![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /opt/mattermost/client/ |
Upload File : |
{"version":3,"file":"6532.5ef83817a6c9c2f38d7d.js","mappings":"6oBAwBe,SAASA,EAAYC,GAChC,MAAM,cAACC,EAAa,OAAEC,EAAM,OAAEC,GAAUH,GAClC,GACFI,EACAC,UAAWC,EACXC,OAAQC,GAAQ,EAChBC,oBAAqBC,GACrBR,EAEES,GAAcC,EAAAA,EAAAA,IAAyBV,GAE7C,IAAIW,EAA6BF,EAuBjC,OAtBIT,EAAOE,KAAOH,EACdY,EACIC,IAAAA,cAACC,EAAAA,iBAAgB,CACbX,GAAG,yCACHY,eAAe,sBACfC,OAAQ,CACJC,YAAaP,KAIlBT,EAAOG,YACdQ,EACIC,IAAAA,cAACC,EAAAA,iBAAgB,CACbX,GAAG,iDACHY,eAAe,8BACfC,OAAQ,CACJC,YAAaP,MAOzBG,IAAAA,cAAAA,IAAAA,SAAA,KACIA,IAAAA,cAACK,EAAAA,EAAc,CACXC,IAAKC,EAAAA,GAAQC,qBAAqBlB,EAAIM,GACtCP,OAASG,GAAaE,OAAiBe,EAATpB,EAC9BqB,KAAK,OAETV,IAAAA,cAAA,OAAKW,UAAU,uBACXX,IAAAA,cAAA,OAAKW,UAAU,oBACVZ,EACAL,GAASM,IAAAA,cAACY,EAAAA,EAAM,OAChBC,EAAAA,EAAAA,G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ACvBU,aACA5B,QACA+F,wBACA1O,gBACA4N,wBACAhF,WAAmC,QAAzBmI,EAAEY,EAAME,yBAAiB,IAAAd,EAAAA,EAAI,EAC1C,CACJ,EAqBL,IAAetO,EAAAA,EAAAA,SAAQmO,IAlBvB,SAA4B/K,GACxB,MAAO,CACH+F,SAASkG,EAAAA,EAAAA,oBAAmB,CACxBjE,YAAW,KACXG,kBAAiB,KACjBlC,0BAAyB,IACzBD,mBAAkB,KAClB4D,4BAA2B,KAC3BC,6BAA4B,KAC5BtC,0BAAyB,KACzBE,0BAAyB,KACzBgC,eAAc,IACdE,oBAAmB,KACnBzD,mBAAkBA,EAAAA,IACnBlG,GAEX,GAEA,CAAgEwF,G","sources":["webpack://mattermost-webapp/./src/components/more_direct_channels/list_item/user_details/user_details.tsx","webpack://mattermost-webapp/./src/components/more_direct_channels/list_item/user_details/index.ts","webpack://mattermost-webapp/./src/components/more_direct_channels/types.ts","webpack://mattermost-webapp/./src/components/more_direct_channels/list_item/list_item.tsx","webpack://mattermost-webapp/./src/components/more_direct_channels/list_item/index.ts","webpack://mattermost-webapp/./src/components/more_direct_channels/list/list.tsx","webpack://mattermost-webapp/./src/components/more_direct_channels/list/index.ts","webpack://mattermost-webapp/./src/components/more_direct_channels/more_direct_channels.tsx","webpack://mattermost-webapp/./src/components/more_direct_channels/index.ts"],"sourcesContent":["// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React from 'react';\nimport {FormattedMessage} from 'react-intl';\n\nimport type {UserProfile} from '@mattermost/types/users';\n\nimport {Client4} from 'mattermost-redux/client';\nimport {isGuest} from 'mattermost-redux/utils/user_utils';\n\nimport CustomStatusEmoji from 'components/custom_status/custom_status_emoji';\nimport ProfilePicture from 'components/profile_picture';\nimport BotTag from 'components/widgets/tag/bot_tag';\nimport GuestTag from 'components/widgets/tag/guest_tag';\n\nimport {displayEntireNameForUser} from 'utils/utils';\n\ntype Props = {\n currentUserId: string;\n option: UserProfile;\n status: string;\n};\n\nexport default function UserDetails(props: Props): JSX.Element {\n const {currentUserId, option, status} = props;\n const {\n id,\n delete_at: deleteAt,\n is_bot: isBot = false,\n last_picture_update: lastPictureUpdate,\n } = option;\n\n const displayName = displayEntireNameForUser(option);\n\n let modalName: React.ReactNode = displayName;\n if (option.id === currentUserId) {\n modalName = (\n <FormattedMessage\n id='more_direct_channels.directchannel.you'\n defaultMessage='{displayname} (you)'\n values={{\n displayname: displayName,\n }}\n />\n );\n } else if (option.delete_at) {\n modalName = (\n <FormattedMessage\n id='more_direct_channels.directchannel.deactivated'\n defaultMessage='{displayname} - Deactivated'\n values={{\n displayname: displayName,\n }}\n />\n );\n }\n\n return (\n <>\n <ProfilePicture\n src={Client4.getProfilePictureUrl(id, lastPictureUpdate)}\n status={!deleteAt && !isBot ? status : undefined}\n size='md'\n />\n <div className='more-modal__details'>\n <div className='more-modal__name'>\n {modalName}\n {isBot && <BotTag/>}\n {isGuest(option.roles) && <GuestTag/>}\n <CustomStatusEmoji\n userID={option.id}\n showTooltip={true}\n emojiSize={15}\n spanStyle={{\n display: 'flex',\n flex: '0 0 auto',\n alignItems: 'center',\n }}\n />\n </div>\n {!isBot && (\n <div className='more-modal__description'>\n {option.email}\n </div>\n )}\n </div>\n </>\n );\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {connect} from 'react-redux';\n\nimport type {UserProfile} from '@mattermost/types/users';\n\nimport {getCurrentUserId, getStatusForUserId} from 'mattermost-redux/selectors/entities/users';\n\nimport type {GlobalState} from 'types/store';\n\nimport UserDetails from './user_details';\n\ntype OwnProps = {\n option: UserProfile;\n}\n\nfunction mapStateToProps(state: GlobalState, ownProps: OwnProps) {\n return {\n currentUserId: getCurrentUserId(state),\n status: getStatusForUserId(state, ownProps.option.id),\n };\n}\n\nexport default connect(mapStateToProps)(UserDetails);\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport type {Channel} from '@mattermost/types/channels';\nimport type {UserProfile} from '@mattermost/types/users';\n\nimport type {Value} from 'components/multiselect/multiselect';\n\n// Not to be confused with the GroupChannel type used for LDAP groups\nexport type GroupChannel = Channel & {\n profiles: UserProfile[];\n}\n\nexport function isGroupChannel(option: UserProfile | GroupChannel): option is GroupChannel {\n return (option as GroupChannel)?.type === 'G';\n}\n\nexport type Option = (UserProfile & {last_post_at?: number}) | GroupChannel;\n\nexport type OptionValue = Option & Value;\n\nexport function optionValue(option: Option): OptionValue {\n return {\n value: option.id,\n label: isGroupChannel(option) ? option.display_name : option.username,\n ...option,\n };\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport classNames from 'classnames';\nimport React, {useCallback} from 'react';\n\nimport Timestamp from 'components/timestamp';\n\nimport UserDetails from './user_details';\n\nimport {isGroupChannel} from '../types';\nimport type {\n GroupChannel,\n OptionValue,\n} from '../types';\n\nconst TIME_SPEC: React.ComponentProps<typeof Timestamp> = {\n useTime: false,\n style: 'long',\n ranges: [\n {within: ['minute', -1], display: ['second', 0]},\n {within: ['hour', -1], display: ['minute']},\n {within: ['hour', -24], display: ['hour']},\n {within: ['day', -30], display: ['day']},\n {within: ['month', -11], display: ['month']},\n {within: ['year', -1000], display: ['year']},\n ],\n};\n\nexport type Props = {\n option: OptionValue;\n isMobileView: boolean;\n isSelected: boolean;\n add: (value: OptionValue) => void;\n select: (value: OptionValue) => void;\n}\n\nconst ListItem = React.forwardRef((props: Props, ref?: React.Ref<HTMLDivElement>) => {\n const {\n option,\n isMobileView,\n isSelected,\n add,\n select,\n } = props;\n\n const {last_post_at: lastPostAt} = option;\n\n let details;\n if (isGroupChannel(option)) {\n details = <GMDetails option={option}/>;\n } else {\n details = <UserDetails option={option}/>;\n }\n\n const handleClick = useCallback(() => add(option), [option, add]);\n const handleMouseEnter = useCallback(() => select(option), [option, select]);\n\n return (\n <div\n ref={ref}\n className={classNames('more-modal__row clickable', {'more-modal__row--selected': isSelected})}\n onClick={handleClick}\n onMouseEnter={handleMouseEnter}\n >\n {details}\n\n {isMobileView && Boolean(lastPostAt) &&\n <div className='more-modal__lastPostAt'>\n <Timestamp\n {...TIME_SPEC}\n value={lastPostAt}\n />\n </div>\n }\n\n <div className='more-modal__actions'>\n <div className='more-modal__actions--round'>\n <i className='icon icon-plus'/>\n </div>\n </div>\n </div>\n );\n});\nListItem.displayName = 'ListItem';\n\nexport default ListItem;\n\nfunction GMDetails(props: {option: GroupChannel}) {\n const {option} = props;\n\n return (\n <>\n <div className='more-modal__gm-icon'>\n {option.profiles.length}\n </div>\n <div className='more-modal__details'>\n <div className='more-modal__name'>\n <span>\n {option.profiles.map((profile) => `@${profile.username}`).join(', ')}\n </span>\n </div>\n </div>\n </>\n );\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {connect} from 'react-redux';\n\nimport {getIsMobileView} from 'selectors/views/browser';\n\nimport type {GlobalState} from 'types/store';\n\nimport ListItem from './list_item';\n\nfunction mapStateToProps(state: GlobalState) {\n return {\n isMobileView: getIsMobileView(state),\n };\n}\n\nexport default connect(mapStateToProps)(ListItem);\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React, {useCallback, useMemo} from 'react';\nimport {FormattedMessage, useIntl} from 'react-intl';\nimport {useDispatch} from 'react-redux';\n\nimport type {UserProfile} from '@mattermost/types/users';\n\nimport {openModal} from 'actions/views/modals';\n\nimport MultiSelect from 'components/multiselect/multiselect';\nimport NewChannelModal from 'components/new_channel_modal/new_channel_modal';\n\nimport Constants, {ModalIdentifiers} from 'utils/constants';\n\nimport ListItem from '../list_item';\nimport {optionValue} from '../types';\nimport type {Option, OptionValue} from '../types';\n\nconst MAX_SELECTABLE_VALUES = Constants.MAX_USERS_IN_GM - 1;\nexport const USERS_PER_PAGE = 50;\n\ntype Props = {\n addValue: (value: OptionValue) => void;\n currentUserId: string;\n handleDelete: (values: OptionValue[]) => void;\n handlePageChange: (page: number, prevPage: number) => void;\n handleSubmit: (values?: OptionValue[]) => void;\n handleHide: () => void;\n isExistingChannel: boolean;\n loading: boolean;\n options: Option[];\n saving: boolean;\n search: (term: string) => void;\n selectedItemRef: React.RefObject<HTMLDivElement>;\n totalCount: number;\n users: UserProfile[];\n\n /**\n * An array of values that have been selected by the user in the multiselect.\n */\n values: OptionValue[];\n}\n\nconst List = React.forwardRef((props: Props, ref?: React.Ref<MultiSelect<OptionValue>>) => {\n const renderOptionValue = useCallback((\n option: OptionValue,\n isSelected: boolean,\n add: (value: OptionValue) => void,\n select: (value: OptionValue) => void,\n ) => {\n return (\n <ListItem\n ref={isSelected ? props.selectedItemRef : undefined}\n key={'more_direct_channels_list_' + option.value}\n option={option}\n isSelected={isSelected}\n add={add}\n select={select}\n />\n );\n }, [props.selectedItemRef]);\n\n const dispatch = useDispatch();\n\n const handleSubmitImmediatelyOn = useCallback((value: OptionValue) => {\n return value.id === props.currentUserId || Boolean(value.delete_at);\n }, [props.currentUserId]);\n\n const handleCreateChannel = (e: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => {\n e.preventDefault();\n props.handleHide();\n dispatch(openModal({modalId: ModalIdentifiers.NEW_CHANNEL_MODAL, dialogType: NewChannelModal}));\n };\n\n const intl = useIntl();\n\n let note;\n if (props.isExistingChannel) {\n if (props.values.length >= MAX_SELECTABLE_VALUES) {\n note = (\n <FormattedMessage\n id='more_direct_channels.new_convo_note.full'\n defaultMessage={'You\\'ve reached the maximum number of people for this conversation. Consider creating a private channel instead.'}\n />\n );\n } else {\n note = (\n <FormattedMessage\n id='more_direct_channels.new_convo_note'\n defaultMessage={'This will start a new conversation. If you\\'re adding a lot of people, consider creating a private channel instead.'}\n />\n );\n }\n }\n\n let remainingText;\n if (MAX_SELECTABLE_VALUES > props.values.length) {\n remainingText = (\n <FormattedMessage\n id={'multiselect.numPeopleRemaining'}\n defaultMessage={'Use ↑↓ to browse, ↵ to select. You can add {num, number} more {num, plural, one {person} other {people}}. '}\n values={{\n num: MAX_SELECTABLE_VALUES - props.values.length,\n }}\n />\n );\n } else {\n remainingText = (\n <FormattedMessage\n id={'multiselect.maxPeople'}\n defaultMessage={'Use ↑↓ to browse, ↵ to select. You can\\'t add more than {num} people. Please <a>create a channel</a> to include more people.'}\n values={{\n num: MAX_SELECTABLE_VALUES,\n a: (chunks: React.ReactNode) => {\n return (\n <a\n href='#'\n onClick={(e) => handleCreateChannel(e)}\n >{chunks}</a>\n );\n },\n }}\n />\n );\n }\n\n const options = useMemo(() => {\n return props.options.map(optionValue);\n }, [props.options]);\n\n return (\n <MultiSelect<OptionValue>\n ref={ref}\n options={options}\n optionRenderer={renderOptionValue}\n intl={intl}\n selectedItemRef={props.selectedItemRef}\n values={props.values}\n valueRenderer={renderValue}\n ariaLabelRenderer={renderAriaLabel}\n perPage={USERS_PER_PAGE}\n handlePageChange={props.handlePageChange}\n handleInput={props.search}\n handleDelete={props.handleDelete}\n handleAdd={props.addValue}\n handleSubmit={props.handleSubmit}\n noteText={note}\n maxValues={MAX_SELECTABLE_VALUES}\n numRemainingText={remainingText}\n buttonSubmitText={\n <FormattedMessage\n id='multiselect.go'\n defaultMessage='Go'\n />\n }\n buttonSubmitLoadingText={\n <FormattedMessage\n id='multiselect.loading'\n defaultMessage='Loading...'\n />\n }\n submitImmediatelyOn={handleSubmitImmediatelyOn}\n saving={props.saving}\n loading={props.loading}\n users={props.users}\n totalCount={props.totalCount}\n placeholderText={intl.formatMessage({id: 'multiselect.placeholder', defaultMessage: 'Search and add members'})}\n />\n );\n});\n\nexport default List;\n\nfunction renderValue(props: {data: OptionValue}) {\n return (props.data as UserProfile).username;\n}\n\nfunction renderAriaLabel(option: OptionValue) {\n return (option as UserProfile)?.username ?? '';\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {connect} from 'react-redux';\n\nimport type {UserProfile} from '@mattermost/types/users';\n\nimport {createSelector} from 'mattermost-redux/selectors/create_selector';\nimport {getAllChannels, getChannelsWithUserProfiles} from 'mattermost-redux/selectors/entities/channels';\nimport {getCurrentUserId} from 'mattermost-redux/selectors/entities/users';\nimport {getUserIdFromChannelName} from 'mattermost-redux/utils/channel_utils';\nimport {filterProfilesStartingWithTerm} from 'mattermost-redux/utils/user_utils';\n\nimport Constants from 'utils/constants';\n\nimport type {GlobalState} from 'types/store';\n\nimport List from './list';\n\nimport type {Option, OptionValue} from '../types';\n\ntype OwnProps = {\n users: UserProfile[];\n values: OptionValue[];\n}\n\nexport function makeGetOptions(): (state: GlobalState, users: UserProfile[], values: OptionValue[]) => Option[] {\n // Gets all loaded DMs (as UserProfiles)\n const getUsersWithDMs = createSelector(\n 'getUsersWithDMs',\n getCurrentUserId,\n getAllChannels,\n (state: GlobalState, users: UserProfile[]) => users,\n (currentUserId, allChannels, users) => {\n const directChannels = Object.values(allChannels).filter((channel) => channel.type === Constants.DM_CHANNEL);\n\n // Gets all loaded DMs (as UserProfiles)\n const usersWithDMs: Array<UserProfile & {last_post_at: number}> = [];\n for (const channel of directChannels) {\n const otherUserId = getUserIdFromChannelName(currentUserId, channel.name);\n const otherUser = users.find((user) => user.id === otherUserId);\n\n if (!otherUser) {\n // The user doesn't match the search filter\n continue;\n }\n\n if (channel.last_post_at === 0) {\n // The DM channel exists but has no messages in it\n continue;\n }\n\n usersWithDMs.push({\n ...otherUser,\n last_post_at: channel.last_post_at,\n });\n }\n\n return usersWithDMs;\n },\n );\n\n // Gets GM channels matching the search term and selected values\n const getFilteredGroupChannels = createSelector(\n 'getFilteredGroupChannels',\n getChannelsWithUserProfiles,\n (state: GlobalState) => state.views.search.modalSearch,\n (state: GlobalState, values: OptionValue[]) => values,\n (channelsWithProfiles, searchTerm, values) => {\n return channelsWithProfiles.filter((channel) => {\n if (searchTerm) {\n // Check that at least one of the users in the channel matches the search term\n const matches = filterProfilesStartingWithTerm(channel.profiles, searchTerm);\n if (matches.length === 0) {\n return false;\n }\n }\n\n if (values) {\n // Check that all of the selected users are in the channel\n const valuesInProfiles = values.every((value) => channel.profiles.find((user) => user.id === value.id));\n if (!valuesInProfiles) {\n return false;\n }\n }\n\n // Only include GM channels with messages in them\n return channel.last_post_at > 0;\n });\n },\n );\n\n return createSelector(\n 'makeGetOptions',\n getUsersWithDMs,\n (state: GlobalState, users: UserProfile[], values: OptionValue[]) => getFilteredGroupChannels(state, values),\n (state: GlobalState, users: UserProfile[]) => users,\n (state: GlobalState) => Boolean(state.views.search.modalSearch),\n (usersWithDMs, filteredGroupChannels, users, isSearch) => {\n // Recent DMs (as UserProfiles) and GMs sorted by recent activity\n const recents = [...usersWithDMs, ...filteredGroupChannels].\n sort((a, b) => b.last_post_at - a.last_post_at);\n\n // Only show the 20 most recent DMs and GMs when no search term has been entered. If a search term has been\n // entered, `users` is expected to have already been filtered by it\n if (!isSearch && recents.length > 0) {\n return recents.slice(0, 20);\n }\n\n // Other users sorted by whether or not they've been deactivated followed by alphabetically\n const usersWithoutDMs = users.\n filter((user) => user.delete_at === 0 && !usersWithDMs.some((other) => other.id === user.id)).\n map((user) => ({...user, last_post_at: 0}));\n usersWithoutDMs.sort((a, b) => {\n return a.username.localeCompare(b.username);\n });\n\n // Returns an array containing:\n // 1. All recent DMs (represented by UserProfiles) and GMs matching the filter\n // - GMs are also filtered to only show ones containing each selected user\n // 2. Other non-deactivated users sorted by username\n return [\n ...recents,\n ...usersWithoutDMs,\n ];\n },\n );\n}\n\nfunction makeMapStateToProps() {\n const getOptions = makeGetOptions();\n\n return (state: GlobalState, ownProps: OwnProps) => {\n return {\n options: getOptions(state, ownProps.users, ownProps.values),\n };\n };\n}\n\nexport default connect(makeMapStateToProps)(List);\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport debounce from 'lodash/debounce';\nimport React from 'react';\nimport {Modal} from 'react-bootstrap';\nimport {FormattedMessage} from 'react-intl';\n\nimport type {Channel} from '@mattermost/types/channels';\nimport type {UserProfile} from '@mattermost/types/users';\n\nimport type {ActionResult} from 'mattermost-redux/types/actions';\n\nimport type MultiSelect from 'components/multiselect/multiselect';\n\nimport {getHistory} from 'utils/browser_history';\nimport Constants from 'utils/constants';\n\nimport List from './list';\nimport {USERS_PER_PAGE} from './list/list';\nimport {\n isGroupChannel,\n optionValue,\n} from './types';\nimport type {\n OptionValue} from './types';\n\nexport type Props = {\n currentUserId: string;\n currentTeamId?: string;\n currentTeamName?: string;\n searchTerm: string;\n users: UserProfile[];\n totalCount: number;\n\n /*\n * List of current channel members of existing channel\n */\n currentChannelMembers?: UserProfile[];\n\n /*\n * Whether the modal is for existing channel or not\n */\n isExistingChannel: boolean;\n\n /*\n * The mode by which direct messages are restricted, if at all.\n */\n restrictDirectMessage?: string;\n onModalDismissed?: () => void;\n onExited?: () => void;\n actions: {\n getProfiles: (page?: number | undefined, perPage?: number | undefined, options?: any) => Promise<ActionResult>;\n getProfilesInTeam: (teamId: string, page: number, perPage?: number | undefined, sort?: string | undefined, options?: any) => Promise<ActionResult>;\n loadProfilesMissingStatus: (users: UserProfile[]) => void;\n getTotalUsersStats: () => void;\n loadStatusesForProfilesList: (users: UserProfile[]) => void;\n loadProfilesForGroupChannels: (groupChannels: Channel[]) => void;\n openDirectChannelToUserId: (userId: string) => Promise<ActionResult>;\n openGroupChannelToUserIds: (userIds: string[]) => Promise<ActionResult>;\n searchProfiles: (term: string, options: any) => Promise<ActionResult<UserProfile[]>>;\n searchGroupChannels: (term: string) => Promise<ActionResult<Channel[]>>;\n setModalSearchTerm: (term: string) => void;\n };\n}\n\ntype State = {\n values: OptionValue[];\n show: boolean;\n search: boolean;\n saving: boolean;\n loadingUsers: boolean;\n}\n\nexport default class MoreDirectChannels extends React.PureComponent<Props, State> {\n searchTimeoutId: any;\n exitToChannel?: string;\n multiselect: React.RefObject<MultiSelect<OptionValue>>;\n selectedItemRef: React.RefObject<HTMLDivElement>;\n constructor(props: Props) {\n super(props);\n\n this.searchTimeoutId = 0;\n this.multiselect = React.createRef();\n this.selectedItemRef = React.createRef();\n\n const values: OptionValue[] = [];\n\n if (props.currentChannelMembers) {\n for (let i = 0; i < props.currentChannelMembers.length; i++) {\n const user = Object.assign({}, props.currentChannelMembers[i]);\n\n if (user.id === props.currentUserId) {\n continue;\n }\n\n values.push(optionValue(user));\n }\n }\n\n this.state = {\n values,\n show: true,\n search: false,\n saving: false,\n loadingUsers: true,\n };\n }\n\n loadModalData = () => {\n this.getUserProfiles();\n this.props.actions.getTotalUsersStats();\n this.props.actions.loadProfilesMissingStatus(this.props.users);\n };\n\n updateFromProps(prevProps: Props) {\n if (prevProps.searchTerm !== this.props.searchTerm) {\n clearTimeout(this.searchTimeoutId);\n\n const searchTerm = this.props.searchTerm;\n if (searchTerm === '') {\n this.resetPaging();\n } else {\n const teamId = this.props.restrictDirectMessage === 'any' ? '' : this.props.currentTeamId;\n\n this.searchTimeoutId = setTimeout(\n async () => {\n this.setUsersLoadingState(true);\n const [{data: profilesData}, {data: groupChannelsData}] = await Promise.all([\n this.props.actions.searchProfiles(searchTerm, {team_id: teamId}),\n this.props.actions.searchGroupChannels(searchTerm),\n ]);\n if (profilesData) {\n this.props.actions.loadStatusesForProfilesList(profilesData);\n }\n if (groupChannelsData) {\n this.props.actions.loadProfilesForGroupChannels(groupChannelsData);\n }\n this.resetPaging();\n this.setUsersLoadingState(false);\n },\n Constants.SEARCH_TIMEOUT_MILLISECONDS,\n );\n }\n }\n\n if (\n prevProps.users.length !== this.props.users.length\n ) {\n this.props.actions.loadProfilesMissingStatus(this.props.users);\n }\n }\n\n componentDidUpdate(prevProps: Props) {\n this.updateFromProps(prevProps);\n }\n\n handleHide = () => {\n this.props.actions.setModalSearchTerm('');\n this.setState({show: false});\n };\n\n setUsersLoadingState = (loadingState: boolean) => {\n this.setState({\n loadingUsers: loadingState,\n });\n };\n\n handleExit = () => {\n if (this.exitToChannel) {\n getHistory().push(this.exitToChannel);\n }\n\n this.props.onModalDismissed?.();\n this.props.onExited?.();\n };\n\n handleSubmit = (values = this.state.values) => {\n const {actions} = this.props;\n if (this.state.saving) {\n return;\n }\n\n const userIds = values.map((v) => v.id);\n if (userIds.length === 0) {\n return;\n }\n\n this.setState({saving: true});\n\n const done = (result: any) => {\n const {data, error} = result;\n this.setState({saving: false});\n\n if (!error) {\n this.exitToChannel = '/' + this.props.currentTeamName + '/channels/' + data.name;\n this.handleHide();\n }\n };\n\n if (userIds.length === 1) {\n actions.openDirectChannelToUserId(userIds[0]).then(done);\n } else {\n actions.openGroupChannelToUserIds(userIds).then(done);\n }\n };\n\n addValue = (value: OptionValue) => {\n if (isGroupChannel(value)) {\n this.addUsers(value.profiles);\n } else {\n const values = Object.assign([], this.state.values);\n\n if (values.indexOf(value) === -1) {\n values.push(value);\n }\n\n this.setState({values});\n }\n };\n\n addUsers = (users: UserProfile[]) => {\n const values: OptionValue[] = Object.assign([], this.state.values);\n const existingUserIds = values.map((user) => user.id);\n for (const user of users) {\n if (existingUserIds.indexOf(user.id) !== -1) {\n continue;\n }\n values.push(optionValue(user));\n }\n\n this.setState({values});\n };\n\n getUserProfiles = (page?: number) => {\n const pageNum = page ? page + 1 : 0;\n if (this.props.restrictDirectMessage === 'any') {\n this.props.actions.getProfiles(pageNum, USERS_PER_PAGE * 2).then(() => {\n this.setUsersLoadingState(false);\n });\n } else {\n this.props.actions.getProfilesInTeam(this.props.currentTeamId || '', pageNum, USERS_PER_PAGE * 2).then(() => {\n this.setUsersLoadingState(false);\n });\n }\n };\n\n handlePageChange = (page: number, prevPage: number) => {\n if (page > prevPage) {\n this.setUsersLoadingState(true);\n this.getUserProfiles(page);\n }\n };\n\n resetPaging = () => {\n this.multiselect.current?.resetPaging();\n };\n\n search = debounce((term: string) => {\n this.props.actions.setModalSearchTerm(term);\n }, 250);\n\n handleDelete = (values: OptionValue[]) => {\n this.setState({values});\n };\n\n render() {\n const body = (\n <List\n addValue={this.addValue}\n currentUserId={this.props.currentUserId}\n handleDelete={this.handleDelete}\n handlePageChange={this.handlePageChange}\n handleSubmit={this.handleSubmit}\n handleHide={this.handleHide}\n isExistingChannel={this.props.isExistingChannel}\n loading={this.state.loadingUsers}\n saving={this.state.saving}\n search={this.search}\n selectedItemRef={this.selectedItemRef}\n totalCount={this.props.totalCount}\n users={this.props.users}\n values={this.state.values}\n />\n );\n\n return (\n <Modal\n dialogClassName='a11y__modal more-modal more-direct-channels'\n show={this.state.show}\n onHide={this.handleHide}\n onExited={this.handleExit}\n onEntered={this.loadModalData}\n role='none'\n aria-labelledby='moreDmModalLabel'\n id='moreDmModal'\n >\n <Modal.Header closeButton={true}>\n <Modal.Title\n componentClass='h1'\n id='moreDmModalLabel'\n >\n <FormattedMessage\n id='more_direct_channels.title'\n defaultMessage='Direct Messages'\n />\n </Modal.Title>\n </Modal.Header>\n <Modal.Body\n role='application'\n >\n {body}\n </Modal.Body>\n <Modal.Footer className='modal-footer--invisible'>\n <button\n id='closeModalButton'\n type='button'\n className='btn btn-tertiary'\n >\n <FormattedMessage\n id='general_button.close'\n defaultMessage='Close'\n />\n </button>\n </Modal.Footer>\n </Modal>\n );\n }\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {connect} from 'react-redux';\nimport {bindActionCreators} from 'redux';\nimport type {Dispatch} from 'redux';\n\nimport type {UserProfile} from '@mattermost/types/users';\n\nimport {searchGroupChannels} from 'mattermost-redux/actions/channels';\nimport {\n getProfiles,\n getProfilesInTeam,\n getTotalUsersStats,\n searchProfiles,\n} from 'mattermost-redux/actions/users';\nimport {getConfig, getFeatureFlagValue} from 'mattermost-redux/selectors/entities/general';\nimport {getCurrentTeam} from 'mattermost-redux/selectors/entities/teams';\nimport {\n getCurrentUserId,\n getProfiles as selectProfiles,\n getProfilesInCurrentChannel,\n getProfilesInCurrentTeam,\n makeSearchProfilesStartingWithTerm,\n searchProfilesInCurrentTeam,\n getTotalUsersStats as getTotalUsersStatsSelector,\n} from 'mattermost-redux/selectors/entities/users';\n\nimport {openDirectChannelToUserId, openGroupChannelToUserIds} from 'actions/channel_actions';\nimport {loadStatusesForProfilesList, loadProfilesMissingStatus} from 'actions/status_actions';\nimport {loadProfilesForGroupChannels} from 'actions/user_actions';\nimport {setModalSearchTerm} from 'actions/views/search';\n\nimport type {GlobalState} from 'types/store';\n\nimport MoreDirectChannels from './more_direct_channels';\n\ntype OwnProps = {\n isExistingChannel: boolean;\n}\n\nexport const makeMapStateToProps = () => {\n const searchProfilesStartingWithTerm = makeSearchProfilesStartingWithTerm();\n\n return (state: GlobalState, ownProps: OwnProps) => {\n const currentUserId = getCurrentUserId(state);\n let currentChannelMembers;\n if (ownProps.isExistingChannel) {\n currentChannelMembers = getProfilesInCurrentChannel(state);\n }\n\n const config = getConfig(state);\n const restrictDirectMessage = config.RestrictDirectMessage;\n\n const searchTerm = state.views.search.modalSearch;\n\n let filters;\n const enableSharedChannelsDMs = getFeatureFlagValue(state, 'EnableSharedChannelsDMs') === 'true';\n if (!enableSharedChannelsDMs) {\n filters = {exclude_remote: true};\n }\n\n let users: UserProfile[];\n if (searchTerm) {\n if (restrictDirectMessage === 'any') {\n users = searchProfilesStartingWithTerm(state, searchTerm, false, filters);\n } else {\n users = searchProfilesInCurrentTeam(state, searchTerm, false, filters);\n }\n } else if (restrictDirectMessage === 'any') {\n users = selectProfiles(state, filters);\n } else {\n users = getProfilesInCurrentTeam(state, filters);\n }\n\n const team = getCurrentTeam(state);\n const stats = getTotalUsersStatsSelector(state) || {total_users_count: 0};\n\n return {\n currentTeamId: team?.id,\n currentTeamName: team?.name,\n searchTerm,\n users,\n currentChannelMembers,\n currentUserId,\n restrictDirectMessage,\n totalCount: stats.total_users_count ?? 0,\n };\n };\n};\n\nfunction mapDispatchToProps(dispatch: Dispatch) {\n return {\n actions: bindActionCreators({\n getProfiles,\n getProfilesInTeam,\n loadProfilesMissingStatus,\n getTotalUsersStats,\n loadStatusesForProfilesList,\n loadProfilesForGroupChannels,\n openDirectChannelToUserId,\n openGroupChannelToUserIds,\n searchProfiles,\n searchGroupChannels,\n setModalSearchTerm,\n }, dispatch),\n };\n}\n\nexport default connect(makeMapStateToProps, mapDispatchToProps)(MoreDirectChannels);\n"],"names":["UserDetails","props","currentUserId","option","status","id","delete_at","deleteAt","is_bot","isBot","last_picture_update","lastPictureUpdate","displayName","displayEntireNameForUser","modalName","React","FormattedMessage","defaultMessage","values","displayname","ProfilePicture","src","Client4","getProfilePictureUrl","undefined","size","className","BotTag","isGuest","roles","GuestTag","CustomStatusEmoji","userID","showTooltip","emojiSize","spanStyle","display","flex","alignItems","email","propTypes","_pt","isRequired","connect","state","ownProps","getCurrentUserId","getStatusForUserId","isGroupChannel","type","optionValue","_objectSpread","value","label","display_name","username","TIME_SPEC","useTime","style","ranges","within","ListItem","ref","isMobileView","isSelected","add","select","last_post_at","lastPostAt","details","GMDetails","handleClick","useCallback","handleMouseEnter","classNames","onClick","onMouseEnter","Boolean","Timestamp","Object","assign","profiles","length","map","profile","concat","join","getIsMobileView","MAX_SELECTABLE_VALUES","Constants","MAX_USERS_IN_GM","List","renderOptionValue","selectedItemRef","key","dispatch","useDispatch","handleSubmitImmediatelyOn","intl","useIntl","note","remainingText","isExistingChannel","num","a","chunks","href","e","preventDefault","handleHide","openModal","modalId","ModalIdentifiers","NEW_CHANNEL_MODAL","dialogType","NewChannelModal","handleCreateChannel","options","useMemo","MultiSelect","optionRenderer","valueRenderer","renderValue","ariaLabelRenderer","renderAriaLabel","perPage","handlePageChange","handleInput","search","handleDelete","handleAdd","addValue","handleSubmit","noteText","maxValues","numRemainingText","buttonSubmitText","buttonSubmitLoadingText","submitImmediatelyOn","saving","loading","users","totalCount","placeholderText","formatMessage","data","_username","getOptions","getUsersWithDMs","createSelector","getAllChannels","allChannels","directChannels","filter","channel","DM_CHANNEL","usersWithDMs","otherUserId","getUserIdFromChannelName","name","otherUser","find","user","push","getFilteredGroupChannels","getChannelsWithUserProfiles","views","modalSearch","channelsWithProfiles","searchTerm","filterProfilesStartingWithTerm","every","filteredGroupChannels","isSearch","recents","sort","b","slice","usersWithoutDMs","some","other","localeCompare","makeGetOptions","MoreDirectChannels","constructor","_this","super","this","_defineProperty","getUserProfiles","actions","getTotalUsersStats","loadProfilesMissingStatus","setModalSearchTerm","setState","show","loadingState","loadingUsers","_this$props$onModalDi","_this$props","_this$props$onExited","_this$props2","exitToChannel","getHistory","onModalDismissed","call","onExited","arguments","userIds","v","done","result","error","currentTeamName","openDirectChannelToUserId","then","openGroupChannelToUserIds","addUsers","indexOf","existingUserIds","page","pageNum","restrictDirectMessage","getProfiles","USERS_PER_PAGE","setUsersLoadingState","getProfilesInTeam","currentTeamId","prevPage","_this$multiselect$cur","multiselect","current","resetPaging","debounce","term","searchTimeoutId","currentChannelMembers","i","updateFromProps","prevProps","clearTimeout","teamId","setTimeout","async","profilesData","groupChannelsData","Promise","all","searchProfiles","team_id","searchGroupChannels","loadStatusesForProfilesList","loadProfilesForGroupChannels","SEARCH_TIMEOUT_MILLISECONDS","componentDidUpdate","render","body","Modal","dialogClassName","onHide","handleExit","onEntered","loadModalData","role","Header","closeButton","Title","componentClass","Body","Footer","makeMapStateToProps","searchProfilesStartingWithTerm","makeSearchProfilesStartingWithTerm","_stats$total_users_co","getProfilesInCurrentChannel","getConfig","RestrictDirectMessage","filters","getFeatureFlagValue","exclude_remote","searchProfilesInCurrentTeam","selectProfiles","getProfilesInCurrentTeam","team","getCurrentTeam","stats","getTotalUsersStatsSelector","total_users_count","bindActionCreators"],"sourceRoot":""}