stream-chat-angular 2.20.0 → 2.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"stream-chat-angular.js","sources":["../../../projects/stream-chat-angular/src/assets/version.ts","../../../projects/stream-chat-angular/src/lib/notification.service.ts","../../../projects/stream-chat-angular/src/lib/chat-client.service.ts","../../../projects/stream-chat-angular/src/lib/message-preview.ts","../../../projects/stream-chat-angular/src/lib/read-by.ts","../../../projects/stream-chat-angular/src/lib/channel.service.ts","../../../projects/stream-chat-angular/src/lib/theme.service.ts","../../../projects/stream-chat-angular/src/lib/is-image-file.ts","../../../projects/stream-chat-angular/src/lib/is-image-attachment.ts","../../../projects/stream-chat-angular/src/lib/attachment.service.ts","../../../projects/stream-chat-angular/src/assets/i18n/en.ts","../../../projects/stream-chat-angular/src/lib/stream-i18n.service.ts","../../../projects/stream-chat-angular/src/lib/avatar/avatar.component.ts","../../../projects/stream-chat-angular/src/lib/avatar/avatar.component.html","../../../projects/stream-chat-angular/src/lib/icon/icon.component.ts","../../../projects/stream-chat-angular/src/lib/icon/icon.component.html","../../../projects/stream-chat-angular/src/lib/loading-indicator/loading-indicator.component.ts","../../../projects/stream-chat-angular/src/lib/loading-indicator/loading-indicator.component.html","../../../projects/stream-chat-angular/src/lib/injection-tokens.ts","../../../projects/stream-chat-angular/src/lib/message-input/textarea.directive.ts","../../../projects/stream-chat-angular/src/lib/message-input/emoji-input.service.ts","../../../projects/stream-chat-angular/src/lib/message-input/message-input-config.service.ts","../../../projects/stream-chat-angular/src/lib/message-list/image-load.service.ts","../../../projects/stream-chat-angular/src/lib/modal/modal.component.ts","../../../projects/stream-chat-angular/src/lib/modal/modal.component.html","../../../projects/stream-chat-angular/src/lib/attachment-list/attachment-list.component.ts","../../../projects/stream-chat-angular/src/lib/attachment-list/attachment-list.component.html","../../../projects/stream-chat-angular/src/lib/attachment-preview-list/attachment-preview-list.component.ts","../../../projects/stream-chat-angular/src/lib/attachment-preview-list/attachment-preview-list.component.html","../../../projects/stream-chat-angular/src/lib/message-input/message-input.component.ts","../../../projects/stream-chat-angular/src/lib/message-input/message-input.component.html","../../../projects/stream-chat-angular/src/lib/notification/notification.component.ts","../../../projects/stream-chat-angular/src/lib/notification/notification.component.html","../../../projects/stream-chat-angular/src/lib/notification-list/notification-list.component.ts","../../../projects/stream-chat-angular/src/lib/notification-list/notification-list.component.html","../../../projects/stream-chat-angular/src/lib/message-actions-box/message-actions-box.component.ts","../../../projects/stream-chat-angular/src/lib/message-actions-box/message-actions-box.component.html","../../../projects/stream-chat-angular/src/lib/channel/channel.component.ts","../../../projects/stream-chat-angular/src/lib/channel/channel.component.html","../../../projects/stream-chat-angular/src/lib/device-width.ts","../../../projects/stream-chat-angular/src/lib/channel-list/channel-list-toggle.service.ts","../../../projects/stream-chat-angular/src/lib/channel-header/channel-header.component.ts","../../../projects/stream-chat-angular/src/lib/channel-header/channel-header.component.html","../../../projects/stream-chat-angular/src/lib/channel-preview/channel-preview.component.ts","../../../projects/stream-chat-angular/src/lib/channel-preview/channel-preview.component.html","../../../projects/stream-chat-angular/src/lib/channel-list/channel-list.component.ts","../../../projects/stream-chat-angular/src/lib/channel-list/channel-list.component.html","../../../projects/stream-chat-angular/src/lib/message/parse-date.ts","../../../projects/stream-chat-angular/src/lib/message/read-by-text.ts","../../../projects/stream-chat-angular/src/lib/message-reactions/message-reactions.component.ts","../../../projects/stream-chat-angular/src/lib/message-reactions/message-reactions.component.html","../../../projects/stream-chat-angular/src/lib/message/message.component.ts","../../../projects/stream-chat-angular/src/lib/message/message.component.html","../../../projects/stream-chat-angular/src/lib/message-input/textarea/textarea.component.ts","../../../projects/stream-chat-angular/src/lib/message-input/textarea/textarea.component.html","../../../projects/stream-chat-angular/src/lib/transliteration.service.ts","../../../projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts","../../../projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.html","../../../projects/stream-chat-angular/src/lib/message-list/group-styles.ts","../../../projects/stream-chat-angular/src/lib/message-list/message-list.component.ts","../../../projects/stream-chat-angular/src/lib/message-list/message-list.component.html","../../../projects/stream-chat-angular/src/lib/thread/thread.component.ts","../../../projects/stream-chat-angular/src/lib/thread/thread.component.html","../../../projects/stream-chat-angular/src/lib/stream-avatar.module.ts","../../../projects/stream-chat-angular/src/lib/stream-chat.module.ts","../../../projects/stream-chat-angular/src/lib/stream-autocomplete-textarea.module.ts","../../../projects/stream-chat-angular/src/lib/stream-textarea.module.ts","../../../projects/stream-chat-angular/src/public-api.ts","../../../projects/stream-chat-angular/src/stream-chat-angular.ts"],"sourcesContent":["export const version = '2.20.0';\n","import { Injectable, TemplateRef } from '@angular/core';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { NotificationPayload, NotificationType } from './types';\n\n/**\n * The `NotificationService` can be used to add or remove notifications. By default the [`NotificationList`](../components/NotificationListComponent.mdx) component displays the currently active notifications.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class NotificationService {\n /**\n * Emits the currently active [notifications](https://github.com/GetStream/stream-chat-angular/blob/master/projects/stream-chat-angular/src/lib/notification.service.ts).\n */\n notifications$: Observable<NotificationPayload[]>;\n private notificationsSubject = new BehaviorSubject<NotificationPayload[]>([]);\n\n constructor() {\n this.notifications$ = this.notificationsSubject.asObservable();\n }\n\n /**\n * Displays a notification for the given amount of time.\n * @param content The text of the notification or the HTML template for the notification\n * @param type The type of the notification\n * @param timeout The number of milliseconds while the notification should be visible\n * @param translateParams Translation parameters for the `content` (for text notifications)\n * @param templateContext The input of the notification template (for HTML notifications)\n * @returns A method to clear the notification (before the timeout).\n */\n addTemporaryNotification<T>(\n content: string | TemplateRef<T>,\n type: NotificationType = 'error',\n timeout: number = 5000,\n translateParams?: Object,\n templateContext?: T\n ) {\n const notification = this.createNotification<T>(\n content,\n type,\n translateParams,\n templateContext\n );\n const id = setTimeout(\n () => this.removeNotification(notification.id),\n timeout\n );\n notification.dismissFn = () => {\n clearTimeout(id);\n this.removeNotification(notification.id);\n };\n this.notificationsSubject.next([\n ...this.notificationsSubject.getValue(),\n notification,\n ]);\n\n return notification.dismissFn;\n }\n\n /**\n * Displays a notification, that will be visible until it's removed.\n * @param content The text of the notification or the HTML template for the notification\n * @param type The type of the notification\n * @param translateParams Translation parameters for the `content` (for text notifications)\n * @param templateContext The input of the notification template (for HTML notifications)\n * @returns A method to clear the notification.\n */\n addPermanentNotification<\n T = {\n [key: string]: any;\n dismissFn: () => {};\n }\n >(\n content: string | TemplateRef<T>,\n type: NotificationType = 'error',\n translateParams?: Object,\n templateContext?: T\n ) {\n const notification = this.createNotification<T>(\n content,\n type,\n translateParams,\n templateContext\n );\n this.notificationsSubject.next([\n ...this.notificationsSubject.getValue(),\n notification,\n ]);\n\n return notification.dismissFn;\n }\n\n private createNotification<T>(\n content: string | TemplateRef<T>,\n type: NotificationType,\n translateParams?: Object,\n templateContext?: T\n ) {\n const id = new Date().getTime().toString() + Math.random().toString();\n return {\n id,\n [typeof content === 'string' ? 'text' : 'template']: content,\n type,\n translateParams,\n templateContext,\n dismissFn: () => this.removeNotification(id),\n };\n }\n\n private removeNotification(id: string) {\n const notifications = this.notificationsSubject.getValue();\n const index = notifications.findIndex((n) => n.id === id);\n if (index === -1) {\n return;\n }\n notifications.splice(index, 1);\n this.notificationsSubject.next([...notifications]);\n }\n}\n","import { Injectable, NgZone } from '@angular/core';\nimport { BehaviorSubject, Observable, ReplaySubject } from 'rxjs';\nimport {\n Channel,\n ChannelResponse,\n OwnUserResponse,\n UserResponse,\n} from 'stream-chat';\nimport { AppSettings, Event, StreamChat, TokenOrProvider } from 'stream-chat';\nimport { version } from '../assets/version';\nimport { NotificationService } from './notification.service';\n\nexport type Notification = {\n eventType: string;\n event: Event;\n};\n\n/**\n * The `ChatClient` service connects the user to the Stream chat.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class ChatClientService {\n /**\n * The [StreamChat client](https://github.com/GetStream/stream-chat-js/blob/master/src/client.ts) instance. In general you shouldn't need to access the client, but it's there if you want to use it.\n */\n chatClient!: StreamChat;\n /**\n * Emits [`Notification`](https://github.com/GetStream/stream-chat-angular/blob/master/projects/stream-chat-angular/src/lib/chat-client.service.ts) events. The platform documentation covers [the list of client and notification events](https://getstream.io/chat/docs/javascript/event_object/?language=javascript).\n * :::important\n * For performance reasons this Observable operates outside of the Angular change detection zone. If you subscribe to it, you need to manually reenter Angular's change detection zone, our [Change detection guide](../concepts/change-detection.mdx) explains this in detail.\n * :::\n */\n notification$: Observable<Notification>;\n /**\n * Emits the current [application settings](https://getstream.io/chat/docs/javascript/app_setting_overview/?language=javascript). Since getting the application settings is an expensive API call and we don't always need the result, this is not initialized by default, you need to call `getApplicationSettings` to load them.\n */\n appSettings$: Observable<AppSettings | undefined>;\n /**\n * Emits the current connection state of the user (`online` or `offline`)\n */\n connectionState$: Observable<'offline' | 'online'>;\n /**\n * Emits the list of pending invites of the user. It emits every pending invitation during initialization and then extends the list when a new invite is received. More information can be found in the [channel invitations](../code-examples/channel-invites.mdx) guide.\n */\n pendingInvites$: Observable<(ChannelResponse | Channel)[]>;\n private notificationSubject = new ReplaySubject<Notification>(1);\n private connectionStateSubject = new ReplaySubject<'offline' | 'online'>(1);\n private appSettingsSubject = new BehaviorSubject<AppSettings | undefined>(\n undefined\n );\n private pendingInvitesSubject = new BehaviorSubject<\n (ChannelResponse | Channel)[]\n >([]);\n\n constructor(\n private ngZone: NgZone,\n private notificationService: NotificationService\n ) {\n this.notification$ = this.notificationSubject.asObservable();\n this.connectionState$ = this.connectionStateSubject.asObservable();\n this.appSettings$ = this.appSettingsSubject.asObservable();\n this.pendingInvites$ = this.pendingInvitesSubject.asObservable();\n }\n\n /**\n * Creates a [`StreamChat`](https://github.com/GetStream/stream-chat-js/blob/668b3e5521339f4e14fc657834531b4c8bf8176b/src/client.ts#L124) instance using the provided `apiKey`, and connects a user with the given meta data and token. More info about [connecting users](https://getstream.io/chat/docs/javascript/init_and_users/?language=javascript) can be found in the platform documentation.\n * @param apiKey\n * @param userOrId\n * @param userTokenOrProvider\n */\n async init(\n apiKey: string,\n userOrId: string | OwnUserResponse | UserResponse,\n userTokenOrProvider: TokenOrProvider\n ) {\n this.chatClient = StreamChat.getInstance(apiKey);\n this.chatClient.devToken;\n await this.ngZone.runOutsideAngular(async () => {\n const user = typeof userOrId === 'string' ? { id: userOrId } : userOrId;\n await this.chatClient.connectUser(user, userTokenOrProvider);\n this.chatClient.setUserAgent(\n `stream-chat-angular-${version}-${this.chatClient.getUserAgent()}`\n );\n });\n const channels = await this.chatClient.queryChannels(\n { invite: 'pending' },\n {},\n { user_id: this.chatClient.user?.id }\n );\n this.pendingInvitesSubject.next(channels);\n this.appSettingsSubject.next(undefined);\n this.chatClient.on((e) => {\n this.updatePendingInvites(e);\n this.notificationSubject.next({\n eventType: e.type,\n event: e,\n });\n });\n let removeNotification: undefined | Function;\n this.chatClient.on('connection.changed', (e) => {\n this.ngZone.run(() => {\n const isOnline = e.online;\n if (isOnline) {\n if (removeNotification) {\n removeNotification();\n }\n } else {\n removeNotification =\n this.notificationService.addPermanentNotification(\n 'streamChat.Connection failure, reconnecting now...'\n );\n }\n this.connectionStateSubject.next(isOnline ? 'online' : 'offline');\n });\n });\n }\n\n /**\n * Disconnects the current user, and closes the WebSocket connection. Useful when disconnecting a chat user, use in combination with [`reset`](./ChannelService.mdx/#reset).\n */\n async disconnectUser() {\n this.pendingInvitesSubject.next([]);\n await this.chatClient.disconnectUser();\n }\n\n /**\n * Loads the current [application settings](https://getstream.io/chat/docs/javascript/app_setting_overview/?language=javascript), if the application settings have already been loaded, it does nothing.\n */\n async getAppSettings() {\n if (this.appSettingsSubject.getValue()) {\n return;\n }\n const settings = await this.chatClient.getAppSettings();\n this.appSettingsSubject.next(settings.app || {});\n }\n\n /**\n * Flag the message with the given ID. If you want to know [more about flags](https://getstream.io/chat/docs/javascript/moderation/?language=javascript) check out the platform documentation.\n * @param messageId\n */\n async flagMessage(messageId: string) {\n await this.chatClient.flagMessage(messageId);\n }\n\n /**\n * Searches for users in the application that have ID or name matching the provided search term\n * @param searchTerm\n * @returns The users matching the search\n */\n async autocompleteUsers(searchTerm: string) {\n if (!searchTerm) {\n return [];\n }\n const result = await this.chatClient.queryUsers({\n $or: [\n { id: { $autocomplete: searchTerm } },\n { name: { $autocomplete: searchTerm } },\n ],\n id: { $ne: this.chatClient.userID! },\n });\n return result.users;\n }\n\n private updatePendingInvites(e: Event) {\n if (e.member?.user?.id === this.chatClient.user?.id && e.channel) {\n const pendingInvites = this.pendingInvitesSubject.getValue();\n if (e.type === 'notification.invited') {\n this.pendingInvitesSubject.next([...pendingInvites, e.channel]);\n } else if (\n e.type === 'notification.invite_accepted' ||\n e.type === 'notification.invite_rejected'\n ) {\n const index = pendingInvites.findIndex(\n (i) => i?.cid === e.channel?.cid\n );\n if (index !== -1) {\n pendingInvites.splice(index, 1);\n this.pendingInvitesSubject.next([...pendingInvites]);\n }\n }\n }\n }\n}\n","import { Attachment, MessageResponse, UserResponse } from 'stream-chat';\nimport { v4 as uuidv4 } from 'uuid';\n\nexport const createMessagePreview = (\n user: UserResponse,\n text: string,\n attachments: Attachment[] = [],\n mentionedUsers: UserResponse[] = [],\n parentId: undefined | string = undefined,\n quotedMessageId: undefined | string = undefined\n) => {\n const clientSideId = `${user.id}-${uuidv4()}`;\n\n return {\n __html: text,\n created_at: new Date(),\n html: text,\n id: clientSideId,\n reactions: [],\n status: 'sending',\n text,\n type: 'regular',\n user,\n attachments,\n mentioned_users: mentionedUsers,\n parent_id: parentId,\n quoted_message_id: quotedMessageId,\n } as unknown as MessageResponse;\n};\n","import { Channel, FormatMessageResponse, UserResponse } from 'stream-chat';\n\nexport const getReadBy = (message: FormatMessageResponse, channel: Channel) => {\n const readBy: UserResponse[] = [];\n Object.keys(channel.state.read).forEach((key) => {\n if (\n channel.state.read[key].last_read.getTime() >=\n message.updated_at.getTime() &&\n message.user?.id !== key\n ) {\n readBy.push(channel.state.read[key].user);\n }\n });\n\n return readBy;\n};\n","import { Injectable, NgZone } from '@angular/core';\nimport {\n BehaviorSubject,\n combineLatest,\n Observable,\n ReplaySubject,\n} from 'rxjs';\nimport { filter, first, map, shareReplay } from 'rxjs/operators';\nimport {\n Attachment,\n Channel,\n ChannelFilters,\n ChannelOptions,\n ChannelResponse,\n ChannelSort,\n Event,\n FormatMessageResponse,\n MessageResponse,\n UpdatedMessage,\n UserResponse,\n} from 'stream-chat';\nimport { ChatClientService, Notification } from './chat-client.service';\nimport { createMessagePreview } from './message-preview';\nimport { MessageReactionType } from './message-reactions/message-reactions.component';\nimport { getReadBy } from './read-by';\nimport { AttachmentUpload, StreamMessage } from './types';\n\n/**\n * The `ChannelService` provides data and interaction for the channel list and message list. TEST\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class ChannelService {\n /**\n * Emits `false` if there are no more pages of channels that can be loaded.\n */\n hasMoreChannels$: Observable<boolean>;\n /**\n * Emits the currently loaded and [watched](https://getstream.io/chat/docs/javascript/watch_channel/?language=javascript) channel list.\n *\n * :::important\n * If you want to subscribe to channel events, you need to manually reenter Angular's change detection zone, our [Change detection guide](../concepts/change-detection.mdx) explains this in detail.\n * :::\n *\n * Apart from pagination, the channel list is also updated on the following events:\n *\n * | Event type | Default behavior | Custom handler to override |\n * | ----------------------------------- | ------------------------------------------------------------------ | --------------------------------------------- |\n * | `channel.deleted` | Remove channel from the list | `customChannelDeletedHandler` |\n * | `channel.hidden` | Remove channel from the list | `customChannelHiddenHandler` |\n * | `channel.truncated` | Updates the channel | `customChannelTruncatedHandler` |\n * | `channel.updated` | Updates the channel | `customChannelUpdatedHandler` |\n * | `channel.visible` | Adds the channel to the list | `customChannelVisibleHandler` |\n * | `message.new` | Moves the channel to top of the list | `customNewMessageHandler` |\n * | `notification.added_to_channel` | Adds the new channel to the top of the list and starts watching it | `customAddedToChannelNotificationHandler` |\n * | `notification.message_new` | Adds the new channel to the top of the list and starts watching it | `customNewMessageNotificationHandler` |\n * | `notification.removed_from_channel` | Removes the channel from the list | `customRemovedFromChannelNotificationHandler` |\n *\n * It's important to note that filters don't apply to updates to the list from events.\n *\n * Our platform documentation covers the topic of [channel events](https://getstream.io/chat/docs/javascript/event_object/?language=javascript#events) in depth.\n */\n channels$: Observable<Channel[] | undefined>;\n /**\n * Emits the currently active channel.\n *\n * :::important\n * If you want to subscribe to channel events, you need to manually reenter Angular's change detection zone, our [Change detection guide](../concepts/change-detection.mdx) explains this in detail.\n * :::\n */\n activeChannel$: Observable<Channel | undefined>;\n /**\n * Emits the list of currently loaded messages of the active channel.\n */\n activeChannelMessages$: Observable<StreamMessage[]>;\n /**\n * Emits the id of the currently selected parent message. If no message is selected, it emits undefined.\n */\n activeParentMessageId$: Observable<string | undefined>;\n /**\n * Emits the list of currently loaded thread replies belonging to the selected parent message. If there is no currently active thread it emits an empty array.\n */\n activeThreadMessages$: Observable<StreamMessage[]>;\n /**\n * Emits the currently selected parent message. If no message is selected, it emits undefined.\n */\n activeParentMessage$: Observable<StreamMessage | undefined>;\n /**\n * Emits the currently selected message to quote\n */\n messageToQuote$: Observable<StreamMessage | undefined>;\n /**\n * Emits the list of users that are currently typing in the channel (current user is not included)\n */\n usersTypingInChannel$: Observable<UserResponse[]>;\n /**\n * Emits the list of users that are currently typing in the active thread (current user is not included)\n */\n usersTypingInThread$: Observable<UserResponse[]>;\n /**\n * Emits a map that contains the date of the latest message sent by the current user by channels (this is used to detect if slow mode countdown should be started)\n */\n latestMessageDateByUserByChannels$: Observable<{ [key: string]: Date }>;\n /**\n * Custom event handler to call if a new message received from a channel that is not being watched, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customNewMessageNotificationHandler?: (\n notification: Notification,\n channelListSetter: (channels: (Channel | ChannelResponse)[]) => void\n ) => void;\n /**\n * Custom event handler to call when the user is added to a channel, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customAddedToChannelNotificationHandler?: (\n notification: Notification,\n channelListSetter: (channels: (Channel | ChannelResponse)[]) => void\n ) => void;\n /**\n * Custom event handler to call when the user is removed from a channel, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customRemovedFromChannelNotificationHandler?: (\n notification: Notification,\n channelListSetter: (channels: (Channel | ChannelResponse)[]) => void\n ) => void;\n /**\n * Custom event handler to call when a channel is deleted, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customChannelDeletedHandler?: (\n event: Event,\n channel: Channel,\n channelListSetter: (channels: (Channel | ChannelResponse)[]) => void,\n messageListSetter: (messages: StreamMessage[]) => void,\n threadListSetter: (messages: StreamMessage[]) => void,\n parentMessageSetter: (message: StreamMessage | undefined) => void\n ) => void;\n /**\n * Custom event handler to call when a channel is updated, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customChannelUpdatedHandler?: (\n event: Event,\n channel: Channel,\n channelListSetter: (channels: (Channel | ChannelResponse)[]) => void,\n messageListSetter: (messages: StreamMessage[]) => void,\n threadListSetter: (messages: StreamMessage[]) => void,\n parentMessageSetter: (message: StreamMessage | undefined) => void\n ) => void;\n /**\n * Custom event handler to call when a channel is truncated, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customChannelTruncatedHandler?: (\n event: Event,\n channel: Channel,\n channelListSetter: (channels: (Channel | ChannelResponse)[]) => void,\n messageListSetter: (messages: StreamMessage[]) => void,\n threadListSetter: (messages: StreamMessage[]) => void,\n parentMessageSetter: (message: StreamMessage | undefined) => void\n ) => void;\n /**\n * Custom event handler to call when a channel becomes hidden, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customChannelHiddenHandler?: (\n event: Event,\n channel: Channel,\n channelListSetter: (channels: (Channel | ChannelResponse)[]) => void,\n messageListSetter: (messages: StreamMessage[]) => void,\n threadListSetter: (messages: StreamMessage[]) => void,\n parentMessageSetter: (message: StreamMessage | undefined) => void\n ) => void;\n /**\n * Custom event handler to call when a channel becomes visible, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customChannelVisibleHandler?: (\n event: Event,\n channel: Channel,\n channelListSetter: (channels: (Channel | ChannelResponse)[]) => void,\n messageListSetter: (messages: StreamMessage[]) => void,\n threadListSetter: (messages: StreamMessage[]) => void,\n parentMessageSetter: (message: StreamMessage | undefined) => void\n ) => void;\n /**\n * Custom event handler to call if a new message received from a channel that is being watched, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customNewMessageHandler?: (\n event: Event,\n channel: Channel,\n channelListSetter: (channels: (Channel | ChannelResponse)[]) => void,\n messageListSetter: (messages: StreamMessage[]) => void,\n threadListSetter: (messages: StreamMessage[]) => void,\n parentMessageSetter: (message: StreamMessage | undefined) => void\n ) => void;\n private channelsSubject = new BehaviorSubject<Channel[] | undefined>(\n undefined\n );\n private activeChannelSubject = new BehaviorSubject<Channel | undefined>(\n undefined\n );\n private activeChannelMessagesSubject = new BehaviorSubject<\n (StreamMessage | MessageResponse | FormatMessageResponse)[]\n >([]);\n private hasMoreChannelsSubject = new ReplaySubject<boolean>(1);\n private activeChannelSubscriptions: { unsubscribe: () => void }[] = [];\n private activeParentMessageIdSubject = new BehaviorSubject<\n string | undefined\n >(undefined);\n private activeThreadMessagesSubject = new BehaviorSubject<\n (StreamMessage | MessageResponse | FormatMessageResponse)[]\n >([]);\n private latestMessageDateByUserByChannelsSubject = new BehaviorSubject<{\n [key: string]: Date;\n }>({});\n private filters: ChannelFilters | undefined;\n private sort: ChannelSort | undefined;\n private options: ChannelOptions | undefined;\n private readonly messagePageSize = 25;\n private messageToQuoteSubject = new BehaviorSubject<\n StreamMessage | undefined\n >(undefined);\n private usersTypingInChannelSubject = new BehaviorSubject<UserResponse[]>([]);\n private usersTypingInThreadSubject = new BehaviorSubject<UserResponse[]>([]);\n\n private channelListSetter = (channels: (Channel | ChannelResponse)[]) => {\n const currentChannels = this.channelsSubject.getValue() || [];\n const newChannels = channels.filter(\n (c) => !currentChannels.find((channel) => channel.cid === c.cid)\n );\n const deletedChannels = currentChannels.filter(\n (c) => !channels?.find((channel) => channel.cid === c.cid)\n );\n this.addChannelsFromNotification(newChannels as ChannelResponse[]);\n this.removeChannelsFromChannelList(deletedChannels.map((c) => c.cid));\n if (!newChannels.length && !deletedChannels.length) {\n this.channelsSubject.next(channels as Channel[]);\n }\n };\n\n private messageListSetter = (messages: StreamMessage[]) => {\n this.activeChannelMessagesSubject.next(messages);\n };\n\n private threadListSetter = (messages: StreamMessage[]) => {\n this.activeThreadMessagesSubject.next(messages);\n };\n\n private parentMessageSetter = (message: StreamMessage | undefined) => {\n this.activeParentMessageIdSubject.next(message?.id);\n };\n\n constructor(\n private chatClientService: ChatClientService,\n private ngZone: NgZone\n ) {\n this.channels$ = this.channelsSubject.asObservable();\n this.activeChannel$ = this.activeChannelSubject.asObservable();\n this.activeChannelMessages$ = this.activeChannelMessagesSubject.pipe(\n map((messages) => {\n const channel = this.activeChannelSubject.getValue()!;\n return messages.map((message) =>\n this.transformToStreamMessage(message, channel)\n );\n })\n );\n this.hasMoreChannels$ = this.hasMoreChannelsSubject.asObservable();\n this.activeParentMessageId$ =\n this.activeParentMessageIdSubject.asObservable();\n this.activeThreadMessages$ = this.activeThreadMessagesSubject.pipe(\n map((messages) => {\n const channel = this.activeChannelSubject.getValue()!;\n return messages.map((message) =>\n this.transformToStreamMessage(message, channel)\n );\n })\n );\n this.activeParentMessage$ = combineLatest([\n this.activeChannelMessages$,\n this.activeParentMessageId$,\n ]).pipe(\n map(\n ([messages, parentMessageId]: [\n StreamMessage[],\n string | undefined\n ]) => {\n if (!parentMessageId) {\n return undefined;\n } else {\n return messages.find((m) => m.id === parentMessageId);\n }\n }\n ),\n shareReplay()\n );\n this.messageToQuote$ = this.messageToQuoteSubject.asObservable();\n\n this.chatClientService.connectionState$\n .pipe(filter((s) => s === 'online'))\n .subscribe(() => {\n void this.setAsActiveParentMessage(undefined);\n });\n\n this.usersTypingInChannel$ =\n this.usersTypingInChannelSubject.asObservable();\n this.usersTypingInThread$ = this.usersTypingInThreadSubject.asObservable();\n this.latestMessageDateByUserByChannels$ =\n this.latestMessageDateByUserByChannelsSubject.asObservable();\n }\n\n /**\n * Sets the given `channel` as active.\n * @param channel\n */\n setAsActiveChannel(channel: Channel) {\n const prevActiveChannel = this.activeChannelSubject.getValue();\n this.stopWatchForActiveChannelEvents(prevActiveChannel);\n this.watchForActiveChannelEvents(channel);\n this.activeChannelSubject.next(channel);\n channel.state.messages.forEach((m) => {\n m.readBy = getReadBy(m, channel);\n });\n if (this.canSendReadEvents) {\n void channel.markRead();\n }\n this.activeChannelMessagesSubject.next([...channel.state.messages]);\n this.activeParentMessageIdSubject.next(undefined);\n this.activeThreadMessagesSubject.next([]);\n this.messageToQuoteSubject.next(undefined);\n }\n\n /**\n * Sets the given `message` as an active parent message. If `undefined` is provided, it will deleselect the current parent message.\n * @param message\n */\n async setAsActiveParentMessage(message: StreamMessage | undefined) {\n const messageToQuote = this.messageToQuoteSubject.getValue();\n if (messageToQuote && !!messageToQuote.parent_id) {\n this.messageToQuoteSubject.next(undefined);\n }\n if (!message) {\n this.activeParentMessageIdSubject.next(undefined);\n this.activeThreadMessagesSubject.next([]);\n } else {\n this.activeParentMessageIdSubject.next(message.id);\n const activeChannel = this.activeChannelSubject.getValue();\n const result = await activeChannel?.getReplies(message.id, {\n limit: this.options?.message_limit,\n });\n this.activeThreadMessagesSubject.next(result?.messages || []);\n }\n }\n\n /**\n * Loads the next page of messages of the active channel. The page size can be set in the [query option](https://getstream.io/chat/docs/javascript/query_channels/?language=javascript#query-options) object.\n */\n async loadMoreMessages() {\n const activeChnannel = this.activeChannelSubject.getValue();\n const lastMessageId = this.activeChannelMessagesSubject.getValue()[0]?.id;\n await activeChnannel?.query({\n messages: { limit: this.options?.message_limit, id_lt: lastMessageId },\n members: { limit: 0 },\n watchers: { limit: 0 },\n });\n if (\n activeChnannel?.data?.id ===\n this.activeChannelSubject.getValue()?.data?.id\n ) {\n this.activeChannelMessagesSubject.next([\n ...activeChnannel!.state.messages,\n ]);\n }\n }\n\n /**\n * Loads the next page of messages of the active thread. The page size can be set in the [query option](https://getstream.io/chat/docs/javascript/query_channels/?language=javascript#query-options) object.\n */\n async loadMoreThreadReplies() {\n const activeChnannel = this.activeChannelSubject.getValue();\n const parentMessageId = this.activeParentMessageIdSubject.getValue();\n if (!parentMessageId) {\n return;\n }\n const lastMessageId = this.activeThreadMessagesSubject.getValue()[0]?.id;\n await activeChnannel?.getReplies(parentMessageId, {\n limit: this.options?.message_limit,\n id_lt: lastMessageId,\n });\n this.activeThreadMessagesSubject.next(\n activeChnannel?.state.threads[parentMessageId] || []\n );\n }\n\n /**\n * Queries the channels with the given filters, sorts and options. More info about [channel querying](https://getstream.io/chat/docs/javascript/query_channels/?language=javascript) can be found in the platform documentation.\n * @param filters\n * @param sort\n * @param options\n */\n async init(\n filters: ChannelFilters,\n sort?: ChannelSort,\n options?: ChannelOptions\n ) {\n this.filters = filters;\n this.options = options || {\n offset: 0,\n limit: 25,\n state: true,\n presence: true,\n watch: true,\n message_limit: this.messagePageSize,\n };\n this.sort = sort || { last_message_at: -1, updated_at: -1 };\n await this.queryChannels();\n this.chatClientService.notification$.subscribe(\n (notification) => void this.handleNotification(notification)\n );\n }\n\n /**\n * Resets the `activeChannel$`, `channels$` and `activeChannelMessages$` Observables. Useful when disconnecting a chat user, use in combination with [`disconnectUser`](./ChatClientService.mdx/#disconnectuser).\n */\n reset() {\n this.activeChannelMessagesSubject.next([]);\n this.activeChannelSubject.next(undefined);\n this.activeParentMessageIdSubject.next(undefined);\n this.activeThreadMessagesSubject.next([]);\n this.channelsSubject.next(undefined);\n this.latestMessageDateByUserByChannelsSubject.next({});\n this.selectMessageToQuote(undefined);\n }\n\n /**\n * Loads the next page of channels. The page size can be set in the [query option](https://getstream.io/chat/docs/javascript/query_channels/?language=javascript#query-options) object.\n */\n async loadMoreChannels() {\n this.options!.offset = this.channels.length!;\n await this.queryChannels();\n }\n\n /**\n * Adds a reaction to a message.\n * @param messageId The id of the message to add the reaction to\n * @param reactionType The type of the reaction\n */\n async addReaction(messageId: string, reactionType: MessageReactionType) {\n await this.activeChannelSubject.getValue()?.sendReaction(messageId, {\n type: reactionType,\n });\n }\n\n /**\n * Removes a reaction from a message.\n * @param messageId The id of the message to remove the reaction from\n * @param reactionType Thr type of reaction to remove\n */\n async removeReaction(messageId: string, reactionType: MessageReactionType) {\n await this.activeChannelSubject\n .getValue()\n ?.deleteReaction(messageId, reactionType);\n }\n\n /**\n * Sends a message to the active channel. The message is immediately added to the message list, if an error occurs and the message can't be sent, the error is indicated in `state` of the message.\n * @param text The text of the message\n * @param attachments The attachments\n * @param mentionedUsers Mentioned users\n * @param parentId Id of the parent message (if sending a thread reply)\n * @param quotedMessageId Id of the message to quote (if sending a quote reply)\n */\n async sendMessage(\n text: string,\n attachments: Attachment[] = [],\n mentionedUsers: UserResponse[] = [],\n parentId: string | undefined = undefined,\n quotedMessageId: string | undefined = undefined\n ) {\n const preview = createMessagePreview(\n this.chatClientService.chatClient.user!,\n text,\n attachments,\n mentionedUsers,\n parentId,\n quotedMessageId\n );\n const channel = this.activeChannelSubject.getValue()!;\n preview.readBy = [];\n channel.state.addMessageSorted(preview, true);\n await this.sendMessageRequest(preview);\n }\n\n /**\n * Resends the given message to the active channel\n * @param message The message to resend\n */\n async resendMessage(message: StreamMessage) {\n const channel = this.activeChannelSubject.getValue()!;\n channel.state.addMessageSorted(\n {\n ...(message as any as MessageResponse),\n errorStatusCode: undefined,\n status: 'sending',\n },\n true\n );\n await this.sendMessageRequest(message);\n }\n\n /**\n * Updates the message in the active channel\n * @param message Mesage to be updated\n */\n async updateMessage(message: StreamMessage) {\n await this.chatClientService.chatClient.updateMessage(\n message as UpdatedMessage\n );\n }\n\n /**\n * Deletes the message from the active channel\n * @param message Message to be deleted\n */\n async deleteMessage(message: StreamMessage) {\n await this.chatClientService.chatClient.deleteMessage(message.id);\n }\n\n /**\n * Uploads files to the channel. If you want to know more about [file uploads](https://getstream.io/chat/docs/javascript/file_uploads/?language=javascript) check out the platform documentation.\n * @param uploads the attachments to upload (output of the [`AttachmentService`](./AttachmentService.mdx))\n * @returns the result of file upload requests\n */\n async uploadAttachments(\n uploads: AttachmentUpload[]\n ): Promise<AttachmentUpload[]> {\n const result: AttachmentUpload[] = [];\n const channel = this.activeChannelSubject.getValue()!;\n const uploadResults = await Promise.allSettled(\n uploads.map((upload) =>\n upload.type === 'image'\n ? channel.sendImage(upload.file)\n : channel.sendFile(upload.file)\n )\n );\n uploadResults.forEach((uploadResult, i) => {\n const file = uploads[i].file;\n const type = uploads[i].type;\n if (uploadResult.status === 'fulfilled') {\n result.push({\n file,\n type,\n state: 'success',\n url: uploadResult.value.file,\n });\n } else {\n result.push({ file, type, state: 'error' });\n }\n });\n\n return result;\n }\n\n /**\n * Deletes an uploaded file by URL. If you want to know more about [file uploads](https://getstream.io/chat/docs/javascript/file_uploads/?language=javascript) check out the platform documentation\n * @param attachmentUpload Attachment to be deleted (output of the [`AttachmentService`](./AttachmentService.mdx))\n */\n async deleteAttachment(attachmentUpload: AttachmentUpload) {\n const channel = this.activeChannelSubject.getValue()!;\n await (attachmentUpload.type === 'image'\n ? channel.deleteImage(attachmentUpload.url!)\n : channel.deleteFile(attachmentUpload.url!));\n }\n\n /**\n * Returns the autocomplete options for current channel members. If the channel has less than 100 members, it returns the channel members, otherwise sends a [search request](https://getstream.io/chat/docs/javascript/query_members/?language=javascript#pagination-and-ordering) with the given search term.\n * @param searchTerm Text to search for in the names of members\n * @returns The list of members matching the search filter\n */\n async autocompleteMembers(searchTerm: string) {\n const activeChannel = this.activeChannelSubject.getValue();\n if (!activeChannel) {\n return [];\n }\n if (Object.keys(activeChannel.state.members).length <= 100) {\n return Object.values(activeChannel.state.members).filter(\n (m) => m.user?.id !== this.chatClientService.chatClient.userID!\n );\n } else {\n if (!searchTerm) {\n return [];\n }\n const result = await activeChannel.queryMembers({\n name: { $autocomplete: searchTerm },\n id: { $ne: this.chatClientService.chatClient.userID! },\n });\n return Object.values(result.members);\n }\n }\n\n /**\n * [Runs a message action](https://getstream.io/chat/docs/rest/#messages-runmessageaction) in the current channel. Updates the message list based on the action result (if no message is returned, the message will be removed from the message list).\n * @param messageId\n * @param formData\n */\n async sendAction(messageId: string, formData: Record<string, string>) {\n const channel = this.activeChannelSubject.getValue()!;\n const response = await channel.sendAction(messageId, formData);\n if (response?.message) {\n channel.state.addMessageSorted({\n ...response.message,\n status: 'received',\n });\n const isThreadReply = !!response.message.parent_id;\n isThreadReply\n ? this.activeThreadMessagesSubject.next([\n ...channel.state.threads[response.message.parent_id!],\n ])\n : this.activeChannelMessagesSubject.next([...channel.state.messages]);\n } else {\n channel.state.removeMessage({ id: messageId });\n if (\n this.activeChannelMessagesSubject\n .getValue()\n .find((m) => m.id === messageId)\n ) {\n this.activeChannelMessagesSubject.next([...channel.state.messages]);\n } else if (\n this.activeThreadMessagesSubject\n .getValue()\n .find((m) => m.id === messageId)\n ) {\n this.activeThreadMessagesSubject.next(\n channel.state.threads[this.activeParentMessageIdSubject.getValue()!]\n );\n }\n }\n }\n\n /**\n * Selects or deselects the current message to quote reply to\n * @param message The message to select, if called with `undefined`, it deselects the message\n */\n selectMessageToQuote(message: StreamMessage | undefined) {\n this.messageToQuoteSubject.next(message);\n }\n\n private async sendMessageRequest(preview: MessageResponse | StreamMessage) {\n const channel = this.activeChannelSubject.getValue()!;\n const isThreadReply = !!preview.parent_id;\n isThreadReply\n ? this.activeThreadMessagesSubject.next([\n ...channel.state.threads[preview.parent_id!],\n ])\n : this.activeChannelMessagesSubject.next([...channel.state.messages]);\n try {\n const response = await channel.sendMessage({\n text: preview.text,\n attachments: preview.attachments,\n mentioned_users: preview.mentioned_users?.map((u) => u.id),\n id: preview.id,\n parent_id: preview.parent_id,\n quoted_message_id: preview.quoted_message_id,\n });\n if (response?.message) {\n channel.state.addMessageSorted(\n {\n ...response.message,\n status: 'received',\n },\n true\n );\n isThreadReply\n ? this.activeThreadMessagesSubject.next([\n ...channel.state.threads[preview.parent_id!],\n ])\n : this.activeChannelMessagesSubject.next([...channel.state.messages]);\n }\n } catch (error) {\n const stringError = JSON.stringify(error);\n const parsedError: { status?: number } = stringError\n ? (JSON.parse(stringError) as { status?: number })\n : {};\n\n channel.state.addMessageSorted(\n {\n ...(preview as MessageResponse),\n errorStatusCode: parsedError.status || undefined,\n status: 'failed',\n },\n true\n );\n isThreadReply\n ? this.activeThreadMessagesSubject.next([\n ...channel.state.threads[preview.parent_id!],\n ])\n : this.activeChannelMessagesSubject.next([...channel.state.messages]);\n }\n }\n\n private handleNotification(notification: Notification) {\n switch (notification.eventType) {\n case 'notification.message_new': {\n this.ngZone.run(() => {\n if (this.customNewMessageNotificationHandler) {\n this.customNewMessageNotificationHandler(\n notification,\n this.channelListSetter\n );\n } else {\n this.handleNewMessageNotification(notification);\n }\n });\n break;\n }\n case 'notification.added_to_channel': {\n this.ngZone.run(() => {\n if (this.customAddedToChannelNotificationHandler) {\n this.customAddedToChannelNotificationHandler(\n notification,\n this.channelListSetter\n );\n } else {\n this.handleAddedToChannelNotification(notification);\n }\n });\n break;\n }\n case 'notification.removed_from_channel': {\n this.ngZone.run(() => {\n if (this.customRemovedFromChannelNotificationHandler) {\n this.customRemovedFromChannelNotificationHandler(\n notification,\n this.channelListSetter\n );\n } else {\n this.handleRemovedFromChannelNotification(notification);\n }\n });\n }\n }\n }\n\n private handleRemovedFromChannelNotification(notification: Notification) {\n const channelIdToBeRemoved = notification.event.channel!.cid;\n this.removeChannelsFromChannelList([channelIdToBeRemoved]);\n }\n\n private handleNewMessageNotification(notification: Notification) {\n if (notification.event.channel) {\n this.addChannelsFromNotification([notification.event.channel]);\n }\n }\n\n private handleAddedToChannelNotification(notification: Notification) {\n if (notification.event.channel) {\n this.addChannelsFromNotification([notification.event.channel]);\n }\n }\n\n private addChannelsFromNotification(channelResponses: ChannelResponse[]) {\n const newChannels: Channel[] = [];\n channelResponses.forEach((channelResponse) => {\n const channel = this.chatClientService.chatClient.channel(\n channelResponse.type,\n channelResponse.id\n );\n void channel.watch();\n this.watchForChannelEvents(channel);\n newChannels.push(channel);\n });\n this.channelsSubject.next([\n ...newChannels,\n ...(this.channelsSubject.getValue() || []),\n ]);\n }\n\n private removeChannelsFromChannelList(cids: string[]) {\n const channels = this.channels.filter((c) => !cids.includes(c.cid || ''));\n if (channels.length < this.channels.length) {\n this.channelsSubject.next(channels);\n if (cids.includes(this.activeChannelSubject.getValue()?.cid || '')) {\n if (channels.length > 0) {\n this.setAsActiveChannel(channels[0]);\n } else {\n this.activeChannelSubject.next(undefined);\n }\n }\n }\n }\n\n private watchForActiveChannelEvents(channel: Channel) {\n this.activeChannelSubscriptions.push(\n channel.on('message.new', (event) => {\n this.ngZone.run(() => {\n event.message && event.message.parent_id\n ? this.activeThreadMessagesSubject.next([\n ...channel.state.threads[event.message.parent_id],\n ])\n : this.activeChannelMessagesSubject.next([\n ...channel.state.messages,\n ]);\n this.activeChannel$.pipe(first()).subscribe((c) => {\n if (this.canSendReadEvents) {\n void c?.markRead();\n }\n });\n this.updateLatestMessages(event);\n });\n })\n );\n this.activeChannelSubscriptions.push(\n channel.on('message.updated', (event) => this.messageUpdated(event))\n );\n this.activeChannelSubscriptions.push(\n channel.on('message.deleted', (event) => this.messageUpdated(event))\n );\n this.activeChannelSubscriptions.push(\n channel.on('reaction.new', (e) => this.messageReactionEventReceived(e))\n );\n this.activeChannelSubscriptions.push(\n channel.on('reaction.deleted', (e) =>\n this.messageReactionEventReceived(e)\n )\n );\n this.activeChannelSubscriptions.push(\n channel.on('reaction.updated', (e) =>\n this.messageReactionEventReceived(e)\n )\n );\n this.activeChannelSubscriptions.push(\n channel.on('message.read', (e) => {\n this.ngZone.run(() => {\n let latestMessage!: StreamMessage;\n this.activeChannelMessages$.pipe(first()).subscribe((messages) => {\n latestMessage = messages[messages.length - 1];\n });\n if (!latestMessage || !e.user) {\n return;\n }\n latestMessage.readBy = getReadBy(latestMessage, channel);\n\n this.activeChannelMessagesSubject.next(\n this.activeChannelMessagesSubject.getValue()\n );\n });\n })\n );\n this.activeChannelSubscriptions.push(\n channel.on('typing.start', (e) =>\n this.ngZone.run(() => this.handleTypingStartEvent(e))\n )\n );\n this.activeChannelSubscriptions.push(\n channel.on('typing.stop', (e) =>\n this.ngZone.run(() => this.handleTypingStopEvent(e))\n )\n );\n }\n\n /**\n * Call this method if user started typing in the active channel\n * @param parentId The id of the parent message, if user is typing in a thread\n */\n async typingStarted(parentId?: string) {\n const activeChannel = this.activeChannelSubject.getValue();\n await activeChannel?.keystroke(parentId);\n }\n\n /**\n * Call this method if user stopped typing in the active channel\n * @param parentId The id of the parent message, if user were typing in a thread\n */\n async typingStopped(parentId?: string) {\n const activeChannel = this.activeChannelSubject.getValue();\n await activeChannel?.stopTyping(parentId);\n }\n\n private messageUpdated(event: Event) {\n this.ngZone.run(() => {\n const isThreadReply = event.message && event.message.parent_id;\n const messages = isThreadReply\n ? this.activeThreadMessagesSubject.getValue()\n : this.activeChannelMessagesSubject.getValue();\n const messageIndex = messages.findIndex(\n (m) => m.id === event.message?.id\n );\n if (messageIndex !== -1 && event.message) {\n messages[messageIndex] = event.message;\n isThreadReply\n ? this.activeThreadMessagesSubject.next([...messages])\n : this.activeChannelMessagesSubject.next([...messages]);\n }\n });\n }\n\n private messageReactionEventReceived(e: Event) {\n this.ngZone.run(() => {\n const isThreadMessage = e.message && e.message.parent_id;\n let messages!: StreamMessage[];\n (isThreadMessage\n ? this.activeThreadMessages$\n : this.activeChannelMessages$\n )\n .pipe(first())\n .subscribe((m) => (messages = m));\n const message = messages.find((m) => m.id === e?.message?.id);\n if (!message) {\n return;\n }\n message.reaction_counts = { ...e.message?.reaction_counts };\n message.reaction_scores = { ...e.message?.reaction_scores };\n message.latest_reactions = [...(e.message?.latest_reactions || [])];\n message.own_reactions = [...(e.message?.own_reactions || [])];\n isThreadMessage\n ? this.activeThreadMessagesSubject.next([...messages])\n : this.activeChannelMessagesSubject.next([...messages]);\n });\n }\n\n private formatMessage(message: MessageResponse) {\n return {\n ...message,\n // parse the date..\n pinned_at: message.pinned_at ? new Date(message.pinned_at) : null,\n created_at: message.created_at\n ? new Date(message.created_at)\n : new Date(),\n updated_at: message.updated_at\n ? new Date(message.updated_at)\n : new Date(),\n status: message.status || 'received',\n };\n }\n\n private isStreamMessage(\n message: StreamMessage | FormatMessageResponse | MessageResponse\n ): message is StreamMessage {\n return !!message.readBy;\n }\n\n private isFormatMessageResponse(\n message: StreamMessage | FormatMessageResponse | MessageResponse\n ): message is FormatMessageResponse {\n return message.created_at instanceof Date;\n }\n\n private stopWatchForActiveChannelEvents(channel: Channel | undefined) {\n if (!channel) {\n return;\n }\n this.activeChannelSubscriptions.forEach((s) => s.unsubscribe());\n this.activeChannelSubscriptions = [];\n }\n\n private async queryChannels() {\n try {\n const channels = await this.chatClientService.chatClient.queryChannels(\n this.filters!,\n this.sort,\n this.options\n );\n channels.forEach((c) => this.watchForChannelEvents(c));\n const prevChannels = this.channelsSubject.getValue() || [];\n this.channelsSubject.next([...prevChannels, ...channels]);\n if (channels.length > 0 && !this.activeChannelSubject.getValue()) {\n this.setAsActiveChannel(channels[0]);\n }\n this.hasMoreChannelsSubject.next(channels.length >= this.options!.limit!);\n } catch (error) {\n this.channelsSubject.error(error);\n }\n }\n\n private watchForChannelEvents(channel: Channel) {\n channel.on((event: Event) => {\n switch (event.type) {\n case 'message.new': {\n this.ngZone.run(() => {\n if (this.customNewMessageHandler) {\n this.customNewMessageHandler(\n event,\n channel,\n this.channelListSetter,\n this.messageListSetter,\n this.threadListSetter,\n this.parentMessageSetter\n );\n } else {\n this.handleNewMessage(event, channel);\n }\n });\n break;\n }\n case 'channel.hidden': {\n this.ngZone.run(() => {\n if (this.customChannelHiddenHandler) {\n this.customChannelHiddenHandler(\n event,\n channel,\n this.channelListSetter,\n this.messageListSetter,\n this.threadListSetter,\n this.parentMessageSetter\n );\n } else {\n this.handleChannelHidden(event);\n }\n });\n break;\n }\n case 'channel.deleted': {\n this.ngZone.run(() => {\n if (this.customChannelDeletedHandler) {\n this.customChannelDeletedHandler(\n event,\n channel,\n this.channelListSetter,\n this.messageListSetter,\n this.threadListSetter,\n this.parentMessageSetter\n );\n } else {\n this.handleChannelDeleted(event);\n }\n });\n break;\n }\n case 'channel.visible': {\n this.ngZone.run(() => {\n if (this.customChannelVisibleHandler) {\n this.customChannelVisibleHandler(\n event,\n channel,\n this.channelListSetter,\n this.messageListSetter,\n this.threadListSetter,\n this.parentMessageSetter\n );\n } else {\n this.handleChannelVisible(event, channel);\n }\n });\n break;\n }\n case 'channel.updated': {\n this.ngZone.run(() => {\n if (this.customChannelUpdatedHandler) {\n this.customChannelUpdatedHandler(\n event,\n channel,\n this.channelListSetter,\n this.messageListSetter,\n this.threadListSetter,\n this.parentMessageSetter\n );\n } else {\n this.handleChannelUpdate(event);\n }\n });\n break;\n }\n case 'channel.truncated': {\n this.ngZone.run(() => {\n if (this.customChannelTruncatedHandler) {\n this.customChannelTruncatedHandler(\n event,\n channel,\n this.channelListSetter,\n this.messageListSetter,\n this.threadListSetter,\n this.parentMessageSetter\n );\n } else {\n this.handleChannelTruncate(event);\n }\n });\n break;\n }\n }\n });\n }\n\n private handleNewMessage(_: Event, channel: Channel) {\n const channelIndex = this.channels.findIndex((c) => c.cid === channel.cid);\n this.channels.splice(channelIndex, 1);\n this.channelsSubject.next([channel, ...this.channels]);\n }\n\n private handleChannelHidden(event: Event) {\n this.removeChannelsFromChannelList([event.channel!.cid]);\n }\n\n private handleChannelDeleted(event: Event) {\n this.removeChannelsFromChannelList([event.channel!.cid]);\n }\n\n private handleChannelVisible(event: Event, channel: Channel) {\n if (!this.channels.find((c) => c.cid === event.cid)) {\n this.ngZone.run(() =>\n this.channelsSubject.next([...this.channels, channel])\n );\n }\n }\n\n private handleChannelUpdate(event: Event) {\n const channelIndex = this.channels.findIndex(\n (c) => c.cid === event.channel!.cid\n );\n if (channelIndex !== -1) {\n this.channels[channelIndex].data = event.channel;\n this.channelsSubject.next([...this.channels]);\n if (event.channel?.cid === this.activeChannelSubject.getValue()?.cid) {\n const channel = this.activeChannelSubject.getValue()!;\n channel.data = event.channel;\n this.activeChannelSubject.next(channel);\n }\n }\n }\n\n private handleChannelTruncate(event: Event) {\n const channelIndex = this.channels.findIndex(\n (c) => c.cid === event.channel!.cid\n );\n if (channelIndex !== -1) {\n this.channels[channelIndex].state.messages = [];\n this.channelsSubject.next([...this.channels]);\n if (event.channel?.cid === this.activeChannelSubject.getValue()?.cid) {\n const channel = this.activeChannelSubject.getValue()!;\n channel.state.messages = [];\n this.activeChannelSubject.next(channel);\n this.activeChannelMessagesSubject.next([]);\n this.activeParentMessageIdSubject.next(undefined);\n this.activeThreadMessagesSubject.next([]);\n }\n }\n }\n\n private get channels() {\n return this.channelsSubject.getValue() || [];\n }\n\n private get canSendReadEvents() {\n const channel = this.activeChannelSubject.getValue();\n if (!channel) {\n return false;\n }\n const capabilites = channel.data?.own_capabilities as string[];\n return capabilites.indexOf('read-events') !== -1;\n }\n\n private transformToStreamMessage(\n message: StreamMessage | MessageResponse | FormatMessageResponse,\n channel: Channel\n ) {\n const isThreadMessage = !!message.parent_id;\n if (\n this.isStreamMessage(message) &&\n this.isFormatMessageResponse(message)\n ) {\n return message;\n } else if (this.isFormatMessageResponse(message)) {\n return {\n ...message,\n readBy: isThreadMessage ? [] : getReadBy(message, channel),\n };\n } else {\n const formatMessage = this.formatMessage(message);\n return {\n ...formatMessage,\n readBy: isThreadMessage ? [] : getReadBy(formatMessage, channel),\n };\n }\n }\n\n private handleTypingStartEvent(event: Event) {\n if (event.user?.id === this.chatClientService.chatClient.user?.id) {\n return;\n }\n const isTypingInThread = !!event.parent_id;\n if (\n isTypingInThread &&\n event.parent_id !== this.activeParentMessageIdSubject.getValue()\n ) {\n return;\n }\n const subject = isTypingInThread\n ? this.usersTypingInThreadSubject\n : this.usersTypingInChannelSubject;\n const users: UserResponse[] = subject.getValue();\n const user = event.user;\n if (user && !users.find((u) => u.id === user.id)) {\n users.push(user);\n subject.next([...users]);\n }\n }\n\n private handleTypingStopEvent(event: Event) {\n const usersTypingInChannel = this.usersTypingInChannelSubject.getValue();\n const usersTypingInThread = this.usersTypingInThreadSubject.getValue();\n const user = event.user;\n if (user && usersTypingInChannel.find((u) => u.id === user.id)) {\n usersTypingInChannel.splice(\n usersTypingInChannel.findIndex((u) => u.id === user.id),\n 1\n );\n this.usersTypingInChannelSubject.next([...usersTypingInChannel]);\n return;\n }\n if (user && usersTypingInThread.find((u) => u.id === user.id)) {\n usersTypingInThread.splice(\n usersTypingInThread.findIndex((u) => u.id === user.id),\n 1\n );\n this.usersTypingInThreadSubject.next([...usersTypingInThread]);\n return;\n }\n }\n\n private updateLatestMessages(event: Event) {\n if (\n event.message?.user?.id !== this.chatClientService?.chatClient.user?.id\n ) {\n return;\n }\n const latestMessages =\n this.latestMessageDateByUserByChannelsSubject.getValue();\n if (!event.message?.created_at) {\n return;\n }\n const channelId = event?.message?.cid;\n if (!channelId) {\n return;\n }\n const messageDate = new Date(event.message.created_at);\n if (\n !latestMessages[channelId] ||\n latestMessages[channelId]?.getTime() < messageDate.getTime()\n ) {\n latestMessages[channelId] = messageDate;\n this.latestMessageDateByUserByChannelsSubject.next({\n ...latestMessages,\n });\n }\n }\n}\n","import { Injectable } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\n\nexport type Theme = 'light' | 'dark';\n\n/**\n * The `ThemeService` can be used to change the theme of the chat UI and to customize the theme. Our [themeing guide](../concepts/themeing-and-css.mdx) gives a complete overview about the topic.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class ThemeService {\n /**\n * A Subject that can be used to get or set the currently active theme.\n */\n theme$ = new BehaviorSubject<Theme>('light');\n private _customLightThemeVariables: { [key: string]: string } | undefined;\n private _customDarkThemeVariables: { [key: string]: string } | undefined;\n private defaultDarkModeVariables = {\n '--bg-gradient-end': '#101214',\n '--bg-gradient-start': '#070a0d',\n '--black': '#ffffff',\n '--blue-alice': '#00193d',\n '--border': '#141924',\n '--button-background': '#ffffff',\n '--button-text': '#005fff',\n '--grey': '#7a7a7a',\n '--grey-gainsboro': '#2d2f2f',\n '--grey-whisper': '#1c1e22',\n '--modal-shadow': '#000000',\n '--overlay': '#00000066', // 66 = 40% opacity\n '--overlay-dark': '#ffffffcc', // CC = 80% opacity\n '--shadow-icon': '#00000080', // 80 = 50% opacity\n '--targetedMessageBackground': '#302d22',\n '--transparent': 'transparent',\n '--white': '#101418',\n '--white-smoke': '#13151b',\n '--white-snow': '#070a0d',\n };\n private variablesToDelete: { [key: string]: string }[] = [];\n\n constructor() {\n this.theme$.subscribe((theme) => {\n const darkVariables = this.customDarkThemeVariables\n ? { ...this.defaultDarkModeVariables, ...this.customDarkThemeVariables }\n : this.defaultDarkModeVariables;\n const lightVariables = this.customLightThemeVariables\n ? this.customLightThemeVariables\n : {};\n this.variablesToDelete.forEach((variables) =>\n this.deleteVariables(variables)\n );\n if (theme === 'dark') {\n this.deleteVariables(lightVariables);\n this.setVariables(darkVariables);\n } else {\n this.deleteVariables(darkVariables);\n this.setVariables(lightVariables);\n }\n });\n }\n\n /**\n * A getter that returns the currently set custom light theme variables.\n * @returns An object where the keys are theme variables, and the values are the currently set CSS values.\n */\n get customLightThemeVariables() {\n return this._customLightThemeVariables;\n }\n\n /**\n * A setter that can be used to overwrite the values of the CSS theme variables of the light theme.\n * @param variables An object where the keys are theme variables, and the values are CSS values.\n */\n set customLightThemeVariables(\n variables: { [key: string]: string } | undefined\n ) {\n const prevVariables = this.customLightThemeVariables;\n if (prevVariables) {\n this.variablesToDelete.push(prevVariables);\n }\n this._customLightThemeVariables = variables;\n if (this.theme$.getValue() === 'light') {\n this.theme$.next('light');\n }\n }\n\n /**\n * A getter that returns the currently set custom dark theme variables.\n * @returns An object where the keys are theme variables, and the values are the currently set CSS values.\n */\n get customDarkThemeVariables() {\n return this._customDarkThemeVariables;\n }\n\n /**\n * A setter that can be used to overwrite the values of the CSS theme variables of the dark theme.\n * @param variables An object where the keys are theme variables, and the values are CSS values.\n */\n set customDarkThemeVariables(\n variables: { [key: string]: string } | undefined\n ) {\n const prevVariables = this.customDarkThemeVariables;\n if (prevVariables) {\n this.variablesToDelete.push(prevVariables);\n }\n this._customDarkThemeVariables = variables;\n if (this.theme$.getValue() === 'dark') {\n this.theme$.next('dark');\n }\n }\n\n private deleteVariables(variables: { [key: string]: string } | undefined) {\n if (!variables) {\n return;\n }\n Object.keys(variables).forEach((key) =>\n document.documentElement.style.setProperty(key, null)\n );\n }\n\n private setVariables(variables: { [key: string]: string } | undefined) {\n if (!variables) {\n return;\n }\n Object.keys(variables).forEach((key) =>\n document.documentElement.style.setProperty(key, variables[key])\n );\n }\n}\n","export const isImageFile = (file: File) => {\n // photoshop files begin with 'image/'\n return file.type.startsWith('image/') && !file.type.endsWith('.photoshop');\n};\n","import { Attachment } from 'stream-chat';\n\nexport const isImageAttachment = (attachment: Attachment) => {\n return (\n attachment.type === 'image' &&\n !attachment.title_link &&\n !attachment.og_scrape_url\n );\n};\n","import { Injectable } from '@angular/core';\nimport { isImageFile } from './is-image-file';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { Attachment } from 'stream-chat';\nimport { ChannelService } from './channel.service';\nimport { isImageAttachment } from './is-image-attachment';\nimport { NotificationService } from './notification.service';\nimport { AttachmentUpload } from './types';\n\n/**\n * The `AttachmentService` manages the uploads of a message input.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class AttachmentService {\n /**\n * Emits the number of uploads in progress.\n */\n attachmentUploadInProgressCounter$: Observable<number>;\n /**\n * Emits the state of the uploads ([`AttachmentUpload[]`](https://github.com/GetStream/stream-chat-angular/blob/master/projects/stream-chat-angular/src/lib/types.ts)), it adds a state (`success`, `error` or `uploading`) to each file the user selects for upload. It is used by the [`AttachmentPreviewList`](../components/AttachmentPreviewListComponent.mdx) to display the attachment previews.\n */\n attachmentUploads$: Observable<AttachmentUpload[]>;\n private attachmentUploadInProgressCounterSubject =\n new BehaviorSubject<number>(0);\n private attachmentUploadsSubject = new BehaviorSubject<AttachmentUpload[]>(\n []\n );\n\n constructor(\n private channelService: ChannelService,\n private notificationService: NotificationService\n ) {\n this.attachmentUploadInProgressCounter$ =\n this.attachmentUploadInProgressCounterSubject.asObservable();\n this.attachmentUploads$ = this.attachmentUploadsSubject.asObservable();\n }\n\n /**\n * Resets the attachments uploads (for example after the message with the attachments sent successfully)\n */\n resetAttachmentUploads() {\n this.attachmentUploadsSubject.next([]);\n }\n\n /**\n * Uploads the selected files, and creates preview for image files. The result is propagated throught the `attachmentUploads$` stream.\n * @param fileList The files selected by the user\n * @returns A promise with the result\n */\n async filesSelected(fileList: FileList | null) {\n if (!fileList) {\n return;\n }\n const imageFiles: File[] = [];\n const dataFiles: File[] = [];\n\n Array.from(fileList).forEach((file) => {\n if (isImageFile(file)) {\n imageFiles.push(file);\n } else {\n dataFiles.push(file);\n }\n });\n imageFiles.forEach((f) => this.createPreview(f));\n const newUploads = [\n ...imageFiles.map((file) => ({\n file,\n state: 'uploading' as 'uploading',\n type: 'image' as 'image',\n })),\n ...dataFiles.map((file) => ({\n file,\n state: 'uploading' as 'uploading',\n type: 'file' as 'file',\n })),\n ];\n this.attachmentUploadsSubject.next([\n ...this.attachmentUploadsSubject.getValue(),\n ...newUploads,\n ]);\n await this.uploadAttachments(newUploads);\n }\n\n /**\n * Retries to upload an attachment.\n * @param file\n * @returns A promise with the result\n */\n async retryAttachmentUpload(file: File) {\n const attachmentUploads = this.attachmentUploadsSubject.getValue();\n const upload = attachmentUploads.find((u) => u.file === file);\n if (!upload) {\n return;\n }\n upload.state = 'uploading';\n this.attachmentUploadsSubject.next([...attachmentUploads]);\n await this.uploadAttachments([upload]);\n }\n\n /**\n * Deletes an attachment, the attachment can have any state (`error`, `uploading` or `success`).\n * @param upload\n */\n async deleteAttachment(upload: AttachmentUpload) {\n const attachmentUploads = this.attachmentUploadsSubject.getValue();\n if (upload.state === 'success') {\n try {\n await this.channelService.deleteAttachment(upload);\n attachmentUploads.splice(attachmentUploads.indexOf(upload), 1);\n } catch (error) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.Error deleting attachment'\n );\n }\n } else {\n attachmentUploads.splice(attachmentUploads.indexOf(upload), 1);\n }\n this.attachmentUploadsSubject.next([...attachmentUploads]);\n }\n\n /**\n * Maps the current uploads to a format that can be sent along with the message to the Stream API.\n * @returns the attachments\n */\n mapToAttachments() {\n const attachmentUploads = this.attachmentUploadsSubject.getValue();\n return attachmentUploads\n .filter((r) => r.state === 'success')\n .map((r) => {\n const attachment: Attachment = {\n type: r.type,\n };\n if (r.type === 'image') {\n attachment.fallback = r.file?.name;\n attachment.image_url = r.url;\n } else {\n attachment.asset_url = r.url;\n attachment.title = r.file?.name;\n attachment.file_size = r.file?.size;\n }\n\n return attachment;\n });\n }\n\n /**\n * Maps attachments received from the Stream API to uploads. This is useful when editing a message.\n * @param attachments Attachemnts received with the message\n */\n createFromAttachments(attachments: Attachment[]) {\n const attachmentUploads: AttachmentUpload[] = [];\n attachments.forEach((attachment) => {\n if (isImageAttachment(attachment)) {\n attachmentUploads.push({\n url: (attachment.img_url ||\n attachment.thumb_url ||\n attachment.image_url) as string,\n state: 'success',\n type: 'image',\n file: {\n name: attachment.fallback,\n } as File,\n });\n } else if (attachment.type === 'file') {\n attachmentUploads.push({\n url: attachment.asset_url,\n state: 'success',\n file: {\n name: attachment.title,\n size: attachment.file_size,\n } as File,\n type: 'file',\n });\n }\n });\n\n if (attachmentUploads.length > 0) {\n this.attachmentUploadsSubject.next([\n ...this.attachmentUploadsSubject.getValue(),\n ...attachmentUploads,\n ]);\n }\n }\n\n private createPreview(file: File) {\n const reader = new FileReader();\n reader.onload = (event) => {\n const attachmentUploads = this.attachmentUploadsSubject.getValue();\n const upload = attachmentUploads.find((upload) => upload.file === file);\n if (!upload) {\n return;\n }\n upload.previewUri = event.target?.result || undefined;\n this.attachmentUploadsSubject.next([...attachmentUploads]);\n };\n reader.readAsDataURL(file as Blob);\n }\n\n private async uploadAttachments(uploads: AttachmentUpload[]) {\n const attachmentUploads = this.attachmentUploadsSubject.getValue();\n this.attachmentUploadInProgressCounterSubject.next(\n this.attachmentUploadInProgressCounterSubject.getValue() + 1\n );\n const result = await this.channelService.uploadAttachments(uploads);\n result.forEach((r) => {\n const upload = attachmentUploads.find((upload) => upload.file === r.file);\n if (!upload) {\n if (r.url) {\n void this.channelService.deleteAttachment(r);\n }\n return;\n }\n upload.state = r.state;\n upload.url = r.url;\n if (upload.state === 'error') {\n this.notificationService.addTemporaryNotification(\n upload.type === 'image'\n ? 'streamChat.Error uploading image'\n : 'streamChat.Error uploading file'\n );\n }\n });\n this.attachmentUploadInProgressCounterSubject.next(\n this.attachmentUploadInProgressCounterSubject.getValue() - 1\n );\n this.attachmentUploadsSubject.next([...attachmentUploads]);\n }\n}\n","export const en = {\n streamChat: {\n '1 reply': '1 reply',\n 'Attach files': 'Attach files',\n Cancel: 'Cancel',\n 'Channel Missing': 'Channel Missing',\n Close: 'Close',\n 'Close emoji picker': 'Close emoji picker',\n 'Commands matching': 'Commands matching',\n 'Connection failure, reconnecting now...':\n 'Connection failure, reconnecting now...',\n Delete: 'Delete',\n Delivered: 'Delivered',\n 'Edit Message': 'Edit Message',\n 'Edit message request failed': 'Edit message request failed',\n 'Emoji matching': 'Emoji matching',\n 'Empty message...': 'Empty message...',\n 'Error adding flag': 'Error adding flag',\n 'Error connecting to chat, refresh the page to try again.':\n 'Error connecting to chat, refresh the page to try again.',\n 'Error deleting message': 'Error deleting message',\n 'Error muting a user ...': 'Error muting a user ...',\n 'Error pinning message': 'Error pinning message',\n 'Error removing message pin': 'Error removing message pin',\n 'Error unmuting a user ...': 'Error unmuting a user ...',\n 'Error uploading file': 'Error uploading file',\n 'Error uploading image': 'Error uploading image',\n 'Error deleting attachment': 'Error deleting attachment',\n 'Error · Unsent': 'Error · Unsent',\n 'Error: {{ errorMessage }}': 'Error: {{ errorMessage }}',\n Flag: 'Flag',\n 'Message Failed': 'Message Failed',\n 'Message Failed · Unauthorized': 'Message Failed · Unauthorized',\n 'Message Failed · Click to try again':\n 'Message Failed · Click to try again',\n 'Message deleted': 'Message deleted',\n 'Message has been successfully flagged':\n 'Message has been successfully flagged',\n 'Message pinned': 'Message pinned',\n Mute: 'Mute',\n New: 'New',\n 'New Messages!': 'New Messages!',\n 'No results found': 'No results found',\n 'Nothing yet...': 'Nothing yet...',\n 'Only visible to you': 'Only visible to you',\n 'Open emoji picker': 'Open emoji picker',\n 'People matching': 'People matching',\n 'Pick your emoji': 'Pick your emoji',\n Pin: 'Pin',\n 'Pinned by': 'Pinned by',\n Reply: 'Reply',\n 'Reply to Message': 'Reply to Message',\n Search: 'Search',\n 'Searching...': 'Searching...',\n Send: 'Send',\n 'Send message request failed': 'Send message request failed',\n 'Sending...': 'Sending...',\n 'Slow Mode ON': 'Slow Mode ON',\n 'Start of a new thread': 'Start of a new thread',\n 'This message was deleted...': 'This message was deleted...',\n Thread: 'Thread',\n 'Type your message': 'Type your message',\n Unmute: 'Unmute',\n Unpin: 'Unpin',\n 'Wait until all attachments have uploaded':\n 'Wait until all attachments have uploaded',\n 'You have no channels currently': 'You have no channels currently',\n \"You've reached the maximum number of files\":\n \"You've reached the maximum number of files\",\n live: 'live',\n 'this content could not be displayed':\n 'this content could not be displayed',\n '{{ commaSeparatedUsers }} and {{ moreCount }} more':\n '{{ commaSeparatedUsers }} and {{ moreCount }} more',\n '{{ commaSeparatedUsers }}, and {{ lastUser }}':\n '{{ commaSeparatedUsers }}, and {{ lastUser }}',\n '{{ firstUser }} and {{ secondUser }}':\n '{{ firstUser }} and {{ secondUser }}',\n '{{ imageCount }} more': '{{ imageCount }} more',\n '{{ memberCount }} members': '{{ memberCount }} members',\n '{{ replyCount }} replies': '{{ replyCount }} replies',\n '{{ user }} has been muted': '{{ user }} has been muted',\n '{{ user }} has been unmuted': '{{ user }} has been unmuted',\n '{{ watcherCount }} online': '{{ watcherCount }} online',\n '🏙 Attachment...': '🏙 Attachment...',\n 'Connection error': 'Connection error',\n 'Load more': 'Load more',\n failed: 'failed',\n retry: 'retry',\n test: 'success',\n 'Sending links is not allowed in this conversation':\n 'Sending links is not allowed in this conversation',\n \"You can't send messages in this channel\":\n \"You can't send messages in this channel\",\n \"You can't send thread replies in this channel\":\n \"You can't send thread replies in this channel\",\n 'Unsupported file type: {{type}}': 'Unsupported file type: {{type}}',\n },\n};\n","import { Injectable } from '@angular/core';\nimport { TranslateService } from '@ngx-translate/core';\nimport { en } from '../assets/i18n/en';\n\n/**\n * The `StreamI18nService` can be used to customize the labels of the chat UI. Our [translation guide](../concepts/translation.mdx) covers this topic in detail.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class StreamI18nService {\n constructor(private translteService: TranslateService) {}\n\n /**\n * Registers the translation to the [ngx-translate](https://github.com/ngx-translate/core) TranslateService.\n * @param lang The language key to register the translation to\n * @param overrides An object which keys are translation keys, and the values are custom translations\n */\n setTranslation(lang = 'en', overrides?: { [key: string]: string }) {\n if (!this.translteService.defaultLang) {\n this.translteService.defaultLang = lang;\n }\n this.translteService.setTranslation(\n lang,\n { streamChat: { ...en.streamChat, ...overrides } },\n true\n );\n }\n}\n","import { Component, Input } from '@angular/core';\n\n/**\n * The `Avatar` component displays the provided image, with fallback to the first letter of the optional name input.\n */\n@Component({\n selector: 'stream-avatar',\n templateUrl: './avatar.component.html',\n styleUrls: ['./avatar.component.scss'],\n})\nexport class AvatarComponent {\n /**\n * An optional name of the image, used for fallback image or image title (if `imageUrl` is provided)\n */\n @Input() name: string | undefined;\n /**\n * The URL of the image to be displayed. If the image can't be displayed the first letter of the name input is displayed.\n */\n @Input() imageUrl: string | undefined;\n /**\n * The size in pixels of the avatar image.\n */\n @Input() size = 32;\n isLoaded = false;\n isError = false;\n\n constructor() {}\n\n get initials() {\n return (this.name?.toString() || '').charAt(0);\n }\n}\n","<div\n class=\"str-chat__avatar str-chat__avatar--circle\"\n title=\"{{ name }}\"\n [style]=\"{\n flexBasis: size + 'px',\n fontSize: size / 2 + 'px',\n height: size + 'px',\n lineHeight: size + 'px',\n width: size + 'px'\n }\"\n>\n <img\n *ngIf=\"imageUrl && !isError; else fallback\"\n class=\"str-chat__avatar-image str-chat__avatar-image{{\n isLoaded ? ' str-chat__avatar-image--loaded' : ''\n }}\"\n src=\"{{ imageUrl }}\"\n alt=\"{{ initials }}\"\n data-testid=\"avatar-img\"\n (load)=\"isLoaded = true\"\n (error)=\"isError = true\"\n [style]=\"{\n flexBasis: size + 'px',\n height: size + 'px',\n objectFit: 'cover',\n width: size + 'px'\n }\"\n />\n <ng-template #fallback>\n <div data-testid=\"fallback-img\" class=\"str-chat__avatar-fallback\">\n {{ initials }}\n </div>\n </ng-template>\n</div>\n","import { Component, Input } from '@angular/core';\n\nexport type Icon =\n | 'action-icon'\n | 'delivered-icon'\n | 'reaction-icon'\n | 'connection-error'\n | 'send'\n | 'file-upload'\n | 'retry'\n | 'close'\n | 'file'\n | 'reply'\n | 'close-no-outline'\n | 'reply-in-thread'\n | 'arrow-left'\n | 'arrow-right'\n | 'menu';\n\n/**\n * The `Icon` component can be used to display different icons (i. e. message delivered icon).\n */\n@Component({\n selector: 'stream-icon',\n templateUrl: './icon.component.html',\n styles: [],\n})\nexport class IconComponent {\n /**\n * The icon to display, the list of [supported icons](https://github.com/GetStream/stream-chat-angular/tree/master/projects/stream-chat-angular/src/lib/icon/icon.component.ts) can be found on GitHub.\n */\n @Input() icon: Icon | undefined;\n /**\n * The size of the icon (in pixels)\n */\n @Input() size: number | undefined;\n constructor() {}\n}\n","<svg\n data-testid=\"action-icon\"\n *ngIf=\"icon === 'action-icon'\"\n height=\"4\"\n viewBox=\"0 0 11 4\"\n width=\"11\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M1.5 3a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm4 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm4 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z\"\n fillRule=\"nonzero\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'delivered-icon'\"\n height=\"16\"\n width=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"delivered-icon\"\n>\n <path\n d=\"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0zm3.72 6.633a.955.955 0 1 0-1.352-1.352L6.986 8.663 5.633 7.31A.956.956 0 1 0 4.28 8.663l2.029 2.028a.956.956 0 0 0 1.353 0l4.058-4.058z\"\n fill=\"#006CFF\"\n fillRule=\"evenodd\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'reaction-icon'\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n width=\"12\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"reaction-icon\"\n>\n <g clipRule=\"evenodd\" fillRule=\"evenodd\">\n <path\n d=\"M6 1.2C3.3 1.2 1.2 3.3 1.2 6c0 2.7 2.1 4.8 4.8 4.8 2.7 0 4.8-2.1 4.8-4.8 0-2.7-2.1-4.8-4.8-4.8zM0 6c0-3.3 2.7-6 6-6s6 2.7 6 6-2.7 6-6 6-6-2.7-6-6z\"\n ></path>\n <path\n d=\"M5.4 4.5c0 .5-.4.9-.9.9s-.9-.4-.9-.9.4-.9.9-.9.9.4.9.9zM8.4 4.5c0 .5-.4.9-.9.9s-.9-.4-.9-.9.4-.9.9-.9.9.4.9.9zM3.3 6.7c.3-.2.6-.1.8.1.3.4.8.9 1.5 1 .6.2 1.4.1 2.4-1 .2-.2.6-.3.8 0 .2.2.3.6 0 .8-1.1 1.3-2.4 1.7-3.5 1.5-1-.2-1.8-.9-2.2-1.5-.2-.3-.1-.7.2-.9z\"\n ></path>\n </g>\n</svg>\n<svg\n data-testid=\"connection-error\"\n *ngIf=\"icon === 'connection-error'\"\n width=\"78px\"\n height=\"78px\"\n viewBox=\"0 0 78 78\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n>\n <!-- Generator: Sketch 52.6 (67491) - http://www.bohemiancoding.com/sketch -->\n <title>Combined Shape</title>\n <desc>Created with Sketch.</desc>\n <g\n id=\"Interactions\"\n stroke=\"none\"\n stroke-width=\"1\"\n fill=\"none\"\n fill-rule=\"evenodd\"\n >\n <g\n id=\"Connection-Error-_-Connectivity\"\n transform=\"translate(-270.000000, -30.000000)\"\n fill=\"#CF1F25\"\n >\n <g\n id=\"109-network-connection\"\n transform=\"translate(270.000000, 30.000000)\"\n >\n <path\n d=\"M66.4609744,11.414231 C81.6225232,26.5757798 81.6225232,51.157545 66.4609744,66.3188467 C51.2994256,81.4803954 26.7176604,81.4803954 11.5563587,66.3188467 C-3.60519004,51.1572979 -3.60519004,26.5755327 11.5563587,11.414231 C26.7179075,-3.74731776 51.2996727,-3.74731776 66.4609744,11.414231 Z M54.7853215,45.8823776 L54.7853215,40.5882574 C54.7853215,39.613638 53.9952341,38.8235506 53.0206147,38.8235506 L44.9576695,38.8235506 L41.428256,42.3529641 L51.255555,42.3529641 L51.255555,45.8823776 L54.7853215,45.8823776 Z M40.6659027,43.1153174 L37.8988425,45.8823776 L40.6659027,45.8823776 L40.6659027,43.1153174 Z M51.1764962,56.4702653 L58.2353232,56.4702653 C59.2099355,56.4702653 60.00003,55.6801708 60.00003,54.7055585 L60.00003,51.176145 C60.00003,50.2015327 59.2099355,49.4114382 58.2353232,49.4114382 L51.1764962,49.4114382 C50.2018839,49.4114382 49.4117894,50.2015327 49.4117894,51.176145 L49.4117894,54.7055585 C49.4117894,55.6801708 50.2018839,56.4702653 51.1764962,56.4702653 Z M35.2941353,56.4702653 L42.3529624,56.4702653 C43.3275746,56.4702653 44.1176691,55.6801708 44.1176691,54.7055585 L44.1176691,51.176145 C44.1176691,50.2015327 43.3275746,49.4114382 42.3529624,49.4114382 L35.2941353,49.4114382 C34.319523,49.4114382 33.5294285,50.2015327 33.5294285,51.176145 L33.5294285,54.7055585 C33.5294285,55.6801708 34.319523,56.4702653 35.2941353,56.4702653 Z M56.6964989,19.0874231 C56.007381,18.3985134 54.8903216,18.3985134 54.2012036,19.087423 L45.882376,27.4062507 L45.882376,19.4117761 C45.882376,18.4371568 45.0922885,17.6470693 44.1176692,17.6470693 L33.5294286,17.6470693 C32.5548092,17.6470694 31.7647218,18.4371568 31.7647218,19.4117761 L31.7647218,30.0000167 C31.7647219,30.9746363 32.5548092,31.7647237 33.5294285,31.7647237 L41.5239031,31.7647237 L34.4650761,38.8235508 L24.7058947,38.8235508 C23.7312753,38.8235508 22.9411879,39.6136382 22.9411879,40.5882575 L22.9411879,45.8823778 L26.4706014,45.8823778 L26.4706014,42.3529643 L30.9356624,42.3529643 L23.8768354,49.4117914 L19.4117743,49.4117914 C18.4371549,49.4117914 17.6470675,50.2018788 17.6470675,51.1764981 L17.6470675,54.7059117 C17.6504049,54.9674302 17.7129076,55.2248042 17.8298886,55.4587302 L16.4456526,56.8429662 C15.7446193,57.5200453 15.7252005,58.6372282 16.4022825,59.3382615 C17.0793616,60.0392948 18.1965445,60.0587136 18.8975778,59.3816316 C18.9122847,59.3674273 18.9267436,59.3529684 18.940948,59.3382615 L56.6964963,21.5830662 C57.3856425,20.8939094 57.3856425,19.7765747 56.6964963,19.0874179 Z\"\n id=\"Combined-Shape\"\n ></path>\n </g>\n </g>\n </g>\n</svg>\n<svg\n *ngIf=\"icon === 'send'\"\n data-testid=\"send\"\n height=\"17\"\n viewBox=\"0 0 18 17\"\n width=\"18\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <title translate>streamChat.Send</title>\n <path\n d=\"M0 17.015l17.333-8.508L0 0v6.617l12.417 1.89L0 10.397z\"\n fill=\"#006cff\"\n fillRule=\"evenodd\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'file-upload'\"\n data-testid=\"file-upload\"\n height=\"14\"\n width=\"14\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <title translate>streamChat.Attach files</title>\n <path\n d=\"M1.667.333h10.666c.737 0 1.334.597 1.334 1.334v10.666c0 .737-.597 1.334-1.334 1.334H1.667a1.333 1.333 0 0 1-1.334-1.334V1.667C.333.93.93.333 1.667.333zm2 1.334a1.667 1.667 0 1 0 0 3.333 1.667 1.667 0 0 0 0-3.333zm-2 9.333v1.333h10.666v-4l-2-2-4 4-2-2L1.667 11z\"\n fillRule=\"nonzero\"\n />\n</svg>\n<svg\n data-testid=\"retry\"\n *ngIf=\"icon === 'retry'\"\n width=\"22\"\n height=\"20\"\n viewBox=\"0 0 22 20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M20 5.535V2a1 1 0 0 1 2 0v6a1 1 0 0 1-1 1h-6a1 1 0 0 1 0-2h3.638l-2.975-2.653a8 8 0 1 0 1.884 8.32 1 1 0 1 1 1.886.666A10 10 0 1 1 5.175 1.245c3.901-2.15 8.754-1.462 11.88 1.667L20 5.535z\"\n fill=\"#FFF\"\n fill-rule=\"nonzero\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'close'\"\n data-testid=\"close\"\n width=\"28\"\n height=\"28\"\n viewBox=\"0 0 28 28\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n>\n <defs>\n <path\n d=\"M465 5c5.53 0 10 4.47 10 10s-4.47 10-10 10-10-4.47-10-10 4.47-10 10-10zm3.59 5L465 13.59 461.41 10 460 11.41l3.59 3.59-3.59 3.59 1.41 1.41 3.59-3.59 3.59 3.59 1.41-1.41-3.59-3.59 3.59-3.59-1.41-1.41z\"\n id=\"b\"\n />\n <filter\n x=\"-30%\"\n y=\"-30%\"\n width=\"160%\"\n height=\"160%\"\n filterUnits=\"objectBoundingBox\"\n id=\"a\"\n >\n <feOffset in=\"SourceAlpha\" result=\"shadowOffsetOuter1\" />\n <feGaussianBlur\n stdDeviation=\"2\"\n in=\"shadowOffsetOuter1\"\n result=\"shadowBlurOuter1\"\n />\n <feColorMatrix\n values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0\"\n in=\"shadowBlurOuter1\"\n />\n </filter>\n </defs>\n <g transform=\"translate(-451 -1)\" fill-rule=\"nonzero\" fill=\"none\">\n <use fill=\"#000\" filter=\"url(#a)\" xlink:href=\"#b\" />\n <use fill=\"#FFF\" fill-rule=\"evenodd\" xlink:href=\"#b\" />\n </g>\n</svg>\n<svg\n *ngIf=\"icon === 'file'\"\n data-testid=\"file\"\n className=\"rfu-file-icon--small fa-file-fallback\"\n [attr.height]=\"size || 20\"\n [attr.width]=\"size || 20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 384 512\"\n>\n <path\n d=\"M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48z\"\n fill=\"#414D54\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'reply'\"\n data-testid=\"reply\"\n height=\"15\"\n width=\"18\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M.56 10.946H.06l-.002-.498L.025.92a.5.5 0 1 1 1-.004l.032 9.029H9.06v-4l9 4.5-9 4.5v-4H.56z\"\n fillRule=\"nonzero\"\n />\n</svg>\n<svg\n height=\"10\"\n width=\"10\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"close-no-outline\"\n *ngIf=\"icon === 'close-no-outline'\"\n>\n <path\n d=\"M9.916 1.027L8.973.084 5 4.058 1.027.084l-.943.943L4.058 5 .084 8.973l.943.943L5 5.942l3.973 3.974.943-.943L5.942 5z\"\n fillRule=\"evenodd\"\n />\n</svg>\n<svg\n height=\"10\"\n width=\"14\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"reply-in-thread\"\n *ngIf=\"icon === 'reply-in-thread'\"\n>\n <path\n d=\"M8.516 3c4.78 0 4.972 6.5 4.972 6.5-1.6-2.906-2.847-3.184-4.972-3.184v2.872L3.772 4.994 8.516.5V3zM.484 5l4.5-4.237v1.78L2.416 5l2.568 2.125v1.828L.484 5z\"\n fillRule=\"evenodd\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'arrow-left'\"\n data-testid=\"arrow-left\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M15.7049 7.41L14.2949 6L8.29492 12L14.2949 18L15.7049 16.59L11.1249 12L15.7049 7.41Z\"\n fill=\"var(--black)\"\n />\n</svg>\n\n<svg\n *ngIf=\"icon === 'arrow-right'\"\n data-testid=\"arrow-right\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M9.70492 6L8.29492 7.41L12.8749 12L8.29492 16.59L9.70492 18L15.7049 12L9.70492 6Z\"\n fill=\"var(--black)\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'menu'\"\n data-testid=\"menu\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M3 8V6H21V8H3ZM3 13H21V11H3V13ZM3 18H21V16H3V18Z\"\n fill=\"black\"\n />\n</svg>\n","import { Component, Input } from '@angular/core';\n\n/**\n * The `LoadingIndicator` component displays a spinner to indicate that an action is in progress.\n */\n@Component({\n selector: 'stream-loading-indicator',\n templateUrl: './loading-indicator.component.html',\n styles: [],\n})\nexport class LoadingIndicatorComponent {\n /**\n * The size of the indicator (in pixels)\n */\n @Input() size = 15;\n /**\n * The color of the indicator\n */\n @Input() color = '#006CFF';\n\n constructor() {}\n}\n","<div class=\"str-chat__loading-indicator\">\n <svg\n [attr.height]=\"size\"\n viewBox=\"0 0 30 30\"\n [attr.width]=\"size\"\n data-testid=\"loading-indicator\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <defs>\n <linearGradient id=\"a\" x1=\"50%\" x2=\"50%\" y1=\"0%\" y2=\"100%\">\n <stop offset=\"0%\" stop-color=\"#FFF\" stop-opacity=\"0\" />\n <stop\n data-testid=\"stop-color\"\n offset=\"100%\"\n [attr.stop-color]=\"color\"\n stop-opacity=\"1\"\n [ngStyle]=\"{ stopColor: color }\"\n />\n </linearGradient>\n </defs>\n <path\n d=\"M2.518 23.321l1.664-1.11A12.988 12.988 0 0 0 15 28c7.18 0 13-5.82 13-13S22.18 2 15 2V0c8.284 0 15 6.716 15 15 0 8.284-6.716 15-15 15-5.206 0-9.792-2.652-12.482-6.679z\"\n fill=\"url(#a)\"\n fillRule=\"evenodd\"\n />\n </svg>\n</div>\n","import { InjectionToken, Type } from '@angular/core';\nimport { TextareaInterface } from './message-input/textarea.interface';\n\nexport const textareaInjectionToken = new InjectionToken<\n Type<TextareaInterface>\n>('textareaInjectionToken');\n","import {\n ComponentRef,\n EventEmitter,\n Input,\n OnChanges,\n Output,\n SimpleChanges,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport { Directive } from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { UserResponse } from 'stream-chat';\nimport {\n CommandAutocompleteListItemContext,\n MentionAutcompleteListItemContext,\n} from '../types';\nimport { TextareaInterface } from './textarea.interface';\n\n@Directive({\n selector: '[streamTextarea]',\n})\nexport class TextareaDirective implements OnChanges {\n @Input() componentRef: ComponentRef<TextareaInterface> | undefined;\n @Input() areMentionsEnabled: boolean | undefined;\n @Input() mentionAutocompleteItemTemplate:\n | TemplateRef<MentionAutcompleteListItemContext>\n | undefined;\n @Input() mentionScope?: 'channel' | 'application';\n @Input() commandAutocompleteItemTemplate:\n | TemplateRef<CommandAutocompleteListItemContext>\n | undefined;\n @Input() value = '';\n @Output() readonly valueChange = new EventEmitter<string>();\n @Output() readonly send = new EventEmitter<void>();\n @Output() readonly userMentions = new EventEmitter<UserResponse[]>();\n private subscriptions: Subscription[] = [];\n private unpropagatedChanges: SimpleChanges[] = [];\n constructor(public viewContainerRef: ViewContainerRef) {}\n\n ngOnChanges(changes: SimpleChanges): void {\n this.unpropagatedChanges.push(changes);\n if (!this.componentRef) {\n return;\n }\n if (changes.componentRef) {\n this.subscriptions.forEach((s) => s.unsubscribe());\n if (this.componentRef) {\n this.subscriptions.push(\n this.componentRef.instance.valueChange.subscribe((value) =>\n this.valueChange.next(value)\n )\n );\n this.subscriptions.push(\n this.componentRef.instance.send.subscribe((value) =>\n this.send.next(value)\n )\n );\n if (this.componentRef.instance.userMentions) {\n this.subscriptions.push(\n this.componentRef.instance.userMentions.subscribe((value) =>\n this.userMentions.next(value)\n )\n );\n }\n this.componentRef.instance.areMentionsEnabled = this.areMentionsEnabled;\n this.componentRef.instance.mentionAutocompleteItemTemplate =\n this.mentionAutocompleteItemTemplate;\n this.componentRef.instance.commandAutocompleteItemTemplate =\n this.commandAutocompleteItemTemplate;\n this.componentRef.instance.mentionScope = this.mentionScope;\n this.componentRef.instance.value = this.value;\n }\n }\n if (changes.areMentionsEnabled) {\n this.componentRef.instance.areMentionsEnabled = this.areMentionsEnabled;\n }\n if (changes.mentionAutocompleteItemTemplate) {\n this.componentRef.instance.mentionAutocompleteItemTemplate =\n this.mentionAutocompleteItemTemplate;\n }\n if (changes.commandAutocompleteItemTemplate) {\n this.componentRef.instance.commandAutocompleteItemTemplate =\n this.commandAutocompleteItemTemplate;\n }\n if (changes.mentionScope) {\n this.componentRef.instance.mentionScope = this.mentionScope;\n }\n if (changes.value) {\n this.componentRef.instance.value = this.value;\n }\n // ngOnChanges not called for dynamic components since we don't use template binding\n let changesToPropagate = {};\n this.unpropagatedChanges.forEach(\n (c) => (changesToPropagate = { ...changesToPropagate, ...c })\n );\n // eslint-disable-next-line @angular-eslint/no-lifecycle-call\n this.componentRef.instance.ngOnChanges(changesToPropagate);\n this.unpropagatedChanges = [];\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n/**\n * If you have an emoji picker in your application, you can propagate the selected emoji to the textarea using this service, more info can be found in [custom emoji picker guide](../code-examples/emoji-picker.mdx)\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class EmojiInputService {\n /**\n * If you have an emoji picker in your application, you can propagate the selected emoji to the textarea using this Subject, more info can be found in [custom emoji picker guide](../code-examples/emoji-picker.mdx)\n */\n emojiInput$ = new Subject<string>();\n\n constructor() {}\n}\n","import { Injectable, TemplateRef } from '@angular/core';\nimport {\n CommandAutocompleteListItemContext,\n MentionAutcompleteListItemContext,\n} from '../types';\n\n/**\n * The `MessageInputConfigService` is used to keep a consistent configuration among the different [`MessageInput`](../components/MessageInputComponent.mdx) components if your UI has more than one input component.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class MessageInputConfigService {\n /**\n * If file upload is enabled, the user can open a file selector from the input. Please note that the user also needs to have the necessary [channel capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript).\n */\n isFileUploadEnabled: boolean | undefined = true;\n /**\n * If true, users can mention other users in messages. You also [need to use the `AutocompleteTextarea`](../concepts/opt-in-architecture.mdx) for this feature to work.\n */\n areMentionsEnabled: boolean | undefined = true;\n /**\n * You can provide your own template for the autocomplete list for user mentions. You also [need to use the `AutocompleteTextarea`](../concepts/opt-in-architecture.mdx) for this feature to work.\n */\n mentionAutocompleteItemTemplate:\n | TemplateRef<MentionAutcompleteListItemContext>\n | undefined;\n /**\n * You can provide your own template for the autocomplete list for commands. You also [need to use the `AutocompleteTextarea`](../concepts/opt-in-architecture.mdx) for this feature to work.\n */\n commandAutocompleteItemTemplate:\n | TemplateRef<CommandAutocompleteListItemContext>\n | undefined;\n /**\n * You can add an emoji picker by [providing your own emoji picker template](../code-examples/emoji-picker.mdx)\n */\n emojiPickerTemplate: TemplateRef<void> | undefined;\n /**\n * You can narrow the accepted file types by providing the [accepted types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept). By default every file type is accepted.\n * @deprecated use [application settings](https://getstream.io/chat/docs/javascript/app_setting_overview/?language=javascript#file-uploads) instead\n */\n acceptedFileTypes: string[] | undefined;\n /**\n * If `false`, users can only upload one attachment per message\n */\n isMultipleFileUploadEnabled: boolean | undefined = true;\n /**\n * The scope for user mentions, either members of the current channel of members of the application\n */\n mentionScope: 'channel' | 'application' | undefined = 'channel';\n\n constructor() {}\n}\n","import { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n/**\n * The `ImageLoadService` is used to position the scrollbar in the message list\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class ImageLoadService {\n /**\n * A subject that can be used to notify the message list if an image attachment finished loading\n */\n imageLoad$ = new Subject<void>();\n\n constructor() {}\n}\n","import {\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n Output,\n SimpleChanges,\n ViewChild,\n} from '@angular/core';\n\n/**\n * The `Modal` component displays its content in an overlay. The modal can be closed with a close button, if the user clicks outside of the modal content, or if the escape button is pressed. The modal can also be closed from outside.\n */\n@Component({\n selector: 'stream-modal',\n templateUrl: './modal.component.html',\n styles: [],\n})\nexport class ModalComponent implements OnChanges {\n /**\n * If `true` the modal will be displayed, if `false` the modal will be hidden\n */\n @Input() isOpen = false;\n /**\n * Emits `true` if the modal becomes visible, and `false` if the modal is closed.\n */\n @Output() readonly isOpenChange = new EventEmitter<boolean>();\n @ViewChild('content') private content: ElementRef<HTMLElement> | undefined;\n\n constructor() {}\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.isOpen) {\n if (this.isOpen) {\n window.addEventListener('keyup', this.watchForEscPress);\n setTimeout(\n () => window.addEventListener('click', this.watchForOutsideClicks),\n 0\n );\n } else {\n this.stopWatchForOutsideClicks();\n this.stopWatchForEscPress();\n }\n }\n }\n\n close() {\n this.isOpen = false;\n this.isOpenChange.emit(false);\n this.stopWatchForOutsideClicks();\n this.stopWatchForEscPress();\n }\n\n private watchForEscPress = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n this.close();\n }\n };\n\n private stopWatchForEscPress = () => {\n window.removeEventListener('keyup', this.watchForEscPress);\n };\n\n private watchForOutsideClicks = (event: Event) => {\n if (!this.content?.nativeElement.contains(event.target as Node)) {\n this.close();\n }\n };\n\n private stopWatchForOutsideClicks() {\n window.removeEventListener('click', this.watchForOutsideClicks);\n }\n}\n","<div\n data-testid=\"modal\"\n class=\"str-chat__modal str-chat__modal--{{ isOpen ? 'open' : 'close' }}\"\n>\n <div\n data-testid=\"close\"\n class=\"str-chat__modal__close-button\"\n (click)=\"close()\"\n (keyup.enter)=\"close()\"\n translate\n >\n streamChat.Close\n <stream-icon icon=\"close\"></stream-icon>\n </div>\n <div class=\"str-chat__modal__inner\" #content>\n <ng-content></ng-content>\n </div>\n</div>\n","import { Component, Input, OnChanges } from '@angular/core';\nimport { Action, Attachment } from 'stream-chat';\nimport { ImageLoadService } from '../message-list/image-load.service';\nimport { DefaultAttachmentType } from '../types';\nimport prettybytes from 'pretty-bytes';\nimport { isImageAttachment } from '../is-image-attachment';\nimport { ChannelService } from '../channel.service';\n\n/**\n * The `AttachmentList` compontent displays the attachments of a message\n */\n@Component({\n selector: 'stream-attachment-list',\n templateUrl: './attachment-list.component.html',\n styles: [],\n})\nexport class AttachmentListComponent implements OnChanges {\n /**\n * The id of the message the attachments belong to\n */\n @Input() messageId: string | undefined;\n /**\n * The attachments to display\n */\n @Input() attachments: Attachment<DefaultAttachmentType>[] = [];\n orderedAttachments: Attachment<DefaultAttachmentType>[] = [];\n imagesToView: Attachment<DefaultAttachmentType>[] = [];\n imagesToViewCurrentIndex = 0;\n\n constructor(\n private imageLoadService: ImageLoadService,\n private channelService: ChannelService\n ) {}\n\n ngOnChanges(): void {\n const images = this.attachments.filter(this.isImage);\n const containsGallery = images.length >= 2;\n this.orderedAttachments = [\n ...(containsGallery ? this.createGallery(images) : images),\n ...this.attachments.filter((a) => this.isFile(a)),\n ...this.attachments.filter((a) => this.isCard(a)),\n ];\n }\n\n trackById(index: number) {\n return index;\n }\n\n isImage(attachment: Attachment) {\n return isImageAttachment(attachment);\n }\n\n isFile(attachment: Attachment) {\n return attachment.type === 'file';\n }\n\n isGallery(attachment: Attachment) {\n return attachment.type === 'gallery';\n }\n\n isCard(attachment: Attachment) {\n return (\n !attachment.type ||\n (attachment.type === 'image' && !this.isImage(attachment)) ||\n attachment.type === 'giphy'\n );\n }\n\n imageLoaded() {\n this.imageLoadService.imageLoad$.next();\n }\n\n hasFileSize(attachment: Attachment<DefaultAttachmentType>) {\n return (\n attachment.file_size && Number.isFinite(Number(attachment.file_size))\n );\n }\n\n getFileSize(attachment: Attachment<DefaultAttachmentType>) {\n return prettybytes(Number(attachment.file_size!));\n }\n\n trimUrl(url?: string | null) {\n if (url !== undefined && url !== null) {\n const [trimmedUrl] = url\n .replace(/^(?:https?:\\/\\/)?(?:www\\.)?/i, '')\n .split('/');\n\n return trimmedUrl;\n }\n return null;\n }\n\n sendAction(action: Action) {\n void this.channelService.sendAction(this.messageId!, {\n [action.name!]: action.value!,\n });\n }\n\n trackByActionValue(_: number, item: Action) {\n return item.value;\n }\n\n openImageModal(attachments: Attachment[], selectedIndex = 0) {\n this.imagesToView = attachments;\n this.imagesToViewCurrentIndex = selectedIndex;\n }\n\n closeImageModal() {\n this.imagesToView = [];\n }\n\n stepImages(dir: -1 | 1) {\n this.imagesToViewCurrentIndex += dir * 1;\n }\n\n trackByImageUrl(_: number, item: Attachment) {\n return item.image_url || item.img_url || item.thumb_url;\n }\n\n get isImageModalPrevButtonVisible() {\n return this.imagesToViewCurrentIndex !== 0;\n }\n\n get isImageModalNextButtonVisible() {\n return this.imagesToViewCurrentIndex !== this.imagesToView.length - 1;\n }\n\n private createGallery(images: Attachment[]) {\n return [\n {\n type: 'gallery',\n images,\n },\n ];\n }\n}\n","<ng-container *ngFor=\"let attachment of orderedAttachments; trackBy: trackById\">\n <div\n data-testclass=\"attachment-container\"\n class=\"str-chat__message-attachment str-chat__message-attachment--{{\n attachment.type\n }}\"\n [class.str-chat__message-attachment--card]=\"isCard(attachment)\"\n [class.str-chat-angular__message-attachment-file-single]=\"\n isFile(attachment)\n \"\n >\n <img\n *ngIf=\"isImage(attachment)\"\n class=\"str-chat__message-attachment--img\"\n data-testclass=\"image\"\n [src]=\"attachment.img_url || attachment.thumb_url || attachment.image_url\"\n [alt]=\"attachment?.fallback\"\n (load)=\"imageLoaded()\"\n (click)=\"openImageModal([attachment])\"\n (keyup.enter)=\"openImageModal([attachment])\"\n />\n <div\n class=\"str-chat__gallery\"\n data-testid=\"image-gallery\"\n *ngIf=\"isGallery(attachment)\"\n [class.str-chat__gallery--square]=\"(attachment?.images)!.length > 3\"\n >\n <ng-container\n *ngFor=\"\n let galleryImage of attachment.images;\n let index = index;\n let isLast = last;\n trackBy: trackByImageUrl\n \"\n >\n <button\n *ngIf=\"index < 3 || (index === 3 && isLast)\"\n class=\"str-chat__gallery-image\"\n data-testclass=\"gallery-image\"\n (click)=\"openImageModal(attachment.images!, index)\"\n (keyup.enter)=\"openImageModal(attachment.images!, index)\"\n >\n <img\n [src]=\"\n galleryImage.img_url ||\n galleryImage.thumb_url ||\n galleryImage.image_url\n \"\n [alt]=\"galleryImage.fallback\"\n (load)=\"imageLoaded()\"\n />\n </button>\n <button\n *ngIf=\"index === 3 && !isLast\"\n class=\"str-chat__gallery-placeholder\"\n data-testclass=\"gallery-image\"\n (click)=\"openImageModal(attachment.images!, index)\"\n (keyup.enter)=\"openImageModal(attachment.images!, index)\"\n [ngStyle]=\"{\n 'background-image':\n 'url(' +\n (galleryImage.img_url ||\n galleryImage.thumb_url ||\n galleryImage.image_url) +\n ')'\n }\"\n >\n <p\n [innerHTML]=\"\n 'streamChat.{{ imageCount }} more'\n | translate: { imageCount: attachment!.images!.length - 4 }\n \"\n ></p>\n </button>\n </ng-container>\n </div>\n <div\n *ngIf=\"isFile(attachment)\"\n class=\"\n str-chat__message-attachment-file--item\n str-chat-angular__message-attachment-file-single\n \"\n >\n <stream-icon icon=\"file\" [size]=\"30\"></stream-icon>\n <div class=\"str-chat__message-attachment-file--item-text\">\n <a\n data-testclass=\"file-link\"\n download\n href=\"{{ attachment.asset_url }}\"\n target=\"_blank\"\n >\n {{ attachment.title }}\n </a>\n <span data-testclass=\"size\" *ngIf=\"hasFileSize(attachment)\">{{\n getFileSize(attachment)\n }}</span>\n </div>\n </div>\n <div\n *ngIf=\"isCard(attachment)\"\n class=\"str-chat__message-attachment-card str-chat__message-attachment-card--{{\n attachment.type\n }}\"\n >\n <div\n *ngIf=\"attachment.image_url || attachment.thumb_url\"\n class=\"str-chat__message-attachment-card--header\"\n >\n <img\n data-testclass=\"card-img\"\n alt=\"{{ attachment.image_url || attachment.thumb_url }}\"\n src=\"{{ attachment.image_url || attachment.thumb_url }}\"\n />\n </div>\n <div class=\"str-chat__message-attachment-card--content\">\n <div class=\"str-chat__message-attachment-card--flex\">\n <div\n *ngIf=\"attachment.title\"\n data-testclass=\"card-title\"\n class=\"str-chat__message-attachment-card--title\"\n >\n {{ attachment.title }}\n </div>\n <div\n *ngIf=\"attachment.text\"\n class=\"str-chat__message-attachment-card--text\"\n data-testclass=\"card-text\"\n >\n {{ attachment.text }}\n </div>\n <a\n class=\"str-chat__message-attachment-card--url\"\n *ngIf=\"attachment.title_link || attachment.og_scrape_url\"\n data-testclass=\"url-link\"\n noopener\n noreferrer\n href=\"{{ attachment.title_link || attachment.og_scrape_url }}\"\n target=\"_blank\"\n >\n {{ trimUrl(attachment.title_link || attachment.og_scrape_url) }}\n </a>\n </div>\n </div>\n </div>\n <div\n class=\"str-chat__message-attachment-actions\"\n *ngIf=\"attachment.actions && attachment.actions.length > 0\"\n >\n <div class=\"str-chat__message-attachment-actions-form\">\n <button\n *ngFor=\"let action of attachment.actions; trackBy: trackByActionValue\"\n class=\"str-chat__message-attachment-actions-button str-chat__message-attachment-actions-button--{{\n action.style\n }}\"\n data-testclass=\"attachment-action\"\n (click)=\"sendAction(action)\"\n (keyup.enter)=\"sendAction(action)\"\n >\n {{ action.text }}\n </button>\n </div>\n </div>\n </div>\n</ng-container>\n\n<stream-modal\n *ngIf=\"imagesToView && imagesToView.length > 0\"\n [isOpen]=\"imagesToView && imagesToView.length > 0\"\n (isOpenChange)=\"$event ? null : closeImageModal()\"\n>\n <div class=\"stream-chat-angular__image-modal\">\n <button\n class=\"stream-chat-angular__image-modal-stepper\"\n [ngStyle]=\"{\n visibility: isImageModalPrevButtonVisible ? 'visible' : 'hidden'\n }\"\n data-testid=\"image-modal-prev\"\n type=\"button\"\n (click)=\"stepImages(-1)\"\n (keyup.enter)=\"stepImages(-1)\"\n >\n <stream-icon icon=\"arrow-left\"></stream-icon>\n </button>\n <img\n class=\"stream-chat-angular__image-modal-image\"\n data-testid=\"modal-image\"\n [src]=\"\n imagesToView[imagesToViewCurrentIndex].img_url ||\n imagesToView[imagesToViewCurrentIndex].thumb_url ||\n imagesToView[imagesToViewCurrentIndex].image_url\n \"\n [alt]=\"imagesToView[imagesToViewCurrentIndex].fallback\"\n />\n <button\n class=\"stream-chat-angular__image-modal-stepper\"\n type=\"button\"\n [ngStyle]=\"{\n visibility: isImageModalNextButtonVisible ? 'visible' : 'hidden'\n }\"\n data-testid=\"image-modal-next\"\n (click)=\"stepImages(1)\"\n (keyup.enter)=\"stepImages(1)\"\n >\n <stream-icon icon=\"arrow-right\"></stream-icon>\n </button>\n </div>\n</stream-modal>\n","import { Component } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { AttachmentService } from '../attachment.service';\nimport { AttachmentUpload } from '../types';\n\n/**\n * The `AttachmentPreviewList` compontent displays a preview of the attachments uploaded to a message. Users can delete attachments using the preview component, or retry upload if it failed previously.\n */\n@Component({\n selector: 'stream-attachment-preview-list',\n templateUrl: './attachment-preview-list.component.html',\n styles: [],\n})\nexport class AttachmentPreviewListComponent {\n attachmentUploads$: Observable<AttachmentUpload[]>;\n\n constructor(private attachmentService: AttachmentService) {\n this.attachmentUploads$ = this.attachmentService.attachmentUploads$;\n }\n\n async retryAttachmentUpload(file: File) {\n await this.attachmentService.retryAttachmentUpload(file);\n }\n\n async deleteAttachment(upload: AttachmentUpload) {\n await this.attachmentService.deleteAttachment(upload);\n }\n\n trackByFile(_: number, item: AttachmentUpload) {\n return item.file;\n }\n}\n","<div class=\"rfu-image-previewer\" *ngIf=\"(attachmentUploads$ | async)?.length\">\n <ng-container\n *ngFor=\"\n let attachmentUpload of attachmentUploads$ | async;\n trackBy: trackByFile\n \"\n >\n <div\n *ngIf=\"attachmentUpload.type === 'image'\"\n class=\"rfu-image-previewer__image\"\n [class.rfu-image-previewer__image--loaded]=\"\n attachmentUpload.state === 'success'\n \"\n data-testclass=\"attachment-image-preview\"\n >\n <div\n *ngIf=\"attachmentUpload.state === 'error'\"\n class=\"rfu-image-previewer__retry\"\n (click)=\"retryAttachmentUpload(attachmentUpload.file)\"\n (keyup.enter)=\"retryAttachmentUpload(attachmentUpload.file)\"\n data-testclass=\"upload-error\"\n >\n <stream-icon icon=\"retry\"></stream-icon>\n </div>\n <div class=\"rfu-thumbnail__wrapper\" style=\"width: 100; height: 100\">\n <div class=\"rfu-thumbnail__overlay\">\n <div\n class=\"rfu-icon-button\"\n data-testclass=\"delete-attachment\"\n role=\"button\"\n (click)=\"deleteAttachment(attachmentUpload)\"\n (keyup.enter)=\"deleteAttachment(attachmentUpload)\"\n >\n <stream-icon icon=\"close\"></stream-icon>\n </div>\n </div>\n <img\n *ngIf=\"attachmentUpload.url || attachmentUpload.previewUri\"\n src=\"{{\n attachmentUpload.url\n ? attachmentUpload.url\n : attachmentUpload.previewUri\n }}\"\n alt=\"attachmentUpload.file.name\"\n class=\"rfu-thumbnail__image\"\n data-testclass=\"attachment-image\"\n />\n </div>\n <stream-loading-indicator\n data-testclass=\"loading-indicator\"\n color=\"rgba(255,255,255,0.7)\"\n *ngIf=\"attachmentUpload.state === 'uploading'\"\n ></stream-loading-indicator>\n </div>\n <div\n class=\"rfu-file-previewer\"\n *ngIf=\"attachmentUpload.type === 'file'\"\n data-testclass=\"attachment-file-preview\"\n >\n <ol>\n <li\n class=\"rfu-file-previewer__file\"\n [class.rfu-file-previewer__file--uploading]=\"\n attachmentUpload.state === 'uploading'\n \"\n [class.rfu-file-previewer__file--failed]=\"\n attachmentUpload.state === 'error'\n \"\n >\n <stream-icon icon=\"file\"></stream-icon>\n\n <a\n data-testclass=\"file-download-link\"\n href=\"{{ attachmentUpload.url }}\"\n (click)=\"attachmentUpload.url ? null : $event.preventDefault()\"\n (keyup.enter)=\"\n attachmentUpload.url ? null : $event.preventDefault()\n \"\n download\n >\n {{ attachmentUpload.file.name }}\n <ng-container *ngIf=\"attachmentUpload.state === 'error'\">\n <div\n data-testclass=\"file-upload-retry\"\n class=\"rfu-file-previewer__failed\"\n (click)=\"retryAttachmentUpload(attachmentUpload.file)\"\n (keyup.enter)=\"retryAttachmentUpload(attachmentUpload.file)\"\n translate\n >\n streamChat.failed\n </div>\n <div\n class=\"rfu-file-previewer__retry\"\n (click)=\"retryAttachmentUpload(attachmentUpload.file)\"\n (keyup.enter)=\"retryAttachmentUpload(attachmentUpload.file)\"\n translate\n >\n streamChat.retry\n </div>\n </ng-container>\n </a>\n\n <span\n data-testclass=\"file-delete\"\n class=\"rfu-file-previewer__close-button\"\n (click)=\"deleteAttachment(attachmentUpload)\"\n (keyup.enter)=\"deleteAttachment(attachmentUpload)\"\n >\n ✘\n </span>\n <div\n *ngIf=\"attachmentUpload.state === 'uploading'\"\n class=\"rfu-file-previewer__loading-indicator\"\n >\n <stream-loading-indicator></stream-loading-indicator>\n </div>\n </li>\n </ol>\n </div>\n </ng-container>\n</div>\n","import {\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n ComponentFactoryResolver,\n ComponentRef,\n ElementRef,\n EventEmitter,\n Inject,\n Input,\n OnChanges,\n OnDestroy,\n Output,\n SimpleChanges,\n TemplateRef,\n Type,\n ViewChild,\n} from '@angular/core';\nimport { ChatClientService } from '../chat-client.service';\nimport { combineLatest, Observable, Subject, Subscription, timer } from 'rxjs';\nimport { first, map, take, tap } from 'rxjs/operators';\nimport { AppSettings, Channel, UserResponse } from 'stream-chat';\nimport { AttachmentService } from '../attachment.service';\nimport { ChannelService } from '../channel.service';\nimport { textareaInjectionToken } from '../injection-tokens';\nimport { NotificationService } from '../notification.service';\nimport {\n AttachmentUpload,\n CommandAutocompleteListItemContext,\n MentionAutcompleteListItemContext,\n StreamMessage,\n} from '../types';\nimport { MessageInputConfigService } from './message-input-config.service';\nimport { TextareaDirective } from './textarea.directive';\nimport { TextareaInterface } from './textarea.interface';\nimport { isImageFile } from '../is-image-file';\nimport { EmojiInputService } from './emoji-input.service';\n\n/**\n * The `MessageInput` component displays an input where users can type their messages and upload files, and sends the message to the active channel. The component can be used to compose new messages or update existing ones. To send messages, the chat user needs to have the necessary [channel capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript).\n */\n@Component({\n selector: 'stream-message-input',\n templateUrl: './message-input.component.html',\n styles: [],\n providers: [AttachmentService, EmojiInputService],\n})\nexport class MessageInputComponent\n implements OnChanges, OnDestroy, AfterViewInit\n{\n /**\n * If file upload is enabled, the user can open a file selector from the input. Please note that the user also needs to have the necessary [channel capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript). If no value is provided, it is set from the [`MessageInputConfigService`](../services/MessageInputConfigService.mdx).\n */\n @Input() isFileUploadEnabled: boolean | undefined;\n /**\n * If true, users can mention other users in messages. You also [need to use the `AutocompleteTextarea`](../concepts/opt-in-architecture.mdx) for this feature to work. If no value is provided, it is set from the [`MessageInputConfigService`](../services/MessageInputConfigService.mdx).\n */\n @Input() areMentionsEnabled: boolean | undefined;\n /**\n * The scope for user mentions, either members of the current channel of members of the application. If no value is provided, it is set from the [`MessageInputConfigService`](../services/MessageInputConfigService.mdx).\n */\n @Input() mentionScope: 'channel' | 'application' | undefined;\n /**\n * You can provide your own template for the autocomplete list for user mentions. You also [need to use the `AutocompleteTextarea`](../concepts/opt-in-architecture.mdx) for this feature to work. If no value is provided, it is set from the [`MessageInputConfigService`](../services/MessageInputConfigService.mdx).\n */\n @Input() mentionAutocompleteItemTemplate:\n | TemplateRef<MentionAutcompleteListItemContext>\n | undefined;\n /**\n * You can provide your own template for the autocomplete list for commands. You also [need to use the `AutocompleteTextarea`](../concepts/opt-in-architecture.mdx) for this feature to work. If no value is provided, it is set from the [`MessageInputConfigService`](../services/MessageInputConfigService.mdx).\n */\n @Input() commandAutocompleteItemTemplate:\n | TemplateRef<CommandAutocompleteListItemContext>\n | undefined;\n /**\n * You can add an emoji picker by [providing your own emoji picker template](../code-examples/emoji-picker.mdx)\n */\n @Input() emojiPickerTemplate: TemplateRef<void> | undefined;\n /**\n * Determines if the message is being dispalyed in a channel or in a [thread](https://getstream.io/chat/docs/javascript/threads/?language=javascript).\n */\n @Input() mode: 'thread' | 'main' = 'main';\n /**\n * You can narrow the accepted file types by providing the [accepted types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept). By default every file type is accepted.\n * If no value is provided, it is set from the [`MessageInputConfigService`](../services/MessageInputConfigService.mdx).\n * @deprecated use [application settings](https://getstream.io/chat/docs/javascript/app_setting_overview/?language=javascript#file-uploads) instead\n */\n @Input() acceptedFileTypes: string[] | undefined;\n /**\n * If true, users can select multiple files to upload. If no value is provided, it is set from the [`MessageInputConfigService`](../services/MessageInputConfigService.mdx).\n */\n @Input() isMultipleFileUploadEnabled: boolean | undefined;\n /**\n * The message to edit\n */\n @Input() message: StreamMessage | undefined;\n /**\n * Emits when a message was successfuly sent or updated\n */\n @Output() readonly messageUpdate = new EventEmitter<void>();\n isFileUploadAuthorized: boolean | undefined;\n canSendLinks: boolean | undefined;\n canSendMessages: boolean | undefined;\n attachmentUploads$: Observable<AttachmentUpload[]>;\n textareaValue = '';\n textareaRef: ComponentRef<TextareaInterface> | undefined;\n mentionedUsers: UserResponse[] = [];\n quotedMessage: undefined | StreamMessage;\n typingStart$ = new Subject<void>();\n cooldown$: Observable<number> | undefined;\n isCooldownInProgress = false;\n @ViewChild('fileInput') private fileInput!: ElementRef<HTMLInputElement>;\n @ViewChild(TextareaDirective, { static: false })\n private textareaAnchor!: TextareaDirective;\n private subscriptions: Subscription[] = [];\n private hideNotification: Function | undefined;\n private isViewInited = false;\n private appSettings: AppSettings | undefined;\n private channel: Channel | undefined;\n constructor(\n private channelService: ChannelService,\n private notificationService: NotificationService,\n private attachmentService: AttachmentService,\n private configService: MessageInputConfigService,\n @Inject(textareaInjectionToken)\n private textareaType: Type<TextareaInterface>,\n private componentFactoryResolver: ComponentFactoryResolver,\n private cdRef: ChangeDetectorRef,\n private chatClient: ChatClientService,\n public emojiInputService: EmojiInputService\n ) {\n this.subscriptions.push(\n this.attachmentService.attachmentUploadInProgressCounter$.subscribe(\n (counter) => {\n if (counter === 0 && this.hideNotification) {\n this.hideNotification();\n this.hideNotification = undefined;\n }\n }\n )\n );\n this.subscriptions.push(\n this.channelService.activeChannel$.subscribe((channel) => {\n this.textareaValue = '';\n this.attachmentService.resetAttachmentUploads();\n const capabilities = channel?.data?.own_capabilities as string[];\n if (capabilities) {\n this.isFileUploadAuthorized =\n capabilities.indexOf('upload-file') !== -1;\n this.canSendLinks = capabilities.indexOf('send-links') !== -1;\n this.channel = channel;\n this.setCanSendMessages();\n }\n })\n );\n this.subscriptions.push(\n this.chatClient.appSettings$.subscribe(\n (appSettings) => (this.appSettings = appSettings)\n )\n );\n this.subscriptions.push(\n this.channelService.messageToQuote$.subscribe((m) => {\n const isThreadReply = m && m.parent_id;\n if (\n (this.mode === 'thread' && isThreadReply) ||\n (this.mode === 'thread' && this.quotedMessage && !m) ||\n (this.mode === 'main' && !isThreadReply)\n ) {\n this.quotedMessage = m;\n }\n })\n );\n this.attachmentUploads$ = this.attachmentService.attachmentUploads$;\n this.isFileUploadEnabled = this.configService.isFileUploadEnabled;\n this.acceptedFileTypes = this.configService.acceptedFileTypes;\n this.isMultipleFileUploadEnabled =\n this.configService.isMultipleFileUploadEnabled;\n this.areMentionsEnabled = this.configService.areMentionsEnabled;\n this.mentionAutocompleteItemTemplate =\n this.configService.mentionAutocompleteItemTemplate;\n this.mentionScope = this.configService.mentionScope;\n this.commandAutocompleteItemTemplate =\n this.configService.commandAutocompleteItemTemplate;\n this.emojiPickerTemplate = this.configService.emojiPickerTemplate;\n\n this.subscriptions.push(\n this.typingStart$.subscribe(\n () => void this.channelService.typingStarted(this.parentMessageId)\n )\n );\n\n this.subscriptions.push(\n combineLatest([\n this.channelService.latestMessageDateByUserByChannels$,\n this.channelService.activeChannel$,\n ])\n .pipe(\n map(\n ([latestMessages, channel]): [\n Date | undefined,\n Channel | undefined\n ] => [latestMessages[channel?.cid || ''], channel!]\n )\n )\n .subscribe(([latestMessageDate, channel]) => {\n const cooldown =\n (channel?.data?.cooldown as number) &&\n latestMessageDate &&\n Math.round(\n (channel?.data?.cooldown as number) -\n (new Date().getTime() - latestMessageDate.getTime()) / 1000\n );\n if (\n cooldown &&\n cooldown > 0 &&\n (channel?.data?.own_capabilities as string[]).includes('slow-mode')\n ) {\n this.startCooldown(cooldown);\n } else if (this.isCooldownInProgress) {\n this.stopCooldown();\n }\n })\n );\n }\n\n ngAfterViewInit(): void {\n this.isViewInited = true;\n this.initTextarea();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.message) {\n this.attachmentService.resetAttachmentUploads();\n if (this.isUpdate) {\n this.attachmentService.createFromAttachments(\n this.message!.attachments || []\n );\n this.textareaValue = this.message!.text || '';\n }\n }\n if (changes.isFileUploadEnabled) {\n this.configService.isFileUploadEnabled = this.isFileUploadEnabled;\n }\n if (changes.acceptedFileTypes) {\n this.configService.acceptedFileTypes = this.acceptedFileTypes;\n }\n if (changes.isMultipleFileUploadEnabled) {\n this.configService.isMultipleFileUploadEnabled =\n this.isMultipleFileUploadEnabled;\n }\n if (changes.areMentionsEnabled) {\n this.configService.areMentionsEnabled = this.areMentionsEnabled;\n }\n if (changes.mentionAutocompleteItemTemplate) {\n this.configService.mentionAutocompleteItemTemplate =\n this.mentionAutocompleteItemTemplate;\n }\n if (changes.commandAutocompleteItemTemplate) {\n this.configService.commandAutocompleteItemTemplate =\n this.commandAutocompleteItemTemplate;\n }\n if (changes.mentionScope) {\n this.configService.mentionScope = this.mentionScope;\n }\n if (changes.emojiPickerTemplate) {\n this.configService.emojiPickerTemplate = this.emojiPickerTemplate;\n }\n if (changes.mode) {\n this.setCanSendMessages();\n }\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n async messageSent() {\n let attachmentUploadInProgressCounter!: number;\n this.attachmentService.attachmentUploadInProgressCounter$\n .pipe(first())\n .subscribe((counter) => (attachmentUploadInProgressCounter = counter));\n if (attachmentUploadInProgressCounter > 0) {\n if (!this.hideNotification) {\n this.hideNotification =\n this.notificationService.addPermanentNotification(\n 'streamChat.Wait until all attachments have uploaded'\n );\n }\n return;\n }\n const attachments = this.attachmentService.mapToAttachments();\n const text = this.textareaValue;\n if (!text && (!attachments || attachments.length === 0)) {\n return;\n }\n if (this.containsLinks && !this.canSendLinks) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.Sending links is not allowed in this conversation'\n );\n return;\n }\n if (!this.isUpdate) {\n this.textareaValue = '';\n }\n try {\n await (this.isUpdate\n ? this.channelService.updateMessage({\n ...this.message!,\n text: text,\n attachments: attachments,\n })\n : this.channelService.sendMessage(\n text,\n attachments,\n this.mentionedUsers,\n this.parentMessageId,\n this.quotedMessage?.id\n ));\n this.messageUpdate.emit();\n if (!this.isUpdate) {\n this.attachmentService.resetAttachmentUploads();\n }\n } catch (error) {\n if (this.isUpdate) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.Edit message request failed'\n );\n }\n }\n void this.channelService.typingStopped(this.parentMessageId);\n if (this.quotedMessage) {\n this.deselectMessageToQuote();\n }\n }\n\n get containsLinks() {\n return /(?:(?:https?|ftp):\\/\\/)?[\\w/\\-?=%.]+\\.[\\w/\\-&?=%.]+/.test(\n this.textareaValue\n );\n }\n\n get accept() {\n return this.acceptedFileTypes ? this.acceptedFileTypes?.join(',') : '';\n }\n\n get quotedMessageAttachments() {\n const originalAttachments = this.quotedMessage?.attachments;\n return originalAttachments && originalAttachments.length\n ? [originalAttachments[0]]\n : [];\n }\n\n get disabledTextareaText() {\n if (!this.canSendMessages) {\n return this.mode === 'thread'\n ? \"streamChat.You can't send thread replies in this channel\"\n : \"streamChat.You can't send messages in this channel\";\n } else if (this.cooldown$) {\n return 'streamChat.Slow Mode ON';\n }\n return '';\n }\n\n async filesSelected(fileList: FileList | null) {\n if (!(await this.areAttachemntsValid(fileList))) {\n return;\n }\n await this.attachmentService.filesSelected(fileList);\n this.clearFileInput();\n }\n\n deselectMessageToQuote() {\n this.channelService.selectMessageToQuote(undefined);\n }\n\n private clearFileInput() {\n this.fileInput.nativeElement.value = '';\n }\n\n private get isUpdate() {\n return !!this.message;\n }\n\n private initTextarea() {\n if (!this.canSendMessages || this.textareaRef || !this.textareaAnchor) {\n return;\n }\n const componentFactory =\n this.componentFactoryResolver.resolveComponentFactory(this.textareaType);\n this.textareaRef =\n this.textareaAnchor.viewContainerRef.createComponent<any>(\n componentFactory\n );\n this.cdRef.detectChanges();\n }\n\n private async areAttachemntsValid(fileList: FileList | null) {\n if (!fileList || this.acceptedFileTypes) {\n return true;\n }\n if (!this.appSettings) {\n await this.chatClient.getAppSettings();\n }\n let isValid = true;\n Array.from(fileList).forEach((f) => {\n let hasBlockedExtension: boolean;\n let hasBlockedMimeType: boolean;\n let hasNotAllowedExtension: boolean;\n let hasNotAllowedMimeType: boolean;\n if (isImageFile(f)) {\n hasBlockedExtension =\n !!this.appSettings?.image_upload_config?.blocked_file_extensions?.find(\n (ext) => f.name.endsWith(ext)\n );\n hasBlockedMimeType =\n !!this.appSettings?.image_upload_config?.blocked_mime_types?.find(\n (type) => f.type === type\n );\n hasNotAllowedExtension =\n !!this.appSettings?.image_upload_config?.allowed_file_extensions\n ?.length &&\n !this.appSettings?.image_upload_config?.allowed_file_extensions?.find(\n (ext) => f.name.endsWith(ext)\n );\n hasNotAllowedMimeType =\n !!this.appSettings?.image_upload_config?.allowed_mime_types?.length &&\n !this.appSettings?.image_upload_config?.allowed_mime_types?.find(\n (type) => f.type === type\n );\n } else {\n hasBlockedExtension =\n !!this.appSettings?.file_upload_config?.blocked_file_extensions?.find(\n (ext) => f.name.endsWith(ext)\n );\n hasBlockedMimeType =\n !!this.appSettings?.file_upload_config?.blocked_mime_types?.find(\n (type) => f.type === type\n );\n hasNotAllowedExtension =\n !!this.appSettings?.file_upload_config?.allowed_file_extensions\n ?.length &&\n !this.appSettings?.file_upload_config?.allowed_file_extensions?.find(\n (ext) => f.name.endsWith(ext)\n );\n hasNotAllowedMimeType =\n !!this.appSettings?.file_upload_config?.allowed_mime_types?.length &&\n !this.appSettings?.file_upload_config?.allowed_mime_types?.find(\n (type) => f.type === type\n );\n }\n if (\n hasBlockedExtension ||\n hasBlockedMimeType ||\n hasNotAllowedExtension ||\n hasNotAllowedMimeType\n ) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.Unsupported file type: {{type}}',\n undefined,\n undefined,\n { type: f.type }\n );\n isValid = false;\n }\n });\n return isValid;\n }\n\n private setCanSendMessages() {\n const capabilities = this.channel?.data?.own_capabilities as string[];\n if (!capabilities) {\n this.canSendMessages = false;\n } else {\n this.canSendMessages =\n capabilities.indexOf(\n this.mode === 'main' ? 'send-message' : 'send-reply'\n ) !== -1;\n }\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n this.initTextarea();\n }\n }\n\n private get parentMessageId() {\n let parentMessageId: string | undefined = undefined;\n if (this.mode === 'thread') {\n this.channelService.activeParentMessageId$\n .pipe(first())\n .subscribe((id) => (parentMessageId = id));\n }\n\n return parentMessageId;\n }\n\n private startCooldown(cooldown: number) {\n this.isCooldownInProgress = true;\n this.cooldown$ = timer(0, 1000).pipe(\n take(cooldown + 1),\n map((v) => cooldown - v),\n tap((v) => {\n if (v === 0) {\n this.stopCooldown();\n }\n })\n );\n }\n\n private stopCooldown() {\n this.cooldown$ = undefined;\n this.isCooldownInProgress = false;\n // the anchor directive will be recreated because of *ngIf, so we will have to reinit the textarea as well\n this.textareaRef = undefined;\n // we can only create the textarea after the anchor was recreated, so we will have to wait a change detection cycle with setTimeout\n setTimeout(() => this.initTextarea());\n }\n}\n","<div\n class=\"{{\n mode === 'main' ? 'str-chat__input-flat' : 'str-chat__small-message-input'\n }}\"\n [class.str-chat__input-flat-has-attachments]=\"\n (attachmentUploads$ | async)!.length > 0\n \"\n [class.str-chat__input-flat-quoted]=\"!!quotedMessage\"\n>\n <div\n data-testid=\"quoted-message-container\"\n class=\"quoted-message-preview\"\n *ngIf=\"quotedMessage\"\n >\n <div class=\"quoted-message-preview-header\">\n <div>{{ \"streamChat.Reply to Message\" | translate }}</div>\n <button\n class=\"str-chat__square-button\"\n data-testid=\"remove-quote\"\n (click)=\"deselectMessageToQuote()\"\n (keyup.enter)=\"deselectMessageToQuote()\"\n >\n <stream-icon\n icon=\"close-no-outline\"\n style=\"font-size: 10px; line-height: 10px\"\n ></stream-icon>\n </button>\n </div>\n <div class=\"quoted-message-preview-content\">\n <stream-avatar\n data-testid=\"qouted-message-avatar\"\n class=\"str-chat-angular__avatar-host\"\n [imageUrl]=\"quotedMessage?.user?.image\"\n [name]=\"quotedMessage?.user?.name || quotedMessage?.user?.id\"\n [size]=\"20\"\n ></stream-avatar>\n <div class=\"quoted-message-preview-content-inner\">\n <stream-attachment-list\n *ngIf=\"\n quotedMessage?.attachments && quotedMessage?.attachments?.length\n \"\n [attachments]=\"quotedMessageAttachments\"\n [messageId]=\"quotedMessage?.id\"\n ></stream-attachment-list>\n <div\n data-testid=\"quoted-message-text\"\n [innerHTML]=\"quotedMessage?.html || quotedMessage?.text\"\n ></div>\n </div>\n </div>\n </div>\n <div class=\"str-chat__input-flat-wrapper\" style=\"width: 100%\">\n <div\n class=\"{{\n mode === 'main'\n ? 'str-chat__input-flat--textarea-wrapper'\n : 'str-chat__small-message-input--textarea-wrapper'\n }}\"\n >\n <stream-attachment-preview-list\n class=\"rfu-image-previewer-angular-host\"\n ></stream-attachment-preview-list>\n <div class=\"rta str-chat__textarea str-chat-angular__textarea\">\n <ng-container\n *ngIf=\"emojiPickerTemplate && !isCooldownInProgress\"\n data-testid=\"emoji-picker\"\n >\n <div\n class=\"\n str-chat__input-flat-emojiselect\n str-chat-angular__emojiselect\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n emojiPickerTemplate;\n context: { emojiInput$: emojiInputService.emojiInput$ }\n \"\n ></ng-container>\n </div>\n </ng-container>\n <div\n class=\"str-chat__input-flat-cooldown str-chat-angular__cooldown\"\n *ngIf=\"isCooldownInProgress\"\n data-testid=\"cooldown-timer\"\n >\n {{ cooldown$ | async }}\n </div>\n <ng-template\n *ngIf=\"canSendMessages && !isCooldownInProgress; else notAllowed\"\n streamTextarea\n [(value)]=\"textareaValue\"\n (valueChange)=\"typingStart$.next()\"\n (send)=\"messageSent()\"\n [componentRef]=\"textareaRef\"\n (userMentions)=\"mentionedUsers = $event\"\n [areMentionsEnabled]=\"areMentionsEnabled\"\n [mentionAutocompleteItemTemplate]=\"mentionAutocompleteItemTemplate\"\n [commandAutocompleteItemTemplate]=\"commandAutocompleteItemTemplate\"\n [mentionScope]=\"mentionScope\"\n ></ng-template>\n <ng-template #notAllowed>\n <textarea\n disabled\n rows=\"1\"\n [value]=\"disabledTextareaText | translate\"\n class=\"rta__textarea str-chat__textarea__textarea\"\n data-testid=\"disabled-textarea\"\n ></textarea>\n </ng-template>\n </div>\n <div\n *ngIf=\"\n isFileUploadEnabled &&\n isFileUploadAuthorized &&\n canSendMessages &&\n !isCooldownInProgress\n \"\n class=\"str-chat__fileupload-wrapper\"\n data-testid=\"file-upload-button\"\n >\n <div class=\"str-chat__tooltip\">\n {{ \"streamChat.Attach files\" | translate }}\n </div>\n <div class=\"rfu-file-upload-button\">\n <label>\n <input\n #fileInput\n type=\"file\"\n class=\"rfu-file-input\"\n data-testid=\"file-input\"\n [accept]=\"accept\"\n [multiple]=\"isMultipleFileUploadEnabled\"\n (change)=\"filesSelected(fileInput.files)\"\n />\n <span class=\"str-chat__input-flat-fileupload\">\n <stream-icon icon=\"file-upload\"></stream-icon>\n </span>\n </label>\n </div>\n </div>\n </div>\n <button\n *ngIf=\"canSendMessages\"\n data-testid=\"send-button\"\n class=\"str-chat__send-button\"\n (click)=\"messageSent()\"\n (keyup.enter)=\"messageSent()\"\n >\n <stream-icon icon=\"send\"></stream-icon>\n </button>\n </div>\n</div>\n","import { Component, Input } from '@angular/core';\nimport { NotificationType } from '../types';\n\n/**\n * The `Notification` component displays a notification within the [`NotificationList`](./NotificationListComponent.mdx)\n */\n@Component({\n selector: 'stream-notification',\n templateUrl: './notification.component.html',\n styles: [],\n})\nexport class NotificationComponent {\n /**\n * The type of the notification\n */\n @Input() type: NotificationType | undefined;\n\n constructor() {}\n}\n","<div\n class=\"str-chat__custom-notification notification-{{ type }}\"\n data-testid=\"custom-notification\"\n>\n <ng-content></ng-content>\n</div>\n","import { Component } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { NotificationService } from '../notification.service';\nimport { NotificationPayload } from '../types';\n\n/**\n * The `NotificationList` component displays the list of active notifications.\n */\n@Component({\n selector: 'stream-notification-list',\n templateUrl: './notification-list.component.html',\n styles: [],\n})\nexport class NotificationListComponent {\n notifications$: Observable<NotificationPayload[]>;\n\n constructor(private notificationService: NotificationService) {\n this.notifications$ = this.notificationService.notifications$;\n }\n\n trackById(_: number, item: NotificationPayload) {\n return item.id;\n }\n\n getTemplateContext(notification: NotificationPayload) {\n return {\n ...notification.templateContext,\n dismissFn: notification.dismissFn,\n };\n }\n}\n","<div class=\"str-chat__list-notifications\">\n <stream-notification\n *ngFor=\"let notification of notifications$ | async; trackBy: trackById\"\n [type]=\"notification.type\"\n >\n <div\n *ngIf=\"notification.text !== undefined\"\n data-testclass=\"notification-content\"\n >\n {{ notification.text | translate: notification.translateParams }}\n </div>\n <ng-container *ngIf=\"notification.template !== undefined\">\n <ng-container\n *ngTemplateOutlet=\"\n notification.template;\n context: getTemplateContext(notification)\n \"\n ></ng-container>\n </ng-container>\n </stream-notification>\n</div>\n","import {\n Component,\n EventEmitter,\n Input,\n OnChanges,\n Output,\n SimpleChanges,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport { ChannelService } from '../channel.service';\nimport { ChatClientService } from '../chat-client.service';\nimport { MessageInputComponent } from '../message-input/message-input.component';\nimport { NotificationService } from '../notification.service';\nimport { StreamMessage } from '../types';\n\n/**\n * @deprecated https://getstream.io/chat/docs/sdk/angular/components/message-actions/#required-enabledactions\n */\nexport type MessageActions =\n | 'edit'\n | 'delete'\n | 'edit-any'\n | 'delete-any'\n | 'pin'\n | 'quote'\n | 'flag'\n | 'mute';\n\n/**\n * The `MessageActionsBox` component displays a list of message actions (i.e edit), that can be opened or closed. You can find the [list of the supported actions](../concepts/message-interactions.mdx) in the message interaction guide.\n */\n@Component({\n selector: 'stream-message-actions-box',\n templateUrl: './message-actions-box.component.html',\n styles: [],\n})\nexport class MessageActionsBoxComponent implements OnChanges {\n /**\n * The input used for message edit. By default, the [default message input component](./MessageInputComponent.mdx) is used. To change the input for message edit, provide [your own custom template](./MessageInputComponent.mdx/#customization).\n */\n @Input() messageInputTemplate: TemplateRef<any> | undefined;\n /**\n * Indicates if the list should be opened or closed. Adding a UI element to open and close the list is the parent's component responsibility.\n */\n @Input() isOpen = false;\n /**\n * Indicates if the message actions are belonging to a message that was sent by the current user or not.\n */\n @Input() isMine = false;\n /**\n * The message the actions will be executed on\n */\n @Input() message: StreamMessage | undefined;\n /**\n * The list of [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) that are enabled for the current user, the list of [supported interactions](../concepts/message-interactions.mdx) can be found in our message interaction guide. Unathorized actions won't be displayed on the UI.\n */\n @Input() enabledActions: string[] = [];\n /**\n * The number of authorized actions (it can be less or equal than the number of enabled actions)\n */\n @Output() readonly displayedActionsCount = new EventEmitter<number>();\n /**\n * An event which emits `true` if the edit message modal is open, and `false` when it is closed.\n */\n @Output() readonly isEditing = new EventEmitter<boolean>();\n isEditModalOpen = false;\n @ViewChild(MessageInputComponent) private messageInput:\n | MessageInputComponent\n | undefined;\n\n constructor(\n private chatClientService: ChatClientService,\n private notificationService: NotificationService,\n private channelService: ChannelService\n ) {}\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.isMine || changes.enabledActions) {\n let displayedActionsCount = 0;\n if (this.isQuoteVisible) {\n displayedActionsCount++;\n }\n if (this.isEditVisible) {\n displayedActionsCount++;\n }\n if (this.isDeleteVisible) {\n displayedActionsCount++;\n }\n if (this.isMuteVisible) {\n displayedActionsCount++;\n }\n if (this.isFlagVisible) {\n displayedActionsCount++;\n }\n if (this.isPinVisible) {\n displayedActionsCount++;\n }\n this.displayedActionsCount.next(displayedActionsCount);\n }\n }\n\n get isQuoteVisible() {\n return (\n (this.enabledActions.indexOf('quote') !== -1 ||\n this.enabledActions.indexOf('quote-message') !== -1) &&\n !this.message?.quoted_message\n );\n }\n\n get isEditVisible() {\n return (\n ((this.enabledActions.indexOf('edit') !== -1 ||\n this.enabledActions.indexOf('update-own-message') !== -1) &&\n this.isMine) ||\n this.enabledActions.indexOf('edit-any') !== -1 ||\n this.enabledActions.indexOf('update-any-message') !== -1\n );\n }\n\n get isDeleteVisible() {\n return (\n ((this.enabledActions.indexOf('delete') !== -1 ||\n this.enabledActions.indexOf('delete-own-message') !== -1) &&\n this.isMine) ||\n this.enabledActions.indexOf('delete-any') !== -1 ||\n this.enabledActions.indexOf('delete-any-message') !== -1\n );\n }\n\n get isMuteVisible() {\n return this.enabledActions.indexOf('mute') !== -1;\n }\n\n get isFlagVisible() {\n return (\n (this.enabledActions.indexOf('flag') !== -1 ||\n this.enabledActions.indexOf('flag-message') !== -1) &&\n !this.isMine\n );\n }\n\n get isPinVisible() {\n return this.enabledActions.indexOf('pin') !== -1;\n }\n\n pinClicked() {\n alert('Feature not yet implemented');\n }\n\n async flagClicked() {\n try {\n await this.chatClientService.flagMessage(this.message!.id);\n this.notificationService.addTemporaryNotification(\n 'streamChat.Message has been successfully flagged',\n 'success'\n );\n } catch (err) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.Error adding flag'\n );\n }\n }\n\n muteClicked() {\n alert('Feature not yet implemented');\n }\n\n quoteClicked() {\n this.channelService.selectMessageToQuote(this.message);\n }\n\n editClicked() {\n this.isEditing.emit(true);\n this.isEditModalOpen = true;\n }\n\n sendClicked() {\n this.messageInput?.messageSent();\n }\n\n modalClosed = () => {\n this.isEditModalOpen = false;\n this.isEditing.emit(false);\n };\n\n async deleteClicked() {\n try {\n await this.channelService.deleteMessage(this.message!);\n } catch (error) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.Error deleting message'\n );\n }\n }\n}\n","<div\n data-testid=\"action-box\"\n class=\"str-chat__message-actions-box\"\n [class.str-chat__message-actions-box--open]=\"isOpen\"\n [class.str-chat__message-actions-box--mine]=\"isMine\"\n>\n <ul class=\"str-chat__message-actions-list\">\n <button\n data-testid=\"quote-action\"\n *ngIf=\"isQuoteVisible\"\n (click)=\"quoteClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Reply\" | translate }}\n </li>\n </button>\n <button\n data-testid=\"pin-action\"\n *ngIf=\"isPinVisible\"\n (click)=\"pinClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{\n (message?.pinned ? \"streamChat.Unpin\" : \"streamChat.Pin\") | translate\n }}\n </li>\n </button>\n <button\n data-testid=\"flag-action\"\n *ngIf=\"isFlagVisible\"\n (click)=\"flagClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Flag\" | translate }}\n </li>\n </button>\n <button\n data-testid=\"mute-action\"\n *ngIf=\"isMuteVisible\"\n (click)=\"muteClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Mute\" | translate }}\n </li>\n </button>\n <button\n data-testid=\"edit-action\"\n *ngIf=\"isEditVisible\"\n (click)=\"editClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Edit Message\" | translate }}\n </li>\n </button>\n <button\n data-testid=\"delete-action\"\n *ngIf=\"isDeleteVisible\"\n (click)=\"deleteClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Delete\" | translate }}\n </li>\n </button>\n </ul>\n</div>\n\n<stream-modal\n [isOpen]=\"isEditModalOpen\"\n (isOpenChange)=\"\n isEditModalOpen = $event; isEditModalOpen ? '' : modalClosed()\n \"\n>\n <div class=\"str-chat__edit-message-form\" *ngIf=\"isEditModalOpen\">\n <ng-container *ngIf=\"messageInputTemplate; else defaultInput\">\n <ng-container\n *ngTemplateOutlet=\"\n messageInputTemplate;\n context: {\n message: message,\n messageUpdateHandler: modalClosed\n }\n \"\n ></ng-container>\n </ng-container>\n <ng-template #defaultInput>\n <stream-message-input\n [message]=\"message\"\n (messageUpdate)=\"modalClosed()\"\n ></stream-message-input>\n </ng-template>\n <stream-notification-list></stream-notification-list>\n <div\n class=\"\n str-chat__message-team-form-footer\n str-chat__message-team-form-footer-angular\n \"\n >\n <div class=\"str-chat__edit-message-form-options\">\n <button translate data-testid=\"cancel-button\" (click)=\"modalClosed()\">\n streamChat.Cancel\n </button>\n <button\n type=\"submit\"\n translate\n data-testid=\"send-button\"\n (click)=\"sendClicked()\"\n (keyup.enter)=\"sendClicked()\"\n >\n streamChat.Send\n </button>\n </div>\n </div>\n </div>\n</stream-modal>\n","import { Component } from '@angular/core';\nimport { Observable, of, Subscription } from 'rxjs';\nimport { catchError, map, startWith } from 'rxjs/operators';\nimport { ChannelService } from '../channel.service';\n\n/**\n * The `Channel` component is a container component that displays the [`ChannelHeader`](./ChannelHeaderComponent.mdx), [`MessageList`](./MessageListComponent.mdx), [`NotificationList`](./NotificationListComponent.mdx) and [`MessageInput`](./MessageInputComponent.mdx) components. You can also provide the [`Thread`](./ThreadComponent.mdx) component to use message [threads](https://getstream.io/chat/docs/javascript/threads/?language=javascript).\n */\n@Component({\n selector: 'stream-channel',\n templateUrl: './channel.component.html',\n styles: [],\n})\nexport class ChannelComponent {\n isError$: Observable<boolean>;\n isInitializing$: Observable<boolean>;\n isActiveThread$: Observable<boolean>;\n subscriptions: Subscription[] = [];\n\n constructor(private channelService: ChannelService) {\n this.isError$ = this.channelService.channels$.pipe(\n map(() => false),\n catchError(() => of(true)),\n startWith(false)\n );\n this.isInitializing$ = this.channelService.channels$.pipe(\n map((channels) => !channels),\n catchError(() => of(false))\n );\n this.isActiveThread$ = this.channelService.activeParentMessageId$.pipe(\n map((id) => !!id)\n );\n }\n}\n","<div\n *ngIf=\"(isError$ | async) === false && (isInitializing$ | async) === false\"\n class=\"str-chat str-chat-channel messaging\"\n>\n <div class=\"str-chat__container\">\n <div class=\"str-chat__main-panel\">\n <ng-content></ng-content>\n </div>\n <ng-content\n *ngIf=\"isActiveThread$ | async\"\n select='[name=\"thread\"]'\n ></ng-content>\n </div>\n</div>\n","export type DeviceWidth = {\n device: 'mobile' | 'tablet' | 'full';\n width: number;\n};\n\nexport const getDeviceWidth = (): DeviceWidth => {\n const width = window.innerWidth;\n if (width < 768) return { device: 'mobile', width };\n if (width < 1024) return { device: 'tablet', width };\n return { device: 'full', width };\n};\n","import { Injectable } from '@angular/core';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { distinctUntilChanged, filter, first } from 'rxjs/operators';\nimport { getDeviceWidth } from '../device-width';\n\n/**\n * The `ChannelListToggleService` can be used to toggle the channel list.\n */\n@Injectable({ providedIn: 'root' })\nexport class ChannelListToggleService {\n /**\n * Emits `true` if the channel list is in open state, otherwise it emits `false`\n */\n isOpen$: Observable<boolean>;\n private isOpenSubject = new BehaviorSubject<boolean>(false);\n private menuElement: HTMLElement | undefined;\n\n constructor() {\n this.isOpen$ = this.isOpenSubject\n .asObservable()\n .pipe(distinctUntilChanged());\n this.isOpen$.pipe(filter((s) => s)).subscribe(() => {\n if (getDeviceWidth().device === 'mobile') {\n this.watchForOutsideClicks();\n }\n });\n }\n\n /**\n * Opens the channel list.\n */\n open() {\n this.isOpenSubject.next(true);\n }\n\n /**\n * Closes the channel list.\n */\n close() {\n this.isOpenSubject.next(false);\n }\n\n /**\n * Opens the channel list if it was closed, and closes if it was opened.\n */\n toggle() {\n this.isOpenSubject.getValue() ? this.close() : this.open();\n }\n\n /**\n * Sets the channel list element, on mobile screen size if the user opens the channel list, and clicks outside, the service automatically closes the channel list if a reference to the HTML element is provided.\n * @param element\n */\n setMenuElement(element: HTMLElement | undefined) {\n this.menuElement = element;\n }\n\n /**\n * This method should be called if a channel was selected, if on mobile, the channel list will be closed.\n */\n channelSelected() {\n if (getDeviceWidth().device === 'mobile') {\n this.close();\n }\n }\n\n private watchForOutsideClicks() {\n if (!this.menuElement) {\n return;\n }\n const eventHandler = (event: Event) => {\n if (!this.menuElement!.contains(event.target as Node)) {\n this.close();\n window.removeEventListener('click', eventHandler);\n }\n };\n window.addEventListener('click', eventHandler);\n this.isOpen$\n .pipe(\n filter((s) => !s),\n first()\n )\n .subscribe(() => window.removeEventListener('click', eventHandler));\n }\n}\n","import { Component, Input, TemplateRef } from '@angular/core';\nimport { Channel } from 'stream-chat';\nimport { ChannelListToggleService } from '../channel-list/channel-list-toggle.service';\nimport { ChannelService } from '../channel.service';\n\n/**\n * The `ChannelHeader` component displays the avatar and name of the currently active channel along with member and watcher information. You can read about [the difference between members and watchers](https://getstream.io/chat/docs/javascript/watch_channel/?language=javascript#watchers-vs-members) in the platform documentation. Please note that number of watchers is only displayed if the user has [`connect-events` capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript)\n */\n@Component({\n selector: 'stream-channel-header',\n templateUrl: './channel-header.component.html',\n styles: [],\n})\nexport class ChannelHeaderComponent {\n /**\n * Template that can be used to add actions (such as edit, invite) to the channel header\n */\n @Input() channelActionsTemplate?: TemplateRef<{ channel: Channel }>;\n activeChannel: Channel | undefined;\n canReceiveConnectEvents: boolean | undefined;\n\n constructor(\n private channelService: ChannelService,\n private channelListToggleService: ChannelListToggleService\n ) {\n this.channelService.activeChannel$.subscribe((c) => {\n this.activeChannel = c;\n const capabilities = this.activeChannel?.data\n ?.own_capabilities as string[];\n if (!capabilities) {\n return;\n }\n this.canReceiveConnectEvents =\n capabilities.indexOf('connect-events') !== -1;\n });\n }\n\n toggleMenu(event: Event) {\n event.stopPropagation();\n this.channelListToggleService.toggle();\n }\n\n get memberCountParam() {\n return { memberCount: this.activeChannel?.data?.member_count || 0 };\n }\n\n get watcherCountParam() {\n return { watcherCount: this.activeChannel?.state?.watcher_count || 0 };\n }\n}\n","<div class=\"str-chat__header-livestream\">\n <div\n class=\"str-chat__header-hamburger\"\n (click)=\"toggleMenu($event)\"\n (keyup.enter)=\"toggleMenu($event)\"\n >\n <stream-icon icon=\"menu\"></stream-icon>\n </div>\n <stream-avatar\n imageUrl=\"{{ activeChannel?.data?.image }}\"\n name=\"{{ activeChannel?.data?.name }}\"\n ></stream-avatar>\n <div class=\"str-chat__header-livestream-left\">\n <p data-testid=\"name\" class=\"str-chat__header-livestream-left--title\">\n {{ activeChannel?.data?.name }}\n </p>\n <p data-testid=\"info\" class=\"str-chat__header-livestream-left--members\">\n {{'streamChat.{{ memberCount }} members' | translate:memberCountParam}}\n {{canReceiveConnectEvents ? ('streamChat.{{ watcherCount }} online' |\n translate:watcherCountParam) : ''}}\n </p>\n </div>\n <ng-container *ngIf=\"channelActionsTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n channelActionsTemplate;\n context: { channel: activeChannel }\n \"\n ></ng-container>\n </ng-container>\n</div>\n","import { Component, Input, NgZone, OnDestroy, OnInit } from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport {\n Channel,\n Event,\n FormatMessageResponse,\n MessageResponse,\n} from 'stream-chat';\nimport { ChannelService } from '../channel.service';\n\n/**\n * The `ChannelPreview` component displays a channel preview in the channel list, it consists of the image, name and latest message of the channel.\n */\n@Component({\n selector: 'stream-channel-preview',\n templateUrl: './channel-preview.component.html',\n styles: [],\n})\nexport class ChannelPreviewComponent implements OnInit, OnDestroy {\n /**\n * The channel to be displayed\n */\n @Input() channel: Channel | undefined;\n isActive = false;\n isUnread = false;\n latestMessage: string = 'Nothing yet...';\n private subscriptions: (Subscription | { unsubscribe: () => void })[] = [];\n private canSendReadEvents = true;\n\n constructor(private channelService: ChannelService, private ngZone: NgZone) {}\n\n ngOnInit(): void {\n this.subscriptions.push(\n this.channelService.activeChannel$.subscribe(\n (activeChannel) =>\n (this.isActive = activeChannel?.id === this.channel?.id)\n )\n );\n const messages = this.channel?.state?.messages;\n if (messages && messages.length > 0) {\n this.setLatestMessage(messages[messages.length - 1]);\n }\n this.isUnread = !!this.channel!.countUnread() && this.canSendReadEvents;\n const capabilities =\n (this.channel?.data?.own_capabilities as string[]) || [];\n this.canSendReadEvents = capabilities.indexOf('read-events') !== -1;\n this.subscriptions.push(\n this.channel!.on('message.new', this.handleMessageEvent.bind(this))\n );\n this.subscriptions.push(\n this.channel!.on('message.updated', this.handleMessageEvent.bind(this))\n );\n this.subscriptions.push(\n this.channel!.on('message.deleted', this.handleMessageEvent.bind(this))\n );\n this.subscriptions.push(\n this.channel!.on('channel.truncated', this.handleMessageEvent.bind(this))\n );\n this.subscriptions.push(\n this.channel!.on('message.read', () =>\n this.ngZone.run(() => {\n this.isUnread =\n !!this.channel!.countUnread() && this.canSendReadEvents;\n })\n )\n );\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n get avatarImage() {\n return this.channel?.data?.image;\n }\n\n get avatarName() {\n return this.channel?.data?.name;\n }\n\n get title() {\n return this.channel?.data?.name;\n }\n\n setAsActiveChannel(): void {\n void this.channelService.setAsActiveChannel(this.channel!);\n }\n\n private handleMessageEvent(event: Event) {\n this.ngZone.run(() => {\n if (this.channel?.state.messages.length === 0) {\n this.latestMessage = 'Nothing yet...';\n return;\n }\n if (\n !event.message ||\n this.channel?.state.messages[this.channel?.state.messages.length - 1]\n .id !== event.message.id\n ) {\n return;\n }\n this.setLatestMessage(event.message);\n this.isUnread = !!this.channel.countUnread() && this.canSendReadEvents;\n });\n }\n\n private setLatestMessage(message?: FormatMessageResponse | MessageResponse) {\n if (message?.deleted_at) {\n this.latestMessage = 'streamChat.Message deleted';\n } else if (message?.text) {\n this.latestMessage = message.text;\n } else if (message?.attachments && message.attachments.length) {\n this.latestMessage = 'streamChat.🏙 Attachment...';\n }\n }\n}\n","<button\n class=\"str-chat__channel-preview-messenger\"\n [class.str-chat__channel-preview-messenger--active]=\"isActive\"\n [class.str-chat__channel-preview-messenger--unread]=\"isUnread\"\n (click)=\"setAsActiveChannel()\"\n data-testid=\"channel-preview-container\"\n>\n <div class=\"str-chat__channel-preview-messenger--left\">\n <stream-avatar\n imageUrl=\"{{ avatarImage }}\"\n name=\"{{ avatarName }}\"\n [size]=\"40\"\n ></stream-avatar>\n </div>\n <div class=\"str-chat__channel-preview-messenger--right\">\n <div class=\"str-chat__channel-preview-messenger--name\">\n <span data-testid=\"channel-preview-title\">{{ title }}</span>\n </div>\n <div\n data-testid=\"latest-message\"\n class=\"str-chat__channel-preview-messenger--last-message\"\n >\n {{ latestMessage | translate }}\n </div>\n </div>\n</button>\n","import {\n AfterViewInit,\n Component,\n ElementRef,\n Input,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport { Observable, of } from 'rxjs';\nimport { catchError, map, startWith } from 'rxjs/operators';\nimport { Channel } from 'stream-chat';\nimport { ChannelService } from '../channel.service';\nimport { ChannelListToggleService } from './channel-list-toggle.service';\n\n/**\n * The `ChannelList` component renders the list of channels.\n */\n@Component({\n selector: 'stream-channel-list',\n templateUrl: './channel-list.component.html',\n styles: [],\n})\nexport class ChannelListComponent implements AfterViewInit {\n /**\n * By default, the [default preview component](./ChannelPreviewComponent.mdx) is used. To change the contents of the channel list, [provide your own custom template](./ChannelPreviewComponent.mdx/#customization).\n */\n @Input() customChannelPreviewTemplate: TemplateRef<any> | undefined;\n channels$: Observable<Channel[] | undefined>;\n isError$: Observable<boolean>;\n isInitializing$: Observable<boolean>;\n isLoadingMoreChannels = false;\n isOpen$: Observable<boolean>;\n hasMoreChannels$: Observable<boolean>;\n @ViewChild('container') private container!: ElementRef<HTMLElement>;\n\n constructor(\n private channelService: ChannelService,\n private channelListToggleService: ChannelListToggleService\n ) {\n this.isOpen$ = this.channelListToggleService.isOpen$;\n this.channels$ = this.channelService.channels$;\n this.hasMoreChannels$ = this.channelService.hasMoreChannels$;\n this.isError$ = this.channels$.pipe(\n map(() => false),\n catchError(() => of(true)),\n startWith(false)\n );\n this.isInitializing$ = this.channels$.pipe(\n map((channels) => !channels),\n catchError(() => of(false))\n );\n }\n ngAfterViewInit(): void {\n this.channelListToggleService.setMenuElement(this.container.nativeElement);\n }\n\n async loadMoreChannels() {\n this.isLoadingMoreChannels = true;\n await this.channelService.loadMoreChannels();\n this.isLoadingMoreChannels = false;\n }\n\n trackByChannelId(index: number, item: Channel) {\n return item.cid;\n }\n\n channelSelected() {\n this.channelListToggleService.channelSelected();\n }\n}\n","<div\n #container\n data-testid=\"channel-list-container\"\n class=\"str-chat str-chat-channel-list messaging\"\n [class.str-chat-channel-list--open]=\"(isOpen$ | async) === true\"\n>\n <div\n *ngIf=\"\n (isError$ | async) === false && (isInitializing$ | async) === false;\n else statusIndicator\n \"\n class=\"str-chat__channel-list-messenger\"\n >\n <div class=\"str-chat__channel-list-messenger__main\">\n <p\n data-testid=\"empty-channel-list-indicator\"\n *ngIf=\"!(channels$ | async)?.length\"\n >\n {{ \"streamChat.You have no channels currently\" | translate }}\n </p>\n <ng-container\n *ngFor=\"let channel of channels$ | async; trackBy: trackByChannelId\"\n >\n <ng-container\n *ngIf=\"customChannelPreviewTemplate; else defaultTemplate\"\n >\n <div (click)=\"channelSelected()\" (keyup.enter)=\"channelSelected()\">\n <ng-container\n *ngTemplateOutlet=\"\n customChannelPreviewTemplate;\n context: { channel: channel }\n \"\n ></ng-container>\n </div>\n </ng-container>\n <ng-template #defaultTemplate>\n <stream-channel-preview\n data-testclass=\"channel-preview\"\n [channel]=\"channel\"\n (click)=\"channelSelected()\"\n (keyup.enter)=\"channelSelected()\"\n ></stream-channel-preview>\n </ng-template>\n </ng-container>\n <div\n *ngIf=\"hasMoreChannels$ | async\"\n class=\"str-chat__load-more-button\"\n (click)=\"loadMoreChannels()\"\n (keyup.enter)=\"loadMoreChannels()\"\n data-testid=\"load-more\"\n >\n <button\n class=\"str-chat__load-more-button__button\"\n data-testid=\"load-more-button\"\n [disabled]=\"isLoadingMoreChannels\"\n >\n <span *ngIf=\"!isLoadingMoreChannels; else loadingIndicator\">{{\n \"Load more\" | translate\n }}</span>\n <ng-template #loadingIndicator\n ><stream-loading-indicator></stream-loading-indicator\n ></ng-template>\n </button>\n </div>\n </div>\n </div>\n</div>\n\n<ng-template #statusIndicator>\n <ng-container *ngIf=\"isError$ | async\">\n <ng-container *ngTemplateOutlet=\"chatDown\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"isInitializing$ | async\">\n <ng-container *ngTemplateOutlet=\"loadingChannels\"></ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #chatDown>\n <div data-testid=\"chatdown-container\" class=\"str-chat__down\">\n <ng-container *ngTemplateOutlet=\"loadingChannels\"></ng-container>\n <div class=\"str-chat__down-main\">\n <stream-icon icon=\"connection-error\"></stream-icon>\n <h1>{{ \"streamChat.Connection error\" | translate }}</h1>\n <h3>\n {{\n \"streamChat.Error connecting to chat, refresh the page to try again.\"\n | translate\n }}\n </h3>\n </div>\n </div>\n</ng-template>\n\n<ng-template #loadingChannels>\n <div data-testid=\"loading-indicator\" class=\"str-chat__loading-channels\">\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #loadingChannel>\n <div class=\"str-chat__loading-channels-item\">\n <div class=\"str-chat__loading-channels-avatar\"></div>\n <div class=\"str-chat__loading-channels-meta\">\n <div class=\"str-chat__loading-channels-username\"></div>\n <div class=\"str-chat__loading-channels-status\"></div>\n </div>\n </div>\n</ng-template>\n","import Dayjs from 'dayjs';\nimport calendar from 'dayjs/plugin/calendar';\n\nDayjs.extend(calendar);\n\nexport const parseDate = (date: Date) => {\n const parsedTime = Dayjs(date);\n\n return parsedTime.calendar();\n};\n","import { UserResponse } from 'stream-chat';\n\nexport const getReadByText = (users: UserResponse[]) => {\n let outStr = '';\n\n const slicedArr = users.map((item) => item.name || item.id).slice(0, 5);\n const restLength = users.length - slicedArr.length;\n\n if (slicedArr.length === 1) {\n outStr = `${slicedArr[0]} `;\n } else if (slicedArr.length === 2) {\n // joins all with \"and\" but =no commas\n // example: \"bob and sam\"\n outStr = `${slicedArr[0]} and ${slicedArr[1]}`;\n } else if (slicedArr.length > 2) {\n // joins all with commas, but last one gets \", and\" (oxford comma!)\n // example: \"bob, joe, sam and 4 more\"\n if (restLength === 0) {\n // mutate slicedArr to remove last user to display it separately\n const lastUser = slicedArr.splice(slicedArr.length - 2, 1)[0];\n const commaSeparatedUsers = slicedArr.join(', ');\n outStr = `${commaSeparatedUsers}, and ${lastUser}`;\n } else {\n const commaSeparatedUsers = slicedArr.join(', ');\n outStr = `${commaSeparatedUsers} and ${restLength} more`;\n }\n }\n\n return outStr;\n};\n","import {\n AfterViewChecked,\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n Output,\n SimpleChanges,\n ViewChild,\n} from '@angular/core';\nimport { ReactionResponse } from 'stream-chat';\nimport { ChannelService } from '../channel.service';\nimport { DefaultReactionType, DefaultUserType } from '../types';\n\nexport type MessageReactionType =\n | 'angry'\n | 'haha'\n | 'like'\n | 'love'\n | 'sad'\n | 'wow';\n\nconst emojiReactionsMapping: { [key in MessageReactionType]: string } = {\n like: '👍',\n angry: '😠',\n love: '❤️',\n haha: '😂',\n wow: '😮',\n sad: '😞',\n};\n\n/**\n * The `MessageReactions` component displays the reactions of a message, the current user can add and remove reactions. You can read more about [message reactions](https://getstream.io/chat/docs/javascript/send_reaction/?language=javascript) in the platform documentation.\n */\n@Component({\n selector: 'stream-message-reactions',\n templateUrl: './message-reactions.component.html',\n styles: ['.emoji {position: relative; display: inline-block; }'],\n})\nexport class MessageReactionsComponent implements AfterViewChecked, OnChanges {\n /**\n * The id of the message the reactions belong to\n */\n @Input() messageId: string | undefined;\n /**\n * The number of reactions grouped by [reaction types](https://github.com/GetStream/stream-chat-angular/tree/master/projects/stream-chat-angular/src/lib/message-reactions/message-reactions.component.ts)\n */\n @Input() messageReactionCounts: { [key in MessageReactionType]?: number } =\n {};\n /**\n * Indicates if the selector should be opened or closed. Adding a UI element to open and close the selector is the parent's component responsibility.\n */\n @Input() isSelectorOpen: boolean = false;\n /**\n * List of reactions of a [message](../types/stream-message.mdx), used to display the users of a reaction type.\n */\n @Input() latestReactions: ReactionResponse<\n DefaultReactionType,\n DefaultUserType\n >[] = [];\n /**\n * List of the user's own reactions of a [message](../types/stream-message.mdx), used to display the users of a reaction type.\n */\n @Input() ownReactions: ReactionResponse<\n DefaultReactionType,\n DefaultUserType\n >[] = [];\n /**\n * Indicates if the selector should be opened or closed. Adding a UI element to open and close the selector is the parent's component responsibility.\n */\n @Output() readonly isSelectorOpenChange = new EventEmitter<boolean>();\n tooltipPositions: { arrow: number; tooltip: number } | undefined;\n tooltipText: string | undefined;\n @ViewChild('selectorContainer') private selectorContainer:\n | ElementRef<HTMLElement>\n | undefined;\n @ViewChild('selectorTooltip') private selectorTooltip:\n | ElementRef<HTMLElement>\n | undefined;\n currentTooltipTarget: HTMLElement | undefined;\n\n constructor(\n private cdRef: ChangeDetectorRef,\n private channelService: ChannelService\n ) {}\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.isSelectorOpen) {\n this.isSelectorOpen\n ? setTimeout(() => this.watchForOutsideClicks()) // setTimeout: wait for current click to bubble up, and only watch for clicks after that\n : this.stopWatchForOutsideClicks();\n }\n }\n\n ngAfterViewChecked(): void {\n if (this.tooltipText && !this.tooltipPositions) {\n this.setTooltipPosition();\n this.cdRef.detectChanges();\n }\n }\n\n get existingReactions(): MessageReactionType[] {\n return Object.keys(this.messageReactionCounts).filter(\n (k) => this.messageReactionCounts[k as MessageReactionType]! > 0\n ) as MessageReactionType[];\n }\n\n get reactionsCount() {\n return Object.values(this.messageReactionCounts).reduce(\n (total, count) => total + count,\n 0\n );\n }\n\n get reactionOptions(): MessageReactionType[] {\n return ['like', 'love', 'haha', 'wow', 'sad', 'angry'];\n }\n\n getLatestUserByReaction(reactionType: MessageReactionType) {\n return this.latestReactions.find((r) => r.type === reactionType && r.user)\n ?.user;\n }\n\n getEmojiByReaction(reactionType: MessageReactionType) {\n return emojiReactionsMapping[reactionType];\n }\n\n getUsersByReaction(reactionType: MessageReactionType) {\n return this.latestReactions\n .filter((r) => r.type === reactionType)\n .map((r) => r.user?.name || r.user?.id)\n .filter((i) => !!i)\n .join(', ');\n }\n\n showTooltip(event: Event, reactionType: MessageReactionType) {\n this.currentTooltipTarget = event.target as HTMLElement;\n this.tooltipText = this.getUsersByReaction(reactionType);\n }\n\n hideTooltip() {\n this.tooltipText = undefined;\n this.currentTooltipTarget = undefined;\n this.tooltipPositions = undefined;\n }\n\n trackByMessageReaction(index: number, item: MessageReactionType) {\n return item;\n }\n\n react(type: MessageReactionType) {\n this.ownReactions.find((r) => r.type === type)\n ? void this.channelService.removeReaction(this.messageId!, type)\n : void this.channelService.addReaction(this.messageId!, type);\n }\n\n private eventHandler = (event: Event) => {\n if (!this.selectorContainer?.nativeElement.contains(event.target as Node)) {\n this.isSelectorOpenChange.emit(false);\n }\n };\n\n private watchForOutsideClicks() {\n window.addEventListener('click', this.eventHandler);\n }\n\n private stopWatchForOutsideClicks() {\n window.removeEventListener('click', this.eventHandler);\n }\n\n private setTooltipPosition() {\n const tooltip = this.selectorTooltip?.nativeElement.getBoundingClientRect();\n const target = this.currentTooltipTarget?.getBoundingClientRect();\n\n const container =\n this.selectorContainer?.nativeElement.getBoundingClientRect();\n\n if (!tooltip || !target || !container) return;\n\n const tooltipPosition =\n tooltip.width === container.width || tooltip.x < container.x\n ? 0\n : target.left + target.width / 2 - container.left - tooltip.width / 2;\n\n const arrowPosition =\n target.x - tooltip.x + target.width / 2 - tooltipPosition;\n\n this.tooltipPositions = {\n tooltip: tooltipPosition,\n arrow: arrowPosition,\n };\n }\n}\n","<div\n *ngIf=\"existingReactions.length > 0 && !isSelectorOpen\"\n class=\"str-chat__reaction-list\"\n [class.str-chat__reaction-list--reverse]=\"true\"\n data-testid=\"reaction-list\"\n>\n <ul>\n <li\n *ngFor=\"\n let reactionType of existingReactions;\n trackBy: trackByMessageReaction\n \"\n data-testclass=\"emoji\"\n >\n <span class=\"emoji\">\n {{ getEmojiByReaction(reactionType) }}\n </span>\n &nbsp;\n </li>\n <li>\n <span\n data-testid=\"reactions-count\"\n class=\"str-chat__reaction-list--counter\"\n >{{ reactionsCount }}</span\n >\n </li>\n </ul>\n</div>\n\n<div\n #selectorContainer\n class=\"str-chat__reaction-selector\"\n *ngIf=\"isSelectorOpen\"\n data-testid=\"reaction-selector\"\n>\n <div\n *ngIf=\"tooltipText\"\n data-testid=\"tooltip\"\n #selectorTooltip\n class=\"str-chat__reaction-selector-tooltip\"\n [ngStyle]=\"{\n left: tooltipPositions?.tooltip + 'px',\n visibility: tooltipPositions ? 'visible' : 'hidden'\n }\"\n >\n <div\n class=\"arrow\"\n [ngStyle]=\"{ left: tooltipPositions?.arrow + 'px' }\"\n ></div>\n <span class=\"latest-user-username\">\n {{ tooltipText }}\n </span>\n </div>\n <ul class=\"str-chat__message-reactions-list\">\n <li\n class=\"str-chat__message-reactions-list-item str-chat__emoji\"\n *ngFor=\"\n let reactionType of reactionOptions;\n trackBy: trackByMessageReaction\n \"\n data-testclass=\"emoji-option\"\n (click)=\"react(reactionType)\"\n (keyup.enter)=\"react(reactionType)\"\n >\n <div\n *ngIf=\"getLatestUserByReaction(reactionType) as user\"\n class=\"latest-user\"\n (click)=\"hideTooltip()\"\n (keyup.enter)=\"hideTooltip()\"\n (mouseenter)=\"showTooltip($event, reactionType)\"\n (mouseleave)=\"hideTooltip()\"\n attr.data-testid=\"{{ reactionType }}-last-user\"\n >\n <stream-avatar\n attr.data-testid=\"{{ reactionType }}-avatar\"\n [imageUrl]=\"user.image\"\n [name]=\"user.name || user.id\"\n [size]=\"20\"\n ></stream-avatar>\n </div>\n <span class=\"emoji\" style=\"width: 20px; height: 20px; top: 10px\">\n {{ getEmojiByReaction(reactionType) }}\n </span>\n <span\n *ngIf=\"\n messageReactionCounts[reactionType] &&\n messageReactionCounts[reactionType]! > 0\n \"\n class=\"str-chat__message-reactions-list-item__count\"\n attr.data-testid=\"{{ reactionType }}-reaction-count\"\n >\n {{ messageReactionCounts[reactionType] }}\n </span>\n </li>\n </ul>\n</div>\n","import {\n Component,\n ElementRef,\n Input,\n TemplateRef,\n OnChanges,\n SimpleChanges,\n ViewChild,\n} from '@angular/core';\nimport { UserResponse } from 'stream-chat';\nimport { ChannelService } from '../channel.service';\nimport { ChatClientService } from '../chat-client.service';\nimport { getDeviceWidth } from '../device-width';\nimport { DefaultUserType, StreamMessage } from '../types';\nimport { parseDate } from './parse-date';\nimport { getReadByText } from './read-by-text';\nimport emojiRegex from 'emoji-regex';\n\ntype MessagePart = {\n content: string;\n type: 'text' | 'mention';\n user?: UserResponse;\n};\n\n/**\n * The `Message` component displays a message with additional information such as sender and date, and enables [interaction with the message (i.e. edit or react)](../concepts/message-interactions.mdx).\n */\n@Component({\n selector: 'stream-message',\n templateUrl: './message.component.html',\n styles: [],\n})\nexport class MessageComponent implements OnChanges {\n /**\n * The input used for message edit. By default, the [default message input component](./MessageInputComponent.mdx) is used. To change the input for message edit, provide [your own custom template](./MessageInputComponent.mdx/#customization).\n */\n @Input() messageInputTemplate: TemplateRef<any> | undefined;\n /**\n * The template used to display a mention in a message. It receives the mentioned user in a variable called `user` with the type [`UserResponse`](https://github.com/GetStream/stream-chat-js/blob/master/src/types.ts). You can provide your own template if you want to [add actions to mentions](../code-examples/mention-actions.mdx).\n */\n @Input() mentionTemplate: TemplateRef<any> | undefined;\n /**\n * The message to be displayed\n */\n @Input() message: StreamMessage | undefined;\n /**\n * The list of [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) that are enabled for the current user, the list of [supported interactions](../concepts/message-interactions.mdx) can be found in our message interaction guide. Unathorized actions won't be displayed on the UI. The [`MessageList`](./MessageListComponent.mdx) component automatically sets this based on [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript).\n */\n @Input() enabledMessageActions: string[] = [];\n /**\n * If true, the message reactions are displayed. If you use the default chat UI you can also set this using the [`MessageList`](./MessageListComponent.mdx) component.\n * @deprecated use [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) instead\n */\n @Input() areReactionsEnabled: boolean | undefined;\n /**\n * If true, the user can add reactions to the message. The [`MessageList`](./MessageListComponent.mdx) component automatically sets this based on [channel capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript).\n * @deprecated use [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) instead\n */\n @Input() canReactToMessage: boolean | undefined;\n /**\n * If `true`, the message status (sending, sent, who read the message) is displayed.\n */\n @Input() isLastSentMessage: boolean | undefined;\n /**\n * If true, the read indicator is displayed. The [`MessageList`](./MessageListComponent.mdx) component automatically sets this based on [channel capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript).\n * @deprecated use [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) instead\n */\n @Input() canReceiveReadEvents: boolean | undefined;\n /**\n * Determines if the message is being dispalyed in a channel or in a [thread](https://getstream.io/chat/docs/javascript/threads/?language=javascript).\n */\n @Input() mode: 'thread' | 'main' = 'main';\n isEditing: boolean | undefined;\n isActionBoxOpen = false;\n isReactionSelectorOpen = false;\n isPressedOnMobile = false;\n visibleMessageActionsCount = 0;\n messageTextParts: MessagePart[] = [];\n private user: UserResponse<DefaultUserType> | undefined;\n @ViewChild('container') private container:\n | ElementRef<HTMLElement>\n | undefined;\n\n constructor(\n private chatClientService: ChatClientService,\n private channelService: ChannelService\n ) {\n this.user = this.chatClientService.chatClient.user;\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.message) {\n this.createMessageParts();\n }\n }\n\n get isSentByCurrentUser() {\n return this.message?.user?.id === this.user?.id;\n }\n\n get readByText() {\n return getReadByText(this.message!.readBy);\n }\n\n get lastReadUser() {\n return this.message?.readBy.filter((u) => u.id !== this.user?.id)[0];\n }\n\n get isOnlyReadByMe() {\n return this.message && this.message.readBy.length === 0;\n }\n\n get isReadByMultipleUsers() {\n return this.message && this.message.readBy.length > 1;\n }\n\n get isMessageDeliveredAndRead() {\n return (\n this.message &&\n this.message.readBy &&\n this.message.status === 'received' &&\n this.message.readBy.length > 0\n );\n }\n\n get parsedDate() {\n if (!this.message || !this.message?.created_at) {\n return;\n }\n return parseDate(this.message.created_at);\n }\n\n get areOptionsVisible() {\n if (!this.message) {\n return false;\n }\n return !(\n !this.message.type ||\n this.message.type === 'error' ||\n this.message.type === 'system' ||\n this.message.type === 'ephemeral' ||\n this.message.status === 'failed' ||\n this.message.status === 'sending' ||\n (this.mode === 'thread' && !this.message.parent_id)\n );\n }\n\n get hasAttachment() {\n return !!this.message?.attachments && !!this.message.attachments.length;\n }\n\n get hasReactions() {\n return (\n !!this.message?.reaction_counts &&\n Object.keys(this.message.reaction_counts).length > 0\n );\n }\n\n get replyCountParam() {\n return { replyCount: this.message?.reply_count };\n }\n\n get canDisplayReadStatus() {\n return (\n this.canReceiveReadEvents !== false &&\n this.enabledMessageActions.indexOf('read-events') !== -1\n );\n }\n\n get quotedMessageAttachments() {\n const originalAttachments = this.message?.quoted_message?.attachments;\n return originalAttachments && originalAttachments.length\n ? [originalAttachments[0]]\n : [];\n }\n\n resendMessage() {\n void this.channelService.resendMessage(this.message!);\n }\n\n textClicked() {\n if (getDeviceWidth().device !== 'mobile') {\n this.isPressedOnMobile = false;\n return;\n }\n if (this.isPressedOnMobile) {\n return;\n }\n this.isPressedOnMobile = true;\n const eventHandler = (event: Event) => {\n if (!this.container?.nativeElement.contains(event.target as Node)) {\n this.isPressedOnMobile = false;\n window.removeEventListener('click', eventHandler);\n }\n };\n window.addEventListener('click', eventHandler);\n }\n\n setAsActiveParentMessage() {\n void this.channelService.setAsActiveParentMessage(this.message);\n }\n\n private createMessageParts() {\n let content = this.message?.html || this.message?.text;\n if (!content) {\n this.messageTextParts = [];\n } else {\n // Backend will wrap HTML content with <p></p>\\n\n if (content.startsWith('<p>')) {\n content = content.replace('<p>', '');\n }\n if (content.endsWith('</p>\\n')) {\n content = content.replace('</p>\\n', '');\n }\n if (\n !this.message!.mentioned_users ||\n this.message!.mentioned_users.length === 0\n ) {\n // Wrap emojis in span to display emojis correctly in Chrome https://bugs.chromium.org/p/chromium/issues/detail?id=596223\n const regex = new RegExp(emojiRegex(), 'g');\n content = content.replace(\n regex,\n (match) => `<span class=\"str-chat__emoji-display-fix\">${match}</span>`\n );\n this.messageTextParts = [{ content, type: 'text' }];\n } else {\n this.messageTextParts = [];\n let text = content;\n this.message!.mentioned_users.forEach((user) => {\n const mention = `@${user.name || user.id}`;\n const precedingText = text.substring(0, text.indexOf(mention));\n this.messageTextParts.push({\n content: precedingText,\n type: 'text',\n });\n this.messageTextParts.push({\n content: mention,\n type: 'mention',\n user,\n });\n text = text.replace(precedingText + mention, '');\n });\n if (text) {\n this.messageTextParts.push({ content: text, type: 'text' });\n }\n }\n }\n }\n}\n","<div\n #container\n class=\"str-chat__message-simple str-chat__message str-chat__message--{{\n message?.type\n }} str-chat__message--{{ message?.status }} {{\n message?.text ? 'str-chat__message--has-text' : 'has-no-text'\n }}\"\n [class.str-chat__message--me]=\"isSentByCurrentUser\"\n [class.str-chat__message-simple--me]=\"isSentByCurrentUser\"\n [class.mobile-press]=\"isPressedOnMobile\"\n [class.str-chat__message--has-attachment]=\"hasAttachment\"\n [class.str-chat__message--with-reactions]=\"\n areReactionsEnabled !== false && hasReactions\n \"\n data-testid=\"message-container\"\n (mouseleave)=\"isActionBoxOpen = false\"\n>\n <ng-container *ngIf=\"!message?.deleted_at; else deletedMessage\">\n <ng-container *ngIf=\"message?.type !== 'system'; else systemMessage\">\n <ng-container\n *ngIf=\"\n isSentByCurrentUser &&\n ((isLastSentMessage && message?.status === 'received') ||\n message?.status === 'sending')\n \"\n >\n <ng-container *ngIf=\"message?.status === 'sending'; else sentStatus\">\n <ng-container *ngTemplateOutlet=\"sendingStatus\"></ng-container>\n </ng-container>\n <ng-template #sentStatus>\n <ng-container\n *ngIf=\"\n mode === 'main' &&\n isMessageDeliveredAndRead &&\n canDisplayReadStatus;\n else deliveredStatus\n \"\n >\n <ng-container *ngTemplateOutlet=\"readStatus\"></ng-container>\n </ng-container>\n </ng-template>\n </ng-container>\n <stream-avatar\n data-testid=\"avatar\"\n class=\"str-chat-angular__avatar-host\"\n [imageUrl]=\"message?.user?.image\"\n [name]=\"message?.user?.name || message?.user?.id\"\n ></stream-avatar>\n <div class=\"str-chat__message-inner\">\n <div\n class=\"str-chat__message-simple__actions\"\n data-testid=\"message-options\"\n *ngIf=\"areOptionsVisible\"\n >\n <div\n data-testid=\"message-actions-container\"\n class=\"\n str-chat__message-simple__actions__action\n str-chat__message-simple__actions__action--options\n \"\n [class.str-chat-angular__message-simple__actions__action--options--editing]=\"\n isEditing\n \"\n >\n <stream-message-actions-box\n [isOpen]=\"isActionBoxOpen\"\n [isMine]=\"isSentByCurrentUser\"\n [enabledActions]=\"enabledMessageActions\"\n [message]=\"message\"\n (displayedActionsCount)=\"visibleMessageActionsCount = $event\"\n (isEditing)=\"isEditing = $event; isActionBoxOpen = !isEditing\"\n [messageInputTemplate]=\"messageInputTemplate\"\n ></stream-message-actions-box>\n <stream-icon\n *ngIf=\"visibleMessageActionsCount > 0\"\n data-testid=\"action-icon\"\n icon=\"action-icon\"\n (keyup.enter)=\"isActionBoxOpen = !isActionBoxOpen\"\n (click)=\"isActionBoxOpen = !isActionBoxOpen\"\n ></stream-icon>\n </div>\n <!-- eslint-disable @angular-eslint/template/conditional-complexity -->\n <div\n *ngIf=\"\n enabledMessageActions.indexOf('send-reply') !== -1 &&\n mode === 'main'\n \"\n class=\"\n str-chat__message-simple__actions__action\n str-chat__message-simple__actions__action--thread\n \"\n data-testid=\"reply-in-thread\"\n (click)=\"setAsActiveParentMessage()\"\n (keyup.enter)=\"setAsActiveParentMessage()\"\n >\n <stream-icon icon=\"reply-in-thread\"></stream-icon>\n </div>\n <div\n *ngIf=\"\n areReactionsEnabled !== false &&\n canReactToMessage !== false &&\n enabledMessageActions.indexOf('send-reaction') !== -1\n \"\n class=\"\n str-chat__message-simple__actions__action\n str-chat__message-simple__actions__action--reactions\n \"\n data-testid=\"reaction-icon\"\n (click)=\"isReactionSelectorOpen = !isReactionSelectorOpen\"\n (keyup.enter)=\"isReactionSelectorOpen = !isReactionSelectorOpen\"\n >\n <stream-icon icon=\"reaction-icon\"></stream-icon>\n </div>\n </div>\n <!-- eslint-enable @angular-eslint/template/conditional-complexity -->\n <stream-message-reactions\n *ngIf=\"areReactionsEnabled !== false\"\n [messageReactionCounts]=\"message?.reaction_counts || {}\"\n [latestReactions]=\"message?.latest_reactions || []\"\n [(isSelectorOpen)]=\"isReactionSelectorOpen\"\n [messageId]=\"message?.id\"\n [ownReactions]=\"message?.own_reactions || []\"\n ></stream-message-reactions>\n <stream-attachment-list\n *ngIf=\"hasAttachment && !message?.quoted_message\"\n [attachments]=\"message!.attachments!\"\n [messageId]=\"message!.id\"\n ></stream-attachment-list>\n <div class=\"str-chat__message-text\" *ngIf=\"message?.text\">\n <div\n data-testid=\"inner-message\"\n class=\"\n str-chat__message-text-inner str-chat__message-simple-text-inner\n \"\n [class.str-chat__message-light-text-inner--has-attachment]=\"\n hasAttachment\n \"\n (click)=\"\n message?.status === 'failed' && message?.errorStatusCode !== 403\n ? resendMessage()\n : undefined\n \"\n (keyup.enter)=\"\n message?.status === 'failed' && message?.errorStatusCode !== 403\n ? resendMessage()\n : undefined\n \"\n >\n <ng-container *ngTemplateOutlet=\"quotedMessage\"></ng-container>\n <stream-attachment-list\n *ngIf=\"hasAttachment && message?.quoted_message\"\n [attachments]=\"message!.attachments!\"\n [messageId]=\"message!.id\"\n ></stream-attachment-list>\n <div\n data-testid=\"client-error-message\"\n *ngIf=\"message?.type === 'error'\"\n class=\"str-chat__simple-message--error-message\"\n >\n {{ \"streamChat.Error · Unsent\" | translate }}\n </div>\n <div\n data-testid=\"error-message\"\n *ngIf=\"message?.status === 'failed'\"\n class=\"str-chat__simple-message--error-message\"\n >\n {{\n (message?.errorStatusCode === 403\n ? \"streamChat.Message Failed · Unauthorized\"\n : \"streamChat.Message Failed · Click to try again\"\n ) | translate\n }}\n </div>\n <div\n (click)=\"textClicked()\"\n (keyup.enter)=\"textClicked()\"\n data-testid=\"text\"\n >\n <p>\n <!-- eslint-disable-next-line @angular-eslint/template/use-track-by-function -->\n <ng-container *ngFor=\"let part of messageTextParts\">\n <span\n *ngIf=\"part.type === 'text'; else mention\"\n [innerHTML]=\"part.content\"\n ></span>\n <ng-template #mention>\n <ng-container *ngIf=\"mentionTemplate; else defaultMention\">\n <ng-container\n *ngTemplateOutlet=\"\n mentionTemplate;\n context: { user: part.user! }\n \"\n ></ng-container>\n </ng-container>\n <ng-template #defaultMention>\n <b>{{ part.content }}</b>\n </ng-template>\n </ng-template>\n </ng-container>\n </p>\n </div>\n </div>\n </div>\n <div class=\"str-chat__message-simple-reply-button\">\n <button\n *ngIf=\"\n !!message?.reply_count &&\n mode !== 'thread' &&\n enabledMessageActions.indexOf('send-reply') !== -1\n \"\n class=\"str-chat__message-replies-count-button\"\n data-testid=\"reply-count-button\"\n (click)=\"setAsActiveParentMessage()\"\n >\n <stream-icon icon=\"reply\"></stream-icon>\n {{message?.reply_count === 1 ? ('streamChat.1 reply' | translate) : ('streamChat.{{ replyCount }}\n replies' | translate:replyCountParam)}}\n </button>\n </div>\n <div class=\"str-chat__message-data str-chat__message-simple-data\">\n <span\n data-testid=\"sender\"\n *ngIf=\"!isSentByCurrentUser\"\n class=\"str-chat__message-simple-name\"\n >\n {{ message?.user?.name ? message?.user?.name : message?.user?.id }}\n </span>\n <span data-testid=\"date\" class=\"str-chat__message-simple-timestamp\">\n {{ parsedDate }}\n </span>\n </div>\n </div>\n </ng-container>\n </ng-container>\n</div>\n\n<ng-template #sendingStatus>\n <span\n class=\"\n str-chat__message-simple-status str-chat__message-simple-status-angular\n \"\n data-testid=\"sending-indicator\"\n >\n <div class=\"str-chat__tooltip\">\n {{ \"streamChat.Sending...\" | translate }}\n </div>\n <stream-loading-indicator\n data-testid=\"loading-indicator\"\n ></stream-loading-indicator>\n </span>\n</ng-template>\n<ng-template #readStatus>\n <span\n class=\"\n str-chat__message-simple-status str-chat__message-simple-status-angular\n \"\n data-testid=\"read-indicator\"\n >\n <div class=\"str-chat__tooltip\" data-testid=\"read-by-tooltip\">\n {{ readByText }}\n </div>\n <stream-avatar\n class=\"str-chat-angular__avatar-host\"\n data-test-id=\"last-read-user-avatar\"\n [size]=\"15\"\n [imageUrl]=\"lastReadUser?.image\"\n [name]=\"lastReadUser?.name || lastReadUser?.id\"\n ></stream-avatar>\n <span\n data-test-id=\"read-by-length\"\n *ngIf=\"isReadByMultipleUsers\"\n class=\"str-chat__message-simple-status-number\"\n >\n {{ (message?.readBy)!.length }}\n </span>\n </span>\n</ng-template>\n<ng-template #deliveredStatus>\n <span\n *ngIf=\"mode === 'main'\"\n class=\"\n str-chat__message-simple-status str-chat__message-simple-status-angular\n \"\n data-testid=\"delivered-indicator\"\n >\n <div class=\"str-chat__tooltip\">\n {{ \"streamChat.Delivered\" | translate }}\n </div>\n <stream-icon\n data-testid=\"delivered-icon\"\n icon=\"delivered-icon\"\n ></stream-icon>\n </span>\n</ng-template>\n\n<ng-template #deletedMessage>\n <div data-testid=\"message-deleted-component\">\n <div class=\"str-chat__message--deleted-inner\" translate>\n streamChat.This message was deleted...\n </div>\n </div>\n</ng-template>\n\n<ng-template #systemMessage>\n <div data-testid=\"system-message\" class=\"str-chat__message--system\">\n <div class=\"str-chat__message--system__text\">\n <div class=\"str-chat__message--system__line\"></div>\n <p>{{ message?.text }}</p>\n <div class=\"str-chat__message--system__line\"></div>\n </div>\n <div class=\"str-chat__message--system__date\">\n {{ parsedDate }}\n </div>\n </div>\n</ng-template>\n\n<ng-template #quotedMessage>\n <div\n *ngIf=\"message?.quoted_message\"\n class=\"quoted-message\"\n data-testid=\"quoted-message-container\"\n [class.mine]=\"isSentByCurrentUser\"\n >\n <stream-avatar\n data-testid=\"qouted-message-avatar\"\n class=\"str-chat-angular__avatar-host\"\n [imageUrl]=\"message?.quoted_message?.user?.image\"\n [name]=\"\n message?.quoted_message?.user?.name || message?.quoted_message?.user?.id\n \"\n [size]=\"20\"\n ></stream-avatar>\n <div class=\"quoted-message-inner\">\n <stream-attachment-list\n *ngIf=\"\n message?.quoted_message?.attachments &&\n message?.quoted_message?.attachments?.length\n \"\n [attachments]=\"quotedMessageAttachments\"\n [messageId]=\"message?.quoted_message?.id\"\n ></stream-attachment-list>\n <div\n data-testid=\"quoted-message-text\"\n [innerHTML]=\"\n message?.quoted_message?.html || message?.quoted_message?.text\n \"\n ></div>\n </div>\n </div>\n</ng-template>\n","import {\n Component,\n ElementRef,\n EventEmitter,\n HostBinding,\n Input,\n OnChanges,\n OnDestroy,\n Output,\n ViewChild,\n} from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { EmojiInputService } from '../emoji-input.service';\nimport { TextareaInterface } from '../textarea.interface';\n\n/**\n * The `Textarea` component is used by the [`MessageInput`](./MessageInputComponent.mdx) component to display the input HTML element where users can type their message.\n */\n@Component({\n selector: 'stream-textarea',\n templateUrl: './textarea.component.html',\n styles: [],\n})\nexport class TextareaComponent\n implements TextareaInterface, OnChanges, OnDestroy\n{\n @HostBinding() class = 'str-chat__textarea';\n /**\n * The value of the input HTML element.\n */\n @Input() value = '';\n /**\n * Emits the current value of the input element when a user types.\n */\n @Output() readonly valueChange = new EventEmitter<string>();\n /**\n * Emits when a user triggers a message send event (this happens when they hit the `Enter` key).\n */\n @Output() readonly send = new EventEmitter<void>();\n @ViewChild('input') private messageInput!: ElementRef<HTMLInputElement>;\n private subscriptions: Subscription[] = [];\n\n constructor(private emojiInputService: EmojiInputService) {\n this.subscriptions.push(\n this.emojiInputService.emojiInput$.subscribe((emoji) => {\n this.messageInput.nativeElement.focus();\n const { selectionStart } = this.messageInput.nativeElement;\n this.messageInput.nativeElement.setRangeText(emoji);\n this.messageInput.nativeElement.selectionStart =\n selectionStart! + emoji.length;\n this.messageInput.nativeElement.selectionEnd =\n selectionStart! + emoji.length;\n this.inputChanged();\n })\n );\n }\n\n // eslint-disable-next-line @angular-eslint/no-empty-lifecycle-method\n ngOnChanges(): void {}\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n inputChanged() {\n this.valueChange.emit(this.messageInput.nativeElement.value);\n }\n\n sent(event: Event) {\n event.preventDefault();\n this.send.next();\n }\n}\n","<textarea\n [value]=\"value || ''\"\n autofocus\n data-testid=\"textarea\"\n #input\n placeholder=\"{{ 'streamChat.Type your message' | translate }}\"\n class=\"rta__textarea str-chat__textarea__textarea str-chat__angular-textarea\"\n rows=\"1\"\n (input)=\"inputChanged()\"\n (keydown.enter)=\"sent($event)\"\n></textarea>\n","import { Injectable } from '@angular/core';\nimport transliterate from '@stream-io/transliterate';\n\n/**\n * The `TransliterationService` wraps the [@sindresorhus/transliterate](https://www.npmjs.com/package/@sindresorhus/transliterate) library\n */\n@Injectable({ providedIn: 'root' })\nexport class TransliterationService {\n constructor() {}\n\n /**\n *\n * @param s the string to be transliterated\n * @returns the result of the transliteration\n */\n transliterate(s: string) {\n return transliterate(s);\n }\n}\n","import {\n Component,\n ElementRef,\n EventEmitter,\n HostBinding,\n Input,\n OnChanges,\n Output,\n SimpleChanges,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport { MentionConfig, Mentions } from 'angular-mentions';\nimport {\n MentionAutcompleteListItemContext,\n MentionAutcompleteListItem,\n CommandAutocompleteListItemContext,\n} from '../../types';\n\nimport { BehaviorSubject, Subscription } from 'rxjs';\nimport { UserResponse } from 'stream-chat';\nimport { ChannelService } from '../../channel.service';\nimport { TextareaInterface } from '../textarea.interface';\nimport { ChatClientService } from '../../chat-client.service';\nimport { debounceTime, distinctUntilChanged } from 'rxjs/operators';\nimport { TransliterationService } from '../../transliteration.service';\nimport { EmojiInputService } from '../emoji-input.service';\n\n/**\n * The `AutocompleteTextarea` component is used by the [`MessageInput`](./MessageInputComponent.mdx) component to display the input HTML element where users can type their message.\n */\n@Component({\n selector: 'stream-autocomplete-textarea',\n templateUrl: './autocomplete-textarea.component.html',\n styles: [],\n})\nexport class AutocompleteTextareaComponent\n implements TextareaInterface, OnChanges\n{\n @HostBinding() class = 'str-chat__textarea';\n /**\n * The value of the input HTML element.\n */\n @Input() value = '';\n /**\n * If true, users can mention other users in messages. You can also set this input on the [`MessageInput`](./MessageInputComponent.mdx/#inputs-and-outputs) component.\n */\n @Input() areMentionsEnabled: boolean | undefined = true;\n /**\n * You can provide your own template for the autocomplete list for user mentions. You can also set this input on the [`MessageInput`](./MessageInputComponent.mdx/#inputs-and-outputs) component.\n */\n @Input() mentionAutocompleteItemTemplate:\n | TemplateRef<MentionAutcompleteListItemContext>\n | undefined;\n /**\n * You can provide your own template for the autocomplete list for commands. You can also set this input on the [`MessageInput`](./MessageInputComponent.mdx/#inputs-and-outputs) component.\n */\n @Input() commandAutocompleteItemTemplate:\n | TemplateRef<CommandAutocompleteListItemContext>\n | undefined;\n /**\n * The scope for user mentions, either members of the current channel of members of the application. You can also set this input on the [`MessageInput`](./MessageInputComponent.mdx/#inputs-and-outputs) component.\n */\n @Input() mentionScope: 'channel' | 'application' = 'channel';\n /**\n * Emits the current value of the input element when a user types.\n */\n @Output() readonly valueChange = new EventEmitter<string>();\n /**\n * Emits when a user triggers a message send event (this happens when they hit the `Enter` key).\n */\n @Output() readonly send = new EventEmitter<void>();\n /**\n * Emits the array of users that are mentioned in the message, it is updated when a user mentions a new user or deletes a mention.\n */\n @Output() readonly userMentions = new EventEmitter<UserResponse[]>();\n private readonly autocompleteKey = 'autocompleteLabel';\n private readonly mentionTriggerChar = '@';\n private readonly commandTriggerChar = '/';\n autocompleteConfig: MentionConfig = {\n mentions: [],\n };\n @ViewChild('input') private messageInput!: ElementRef<HTMLInputElement>;\n private subscriptions: Subscription[] = [];\n private mentionedUsers: UserResponse[] = [];\n private userMentionConfig: Mentions = {\n triggerChar: this.mentionTriggerChar,\n dropUp: true,\n labelKey: this.autocompleteKey,\n returnTrigger: true,\n mentionFilter: (\n searchString: string,\n items: { autocompleteLabel: string }[]\n ) => this.filter(searchString, items),\n mentionSelect: (item, triggerChar) =>\n this.itemSelectedFromAutocompleteList(item, triggerChar),\n };\n private slashCommandConfig: Mentions = {\n triggerChar: this.commandTriggerChar,\n dropUp: true,\n labelKey: 'name',\n returnTrigger: true,\n mentionFilter: (\n searchString: string,\n items: { autocompleteLabel: string }[]\n ) => this.filter(searchString, items),\n mentionSelect: (item, triggerChar) =>\n this.itemSelectedFromAutocompleteList(item, triggerChar),\n };\n private searchTerm$ = new BehaviorSubject<string>('');\n\n constructor(\n private channelService: ChannelService,\n private chatClientService: ChatClientService,\n private transliterationService: TransliterationService,\n private emojiInputService: EmojiInputService\n ) {\n this.searchTerm$\n .pipe(debounceTime(300), distinctUntilChanged())\n .subscribe((searchTerm) => {\n if (searchTerm.startsWith(this.mentionTriggerChar)) {\n void this.updateMentionOptions(searchTerm);\n }\n });\n this.subscriptions.push(\n this.channelService.activeChannel$.subscribe((channel) => {\n const commands = channel?.getConfig()?.commands || [];\n this.slashCommandConfig.items = commands.map((c) => ({\n ...c,\n [this.autocompleteKey]: c.name,\n type: 'command',\n }));\n this.mentionedUsers = [];\n this.userMentions.next([...this.mentionedUsers]);\n void this.updateMentionOptions(this.searchTerm$.getValue());\n })\n );\n this.subscriptions.push(\n this.emojiInputService.emojiInput$.subscribe((emoji) => {\n this.messageInput.nativeElement.focus();\n const { selectionStart } = this.messageInput.nativeElement;\n this.messageInput.nativeElement.setRangeText(emoji);\n this.messageInput.nativeElement.selectionStart =\n selectionStart! + emoji.length;\n this.messageInput.nativeElement.selectionEnd =\n selectionStart! + emoji.length;\n this.inputChanged();\n })\n );\n this.autocompleteConfig.mentions = [\n this.userMentionConfig,\n this.slashCommandConfig,\n ];\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.areMentionsEnabled) {\n if (this.areMentionsEnabled) {\n this.autocompleteConfig.mentions = [\n this.userMentionConfig,\n this.slashCommandConfig,\n ];\n this.autocompleteConfig = { ...this.autocompleteConfig };\n } else {\n this.autocompleteConfig.mentions = [this.slashCommandConfig];\n this.autocompleteConfig = { ...this.autocompleteConfig };\n }\n }\n if (changes.mentionScope) {\n void this.updateMentionOptions(this.searchTerm$.getValue());\n }\n }\n\n filter(searchString: string, items: { autocompleteLabel: string }[]) {\n return items.filter((item) =>\n this.transliterate(item.autocompleteLabel.toLowerCase()).includes(\n this.transliterate(searchString.toLowerCase())\n )\n );\n }\n\n itemSelectedFromAutocompleteList(\n item: MentionAutcompleteListItem,\n triggerChar = ''\n ) {\n if (triggerChar === this.mentionTriggerChar) {\n this.mentionedUsers.push((item.user ? item.user : item) as UserResponse);\n this.userMentions.next([...this.mentionedUsers]);\n }\n return (\n triggerChar +\n item.autocompleteLabel +\n (triggerChar === this.commandTriggerChar ? ' ' : '')\n );\n }\n\n autcompleteSearchTermChanged(searchTerm: string) {\n if (searchTerm === this.mentionTriggerChar) {\n void this.updateMentionOptions();\n } else {\n this.searchTerm$.next(searchTerm);\n }\n }\n\n inputChanged() {\n this.valueChange.emit(this.messageInput.nativeElement.value);\n }\n\n inputLeft() {\n this.updateMentionedUsersFromText();\n }\n\n sent(event: Event) {\n event.preventDefault();\n this.updateMentionedUsersFromText();\n this.send.next();\n }\n\n private transliterate(s: string) {\n if (this.transliterationService) {\n return this.transliterationService.transliterate(s);\n } else {\n return s;\n }\n }\n\n private async updateMentionOptions(searchTerm?: string) {\n if (!this.areMentionsEnabled) {\n return;\n }\n searchTerm = searchTerm?.replace(this.mentionTriggerChar, '');\n const request =\n this.mentionScope === 'application'\n ? (s: string) => this.chatClientService.autocompleteUsers(s)\n : (s: string) => this.channelService.autocompleteMembers(s);\n const result = await request(searchTerm || '');\n const items = this.filter(\n searchTerm || '',\n result.map((i) => {\n const user = (i.user ? i.user : i) as UserResponse;\n return {\n ...i,\n autocompleteLabel: user.name || user.id,\n type: 'mention',\n };\n })\n );\n this.userMentionConfig.items = items;\n this.autocompleteConfig.mentions = [\n this.userMentionConfig,\n this.slashCommandConfig,\n ];\n this.autocompleteConfig = { ...this.autocompleteConfig };\n }\n\n private updateMentionedUsersFromText() {\n const updatedMentionedUsers: UserResponse[] = [];\n this.mentionedUsers.forEach((u) => {\n const key = u.name || u.id;\n if (this.value.includes(`${this.mentionTriggerChar}${key}`)) {\n updatedMentionedUsers.push(u);\n }\n });\n if (updatedMentionedUsers.length !== this.mentionedUsers.length) {\n this.userMentions.next([...updatedMentionedUsers]);\n this.mentionedUsers = updatedMentionedUsers;\n }\n }\n}\n","<textarea\n [value]=\"value || ''\"\n autofocus\n data-testid=\"textarea\"\n #input\n placeholder=\"{{ 'streamChat.Type your message' | translate }}\"\n class=\"rta__textarea str-chat__textarea__textarea str-chat__angular-textarea\"\n rows=\"1\"\n (input)=\"inputChanged()\"\n (keydown.enter)=\"sent($event)\"\n [mentionConfig]=\"autocompleteConfig\"\n (searchTerm)=\"autcompleteSearchTermChanged($event)\"\n [mentionListTemplate]=\"autocompleteItem\"\n (blur)=\"inputLeft()\"\n></textarea>\n<ng-template #autocompleteItem let-item=\"item\">\n <div class=\"rta rta__item str-chat__emojisearch__item\" [ngSwitch]=\"item.type\">\n <div class=\"rta__entity\" *ngSwitchCase=\"'mention'\">\n <ng-container\n *ngTemplateOutlet=\"\n mentionAutocompleteItemTemplate || defaultMentionTemplate;\n context: { item: item }\n \"\n ></ng-container>\n </div>\n <div class=\"rta__entity\" *ngSwitchCase=\"'command'\">\n <ng-container\n *ngTemplateOutlet=\"\n commandAutocompleteItemTemplate || defaultCommandTemplate;\n context: { item: item }\n \"\n ></ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #defaultCommandTemplate let-item=\"item\">\n <div class=\"str-chat__slash-command\">\n <span class=\"str-chat__slash-command-header\">\n <strong data-testclass=\"command-name\">{{ item.name }}</strong>\n {{ item.args }}\n </span>\n <br />\n <span class=\"str-chat__slash-command-description\">{{\n item.description\n }}</span>\n </div>\n</ng-template>\n\n<ng-template #defaultMentionTemplate let-item=\"item\">\n <div class=\"str-chat__user-item\">\n <stream-avatar\n data-testclass=\"avatar\"\n class=\"str-chat__avatar str-chat__avatar--circle\"\n style=\"height: 20px\"\n [size]=\"20\"\n [imageUrl]=\"item.image || item.user?.image\"\n [name]=\"item.autocompleteLabel\"\n ></stream-avatar>\n <span data-testclass=\"username\" class=\"str-chat__user-item--name\">{{\n item.autocompleteLabel\n }}</span>\n </div>\n</ng-template>\n","import { StreamMessage } from '../types';\n\nexport type GroupStyle = '' | 'middle' | 'top' | 'bottom' | 'single';\n\nexport const getGroupStyles = (\n message: StreamMessage,\n previousMessage?: StreamMessage,\n nextMessage?: StreamMessage,\n noGroupByUser = false\n): GroupStyle => {\n if (\n noGroupByUser ||\n (message.attachments && message.attachments.length !== 0)\n )\n return 'single';\n\n const isTopMessage =\n !previousMessage ||\n !isOnSameDay(previousMessage.created_at, message.created_at) ||\n previousMessage.type === 'system' ||\n (previousMessage.attachments &&\n previousMessage.attachments?.length !== 0) ||\n message.user?.id !== previousMessage.user?.id ||\n previousMessage.type === 'error' ||\n previousMessage.deleted_at;\n\n const isBottomMessage =\n !nextMessage ||\n !isOnSameDay(message.created_at, nextMessage.created_at) ||\n nextMessage.type === 'system' ||\n (nextMessage.attachments && nextMessage.attachments?.length !== 0) ||\n message.user?.id !== nextMessage.user?.id ||\n nextMessage.type === 'error' ||\n nextMessage.deleted_at;\n\n if (!isTopMessage && !isBottomMessage) {\n if (message.deleted_at || message.type === 'error') return 'single';\n return 'middle';\n }\n\n if (isBottomMessage) {\n if (isTopMessage || message.deleted_at || message.type === 'error')\n return 'single';\n return 'bottom';\n }\n\n if (isTopMessage) return 'top';\n\n return '';\n};\n\nconst isOnSameDay = (date1: Date, date2: Date) => {\n return (\n date1.getFullYear() === date2.getFullYear() &&\n date1.getMonth() === date2.getMonth() &&\n date1.getDate() === date2.getDate()\n );\n};\n","import {\n AfterViewChecked,\n Component,\n ElementRef,\n HostBinding,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n SimpleChanges,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport { ChannelService } from '../channel.service';\nimport { Observable, Subscription } from 'rxjs';\nimport { tap } from 'rxjs/operators';\nimport { DefaultUserType, StreamMessage } from '../types';\nimport { ChatClientService } from '../chat-client.service';\nimport { getGroupStyles, GroupStyle } from './group-styles';\nimport { ImageLoadService } from './image-load.service';\nimport { UserResponse } from 'stream-chat';\n\n/**\n * The `MessageList` component renders a scrollable list of messages.\n */\n@Component({\n selector: 'stream-message-list',\n templateUrl: './message-list.component.html',\n styles: [],\n})\nexport class MessageListComponent\n implements AfterViewChecked, OnChanges, OnInit, OnDestroy\n{\n /**\n * By default, the [default message component](./MessageComponent.mdx) is used. To change the contents of the message, provide [your own custom message template](./MessageComponent.mdx/#customization).\n */\n @Input() messageTemplate: TemplateRef<any> | undefined;\n /**\n * The input used for message edit. By default, the [default message input component](./MessageInputComponent.mdx) is used. To change the input for message edit, provide [your own custom template](./MessageInputComponent.mdx/#customization).\n */\n @Input() messageInputTemplate: TemplateRef<any> | undefined;\n /**\n * The template used to display a mention in a message. It receives the mentioned user in a variable called `user` with the type [`UserResponse`](https://github.com/GetStream/stream-chat-js/blob/master/src/types.ts). You can provide your own template if you want to [add actions to mentions](../code-examples/mention-actions.mdx).\n */\n @Input() mentionTemplate: TemplateRef<any> | undefined;\n /**\n * You can provide your own typing indicator template instead of the default one.\n */\n @Input() typingIndicatorTemplate:\n | TemplateRef<{ usersTyping$: Observable<UserResponse<DefaultUserType>[]> }>\n | undefined;\n /**\n * @deprecated use [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) instead. If true, the message reactions are displayed. Users can also react to messages if they have the necessary [channel capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript).\n */\n @Input() areReactionsEnabled: boolean | undefined = undefined;\n /**\n * @deprecated use [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) instead. The list of [actions that are enabled](./MessageActionsBoxComponent.mdx), please note that the user also has to have the necessary [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) for actions to work. Unathorized actions won't be displayed on the UI. The `MessgaeList` component makes the necessary checks before passing the actions to the `Message` component.\n */\n /* eslint-disable-next-line @angular-eslint/no-input-rename */\n @Input('enabledMessageActions') enabledMessageActionsInput:\n | string[]\n | undefined = undefined;\n /**\n * Determines if the message list should display channel messages or [thread messages](https://getstream.io/chat/docs/javascript/threads/?language=javascript).\n */\n @Input() mode: 'main' | 'thread' = 'main';\n messages$!: Observable<StreamMessage[]>;\n canReactToMessage: boolean | undefined;\n canReceiveReadEvents: boolean | undefined;\n enabledMessageActions: string[] = [];\n @HostBinding('class') private class =\n 'str-chat-angular__main-panel-inner str-chat-angular__message-list-host';\n unreadMessageCount = 0;\n isUserScrolledUp: boolean | undefined;\n groupStyles: GroupStyle[] = [];\n lastSentMessageId: string | undefined;\n parentMessage: StreamMessage | undefined;\n @ViewChild('scrollContainer')\n private scrollContainer!: ElementRef<HTMLElement>;\n @ViewChild('parentMessageElement')\n private parentMessageElement!: ElementRef<HTMLElement>;\n private latestMessageDate: Date | undefined;\n private hasNewMessages: boolean | undefined;\n private containerHeight: number | undefined;\n private oldestMessageDate: Date | undefined;\n private olderMassagesLoaded: boolean | undefined;\n private isNewMessageSentByUser: boolean | undefined;\n private authorizedMessageActions: string[] = ['flag'];\n private readonly isUserScrolledUpThreshold = 300;\n private subscriptions: Subscription[] = [];\n private prevScrollTop: number | undefined;\n private usersTypingInChannel$!: Observable<UserResponse<DefaultUserType>[]>;\n private usersTypingInThread$!: Observable<UserResponse<DefaultUserType>[]>;\n\n constructor(\n private channelService: ChannelService,\n private chatClientService: ChatClientService,\n private imageLoadService: ImageLoadService\n ) {\n this.subscriptions.push(\n this.channelService.activeChannel$.subscribe((channel) => {\n this.resetScrollState();\n const capabilites = channel?.data?.own_capabilities as string[];\n if (capabilites) {\n this.canReactToMessage = capabilites.indexOf('send-reaction') !== -1;\n this.canReceiveReadEvents = capabilites.indexOf('read-events') !== -1;\n this.authorizedMessageActions = [];\n if (this.canReactToMessage) {\n this.authorizedMessageActions.push('send-reaction');\n }\n if (this.canReceiveReadEvents) {\n this.authorizedMessageActions.push('read-events');\n }\n if (capabilites.indexOf('flag-message') !== -1) {\n this.authorizedMessageActions.push('flag');\n }\n if (capabilites.indexOf('update-own-message') !== -1) {\n this.authorizedMessageActions.push('edit');\n }\n if (capabilites.indexOf('update-any-message') !== -1) {\n this.authorizedMessageActions.push('edit');\n this.authorizedMessageActions.push('edit-any');\n }\n if (capabilites.indexOf('delete-own-message') !== -1) {\n this.authorizedMessageActions.push('delete');\n }\n if (capabilites.indexOf('delete-any-message') !== -1) {\n this.authorizedMessageActions.push('delete');\n this.authorizedMessageActions.push('delete-any');\n }\n if (capabilites.indexOf('send-reply') !== -1) {\n this.authorizedMessageActions.push('send-reply');\n }\n if (capabilites.indexOf('quote-message') !== -1) {\n this.authorizedMessageActions.push('quote-message');\n }\n this.setEnabledActions();\n }\n })\n );\n this.subscriptions.push(\n this.imageLoadService.imageLoad$.subscribe(() => {\n if (!this.isUserScrolledUp) {\n this.scrollToBottom();\n // Hacky and unreliable workaround to scroll down after loaded images move the scrollbar\n setTimeout(() => {\n this.scrollToBottom();\n }, 300);\n }\n })\n );\n this.subscriptions.push(\n this.channelService.activeParentMessage$.subscribe((message) => {\n if (\n message &&\n this.parentMessage &&\n message.id !== this.parentMessage.id &&\n this.mode === 'thread'\n ) {\n this.resetScrollState();\n }\n this.parentMessage = message;\n })\n );\n this.usersTypingInChannel$ = this.channelService.usersTypingInChannel$;\n this.usersTypingInThread$ = this.channelService.usersTypingInThread$;\n }\n\n ngOnInit(): void {\n this.setMessages$();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.enabledMessageActionsInput) {\n this.setEnabledActions();\n }\n if (changes.mode) {\n this.setMessages$();\n }\n }\n\n ngAfterViewChecked() {\n if (this.hasNewMessages) {\n if (!this.isUserScrolledUp || this.isNewMessageSentByUser) {\n this.scrollToBottom();\n // Hacky and unreliable workaround to scroll down after loaded images move the scrollbar\n setTimeout(() => {\n this.scrollToBottom();\n }, 300);\n }\n this.hasNewMessages = false;\n this.containerHeight = this.scrollContainer.nativeElement.scrollHeight;\n } else if (this.olderMassagesLoaded) {\n this.preserveScrollbarPosition();\n this.containerHeight = this.scrollContainer.nativeElement.scrollHeight;\n this.olderMassagesLoaded = false;\n } else if (\n this.containerHeight !== undefined &&\n this.containerHeight < this.scrollContainer.nativeElement.scrollHeight &&\n !this.isUserScrolledUp\n ) {\n this.scrollToBottom();\n this.containerHeight = this.scrollContainer.nativeElement.scrollHeight;\n }\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n get usersTyping$() {\n return this.mode === 'thread'\n ? this.usersTypingInThread$\n : this.usersTypingInChannel$;\n }\n\n trackByMessageId(index: number, item: StreamMessage) {\n return item.id;\n }\n\n trackByUserId(index: number, user: UserResponse) {\n return user.id;\n }\n\n scrollToBottom(): void {\n this.scrollContainer.nativeElement.scrollTop =\n this.scrollContainer.nativeElement.scrollHeight;\n }\n\n scrolled() {\n this.isUserScrolledUp =\n this.scrollContainer.nativeElement.scrollHeight -\n (this.scrollContainer.nativeElement.scrollTop +\n this.scrollContainer.nativeElement.clientHeight) >\n this.isUserScrolledUpThreshold;\n if (!this.isUserScrolledUp) {\n this.unreadMessageCount = 0;\n }\n if (\n this.scrollContainer.nativeElement.scrollTop <=\n (this.parentMessageElement?.nativeElement.clientHeight || 0) &&\n (this.prevScrollTop === undefined ||\n this.prevScrollTop >\n (this.parentMessageElement?.nativeElement.clientHeight || 0))\n ) {\n this.containerHeight = this.scrollContainer.nativeElement.scrollHeight;\n this.mode === 'main'\n ? void this.channelService.loadMoreMessages()\n : void this.channelService.loadMoreThreadReplies();\n }\n this.prevScrollTop = this.scrollContainer.nativeElement.scrollTop;\n }\n\n private preserveScrollbarPosition() {\n this.scrollContainer.nativeElement.scrollTop =\n (this.prevScrollTop || 0) +\n (this.scrollContainer.nativeElement.scrollHeight - this.containerHeight!);\n }\n\n private setEnabledActions() {\n this.enabledMessageActions = [];\n if (!this.enabledMessageActionsInput) {\n this.enabledMessageActions = this.authorizedMessageActions;\n return;\n }\n this.enabledMessageActionsInput = [\n ...this.enabledMessageActionsInput,\n 'send-reaction',\n 'read-events',\n 'send-reply',\n 'quote-message',\n ];\n this.enabledMessageActionsInput.forEach((action) => {\n const isAuthorized = this.authorizedMessageActions.indexOf(action) !== -1;\n if (isAuthorized) {\n this.enabledMessageActions.push(action);\n }\n });\n }\n\n private setMessages$() {\n this.messages$ = (\n this.mode === 'main'\n ? this.channelService.activeChannelMessages$\n : this.channelService.activeThreadMessages$\n ).pipe(\n tap((messages) => {\n if (messages.length === 0) {\n return;\n }\n const currentLatestMessageDate =\n messages[messages.length - 1].created_at;\n if (\n !this.latestMessageDate ||\n this.latestMessageDate?.getTime() < currentLatestMessageDate.getTime()\n ) {\n this.latestMessageDate = currentLatestMessageDate;\n this.hasNewMessages = true;\n this.isNewMessageSentByUser =\n messages[messages.length - 1].user?.id ===\n this.chatClientService.chatClient?.user?.id;\n if (this.isUserScrolledUp) {\n this.unreadMessageCount++;\n }\n }\n const currentOldestMessageDate = messages[0].created_at;\n if (!this.oldestMessageDate) {\n this.oldestMessageDate = currentOldestMessageDate;\n } else if (\n this.oldestMessageDate?.getTime() > currentOldestMessageDate.getTime()\n ) {\n this.oldestMessageDate = currentOldestMessageDate;\n this.olderMassagesLoaded = true;\n }\n }),\n tap((messages) => {\n this.groupStyles = messages.map((m, i) =>\n getGroupStyles(m, messages[i - 1], messages[i + 1])\n );\n }),\n tap(\n (messages) =>\n (this.lastSentMessageId = [...messages]\n .reverse()\n .find(\n (m) =>\n m.user?.id === this.chatClientService.chatClient?.user?.id &&\n m.status !== 'sending'\n )?.id)\n )\n );\n }\n\n private resetScrollState() {\n this.latestMessageDate = undefined;\n this.hasNewMessages = true;\n this.isUserScrolledUp = false;\n this.containerHeight = undefined;\n this.olderMassagesLoaded = false;\n this.oldestMessageDate = undefined;\n this.unreadMessageCount = 0;\n this.prevScrollTop = undefined;\n this.isNewMessageSentByUser = undefined;\n }\n}\n","<div\n #scrollContainer\n data-testid=\"scroll-container\"\n class=\"str-chat__list\"\n (scroll)=\"scrolled()\"\n>\n <div class=\"str-chat__reverse-infinite-scroll\">\n <ul class=\"str-chat__ul\">\n <li\n #parentMessageElement\n *ngIf=\"mode === 'thread'\"\n data-testid=\"parent-message\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplateContainer;\n context: { message: parentMessage }\n \"\n ></ng-container>\n <div class=\"str-chat__thread-start\" translate>\n streamChat.Start of a new thread\n </div>\n </li>\n <li\n data-testclass=\"message\"\n *ngFor=\"\n let message of messages$ | async;\n let i = index;\n trackBy: trackByMessageId\n \"\n class=\"str-chat__li str-chat__li--{{ groupStyles[i] }}\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplateContainer;\n context: { message: message }\n \"\n ></ng-container>\n </li>\n </ul>\n <ng-container *ngIf=\"typingIndicatorTemplate; else defaultTypingIndicator\">\n <ng-container\n *ngTemplateOutlet=\"\n typingIndicatorTemplate;\n context: { usersTyping$: usersTyping$ }\n \"\n ></ng-container>\n </ng-container>\n <ng-template #defaultTypingIndicator>\n <div\n *ngIf=\"(usersTyping$ | async)?.length\"\n data-testid=\"typing-indicator\"\n class=\"str-chat__typing-indicator str-chat__typing-indicator--typing\"\n >\n <stream-avatar\n *ngFor=\"let user of usersTyping$ | async; trackBy: trackByUserId\"\n [name]=\"user.name || user.id\"\n [imageUrl]=\"user.image\"\n ></stream-avatar>\n <div class=\"str-chat__typing-indicator__dots\">\n <span class=\"str-chat__typing-indicator__dot\"></span>\n <span class=\"str-chat__typing-indicator__dot\"></span>\n <span class=\"str-chat__typing-indicator__dot\"></span>\n </div>\n </div>\n </ng-template>\n </div>\n</div>\n<div class=\"str-chat__list-notifications\">\n <button\n data-testid=\"scroll-to-bottom\"\n *ngIf=\"isUserScrolledUp\"\n class=\"\n str-chat__message-notification\n str-chat__message-notification-right\n str-chat__message-notification-scroll-down\n \"\n (keyup.enter)=\"scrollToBottom()\"\n (click)=\"scrollToBottom()\"\n >\n <div\n *ngIf=\"unreadMessageCount > 0\"\n class=\"\n str-chat__message-notification\n str-chat__message-notification-scroll-down-unread-count\n \"\n >\n {{ unreadMessageCount }}\n </div>\n </button>\n</div>\n\n<ng-template #messageTemplateContainer let-message=\"message\">\n <ng-container *ngIf=\"messageTemplate; else defaultMessageTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplate;\n context: {\n message: message,\n areReactionsEnabled: areReactionsEnabled,\n canReactToMessage: canReactToMessage,\n lastSentMessageId: !!(\n lastSentMessageId && message?.id === lastSentMessageId\n ),\n canReceiveReadEvents: canReceiveReadEvents,\n messageInputTemplate: messageInputTemplate,\n mentionTemplate: mentionTemplate,\n mode: mode\n }\n \"\n ></ng-container>\n </ng-container>\n <ng-template #defaultMessageTemplate>\n <stream-message\n [message]=\"message\"\n [areReactionsEnabled]=\"areReactionsEnabled\"\n [canReactToMessage]=\"canReactToMessage\"\n [isLastSentMessage]=\"\n !!(lastSentMessageId && message?.id === lastSentMessageId)\n \"\n [enabledMessageActions]=\"enabledMessageActions\"\n [canReceiveReadEvents]=\"canReceiveReadEvents\"\n [messageInputTemplate]=\"messageInputTemplate\"\n [mentionTemplate]=\"mentionTemplate\"\n [mode]=\"mode\"\n ></stream-message>\n </ng-template>\n</ng-template>\n","import { Component, HostBinding, OnDestroy } from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { ChannelService } from '../channel.service';\nimport { StreamMessage } from '../types';\n\n/**\n * The `Thread` component represents a [message thread](https://getstream.io/chat/docs/javascript/threads/?language=javascript), it is a container component that displays a thread with a header, [`MessageList`](./MessageListComponent.mdx) and [`MessageInput`](./MessageInputComponent.mdx) components.\n */\n@Component({\n selector: 'stream-thread',\n templateUrl: './thread.component.html',\n styles: [],\n})\nexport class ThreadComponent implements OnDestroy {\n @HostBinding('class') private class = 'str-chat__thread';\n parentMessage: StreamMessage | undefined;\n private subscriptions: Subscription[] = [];\n\n constructor(private channelService: ChannelService) {\n this.subscriptions.push(\n this.channelService.activeParentMessage$.subscribe(\n (parentMessage) => (this.parentMessage = parentMessage)\n )\n );\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n get replyCountParam() {\n return { replyCount: this.parentMessage?.reply_count };\n }\n\n closeThread() {\n void this.channelService.setAsActiveParentMessage(undefined);\n }\n}\n","<div class=\"str-chat__thread-header\">\n <div class=\"str-chat__thread-header-details\">\n <strong translate>streamChat.Thread</strong>\n <small data-testid=\"reply-count\">\n {{parentMessage?.reply_count === 1 ? ('streamChat.1 reply' | translate) : ('streamChat.{{ replyCount }}\n replies' | translate:replyCountParam)}}\n </small>\n </div>\n <button\n class=\"str-chat__square-button\"\n data-testid=\"close-button\"\n (click)=\"closeThread()\"\n >\n <stream-icon icon=\"close-no-outline\"></stream-icon>\n </button>\n</div>\n<ng-content select='[name=\"thread-message-list\"]'></ng-content>\n<div class=\"str-chat__small-message-input__wrapper\">\n <ng-content select='[name=\"thread-message-input\"]'></ng-content>\n</div>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { AvatarComponent } from './avatar/avatar.component';\nimport { TranslateModule } from '@ngx-translate/core';\n\n@NgModule({\n declarations: [AvatarComponent],\n imports: [CommonModule, TranslateModule],\n exports: [AvatarComponent],\n})\nexport class StreamAvatarModule {}\n","import { NgModule } from '@angular/core';\nimport { ChannelComponent } from './channel/channel.component';\nimport { ChannelHeaderComponent } from './channel-header/channel-header.component';\nimport { ChannelListComponent } from './channel-list/channel-list.component';\nimport { ChannelPreviewComponent } from './channel-preview/channel-preview.component';\nimport { MessageComponent } from './message/message.component';\nimport { MessageInputComponent } from './message-input/message-input.component';\nimport { MessageListComponent } from './message-list/message-list.component';\nimport { CommonModule } from '@angular/common';\nimport { LoadingIndicatorComponent } from './loading-indicator/loading-indicator.component';\nimport { IconComponent } from './icon/icon.component';\nimport { MessageActionsBoxComponent } from './message-actions-box/message-actions-box.component';\nimport { AttachmentListComponent } from './attachment-list/attachment-list.component';\nimport { MessageReactionsComponent } from './message-reactions/message-reactions.component';\nimport { NotificationComponent } from './notification/notification.component';\nimport { NotificationListComponent } from './notification-list/notification-list.component';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { AttachmentPreviewListComponent } from './attachment-preview-list/attachment-preview-list.component';\nimport { ModalComponent } from './modal/modal.component';\nimport { TextareaDirective } from './message-input/textarea.directive';\nimport { StreamAvatarModule } from './stream-avatar.module';\nimport { ThreadComponent } from './thread/thread.component';\n\n@NgModule({\n declarations: [\n ChannelComponent,\n ChannelHeaderComponent,\n ChannelListComponent,\n ChannelPreviewComponent,\n MessageComponent,\n MessageInputComponent,\n MessageListComponent,\n LoadingIndicatorComponent,\n IconComponent,\n MessageActionsBoxComponent,\n AttachmentListComponent,\n MessageReactionsComponent,\n NotificationComponent,\n NotificationListComponent,\n AttachmentPreviewListComponent,\n ModalComponent,\n TextareaDirective,\n ThreadComponent,\n ],\n imports: [CommonModule, TranslateModule, StreamAvatarModule],\n exports: [\n ChannelComponent,\n ChannelHeaderComponent,\n ChannelListComponent,\n ChannelPreviewComponent,\n MessageComponent,\n MessageInputComponent,\n MessageListComponent,\n LoadingIndicatorComponent,\n IconComponent,\n MessageActionsBoxComponent,\n AttachmentListComponent,\n MessageReactionsComponent,\n NotificationComponent,\n NotificationListComponent,\n AttachmentPreviewListComponent,\n ModalComponent,\n StreamAvatarModule,\n ThreadComponent,\n ],\n})\nexport class StreamChatModule {}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { AutocompleteTextareaComponent } from './message-input/autocomplete-textarea/autocomplete-textarea.component';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { MentionModule } from 'angular-mentions';\nimport { StreamAvatarModule } from './stream-avatar.module';\nimport { textareaInjectionToken } from './injection-tokens';\n\n@NgModule({\n declarations: [AutocompleteTextareaComponent],\n imports: [CommonModule, TranslateModule, MentionModule, StreamAvatarModule],\n exports: [AutocompleteTextareaComponent],\n providers: [\n {\n provide: textareaInjectionToken,\n useValue: AutocompleteTextareaComponent,\n },\n ],\n})\nexport class StreamAutocompleteTextareaModule {}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { TextareaComponent } from './message-input/textarea/textarea.component';\nimport { textareaInjectionToken } from './injection-tokens';\n\n@NgModule({\n declarations: [TextareaComponent],\n imports: [CommonModule, TranslateModule],\n exports: [TextareaComponent],\n providers: [\n {\n provide: textareaInjectionToken,\n useValue: TextareaComponent,\n },\n ],\n})\nexport class StreamTextareaModule {}\n","/*\n * Public API Surface of stream-chat-angular\n */\n\nexport * from './lib/chat-client.service';\nexport * from './lib/channel.service';\nexport * from './lib/theme.service';\nexport * from './lib/attachment.service';\nexport * from './lib/stream-i18n.service';\nexport * from './lib/avatar/avatar.component';\nexport * from './lib/icon/icon.component';\nexport * from './lib/loading-indicator/loading-indicator.component';\nexport * from './lib/message-actions-box/message-actions-box.component';\nexport * from './lib/channel/channel.component';\nexport * from './lib/channel-header/channel-header.component';\nexport * from './lib/channel-preview/channel-preview.component';\nexport * from './lib/channel-list/channel-list.component';\nexport * from './lib/channel-list/channel-list-toggle.service';\nexport * from './lib/message/message.component';\nexport * from './lib/message/parse-date';\nexport * from './lib/message/read-by-text';\nexport * from './lib/message-input/message-input.component';\nexport * from './lib/message-input/textarea/textarea.component';\nexport * from './lib/message-input/autocomplete-textarea/autocomplete-textarea.component';\nexport * from './lib/message-input/message-input-config.service';\nexport * from './lib/message-input/textarea.directive';\nexport * from './lib/message-input/textarea.interface';\nexport * from './lib/message-input/emoji-input.service';\nexport * from './lib/message-list/message-list.component';\nexport * from './lib/message-list/image-load.service';\nexport * from './lib/message-list/group-styles';\nexport * from './lib/attachment-list/attachment-list.component';\nexport * from './lib/attachment-preview-list/attachment-preview-list.component';\nexport * from './lib/message-reactions/message-reactions.component';\nexport * from './lib/notification/notification.component';\nexport * from './lib/notification-list/notification-list.component';\nexport * from './lib/thread/thread.component';\nexport * from './lib/modal/modal.component';\nexport * from './lib/read-by';\nexport * from './lib/is-image-attachment';\nexport * from './lib/is-image-file';\nexport * from './lib/device-width';\nexport * from './lib/message-preview';\nexport * from './lib/notification.service';\nexport * from './lib/transliteration.service';\nexport * from './lib/stream-chat.module';\nexport * from './lib/stream-avatar.module';\nexport * from './lib/stream-autocomplete-textarea.module';\nexport * from './lib/stream-textarea.module';\nexport * from './lib/injection-tokens';\nexport * from './lib/types';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["uuidv4"],"mappings":";;;;;;;;;;;;;;;;;;;AAAO,MAAM,OAAO,GAAG,QAAQ;;ACI/B;;;MAMa,mBAAmB;IAO9B;QAFQ,yBAAoB,GAAG,IAAI,eAAe,CAAwB,EAAE,CAAC,CAAC;QAG5E,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,oBAAoB,CAAC,YAAY,EAAE,CAAC;KAChE;;;;;;;;;;I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AAS,EAAE;wBACT;4BACE,OAAO,EAAE,sBAAsB;4BAC/B,QAAQ,EAAE,iBAAiB;yBAC5B;qBACF;iBACF;;;AChBD;;;;ACAA;;;;;;"}
1
+ {"version":3,"file":"stream-chat-angular.js","sources":["../../../projects/stream-chat-angular/src/assets/version.ts","../../../projects/stream-chat-angular/src/lib/notification.service.ts","../../../projects/stream-chat-angular/src/lib/chat-client.service.ts","../../../projects/stream-chat-angular/src/lib/message-preview.ts","../../../projects/stream-chat-angular/src/lib/read-by.ts","../../../projects/stream-chat-angular/src/lib/channel.service.ts","../../../projects/stream-chat-angular/src/lib/theme.service.ts","../../../projects/stream-chat-angular/src/lib/is-image-file.ts","../../../projects/stream-chat-angular/src/lib/is-image-attachment.ts","../../../projects/stream-chat-angular/src/lib/attachment.service.ts","../../../projects/stream-chat-angular/src/assets/i18n/en.ts","../../../projects/stream-chat-angular/src/lib/stream-i18n.service.ts","../../../projects/stream-chat-angular/src/lib/avatar/avatar.component.ts","../../../projects/stream-chat-angular/src/lib/avatar/avatar.component.html","../../../projects/stream-chat-angular/src/lib/icon/icon.component.ts","../../../projects/stream-chat-angular/src/lib/icon/icon.component.html","../../../projects/stream-chat-angular/src/lib/loading-indicator/loading-indicator.component.ts","../../../projects/stream-chat-angular/src/lib/loading-indicator/loading-indicator.component.html","../../../projects/stream-chat-angular/src/lib/injection-tokens.ts","../../../projects/stream-chat-angular/src/lib/message-input/textarea.directive.ts","../../../projects/stream-chat-angular/src/lib/message-input/emoji-input.service.ts","../../../projects/stream-chat-angular/src/lib/message-input/message-input-config.service.ts","../../../projects/stream-chat-angular/src/lib/message-list/image-load.service.ts","../../../projects/stream-chat-angular/src/lib/modal/modal.component.ts","../../../projects/stream-chat-angular/src/lib/modal/modal.component.html","../../../projects/stream-chat-angular/src/lib/attachment-list/attachment-list.component.ts","../../../projects/stream-chat-angular/src/lib/attachment-list/attachment-list.component.html","../../../projects/stream-chat-angular/src/lib/attachment-preview-list/attachment-preview-list.component.ts","../../../projects/stream-chat-angular/src/lib/attachment-preview-list/attachment-preview-list.component.html","../../../projects/stream-chat-angular/src/lib/message-input/message-input.component.ts","../../../projects/stream-chat-angular/src/lib/message-input/message-input.component.html","../../../projects/stream-chat-angular/src/lib/notification/notification.component.ts","../../../projects/stream-chat-angular/src/lib/notification/notification.component.html","../../../projects/stream-chat-angular/src/lib/notification-list/notification-list.component.ts","../../../projects/stream-chat-angular/src/lib/notification-list/notification-list.component.html","../../../projects/stream-chat-angular/src/lib/message-actions-box/message-actions-box.component.ts","../../../projects/stream-chat-angular/src/lib/message-actions-box/message-actions-box.component.html","../../../projects/stream-chat-angular/src/lib/channel/channel.component.ts","../../../projects/stream-chat-angular/src/lib/channel/channel.component.html","../../../projects/stream-chat-angular/src/lib/device-width.ts","../../../projects/stream-chat-angular/src/lib/channel-list/channel-list-toggle.service.ts","../../../projects/stream-chat-angular/src/lib/channel-header/channel-header.component.ts","../../../projects/stream-chat-angular/src/lib/channel-header/channel-header.component.html","../../../projects/stream-chat-angular/src/lib/channel-preview/channel-preview.component.ts","../../../projects/stream-chat-angular/src/lib/channel-preview/channel-preview.component.html","../../../projects/stream-chat-angular/src/lib/channel-list/channel-list.component.ts","../../../projects/stream-chat-angular/src/lib/channel-list/channel-list.component.html","../../../projects/stream-chat-angular/src/lib/message/parse-date.ts","../../../projects/stream-chat-angular/src/lib/message/read-by-text.ts","../../../projects/stream-chat-angular/src/lib/message-reactions/message-reactions.component.ts","../../../projects/stream-chat-angular/src/lib/message-reactions/message-reactions.component.html","../../../projects/stream-chat-angular/src/lib/message/message.component.ts","../../../projects/stream-chat-angular/src/lib/message/message.component.html","../../../projects/stream-chat-angular/src/lib/message-input/textarea/textarea.component.ts","../../../projects/stream-chat-angular/src/lib/message-input/textarea/textarea.component.html","../../../projects/stream-chat-angular/src/lib/transliteration.service.ts","../../../projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts","../../../projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.html","../../../projects/stream-chat-angular/src/lib/message-list/group-styles.ts","../../../projects/stream-chat-angular/src/lib/message-list/message-list.component.ts","../../../projects/stream-chat-angular/src/lib/message-list/message-list.component.html","../../../projects/stream-chat-angular/src/lib/thread/thread.component.ts","../../../projects/stream-chat-angular/src/lib/thread/thread.component.html","../../../projects/stream-chat-angular/src/lib/stream-avatar.module.ts","../../../projects/stream-chat-angular/src/lib/stream-chat.module.ts","../../../projects/stream-chat-angular/src/lib/stream-autocomplete-textarea.module.ts","../../../projects/stream-chat-angular/src/lib/stream-textarea.module.ts","../../../projects/stream-chat-angular/src/public-api.ts","../../../projects/stream-chat-angular/src/stream-chat-angular.ts"],"sourcesContent":["export const version = '2.20.1';\n","import { Injectable, TemplateRef } from '@angular/core';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { NotificationPayload, NotificationType } from './types';\n\n/**\n * The `NotificationService` can be used to add or remove notifications. By default the [`NotificationList`](../components/NotificationListComponent.mdx) component displays the currently active notifications.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class NotificationService {\n /**\n * Emits the currently active [notifications](https://github.com/GetStream/stream-chat-angular/blob/master/projects/stream-chat-angular/src/lib/notification.service.ts).\n */\n notifications$: Observable<NotificationPayload[]>;\n private notificationsSubject = new BehaviorSubject<NotificationPayload[]>([]);\n\n constructor() {\n this.notifications$ = this.notificationsSubject.asObservable();\n }\n\n /**\n * Displays a notification for the given amount of time.\n * @param content The text of the notification or the HTML template for the notification\n * @param type The type of the notification\n * @param timeout The number of milliseconds while the notification should be visible\n * @param translateParams Translation parameters for the `content` (for text notifications)\n * @param templateContext The input of the notification template (for HTML notifications)\n * @returns A method to clear the notification (before the timeout).\n */\n addTemporaryNotification<T>(\n content: string | TemplateRef<T>,\n type: NotificationType = 'error',\n timeout: number = 5000,\n translateParams?: Object,\n templateContext?: T\n ) {\n const notification = this.createNotification<T>(\n content,\n type,\n translateParams,\n templateContext\n );\n const id = setTimeout(\n () => this.removeNotification(notification.id),\n timeout\n );\n notification.dismissFn = () => {\n clearTimeout(id);\n this.removeNotification(notification.id);\n };\n this.notificationsSubject.next([\n ...this.notificationsSubject.getValue(),\n notification,\n ]);\n\n return notification.dismissFn;\n }\n\n /**\n * Displays a notification, that will be visible until it's removed.\n * @param content The text of the notification or the HTML template for the notification\n * @param type The type of the notification\n * @param translateParams Translation parameters for the `content` (for text notifications)\n * @param templateContext The input of the notification template (for HTML notifications)\n * @returns A method to clear the notification.\n */\n addPermanentNotification<\n T = {\n [key: string]: any;\n dismissFn: () => {};\n }\n >(\n content: string | TemplateRef<T>,\n type: NotificationType = 'error',\n translateParams?: Object,\n templateContext?: T\n ) {\n const notification = this.createNotification<T>(\n content,\n type,\n translateParams,\n templateContext\n );\n this.notificationsSubject.next([\n ...this.notificationsSubject.getValue(),\n notification,\n ]);\n\n return notification.dismissFn;\n }\n\n private createNotification<T>(\n content: string | TemplateRef<T>,\n type: NotificationType,\n translateParams?: Object,\n templateContext?: T\n ) {\n const id = new Date().getTime().toString() + Math.random().toString();\n return {\n id,\n [typeof content === 'string' ? 'text' : 'template']: content,\n type,\n translateParams,\n templateContext,\n dismissFn: () => this.removeNotification(id),\n };\n }\n\n private removeNotification(id: string) {\n const notifications = this.notificationsSubject.getValue();\n const index = notifications.findIndex((n) => n.id === id);\n if (index === -1) {\n return;\n }\n notifications.splice(index, 1);\n this.notificationsSubject.next([...notifications]);\n }\n}\n","import { Injectable, NgZone } from '@angular/core';\nimport { BehaviorSubject, Observable, ReplaySubject } from 'rxjs';\nimport {\n Channel,\n ChannelResponse,\n OwnUserResponse,\n UserResponse,\n} from 'stream-chat';\nimport { AppSettings, Event, StreamChat, TokenOrProvider } from 'stream-chat';\nimport { version } from '../assets/version';\nimport { NotificationService } from './notification.service';\n\nexport type Notification = {\n eventType: string;\n event: Event;\n};\n\n/**\n * The `ChatClient` service connects the user to the Stream chat.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class ChatClientService {\n /**\n * The [StreamChat client](https://github.com/GetStream/stream-chat-js/blob/master/src/client.ts) instance. In general you shouldn't need to access the client, but it's there if you want to use it.\n */\n chatClient!: StreamChat;\n /**\n * Emits [`Notification`](https://github.com/GetStream/stream-chat-angular/blob/master/projects/stream-chat-angular/src/lib/chat-client.service.ts) events. The platform documentation covers [the list of client and notification events](https://getstream.io/chat/docs/javascript/event_object/?language=javascript).\n * :::important\n * For performance reasons this Observable operates outside of the Angular change detection zone. If you subscribe to it, you need to manually reenter Angular's change detection zone, our [Change detection guide](../concepts/change-detection.mdx) explains this in detail.\n * :::\n */\n notification$: Observable<Notification>;\n /**\n * Emits the current [application settings](https://getstream.io/chat/docs/javascript/app_setting_overview/?language=javascript). Since getting the application settings is an expensive API call and we don't always need the result, this is not initialized by default, you need to call `getApplicationSettings` to load them.\n */\n appSettings$: Observable<AppSettings | undefined>;\n /**\n * Emits the current connection state of the user (`online` or `offline`)\n */\n connectionState$: Observable<'offline' | 'online'>;\n /**\n * Emits the list of pending invites of the user. It emits every pending invitation during initialization and then extends the list when a new invite is received. More information can be found in the [channel invitations](../code-examples/channel-invites.mdx) guide.\n */\n pendingInvites$: Observable<(ChannelResponse | Channel)[]>;\n private notificationSubject = new ReplaySubject<Notification>(1);\n private connectionStateSubject = new ReplaySubject<'offline' | 'online'>(1);\n private appSettingsSubject = new BehaviorSubject<AppSettings | undefined>(\n undefined\n );\n private pendingInvitesSubject = new BehaviorSubject<\n (ChannelResponse | Channel)[]\n >([]);\n\n constructor(\n private ngZone: NgZone,\n private notificationService: NotificationService\n ) {\n this.notification$ = this.notificationSubject.asObservable();\n this.connectionState$ = this.connectionStateSubject.asObservable();\n this.appSettings$ = this.appSettingsSubject.asObservable();\n this.pendingInvites$ = this.pendingInvitesSubject.asObservable();\n }\n\n /**\n * Creates a [`StreamChat`](https://github.com/GetStream/stream-chat-js/blob/668b3e5521339f4e14fc657834531b4c8bf8176b/src/client.ts#L124) instance using the provided `apiKey`, and connects a user with the given meta data and token. More info about [connecting users](https://getstream.io/chat/docs/javascript/init_and_users/?language=javascript) can be found in the platform documentation.\n * @param apiKey\n * @param userOrId\n * @param userTokenOrProvider\n */\n async init(\n apiKey: string,\n userOrId: string | OwnUserResponse | UserResponse,\n userTokenOrProvider: TokenOrProvider\n ) {\n this.chatClient = StreamChat.getInstance(apiKey);\n this.chatClient.devToken;\n await this.ngZone.runOutsideAngular(async () => {\n const user = typeof userOrId === 'string' ? { id: userOrId } : userOrId;\n await this.chatClient.connectUser(user, userTokenOrProvider);\n this.chatClient.setUserAgent(\n `stream-chat-angular-${version}-${this.chatClient.getUserAgent()}`\n );\n });\n const channels = await this.chatClient.queryChannels(\n { invite: 'pending' },\n {},\n { user_id: this.chatClient.user?.id }\n );\n this.pendingInvitesSubject.next(channels);\n this.appSettingsSubject.next(undefined);\n this.chatClient.on((e) => {\n this.updatePendingInvites(e);\n this.notificationSubject.next({\n eventType: e.type,\n event: e,\n });\n });\n let removeNotification: undefined | Function;\n this.chatClient.on('connection.changed', (e) => {\n this.ngZone.run(() => {\n const isOnline = e.online;\n if (isOnline) {\n if (removeNotification) {\n removeNotification();\n }\n } else {\n removeNotification =\n this.notificationService.addPermanentNotification(\n 'streamChat.Connection failure, reconnecting now...'\n );\n }\n this.connectionStateSubject.next(isOnline ? 'online' : 'offline');\n });\n });\n }\n\n /**\n * Disconnects the current user, and closes the WebSocket connection. Useful when disconnecting a chat user, use in combination with [`reset`](./ChannelService.mdx/#reset).\n */\n async disconnectUser() {\n this.pendingInvitesSubject.next([]);\n await this.chatClient.disconnectUser();\n }\n\n /**\n * Loads the current [application settings](https://getstream.io/chat/docs/javascript/app_setting_overview/?language=javascript), if the application settings have already been loaded, it does nothing.\n */\n async getAppSettings() {\n if (this.appSettingsSubject.getValue()) {\n return;\n }\n const settings = await this.chatClient.getAppSettings();\n this.appSettingsSubject.next(settings.app || {});\n }\n\n /**\n * Flag the message with the given ID. If you want to know [more about flags](https://getstream.io/chat/docs/javascript/moderation/?language=javascript) check out the platform documentation.\n * @param messageId\n */\n async flagMessage(messageId: string) {\n await this.chatClient.flagMessage(messageId);\n }\n\n /**\n * Searches for users in the application that have ID or name matching the provided search term\n * @param searchTerm\n * @returns The users matching the search\n */\n async autocompleteUsers(searchTerm: string) {\n if (!searchTerm) {\n return [];\n }\n const result = await this.chatClient.queryUsers({\n $or: [\n { id: { $autocomplete: searchTerm } },\n { name: { $autocomplete: searchTerm } },\n ],\n id: { $ne: this.chatClient.userID! },\n });\n return result.users;\n }\n\n private updatePendingInvites(e: Event) {\n if (e.member?.user?.id === this.chatClient.user?.id && e.channel) {\n const pendingInvites = this.pendingInvitesSubject.getValue();\n if (e.type === 'notification.invited') {\n this.pendingInvitesSubject.next([...pendingInvites, e.channel]);\n } else if (\n e.type === 'notification.invite_accepted' ||\n e.type === 'notification.invite_rejected'\n ) {\n const index = pendingInvites.findIndex(\n (i) => i?.cid === e.channel?.cid\n );\n if (index !== -1) {\n pendingInvites.splice(index, 1);\n this.pendingInvitesSubject.next([...pendingInvites]);\n }\n }\n }\n }\n}\n","import { Attachment, MessageResponse, UserResponse } from 'stream-chat';\nimport { v4 as uuidv4 } from 'uuid';\n\nexport const createMessagePreview = (\n user: UserResponse,\n text: string,\n attachments: Attachment[] = [],\n mentionedUsers: UserResponse[] = [],\n parentId: undefined | string = undefined,\n quotedMessageId: undefined | string = undefined\n) => {\n const clientSideId = `${user.id}-${uuidv4()}`;\n\n return {\n __html: text,\n created_at: new Date(),\n html: text,\n id: clientSideId,\n reactions: [],\n status: 'sending',\n text,\n type: 'regular',\n user,\n attachments,\n mentioned_users: mentionedUsers,\n parent_id: parentId,\n quoted_message_id: quotedMessageId,\n } as unknown as MessageResponse;\n};\n","import { Channel, FormatMessageResponse, UserResponse } from 'stream-chat';\n\nexport const getReadBy = (message: FormatMessageResponse, channel: Channel) => {\n const readBy: UserResponse[] = [];\n Object.keys(channel.state.read).forEach((key) => {\n if (\n channel.state.read[key].last_read.getTime() >=\n message.updated_at.getTime() &&\n message.user?.id !== key\n ) {\n readBy.push(channel.state.read[key].user);\n }\n });\n\n return readBy;\n};\n","import { Injectable, NgZone } from '@angular/core';\nimport {\n BehaviorSubject,\n combineLatest,\n Observable,\n ReplaySubject,\n} from 'rxjs';\nimport { filter, first, map, shareReplay } from 'rxjs/operators';\nimport {\n Attachment,\n Channel,\n ChannelFilters,\n ChannelOptions,\n ChannelResponse,\n ChannelSort,\n Event,\n FormatMessageResponse,\n MessageResponse,\n UpdatedMessage,\n UserResponse,\n} from 'stream-chat';\nimport { ChatClientService, Notification } from './chat-client.service';\nimport { createMessagePreview } from './message-preview';\nimport { MessageReactionType } from './message-reactions/message-reactions.component';\nimport { getReadBy } from './read-by';\nimport { AttachmentUpload, StreamMessage } from './types';\n\n/**\n * The `ChannelService` provides data and interaction for the channel list and message list. TEST\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class ChannelService {\n /**\n * Emits `false` if there are no more pages of channels that can be loaded.\n */\n hasMoreChannels$: Observable<boolean>;\n /**\n * Emits the currently loaded and [watched](https://getstream.io/chat/docs/javascript/watch_channel/?language=javascript) channel list.\n *\n * :::important\n * If you want to subscribe to channel events, you need to manually reenter Angular's change detection zone, our [Change detection guide](../concepts/change-detection.mdx) explains this in detail.\n * :::\n *\n * Apart from pagination, the channel list is also updated on the following events:\n *\n * | Event type | Default behavior | Custom handler to override |\n * | ----------------------------------- | ------------------------------------------------------------------ | --------------------------------------------- |\n * | `channel.deleted` | Remove channel from the list | `customChannelDeletedHandler` |\n * | `channel.hidden` | Remove channel from the list | `customChannelHiddenHandler` |\n * | `channel.truncated` | Updates the channel | `customChannelTruncatedHandler` |\n * | `channel.updated` | Updates the channel | `customChannelUpdatedHandler` |\n * | `channel.visible` | Adds the channel to the list | `customChannelVisibleHandler` |\n * | `message.new` | Moves the channel to top of the list | `customNewMessageHandler` |\n * | `notification.added_to_channel` | Adds the new channel to the top of the list and starts watching it | `customAddedToChannelNotificationHandler` |\n * | `notification.message_new` | Adds the new channel to the top of the list and starts watching it | `customNewMessageNotificationHandler` |\n * | `notification.removed_from_channel` | Removes the channel from the list | `customRemovedFromChannelNotificationHandler` |\n *\n * It's important to note that filters don't apply to updates to the list from events.\n *\n * Our platform documentation covers the topic of [channel events](https://getstream.io/chat/docs/javascript/event_object/?language=javascript#events) in depth.\n */\n channels$: Observable<Channel[] | undefined>;\n /**\n * Emits the currently active channel.\n *\n * :::important\n * If you want to subscribe to channel events, you need to manually reenter Angular's change detection zone, our [Change detection guide](../concepts/change-detection.mdx) explains this in detail.\n * :::\n */\n activeChannel$: Observable<Channel | undefined>;\n /**\n * Emits the list of currently loaded messages of the active channel.\n */\n activeChannelMessages$: Observable<StreamMessage[]>;\n /**\n * Emits the id of the currently selected parent message. If no message is selected, it emits undefined.\n */\n activeParentMessageId$: Observable<string | undefined>;\n /**\n * Emits the list of currently loaded thread replies belonging to the selected parent message. If there is no currently active thread it emits an empty array.\n */\n activeThreadMessages$: Observable<StreamMessage[]>;\n /**\n * Emits the currently selected parent message. If no message is selected, it emits undefined.\n */\n activeParentMessage$: Observable<StreamMessage | undefined>;\n /**\n * Emits the currently selected message to quote\n */\n messageToQuote$: Observable<StreamMessage | undefined>;\n /**\n * Emits the list of users that are currently typing in the channel (current user is not included)\n */\n usersTypingInChannel$: Observable<UserResponse[]>;\n /**\n * Emits the list of users that are currently typing in the active thread (current user is not included)\n */\n usersTypingInThread$: Observable<UserResponse[]>;\n /**\n * Emits a map that contains the date of the latest message sent by the current user by channels (this is used to detect if slow mode countdown should be started)\n */\n latestMessageDateByUserByChannels$: Observable<{ [key: string]: Date }>;\n /**\n * Custom event handler to call if a new message received from a channel that is not being watched, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customNewMessageNotificationHandler?: (\n notification: Notification,\n channelListSetter: (channels: (Channel | ChannelResponse)[]) => void\n ) => void;\n /**\n * Custom event handler to call when the user is added to a channel, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customAddedToChannelNotificationHandler?: (\n notification: Notification,\n channelListSetter: (channels: (Channel | ChannelResponse)[]) => void\n ) => void;\n /**\n * Custom event handler to call when the user is removed from a channel, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customRemovedFromChannelNotificationHandler?: (\n notification: Notification,\n channelListSetter: (channels: (Channel | ChannelResponse)[]) => void\n ) => void;\n /**\n * Custom event handler to call when a channel is deleted, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customChannelDeletedHandler?: (\n event: Event,\n channel: Channel,\n channelListSetter: (channels: (Channel | ChannelResponse)[]) => void,\n messageListSetter: (messages: StreamMessage[]) => void,\n threadListSetter: (messages: StreamMessage[]) => void,\n parentMessageSetter: (message: StreamMessage | undefined) => void\n ) => void;\n /**\n * Custom event handler to call when a channel is updated, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customChannelUpdatedHandler?: (\n event: Event,\n channel: Channel,\n channelListSetter: (channels: (Channel | ChannelResponse)[]) => void,\n messageListSetter: (messages: StreamMessage[]) => void,\n threadListSetter: (messages: StreamMessage[]) => void,\n parentMessageSetter: (message: StreamMessage | undefined) => void\n ) => void;\n /**\n * Custom event handler to call when a channel is truncated, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customChannelTruncatedHandler?: (\n event: Event,\n channel: Channel,\n channelListSetter: (channels: (Channel | ChannelResponse)[]) => void,\n messageListSetter: (messages: StreamMessage[]) => void,\n threadListSetter: (messages: StreamMessage[]) => void,\n parentMessageSetter: (message: StreamMessage | undefined) => void\n ) => void;\n /**\n * Custom event handler to call when a channel becomes hidden, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customChannelHiddenHandler?: (\n event: Event,\n channel: Channel,\n channelListSetter: (channels: (Channel | ChannelResponse)[]) => void,\n messageListSetter: (messages: StreamMessage[]) => void,\n threadListSetter: (messages: StreamMessage[]) => void,\n parentMessageSetter: (message: StreamMessage | undefined) => void\n ) => void;\n /**\n * Custom event handler to call when a channel becomes visible, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customChannelVisibleHandler?: (\n event: Event,\n channel: Channel,\n channelListSetter: (channels: (Channel | ChannelResponse)[]) => void,\n messageListSetter: (messages: StreamMessage[]) => void,\n threadListSetter: (messages: StreamMessage[]) => void,\n parentMessageSetter: (message: StreamMessage | undefined) => void\n ) => void;\n /**\n * Custom event handler to call if a new message received from a channel that is being watched, provide an event handler if you want to override the [default channel list ordering](./ChannelService.mdx/#channels)\n */\n customNewMessageHandler?: (\n event: Event,\n channel: Channel,\n channelListSetter: (channels: (Channel | ChannelResponse)[]) => void,\n messageListSetter: (messages: StreamMessage[]) => void,\n threadListSetter: (messages: StreamMessage[]) => void,\n parentMessageSetter: (message: StreamMessage | undefined) => void\n ) => void;\n private channelsSubject = new BehaviorSubject<Channel[] | undefined>(\n undefined\n );\n private activeChannelSubject = new BehaviorSubject<Channel | undefined>(\n undefined\n );\n private activeChannelMessagesSubject = new BehaviorSubject<\n (StreamMessage | MessageResponse | FormatMessageResponse)[]\n >([]);\n private hasMoreChannelsSubject = new ReplaySubject<boolean>(1);\n private activeChannelSubscriptions: { unsubscribe: () => void }[] = [];\n private activeParentMessageIdSubject = new BehaviorSubject<\n string | undefined\n >(undefined);\n private activeThreadMessagesSubject = new BehaviorSubject<\n (StreamMessage | MessageResponse | FormatMessageResponse)[]\n >([]);\n private latestMessageDateByUserByChannelsSubject = new BehaviorSubject<{\n [key: string]: Date;\n }>({});\n private filters: ChannelFilters | undefined;\n private sort: ChannelSort | undefined;\n private options: ChannelOptions | undefined;\n private readonly messagePageSize = 25;\n private messageToQuoteSubject = new BehaviorSubject<\n StreamMessage | undefined\n >(undefined);\n private usersTypingInChannelSubject = new BehaviorSubject<UserResponse[]>([]);\n private usersTypingInThreadSubject = new BehaviorSubject<UserResponse[]>([]);\n\n private channelListSetter = (channels: (Channel | ChannelResponse)[]) => {\n const currentChannels = this.channelsSubject.getValue() || [];\n const newChannels = channels.filter(\n (c) => !currentChannels.find((channel) => channel.cid === c.cid)\n );\n const deletedChannels = currentChannels.filter(\n (c) => !channels?.find((channel) => channel.cid === c.cid)\n );\n this.addChannelsFromNotification(newChannels as ChannelResponse[]);\n this.removeChannelsFromChannelList(deletedChannels.map((c) => c.cid));\n if (!newChannels.length && !deletedChannels.length) {\n this.channelsSubject.next(channels as Channel[]);\n }\n };\n\n private messageListSetter = (messages: StreamMessage[]) => {\n this.activeChannelMessagesSubject.next(messages);\n };\n\n private threadListSetter = (messages: StreamMessage[]) => {\n this.activeThreadMessagesSubject.next(messages);\n };\n\n private parentMessageSetter = (message: StreamMessage | undefined) => {\n this.activeParentMessageIdSubject.next(message?.id);\n };\n\n constructor(\n private chatClientService: ChatClientService,\n private ngZone: NgZone\n ) {\n this.channels$ = this.channelsSubject.asObservable();\n this.activeChannel$ = this.activeChannelSubject.asObservable();\n this.activeChannelMessages$ = this.activeChannelMessagesSubject.pipe(\n map((messages) => {\n const channel = this.activeChannelSubject.getValue()!;\n return messages.map((message) =>\n this.transformToStreamMessage(message, channel)\n );\n })\n );\n this.hasMoreChannels$ = this.hasMoreChannelsSubject.asObservable();\n this.activeParentMessageId$ =\n this.activeParentMessageIdSubject.asObservable();\n this.activeThreadMessages$ = this.activeThreadMessagesSubject.pipe(\n map((messages) => {\n const channel = this.activeChannelSubject.getValue()!;\n return messages.map((message) =>\n this.transformToStreamMessage(message, channel)\n );\n })\n );\n this.activeParentMessage$ = combineLatest([\n this.activeChannelMessages$,\n this.activeParentMessageId$,\n ]).pipe(\n map(\n ([messages, parentMessageId]: [\n StreamMessage[],\n string | undefined\n ]) => {\n if (!parentMessageId) {\n return undefined;\n } else {\n return messages.find((m) => m.id === parentMessageId);\n }\n }\n ),\n shareReplay()\n );\n this.messageToQuote$ = this.messageToQuoteSubject.asObservable();\n\n this.chatClientService.connectionState$\n .pipe(filter((s) => s === 'online'))\n .subscribe(() => {\n void this.setAsActiveParentMessage(undefined);\n });\n\n this.usersTypingInChannel$ =\n this.usersTypingInChannelSubject.asObservable();\n this.usersTypingInThread$ = this.usersTypingInThreadSubject.asObservable();\n this.latestMessageDateByUserByChannels$ =\n this.latestMessageDateByUserByChannelsSubject.asObservable();\n }\n\n /**\n * Sets the given `channel` as active.\n * @param channel\n */\n setAsActiveChannel(channel: Channel) {\n const prevActiveChannel = this.activeChannelSubject.getValue();\n this.stopWatchForActiveChannelEvents(prevActiveChannel);\n this.watchForActiveChannelEvents(channel);\n this.activeChannelSubject.next(channel);\n channel.state.messages.forEach((m) => {\n m.readBy = getReadBy(m, channel);\n });\n if (this.canSendReadEvents) {\n void channel.markRead();\n }\n this.activeChannelMessagesSubject.next([...channel.state.messages]);\n this.activeParentMessageIdSubject.next(undefined);\n this.activeThreadMessagesSubject.next([]);\n this.messageToQuoteSubject.next(undefined);\n }\n\n /**\n * Sets the given `message` as an active parent message. If `undefined` is provided, it will deleselect the current parent message.\n * @param message\n */\n async setAsActiveParentMessage(message: StreamMessage | undefined) {\n const messageToQuote = this.messageToQuoteSubject.getValue();\n if (messageToQuote && !!messageToQuote.parent_id) {\n this.messageToQuoteSubject.next(undefined);\n }\n if (!message) {\n this.activeParentMessageIdSubject.next(undefined);\n this.activeThreadMessagesSubject.next([]);\n } else {\n this.activeParentMessageIdSubject.next(message.id);\n const activeChannel = this.activeChannelSubject.getValue();\n const result = await activeChannel?.getReplies(message.id, {\n limit: this.options?.message_limit,\n });\n this.activeThreadMessagesSubject.next(result?.messages || []);\n }\n }\n\n /**\n * Loads the next page of messages of the active channel. The page size can be set in the [query option](https://getstream.io/chat/docs/javascript/query_channels/?language=javascript#query-options) object.\n */\n async loadMoreMessages() {\n const activeChnannel = this.activeChannelSubject.getValue();\n const lastMessageId = this.activeChannelMessagesSubject.getValue()[0]?.id;\n await activeChnannel?.query({\n messages: { limit: this.options?.message_limit, id_lt: lastMessageId },\n members: { limit: 0 },\n watchers: { limit: 0 },\n });\n if (\n activeChnannel?.data?.id ===\n this.activeChannelSubject.getValue()?.data?.id\n ) {\n this.activeChannelMessagesSubject.next([\n ...activeChnannel!.state.messages,\n ]);\n }\n }\n\n /**\n * Loads the next page of messages of the active thread. The page size can be set in the [query option](https://getstream.io/chat/docs/javascript/query_channels/?language=javascript#query-options) object.\n */\n async loadMoreThreadReplies() {\n const activeChnannel = this.activeChannelSubject.getValue();\n const parentMessageId = this.activeParentMessageIdSubject.getValue();\n if (!parentMessageId) {\n return;\n }\n const lastMessageId = this.activeThreadMessagesSubject.getValue()[0]?.id;\n await activeChnannel?.getReplies(parentMessageId, {\n limit: this.options?.message_limit,\n id_lt: lastMessageId,\n });\n this.activeThreadMessagesSubject.next(\n activeChnannel?.state.threads[parentMessageId] || []\n );\n }\n\n /**\n * Queries the channels with the given filters, sorts and options. More info about [channel querying](https://getstream.io/chat/docs/javascript/query_channels/?language=javascript) can be found in the platform documentation.\n * @param filters\n * @param sort\n * @param options\n */\n async init(\n filters: ChannelFilters,\n sort?: ChannelSort,\n options?: ChannelOptions\n ) {\n this.filters = filters;\n this.options = options || {\n offset: 0,\n limit: 25,\n state: true,\n presence: true,\n watch: true,\n message_limit: this.messagePageSize,\n };\n this.sort = sort || { last_message_at: -1, updated_at: -1 };\n await this.queryChannels();\n this.chatClientService.notification$.subscribe(\n (notification) => void this.handleNotification(notification)\n );\n }\n\n /**\n * Resets the `activeChannel$`, `channels$` and `activeChannelMessages$` Observables. Useful when disconnecting a chat user, use in combination with [`disconnectUser`](./ChatClientService.mdx/#disconnectuser).\n */\n reset() {\n this.activeChannelMessagesSubject.next([]);\n this.activeChannelSubject.next(undefined);\n this.activeParentMessageIdSubject.next(undefined);\n this.activeThreadMessagesSubject.next([]);\n this.channelsSubject.next(undefined);\n this.latestMessageDateByUserByChannelsSubject.next({});\n this.selectMessageToQuote(undefined);\n }\n\n /**\n * Loads the next page of channels. The page size can be set in the [query option](https://getstream.io/chat/docs/javascript/query_channels/?language=javascript#query-options) object.\n */\n async loadMoreChannels() {\n this.options!.offset = this.channels.length!;\n await this.queryChannels();\n }\n\n /**\n * Adds a reaction to a message.\n * @param messageId The id of the message to add the reaction to\n * @param reactionType The type of the reaction\n */\n async addReaction(messageId: string, reactionType: MessageReactionType) {\n await this.activeChannelSubject.getValue()?.sendReaction(messageId, {\n type: reactionType,\n });\n }\n\n /**\n * Removes a reaction from a message.\n * @param messageId The id of the message to remove the reaction from\n * @param reactionType Thr type of reaction to remove\n */\n async removeReaction(messageId: string, reactionType: MessageReactionType) {\n await this.activeChannelSubject\n .getValue()\n ?.deleteReaction(messageId, reactionType);\n }\n\n /**\n * Sends a message to the active channel. The message is immediately added to the message list, if an error occurs and the message can't be sent, the error is indicated in `state` of the message.\n * @param text The text of the message\n * @param attachments The attachments\n * @param mentionedUsers Mentioned users\n * @param parentId Id of the parent message (if sending a thread reply)\n * @param quotedMessageId Id of the message to quote (if sending a quote reply)\n */\n async sendMessage(\n text: string,\n attachments: Attachment[] = [],\n mentionedUsers: UserResponse[] = [],\n parentId: string | undefined = undefined,\n quotedMessageId: string | undefined = undefined\n ) {\n const preview = createMessagePreview(\n this.chatClientService.chatClient.user!,\n text,\n attachments,\n mentionedUsers,\n parentId,\n quotedMessageId\n );\n const channel = this.activeChannelSubject.getValue()!;\n preview.readBy = [];\n channel.state.addMessageSorted(preview, true);\n await this.sendMessageRequest(preview);\n }\n\n /**\n * Resends the given message to the active channel\n * @param message The message to resend\n */\n async resendMessage(message: StreamMessage) {\n const channel = this.activeChannelSubject.getValue()!;\n channel.state.addMessageSorted(\n {\n ...(message as any as MessageResponse),\n errorStatusCode: undefined,\n status: 'sending',\n },\n true\n );\n await this.sendMessageRequest(message);\n }\n\n /**\n * Updates the message in the active channel\n * @param message Mesage to be updated\n */\n async updateMessage(message: StreamMessage) {\n await this.chatClientService.chatClient.updateMessage(\n message as UpdatedMessage\n );\n }\n\n /**\n * Deletes the message from the active channel\n * @param message Message to be deleted\n */\n async deleteMessage(message: StreamMessage) {\n await this.chatClientService.chatClient.deleteMessage(message.id);\n }\n\n /**\n * Uploads files to the channel. If you want to know more about [file uploads](https://getstream.io/chat/docs/javascript/file_uploads/?language=javascript) check out the platform documentation.\n * @param uploads the attachments to upload (output of the [`AttachmentService`](./AttachmentService.mdx))\n * @returns the result of file upload requests\n */\n async uploadAttachments(\n uploads: AttachmentUpload[]\n ): Promise<AttachmentUpload[]> {\n const result: AttachmentUpload[] = [];\n const channel = this.activeChannelSubject.getValue()!;\n const uploadResults = await Promise.allSettled(\n uploads.map((upload) =>\n upload.type === 'image'\n ? channel.sendImage(upload.file)\n : channel.sendFile(upload.file)\n )\n );\n uploadResults.forEach((uploadResult, i) => {\n const file = uploads[i].file;\n const type = uploads[i].type;\n if (uploadResult.status === 'fulfilled') {\n result.push({\n file,\n type,\n state: 'success',\n url: uploadResult.value.file,\n });\n } else {\n result.push({ file, type, state: 'error' });\n }\n });\n\n return result;\n }\n\n /**\n * Deletes an uploaded file by URL. If you want to know more about [file uploads](https://getstream.io/chat/docs/javascript/file_uploads/?language=javascript) check out the platform documentation\n * @param attachmentUpload Attachment to be deleted (output of the [`AttachmentService`](./AttachmentService.mdx))\n */\n async deleteAttachment(attachmentUpload: AttachmentUpload) {\n const channel = this.activeChannelSubject.getValue()!;\n await (attachmentUpload.type === 'image'\n ? channel.deleteImage(attachmentUpload.url!)\n : channel.deleteFile(attachmentUpload.url!));\n }\n\n /**\n * Returns the autocomplete options for current channel members. If the channel has less than 100 members, it returns the channel members, otherwise sends a [search request](https://getstream.io/chat/docs/javascript/query_members/?language=javascript#pagination-and-ordering) with the given search term.\n * @param searchTerm Text to search for in the names of members\n * @returns The list of members matching the search filter\n */\n async autocompleteMembers(searchTerm: string) {\n const activeChannel = this.activeChannelSubject.getValue();\n if (!activeChannel) {\n return [];\n }\n if (Object.keys(activeChannel.state.members).length <= 100) {\n return Object.values(activeChannel.state.members).filter(\n (m) => m.user?.id !== this.chatClientService.chatClient.userID!\n );\n } else {\n if (!searchTerm) {\n return [];\n }\n const result = await activeChannel.queryMembers({\n name: { $autocomplete: searchTerm },\n id: { $ne: this.chatClientService.chatClient.userID! },\n });\n return Object.values(result.members);\n }\n }\n\n /**\n * [Runs a message action](https://getstream.io/chat/docs/rest/#messages-runmessageaction) in the current channel. Updates the message list based on the action result (if no message is returned, the message will be removed from the message list).\n * @param messageId\n * @param formData\n */\n async sendAction(messageId: string, formData: Record<string, string>) {\n const channel = this.activeChannelSubject.getValue()!;\n const response = await channel.sendAction(messageId, formData);\n if (response?.message) {\n channel.state.addMessageSorted({\n ...response.message,\n status: 'received',\n });\n const isThreadReply = !!response.message.parent_id;\n isThreadReply\n ? this.activeThreadMessagesSubject.next([\n ...channel.state.threads[response.message.parent_id!],\n ])\n : this.activeChannelMessagesSubject.next([...channel.state.messages]);\n } else {\n channel.state.removeMessage({ id: messageId });\n if (\n this.activeChannelMessagesSubject\n .getValue()\n .find((m) => m.id === messageId)\n ) {\n this.activeChannelMessagesSubject.next([...channel.state.messages]);\n } else if (\n this.activeThreadMessagesSubject\n .getValue()\n .find((m) => m.id === messageId)\n ) {\n this.activeThreadMessagesSubject.next(\n channel.state.threads[this.activeParentMessageIdSubject.getValue()!]\n );\n }\n }\n }\n\n /**\n * Selects or deselects the current message to quote reply to\n * @param message The message to select, if called with `undefined`, it deselects the message\n */\n selectMessageToQuote(message: StreamMessage | undefined) {\n this.messageToQuoteSubject.next(message);\n }\n\n private async sendMessageRequest(preview: MessageResponse | StreamMessage) {\n const channel = this.activeChannelSubject.getValue()!;\n const isThreadReply = !!preview.parent_id;\n isThreadReply\n ? this.activeThreadMessagesSubject.next([\n ...channel.state.threads[preview.parent_id!],\n ])\n : this.activeChannelMessagesSubject.next([...channel.state.messages]);\n try {\n const response = await channel.sendMessage({\n text: preview.text,\n attachments: preview.attachments,\n mentioned_users: preview.mentioned_users?.map((u) => u.id),\n id: preview.id,\n parent_id: preview.parent_id,\n quoted_message_id: preview.quoted_message_id,\n });\n if (response?.message) {\n channel.state.addMessageSorted(\n {\n ...response.message,\n status: 'received',\n },\n true\n );\n isThreadReply\n ? this.activeThreadMessagesSubject.next([\n ...channel.state.threads[preview.parent_id!],\n ])\n : this.activeChannelMessagesSubject.next([...channel.state.messages]);\n }\n } catch (error) {\n const stringError = JSON.stringify(error);\n const parsedError: { status?: number } = stringError\n ? (JSON.parse(stringError) as { status?: number })\n : {};\n\n channel.state.addMessageSorted(\n {\n ...(preview as MessageResponse),\n errorStatusCode: parsedError.status || undefined,\n status: 'failed',\n },\n true\n );\n isThreadReply\n ? this.activeThreadMessagesSubject.next([\n ...channel.state.threads[preview.parent_id!],\n ])\n : this.activeChannelMessagesSubject.next([...channel.state.messages]);\n }\n }\n\n private handleNotification(notification: Notification) {\n switch (notification.eventType) {\n case 'notification.message_new': {\n this.ngZone.run(() => {\n if (this.customNewMessageNotificationHandler) {\n this.customNewMessageNotificationHandler(\n notification,\n this.channelListSetter\n );\n } else {\n this.handleNewMessageNotification(notification);\n }\n });\n break;\n }\n case 'notification.added_to_channel': {\n this.ngZone.run(() => {\n if (this.customAddedToChannelNotificationHandler) {\n this.customAddedToChannelNotificationHandler(\n notification,\n this.channelListSetter\n );\n } else {\n this.handleAddedToChannelNotification(notification);\n }\n });\n break;\n }\n case 'notification.removed_from_channel': {\n this.ngZone.run(() => {\n if (this.customRemovedFromChannelNotificationHandler) {\n this.customRemovedFromChannelNotificationHandler(\n notification,\n this.channelListSetter\n );\n } else {\n this.handleRemovedFromChannelNotification(notification);\n }\n });\n }\n }\n }\n\n private handleRemovedFromChannelNotification(notification: Notification) {\n const channelIdToBeRemoved = notification.event.channel!.cid;\n this.removeChannelsFromChannelList([channelIdToBeRemoved]);\n }\n\n private handleNewMessageNotification(notification: Notification) {\n if (notification.event.channel) {\n this.addChannelsFromNotification([notification.event.channel]);\n }\n }\n\n private handleAddedToChannelNotification(notification: Notification) {\n if (notification.event.channel) {\n this.addChannelsFromNotification([notification.event.channel]);\n }\n }\n\n private addChannelsFromNotification(channelResponses: ChannelResponse[]) {\n const newChannels: Channel[] = [];\n channelResponses.forEach((channelResponse) => {\n const channel = this.chatClientService.chatClient.channel(\n channelResponse.type,\n channelResponse.id\n );\n void channel.watch();\n this.watchForChannelEvents(channel);\n newChannels.push(channel);\n });\n this.channelsSubject.next([\n ...newChannels,\n ...(this.channelsSubject.getValue() || []),\n ]);\n }\n\n private removeChannelsFromChannelList(cids: string[]) {\n const channels = this.channels.filter((c) => !cids.includes(c.cid || ''));\n if (channels.length < this.channels.length) {\n this.channelsSubject.next(channels);\n if (cids.includes(this.activeChannelSubject.getValue()?.cid || '')) {\n if (channels.length > 0) {\n this.setAsActiveChannel(channels[0]);\n } else {\n this.activeChannelSubject.next(undefined);\n }\n }\n }\n }\n\n private watchForActiveChannelEvents(channel: Channel) {\n this.activeChannelSubscriptions.push(\n channel.on('message.new', (event) => {\n this.ngZone.run(() => {\n event.message && event.message.parent_id\n ? this.activeThreadMessagesSubject.next([\n ...channel.state.threads[event.message.parent_id],\n ])\n : this.activeChannelMessagesSubject.next([\n ...channel.state.messages,\n ]);\n this.activeChannel$.pipe(first()).subscribe((c) => {\n if (this.canSendReadEvents) {\n void c?.markRead();\n }\n });\n this.updateLatestMessages(event);\n });\n })\n );\n this.activeChannelSubscriptions.push(\n channel.on('message.updated', (event) => this.messageUpdated(event))\n );\n this.activeChannelSubscriptions.push(\n channel.on('message.deleted', (event) => this.messageUpdated(event))\n );\n this.activeChannelSubscriptions.push(\n channel.on('reaction.new', (e) => this.messageReactionEventReceived(e))\n );\n this.activeChannelSubscriptions.push(\n channel.on('reaction.deleted', (e) =>\n this.messageReactionEventReceived(e)\n )\n );\n this.activeChannelSubscriptions.push(\n channel.on('reaction.updated', (e) =>\n this.messageReactionEventReceived(e)\n )\n );\n this.activeChannelSubscriptions.push(\n channel.on('message.read', (e) => {\n this.ngZone.run(() => {\n let latestMessage!: StreamMessage;\n this.activeChannelMessages$.pipe(first()).subscribe((messages) => {\n latestMessage = messages[messages.length - 1];\n });\n if (!latestMessage || !e.user) {\n return;\n }\n latestMessage.readBy = getReadBy(latestMessage, channel);\n\n this.activeChannelMessagesSubject.next(\n this.activeChannelMessagesSubject.getValue()\n );\n });\n })\n );\n this.activeChannelSubscriptions.push(\n channel.on('typing.start', (e) =>\n this.ngZone.run(() => this.handleTypingStartEvent(e))\n )\n );\n this.activeChannelSubscriptions.push(\n channel.on('typing.stop', (e) =>\n this.ngZone.run(() => this.handleTypingStopEvent(e))\n )\n );\n }\n\n /**\n * Call this method if user started typing in the active channel\n * @param parentId The id of the parent message, if user is typing in a thread\n */\n async typingStarted(parentId?: string) {\n const activeChannel = this.activeChannelSubject.getValue();\n await activeChannel?.keystroke(parentId);\n }\n\n /**\n * Call this method if user stopped typing in the active channel\n * @param parentId The id of the parent message, if user were typing in a thread\n */\n async typingStopped(parentId?: string) {\n const activeChannel = this.activeChannelSubject.getValue();\n await activeChannel?.stopTyping(parentId);\n }\n\n private messageUpdated(event: Event) {\n this.ngZone.run(() => {\n const isThreadReply = event.message && event.message.parent_id;\n const messages = isThreadReply\n ? this.activeThreadMessagesSubject.getValue()\n : this.activeChannelMessagesSubject.getValue();\n const messageIndex = messages.findIndex(\n (m) => m.id === event.message?.id\n );\n if (messageIndex !== -1 && event.message) {\n messages[messageIndex] = event.message;\n isThreadReply\n ? this.activeThreadMessagesSubject.next([...messages])\n : this.activeChannelMessagesSubject.next([...messages]);\n }\n });\n }\n\n private messageReactionEventReceived(e: Event) {\n this.ngZone.run(() => {\n const isThreadMessage = e.message && e.message.parent_id;\n let messages!: StreamMessage[];\n (isThreadMessage\n ? this.activeThreadMessages$\n : this.activeChannelMessages$\n )\n .pipe(first())\n .subscribe((m) => (messages = m));\n const message = messages.find((m) => m.id === e?.message?.id);\n if (!message) {\n return;\n }\n message.reaction_counts = { ...e.message?.reaction_counts };\n message.reaction_scores = { ...e.message?.reaction_scores };\n message.latest_reactions = [...(e.message?.latest_reactions || [])];\n message.own_reactions = [...(e.message?.own_reactions || [])];\n isThreadMessage\n ? this.activeThreadMessagesSubject.next([...messages])\n : this.activeChannelMessagesSubject.next([...messages]);\n });\n }\n\n private formatMessage(message: MessageResponse) {\n return {\n ...message,\n // parse the date..\n pinned_at: message.pinned_at ? new Date(message.pinned_at) : null,\n created_at: message.created_at\n ? new Date(message.created_at)\n : new Date(),\n updated_at: message.updated_at\n ? new Date(message.updated_at)\n : new Date(),\n status: message.status || 'received',\n };\n }\n\n private isStreamMessage(\n message: StreamMessage | FormatMessageResponse | MessageResponse\n ): message is StreamMessage {\n return !!message.readBy;\n }\n\n private isFormatMessageResponse(\n message: StreamMessage | FormatMessageResponse | MessageResponse\n ): message is FormatMessageResponse {\n return message.created_at instanceof Date;\n }\n\n private stopWatchForActiveChannelEvents(channel: Channel | undefined) {\n if (!channel) {\n return;\n }\n this.activeChannelSubscriptions.forEach((s) => s.unsubscribe());\n this.activeChannelSubscriptions = [];\n }\n\n private async queryChannels() {\n try {\n const channels = await this.chatClientService.chatClient.queryChannels(\n this.filters!,\n this.sort,\n this.options\n );\n channels.forEach((c) => this.watchForChannelEvents(c));\n const prevChannels = this.channelsSubject.getValue() || [];\n this.channelsSubject.next([...prevChannels, ...channels]);\n if (channels.length > 0 && !this.activeChannelSubject.getValue()) {\n this.setAsActiveChannel(channels[0]);\n }\n this.hasMoreChannelsSubject.next(channels.length >= this.options!.limit!);\n } catch (error) {\n this.channelsSubject.error(error);\n }\n }\n\n private watchForChannelEvents(channel: Channel) {\n channel.on((event: Event) => {\n switch (event.type) {\n case 'message.new': {\n this.ngZone.run(() => {\n if (this.customNewMessageHandler) {\n this.customNewMessageHandler(\n event,\n channel,\n this.channelListSetter,\n this.messageListSetter,\n this.threadListSetter,\n this.parentMessageSetter\n );\n } else {\n this.handleNewMessage(event, channel);\n }\n });\n break;\n }\n case 'channel.hidden': {\n this.ngZone.run(() => {\n if (this.customChannelHiddenHandler) {\n this.customChannelHiddenHandler(\n event,\n channel,\n this.channelListSetter,\n this.messageListSetter,\n this.threadListSetter,\n this.parentMessageSetter\n );\n } else {\n this.handleChannelHidden(event);\n }\n });\n break;\n }\n case 'channel.deleted': {\n this.ngZone.run(() => {\n if (this.customChannelDeletedHandler) {\n this.customChannelDeletedHandler(\n event,\n channel,\n this.channelListSetter,\n this.messageListSetter,\n this.threadListSetter,\n this.parentMessageSetter\n );\n } else {\n this.handleChannelDeleted(event);\n }\n });\n break;\n }\n case 'channel.visible': {\n this.ngZone.run(() => {\n if (this.customChannelVisibleHandler) {\n this.customChannelVisibleHandler(\n event,\n channel,\n this.channelListSetter,\n this.messageListSetter,\n this.threadListSetter,\n this.parentMessageSetter\n );\n } else {\n this.handleChannelVisible(event, channel);\n }\n });\n break;\n }\n case 'channel.updated': {\n this.ngZone.run(() => {\n if (this.customChannelUpdatedHandler) {\n this.customChannelUpdatedHandler(\n event,\n channel,\n this.channelListSetter,\n this.messageListSetter,\n this.threadListSetter,\n this.parentMessageSetter\n );\n } else {\n this.handleChannelUpdate(event);\n }\n });\n break;\n }\n case 'channel.truncated': {\n this.ngZone.run(() => {\n if (this.customChannelTruncatedHandler) {\n this.customChannelTruncatedHandler(\n event,\n channel,\n this.channelListSetter,\n this.messageListSetter,\n this.threadListSetter,\n this.parentMessageSetter\n );\n } else {\n this.handleChannelTruncate(event);\n }\n });\n break;\n }\n }\n });\n }\n\n private handleNewMessage(_: Event, channel: Channel) {\n const channelIndex = this.channels.findIndex((c) => c.cid === channel.cid);\n this.channels.splice(channelIndex, 1);\n this.channelsSubject.next([channel, ...this.channels]);\n }\n\n private handleChannelHidden(event: Event) {\n this.removeChannelsFromChannelList([event.channel!.cid]);\n }\n\n private handleChannelDeleted(event: Event) {\n this.removeChannelsFromChannelList([event.channel!.cid]);\n }\n\n private handleChannelVisible(event: Event, channel: Channel) {\n if (!this.channels.find((c) => c.cid === event.cid)) {\n this.ngZone.run(() =>\n this.channelsSubject.next([...this.channels, channel])\n );\n }\n }\n\n private handleChannelUpdate(event: Event) {\n const channelIndex = this.channels.findIndex(\n (c) => c.cid === event.channel!.cid\n );\n if (channelIndex !== -1) {\n this.channels[channelIndex].data = event.channel;\n this.channelsSubject.next([...this.channels]);\n if (event.channel?.cid === this.activeChannelSubject.getValue()?.cid) {\n const channel = this.activeChannelSubject.getValue()!;\n channel.data = event.channel;\n this.activeChannelSubject.next(channel);\n }\n }\n }\n\n private handleChannelTruncate(event: Event) {\n const channelIndex = this.channels.findIndex(\n (c) => c.cid === event.channel!.cid\n );\n if (channelIndex !== -1) {\n this.channels[channelIndex].state.messages = [];\n this.channelsSubject.next([...this.channels]);\n if (event.channel?.cid === this.activeChannelSubject.getValue()?.cid) {\n const channel = this.activeChannelSubject.getValue()!;\n channel.state.messages = [];\n this.activeChannelSubject.next(channel);\n this.activeChannelMessagesSubject.next([]);\n this.activeParentMessageIdSubject.next(undefined);\n this.activeThreadMessagesSubject.next([]);\n }\n }\n }\n\n private get channels() {\n return this.channelsSubject.getValue() || [];\n }\n\n private get canSendReadEvents() {\n const channel = this.activeChannelSubject.getValue();\n if (!channel) {\n return false;\n }\n const capabilites = channel.data?.own_capabilities as string[];\n return capabilites.indexOf('read-events') !== -1;\n }\n\n private transformToStreamMessage(\n message: StreamMessage | MessageResponse | FormatMessageResponse,\n channel: Channel\n ) {\n const isThreadMessage = !!message.parent_id;\n if (\n this.isStreamMessage(message) &&\n this.isFormatMessageResponse(message)\n ) {\n return message;\n } else if (this.isFormatMessageResponse(message)) {\n return {\n ...message,\n readBy: isThreadMessage ? [] : getReadBy(message, channel),\n };\n } else {\n const formatMessage = this.formatMessage(message);\n return {\n ...formatMessage,\n readBy: isThreadMessage ? [] : getReadBy(formatMessage, channel),\n };\n }\n }\n\n private handleTypingStartEvent(event: Event) {\n if (event.user?.id === this.chatClientService.chatClient.user?.id) {\n return;\n }\n const isTypingInThread = !!event.parent_id;\n if (\n isTypingInThread &&\n event.parent_id !== this.activeParentMessageIdSubject.getValue()\n ) {\n return;\n }\n const subject = isTypingInThread\n ? this.usersTypingInThreadSubject\n : this.usersTypingInChannelSubject;\n const users: UserResponse[] = subject.getValue();\n const user = event.user;\n if (user && !users.find((u) => u.id === user.id)) {\n users.push(user);\n subject.next([...users]);\n }\n }\n\n private handleTypingStopEvent(event: Event) {\n const usersTypingInChannel = this.usersTypingInChannelSubject.getValue();\n const usersTypingInThread = this.usersTypingInThreadSubject.getValue();\n const user = event.user;\n if (user && usersTypingInChannel.find((u) => u.id === user.id)) {\n usersTypingInChannel.splice(\n usersTypingInChannel.findIndex((u) => u.id === user.id),\n 1\n );\n this.usersTypingInChannelSubject.next([...usersTypingInChannel]);\n return;\n }\n if (user && usersTypingInThread.find((u) => u.id === user.id)) {\n usersTypingInThread.splice(\n usersTypingInThread.findIndex((u) => u.id === user.id),\n 1\n );\n this.usersTypingInThreadSubject.next([...usersTypingInThread]);\n return;\n }\n }\n\n private updateLatestMessages(event: Event) {\n if (\n event.message?.user?.id !== this.chatClientService?.chatClient.user?.id\n ) {\n return;\n }\n const latestMessages =\n this.latestMessageDateByUserByChannelsSubject.getValue();\n if (!event.message?.created_at) {\n return;\n }\n const channelId = event?.message?.cid;\n if (!channelId) {\n return;\n }\n const messageDate = new Date(event.message.created_at);\n if (\n !latestMessages[channelId] ||\n latestMessages[channelId]?.getTime() < messageDate.getTime()\n ) {\n latestMessages[channelId] = messageDate;\n this.latestMessageDateByUserByChannelsSubject.next({\n ...latestMessages,\n });\n }\n }\n}\n","import { Injectable } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\n\nexport type Theme = 'light' | 'dark';\n\n/**\n * The `ThemeService` can be used to change the theme of the chat UI and to customize the theme. Our [themeing guide](../concepts/themeing-and-css.mdx) gives a complete overview about the topic.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class ThemeService {\n /**\n * A Subject that can be used to get or set the currently active theme.\n */\n theme$ = new BehaviorSubject<Theme>('light');\n private _customLightThemeVariables: { [key: string]: string } | undefined;\n private _customDarkThemeVariables: { [key: string]: string } | undefined;\n private defaultDarkModeVariables = {\n '--bg-gradient-end': '#101214',\n '--bg-gradient-start': '#070a0d',\n '--black': '#ffffff',\n '--blue-alice': '#00193d',\n '--border': '#141924',\n '--button-background': '#ffffff',\n '--button-text': '#005fff',\n '--grey': '#7a7a7a',\n '--grey-gainsboro': '#2d2f2f',\n '--grey-whisper': '#1c1e22',\n '--modal-shadow': '#000000',\n '--overlay': '#00000066', // 66 = 40% opacity\n '--overlay-dark': '#ffffffcc', // CC = 80% opacity\n '--shadow-icon': '#00000080', // 80 = 50% opacity\n '--targetedMessageBackground': '#302d22',\n '--transparent': 'transparent',\n '--white': '#101418',\n '--white-smoke': '#13151b',\n '--white-snow': '#070a0d',\n };\n private variablesToDelete: { [key: string]: string }[] = [];\n\n constructor() {\n this.theme$.subscribe((theme) => {\n const darkVariables = this.customDarkThemeVariables\n ? { ...this.defaultDarkModeVariables, ...this.customDarkThemeVariables }\n : this.defaultDarkModeVariables;\n const lightVariables = this.customLightThemeVariables\n ? this.customLightThemeVariables\n : {};\n this.variablesToDelete.forEach((variables) =>\n this.deleteVariables(variables)\n );\n if (theme === 'dark') {\n this.deleteVariables(lightVariables);\n this.setVariables(darkVariables);\n } else {\n this.deleteVariables(darkVariables);\n this.setVariables(lightVariables);\n }\n });\n }\n\n /**\n * A getter that returns the currently set custom light theme variables.\n * @returns An object where the keys are theme variables, and the values are the currently set CSS values.\n */\n get customLightThemeVariables() {\n return this._customLightThemeVariables;\n }\n\n /**\n * A setter that can be used to overwrite the values of the CSS theme variables of the light theme.\n * @param variables An object where the keys are theme variables, and the values are CSS values.\n */\n set customLightThemeVariables(\n variables: { [key: string]: string } | undefined\n ) {\n const prevVariables = this.customLightThemeVariables;\n if (prevVariables) {\n this.variablesToDelete.push(prevVariables);\n }\n this._customLightThemeVariables = variables;\n if (this.theme$.getValue() === 'light') {\n this.theme$.next('light');\n }\n }\n\n /**\n * A getter that returns the currently set custom dark theme variables.\n * @returns An object where the keys are theme variables, and the values are the currently set CSS values.\n */\n get customDarkThemeVariables() {\n return this._customDarkThemeVariables;\n }\n\n /**\n * A setter that can be used to overwrite the values of the CSS theme variables of the dark theme.\n * @param variables An object where the keys are theme variables, and the values are CSS values.\n */\n set customDarkThemeVariables(\n variables: { [key: string]: string } | undefined\n ) {\n const prevVariables = this.customDarkThemeVariables;\n if (prevVariables) {\n this.variablesToDelete.push(prevVariables);\n }\n this._customDarkThemeVariables = variables;\n if (this.theme$.getValue() === 'dark') {\n this.theme$.next('dark');\n }\n }\n\n private deleteVariables(variables: { [key: string]: string } | undefined) {\n if (!variables) {\n return;\n }\n Object.keys(variables).forEach((key) =>\n document.documentElement.style.setProperty(key, null)\n );\n }\n\n private setVariables(variables: { [key: string]: string } | undefined) {\n if (!variables) {\n return;\n }\n Object.keys(variables).forEach((key) =>\n document.documentElement.style.setProperty(key, variables[key])\n );\n }\n}\n","export const isImageFile = (file: File) => {\n // photoshop files begin with 'image/'\n return file.type.startsWith('image/') && !file.type.endsWith('.photoshop');\n};\n","import { Attachment } from 'stream-chat';\n\nexport const isImageAttachment = (attachment: Attachment) => {\n return (\n attachment.type === 'image' &&\n !attachment.title_link &&\n !attachment.og_scrape_url\n );\n};\n","import { Injectable } from '@angular/core';\nimport { isImageFile } from './is-image-file';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { Attachment } from 'stream-chat';\nimport { ChannelService } from './channel.service';\nimport { isImageAttachment } from './is-image-attachment';\nimport { NotificationService } from './notification.service';\nimport { AttachmentUpload } from './types';\n\n/**\n * The `AttachmentService` manages the uploads of a message input.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class AttachmentService {\n /**\n * Emits the number of uploads in progress.\n */\n attachmentUploadInProgressCounter$: Observable<number>;\n /**\n * Emits the state of the uploads ([`AttachmentUpload[]`](https://github.com/GetStream/stream-chat-angular/blob/master/projects/stream-chat-angular/src/lib/types.ts)), it adds a state (`success`, `error` or `uploading`) to each file the user selects for upload. It is used by the [`AttachmentPreviewList`](../components/AttachmentPreviewListComponent.mdx) to display the attachment previews.\n */\n attachmentUploads$: Observable<AttachmentUpload[]>;\n private attachmentUploadInProgressCounterSubject =\n new BehaviorSubject<number>(0);\n private attachmentUploadsSubject = new BehaviorSubject<AttachmentUpload[]>(\n []\n );\n\n constructor(\n private channelService: ChannelService,\n private notificationService: NotificationService\n ) {\n this.attachmentUploadInProgressCounter$ =\n this.attachmentUploadInProgressCounterSubject.asObservable();\n this.attachmentUploads$ = this.attachmentUploadsSubject.asObservable();\n }\n\n /**\n * Resets the attachments uploads (for example after the message with the attachments sent successfully)\n */\n resetAttachmentUploads() {\n this.attachmentUploadsSubject.next([]);\n }\n\n /**\n * Uploads the selected files, and creates preview for image files. The result is propagated throught the `attachmentUploads$` stream.\n * @param fileList The files selected by the user\n * @returns A promise with the result\n */\n async filesSelected(fileList: FileList | null) {\n if (!fileList) {\n return;\n }\n const imageFiles: File[] = [];\n const dataFiles: File[] = [];\n\n Array.from(fileList).forEach((file) => {\n if (isImageFile(file)) {\n imageFiles.push(file);\n } else {\n dataFiles.push(file);\n }\n });\n imageFiles.forEach((f) => this.createPreview(f));\n const newUploads = [\n ...imageFiles.map((file) => ({\n file,\n state: 'uploading' as 'uploading',\n type: 'image' as 'image',\n })),\n ...dataFiles.map((file) => ({\n file,\n state: 'uploading' as 'uploading',\n type: 'file' as 'file',\n })),\n ];\n this.attachmentUploadsSubject.next([\n ...this.attachmentUploadsSubject.getValue(),\n ...newUploads,\n ]);\n await this.uploadAttachments(newUploads);\n }\n\n /**\n * Retries to upload an attachment.\n * @param file\n * @returns A promise with the result\n */\n async retryAttachmentUpload(file: File) {\n const attachmentUploads = this.attachmentUploadsSubject.getValue();\n const upload = attachmentUploads.find((u) => u.file === file);\n if (!upload) {\n return;\n }\n upload.state = 'uploading';\n this.attachmentUploadsSubject.next([...attachmentUploads]);\n await this.uploadAttachments([upload]);\n }\n\n /**\n * Deletes an attachment, the attachment can have any state (`error`, `uploading` or `success`).\n * @param upload\n */\n async deleteAttachment(upload: AttachmentUpload) {\n const attachmentUploads = this.attachmentUploadsSubject.getValue();\n if (upload.state === 'success') {\n try {\n await this.channelService.deleteAttachment(upload);\n attachmentUploads.splice(attachmentUploads.indexOf(upload), 1);\n } catch (error) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.Error deleting attachment'\n );\n }\n } else {\n attachmentUploads.splice(attachmentUploads.indexOf(upload), 1);\n }\n this.attachmentUploadsSubject.next([...attachmentUploads]);\n }\n\n /**\n * Maps the current uploads to a format that can be sent along with the message to the Stream API.\n * @returns the attachments\n */\n mapToAttachments() {\n const attachmentUploads = this.attachmentUploadsSubject.getValue();\n return attachmentUploads\n .filter((r) => r.state === 'success')\n .map((r) => {\n const attachment: Attachment = {\n type: r.type,\n };\n if (r.type === 'image') {\n attachment.fallback = r.file?.name;\n attachment.image_url = r.url;\n } else {\n attachment.asset_url = r.url;\n attachment.title = r.file?.name;\n attachment.file_size = r.file?.size;\n }\n\n return attachment;\n });\n }\n\n /**\n * Maps attachments received from the Stream API to uploads. This is useful when editing a message.\n * @param attachments Attachemnts received with the message\n */\n createFromAttachments(attachments: Attachment[]) {\n const attachmentUploads: AttachmentUpload[] = [];\n attachments.forEach((attachment) => {\n if (isImageAttachment(attachment)) {\n attachmentUploads.push({\n url: (attachment.img_url ||\n attachment.thumb_url ||\n attachment.image_url) as string,\n state: 'success',\n type: 'image',\n file: {\n name: attachment.fallback,\n } as File,\n });\n } else if (attachment.type === 'file') {\n attachmentUploads.push({\n url: attachment.asset_url,\n state: 'success',\n file: {\n name: attachment.title,\n size: attachment.file_size,\n } as File,\n type: 'file',\n });\n }\n });\n\n if (attachmentUploads.length > 0) {\n this.attachmentUploadsSubject.next([\n ...this.attachmentUploadsSubject.getValue(),\n ...attachmentUploads,\n ]);\n }\n }\n\n private createPreview(file: File) {\n const reader = new FileReader();\n reader.onload = (event) => {\n const attachmentUploads = this.attachmentUploadsSubject.getValue();\n const upload = attachmentUploads.find((upload) => upload.file === file);\n if (!upload) {\n return;\n }\n upload.previewUri = event.target?.result || undefined;\n this.attachmentUploadsSubject.next([...attachmentUploads]);\n };\n reader.readAsDataURL(file as Blob);\n }\n\n private async uploadAttachments(uploads: AttachmentUpload[]) {\n const attachmentUploads = this.attachmentUploadsSubject.getValue();\n this.attachmentUploadInProgressCounterSubject.next(\n this.attachmentUploadInProgressCounterSubject.getValue() + 1\n );\n const result = await this.channelService.uploadAttachments(uploads);\n result.forEach((r) => {\n const upload = attachmentUploads.find((upload) => upload.file === r.file);\n if (!upload) {\n if (r.url) {\n void this.channelService.deleteAttachment(r);\n }\n return;\n }\n upload.state = r.state;\n upload.url = r.url;\n if (upload.state === 'error') {\n this.notificationService.addTemporaryNotification(\n upload.type === 'image'\n ? 'streamChat.Error uploading image'\n : 'streamChat.Error uploading file'\n );\n }\n });\n this.attachmentUploadInProgressCounterSubject.next(\n this.attachmentUploadInProgressCounterSubject.getValue() - 1\n );\n this.attachmentUploadsSubject.next([...attachmentUploads]);\n }\n}\n","export const en = {\n streamChat: {\n '1 reply': '1 reply',\n 'Attach files': 'Attach files',\n Cancel: 'Cancel',\n 'Channel Missing': 'Channel Missing',\n Close: 'Close',\n 'Close emoji picker': 'Close emoji picker',\n 'Commands matching': 'Commands matching',\n 'Connection failure, reconnecting now...':\n 'Connection failure, reconnecting now...',\n Delete: 'Delete',\n Delivered: 'Delivered',\n 'Edit Message': 'Edit Message',\n 'Edit message request failed': 'Edit message request failed',\n 'Emoji matching': 'Emoji matching',\n 'Empty message...': 'Empty message...',\n 'Error adding flag': 'Error adding flag',\n 'Error connecting to chat, refresh the page to try again.':\n 'Error connecting to chat, refresh the page to try again.',\n 'Error deleting message': 'Error deleting message',\n 'Error muting a user ...': 'Error muting a user ...',\n 'Error pinning message': 'Error pinning message',\n 'Error removing message pin': 'Error removing message pin',\n 'Error unmuting a user ...': 'Error unmuting a user ...',\n 'Error uploading file': 'Error uploading file',\n 'Error uploading image': 'Error uploading image',\n 'Error deleting attachment': 'Error deleting attachment',\n 'Error · Unsent': 'Error · Unsent',\n 'Error: {{ errorMessage }}': 'Error: {{ errorMessage }}',\n Flag: 'Flag',\n 'Message Failed': 'Message Failed',\n 'Message Failed · Unauthorized': 'Message Failed · Unauthorized',\n 'Message Failed · Click to try again':\n 'Message Failed · Click to try again',\n 'Message deleted': 'Message deleted',\n 'Message has been successfully flagged':\n 'Message has been successfully flagged',\n 'Message pinned': 'Message pinned',\n Mute: 'Mute',\n New: 'New',\n 'New Messages!': 'New Messages!',\n 'No results found': 'No results found',\n 'Nothing yet...': 'Nothing yet...',\n 'Only visible to you': 'Only visible to you',\n 'Open emoji picker': 'Open emoji picker',\n 'People matching': 'People matching',\n 'Pick your emoji': 'Pick your emoji',\n Pin: 'Pin',\n 'Pinned by': 'Pinned by',\n Reply: 'Reply',\n 'Reply to Message': 'Reply to Message',\n Search: 'Search',\n 'Searching...': 'Searching...',\n Send: 'Send',\n 'Send message request failed': 'Send message request failed',\n 'Sending...': 'Sending...',\n 'Slow Mode ON': 'Slow Mode ON',\n 'Start of a new thread': 'Start of a new thread',\n 'This message was deleted...': 'This message was deleted...',\n Thread: 'Thread',\n 'Type your message': 'Type your message',\n Unmute: 'Unmute',\n Unpin: 'Unpin',\n 'Wait until all attachments have uploaded':\n 'Wait until all attachments have uploaded',\n 'You have no channels currently': 'You have no channels currently',\n \"You've reached the maximum number of files\":\n \"You've reached the maximum number of files\",\n live: 'live',\n 'this content could not be displayed':\n 'this content could not be displayed',\n '{{ commaSeparatedUsers }} and {{ moreCount }} more':\n '{{ commaSeparatedUsers }} and {{ moreCount }} more',\n '{{ commaSeparatedUsers }}, and {{ lastUser }}':\n '{{ commaSeparatedUsers }}, and {{ lastUser }}',\n '{{ firstUser }} and {{ secondUser }}':\n '{{ firstUser }} and {{ secondUser }}',\n '{{ imageCount }} more': '{{ imageCount }} more',\n '{{ memberCount }} members': '{{ memberCount }} members',\n '{{ replyCount }} replies': '{{ replyCount }} replies',\n '{{ user }} has been muted': '{{ user }} has been muted',\n '{{ user }} has been unmuted': '{{ user }} has been unmuted',\n '{{ watcherCount }} online': '{{ watcherCount }} online',\n '🏙 Attachment...': '🏙 Attachment...',\n 'Connection error': 'Connection error',\n 'Load more': 'Load more',\n failed: 'failed',\n retry: 'retry',\n test: 'success',\n 'Sending links is not allowed in this conversation':\n 'Sending links is not allowed in this conversation',\n \"You can't send messages in this channel\":\n \"You can't send messages in this channel\",\n \"You can't send thread replies in this channel\":\n \"You can't send thread replies in this channel\",\n 'Unsupported file type: {{type}}': 'Unsupported file type: {{type}}',\n },\n};\n","import { Injectable } from '@angular/core';\nimport { TranslateService } from '@ngx-translate/core';\nimport { en } from '../assets/i18n/en';\n\n/**\n * The `StreamI18nService` can be used to customize the labels of the chat UI. Our [translation guide](../concepts/translation.mdx) covers this topic in detail.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class StreamI18nService {\n constructor(private translteService: TranslateService) {}\n\n /**\n * Registers the translation to the [ngx-translate](https://github.com/ngx-translate/core) TranslateService.\n * @param lang The language key to register the translation to\n * @param overrides An object which keys are translation keys, and the values are custom translations\n */\n setTranslation(lang = 'en', overrides?: { [key: string]: string }) {\n if (!this.translteService.defaultLang) {\n this.translteService.defaultLang = lang;\n }\n this.translteService.setTranslation(\n lang,\n { streamChat: { ...en.streamChat, ...overrides } },\n true\n );\n }\n}\n","import { Component, Input } from '@angular/core';\n\n/**\n * The `Avatar` component displays the provided image, with fallback to the first letter of the optional name input.\n */\n@Component({\n selector: 'stream-avatar',\n templateUrl: './avatar.component.html',\n styleUrls: ['./avatar.component.scss'],\n})\nexport class AvatarComponent {\n /**\n * An optional name of the image, used for fallback image or image title (if `imageUrl` is provided)\n */\n @Input() name: string | undefined;\n /**\n * The URL of the image to be displayed. If the image can't be displayed the first letter of the name input is displayed.\n */\n @Input() imageUrl: string | undefined;\n /**\n * The size in pixels of the avatar image.\n */\n @Input() size = 32;\n isLoaded = false;\n isError = false;\n\n constructor() {}\n\n get initials() {\n return (this.name?.toString() || '').charAt(0);\n }\n}\n","<div\n class=\"str-chat__avatar str-chat__avatar--circle\"\n title=\"{{ name }}\"\n [style]=\"{\n flexBasis: size + 'px',\n fontSize: size / 2 + 'px',\n height: size + 'px',\n lineHeight: size + 'px',\n width: size + 'px'\n }\"\n>\n <img\n *ngIf=\"imageUrl && !isError; else fallback\"\n class=\"str-chat__avatar-image str-chat__avatar-image{{\n isLoaded ? ' str-chat__avatar-image--loaded' : ''\n }}\"\n src=\"{{ imageUrl }}\"\n alt=\"{{ initials }}\"\n data-testid=\"avatar-img\"\n (load)=\"isLoaded = true\"\n (error)=\"isError = true\"\n [style]=\"{\n flexBasis: size + 'px',\n height: size + 'px',\n objectFit: 'cover',\n width: size + 'px'\n }\"\n />\n <ng-template #fallback>\n <div data-testid=\"fallback-img\" class=\"str-chat__avatar-fallback\">\n {{ initials }}\n </div>\n </ng-template>\n</div>\n","import { Component, Input } from '@angular/core';\n\nexport type Icon =\n | 'action-icon'\n | 'delivered-icon'\n | 'reaction-icon'\n | 'connection-error'\n | 'send'\n | 'file-upload'\n | 'retry'\n | 'close'\n | 'file'\n | 'reply'\n | 'close-no-outline'\n | 'reply-in-thread'\n | 'arrow-left'\n | 'arrow-right'\n | 'menu';\n\n/**\n * The `Icon` component can be used to display different icons (i. e. message delivered icon).\n */\n@Component({\n selector: 'stream-icon',\n templateUrl: './icon.component.html',\n styles: [],\n})\nexport class IconComponent {\n /**\n * The icon to display, the list of [supported icons](https://github.com/GetStream/stream-chat-angular/tree/master/projects/stream-chat-angular/src/lib/icon/icon.component.ts) can be found on GitHub.\n */\n @Input() icon: Icon | undefined;\n /**\n * The size of the icon (in pixels)\n */\n @Input() size: number | undefined;\n constructor() {}\n}\n","<svg\n data-testid=\"action-icon\"\n *ngIf=\"icon === 'action-icon'\"\n height=\"4\"\n viewBox=\"0 0 11 4\"\n width=\"11\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M1.5 3a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm4 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm4 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z\"\n fillRule=\"nonzero\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'delivered-icon'\"\n height=\"16\"\n width=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"delivered-icon\"\n>\n <path\n d=\"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0zm3.72 6.633a.955.955 0 1 0-1.352-1.352L6.986 8.663 5.633 7.31A.956.956 0 1 0 4.28 8.663l2.029 2.028a.956.956 0 0 0 1.353 0l4.058-4.058z\"\n fill=\"#006CFF\"\n fillRule=\"evenodd\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'reaction-icon'\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n width=\"12\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"reaction-icon\"\n>\n <g clipRule=\"evenodd\" fillRule=\"evenodd\">\n <path\n d=\"M6 1.2C3.3 1.2 1.2 3.3 1.2 6c0 2.7 2.1 4.8 4.8 4.8 2.7 0 4.8-2.1 4.8-4.8 0-2.7-2.1-4.8-4.8-4.8zM0 6c0-3.3 2.7-6 6-6s6 2.7 6 6-2.7 6-6 6-6-2.7-6-6z\"\n ></path>\n <path\n d=\"M5.4 4.5c0 .5-.4.9-.9.9s-.9-.4-.9-.9.4-.9.9-.9.9.4.9.9zM8.4 4.5c0 .5-.4.9-.9.9s-.9-.4-.9-.9.4-.9.9-.9.9.4.9.9zM3.3 6.7c.3-.2.6-.1.8.1.3.4.8.9 1.5 1 .6.2 1.4.1 2.4-1 .2-.2.6-.3.8 0 .2.2.3.6 0 .8-1.1 1.3-2.4 1.7-3.5 1.5-1-.2-1.8-.9-2.2-1.5-.2-.3-.1-.7.2-.9z\"\n ></path>\n </g>\n</svg>\n<svg\n data-testid=\"connection-error\"\n *ngIf=\"icon === 'connection-error'\"\n width=\"78px\"\n height=\"78px\"\n viewBox=\"0 0 78 78\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n>\n <!-- Generator: Sketch 52.6 (67491) - http://www.bohemiancoding.com/sketch -->\n <title>Combined Shape</title>\n <desc>Created with Sketch.</desc>\n <g\n id=\"Interactions\"\n stroke=\"none\"\n stroke-width=\"1\"\n fill=\"none\"\n fill-rule=\"evenodd\"\n >\n <g\n id=\"Connection-Error-_-Connectivity\"\n transform=\"translate(-270.000000, -30.000000)\"\n fill=\"#CF1F25\"\n >\n <g\n id=\"109-network-connection\"\n transform=\"translate(270.000000, 30.000000)\"\n >\n <path\n d=\"M66.4609744,11.414231 C81.6225232,26.5757798 81.6225232,51.157545 66.4609744,66.3188467 C51.2994256,81.4803954 26.7176604,81.4803954 11.5563587,66.3188467 C-3.60519004,51.1572979 -3.60519004,26.5755327 11.5563587,11.414231 C26.7179075,-3.74731776 51.2996727,-3.74731776 66.4609744,11.414231 Z M54.7853215,45.8823776 L54.7853215,40.5882574 C54.7853215,39.613638 53.9952341,38.8235506 53.0206147,38.8235506 L44.9576695,38.8235506 L41.428256,42.3529641 L51.255555,42.3529641 L51.255555,45.8823776 L54.7853215,45.8823776 Z M40.6659027,43.1153174 L37.8988425,45.8823776 L40.6659027,45.8823776 L40.6659027,43.1153174 Z M51.1764962,56.4702653 L58.2353232,56.4702653 C59.2099355,56.4702653 60.00003,55.6801708 60.00003,54.7055585 L60.00003,51.176145 C60.00003,50.2015327 59.2099355,49.4114382 58.2353232,49.4114382 L51.1764962,49.4114382 C50.2018839,49.4114382 49.4117894,50.2015327 49.4117894,51.176145 L49.4117894,54.7055585 C49.4117894,55.6801708 50.2018839,56.4702653 51.1764962,56.4702653 Z M35.2941353,56.4702653 L42.3529624,56.4702653 C43.3275746,56.4702653 44.1176691,55.6801708 44.1176691,54.7055585 L44.1176691,51.176145 C44.1176691,50.2015327 43.3275746,49.4114382 42.3529624,49.4114382 L35.2941353,49.4114382 C34.319523,49.4114382 33.5294285,50.2015327 33.5294285,51.176145 L33.5294285,54.7055585 C33.5294285,55.6801708 34.319523,56.4702653 35.2941353,56.4702653 Z M56.6964989,19.0874231 C56.007381,18.3985134 54.8903216,18.3985134 54.2012036,19.087423 L45.882376,27.4062507 L45.882376,19.4117761 C45.882376,18.4371568 45.0922885,17.6470693 44.1176692,17.6470693 L33.5294286,17.6470693 C32.5548092,17.6470694 31.7647218,18.4371568 31.7647218,19.4117761 L31.7647218,30.0000167 C31.7647219,30.9746363 32.5548092,31.7647237 33.5294285,31.7647237 L41.5239031,31.7647237 L34.4650761,38.8235508 L24.7058947,38.8235508 C23.7312753,38.8235508 22.9411879,39.6136382 22.9411879,40.5882575 L22.9411879,45.8823778 L26.4706014,45.8823778 L26.4706014,42.3529643 L30.9356624,42.3529643 L23.8768354,49.4117914 L19.4117743,49.4117914 C18.4371549,49.4117914 17.6470675,50.2018788 17.6470675,51.1764981 L17.6470675,54.7059117 C17.6504049,54.9674302 17.7129076,55.2248042 17.8298886,55.4587302 L16.4456526,56.8429662 C15.7446193,57.5200453 15.7252005,58.6372282 16.4022825,59.3382615 C17.0793616,60.0392948 18.1965445,60.0587136 18.8975778,59.3816316 C18.9122847,59.3674273 18.9267436,59.3529684 18.940948,59.3382615 L56.6964963,21.5830662 C57.3856425,20.8939094 57.3856425,19.7765747 56.6964963,19.0874179 Z\"\n id=\"Combined-Shape\"\n ></path>\n </g>\n </g>\n </g>\n</svg>\n<svg\n *ngIf=\"icon === 'send'\"\n data-testid=\"send\"\n height=\"17\"\n viewBox=\"0 0 18 17\"\n width=\"18\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <title translate>streamChat.Send</title>\n <path\n d=\"M0 17.015l17.333-8.508L0 0v6.617l12.417 1.89L0 10.397z\"\n fill=\"#006cff\"\n fillRule=\"evenodd\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'file-upload'\"\n data-testid=\"file-upload\"\n height=\"14\"\n width=\"14\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <title translate>streamChat.Attach files</title>\n <path\n d=\"M1.667.333h10.666c.737 0 1.334.597 1.334 1.334v10.666c0 .737-.597 1.334-1.334 1.334H1.667a1.333 1.333 0 0 1-1.334-1.334V1.667C.333.93.93.333 1.667.333zm2 1.334a1.667 1.667 0 1 0 0 3.333 1.667 1.667 0 0 0 0-3.333zm-2 9.333v1.333h10.666v-4l-2-2-4 4-2-2L1.667 11z\"\n fillRule=\"nonzero\"\n />\n</svg>\n<svg\n data-testid=\"retry\"\n *ngIf=\"icon === 'retry'\"\n width=\"22\"\n height=\"20\"\n viewBox=\"0 0 22 20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M20 5.535V2a1 1 0 0 1 2 0v6a1 1 0 0 1-1 1h-6a1 1 0 0 1 0-2h3.638l-2.975-2.653a8 8 0 1 0 1.884 8.32 1 1 0 1 1 1.886.666A10 10 0 1 1 5.175 1.245c3.901-2.15 8.754-1.462 11.88 1.667L20 5.535z\"\n fill=\"#FFF\"\n fill-rule=\"nonzero\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'close'\"\n data-testid=\"close\"\n width=\"28\"\n height=\"28\"\n viewBox=\"0 0 28 28\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n>\n <defs>\n <path\n d=\"M465 5c5.53 0 10 4.47 10 10s-4.47 10-10 10-10-4.47-10-10 4.47-10 10-10zm3.59 5L465 13.59 461.41 10 460 11.41l3.59 3.59-3.59 3.59 1.41 1.41 3.59-3.59 3.59 3.59 1.41-1.41-3.59-3.59 3.59-3.59-1.41-1.41z\"\n id=\"b\"\n />\n <filter\n x=\"-30%\"\n y=\"-30%\"\n width=\"160%\"\n height=\"160%\"\n filterUnits=\"objectBoundingBox\"\n id=\"a\"\n >\n <feOffset in=\"SourceAlpha\" result=\"shadowOffsetOuter1\" />\n <feGaussianBlur\n stdDeviation=\"2\"\n in=\"shadowOffsetOuter1\"\n result=\"shadowBlurOuter1\"\n />\n <feColorMatrix\n values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0\"\n in=\"shadowBlurOuter1\"\n />\n </filter>\n </defs>\n <g transform=\"translate(-451 -1)\" fill-rule=\"nonzero\" fill=\"none\">\n <use fill=\"#000\" filter=\"url(#a)\" xlink:href=\"#b\" />\n <use fill=\"#FFF\" fill-rule=\"evenodd\" xlink:href=\"#b\" />\n </g>\n</svg>\n<svg\n *ngIf=\"icon === 'file'\"\n data-testid=\"file\"\n className=\"rfu-file-icon--small fa-file-fallback\"\n [attr.height]=\"size || 20\"\n [attr.width]=\"size || 20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 384 512\"\n>\n <path\n d=\"M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48z\"\n fill=\"#414D54\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'reply'\"\n data-testid=\"reply\"\n height=\"15\"\n width=\"18\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M.56 10.946H.06l-.002-.498L.025.92a.5.5 0 1 1 1-.004l.032 9.029H9.06v-4l9 4.5-9 4.5v-4H.56z\"\n fillRule=\"nonzero\"\n />\n</svg>\n<svg\n height=\"10\"\n width=\"10\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"close-no-outline\"\n *ngIf=\"icon === 'close-no-outline'\"\n>\n <path\n d=\"M9.916 1.027L8.973.084 5 4.058 1.027.084l-.943.943L4.058 5 .084 8.973l.943.943L5 5.942l3.973 3.974.943-.943L5.942 5z\"\n fillRule=\"evenodd\"\n />\n</svg>\n<svg\n height=\"10\"\n width=\"14\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"reply-in-thread\"\n *ngIf=\"icon === 'reply-in-thread'\"\n>\n <path\n d=\"M8.516 3c4.78 0 4.972 6.5 4.972 6.5-1.6-2.906-2.847-3.184-4.972-3.184v2.872L3.772 4.994 8.516.5V3zM.484 5l4.5-4.237v1.78L2.416 5l2.568 2.125v1.828L.484 5z\"\n fillRule=\"evenodd\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'arrow-left'\"\n data-testid=\"arrow-left\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M15.7049 7.41L14.2949 6L8.29492 12L14.2949 18L15.7049 16.59L11.1249 12L15.7049 7.41Z\"\n fill=\"var(--black)\"\n />\n</svg>\n\n<svg\n *ngIf=\"icon === 'arrow-right'\"\n data-testid=\"arrow-right\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M9.70492 6L8.29492 7.41L12.8749 12L8.29492 16.59L9.70492 18L15.7049 12L9.70492 6Z\"\n fill=\"var(--black)\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'menu'\"\n data-testid=\"menu\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M3 8V6H21V8H3ZM3 13H21V11H3V13ZM3 18H21V16H3V18Z\"\n fill=\"black\"\n />\n</svg>\n","import { Component, Input } from '@angular/core';\n\n/**\n * The `LoadingIndicator` component displays a spinner to indicate that an action is in progress.\n */\n@Component({\n selector: 'stream-loading-indicator',\n templateUrl: './loading-indicator.component.html',\n styles: [],\n})\nexport class LoadingIndicatorComponent {\n /**\n * The size of the indicator (in pixels)\n */\n @Input() size = 15;\n /**\n * The color of the indicator\n */\n @Input() color = '#006CFF';\n\n constructor() {}\n}\n","<div class=\"str-chat__loading-indicator\">\n <svg\n [attr.height]=\"size\"\n viewBox=\"0 0 30 30\"\n [attr.width]=\"size\"\n data-testid=\"loading-indicator\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <defs>\n <linearGradient id=\"a\" x1=\"50%\" x2=\"50%\" y1=\"0%\" y2=\"100%\">\n <stop offset=\"0%\" stop-color=\"#FFF\" stop-opacity=\"0\" />\n <stop\n data-testid=\"stop-color\"\n offset=\"100%\"\n [attr.stop-color]=\"color\"\n stop-opacity=\"1\"\n [ngStyle]=\"{ stopColor: color }\"\n />\n </linearGradient>\n </defs>\n <path\n d=\"M2.518 23.321l1.664-1.11A12.988 12.988 0 0 0 15 28c7.18 0 13-5.82 13-13S22.18 2 15 2V0c8.284 0 15 6.716 15 15 0 8.284-6.716 15-15 15-5.206 0-9.792-2.652-12.482-6.679z\"\n fill=\"url(#a)\"\n fillRule=\"evenodd\"\n />\n </svg>\n</div>\n","import { InjectionToken, Type } from '@angular/core';\nimport { TextareaInterface } from './message-input/textarea.interface';\n\nexport const textareaInjectionToken = new InjectionToken<\n Type<TextareaInterface>\n>('textareaInjectionToken');\n","import {\n ComponentRef,\n EventEmitter,\n Input,\n OnChanges,\n Output,\n SimpleChanges,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport { Directive } from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { UserResponse } from 'stream-chat';\nimport {\n CommandAutocompleteListItemContext,\n MentionAutcompleteListItemContext,\n} from '../types';\nimport { TextareaInterface } from './textarea.interface';\n\n@Directive({\n selector: '[streamTextarea]',\n})\nexport class TextareaDirective implements OnChanges {\n @Input() componentRef: ComponentRef<TextareaInterface> | undefined;\n @Input() areMentionsEnabled: boolean | undefined;\n @Input() mentionAutocompleteItemTemplate:\n | TemplateRef<MentionAutcompleteListItemContext>\n | undefined;\n @Input() mentionScope?: 'channel' | 'application';\n @Input() commandAutocompleteItemTemplate:\n | TemplateRef<CommandAutocompleteListItemContext>\n | undefined;\n @Input() value = '';\n @Output() readonly valueChange = new EventEmitter<string>();\n @Output() readonly send = new EventEmitter<void>();\n @Output() readonly userMentions = new EventEmitter<UserResponse[]>();\n private subscriptions: Subscription[] = [];\n private unpropagatedChanges: SimpleChanges[] = [];\n constructor(public viewContainerRef: ViewContainerRef) {}\n\n ngOnChanges(changes: SimpleChanges): void {\n this.unpropagatedChanges.push(changes);\n if (!this.componentRef) {\n return;\n }\n if (changes.componentRef) {\n this.subscriptions.forEach((s) => s.unsubscribe());\n if (this.componentRef) {\n this.subscriptions.push(\n this.componentRef.instance.valueChange.subscribe((value) =>\n this.valueChange.next(value)\n )\n );\n this.subscriptions.push(\n this.componentRef.instance.send.subscribe((value) =>\n this.send.next(value)\n )\n );\n if (this.componentRef.instance.userMentions) {\n this.subscriptions.push(\n this.componentRef.instance.userMentions.subscribe((value) =>\n this.userMentions.next(value)\n )\n );\n }\n this.componentRef.instance.areMentionsEnabled = this.areMentionsEnabled;\n this.componentRef.instance.mentionAutocompleteItemTemplate =\n this.mentionAutocompleteItemTemplate;\n this.componentRef.instance.commandAutocompleteItemTemplate =\n this.commandAutocompleteItemTemplate;\n this.componentRef.instance.mentionScope = this.mentionScope;\n this.componentRef.instance.value = this.value;\n }\n }\n if (changes.areMentionsEnabled) {\n this.componentRef.instance.areMentionsEnabled = this.areMentionsEnabled;\n }\n if (changes.mentionAutocompleteItemTemplate) {\n this.componentRef.instance.mentionAutocompleteItemTemplate =\n this.mentionAutocompleteItemTemplate;\n }\n if (changes.commandAutocompleteItemTemplate) {\n this.componentRef.instance.commandAutocompleteItemTemplate =\n this.commandAutocompleteItemTemplate;\n }\n if (changes.mentionScope) {\n this.componentRef.instance.mentionScope = this.mentionScope;\n }\n if (changes.value) {\n this.componentRef.instance.value = this.value;\n }\n // ngOnChanges not called for dynamic components since we don't use template binding\n let changesToPropagate = {};\n this.unpropagatedChanges.forEach(\n (c) => (changesToPropagate = { ...changesToPropagate, ...c })\n );\n // eslint-disable-next-line @angular-eslint/no-lifecycle-call\n this.componentRef.instance.ngOnChanges(changesToPropagate);\n this.unpropagatedChanges = [];\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n/**\n * If you have an emoji picker in your application, you can propagate the selected emoji to the textarea using this service, more info can be found in [custom emoji picker guide](../code-examples/emoji-picker.mdx)\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class EmojiInputService {\n /**\n * If you have an emoji picker in your application, you can propagate the selected emoji to the textarea using this Subject, more info can be found in [custom emoji picker guide](../code-examples/emoji-picker.mdx)\n */\n emojiInput$ = new Subject<string>();\n\n constructor() {}\n}\n","import { Injectable, TemplateRef } from '@angular/core';\nimport {\n CommandAutocompleteListItemContext,\n MentionAutcompleteListItemContext,\n} from '../types';\n\n/**\n * The `MessageInputConfigService` is used to keep a consistent configuration among the different [`MessageInput`](../components/MessageInputComponent.mdx) components if your UI has more than one input component.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class MessageInputConfigService {\n /**\n * If file upload is enabled, the user can open a file selector from the input. Please note that the user also needs to have the necessary [channel capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript).\n */\n isFileUploadEnabled: boolean | undefined = true;\n /**\n * If true, users can mention other users in messages. You also [need to use the `AutocompleteTextarea`](../concepts/opt-in-architecture.mdx) for this feature to work.\n */\n areMentionsEnabled: boolean | undefined = true;\n /**\n * You can provide your own template for the autocomplete list for user mentions. You also [need to use the `AutocompleteTextarea`](../concepts/opt-in-architecture.mdx) for this feature to work.\n */\n mentionAutocompleteItemTemplate:\n | TemplateRef<MentionAutcompleteListItemContext>\n | undefined;\n /**\n * You can provide your own template for the autocomplete list for commands. You also [need to use the `AutocompleteTextarea`](../concepts/opt-in-architecture.mdx) for this feature to work.\n */\n commandAutocompleteItemTemplate:\n | TemplateRef<CommandAutocompleteListItemContext>\n | undefined;\n /**\n * You can add an emoji picker by [providing your own emoji picker template](../code-examples/emoji-picker.mdx)\n */\n emojiPickerTemplate: TemplateRef<void> | undefined;\n /**\n * You can narrow the accepted file types by providing the [accepted types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept). By default every file type is accepted.\n * @deprecated use [application settings](https://getstream.io/chat/docs/javascript/app_setting_overview/?language=javascript#file-uploads) instead\n */\n acceptedFileTypes: string[] | undefined;\n /**\n * If `false`, users can only upload one attachment per message\n */\n isMultipleFileUploadEnabled: boolean | undefined = true;\n /**\n * The scope for user mentions, either members of the current channel of members of the application\n */\n mentionScope: 'channel' | 'application' | undefined = 'channel';\n\n constructor() {}\n}\n","import { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n/**\n * The `ImageLoadService` is used to position the scrollbar in the message list\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class ImageLoadService {\n /**\n * A subject that can be used to notify the message list if an image attachment finished loading\n */\n imageLoad$ = new Subject<void>();\n\n constructor() {}\n}\n","import {\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n Output,\n SimpleChanges,\n ViewChild,\n} from '@angular/core';\n\n/**\n * The `Modal` component displays its content in an overlay. The modal can be closed with a close button, if the user clicks outside of the modal content, or if the escape button is pressed. The modal can also be closed from outside.\n */\n@Component({\n selector: 'stream-modal',\n templateUrl: './modal.component.html',\n styles: [],\n})\nexport class ModalComponent implements OnChanges {\n /**\n * If `true` the modal will be displayed, if `false` the modal will be hidden\n */\n @Input() isOpen = false;\n /**\n * Emits `true` if the modal becomes visible, and `false` if the modal is closed.\n */\n @Output() readonly isOpenChange = new EventEmitter<boolean>();\n @ViewChild('content') private content: ElementRef<HTMLElement> | undefined;\n\n constructor() {}\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.isOpen) {\n if (this.isOpen) {\n window.addEventListener('keyup', this.watchForEscPress);\n setTimeout(\n () => window.addEventListener('click', this.watchForOutsideClicks),\n 0\n );\n } else {\n this.stopWatchForOutsideClicks();\n this.stopWatchForEscPress();\n }\n }\n }\n\n close() {\n this.isOpen = false;\n this.isOpenChange.emit(false);\n this.stopWatchForOutsideClicks();\n this.stopWatchForEscPress();\n }\n\n private watchForEscPress = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n this.close();\n }\n };\n\n private stopWatchForEscPress = () => {\n window.removeEventListener('keyup', this.watchForEscPress);\n };\n\n private watchForOutsideClicks = (event: Event) => {\n if (!this.content?.nativeElement.contains(event.target as Node)) {\n this.close();\n }\n };\n\n private stopWatchForOutsideClicks() {\n window.removeEventListener('click', this.watchForOutsideClicks);\n }\n}\n","<div\n data-testid=\"modal\"\n class=\"str-chat__modal str-chat__modal--{{ isOpen ? 'open' : 'close' }}\"\n>\n <div\n data-testid=\"close\"\n class=\"str-chat__modal__close-button\"\n (click)=\"close()\"\n (keyup.enter)=\"close()\"\n translate\n >\n streamChat.Close\n <stream-icon icon=\"close\"></stream-icon>\n </div>\n <div class=\"str-chat__modal__inner\" #content>\n <ng-content></ng-content>\n </div>\n</div>\n","import { Component, Input, OnChanges } from '@angular/core';\nimport { Action, Attachment } from 'stream-chat';\nimport { ImageLoadService } from '../message-list/image-load.service';\nimport { DefaultAttachmentType } from '../types';\nimport prettybytes from 'pretty-bytes';\nimport { isImageAttachment } from '../is-image-attachment';\nimport { ChannelService } from '../channel.service';\n\n/**\n * The `AttachmentList` compontent displays the attachments of a message\n */\n@Component({\n selector: 'stream-attachment-list',\n templateUrl: './attachment-list.component.html',\n styles: [],\n})\nexport class AttachmentListComponent implements OnChanges {\n /**\n * The id of the message the attachments belong to\n */\n @Input() messageId: string | undefined;\n /**\n * The attachments to display\n */\n @Input() attachments: Attachment<DefaultAttachmentType>[] = [];\n orderedAttachments: Attachment<DefaultAttachmentType>[] = [];\n imagesToView: Attachment<DefaultAttachmentType>[] = [];\n imagesToViewCurrentIndex = 0;\n\n constructor(\n private imageLoadService: ImageLoadService,\n private channelService: ChannelService\n ) {}\n\n ngOnChanges(): void {\n const images = this.attachments.filter(this.isImage);\n const containsGallery = images.length >= 2;\n this.orderedAttachments = [\n ...(containsGallery ? this.createGallery(images) : images),\n ...this.attachments.filter((a) => this.isFile(a)),\n ...this.attachments.filter((a) => this.isCard(a)),\n ];\n }\n\n trackById(index: number) {\n return index;\n }\n\n isImage(attachment: Attachment) {\n return isImageAttachment(attachment);\n }\n\n isFile(attachment: Attachment) {\n return attachment.type === 'file';\n }\n\n isGallery(attachment: Attachment) {\n return attachment.type === 'gallery';\n }\n\n isCard(attachment: Attachment) {\n return (\n !attachment.type ||\n (attachment.type === 'image' && !this.isImage(attachment)) ||\n attachment.type === 'giphy'\n );\n }\n\n imageLoaded() {\n this.imageLoadService.imageLoad$.next();\n }\n\n hasFileSize(attachment: Attachment<DefaultAttachmentType>) {\n return (\n attachment.file_size && Number.isFinite(Number(attachment.file_size))\n );\n }\n\n getFileSize(attachment: Attachment<DefaultAttachmentType>) {\n return prettybytes(Number(attachment.file_size!));\n }\n\n trimUrl(url?: string | null) {\n if (url !== undefined && url !== null) {\n const [trimmedUrl] = url\n .replace(/^(?:https?:\\/\\/)?(?:www\\.)?/i, '')\n .split('/');\n\n return trimmedUrl;\n }\n return null;\n }\n\n sendAction(action: Action) {\n void this.channelService.sendAction(this.messageId!, {\n [action.name!]: action.value!,\n });\n }\n\n trackByActionValue(_: number, item: Action) {\n return item.value;\n }\n\n openImageModal(attachments: Attachment[], selectedIndex = 0) {\n this.imagesToView = attachments;\n this.imagesToViewCurrentIndex = selectedIndex;\n }\n\n closeImageModal() {\n this.imagesToView = [];\n }\n\n stepImages(dir: -1 | 1) {\n this.imagesToViewCurrentIndex += dir * 1;\n }\n\n trackByImageUrl(_: number, item: Attachment) {\n return item.image_url || item.img_url || item.thumb_url;\n }\n\n get isImageModalPrevButtonVisible() {\n return this.imagesToViewCurrentIndex !== 0;\n }\n\n get isImageModalNextButtonVisible() {\n return this.imagesToViewCurrentIndex !== this.imagesToView.length - 1;\n }\n\n private createGallery(images: Attachment[]) {\n return [\n {\n type: 'gallery',\n images,\n },\n ];\n }\n}\n","<ng-container *ngFor=\"let attachment of orderedAttachments; trackBy: trackById\">\n <div\n data-testclass=\"attachment-container\"\n class=\"str-chat__message-attachment str-chat__message-attachment--{{\n attachment.type\n }}\"\n [class.str-chat__message-attachment--card]=\"isCard(attachment)\"\n [class.str-chat-angular__message-attachment-file-single]=\"\n isFile(attachment)\n \"\n >\n <img\n *ngIf=\"isImage(attachment)\"\n class=\"str-chat__message-attachment--img\"\n data-testclass=\"image\"\n [src]=\"attachment.img_url || attachment.thumb_url || attachment.image_url\"\n [alt]=\"attachment?.fallback\"\n (load)=\"imageLoaded()\"\n (click)=\"openImageModal([attachment])\"\n (keyup.enter)=\"openImageModal([attachment])\"\n />\n <div\n class=\"str-chat__gallery\"\n data-testid=\"image-gallery\"\n *ngIf=\"isGallery(attachment)\"\n [class.str-chat__gallery--square]=\"(attachment?.images)!.length > 3\"\n >\n <ng-container\n *ngFor=\"\n let galleryImage of attachment.images;\n let index = index;\n let isLast = last;\n trackBy: trackByImageUrl\n \"\n >\n <button\n *ngIf=\"index < 3 || (index === 3 && isLast)\"\n class=\"str-chat__gallery-image\"\n data-testclass=\"gallery-image\"\n (click)=\"openImageModal(attachment.images!, index)\"\n (keyup.enter)=\"openImageModal(attachment.images!, index)\"\n >\n <img\n [src]=\"\n galleryImage.img_url ||\n galleryImage.thumb_url ||\n galleryImage.image_url\n \"\n [alt]=\"galleryImage.fallback\"\n (load)=\"imageLoaded()\"\n />\n </button>\n <button\n *ngIf=\"index === 3 && !isLast\"\n class=\"str-chat__gallery-placeholder\"\n data-testclass=\"gallery-image\"\n (click)=\"openImageModal(attachment.images!, index)\"\n (keyup.enter)=\"openImageModal(attachment.images!, index)\"\n [ngStyle]=\"{\n 'background-image':\n 'url(' +\n (galleryImage.img_url ||\n galleryImage.thumb_url ||\n galleryImage.image_url) +\n ')'\n }\"\n >\n <p\n [innerHTML]=\"\n 'streamChat.{{ imageCount }} more'\n | translate: { imageCount: attachment!.images!.length - 4 }\n \"\n ></p>\n </button>\n </ng-container>\n </div>\n <div\n *ngIf=\"isFile(attachment)\"\n class=\"\n str-chat__message-attachment-file--item\n str-chat-angular__message-attachment-file-single\n \"\n >\n <stream-icon icon=\"file\" [size]=\"30\"></stream-icon>\n <div class=\"str-chat__message-attachment-file--item-text\">\n <a\n data-testclass=\"file-link\"\n download\n href=\"{{ attachment.asset_url }}\"\n target=\"_blank\"\n >\n {{ attachment.title }}\n </a>\n <span data-testclass=\"size\" *ngIf=\"hasFileSize(attachment)\">{{\n getFileSize(attachment)\n }}</span>\n </div>\n </div>\n <div\n *ngIf=\"isCard(attachment)\"\n class=\"str-chat__message-attachment-card str-chat__message-attachment-card--{{\n attachment.type\n }}\"\n >\n <div\n *ngIf=\"attachment.image_url || attachment.thumb_url\"\n class=\"str-chat__message-attachment-card--header\"\n >\n <img\n data-testclass=\"card-img\"\n alt=\"{{ attachment.image_url || attachment.thumb_url }}\"\n src=\"{{ attachment.image_url || attachment.thumb_url }}\"\n />\n </div>\n <div class=\"str-chat__message-attachment-card--content\">\n <div class=\"str-chat__message-attachment-card--flex\">\n <div\n *ngIf=\"attachment.title\"\n data-testclass=\"card-title\"\n class=\"str-chat__message-attachment-card--title\"\n >\n {{ attachment.title }}\n </div>\n <div\n *ngIf=\"attachment.text\"\n class=\"str-chat__message-attachment-card--text\"\n data-testclass=\"card-text\"\n >\n {{ attachment.text }}\n </div>\n <a\n class=\"str-chat__message-attachment-card--url\"\n *ngIf=\"attachment.title_link || attachment.og_scrape_url\"\n data-testclass=\"url-link\"\n noopener\n noreferrer\n href=\"{{ attachment.title_link || attachment.og_scrape_url }}\"\n target=\"_blank\"\n >\n {{ trimUrl(attachment.title_link || attachment.og_scrape_url) }}\n </a>\n </div>\n </div>\n </div>\n <div\n class=\"str-chat__message-attachment-actions\"\n *ngIf=\"attachment.actions && attachment.actions.length > 0\"\n >\n <div class=\"str-chat__message-attachment-actions-form\">\n <button\n *ngFor=\"let action of attachment.actions; trackBy: trackByActionValue\"\n class=\"str-chat__message-attachment-actions-button str-chat__message-attachment-actions-button--{{\n action.style\n }}\"\n data-testclass=\"attachment-action\"\n (click)=\"sendAction(action)\"\n (keyup.enter)=\"sendAction(action)\"\n >\n {{ action.text }}\n </button>\n </div>\n </div>\n </div>\n</ng-container>\n\n<stream-modal\n *ngIf=\"imagesToView && imagesToView.length > 0\"\n [isOpen]=\"imagesToView && imagesToView.length > 0\"\n (isOpenChange)=\"$event ? null : closeImageModal()\"\n>\n <div class=\"stream-chat-angular__image-modal\">\n <button\n class=\"stream-chat-angular__image-modal-stepper\"\n [ngStyle]=\"{\n visibility: isImageModalPrevButtonVisible ? 'visible' : 'hidden'\n }\"\n data-testid=\"image-modal-prev\"\n type=\"button\"\n (click)=\"stepImages(-1)\"\n (keyup.enter)=\"stepImages(-1)\"\n >\n <stream-icon icon=\"arrow-left\"></stream-icon>\n </button>\n <img\n class=\"stream-chat-angular__image-modal-image\"\n data-testid=\"modal-image\"\n [src]=\"\n imagesToView[imagesToViewCurrentIndex].img_url ||\n imagesToView[imagesToViewCurrentIndex].thumb_url ||\n imagesToView[imagesToViewCurrentIndex].image_url\n \"\n [alt]=\"imagesToView[imagesToViewCurrentIndex].fallback\"\n />\n <button\n class=\"stream-chat-angular__image-modal-stepper\"\n type=\"button\"\n [ngStyle]=\"{\n visibility: isImageModalNextButtonVisible ? 'visible' : 'hidden'\n }\"\n data-testid=\"image-modal-next\"\n (click)=\"stepImages(1)\"\n (keyup.enter)=\"stepImages(1)\"\n >\n <stream-icon icon=\"arrow-right\"></stream-icon>\n </button>\n </div>\n</stream-modal>\n","import { Component } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { AttachmentService } from '../attachment.service';\nimport { AttachmentUpload } from '../types';\n\n/**\n * The `AttachmentPreviewList` compontent displays a preview of the attachments uploaded to a message. Users can delete attachments using the preview component, or retry upload if it failed previously.\n */\n@Component({\n selector: 'stream-attachment-preview-list',\n templateUrl: './attachment-preview-list.component.html',\n styles: [],\n})\nexport class AttachmentPreviewListComponent {\n attachmentUploads$: Observable<AttachmentUpload[]>;\n\n constructor(private attachmentService: AttachmentService) {\n this.attachmentUploads$ = this.attachmentService.attachmentUploads$;\n }\n\n async retryAttachmentUpload(file: File) {\n await this.attachmentService.retryAttachmentUpload(file);\n }\n\n async deleteAttachment(upload: AttachmentUpload) {\n await this.attachmentService.deleteAttachment(upload);\n }\n\n trackByFile(_: number, item: AttachmentUpload) {\n return item.file;\n }\n}\n","<div class=\"rfu-image-previewer\" *ngIf=\"(attachmentUploads$ | async)?.length\">\n <ng-container\n *ngFor=\"\n let attachmentUpload of attachmentUploads$ | async;\n trackBy: trackByFile\n \"\n >\n <div\n *ngIf=\"attachmentUpload.type === 'image'\"\n class=\"rfu-image-previewer__image\"\n [class.rfu-image-previewer__image--loaded]=\"\n attachmentUpload.state === 'success'\n \"\n data-testclass=\"attachment-image-preview\"\n >\n <div\n *ngIf=\"attachmentUpload.state === 'error'\"\n class=\"rfu-image-previewer__retry\"\n (click)=\"retryAttachmentUpload(attachmentUpload.file)\"\n (keyup.enter)=\"retryAttachmentUpload(attachmentUpload.file)\"\n data-testclass=\"upload-error\"\n >\n <stream-icon icon=\"retry\"></stream-icon>\n </div>\n <div class=\"rfu-thumbnail__wrapper\" style=\"width: 100; height: 100\">\n <div class=\"rfu-thumbnail__overlay\">\n <div\n class=\"rfu-icon-button\"\n data-testclass=\"delete-attachment\"\n role=\"button\"\n (click)=\"deleteAttachment(attachmentUpload)\"\n (keyup.enter)=\"deleteAttachment(attachmentUpload)\"\n >\n <stream-icon icon=\"close\"></stream-icon>\n </div>\n </div>\n <img\n *ngIf=\"attachmentUpload.url || attachmentUpload.previewUri\"\n src=\"{{\n attachmentUpload.url\n ? attachmentUpload.url\n : attachmentUpload.previewUri\n }}\"\n alt=\"attachmentUpload.file.name\"\n class=\"rfu-thumbnail__image\"\n data-testclass=\"attachment-image\"\n />\n </div>\n <stream-loading-indicator\n data-testclass=\"loading-indicator\"\n color=\"rgba(255,255,255,0.7)\"\n *ngIf=\"attachmentUpload.state === 'uploading'\"\n ></stream-loading-indicator>\n </div>\n <div\n class=\"rfu-file-previewer\"\n *ngIf=\"attachmentUpload.type === 'file'\"\n data-testclass=\"attachment-file-preview\"\n >\n <ol>\n <li\n class=\"rfu-file-previewer__file\"\n [class.rfu-file-previewer__file--uploading]=\"\n attachmentUpload.state === 'uploading'\n \"\n [class.rfu-file-previewer__file--failed]=\"\n attachmentUpload.state === 'error'\n \"\n >\n <stream-icon icon=\"file\"></stream-icon>\n\n <a\n data-testclass=\"file-download-link\"\n href=\"{{ attachmentUpload.url }}\"\n (click)=\"attachmentUpload.url ? null : $event.preventDefault()\"\n (keyup.enter)=\"\n attachmentUpload.url ? null : $event.preventDefault()\n \"\n download\n >\n {{ attachmentUpload.file.name }}\n <ng-container *ngIf=\"attachmentUpload.state === 'error'\">\n <div\n data-testclass=\"file-upload-retry\"\n class=\"rfu-file-previewer__failed\"\n (click)=\"retryAttachmentUpload(attachmentUpload.file)\"\n (keyup.enter)=\"retryAttachmentUpload(attachmentUpload.file)\"\n translate\n >\n streamChat.failed\n </div>\n <div\n class=\"rfu-file-previewer__retry\"\n (click)=\"retryAttachmentUpload(attachmentUpload.file)\"\n (keyup.enter)=\"retryAttachmentUpload(attachmentUpload.file)\"\n translate\n >\n streamChat.retry\n </div>\n </ng-container>\n </a>\n\n <span\n data-testclass=\"file-delete\"\n class=\"rfu-file-previewer__close-button\"\n (click)=\"deleteAttachment(attachmentUpload)\"\n (keyup.enter)=\"deleteAttachment(attachmentUpload)\"\n >\n ✘\n </span>\n <div\n *ngIf=\"attachmentUpload.state === 'uploading'\"\n class=\"rfu-file-previewer__loading-indicator\"\n >\n <stream-loading-indicator></stream-loading-indicator>\n </div>\n </li>\n </ol>\n </div>\n </ng-container>\n</div>\n","import {\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n ComponentFactoryResolver,\n ComponentRef,\n ElementRef,\n EventEmitter,\n Inject,\n Input,\n OnChanges,\n OnDestroy,\n Output,\n SimpleChanges,\n TemplateRef,\n Type,\n ViewChild,\n} from '@angular/core';\nimport { ChatClientService } from '../chat-client.service';\nimport { combineLatest, Observable, Subject, Subscription, timer } from 'rxjs';\nimport { first, map, take, tap } from 'rxjs/operators';\nimport { AppSettings, Channel, UserResponse } from 'stream-chat';\nimport { AttachmentService } from '../attachment.service';\nimport { ChannelService } from '../channel.service';\nimport { textareaInjectionToken } from '../injection-tokens';\nimport { NotificationService } from '../notification.service';\nimport {\n AttachmentUpload,\n CommandAutocompleteListItemContext,\n MentionAutcompleteListItemContext,\n StreamMessage,\n} from '../types';\nimport { MessageInputConfigService } from './message-input-config.service';\nimport { TextareaDirective } from './textarea.directive';\nimport { TextareaInterface } from './textarea.interface';\nimport { isImageFile } from '../is-image-file';\nimport { EmojiInputService } from './emoji-input.service';\n\n/**\n * The `MessageInput` component displays an input where users can type their messages and upload files, and sends the message to the active channel. The component can be used to compose new messages or update existing ones. To send messages, the chat user needs to have the necessary [channel capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript).\n */\n@Component({\n selector: 'stream-message-input',\n templateUrl: './message-input.component.html',\n styles: [],\n providers: [AttachmentService, EmojiInputService],\n})\nexport class MessageInputComponent\n implements OnChanges, OnDestroy, AfterViewInit\n{\n /**\n * If file upload is enabled, the user can open a file selector from the input. Please note that the user also needs to have the necessary [channel capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript). If no value is provided, it is set from the [`MessageInputConfigService`](../services/MessageInputConfigService.mdx).\n */\n @Input() isFileUploadEnabled: boolean | undefined;\n /**\n * If true, users can mention other users in messages. You also [need to use the `AutocompleteTextarea`](../concepts/opt-in-architecture.mdx) for this feature to work. If no value is provided, it is set from the [`MessageInputConfigService`](../services/MessageInputConfigService.mdx).\n */\n @Input() areMentionsEnabled: boolean | undefined;\n /**\n * The scope for user mentions, either members of the current channel of members of the application. If no value is provided, it is set from the [`MessageInputConfigService`](../services/MessageInputConfigService.mdx).\n */\n @Input() mentionScope: 'channel' | 'application' | undefined;\n /**\n * You can provide your own template for the autocomplete list for user mentions. You also [need to use the `AutocompleteTextarea`](../concepts/opt-in-architecture.mdx) for this feature to work. If no value is provided, it is set from the [`MessageInputConfigService`](../services/MessageInputConfigService.mdx).\n */\n @Input() mentionAutocompleteItemTemplate:\n | TemplateRef<MentionAutcompleteListItemContext>\n | undefined;\n /**\n * You can provide your own template for the autocomplete list for commands. You also [need to use the `AutocompleteTextarea`](../concepts/opt-in-architecture.mdx) for this feature to work. If no value is provided, it is set from the [`MessageInputConfigService`](../services/MessageInputConfigService.mdx).\n */\n @Input() commandAutocompleteItemTemplate:\n | TemplateRef<CommandAutocompleteListItemContext>\n | undefined;\n /**\n * You can add an emoji picker by [providing your own emoji picker template](../code-examples/emoji-picker.mdx)\n */\n @Input() emojiPickerTemplate: TemplateRef<void> | undefined;\n /**\n * Determines if the message is being dispalyed in a channel or in a [thread](https://getstream.io/chat/docs/javascript/threads/?language=javascript).\n */\n @Input() mode: 'thread' | 'main' = 'main';\n /**\n * You can narrow the accepted file types by providing the [accepted types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept). By default every file type is accepted.\n * If no value is provided, it is set from the [`MessageInputConfigService`](../services/MessageInputConfigService.mdx).\n * @deprecated use [application settings](https://getstream.io/chat/docs/javascript/app_setting_overview/?language=javascript#file-uploads) instead\n */\n @Input() acceptedFileTypes: string[] | undefined;\n /**\n * If true, users can select multiple files to upload. If no value is provided, it is set from the [`MessageInputConfigService`](../services/MessageInputConfigService.mdx).\n */\n @Input() isMultipleFileUploadEnabled: boolean | undefined;\n /**\n * The message to edit\n */\n @Input() message: StreamMessage | undefined;\n /**\n * Emits when a message was successfuly sent or updated\n */\n @Output() readonly messageUpdate = new EventEmitter<void>();\n isFileUploadAuthorized: boolean | undefined;\n canSendLinks: boolean | undefined;\n canSendMessages: boolean | undefined;\n attachmentUploads$: Observable<AttachmentUpload[]>;\n textareaValue = '';\n textareaRef: ComponentRef<TextareaInterface> | undefined;\n mentionedUsers: UserResponse[] = [];\n quotedMessage: undefined | StreamMessage;\n typingStart$ = new Subject<void>();\n cooldown$: Observable<number> | undefined;\n isCooldownInProgress = false;\n @ViewChild('fileInput') private fileInput!: ElementRef<HTMLInputElement>;\n @ViewChild(TextareaDirective, { static: false })\n private textareaAnchor!: TextareaDirective;\n private subscriptions: Subscription[] = [];\n private hideNotification: Function | undefined;\n private isViewInited = false;\n private appSettings: AppSettings | undefined;\n private channel: Channel | undefined;\n constructor(\n private channelService: ChannelService,\n private notificationService: NotificationService,\n private attachmentService: AttachmentService,\n private configService: MessageInputConfigService,\n @Inject(textareaInjectionToken)\n private textareaType: Type<TextareaInterface>,\n private componentFactoryResolver: ComponentFactoryResolver,\n private cdRef: ChangeDetectorRef,\n private chatClient: ChatClientService,\n public emojiInputService: EmojiInputService\n ) {\n this.subscriptions.push(\n this.attachmentService.attachmentUploadInProgressCounter$.subscribe(\n (counter) => {\n if (counter === 0 && this.hideNotification) {\n this.hideNotification();\n this.hideNotification = undefined;\n }\n }\n )\n );\n this.subscriptions.push(\n this.channelService.activeChannel$.subscribe((channel) => {\n this.textareaValue = '';\n this.attachmentService.resetAttachmentUploads();\n const capabilities = channel?.data?.own_capabilities as string[];\n if (capabilities) {\n this.isFileUploadAuthorized =\n capabilities.indexOf('upload-file') !== -1;\n this.canSendLinks = capabilities.indexOf('send-links') !== -1;\n this.channel = channel;\n this.setCanSendMessages();\n }\n })\n );\n this.subscriptions.push(\n this.chatClient.appSettings$.subscribe(\n (appSettings) => (this.appSettings = appSettings)\n )\n );\n this.subscriptions.push(\n this.channelService.messageToQuote$.subscribe((m) => {\n const isThreadReply = m && m.parent_id;\n if (\n (this.mode === 'thread' && isThreadReply) ||\n (this.mode === 'thread' && this.quotedMessage && !m) ||\n (this.mode === 'main' && !isThreadReply)\n ) {\n this.quotedMessage = m;\n }\n })\n );\n this.attachmentUploads$ = this.attachmentService.attachmentUploads$;\n this.isFileUploadEnabled = this.configService.isFileUploadEnabled;\n this.acceptedFileTypes = this.configService.acceptedFileTypes;\n this.isMultipleFileUploadEnabled =\n this.configService.isMultipleFileUploadEnabled;\n this.areMentionsEnabled = this.configService.areMentionsEnabled;\n this.mentionAutocompleteItemTemplate =\n this.configService.mentionAutocompleteItemTemplate;\n this.mentionScope = this.configService.mentionScope;\n this.commandAutocompleteItemTemplate =\n this.configService.commandAutocompleteItemTemplate;\n this.emojiPickerTemplate = this.configService.emojiPickerTemplate;\n\n this.subscriptions.push(\n this.typingStart$.subscribe(\n () => void this.channelService.typingStarted(this.parentMessageId)\n )\n );\n\n this.subscriptions.push(\n combineLatest([\n this.channelService.latestMessageDateByUserByChannels$,\n this.channelService.activeChannel$,\n ])\n .pipe(\n map(\n ([latestMessages, channel]): [\n Date | undefined,\n Channel | undefined\n ] => [latestMessages[channel?.cid || ''], channel!]\n )\n )\n .subscribe(([latestMessageDate, channel]) => {\n const cooldown =\n (channel?.data?.cooldown as number) &&\n latestMessageDate &&\n Math.round(\n (channel?.data?.cooldown as number) -\n (new Date().getTime() - latestMessageDate.getTime()) / 1000\n );\n if (\n cooldown &&\n cooldown > 0 &&\n (channel?.data?.own_capabilities as string[]).includes('slow-mode')\n ) {\n this.startCooldown(cooldown);\n } else if (this.isCooldownInProgress) {\n this.stopCooldown();\n }\n })\n );\n }\n\n ngAfterViewInit(): void {\n this.isViewInited = true;\n this.initTextarea();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.message) {\n this.attachmentService.resetAttachmentUploads();\n if (this.isUpdate) {\n this.attachmentService.createFromAttachments(\n this.message!.attachments || []\n );\n this.textareaValue = this.message!.text || '';\n }\n }\n if (changes.isFileUploadEnabled) {\n this.configService.isFileUploadEnabled = this.isFileUploadEnabled;\n }\n if (changes.acceptedFileTypes) {\n this.configService.acceptedFileTypes = this.acceptedFileTypes;\n }\n if (changes.isMultipleFileUploadEnabled) {\n this.configService.isMultipleFileUploadEnabled =\n this.isMultipleFileUploadEnabled;\n }\n if (changes.areMentionsEnabled) {\n this.configService.areMentionsEnabled = this.areMentionsEnabled;\n }\n if (changes.mentionAutocompleteItemTemplate) {\n this.configService.mentionAutocompleteItemTemplate =\n this.mentionAutocompleteItemTemplate;\n }\n if (changes.commandAutocompleteItemTemplate) {\n this.configService.commandAutocompleteItemTemplate =\n this.commandAutocompleteItemTemplate;\n }\n if (changes.mentionScope) {\n this.configService.mentionScope = this.mentionScope;\n }\n if (changes.emojiPickerTemplate) {\n this.configService.emojiPickerTemplate = this.emojiPickerTemplate;\n }\n if (changes.mode) {\n this.setCanSendMessages();\n }\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n async messageSent() {\n let attachmentUploadInProgressCounter!: number;\n this.attachmentService.attachmentUploadInProgressCounter$\n .pipe(first())\n .subscribe((counter) => (attachmentUploadInProgressCounter = counter));\n if (attachmentUploadInProgressCounter > 0) {\n if (!this.hideNotification) {\n this.hideNotification =\n this.notificationService.addPermanentNotification(\n 'streamChat.Wait until all attachments have uploaded'\n );\n }\n return;\n }\n const attachments = this.attachmentService.mapToAttachments();\n const text = this.textareaValue;\n if (!text && (!attachments || attachments.length === 0)) {\n return;\n }\n if (this.containsLinks && !this.canSendLinks) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.Sending links is not allowed in this conversation'\n );\n return;\n }\n if (!this.isUpdate) {\n this.textareaValue = '';\n }\n try {\n await (this.isUpdate\n ? this.channelService.updateMessage({\n ...this.message!,\n text: text,\n attachments: attachments,\n })\n : this.channelService.sendMessage(\n text,\n attachments,\n this.mentionedUsers,\n this.parentMessageId,\n this.quotedMessage?.id\n ));\n this.messageUpdate.emit();\n if (!this.isUpdate) {\n this.attachmentService.resetAttachmentUploads();\n }\n } catch (error) {\n if (this.isUpdate) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.Edit message request failed'\n );\n }\n }\n void this.channelService.typingStopped(this.parentMessageId);\n if (this.quotedMessage) {\n this.deselectMessageToQuote();\n }\n }\n\n get containsLinks() {\n return /(?:(?:https?|ftp):\\/\\/)?[\\w/\\-?=%.]+\\.[\\w/\\-&?=%.]+/.test(\n this.textareaValue\n );\n }\n\n get accept() {\n return this.acceptedFileTypes ? this.acceptedFileTypes?.join(',') : '';\n }\n\n get quotedMessageAttachments() {\n const originalAttachments = this.quotedMessage?.attachments;\n return originalAttachments && originalAttachments.length\n ? [originalAttachments[0]]\n : [];\n }\n\n get disabledTextareaText() {\n if (!this.canSendMessages) {\n return this.mode === 'thread'\n ? \"streamChat.You can't send thread replies in this channel\"\n : \"streamChat.You can't send messages in this channel\";\n } else if (this.cooldown$) {\n return 'streamChat.Slow Mode ON';\n }\n return '';\n }\n\n async filesSelected(fileList: FileList | null) {\n if (!(await this.areAttachemntsValid(fileList))) {\n return;\n }\n await this.attachmentService.filesSelected(fileList);\n this.clearFileInput();\n }\n\n deselectMessageToQuote() {\n this.channelService.selectMessageToQuote(undefined);\n }\n\n private clearFileInput() {\n this.fileInput.nativeElement.value = '';\n }\n\n private get isUpdate() {\n return !!this.message;\n }\n\n private initTextarea() {\n if (!this.canSendMessages || this.textareaRef || !this.textareaAnchor) {\n return;\n }\n const componentFactory =\n this.componentFactoryResolver.resolveComponentFactory(this.textareaType);\n this.textareaRef =\n this.textareaAnchor.viewContainerRef.createComponent<any>(\n componentFactory\n );\n this.cdRef.detectChanges();\n }\n\n private async areAttachemntsValid(fileList: FileList | null) {\n if (!fileList || this.acceptedFileTypes) {\n return true;\n }\n if (!this.appSettings) {\n await this.chatClient.getAppSettings();\n }\n let isValid = true;\n Array.from(fileList).forEach((f) => {\n let hasBlockedExtension: boolean;\n let hasBlockedMimeType: boolean;\n let hasNotAllowedExtension: boolean;\n let hasNotAllowedMimeType: boolean;\n if (isImageFile(f)) {\n hasBlockedExtension =\n !!this.appSettings?.image_upload_config?.blocked_file_extensions?.find(\n (ext) => f.name.endsWith(ext)\n );\n hasBlockedMimeType =\n !!this.appSettings?.image_upload_config?.blocked_mime_types?.find(\n (type) => f.type === type\n );\n hasNotAllowedExtension =\n !!this.appSettings?.image_upload_config?.allowed_file_extensions\n ?.length &&\n !this.appSettings?.image_upload_config?.allowed_file_extensions?.find(\n (ext) => f.name.endsWith(ext)\n );\n hasNotAllowedMimeType =\n !!this.appSettings?.image_upload_config?.allowed_mime_types?.length &&\n !this.appSettings?.image_upload_config?.allowed_mime_types?.find(\n (type) => f.type === type\n );\n } else {\n hasBlockedExtension =\n !!this.appSettings?.file_upload_config?.blocked_file_extensions?.find(\n (ext) => f.name.endsWith(ext)\n );\n hasBlockedMimeType =\n !!this.appSettings?.file_upload_config?.blocked_mime_types?.find(\n (type) => f.type === type\n );\n hasNotAllowedExtension =\n !!this.appSettings?.file_upload_config?.allowed_file_extensions\n ?.length &&\n !this.appSettings?.file_upload_config?.allowed_file_extensions?.find(\n (ext) => f.name.endsWith(ext)\n );\n hasNotAllowedMimeType =\n !!this.appSettings?.file_upload_config?.allowed_mime_types?.length &&\n !this.appSettings?.file_upload_config?.allowed_mime_types?.find(\n (type) => f.type === type\n );\n }\n if (\n hasBlockedExtension ||\n hasBlockedMimeType ||\n hasNotAllowedExtension ||\n hasNotAllowedMimeType\n ) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.Unsupported file type: {{type}}',\n undefined,\n undefined,\n { type: f.type }\n );\n isValid = false;\n }\n });\n return isValid;\n }\n\n private setCanSendMessages() {\n const capabilities = this.channel?.data?.own_capabilities as string[];\n if (!capabilities) {\n this.canSendMessages = false;\n } else {\n this.canSendMessages =\n capabilities.indexOf(\n this.mode === 'main' ? 'send-message' : 'send-reply'\n ) !== -1;\n }\n if (this.isViewInited) {\n this.cdRef.detectChanges();\n this.initTextarea();\n }\n }\n\n private get parentMessageId() {\n let parentMessageId: string | undefined = undefined;\n if (this.mode === 'thread') {\n this.channelService.activeParentMessageId$\n .pipe(first())\n .subscribe((id) => (parentMessageId = id));\n }\n\n return parentMessageId;\n }\n\n private startCooldown(cooldown: number) {\n this.isCooldownInProgress = true;\n this.cooldown$ = timer(0, 1000).pipe(\n take(cooldown + 1),\n map((v) => cooldown - v),\n tap((v) => {\n if (v === 0) {\n this.stopCooldown();\n }\n })\n );\n }\n\n private stopCooldown() {\n this.cooldown$ = undefined;\n this.isCooldownInProgress = false;\n // the anchor directive will be recreated because of *ngIf, so we will have to reinit the textarea as well\n this.textareaRef = undefined;\n // we can only create the textarea after the anchor was recreated, so we will have to wait a change detection cycle with setTimeout\n setTimeout(() => this.initTextarea());\n }\n}\n","<div\n class=\"{{\n mode === 'main' ? 'str-chat__input-flat' : 'str-chat__small-message-input'\n }}\"\n [class.str-chat__input-flat-has-attachments]=\"\n (attachmentUploads$ | async)!.length > 0\n \"\n [class.str-chat__input-flat-quoted]=\"!!quotedMessage\"\n>\n <div\n data-testid=\"quoted-message-container\"\n class=\"quoted-message-preview\"\n *ngIf=\"quotedMessage\"\n >\n <div class=\"quoted-message-preview-header\">\n <div>{{ \"streamChat.Reply to Message\" | translate }}</div>\n <button\n class=\"str-chat__square-button\"\n data-testid=\"remove-quote\"\n (click)=\"deselectMessageToQuote()\"\n (keyup.enter)=\"deselectMessageToQuote()\"\n >\n <stream-icon\n icon=\"close-no-outline\"\n style=\"font-size: 10px; line-height: 10px\"\n ></stream-icon>\n </button>\n </div>\n <div class=\"quoted-message-preview-content\">\n <stream-avatar\n data-testid=\"qouted-message-avatar\"\n class=\"str-chat-angular__avatar-host\"\n [imageUrl]=\"quotedMessage?.user?.image\"\n [name]=\"quotedMessage?.user?.name || quotedMessage?.user?.id\"\n [size]=\"20\"\n ></stream-avatar>\n <div class=\"quoted-message-preview-content-inner\">\n <stream-attachment-list\n *ngIf=\"\n quotedMessage?.attachments && quotedMessage?.attachments?.length\n \"\n [attachments]=\"quotedMessageAttachments\"\n [messageId]=\"quotedMessage?.id\"\n ></stream-attachment-list>\n <div\n data-testid=\"quoted-message-text\"\n [innerHTML]=\"quotedMessage?.html || quotedMessage?.text\"\n ></div>\n </div>\n </div>\n </div>\n <div class=\"str-chat__input-flat-wrapper\" style=\"width: 100%\">\n <div\n class=\"{{\n mode === 'main'\n ? 'str-chat__input-flat--textarea-wrapper'\n : 'str-chat__small-message-input--textarea-wrapper'\n }}\"\n >\n <stream-attachment-preview-list\n class=\"rfu-image-previewer-angular-host\"\n ></stream-attachment-preview-list>\n <div class=\"rta str-chat__textarea str-chat-angular__textarea\">\n <ng-container\n *ngIf=\"emojiPickerTemplate && !isCooldownInProgress\"\n data-testid=\"emoji-picker\"\n >\n <div\n class=\"\n str-chat__input-flat-emojiselect\n str-chat-angular__emojiselect\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n emojiPickerTemplate;\n context: { emojiInput$: emojiInputService.emojiInput$ }\n \"\n ></ng-container>\n </div>\n </ng-container>\n <div\n class=\"str-chat__input-flat-cooldown str-chat-angular__cooldown\"\n *ngIf=\"isCooldownInProgress\"\n data-testid=\"cooldown-timer\"\n >\n {{ cooldown$ | async }}\n </div>\n <ng-template\n *ngIf=\"canSendMessages && !isCooldownInProgress; else notAllowed\"\n streamTextarea\n [(value)]=\"textareaValue\"\n (valueChange)=\"typingStart$.next()\"\n (send)=\"messageSent()\"\n [componentRef]=\"textareaRef\"\n (userMentions)=\"mentionedUsers = $event\"\n [areMentionsEnabled]=\"areMentionsEnabled\"\n [mentionAutocompleteItemTemplate]=\"mentionAutocompleteItemTemplate\"\n [commandAutocompleteItemTemplate]=\"commandAutocompleteItemTemplate\"\n [mentionScope]=\"mentionScope\"\n ></ng-template>\n <ng-template #notAllowed>\n <textarea\n disabled\n rows=\"1\"\n [value]=\"disabledTextareaText | translate\"\n class=\"rta__textarea str-chat__textarea__textarea\"\n data-testid=\"disabled-textarea\"\n ></textarea>\n </ng-template>\n </div>\n <div\n *ngIf=\"\n isFileUploadEnabled &&\n isFileUploadAuthorized &&\n canSendMessages &&\n !isCooldownInProgress\n \"\n class=\"str-chat__fileupload-wrapper\"\n data-testid=\"file-upload-button\"\n >\n <div class=\"str-chat__tooltip\">\n {{ \"streamChat.Attach files\" | translate }}\n </div>\n <div class=\"rfu-file-upload-button\">\n <label>\n <input\n #fileInput\n type=\"file\"\n class=\"rfu-file-input\"\n data-testid=\"file-input\"\n [accept]=\"accept\"\n [multiple]=\"isMultipleFileUploadEnabled\"\n (change)=\"filesSelected(fileInput.files)\"\n />\n <span class=\"str-chat__input-flat-fileupload\">\n <stream-icon icon=\"file-upload\"></stream-icon>\n </span>\n </label>\n </div>\n </div>\n </div>\n <button\n *ngIf=\"canSendMessages\"\n data-testid=\"send-button\"\n class=\"str-chat__send-button\"\n (click)=\"messageSent()\"\n (keyup.enter)=\"messageSent()\"\n >\n <stream-icon icon=\"send\"></stream-icon>\n </button>\n </div>\n</div>\n","import { Component, Input } from '@angular/core';\nimport { NotificationType } from '../types';\n\n/**\n * The `Notification` component displays a notification within the [`NotificationList`](./NotificationListComponent.mdx)\n */\n@Component({\n selector: 'stream-notification',\n templateUrl: './notification.component.html',\n styles: [],\n})\nexport class NotificationComponent {\n /**\n * The type of the notification\n */\n @Input() type: NotificationType | undefined;\n\n constructor() {}\n}\n","<div\n class=\"str-chat__custom-notification notification-{{ type }}\"\n data-testid=\"custom-notification\"\n>\n <ng-content></ng-content>\n</div>\n","import { Component } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { NotificationService } from '../notification.service';\nimport { NotificationPayload } from '../types';\n\n/**\n * The `NotificationList` component displays the list of active notifications.\n */\n@Component({\n selector: 'stream-notification-list',\n templateUrl: './notification-list.component.html',\n styles: [],\n})\nexport class NotificationListComponent {\n notifications$: Observable<NotificationPayload[]>;\n\n constructor(private notificationService: NotificationService) {\n this.notifications$ = this.notificationService.notifications$;\n }\n\n trackById(_: number, item: NotificationPayload) {\n return item.id;\n }\n\n getTemplateContext(notification: NotificationPayload) {\n return {\n ...notification.templateContext,\n dismissFn: notification.dismissFn,\n };\n }\n}\n","<div class=\"str-chat__list-notifications\">\n <stream-notification\n *ngFor=\"let notification of notifications$ | async; trackBy: trackById\"\n [type]=\"notification.type\"\n >\n <div\n *ngIf=\"notification.text !== undefined\"\n data-testclass=\"notification-content\"\n >\n {{ notification.text | translate: notification.translateParams }}\n </div>\n <ng-container *ngIf=\"notification.template !== undefined\">\n <ng-container\n *ngTemplateOutlet=\"\n notification.template;\n context: getTemplateContext(notification)\n \"\n ></ng-container>\n </ng-container>\n </stream-notification>\n</div>\n","import {\n Component,\n EventEmitter,\n Input,\n OnChanges,\n Output,\n SimpleChanges,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport { ChannelService } from '../channel.service';\nimport { ChatClientService } from '../chat-client.service';\nimport { MessageInputComponent } from '../message-input/message-input.component';\nimport { NotificationService } from '../notification.service';\nimport { StreamMessage } from '../types';\n\n/**\n * @deprecated https://getstream.io/chat/docs/sdk/angular/components/message-actions/#required-enabledactions\n */\nexport type MessageActions =\n | 'edit'\n | 'delete'\n | 'edit-any'\n | 'delete-any'\n | 'pin'\n | 'quote'\n | 'flag'\n | 'mute';\n\n/**\n * The `MessageActionsBox` component displays a list of message actions (i.e edit), that can be opened or closed. You can find the [list of the supported actions](../concepts/message-interactions.mdx) in the message interaction guide.\n */\n@Component({\n selector: 'stream-message-actions-box',\n templateUrl: './message-actions-box.component.html',\n styles: [],\n})\nexport class MessageActionsBoxComponent implements OnChanges {\n /**\n * The input used for message edit. By default, the [default message input component](./MessageInputComponent.mdx) is used. To change the input for message edit, provide [your own custom template](./MessageInputComponent.mdx/#customization).\n */\n @Input() messageInputTemplate: TemplateRef<any> | undefined;\n /**\n * Indicates if the list should be opened or closed. Adding a UI element to open and close the list is the parent's component responsibility.\n */\n @Input() isOpen = false;\n /**\n * Indicates if the message actions are belonging to a message that was sent by the current user or not.\n */\n @Input() isMine = false;\n /**\n * The message the actions will be executed on\n */\n @Input() message: StreamMessage | undefined;\n /**\n * The list of [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) that are enabled for the current user, the list of [supported interactions](../concepts/message-interactions.mdx) can be found in our message interaction guide. Unathorized actions won't be displayed on the UI.\n */\n @Input() enabledActions: string[] = [];\n /**\n * The number of authorized actions (it can be less or equal than the number of enabled actions)\n */\n @Output() readonly displayedActionsCount = new EventEmitter<number>();\n /**\n * An event which emits `true` if the edit message modal is open, and `false` when it is closed.\n */\n @Output() readonly isEditing = new EventEmitter<boolean>();\n isEditModalOpen = false;\n @ViewChild(MessageInputComponent) private messageInput:\n | MessageInputComponent\n | undefined;\n\n constructor(\n private chatClientService: ChatClientService,\n private notificationService: NotificationService,\n private channelService: ChannelService\n ) {}\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.isMine || changes.enabledActions) {\n let displayedActionsCount = 0;\n if (this.isQuoteVisible) {\n displayedActionsCount++;\n }\n if (this.isEditVisible) {\n displayedActionsCount++;\n }\n if (this.isDeleteVisible) {\n displayedActionsCount++;\n }\n if (this.isMuteVisible) {\n displayedActionsCount++;\n }\n if (this.isFlagVisible) {\n displayedActionsCount++;\n }\n if (this.isPinVisible) {\n displayedActionsCount++;\n }\n this.displayedActionsCount.next(displayedActionsCount);\n }\n }\n\n get isQuoteVisible() {\n return (\n (this.enabledActions.indexOf('quote') !== -1 ||\n this.enabledActions.indexOf('quote-message') !== -1) &&\n !this.message?.quoted_message\n );\n }\n\n get isEditVisible() {\n return (\n ((this.enabledActions.indexOf('edit') !== -1 ||\n this.enabledActions.indexOf('update-own-message') !== -1) &&\n this.isMine) ||\n this.enabledActions.indexOf('edit-any') !== -1 ||\n this.enabledActions.indexOf('update-any-message') !== -1\n );\n }\n\n get isDeleteVisible() {\n return (\n ((this.enabledActions.indexOf('delete') !== -1 ||\n this.enabledActions.indexOf('delete-own-message') !== -1) &&\n this.isMine) ||\n this.enabledActions.indexOf('delete-any') !== -1 ||\n this.enabledActions.indexOf('delete-any-message') !== -1\n );\n }\n\n get isMuteVisible() {\n return this.enabledActions.indexOf('mute') !== -1;\n }\n\n get isFlagVisible() {\n return (\n (this.enabledActions.indexOf('flag') !== -1 ||\n this.enabledActions.indexOf('flag-message') !== -1) &&\n !this.isMine\n );\n }\n\n get isPinVisible() {\n return this.enabledActions.indexOf('pin') !== -1;\n }\n\n pinClicked() {\n alert('Feature not yet implemented');\n }\n\n async flagClicked() {\n try {\n await this.chatClientService.flagMessage(this.message!.id);\n this.notificationService.addTemporaryNotification(\n 'streamChat.Message has been successfully flagged',\n 'success'\n );\n } catch (err) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.Error adding flag'\n );\n }\n }\n\n muteClicked() {\n alert('Feature not yet implemented');\n }\n\n quoteClicked() {\n this.channelService.selectMessageToQuote(this.message);\n }\n\n editClicked() {\n this.isEditing.emit(true);\n this.isEditModalOpen = true;\n }\n\n sendClicked() {\n this.messageInput?.messageSent();\n }\n\n modalClosed = () => {\n this.isEditModalOpen = false;\n this.isEditing.emit(false);\n };\n\n async deleteClicked() {\n try {\n await this.channelService.deleteMessage(this.message!);\n } catch (error) {\n this.notificationService.addTemporaryNotification(\n 'streamChat.Error deleting message'\n );\n }\n }\n}\n","<div\n data-testid=\"action-box\"\n class=\"str-chat__message-actions-box\"\n [class.str-chat__message-actions-box--open]=\"isOpen\"\n [class.str-chat__message-actions-box--mine]=\"isMine\"\n>\n <ul class=\"str-chat__message-actions-list\">\n <button\n data-testid=\"quote-action\"\n *ngIf=\"isQuoteVisible\"\n (click)=\"quoteClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Reply\" | translate }}\n </li>\n </button>\n <button\n data-testid=\"pin-action\"\n *ngIf=\"isPinVisible\"\n (click)=\"pinClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{\n (message?.pinned ? \"streamChat.Unpin\" : \"streamChat.Pin\") | translate\n }}\n </li>\n </button>\n <button\n data-testid=\"flag-action\"\n *ngIf=\"isFlagVisible\"\n (click)=\"flagClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Flag\" | translate }}\n </li>\n </button>\n <button\n data-testid=\"mute-action\"\n *ngIf=\"isMuteVisible\"\n (click)=\"muteClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Mute\" | translate }}\n </li>\n </button>\n <button\n data-testid=\"edit-action\"\n *ngIf=\"isEditVisible\"\n (click)=\"editClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Edit Message\" | translate }}\n </li>\n </button>\n <button\n data-testid=\"delete-action\"\n *ngIf=\"isDeleteVisible\"\n (click)=\"deleteClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Delete\" | translate }}\n </li>\n </button>\n </ul>\n</div>\n\n<stream-modal\n [isOpen]=\"isEditModalOpen\"\n (isOpenChange)=\"\n isEditModalOpen = $event; isEditModalOpen ? '' : modalClosed()\n \"\n>\n <div class=\"str-chat__edit-message-form\" *ngIf=\"isEditModalOpen\">\n <ng-container *ngIf=\"messageInputTemplate; else defaultInput\">\n <ng-container\n *ngTemplateOutlet=\"\n messageInputTemplate;\n context: {\n message: message,\n messageUpdateHandler: modalClosed\n }\n \"\n ></ng-container>\n </ng-container>\n <ng-template #defaultInput>\n <stream-message-input\n [message]=\"message\"\n (messageUpdate)=\"modalClosed()\"\n ></stream-message-input>\n </ng-template>\n <stream-notification-list></stream-notification-list>\n <div\n class=\"\n str-chat__message-team-form-footer\n str-chat__message-team-form-footer-angular\n \"\n >\n <div class=\"str-chat__edit-message-form-options\">\n <button translate data-testid=\"cancel-button\" (click)=\"modalClosed()\">\n streamChat.Cancel\n </button>\n <button\n type=\"submit\"\n translate\n data-testid=\"send-button\"\n (click)=\"sendClicked()\"\n (keyup.enter)=\"sendClicked()\"\n >\n streamChat.Send\n </button>\n </div>\n </div>\n </div>\n</stream-modal>\n","import { Component } from '@angular/core';\nimport { Observable, of, Subscription } from 'rxjs';\nimport { catchError, map, startWith } from 'rxjs/operators';\nimport { ChannelService } from '../channel.service';\n\n/**\n * The `Channel` component is a container component that displays the [`ChannelHeader`](./ChannelHeaderComponent.mdx), [`MessageList`](./MessageListComponent.mdx), [`NotificationList`](./NotificationListComponent.mdx) and [`MessageInput`](./MessageInputComponent.mdx) components. You can also provide the [`Thread`](./ThreadComponent.mdx) component to use message [threads](https://getstream.io/chat/docs/javascript/threads/?language=javascript).\n */\n@Component({\n selector: 'stream-channel',\n templateUrl: './channel.component.html',\n styles: [],\n})\nexport class ChannelComponent {\n isError$: Observable<boolean>;\n isInitializing$: Observable<boolean>;\n isActiveThread$: Observable<boolean>;\n subscriptions: Subscription[] = [];\n\n constructor(private channelService: ChannelService) {\n this.isError$ = this.channelService.channels$.pipe(\n map(() => false),\n catchError(() => of(true)),\n startWith(false)\n );\n this.isInitializing$ = this.channelService.channels$.pipe(\n map((channels) => !channels),\n catchError(() => of(false))\n );\n this.isActiveThread$ = this.channelService.activeParentMessageId$.pipe(\n map((id) => !!id)\n );\n }\n}\n","<div\n *ngIf=\"(isError$ | async) === false && (isInitializing$ | async) === false\"\n class=\"str-chat str-chat-channel messaging\"\n>\n <div class=\"str-chat__container\">\n <div class=\"str-chat__main-panel\">\n <ng-content></ng-content>\n </div>\n <ng-content\n *ngIf=\"isActiveThread$ | async\"\n select='[name=\"thread\"]'\n ></ng-content>\n </div>\n</div>\n","export type DeviceWidth = {\n device: 'mobile' | 'tablet' | 'full';\n width: number;\n};\n\nexport const getDeviceWidth = (): DeviceWidth => {\n const width = window.innerWidth;\n if (width < 768) return { device: 'mobile', width };\n if (width < 1024) return { device: 'tablet', width };\n return { device: 'full', width };\n};\n","import { Injectable } from '@angular/core';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { distinctUntilChanged, filter, first } from 'rxjs/operators';\nimport { getDeviceWidth } from '../device-width';\n\n/**\n * The `ChannelListToggleService` can be used to toggle the channel list.\n */\n@Injectable({ providedIn: 'root' })\nexport class ChannelListToggleService {\n /**\n * Emits `true` if the channel list is in open state, otherwise it emits `false`\n */\n isOpen$: Observable<boolean>;\n private isOpenSubject = new BehaviorSubject<boolean>(false);\n private menuElement: HTMLElement | undefined;\n\n constructor() {\n this.isOpen$ = this.isOpenSubject\n .asObservable()\n .pipe(distinctUntilChanged());\n this.isOpen$.pipe(filter((s) => s)).subscribe(() => {\n if (getDeviceWidth().device === 'mobile') {\n this.watchForOutsideClicks();\n }\n });\n }\n\n /**\n * Opens the channel list.\n */\n open() {\n this.isOpenSubject.next(true);\n }\n\n /**\n * Closes the channel list.\n */\n close() {\n this.isOpenSubject.next(false);\n }\n\n /**\n * Opens the channel list if it was closed, and closes if it was opened.\n */\n toggle() {\n this.isOpenSubject.getValue() ? this.close() : this.open();\n }\n\n /**\n * Sets the channel list element, on mobile screen size if the user opens the channel list, and clicks outside, the service automatically closes the channel list if a reference to the HTML element is provided.\n * @param element\n */\n setMenuElement(element: HTMLElement | undefined) {\n this.menuElement = element;\n }\n\n /**\n * This method should be called if a channel was selected, if on mobile, the channel list will be closed.\n */\n channelSelected() {\n if (getDeviceWidth().device === 'mobile') {\n this.close();\n }\n }\n\n private watchForOutsideClicks() {\n if (!this.menuElement) {\n return;\n }\n const eventHandler = (event: Event) => {\n if (!this.menuElement!.contains(event.target as Node)) {\n this.close();\n window.removeEventListener('click', eventHandler);\n }\n };\n window.addEventListener('click', eventHandler);\n this.isOpen$\n .pipe(\n filter((s) => !s),\n first()\n )\n .subscribe(() => window.removeEventListener('click', eventHandler));\n }\n}\n","import { Component, Input, TemplateRef } from '@angular/core';\nimport { Channel } from 'stream-chat';\nimport { ChannelListToggleService } from '../channel-list/channel-list-toggle.service';\nimport { ChannelService } from '../channel.service';\n\n/**\n * The `ChannelHeader` component displays the avatar and name of the currently active channel along with member and watcher information. You can read about [the difference between members and watchers](https://getstream.io/chat/docs/javascript/watch_channel/?language=javascript#watchers-vs-members) in the platform documentation. Please note that number of watchers is only displayed if the user has [`connect-events` capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript)\n */\n@Component({\n selector: 'stream-channel-header',\n templateUrl: './channel-header.component.html',\n styles: [],\n})\nexport class ChannelHeaderComponent {\n /**\n * Template that can be used to add actions (such as edit, invite) to the channel header\n */\n @Input() channelActionsTemplate?: TemplateRef<{ channel: Channel }>;\n activeChannel: Channel | undefined;\n canReceiveConnectEvents: boolean | undefined;\n\n constructor(\n private channelService: ChannelService,\n private channelListToggleService: ChannelListToggleService\n ) {\n this.channelService.activeChannel$.subscribe((c) => {\n this.activeChannel = c;\n const capabilities = this.activeChannel?.data\n ?.own_capabilities as string[];\n if (!capabilities) {\n return;\n }\n this.canReceiveConnectEvents =\n capabilities.indexOf('connect-events') !== -1;\n });\n }\n\n toggleMenu(event: Event) {\n event.stopPropagation();\n this.channelListToggleService.toggle();\n }\n\n get memberCountParam() {\n return { memberCount: this.activeChannel?.data?.member_count || 0 };\n }\n\n get watcherCountParam() {\n return { watcherCount: this.activeChannel?.state?.watcher_count || 0 };\n }\n}\n","<div class=\"str-chat__header-livestream\">\n <div\n class=\"str-chat__header-hamburger\"\n (click)=\"toggleMenu($event)\"\n (keyup.enter)=\"toggleMenu($event)\"\n >\n <stream-icon icon=\"menu\"></stream-icon>\n </div>\n <stream-avatar\n imageUrl=\"{{ activeChannel?.data?.image }}\"\n name=\"{{ activeChannel?.data?.name }}\"\n ></stream-avatar>\n <div class=\"str-chat__header-livestream-left\">\n <p data-testid=\"name\" class=\"str-chat__header-livestream-left--title\">\n {{ activeChannel?.data?.name }}\n </p>\n <p data-testid=\"info\" class=\"str-chat__header-livestream-left--members\">\n {{'streamChat.{{ memberCount }} members' | translate:memberCountParam}}\n {{canReceiveConnectEvents ? ('streamChat.{{ watcherCount }} online' |\n translate:watcherCountParam) : ''}}\n </p>\n </div>\n <ng-container *ngIf=\"channelActionsTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n channelActionsTemplate;\n context: { channel: activeChannel }\n \"\n ></ng-container>\n </ng-container>\n</div>\n","import { Component, Input, NgZone, OnDestroy, OnInit } from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport {\n Channel,\n Event,\n FormatMessageResponse,\n MessageResponse,\n} from 'stream-chat';\nimport { ChannelService } from '../channel.service';\n\n/**\n * The `ChannelPreview` component displays a channel preview in the channel list, it consists of the image, name and latest message of the channel.\n */\n@Component({\n selector: 'stream-channel-preview',\n templateUrl: './channel-preview.component.html',\n styles: [],\n})\nexport class ChannelPreviewComponent implements OnInit, OnDestroy {\n /**\n * The channel to be displayed\n */\n @Input() channel: Channel | undefined;\n isActive = false;\n isUnread = false;\n latestMessage: string = 'Nothing yet...';\n private subscriptions: (Subscription | { unsubscribe: () => void })[] = [];\n private canSendReadEvents = true;\n\n constructor(private channelService: ChannelService, private ngZone: NgZone) {}\n\n ngOnInit(): void {\n this.subscriptions.push(\n this.channelService.activeChannel$.subscribe(\n (activeChannel) =>\n (this.isActive = activeChannel?.id === this.channel?.id)\n )\n );\n const messages = this.channel?.state?.messages;\n if (messages && messages.length > 0) {\n this.setLatestMessage(messages[messages.length - 1]);\n }\n this.isUnread = !!this.channel!.countUnread() && this.canSendReadEvents;\n const capabilities =\n (this.channel?.data?.own_capabilities as string[]) || [];\n this.canSendReadEvents = capabilities.indexOf('read-events') !== -1;\n this.subscriptions.push(\n this.channel!.on('message.new', this.handleMessageEvent.bind(this))\n );\n this.subscriptions.push(\n this.channel!.on('message.updated', this.handleMessageEvent.bind(this))\n );\n this.subscriptions.push(\n this.channel!.on('message.deleted', this.handleMessageEvent.bind(this))\n );\n this.subscriptions.push(\n this.channel!.on('channel.truncated', this.handleMessageEvent.bind(this))\n );\n this.subscriptions.push(\n this.channel!.on('message.read', () =>\n this.ngZone.run(() => {\n this.isUnread =\n !!this.channel!.countUnread() && this.canSendReadEvents;\n })\n )\n );\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n get avatarImage() {\n return this.channel?.data?.image;\n }\n\n get avatarName() {\n return this.channel?.data?.name;\n }\n\n get title() {\n return this.channel?.data?.name;\n }\n\n setAsActiveChannel(): void {\n void this.channelService.setAsActiveChannel(this.channel!);\n }\n\n private handleMessageEvent(event: Event) {\n this.ngZone.run(() => {\n if (this.channel?.state.messages.length === 0) {\n this.latestMessage = 'Nothing yet...';\n return;\n }\n if (\n !event.message ||\n this.channel?.state.messages[this.channel?.state.messages.length - 1]\n .id !== event.message.id\n ) {\n return;\n }\n this.setLatestMessage(event.message);\n this.isUnread = !!this.channel.countUnread() && this.canSendReadEvents;\n });\n }\n\n private setLatestMessage(message?: FormatMessageResponse | MessageResponse) {\n if (message?.deleted_at) {\n this.latestMessage = 'streamChat.Message deleted';\n } else if (message?.text) {\n this.latestMessage = message.text;\n } else if (message?.attachments && message.attachments.length) {\n this.latestMessage = 'streamChat.🏙 Attachment...';\n }\n }\n}\n","<button\n class=\"str-chat__channel-preview-messenger\"\n [class.str-chat__channel-preview-messenger--active]=\"isActive\"\n [class.str-chat__channel-preview-messenger--unread]=\"isUnread\"\n (click)=\"setAsActiveChannel()\"\n data-testid=\"channel-preview-container\"\n>\n <div class=\"str-chat__channel-preview-messenger--left\">\n <stream-avatar\n imageUrl=\"{{ avatarImage }}\"\n name=\"{{ avatarName }}\"\n [size]=\"40\"\n ></stream-avatar>\n </div>\n <div class=\"str-chat__channel-preview-messenger--right\">\n <div class=\"str-chat__channel-preview-messenger--name\">\n <span data-testid=\"channel-preview-title\">{{ title }}</span>\n </div>\n <div\n data-testid=\"latest-message\"\n class=\"str-chat__channel-preview-messenger--last-message\"\n >\n {{ latestMessage | translate }}\n </div>\n </div>\n</button>\n","import {\n AfterViewInit,\n Component,\n ElementRef,\n Input,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport { Observable, of } from 'rxjs';\nimport { catchError, map, startWith } from 'rxjs/operators';\nimport { Channel } from 'stream-chat';\nimport { ChannelService } from '../channel.service';\nimport { ChannelListToggleService } from './channel-list-toggle.service';\n\n/**\n * The `ChannelList` component renders the list of channels.\n */\n@Component({\n selector: 'stream-channel-list',\n templateUrl: './channel-list.component.html',\n styles: [],\n})\nexport class ChannelListComponent implements AfterViewInit {\n /**\n * By default, the [default preview component](./ChannelPreviewComponent.mdx) is used. To change the contents of the channel list, [provide your own custom template](./ChannelPreviewComponent.mdx/#customization).\n */\n @Input() customChannelPreviewTemplate: TemplateRef<any> | undefined;\n channels$: Observable<Channel[] | undefined>;\n isError$: Observable<boolean>;\n isInitializing$: Observable<boolean>;\n isLoadingMoreChannels = false;\n isOpen$: Observable<boolean>;\n hasMoreChannels$: Observable<boolean>;\n @ViewChild('container') private container!: ElementRef<HTMLElement>;\n\n constructor(\n private channelService: ChannelService,\n private channelListToggleService: ChannelListToggleService\n ) {\n this.isOpen$ = this.channelListToggleService.isOpen$;\n this.channels$ = this.channelService.channels$;\n this.hasMoreChannels$ = this.channelService.hasMoreChannels$;\n this.isError$ = this.channels$.pipe(\n map(() => false),\n catchError(() => of(true)),\n startWith(false)\n );\n this.isInitializing$ = this.channels$.pipe(\n map((channels) => !channels),\n catchError(() => of(false))\n );\n }\n ngAfterViewInit(): void {\n this.channelListToggleService.setMenuElement(this.container.nativeElement);\n }\n\n async loadMoreChannels() {\n this.isLoadingMoreChannels = true;\n await this.channelService.loadMoreChannels();\n this.isLoadingMoreChannels = false;\n }\n\n trackByChannelId(index: number, item: Channel) {\n return item.cid;\n }\n\n channelSelected() {\n this.channelListToggleService.channelSelected();\n }\n}\n","<div\n #container\n data-testid=\"channel-list-container\"\n class=\"str-chat str-chat-channel-list messaging\"\n [class.str-chat-channel-list--open]=\"(isOpen$ | async) === true\"\n>\n <div\n *ngIf=\"\n (isError$ | async) === false && (isInitializing$ | async) === false;\n else statusIndicator\n \"\n class=\"str-chat__channel-list-messenger\"\n >\n <div class=\"str-chat__channel-list-messenger__main\">\n <p\n data-testid=\"empty-channel-list-indicator\"\n *ngIf=\"!(channels$ | async)?.length\"\n >\n {{ \"streamChat.You have no channels currently\" | translate }}\n </p>\n <ng-container\n *ngFor=\"let channel of channels$ | async; trackBy: trackByChannelId\"\n >\n <ng-container\n *ngIf=\"customChannelPreviewTemplate; else defaultTemplate\"\n >\n <div (click)=\"channelSelected()\" (keyup.enter)=\"channelSelected()\">\n <ng-container\n *ngTemplateOutlet=\"\n customChannelPreviewTemplate;\n context: { channel: channel }\n \"\n ></ng-container>\n </div>\n </ng-container>\n <ng-template #defaultTemplate>\n <stream-channel-preview\n data-testclass=\"channel-preview\"\n [channel]=\"channel\"\n (click)=\"channelSelected()\"\n (keyup.enter)=\"channelSelected()\"\n ></stream-channel-preview>\n </ng-template>\n </ng-container>\n <div\n *ngIf=\"hasMoreChannels$ | async\"\n class=\"str-chat__load-more-button\"\n (click)=\"loadMoreChannels()\"\n (keyup.enter)=\"loadMoreChannels()\"\n data-testid=\"load-more\"\n >\n <button\n class=\"str-chat__load-more-button__button\"\n data-testid=\"load-more-button\"\n [disabled]=\"isLoadingMoreChannels\"\n >\n <span *ngIf=\"!isLoadingMoreChannels; else loadingIndicator\">{{\n \"Load more\" | translate\n }}</span>\n <ng-template #loadingIndicator\n ><stream-loading-indicator></stream-loading-indicator\n ></ng-template>\n </button>\n </div>\n </div>\n </div>\n</div>\n\n<ng-template #statusIndicator>\n <ng-container *ngIf=\"isError$ | async\">\n <ng-container *ngTemplateOutlet=\"chatDown\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"isInitializing$ | async\">\n <ng-container *ngTemplateOutlet=\"loadingChannels\"></ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #chatDown>\n <div data-testid=\"chatdown-container\" class=\"str-chat__down\">\n <ng-container *ngTemplateOutlet=\"loadingChannels\"></ng-container>\n <div class=\"str-chat__down-main\">\n <stream-icon icon=\"connection-error\"></stream-icon>\n <h1>{{ \"streamChat.Connection error\" | translate }}</h1>\n <h3>\n {{\n \"streamChat.Error connecting to chat, refresh the page to try again.\"\n | translate\n }}\n </h3>\n </div>\n </div>\n</ng-template>\n\n<ng-template #loadingChannels>\n <div data-testid=\"loading-indicator\" class=\"str-chat__loading-channels\">\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #loadingChannel>\n <div class=\"str-chat__loading-channels-item\">\n <div class=\"str-chat__loading-channels-avatar\"></div>\n <div class=\"str-chat__loading-channels-meta\">\n <div class=\"str-chat__loading-channels-username\"></div>\n <div class=\"str-chat__loading-channels-status\"></div>\n </div>\n </div>\n</ng-template>\n","import Dayjs from 'dayjs';\nimport calendar from 'dayjs/plugin/calendar';\n\nDayjs.extend(calendar);\n\nexport const parseDate = (date: Date) => {\n const parsedTime = Dayjs(date);\n\n return parsedTime.calendar();\n};\n","import { UserResponse } from 'stream-chat';\n\nexport const getReadByText = (users: UserResponse[]) => {\n let outStr = '';\n\n const slicedArr = users.map((item) => item.name || item.id).slice(0, 5);\n const restLength = users.length - slicedArr.length;\n\n if (slicedArr.length === 1) {\n outStr = `${slicedArr[0]} `;\n } else if (slicedArr.length === 2) {\n // joins all with \"and\" but =no commas\n // example: \"bob and sam\"\n outStr = `${slicedArr[0]} and ${slicedArr[1]}`;\n } else if (slicedArr.length > 2) {\n // joins all with commas, but last one gets \", and\" (oxford comma!)\n // example: \"bob, joe, sam and 4 more\"\n if (restLength === 0) {\n // mutate slicedArr to remove last user to display it separately\n const lastUser = slicedArr.splice(slicedArr.length - 2, 1)[0];\n const commaSeparatedUsers = slicedArr.join(', ');\n outStr = `${commaSeparatedUsers}, and ${lastUser}`;\n } else {\n const commaSeparatedUsers = slicedArr.join(', ');\n outStr = `${commaSeparatedUsers} and ${restLength} more`;\n }\n }\n\n return outStr;\n};\n","import {\n AfterViewChecked,\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n Output,\n SimpleChanges,\n ViewChild,\n} from '@angular/core';\nimport { ReactionResponse } from 'stream-chat';\nimport { ChannelService } from '../channel.service';\nimport { DefaultReactionType, DefaultUserType } from '../types';\n\nexport type MessageReactionType =\n | 'angry'\n | 'haha'\n | 'like'\n | 'love'\n | 'sad'\n | 'wow';\n\nconst emojiReactionsMapping: { [key in MessageReactionType]: string } = {\n like: '👍',\n angry: '😠',\n love: '❤️',\n haha: '😂',\n wow: '😮',\n sad: '😞',\n};\n\n/**\n * The `MessageReactions` component displays the reactions of a message, the current user can add and remove reactions. You can read more about [message reactions](https://getstream.io/chat/docs/javascript/send_reaction/?language=javascript) in the platform documentation.\n */\n@Component({\n selector: 'stream-message-reactions',\n templateUrl: './message-reactions.component.html',\n styles: ['.emoji {position: relative; display: inline-block; }'],\n})\nexport class MessageReactionsComponent implements AfterViewChecked, OnChanges {\n /**\n * The id of the message the reactions belong to\n */\n @Input() messageId: string | undefined;\n /**\n * The number of reactions grouped by [reaction types](https://github.com/GetStream/stream-chat-angular/tree/master/projects/stream-chat-angular/src/lib/message-reactions/message-reactions.component.ts)\n */\n @Input() messageReactionCounts: { [key in MessageReactionType]?: number } =\n {};\n /**\n * Indicates if the selector should be opened or closed. Adding a UI element to open and close the selector is the parent's component responsibility.\n */\n @Input() isSelectorOpen: boolean = false;\n /**\n * List of reactions of a [message](../types/stream-message.mdx), used to display the users of a reaction type.\n */\n @Input() latestReactions: ReactionResponse<\n DefaultReactionType,\n DefaultUserType\n >[] = [];\n /**\n * List of the user's own reactions of a [message](../types/stream-message.mdx), used to display the users of a reaction type.\n */\n @Input() ownReactions: ReactionResponse<\n DefaultReactionType,\n DefaultUserType\n >[] = [];\n /**\n * Indicates if the selector should be opened or closed. Adding a UI element to open and close the selector is the parent's component responsibility.\n */\n @Output() readonly isSelectorOpenChange = new EventEmitter<boolean>();\n tooltipPositions: { arrow: number; tooltip: number } | undefined;\n tooltipText: string | undefined;\n @ViewChild('selectorContainer') private selectorContainer:\n | ElementRef<HTMLElement>\n | undefined;\n @ViewChild('selectorTooltip') private selectorTooltip:\n | ElementRef<HTMLElement>\n | undefined;\n currentTooltipTarget: HTMLElement | undefined;\n\n constructor(\n private cdRef: ChangeDetectorRef,\n private channelService: ChannelService\n ) {}\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.isSelectorOpen) {\n this.isSelectorOpen\n ? setTimeout(() => this.watchForOutsideClicks()) // setTimeout: wait for current click to bubble up, and only watch for clicks after that\n : this.stopWatchForOutsideClicks();\n }\n }\n\n ngAfterViewChecked(): void {\n if (this.tooltipText && !this.tooltipPositions) {\n this.setTooltipPosition();\n this.cdRef.detectChanges();\n }\n }\n\n get existingReactions(): MessageReactionType[] {\n return Object.keys(this.messageReactionCounts).filter(\n (k) => this.messageReactionCounts[k as MessageReactionType]! > 0\n ) as MessageReactionType[];\n }\n\n get reactionsCount() {\n return Object.values(this.messageReactionCounts).reduce(\n (total, count) => total + count,\n 0\n );\n }\n\n get reactionOptions(): MessageReactionType[] {\n return ['like', 'love', 'haha', 'wow', 'sad', 'angry'];\n }\n\n getLatestUserByReaction(reactionType: MessageReactionType) {\n return this.latestReactions.find((r) => r.type === reactionType && r.user)\n ?.user;\n }\n\n getEmojiByReaction(reactionType: MessageReactionType) {\n return emojiReactionsMapping[reactionType];\n }\n\n getUsersByReaction(reactionType: MessageReactionType) {\n return this.latestReactions\n .filter((r) => r.type === reactionType)\n .map((r) => r.user?.name || r.user?.id)\n .filter((i) => !!i)\n .join(', ');\n }\n\n showTooltip(event: Event, reactionType: MessageReactionType) {\n this.currentTooltipTarget = event.target as HTMLElement;\n this.tooltipText = this.getUsersByReaction(reactionType);\n }\n\n hideTooltip() {\n this.tooltipText = undefined;\n this.currentTooltipTarget = undefined;\n this.tooltipPositions = undefined;\n }\n\n trackByMessageReaction(index: number, item: MessageReactionType) {\n return item;\n }\n\n react(type: MessageReactionType) {\n this.ownReactions.find((r) => r.type === type)\n ? void this.channelService.removeReaction(this.messageId!, type)\n : void this.channelService.addReaction(this.messageId!, type);\n }\n\n private eventHandler = (event: Event) => {\n if (!this.selectorContainer?.nativeElement.contains(event.target as Node)) {\n this.isSelectorOpenChange.emit(false);\n }\n };\n\n private watchForOutsideClicks() {\n window.addEventListener('click', this.eventHandler);\n }\n\n private stopWatchForOutsideClicks() {\n window.removeEventListener('click', this.eventHandler);\n }\n\n private setTooltipPosition() {\n const tooltip = this.selectorTooltip?.nativeElement.getBoundingClientRect();\n const target = this.currentTooltipTarget?.getBoundingClientRect();\n\n const container =\n this.selectorContainer?.nativeElement.getBoundingClientRect();\n\n if (!tooltip || !target || !container) return;\n\n const tooltipPosition =\n tooltip.width === container.width || tooltip.x < container.x\n ? 0\n : target.left + target.width / 2 - container.left - tooltip.width / 2;\n\n const arrowPosition =\n target.x - tooltip.x + target.width / 2 - tooltipPosition;\n\n this.tooltipPositions = {\n tooltip: tooltipPosition,\n arrow: arrowPosition,\n };\n }\n}\n","<div\n *ngIf=\"existingReactions.length > 0 && !isSelectorOpen\"\n class=\"str-chat__reaction-list\"\n [class.str-chat__reaction-list--reverse]=\"true\"\n data-testid=\"reaction-list\"\n>\n <ul>\n <li\n *ngFor=\"\n let reactionType of existingReactions;\n trackBy: trackByMessageReaction\n \"\n data-testclass=\"emoji\"\n >\n <span class=\"emoji\">\n {{ getEmojiByReaction(reactionType) }}\n </span>\n &nbsp;\n </li>\n <li>\n <span\n data-testid=\"reactions-count\"\n class=\"str-chat__reaction-list--counter\"\n >{{ reactionsCount }}</span\n >\n </li>\n </ul>\n</div>\n\n<div\n #selectorContainer\n class=\"str-chat__reaction-selector\"\n *ngIf=\"isSelectorOpen\"\n data-testid=\"reaction-selector\"\n>\n <div\n *ngIf=\"tooltipText\"\n data-testid=\"tooltip\"\n #selectorTooltip\n class=\"str-chat__reaction-selector-tooltip\"\n [ngStyle]=\"{\n left: tooltipPositions?.tooltip + 'px',\n visibility: tooltipPositions ? 'visible' : 'hidden'\n }\"\n >\n <div\n class=\"arrow\"\n [ngStyle]=\"{ left: tooltipPositions?.arrow + 'px' }\"\n ></div>\n <span class=\"latest-user-username\">\n {{ tooltipText }}\n </span>\n </div>\n <ul class=\"str-chat__message-reactions-list\">\n <li\n class=\"str-chat__message-reactions-list-item str-chat__emoji\"\n *ngFor=\"\n let reactionType of reactionOptions;\n trackBy: trackByMessageReaction\n \"\n data-testclass=\"emoji-option\"\n (click)=\"react(reactionType)\"\n (keyup.enter)=\"react(reactionType)\"\n >\n <div\n *ngIf=\"getLatestUserByReaction(reactionType) as user\"\n class=\"latest-user\"\n (click)=\"hideTooltip()\"\n (keyup.enter)=\"hideTooltip()\"\n (mouseenter)=\"showTooltip($event, reactionType)\"\n (mouseleave)=\"hideTooltip()\"\n attr.data-testid=\"{{ reactionType }}-last-user\"\n >\n <stream-avatar\n attr.data-testid=\"{{ reactionType }}-avatar\"\n [imageUrl]=\"user.image\"\n [name]=\"user.name || user.id\"\n [size]=\"20\"\n ></stream-avatar>\n </div>\n <span class=\"emoji\" style=\"width: 20px; height: 20px; top: 10px\">\n {{ getEmojiByReaction(reactionType) }}\n </span>\n <span\n *ngIf=\"\n messageReactionCounts[reactionType] &&\n messageReactionCounts[reactionType]! > 0\n \"\n class=\"str-chat__message-reactions-list-item__count\"\n attr.data-testid=\"{{ reactionType }}-reaction-count\"\n >\n {{ messageReactionCounts[reactionType] }}\n </span>\n </li>\n </ul>\n</div>\n","import {\n Component,\n ElementRef,\n Input,\n TemplateRef,\n OnChanges,\n SimpleChanges,\n ViewChild,\n} from '@angular/core';\nimport { UserResponse } from 'stream-chat';\nimport { ChannelService } from '../channel.service';\nimport { ChatClientService } from '../chat-client.service';\nimport { getDeviceWidth } from '../device-width';\nimport { DefaultUserType, StreamMessage } from '../types';\nimport { parseDate } from './parse-date';\nimport { getReadByText } from './read-by-text';\nimport emojiRegex from 'emoji-regex';\n\ntype MessagePart = {\n content: string;\n type: 'text' | 'mention';\n user?: UserResponse;\n};\n\n/**\n * The `Message` component displays a message with additional information such as sender and date, and enables [interaction with the message (i.e. edit or react)](../concepts/message-interactions.mdx).\n */\n@Component({\n selector: 'stream-message',\n templateUrl: './message.component.html',\n styles: [],\n})\nexport class MessageComponent implements OnChanges {\n /**\n * The input used for message edit. By default, the [default message input component](./MessageInputComponent.mdx) is used. To change the input for message edit, provide [your own custom template](./MessageInputComponent.mdx/#customization).\n */\n @Input() messageInputTemplate: TemplateRef<any> | undefined;\n /**\n * The template used to display a mention in a message. It receives the mentioned user in a variable called `user` with the type [`UserResponse`](https://github.com/GetStream/stream-chat-js/blob/master/src/types.ts). You can provide your own template if you want to [add actions to mentions](../code-examples/mention-actions.mdx).\n */\n @Input() mentionTemplate: TemplateRef<any> | undefined;\n /**\n * The message to be displayed\n */\n @Input() message: StreamMessage | undefined;\n /**\n * The list of [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) that are enabled for the current user, the list of [supported interactions](../concepts/message-interactions.mdx) can be found in our message interaction guide. Unathorized actions won't be displayed on the UI. The [`MessageList`](./MessageListComponent.mdx) component automatically sets this based on [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript).\n */\n @Input() enabledMessageActions: string[] = [];\n /**\n * If true, the message reactions are displayed. If you use the default chat UI you can also set this using the [`MessageList`](./MessageListComponent.mdx) component.\n * @deprecated use [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) instead\n */\n @Input() areReactionsEnabled: boolean | undefined;\n /**\n * If true, the user can add reactions to the message. The [`MessageList`](./MessageListComponent.mdx) component automatically sets this based on [channel capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript).\n * @deprecated use [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) instead\n */\n @Input() canReactToMessage: boolean | undefined;\n /**\n * If `true`, the message status (sending, sent, who read the message) is displayed.\n */\n @Input() isLastSentMessage: boolean | undefined;\n /**\n * If true, the read indicator is displayed. The [`MessageList`](./MessageListComponent.mdx) component automatically sets this based on [channel capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript).\n * @deprecated use [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) instead\n */\n @Input() canReceiveReadEvents: boolean | undefined;\n /**\n * Determines if the message is being dispalyed in a channel or in a [thread](https://getstream.io/chat/docs/javascript/threads/?language=javascript).\n */\n @Input() mode: 'thread' | 'main' = 'main';\n isEditing: boolean | undefined;\n isActionBoxOpen = false;\n isReactionSelectorOpen = false;\n isPressedOnMobile = false;\n visibleMessageActionsCount = 0;\n messageTextParts: MessagePart[] = [];\n private user: UserResponse<DefaultUserType> | undefined;\n @ViewChild('container') private container:\n | ElementRef<HTMLElement>\n | undefined;\n\n constructor(\n private chatClientService: ChatClientService,\n private channelService: ChannelService\n ) {\n this.user = this.chatClientService.chatClient.user;\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.message) {\n this.createMessageParts();\n }\n }\n\n get isSentByCurrentUser() {\n return this.message?.user?.id === this.user?.id;\n }\n\n get readByText() {\n return getReadByText(this.message!.readBy);\n }\n\n get lastReadUser() {\n return this.message?.readBy.filter((u) => u.id !== this.user?.id)[0];\n }\n\n get isOnlyReadByMe() {\n return this.message && this.message.readBy.length === 0;\n }\n\n get isReadByMultipleUsers() {\n return this.message && this.message.readBy.length > 1;\n }\n\n get isMessageDeliveredAndRead() {\n return (\n this.message &&\n this.message.readBy &&\n this.message.status === 'received' &&\n this.message.readBy.length > 0\n );\n }\n\n get parsedDate() {\n if (!this.message || !this.message?.created_at) {\n return;\n }\n return parseDate(this.message.created_at);\n }\n\n get areOptionsVisible() {\n if (!this.message) {\n return false;\n }\n return !(\n !this.message.type ||\n this.message.type === 'error' ||\n this.message.type === 'system' ||\n this.message.type === 'ephemeral' ||\n this.message.status === 'failed' ||\n this.message.status === 'sending' ||\n (this.mode === 'thread' && !this.message.parent_id)\n );\n }\n\n get hasAttachment() {\n return !!this.message?.attachments && !!this.message.attachments.length;\n }\n\n get hasReactions() {\n return (\n !!this.message?.reaction_counts &&\n Object.keys(this.message.reaction_counts).length > 0\n );\n }\n\n get replyCountParam() {\n return { replyCount: this.message?.reply_count };\n }\n\n get canDisplayReadStatus() {\n return (\n this.canReceiveReadEvents !== false &&\n this.enabledMessageActions.indexOf('read-events') !== -1\n );\n }\n\n get quotedMessageAttachments() {\n const originalAttachments = this.message?.quoted_message?.attachments;\n return originalAttachments && originalAttachments.length\n ? [originalAttachments[0]]\n : [];\n }\n\n resendMessage() {\n void this.channelService.resendMessage(this.message!);\n }\n\n textClicked() {\n if (getDeviceWidth().device !== 'mobile') {\n this.isPressedOnMobile = false;\n return;\n }\n if (this.isPressedOnMobile) {\n return;\n }\n this.isPressedOnMobile = true;\n const eventHandler = (event: Event) => {\n if (!this.container?.nativeElement.contains(event.target as Node)) {\n this.isPressedOnMobile = false;\n window.removeEventListener('click', eventHandler);\n }\n };\n window.addEventListener('click', eventHandler);\n }\n\n setAsActiveParentMessage() {\n void this.channelService.setAsActiveParentMessage(this.message);\n }\n\n private createMessageParts() {\n let content = this.message?.html || this.message?.text;\n if (!content) {\n this.messageTextParts = [];\n } else {\n // Backend will wrap HTML content with <p></p>\\n\n if (content.startsWith('<p>')) {\n content = content.replace('<p>', '');\n }\n if (content.endsWith('</p>\\n')) {\n content = content.replace('</p>\\n', '');\n }\n if (\n !this.message!.mentioned_users ||\n this.message!.mentioned_users.length === 0\n ) {\n // Wrap emojis in span to display emojis correctly in Chrome https://bugs.chromium.org/p/chromium/issues/detail?id=596223\n const regex = new RegExp(emojiRegex(), 'g');\n // Based on this: https://stackoverflow.com/questions/4565112/javascript-how-to-find-out-if-the-user-browser-is-chrome\n /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n const isChrome =\n !!(window as any).chrome &&\n typeof (window as any).opr === 'undefined';\n /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n content = content.replace(\n regex,\n (match) =>\n `<span ${\n isChrome ? 'class=\"str-chat__emoji-display-fix\"' : ''\n }>${match}</span>`\n );\n this.messageTextParts = [{ content, type: 'text' }];\n } else {\n this.messageTextParts = [];\n let text = content;\n this.message!.mentioned_users.forEach((user) => {\n const mention = `@${user.name || user.id}`;\n const precedingText = text.substring(0, text.indexOf(mention));\n this.messageTextParts.push({\n content: precedingText,\n type: 'text',\n });\n this.messageTextParts.push({\n content: mention,\n type: 'mention',\n user,\n });\n text = text.replace(precedingText + mention, '');\n });\n if (text) {\n this.messageTextParts.push({ content: text, type: 'text' });\n }\n }\n }\n }\n}\n","<div\n #container\n class=\"str-chat__message-simple str-chat__message str-chat__message--{{\n message?.type\n }} str-chat__message--{{ message?.status }} {{\n message?.text ? 'str-chat__message--has-text' : 'has-no-text'\n }}\"\n [class.str-chat__message--me]=\"isSentByCurrentUser\"\n [class.str-chat__message-simple--me]=\"isSentByCurrentUser\"\n [class.mobile-press]=\"isPressedOnMobile\"\n [class.str-chat__message--has-attachment]=\"hasAttachment\"\n [class.str-chat__message--with-reactions]=\"\n areReactionsEnabled !== false && hasReactions\n \"\n data-testid=\"message-container\"\n (mouseleave)=\"isActionBoxOpen = false\"\n>\n <ng-container *ngIf=\"!message?.deleted_at; else deletedMessage\">\n <ng-container *ngIf=\"message?.type !== 'system'; else systemMessage\">\n <ng-container\n *ngIf=\"\n isSentByCurrentUser &&\n ((isLastSentMessage && message?.status === 'received') ||\n message?.status === 'sending')\n \"\n >\n <ng-container *ngIf=\"message?.status === 'sending'; else sentStatus\">\n <ng-container *ngTemplateOutlet=\"sendingStatus\"></ng-container>\n </ng-container>\n <ng-template #sentStatus>\n <ng-container\n *ngIf=\"\n mode === 'main' &&\n isMessageDeliveredAndRead &&\n canDisplayReadStatus;\n else deliveredStatus\n \"\n >\n <ng-container *ngTemplateOutlet=\"readStatus\"></ng-container>\n </ng-container>\n </ng-template>\n </ng-container>\n <stream-avatar\n data-testid=\"avatar\"\n class=\"str-chat-angular__avatar-host\"\n [imageUrl]=\"message?.user?.image\"\n [name]=\"message?.user?.name || message?.user?.id\"\n ></stream-avatar>\n <div class=\"str-chat__message-inner\">\n <div\n class=\"str-chat__message-simple__actions\"\n data-testid=\"message-options\"\n *ngIf=\"areOptionsVisible\"\n >\n <div\n data-testid=\"message-actions-container\"\n class=\"\n str-chat__message-simple__actions__action\n str-chat__message-simple__actions__action--options\n \"\n [class.str-chat-angular__message-simple__actions__action--options--editing]=\"\n isEditing\n \"\n >\n <stream-message-actions-box\n [isOpen]=\"isActionBoxOpen\"\n [isMine]=\"isSentByCurrentUser\"\n [enabledActions]=\"enabledMessageActions\"\n [message]=\"message\"\n (displayedActionsCount)=\"visibleMessageActionsCount = $event\"\n (isEditing)=\"isEditing = $event; isActionBoxOpen = !isEditing\"\n [messageInputTemplate]=\"messageInputTemplate\"\n ></stream-message-actions-box>\n <stream-icon\n *ngIf=\"visibleMessageActionsCount > 0\"\n data-testid=\"action-icon\"\n icon=\"action-icon\"\n (keyup.enter)=\"isActionBoxOpen = !isActionBoxOpen\"\n (click)=\"isActionBoxOpen = !isActionBoxOpen\"\n ></stream-icon>\n </div>\n <!-- eslint-disable @angular-eslint/template/conditional-complexity -->\n <div\n *ngIf=\"\n enabledMessageActions.indexOf('send-reply') !== -1 &&\n mode === 'main'\n \"\n class=\"\n str-chat__message-simple__actions__action\n str-chat__message-simple__actions__action--thread\n \"\n data-testid=\"reply-in-thread\"\n (click)=\"setAsActiveParentMessage()\"\n (keyup.enter)=\"setAsActiveParentMessage()\"\n >\n <stream-icon icon=\"reply-in-thread\"></stream-icon>\n </div>\n <div\n *ngIf=\"\n areReactionsEnabled !== false &&\n canReactToMessage !== false &&\n enabledMessageActions.indexOf('send-reaction') !== -1\n \"\n class=\"\n str-chat__message-simple__actions__action\n str-chat__message-simple__actions__action--reactions\n \"\n data-testid=\"reaction-icon\"\n (click)=\"isReactionSelectorOpen = !isReactionSelectorOpen\"\n (keyup.enter)=\"isReactionSelectorOpen = !isReactionSelectorOpen\"\n >\n <stream-icon icon=\"reaction-icon\"></stream-icon>\n </div>\n </div>\n <!-- eslint-enable @angular-eslint/template/conditional-complexity -->\n <stream-message-reactions\n *ngIf=\"areReactionsEnabled !== false\"\n [messageReactionCounts]=\"message?.reaction_counts || {}\"\n [latestReactions]=\"message?.latest_reactions || []\"\n [(isSelectorOpen)]=\"isReactionSelectorOpen\"\n [messageId]=\"message?.id\"\n [ownReactions]=\"message?.own_reactions || []\"\n ></stream-message-reactions>\n <stream-attachment-list\n *ngIf=\"hasAttachment && !message?.quoted_message\"\n [attachments]=\"message!.attachments!\"\n [messageId]=\"message!.id\"\n ></stream-attachment-list>\n <div class=\"str-chat__message-text\" *ngIf=\"message?.text\">\n <div\n data-testid=\"inner-message\"\n class=\"\n str-chat__message-text-inner str-chat__message-simple-text-inner\n \"\n [class.str-chat__message-light-text-inner--has-attachment]=\"\n hasAttachment\n \"\n (click)=\"\n message?.status === 'failed' && message?.errorStatusCode !== 403\n ? resendMessage()\n : undefined\n \"\n (keyup.enter)=\"\n message?.status === 'failed' && message?.errorStatusCode !== 403\n ? resendMessage()\n : undefined\n \"\n >\n <ng-container *ngTemplateOutlet=\"quotedMessage\"></ng-container>\n <stream-attachment-list\n *ngIf=\"hasAttachment && message?.quoted_message\"\n [attachments]=\"message!.attachments!\"\n [messageId]=\"message!.id\"\n ></stream-attachment-list>\n <div\n data-testid=\"client-error-message\"\n *ngIf=\"message?.type === 'error'\"\n class=\"str-chat__simple-message--error-message\"\n >\n {{ \"streamChat.Error · Unsent\" | translate }}\n </div>\n <div\n data-testid=\"error-message\"\n *ngIf=\"message?.status === 'failed'\"\n class=\"str-chat__simple-message--error-message\"\n >\n {{\n (message?.errorStatusCode === 403\n ? \"streamChat.Message Failed · Unauthorized\"\n : \"streamChat.Message Failed · Click to try again\"\n ) | translate\n }}\n </div>\n <div\n (click)=\"textClicked()\"\n (keyup.enter)=\"textClicked()\"\n data-testid=\"text\"\n >\n <p>\n <!-- eslint-disable-next-line @angular-eslint/template/use-track-by-function -->\n <ng-container *ngFor=\"let part of messageTextParts\">\n <span\n *ngIf=\"part.type === 'text'; else mention\"\n [innerHTML]=\"part.content\"\n ></span>\n <ng-template #mention>\n <ng-container *ngIf=\"mentionTemplate; else defaultMention\">\n <ng-container\n *ngTemplateOutlet=\"\n mentionTemplate;\n context: { user: part.user! }\n \"\n ></ng-container>\n </ng-container>\n <ng-template #defaultMention>\n <b>{{ part.content }}</b>\n </ng-template>\n </ng-template>\n </ng-container>\n </p>\n </div>\n </div>\n </div>\n <div class=\"str-chat__message-simple-reply-button\">\n <button\n *ngIf=\"\n !!message?.reply_count &&\n mode !== 'thread' &&\n enabledMessageActions.indexOf('send-reply') !== -1\n \"\n class=\"str-chat__message-replies-count-button\"\n data-testid=\"reply-count-button\"\n (click)=\"setAsActiveParentMessage()\"\n >\n <stream-icon icon=\"reply\"></stream-icon>\n {{message?.reply_count === 1 ? ('streamChat.1 reply' | translate) : ('streamChat.{{ replyCount }}\n replies' | translate:replyCountParam)}}\n </button>\n </div>\n <div class=\"str-chat__message-data str-chat__message-simple-data\">\n <span\n data-testid=\"sender\"\n *ngIf=\"!isSentByCurrentUser\"\n class=\"str-chat__message-simple-name\"\n >\n {{ message?.user?.name ? message?.user?.name : message?.user?.id }}\n </span>\n <span data-testid=\"date\" class=\"str-chat__message-simple-timestamp\">\n {{ parsedDate }}\n </span>\n </div>\n </div>\n </ng-container>\n </ng-container>\n</div>\n\n<ng-template #sendingStatus>\n <span\n class=\"\n str-chat__message-simple-status str-chat__message-simple-status-angular\n \"\n data-testid=\"sending-indicator\"\n >\n <div class=\"str-chat__tooltip\">\n {{ \"streamChat.Sending...\" | translate }}\n </div>\n <stream-loading-indicator\n data-testid=\"loading-indicator\"\n ></stream-loading-indicator>\n </span>\n</ng-template>\n<ng-template #readStatus>\n <span\n class=\"\n str-chat__message-simple-status str-chat__message-simple-status-angular\n \"\n data-testid=\"read-indicator\"\n >\n <div class=\"str-chat__tooltip\" data-testid=\"read-by-tooltip\">\n {{ readByText }}\n </div>\n <stream-avatar\n class=\"str-chat-angular__avatar-host\"\n data-test-id=\"last-read-user-avatar\"\n [size]=\"15\"\n [imageUrl]=\"lastReadUser?.image\"\n [name]=\"lastReadUser?.name || lastReadUser?.id\"\n ></stream-avatar>\n <span\n data-test-id=\"read-by-length\"\n *ngIf=\"isReadByMultipleUsers\"\n class=\"str-chat__message-simple-status-number\"\n >\n {{ (message?.readBy)!.length }}\n </span>\n </span>\n</ng-template>\n<ng-template #deliveredStatus>\n <span\n *ngIf=\"mode === 'main'\"\n class=\"\n str-chat__message-simple-status str-chat__message-simple-status-angular\n \"\n data-testid=\"delivered-indicator\"\n >\n <div class=\"str-chat__tooltip\">\n {{ \"streamChat.Delivered\" | translate }}\n </div>\n <stream-icon\n data-testid=\"delivered-icon\"\n icon=\"delivered-icon\"\n ></stream-icon>\n </span>\n</ng-template>\n\n<ng-template #deletedMessage>\n <div data-testid=\"message-deleted-component\">\n <div class=\"str-chat__message--deleted-inner\" translate>\n streamChat.This message was deleted...\n </div>\n </div>\n</ng-template>\n\n<ng-template #systemMessage>\n <div data-testid=\"system-message\" class=\"str-chat__message--system\">\n <div class=\"str-chat__message--system__text\">\n <div class=\"str-chat__message--system__line\"></div>\n <p>{{ message?.text }}</p>\n <div class=\"str-chat__message--system__line\"></div>\n </div>\n <div class=\"str-chat__message--system__date\">\n {{ parsedDate }}\n </div>\n </div>\n</ng-template>\n\n<ng-template #quotedMessage>\n <div\n *ngIf=\"message?.quoted_message\"\n class=\"quoted-message\"\n data-testid=\"quoted-message-container\"\n [class.mine]=\"isSentByCurrentUser\"\n >\n <stream-avatar\n data-testid=\"qouted-message-avatar\"\n class=\"str-chat-angular__avatar-host\"\n [imageUrl]=\"message?.quoted_message?.user?.image\"\n [name]=\"\n message?.quoted_message?.user?.name || message?.quoted_message?.user?.id\n \"\n [size]=\"20\"\n ></stream-avatar>\n <div class=\"quoted-message-inner\">\n <stream-attachment-list\n *ngIf=\"\n message?.quoted_message?.attachments &&\n message?.quoted_message?.attachments?.length\n \"\n [attachments]=\"quotedMessageAttachments\"\n [messageId]=\"message?.quoted_message?.id\"\n ></stream-attachment-list>\n <div\n data-testid=\"quoted-message-text\"\n [innerHTML]=\"\n message?.quoted_message?.html || message?.quoted_message?.text\n \"\n ></div>\n </div>\n </div>\n</ng-template>\n","import {\n Component,\n ElementRef,\n EventEmitter,\n HostBinding,\n Input,\n OnChanges,\n OnDestroy,\n Output,\n ViewChild,\n} from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { EmojiInputService } from '../emoji-input.service';\nimport { TextareaInterface } from '../textarea.interface';\n\n/**\n * The `Textarea` component is used by the [`MessageInput`](./MessageInputComponent.mdx) component to display the input HTML element where users can type their message.\n */\n@Component({\n selector: 'stream-textarea',\n templateUrl: './textarea.component.html',\n styles: [],\n})\nexport class TextareaComponent\n implements TextareaInterface, OnChanges, OnDestroy\n{\n @HostBinding() class = 'str-chat__textarea';\n /**\n * The value of the input HTML element.\n */\n @Input() value = '';\n /**\n * Emits the current value of the input element when a user types.\n */\n @Output() readonly valueChange = new EventEmitter<string>();\n /**\n * Emits when a user triggers a message send event (this happens when they hit the `Enter` key).\n */\n @Output() readonly send = new EventEmitter<void>();\n @ViewChild('input') private messageInput!: ElementRef<HTMLInputElement>;\n private subscriptions: Subscription[] = [];\n\n constructor(private emojiInputService: EmojiInputService) {\n this.subscriptions.push(\n this.emojiInputService.emojiInput$.subscribe((emoji) => {\n this.messageInput.nativeElement.focus();\n const { selectionStart } = this.messageInput.nativeElement;\n this.messageInput.nativeElement.setRangeText(emoji);\n this.messageInput.nativeElement.selectionStart =\n selectionStart! + emoji.length;\n this.messageInput.nativeElement.selectionEnd =\n selectionStart! + emoji.length;\n this.inputChanged();\n })\n );\n }\n\n // eslint-disable-next-line @angular-eslint/no-empty-lifecycle-method\n ngOnChanges(): void {}\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n inputChanged() {\n this.valueChange.emit(this.messageInput.nativeElement.value);\n }\n\n sent(event: Event) {\n event.preventDefault();\n this.send.next();\n }\n}\n","<textarea\n [value]=\"value || ''\"\n autofocus\n data-testid=\"textarea\"\n #input\n placeholder=\"{{ 'streamChat.Type your message' | translate }}\"\n class=\"rta__textarea str-chat__textarea__textarea str-chat__angular-textarea\"\n rows=\"1\"\n (input)=\"inputChanged()\"\n (keydown.enter)=\"sent($event)\"\n></textarea>\n","import { Injectable } from '@angular/core';\nimport transliterate from '@stream-io/transliterate';\n\n/**\n * The `TransliterationService` wraps the [@sindresorhus/transliterate](https://www.npmjs.com/package/@sindresorhus/transliterate) library\n */\n@Injectable({ providedIn: 'root' })\nexport class TransliterationService {\n constructor() {}\n\n /**\n *\n * @param s the string to be transliterated\n * @returns the result of the transliteration\n */\n transliterate(s: string) {\n return transliterate(s);\n }\n}\n","import {\n Component,\n ElementRef,\n EventEmitter,\n HostBinding,\n Input,\n OnChanges,\n Output,\n SimpleChanges,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport { MentionConfig, Mentions } from 'angular-mentions';\nimport {\n MentionAutcompleteListItemContext,\n MentionAutcompleteListItem,\n CommandAutocompleteListItemContext,\n} from '../../types';\n\nimport { BehaviorSubject, Subscription } from 'rxjs';\nimport { UserResponse } from 'stream-chat';\nimport { ChannelService } from '../../channel.service';\nimport { TextareaInterface } from '../textarea.interface';\nimport { ChatClientService } from '../../chat-client.service';\nimport { debounceTime, distinctUntilChanged } from 'rxjs/operators';\nimport { TransliterationService } from '../../transliteration.service';\nimport { EmojiInputService } from '../emoji-input.service';\n\n/**\n * The `AutocompleteTextarea` component is used by the [`MessageInput`](./MessageInputComponent.mdx) component to display the input HTML element where users can type their message.\n */\n@Component({\n selector: 'stream-autocomplete-textarea',\n templateUrl: './autocomplete-textarea.component.html',\n styles: [],\n})\nexport class AutocompleteTextareaComponent\n implements TextareaInterface, OnChanges\n{\n @HostBinding() class = 'str-chat__textarea';\n /**\n * The value of the input HTML element.\n */\n @Input() value = '';\n /**\n * If true, users can mention other users in messages. You can also set this input on the [`MessageInput`](./MessageInputComponent.mdx/#inputs-and-outputs) component.\n */\n @Input() areMentionsEnabled: boolean | undefined = true;\n /**\n * You can provide your own template for the autocomplete list for user mentions. You can also set this input on the [`MessageInput`](./MessageInputComponent.mdx/#inputs-and-outputs) component.\n */\n @Input() mentionAutocompleteItemTemplate:\n | TemplateRef<MentionAutcompleteListItemContext>\n | undefined;\n /**\n * You can provide your own template for the autocomplete list for commands. You can also set this input on the [`MessageInput`](./MessageInputComponent.mdx/#inputs-and-outputs) component.\n */\n @Input() commandAutocompleteItemTemplate:\n | TemplateRef<CommandAutocompleteListItemContext>\n | undefined;\n /**\n * The scope for user mentions, either members of the current channel of members of the application. You can also set this input on the [`MessageInput`](./MessageInputComponent.mdx/#inputs-and-outputs) component.\n */\n @Input() mentionScope: 'channel' | 'application' = 'channel';\n /**\n * Emits the current value of the input element when a user types.\n */\n @Output() readonly valueChange = new EventEmitter<string>();\n /**\n * Emits when a user triggers a message send event (this happens when they hit the `Enter` key).\n */\n @Output() readonly send = new EventEmitter<void>();\n /**\n * Emits the array of users that are mentioned in the message, it is updated when a user mentions a new user or deletes a mention.\n */\n @Output() readonly userMentions = new EventEmitter<UserResponse[]>();\n private readonly autocompleteKey = 'autocompleteLabel';\n private readonly mentionTriggerChar = '@';\n private readonly commandTriggerChar = '/';\n autocompleteConfig: MentionConfig = {\n mentions: [],\n };\n @ViewChild('input') private messageInput!: ElementRef<HTMLInputElement>;\n private subscriptions: Subscription[] = [];\n private mentionedUsers: UserResponse[] = [];\n private userMentionConfig: Mentions = {\n triggerChar: this.mentionTriggerChar,\n dropUp: true,\n labelKey: this.autocompleteKey,\n returnTrigger: true,\n mentionFilter: (\n searchString: string,\n items: { autocompleteLabel: string }[]\n ) => this.filter(searchString, items),\n mentionSelect: (item, triggerChar) =>\n this.itemSelectedFromAutocompleteList(item, triggerChar),\n };\n private slashCommandConfig: Mentions = {\n triggerChar: this.commandTriggerChar,\n dropUp: true,\n labelKey: 'name',\n returnTrigger: true,\n mentionFilter: (\n searchString: string,\n items: { autocompleteLabel: string }[]\n ) => this.filter(searchString, items),\n mentionSelect: (item, triggerChar) =>\n this.itemSelectedFromAutocompleteList(item, triggerChar),\n };\n private searchTerm$ = new BehaviorSubject<string>('');\n\n constructor(\n private channelService: ChannelService,\n private chatClientService: ChatClientService,\n private transliterationService: TransliterationService,\n private emojiInputService: EmojiInputService\n ) {\n this.searchTerm$\n .pipe(debounceTime(300), distinctUntilChanged())\n .subscribe((searchTerm) => {\n if (searchTerm.startsWith(this.mentionTriggerChar)) {\n void this.updateMentionOptions(searchTerm);\n }\n });\n this.subscriptions.push(\n this.channelService.activeChannel$.subscribe((channel) => {\n const commands = channel?.getConfig()?.commands || [];\n this.slashCommandConfig.items = commands.map((c) => ({\n ...c,\n [this.autocompleteKey]: c.name,\n type: 'command',\n }));\n this.mentionedUsers = [];\n this.userMentions.next([...this.mentionedUsers]);\n void this.updateMentionOptions(this.searchTerm$.getValue());\n })\n );\n this.subscriptions.push(\n this.emojiInputService.emojiInput$.subscribe((emoji) => {\n this.messageInput.nativeElement.focus();\n const { selectionStart } = this.messageInput.nativeElement;\n this.messageInput.nativeElement.setRangeText(emoji);\n this.messageInput.nativeElement.selectionStart =\n selectionStart! + emoji.length;\n this.messageInput.nativeElement.selectionEnd =\n selectionStart! + emoji.length;\n this.inputChanged();\n })\n );\n this.autocompleteConfig.mentions = [\n this.userMentionConfig,\n this.slashCommandConfig,\n ];\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.areMentionsEnabled) {\n if (this.areMentionsEnabled) {\n this.autocompleteConfig.mentions = [\n this.userMentionConfig,\n this.slashCommandConfig,\n ];\n this.autocompleteConfig = { ...this.autocompleteConfig };\n } else {\n this.autocompleteConfig.mentions = [this.slashCommandConfig];\n this.autocompleteConfig = { ...this.autocompleteConfig };\n }\n }\n if (changes.mentionScope) {\n void this.updateMentionOptions(this.searchTerm$.getValue());\n }\n }\n\n filter(searchString: string, items: { autocompleteLabel: string }[]) {\n return items.filter((item) =>\n this.transliterate(item.autocompleteLabel.toLowerCase()).includes(\n this.transliterate(searchString.toLowerCase())\n )\n );\n }\n\n itemSelectedFromAutocompleteList(\n item: MentionAutcompleteListItem,\n triggerChar = ''\n ) {\n if (triggerChar === this.mentionTriggerChar) {\n this.mentionedUsers.push((item.user ? item.user : item) as UserResponse);\n this.userMentions.next([...this.mentionedUsers]);\n }\n return (\n triggerChar +\n item.autocompleteLabel +\n (triggerChar === this.commandTriggerChar ? ' ' : '')\n );\n }\n\n autcompleteSearchTermChanged(searchTerm: string) {\n if (searchTerm === this.mentionTriggerChar) {\n void this.updateMentionOptions();\n } else {\n this.searchTerm$.next(searchTerm);\n }\n }\n\n inputChanged() {\n this.valueChange.emit(this.messageInput.nativeElement.value);\n }\n\n inputLeft() {\n this.updateMentionedUsersFromText();\n }\n\n sent(event: Event) {\n event.preventDefault();\n this.updateMentionedUsersFromText();\n this.send.next();\n }\n\n private transliterate(s: string) {\n if (this.transliterationService) {\n return this.transliterationService.transliterate(s);\n } else {\n return s;\n }\n }\n\n private async updateMentionOptions(searchTerm?: string) {\n if (!this.areMentionsEnabled) {\n return;\n }\n searchTerm = searchTerm?.replace(this.mentionTriggerChar, '');\n const request =\n this.mentionScope === 'application'\n ? (s: string) => this.chatClientService.autocompleteUsers(s)\n : (s: string) => this.channelService.autocompleteMembers(s);\n const result = await request(searchTerm || '');\n const items = this.filter(\n searchTerm || '',\n result.map((i) => {\n const user = (i.user ? i.user : i) as UserResponse;\n return {\n ...i,\n autocompleteLabel: user.name || user.id,\n type: 'mention',\n };\n })\n );\n this.userMentionConfig.items = items;\n this.autocompleteConfig.mentions = [\n this.userMentionConfig,\n this.slashCommandConfig,\n ];\n this.autocompleteConfig = { ...this.autocompleteConfig };\n }\n\n private updateMentionedUsersFromText() {\n const updatedMentionedUsers: UserResponse[] = [];\n this.mentionedUsers.forEach((u) => {\n const key = u.name || u.id;\n if (this.value.includes(`${this.mentionTriggerChar}${key}`)) {\n updatedMentionedUsers.push(u);\n }\n });\n if (updatedMentionedUsers.length !== this.mentionedUsers.length) {\n this.userMentions.next([...updatedMentionedUsers]);\n this.mentionedUsers = updatedMentionedUsers;\n }\n }\n}\n","<textarea\n [value]=\"value || ''\"\n autofocus\n data-testid=\"textarea\"\n #input\n placeholder=\"{{ 'streamChat.Type your message' | translate }}\"\n class=\"rta__textarea str-chat__textarea__textarea str-chat__angular-textarea\"\n rows=\"1\"\n (input)=\"inputChanged()\"\n (keydown.enter)=\"sent($event)\"\n [mentionConfig]=\"autocompleteConfig\"\n (searchTerm)=\"autcompleteSearchTermChanged($event)\"\n [mentionListTemplate]=\"autocompleteItem\"\n (blur)=\"inputLeft()\"\n></textarea>\n<ng-template #autocompleteItem let-item=\"item\">\n <div class=\"rta rta__item str-chat__emojisearch__item\" [ngSwitch]=\"item.type\">\n <div class=\"rta__entity\" *ngSwitchCase=\"'mention'\">\n <ng-container\n *ngTemplateOutlet=\"\n mentionAutocompleteItemTemplate || defaultMentionTemplate;\n context: { item: item }\n \"\n ></ng-container>\n </div>\n <div class=\"rta__entity\" *ngSwitchCase=\"'command'\">\n <ng-container\n *ngTemplateOutlet=\"\n commandAutocompleteItemTemplate || defaultCommandTemplate;\n context: { item: item }\n \"\n ></ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #defaultCommandTemplate let-item=\"item\">\n <div class=\"str-chat__slash-command\">\n <span class=\"str-chat__slash-command-header\">\n <strong data-testclass=\"command-name\">{{ item.name }}</strong>\n {{ item.args }}\n </span>\n <br />\n <span class=\"str-chat__slash-command-description\">{{\n item.description\n }}</span>\n </div>\n</ng-template>\n\n<ng-template #defaultMentionTemplate let-item=\"item\">\n <div class=\"str-chat__user-item\">\n <stream-avatar\n data-testclass=\"avatar\"\n class=\"str-chat__avatar str-chat__avatar--circle\"\n style=\"height: 20px\"\n [size]=\"20\"\n [imageUrl]=\"item.image || item.user?.image\"\n [name]=\"item.autocompleteLabel\"\n ></stream-avatar>\n <span data-testclass=\"username\" class=\"str-chat__user-item--name\">{{\n item.autocompleteLabel\n }}</span>\n </div>\n</ng-template>\n","import { StreamMessage } from '../types';\n\nexport type GroupStyle = '' | 'middle' | 'top' | 'bottom' | 'single';\n\nexport const getGroupStyles = (\n message: StreamMessage,\n previousMessage?: StreamMessage,\n nextMessage?: StreamMessage,\n noGroupByUser = false\n): GroupStyle => {\n if (\n noGroupByUser ||\n (message.attachments && message.attachments.length !== 0)\n )\n return 'single';\n\n const isTopMessage =\n !previousMessage ||\n !isOnSameDay(previousMessage.created_at, message.created_at) ||\n previousMessage.type === 'system' ||\n (previousMessage.attachments &&\n previousMessage.attachments?.length !== 0) ||\n message.user?.id !== previousMessage.user?.id ||\n previousMessage.type === 'error' ||\n previousMessage.deleted_at;\n\n const isBottomMessage =\n !nextMessage ||\n !isOnSameDay(message.created_at, nextMessage.created_at) ||\n nextMessage.type === 'system' ||\n (nextMessage.attachments && nextMessage.attachments?.length !== 0) ||\n message.user?.id !== nextMessage.user?.id ||\n nextMessage.type === 'error' ||\n nextMessage.deleted_at;\n\n if (!isTopMessage && !isBottomMessage) {\n if (message.deleted_at || message.type === 'error') return 'single';\n return 'middle';\n }\n\n if (isBottomMessage) {\n if (isTopMessage || message.deleted_at || message.type === 'error')\n return 'single';\n return 'bottom';\n }\n\n if (isTopMessage) return 'top';\n\n return '';\n};\n\nconst isOnSameDay = (date1: Date, date2: Date) => {\n return (\n date1.getFullYear() === date2.getFullYear() &&\n date1.getMonth() === date2.getMonth() &&\n date1.getDate() === date2.getDate()\n );\n};\n","import {\n AfterViewChecked,\n Component,\n ElementRef,\n HostBinding,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n SimpleChanges,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport { ChannelService } from '../channel.service';\nimport { Observable, Subscription } from 'rxjs';\nimport { tap } from 'rxjs/operators';\nimport { DefaultUserType, StreamMessage } from '../types';\nimport { ChatClientService } from '../chat-client.service';\nimport { getGroupStyles, GroupStyle } from './group-styles';\nimport { ImageLoadService } from './image-load.service';\nimport { UserResponse } from 'stream-chat';\n\n/**\n * The `MessageList` component renders a scrollable list of messages.\n */\n@Component({\n selector: 'stream-message-list',\n templateUrl: './message-list.component.html',\n styles: [],\n})\nexport class MessageListComponent\n implements AfterViewChecked, OnChanges, OnInit, OnDestroy\n{\n /**\n * By default, the [default message component](./MessageComponent.mdx) is used. To change the contents of the message, provide [your own custom message template](./MessageComponent.mdx/#customization).\n */\n @Input() messageTemplate: TemplateRef<any> | undefined;\n /**\n * The input used for message edit. By default, the [default message input component](./MessageInputComponent.mdx) is used. To change the input for message edit, provide [your own custom template](./MessageInputComponent.mdx/#customization).\n */\n @Input() messageInputTemplate: TemplateRef<any> | undefined;\n /**\n * The template used to display a mention in a message. It receives the mentioned user in a variable called `user` with the type [`UserResponse`](https://github.com/GetStream/stream-chat-js/blob/master/src/types.ts). You can provide your own template if you want to [add actions to mentions](../code-examples/mention-actions.mdx).\n */\n @Input() mentionTemplate: TemplateRef<any> | undefined;\n /**\n * You can provide your own typing indicator template instead of the default one.\n */\n @Input() typingIndicatorTemplate:\n | TemplateRef<{ usersTyping$: Observable<UserResponse<DefaultUserType>[]> }>\n | undefined;\n /**\n * @deprecated use [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) instead. If true, the message reactions are displayed. Users can also react to messages if they have the necessary [channel capability](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript).\n */\n @Input() areReactionsEnabled: boolean | undefined = undefined;\n /**\n * @deprecated use [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) instead. The list of [actions that are enabled](./MessageActionsBoxComponent.mdx), please note that the user also has to have the necessary [channel capabilities](https://getstream.io/chat/docs/javascript/channel_capabilities/?language=javascript) for actions to work. Unathorized actions won't be displayed on the UI. The `MessgaeList` component makes the necessary checks before passing the actions to the `Message` component.\n */\n /* eslint-disable-next-line @angular-eslint/no-input-rename */\n @Input('enabledMessageActions') enabledMessageActionsInput:\n | string[]\n | undefined = undefined;\n /**\n * Determines if the message list should display channel messages or [thread messages](https://getstream.io/chat/docs/javascript/threads/?language=javascript).\n */\n @Input() mode: 'main' | 'thread' = 'main';\n messages$!: Observable<StreamMessage[]>;\n canReactToMessage: boolean | undefined;\n canReceiveReadEvents: boolean | undefined;\n enabledMessageActions: string[] = [];\n @HostBinding('class') private class =\n 'str-chat-angular__main-panel-inner str-chat-angular__message-list-host';\n unreadMessageCount = 0;\n isUserScrolledUp: boolean | undefined;\n groupStyles: GroupStyle[] = [];\n lastSentMessageId: string | undefined;\n parentMessage: StreamMessage | undefined;\n @ViewChild('scrollContainer')\n private scrollContainer!: ElementRef<HTMLElement>;\n @ViewChild('parentMessageElement')\n private parentMessageElement!: ElementRef<HTMLElement>;\n private latestMessageDate: Date | undefined;\n private hasNewMessages: boolean | undefined;\n private containerHeight: number | undefined;\n private oldestMessageDate: Date | undefined;\n private olderMassagesLoaded: boolean | undefined;\n private isNewMessageSentByUser: boolean | undefined;\n private authorizedMessageActions: string[] = ['flag'];\n private readonly isUserScrolledUpThreshold = 300;\n private subscriptions: Subscription[] = [];\n private prevScrollTop: number | undefined;\n private usersTypingInChannel$!: Observable<UserResponse<DefaultUserType>[]>;\n private usersTypingInThread$!: Observable<UserResponse<DefaultUserType>[]>;\n\n constructor(\n private channelService: ChannelService,\n private chatClientService: ChatClientService,\n private imageLoadService: ImageLoadService\n ) {\n this.subscriptions.push(\n this.channelService.activeChannel$.subscribe((channel) => {\n this.resetScrollState();\n const capabilites = channel?.data?.own_capabilities as string[];\n if (capabilites) {\n this.canReactToMessage = capabilites.indexOf('send-reaction') !== -1;\n this.canReceiveReadEvents = capabilites.indexOf('read-events') !== -1;\n this.authorizedMessageActions = [];\n if (this.canReactToMessage) {\n this.authorizedMessageActions.push('send-reaction');\n }\n if (this.canReceiveReadEvents) {\n this.authorizedMessageActions.push('read-events');\n }\n if (capabilites.indexOf('flag-message') !== -1) {\n this.authorizedMessageActions.push('flag');\n }\n if (capabilites.indexOf('update-own-message') !== -1) {\n this.authorizedMessageActions.push('edit');\n }\n if (capabilites.indexOf('update-any-message') !== -1) {\n this.authorizedMessageActions.push('edit');\n this.authorizedMessageActions.push('edit-any');\n }\n if (capabilites.indexOf('delete-own-message') !== -1) {\n this.authorizedMessageActions.push('delete');\n }\n if (capabilites.indexOf('delete-any-message') !== -1) {\n this.authorizedMessageActions.push('delete');\n this.authorizedMessageActions.push('delete-any');\n }\n if (capabilites.indexOf('send-reply') !== -1) {\n this.authorizedMessageActions.push('send-reply');\n }\n if (capabilites.indexOf('quote-message') !== -1) {\n this.authorizedMessageActions.push('quote-message');\n }\n this.setEnabledActions();\n }\n })\n );\n this.subscriptions.push(\n this.imageLoadService.imageLoad$.subscribe(() => {\n if (!this.isUserScrolledUp) {\n this.scrollToBottom();\n // Hacky and unreliable workaround to scroll down after loaded images move the scrollbar\n setTimeout(() => {\n this.scrollToBottom();\n }, 300);\n }\n })\n );\n this.subscriptions.push(\n this.channelService.activeParentMessage$.subscribe((message) => {\n if (\n message &&\n this.parentMessage &&\n message.id !== this.parentMessage.id &&\n this.mode === 'thread'\n ) {\n this.resetScrollState();\n }\n this.parentMessage = message;\n })\n );\n this.usersTypingInChannel$ = this.channelService.usersTypingInChannel$;\n this.usersTypingInThread$ = this.channelService.usersTypingInThread$;\n }\n\n ngOnInit(): void {\n this.setMessages$();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.enabledMessageActionsInput) {\n this.setEnabledActions();\n }\n if (changes.mode) {\n this.setMessages$();\n }\n }\n\n ngAfterViewChecked() {\n if (this.hasNewMessages) {\n if (!this.isUserScrolledUp || this.isNewMessageSentByUser) {\n this.scrollToBottom();\n // Hacky and unreliable workaround to scroll down after loaded images move the scrollbar\n setTimeout(() => {\n this.scrollToBottom();\n }, 300);\n }\n this.hasNewMessages = false;\n this.containerHeight = this.scrollContainer.nativeElement.scrollHeight;\n } else if (this.olderMassagesLoaded) {\n this.preserveScrollbarPosition();\n this.containerHeight = this.scrollContainer.nativeElement.scrollHeight;\n this.olderMassagesLoaded = false;\n } else if (\n this.containerHeight !== undefined &&\n this.containerHeight < this.scrollContainer.nativeElement.scrollHeight &&\n !this.isUserScrolledUp\n ) {\n this.scrollToBottom();\n this.containerHeight = this.scrollContainer.nativeElement.scrollHeight;\n }\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n get usersTyping$() {\n return this.mode === 'thread'\n ? this.usersTypingInThread$\n : this.usersTypingInChannel$;\n }\n\n trackByMessageId(index: number, item: StreamMessage) {\n return item.id;\n }\n\n trackByUserId(index: number, user: UserResponse) {\n return user.id;\n }\n\n scrollToBottom(): void {\n this.scrollContainer.nativeElement.scrollTop =\n this.scrollContainer.nativeElement.scrollHeight;\n }\n\n scrolled() {\n this.isUserScrolledUp =\n this.scrollContainer.nativeElement.scrollHeight -\n (this.scrollContainer.nativeElement.scrollTop +\n this.scrollContainer.nativeElement.clientHeight) >\n this.isUserScrolledUpThreshold;\n if (!this.isUserScrolledUp) {\n this.unreadMessageCount = 0;\n }\n if (\n this.scrollContainer.nativeElement.scrollTop <=\n (this.parentMessageElement?.nativeElement.clientHeight || 0) &&\n (this.prevScrollTop === undefined ||\n this.prevScrollTop >\n (this.parentMessageElement?.nativeElement.clientHeight || 0))\n ) {\n this.containerHeight = this.scrollContainer.nativeElement.scrollHeight;\n this.mode === 'main'\n ? void this.channelService.loadMoreMessages()\n : void this.channelService.loadMoreThreadReplies();\n }\n this.prevScrollTop = this.scrollContainer.nativeElement.scrollTop;\n }\n\n private preserveScrollbarPosition() {\n this.scrollContainer.nativeElement.scrollTop =\n (this.prevScrollTop || 0) +\n (this.scrollContainer.nativeElement.scrollHeight - this.containerHeight!);\n }\n\n private setEnabledActions() {\n this.enabledMessageActions = [];\n if (!this.enabledMessageActionsInput) {\n this.enabledMessageActions = this.authorizedMessageActions;\n return;\n }\n this.enabledMessageActionsInput = [\n ...this.enabledMessageActionsInput,\n 'send-reaction',\n 'read-events',\n 'send-reply',\n 'quote-message',\n ];\n this.enabledMessageActionsInput.forEach((action) => {\n const isAuthorized = this.authorizedMessageActions.indexOf(action) !== -1;\n if (isAuthorized) {\n this.enabledMessageActions.push(action);\n }\n });\n }\n\n private setMessages$() {\n this.messages$ = (\n this.mode === 'main'\n ? this.channelService.activeChannelMessages$\n : this.channelService.activeThreadMessages$\n ).pipe(\n tap((messages) => {\n if (messages.length === 0) {\n return;\n }\n const currentLatestMessageDate =\n messages[messages.length - 1].created_at;\n if (\n !this.latestMessageDate ||\n this.latestMessageDate?.getTime() < currentLatestMessageDate.getTime()\n ) {\n this.latestMessageDate = currentLatestMessageDate;\n this.hasNewMessages = true;\n this.isNewMessageSentByUser =\n messages[messages.length - 1].user?.id ===\n this.chatClientService.chatClient?.user?.id;\n if (this.isUserScrolledUp) {\n this.unreadMessageCount++;\n }\n }\n const currentOldestMessageDate = messages[0].created_at;\n if (!this.oldestMessageDate) {\n this.oldestMessageDate = currentOldestMessageDate;\n } else if (\n this.oldestMessageDate?.getTime() > currentOldestMessageDate.getTime()\n ) {\n this.oldestMessageDate = currentOldestMessageDate;\n this.olderMassagesLoaded = true;\n }\n }),\n tap((messages) => {\n this.groupStyles = messages.map((m, i) =>\n getGroupStyles(m, messages[i - 1], messages[i + 1])\n );\n }),\n tap(\n (messages) =>\n (this.lastSentMessageId = [...messages]\n .reverse()\n .find(\n (m) =>\n m.user?.id === this.chatClientService.chatClient?.user?.id &&\n m.status !== 'sending'\n )?.id)\n )\n );\n }\n\n private resetScrollState() {\n this.latestMessageDate = undefined;\n this.hasNewMessages = true;\n this.isUserScrolledUp = false;\n this.containerHeight = undefined;\n this.olderMassagesLoaded = false;\n this.oldestMessageDate = undefined;\n this.unreadMessageCount = 0;\n this.prevScrollTop = undefined;\n this.isNewMessageSentByUser = undefined;\n }\n}\n","<div\n #scrollContainer\n data-testid=\"scroll-container\"\n class=\"str-chat__list\"\n (scroll)=\"scrolled()\"\n>\n <div class=\"str-chat__reverse-infinite-scroll\">\n <ul class=\"str-chat__ul\">\n <li\n #parentMessageElement\n *ngIf=\"mode === 'thread'\"\n data-testid=\"parent-message\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplateContainer;\n context: { message: parentMessage }\n \"\n ></ng-container>\n <div class=\"str-chat__thread-start\" translate>\n streamChat.Start of a new thread\n </div>\n </li>\n <li\n data-testclass=\"message\"\n *ngFor=\"\n let message of messages$ | async;\n let i = index;\n trackBy: trackByMessageId\n \"\n class=\"str-chat__li str-chat__li--{{ groupStyles[i] }}\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplateContainer;\n context: { message: message }\n \"\n ></ng-container>\n </li>\n </ul>\n <ng-container *ngIf=\"typingIndicatorTemplate; else defaultTypingIndicator\">\n <ng-container\n *ngTemplateOutlet=\"\n typingIndicatorTemplate;\n context: { usersTyping$: usersTyping$ }\n \"\n ></ng-container>\n </ng-container>\n <ng-template #defaultTypingIndicator>\n <div\n *ngIf=\"(usersTyping$ | async)?.length\"\n data-testid=\"typing-indicator\"\n class=\"str-chat__typing-indicator str-chat__typing-indicator--typing\"\n >\n <stream-avatar\n *ngFor=\"let user of usersTyping$ | async; trackBy: trackByUserId\"\n [name]=\"user.name || user.id\"\n [imageUrl]=\"user.image\"\n ></stream-avatar>\n <div class=\"str-chat__typing-indicator__dots\">\n <span class=\"str-chat__typing-indicator__dot\"></span>\n <span class=\"str-chat__typing-indicator__dot\"></span>\n <span class=\"str-chat__typing-indicator__dot\"></span>\n </div>\n </div>\n </ng-template>\n </div>\n</div>\n<div class=\"str-chat__list-notifications\">\n <button\n data-testid=\"scroll-to-bottom\"\n *ngIf=\"isUserScrolledUp\"\n class=\"\n str-chat__message-notification\n str-chat__message-notification-right\n str-chat__message-notification-scroll-down\n \"\n (keyup.enter)=\"scrollToBottom()\"\n (click)=\"scrollToBottom()\"\n >\n <div\n *ngIf=\"unreadMessageCount > 0\"\n class=\"\n str-chat__message-notification\n str-chat__message-notification-scroll-down-unread-count\n \"\n >\n {{ unreadMessageCount }}\n </div>\n </button>\n</div>\n\n<ng-template #messageTemplateContainer let-message=\"message\">\n <ng-container *ngIf=\"messageTemplate; else defaultMessageTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n messageTemplate;\n context: {\n message: message,\n areReactionsEnabled: areReactionsEnabled,\n canReactToMessage: canReactToMessage,\n lastSentMessageId: !!(\n lastSentMessageId && message?.id === lastSentMessageId\n ),\n canReceiveReadEvents: canReceiveReadEvents,\n messageInputTemplate: messageInputTemplate,\n mentionTemplate: mentionTemplate,\n mode: mode\n }\n \"\n ></ng-container>\n </ng-container>\n <ng-template #defaultMessageTemplate>\n <stream-message\n [message]=\"message\"\n [areReactionsEnabled]=\"areReactionsEnabled\"\n [canReactToMessage]=\"canReactToMessage\"\n [isLastSentMessage]=\"\n !!(lastSentMessageId && message?.id === lastSentMessageId)\n \"\n [enabledMessageActions]=\"enabledMessageActions\"\n [canReceiveReadEvents]=\"canReceiveReadEvents\"\n [messageInputTemplate]=\"messageInputTemplate\"\n [mentionTemplate]=\"mentionTemplate\"\n [mode]=\"mode\"\n ></stream-message>\n </ng-template>\n</ng-template>\n","import { Component, HostBinding, OnDestroy } from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { ChannelService } from '../channel.service';\nimport { StreamMessage } from '../types';\n\n/**\n * The `Thread` component represents a [message thread](https://getstream.io/chat/docs/javascript/threads/?language=javascript), it is a container component that displays a thread with a header, [`MessageList`](./MessageListComponent.mdx) and [`MessageInput`](./MessageInputComponent.mdx) components.\n */\n@Component({\n selector: 'stream-thread',\n templateUrl: './thread.component.html',\n styles: [],\n})\nexport class ThreadComponent implements OnDestroy {\n @HostBinding('class') private class = 'str-chat__thread';\n parentMessage: StreamMessage | undefined;\n private subscriptions: Subscription[] = [];\n\n constructor(private channelService: ChannelService) {\n this.subscriptions.push(\n this.channelService.activeParentMessage$.subscribe(\n (parentMessage) => (this.parentMessage = parentMessage)\n )\n );\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((s) => s.unsubscribe());\n }\n\n get replyCountParam() {\n return { replyCount: this.parentMessage?.reply_count };\n }\n\n closeThread() {\n void this.channelService.setAsActiveParentMessage(undefined);\n }\n}\n","<div class=\"str-chat__thread-header\">\n <div class=\"str-chat__thread-header-details\">\n <strong translate>streamChat.Thread</strong>\n <small data-testid=\"reply-count\">\n {{parentMessage?.reply_count === 1 ? ('streamChat.1 reply' | translate) : ('streamChat.{{ replyCount }}\n replies' | translate:replyCountParam)}}\n </small>\n </div>\n <button\n class=\"str-chat__square-button\"\n data-testid=\"close-button\"\n (click)=\"closeThread()\"\n >\n <stream-icon icon=\"close-no-outline\"></stream-icon>\n </button>\n</div>\n<ng-content select='[name=\"thread-message-list\"]'></ng-content>\n<div class=\"str-chat__small-message-input__wrapper\">\n <ng-content select='[name=\"thread-message-input\"]'></ng-content>\n</div>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { AvatarComponent } from './avatar/avatar.component';\nimport { TranslateModule } from '@ngx-translate/core';\n\n@NgModule({\n declarations: [AvatarComponent],\n imports: [CommonModule, TranslateModule],\n exports: [AvatarComponent],\n})\nexport class StreamAvatarModule {}\n","import { NgModule } from '@angular/core';\nimport { ChannelComponent } from './channel/channel.component';\nimport { ChannelHeaderComponent } from './channel-header/channel-header.component';\nimport { ChannelListComponent } from './channel-list/channel-list.component';\nimport { ChannelPreviewComponent } from './channel-preview/channel-preview.component';\nimport { MessageComponent } from './message/message.component';\nimport { MessageInputComponent } from './message-input/message-input.component';\nimport { MessageListComponent } from './message-list/message-list.component';\nimport { CommonModule } from '@angular/common';\nimport { LoadingIndicatorComponent } from './loading-indicator/loading-indicator.component';\nimport { IconComponent } from './icon/icon.component';\nimport { MessageActionsBoxComponent } from './message-actions-box/message-actions-box.component';\nimport { AttachmentListComponent } from './attachment-list/attachment-list.component';\nimport { MessageReactionsComponent } from './message-reactions/message-reactions.component';\nimport { NotificationComponent } from './notification/notification.component';\nimport { NotificationListComponent } from './notification-list/notification-list.component';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { AttachmentPreviewListComponent } from './attachment-preview-list/attachment-preview-list.component';\nimport { ModalComponent } from './modal/modal.component';\nimport { TextareaDirective } from './message-input/textarea.directive';\nimport { StreamAvatarModule } from './stream-avatar.module';\nimport { ThreadComponent } from './thread/thread.component';\n\n@NgModule({\n declarations: [\n ChannelComponent,\n ChannelHeaderComponent,\n ChannelListComponent,\n ChannelPreviewComponent,\n MessageComponent,\n MessageInputComponent,\n MessageListComponent,\n LoadingIndicatorComponent,\n IconComponent,\n MessageActionsBoxComponent,\n AttachmentListComponent,\n MessageReactionsComponent,\n NotificationComponent,\n NotificationListComponent,\n AttachmentPreviewListComponent,\n ModalComponent,\n TextareaDirective,\n ThreadComponent,\n ],\n imports: [CommonModule, TranslateModule, StreamAvatarModule],\n exports: [\n ChannelComponent,\n ChannelHeaderComponent,\n ChannelListComponent,\n ChannelPreviewComponent,\n MessageComponent,\n MessageInputComponent,\n MessageListComponent,\n LoadingIndicatorComponent,\n IconComponent,\n MessageActionsBoxComponent,\n AttachmentListComponent,\n MessageReactionsComponent,\n NotificationComponent,\n NotificationListComponent,\n AttachmentPreviewListComponent,\n ModalComponent,\n StreamAvatarModule,\n ThreadComponent,\n ],\n})\nexport class StreamChatModule {}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { AutocompleteTextareaComponent } from './message-input/autocomplete-textarea/autocomplete-textarea.component';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { MentionModule } from 'angular-mentions';\nimport { StreamAvatarModule } from './stream-avatar.module';\nimport { textareaInjectionToken } from './injection-tokens';\n\n@NgModule({\n declarations: [AutocompleteTextareaComponent],\n imports: [CommonModule, TranslateModule, MentionModule, StreamAvatarModule],\n exports: [AutocompleteTextareaComponent],\n providers: [\n {\n provide: textareaInjectionToken,\n useValue: AutocompleteTextareaComponent,\n },\n ],\n})\nexport class StreamAutocompleteTextareaModule {}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { TextareaComponent } from './message-input/textarea/textarea.component';\nimport { textareaInjectionToken } from './injection-tokens';\n\n@NgModule({\n declarations: [TextareaComponent],\n imports: [CommonModule, TranslateModule],\n exports: [TextareaComponent],\n providers: [\n {\n provide: textareaInjectionToken,\n useValue: TextareaComponent,\n },\n ],\n})\nexport class StreamTextareaModule {}\n","/*\n * Public API Surface of stream-chat-angular\n */\n\nexport * from './lib/chat-client.service';\nexport * from './lib/channel.service';\nexport * from './lib/theme.service';\nexport * from './lib/attachment.service';\nexport * from './lib/stream-i18n.service';\nexport * from './lib/avatar/avatar.component';\nexport * from './lib/icon/icon.component';\nexport * from './lib/loading-indicator/loading-indicator.component';\nexport * from './lib/message-actions-box/message-actions-box.component';\nexport * from './lib/channel/channel.component';\nexport * from './lib/channel-header/channel-header.component';\nexport * from './lib/channel-preview/channel-preview.component';\nexport * from './lib/channel-list/channel-list.component';\nexport * from './lib/channel-list/channel-list-toggle.service';\nexport * from './lib/message/message.component';\nexport * from './lib/message/parse-date';\nexport * from './lib/message/read-by-text';\nexport * from './lib/message-input/message-input.component';\nexport * from './lib/message-input/textarea/textarea.component';\nexport * from './lib/message-input/autocomplete-textarea/autocomplete-textarea.component';\nexport * from './lib/message-input/message-input-config.service';\nexport * from './lib/message-input/textarea.directive';\nexport * from './lib/message-input/textarea.interface';\nexport * from './lib/message-input/emoji-input.service';\nexport * from './lib/message-list/message-list.component';\nexport * from './lib/message-list/image-load.service';\nexport * from './lib/message-list/group-styles';\nexport * from './lib/attachment-list/attachment-list.component';\nexport * from './lib/attachment-preview-list/attachment-preview-list.component';\nexport * from './lib/message-reactions/message-reactions.component';\nexport * from './lib/notification/notification.component';\nexport * from './lib/notification-list/notification-list.component';\nexport * from './lib/thread/thread.component';\nexport * from './lib/modal/modal.component';\nexport * from './lib/read-by';\nexport * from './lib/is-image-attachment';\nexport * from './lib/is-image-file';\nexport * from './lib/device-width';\nexport * from './lib/message-preview';\nexport * from './lib/notification.service';\nexport * from './lib/transliteration.service';\nexport * from './lib/stream-chat.module';\nexport * from './lib/stream-avatar.module';\nexport * from './lib/stream-autocomplete-textarea.module';\nexport * from './lib/stream-textarea.module';\nexport * from './lib/injection-tokens';\nexport * from './lib/types';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["uuidv4"],"mappings":";;;;;;;;;;;;;;;;;;;AAAO,M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