isometrik-plugin-chat-sdk 2.0.21 → 2.0.22
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/dist/cjs/admin-transfer-dialog.cjs.entry.js +2 -2
- package/dist/cjs/{app-globals-2824b330.js → app-globals-0e7848be.js} +3 -3
- package/dist/cjs/{app-globals-2824b330.js.map → app-globals-0e7848be.js.map} +1 -1
- package/dist/cjs/{attachment-preview_22.cjs.entry.js → attachment-preview_23.cjs.entry.js} +692 -388
- package/dist/cjs/attachment-preview_23.cjs.entry.js.map +1 -0
- package/dist/cjs/audio-bubble_4.cjs.entry.js +66 -22
- package/dist/cjs/audio-bubble_4.cjs.entry.js.map +1 -1
- package/dist/cjs/chat-app.cjs.entry.js +1 -1
- package/dist/cjs/chat-document-message-bubble.cjs.entry.js +1 -1
- package/dist/cjs/chat-image-message-bubble.cjs.entry.js +1 -1
- package/dist/cjs/chat-tile_3.cjs.entry.js +14 -10
- package/dist/cjs/chat-tile_3.cjs.entry.js.map +1 -1
- package/dist/cjs/chat-video-message-bubble.cjs.entry.js +1 -1
- package/dist/cjs/confirm-dialog.cjs.entry.js +1 -1
- package/dist/cjs/{content-ebca062a.js → content-8b271b56.js} +3 -1
- package/dist/cjs/content-8b271b56.js.map +1 -0
- package/dist/cjs/delete-message.cjs.entry.js +1 -1
- package/dist/cjs/download-9ccc0a6c.js +120 -0
- package/dist/cjs/download-9ccc0a6c.js.map +1 -0
- package/dist/cjs/{drawer-00a2323a.js → drawer-3f9c87b4.js} +42 -5
- package/dist/cjs/drawer-3f9c87b4.js.map +1 -0
- package/dist/cjs/forward-memebers.cjs.entry.js +61 -24
- package/dist/cjs/forward-memebers.cjs.entry.js.map +1 -1
- package/dist/cjs/forward-message.cjs.entry.js +2 -2
- package/dist/cjs/group-chat-contacts.cjs.entry.js +2 -2
- package/dist/cjs/{group-members-b3bea06e.js → group-members-1205fc4c.js} +5 -5
- package/dist/cjs/{group-members-b3bea06e.js.map → group-members-1205fc4c.js.map} +1 -1
- package/dist/cjs/{groupcast-8441b4df.js → groupcast-bb393c81.js} +14 -54
- package/dist/cjs/groupcast-bb393c81.js.map +1 -0
- package/dist/cjs/{groupcast-f24da720.js → groupcast-e1e52bd1.js} +16 -16
- package/dist/cjs/{groupcast-f24da720.js.map → groupcast-e1e52bd1.js.map} +1 -1
- package/dist/cjs/{helpers-154861e9.js → helpers-877a7116.js} +30 -1
- package/dist/cjs/helpers-877a7116.js.map +1 -0
- package/dist/cjs/index.cjs.js +8 -6
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/{toast-91093c84.js → index.m-ff115b26.js} +1 -156
- package/dist/cjs/{toast-91093c84.js.map → index.m-ff115b26.js.map} +1 -1
- package/dist/cjs/info-panel-media_2.cjs.entry.js +244 -0
- package/dist/cjs/info-panel-media_2.cjs.entry.js.map +1 -0
- package/dist/cjs/isometrik-webchat.cjs.js +11 -9
- package/dist/cjs/isometrik-webchat.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +11 -9
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/{local-notification-bdd04d7a.js → local-notification-a86a2b34.js} +3 -3
- package/dist/cjs/local-notification-a86a2b34.js.map +1 -0
- package/dist/cjs/login-page_3.cjs.entry.js +258 -104
- package/dist/cjs/login-page_3.cjs.entry.js.map +1 -1
- package/dist/cjs/media-gallery.cjs.entry.js +10 -2
- package/dist/cjs/media-gallery.cjs.entry.js.map +1 -1
- package/dist/cjs/member-add.cjs.entry.js +20 -11
- package/dist/cjs/member-add.cjs.entry.js.map +1 -1
- package/dist/cjs/message-bubble.cjs.entry.js +2 -2
- package/dist/cjs/{message-reaction-82a4f93c.js → message-reaction-8f93a048.js} +5 -5
- package/dist/cjs/{message-reaction-82a4f93c.js.map → message-reaction-8f93a048.js.map} +1 -1
- package/dist/cjs/messages-e129b34d.js +179 -0
- package/dist/cjs/messages-e129b34d.js.map +1 -0
- package/dist/cjs/my-component.cjs.entry.js +1 -1
- package/dist/cjs/new-chat-sidebar.cjs.entry.js +2 -2
- package/dist/cjs/play-b473e0ab.js +13 -0
- package/dist/cjs/play-b473e0ab.js.map +1 -0
- package/dist/cjs/profile-avatar.cjs.entry.js +1 -1
- package/dist/cjs/reaction-container.cjs.entry.js +5 -4
- package/dist/cjs/reaction-container.cjs.entry.js.map +1 -1
- package/dist/cjs/{runtime-controls-cfc8fc31.js → runtime-controls-a70872fe.js} +33 -15
- package/dist/cjs/runtime-controls-a70872fe.js.map +1 -0
- package/dist/cjs/{send-media-4ee967d4.js → send-media-8a841e50.js} +559 -192
- package/dist/cjs/send-media-8a841e50.js.map +1 -0
- package/dist/cjs/share-popup.cjs.entry.js +1 -1
- package/dist/cjs/signup-page.cjs.entry.js +2 -2
- package/dist/cjs/spinner-loader.cjs.entry.js +1 -1
- package/dist/cjs/{group-members-cef1198e.js → storage-quota-2e81fb71.js} +254 -10
- package/dist/cjs/storage-quota-2e81fb71.js.map +1 -0
- package/dist/cjs/toast-a75f822c.js +159 -0
- package/dist/cjs/toast-a75f822c.js.map +1 -0
- package/dist/collection/collection-manifest.json +10 -8
- package/dist/collection/components/ChatUIComponent/AddMember.js +14 -7
- package/dist/collection/components/ChatUIComponent/AddMember.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/ChatDocumentMessageBubble.js +1 -1
- package/dist/collection/components/ChatUIComponent/ChatImageMessageBubble.js +1 -1
- package/dist/collection/components/ChatUIComponent/ChatOwnProfile/Profile.js +8 -2
- package/dist/collection/components/ChatUIComponent/ChatOwnProfile/Profile.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js +90 -47
- package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/ChatVideoMessageBubble.js +1 -1
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js +105 -37
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/Header/WebChatHeader.js +45 -11
- package/dist/collection/components/ChatUIComponent/Header/WebChatHeader.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/ReactionContainer.js +2 -2
- package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js +38 -13
- package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/WebChatBody/web-chat-body.css +1 -0
- package/dist/collection/components/ChatUIComponent/shared/AudioBubble/AudioBubble.js +22 -10
- package/dist/collection/components/ChatUIComponent/shared/AudioBubble/AudioBubble.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/ForwardMessageList/ForwardMessageList.js +55 -19
- package/dist/collection/components/ChatUIComponent/shared/ForwardMessageList/ForwardMessageList.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/admin-transfer-dialog/admin-transfer-dialog.js +2 -2
- package/dist/collection/components/ChatUIComponent/shared/attachment-preview/attachment-preview.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/block chatlist/BlockChatList.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/chat-loading-placeholder/chat-loading-placeholder.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/chat-tile/chat-tile.js +31 -9
- package/dist/collection/components/ChatUIComponent/shared/chat-tile/chat-tile.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/confirm-dialog/confirm-dialog.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js +66 -157
- package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/delete-message/delete-message.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/document-message/document-message.js +14 -4
- package/dist/collection/components/ChatUIComponent/shared/document-message/document-message.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/forward-message/forward-message.js +2 -2
- package/dist/collection/components/ChatUIComponent/shared/group-info/group-info.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/image-message/image-message.js +65 -2
- package/dist/collection/components/ChatUIComponent/shared/image-message/image-message.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/incoming-text-message-bubble/incoming-text-message-bubble.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/info-panel-media/info-panel-media.js +335 -0
- package/dist/collection/components/ChatUIComponent/shared/info-panel-media/info-panel-media.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/shared/link-preview/link-preview.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/media-gallery/media-gallery.js +11 -2
- package/dist/collection/components/ChatUIComponent/shared/media-gallery/media-gallery.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/message-bubble/message-bubble.js +2 -2
- package/dist/collection/components/ChatUIComponent/shared/message-date-pill/message-date-pill.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/message-info/message-info.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/message-search/message-search.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/new chat/new-chat.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/outgoing-text-message-bubble/outgoing-text-message-bubble.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/profile sidebar/profile-sidebar.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/profile-avatar/profile-avatar.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/profile-info/profile-info.js +70 -3
- package/dist/collection/components/ChatUIComponent/shared/profile-info/profile-info.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/reply-block/reply-block.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/reply-message-container/reply-message-container.js +31 -2
- package/dist/collection/components/ChatUIComponent/shared/reply-message-container/reply-message-container.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/reply-message-container/reply-message-container.stories.js +10 -6
- package/dist/collection/components/ChatUIComponent/shared/searchable list/searchable-list.js +3 -3
- package/dist/collection/components/ChatUIComponent/shared/share-popup/share-popup.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/spinner-loader/spinner-loader.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/storage/storage-manager.js +140 -0
- package/dist/collection/components/ChatUIComponent/shared/storage/storage-manager.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/shared/video-message/video-message.js +35 -3
- package/dist/collection/components/ChatUIComponent/shared/video-message/video-message.js.map +1 -1
- package/dist/collection/components/Login.js +1 -1
- package/dist/collection/components/Signup.js +2 -2
- package/dist/collection/components/chat-main.js +1 -1
- package/dist/collection/components/my-component/my-component.js +1 -1
- package/dist/collection/components/my-component/web-chat/WebChat.js +145 -1
- package/dist/collection/components/my-component/web-chat/WebChat.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/WebchatRightSide.js +44 -2
- package/dist/collection/components/my-component/web-chat/WebchatRightSide.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/bootstrap.js +1 -0
- package/dist/collection/components/my-component/web-chat/bootstrap.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/conversation-ops.js +22 -2
- package/dist/collection/components/my-component/web-chat/conversation-ops.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/data-fetch.js +9 -4
- package/dist/collection/components/my-component/web-chat/data-fetch.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/event-handlers.js +51 -10
- package/dist/collection/components/my-component/web-chat/event-handlers.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/mutations.js +38 -8
- package/dist/collection/components/my-component/web-chat/mutations.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/offline-host.js +31 -17
- package/dist/collection/components/my-component/web-chat/offline-host.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/public-send.js +6 -1
- package/dist/collection/components/my-component/web-chat/public-send.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/shell-render.js +11 -9
- package/dist/collection/components/my-component/web-chat/shell-render.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/web-chat.css +40 -3
- package/dist/collection/components/theme-provider.js +1 -1
- package/dist/collection/constants/content.js +2 -0
- package/dist/collection/lib/chat/block-status.js +12 -0
- package/dist/collection/lib/chat/block-status.js.map +1 -0
- package/dist/collection/lib/chat/clipboard-paste.js +68 -0
- package/dist/collection/lib/chat/clipboard-paste.js.map +1 -0
- package/dist/collection/lib/chat/conversations.js +47 -3
- package/dist/collection/lib/chat/conversations.js.map +1 -1
- package/dist/collection/lib/chat/download-media.js +112 -0
- package/dist/collection/lib/chat/download-media.js.map +1 -0
- package/dist/collection/lib/chat/index.js +6 -2
- package/dist/collection/lib/chat/index.js.map +1 -1
- package/dist/collection/lib/chat/local-notification.js +1 -1
- package/dist/collection/lib/chat/local-notification.js.map +1 -1
- package/dist/collection/lib/chat/same-name-upload.js +53 -0
- package/dist/collection/lib/chat/same-name-upload.js.map +1 -0
- package/dist/collection/lib/chat/send-media.js +194 -27
- package/dist/collection/lib/chat/send-media.js.map +1 -1
- package/dist/collection/lib/chat/session.js +9 -3
- package/dist/collection/lib/chat/session.js.map +1 -1
- package/dist/collection/lib/chat/storage-quota.js +226 -0
- package/dist/collection/lib/chat/storage-quota.js.map +1 -0
- package/dist/collection/lib/custom-ui/public-api.js +5 -0
- package/dist/collection/lib/custom-ui/public-api.js.map +1 -1
- package/dist/collection/lib/drawer.js +42 -4
- package/dist/collection/lib/drawer.js.map +1 -1
- package/dist/collection/lib/helpers.js +29 -1
- package/dist/collection/lib/mqtt/dispatch.js +7 -3
- package/dist/collection/lib/mqtt/dispatch.js.map +1 -1
- package/dist/collection/sdk/headless-api.js +8 -0
- package/dist/collection/sdk/headless-api.js.map +1 -1
- package/dist/collection/sdk/index.js +1 -0
- package/dist/collection/sdk/index.js.map +1 -1
- package/dist/collection/sdk/webchat-api.js +5 -0
- package/dist/collection/sdk/webchat-api.js.map +1 -1
- package/dist/collection/store/storage-quota.js +244 -0
- package/dist/collection/store/storage-quota.js.map +1 -0
- package/dist/collection/testing/iso-chat-sdk-mock.js +10 -6
- package/dist/components/AudioBubble.js +22 -10
- package/dist/components/AudioBubble.js.map +1 -1
- package/dist/components/BlockChatList.js +2 -2
- package/dist/components/ChatFooter.js +172 -37
- package/dist/components/ChatFooter.js.map +1 -1
- package/dist/components/ChatSidebar.js +102 -49
- package/dist/components/ChatSidebar.js.map +1 -1
- package/dist/components/GroupCast2.js +1 -1
- package/dist/components/Login.js +1 -1
- package/dist/components/Profile.js +20 -9
- package/dist/components/Profile.js.map +1 -1
- package/dist/components/WebChat.js +301 -126
- package/dist/components/WebChat.js.map +1 -1
- package/dist/components/WebChatBody.js +39 -14
- package/dist/components/WebChatBody.js.map +1 -1
- package/dist/components/WebChatHeader.js +48 -15
- package/dist/components/WebChatHeader.js.map +1 -1
- package/dist/components/WebchatRightSide.js +22 -7
- package/dist/components/WebchatRightSide.js.map +1 -1
- package/dist/components/admin-transfer-dialog.js +2 -2
- package/dist/components/attachment-preview2.js +1 -1
- package/dist/components/chat-app.js +85 -73
- package/dist/components/chat-app.js.map +1 -1
- package/dist/components/chat-assets.js +1 -1
- package/dist/components/chat-document-message-bubble.js +1 -1
- package/dist/components/chat-image-message-bubble.js +1 -1
- package/dist/components/chat-loading-placeholder2.js +1 -1
- package/dist/components/chat-tile2.js +12 -7
- package/dist/components/chat-tile2.js.map +1 -1
- package/dist/components/chat-video-message-bubble.js +1 -1
- package/dist/components/client.js +11 -47
- package/dist/components/client.js.map +1 -1
- package/dist/components/confirm-dialog.js +1 -1
- package/dist/components/contact-info2.js +73 -162
- package/dist/components/contact-info2.js.map +1 -1
- package/dist/components/content.js +2 -0
- package/dist/components/content.js.map +1 -1
- package/dist/components/conversation.js +1 -1
- package/dist/components/conversations.js +91 -0
- package/dist/components/conversations.js.map +1 -0
- package/dist/components/delete-message.js +1 -1
- package/dist/components/document-message2.js +15 -6
- package/dist/components/document-message2.js.map +1 -1
- package/dist/components/download-media.js +115 -0
- package/dist/components/download-media.js.map +1 -0
- package/dist/components/download.js +5 -0
- package/dist/components/download.js.map +1 -0
- package/dist/components/drawer.js +42 -5
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/forward-memebers.js +56 -20
- package/dist/components/forward-memebers.js.map +1 -1
- package/dist/components/forward-message.js +2 -2
- package/dist/components/group-chat-contacts2.js +1 -1
- package/dist/components/group-info.js +1 -1
- package/dist/components/group-members.js +26 -298
- package/dist/components/group-members.js.map +1 -1
- package/dist/components/helpers.js +28 -1
- package/dist/components/helpers.js.map +1 -1
- package/dist/components/image-message2.js +17 -2
- package/dist/components/image-message2.js.map +1 -1
- package/dist/components/incoming-text-message-bubble2.js +1 -1
- package/dist/components/index.js +21 -2
- package/dist/components/index.js.map +1 -1
- package/dist/{esm/group-members-7909941c.js → components/index3.js} +3 -52
- package/dist/components/index3.js.map +1 -0
- package/dist/components/info-panel-media.d.ts +11 -0
- package/dist/components/info-panel-media.js +8 -0
- package/dist/components/info-panel-media.js.map +1 -0
- package/dist/components/info-panel-media2.js +242 -0
- package/dist/components/info-panel-media2.js.map +1 -0
- package/dist/components/link-preview2.js +1 -1
- package/dist/components/local-notification.js +1 -1
- package/dist/components/local-notification.js.map +1 -1
- package/dist/components/media-gallery.js +11 -2
- package/dist/components/media-gallery.js.map +1 -1
- package/dist/components/member-add.js +16 -9
- package/dist/components/member-add.js.map +1 -1
- package/dist/components/message-bubble2.js +2 -2
- package/dist/components/message-date-pill2.js +1 -1
- package/dist/components/message-info2.js +2 -2
- package/dist/components/message-search2.js +1 -1
- package/dist/components/messages.js +1 -1
- package/dist/components/my-component.js +1 -1
- package/dist/components/new-chat-sidebar.js +1 -1
- package/dist/components/new-chat2.js +1 -1
- package/dist/components/outgoing-text-message-bubble2.js +1 -1
- package/dist/components/profile-avatar2.js +1 -1
- package/dist/components/profile-info2.js +69 -6
- package/dist/components/profile-info2.js.map +1 -1
- package/dist/components/profile-sidebar2.js +2 -2
- package/dist/components/prompt-exit-group.js +26 -3
- package/dist/components/prompt-exit-group.js.map +1 -1
- package/dist/components/reaction-container.js +2 -2
- package/dist/components/reply-block2.js +1 -1
- package/dist/components/reply-message-container2.js +12 -2
- package/dist/components/reply-message-container2.js.map +1 -1
- package/dist/components/searchable-list2.js +3 -3
- package/dist/components/send-media.js +242 -33
- package/dist/components/send-media.js.map +1 -1
- package/dist/components/share-popup.js +1 -1
- package/dist/components/signup-page.js +2 -2
- package/dist/components/spinner-loader2.js +1 -1
- package/dist/components/storage-manager.js +125 -0
- package/dist/components/storage-manager.js.map +1 -0
- package/dist/components/storage-quota.js +223 -0
- package/dist/components/storage-quota.js.map +1 -0
- package/dist/components/storage-quota2.js +248 -0
- package/dist/components/storage-quota2.js.map +1 -0
- package/dist/components/theme-provider2.js +1 -1
- package/dist/components/video-message2.js +19 -3
- package/dist/components/video-message2.js.map +1 -1
- package/dist/components/web-chat-storage.d.ts +11 -0
- package/dist/components/web-chat-storage.js +8 -0
- package/dist/components/web-chat-storage.js.map +1 -0
- package/dist/esm/admin-transfer-dialog.entry.js +2 -2
- package/dist/esm/{app-globals-e3f4717b.js → app-globals-eba1ca0c.js} +3 -3
- package/dist/esm/{app-globals-e3f4717b.js.map → app-globals-eba1ca0c.js.map} +1 -1
- package/dist/esm/{attachment-preview_22.entry.js → attachment-preview_23.entry.js} +657 -354
- package/dist/esm/attachment-preview_23.entry.js.map +1 -0
- package/dist/esm/audio-bubble_4.entry.js +66 -22
- package/dist/esm/audio-bubble_4.entry.js.map +1 -1
- package/dist/esm/chat-app.entry.js +1 -1
- package/dist/esm/chat-document-message-bubble.entry.js +1 -1
- package/dist/esm/chat-image-message-bubble.entry.js +1 -1
- package/dist/esm/chat-tile_3.entry.js +15 -11
- package/dist/esm/chat-tile_3.entry.js.map +1 -1
- package/dist/esm/chat-video-message-bubble.entry.js +1 -1
- package/dist/esm/confirm-dialog.entry.js +1 -1
- package/dist/esm/{content-fb138a93.js → content-fd0af283.js} +3 -1
- package/dist/esm/content-fd0af283.js.map +1 -0
- package/dist/esm/delete-message.entry.js +1 -1
- package/dist/esm/download-5368a10f.js +117 -0
- package/dist/esm/download-5368a10f.js.map +1 -0
- package/dist/esm/{drawer-7de04622.js → drawer-a457d820.js} +43 -6
- package/dist/esm/drawer-a457d820.js.map +1 -0
- package/dist/esm/forward-memebers.entry.js +59 -22
- package/dist/esm/forward-memebers.entry.js.map +1 -1
- package/dist/esm/forward-message.entry.js +2 -2
- package/dist/esm/group-chat-contacts.entry.js +2 -2
- package/dist/esm/{group-members-36cf9395.js → group-members-d603f29f.js} +2 -2
- package/dist/esm/{group-members-36cf9395.js.map → group-members-d603f29f.js.map} +1 -1
- package/dist/esm/{groupcast-5fb19ec3.js → groupcast-4f15b050.js} +14 -50
- package/dist/esm/groupcast-4f15b050.js.map +1 -0
- package/dist/esm/{groupcast-f96c1d9e.js → groupcast-c6da3918.js} +2 -2
- package/dist/esm/{groupcast-f96c1d9e.js.map → groupcast-c6da3918.js.map} +1 -1
- package/dist/esm/{helpers-f33b895c.js → helpers-1632a4c7.js} +29 -2
- package/dist/esm/helpers-1632a4c7.js.map +1 -0
- package/dist/esm/index.js +9 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/{toast-a1531088.js → index.m-8c70037f.js} +2 -156
- package/dist/esm/{toast-a1531088.js.map → index.m-8c70037f.js.map} +1 -1
- package/dist/esm/info-panel-media_2.entry.js +239 -0
- package/dist/esm/info-panel-media_2.entry.js.map +1 -0
- package/dist/esm/isometrik-webchat.js +11 -9
- package/dist/esm/isometrik-webchat.js.map +1 -1
- package/dist/esm/loader.js +11 -9
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/{local-notification-4c1e166d.js → local-notification-f9ae9062.js} +3 -3
- package/dist/esm/local-notification-f9ae9062.js.map +1 -0
- package/dist/esm/login-page_3.entry.js +219 -65
- package/dist/esm/login-page_3.entry.js.map +1 -1
- package/dist/esm/media-gallery.entry.js +10 -2
- package/dist/esm/media-gallery.entry.js.map +1 -1
- package/dist/esm/member-add.entry.js +20 -11
- package/dist/esm/member-add.entry.js.map +1 -1
- package/dist/esm/message-bubble.entry.js +2 -2
- package/dist/esm/{message-reaction-0d2ef75f.js → message-reaction-0a2bb115.js} +2 -2
- package/dist/esm/{message-reaction-0d2ef75f.js.map → message-reaction-0a2bb115.js.map} +1 -1
- package/dist/esm/messages-057dbecb.js +167 -0
- package/dist/esm/messages-057dbecb.js.map +1 -0
- package/dist/esm/my-component.entry.js +1 -1
- package/dist/esm/new-chat-sidebar.entry.js +2 -2
- package/dist/esm/play-05ae077a.js +9 -0
- package/dist/esm/play-05ae077a.js.map +1 -0
- package/dist/esm/profile-avatar.entry.js +1 -1
- package/dist/esm/reaction-container.entry.js +5 -4
- package/dist/esm/reaction-container.entry.js.map +1 -1
- package/dist/esm/{runtime-controls-ff81e90a.js → runtime-controls-bdb84aeb.js} +21 -3
- package/dist/esm/runtime-controls-bdb84aeb.js.map +1 -0
- package/dist/esm/{send-media-58e7145b.js → send-media-04f7ca0a.js} +533 -180
- package/dist/esm/send-media-04f7ca0a.js.map +1 -0
- package/dist/esm/share-popup.entry.js +1 -1
- package/dist/esm/signup-page.entry.js +2 -2
- package/dist/esm/spinner-loader.entry.js +1 -1
- package/dist/esm/storage-quota-6329fabe.js +578 -0
- package/dist/esm/storage-quota-6329fabe.js.map +1 -0
- package/dist/esm/toast-f681e916.js +157 -0
- package/dist/esm/toast-f681e916.js.map +1 -0
- package/dist/isometrik-webchat/index.esm.js +1 -1
- package/dist/isometrik-webchat/index.esm.js.map +1 -1
- package/dist/isometrik-webchat/isometrik-webchat.esm.js +1 -1
- package/dist/isometrik-webchat/isometrik-webchat.esm.js.map +1 -1
- package/dist/isometrik-webchat/p-0161f40b.js +2 -0
- package/dist/isometrik-webchat/p-0161f40b.js.map +1 -0
- package/dist/isometrik-webchat/{p-d892b4d4.entry.js → p-02db2116.entry.js} +2 -2
- package/dist/isometrik-webchat/p-03933431.entry.js +2 -0
- package/dist/isometrik-webchat/{p-352b589e.entry.js.map → p-03933431.entry.js.map} +1 -1
- package/dist/isometrik-webchat/{p-c591fa45.js → p-04fdbd0a.js} +2 -2
- package/dist/isometrik-webchat/p-0bb42151.entry.js +2 -0
- package/dist/isometrik-webchat/p-0bb42151.entry.js.map +1 -0
- package/dist/isometrik-webchat/{p-c5bff6a1.entry.js → p-119fc683.entry.js} +2 -2
- package/dist/isometrik-webchat/p-19d37e1f.js +2 -0
- package/dist/isometrik-webchat/p-19d37e1f.js.map +1 -0
- package/dist/isometrik-webchat/{p-925decda.js → p-1dc52239.js} +2 -2
- package/dist/isometrik-webchat/p-1f0e8230.entry.js +2 -0
- package/dist/isometrik-webchat/p-1f0e8230.entry.js.map +1 -0
- package/dist/isometrik-webchat/{p-7b25f234.entry.js → p-35f2b9ae.entry.js} +2 -2
- package/dist/isometrik-webchat/p-3a0409fc.js +2 -0
- package/dist/isometrik-webchat/p-3a0409fc.js.map +1 -0
- package/dist/isometrik-webchat/{p-9982fa21.js → p-3dca1e56.js} +2 -2
- package/dist/isometrik-webchat/p-3dca1e56.js.map +1 -0
- package/dist/isometrik-webchat/p-40217f22.js +2 -0
- package/dist/isometrik-webchat/p-40217f22.js.map +1 -0
- package/dist/isometrik-webchat/{p-3b3dc33e.js → p-46be73c5.js} +2 -2
- package/dist/isometrik-webchat/p-56521ea4.entry.js +2 -0
- package/dist/isometrik-webchat/{p-f7d05551.entry.js → p-57f97cef.entry.js} +2 -2
- package/dist/isometrik-webchat/p-5f7eebbf.entry.js +2 -0
- package/dist/isometrik-webchat/p-605cb14e.entry.js +2 -0
- package/dist/isometrik-webchat/p-605cb14e.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-640e2c03.entry.js +2 -0
- package/dist/isometrik-webchat/p-69d953cb.entry.js +2 -0
- package/dist/isometrik-webchat/p-69d953cb.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-6c5eb178.js +2 -0
- package/dist/isometrik-webchat/{p-d8b65cf4.entry.js → p-6eadaa6c.entry.js} +2 -2
- package/dist/isometrik-webchat/{p-161fcb35.entry.js → p-7130f547.entry.js} +2 -2
- package/dist/isometrik-webchat/p-782d1bd2.js +2 -0
- package/dist/isometrik-webchat/p-782d1bd2.js.map +1 -0
- package/dist/isometrik-webchat/p-8142a54d.js +2 -0
- package/dist/isometrik-webchat/p-8142a54d.js.map +1 -0
- package/dist/isometrik-webchat/{p-cbb1179b.entry.js → p-89a8fc58.entry.js} +2 -2
- package/dist/isometrik-webchat/p-8f17345f.js +7 -0
- package/dist/isometrik-webchat/p-8f17345f.js.map +1 -0
- package/dist/isometrik-webchat/p-991d5437.js +2 -0
- package/dist/isometrik-webchat/p-991d5437.js.map +1 -0
- package/dist/isometrik-webchat/p-9b70e93f.entry.js +2 -0
- package/dist/isometrik-webchat/p-a5faa465.entry.js +2 -0
- package/dist/isometrik-webchat/p-a5faa465.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-a83932d4.js +2 -0
- package/dist/isometrik-webchat/p-a83932d4.js.map +1 -0
- package/dist/isometrik-webchat/p-b0f6f9ab.entry.js +2 -0
- package/dist/isometrik-webchat/p-b0f6f9ab.entry.js.map +1 -0
- package/dist/isometrik-webchat/{p-3664e0ad.entry.js → p-b431d864.entry.js} +2 -2
- package/dist/isometrik-webchat/{p-0ccfbe90.entry.js → p-b516938b.entry.js} +2 -2
- package/dist/isometrik-webchat/p-be09cdc8.js +2 -0
- package/dist/isometrik-webchat/p-be09cdc8.js.map +1 -0
- package/dist/isometrik-webchat/{p-5b965e04.js → p-c4b7babb.js} +2 -2
- package/dist/isometrik-webchat/{p-5b965e04.js.map → p-c4b7babb.js.map} +1 -1
- package/dist/isometrik-webchat/p-d0f6679d.entry.js +2 -0
- package/dist/isometrik-webchat/p-d0f6679d.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-d44c612a.entry.js +2 -0
- package/dist/isometrik-webchat/p-dc963574.entry.js +2 -0
- package/dist/isometrik-webchat/{p-5d1877d1.entry.js.map → p-dc963574.entry.js.map} +1 -1
- package/dist/isometrik-webchat/p-eb1f3118.entry.js +2 -0
- package/dist/isometrik-webchat/p-f18fa23d.js +2 -0
- package/dist/isometrik-webchat/p-f18fa23d.js.map +1 -0
- package/dist/isometrik-webchat/{p-08ba6153.entry.js → p-f5502a63.entry.js} +2 -2
- package/dist/types/components/ChatUIComponent/ChatOwnProfile/Profile.d.ts +2 -0
- package/dist/types/components/ChatUIComponent/ChatSidebar/ChatSidebar.d.ts +10 -0
- package/dist/types/components/ChatUIComponent/Footer/ChatFooter.d.ts +3 -0
- package/dist/types/components/ChatUIComponent/Header/WebChatHeader.d.ts +3 -0
- package/dist/types/components/ChatUIComponent/WebChatBody/WebChatBody.d.ts +5 -0
- package/dist/types/components/ChatUIComponent/shared/ForwardMessageList/ForwardMessageList.d.ts +5 -2
- package/dist/types/components/ChatUIComponent/shared/chat-tile/chat-tile.d.ts +4 -1
- package/dist/types/components/ChatUIComponent/shared/contact-info/contact-info.d.ts +8 -22
- package/dist/types/components/ChatUIComponent/shared/image-message/image-message.d.ts +5 -0
- package/dist/types/components/ChatUIComponent/shared/info-panel-media/info-panel-media.d.ts +45 -0
- package/dist/types/components/ChatUIComponent/shared/media-gallery/media-gallery.d.ts +1 -0
- package/dist/types/components/ChatUIComponent/shared/profile-info/profile-info.d.ts +8 -0
- package/dist/types/components/ChatUIComponent/shared/reply-message-container/reply-message-container.d.ts +3 -0
- package/dist/types/components/ChatUIComponent/shared/storage/storage-manager.d.ts +17 -0
- package/dist/types/components/ChatUIComponent/shared/video-message/video-message.d.ts +3 -0
- package/dist/types/components/my-component/web-chat/WebChat.d.ts +22 -0
- package/dist/types/components/my-component/web-chat/WebchatRightSide.d.ts +7 -0
- package/dist/types/components/my-component/web-chat/conversation-ops.d.ts +10 -2
- package/dist/types/components/my-component/web-chat/event-handlers.d.ts +5 -0
- package/dist/types/components/my-component/web-chat/mutations.d.ts +2 -2
- package/dist/types/components.d.ts +133 -2
- package/dist/types/lib/chat/block-status.d.ts +11 -0
- package/dist/types/lib/chat/clipboard-paste.d.ts +16 -0
- package/dist/types/lib/chat/download-media.d.ts +11 -0
- package/dist/types/lib/chat/index.d.ts +6 -2
- package/dist/types/lib/chat/same-name-upload.d.ts +24 -0
- package/dist/types/lib/chat/send-media.d.ts +90 -0
- package/dist/types/lib/chat/storage-quota.d.ts +98 -0
- package/dist/types/lib/custom-ui/public-api.d.ts +1 -1
- package/dist/types/lib/drawer.d.ts +1 -0
- package/dist/types/sdk/headless-api.d.ts +7 -0
- package/dist/types/sdk/index.d.ts +1 -0
- package/dist/types/sdk/webchat-api.d.ts +14 -0
- package/dist/types/store/storage-quota.d.ts +64 -0
- package/docs/MEDIA_STORAGE_QUOTA.md +130 -0
- package/package.json +3 -2
- package/dist/cjs/attachment-preview_22.cjs.entry.js.map +0 -1
- package/dist/cjs/content-ebca062a.js.map +0 -1
- package/dist/cjs/drawer-00a2323a.js.map +0 -1
- package/dist/cjs/group-members-cef1198e.js.map +0 -1
- package/dist/cjs/groupcast-8441b4df.js.map +0 -1
- package/dist/cjs/helpers-154861e9.js.map +0 -1
- package/dist/cjs/link-preview.cjs.entry.js +0 -49
- package/dist/cjs/link-preview.cjs.entry.js.map +0 -1
- package/dist/cjs/local-notification-bdd04d7a.js.map +0 -1
- package/dist/cjs/runtime-controls-cfc8fc31.js.map +0 -1
- package/dist/cjs/send-media-4ee967d4.js.map +0 -1
- package/dist/components/group-members2.js +0 -37
- package/dist/components/group-members2.js.map +0 -1
- package/dist/esm/attachment-preview_22.entry.js.map +0 -1
- package/dist/esm/content-fb138a93.js.map +0 -1
- package/dist/esm/drawer-7de04622.js.map +0 -1
- package/dist/esm/group-members-7909941c.js.map +0 -1
- package/dist/esm/groupcast-5fb19ec3.js.map +0 -1
- package/dist/esm/helpers-f33b895c.js.map +0 -1
- package/dist/esm/link-preview.entry.js +0 -45
- package/dist/esm/link-preview.entry.js.map +0 -1
- package/dist/esm/local-notification-4c1e166d.js.map +0 -1
- package/dist/esm/runtime-controls-ff81e90a.js.map +0 -1
- package/dist/esm/send-media-58e7145b.js.map +0 -1
- package/dist/isometrik-webchat/p-09980c53.entry.js +0 -2
- package/dist/isometrik-webchat/p-09980c53.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-1eecc7c5.entry.js +0 -2
- package/dist/isometrik-webchat/p-1eecc7c5.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-2cf296e6.entry.js +0 -2
- package/dist/isometrik-webchat/p-2e9974e1.entry.js +0 -2
- package/dist/isometrik-webchat/p-343f50b4.js +0 -7
- package/dist/isometrik-webchat/p-343f50b4.js.map +0 -1
- package/dist/isometrik-webchat/p-352b589e.entry.js +0 -2
- package/dist/isometrik-webchat/p-44da28d3.entry.js +0 -2
- package/dist/isometrik-webchat/p-44da28d3.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-48ce4dca.entry.js +0 -2
- package/dist/isometrik-webchat/p-52a575c0.entry.js +0 -2
- package/dist/isometrik-webchat/p-52a575c0.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-5cfb953d.js +0 -2
- package/dist/isometrik-webchat/p-5cfb953d.js.map +0 -1
- package/dist/isometrik-webchat/p-5d1877d1.entry.js +0 -2
- package/dist/isometrik-webchat/p-6f5037b2.js +0 -2
- package/dist/isometrik-webchat/p-6f5037b2.js.map +0 -1
- package/dist/isometrik-webchat/p-78fb47c4.js +0 -2
- package/dist/isometrik-webchat/p-78fb47c4.js.map +0 -1
- package/dist/isometrik-webchat/p-9982fa21.js.map +0 -1
- package/dist/isometrik-webchat/p-a9efcf1c.entry.js +0 -2
- package/dist/isometrik-webchat/p-a9efcf1c.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-ad02a8ca.entry.js +0 -2
- package/dist/isometrik-webchat/p-b0baa9ad.entry.js +0 -2
- package/dist/isometrik-webchat/p-b0baa9ad.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-b385ac4b.js +0 -2
- package/dist/isometrik-webchat/p-b385ac4b.js.map +0 -1
- package/dist/isometrik-webchat/p-c83e2d5d.entry.js +0 -2
- package/dist/isometrik-webchat/p-d758e431.js +0 -2
- package/dist/isometrik-webchat/p-d864bb9f.entry.js +0 -2
- package/dist/isometrik-webchat/p-d864bb9f.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-dab06d54.js +0 -2
- package/dist/isometrik-webchat/p-dab06d54.js.map +0 -1
- package/dist/isometrik-webchat/p-e40e8866.js +0 -2
- package/dist/isometrik-webchat/p-e40e8866.js.map +0 -1
- package/dist/isometrik-webchat/p-e48a1217.entry.js +0 -2
- /package/dist/isometrik-webchat/{p-d892b4d4.entry.js.map → p-02db2116.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-c591fa45.js.map → p-04fdbd0a.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-c5bff6a1.entry.js.map → p-119fc683.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-925decda.js.map → p-1dc52239.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-7b25f234.entry.js.map → p-35f2b9ae.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-3b3dc33e.js.map → p-46be73c5.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-2cf296e6.entry.js.map → p-56521ea4.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-f7d05551.entry.js.map → p-57f97cef.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-ad02a8ca.entry.js.map → p-5f7eebbf.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-c83e2d5d.entry.js.map → p-640e2c03.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-d758e431.js.map → p-6c5eb178.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-d8b65cf4.entry.js.map → p-6eadaa6c.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-161fcb35.entry.js.map → p-7130f547.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-cbb1179b.entry.js.map → p-89a8fc58.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-e48a1217.entry.js.map → p-9b70e93f.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-3664e0ad.entry.js.map → p-b431d864.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-0ccfbe90.entry.js.map → p-b516938b.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-48ce4dca.entry.js.map → p-d44c612a.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-2e9974e1.entry.js.map → p-eb1f3118.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-08ba6153.entry.js.map → p-f5502a63.entry.js.map} +0 -0
|
@@ -1,166 +1,310 @@
|
|
|
1
|
-
import { M } from './
|
|
2
|
-
import { w as withHostMessagePushFields } from './local-notification-
|
|
1
|
+
import { M } from './index.m-8c70037f.js';
|
|
2
|
+
import { w as withHostMessagePushFields } from './local-notification-f9ae9062.js';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
4
|
+
/** Trimmed search text for conversation list queries; empty strings become undefined. */
|
|
5
|
+
function normalizeConversationSearchTag(searchTag) {
|
|
6
|
+
const trimmed = typeof searchTag === 'string' ? searchTag.trim() : '';
|
|
7
|
+
return trimmed ? trimmed : undefined;
|
|
8
|
+
}
|
|
9
|
+
/** Lowercase haystack for case-insensitive conversation search (title, opponent, tags). */
|
|
10
|
+
function conversationSearchHaystack(conversation) {
|
|
11
|
+
var _a;
|
|
12
|
+
const parts = [];
|
|
13
|
+
const title = conversation === null || conversation === void 0 ? void 0 : conversation.conversationTitle;
|
|
14
|
+
const userName = (_a = conversation === null || conversation === void 0 ? void 0 : conversation.opponentDetails) === null || _a === void 0 ? void 0 : _a.userName;
|
|
15
|
+
const groupcastTitle = conversation === null || conversation === void 0 ? void 0 : conversation.groupcastTitle;
|
|
16
|
+
if (title)
|
|
17
|
+
parts.push(String(title));
|
|
18
|
+
if (userName)
|
|
19
|
+
parts.push(String(userName));
|
|
20
|
+
if (groupcastTitle)
|
|
21
|
+
parts.push(String(groupcastTitle));
|
|
22
|
+
const tags = conversation === null || conversation === void 0 ? void 0 : conversation.searchableTags;
|
|
23
|
+
if (Array.isArray(tags)) {
|
|
24
|
+
for (const tag of tags) {
|
|
25
|
+
if (tag != null && String(tag).trim())
|
|
26
|
+
parts.push(String(tag));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return parts.join(' ').toLocaleLowerCase();
|
|
30
|
+
}
|
|
31
|
+
/** Case-insensitive match against conversation title, opponent name, and searchableTags. */
|
|
32
|
+
function conversationMatchesSearch(conversation, searchTag) {
|
|
33
|
+
var _a;
|
|
34
|
+
const needle = (_a = normalizeConversationSearchTag(searchTag)) === null || _a === void 0 ? void 0 : _a.toLocaleLowerCase();
|
|
35
|
+
if (!needle)
|
|
36
|
+
return true;
|
|
37
|
+
return conversationSearchHaystack(conversation).includes(needle);
|
|
38
|
+
}
|
|
39
|
+
function filterConversationsBySearch(conversations, searchTag) {
|
|
40
|
+
const needle = normalizeConversationSearchTag(searchTag);
|
|
41
|
+
if (!needle)
|
|
42
|
+
return Array.isArray(conversations) ? conversations : [];
|
|
43
|
+
const list = Array.isArray(conversations) ? conversations : [];
|
|
44
|
+
return list.filter(c => conversationMatchesSearch(c, needle));
|
|
45
|
+
}
|
|
46
|
+
/** Newest last-message first. Skips empty/cleared last messages when sorting. */
|
|
47
|
+
function sortConversationsByLatestMessage(conversations) {
|
|
48
|
+
return [...conversations].sort((a, b) => {
|
|
49
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
50
|
+
if ((((_a = a === null || a === void 0 ? void 0 : a.lastMessageDetails) === null || _a === void 0 ? void 0 : _a.action) == 'chatMessageSent' || ((_b = a === null || a === void 0 ? void 0 : a.lastMessageDetails) === null || _b === void 0 ? void 0 : _b.action) == 'forward') &&
|
|
51
|
+
(((_c = a === null || a === void 0 ? void 0 : a.lastMessageDetails) === null || _c === void 0 ? void 0 : _c.body) === '' || ((_d = a === null || a === void 0 ? void 0 : a.lastMessageDetails) === null || _d === void 0 ? void 0 : _d.action) === 'clearConversation')) {
|
|
52
|
+
return 0;
|
|
53
|
+
}
|
|
54
|
+
if ((((_e = b === null || b === void 0 ? void 0 : b.lastMessageDetails) === null || _e === void 0 ? void 0 : _e.action) == 'chatMessageSent' || ((_f = b === null || b === void 0 ? void 0 : b.lastMessageDetails) === null || _f === void 0 ? void 0 : _f.action) == 'forward') &&
|
|
55
|
+
(((_g = b === null || b === void 0 ? void 0 : b.lastMessageDetails) === null || _g === void 0 ? void 0 : _g.body) === '' || ((_h = b === null || b === void 0 ? void 0 : b.lastMessageDetails) === null || _h === void 0 ? void 0 : _h.action) === 'clearConversation')) {
|
|
56
|
+
return 0;
|
|
57
|
+
}
|
|
58
|
+
const timestampA = (_j = a === null || a === void 0 ? void 0 : a.lastMessageDetails) === null || _j === void 0 ? void 0 : _j.updatedAt;
|
|
59
|
+
const timestampB = (_k = b === null || b === void 0 ? void 0 : b.lastMessageDetails) === null || _k === void 0 ? void 0 : _k.updatedAt;
|
|
60
|
+
return timestampB - timestampA;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function mergeUniqueConversations(existing, incoming) {
|
|
64
|
+
const list = Array.isArray(existing) ? existing : [];
|
|
65
|
+
const next = Array.isArray(incoming) ? incoming : [];
|
|
66
|
+
return [
|
|
67
|
+
...list,
|
|
68
|
+
...next.filter(newConv => !list.some(existingConv => existingConv.conversationId === newConv.conversationId)),
|
|
69
|
+
];
|
|
70
|
+
}
|
|
71
|
+
async function fetchConversationsPage(opts) {
|
|
72
|
+
var _a, _b, _c;
|
|
73
|
+
const query = {
|
|
8
74
|
limit: (_a = opts.limit) !== null && _a !== void 0 ? _a : 20,
|
|
9
75
|
skip: (_b = opts.skip) !== null && _b !== void 0 ? _b : 0,
|
|
10
|
-
|
|
11
|
-
|
|
76
|
+
includeMembers: (_c = opts.includeMembers) !== null && _c !== void 0 ? _c : true,
|
|
77
|
+
};
|
|
78
|
+
const searchTag = normalizeConversationSearchTag(opts.searchTag);
|
|
79
|
+
if (searchTag)
|
|
80
|
+
query.searchTag = searchTag.toLocaleLowerCase();
|
|
81
|
+
const res = await M.getInstance().Conversation.getConversations(query);
|
|
82
|
+
const conversations = (res === null || res === void 0 ? void 0 : res.conversations) || [];
|
|
83
|
+
return searchTag ? filterConversationsBySearch(conversations, searchTag) : conversations;
|
|
84
|
+
}
|
|
85
|
+
async function fetchConversationDetails(conversationId, includeMembers = true) {
|
|
86
|
+
const res = await M.getInstance().Conversation.getConversationDetails({ conversationId, includeMembers }, conversationId);
|
|
87
|
+
return res === null || res === void 0 ? void 0 : res.conversationDetails;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Per-user media storage quota — data layer for <web-chat>.
|
|
92
|
+
*
|
|
93
|
+
* The core `test-iso-chat-sdk` does not expose the `/chat/quota/*` endpoints,
|
|
94
|
+
* so these are plain `fetch` calls (same approach as the presigned-URL PUTs in
|
|
95
|
+
* send-media.ts), authenticated with the standard chat headers.
|
|
96
|
+
*
|
|
97
|
+
* Usage is **server-authoritative** — never compute it on-device. The feature
|
|
98
|
+
* is dormant until an admin turns quota on for the project (`quotaEnabled`
|
|
99
|
+
* false), in which case uploads are never gated and the storage screen shows a
|
|
100
|
+
* neutral "not limited" state.
|
|
101
|
+
*
|
|
102
|
+
* Mirrors the Flutter SDK's `IsmChatStorageQuota*` surface.
|
|
103
|
+
*/
|
|
104
|
+
/** App-level error code the API returns for an over-quota presign/send. */
|
|
105
|
+
const QUOTA_EXCEEDED_CODE = 6;
|
|
106
|
+
let config = null;
|
|
107
|
+
/** Called once during <web-chat> bootstrap (same creds as ChatSDK init). */
|
|
108
|
+
function setStorageQuotaConfig(next) {
|
|
109
|
+
config = Object.assign({}, next);
|
|
110
|
+
}
|
|
111
|
+
function authHeaders() {
|
|
112
|
+
const c = config;
|
|
113
|
+
return {
|
|
114
|
+
licenseKey: c.licenseKey,
|
|
115
|
+
appSecret: c.appSecret,
|
|
116
|
+
userToken: c.userToken,
|
|
117
|
+
'Content-Type': 'application/json',
|
|
118
|
+
};
|
|
12
119
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
120
|
+
function toInt(value) {
|
|
121
|
+
if (value === null || value === undefined)
|
|
122
|
+
return null;
|
|
123
|
+
const n = typeof value === 'number' ? value : Number(value);
|
|
124
|
+
return Number.isFinite(n) ? Math.trunc(n) : null;
|
|
125
|
+
}
|
|
126
|
+
function normalizeTier(value) {
|
|
127
|
+
if (value === 'paid')
|
|
128
|
+
return 'paid';
|
|
129
|
+
if (value === 'free')
|
|
130
|
+
return 'free';
|
|
131
|
+
return null;
|
|
19
132
|
}
|
|
20
|
-
function
|
|
133
|
+
function normalizeUsage(raw) {
|
|
21
134
|
var _a;
|
|
22
|
-
|
|
135
|
+
const quotaEnabled = (raw === null || raw === void 0 ? void 0 : raw.quotaEnabled) === true;
|
|
136
|
+
return {
|
|
137
|
+
quotaEnabled,
|
|
138
|
+
usedBytes: toInt(raw === null || raw === void 0 ? void 0 : raw.usedBytes),
|
|
139
|
+
quotaBytes: toInt(raw === null || raw === void 0 ? void 0 : raw.quotaBytes),
|
|
140
|
+
remainingBytes: toInt(raw === null || raw === void 0 ? void 0 : raw.remainingBytes),
|
|
141
|
+
tier: quotaEnabled ? (_a = normalizeTier(raw === null || raw === void 0 ? void 0 : raw.tier)) !== null && _a !== void 0 ? _a : 'free' : normalizeTier(raw === null || raw === void 0 ? void 0 : raw.tier),
|
|
142
|
+
// Missing canUpload must never wrongly block the composer.
|
|
143
|
+
canUpload: (raw === null || raw === void 0 ? void 0 : raw.canUpload) !== false,
|
|
144
|
+
};
|
|
23
145
|
}
|
|
24
|
-
function
|
|
25
|
-
var _a, _b;
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
146
|
+
function normalizeMediaItem(raw) {
|
|
147
|
+
var _a, _b, _c, _d, _e, _f;
|
|
148
|
+
const trim = (v) => {
|
|
149
|
+
const s = typeof v === 'string' ? v.trim() : '';
|
|
150
|
+
return s.length ? s : null;
|
|
151
|
+
};
|
|
152
|
+
return {
|
|
153
|
+
mediaId: String((_a = raw === null || raw === void 0 ? void 0 : raw.mediaId) !== null && _a !== void 0 ? _a : ''),
|
|
154
|
+
messageId: String((_b = raw === null || raw === void 0 ? void 0 : raw.messageId) !== null && _b !== void 0 ? _b : ''),
|
|
155
|
+
conversationId: String((_c = raw === null || raw === void 0 ? void 0 : raw.conversationId) !== null && _c !== void 0 ? _c : ''),
|
|
156
|
+
attachmentType: (_d = toInt(raw === null || raw === void 0 ? void 0 : raw.attachmentType)) !== null && _d !== void 0 ? _d : 0,
|
|
157
|
+
name: String((_e = raw === null || raw === void 0 ? void 0 : raw.name) !== null && _e !== void 0 ? _e : ''),
|
|
158
|
+
size: (_f = toInt(raw === null || raw === void 0 ? void 0 : raw.size)) !== null && _f !== void 0 ? _f : 0,
|
|
159
|
+
mediaUrl: trim(raw === null || raw === void 0 ? void 0 : raw.mediaUrl),
|
|
160
|
+
thumbnailUrl: trim(raw === null || raw === void 0 ? void 0 : raw.thumbnailUrl),
|
|
161
|
+
restricted: (raw === null || raw === void 0 ? void 0 : raw.restricted) === true,
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
/** `GET /chat/quota/storage/usage`. Returns `null` on a transport error. */
|
|
165
|
+
async function fetchStorageUsage() {
|
|
166
|
+
if (!config)
|
|
167
|
+
return null;
|
|
168
|
+
try {
|
|
169
|
+
const res = await fetch(`${config.baseUrl}/chat/quota/storage/usage`, {
|
|
170
|
+
method: 'GET',
|
|
171
|
+
headers: authHeaders(),
|
|
172
|
+
});
|
|
173
|
+
if (!res.ok)
|
|
174
|
+
return null;
|
|
175
|
+
return normalizeUsage(await res.json());
|
|
36
176
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const id = messageIdOf(m);
|
|
40
|
-
if (!id)
|
|
41
|
-
continue;
|
|
42
|
-
if (!byId.has(id))
|
|
43
|
-
added += 1;
|
|
44
|
-
byId.set(id, m);
|
|
177
|
+
catch (_a) {
|
|
178
|
+
return null;
|
|
45
179
|
}
|
|
46
|
-
const next = Array.from(byId.values()).sort((a, b) => sentAtOf(a) - sentAtOf(b));
|
|
47
|
-
return { next, added };
|
|
48
180
|
}
|
|
49
|
-
|
|
181
|
+
/** `GET /chat/quota/storage/media`. `limit` is clamped to 1..20. */
|
|
182
|
+
async function fetchStorageMedia(opts = {}) {
|
|
50
183
|
var _a, _b;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
184
|
+
if (!config)
|
|
185
|
+
return null;
|
|
186
|
+
const limit = Math.min(20, Math.max(1, (_a = opts.limit) !== null && _a !== void 0 ? _a : 20));
|
|
187
|
+
const skip = Math.max(0, (_b = opts.skip) !== null && _b !== void 0 ? _b : 0);
|
|
188
|
+
const params = new URLSearchParams({ limit: String(limit), skip: String(skip) });
|
|
189
|
+
if (opts.conversationId)
|
|
190
|
+
params.set('conversationId', opts.conversationId);
|
|
191
|
+
try {
|
|
192
|
+
const res = await fetch(`${config.baseUrl}/chat/quota/storage/media?${params.toString()}`, {
|
|
193
|
+
method: 'GET',
|
|
194
|
+
headers: authHeaders(),
|
|
195
|
+
});
|
|
196
|
+
if (!res.ok)
|
|
197
|
+
return null;
|
|
198
|
+
const data = await res.json();
|
|
199
|
+
return {
|
|
200
|
+
quotaEnabled: (data === null || data === void 0 ? void 0 : data.quotaEnabled) === true,
|
|
201
|
+
msg: data === null || data === void 0 ? void 0 : data.msg,
|
|
202
|
+
media: Array.isArray(data === null || data === void 0 ? void 0 : data.media) ? data.media.map(normalizeMediaItem) : [],
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
catch (_c) {
|
|
206
|
+
return null;
|
|
207
|
+
}
|
|
65
208
|
}
|
|
66
|
-
|
|
209
|
+
function parseDeleteResult(raw) {
|
|
67
210
|
var _a;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
211
|
+
return {
|
|
212
|
+
freedBytes: (_a = toInt(raw === null || raw === void 0 ? void 0 : raw.freedBytes)) !== null && _a !== void 0 ? _a : 0,
|
|
213
|
+
usedBytes: toInt(raw === null || raw === void 0 ? void 0 : raw.usedBytes),
|
|
214
|
+
quotaBytes: toInt(raw === null || raw === void 0 ? void 0 : raw.quotaBytes),
|
|
215
|
+
msg: raw === null || raw === void 0 ? void 0 : raw.msg,
|
|
216
|
+
};
|
|
73
217
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
if (/xlsx?|spreadsheet|excel|csv/.test(t))
|
|
89
|
-
return 'excel';
|
|
90
|
-
if (t.includes('pdf'))
|
|
91
|
-
return 'pdf';
|
|
92
|
-
if (t.includes('rtf'))
|
|
93
|
-
return 'rtf';
|
|
94
|
-
if (t.includes('text/plain') || /(^|[^a-z])txt([^a-z]|$)/.test(t))
|
|
95
|
-
return 'txt';
|
|
96
|
-
return 'file';
|
|
97
|
-
}
|
|
98
|
-
/** send-media.ts: 0 image, 1 video → media; 3 document → docs. */
|
|
99
|
-
function attachmentBucket(att) {
|
|
100
|
-
if (!att)
|
|
101
|
-
return null;
|
|
102
|
-
const mime = String(att.mimeType || '');
|
|
103
|
-
if (mime.startsWith('image/') || mime.startsWith('video/'))
|
|
104
|
-
return 'media';
|
|
105
|
-
if (mime.startsWith('application/') || mime === 'text/plain' || mime.includes('rtf'))
|
|
106
|
-
return 'docs';
|
|
107
|
-
const type = att.mediaType == null || att.mediaType === '' ? NaN : Number(att.mediaType);
|
|
108
|
-
if (type === 0 || type === 1)
|
|
109
|
-
return 'media';
|
|
110
|
-
if (type === 3)
|
|
111
|
-
return 'docs';
|
|
112
|
-
return null;
|
|
218
|
+
async function runDelete(url, body) {
|
|
219
|
+
if (!config)
|
|
220
|
+
return { result: null, status: 0, error: 'Storage quota not configured' };
|
|
221
|
+
try {
|
|
222
|
+
const res = await fetch(url, Object.assign({ method: 'DELETE', headers: authHeaders() }, (body !== undefined ? { body: JSON.stringify(body) } : {})));
|
|
223
|
+
const data = await res.json().catch(() => ({}));
|
|
224
|
+
if (!res.ok) {
|
|
225
|
+
return { result: null, status: res.status, error: (data === null || data === void 0 ? void 0 : data.error) || (data === null || data === void 0 ? void 0 : data.message) };
|
|
226
|
+
}
|
|
227
|
+
return { result: parseDeleteResult(data), status: res.status };
|
|
228
|
+
}
|
|
229
|
+
catch (e) {
|
|
230
|
+
return { result: null, status: 0, error: e === null || e === void 0 ? void 0 : e.message };
|
|
231
|
+
}
|
|
113
232
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
return { media, docs };
|
|
233
|
+
/** `DELETE /chat/quota/media` with `{ mediaIds }` (1..50). For everyone. */
|
|
234
|
+
function deleteStorageMediaApi(mediaIds) {
|
|
235
|
+
if (!config)
|
|
236
|
+
return Promise.resolve({ result: null, status: 0, error: 'Storage quota not configured' });
|
|
237
|
+
return runDelete(`${config.baseUrl}/chat/quota/media`, { mediaIds });
|
|
238
|
+
}
|
|
239
|
+
/** `DELETE /chat/quota/storage/conversation/{id}/media`. For everyone. */
|
|
240
|
+
function deleteConversationStorageMediaApi(conversationId) {
|
|
241
|
+
if (!config)
|
|
242
|
+
return Promise.resolve({ result: null, status: 0, error: 'Storage quota not configured' });
|
|
243
|
+
return runDelete(`${config.baseUrl}/chat/quota/storage/conversation/${conversationId}/media`);
|
|
244
|
+
}
|
|
245
|
+
// ----------------------------------------------------------------- helpers
|
|
246
|
+
/** Fraction of the allowance used, 0..1. `0` when quota is off/unknown. */
|
|
247
|
+
function usedFraction(usage) {
|
|
248
|
+
var _a;
|
|
249
|
+
if (!usage || !usage.quotaEnabled || !usage.quotaBytes)
|
|
250
|
+
return 0;
|
|
251
|
+
const f = ((_a = usage.usedBytes) !== null && _a !== void 0 ? _a : 0) / usage.quotaBytes;
|
|
252
|
+
return Number.isFinite(f) ? Math.min(1, Math.max(0, f)) : 0;
|
|
135
253
|
}
|
|
136
|
-
/**
|
|
137
|
-
function
|
|
138
|
-
|
|
139
|
-
return [];
|
|
140
|
-
return messages.filter(message => {
|
|
141
|
-
if (!message.attachments || !Array.isArray(message.attachments))
|
|
142
|
-
return false;
|
|
143
|
-
const valid = message.attachments.filter((attachment) => (attachment === null || attachment === void 0 ? void 0 : attachment.mimeType) && !String(attachment.mimeType).startsWith('application'));
|
|
144
|
-
return valid.length > 0;
|
|
145
|
-
});
|
|
254
|
+
/** At/over the allowance (uploads blocked). Always false when quota is off. */
|
|
255
|
+
function isOverLimit(usage) {
|
|
256
|
+
return !!usage && usage.quotaEnabled && !usage.canUpload;
|
|
146
257
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
258
|
+
/**
|
|
259
|
+
* True when usage is at or above `threshold` of the allowance (default `0.9` = 90%).
|
|
260
|
+
* Used by the conversation-list warning banner — mirrors Flutter's
|
|
261
|
+
* `IsmChatStorageUsageModel.shouldWarnNearQuota`.
|
|
262
|
+
* Always false when quota is off or quota size is unknown/zero.
|
|
263
|
+
*/
|
|
264
|
+
function shouldWarnNearQuota(usage, threshold = 0.9) {
|
|
265
|
+
if (!(usage === null || usage === void 0 ? void 0 : usage.quotaEnabled))
|
|
266
|
+
return false;
|
|
267
|
+
const quota = usage.quotaBytes;
|
|
268
|
+
if (quota == null || quota <= 0)
|
|
269
|
+
return false;
|
|
270
|
+
return usedFraction(usage) >= threshold;
|
|
271
|
+
}
|
|
272
|
+
/** Whether an upload of `size` bytes fits. Always true when quota is off. */
|
|
273
|
+
function canUploadBytes(usage, size) {
|
|
274
|
+
if (!usage || !usage.quotaEnabled)
|
|
275
|
+
return true;
|
|
276
|
+
if (!usage.canUpload)
|
|
277
|
+
return false;
|
|
278
|
+
if (usage.remainingBytes == null)
|
|
279
|
+
return true;
|
|
280
|
+
return size <= usage.remainingBytes;
|
|
281
|
+
}
|
|
282
|
+
/** Whether an error/response is the storage-quota rejection (errorCode 6). */
|
|
283
|
+
function isQuotaExceededError(err) {
|
|
284
|
+
var _a, _b, _c, _d;
|
|
285
|
+
if (!err)
|
|
286
|
+
return false;
|
|
287
|
+
const code = (_c = (_a = err === null || err === void 0 ? void 0 : err.errorCode) !== null && _a !== void 0 ? _a : (_b = err === null || err === void 0 ? void 0 : err.data) === null || _b === void 0 ? void 0 : _b.errorCode) !== null && _c !== void 0 ? _c : (_d = err === null || err === void 0 ? void 0 : err.response) === null || _d === void 0 ? void 0 : _d.errorCode;
|
|
288
|
+
if (code === QUOTA_EXCEEDED_CODE)
|
|
289
|
+
return true;
|
|
290
|
+
const msg = String((err === null || err === void 0 ? void 0 : err.error) || (err === null || err === void 0 ? void 0 : err.message) || '').toLowerCase();
|
|
291
|
+
return msg.includes('storage quota');
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Human-readable byte sizes for UI copy (e.g. `24.14 MB`, `1.07 GB`).
|
|
295
|
+
*
|
|
296
|
+
* Uses **decimal SI** steps (1 KB = 1_000 B, 1 MB = 1_000_000 B) so numbers match
|
|
297
|
+
* common product/dashboard expectations. API fields are still raw byte counts.
|
|
298
|
+
*/
|
|
299
|
+
function formatBytes(bytes, fractionDigits = 2) {
|
|
300
|
+
const n = typeof bytes === 'number' && Number.isFinite(bytes) ? bytes : 0;
|
|
301
|
+
if (n <= 0)
|
|
302
|
+
return '0 B';
|
|
303
|
+
const base = 1000;
|
|
304
|
+
const units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];
|
|
305
|
+
const i = Math.min(units.length - 1, Math.floor(Math.log(n) / Math.log(base)));
|
|
306
|
+
const value = n / Math.pow(base, i);
|
|
307
|
+
return `${value.toFixed(i === 0 ? 0 : fractionDigits)} ${units[i]}`;
|
|
164
308
|
}
|
|
165
309
|
|
|
166
310
|
/** One chat message may carry at most this many attachments. */
|
|
@@ -618,14 +762,86 @@ function roundRect(ctx, x, y, width, height, radius) {
|
|
|
618
762
|
}
|
|
619
763
|
|
|
620
764
|
/**
|
|
621
|
-
*
|
|
622
|
-
* Conversation path only (groupcast keeps using ChatFooter).
|
|
765
|
+
* Same-name storage upload UX (quota feature).
|
|
623
766
|
*
|
|
624
|
-
*
|
|
625
|
-
*
|
|
626
|
-
*
|
|
767
|
+
* Contract: see SAME_NAME_UPLOAD_FRONTEND.md in product docs — presign returns
|
|
768
|
+
* `duplicate: true` without PUT URLs; user picks reshare vs `forceUpload: true`.
|
|
769
|
+
* Reused from send-media.ts, ChatFooter, and uploadAndPostMediaMessage.
|
|
627
770
|
*/
|
|
771
|
+
const SAME_NAME_UPLOAD_WARNING = 'A file with the same name is already in your storage.';
|
|
772
|
+
class SameNameUploadCancelledError extends Error {
|
|
773
|
+
constructor(message = 'Same-name upload cancelled') {
|
|
774
|
+
super(message);
|
|
775
|
+
this.name = 'SameNameUploadCancelledError';
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
function isSameNameUploadCancelledError(err) {
|
|
779
|
+
return err instanceof SameNameUploadCancelledError;
|
|
780
|
+
}
|
|
781
|
+
/**
|
|
782
|
+
* Modal: primary = new copy (forceUpload path), secondary = reshare older file.
|
|
783
|
+
* Drawer dismiss → cancel (caller removes optimistic message).
|
|
784
|
+
*
|
|
785
|
+
* Dynamic-imports drawer so unit tests that import send-media do not load Stencil shells.
|
|
786
|
+
*/
|
|
787
|
+
function promptSameNameUpload(args) {
|
|
788
|
+
const { fileName, warning } = args;
|
|
789
|
+
const description = (warning === null || warning === void 0 ? void 0 : warning.trim()) || `“${fileName}”\n\n${SAME_NAME_UPLOAD_WARNING}`;
|
|
790
|
+
return import('./drawer-a457d820.js').then(({ drawerDialogService }) => {
|
|
791
|
+
return new Promise(resolve => {
|
|
792
|
+
const finish = (choice) => {
|
|
793
|
+
drawerDialogService.closeDialog('confirm-dialog');
|
|
794
|
+
resolve(choice);
|
|
795
|
+
};
|
|
796
|
+
let settled = false;
|
|
797
|
+
const settle = (choice) => {
|
|
798
|
+
if (settled)
|
|
799
|
+
return;
|
|
800
|
+
settled = true;
|
|
801
|
+
finish(choice);
|
|
802
|
+
};
|
|
803
|
+
drawerDialogService.openDialog('confirm-dialog', {
|
|
804
|
+
title: 'File already in storage',
|
|
805
|
+
description,
|
|
806
|
+
yesText: 'Upload a copy',
|
|
807
|
+
noText: 'Reshare older file',
|
|
808
|
+
handleConfirm: () => settle('forceUpload'),
|
|
809
|
+
handleCancel: () => settle('reshare'),
|
|
810
|
+
// Overlay / × close (drawer.ts calls onDismiss) → cancel send.
|
|
811
|
+
onDismiss: () => settle('cancel'),
|
|
812
|
+
});
|
|
813
|
+
});
|
|
814
|
+
});
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
818
|
+
var t = {};
|
|
819
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
820
|
+
t[p] = s[p];
|
|
821
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
822
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
823
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
824
|
+
t[p[i]] = s[p[i]];
|
|
825
|
+
}
|
|
826
|
+
return t;
|
|
827
|
+
};
|
|
628
828
|
const ATTACHMENT_BODY_PLACEHOLDER = 'AttachmentMessage:Multiple';
|
|
829
|
+
const DOCUMENT_ATTACHMENT_CUSTOM_TYPES = new Set(['AttachmentMessage:Doc', 'AttachmentMessage:File']);
|
|
830
|
+
/** Display/download filename on an attachment record (API may use `name` or `nameWithExtension`). */
|
|
831
|
+
function attachmentFileLabel(attachment) {
|
|
832
|
+
var _a, _b;
|
|
833
|
+
return String((_b = (_a = attachment === null || attachment === void 0 ? void 0 : attachment.name) !== null && _a !== void 0 ? _a : attachment === null || attachment === void 0 ? void 0 : attachment.nameWithExtension) !== null && _b !== void 0 ? _b : '').trim();
|
|
834
|
+
}
|
|
835
|
+
function labelsEqual(a, b) {
|
|
836
|
+
return a.localeCompare(b, undefined, { sensitivity: 'accent' }) === 0;
|
|
837
|
+
}
|
|
838
|
+
function attachmentFileLabels(attachments) {
|
|
839
|
+
return (attachments || []).map(a => attachmentFileLabel(a)).filter(Boolean);
|
|
840
|
+
}
|
|
841
|
+
/** Filename-only API body for a single document (e.g. `report.pdf`). */
|
|
842
|
+
function bodyLooksLikeStandaloneFileName(body) {
|
|
843
|
+
return /^[^\s/\\]+\.[^\s.]+$/i.test(body);
|
|
844
|
+
}
|
|
629
845
|
function mediaTypeFromMime(mime) {
|
|
630
846
|
if (!mime)
|
|
631
847
|
return 3;
|
|
@@ -659,8 +875,12 @@ function attachmentCaption(message) {
|
|
|
659
875
|
var _a, _b, _c, _d;
|
|
660
876
|
const meta = message === null || message === void 0 ? void 0 : message.metaData;
|
|
661
877
|
const fromMeta = String((_b = (_a = meta === null || meta === void 0 ? void 0 : meta.caption) !== null && _a !== void 0 ? _a : meta === null || meta === void 0 ? void 0 : meta.captionMessage) !== null && _b !== void 0 ? _b : '').trim();
|
|
662
|
-
|
|
878
|
+
const labels = attachmentFileLabels(message === null || message === void 0 ? void 0 : message.attachments);
|
|
879
|
+
if (fromMeta) {
|
|
880
|
+
if (labels.some(l => labelsEqual(l, fromMeta)))
|
|
881
|
+
return '';
|
|
663
882
|
return fromMeta;
|
|
883
|
+
}
|
|
664
884
|
const body = String((_c = message === null || message === void 0 ? void 0 : message.body) !== null && _c !== void 0 ? _c : '').trim();
|
|
665
885
|
const customType = String((_d = message === null || message === void 0 ? void 0 : message.customType) !== null && _d !== void 0 ? _d : '').trim();
|
|
666
886
|
// Multiple attachments: real caption lives in metaData only (Flutter/Swift/web); never use body text
|
|
@@ -668,8 +888,26 @@ function attachmentCaption(message) {
|
|
|
668
888
|
return '';
|
|
669
889
|
if (isAttachmentBodyPlaceholder(body))
|
|
670
890
|
return '';
|
|
891
|
+
// Single doc without caption: body is the filename for the API — already shown on the card
|
|
892
|
+
if (labels.some(l => labelsEqual(l, body)))
|
|
893
|
+
return '';
|
|
894
|
+
if (DOCUMENT_ATTACHMENT_CUSTOM_TYPES.has(customType) &&
|
|
895
|
+
bodyLooksLikeStandaloneFileName(body) &&
|
|
896
|
+
labels.length <= 1) {
|
|
897
|
+
return '';
|
|
898
|
+
}
|
|
671
899
|
return body;
|
|
672
900
|
}
|
|
901
|
+
/** Document bubble caption — drop text that only repeats the attachment filename. */
|
|
902
|
+
function suppressDuplicateFileCaption(caption, attachment) {
|
|
903
|
+
const text = String(caption !== null && caption !== void 0 ? caption : '').trim();
|
|
904
|
+
if (!text)
|
|
905
|
+
return '';
|
|
906
|
+
const label = attachmentFileLabel(attachment);
|
|
907
|
+
if (label && labelsEqual(text, label))
|
|
908
|
+
return '';
|
|
909
|
+
return text;
|
|
910
|
+
}
|
|
673
911
|
/** @deprecated Prefer attachmentBodyForOutgoing — kept for callers that only pass caption. */
|
|
674
912
|
function attachmentBodyForApi(caption) {
|
|
675
913
|
return (caption === null || caption === void 0 ? void 0 : caption.trim()) || ATTACHMENT_BODY_PLACEHOLDER;
|
|
@@ -825,6 +1063,142 @@ function buildLocalMediaAttachments(files) {
|
|
|
825
1063
|
};
|
|
826
1064
|
});
|
|
827
1065
|
}
|
|
1066
|
+
function isPresignDuplicateSlot(slot) {
|
|
1067
|
+
return (slot === null || slot === void 0 ? void 0 : slot.duplicate) === true;
|
|
1068
|
+
}
|
|
1069
|
+
function presignedSlotsByMediaId(slots) {
|
|
1070
|
+
const map = new Map();
|
|
1071
|
+
for (const slot of slots || []) {
|
|
1072
|
+
if ((slot === null || slot === void 0 ? void 0 : slot.mediaId) != null)
|
|
1073
|
+
map.set(String(slot.mediaId), slot);
|
|
1074
|
+
}
|
|
1075
|
+
return map;
|
|
1076
|
+
}
|
|
1077
|
+
function presignRequestAttachments(attachments, forceUploadMediaIds) {
|
|
1078
|
+
return attachments.map(a => (Object.assign({ mediaId: a.mediaId, mediaType: a.mediaType, nameWithExtension: a.nameWithExtension }, ((forceUploadMediaIds === null || forceUploadMediaIds === void 0 ? void 0 : forceUploadMediaIds.has(a.mediaId)) ? { forceUpload: true } : {}))));
|
|
1079
|
+
}
|
|
1080
|
+
async function fetchPresignedUrlSlots(conversationId, attachments, forceUploadMediaIds) {
|
|
1081
|
+
const res = await M.getInstance().message.postMessagesPresignedurls({
|
|
1082
|
+
conversationId,
|
|
1083
|
+
attachments: presignRequestAttachments(attachments, forceUploadMediaIds),
|
|
1084
|
+
});
|
|
1085
|
+
const presignedUrls = (res === null || res === void 0 ? void 0 : res.presignedUrls)
|
|
1086
|
+
? res.presignedUrls
|
|
1087
|
+
: (res === null || res === void 0 ? void 0 : res.presignedUrl)
|
|
1088
|
+
? [res]
|
|
1089
|
+
: null;
|
|
1090
|
+
if (!(presignedUrls === null || presignedUrls === void 0 ? void 0 : presignedUrls.length)) {
|
|
1091
|
+
throw new Error('No presigned URLs returned for media upload');
|
|
1092
|
+
}
|
|
1093
|
+
return presignedUrls;
|
|
1094
|
+
}
|
|
1095
|
+
/**
|
|
1096
|
+
* Build message attachment for reshare after `duplicate: true` — no PUT.
|
|
1097
|
+
* Presign request uses client `attachment.mediaId` to match the slot; POST /chat/message
|
|
1098
|
+
* must use `slot.existingMediaId` so the server reuses the stored object (0 quota bytes).
|
|
1099
|
+
*/
|
|
1100
|
+
function buildReshareAttachmentPayload(slot, attachment) {
|
|
1101
|
+
const mediaUrl = String(slot.mediaUrl || '');
|
|
1102
|
+
if (!mediaUrl) {
|
|
1103
|
+
throw new Error('Duplicate file response missing mediaUrl');
|
|
1104
|
+
}
|
|
1105
|
+
const existingMediaId = String(slot.existingMediaId || '').trim();
|
|
1106
|
+
if (!existingMediaId) {
|
|
1107
|
+
throw new Error('Duplicate file response missing existingMediaId');
|
|
1108
|
+
}
|
|
1109
|
+
const isPdf = isPdfFileAttachment(attachment);
|
|
1110
|
+
const isOffice = isOfficeFileAttachment(attachment);
|
|
1111
|
+
const needsImageThumb = isPdf || isOffice;
|
|
1112
|
+
const thumbnailUrl = needsImageThumb
|
|
1113
|
+
? documentThumbnailUrl({ mediaUrl, thumbnailUrl: slot.thumbnailUrl })
|
|
1114
|
+
: String(slot.thumbnailUrl || mediaUrl);
|
|
1115
|
+
const fileExt = extensionFromFileName(attachment.nameWithExtension);
|
|
1116
|
+
return {
|
|
1117
|
+
mediaId: existingMediaId,
|
|
1118
|
+
mediaUrl,
|
|
1119
|
+
thumbnailUrl,
|
|
1120
|
+
mediaType: attachment.mediaType,
|
|
1121
|
+
nameWithExtension: attachment.nameWithExtension,
|
|
1122
|
+
name: attachment.nameWithExtension,
|
|
1123
|
+
mimeType: attachment.mimeType,
|
|
1124
|
+
extension: fileExt,
|
|
1125
|
+
size: attachment.size,
|
|
1126
|
+
attachmentType: attachment.mediaType,
|
|
1127
|
+
};
|
|
1128
|
+
}
|
|
1129
|
+
function mapOutgoingAttachmentsForApi(payloads) {
|
|
1130
|
+
return payloads.map(p => {
|
|
1131
|
+
if (p.forceUpload) {
|
|
1132
|
+
const rest = __rest(p, ["forceUpload"]);
|
|
1133
|
+
return Object.assign(Object.assign({}, rest), { forceUpload: true });
|
|
1134
|
+
}
|
|
1135
|
+
const rest = __rest(p, ["forceUpload"]);
|
|
1136
|
+
return rest;
|
|
1137
|
+
});
|
|
1138
|
+
}
|
|
1139
|
+
/**
|
|
1140
|
+
* Presign → (optional same-name prompt) → PUT or reshare → payloads for postMessages.
|
|
1141
|
+
* Processes duplicates sequentially so the user can choose per file.
|
|
1142
|
+
*/
|
|
1143
|
+
async function resolveAttachmentPayloads(args) {
|
|
1144
|
+
var _a, _b, _c, _d;
|
|
1145
|
+
const { conversationId, attachments, renderPdfThumbnail, renderOfficeThumbnail } = args;
|
|
1146
|
+
const prompt = (_a = args.sameNameUploadPrompt) !== null && _a !== void 0 ? _a : promptSameNameUpload;
|
|
1147
|
+
const slots = (_b = args.presignedSlots) !== null && _b !== void 0 ? _b : (await fetchPresignedUrlSlots(conversationId, attachments));
|
|
1148
|
+
const slotById = presignedSlotsByMediaId(slots);
|
|
1149
|
+
const payloads = [];
|
|
1150
|
+
for (let index = 0; index < attachments.length; index++) {
|
|
1151
|
+
const attachment = attachments[index];
|
|
1152
|
+
const urlDetails = (_c = slotById.get(attachment.mediaId)) !== null && _c !== void 0 ? _c : slots[index];
|
|
1153
|
+
if (!urlDetails)
|
|
1154
|
+
continue;
|
|
1155
|
+
if (isPresignDuplicateSlot(urlDetails)) {
|
|
1156
|
+
const choice = await prompt({
|
|
1157
|
+
fileName: attachment.nameWithExtension,
|
|
1158
|
+
warning: urlDetails.warning,
|
|
1159
|
+
});
|
|
1160
|
+
if (choice === 'cancel') {
|
|
1161
|
+
throw new SameNameUploadCancelledError();
|
|
1162
|
+
}
|
|
1163
|
+
if (choice === 'reshare') {
|
|
1164
|
+
payloads.push(buildReshareAttachmentPayload(urlDetails, attachment));
|
|
1165
|
+
continue;
|
|
1166
|
+
}
|
|
1167
|
+
const forced = await fetchPresignedUrlSlots(conversationId, [attachment], new Set([attachment.mediaId]));
|
|
1168
|
+
const forceSlot = (_d = presignedSlotsByMediaId(forced).get(attachment.mediaId)) !== null && _d !== void 0 ? _d : forced[0];
|
|
1169
|
+
if (!forceSlot || isPresignDuplicateSlot(forceSlot)) {
|
|
1170
|
+
throw new Error('Could not get upload URL for duplicate file copy');
|
|
1171
|
+
}
|
|
1172
|
+
const uploaded = await uploadPresignedMediaAttachment({
|
|
1173
|
+
urlDetails: forceSlot,
|
|
1174
|
+
attachment,
|
|
1175
|
+
conversationId,
|
|
1176
|
+
renderPdfThumbnail,
|
|
1177
|
+
renderOfficeThumbnail,
|
|
1178
|
+
});
|
|
1179
|
+
if (!uploaded) {
|
|
1180
|
+
throw new Error('Upload failed for duplicate file copy');
|
|
1181
|
+
}
|
|
1182
|
+
payloads.push(Object.assign(Object.assign({}, uploaded), { forceUpload: true }));
|
|
1183
|
+
continue;
|
|
1184
|
+
}
|
|
1185
|
+
const uploaded = await uploadPresignedMediaAttachment({
|
|
1186
|
+
urlDetails,
|
|
1187
|
+
attachment,
|
|
1188
|
+
conversationId,
|
|
1189
|
+
renderPdfThumbnail,
|
|
1190
|
+
renderOfficeThumbnail,
|
|
1191
|
+
});
|
|
1192
|
+
if (!uploaded) {
|
|
1193
|
+
throw new Error(`Upload failed for ${attachment.nameWithExtension}`);
|
|
1194
|
+
}
|
|
1195
|
+
payloads.push(uploaded);
|
|
1196
|
+
}
|
|
1197
|
+
if (!payloads.length) {
|
|
1198
|
+
throw new Error('No attachments to send');
|
|
1199
|
+
}
|
|
1200
|
+
return payloads;
|
|
1201
|
+
}
|
|
828
1202
|
/** PDF (or a file named *.pdf). The app cannot paint these bytes with Image.network. */
|
|
829
1203
|
function isPdfFileAttachment(file) {
|
|
830
1204
|
const mime = String((file === null || file === void 0 ? void 0 : file.mimeType) || '').toLowerCase();
|
|
@@ -1042,7 +1416,7 @@ async function uploadPresignedMediaAttachment(opts) {
|
|
|
1042
1416
|
if (!attachment)
|
|
1043
1417
|
return null;
|
|
1044
1418
|
const mediaPresignedUrl = (urlDetails === null || urlDetails === void 0 ? void 0 : urlDetails.mediaPresignedUrl) || (urlDetails === null || urlDetails === void 0 ? void 0 : urlDetails.presignedUrl);
|
|
1045
|
-
const mediaId = (urlDetails === null || urlDetails === void 0 ? void 0 : urlDetails.mediaId) || (urlDetails === null || urlDetails === void 0 ? void 0 : urlDetails.mediaUrl);
|
|
1419
|
+
const mediaId = attachment.mediaId || (urlDetails === null || urlDetails === void 0 ? void 0 : urlDetails.mediaId) || (urlDetails === null || urlDetails === void 0 ? void 0 : urlDetails.mediaUrl);
|
|
1046
1420
|
const mediaUrl = urlDetails === null || urlDetails === void 0 ? void 0 : urlDetails.mediaUrl;
|
|
1047
1421
|
const thumbnailPresignedUrl = urlDetails === null || urlDetails === void 0 ? void 0 : urlDetails.thumbnailPresignedUrl;
|
|
1048
1422
|
const isPdf = isPdfFileAttachment(attachment);
|
|
@@ -1112,35 +1486,14 @@ async function uploadPresignedMediaAttachment(opts) {
|
|
|
1112
1486
|
}
|
|
1113
1487
|
/** Presign → PUT files → postMessages. Returns API messageId. */
|
|
1114
1488
|
async function uploadAndPostMediaMessage(args) {
|
|
1115
|
-
const { conversationId, deviceId, attachments, replyMessage, caption, mentionedUsers, pushContext } = args;
|
|
1489
|
+
const { conversationId, deviceId, attachments, replyMessage, caption, mentionedUsers, pushContext, sameNameUploadPrompt, } = args;
|
|
1116
1490
|
if (!conversationId || !(attachments === null || attachments === void 0 ? void 0 : attachments.length))
|
|
1117
1491
|
return null;
|
|
1118
|
-
const
|
|
1492
|
+
const allPayloads = await resolveAttachmentPayloads({
|
|
1119
1493
|
conversationId,
|
|
1120
1494
|
attachments,
|
|
1495
|
+
sameNameUploadPrompt,
|
|
1121
1496
|
});
|
|
1122
|
-
const presignedUrls = (resForPresignedUrl === null || resForPresignedUrl === void 0 ? void 0 : resForPresignedUrl.presignedUrls)
|
|
1123
|
-
? resForPresignedUrl.presignedUrls
|
|
1124
|
-
: (resForPresignedUrl === null || resForPresignedUrl === void 0 ? void 0 : resForPresignedUrl.presignedUrl)
|
|
1125
|
-
? [resForPresignedUrl]
|
|
1126
|
-
: null;
|
|
1127
|
-
if (!(presignedUrls === null || presignedUrls === void 0 ? void 0 : presignedUrls.length)) {
|
|
1128
|
-
throw new Error('No presigned URLs returned for media upload');
|
|
1129
|
-
}
|
|
1130
|
-
/** Typed array so `postMessages` payload is not `any[]` (strict noImplicitAny). */
|
|
1131
|
-
const allPayloads = [];
|
|
1132
|
-
await Promise.all(presignedUrls.map(async (urlDetails, index) => {
|
|
1133
|
-
const attachmentPayload = attachments[index];
|
|
1134
|
-
if (!attachmentPayload)
|
|
1135
|
-
return;
|
|
1136
|
-
const payload = await uploadPresignedMediaAttachment({
|
|
1137
|
-
urlDetails,
|
|
1138
|
-
attachment: attachmentPayload,
|
|
1139
|
-
conversationId,
|
|
1140
|
-
});
|
|
1141
|
-
if (payload)
|
|
1142
|
-
allPayloads.push(payload);
|
|
1143
|
-
}));
|
|
1144
1497
|
const customType = resolveCustomTypeForUpload(attachments);
|
|
1145
1498
|
const payload = {
|
|
1146
1499
|
showInConversation: true,
|
|
@@ -1150,7 +1503,7 @@ async function uploadAndPostMediaMessage(args) {
|
|
|
1150
1503
|
conversationId,
|
|
1151
1504
|
body: attachmentBodyForOutgoing(caption, attachments),
|
|
1152
1505
|
customType,
|
|
1153
|
-
attachments: allPayloads,
|
|
1506
|
+
attachments: mapOutgoingAttachmentsForApi(allPayloads),
|
|
1154
1507
|
deviceId,
|
|
1155
1508
|
metaData: buildReplyMetaData(replyMessage, caption),
|
|
1156
1509
|
};
|
|
@@ -1161,6 +1514,6 @@ async function uploadAndPostMediaMessage(args) {
|
|
|
1161
1514
|
return (sendMessageRes === null || sendMessageRes === void 0 ? void 0 : sendMessageRes.messageId) || null;
|
|
1162
1515
|
}
|
|
1163
1516
|
|
|
1164
|
-
export {
|
|
1517
|
+
export { usedFraction as A, shouldWarnNearQuota as B, ATTACHMENT_BODY_PLACEHOLDER as C, conversationMatchesSearch as D, canUploadBytes as E, presignedSlotsByMediaId as F, isQuotaExceededError as G, uploadPresignedMediaAttachment as H, resolveAttachmentPayloads as I, mapOutgoingAttachmentsForApi as J, isPresignDuplicateSlot as K, attachmentCaption as L, MAX_MEDIA_PER_MESSAGE as M, attachmentFileLabel as N, suppressDuplicateFileCaption as O, fetchConversationDetails as a, mediaTypeFromMime as b, customTypeFromMime as c, buildReplyMetaData as d, fetchStorageUsage as e, fetchConversationsPage as f, fetchStorageMedia as g, deleteStorageMediaApi as h, deleteConversationStorageMediaApi as i, setStorageQuotaConfig as j, attachmentBodyForApi as k, isAttachmentBodyPlaceholder as l, mergeUniqueConversations as m, isSameNameUploadCancelledError as n, normalizeConversationSearchTag as o, prepareMediaAttachments as p, filterConversationsBySearch as q, mediaLimitToastMessage as r, sortConversationsByLatestMessage as s, takeMediaFiles as t, uploadAndPostMediaMessage as u, buildLocalMediaAttachments as v, attachmentBodyForOutgoing as w, resolveCustomTypeForUpload as x, formatBytes as y, isOverLimit as z };
|
|
1165
1518
|
|
|
1166
|
-
//# sourceMappingURL=send-media-
|
|
1519
|
+
//# sourceMappingURL=send-media-04f7ca0a.js.map
|