isometrik-plugin-chat-sdk 1.0.0
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.
- package/LICENSE +21 -0
- package/dist/cjs/BlockChatList-720a703e.js +423 -0
- package/dist/cjs/BlockChatList-720a703e.js.map +1 -0
- package/dist/cjs/DocumentMessageBubble-c79bfbe5.js +493 -0
- package/dist/cjs/DocumentMessageBubble-c79bfbe5.js.map +1 -0
- package/dist/cjs/Image-67c52acd.js +135 -0
- package/dist/cjs/Image-67c52acd.js.map +1 -0
- package/dist/cjs/ImageMessageBubble-1218fb66.js +675 -0
- package/dist/cjs/ImageMessageBubble-1218fb66.js.map +1 -0
- package/dist/cjs/IsometrikLogo-976b1c34.js +44 -0
- package/dist/cjs/IsometrikLogo-976b1c34.js.map +1 -0
- package/dist/cjs/MessageSearch-5fc9dc00.js +5892 -0
- package/dist/cjs/MessageSearch-5fc9dc00.js.map +1 -0
- package/dist/cjs/ReactionsContainer-a6ce9059.js +375 -0
- package/dist/cjs/ReactionsContainer-a6ce9059.js.map +1 -0
- package/dist/cjs/Text-fedf6eab.js +60 -0
- package/dist/cjs/Text-fedf6eab.js.map +1 -0
- package/dist/cjs/VideoMessageBubble-c4694a78.js +571 -0
- package/dist/cjs/VideoMessageBubble-c4694a78.js.map +1 -0
- package/dist/cjs/WebChat-403e7ab1.js +2884 -0
- package/dist/cjs/WebChat-403e7ab1.js.map +1 -0
- package/dist/cjs/app-globals-3a1e7e63.js +7 -0
- package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
- package/dist/cjs/audio-bubble_8.cjs.entry.js +21011 -0
- package/dist/cjs/audio-bubble_8.cjs.entry.js.map +1 -0
- package/dist/cjs/block-chat-list.cjs.entry.js +16 -0
- package/dist/cjs/block-chat-list.cjs.entry.js.map +1 -0
- package/dist/cjs/chat-app.cjs.entry.js +55 -0
- package/dist/cjs/chat-app.cjs.entry.js.map +1 -0
- package/dist/cjs/chat-assets-6ab1faa6.js +9 -0
- package/dist/cjs/chat-assets-6ab1faa6.js.map +1 -0
- package/dist/cjs/chat-creds-f4cbf400.js +38 -0
- package/dist/cjs/chat-creds-f4cbf400.js.map +1 -0
- package/dist/cjs/chat-document-message-bubble.cjs.entry.js +24 -0
- package/dist/cjs/chat-document-message-bubble.cjs.entry.js.map +1 -0
- package/dist/cjs/chat-image-message-bubble.cjs.entry.js +26 -0
- package/dist/cjs/chat-image-message-bubble.cjs.entry.js.map +1 -0
- package/dist/cjs/chat-video-message-bubble.cjs.entry.js +24 -0
- package/dist/cjs/chat-video-message-bubble.cjs.entry.js.map +1 -0
- package/dist/cjs/content-eca5336c.js +81 -0
- package/dist/cjs/content-eca5336c.js.map +1 -0
- package/dist/cjs/dialog-drawer-9d04911c.js +5313 -0
- package/dist/cjs/dialog-drawer-9d04911c.js.map +1 -0
- package/dist/cjs/forward-memebers.cjs.entry.js +128 -0
- package/dist/cjs/forward-memebers.cjs.entry.js.map +1 -0
- package/dist/cjs/group-members-a60fb1cb.js +41 -0
- package/dist/cjs/group-members-a60fb1cb.js.map +1 -0
- package/dist/cjs/groupcast-49dae5ab.js +202 -0
- package/dist/cjs/groupcast-49dae5ab.js.map +1 -0
- package/dist/cjs/imagePlaceholder-030cc566.js +4365 -0
- package/dist/cjs/imagePlaceholder-030cc566.js.map +1 -0
- package/dist/cjs/index-9afe62b6.js +3129 -0
- package/dist/cjs/index-9afe62b6.js.map +1 -0
- package/dist/cjs/index.cjs.js +148 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/isometrik-webchat.cjs.js +54 -0
- package/dist/cjs/isometrik-webchat.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +17 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/login-page.cjs.entry.js +85 -0
- package/dist/cjs/login-page.cjs.entry.js.map +1 -0
- package/dist/cjs/member-add.cjs.entry.js +122 -0
- package/dist/cjs/member-add.cjs.entry.js.map +1 -0
- package/dist/cjs/message-reaction-976f6261.js +24 -0
- package/dist/cjs/message-reaction-976f6261.js.map +1 -0
- package/dist/cjs/my-component.cjs.entry.js +29 -0
- package/dist/cjs/my-component.cjs.entry.js.map +1 -0
- package/dist/cjs/reaction-container.cjs.entry.js +52 -0
- package/dist/cjs/reaction-container.cjs.entry.js.map +1 -0
- package/dist/cjs/shadow-css-7c4dbc43.js +336 -0
- package/dist/cjs/shadow-css-7c4dbc43.js.map +1 -0
- package/dist/cjs/signup-page.cjs.entry.js +143 -0
- package/dist/cjs/signup-page.cjs.entry.js.map +1 -0
- package/dist/cjs/taguser-aca04ed9.js +512 -0
- package/dist/cjs/taguser-aca04ed9.js.map +1 -0
- package/dist/cjs/theme-provider_2.cjs.entry.js +113 -0
- package/dist/cjs/theme-provider_2.cjs.entry.js.map +1 -0
- package/dist/cjs/toast-helper-defae4a5.js +84 -0
- package/dist/cjs/toast-helper-defae4a5.js.map +1 -0
- package/dist/cjs/utils-bcad3386.js +9 -0
- package/dist/cjs/utils-bcad3386.js.map +1 -0
- package/dist/collection/api/conversations.js +12 -0
- package/dist/collection/api/group-members.js +36 -0
- package/dist/collection/api/groupcast.js +183 -0
- package/dist/collection/api/membership-control.js +13 -0
- package/dist/collection/api/message-reaction.js +16 -0
- package/dist/collection/api/social-accounts.js +282 -0
- package/dist/collection/app-root.js +51 -0
- package/dist/collection/app-root.js.map +1 -0
- package/dist/collection/assets/images/avatar.svg +1 -0
- package/dist/collection/assets/images/chatdefaultbg.svg +6140 -0
- package/dist/collection/assets/images/equalizer.svg +1 -0
- package/dist/collection/assets/images/imagePlaceholder.svg +2 -0
- package/dist/collection/assets/images/link.svg +1 -0
- package/dist/collection/assets/images/videoPlaceholder.svg +4 -0
- package/dist/collection/assets/images/videoThumbnail.svg +1 -0
- package/dist/collection/assets/svg/ExcelDocument.js +2 -0
- package/dist/collection/assets/svg/IsometrikLogo.js +38 -0
- package/dist/collection/assets/svg/Moon.svg +1 -0
- package/dist/collection/assets/svg/NoChatPlaceholder.js +16 -0
- package/dist/collection/assets/svg/NoContactsPlaceholder.js +9 -0
- package/dist/collection/assets/svg/NoMessagePlaceholder.svg +13 -0
- package/dist/collection/assets/svg/PdfDocument.js +2 -0
- package/dist/collection/assets/svg/ProfilePlaceholder.js +1 -0
- package/dist/collection/assets/svg/SelectChatPlaceholder.js +13 -0
- package/dist/collection/assets/svg/Sun.svg +1 -0
- package/dist/collection/assets/svg/broadcast-selected.svg +4 -0
- package/dist/collection/assets/svg/broadcst-default.svg +4 -0
- package/dist/collection/assets/svg/close.svg +1 -0
- package/dist/collection/assets/svg/group.svg +7 -0
- package/dist/collection/assets/svg/login.svg +3051 -0
- package/dist/collection/assets/svg/message-add.svg +5 -0
- package/dist/collection/assets/svg/message-bold.svg +3 -0
- package/dist/collection/assets/svg/message-outline.svg +5 -0
- package/dist/collection/collection-manifest.json +32 -0
- package/dist/collection/components/ChatUIComponent/AddMember.js +144 -0
- package/dist/collection/components/ChatUIComponent/AddMember.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/AudioBubble.js +528 -0
- package/dist/collection/components/ChatUIComponent/AudioBubble.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/BlockChatList.js +114 -0
- package/dist/collection/components/ChatUIComponent/BlockChatList.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/ChatDocumentMessageBubble.js +11 -0
- package/dist/collection/components/ChatUIComponent/ChatDocumentMessageBubble.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/ChatImageMessageBubble.js +11 -0
- package/dist/collection/components/ChatUIComponent/ChatImageMessageBubble.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/ChatOwnProfile/Profile.js +540 -0
- package/dist/collection/components/ChatUIComponent/ChatOwnProfile/Profile.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/ChatOwnProfile/profile-page.css +252 -0
- package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js +1175 -0
- package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/ChatVideoMessageBubble.js +11 -0
- package/dist/collection/components/ChatUIComponent/ChatVideoMessageBubble.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js +790 -0
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/ForwardMessageList.js +152 -0
- package/dist/collection/components/ChatUIComponent/ForwardMessageList.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/GroupCast.js +218 -0
- package/dist/collection/components/ChatUIComponent/GroupCast.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/Header/WebChatHeader.js +590 -0
- package/dist/collection/components/ChatUIComponent/Header/WebChatHeader.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/ReactionContainer.js +103 -0
- package/dist/collection/components/ChatUIComponent/ReactionContainer.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js +1352 -0
- package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/WebChatBody/web-chat-body.css +277 -0
- package/dist/collection/components/Login.js +118 -0
- package/dist/collection/components/Login.js.map +1 -0
- package/dist/collection/components/Signup.js +177 -0
- package/dist/collection/components/Signup.js.map +1 -0
- package/dist/collection/components/chat-main.js +131 -0
- package/dist/collection/components/chat-main.js.map +1 -0
- package/dist/collection/components/my-component/my-component.css +3 -0
- package/dist/collection/components/my-component/my-component.js +83 -0
- package/dist/collection/components/my-component/my-component.js.map +1 -0
- package/dist/collection/components/my-component/web-chat/WebChat.js +2686 -0
- package/dist/collection/components/my-component/web-chat/WebChat.js.map +1 -0
- package/dist/collection/components/my-component/web-chat/WebchatRightSide.js +675 -0
- package/dist/collection/components/my-component/web-chat/WebchatRightSide.js.map +1 -0
- package/dist/collection/components/my-component/web-chat/web-chat.css +336 -0
- package/dist/collection/components/theme-provider.js +182 -0
- package/dist/collection/components/theme-provider.js.map +1 -0
- package/dist/collection/constants/chat-assets.js +12 -0
- package/dist/collection/constants/chat-creds.js +31 -0
- package/dist/collection/constants/content.js +75 -0
- package/dist/collection/constants/urls.js +1 -0
- package/dist/collection/index.js +135 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/lib/helpers.js +205 -0
- package/dist/collection/lib/taguser.js +123 -0
- package/dist/collection/store/conversation.js +25 -0
- package/dist/collection/store/conversation.js.map +1 -0
- package/dist/collection/store/group-members.js +24 -0
- package/dist/collection/store/group-members.js.map +1 -0
- package/dist/collection/store/unread-count.js +18 -0
- package/dist/collection/store/unread-count.js.map +1 -0
- package/dist/collection/stories/Components/ActionsPopup/ActionsPopup.js +222 -0
- package/dist/collection/stories/Components/ActionsPopup/ActionsPopup.stories.js +148 -0
- package/dist/collection/stories/Components/AttachmentBox/AttachmentBox.js +211 -0
- package/dist/collection/stories/Components/AttachmentBox/AttachmentPreview/AttachmentPreview.js +708 -0
- package/dist/collection/stories/Components/AttachmentBox/AttachmentPreview/AttachmentPreview.stories.js +57 -0
- package/dist/collection/stories/Components/AttachmentBox/Attachmentbox.stories.js +74 -0
- package/dist/collection/stories/Components/AttachmentBox/CameraPreview.js +231 -0
- package/dist/collection/stories/Components/BlockUsers/BlockUsers.js +337 -0
- package/dist/collection/stories/Components/Body/Body.js +48 -0
- package/dist/collection/stories/Components/Body/Body.stories.js +33 -0
- package/dist/collection/stories/Components/Buttons/Buttons.js +65 -0
- package/dist/collection/stories/Components/Buttons/Buttons.stories.js +132 -0
- package/dist/collection/stories/Components/ChatSidebar/ChatSidebar.js +951 -0
- package/dist/collection/stories/Components/ChatSidebar/ChatSidebar.stories.js +75 -0
- package/dist/collection/stories/Components/ChatSidebar/ContextMenu.js +109 -0
- package/dist/collection/stories/Components/ChatTile/ChatTile.js +290 -0
- package/dist/collection/stories/Components/ChatTile/ChatTile.stories.js +180 -0
- package/dist/collection/stories/Components/Chip/Chip.js +111 -0
- package/dist/collection/stories/Components/Chip/Chip.stories.js +149 -0
- package/dist/collection/stories/Components/ContactInfo/ContactInfo.js +1491 -0
- package/dist/collection/stories/Components/ContactInfo/ContactInfo.stories.js +118 -0
- package/dist/collection/stories/Components/ContactInfo/MediaList.js +147 -0
- package/dist/collection/stories/Components/ContactInfo/ProfileInfo.js +1219 -0
- package/dist/collection/stories/Components/ContactTile/ContactTile.js +416 -0
- package/dist/collection/stories/Components/ContactTile/ContactTile.stories.js +60 -0
- package/dist/collection/stories/Components/Dialog-Drawer/confirm.js +113 -0
- package/dist/collection/stories/Components/Dialog-Drawer/deletemessage.js +97 -0
- package/dist/collection/stories/Components/Dialog-Drawer/dialog-drawer.js +264 -0
- package/dist/collection/stories/Components/EmojiReactions/EmojiReactions.js +179 -0
- package/dist/collection/stories/Components/Footer/Footer.js +4 -0
- package/dist/collection/stories/Components/Footer/Footer.stories.js +155 -0
- package/dist/collection/stories/Components/ForwardMessage/ForwardMessageContainer.js +433 -0
- package/dist/collection/stories/Components/ForwardMessage/ForwardMessageContainer.stories.js +110 -0
- package/dist/collection/stories/Components/ForwardMessage/ForwardUi.js +46 -0
- package/dist/collection/stories/Components/GroupChatContacts/GroupChatContacts.js +546 -0
- package/dist/collection/stories/Components/GroupChatContacts/GroupChatContacts.stories.js +56 -0
- package/dist/collection/stories/Components/GroupInfo/GroupInfo.js +394 -0
- package/dist/collection/stories/Components/GroupInfo/GroupInfo.stories.js +107 -0
- package/dist/collection/stories/Components/Head/ClosedHeader/ClosedHead.js +129 -0
- package/dist/collection/stories/Components/Head/ClosedHeader/ClosedHead.stories.js +78 -0
- package/dist/collection/stories/Components/Head/Head.js +672 -0
- package/dist/collection/stories/Components/Head/Head.stories.js +91 -0
- package/dist/collection/stories/Components/Icon/Icon.js +115 -0
- package/dist/collection/stories/Components/Image/Image.js +41 -0
- package/dist/collection/stories/Components/Image/Image.stories.js +49 -0
- package/dist/collection/stories/Components/Image/Img.stories.js +178 -0
- package/dist/collection/stories/Components/Inputbox/Input.js +206 -0
- package/dist/collection/stories/Components/Inputbox/Input.stories.js +87 -0
- package/dist/collection/stories/Components/InstagramAccounts/InstagramAccountsPanel.js +605 -0
- package/dist/collection/stories/Components/Loader/Spinner/Spinner.js +60 -0
- package/dist/collection/stories/Components/Loader/Spinner/Spinner.stories.js +38 -0
- package/dist/collection/stories/Components/MainPlaceHolder/MainChatPlaceHolder.js +78 -0
- package/dist/collection/stories/Components/MainPlaceHolder/MainPlaceHolder.stories.js +130 -0
- package/dist/collection/stories/Components/MediaGallery/MediaGallery.js +868 -0
- package/dist/collection/stories/Components/MediaGallery/MediaGallery.stories.js +81 -0
- package/dist/collection/stories/Components/MembersList/MembersList.js +348 -0
- package/dist/collection/stories/Components/MessageBubble/AudioMessageBubble/AudioMesaageBubble.js +533 -0
- package/dist/collection/stories/Components/MessageBubble/DocumentMessageBubble/DocumentMessageBubble.js +484 -0
- package/dist/collection/stories/Components/MessageBubble/DocumentMessageBubble/DocumentMessageBubble.stories.js +54 -0
- package/dist/collection/stories/Components/MessageBubble/ImageMessageBubble/ImageMessageBubble.js +683 -0
- package/dist/collection/stories/Components/MessageBubble/ImageMessageBubble/ImageMessageBubble.stories.js +49 -0
- package/dist/collection/stories/Components/MessageBubble/IncomingTextMessageBubble/IncomingTextMessageBubble.js +450 -0
- package/dist/collection/stories/Components/MessageBubble/IncomingTextMessageBubble/IncomingTextMessageBubble.stories.js +56 -0
- package/dist/collection/stories/Components/MessageBubble/LinkMessageBubble/LinkMessageBubble.js +721 -0
- package/dist/collection/stories/Components/MessageBubble/OutgoingTextMessageBubble/OutgoingTextMessageBubble.js +139 -0
- package/dist/collection/stories/Components/MessageBubble/OutgoingTextMessageBubble/OutgoingTextMessageBubble.stories.js +63 -0
- package/dist/collection/stories/Components/MessageBubble/VideoMessageBubble/VideoMessageBubble.js +576 -0
- package/dist/collection/stories/Components/MessageBubble/VideoMessageBubble/VideoMessageBubble.stories.js +50 -0
- package/dist/collection/stories/Components/MessageDatePill/MessageDatePill.js +66 -0
- package/dist/collection/stories/Components/MessageDatePill/MessageDatePill.stories.js +48 -0
- package/dist/collection/stories/Components/MessageInfo/MessageInfo.js +465 -0
- package/dist/collection/stories/Components/MessageInfo/MessageInfo.stories.js +111 -0
- package/dist/collection/stories/Components/MessageSearch/MessageSearch.js +242 -0
- package/dist/collection/stories/Components/MessageSearchBar/SearchBar.js +523 -0
- package/dist/collection/stories/Components/MessageSearchBar/SearchBar.stories.js +98 -0
- package/dist/collection/stories/Components/MessageUnreadCount/MessageUnreadCount.js +51 -0
- package/dist/collection/stories/Components/MessageUnreadCount/MessageUnreadCount.stories.js +79 -0
- package/dist/collection/stories/Components/NewChatSidebar/NewChatSidebar.js +560 -0
- package/dist/collection/stories/Components/NewChatSidebar/NewChatSidebar.stories.js +56 -0
- package/dist/collection/stories/Components/Placeholder/NoContactsPlaceholder.js +57 -0
- package/dist/collection/stories/Components/Popup/ConfirmationPopup/DeleteConfirmationPopup/DeletePopup.js +114 -0
- package/dist/collection/stories/Components/ProfileSidebar/ProfileSidebar.js +166 -0
- package/dist/collection/stories/Components/ProfileSidebar/ProfileSidebar.stories.js +125 -0
- package/dist/collection/stories/Components/ProfileTab/ProfileTab.js +939 -0
- package/dist/collection/stories/Components/ProfileTab/ProfileTab.stories.js +144 -0
- package/dist/collection/stories/Components/ReactionsContainer/ReactionsContainer.js +166 -0
- package/dist/collection/stories/Components/ReactionsContainer/ReactionsContainer.stories.js +115 -0
- package/dist/collection/stories/Components/ReactionsContainer/ReactionsInfoCard/ReactionsInfoCard.js +98 -0
- package/dist/collection/stories/Components/ReactionsContainer/ReactionsInfoCard/ReactionsInfoCard.stories.js +55 -0
- package/dist/collection/stories/Components/ReadMark/BlueReadMark/BlueReadMark.js +27 -0
- package/dist/collection/stories/Components/ReadMark/BlueReadMark/BlueReadMark.stories.js +28 -0
- package/dist/collection/stories/Components/ReadMark/ClockMark/ClockMark.js +26 -0
- package/dist/collection/stories/Components/ReadMark/ClockMark/ClockMark.stories.js +33 -0
- package/dist/collection/stories/Components/ReadMark/DoubleMark/DoubleMark.js +27 -0
- package/dist/collection/stories/Components/ReadMark/DoubleMark/DoubleMark.stories.js +28 -0
- package/dist/collection/stories/Components/ReadMark/SingleMark/SingleMark.js +38 -0
- package/dist/collection/stories/Components/ReadMark/SingleMark/SingleMark.stories.js +33 -0
- package/dist/collection/stories/Components/ReplyBlock/MediaIcons.js +16 -0
- package/dist/collection/stories/Components/ReplyBlock/ReplyBlock.js +196 -0
- package/dist/collection/stories/Components/ReplyBlock/ReplyBlock.stories.js +57 -0
- package/dist/collection/stories/Components/ReplyMessageContainer/ReplyMessageContainer.js +645 -0
- package/dist/collection/stories/Components/ReplyMessageContainer/ReplyMessageContainer.stories.js +58 -0
- package/dist/collection/stories/Components/SearchableList/SearchableList.js +393 -0
- package/dist/collection/stories/Components/SearchableList/SearchableList.stories.js +65 -0
- package/dist/collection/stories/Components/SharePopup/SharePopup.js +152 -0
- package/dist/collection/stories/Components/SharePopup/SharePopup.stories.js +47 -0
- package/dist/collection/stories/Components/Splitscreen/Splitscreen.js +157 -0
- package/dist/collection/stories/Components/Splitscreen/Splitscreen.stories.js +100 -0
- package/dist/collection/stories/Components/TestFooter/MentionUserList.js +194 -0
- package/dist/collection/stories/Components/TestFooter/TestFooter.js +1339 -0
- package/dist/collection/stories/Components/TestFooter/TestFooter.stories.js +89 -0
- package/dist/collection/stories/Components/Text/Text.js +57 -0
- package/dist/collection/stories/Components/Text/Text.stories.js +83 -0
- package/dist/collection/stories/Components/TextStyle/TextStyle.js +38 -0
- package/dist/collection/stories/Components/TextStyle/TextStyle.stories.js +50 -0
- package/dist/collection/stories/Components/Time/Timestamp.js +50 -0
- package/dist/collection/stories/Components/Time/Timestamp.stories.js +34 -0
- package/dist/collection/stories/Components/Toaster/Toaster.js +94 -0
- package/dist/collection/stories/Components/Toaster/Toaster.stories.js +108 -0
- package/dist/collection/stories/Components/Toaster/toast-helper.js +79 -0
- package/dist/collection/stories/Components/Toaster/toast-helper.js.map +1 -0
- package/dist/collection/stories/Components/final/final.js +86 -0
- package/dist/collection/stories/Components/final/final.stories.js +30 -0
- package/dist/collection/stories/assets/SEARCH ICON.svg +1 -0
- package/dist/collection/types/ConversationDetailsTypes.js +2 -0
- package/dist/collection/types/ConversationDetailsTypes.js.map +1 -0
- package/dist/collection/utils/chatSdk.js +14 -0
- package/dist/collection/utils/getFomattedDate.js +34 -0
- package/dist/collection/utils/getFomattedDate.js.map +1 -0
- package/dist/collection/utils/unixTimeConverter.js +28 -0
- package/dist/collection/utils/utils.js +4 -0
- package/dist/collection/utils/utils.js.map +1 -0
- package/dist/esm/BlockChatList-9fc3a42b.js +421 -0
- package/dist/esm/BlockChatList-9fc3a42b.js.map +1 -0
- package/dist/esm/DocumentMessageBubble-b67726f2.js +491 -0
- package/dist/esm/DocumentMessageBubble-b67726f2.js.map +1 -0
- package/dist/esm/Image-bb9efda3.js +121 -0
- package/dist/esm/Image-bb9efda3.js.map +1 -0
- package/dist/esm/ImageMessageBubble-0e473f6e.js +673 -0
- package/dist/esm/ImageMessageBubble-0e473f6e.js.map +1 -0
- package/dist/esm/IsometrikLogo-14db76af.js +42 -0
- package/dist/esm/IsometrikLogo-14db76af.js.map +1 -0
- package/dist/esm/MessageSearch-4101a627.js +5875 -0
- package/dist/esm/MessageSearch-4101a627.js.map +1 -0
- package/dist/esm/ReactionsContainer-bdd74a3c.js +373 -0
- package/dist/esm/ReactionsContainer-bdd74a3c.js.map +1 -0
- package/dist/esm/Text-3b0b3898.js +58 -0
- package/dist/esm/Text-3b0b3898.js.map +1 -0
- package/dist/esm/VideoMessageBubble-88a7a53e.js +569 -0
- package/dist/esm/VideoMessageBubble-88a7a53e.js.map +1 -0
- package/dist/esm/WebChat-5448d615.js +2882 -0
- package/dist/esm/WebChat-5448d615.js.map +1 -0
- package/dist/esm/app-globals-0f993ce5.js +5 -0
- package/dist/esm/app-globals-0f993ce5.js.map +1 -0
- package/dist/esm/audio-bubble_8.entry.js +21001 -0
- package/dist/esm/audio-bubble_8.entry.js.map +1 -0
- package/dist/esm/block-chat-list.entry.js +8 -0
- package/dist/esm/block-chat-list.entry.js.map +1 -0
- package/dist/esm/chat-app.entry.js +51 -0
- package/dist/esm/chat-app.entry.js.map +1 -0
- package/dist/esm/chat-assets-bd8778d5.js +6 -0
- package/dist/esm/chat-assets-bd8778d5.js.map +1 -0
- package/dist/esm/chat-creds-ff086f05.js +35 -0
- package/dist/esm/chat-creds-ff086f05.js.map +1 -0
- package/dist/esm/chat-document-message-bubble.entry.js +20 -0
- package/dist/esm/chat-document-message-bubble.entry.js.map +1 -0
- package/dist/esm/chat-image-message-bubble.entry.js +22 -0
- package/dist/esm/chat-image-message-bubble.entry.js.map +1 -0
- package/dist/esm/chat-video-message-bubble.entry.js +20 -0
- package/dist/esm/chat-video-message-bubble.entry.js.map +1 -0
- package/dist/esm/content-5aea5e39.js +79 -0
- package/dist/esm/content-5aea5e39.js.map +1 -0
- package/dist/esm/dialog-drawer-9fa083b1.js +5304 -0
- package/dist/esm/dialog-drawer-9fa083b1.js.map +1 -0
- package/dist/esm/forward-memebers.entry.js +124 -0
- package/dist/esm/forward-memebers.entry.js.map +1 -0
- package/dist/esm/group-members-bb3c8db7.js +37 -0
- package/dist/esm/group-members-bb3c8db7.js.map +1 -0
- package/dist/esm/groupcast-d1c54a27.js +187 -0
- package/dist/esm/groupcast-d1c54a27.js.map +1 -0
- package/dist/esm/imagePlaceholder-e544f70b.js +4360 -0
- package/dist/esm/imagePlaceholder-e544f70b.js.map +1 -0
- package/dist/esm/index-fddf30b7.js +3093 -0
- package/dist/esm/index-fddf30b7.js.map +1 -0
- package/dist/esm/index.js +139 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/isometrik-webchat.js +49 -0
- package/dist/esm/isometrik-webchat.js.map +1 -0
- package/dist/esm/loader.js +13 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/login-page.entry.js +81 -0
- package/dist/esm/login-page.entry.js.map +1 -0
- package/dist/esm/member-add.entry.js +118 -0
- package/dist/esm/member-add.entry.js.map +1 -0
- package/dist/esm/message-reaction-ad47ea1a.js +20 -0
- package/dist/esm/message-reaction-ad47ea1a.js.map +1 -0
- package/dist/esm/my-component.entry.js +25 -0
- package/dist/esm/my-component.entry.js.map +1 -0
- package/dist/esm/reaction-container.entry.js +48 -0
- package/dist/esm/reaction-container.entry.js.map +1 -0
- package/dist/esm/shadow-css-7ad5caf8.js +334 -0
- package/dist/esm/shadow-css-7ad5caf8.js.map +1 -0
- package/dist/esm/signup-page.entry.js +139 -0
- package/dist/esm/signup-page.entry.js.map +1 -0
- package/dist/esm/taguser-e9032d65.js +510 -0
- package/dist/esm/taguser-e9032d65.js.map +1 -0
- package/dist/esm/theme-provider_2.entry.js +108 -0
- package/dist/esm/theme-provider_2.entry.js.map +1 -0
- package/dist/esm/toast-helper-840fd8dc.js +82 -0
- package/dist/esm/toast-helper-840fd8dc.js.map +1 -0
- package/dist/esm/utils-11fcde98.js +7 -0
- package/dist/esm/utils-11fcde98.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/isometrik-webchat/index.esm.js +2 -0
- package/dist/isometrik-webchat/index.esm.js.map +1 -0
- package/dist/isometrik-webchat/isometrik-webchat.css +2 -0
- package/dist/isometrik-webchat/isometrik-webchat.esm.js +2 -0
- package/dist/isometrik-webchat/isometrik-webchat.esm.js.map +1 -0
- package/dist/isometrik-webchat/p-12774661.js +2 -0
- package/dist/isometrik-webchat/p-12774661.js.map +1 -0
- package/dist/isometrik-webchat/p-12e56271.js +549 -0
- package/dist/isometrik-webchat/p-12e56271.js.map +1 -0
- package/dist/isometrik-webchat/p-1415e589.js +2 -0
- package/dist/isometrik-webchat/p-1415e589.js.map +1 -0
- package/dist/isometrik-webchat/p-18f8d210.js +13 -0
- package/dist/isometrik-webchat/p-18f8d210.js.map +1 -0
- package/dist/isometrik-webchat/p-1b2461f4.js +357 -0
- package/dist/isometrik-webchat/p-1b2461f4.js.map +1 -0
- package/dist/isometrik-webchat/p-229095d4.js +2 -0
- package/dist/isometrik-webchat/p-229095d4.js.map +1 -0
- package/dist/isometrik-webchat/p-2953d06a.entry.js +2 -0
- package/dist/isometrik-webchat/p-2953d06a.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-3004a123.js +2 -0
- package/dist/isometrik-webchat/p-3004a123.js.map +1 -0
- package/dist/isometrik-webchat/p-3044698a.js +2 -0
- package/dist/isometrik-webchat/p-3044698a.js.map +1 -0
- package/dist/isometrik-webchat/p-40517d7f.js +1098 -0
- package/dist/isometrik-webchat/p-40517d7f.js.map +1 -0
- package/dist/isometrik-webchat/p-42a62cf2.js +2 -0
- package/dist/isometrik-webchat/p-42a62cf2.js.map +1 -0
- package/dist/isometrik-webchat/p-48e1d174.js +45 -0
- package/dist/isometrik-webchat/p-48e1d174.js.map +1 -0
- package/dist/isometrik-webchat/p-48e243ec.entry.js +2 -0
- package/dist/isometrik-webchat/p-48e243ec.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-4d2aca06.js +257 -0
- package/dist/isometrik-webchat/p-4d2aca06.js.map +1 -0
- package/dist/isometrik-webchat/p-610bfd8a.js +2 -0
- package/dist/isometrik-webchat/p-610bfd8a.js.map +1 -0
- package/dist/isometrik-webchat/p-674e4bb0.js +9 -0
- package/dist/isometrik-webchat/p-674e4bb0.js.map +1 -0
- package/dist/isometrik-webchat/p-8490e13d.js +192 -0
- package/dist/isometrik-webchat/p-8490e13d.js.map +1 -0
- package/dist/isometrik-webchat/p-858b0da8.entry.js +2 -0
- package/dist/isometrik-webchat/p-858b0da8.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-89108249.entry.js +5010 -0
- package/dist/isometrik-webchat/p-89108249.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-8dcdea59.js +2963 -0
- package/dist/isometrik-webchat/p-8dcdea59.js.map +1 -0
- package/dist/isometrik-webchat/p-92d0b21c.js +2 -0
- package/dist/isometrik-webchat/p-92d0b21c.js.map +1 -0
- package/dist/isometrik-webchat/p-ada9c8e8.entry.js +2 -0
- package/dist/isometrik-webchat/p-ada9c8e8.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-adbb398d.entry.js +2 -0
- package/dist/isometrik-webchat/p-adbb398d.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-b07dd267.js +2 -0
- package/dist/isometrik-webchat/p-b07dd267.js.map +1 -0
- package/dist/isometrik-webchat/p-bf0aeb22.entry.js +2 -0
- package/dist/isometrik-webchat/p-bf0aeb22.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-bfd51dd4.entry.js +2 -0
- package/dist/isometrik-webchat/p-bfd51dd4.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-c50aa410.entry.js +2 -0
- package/dist/isometrik-webchat/p-c50aa410.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-cd34448c.entry.js +2 -0
- package/dist/isometrik-webchat/p-cd34448c.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-d4b8ece6.entry.js +2 -0
- package/dist/isometrik-webchat/p-d4b8ece6.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-de8a8642.js +197 -0
- package/dist/isometrik-webchat/p-de8a8642.js.map +1 -0
- package/dist/isometrik-webchat/p-e09b32eb.js +591 -0
- package/dist/isometrik-webchat/p-e09b32eb.js.map +1 -0
- package/dist/isometrik-webchat/p-e1255160.js +2 -0
- package/dist/isometrik-webchat/p-e1255160.js.map +1 -0
- package/dist/isometrik-webchat/p-e3731295.js +274 -0
- package/dist/isometrik-webchat/p-e3731295.js.map +1 -0
- package/dist/isometrik-webchat/p-e4efea64.entry.js +2 -0
- package/dist/isometrik-webchat/p-e4efea64.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-ef6e482a.entry.js +2 -0
- package/dist/isometrik-webchat/p-ef6e482a.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-f1f5d5bd.js +3 -0
- package/dist/isometrik-webchat/p-f1f5d5bd.js.map +1 -0
- package/dist/isometrik-webchat/p-ff9f3dfe.js +203 -0
- package/dist/isometrik-webchat/p-ff9f3dfe.js.map +1 -0
- package/dist/loader/cdn.js +1 -0
- package/dist/loader/index.cjs.js +1 -0
- package/dist/loader/index.d.ts +24 -0
- package/dist/loader/index.es2017.js +1 -0
- package/dist/loader/index.js +2 -0
- package/dist/loader/package.json +11 -0
- package/dist/types/app-root.d.ts +0 -0
- package/dist/types/components/ChatUIComponent/AddMember.d.ts +13 -0
- package/dist/types/components/ChatUIComponent/AudioBubble.d.ts +39 -0
- package/dist/types/components/ChatUIComponent/BlockChatList.d.ts +13 -0
- package/dist/types/components/ChatUIComponent/ChatDocumentMessageBubble.d.ts +5 -0
- package/dist/types/components/ChatUIComponent/ChatImageMessageBubble.d.ts +5 -0
- package/dist/types/components/ChatUIComponent/ChatOwnProfile/Profile.d.ts +42 -0
- package/dist/types/components/ChatUIComponent/ChatSidebar/ChatSidebar.d.ts +85 -0
- package/dist/types/components/ChatUIComponent/ChatVideoMessageBubble.d.ts +5 -0
- package/dist/types/components/ChatUIComponent/Footer/ChatFooter.d.ts +154 -0
- package/dist/types/components/ChatUIComponent/ForwardMessageList.d.ts +15 -0
- package/dist/types/components/ChatUIComponent/GroupCast.d.ts +26 -0
- package/dist/types/components/ChatUIComponent/Header/WebChatHeader.d.ts +45 -0
- package/dist/types/components/ChatUIComponent/ReactionContainer.d.ts +12 -0
- package/dist/types/components/ChatUIComponent/WebChatBody/WebChatBody.d.ts +120 -0
- package/dist/types/components/Login.d.ts +13 -0
- package/dist/types/components/Signup.d.ts +17 -0
- package/dist/types/components/chat-main.d.ts +15 -0
- package/dist/types/components/my-component/my-component.d.ts +16 -0
- package/dist/types/components/my-component/web-chat/WebchatRightSide.d.ts +42 -0
- package/dist/types/components/theme-provider.d.ts +44 -0
- package/dist/types/components.d.ts +838 -0
- package/dist/types/index.d.ts +37 -0
- package/dist/types/stencil-public-runtime.d.ts +1678 -0
- package/dist/types/store/conversation.d.ts +17 -0
- package/dist/types/store/group-members.d.ts +18 -0
- package/dist/types/store/unread-count.d.ts +10 -0
- package/dist/types/stories/Components/Toaster/toast-helper.d.ts +8 -0
- package/dist/types/types/ConversationDetailsTypes.d.ts +52 -0
- package/dist/types/utils/getFomattedDate.d.ts +1 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/package.json +89 -0
- package/readme.md +569 -0
|
@@ -0,0 +1,2963 @@
|
|
|
1
|
+
import{r as t,a as e,h as i,g as o,S as r}from"./p-f1f5d5bd.js";import{h as s,k as n,I as a,i as c,M as l,s as d,a as h,e as p,b as g,t as u,R as m}from"./p-48e1d174.js";import{a as b,e as f,g as v,d as x}from"./p-40517d7f.js";import{s as y}from"./p-92d0b21c.js";import"./p-4d2aca06.js";import{C as w}from"./p-12774661.js";import{W as k}from"./p-610bfd8a.js";import{i as $,v as C,e as S}from"./p-12e56271.js";import{p as M}from"./p-de8a8642.js";import"./p-8490e13d.js";class z extends s{static get properties(){return{name:{type:String},isLoading:{type:Boolean},tempProfilePhotoUrl:{type:String},isEditingName:{type:Boolean},newName:{type:String},hasChanges:{type:Boolean},handleNameEdit:{type:Function},handleNameChange:{type:Function},handleNameKeyDown:{type:Function},handleNameSave:{type:Function},handleFileChange:{type:Function},handleManualUpdate:{type:Function},cancelChanges:{type:Function},closeDrawer:{type:Function},showBlockedUsers:{type:Boolean},defaultTheme:{type:String},toggleTheme:{type:Function},socialAccounts:{type:Array},isSocialLoading:{type:Boolean},handleConnectInstagram:{type:Function},handleDisconnectInstagram:{type:Function}}}constructor(){super();this.name="";this.isLoading=false;this.tempProfilePhotoUrl=null;this.isEditingName=false;this.newName="";this.hasChanges=false;this.showBlockedUsers=false;this.socialAccounts=[];this.isSocialLoading=false;this.handleNameEdit=()=>{};this.handleNameChange=()=>{};this.handleNameKeyDown=()=>{};this.handleNameSave=()=>{};this.handleFileChange=()=>{};this.handleManualUpdate=()=>{};this.cancelChanges=()=>{};this.closeDrawer=()=>{};this.handleConnectInstagram=()=>{};this.handleDisconnectInstagram=()=>{}}firstUpdated(){this.newName=this.name}updated(t){if(t.has("name")&&this.name!==this.newName){this.newName=this.name}}triggerFileInput(){const t=this.shadowRoot.querySelector(".file-input");if(t){t.click()}}handleopenBlockList(){this.showBlockedUsers=true}hideBlockedUsersView(){this.showBlockedUsers=false}formatSocialDate(t){if(!t)return"-";try{return new Date(t).toLocaleDateString(undefined,{day:"numeric",month:"short",year:"numeric"})}catch{return String(t)}}renderSocialAccount(t){const e=t.displayName||t.username||"Instagram";const i=t.username?`@${t.username}`:"";const o=t.status==="connected";const r=`igGrad-${t.zernioAccountId||t.username||"acc"}`;return n`
|
|
2
|
+
<article class="ig-card">
|
|
3
|
+
<div class="ig-card-top">
|
|
4
|
+
<div class="ig-mark" aria-hidden="true">
|
|
5
|
+
<svg viewBox="0 0 24 24" width="22" height="22" fill="none">
|
|
6
|
+
<defs>
|
|
7
|
+
<linearGradient id=${r} x1="0%" y1="100%" x2="100%" y2="0%">
|
|
8
|
+
<stop offset="0%" stop-color="#f58529" />
|
|
9
|
+
<stop offset="50%" stop-color="#dd2a7b" />
|
|
10
|
+
<stop offset="100%" stop-color="#8134af" />
|
|
11
|
+
</linearGradient>
|
|
12
|
+
</defs>
|
|
13
|
+
<rect x="2" y="2" width="20" height="20" rx="5.5" stroke="url(#${r})" stroke-width="1.75" />
|
|
14
|
+
<circle cx="12" cy="12" r="4.25" stroke="url(#${r})" stroke-width="1.75" />
|
|
15
|
+
<circle cx="17.35" cy="6.65" r="1.15" fill="url(#${r})" />
|
|
16
|
+
</svg>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<div class="ig-identity">
|
|
20
|
+
<div class="ig-name-row">
|
|
21
|
+
<h3 class="ig-name">${e}</h3>
|
|
22
|
+
${o?n`<span class="ig-badge">Connected</span>`:n`<span class="ig-badge is-muted">${t.status||"Unknown"}</span>`}
|
|
23
|
+
</div>
|
|
24
|
+
${i?n`<p class="ig-handle">${i}</p>`:null}
|
|
25
|
+
<p class="ig-connected-on">Connected ${this.formatSocialDate(t.connectedAt)}</p>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<div class="ig-actions">
|
|
30
|
+
${t.profileUrl?n`<a class="ig-link" href=${t.profileUrl} target="_blank" rel="noopener noreferrer">View profile</a>`:null}
|
|
31
|
+
<button
|
|
32
|
+
type="button"
|
|
33
|
+
class="ig-disconnect"
|
|
34
|
+
@click=${()=>this.handleDisconnectInstagram(t.zernioAccountId,t.username)}
|
|
35
|
+
>
|
|
36
|
+
Disconnect
|
|
37
|
+
</button>
|
|
38
|
+
</div>
|
|
39
|
+
</article>
|
|
40
|
+
`}renderConnectInstagram(){return n`
|
|
41
|
+
<button type="button" class="ig-connect" @click=${this.handleConnectInstagram} ?disabled=${this.isSocialLoading}>
|
|
42
|
+
<span class="ig-mark" aria-hidden="true">
|
|
43
|
+
<svg viewBox="0 0 24 24" width="22" height="22" fill="none">
|
|
44
|
+
<defs>
|
|
45
|
+
<linearGradient id="igGradEmpty" x1="0%" y1="100%" x2="100%" y2="0%">
|
|
46
|
+
<stop offset="0%" stop-color="#f58529" />
|
|
47
|
+
<stop offset="50%" stop-color="#dd2a7b" />
|
|
48
|
+
<stop offset="100%" stop-color="#8134af" />
|
|
49
|
+
</linearGradient>
|
|
50
|
+
</defs>
|
|
51
|
+
<rect x="2" y="2" width="20" height="20" rx="5.5" stroke="url(#igGradEmpty)" stroke-width="1.75" />
|
|
52
|
+
<circle cx="12" cy="12" r="4.25" stroke="url(#igGradEmpty)" stroke-width="1.75" />
|
|
53
|
+
<circle cx="17.35" cy="6.65" r="1.15" fill="url(#igGradEmpty)" />
|
|
54
|
+
</svg>
|
|
55
|
+
</span>
|
|
56
|
+
<span class="ig-connect-copy">
|
|
57
|
+
<span class="ig-connect-title">Connect Instagram</span>
|
|
58
|
+
<span class="ig-connect-sub">Link your business account to manage DMs here</span>
|
|
59
|
+
</span>
|
|
60
|
+
</button>
|
|
61
|
+
`}handleLogout(t){t.stopPropagation();this.showLogoutPopup=!this.showLogoutPopup;b.openDialog("confirm-dialog",{title:"Logout",description:`Are you sure you want to Logout ?`,handleConfirm:f})}render(){if(this.showBlockedUsers){return n`
|
|
62
|
+
<block-chat-list
|
|
63
|
+
.blockedUsers=${this.blockedUsers}
|
|
64
|
+
.isLoading=${this.isLoadingBlockedUsers}
|
|
65
|
+
.handleUnblock=${this.handleUnblockUser}
|
|
66
|
+
.goBack=${()=>this.hideBlockedUsersView()}
|
|
67
|
+
.height="96%"
|
|
68
|
+
>
|
|
69
|
+
</block-chat-list>
|
|
70
|
+
`}return n`
|
|
71
|
+
${this.isLoading?n`<div class="spinner-overlay">
|
|
72
|
+
<spinner-loader
|
|
73
|
+
height="30px"
|
|
74
|
+
width="30px"
|
|
75
|
+
spinTime="1s"
|
|
76
|
+
spinnerPrimaryColor="var(--bg-primary-color)"
|
|
77
|
+
spinnerSecondaryColor="var(--text-primary-color)"
|
|
78
|
+
spinnerBorderWidth="2px"
|
|
79
|
+
>
|
|
80
|
+
</spinner-loader>
|
|
81
|
+
</div>`:n`<div class="profile-container">
|
|
82
|
+
<div class="header-profile">
|
|
83
|
+
<div @click=${this.closeDrawer}>
|
|
84
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="30px" viewBox="0 -960 960 960" width="30px" fill="var(--text-primary-color)">
|
|
85
|
+
<path d="m249-207-42-42 231-231-231-231 42-42 231 231 231-231 42 42-231 231 231 231-42 42-231-231-231 231Z" />
|
|
86
|
+
</svg>
|
|
87
|
+
</div>
|
|
88
|
+
<h1 class="profile-header">Profile</h1>
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<div class="photo-container">
|
|
92
|
+
<div class="profile-photo" @click=${this.triggerFileInput}>
|
|
93
|
+
${this.tempProfilePhotoUrl?n`<div class="photo-wrapper">
|
|
94
|
+
${a({src:this.tempProfilePhotoUrl,alt:"profile image",width:"100%",height:"100%",objectFit:"cover",borderRadius:"50%",placeholderImage:v(this.name,90,90)})}
|
|
95
|
+
<div class="hover-overlay">
|
|
96
|
+
<div class="d-flex flex-direction-column align-center">
|
|
97
|
+
<div class="camera-icon">
|
|
98
|
+
<svg
|
|
99
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
100
|
+
width="24"
|
|
101
|
+
height="24"
|
|
102
|
+
viewBox="0 0 24 24"
|
|
103
|
+
fill="none"
|
|
104
|
+
stroke="currentColor"
|
|
105
|
+
stroke-width="2"
|
|
106
|
+
stroke-linecap="round"
|
|
107
|
+
stroke-linejoin="round"
|
|
108
|
+
>
|
|
109
|
+
<path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"></path>
|
|
110
|
+
<circle cx="12" cy="13" r="4"></circle>
|
|
111
|
+
</svg>
|
|
112
|
+
</div>
|
|
113
|
+
<span class="change-text">CHANGE PHOTO</span>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
</div>`:n`<div class="photo-placeholder">
|
|
117
|
+
<div class="camera-icon">
|
|
118
|
+
<svg
|
|
119
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
120
|
+
width="24"
|
|
121
|
+
height="24"
|
|
122
|
+
viewBox="0 0 24 24"
|
|
123
|
+
fill="none"
|
|
124
|
+
stroke="currentColor"
|
|
125
|
+
stroke-width="2"
|
|
126
|
+
stroke-linecap="round"
|
|
127
|
+
stroke-linejoin="round"
|
|
128
|
+
>
|
|
129
|
+
<path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"></path>
|
|
130
|
+
<circle cx="12" cy="13" r="4"></circle>
|
|
131
|
+
</svg>
|
|
132
|
+
</div>
|
|
133
|
+
<span class="add-text">ADD PROFILE PHOTO</span>
|
|
134
|
+
</div>`}
|
|
135
|
+
</div>
|
|
136
|
+
<input type="file" accept="image/*" class="file-input" @change=${t=>this.handleFileChange(t)} />
|
|
137
|
+
</div>
|
|
138
|
+
|
|
139
|
+
<div class="form-group">
|
|
140
|
+
<label class="label">Your name</label>
|
|
141
|
+
<div class="input-container">
|
|
142
|
+
${this.isEditingName?n`<input
|
|
143
|
+
type="text"
|
|
144
|
+
.value=${this.newName}
|
|
145
|
+
class="name-input"
|
|
146
|
+
@input=${this.handleNameChange}
|
|
147
|
+
@keydown=${this.handleNameKeyDown}
|
|
148
|
+
maxlength="20"
|
|
149
|
+
placeholder="Enter your Name"
|
|
150
|
+
/>`:n`<span class="input-text">${this.name}</span>`}
|
|
151
|
+
<button class="edit-button" @click=${this.handleNameEdit} aria-label="Edit name">
|
|
152
|
+
<svg
|
|
153
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
154
|
+
width="16"
|
|
155
|
+
height="16"
|
|
156
|
+
viewBox="0 0 24 24"
|
|
157
|
+
fill="none"
|
|
158
|
+
stroke="currentColor"
|
|
159
|
+
stroke-width="2"
|
|
160
|
+
stroke-linecap="round"
|
|
161
|
+
stroke-linejoin="round"
|
|
162
|
+
>
|
|
163
|
+
<path d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"></path>
|
|
164
|
+
</svg>
|
|
165
|
+
</button>
|
|
166
|
+
</div>
|
|
167
|
+
<p class="helper-text">This name will be visible to your contacts. Only lowercase letters, numbers and underscore allowed (max 20 chars).</p>
|
|
168
|
+
</div>
|
|
169
|
+
|
|
170
|
+
${this.hasChanges?n`<div class="update-actions">
|
|
171
|
+
<button class="update-button" @click=${this.handleManualUpdate}>Update Profile</button>
|
|
172
|
+
<button class="cancel-button" @click=${this.cancelChanges}>Cancel</button>
|
|
173
|
+
</div>`:null}
|
|
174
|
+
|
|
175
|
+
<div class="bottom-actions">
|
|
176
|
+
<button type="button" class="action-button" @click=${this.toggleTheme}>
|
|
177
|
+
${this.defaultTheme==="dark"?n`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
178
|
+
<circle cx="12" cy="12" r="4"></circle>
|
|
179
|
+
<path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"></path>
|
|
180
|
+
</svg>`:n`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
181
|
+
<path d="M21 14.5A8.5 8.5 0 0 1 9.5 3 7 7 0 1 0 21 14.5z"></path>
|
|
182
|
+
</svg>`}
|
|
183
|
+
<span>${this.defaultTheme==="dark"?"Light Theme":"Dark Theme"}</span>
|
|
184
|
+
</button>
|
|
185
|
+
<button type="button" class="action-button" @click=${this.handleopenBlockList}>
|
|
186
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
187
|
+
<path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
|
|
188
|
+
<circle cx="8.5" cy="7" r="4"></circle>
|
|
189
|
+
<line x1="18" y1="8" x2="23" y2="13"></line>
|
|
190
|
+
<line x1="23" y1="8" x2="18" y2="13"></line>
|
|
191
|
+
</svg>
|
|
192
|
+
<span>Block Users</span>
|
|
193
|
+
</button>
|
|
194
|
+
</div>
|
|
195
|
+
</div>`}
|
|
196
|
+
`}static get styles(){return c`
|
|
197
|
+
:host {
|
|
198
|
+
display: flex;
|
|
199
|
+
flex-direction: column;
|
|
200
|
+
height: 100%;
|
|
201
|
+
font-size: 16px;
|
|
202
|
+
box-sizing: border-box;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.profile-container {
|
|
206
|
+
padding: 16px 20px 24px;
|
|
207
|
+
display: flex;
|
|
208
|
+
flex-direction: column;
|
|
209
|
+
height: 100%;
|
|
210
|
+
box-sizing: border-box;
|
|
211
|
+
overflow-y: auto;
|
|
212
|
+
position: relative;
|
|
213
|
+
background-color: var(--bg-primary-color);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.profile-header {
|
|
217
|
+
font-size: 1.25rem;
|
|
218
|
+
font-weight: 600;
|
|
219
|
+
margin: 0 0 0 8px;
|
|
220
|
+
color: var(--text-primary-color);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.photo-container {
|
|
224
|
+
display: flex;
|
|
225
|
+
justify-content: center;
|
|
226
|
+
margin-bottom: 28px;
|
|
227
|
+
position: relative;
|
|
228
|
+
flex-shrink: 0;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.profile-photo {
|
|
232
|
+
width: 120px;
|
|
233
|
+
height: 120px;
|
|
234
|
+
max-width: 120px;
|
|
235
|
+
max-height: 120px;
|
|
236
|
+
border-radius: 50%;
|
|
237
|
+
background-color: var(--bg-incoming-message, #f5f5f5);
|
|
238
|
+
display: flex;
|
|
239
|
+
flex-direction: column;
|
|
240
|
+
justify-content: center;
|
|
241
|
+
align-items: center;
|
|
242
|
+
overflow: hidden;
|
|
243
|
+
position: relative;
|
|
244
|
+
cursor: pointer;
|
|
245
|
+
flex-shrink: 0;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.photo-wrapper {
|
|
249
|
+
position: relative;
|
|
250
|
+
width: 100%;
|
|
251
|
+
height: 100%;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.hover-overlay {
|
|
255
|
+
position: absolute;
|
|
256
|
+
top: 0;
|
|
257
|
+
left: 0;
|
|
258
|
+
width: 100%;
|
|
259
|
+
height: 100%;
|
|
260
|
+
background-color: rgba(0, 0, 0, 0.6);
|
|
261
|
+
display: flex;
|
|
262
|
+
flex-direction: column;
|
|
263
|
+
align-items: center;
|
|
264
|
+
justify-content: center;
|
|
265
|
+
opacity: 0;
|
|
266
|
+
transition: opacity 0.3s ease;
|
|
267
|
+
border-radius: 50%;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.photo-wrapper:hover .hover-overlay {
|
|
271
|
+
opacity: 1;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.photo-placeholder {
|
|
275
|
+
display: flex;
|
|
276
|
+
flex-direction: column;
|
|
277
|
+
align-items: center;
|
|
278
|
+
justify-content: center;
|
|
279
|
+
width: 100%;
|
|
280
|
+
height: 100%;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.camera-icon {
|
|
284
|
+
background-color: var(--bg-incoming-message);
|
|
285
|
+
width: 44px;
|
|
286
|
+
height: 44px;
|
|
287
|
+
border-radius: 50%;
|
|
288
|
+
display: flex;
|
|
289
|
+
justify-content: center;
|
|
290
|
+
align-items: center;
|
|
291
|
+
margin-bottom: 5px;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.camera-icon svg {
|
|
295
|
+
color: var(--text-incoming-message);
|
|
296
|
+
width: 22px;
|
|
297
|
+
height: 22px;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.add-text,
|
|
301
|
+
.change-text {
|
|
302
|
+
font-size: 0.75rem;
|
|
303
|
+
text-align: center;
|
|
304
|
+
padding: 0 15px;
|
|
305
|
+
color: var(--text-incoming-message);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.form-group {
|
|
309
|
+
margin-bottom: 24px;
|
|
310
|
+
flex-shrink: 0;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.label {
|
|
314
|
+
font-size: 0.8125rem;
|
|
315
|
+
color: var(--text-secondary-color);
|
|
316
|
+
margin-bottom: 8px;
|
|
317
|
+
display: block;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.input-container {
|
|
321
|
+
display: flex;
|
|
322
|
+
justify-content: space-between;
|
|
323
|
+
align-items: center;
|
|
324
|
+
border-bottom: 1px solid var(--bg-secondary-color);
|
|
325
|
+
padding-bottom: 10px;
|
|
326
|
+
gap: 8px;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.input-text {
|
|
330
|
+
font-size: 1rem;
|
|
331
|
+
color: var(--text-primary-color);
|
|
332
|
+
font-weight: 500;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.edit-button {
|
|
336
|
+
background: none;
|
|
337
|
+
border: none;
|
|
338
|
+
cursor: pointer;
|
|
339
|
+
color: var(--text-secondary-color);
|
|
340
|
+
padding: 5px;
|
|
341
|
+
display: flex;
|
|
342
|
+
align-items: center;
|
|
343
|
+
justify-content: center;
|
|
344
|
+
flex-shrink: 0;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.helper-text {
|
|
348
|
+
font-size: 0.75rem;
|
|
349
|
+
color: var(--text-secondary-color);
|
|
350
|
+
margin-top: 8px;
|
|
351
|
+
line-height: 1.4;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.file-input {
|
|
355
|
+
display: none;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.name-input {
|
|
359
|
+
background: var(--bg-secondary-color);
|
|
360
|
+
border: none;
|
|
361
|
+
color: var(--text-primary-color);
|
|
362
|
+
font-size: 1rem;
|
|
363
|
+
width: 100%;
|
|
364
|
+
padding: 4px 8px;
|
|
365
|
+
outline: none;
|
|
366
|
+
border-radius: 4px;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
.upload-progress {
|
|
370
|
+
width: 80%;
|
|
371
|
+
display: flex;
|
|
372
|
+
flex-direction: column;
|
|
373
|
+
align-items: center;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.d-flex {
|
|
377
|
+
display: flex;
|
|
378
|
+
}
|
|
379
|
+
.flex-direction-column {
|
|
380
|
+
flex-direction: column;
|
|
381
|
+
}
|
|
382
|
+
.align-center {
|
|
383
|
+
align-items: center;
|
|
384
|
+
}
|
|
385
|
+
.spinner-overlay {
|
|
386
|
+
height: 100%;
|
|
387
|
+
width: 100%;
|
|
388
|
+
display: flex;
|
|
389
|
+
align-items: center;
|
|
390
|
+
justify-content: center;
|
|
391
|
+
background-color: var(--bg-primary-color);
|
|
392
|
+
}
|
|
393
|
+
.update-actions {
|
|
394
|
+
display: flex;
|
|
395
|
+
gap: 10px;
|
|
396
|
+
margin-bottom: 16px;
|
|
397
|
+
flex-shrink: 0;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.update-button,
|
|
401
|
+
.cancel-button {
|
|
402
|
+
padding: 8px 16px;
|
|
403
|
+
border-radius: 4px;
|
|
404
|
+
font-weight: 500;
|
|
405
|
+
cursor: pointer;
|
|
406
|
+
border: none;
|
|
407
|
+
transition: background-color 0.2s, transform 0.1s;
|
|
408
|
+
font-size: 0.875rem;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
.update-button {
|
|
412
|
+
background-color: var(--base-color);
|
|
413
|
+
color: var(--text-incoming-message);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.update-button:hover {
|
|
417
|
+
transform: translateY(-1px);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
.update-button:active {
|
|
421
|
+
transform: translateY(0);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
.cancel-button {
|
|
425
|
+
background-color: var(--bg-grey-color);
|
|
426
|
+
color: var(--text-primary-color);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.cancel-button:hover {
|
|
430
|
+
filter: brightness(0.97);
|
|
431
|
+
transform: translateY(-1px);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
.cancel-button:active {
|
|
435
|
+
transform: translateY(0);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.update-button:disabled,
|
|
439
|
+
.cancel-button:disabled {
|
|
440
|
+
opacity: 0.6;
|
|
441
|
+
cursor: not-allowed;
|
|
442
|
+
transform: none;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
.header-profile {
|
|
446
|
+
display: flex;
|
|
447
|
+
align-items: center;
|
|
448
|
+
flex-direction: row;
|
|
449
|
+
margin-bottom: 24px;
|
|
450
|
+
cursor: pointer;
|
|
451
|
+
flex-shrink: 0;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
.bottom-actions {
|
|
455
|
+
margin-top: auto;
|
|
456
|
+
display: flex;
|
|
457
|
+
flex-direction: column;
|
|
458
|
+
gap: 2px;
|
|
459
|
+
padding-top: 16px;
|
|
460
|
+
border-top: 1px solid var(--border-subtle, #eaeaea);
|
|
461
|
+
flex-shrink: 0;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
.social-section {
|
|
465
|
+
margin-bottom: 20px;
|
|
466
|
+
flex-shrink: 0;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
.ig-card {
|
|
470
|
+
display: flex;
|
|
471
|
+
flex-direction: column;
|
|
472
|
+
gap: 14px;
|
|
473
|
+
padding: 14px;
|
|
474
|
+
border-radius: 12px;
|
|
475
|
+
border: 1px solid var(--border-subtle, color-mix(in srgb, var(--text-primary-color) 10%, transparent));
|
|
476
|
+
background: color-mix(in srgb, var(--bg-secondary-color, #f5f5f5) 70%, transparent);
|
|
477
|
+
animation: ig-in 280ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
@keyframes ig-in {
|
|
481
|
+
from {
|
|
482
|
+
opacity: 0;
|
|
483
|
+
transform: translateY(6px);
|
|
484
|
+
}
|
|
485
|
+
to {
|
|
486
|
+
opacity: 1;
|
|
487
|
+
transform: translateY(0);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
@media (prefers-reduced-motion: reduce) {
|
|
492
|
+
.ig-card {
|
|
493
|
+
animation: none;
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
.ig-card-top {
|
|
498
|
+
display: flex;
|
|
499
|
+
align-items: flex-start;
|
|
500
|
+
gap: 12px;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
.ig-mark {
|
|
504
|
+
width: 40px;
|
|
505
|
+
height: 40px;
|
|
506
|
+
border-radius: 12px;
|
|
507
|
+
display: grid;
|
|
508
|
+
place-items: center;
|
|
509
|
+
flex-shrink: 0;
|
|
510
|
+
background: color-mix(in srgb, #dd2a7b 8%, var(--bg-primary-color, #fff));
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
.ig-identity {
|
|
514
|
+
min-width: 0;
|
|
515
|
+
flex: 1;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
.ig-name-row {
|
|
519
|
+
display: flex;
|
|
520
|
+
align-items: center;
|
|
521
|
+
gap: 8px;
|
|
522
|
+
flex-wrap: wrap;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
.ig-name {
|
|
526
|
+
margin: 0;
|
|
527
|
+
font-size: 0.9375rem;
|
|
528
|
+
font-weight: 600;
|
|
529
|
+
color: var(--text-primary-color);
|
|
530
|
+
line-height: 1.3;
|
|
531
|
+
overflow: hidden;
|
|
532
|
+
text-overflow: ellipsis;
|
|
533
|
+
white-space: nowrap;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
.ig-badge {
|
|
537
|
+
font-size: 0.6875rem;
|
|
538
|
+
font-weight: 600;
|
|
539
|
+
letter-spacing: 0.01em;
|
|
540
|
+
padding: 3px 8px;
|
|
541
|
+
border-radius: 999px;
|
|
542
|
+
background: color-mix(in srgb, var(--success) 14%, transparent);
|
|
543
|
+
color: #15803d;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
.ig-badge.is-muted {
|
|
547
|
+
background: color-mix(in srgb, var(--text-secondary-color) 14%, transparent);
|
|
548
|
+
color: var(--text-secondary-color);
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
.ig-handle {
|
|
552
|
+
margin: 2px 0 0;
|
|
553
|
+
font-size: 0.8125rem;
|
|
554
|
+
color: var(--text-secondary-color);
|
|
555
|
+
overflow: hidden;
|
|
556
|
+
text-overflow: ellipsis;
|
|
557
|
+
white-space: nowrap;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
.ig-connected-on {
|
|
561
|
+
margin: 6px 0 0;
|
|
562
|
+
font-size: 0.75rem;
|
|
563
|
+
color: var(--text-secondary-color);
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
.ig-actions {
|
|
567
|
+
display: flex;
|
|
568
|
+
align-items: center;
|
|
569
|
+
justify-content: space-between;
|
|
570
|
+
gap: 12px;
|
|
571
|
+
padding-top: 2px;
|
|
572
|
+
border-top: 1px solid var(--border-subtle, color-mix(in srgb, var(--text-primary-color) 8%, transparent));
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
.ig-link {
|
|
576
|
+
font-size: 0.8125rem;
|
|
577
|
+
font-weight: 500;
|
|
578
|
+
color: var(--base-color, var(--primary));
|
|
579
|
+
text-decoration: none;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
.ig-link:hover {
|
|
583
|
+
text-decoration: underline;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
.ig-disconnect {
|
|
587
|
+
background: none;
|
|
588
|
+
border: none;
|
|
589
|
+
cursor: pointer;
|
|
590
|
+
color: var(--text-danger-color, #e53935);
|
|
591
|
+
font-size: 0.8125rem;
|
|
592
|
+
font-weight: 500;
|
|
593
|
+
padding: 4px 0;
|
|
594
|
+
transition: opacity 160ms ease, transform 120ms ease;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
.ig-disconnect:hover {
|
|
598
|
+
opacity: 0.85;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
.ig-disconnect:active {
|
|
602
|
+
transform: scale(0.98);
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
.ig-connect {
|
|
606
|
+
width: 100%;
|
|
607
|
+
display: flex;
|
|
608
|
+
align-items: center;
|
|
609
|
+
gap: 12px;
|
|
610
|
+
text-align: left;
|
|
611
|
+
padding: 12px 14px;
|
|
612
|
+
border-radius: 12px;
|
|
613
|
+
border: 1px dashed color-mix(in srgb, var(--text-primary-color) 18%, transparent);
|
|
614
|
+
background: transparent;
|
|
615
|
+
cursor: pointer;
|
|
616
|
+
transition: background-color 160ms ease, border-color 160ms ease, transform 120ms ease;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
.ig-connect:hover {
|
|
620
|
+
background: var(--bg-secondary-color, #f5f5f5);
|
|
621
|
+
border-style: solid;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
.ig-connect:active {
|
|
625
|
+
transform: scale(0.99);
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
.ig-connect:disabled {
|
|
629
|
+
opacity: 0.6;
|
|
630
|
+
cursor: not-allowed;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
.ig-connect-copy {
|
|
634
|
+
display: flex;
|
|
635
|
+
flex-direction: column;
|
|
636
|
+
gap: 2px;
|
|
637
|
+
min-width: 0;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
.ig-connect-title {
|
|
641
|
+
font-size: 0.875rem;
|
|
642
|
+
font-weight: 600;
|
|
643
|
+
color: var(--text-primary-color);
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
.ig-connect-sub {
|
|
647
|
+
font-size: 0.75rem;
|
|
648
|
+
color: var(--text-secondary-color);
|
|
649
|
+
line-height: 1.35;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
.ig-skeleton {
|
|
653
|
+
display: flex;
|
|
654
|
+
align-items: center;
|
|
655
|
+
gap: 12px;
|
|
656
|
+
padding: 14px;
|
|
657
|
+
border-radius: 12px;
|
|
658
|
+
border: 1px solid var(--border-subtle, color-mix(in srgb, var(--text-primary-color) 10%, transparent));
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
.ig-skeleton-mark {
|
|
662
|
+
width: 40px;
|
|
663
|
+
height: 40px;
|
|
664
|
+
border-radius: 12px;
|
|
665
|
+
background: color-mix(in srgb, var(--text-secondary-color) 12%, transparent);
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
.ig-skeleton-lines {
|
|
669
|
+
flex: 1;
|
|
670
|
+
display: flex;
|
|
671
|
+
flex-direction: column;
|
|
672
|
+
gap: 8px;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
.ig-skeleton-line {
|
|
676
|
+
height: 10px;
|
|
677
|
+
width: 42%;
|
|
678
|
+
border-radius: 999px;
|
|
679
|
+
background: color-mix(in srgb, var(--text-secondary-color) 12%, transparent);
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
.ig-skeleton-line.wide {
|
|
683
|
+
width: 68%;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
.action-button,
|
|
687
|
+
.action-button-logout {
|
|
688
|
+
display: flex;
|
|
689
|
+
align-items: center;
|
|
690
|
+
gap: 12px;
|
|
691
|
+
background: none;
|
|
692
|
+
border: none;
|
|
693
|
+
cursor: pointer;
|
|
694
|
+
color: #111111;
|
|
695
|
+
color: var(--text-primary-color, #111111);
|
|
696
|
+
font-size: 15px;
|
|
697
|
+
line-height: 1.3;
|
|
698
|
+
padding: 12px 8px;
|
|
699
|
+
text-align: left;
|
|
700
|
+
width: 100%;
|
|
701
|
+
box-sizing: border-box;
|
|
702
|
+
transition: background-color 0.15s ease, color 0.15s ease;
|
|
703
|
+
border-radius: 8px;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
.action-button span,
|
|
707
|
+
.action-button-logout span {
|
|
708
|
+
color: inherit;
|
|
709
|
+
font-size: inherit;
|
|
710
|
+
line-height: inherit;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
.action-button:hover {
|
|
714
|
+
background-color: var(--bg-secondary-color, #f5f5f5);
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
.action-button-logout {
|
|
718
|
+
color: #e53935;
|
|
719
|
+
color: var(--text-danger-color, #e53935);
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
.action-button-logout:hover {
|
|
723
|
+
background-color: rgba(229, 57, 53, 0.08);
|
|
724
|
+
color: var(--text-danger-color, #e53935);
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
.action-button svg,
|
|
728
|
+
.action-button-logout svg {
|
|
729
|
+
width: 18px;
|
|
730
|
+
height: 18px;
|
|
731
|
+
min-width: 18px;
|
|
732
|
+
flex-shrink: 0;
|
|
733
|
+
stroke: currentColor;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
@media (max-width: 768px) {
|
|
737
|
+
:host {
|
|
738
|
+
font-size: 14px;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
.camera-icon {
|
|
742
|
+
width: 40px;
|
|
743
|
+
height: 40px;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
.camera-icon svg {
|
|
747
|
+
width: 18px;
|
|
748
|
+
height: 18px;
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
@media (max-width: 480px) {
|
|
753
|
+
:host {
|
|
754
|
+
font-size: 12px;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
.profile-header {
|
|
758
|
+
font-size: 1.25rem;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
.profile-photo {
|
|
762
|
+
width: 112px;
|
|
763
|
+
height: 112px;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
.update-actions {
|
|
767
|
+
flex-direction: column;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
.update-button,
|
|
771
|
+
.cancel-button {
|
|
772
|
+
width: 100%;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
.camera-icon {
|
|
776
|
+
width: 36px;
|
|
777
|
+
height: 36px;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
.camera-icon svg {
|
|
781
|
+
width: 16px;
|
|
782
|
+
height: 16px;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
.form-group {
|
|
786
|
+
margin-bottom: 20px;
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
`}}customElements.define("profile-tab",z);const j="isometrik_social_oauth_callback";const I="isometrik_social_connect_pending";const E=({baseUrl:t,appSecret:e,licenseKey:i}={})=>({baseUrl:t||w.baseUrl,appSecret:e||w.appSecret,licenseKey:i||w.licenseKey});const B=(t,e)=>({"Content-Type":"application/json",appSecret:t,licenseKey:e});const T=()=>{if(w.socialRedirectUrl)return w.socialRedirectUrl;if(typeof window==="undefined")return"";return`${window.location.origin}${window.location.pathname||"/"}`};const L=(t=(typeof window!=="undefined"?window.location.search:""))=>{const e=new URLSearchParams(t);const i=e.get("zernioAccountId")||e.get("accountId")||e.get("zernio_account_id");if(!i)return null;return{zernioAccountId:i,username:e.get("username")||"",displayName:e.get("displayName")||e.get("display_name")||"",platform:e.get("platform")||"instagram"}};const A=()=>{if(typeof window==="undefined")return;const t=new URLSearchParams(window.location.search);["zernioAccountId","accountId","zernio_account_id","username","displayName","display_name","platform","headless"].forEach((e=>t.delete(e)));const e=t.toString();const i=`${window.location.pathname}${e?`?${e}`:""}${window.location.hash}`;window.history.replaceState({},"",i)};const U=()=>{if(typeof window==="undefined"||!window.opener)return false;const t=L();if(!t)return false;try{window.opener.postMessage({type:j,...t},window.location.origin)}catch(t){console.error("Failed to notify opener of social callback:",t)}window.close();return true};const N=t=>new Promise(((e,i)=>{if(typeof window==="undefined"){i(new Error("Popup OAuth requires a browser"));return}sessionStorage.setItem(I,"1");const o=560;const r=720;const s=window.screenX+(window.outerWidth-o)/2;const n=window.screenY+(window.outerHeight-r)/2;const a=window.open(t,"isometrik_instagram_oauth",`width=${o},height=${r},left=${s},top=${n},resizable=yes,scrollbars=yes`);if(!a){sessionStorage.removeItem(I);window.location.href=t;e({redirected:true});return}let c=false;const l=t=>{if(c)return;c=true;sessionStorage.removeItem(I);window.removeEventListener("message",d);clearInterval(h);try{if(!a.closed)a.close()}catch(t){}e(t)};const d=t=>{if(t.origin!==window.location.origin)return;if(t.data?.type!==j)return;if(!t.data?.zernioAccountId)return;l({zernioAccountId:t.data.zernioAccountId,username:t.data.username||"",displayName:t.data.displayName||"",platform:t.data.platform||"instagram"})};window.addEventListener("message",d);const h=setInterval((()=>{if(a.closed){l({cancelled:true});return}try{const t=a.location.href;if(!t||t==="about:blank")return;if(!t.startsWith(window.location.origin))return;const e=L(a.location.search);if(e)l(e)}catch(t){}}),400)}));const D=async({baseUrl:t,appSecret:e,licenseKey:i,platform:o="instagram",redirectUrl:r,loginMethod:s="instagram_login"}={})=>{const n=E({baseUrl:t,appSecret:e,licenseKey:i});const a=await fetch(`${n.baseUrl}/chat/social/connect`,{method:"POST",headers:B(n.appSecret,n.licenseKey),body:JSON.stringify({platform:o,redirectUrl:r||T(),loginMethod:s})});const c=await a.json();if(!a.ok){throw new Error(c.message||"Failed to connect social account")}return c};const O=async({baseUrl:t,appSecret:e,licenseKey:i,platform:o="instagram",username:r="",displayName:s="",loginMethod:n="instagram_login"}={})=>{const a=E({baseUrl:t,appSecret:e,licenseKey:i});const c=await R({baseUrl:a.baseUrl,appSecret:a.appSecret,licenseKey:a.licenseKey,platform:o});const l=c?.accounts?.[0]?.zernioAccountId||c?.accounts?.[0]?.accountId;if(!l){throw new Error("No zernioAccountId found from social accounts API")}const d=await fetch(`${a.baseUrl}/chat/social/connect/callback`,{method:"POST",headers:B(a.appSecret,a.licenseKey),body:JSON.stringify({platform:o,zernioAccountId:l,agentUserId:w.isometrikUserId,username:r,displayName:s,loginMethod:n})});const h=await d.json();if(!d.ok){throw new Error(h.message||"Failed to complete social account connect")}return h};const H=(t=[])=>(t||[]).some((t=>t&&(t.zernioAccountId||t.accountId)&&t.status==="connected"));const P=(t=[])=>(t||[]).filter((t=>t&&(t.zernioAccountId||t.accountId)&&t.status==="connected"));const R=async({baseUrl:t,appSecret:e,licenseKey:i,platform:o="instagram"}={})=>{const r=E({baseUrl:t,appSecret:e,licenseKey:i});const s=new URLSearchParams({platform:o});const n=await fetch(`${r.baseUrl}/chat/social/accounts?${s.toString()}`,{method:"GET",headers:B(r.appSecret,r.licenseKey)});const a=await n.json();if(!n.ok){throw new Error(a.message||"Failed to fetch social accounts")}return a};const F=async({baseUrl:t,appSecret:e,licenseKey:i,accountId:o}={})=>{const r=E({baseUrl:t,appSecret:e,licenseKey:i});const s=await fetch(`${r.baseUrl}/chat/social/accounts/${o}`,{method:"DELETE",headers:B(r.appSecret,r.licenseKey)});const n=await s.json().catch((()=>({})));if(!s.ok){throw new Error(n.message||"Failed to delete social account")}return n};const q=":host{display:block;height:100%}profile-tab{display:block;height:100%}.profile-container{padding:24px 20px;background-color:var(--bg-primary-color);font-family:var(--font-sans);height:100%}.profile-header{font-size:var(--title-font-size, 22px);font-weight:600;letter-spacing:-0.03em;margin-left:4px;color:var(--text-primary-color)}.photo-container{display:flex;justify-content:center;margin-bottom:32px;position:relative}.profile-photo{width:128px;height:128px;border-radius:50%;background-color:var(--bg-secondary-color);display:flex;flex-direction:column;justify-content:center;align-items:center;overflow:hidden;position:relative;cursor:pointer}.photo-wrapper{position:relative;width:100%;height:100%}.hover-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:var(--overlay-color);display:flex;flex-direction:column;align-items:center;justify-content:center;opacity:0;transition:opacity var(--duration) var(--ease-out);border-radius:50%}.photo-wrapper:hover .hover-overlay{opacity:1}.photo-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100%}.camera-icon{background-color:var(--bg-incoming-message);width:44px;height:44px;border-radius:50%;display:flex;justify-content:center;align-items:center;margin-bottom:5px}.camera-icon svg{color:var(--text-incoming-message);width:22px;height:22px}.add-text,.change-text{font-size:12px;text-align:center;padding:0 15px;color:var(--white)}.form-group{margin-bottom:24px}.label{font-size:13px;color:var(--text-secondary-color);margin-bottom:8px;display:block}.input-container{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--border-subtle);padding-bottom:10px}.input-text{font-size:16px;color:var(--text-primary-color)}.edit-button{background:none;border:none;cursor:pointer;color:var(--text-secondary-color);padding:5px}.helper-text{font-size:12px;color:var(--text-secondary-color);margin-top:8px}.file-input{display:none}.name-input{background:none;border:none;color:var(--text-primary-color);font-size:16px;width:100%;padding:0;outline:none;font-family:inherit}.upload-progress{width:80%;display:flex;flex-direction:column;align-items:center}.d-flex{display:flex}.flex-direction-column{flex-direction:column}.align-center{align-items:center}.spinner-overlay{height:100%;width:100%;display:flex;align-items:center;justify-content:center}.update-actions{display:flex;gap:10px;margin-top:20px}.update-button,.cancel-button{padding:8px 16px;border-radius:var(--radius-sm);font-weight:500;cursor:pointer;border:none;transition:transform 120ms var(--ease-out), filter 180ms var(--ease-out);font-size:14px;font-family:inherit}.update-button{background-color:var(--base-color);color:var(--white)}.update-button:hover{filter:brightness(1.06)}.update-button:active{transform:scale(0.98)}.cancel-button{background-color:var(--bg-grey-color);color:var(--text-primary-color)}.cancel-button:hover{filter:brightness(0.97)}.cancel-button:active{transform:scale(0.98)}.update-button:disabled,.cancel-button:disabled{opacity:0.6;cursor:not-allowed;transform:none}.header-profile{display:flex;align-items:center;flex-direction:row;margin-top:10px;margin-bottom:30px}.header-profile svg{display:none}@media (max-width: 480px){.update-actions{flex-direction:column}.header-profile svg{display:block}.update-button,.cancel-button{width:100%}}";const Z=q;const G=class{constructor(i){t(this,i);this.InstagramAccountsChanged=e(this,"InstagramAccountsChanged",7);this.loadSocialAccounts=async()=>{this.isSocialLoading=true;try{const t=await R({platform:"instagram"});this.socialAccounts=(t===null||t===void 0?void 0:t.accounts)||[];this.InstagramAccountsChanged.emit(this.socialAccounts)}catch(t){console.error("Failed to load social accounts:",t);this.socialAccounts=[];this.InstagramAccountsChanged.emit([])}finally{this.isSocialLoading=false}};this.completeSocialCallback=async t=>{await O({platform:t.platform||"instagram",username:t.username||"",displayName:t.displayName||"",loginMethod:"instagram_login"});await this.loadSocialAccounts();y({message:"Instagram connected",type:"success",position:"bottom-right"})};this.handleConnectInstagram=async()=>{this.isSocialLoading=true;try{const t=await D({platform:"instagram",redirectUrl:T(),loginMethod:"instagram_login"});if(!(t===null||t===void 0?void 0:t.authUrl))throw new Error("No auth URL returned");const e=await N(t.authUrl);if(e===null||e===void 0?void 0:e.redirected)return;if(e===null||e===void 0?void 0:e.cancelled){await this.loadSocialAccounts();return}await this.completeSocialCallback(e||{})}catch(t){console.error("Failed to connect Instagram:",t);y({message:(t===null||t===void 0?void 0:t.message)||"Failed to connect Instagram",type:"error",position:"bottom-right"})}finally{this.isSocialLoading=false}};this.handleDisconnectInstagram=(t,e)=>{b.openDialog("confirm-dialog",{title:"Disconnect Instagram",description:`Disconnect @${e||"this account"}?`,handleConfirm:async()=>{b.closeDialog("confirm-dialog");this.isSocialLoading=true;try{await F({accountId:t});await this.loadSocialAccounts();y({message:"Instagram disconnected",type:"success",position:"bottom-right"})}catch(t){console.error("Failed to disconnect Instagram:",t);y({message:(t===null||t===void 0?void 0:t.message)||"Failed to disconnect Instagram",type:"error",position:"bottom-right"})}finally{this.isSocialLoading=false}}})};this.validateNameInput=t=>{var e;return(e=t===null||t===void 0?void 0:t.toLowerCase())===null||e===void 0?void 0:e.replace(/[^a-z0-9_]/g,"").slice(0,20)};this.handleNameEdit=()=>{this.isEditingName=true;requestAnimationFrame((()=>{var t,e;const i=(t=this.el.shadowRoot)===null||t===void 0?void 0:t.querySelector("profile-tab");const o=(e=i===null||i===void 0?void 0:i.shadowRoot)===null||e===void 0?void 0:e.querySelector(".name-input");if(o){o.focus();const t=o.value.length;o.setSelectionRange(t,t)}}))};this.handleNameChange=t=>{const e=t.target;const i=e.value;const o=e.selectionStart||0;this.newName=this.validateNameInput(i);if(this.newName!==i){const t=i.substring(0,o);const r=this.validateNameInput(t);const s=t.length-r.length;e.value=this.newName;const n=Math.max(0,o-s);setTimeout((()=>{e.setSelectionRange(n,n)}),0)}};this.handleNameSave=async()=>{try{if(this.newName!==this.name){await this.updateUserProfile({name:this.newName});await this.getUserDetails()}this.isEditingName=false}catch(t){console.error("Error saving name:",t)}};this.handleNameKeyDown=t=>{if(t.key==="Enter"){this.handleNameSave()}else if(t.key==="Escape"){this.newName=this.name;this.isEditingName=false}};this.handleFileChange=async t=>{var e;const i=t.target;const o=(e=i.files)===null||e===void 0?void 0:e[0];if(!o)return;try{this.selectedFile=o;const t=URL.createObjectURL(o);this.tempProfilePhotoUrl=t;i.value=""}catch(t){console.error("Error handling file selection:",t);i.value=""}};this.handleManualUpdate=async()=>{if(!this.selectedFile&&this.newName===this.name){y({message:"No changes to update",type:"info",position:"bottom-right"});return}try{this.isLoading=true;let t=this.profilePhotoUrl;if(this.selectedFile){t=await this.getPresignedUrl(this.selectedFile)}await this.updateUserProfile({name:this.newName!==this.name?this.newName:undefined,profilePhotoUrl:this.selectedFile?t:undefined});if(this.selectedFile){if(this.tempProfilePhotoUrl&&this.tempProfilePhotoUrl.startsWith("blob:")){URL.revokeObjectURL(this.tempProfilePhotoUrl)}this.tempProfilePhotoUrl=this.profilePhotoUrl;this.selectedFile=null}await this.getUserDetails()}catch(t){console.error("Error updating profile:",t);this.isLoading=false}};this.cancelChanges=()=>{this.newName=this.name;this.isEditingName=false;if(this.selectedFile){this.selectedFile=null;if(this.tempProfilePhotoUrl&&this.tempProfilePhotoUrl.startsWith("blob:")){URL.revokeObjectURL(this.tempProfilePhotoUrl)}this.tempProfilePhotoUrl=this.profilePhotoUrl}};this.name="";this.profilePhotoUrl="";this.isEditingName=false;this.newName="";this.isLoading=false;this.selectedFile=null;this.tempProfilePhotoUrl="";this.socialAccounts=[];this.isSocialLoading=false;this.conversationId="";this.getUserDetails=undefined;this.closeDrawer=undefined;this.toggleTheme=undefined;this.defaultTheme=undefined;this.agentUserId=""}get connectedAccounts(){return P(this.socialAccounts)}componentWillLoad(){this.newName=this.name;this.tempProfilePhotoUrl=this.profilePhotoUrl;this.loadSocialAccounts()}async getPresignedUrl(t){try{const e=t.name.split(".").pop();const i=await l.getInstance().user.getPresignedurlUpdate({mediaExtension:e});await fetch(i.presignedUrl,{method:"PUT",body:t,headers:{"Content-Type":t.type}});return i.mediaUrl}catch(t){console.error("Error getting presigned URL or uploading file:",t);throw t}}async updateUserProfile(t){this.isLoading=true;try{await l.getInstance().user.patchUser({userName:t.name,userProfileImageUrl:t.profilePhotoUrl});if(t.name){this.name=t.name}if(t.profilePhotoUrl){this.profilePhotoUrl=t.profilePhotoUrl}this.isLoading=false;y({message:"Profile Updated Successfully!",type:"success",position:"bottom-right"})}catch(t){this.isLoading=false;y({message:"Failed to update profile",type:"error",position:"bottom-right"});console.error("Error updating user profile:",t);throw t}}render(){const t=this.newName!==this.name||this.selectedFile!==null;return i("profile-tab",{key:"3d52f731efb0616b6c366191c7f333c8d1b175c7",name:this.name,isLoading:this.isLoading,tempProfilePhotoUrl:this.tempProfilePhotoUrl,isEditingName:this.isEditingName,newName:this.newName,hasChanges:t,handleNameEdit:this.handleNameEdit,handleNameChange:this.handleNameChange,handleNameKeyDown:this.handleNameKeyDown,handleNameSave:this.handleNameSave,handleFileChange:this.handleFileChange,handleManualUpdate:this.handleManualUpdate,cancelChanges:this.cancelChanges,closeDrawer:this.closeDrawer,defaultTheme:this.defaultTheme,toggleTheme:this.toggleTheme,socialAccounts:this.connectedAccounts,isSocialLoading:this.isSocialLoading,handleConnectInstagram:this.handleConnectInstagram,handleDisconnectInstagram:this.handleDisconnectInstagram})}get el(){return o(this)}};G.style=Z;function _(t){const e=new Date(t);const i=new Date(e.toLocaleString("en-US",{timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone}));const o=new Date;const r=i.getDate()===o.getDate()&&i.getMonth()===o.getMonth()&&i.getFullYear()===o.getFullYear();const s=t=>{let e=t.getHours();const i=t.getMinutes().toString().padStart(2,"0");const o=e>=12?"PM":"AM";e=e%12||12;const r=e.toString().padStart(2,"0");return`${r}:${i} ${o}`};const n=t=>{const e=t.getDate().toString().padStart(2,"0");const i=(t.getMonth()+1).toString().padStart(2,"0");const o=t.getFullYear();return`${e}/${i}/${o}`};return r?s(i):n(i)}class Y extends s{static properties={mediaArray:{type:Array},padding:{type:String},bgColor:{type:String},borderRadius:{type:String},border:{type:String},color:{type:String},height:{type:String},width:{type:String},showGallery:{type:Boolean},selectedIndex:{type:Number}};constructor(){super();this.showGallery=false;this.selectedIndex=0}static styles=c`
|
|
790
|
+
:host {
|
|
791
|
+
display: block;
|
|
792
|
+
width: 100%;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
.media-list {
|
|
796
|
+
display: flex;
|
|
797
|
+
flex-direction: column;
|
|
798
|
+
gap: 10px;
|
|
799
|
+
width: 100%;
|
|
800
|
+
box-sizing: border-box;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
.media-list-body {
|
|
804
|
+
display: grid;
|
|
805
|
+
grid-template-columns: repeat(3, 1fr);
|
|
806
|
+
gap: 10px;
|
|
807
|
+
width: 100%;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
.media-item {
|
|
811
|
+
aspect-ratio: 1/1;
|
|
812
|
+
width: 100%;
|
|
813
|
+
min-width: 80px;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
.media-list-body img {
|
|
817
|
+
cursor: pointer;
|
|
818
|
+
transition: transform 0.2s ease;
|
|
819
|
+
width: 100%;
|
|
820
|
+
height: 100%;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
.media-list-body img:hover {
|
|
824
|
+
transform: scale(1.05);
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
.media-gallery-container {
|
|
828
|
+
position: fixed;
|
|
829
|
+
top: 0;
|
|
830
|
+
left: 0;
|
|
831
|
+
width: 100%;
|
|
832
|
+
height: 100dvh;
|
|
833
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
834
|
+
z-index: 1000;
|
|
835
|
+
display: flex;
|
|
836
|
+
justify-content: center;
|
|
837
|
+
align-items: center;
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
.media-gallery-container media-gallery {
|
|
841
|
+
width: 100%;
|
|
842
|
+
height: 100%;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
`;_handleClose(){this.dispatchEvent(new CustomEvent("media-list-close"))}_handleMediaClick(t){this.selectedIndex=t;this.showGallery=true}_handleGalleryClose(){this.showGallery=false}render(){const t=this.mediaArray.map((t=>({attachments:[{mediaUrl:t,mimeType:t.match(/\.(jpg|jpeg|png|gif)$/i)?"image/jpeg":t.match(/\.(mp4|mov|avi)$/i)?"video/mp4":t.match(/\.(mp3|wav|webm|ogg|m4a|aac)$/i)?"audio/mpeg":"application/octet-stream"}]})));return n`
|
|
846
|
+
${this.showGallery?n`
|
|
847
|
+
<div class="media-gallery-container">
|
|
848
|
+
<media-gallery
|
|
849
|
+
.allAttachments="${t}"
|
|
850
|
+
.mainImageIndex=${this.selectedIndex}
|
|
851
|
+
.images="${this.mediaArray}"
|
|
852
|
+
@close=${this._handleGalleryClose}
|
|
853
|
+
></media-gallery>
|
|
854
|
+
</div>`:n`<div
|
|
855
|
+
class="media-list"
|
|
856
|
+
style="height: ${this.height}; width: ${this.width}; padding: ${this.padding}; background-color: ${this.bgColor}; border-radius: ${this.borderRadius}; border: ${this.border}; color: ${this.color}; overflow: auto;"
|
|
857
|
+
>
|
|
858
|
+
<div class="media-list-body">
|
|
859
|
+
${this.mediaArray.map(((t,e)=>n`<div class="media-item" @click=${()=>this._handleMediaClick(e)}>
|
|
860
|
+
${a({src:t,alt:"Media",height:"100%",width:"100%",objectFit:"cover",backgroundColor:"var(--base-color)",borderRadius:"15px",placeholderImage:t.match(/\.(jpg|jpeg|png|gif)$/i)===0?$:t.match(/\.(mp4|mov|avi)$/i)?C:S})}
|
|
861
|
+
</div>`))}
|
|
862
|
+
</div>
|
|
863
|
+
</div>`}`}}customElements.define("media-list",Y);const V=(t,e,i,o)=>{let r=e.get(o);if(!r){r=new WeakRef(o);e.set(o,r)}let s=t.get(i);if(!s){s=new Set;t.set(i,s)}s.add(r)};const W=(t,e)=>{let i;return(...o)=>{if(i){clearTimeout(i)}i=setTimeout((()=>{i=0;t(...o)}),e)}};const K=t=>!("isConnected"in t)||t.isConnected;const Q=W((t=>{t.forEach(((e,i)=>{const o=new Set;e.forEach((t=>{const e=t.deref();if(e&&K(e))o.add(t)}));t.set(i,o)}))}),2e3);const X=r;const J=X.forceUpdate;const tt=X.getRenderingRef;const et=()=>{if(typeof tt!=="function"||typeof J!=="function"){return{}}const t=J;const e=tt;const i=new WeakMap;const o=new Map;return{dispose:()=>o.clear(),get:t=>{const r=e();if(r){V(o,i,t,r)}},set:e=>{const i=o.get(e);if(i){const r=new Set;i.forEach((e=>{const i=e.deref();if(i&&t(i))r.add(e)}));o.set(e,r)}Q(o)},reset:()=>{o.forEach((e=>{e.forEach((e=>{const i=e.deref();if(i)t(i)}))}));Q(o)}}};const it=t=>typeof t==="function"?t():t;const ot=(t,e=((t,e)=>t!==e))=>{const i=()=>it(t)??{};const o=i();let r=new Map(Object.entries(o));const s=typeof Proxy!=="undefined";const n=s?null:{};const a={dispose:[],get:[],set:[],reset:[]};const c=new Map;const l=()=>{r=new Map(Object.entries(i()));if(!s){y()}a.reset.forEach((t=>t()))};const d=()=>{a.dispose.forEach((t=>t()));l()};const h=t=>{a.get.forEach((e=>e(t)));return r.get(t)};const p=(t,i)=>{const o=r.get(t);if(e(i,o,t)){r.set(t,i);if(!s){x(t)}a.set.forEach((e=>e(t,i,o)))}};const g=s?new Proxy(o,{get(t,e){return h(e)},ownKeys(t){return Array.from(r.keys())},getOwnPropertyDescriptor(){return{enumerable:true,configurable:true}},has(t,e){return r.has(e)},set(t,e,i){p(e,i);return true}}):(()=>{y();return n})();const u=(t,e)=>{a[t].push(e);return()=>{rt(a[t],e)}};const m=(t,e)=>{const o=(i,o)=>{if(i===t){e(o)}};const r=()=>{const o=i();e(o[t])};const s=u("set",o);const n=u("reset",r);c.set(e,{setHandler:o,resetHandler:r,propName:t});return()=>{s();n();c.delete(e)}};const b=(...t)=>{const e=t.reduce(((t,e)=>{if(e.set){t.push(u("set",e.set))}if(e.get){t.push(u("get",e.get))}if(e.reset){t.push(u("reset",e.reset))}if(e.dispose){t.push(u("dispose",e.dispose))}return t}),[]);return()=>e.forEach((t=>t()))};const f=t=>{const e=r.get(t);a.set.forEach((i=>i(t,e,e)))};const v=(t,e)=>{const i=c.get(e);if(i&&i.propName===t){rt(a.set,i.setHandler);rt(a.reset,i.resetHandler);c.delete(e)}};function x(t){if(s||!n){return}if(Object.prototype.hasOwnProperty.call(n,t)){return}Object.defineProperty(n,t,{configurable:true,enumerable:true,get(){return h(t)},set(e){p(t,e)}})}function y(){if(s||!n){return}const t=new Set(r.keys());for(const e of Object.keys(n)){if(!t.has(e)){delete n[e]}}for(const e of t){x(e)}}return{state:g,get:h,set:p,on:u,onChange:m,use:b,dispose:d,reset:l,forceUpdate:f,removeListener:v}};const rt=(t,e)=>{const i=t.indexOf(e);if(i>=0){t[i]=t[t.length-1];t.length--}};const st=(t,e)=>{const i=ot(t,e);i.use(et());return i};const{state:nt}=st({members:[],currentConversationId:null});const at={state:nt,initializeMembers(t,e){nt.members=t;nt.currentConversationId=e},updateAdminStatus(t,e){nt.members=nt.members.map((i=>i.userId===t?Object.assign(Object.assign({},i),{isAdmin:e}):i))},getMembers(){return nt.members},getCurrentConversationId(){return nt.currentConversationId}};const ct="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDBweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSI0MHB4IiBmaWxsPSIjZThlYWVkIj48cGF0aCBkPSJNNDQ2LjY3LTI4MEgyODBxLTgzIDAtMTQxLjUtNTguNVQ4MC00ODBxMC04MyA1OC41LTE0MS41VDI4MC02ODBoMTY2LjY3djY2LjY3SDI4MHEtNTUuNTYgMC05NC40NCAzOC44NC0zOC44OSAzOC44NC0zOC44OSA5NC4zMyAwIDU1LjQ5IDM4Ljg5IDk0LjQ5IDM4Ljg4IDM5IDk0LjQ0IDM5aDE2Ni42N1YtMjgwWk0zMjMuMzMtNDQ2LjY3di02Ni42NmgzMTMuMzR2NjYuNjZIMzIzLjMzWm0xOTAgMTY2LjY3di02Ni42N0g2ODBxNTUuNTYgMCA5NC40NC0zOC44NCAzOC44OS0zOC44NCAzOC44OS05NC4zMyAwLTU1LjQ5LTM4Ljg5LTk0LjQ5LTM4Ljg4LTM5LTk0LjQ0LTM5SDUxMy4zM1YtNjgwSDY4MHE4MyAwIDE0MS41IDU4LjVUODgwLTQ4MHEwIDgzLTU4LjUgMTQxLjVUNjgwLTI4MEg1MTMuMzNaIi8+PC9zdmc+";class lt extends s{static properties={url:{type:String},isRead:{type:Boolean},isDelivered:{type:String},time:{type:String},textColor:{type:String},message:{type:String},backgroundColor:{type:String},isSelf:{type:Boolean},mentionedUsers:{type:Array},preview:{type:Object},isMessageInfo:{type:Boolean},isShowFooter:{type:Boolean},showReactionButton:{type:Boolean},showEmojiReactions:{type:Boolean},messageId:{type:String},reactions:{type:Object},showConfirmationPopup:{type:Boolean},selectedEmojiToRemove:{type:Object},showAllReactionsPopup:{type:Boolean},userMetaData:{type:Object},messageType:{type:Number},timeColor:{type:String},showReactionOnHover:{type:Boolean}};constructor(){super();this.url="";this.isRead=false;this.isDelivered="";this.time="";this.textColor="";this.message="";this.backgroundColor="";this.isSelf=false;this.mentionedUsers=[];this.preview=null;this.isMessageInfo=false;this.isShowFooter=true;this.isLoading=false;this.showReactionButton=false;this.showEmojiReactions=false;this.reactions={};this.showAllReactionsPopup=false;this.showReactionOnHover=false}static styles=c`
|
|
864
|
+
:host {
|
|
865
|
+
display: block;
|
|
866
|
+
}
|
|
867
|
+
.emoji-slider {
|
|
868
|
+
position: absolute;
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
emoji-reactions {
|
|
872
|
+
position: absolute;
|
|
873
|
+
top: 15px;
|
|
874
|
+
z-index: 99;
|
|
875
|
+
left: 0;
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
.reaction-button {
|
|
879
|
+
position: absolute;
|
|
880
|
+
top: 50%;
|
|
881
|
+
right: -25px;
|
|
882
|
+
transform: translateY(-50%);
|
|
883
|
+
cursor: pointer;
|
|
884
|
+
z-index: 100;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
.message-container {
|
|
888
|
+
position: relative;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
.link-container {
|
|
892
|
+
border-radius: var(--radius-bubble);
|
|
893
|
+
max-width: 500px;
|
|
894
|
+
width: fit-content;
|
|
895
|
+
box-shadow: none;
|
|
896
|
+
border: 1px solid var(--bubble-border, var(--primary));
|
|
897
|
+
overflow: hidden;
|
|
898
|
+
}
|
|
899
|
+
.link-container.is-self {
|
|
900
|
+
border-color: transparent;
|
|
901
|
+
}
|
|
902
|
+
.link-footer {
|
|
903
|
+
border: 1px solid var(--bubble-border, var(--primary));
|
|
904
|
+
border-radius: var(--radius-bubble);
|
|
905
|
+
width: 100%;
|
|
906
|
+
background: var(--bg-incoming-message);
|
|
907
|
+
box-shadow: none;
|
|
908
|
+
}
|
|
909
|
+
.link-container-info {
|
|
910
|
+
border: 1px solid var(--bubble-border, var(--primary));
|
|
911
|
+
border-radius: var(--radius-bubble);
|
|
912
|
+
width: 80%;
|
|
913
|
+
background: var(--bg-incoming-message);
|
|
914
|
+
box-shadow: none;
|
|
915
|
+
}
|
|
916
|
+
.link-preview {
|
|
917
|
+
background-color: var(--bg-primary-light);
|
|
918
|
+
border-radius: 0;
|
|
919
|
+
max-width: 240px;
|
|
920
|
+
}
|
|
921
|
+
.link-preview-footer {
|
|
922
|
+
border: 1px solid var(--bubble-border, var(--primary));
|
|
923
|
+
border-radius: var(--radius-bubble);
|
|
924
|
+
width: 100%;
|
|
925
|
+
display: flex;
|
|
926
|
+
flex-direction: row;
|
|
927
|
+
background: var(--bg-incoming-message);
|
|
928
|
+
box-shadow: none;
|
|
929
|
+
}
|
|
930
|
+
.preview-image {
|
|
931
|
+
width: 100%;
|
|
932
|
+
height: 200px;
|
|
933
|
+
background: #f5f5f5;
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
.preview-image img {
|
|
937
|
+
width: 100%;
|
|
938
|
+
height: 100%;
|
|
939
|
+
object-fit: cover;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
.preview-content {
|
|
943
|
+
padding: 12px;
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
.preview-title {
|
|
947
|
+
margin: 0 0 8px;
|
|
948
|
+
font-size: 1.1rem;
|
|
949
|
+
color: var(--text-secondary-color);
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
.preview-description {
|
|
953
|
+
margin: 0 0 12px;
|
|
954
|
+
color: #666;
|
|
955
|
+
font-size: 0.9rem;
|
|
956
|
+
line-height: 1.4;
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
/* Updated footer styles */
|
|
960
|
+
.preview-footer {
|
|
961
|
+
display: flex;
|
|
962
|
+
max-width: 600px;
|
|
963
|
+
flex-direction: column;
|
|
964
|
+
gap: 4px;
|
|
965
|
+
}
|
|
966
|
+
.preview-message {
|
|
967
|
+
padding-top: 10px;
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
.message-footer {
|
|
971
|
+
display: flex;
|
|
972
|
+
align-items: center;
|
|
973
|
+
justify-content: flex-end;
|
|
974
|
+
gap: 4px;
|
|
975
|
+
margin-top: 2px;
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
.message-footer > div {
|
|
979
|
+
display: flex;
|
|
980
|
+
align-items: center;
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
.link-preview-loading {
|
|
984
|
+
padding: 12px;
|
|
985
|
+
text-align: center;
|
|
986
|
+
color: #666;
|
|
987
|
+
}
|
|
988
|
+
@keyframes shimmer {
|
|
989
|
+
0% {
|
|
990
|
+
background-position: -1000px 0;
|
|
991
|
+
}
|
|
992
|
+
100% {
|
|
993
|
+
background-position: 1000px 0;
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
.remaining-count {
|
|
998
|
+
background-color: var(--bg-primary-light);
|
|
999
|
+
font-size: 14px;
|
|
1000
|
+
display: flex;
|
|
1001
|
+
justify-content: center;
|
|
1002
|
+
color: var(--text-primary-color);
|
|
1003
|
+
width: 25px;
|
|
1004
|
+
cursor: pointer;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
.all-reactions-popup-overlay {
|
|
1008
|
+
position: fixed;
|
|
1009
|
+
height: 100vh;
|
|
1010
|
+
width: 100vw;
|
|
1011
|
+
top: 0;
|
|
1012
|
+
left: 0;
|
|
1013
|
+
display: flex;
|
|
1014
|
+
align-items: center;
|
|
1015
|
+
justify-content: center;
|
|
1016
|
+
background: var(--overlay-color);
|
|
1017
|
+
z-index: 99;
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
.all-reactions-popup {
|
|
1021
|
+
background: var(--bg-primary-color);
|
|
1022
|
+
border: 1px solid var(--border-primary-color);
|
|
1023
|
+
border-radius: 8px;
|
|
1024
|
+
padding: 12px;
|
|
1025
|
+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
|
1026
|
+
z-index: 1000;
|
|
1027
|
+
top: 50%;
|
|
1028
|
+
left: 50%;
|
|
1029
|
+
transform: translate(-50%, -50%);
|
|
1030
|
+
min-width: 150px;
|
|
1031
|
+
color: var(--text-primary-color);
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
.all-reactions-heading {
|
|
1035
|
+
display: flex;
|
|
1036
|
+
align-items: center;
|
|
1037
|
+
width: 100%;
|
|
1038
|
+
justify-content: space-between;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
.all-reactions-heading h3 {
|
|
1042
|
+
margin: 0
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
.all-reactions-heading button {
|
|
1046
|
+
cursor: pointer;
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
.all-reactions-list {
|
|
1050
|
+
display: flex;
|
|
1051
|
+
align-items: center;
|
|
1052
|
+
gap: 10px;
|
|
1053
|
+
font-size: 32px;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
.reactions-display {
|
|
1057
|
+
position: absolute;
|
|
1058
|
+
bottom: -10px;
|
|
1059
|
+
right: 10px;
|
|
1060
|
+
display: grid;
|
|
1061
|
+
grid-template-columns: repeat(3, auto);
|
|
1062
|
+
gap: 0;
|
|
1063
|
+
margin-top: 4px;
|
|
1064
|
+
background-color: transparent;
|
|
1065
|
+
}
|
|
1066
|
+
reaction-container {
|
|
1067
|
+
display: block;
|
|
1068
|
+
min-height: 150px;
|
|
1069
|
+
max-height: fit-content;
|
|
1070
|
+
min-width: 300px;
|
|
1071
|
+
max-width: 400px;
|
|
1072
|
+
position: absolute;
|
|
1073
|
+
z-index: 100;
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
.reaction-item {
|
|
1077
|
+
display: flex;
|
|
1078
|
+
align-items: center;
|
|
1079
|
+
gap: 2px;
|
|
1080
|
+
border-radius: 12px;
|
|
1081
|
+
font-size: 20px;
|
|
1082
|
+
background: var(--bg-secondary-color);
|
|
1083
|
+
cursor: pointer;
|
|
1084
|
+
}
|
|
1085
|
+
.shimmer-loading {
|
|
1086
|
+
background: linear-gradient(to right, rgba(214, 222, 249, 0.47) 0%, rgba(212, 211, 240, 0.2) 50%, rgba(189, 188, 239, 0.45) 100%);
|
|
1087
|
+
background-size: 1000px 100%;
|
|
1088
|
+
animation: shimmer 2s infinite linear;
|
|
1089
|
+
}
|
|
1090
|
+
`;calculateEmojiPosition(){return calculateEmojiPosition(this)}handleMouseEnter(){if(showReactionOnHover){this.showReactionButton=true}}handleMouseLeave(t){const e=this.renderRoot.querySelector(".message-container");const i=this.renderRoot.querySelector("emoji-reactions");const o=this.renderRoot.querySelector(".reaction-button");const r=this.showEmojiReactions;const s=e?.contains(t.relatedTarget);const n=i&&i?.contains(t.relatedTarget);const a=o&&o?.contains(t.relatedTarget);if(!s&&!n&&!a){this.showReactionButton=false;if(!r){this.showEmojiReactions=false}}}handleOutsideClick=t=>{const e=this.renderRoot.querySelector("emoji-reactions");const i=this.renderRoot.querySelector(".message-container");const o=this.renderRoot.querySelector("reaction-container");const r=t.composedPath();if(this.showEmojiReactions&&!r.includes(e)&&!r.includes(i)||this.showConfirmationPopup&&!r.includes(o)&&!r.includes(i)){this.showEmojiReactions=false;this.showConfirmationPopup=false;document.removeEventListener("click",this.handleOutsideClick)}};toggleEmojiReactions(){this.showConfirmationPopup=false;this.showEmojiReactions=!this.showEmojiReactions;if(this.showEmojiReactions){setTimeout((()=>{document.addEventListener("click",this.handleOutsideClick)}),100)}}handleReactionRemove(t){this.showEmojiReactions=false;this.showConfirmationPopup=true;this.selectedEmojiToRemove=t;setTimeout((()=>{document.addEventListener("click",this.handleOutsideClick)}),100)}async willUpdate(t){if(t.has("url")){await this.fetchMetadata()}}isValidUrl(t){try{if(typeof t!=="string"||!t.trim()){return false}const e=new URL(t);return(e.protocol==="http:"||e.protocol==="https:")&&e.hostname.length>0&&/^[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(e.hostname)}catch(t){return false}}getAbsoluteUrl(t,e){if(!t)return"";if(this.isValidUrl(t)){return t}try{const i=new URL(e);if(t.startsWith("//")){return`${i.protocol}${t}`}else if(t.startsWith("/")){return`${i.origin}${t}`}else{return new URL(t,i.origin).toString()}}catch(e){console.error("Error creating absolute URL:",e);return t}}async fetchMetadata(){this.isLoading=true;try{const t=await this.fetchWithFallbackProxies(this.url);const e=await t.text();this.preview=this.extractMetadata(e);if(!this.preview.title&&!this.preview.description){const t=new DOMParser;const i=t.parseFromString(e,"text/html");this.preview.title=this.preview.title||i.querySelector("title")?.textContent||new URL(this.url).hostname;this.preview.description=this.preview.description||i.querySelector("p")?.textContent?.slice(0,150)||this.url;if(!this.preview.image){const t=i.querySelector("img");if(t){const e=t.getAttribute("src");this.preview.image=this.getAbsoluteUrl(e,this.url)}}}}catch(t){console.error("Error fetching link preview:",t);this.preview=null}finally{this.isLoading=false}}async fetchWithFallbackProxies(t){const e=["https://api.allorigins.win/raw?url="];const i=5e3;let o;for(const r of e){try{const e=new AbortController;const o=setTimeout((()=>e.abort()),i);const s=await fetch(`${r}${encodeURIComponent(t)}`,{signal:e.signal});clearTimeout(o);if(s.ok){return s}}catch(t){o=t;this.preview={}}}throw o||new Error("All proxies failed")}extractMetadata(t){const e=new DOMParser;const i=e.parseFromString(t,"text/html");const o=t=>{for(const e of t){const t=i.querySelector(e);if(t&&t.getAttribute("content")){return t.getAttribute("content")}}return""};const r=o(['meta[property="og:title"]','meta[name="twitter:title"]'])||i.querySelector("title")?.textContent||"";const s=o(['meta[property="og:description"]','meta[name="twitter:description"]','meta[name="description"]'])||"";const n=o(['meta[property="og:image"]','meta[name="twitter:image"]','meta[property="og:image:url"]']);const a=this.getAbsoluteUrl(n,this.url);return{title:r,description:s,image:a}}handleMentionClick=t=>{this.dispatchEvent(new CustomEvent("tagUserClick",{detail:{userId:t?.userId,userName:t?.userName},bubbles:true,composed:true}))};handleEmojiClick(t){const e=this.userMetaData?.userId;const i=this.reactions[t.id]||[];const o=i.includes(e);let r=null;for(const[t,i]of Object.entries(this.reactions)){if(i.includes(e)){r=t;break}}if(r&&r!==t.id){this.dispatchEvent(new CustomEvent("reaction-removed",{detail:{messageId:this.messageId,emojiId:r},bubbles:true,composed:true}))}if(o){this.dispatchEvent(new CustomEvent("reaction-removed",{detail:{messageId:this.messageId,emojiId:t.id},bubbles:true,composed:true}))}else{this.dispatchEvent(new CustomEvent("reaction-added",{detail:{messageId:this.messageId,emojiId:t.id},bubbles:true,composed:true}))}this.showEmojiReactions=false;document.removeEventListener("click",this.handleOutsideClick)}handleConfirmRemove(){if(this.selectedEmojiToRemove){this.dispatchEvent(new CustomEvent("reaction-removed",{detail:{messageId:this.messageId,emojiId:this.selectedEmojiToRemove.emojiId},bubbles:true,composed:true}))}this.closeConfirmationPopup()}closeConfirmationPopup(){this.showConfirmationPopup=false;this.selectedEmojiToRemove=null}toggleAllReactionsPopup(){this.showAllReactionsPopup=!this.showAllReactionsPopup}render(){const t=document.createElement("emoji-reactions").emojis;const e=Object.keys(this.reactions).map((e=>{const i=t.find((t=>t.id===e));return{emojiId:e,messageId:this.reactions[e],src:i?.src}})).filter((t=>Array.isArray(t.messageId)&&t.messageId.length>0));const i=e.slice(0,2);const o=e.length>2?e.length-2:0;return n`
|
|
1091
|
+
<div
|
|
1092
|
+
@mouseover="${()=>this.handleMouseEnter()}"
|
|
1093
|
+
@mouseout="${t=>this.handleMouseLeave(t)}"
|
|
1094
|
+
class="message-container ${this.isSelf?"is-self":""} ${this.isMessageInfo?"link-container-info":!this.isShowFooter?this.preview?"link-footer":null:"link-container"}"
|
|
1095
|
+
style="background-color: ${this.isShowFooter?this.backgroundColor||(this.isSelf?"var(--bg-outgoing-message)":"var(--bg-incoming-message)"):null}; color: ${this.isShowFooter?this.textColor||(this.isSelf?"var(--text-outgoing-message)":"var(--text-incoming-message)"):null}; padding: 10px; border-radius: var(--radius-bubble);"
|
|
1096
|
+
>
|
|
1097
|
+
${this.messageType===1?n`
|
|
1098
|
+
<forward-ui></forward-ui>
|
|
1099
|
+
`:null}
|
|
1100
|
+
${!this.isSelf&&this.showReactionButton?n`
|
|
1101
|
+
<div class="reaction-button" @click="${()=>this.toggleEmojiReactions()}" ">
|
|
1102
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="var(--text-primary-color)">
|
|
1103
|
+
<path d="M612-516q25 0 42.5-17.5T672-576q0-25-17.5-42.5T612-636q-25 0-42.5 17.5T552-576q0 25 17.5 42.5T612-516Zm-264 0q25 0 42.5-17.5T408-576q0-25-17.5-42.5T348-636q-25 0-42.5 17.5T288-576q0 25 17.5 42.5T348-516Zm132 228q60 0 110.5-31t79.5-84H290q29 53 79.5 84T480-288Zm.28 192Q401-96 331-126t-122.5-82.5Q156-261 126-330.96t-30-149.5Q96-560 126-629.5q30-69.5 82.5-122T330.96-834q69.96-30 149.5-30t149.04 30q69.5 30 122 82.5T834-629.28q30 69.73 30 149Q864-401 834-331t-82.5 122.5Q699-156 629.28-126q-69.73 30-149 30ZM480-480Zm0 312q130 0 221-91t91-221q0-130-91-221t-221-91q-130 0-221 91t-91 221q0 130 91 221t221 91Z"/>
|
|
1104
|
+
</svg>
|
|
1105
|
+
</div>
|
|
1106
|
+
`:""}
|
|
1107
|
+
${this.showConfirmationPopup?n` <reaction-container .messageId=${this.messageId} .userMetaData=${this.userMetaData} .reactions=${e}></reaction-container> `:""}
|
|
1108
|
+
${this.showEmojiReactions?n`
|
|
1109
|
+
<emoji-reactions .isOpen="${this.showEmojiReactions}" .onEmojiSelect="${t=>this.handleEmojiClick(t)}" .selectedEmojis="${this.reactions}"></emoji-reactions>
|
|
1110
|
+
`:""}
|
|
1111
|
+
|
|
1112
|
+
<div class="reactions-display">
|
|
1113
|
+
${i?.map((t=>n`
|
|
1114
|
+
<span class="reaction-item" @click="${()=>this.handleReactionRemove(t)}"> ${t.src?n`<span>${t.src}</span>`:""} </span>
|
|
1115
|
+
`))}
|
|
1116
|
+
${o>0?n`
|
|
1117
|
+
<span @click="${()=>this.handleReactionRemove(i[0])}" class="reaction-item remaining-count" @click="${this.toggleAllReactionsPopup}"> +${o} </span>
|
|
1118
|
+
${this.showAllReactionsPopup?n`
|
|
1119
|
+
<div class="all-reactions-popup-overlay">
|
|
1120
|
+
<div class="all-reactions-popup">
|
|
1121
|
+
<div class="all-reactions-heading">
|
|
1122
|
+
<h3>Reactions:</h3>
|
|
1123
|
+
<button style="border: none; background: transparent; outline: none; font-size: 20px;" @click="${this.toggleAllReactionsPopup}">x</button>
|
|
1124
|
+
</div>
|
|
1125
|
+
<div class="all-reactions-list">
|
|
1126
|
+
${e.map((t=>n`
|
|
1127
|
+
<div class="reaction-list-item" @click="${()=>this.handleReactionRemove(t)}">${t.src?n`<span>${t.src}</span>`:""}</div>
|
|
1128
|
+
`))}
|
|
1129
|
+
</div>
|
|
1130
|
+
</div>
|
|
1131
|
+
</div>
|
|
1132
|
+
`:""}
|
|
1133
|
+
`:""}
|
|
1134
|
+
</div>
|
|
1135
|
+
|
|
1136
|
+
${this.isLoading?n`
|
|
1137
|
+
<div class="${!this.isShowFooter?"link-preview-footer":"link-preview"} shimmer-image shimmer-loading" style="display: flex; border-radius: 8px;">
|
|
1138
|
+
<div style="width: 80px; height: 80px; min-width: 80px;">
|
|
1139
|
+
<img src="${ct}" style="width: 100%; height: 100%; object-fit: cover;" />
|
|
1140
|
+
</div>
|
|
1141
|
+
<div class="preview-content" style="padding: 12px; display: flex; flex-direction: column; justify-content: center; width: 100%; word-break : break-word;">
|
|
1142
|
+
<div style="color: ${this.textColor};">${this.url}</div>
|
|
1143
|
+
</div>
|
|
1144
|
+
</div>
|
|
1145
|
+
`:this.preview?n`
|
|
1146
|
+
<div class="${!this.isShowFooter?"link-preview-footer":"link-preview"}" style="display: flex; border-radius: 8px; ;">
|
|
1147
|
+
${this.preview.image?n`
|
|
1148
|
+
<div class="preview-image" style="width: 80px; height: 80px; min-width: 80px; position: relative;">
|
|
1149
|
+
<img src="${this.preview.image}" alt="${this.preview.title}" @error="${this.handleImageError}" style="width: 100%; height: 100%; object-fit: cover;" />
|
|
1150
|
+
${this.preview.isVideo?n`<div
|
|
1151
|
+
style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,0.5); border-radius: 50%; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;"
|
|
1152
|
+
>
|
|
1153
|
+
<span style="color: white; font-size: 12px;">▶</span>
|
|
1154
|
+
</div>`:null}
|
|
1155
|
+
</div>
|
|
1156
|
+
`:null}
|
|
1157
|
+
<div class="preview-content" style="padding: 12px; display: flex; flex-direction: column; justify-content: center;">
|
|
1158
|
+
<h3
|
|
1159
|
+
class="preview-title"
|
|
1160
|
+
style="overflow: hidden; margin: 0 0 4px; font-size: 1rem; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; ; text-overflow: ellipsis; max-height: 2.4em; line-height: 1.2;"
|
|
1161
|
+
>
|
|
1162
|
+
${this.preview.description||this.preview.title||"Untitled"}
|
|
1163
|
+
</h3>
|
|
1164
|
+
<p class="preview-url" style="margin: 0; font-size: 0.8rem;">${this.preview.domain||new URL(this.url).hostname}</p>
|
|
1165
|
+
</div>
|
|
1166
|
+
</div>
|
|
1167
|
+
`:null}
|
|
1168
|
+
${this.isShowFooter?n`
|
|
1169
|
+
<div class="preview-footer">
|
|
1170
|
+
<span class="preview-message"> ${M(this.message,this.mentionedUsers,this.handleMentionClick,this.isSelf)} </span>
|
|
1171
|
+
<div class="message-footer">
|
|
1172
|
+
<timestamp-element time="${this.time||(new Date).toISOString()}" color="${this.timeColor}"></timestamp-element>
|
|
1173
|
+
${this.isSelf?this.isRead?n`<blue-read-mark></blue-read-mark>`:this.isDelivered==="true"?n`<double-mark></double-mark>`:this.isDelivered==="pending"?n`<clock-mark></clock-mark>`:n`<single-mark></single-mark>`:""}
|
|
1174
|
+
</div>
|
|
1175
|
+
</div>
|
|
1176
|
+
`:null}
|
|
1177
|
+
</div>
|
|
1178
|
+
`}handleImageError(t){t.target.style.display="none"}}customElements.define("link-preview",lt);class dt extends s{static properties={padding:{type:String},margin:{type:String},width:{type:String},boxShadow:{type:String},height:{type:String},borderRadius:{type:String},borderWidth:{type:String},borderColor:{type:String},borderStyle:{type:String},backgroundColor:{type:String},textColor:{type:String},fontSize:{type:String},fontWeight:{type:String},fontFamily:{type:String},fontStyle:{type:String},lineHeight:{type:String},textAlign:{type:String},contactImage:{type:String},contactName:{type:String},contactEmail:{type:String},messageAction:{type:Object},groupMembers:{type:Array},allAttachments:{type:Array},isGroup:{type:Boolean},showAllMembers:{type:Boolean},isPopupOpen:{type:Boolean},showMediaList:{type:Boolean},isImageFullscreen:{type:Boolean},showConfirmationPopup:{type:Boolean},confirmationAction:{type:String},conversationId:{type:String,reflect:true,mutable:true},oppenentId:{type:String,reflect:true},userMetaData:{type:Object},onEditTitle:{type:Function},onEditImage:{type:Function},onEditImage:{type:Function},openOwnProfile:{type:Boolean},editedName:{type:String},eligibleMembers:{type:Array},isEligibleMembersPopupOpen:{type:Boolean},hasMoreEligibleMembers:{type:Boolean},isLoadingMembers:{type:Boolean},activeTab:{type:String},docsAttachments:{type:Array},linksAttachments:{type:Array},allLinks:{type:Array},allLinksCount:{type:Number},isBlocked:{type:Boolean|String},conversationMetaData:{type:Object},isGroupcast:{type:Boolean},groupcastId:{type:String},groupcastMembers:{type:Array}};static styles=c`
|
|
1179
|
+
:host {
|
|
1180
|
+
width: 100%;
|
|
1181
|
+
}
|
|
1182
|
+
.contact-info-container {
|
|
1183
|
+
display: flex;
|
|
1184
|
+
flex-direction: column;
|
|
1185
|
+
overflow: hidden;
|
|
1186
|
+
height: 100%;
|
|
1187
|
+
}
|
|
1188
|
+
.popup-overlay {
|
|
1189
|
+
position: fixed;
|
|
1190
|
+
top: 0;
|
|
1191
|
+
left: 0;
|
|
1192
|
+
width: 100%;
|
|
1193
|
+
height: 100%;
|
|
1194
|
+
background-color: rgba(0, 0, 0, 0.6);
|
|
1195
|
+
display: flex;
|
|
1196
|
+
justify-content: center;
|
|
1197
|
+
align-items: center;
|
|
1198
|
+
z-index: 1000;
|
|
1199
|
+
}
|
|
1200
|
+
.popup-content {
|
|
1201
|
+
background: var(--bg-primary-color);
|
|
1202
|
+
padding: 14px;
|
|
1203
|
+
border-radius: 8px;
|
|
1204
|
+
width: 28%;
|
|
1205
|
+
max-height: 80vh;
|
|
1206
|
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
1207
|
+
}
|
|
1208
|
+
.popup-header {
|
|
1209
|
+
display: flex;
|
|
1210
|
+
justify-content: space-between;
|
|
1211
|
+
align-items: center;
|
|
1212
|
+
padding: 0px 16px;
|
|
1213
|
+
}
|
|
1214
|
+
.popup-body {
|
|
1215
|
+
padding: 0 16px;
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
.popup-body-buttons {
|
|
1219
|
+
display: flex;
|
|
1220
|
+
justify-content: space-between;
|
|
1221
|
+
gap: 10px;
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
.popup-body button {
|
|
1225
|
+
border: none;
|
|
1226
|
+
font-size: 16px;
|
|
1227
|
+
color: var(--text-primary-color);
|
|
1228
|
+
cursor: pointer;
|
|
1229
|
+
width: 50%;
|
|
1230
|
+
padding: 10px 0px;
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
.popup-body button:last-child {
|
|
1234
|
+
background: transparent;
|
|
1235
|
+
border: 1px solid var(--text-primary-color);
|
|
1236
|
+
border-radius: 20px;
|
|
1237
|
+
}
|
|
1238
|
+
.popup-body button:first-child {
|
|
1239
|
+
background: var(--text-primary-color);
|
|
1240
|
+
border-radius: 20px;
|
|
1241
|
+
}
|
|
1242
|
+
.contact-info-header {
|
|
1243
|
+
display: flex;
|
|
1244
|
+
align-items: center;
|
|
1245
|
+
gap: 10px;
|
|
1246
|
+
padding: 20px;
|
|
1247
|
+
font-size: 18px;
|
|
1248
|
+
background: inherit;
|
|
1249
|
+
position: sticky;
|
|
1250
|
+
top: 0;
|
|
1251
|
+
z-index: 10;
|
|
1252
|
+
background: var(--bg-primary-color);
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
.contact-info-body {
|
|
1256
|
+
display: flex;
|
|
1257
|
+
flex-direction: column;
|
|
1258
|
+
gap: 1.5rem;
|
|
1259
|
+
background: inherit;
|
|
1260
|
+
overflow-y: auto;
|
|
1261
|
+
flex-grow: 1;
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
.contact-info-body::-webkit-scrollbar {
|
|
1265
|
+
width: 4px;
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
.contact-info-body::-webkit-scrollbar-thumb {
|
|
1269
|
+
background-color: var(--text-primary-color);
|
|
1270
|
+
border-radius: 10px;
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
.contact-info-body::-webkit-scrollbar-track {
|
|
1274
|
+
background: var(--bg-primary-color);
|
|
1275
|
+
border-radius: 10px;
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
.contact-info {
|
|
1279
|
+
display: flex;
|
|
1280
|
+
align-items: center;
|
|
1281
|
+
gap: 10px;
|
|
1282
|
+
flex-direction: column;
|
|
1283
|
+
padding: 1.5rem;
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
.contact-info-name {
|
|
1287
|
+
display: flex;
|
|
1288
|
+
flex-direction: column;
|
|
1289
|
+
align-items: center;
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
.contact-info-name span:first-child {
|
|
1293
|
+
font-size: 20px;
|
|
1294
|
+
font-weight: 600;
|
|
1295
|
+
max-width: 350px;
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
.contact-info-name span:last-child {
|
|
1299
|
+
font-size: 16px;
|
|
1300
|
+
font-weight: 400;
|
|
1301
|
+
}
|
|
1302
|
+
.contact-media {
|
|
1303
|
+
padding: 16px;
|
|
1304
|
+
background: inherit;
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
.contact-media-header {
|
|
1308
|
+
display: flex;
|
|
1309
|
+
align-items: center;
|
|
1310
|
+
justify-content: space-between;
|
|
1311
|
+
font-size: 18px;
|
|
1312
|
+
}
|
|
1313
|
+
contact-media-header-label {
|
|
1314
|
+
font-size: 14px;
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
.contact-media-header-count {
|
|
1318
|
+
display: flex;
|
|
1319
|
+
align-items: center;
|
|
1320
|
+
cursor: pointer;
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
.contact-media-body {
|
|
1324
|
+
display: flex;
|
|
1325
|
+
gap: 10px;
|
|
1326
|
+
overflow: hidden;
|
|
1327
|
+
padding: 10px;
|
|
1328
|
+
}
|
|
1329
|
+
.shimmer-loader {
|
|
1330
|
+
width: 50%;
|
|
1331
|
+
height: 40px;
|
|
1332
|
+
position: relative;
|
|
1333
|
+
overflow: hidden;
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
.shimmer-line {
|
|
1337
|
+
position: absolute;
|
|
1338
|
+
top: 0;
|
|
1339
|
+
left: -100%;
|
|
1340
|
+
width: 100%;
|
|
1341
|
+
height: 100%;
|
|
1342
|
+
background: linear-gradient(90deg, var(--bg-secondary-color) 25%, var(--bg-primary-light) 50%, var(--bg-secondary-color) 75%);
|
|
1343
|
+
animation: shimmer 1.5s infinite;
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
@keyframes shimmer {
|
|
1347
|
+
0% {
|
|
1348
|
+
left: -100%;
|
|
1349
|
+
}
|
|
1350
|
+
100% {
|
|
1351
|
+
left: 100%;
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
1354
|
+
.members-list {
|
|
1355
|
+
position: absolute;
|
|
1356
|
+
top: 50%;
|
|
1357
|
+
left: 50%;
|
|
1358
|
+
transform: translate(-50%, -50%);
|
|
1359
|
+
z-index: 1000;
|
|
1360
|
+
width: 25%;
|
|
1361
|
+
min-width: var(--sidebar-width);
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
.popup-members {
|
|
1365
|
+
display: flex;
|
|
1366
|
+
flex-direction: column;
|
|
1367
|
+
gap: 10px;
|
|
1368
|
+
max-height: calc(80vh - 50px);
|
|
1369
|
+
overflow-y: auto;
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
.popup-members::-webkit-scrollbar {
|
|
1373
|
+
width: 4px;
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
.popup-members::-webkit-scrollbar-track {
|
|
1377
|
+
background: transparent;
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
.popup-members::-webkit-scrollbar-thumb {
|
|
1381
|
+
background-color: var(--bg-primary-light);
|
|
1382
|
+
border-radius: 3px;
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
.group-members-popup-actions {
|
|
1386
|
+
display: flex;
|
|
1387
|
+
align-items: center;
|
|
1388
|
+
gap: 10px;
|
|
1389
|
+
position: absolute;
|
|
1390
|
+
bottom: 0px;
|
|
1391
|
+
background: var(--bg-secondary-color);
|
|
1392
|
+
z-index: 1;
|
|
1393
|
+
padding: 10px;
|
|
1394
|
+
left: 0;
|
|
1395
|
+
margin: 10px;
|
|
1396
|
+
width: -webkit-fill-available;
|
|
1397
|
+
justify-content: center;
|
|
1398
|
+
cursor: pointer;
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
.group-members-popup {
|
|
1402
|
+
position: relative;
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
.group-members-header {
|
|
1406
|
+
display: flex;
|
|
1407
|
+
justify-content: space-between;
|
|
1408
|
+
align-items: center;
|
|
1409
|
+
padding: 0px 16px;
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
.group-members-header svg {
|
|
1413
|
+
cursor: pointer;
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
.group-members {
|
|
1417
|
+
padding: 16px;
|
|
1418
|
+
background: inherit;
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
.close-btn {
|
|
1422
|
+
background: none;
|
|
1423
|
+
border: none;
|
|
1424
|
+
font-size: 24px;
|
|
1425
|
+
cursor: pointer;
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
.ctas {
|
|
1429
|
+
display: flex;
|
|
1430
|
+
flex-direction: column;
|
|
1431
|
+
gap: 2px;
|
|
1432
|
+
background: var(--bg-primary-color);
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
.ctas button {
|
|
1436
|
+
border: none;
|
|
1437
|
+
display: flex;
|
|
1438
|
+
align-items: center;
|
|
1439
|
+
gap: 10px;
|
|
1440
|
+
padding: 20px;
|
|
1441
|
+
cursor: pointer;
|
|
1442
|
+
width: 100%;
|
|
1443
|
+
font-size: 16px;
|
|
1444
|
+
background: transparent;
|
|
1445
|
+
color: var(--text-primary-color);
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
.ctas button:hover {
|
|
1449
|
+
color: var(--base-color);
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
.fullscreen-image-container {
|
|
1453
|
+
display: flex;
|
|
1454
|
+
justify-content: center;
|
|
1455
|
+
align-items: center;
|
|
1456
|
+
width: 100%;
|
|
1457
|
+
height: 100%;
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
.fullscreen-image-container img {
|
|
1461
|
+
position: relative;
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
.contact-media-body img {
|
|
1465
|
+
cursor: pointer;
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
.contact-media-body img:hover {
|
|
1469
|
+
scale: 1.05;
|
|
1470
|
+
}
|
|
1471
|
+
|
|
1472
|
+
.group-members chat-tile:hover {
|
|
1473
|
+
background: var(--bg-primary-light);
|
|
1474
|
+
cursor: pointer;
|
|
1475
|
+
border-radius: 8px;
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
.popup-members chat-tile:hover {
|
|
1479
|
+
background: var(--bg-primary-light);
|
|
1480
|
+
cursor: pointer;
|
|
1481
|
+
border-radius: 8px;
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
.profile-image-container {
|
|
1485
|
+
position: relative;
|
|
1486
|
+
cursor: pointer;
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
.profile-image-container:hover .image-edit-overlay {
|
|
1490
|
+
opacity: 1;
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
|
+
.image-edit-overlay {
|
|
1494
|
+
position: absolute;
|
|
1495
|
+
top: 0;
|
|
1496
|
+
left: 0;
|
|
1497
|
+
right: 0;
|
|
1498
|
+
bottom: 0;
|
|
1499
|
+
background: rgba(0, 0, 0, 0.5);
|
|
1500
|
+
border-radius: 50%;
|
|
1501
|
+
display: flex;
|
|
1502
|
+
align-items: center;
|
|
1503
|
+
justify-content: center;
|
|
1504
|
+
opacity: 0;
|
|
1505
|
+
transition: opacity 0.3s ease;
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
.name-edit-input:focus {
|
|
1509
|
+
background: var(--bg-primary-light);
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
.nav-container {
|
|
1513
|
+
width: 100%;
|
|
1514
|
+
background-color: var(--bg-secondary-color);
|
|
1515
|
+
padding: 16px 0;
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
/* Inner container for max width */
|
|
1519
|
+
.inner-container {
|
|
1520
|
+
max-width: 1024px;
|
|
1521
|
+
margin: 0 auto;
|
|
1522
|
+
padding: 0 16px;
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
/* Tab styling */
|
|
1526
|
+
.tabs {
|
|
1527
|
+
display: flex;
|
|
1528
|
+
gap: 32px;
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
/* Tab item styling */
|
|
1532
|
+
.tab-item {
|
|
1533
|
+
position: relative;
|
|
1534
|
+
cursor: pointer;
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
/* Radio buttons (hidden) */
|
|
1538
|
+
.tab-radio {
|
|
1539
|
+
position: absolute;
|
|
1540
|
+
opacity: 0;
|
|
1541
|
+
cursor: pointer;
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
/* Tab labels */
|
|
1545
|
+
.tab-label {
|
|
1546
|
+
display: inline-block;
|
|
1547
|
+
color: #9ca3af;
|
|
1548
|
+
font-size: 18px;
|
|
1549
|
+
padding: 4px 0;
|
|
1550
|
+
transition: color 0.3s ease;
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1553
|
+
/* Underline indicator */
|
|
1554
|
+
.tab-indicator {
|
|
1555
|
+
position: absolute;
|
|
1556
|
+
bottom: -16px;
|
|
1557
|
+
left: 0;
|
|
1558
|
+
width: 100%;
|
|
1559
|
+
height: 4px;
|
|
1560
|
+
background-color: var(--base-color);
|
|
1561
|
+
transform: scaleX(0);
|
|
1562
|
+
transition: transform 0.3s ease;
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
/* When radio is checked */
|
|
1566
|
+
.tab-radio:checked + .tab-label {
|
|
1567
|
+
color: var(--base-color);
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
.tab-radio:checked ~ .tab-indicator {
|
|
1571
|
+
transform: scaleX(1);
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
/* Focus styles for accessibility */
|
|
1575
|
+
.tab-radio:focus + .tab-label {
|
|
1576
|
+
outline-offset: 2px;
|
|
1577
|
+
}
|
|
1578
|
+
.doc-item {
|
|
1579
|
+
display: flex;
|
|
1580
|
+
align-items: center;
|
|
1581
|
+
background: var(--bg-primary-light);
|
|
1582
|
+
margin: 8px 0;
|
|
1583
|
+
padding: 12px;
|
|
1584
|
+
border-radius: 8px;
|
|
1585
|
+
cursor: pointer;
|
|
1586
|
+
}
|
|
1587
|
+
|
|
1588
|
+
.doc-item:hover {
|
|
1589
|
+
background: var(--bg-secondary-color);
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
.doc-icon {
|
|
1593
|
+
margin-right: 12px;
|
|
1594
|
+
width: 40px;
|
|
1595
|
+
height: 40px;
|
|
1596
|
+
display: flex;
|
|
1597
|
+
align-items: center;
|
|
1598
|
+
justify-content: center;
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
.doc-info {
|
|
1602
|
+
flex-grow: 1;
|
|
1603
|
+
overflow: hidden;
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
.doc-name {
|
|
1607
|
+
font-weight: 500;
|
|
1608
|
+
white-space: nowrap;
|
|
1609
|
+
overflow: hidden;
|
|
1610
|
+
text-overflow: ellipsis;
|
|
1611
|
+
margin-bottom: 4px;
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
.doc-meta {
|
|
1615
|
+
display: flex;
|
|
1616
|
+
font-size: 12px;
|
|
1617
|
+
color: var(--text-secondary-color);
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1620
|
+
/* Link item styles */
|
|
1621
|
+
.link-item {
|
|
1622
|
+
display: flex;
|
|
1623
|
+
margin: 8px 0;
|
|
1624
|
+
border-radius: 8px;
|
|
1625
|
+
overflow: hidden;
|
|
1626
|
+
text-decoration: none;
|
|
1627
|
+
color: inherit;
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1630
|
+
.link-item:hover {
|
|
1631
|
+
background: var(--bg-secondary-color);
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
.link-preview {
|
|
1635
|
+
width: 100%;
|
|
1636
|
+
height: 100%;
|
|
1637
|
+
display: flex;
|
|
1638
|
+
align-items: center;
|
|
1639
|
+
justify-content: center;
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
.link-info {
|
|
1643
|
+
padding: 12px;
|
|
1644
|
+
flex-grow: 1;
|
|
1645
|
+
overflow: hidden;
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
.link-title {
|
|
1649
|
+
font-weight: 500;
|
|
1650
|
+
margin-bottom: 4px;
|
|
1651
|
+
white-space: nowrap;
|
|
1652
|
+
overflow: hidden;
|
|
1653
|
+
text-overflow: ellipsis;
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
.link-url {
|
|
1657
|
+
font-size: 12px;
|
|
1658
|
+
color: var(--text-secondary-color);
|
|
1659
|
+
white-space: nowrap;
|
|
1660
|
+
overflow: hidden;
|
|
1661
|
+
text-overflow: ellipsis;
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1664
|
+
.no-content {
|
|
1665
|
+
display: flex;
|
|
1666
|
+
flex-direction: column;
|
|
1667
|
+
align-items: center;
|
|
1668
|
+
justify-content: center;
|
|
1669
|
+
height: 200px;
|
|
1670
|
+
color: var(--text-secondary-color);
|
|
1671
|
+
text-align: center;
|
|
1672
|
+
padding: 0 20px;
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
.no-content svg {
|
|
1676
|
+
margin-bottom: 16px;
|
|
1677
|
+
opacity: 0.5;
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1680
|
+
/* Month separator */
|
|
1681
|
+
.month-separator {
|
|
1682
|
+
font-size: 14px;
|
|
1683
|
+
font-weight: 500;
|
|
1684
|
+
margin: 24px 0 12px 0;
|
|
1685
|
+
padding-left: 8px;
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1688
|
+
.shimmer {
|
|
1689
|
+
background: linear-gradient(90deg, var(--bg-secondary-color) 25%, var(--bg-primary-light) 50%, var(--bg-secondary-color) 75%);
|
|
1690
|
+
background-size: 200% 100%;
|
|
1691
|
+
animation: shimmer 1.5s infinite linear;
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1694
|
+
.member-shimmer {
|
|
1695
|
+
height: 60px;
|
|
1696
|
+
border-radius: 8px;
|
|
1697
|
+
margin: 8px 16px;
|
|
1698
|
+
opacity: 0.7;
|
|
1699
|
+
}
|
|
1700
|
+
|
|
1701
|
+
@keyframes shimmer {
|
|
1702
|
+
0% {
|
|
1703
|
+
background-position: 100% 0;
|
|
1704
|
+
}
|
|
1705
|
+
100% {
|
|
1706
|
+
background-position: -100% 0;
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
`;constructor(){super();this.lastConversationId=null;this.isEditingName=false;this.editedName="";this.isLoadingMembers=true;this.activeTab="media";this.conversationMetaData={};this.docsAttachments=[];this.linksAttachments=[];const t=new URLSearchParams(window.location.search);this.isGroupcast=t.has("groupcast");this.groupcastId=t.get("groupcast")}willUpdate(t){if(t.has("conversationId")){this.handleConversationIdChange(this.conversationId,t.get("conversationId"))}if(t.has("groupMembers")){const t=this.getConversationIdFromUrl();at.initializeMembers(this.groupMembers,t)}}handleConversationIdChange(t,e){if(t!==at.getCurrentConversationId()){this.isLoadingMembers=true;at.initializeMembers(this.groupMembers,t)}const i=this.getConversationIdFromUrl();if(this.lastConversationId&&this.lastConversationId!==i){this._handleClose()}this.lastConversationId=i}toggleShowAllMembers(){this.showAllMembers=!this.showAllMembers}showMembersPopup(){this.isPopupOpen=true}closeMembersPopup(){this.isPopupOpen=false}toggleMediaList(){this.showMediaList=!this.showMediaList}toggleImageFullscreen(){this.isImageFullscreen=!this.isImageFullscreen}_handleClose(){if(this.showMediaList){this.showMediaList=false;return}this.dispatchEvent(new CustomEvent("close-right-Sidebar",{detail:{type:"close-right-Sidebar"},bubbles:true,composed:true}))}getConversationIdFromUrl(){const t=new URL(window.location.href);return t.searchParams.get("conversation")}exitGroup(){this.dispatchEvent(new CustomEvent("contact-action",{detail:{action:"exit-group",conversationId:this.conversationId},bubbles:true,composed:true}))}clearChat(){this.dispatchEvent(new CustomEvent("contact-action",{detail:{action:"clear-chat",conversationId:this.conversationId},bubbles:true,composed:true}))}blockContact(){this.dispatchEvent(new CustomEvent("contact-action",{detail:{action:"block-contact",oppenentId:this.oppenentId,userName:this.contactName},bubbles:true,composed:true}))}unblockContact(){this.dispatchEvent(new CustomEvent("contact-action",{detail:{action:"unblock-contact",oppenentId:this.oppenentId,userName:this.contactName},bubbles:true,composed:true}))}deleteChat(){this.dispatchEvent(new CustomEvent("contact-action",{detail:{action:"delete-chat",conversationId:this.conversationId},bubbles:true,composed:true}))}deleteGroupcast(){const t=new URLSearchParams(window.location.search);const e=t.get("groupcast");this.dispatchEvent(new CustomEvent("delete-groupcast",{detail:{groupcastId:e,conversationId:this.conversationId},bubbles:true,composed:true}));b.closeDialog();this._handleClose()}openConfirmationPopup(t,e){b.openDialog("confirm-dialog",{title:`${e}`,description:`Are you sure you want to ${e} ?`,handleConfirm:()=>this.confirmAction(t)})}closeConfirmationPopup(){this.showConfirmationPopup=false;this._handleClose()}confirmAction(t){switch(t){case"delete-groupcast":this.deleteGroupcast();break;case"delete-chat":this.deleteChat();break;case"exit-group":this.exitGroup();break;case"clear-chat":this.clearChat();break;case"block-contact":this.blockContact();break;case"unblock-contact":this.unblockContact();break}this.closeConfirmationPopup()}_handleKebabMenuClick(t){t.stopPropagation()}shouldShowMemberActions(t){const e=this.groupMembers?.find((t=>t.userId===this.userMetaData?.userId));return e?.isAdmin?this.userMetaData?.userId!==t:false}handleNameClick(){if(this.isGroup||this.isGroupcast){this.isEditingName=true;this.editedName=this.contactName;setTimeout((()=>{const t=this.shadowRoot.querySelector(".name-edit-input");if(t){t.focus();t.select()}}),0)}}handleNameInputKeyDown(t){if(t.key==="Enter"){this.saveName()}else if(t.key==="Escape"){this.isEditingName=false}}saveName(){if(this.editedName.trim()&&this.editedName!==this.contactName){const t=this.contactName;this.contactName=this.editedName.trim();this.dispatchEvent(new CustomEvent("edit-title",{detail:{currentTitle:t,newTitle:this.editedName.trim(),conversationId:this.conversationId,onError:()=>{this.contactName=t}},bubbles:true,composed:true}))}this.isEditingName=false}handleImageClick(){if(this.isGroup||this.isGroupcast){const t=document.createElement("input");t.type="file";t.accept="image/*";t.onchange=t=>{const e=t.target.files?.[0];if(e){const t=URL.createObjectURL(e);const i=this.contactImage;this.contactImage=t;this.dispatchEvent(new CustomEvent("edit-image",{detail:{currentImage:i,conversationId:this.conversationId,file:e,onError:()=>{this.contactImage=i;URL.revokeObjectURL(t)},onSuccess:()=>{URL.revokeObjectURL(t)}},bubbles:true,composed:true}))}};t.click()}}handleAddMembersClick(t){t.stopPropagation();b.openDialog("member-add",{title:"Eligible Members",width:"100%",fontSize:"16px",textColor:"var(--text-primary-color)",selectedConversationId:this.isGroupcast?this.groupcastId:this.conversationId,isGroupcast:this.isGroupcast})}extractAttachmentsByType(){this.docsAttachments=[];this.linksAttachments=[];if(!this.allAttachments||!this.allAttachments.length)return;this.allAttachments.forEach((t=>{t?.attachments?.forEach((e=>{if(e.mediaType===3){this.docsAttachments.push({...e,date:t.sentAt,sender:t?.senderInfo?.userName})}else if(t?.customType==="AttachmentMessage:Link"){this.linksAttachments.push({...e,date:t.sentAt,sender:t?.senderInfo?.userName})}}))}));this.docsAttachments.sort(((t,e)=>new Date(e.date)-new Date(t.date)));this.linksAttachments.sort(((t,e)=>new Date(e.date)-new Date(t.date)));this.requestUpdate()}updated(t){super.updated(t);if(t.has("allAttachments")){this.extractAttachmentsByType()}}switchTab(t){this.activeTab=t}formatFileSize(t){if(!t)return"0 B";const e=1024;const i=["B","KB","MB","GB"];const o=Math.floor(Math.log(t)/Math.log(e));return parseFloat((t/Math.pow(e,o)).toFixed(2))+" "+i[o]}formatDate(t){if(!t)return"";const e=new Date(t);return e.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})}getMonthYear(t){if(!t)return"";const e=new Date(t);return e.toLocaleDateString("en-US",{month:"long",year:"numeric"})}groupByMonth(t,e=false){const i={};t.forEach((t=>{const o=this.getMonthYear(e?t.sentAt:t.date);if(!i[o]){i[o]=[]}i[o].push(t)}));return i}renderNoContent(t,e){return n`
|
|
1710
|
+
<div class="tab-content active">
|
|
1711
|
+
<div class="no-content">
|
|
1712
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 0 24 24" width="48" fill="currentColor">
|
|
1713
|
+
<path d="M0 0h24v24H0V0z" fill="none" />
|
|
1714
|
+
<path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86l-3 3.87L9 13.14 6 17h12l-3.86-5.14z" />
|
|
1715
|
+
</svg>
|
|
1716
|
+
<h3 style="margin: 0 0 8px 0;">${t}</h3>
|
|
1717
|
+
<p style="margin: 0;">${e}</p>
|
|
1718
|
+
</div>
|
|
1719
|
+
</div>
|
|
1720
|
+
`}renderTabContent(){if(this.activeTab==="media"){const t=[];this.allAttachments?.forEach((e=>{e?.attachments?.forEach((e=>{if(e?.mediaUrl&&(e.mediaType===0||e.mediaType===1||e.mediaType===2)){t.push(e.mediaUrl)}}))}));if(!t.length){return this.renderNoContent("No Media","Share media with this chat to see them here.")}return n`
|
|
1721
|
+
<div class="tab-content active">
|
|
1722
|
+
<media-list
|
|
1723
|
+
.mediaArray=${t}
|
|
1724
|
+
padding="10px"
|
|
1725
|
+
bgColor=${this.backgroundColor}
|
|
1726
|
+
color=${this.textColor}
|
|
1727
|
+
style="width: 100%"
|
|
1728
|
+
borderRadius="10px"
|
|
1729
|
+
height="calc(100vh - 100px)"
|
|
1730
|
+
></media-list>
|
|
1731
|
+
</div>
|
|
1732
|
+
`}else if(this.activeTab==="docs"){if(!this.docsAttachments.length){return this.renderNoContent("No Documents","Share documents with this chat to see them here.")}const t=this.groupByMonth(this.docsAttachments);return n`
|
|
1733
|
+
<div class="tab-content active">
|
|
1734
|
+
${Object.keys(t).map((e=>n`
|
|
1735
|
+
<div class="month-separator">${e}</div>
|
|
1736
|
+
${t[e].map((t=>n`
|
|
1737
|
+
<div class="doc-item" @click=${()=>window.open(t.mediaUrl,"_blank")}>
|
|
1738
|
+
<div class="doc-icon">
|
|
1739
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24" fill="currentColor">
|
|
1740
|
+
<path d="M0 0h24v24H0V0z" fill="none" />
|
|
1741
|
+
<path d="M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM16 18H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z" />
|
|
1742
|
+
</svg>
|
|
1743
|
+
</div>
|
|
1744
|
+
<div class="doc-info">
|
|
1745
|
+
<div class="doc-name">${t.name||"Document"}</div>
|
|
1746
|
+
<div class="doc-meta">
|
|
1747
|
+
<span>${this.formatFileSize(t.size)}</span>
|
|
1748
|
+
<span style="margin: 0 6px;">•</span>
|
|
1749
|
+
<span>${this.formatDate(t.date)}</span>
|
|
1750
|
+
</div>
|
|
1751
|
+
</div>
|
|
1752
|
+
</div>
|
|
1753
|
+
`))}
|
|
1754
|
+
`))}
|
|
1755
|
+
</div>
|
|
1756
|
+
`}else if(this.activeTab==="links"){if(!this.allLinks?.length){return this.renderNoContent("No Links","URLs shared in this chat will appear here.")}const t=this.groupByMonth(this.allLinks,true);return n`
|
|
1757
|
+
<div class="tab-content active">
|
|
1758
|
+
${Object.keys(t).map((e=>n`
|
|
1759
|
+
<div class="month-separator">${e}</div>
|
|
1760
|
+
${t[e].map((t=>n`
|
|
1761
|
+
<a href=${t.body} target="_blank" class="link-item">
|
|
1762
|
+
<div class="link-preview">
|
|
1763
|
+
<link-preview .showReactionOnHover=${false} url=${t.body} time=${t.sentAt}></link-preview>
|
|
1764
|
+
</div>
|
|
1765
|
+
</a>
|
|
1766
|
+
`))}
|
|
1767
|
+
`))}
|
|
1768
|
+
</div>
|
|
1769
|
+
`}}openProfile(t){if(this.isPopupOpen){this.isPopupOpen=false}if(t.userId===this.userMetaData?.userId){this.openOwnProfile()}else{this.dispatchEvent(new CustomEvent("open-right-Sidebar",{detail:{type:"open-right-Sidebar",renderComponent:"profile-info",userId:t.userId,userName:t.userName},bubbles:true,composed:true}))}}render(){this.allAttachments?.forEach((t=>{t?.attachments?.forEach((t=>{}))}));const t=at.getMembers();this.isLoadingMembers=!t;const e=new URLSearchParams(window.location.search);const i=e.has("groupcast");return n`
|
|
1770
|
+
<div
|
|
1771
|
+
class="contact-info-container"
|
|
1772
|
+
style=${d({padding:this.padding,margin:this.margin,width:this.width,height:this.height,borderRadius:this.borderRadius,borderWidth:this.borderWidth,borderColor:this.borderColor,borderStyle:this.borderStyle,backgroundColor:this.backgroundColor,color:this.textColor,fontSize:this.fontSize,fontWeight:this.fontWeight,fontFamily:this.fontFamily,fontStyle:this.fontStyle,lineHeight:this.lineHeight,boxShadow:this.boxShadow,textAlign:this.textAlign})}
|
|
1773
|
+
>
|
|
1774
|
+
${this.showMediaList?n`
|
|
1775
|
+
<div class="contact-info-header">
|
|
1776
|
+
<svg
|
|
1777
|
+
@click=${this._handleClose}
|
|
1778
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1779
|
+
height="24px"
|
|
1780
|
+
viewBox="0 -960 960 960"
|
|
1781
|
+
width="24px"
|
|
1782
|
+
fill="${this.textColor}"
|
|
1783
|
+
style="cursor: pointer;"
|
|
1784
|
+
>
|
|
1785
|
+
<path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z" />
|
|
1786
|
+
</svg>
|
|
1787
|
+
</div>
|
|
1788
|
+
<div>
|
|
1789
|
+
<div class="nav-container">
|
|
1790
|
+
<div class="inner-container">
|
|
1791
|
+
<div class="tabs">
|
|
1792
|
+
<div class="tab-item">
|
|
1793
|
+
<input type="radio" id="tab-media" name="tabs" class="tab-radio" ?checked=${this.activeTab==="media"} @change=${()=>this.switchTab("media")} />
|
|
1794
|
+
<label for="tab-media" class="tab-label">Media</label>
|
|
1795
|
+
<div class="tab-indicator" style="transform: ${this.activeTab==="media"?"scaleX(1)":"scaleX(0)"}"></div>
|
|
1796
|
+
</div>
|
|
1797
|
+
|
|
1798
|
+
<div class="tab-item">
|
|
1799
|
+
<input type="radio" id="tab-docs" name="tabs" class="tab-radio" ?checked=${this.activeTab==="docs"} @change=${()=>this.switchTab("docs")} />
|
|
1800
|
+
<label for="tab-docs" class="tab-label">Docs</label>
|
|
1801
|
+
<div class="tab-indicator" style="transform: ${this.activeTab==="docs"?"scaleX(1)":"scaleX(0)"}"></div>
|
|
1802
|
+
</div>
|
|
1803
|
+
|
|
1804
|
+
<div class="tab-item">
|
|
1805
|
+
<input
|
|
1806
|
+
type="radio"
|
|
1807
|
+
id="tab-links"
|
|
1808
|
+
name="tabs"
|
|
1809
|
+
class="tab-radio"
|
|
1810
|
+
?checked=${this.activeTab==="links"}
|
|
1811
|
+
@change=${()=>this.switchTab("links")}
|
|
1812
|
+
@click=${()=>this.dispatchEvent(new CustomEvent("get-links",{detail:{conversationId:this.conversationId},bubbles:true,composed:true}))}
|
|
1813
|
+
/>
|
|
1814
|
+
<label for="tab-links" class="tab-label">Links</label>
|
|
1815
|
+
<div class="tab-indicator" style="transform: ${this.activeTab==="links"?"scaleX(1)":"scaleX(0)"}"></div>
|
|
1816
|
+
</div>
|
|
1817
|
+
</div>
|
|
1818
|
+
</div>
|
|
1819
|
+
</div>
|
|
1820
|
+
|
|
1821
|
+
${this.renderTabContent()}
|
|
1822
|
+
</div>
|
|
1823
|
+
`:n`
|
|
1824
|
+
<div class="contact-info-header">
|
|
1825
|
+
<svg
|
|
1826
|
+
@click=${this._handleClose}
|
|
1827
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1828
|
+
height="24px"
|
|
1829
|
+
viewBox="0 -960 960 960"
|
|
1830
|
+
width="24px"
|
|
1831
|
+
fill="${this.textColor}"
|
|
1832
|
+
style="cursor: pointer;"
|
|
1833
|
+
>
|
|
1834
|
+
<path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z" />
|
|
1835
|
+
</svg>
|
|
1836
|
+
${this.isGroup?n`<span class="group-info-label">Group Info</span>`:n`<span class="contact-info-label">Contact Info</span>`}
|
|
1837
|
+
</div>
|
|
1838
|
+
|
|
1839
|
+
<div class="contact-info-body">
|
|
1840
|
+
<div class="contact-info" style="background: var(--bg-primary-color);">
|
|
1841
|
+
<div style="position: relative; display: flex; align-items: center; gap: 8px;">
|
|
1842
|
+
${a({src:this.contactImage,width:"calc(75dvh - 300px)",height:"calc(75dvh - 300px)",borderRadius:"50%",objectFit:"cover",placeholderImage:v(this.contactImage)})}
|
|
1843
|
+
${this.isGroup?n`
|
|
1844
|
+
<div
|
|
1845
|
+
@click=${this.handleImageClick}
|
|
1846
|
+
style="
|
|
1847
|
+
position: absolute;
|
|
1848
|
+
right: 15%;
|
|
1849
|
+
bottom: 0;
|
|
1850
|
+
transform: translateY(-50%);
|
|
1851
|
+
cursor: pointer;
|
|
1852
|
+
padding: 8px;
|
|
1853
|
+
border-radius: 50%;
|
|
1854
|
+
background: var(--bg-primary-light);
|
|
1855
|
+
"
|
|
1856
|
+
>
|
|
1857
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor">
|
|
1858
|
+
<path
|
|
1859
|
+
d="M200-200h57l391-391-57-57-391 391v57Zm-80 80v-170l528-527q12-11 26.5-17t30.5-6q16 0 31 6t26 18l55 56q12 11 17.5 26t5.5 30q0 16-5.5 30.5T817-647L290-120H120Zm640-584-56-56 56 56Zm-141 85-28-29 57 57-29-28Z"
|
|
1860
|
+
/>
|
|
1861
|
+
</svg>
|
|
1862
|
+
</div>
|
|
1863
|
+
`:""}
|
|
1864
|
+
</div>
|
|
1865
|
+
<div class="contact-info-name">
|
|
1866
|
+
${this.isGroup?this.isEditingName?n`
|
|
1867
|
+
<div style="display: flex; align-items: center; gap: 8px; cursor: pointer;">
|
|
1868
|
+
<input
|
|
1869
|
+
type="text"
|
|
1870
|
+
.value=${this.editedName}
|
|
1871
|
+
@input=${t=>this.editedName=t.target.value}
|
|
1872
|
+
@keydown=${this.handleNameInputKeyDown}
|
|
1873
|
+
class="name-edit-input"
|
|
1874
|
+
style="
|
|
1875
|
+
font-size: 20px;
|
|
1876
|
+
font-weight: 600;
|
|
1877
|
+
background: transparent;
|
|
1878
|
+
border: none;
|
|
1879
|
+
border-bottom: 2px solid var(--text-primary-color);
|
|
1880
|
+
color: var(--text-primary-color);
|
|
1881
|
+
text-align: center;
|
|
1882
|
+
width: 100%;
|
|
1883
|
+
padding: 4px;
|
|
1884
|
+
outline: none;
|
|
1885
|
+
"
|
|
1886
|
+
/>
|
|
1887
|
+
<svg @click=${this.saveName} xmlns="http://www.w3.org/2000/svg" height="35px" viewBox="0 -960 960 960" width="36px" fill="var(--text-primary-color)">
|
|
1888
|
+
<path
|
|
1889
|
+
d="m424-296 282-282-56-56-226 226-114-114-56 56 170 170Zm56 216q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Z"
|
|
1890
|
+
/>
|
|
1891
|
+
</svg>
|
|
1892
|
+
</div>
|
|
1893
|
+
`:n`
|
|
1894
|
+
<div style="display: flex; align-items: center; gap: 8px; cursor: pointer;" @click=${this.handleNameClick}>
|
|
1895
|
+
<span>${this.contactName}</span>
|
|
1896
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="18px" viewBox="0 -960 960 960" width="18px" fill="currentColor">
|
|
1897
|
+
<path
|
|
1898
|
+
d="M200-200h57l391-391-57-57-391 391v57Zm-80 80v-170l528-527q12-11 26.5-17t30.5-6q16 0 31 6t26 18l55 56q12 11 17.5 26t5.5 30q0 16-5.5 30.5T817-647L290-120H120Zm640-584-56-56 56 56Zm-141 85-28-29 57 57-29-28Z"
|
|
1899
|
+
/>
|
|
1900
|
+
</svg>
|
|
1901
|
+
</div>
|
|
1902
|
+
`:n` <span>${this.contactName}</span> `}
|
|
1903
|
+
<span>${this.contactEmail}</span>
|
|
1904
|
+
</div>
|
|
1905
|
+
</div>
|
|
1906
|
+
|
|
1907
|
+
<div class="contact-media" style="background: var(--bg-primary-color);">
|
|
1908
|
+
<div class="contact-media-header">
|
|
1909
|
+
<span class="contact-media-header-label">Media, links and docs</span>
|
|
1910
|
+
<div class="contact-media-header-count" @click=${this.toggleMediaList}>
|
|
1911
|
+
<span>${this.allLinksCount||this.allAttachments?.length}</span>
|
|
1912
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 -960 960 960" width="20px" fill="${this.textColor}">
|
|
1913
|
+
<path d="M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z" />
|
|
1914
|
+
</svg>
|
|
1915
|
+
</div>
|
|
1916
|
+
</div>
|
|
1917
|
+
</div>
|
|
1918
|
+
|
|
1919
|
+
${this.isGroup||this.isGroupcast?n`<div class="group-members" style="background: var(--bg-primary-color);">
|
|
1920
|
+
<div class="group-members-header">
|
|
1921
|
+
<span class="group-members-header-label" style="font-size: 18px;">${k.CHAT.GROUP_INFO.GROUP_MEMBERS.TITLE}</span>
|
|
1922
|
+
${this.groupMembers?.find((t=>t.userId===this.userMetaData?.userId))?.isAdmin||this.isGroupcast?n`
|
|
1923
|
+
<svg
|
|
1924
|
+
@click=${this.handleAddMembersClick}
|
|
1925
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1926
|
+
height="24px"
|
|
1927
|
+
viewBox="0 -960 960 960"
|
|
1928
|
+
width="24px"
|
|
1929
|
+
fill="var(--text-primary-color)"
|
|
1930
|
+
>
|
|
1931
|
+
<path
|
|
1932
|
+
d="M720-400v-120H600v-80h120v-120h80v120h120v80H800v120h-80Zm-360-80q-66 0-113-47t-47-113q0-66 47-113t113-47q66 0 113 47t47 113q0 66-47 113t-113 47ZM40-160v-112q0-34 17.5-62.5T104-378q62-31 126-46.5T360-440q66 0 130 15.5T616-378q29 15 46.5 43.5T680-272v112H40Z"
|
|
1933
|
+
/>
|
|
1934
|
+
</svg>
|
|
1935
|
+
`:""}
|
|
1936
|
+
</div>
|
|
1937
|
+
${this.isLoadingMembers?n` <div style="padding: 0 0px;">${[1,2,3].map((()=>n` <div class="member-shimmer shimmer"></div> `))}</div> `:n` ${Array.isArray(this.isGroupcast?this.groupcastMembers:t)?(this.isGroupcast?this.groupcastMembers:t).slice(0,8).map((t=>n`
|
|
1938
|
+
<div>
|
|
1939
|
+
<contact-tile
|
|
1940
|
+
contactName="${t.userId===this.userMetaData?.userId?"You":t.userName||t?.memberInfo?.userName}"
|
|
1941
|
+
imageSrc="${t.userProfileImageUrl||t?.memberInfo?.userProfileImageUrl}"
|
|
1942
|
+
.suffix=${t.isAdmin?"Admin":""}
|
|
1943
|
+
suffixBgColor="var(--bg-secondary-color)"
|
|
1944
|
+
suffixColor="var(--text-primary-color)"
|
|
1945
|
+
bgColor="inherit"
|
|
1946
|
+
padding="10px"
|
|
1947
|
+
borderWidth="0px"
|
|
1948
|
+
.isCheckBox=${false}
|
|
1949
|
+
gap="10px"
|
|
1950
|
+
.showActions=${this.shouldShowMemberActions(t.userId)||this.isGroupcast}
|
|
1951
|
+
.userId=${t?.userId||t?.memberId}
|
|
1952
|
+
.isAdmin=${t?.isAdmin||this.isGroupcast}
|
|
1953
|
+
@name-clicked=${t=>this.openProfile(t.detail)}
|
|
1954
|
+
.isGroupcast=${this.isGroupcast}
|
|
1955
|
+
></contact-tile>
|
|
1956
|
+
</div>
|
|
1957
|
+
`)):""}`}
|
|
1958
|
+
${Array.isArray(t||this.groupcastMembers)&&(t||this.groupcastMembers).length>8?n`<button
|
|
1959
|
+
style="border: none; background: transparent; cursor: pointer; padding: 10px; width: 100%; text-decoration: underline; color:var(--text-primary-color);"
|
|
1960
|
+
@click="${this.showMembersPopup}"
|
|
1961
|
+
>
|
|
1962
|
+
View All Members (${(t||this.groupcastMembers).length})
|
|
1963
|
+
</button>`:""}
|
|
1964
|
+
</div>
|
|
1965
|
+
|
|
1966
|
+
${this.isPopupOpen?n`
|
|
1967
|
+
<div class="popup-overlay">
|
|
1968
|
+
<div class="popup-content group-members-popup">
|
|
1969
|
+
<div class="popup-header">
|
|
1970
|
+
<span style="color: ${this.textColor};">${k.CHAT.GROUP_INFO.GROUP_MEMBERS.TITLE}</span>
|
|
1971
|
+
${this.groupMembers?.find((t=>t.userId===this.userMetaData?.userId))?.isAdmin||this.isGroupcast?n`
|
|
1972
|
+
<div class="group-members-popup-actions">
|
|
1973
|
+
<span>${k.CHAT.GROUP_INFO.GROUP_MEMBERS.ADD_MEMBER}</span>
|
|
1974
|
+
<svg
|
|
1975
|
+
@click=${this.handleAddMembersClick}
|
|
1976
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1977
|
+
height="24px"
|
|
1978
|
+
viewBox="0 -960 960 960"
|
|
1979
|
+
width="24px"
|
|
1980
|
+
fill="var(--text-primary-color)"
|
|
1981
|
+
>
|
|
1982
|
+
<path
|
|
1983
|
+
d="M720-400v-120H600v-80h120v-120h80v120h120v80H800v120h-80Zm-360-80q-66 0-113-47t-47-113q0-66 47-113t113-47q66 0 113 47t47 113q0 66-47 113t-113 47ZM40-160v-112q0-34 17.5-62.5T104-378q62-31 126-46.5T360-440q66 0 130 15.5T616-378q29 15 46.5 43.5T680-272v112H40Z"
|
|
1984
|
+
/>
|
|
1985
|
+
</svg>
|
|
1986
|
+
</div>
|
|
1987
|
+
`:""}
|
|
1988
|
+
<button class="close-btn" @click="${this.closeMembersPopup}">
|
|
1989
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="${this.textColor}">
|
|
1990
|
+
<path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z" />
|
|
1991
|
+
</svg>
|
|
1992
|
+
</button>
|
|
1993
|
+
</div>
|
|
1994
|
+
<div class="popup-members">
|
|
1995
|
+
${(this.isGroupcast?this.groupcastMembers:this.groupMembers).map((t=>n`
|
|
1996
|
+
<div>
|
|
1997
|
+
<contact-tile
|
|
1998
|
+
contactName="${t.userName||t.memberInfo?.userName}"
|
|
1999
|
+
imageSrc="${t.userProfileImageUrl||t.memberInfo?.userProfileImageUrl}"
|
|
2000
|
+
.suffix=${t.isAdmin?"Admin":""}
|
|
2001
|
+
suffixBgColor="var(--bg-secondary-color)"
|
|
2002
|
+
suffixColor="var(--text-primary-color)"
|
|
2003
|
+
bgColor="inherit"
|
|
2004
|
+
padding="10px"
|
|
2005
|
+
borderWidth="0px"
|
|
2006
|
+
.isCheckBox=${false}
|
|
2007
|
+
gap="10px"
|
|
2008
|
+
.showActions=${this.shouldShowMemberActions(t.userId)||this.isGroupcast}
|
|
2009
|
+
.userId=${t.userId||t.memberId}
|
|
2010
|
+
@name-clicked=${t=>this.openProfile(t.detail)}
|
|
2011
|
+
.isGroupcast=${this.isGroupcast}
|
|
2012
|
+
/>
|
|
2013
|
+
</div>
|
|
2014
|
+
`))}
|
|
2015
|
+
</div>
|
|
2016
|
+
</div>
|
|
2017
|
+
</div>
|
|
2018
|
+
`:""}`:""}
|
|
2019
|
+
</div>
|
|
2020
|
+
`}
|
|
2021
|
+
${!i?n`
|
|
2022
|
+
<div class="ctas">
|
|
2023
|
+
${this.showMediaList?null:this.isGroup?n`
|
|
2024
|
+
<button @click="${()=>this.openConfirmationPopup("exit-group","exit group")}">
|
|
2025
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="${this.textColor}">
|
|
2026
|
+
<path
|
|
2027
|
+
d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h280v80H200v560h280v80H200Zm440-160-55-58 102-102H360v-80h327L585-622l55-58 200 200-200 200Z"
|
|
2028
|
+
/>
|
|
2029
|
+
</svg>
|
|
2030
|
+
Exit Group
|
|
2031
|
+
</button>
|
|
2032
|
+
`:n`
|
|
2033
|
+
<button @click="${()=>this.openConfirmationPopup("clear-chat","Clear Chat")}">Clear Chat</button>
|
|
2034
|
+
${this.conversationMetaData.messagingDisabled&&this.isBlocked?n`<button style="color: var(--text-danger-color);" @click="${()=>this.openConfirmationPopup("unblock-contact","Unblock Chat")}">Unblock Chat</button>`:!this.conversationMetaData.messagingDisabled&&this.isBlocked===null?n`<button style="color: var(--text-danger-color);" @click="${()=>this.openConfirmationPopup("block-contact","Block Chat")}">Block Chat</button>`:this.isBlocked==="loading"?n`<div class="shimmer-loader">
|
|
2035
|
+
<div class="shimmer-line"></div>
|
|
2036
|
+
</div>`:null}
|
|
2037
|
+
<button style="color: var(--text-danger-color);" @click="${()=>this.openConfirmationPopup("delete-chat","Delete Chat")}">Delete Chat</button>
|
|
2038
|
+
`}
|
|
2039
|
+
</div>
|
|
2040
|
+
`:n`<div class="ctas">
|
|
2041
|
+
<button style="color: var(--text-danger-color);" @click="${()=>this.openConfirmationPopup("delete-groupcast","Delete Groupcast")}">Delete Groupcast</button>
|
|
2042
|
+
|
|
2043
|
+
</div>`}
|
|
2044
|
+
</div>
|
|
2045
|
+
`}}customElements.define("contact-info",dt);class ht extends s{static properties={padding:{type:String},margin:{type:String},width:{type:String},boxShadow:{type:String},height:{type:String},borderRadius:{type:String},borderWidth:{type:String},borderColor:{type:String},borderStyle:{type:String},backgroundColor:{type:String},textColor:{type:String},fontSize:{type:String},fontWeight:{type:String},fontFamily:{type:String},fontStyle:{type:String},lineHeight:{type:String},textAlign:{type:String},contactImage:{type:String},contactName:{type:String},contactEmail:{type:String},messageAction:{type:Object},groupMembers:{type:Array},allAttachments:{type:Array},isGroup:{type:Boolean},showAllMembers:{type:Boolean},isPopupOpen:{type:Boolean},showMediaList:{type:Boolean},isImageFullscreen:{type:Boolean},showConfirmationPopup:{type:Boolean},confirmationAction:{type:String},conversationId:{type:String,reflect:true,mutable:true},oppenentId:{type:String,reflect:true},userMetaData:{type:Object},onEditTitle:{type:Function},handleChatSelect:{type:Function},onEditImage:{type:Function},isEditingName:{type:Boolean},onEditImage:{type:Function},openOwnProfile:{type:Boolean},editedName:{type:String},eligibleMembers:{type:Array},isEligibleMembersPopupOpen:{type:Boolean},hasMoreEligibleMembers:{type:Boolean},isLoadingMembers:{type:Boolean},activeTab:{type:String},docsAttachments:{type:Array},linksAttachments:{type:Array},allLinks:{type:Array},allLinksCount:{type:Number},isBlocked:{type:Boolean|String},conversationMetaData:{type:Object}};static styles=c`
|
|
2046
|
+
.contact-info-container {
|
|
2047
|
+
display: flex;
|
|
2048
|
+
flex-direction: column;
|
|
2049
|
+
overflow: hidden;
|
|
2050
|
+
height: 100%;
|
|
2051
|
+
}
|
|
2052
|
+
|
|
2053
|
+
.contact-info-header {
|
|
2054
|
+
display: flex;
|
|
2055
|
+
align-items: center;
|
|
2056
|
+
gap: 10px;
|
|
2057
|
+
padding: 20px;
|
|
2058
|
+
font-size: 18px;
|
|
2059
|
+
background: inherit;
|
|
2060
|
+
position: sticky;
|
|
2061
|
+
top: 0;
|
|
2062
|
+
z-index: 10;
|
|
2063
|
+
background: var(--bg-primary-color);
|
|
2064
|
+
}
|
|
2065
|
+
.shimmer-loader {
|
|
2066
|
+
width: 50%;
|
|
2067
|
+
height: 40px;
|
|
2068
|
+
position: relative;
|
|
2069
|
+
overflow: hidden;
|
|
2070
|
+
}
|
|
2071
|
+
|
|
2072
|
+
.shimmer-line {
|
|
2073
|
+
position: absolute;
|
|
2074
|
+
top: 0;
|
|
2075
|
+
left: -100%;
|
|
2076
|
+
width: 100%;
|
|
2077
|
+
height: 100%;
|
|
2078
|
+
background: linear-gradient(90deg, var(--bg-secondary-color) 25%, var(--bg-primary-light) 50%, var(--bg-secondary-color) 75%);
|
|
2079
|
+
animation: shimmer 1.5s infinite;
|
|
2080
|
+
}
|
|
2081
|
+
|
|
2082
|
+
@keyframes shimmer {
|
|
2083
|
+
0% {
|
|
2084
|
+
left: -100%;
|
|
2085
|
+
}
|
|
2086
|
+
100% {
|
|
2087
|
+
left: 100%;
|
|
2088
|
+
}
|
|
2089
|
+
}
|
|
2090
|
+
|
|
2091
|
+
.contact-info-body {
|
|
2092
|
+
display: flex;
|
|
2093
|
+
flex-direction: column;
|
|
2094
|
+
gap: 1.5rem;
|
|
2095
|
+
background: inherit;
|
|
2096
|
+
overflow-y: auto;
|
|
2097
|
+
flex-grow: 1;
|
|
2098
|
+
}
|
|
2099
|
+
|
|
2100
|
+
.contact-info-body::-webkit-scrollbar {
|
|
2101
|
+
width: 4px;
|
|
2102
|
+
}
|
|
2103
|
+
|
|
2104
|
+
.contact-info-body::-webkit-scrollbar-thumb {
|
|
2105
|
+
background-color: var(--text-primary-color);
|
|
2106
|
+
border-radius: 10px;
|
|
2107
|
+
}
|
|
2108
|
+
|
|
2109
|
+
.contact-info-body::-webkit-scrollbar-track {
|
|
2110
|
+
background: var(--bg-primary-color);
|
|
2111
|
+
border-radius: 10px;
|
|
2112
|
+
}
|
|
2113
|
+
|
|
2114
|
+
.contact-info {
|
|
2115
|
+
display: flex;
|
|
2116
|
+
align-items: center;
|
|
2117
|
+
gap: 10px;
|
|
2118
|
+
flex-direction: column;
|
|
2119
|
+
padding: 1.5rem;
|
|
2120
|
+
}
|
|
2121
|
+
|
|
2122
|
+
.contact-info-name {
|
|
2123
|
+
display: flex;
|
|
2124
|
+
flex-direction: column;
|
|
2125
|
+
align-items: center;
|
|
2126
|
+
}
|
|
2127
|
+
|
|
2128
|
+
.contact-info-name span:first-child {
|
|
2129
|
+
font-size: 20px;
|
|
2130
|
+
font-weight: 600;
|
|
2131
|
+
}
|
|
2132
|
+
|
|
2133
|
+
.contact-info-name span:last-child {
|
|
2134
|
+
font-size: 16px;
|
|
2135
|
+
font-weight: 400;
|
|
2136
|
+
}
|
|
2137
|
+
|
|
2138
|
+
.contact-media {
|
|
2139
|
+
padding: 16px;
|
|
2140
|
+
background: inherit;
|
|
2141
|
+
}
|
|
2142
|
+
|
|
2143
|
+
.contact-media-header {
|
|
2144
|
+
display: flex;
|
|
2145
|
+
align-items: center;
|
|
2146
|
+
justify-content: space-between;
|
|
2147
|
+
font-size: 18px;
|
|
2148
|
+
}
|
|
2149
|
+
contact-media-header-label {
|
|
2150
|
+
font-size: 14px;
|
|
2151
|
+
}
|
|
2152
|
+
|
|
2153
|
+
.contact-media-header-count {
|
|
2154
|
+
display: flex;
|
|
2155
|
+
align-items: center;
|
|
2156
|
+
cursor: pointer;
|
|
2157
|
+
}
|
|
2158
|
+
|
|
2159
|
+
.contact-media-body {
|
|
2160
|
+
display: flex;
|
|
2161
|
+
gap: 10px;
|
|
2162
|
+
overflow: hidden;
|
|
2163
|
+
padding: 10px;
|
|
2164
|
+
}
|
|
2165
|
+
.members-list {
|
|
2166
|
+
position: absolute;
|
|
2167
|
+
top: 50%;
|
|
2168
|
+
left: 50%;
|
|
2169
|
+
transform: translate(-50%, -50%);
|
|
2170
|
+
z-index: 1000;
|
|
2171
|
+
width: 25%;
|
|
2172
|
+
min-width: var(--sidebar-width);
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2175
|
+
.popup-members {
|
|
2176
|
+
display: flex;
|
|
2177
|
+
flex-direction: column;
|
|
2178
|
+
gap: 10px;
|
|
2179
|
+
max-height: calc(80vh - 50px);
|
|
2180
|
+
overflow-y: auto;
|
|
2181
|
+
}
|
|
2182
|
+
|
|
2183
|
+
.popup-members::-webkit-scrollbar {
|
|
2184
|
+
width: 4px;
|
|
2185
|
+
}
|
|
2186
|
+
|
|
2187
|
+
.popup-members::-webkit-scrollbar-track {
|
|
2188
|
+
background: transparent;
|
|
2189
|
+
}
|
|
2190
|
+
|
|
2191
|
+
.popup-members::-webkit-scrollbar-thumb {
|
|
2192
|
+
background-color: var(--bg-primary-light);
|
|
2193
|
+
border-radius: 3px;
|
|
2194
|
+
}
|
|
2195
|
+
|
|
2196
|
+
.group-members-popup-actions {
|
|
2197
|
+
display: flex;
|
|
2198
|
+
align-items: center;
|
|
2199
|
+
gap: 10px;
|
|
2200
|
+
position: absolute;
|
|
2201
|
+
bottom: 0px;
|
|
2202
|
+
background: var(--bg-secondary-color);
|
|
2203
|
+
z-index: 1;
|
|
2204
|
+
padding: 10px;
|
|
2205
|
+
left: 0;
|
|
2206
|
+
margin: 10px;
|
|
2207
|
+
width: -webkit-fill-available;
|
|
2208
|
+
justify-content: center;
|
|
2209
|
+
cursor: pointer;
|
|
2210
|
+
}
|
|
2211
|
+
|
|
2212
|
+
.group-members-popup {
|
|
2213
|
+
position: relative;
|
|
2214
|
+
}
|
|
2215
|
+
|
|
2216
|
+
.group-members-header {
|
|
2217
|
+
display: flex;
|
|
2218
|
+
justify-content: space-between;
|
|
2219
|
+
align-items: center;
|
|
2220
|
+
padding: 0px 16px;
|
|
2221
|
+
}
|
|
2222
|
+
|
|
2223
|
+
.group-members-header svg {
|
|
2224
|
+
cursor: pointer;
|
|
2225
|
+
}
|
|
2226
|
+
|
|
2227
|
+
.group-members {
|
|
2228
|
+
padding: 16px;
|
|
2229
|
+
background: inherit;
|
|
2230
|
+
}
|
|
2231
|
+
|
|
2232
|
+
.close-btn {
|
|
2233
|
+
background: none;
|
|
2234
|
+
border: none;
|
|
2235
|
+
font-size: 24px;
|
|
2236
|
+
cursor: pointer;
|
|
2237
|
+
}
|
|
2238
|
+
|
|
2239
|
+
.ctas {
|
|
2240
|
+
display: flex;
|
|
2241
|
+
flex-direction: column;
|
|
2242
|
+
gap: 2px;
|
|
2243
|
+
background: var(--bg-primary-color);
|
|
2244
|
+
}
|
|
2245
|
+
|
|
2246
|
+
.ctas button {
|
|
2247
|
+
border: none;
|
|
2248
|
+
display: flex;
|
|
2249
|
+
align-items: center;
|
|
2250
|
+
gap: 10px;
|
|
2251
|
+
padding: 20px;
|
|
2252
|
+
cursor: pointer;
|
|
2253
|
+
width: 100%;
|
|
2254
|
+
font-size: 16px;
|
|
2255
|
+
background: transparent;
|
|
2256
|
+
}
|
|
2257
|
+
|
|
2258
|
+
.ctas button:hover {
|
|
2259
|
+
background: var(--bg-secondary-color);
|
|
2260
|
+
}
|
|
2261
|
+
|
|
2262
|
+
.fullscreen-image-container {
|
|
2263
|
+
display: flex;
|
|
2264
|
+
justify-content: center;
|
|
2265
|
+
align-items: center;
|
|
2266
|
+
width: 100%;
|
|
2267
|
+
height: 100%;
|
|
2268
|
+
}
|
|
2269
|
+
|
|
2270
|
+
.fullscreen-image-container img {
|
|
2271
|
+
position: relative;
|
|
2272
|
+
}
|
|
2273
|
+
|
|
2274
|
+
.contact-media-body img {
|
|
2275
|
+
cursor: pointer;
|
|
2276
|
+
}
|
|
2277
|
+
|
|
2278
|
+
.contact-media-body img:hover {
|
|
2279
|
+
scale: 1.05;
|
|
2280
|
+
}
|
|
2281
|
+
|
|
2282
|
+
.group-members chat-tile:hover {
|
|
2283
|
+
background: var(--bg-primary-light);
|
|
2284
|
+
cursor: pointer;
|
|
2285
|
+
border-radius: 8px;
|
|
2286
|
+
}
|
|
2287
|
+
|
|
2288
|
+
.popup-members chat-tile:hover {
|
|
2289
|
+
background: var(--bg-primary-light);
|
|
2290
|
+
cursor: pointer;
|
|
2291
|
+
border-radius: 8px;
|
|
2292
|
+
}
|
|
2293
|
+
|
|
2294
|
+
.profile-image-container {
|
|
2295
|
+
position: relative;
|
|
2296
|
+
cursor: pointer;
|
|
2297
|
+
}
|
|
2298
|
+
|
|
2299
|
+
.profile-image-container:hover .image-edit-overlay {
|
|
2300
|
+
opacity: 1;
|
|
2301
|
+
}
|
|
2302
|
+
|
|
2303
|
+
.image-edit-overlay {
|
|
2304
|
+
position: absolute;
|
|
2305
|
+
top: 0;
|
|
2306
|
+
left: 0;
|
|
2307
|
+
right: 0;
|
|
2308
|
+
bottom: 0;
|
|
2309
|
+
background: rgba(0, 0, 0, 0.5);
|
|
2310
|
+
border-radius: 50%;
|
|
2311
|
+
display: flex;
|
|
2312
|
+
align-items: center;
|
|
2313
|
+
justify-content: center;
|
|
2314
|
+
opacity: 0;
|
|
2315
|
+
transition: opacity 0.3s ease;
|
|
2316
|
+
}
|
|
2317
|
+
|
|
2318
|
+
.name-edit-input:focus {
|
|
2319
|
+
background: var(--bg-primary-light);
|
|
2320
|
+
}
|
|
2321
|
+
|
|
2322
|
+
.nav-container {
|
|
2323
|
+
width: 100%;
|
|
2324
|
+
background-color: var(--bg-secondary-color);
|
|
2325
|
+
padding: 16px 0;
|
|
2326
|
+
}
|
|
2327
|
+
.messageTab {
|
|
2328
|
+
display: flex;
|
|
2329
|
+
align-items: center;
|
|
2330
|
+
justify-content: center;
|
|
2331
|
+
flex-direction: column;
|
|
2332
|
+
padding: 10px 0px;
|
|
2333
|
+
color: var(--bg-incoming-message);
|
|
2334
|
+
cursor: pointer;
|
|
2335
|
+
}
|
|
2336
|
+
/* Inner container for max width */
|
|
2337
|
+
.inner-container {
|
|
2338
|
+
max-width: 1024px;
|
|
2339
|
+
margin: 0 auto;
|
|
2340
|
+
padding: 0 16px;
|
|
2341
|
+
}
|
|
2342
|
+
|
|
2343
|
+
/* Tab styling */
|
|
2344
|
+
.tabs {
|
|
2345
|
+
display: flex;
|
|
2346
|
+
gap: 32px;
|
|
2347
|
+
}
|
|
2348
|
+
|
|
2349
|
+
/* Tab item styling */
|
|
2350
|
+
.tab-item {
|
|
2351
|
+
position: relative;
|
|
2352
|
+
cursor: pointer;
|
|
2353
|
+
}
|
|
2354
|
+
|
|
2355
|
+
/* Radio buttons (hidden) */
|
|
2356
|
+
.tab-radio {
|
|
2357
|
+
position: absolute;
|
|
2358
|
+
opacity: 0;
|
|
2359
|
+
cursor: pointer;
|
|
2360
|
+
}
|
|
2361
|
+
|
|
2362
|
+
/* Tab labels */
|
|
2363
|
+
.tab-label {
|
|
2364
|
+
display: inline-block;
|
|
2365
|
+
color: #9ca3af;
|
|
2366
|
+
font-size: 18px;
|
|
2367
|
+
padding: 4px 0;
|
|
2368
|
+
transition: color 0.3s ease;
|
|
2369
|
+
}
|
|
2370
|
+
|
|
2371
|
+
/* Underline indicator */
|
|
2372
|
+
.tab-indicator {
|
|
2373
|
+
position: absolute;
|
|
2374
|
+
bottom: -16px;
|
|
2375
|
+
left: 0;
|
|
2376
|
+
width: 100%;
|
|
2377
|
+
height: 4px;
|
|
2378
|
+
background-color: var(--base-color);
|
|
2379
|
+
transform: scaleX(0);
|
|
2380
|
+
transition: transform 0.3s ease;
|
|
2381
|
+
}
|
|
2382
|
+
|
|
2383
|
+
/* When radio is checked */
|
|
2384
|
+
.tab-radio:checked + .tab-label {
|
|
2385
|
+
color: var(--base-color);
|
|
2386
|
+
}
|
|
2387
|
+
|
|
2388
|
+
.tab-radio:checked ~ .tab-indicator {
|
|
2389
|
+
transform: scaleX(1);
|
|
2390
|
+
}
|
|
2391
|
+
|
|
2392
|
+
/* Focus styles for accessibility */
|
|
2393
|
+
.tab-radio:focus + .tab-label {
|
|
2394
|
+
outline-offset: 2px;
|
|
2395
|
+
}
|
|
2396
|
+
.doc-item {
|
|
2397
|
+
display: flex;
|
|
2398
|
+
align-items: center;
|
|
2399
|
+
background: var(--bg-primary-light);
|
|
2400
|
+
margin: 8px 0;
|
|
2401
|
+
padding: 12px;
|
|
2402
|
+
border-radius: 8px;
|
|
2403
|
+
cursor: pointer;
|
|
2404
|
+
}
|
|
2405
|
+
|
|
2406
|
+
.doc-item:hover {
|
|
2407
|
+
background: var(--bg-secondary-color);
|
|
2408
|
+
}
|
|
2409
|
+
|
|
2410
|
+
.doc-icon {
|
|
2411
|
+
margin-right: 12px;
|
|
2412
|
+
width: 40px;
|
|
2413
|
+
height: 40px;
|
|
2414
|
+
display: flex;
|
|
2415
|
+
align-items: center;
|
|
2416
|
+
justify-content: center;
|
|
2417
|
+
}
|
|
2418
|
+
|
|
2419
|
+
.doc-info {
|
|
2420
|
+
flex-grow: 1;
|
|
2421
|
+
overflow: hidden;
|
|
2422
|
+
}
|
|
2423
|
+
|
|
2424
|
+
.doc-name {
|
|
2425
|
+
font-weight: 500;
|
|
2426
|
+
white-space: nowrap;
|
|
2427
|
+
overflow: hidden;
|
|
2428
|
+
text-overflow: ellipsis;
|
|
2429
|
+
margin-bottom: 4px;
|
|
2430
|
+
}
|
|
2431
|
+
|
|
2432
|
+
.doc-meta {
|
|
2433
|
+
display: flex;
|
|
2434
|
+
font-size: 12px;
|
|
2435
|
+
color: var(--text-secondary-color);
|
|
2436
|
+
}
|
|
2437
|
+
|
|
2438
|
+
/* Link item styles */
|
|
2439
|
+
.link-item {
|
|
2440
|
+
display: flex;
|
|
2441
|
+
margin: 8px 0;
|
|
2442
|
+
border-radius: 8px;
|
|
2443
|
+
overflow: hidden;
|
|
2444
|
+
text-decoration: none;
|
|
2445
|
+
color: inherit;
|
|
2446
|
+
}
|
|
2447
|
+
|
|
2448
|
+
.link-item:hover {
|
|
2449
|
+
background: var(--bg-secondary-color);
|
|
2450
|
+
}
|
|
2451
|
+
|
|
2452
|
+
.link-preview {
|
|
2453
|
+
width: 100%;
|
|
2454
|
+
height: 100%;
|
|
2455
|
+
display: flex;
|
|
2456
|
+
align-items: center;
|
|
2457
|
+
justify-content: center;
|
|
2458
|
+
}
|
|
2459
|
+
|
|
2460
|
+
.link-info {
|
|
2461
|
+
padding: 12px;
|
|
2462
|
+
flex-grow: 1;
|
|
2463
|
+
overflow: hidden;
|
|
2464
|
+
}
|
|
2465
|
+
|
|
2466
|
+
.link-title {
|
|
2467
|
+
font-weight: 500;
|
|
2468
|
+
margin-bottom: 4px;
|
|
2469
|
+
white-space: nowrap;
|
|
2470
|
+
overflow: hidden;
|
|
2471
|
+
text-overflow: ellipsis;
|
|
2472
|
+
}
|
|
2473
|
+
|
|
2474
|
+
.link-url {
|
|
2475
|
+
font-size: 12px;
|
|
2476
|
+
color: var(--text-secondary-color);
|
|
2477
|
+
white-space: nowrap;
|
|
2478
|
+
overflow: hidden;
|
|
2479
|
+
text-overflow: ellipsis;
|
|
2480
|
+
}
|
|
2481
|
+
|
|
2482
|
+
.no-content {
|
|
2483
|
+
display: flex;
|
|
2484
|
+
flex-direction: column;
|
|
2485
|
+
align-items: center;
|
|
2486
|
+
justify-content: center;
|
|
2487
|
+
height: 200px;
|
|
2488
|
+
color: var(--text-secondary-color);
|
|
2489
|
+
text-align: center;
|
|
2490
|
+
padding: 0 20px;
|
|
2491
|
+
}
|
|
2492
|
+
|
|
2493
|
+
.no-content svg {
|
|
2494
|
+
margin-bottom: 16px;
|
|
2495
|
+
opacity: 0.5;
|
|
2496
|
+
}
|
|
2497
|
+
|
|
2498
|
+
/* Month separator */
|
|
2499
|
+
.month-separator {
|
|
2500
|
+
font-size: 14px;
|
|
2501
|
+
font-weight: 500;
|
|
2502
|
+
margin: 24px 0 12px 0;
|
|
2503
|
+
padding-left: 8px;
|
|
2504
|
+
}
|
|
2505
|
+
|
|
2506
|
+
.shimmer {
|
|
2507
|
+
background: linear-gradient(90deg, var(--bg-secondary-color) 25%, var(--bg-primary-light) 50%, var(--bg-secondary-color) 75%);
|
|
2508
|
+
background-size: 200% 100%;
|
|
2509
|
+
animation: shimmer 1.5s infinite linear;
|
|
2510
|
+
}
|
|
2511
|
+
|
|
2512
|
+
.member-shimmer {
|
|
2513
|
+
height: 60px;
|
|
2514
|
+
border-radius: 8px;
|
|
2515
|
+
margin: 8px 16px;
|
|
2516
|
+
opacity: 0.7;
|
|
2517
|
+
}
|
|
2518
|
+
|
|
2519
|
+
@keyframes shimmer {
|
|
2520
|
+
0% {
|
|
2521
|
+
background-position: 100% 0;
|
|
2522
|
+
}
|
|
2523
|
+
100% {
|
|
2524
|
+
background-position: -100% 0;
|
|
2525
|
+
}
|
|
2526
|
+
}
|
|
2527
|
+
`;constructor(){super();this.lastConversationId=null;this.isEditingName=false;this.editedName="";this.isLoadingMembers=true;this.activeTab="media";this.conversationMetaData={};this.docsAttachments=[];this.linksAttachments=[]}willUpdate(t){if(t.has("conversationId")){this.handleConversationIdChange(this.conversationId,t.get("conversationId"))}}handleConversationIdChange(t,e){if(t!==at.getCurrentConversationId()){this.isLoadingMembers=true;at.initializeMembers(this.groupMembers,t)}const i=this.getConversationIdFromUrl();if(this.lastConversationId&&this.lastConversationId!==i){this._handleClose()}this.lastConversationId=i}toggleShowAllMembers(){this.showAllMembers=!this.showAllMembers}showMembersPopup(){this.isPopupOpen=true}closeMembersPopup(){this.isPopupOpen=false}toggleMediaList(){this.showMediaList=!this.showMediaList}toggleImageFullscreen(){this.isImageFullscreen=!this.isImageFullscreen}_handleClose(){if(this.showMediaList){this.showMediaList=false;return}this.dispatchEvent(new CustomEvent("close-right-Sidebar",{detail:{type:"close-right-Sidebar"},bubbles:true,composed:true}))}getConversationIdFromUrl(){const t=new URL(window.location.href);return t.searchParams.get("conversation")}exitGroup(){this.dispatchEvent(new CustomEvent("contact-action",{detail:{action:"exit-group",conversationId:this.conversationId},bubbles:true,composed:true}))}clearChat(){this.dispatchEvent(new CustomEvent("contact-action",{detail:{action:"clear-chat",conversationId:this.conversationId},bubbles:true,composed:true}))}blockContact(){this.dispatchEvent(new CustomEvent("contact-action",{detail:{action:"block-contact",oppenentId:this.oppenentId,userName:this.contactName},bubbles:true,composed:true}))}unblockContact(){this.dispatchEvent(new CustomEvent("contact-action",{detail:{action:"unblock-contact",oppenentId:this.oppenentId,userName:this.contactName},bubbles:true,composed:true}))}deleteChat(){this.dispatchEvent(new CustomEvent("contact-action",{detail:{action:"delete-chat",conversationId:this.conversationId},bubbles:true,composed:true}))}openConfirmationPopup(t){b.openDialog("confirm-dialog",{title:`${title}`,description:`Are you sure you want to ${title} ?`,handleConfirm:()=>this.confirmAction(t)})}closeConfirmationPopup(){this.showConfirmationPopup=false;this._handleClose()}confirmAction(t){switch(t){case"delete-chat":this.deleteChat();break;case"exit-group":this.exitGroup();break;case"clear-chat":this.clearChat();break;case"block-contact":this.blockContact();break;case"unblock-contact":this.unblockContact();break}this.closeConfirmationPopup()}_handleKebabMenuClick(t){t.stopPropagation()}shouldShowMemberActions(t){const e=this.groupMembers?.find((t=>t.userId===this.userMetaData?.userId));return e?.isAdmin?this.userMetaData?.userId!==t:false}handleNameClick(){if(this.isGroup){this.isEditingName=true;this.editedName=this.contactName;setTimeout((()=>{const t=this.shadowRoot.querySelector(".name-edit-input");if(t){t.focus();t.select()}}),0)}}handleNameInputKeyDown(t){if(t.key==="Enter"){this.saveName()}else if(t.key==="Escape"){this.isEditingName=false}}saveName(){if(this.editedName.trim()&&this.editedName!==this.contactName){const t=this.contactName;this.contactName=this.editedName.trim();this.dispatchEvent(new CustomEvent("edit-title",{detail:{currentTitle:t,newTitle:this.editedName.trim(),conversationId:this.conversationId,onError:()=>{this.contactName=t}},bubbles:true,composed:true}))}this.isEditingName=false}handleImageClick(){if(this.isGroup){const t=document.createElement("input");t.type="file";t.accept="image/*";t.onchange=t=>{const e=t.target.files?.[0];if(e){const t=URL.createObjectURL(e);const i=this.contactImage;this.contactImage=t;this.dispatchEvent(new CustomEvent("edit-image",{detail:{currentImage:i,conversationId:this.conversationId,file:e,onError:()=>{this.contactImage=i;URL.revokeObjectURL(t)},onSuccess:()=>{URL.revokeObjectURL(t)}},bubbles:true,composed:true}))}};t.click()}}extractAttachmentsByType(){this.docsAttachments=[];this.linksAttachments=[];if(!this.allAttachments||!this.allAttachments.length)return;this.allAttachments.forEach((t=>{t?.attachments?.forEach((e=>{if(e.mediaType===3){this.docsAttachments.push({...e,date:t.sentAt,sender:t?.senderInfo?.userName})}else if(t?.customType==="AttachmentMessage:Link"){this.linksAttachments.push({...e,date:t.sentAt,sender:t?.senderInfo?.userName})}}))}));this.docsAttachments.sort(((t,e)=>new Date(e.date)-new Date(t.date)));this.linksAttachments.sort(((t,e)=>new Date(e.date)-new Date(t.date)));this.requestUpdate()}updated(t){super.updated(t);if(t.has("allAttachments")){this.extractAttachmentsByType()}}switchTab(t){this.activeTab=t}formatFileSize(t){if(!t)return"0 B";const e=1024;const i=["B","KB","MB","GB"];const o=Math.floor(Math.log(t)/Math.log(e));return parseFloat((t/Math.pow(e,o)).toFixed(2))+" "+i[o]}formatDate(t){if(!t)return"";const e=new Date(t);return e.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})}getMonthYear(t){if(!t)return"";const e=new Date(t);return e.toLocaleDateString("en-US",{month:"long",year:"numeric"})}groupByMonth(t,e=false){const i={};t.forEach((t=>{const o=this.getMonthYear(e?t.sentAt:t.date);if(!i[o]){i[o]=[]}i[o].push(t)}));return i}handleRedirectChat(){if(this.conversationId){this.handleChatSelect(this.conversationId)}this.dispatchEvent(new CustomEvent("close-right-Sidebar",{detail:{type:"close-right-Sidebar"},bubbles:true,composed:true}))}renderNoContent(t,e){return n`
|
|
2528
|
+
<div class="tab-content active">
|
|
2529
|
+
<div class="no-content">
|
|
2530
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 0 24 24" width="48" fill="currentColor">
|
|
2531
|
+
<path d="M0 0h24v24H0V0z" fill="none" />
|
|
2532
|
+
<path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86l-3 3.87L9 13.14 6 17h12l-3.86-5.14z" />
|
|
2533
|
+
</svg>
|
|
2534
|
+
<h3 style="margin: 0 0 8px 0;">${t}</h3>
|
|
2535
|
+
<p style="margin: 0;">${e}</p>
|
|
2536
|
+
</div>
|
|
2537
|
+
</div>
|
|
2538
|
+
`}renderTabContent(){if(this.activeTab==="media"){const t=[];this.allAttachments?.forEach((e=>{e?.attachments?.forEach((e=>{if(e?.mediaUrl&&(e.mediaType===0||e.mediaType===1)){t.push(e.mediaUrl)}}))}));if(!t.length){return this.renderNoContent("No Media","Share media with this chat to see them here.")}return n`
|
|
2539
|
+
<div class="tab-content active">
|
|
2540
|
+
<media-list
|
|
2541
|
+
.mediaArray=${t}
|
|
2542
|
+
padding="10px"
|
|
2543
|
+
bgColor=${this.backgroundColor}
|
|
2544
|
+
color=${this.textColor}
|
|
2545
|
+
style="width: 100%"
|
|
2546
|
+
borderRadius="10px"
|
|
2547
|
+
height="calc(100vh - 100px)"
|
|
2548
|
+
></media-list>
|
|
2549
|
+
</div>
|
|
2550
|
+
`}else if(this.activeTab==="docs"){if(!this.docsAttachments.length){return this.renderNoContent("No Documents","Share documents with this chat to see them here.")}const t=this.groupByMonth(this.docsAttachments);return n`
|
|
2551
|
+
<div class="tab-content active">
|
|
2552
|
+
${Object.keys(t).map((e=>n`
|
|
2553
|
+
<div class="month-separator">${e}</div>
|
|
2554
|
+
${t[e].map((t=>n`
|
|
2555
|
+
<div class="doc-item" @click=${()=>window.open(t.mediaUrl,"_blank")}>
|
|
2556
|
+
<div class="doc-icon">
|
|
2557
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24" fill="currentColor">
|
|
2558
|
+
<path d="M0 0h24v24H0V0z" fill="none" />
|
|
2559
|
+
<path d="M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM16 18H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z" />
|
|
2560
|
+
</svg>
|
|
2561
|
+
</div>
|
|
2562
|
+
<div class="doc-info">
|
|
2563
|
+
<div class="doc-name">${t.name||"Document"}</div>
|
|
2564
|
+
<div class="doc-meta">
|
|
2565
|
+
<span>${this.formatFileSize(t.size)}</span>
|
|
2566
|
+
<span style="margin: 0 6px;">•</span>
|
|
2567
|
+
<span>${this.formatDate(t.date)}</span>
|
|
2568
|
+
</div>
|
|
2569
|
+
</div>
|
|
2570
|
+
</div>
|
|
2571
|
+
`))}
|
|
2572
|
+
`))}
|
|
2573
|
+
</div>
|
|
2574
|
+
`}else if(this.activeTab==="links"){if(!this.allLinks?.length){return this.renderNoContent("No Links","URLs shared in this chat will appear here.")}const t=this.groupByMonth(this.allLinks,true);return n`
|
|
2575
|
+
<div class="tab-content active">
|
|
2576
|
+
${Object.keys(t).map((e=>n`
|
|
2577
|
+
<div class="month-separator">${e}</div>
|
|
2578
|
+
${t[e].map((t=>n`
|
|
2579
|
+
<a href=${t.body} target="_blank" class="link-item">
|
|
2580
|
+
<div class="link-preview">
|
|
2581
|
+
<link-preview url=${t.body} time=${t.sentAt}></link-preview>
|
|
2582
|
+
</div>
|
|
2583
|
+
</a>
|
|
2584
|
+
`))}
|
|
2585
|
+
`))}
|
|
2586
|
+
</div>
|
|
2587
|
+
`}}render(){this.allAttachments?.forEach((t=>{t?.attachments?.forEach((t=>{}))}));const t=at.getMembers();this.isLoadingMembers=!t;return n`
|
|
2588
|
+
<div
|
|
2589
|
+
class="contact-info-container"
|
|
2590
|
+
style=${d({padding:this.padding,margin:this.margin,width:this.width,height:this.height,borderRadius:this.borderRadius,borderWidth:this.borderWidth,borderColor:this.borderColor,borderStyle:this.borderStyle,backgroundColor:this.backgroundColor,color:this.textColor,fontSize:this.fontSize,fontWeight:this.fontWeight,fontFamily:this.fontFamily,fontStyle:this.fontStyle,lineHeight:this.lineHeight,boxShadow:this.boxShadow,textAlign:this.textAlign})}
|
|
2591
|
+
>
|
|
2592
|
+
${this.showMediaList?n`
|
|
2593
|
+
<div class="contact-info-header">
|
|
2594
|
+
<svg
|
|
2595
|
+
@click=${this._handleClose}
|
|
2596
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
2597
|
+
height="24px"
|
|
2598
|
+
viewBox="0 -960 960 960"
|
|
2599
|
+
width="24px"
|
|
2600
|
+
fill="${this.textColor}"
|
|
2601
|
+
style="cursor: pointer;"
|
|
2602
|
+
>
|
|
2603
|
+
<path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z" />
|
|
2604
|
+
</svg>
|
|
2605
|
+
</div>
|
|
2606
|
+
<div>
|
|
2607
|
+
<div class="nav-container">
|
|
2608
|
+
<div class="inner-container">
|
|
2609
|
+
<div class="tabs">
|
|
2610
|
+
<div class="tab-item">
|
|
2611
|
+
<input type="radio" id="tab-media" name="tabs" class="tab-radio" ?checked=${this.activeTab==="media"} @change=${()=>this.switchTab("media")} />
|
|
2612
|
+
<label for="tab-media" class="tab-label">Media</label>
|
|
2613
|
+
<div class="tab-indicator" style="transform: ${this.activeTab==="media"?"scaleX(1)":"scaleX(0)"}"></div>
|
|
2614
|
+
</div>
|
|
2615
|
+
|
|
2616
|
+
<div class="tab-item">
|
|
2617
|
+
<input type="radio" id="tab-docs" name="tabs" class="tab-radio" ?checked=${this.activeTab==="docs"} @change=${()=>this.switchTab("docs")} />
|
|
2618
|
+
<label for="tab-docs" class="tab-label">Docs</label>
|
|
2619
|
+
<div class="tab-indicator" style="transform: ${this.activeTab==="docs"?"scaleX(1)":"scaleX(0)"}"></div>
|
|
2620
|
+
</div>
|
|
2621
|
+
|
|
2622
|
+
<div class="tab-item">
|
|
2623
|
+
<input
|
|
2624
|
+
type="radio"
|
|
2625
|
+
id="tab-links"
|
|
2626
|
+
name="tabs"
|
|
2627
|
+
class="tab-radio"
|
|
2628
|
+
?checked=${this.activeTab==="links"}
|
|
2629
|
+
@change=${()=>this.switchTab("links")}
|
|
2630
|
+
@click=${()=>this.dispatchEvent(new CustomEvent("get-links",{detail:{conversationId:this.conversationId},bubbles:true,composed:true}))}
|
|
2631
|
+
/>
|
|
2632
|
+
<label for="tab-links" class="tab-label">Links</label>
|
|
2633
|
+
<div class="tab-indicator" style="transform: ${this.activeTab==="links"?"scaleX(1)":"scaleX(0)"}"></div>
|
|
2634
|
+
</div>
|
|
2635
|
+
</div>
|
|
2636
|
+
</div>
|
|
2637
|
+
</div>
|
|
2638
|
+
|
|
2639
|
+
${this.renderTabContent()}
|
|
2640
|
+
</div>
|
|
2641
|
+
`:n`
|
|
2642
|
+
<div class="contact-info-header">
|
|
2643
|
+
<svg
|
|
2644
|
+
@click=${this._handleClose}
|
|
2645
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
2646
|
+
height="24px"
|
|
2647
|
+
viewBox="0 -960 960 960"
|
|
2648
|
+
width="24px"
|
|
2649
|
+
fill="${this.textColor}"
|
|
2650
|
+
style="cursor: pointer;"
|
|
2651
|
+
>
|
|
2652
|
+
<path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z" />
|
|
2653
|
+
</svg>
|
|
2654
|
+
${n`<span class="contact-info-label">Contact Info</span>`}
|
|
2655
|
+
</div>
|
|
2656
|
+
|
|
2657
|
+
<div class="contact-info-body">
|
|
2658
|
+
<div class="contact-info" style="background: var(--bg-primary-color);">
|
|
2659
|
+
<div style="position: relative; display: flex; align-items: center; gap: 8px;">
|
|
2660
|
+
${a({src:this.contactImage,alt:this.contactName,width:"calc(75dvh - 300px)",height:"calc(75dvh - 300px)",borderRadius:"50%",objectFit:"cover",placeholderImage:v(this.contactName)})}
|
|
2661
|
+
</div>
|
|
2662
|
+
<div class="contact-info-name">
|
|
2663
|
+
${n` <span>${this.contactName}</span> `}
|
|
2664
|
+
<span>${this.contactEmail}</span>
|
|
2665
|
+
<span @click=${this.handleRedirectChat} class="messageTab">
|
|
2666
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="30px" viewBox="0 -960 960 960" width="30px" fill="#3f51b5">
|
|
2667
|
+
<path
|
|
2668
|
+
d="M240-400h480v-66.67H240V-400Zm0-126.67h480v-66.66H240v66.66Zm0-126.66h480V-720H240v66.67ZM880-80 720-240H146.67q-27 0-46.84-19.83Q80-279.67 80-306.67v-506.66q0-27 19.83-46.84Q119.67-880 146.67-880h666.66q27 0 46.84 19.83Q880-840.33 880-813.33V-80ZM146.67-306.67h602l64.66 68.34v-575H146.67v506.66Zm0 0v-506.66 506.66Z"
|
|
2669
|
+
/>
|
|
2670
|
+
</svg>
|
|
2671
|
+
<span> ${k.PLACEHOLDER_CONTENT.SEARCH_CHAT.MESSAGE} </span>
|
|
2672
|
+
</span>
|
|
2673
|
+
</div>
|
|
2674
|
+
</div>
|
|
2675
|
+
|
|
2676
|
+
<div class="contact-media" style="background: var(--bg-primary-color);">
|
|
2677
|
+
<div class="contact-media-header">
|
|
2678
|
+
<span class="contact-media-header-label">Media, links and docs</span>
|
|
2679
|
+
<div class="contact-media-header-count" @click=${this.toggleMediaList}>
|
|
2680
|
+
<span>${this.allLinksCount||this.allAttachments?.length}</span>
|
|
2681
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 -960 960 960" width="20px" fill="${this.textColor}">
|
|
2682
|
+
<path d="M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z" />
|
|
2683
|
+
</svg>
|
|
2684
|
+
</div>
|
|
2685
|
+
</div>
|
|
2686
|
+
</div>
|
|
2687
|
+
</div>
|
|
2688
|
+
`}
|
|
2689
|
+
${this.isEligibleMembersPopupOpen?n`
|
|
2690
|
+
<div class="popup-overlay">
|
|
2691
|
+
<div class="members-list">
|
|
2692
|
+
<members-list
|
|
2693
|
+
.contactList=${this.eligibleMembers}
|
|
2694
|
+
.onClosePopup=${()=>this.isEligibleMembersPopupOpen=false}
|
|
2695
|
+
label="Eligible Members"
|
|
2696
|
+
width="100%"
|
|
2697
|
+
fontSize="16px"
|
|
2698
|
+
fontFamily="Arial, sans-serif"
|
|
2699
|
+
.hasMoreEligibleMembers=${this.hasMoreEligibleMembers}
|
|
2700
|
+
></members-list>
|
|
2701
|
+
</div>
|
|
2702
|
+
</div>
|
|
2703
|
+
`:""}
|
|
2704
|
+
|
|
2705
|
+
<div class="ctas">
|
|
2706
|
+
${this.showMediaList?null:n`
|
|
2707
|
+
<button @click="${()=>this.openConfirmationPopup("clear-chat")}">Clear Chat</button>
|
|
2708
|
+
${this.conversationMetaData.messagingDisabled&&this.isBlocked?n`<button style="color: red;" @click="${()=>this.openConfirmationPopup("unblock-contact")}">Unblock Chat</button>`:!this.conversationMetaData.messagingDisabled&&this.isBlocked===null?n`<button style="color: red;" @click="${()=>this.openConfirmationPopup("block-contact")}">Block Chat</button>`:this.isBlocked==="loading"?n`<div class="shimmer-loader">
|
|
2709
|
+
<div class="shimmer-line"></div>
|
|
2710
|
+
</div>`:null}
|
|
2711
|
+
<button style="color: red;" @click="${()=>this.openConfirmationPopup("delete-chat")}">Delete Chat</button>
|
|
2712
|
+
`}
|
|
2713
|
+
</div>
|
|
2714
|
+
</div>
|
|
2715
|
+
`}}customElements.define("profile-info",ht);const{state:pt,onChange:gt}=st({conversationTitle:"",conversationId:"",isGroup:false,conversationImageUrl:"",opponentDetails:{userName:"",userProfileImageUrl:""}});const ut={state:pt,updateTitle(t){pt.conversationTitle=t},updateConversationDetails(t){Object.assign(pt,t)},onChange:gt};
|
|
2716
|
+
/**
|
|
2717
|
+
* @license
|
|
2718
|
+
* Copyright 2020 Google LLC
|
|
2719
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
2720
|
+
*/const{I:mt}=h,bt=()=>document.createComment(""),ft=(t,e,i)=>{const o=t._$AA.parentNode,r=void 0===e?t._$AB:e._$AA;if(void 0===i){const e=o.insertBefore(bt(),r),s=o.insertBefore(bt(),r);i=new mt(e,s,t,t.options)}else{const e=i._$AB.nextSibling,s=i._$AM,n=s!==t;if(n){let e;i._$AQ?.(t),i._$AM=t,void 0!==i._$AP&&(e=t._$AU)!==s._$AU&&i._$AP(e)}if(e!==r||n){let t=i._$AA;for(;t!==e;){const e=t.nextSibling;o.insertBefore(t,r),t=e}}}return i},vt=(t,e,i=t)=>(t._$AI(e,i),t),xt={},yt=(t,e=xt)=>t._$AH=e,wt=t=>t._$AH,kt=t=>{t._$AP?.(!1,!0);let e=t._$AA;const i=t._$AB.nextSibling;for(;e!==i;){const t=e.nextSibling;e.remove(),e=t}};
|
|
2721
|
+
/**
|
|
2722
|
+
* @license
|
|
2723
|
+
* Copyright 2017 Google LLC
|
|
2724
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
2725
|
+
*/const $t=(t,e,i)=>{const o=new Map;for(let r=e;r<=i;r++)o.set(t[r],r);return o},Ct=p(class extends g{constructor(t){if(super(t),t.type!==u.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,i){let o;void 0===i?i=e:void 0!==e&&(o=e);const r=[],s=[];let n=0;for(const e of t)r[n]=o?o(e,n):n,s[n]=i(e,n),n++;return{values:s,keys:r}}render(t,e,i){return this.dt(t,e,i).values}update(t,[e,i,o]){const r=wt(t),{values:s,keys:n}=this.dt(e,i,o);if(!Array.isArray(r))return this.ut=n,s;const a=this.ut??=[],c=[];let l,d,h=0,p=r.length-1,g=0,u=s.length-1;for(;h<=p&&g<=u;)if(null===r[h])h++;else if(null===r[p])p--;else if(a[h]===n[g])c[g]=vt(r[h],s[g]),h++,g++;else if(a[p]===n[u])c[u]=vt(r[p],s[u]),p--,u--;else if(a[h]===n[u])c[u]=vt(r[h],s[u]),ft(t,c[u+1],r[h]),h++,u--;else if(a[p]===n[g])c[g]=vt(r[p],s[g]),ft(t,r[h],r[p]),p--,g++;else if(void 0===l&&(l=$t(n,g,u),d=$t(a,h,p)),l.has(a[h]))if(l.has(a[p])){const e=d.get(n[g]),i=void 0!==e?r[e]:null;if(null===i){const e=ft(t,r[h]);vt(e,s[g]),c[g]=e}else c[g]=vt(i,s[g]),ft(t,r[h],i),r[e]=null;g++}else kt(r[p]),p--;else kt(r[h]),h++;for(;g<=u;){const e=ft(t,c[u+1]);vt(e,s[g]),c[g++]=e}for(;h<=p;){const t=r[h++];null!==t&&kt(t)}return this.ut=n,yt(t,c),m}});class St extends s{static properties={value:{type:String},placeholder:{type:String},width:{type:String},height:{type:String},borderColor:{type:String},borderRadius:{type:String},backgroundColor:{type:String},fontSize:{type:String},padding:{type:String},color:{type:String},placeholderColor:{type:String},lineHeight:{type:String},borderWidth:{type:String},inputHeight:{type:String,reflect:true},minHeight:{type:String,reflect:true},maxHeight:{type:String,reflect:true},overflow:{type:String},isSearchSvg:{type:Boolean},disabled:{type:Boolean}};static styles=c`
|
|
2726
|
+
:host {
|
|
2727
|
+
display: block;
|
|
2728
|
+
}
|
|
2729
|
+
|
|
2730
|
+
.input-container {
|
|
2731
|
+
position: relative;
|
|
2732
|
+
width: 100%;
|
|
2733
|
+
}
|
|
2734
|
+
|
|
2735
|
+
textarea {
|
|
2736
|
+
width: var(--input-width, 100%);
|
|
2737
|
+
max-height: var(--input-max-height, 100px);
|
|
2738
|
+
min-height: var(--input-min-height, 45px);
|
|
2739
|
+
height: var(--input-height, 45px);
|
|
2740
|
+
border: var(--input-border-width, 1px) solid var(--input-border-color, gray);
|
|
2741
|
+
border-radius: var(--input-border-radius, 4px);
|
|
2742
|
+
background-color: var(--input-background-color, white);
|
|
2743
|
+
font-size: var(--input-font-size, 16px);
|
|
2744
|
+
padding: var(--input-padding, 12px);
|
|
2745
|
+
color: var(--input-text-color);
|
|
2746
|
+
box-sizing: border-box;
|
|
2747
|
+
resize: none;
|
|
2748
|
+
overflow-x: hidden;
|
|
2749
|
+
overflow-y: hidden;
|
|
2750
|
+
outline: none;
|
|
2751
|
+
border-width: none;
|
|
2752
|
+
font-family: var(--font-sans, inherit);
|
|
2753
|
+
transition: height 0.2s ease;
|
|
2754
|
+
line-height: var(--input-line-height, 1.45);
|
|
2755
|
+
vertical-align: middle;
|
|
2756
|
+
scrollbar-width: none;
|
|
2757
|
+
}
|
|
2758
|
+
|
|
2759
|
+
textarea.is-scrollable {
|
|
2760
|
+
overflow-y: auto;
|
|
2761
|
+
scrollbar-width: thin;
|
|
2762
|
+
}
|
|
2763
|
+
|
|
2764
|
+
:host([data-search]) textarea {
|
|
2765
|
+
padding-right: 40px;
|
|
2766
|
+
}
|
|
2767
|
+
|
|
2768
|
+
textarea::-webkit-scrollbar {
|
|
2769
|
+
width: 0;
|
|
2770
|
+
height: 0;
|
|
2771
|
+
}
|
|
2772
|
+
|
|
2773
|
+
textarea.is-scrollable::-webkit-scrollbar {
|
|
2774
|
+
width: 4px;
|
|
2775
|
+
}
|
|
2776
|
+
|
|
2777
|
+
textarea.is-scrollable::-webkit-scrollbar-track {
|
|
2778
|
+
background: transparent;
|
|
2779
|
+
}
|
|
2780
|
+
|
|
2781
|
+
textarea.is-scrollable::-webkit-scrollbar-thumb {
|
|
2782
|
+
background-color: var(--bg-grey-color, #e2e2e7);
|
|
2783
|
+
border-radius: 10px;
|
|
2784
|
+
}
|
|
2785
|
+
|
|
2786
|
+
textarea.is-scrollable::-webkit-scrollbar-thumb:hover {
|
|
2787
|
+
background-color: var(--text-secondary-color, #6b6a75);
|
|
2788
|
+
}
|
|
2789
|
+
textarea::placeholder {
|
|
2790
|
+
color: var(--input-placeholder-color, #aaa);
|
|
2791
|
+
font-family: inherit;
|
|
2792
|
+
}
|
|
2793
|
+
|
|
2794
|
+
.search-icon {
|
|
2795
|
+
position: absolute;
|
|
2796
|
+
right: 12px;
|
|
2797
|
+
top: 50%;
|
|
2798
|
+
transform: translateY(-50%);
|
|
2799
|
+
pointer-events: none;
|
|
2800
|
+
}
|
|
2801
|
+
`;constructor(){super();this.value="";this.placeholder="Enter your text here...";this.width="100%";this.minHeight="45px";this.maxHeight="105px";this.inputHeight="45px";this.borderColor="gray";this.borderRadius="0px";this.backgroundColor="white";this.fontSize="16px";this.padding="12px";this.lineHeight="";this.placeholderColor="#aaa";this.borderWidth="1px";this.isSearchSvg=true;this.disabled=false}get isFixedHeight(){return Boolean(this.minHeight&&this.maxHeight&&this.minHeight===this.maxHeight)}render(){if(this.isSearchSvg){this.setAttribute("data-search","")}else{this.removeAttribute("data-search")}return n`
|
|
2802
|
+
<div class="input-container">
|
|
2803
|
+
<textarea
|
|
2804
|
+
.value=${this.value}
|
|
2805
|
+
placeholder=${this.placeholder}
|
|
2806
|
+
?disabled=${this.disabled}
|
|
2807
|
+
style=${d({"--input-width":this.width,"--input-min-height":this.minHeight,"--input-max-height":this.maxHeight,"--input-height":this.inputHeight,"--input-border-color":this.borderColor,"--input-border-radius":this.borderRadius,"--input-background-color":this.backgroundColor,"--input-font-size":this.fontSize,"--input-padding":this.padding,"--input-line-height":this.lineHeight||undefined,"--input-text-color":this.color,"--input-placeholder-color":this.placeholderColor,"--input-border-width":this.borderWidth})}
|
|
2808
|
+
@input=${this.handleInputChange}
|
|
2809
|
+
></textarea>
|
|
2810
|
+
</div>
|
|
2811
|
+
`}handleInputChange(t){t.stopPropagation();this.value=t.target.value;if(!this.isFixedHeight){this.adjustTextareaHeight(t.target)}this.dispatchEvent(new CustomEvent("input",{detail:{value:this.value},bubbles:true,composed:true}))}adjustTextareaHeight(t){const e=parseInt(this.minHeight,10)||24;const i=parseInt(this.maxHeight,10)||120;t.style.height="auto";const o=t.scrollHeight;const r=Math.min(Math.max(o,e),i);this.inputHeight=`${r}px`;t.style.height=this.inputHeight;t.classList.toggle("is-scrollable",o>i)}resetHeight(){const t=this.shadowRoot.querySelector("textarea");if(t){const e=this.minHeight||"24px";this.inputHeight=e;t.style.height=e;t.classList.remove("is-scrollable")}}}customElements.define("my-input",St);class Mt extends s{static properties={searchedMessageDetails:{type:Array},onSearchResultClick:{type:Function},onSearchInput:{type:Function},isSearchOpen:{type:Boolean},isLoadingMessage:{type:Boolean},chatBodyRef:{type:HTMLBodyElement}};constructor(){super();this.isSearchOpen=true;this.searchValue="";this.debouncedSearchHandler=x((t=>{if(this.onSearchInput){this.onSearchInput(t)}}),500)}static styles=c`
|
|
2812
|
+
.searchMessageContainer{
|
|
2813
|
+
background-color:var(--bg-primary-color);
|
|
2814
|
+
height:100%;
|
|
2815
|
+
}
|
|
2816
|
+
.search-header {
|
|
2817
|
+
display: flex;
|
|
2818
|
+
justify-content: space-between;
|
|
2819
|
+
align-items: center;
|
|
2820
|
+
padding: 16px;
|
|
2821
|
+
font-size: 18px;
|
|
2822
|
+
}
|
|
2823
|
+
|
|
2824
|
+
.search-header h3 {
|
|
2825
|
+
margin: 0;
|
|
2826
|
+
color: var(--text-outgoing-message);
|
|
2827
|
+
}
|
|
2828
|
+
|
|
2829
|
+
.close-search {
|
|
2830
|
+
background: none;
|
|
2831
|
+
border: none;
|
|
2832
|
+
color: var(--text-outgoing-message);
|
|
2833
|
+
cursor: pointer;
|
|
2834
|
+
font-size: 20px;
|
|
2835
|
+
padding: 5px;
|
|
2836
|
+
}
|
|
2837
|
+
|
|
2838
|
+
.search-input-container {
|
|
2839
|
+
padding: 8px 16px;
|
|
2840
|
+
position: relative;
|
|
2841
|
+
display: flex;
|
|
2842
|
+
align-items: center;
|
|
2843
|
+
}
|
|
2844
|
+
|
|
2845
|
+
.search-input {
|
|
2846
|
+
background-color: var(--bg-secondary-color);
|
|
2847
|
+
border-radius: 20px;
|
|
2848
|
+
color: var(--text-outgoing-message);
|
|
2849
|
+
border: none;
|
|
2850
|
+
padding: 8px 36px 8px 16px;
|
|
2851
|
+
width: 100%;
|
|
2852
|
+
height: 40px;
|
|
2853
|
+
font-size: 16px;
|
|
2854
|
+
outline: none;
|
|
2855
|
+
}
|
|
2856
|
+
|
|
2857
|
+
.back-button {
|
|
2858
|
+
color: var(--text-outgoing-message);
|
|
2859
|
+
margin-right: 8px;
|
|
2860
|
+
cursor: pointer;
|
|
2861
|
+
}
|
|
2862
|
+
|
|
2863
|
+
.clear-button {
|
|
2864
|
+
position: absolute;
|
|
2865
|
+
right: 24px;
|
|
2866
|
+
background: none;
|
|
2867
|
+
border: none;
|
|
2868
|
+
color: var(--text-outgoing-message);
|
|
2869
|
+
cursor: pointer;
|
|
2870
|
+
}
|
|
2871
|
+
|
|
2872
|
+
.search-results {
|
|
2873
|
+
height: calc(100vh - 160px);
|
|
2874
|
+
overflow-y: auto;
|
|
2875
|
+
}
|
|
2876
|
+
|
|
2877
|
+
.search-results-container {
|
|
2878
|
+
display: flex;
|
|
2879
|
+
flex-direction: column;
|
|
2880
|
+
padding: 12px 16px;
|
|
2881
|
+
border-bottom: 1px solid var(--bg-secondary-color);
|
|
2882
|
+
cursor: pointer;
|
|
2883
|
+
}
|
|
2884
|
+
|
|
2885
|
+
.search-results-container span:first-child {
|
|
2886
|
+
color: var(--text-outgoing-message);
|
|
2887
|
+
margin-bottom: 4px;
|
|
2888
|
+
}
|
|
2889
|
+
|
|
2890
|
+
.search-results-container span:last-child {
|
|
2891
|
+
color: var(--text-secondary-color);
|
|
2892
|
+
font-size: 14px;
|
|
2893
|
+
}
|
|
2894
|
+
|
|
2895
|
+
.search-results-placeholder {
|
|
2896
|
+
display: flex;
|
|
2897
|
+
justify-content: center;
|
|
2898
|
+
align-items: center;
|
|
2899
|
+
height: calc(100vh - 160px);
|
|
2900
|
+
color: var(--text-secondary-color);
|
|
2901
|
+
}
|
|
2902
|
+
|
|
2903
|
+
.result-item-name {
|
|
2904
|
+
color: var(--bg-incoming-message);
|
|
2905
|
+
}
|
|
2906
|
+
|
|
2907
|
+
.check-icon {
|
|
2908
|
+
color: var(--bg-incoming-message);
|
|
2909
|
+
margin-right: 4px;
|
|
2910
|
+
}
|
|
2911
|
+
|
|
2912
|
+
.date-label {
|
|
2913
|
+
padding: 12px 0px;
|
|
2914
|
+
color: var(--text-secondary-color);
|
|
2915
|
+
font-size: 14px;
|
|
2916
|
+
}
|
|
2917
|
+
`;async handleSearchResultClick(t){if(this.chatBodyRef){await this.chatBodyRef.scrollToMessage(t)}if(this.onSearchResultClick){this.onSearchResultClick(t)}this.searchedMessageDetails=[];this.dispatchEvent(new CustomEvent("close-right-Sidebar",{detail:{type:"close-right-Sidebar"},bubbles:true,composed:true}))}handleCloseSearch(){this.searchedMessageDetails=[];this.dispatchEvent(new CustomEvent("close-right-Sidebar",{detail:{type:"close-right-Sidebar"},bubbles:true,composed:true}))}handleInputChange(t){const e=t.target.value.toLowerCase();this.searchValue=e;this.debouncedSearchHandler(e);this.requestUpdate()}formatDate(t){const e=new Date(t);return`${e.getMonth()+1}/${e.getDate()}/${e.getFullYear()}`}render(){return n`
|
|
2918
|
+
<div class="searchMessageContainer" @click=${t=>t.stopPropagation()}>
|
|
2919
|
+
<div class="search-header">
|
|
2920
|
+
<h3>Search messages</h3>
|
|
2921
|
+
<button class="close-search" @click=${()=>this.handleCloseSearch()}>
|
|
2922
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor">
|
|
2923
|
+
<path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z" />
|
|
2924
|
+
</svg>
|
|
2925
|
+
</button>
|
|
2926
|
+
</div>
|
|
2927
|
+
<div class="search-input-container">
|
|
2928
|
+
<input
|
|
2929
|
+
type="text"
|
|
2930
|
+
class="search-input"
|
|
2931
|
+
placeholder="Search"
|
|
2932
|
+
.value=${this.searchValue}
|
|
2933
|
+
@input=${t=>this.handleInputChange(t)}
|
|
2934
|
+
/>
|
|
2935
|
+
${this.searchValue?n`
|
|
2936
|
+
<button class="clear-button" @click=${()=>{this.searchValue="";this.searchedMessageDetails=[];this.requestUpdate()}}>
|
|
2937
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor">
|
|
2938
|
+
<path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z" />
|
|
2939
|
+
</svg>
|
|
2940
|
+
</button>
|
|
2941
|
+
`:""}
|
|
2942
|
+
</div>
|
|
2943
|
+
<div class="search-results">
|
|
2944
|
+
${this.isLoadingMessage?n`<div class="search-results-placeholder">
|
|
2945
|
+
<spinner-loader
|
|
2946
|
+
height="15px"
|
|
2947
|
+
width="15px"
|
|
2948
|
+
spinTime="1s"
|
|
2949
|
+
spinnerPrimaryColor="var(--bg-primary-color)"
|
|
2950
|
+
spinnerSecondaryColor="var(--text-primary-color)"
|
|
2951
|
+
spinnerBorderWidth="2px"
|
|
2952
|
+
></spinner-loader>
|
|
2953
|
+
</div>`:this.searchedMessageDetails.length===0?n`<div class="search-results-placeholder">${this.searchValue?k.PLACEHOLDER_CONTENT.SEARCH_CHAT.NO_RESULTS_FOUND:k.PLACEHOLDER_CONTENT.SEARCH_CHAT.SEARCH_FOR_MSG}</div>`:n`
|
|
2954
|
+
${Ct(this.searchedMessageDetails,(t=>t.messageId),(t=>n`
|
|
2955
|
+
<div class="search-results-container" @click=${()=>this.handleSearchResultClick(t.messageId)}>
|
|
2956
|
+
<span class='date-label' >${_(t.sentAt)}</span>
|
|
2957
|
+
<span>${t.body}</span>
|
|
2958
|
+
</div>
|
|
2959
|
+
`))}
|
|
2960
|
+
`}
|
|
2961
|
+
</div>
|
|
2962
|
+
</div>`}}customElements.define("message-search",Mt);export{G as P,R as a,D as b,O as c,F as d,T as e,st as f,P as g,H as h,A as i,at as j,ut as k,_ as l,U as n,N as o,L as p};
|
|
2963
|
+
//# sourceMappingURL=p-8dcdea59.js.map
|