isometrik-plugin-chat-sdk 1.3.18 → 2.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/dist/cjs/app-globals-61a8bfde.js +38 -0
- package/dist/cjs/app-globals-61a8bfde.js.map +1 -0
- package/dist/cjs/attachment-preview_22.cjs.entry.js +122 -44
- package/dist/cjs/attachment-preview_22.cjs.entry.js.map +1 -1
- package/dist/cjs/audio-bubble_4.cjs.entry.js +38 -8
- package/dist/cjs/audio-bubble_4.cjs.entry.js.map +1 -1
- package/dist/cjs/chat-app.cjs.entry.js +2 -2
- package/dist/cjs/chat-app.cjs.entry.js.map +1 -1
- package/dist/cjs/{chat-creds-cf537d4b.js → chat-creds-2dbc4087.js} +3 -3
- package/dist/cjs/chat-creds-2dbc4087.js.map +1 -0
- 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-video-message-bubble.cjs.entry.js +1 -1
- package/dist/cjs/client-80851676.js +482 -0
- package/dist/cjs/client-80851676.js.map +1 -0
- package/dist/cjs/{contracts-31632812.js → contracts-dfc84075.js} +2 -2
- package/dist/cjs/contracts-dfc84075.js.map +1 -0
- package/dist/cjs/destroy-chat-7ae8fc99.js +24 -0
- package/dist/cjs/destroy-chat-7ae8fc99.js.map +1 -0
- package/dist/cjs/doublecheck-c2461adc.js +36 -0
- package/dist/cjs/doublecheck-c2461adc.js.map +1 -0
- package/dist/cjs/{drawer-28cc94a4.js → drawer-811d2ce8.js} +2 -2
- package/dist/cjs/{drawer-28cc94a4.js.map → drawer-811d2ce8.js.map} +1 -1
- package/dist/cjs/forward-memebers.cjs.entry.js +2 -2
- 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-73ad1074.js → group-members-5a82ec8a.js} +1 -125
- package/dist/cjs/group-members-5a82ec8a.js.map +1 -0
- package/dist/cjs/{helpers-8061ec7d.js → helpers-154861e9.js} +2 -2
- package/dist/cjs/{helpers-8061ec7d.js.map → helpers-154861e9.js.map} +1 -1
- package/dist/cjs/{index-1a26d11d.js → index-66f98408.js} +2 -2
- package/dist/cjs/index-66f98408.js.map +1 -0
- package/dist/cjs/index.cjs.js +55 -182
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/isometrik-webchat.cjs.js +10 -2
- package/dist/cjs/isometrik-webchat.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +10 -2
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/login-page_3.cjs.entry.js +708 -376
- package/dist/cjs/login-page_3.cjs.entry.js.map +1 -1
- package/dist/cjs/media-gallery.cjs.entry.js +1 -1
- package/dist/cjs/media-limits-eba42629.js +165 -0
- package/dist/cjs/media-limits-eba42629.js.map +1 -0
- package/dist/cjs/member-add.cjs.entry.js +3 -3
- package/dist/cjs/message-bubble.cjs.entry.js +30 -8
- package/dist/cjs/message-bubble.cjs.entry.js.map +1 -1
- package/dist/cjs/my-component.cjs.entry.js +1 -1
- package/dist/cjs/new-chat-sidebar.cjs.entry.js +2 -2
- package/dist/cjs/reaction-container.cjs.entry.js +4 -4
- package/dist/cjs/runtime-controls-201c71ba.js +650 -0
- package/dist/cjs/runtime-controls-201c71ba.js.map +1 -0
- package/dist/cjs/send-media-14908d4b.js +375 -0
- package/dist/cjs/send-media-14908d4b.js.map +1 -0
- package/dist/cjs/signup-page.cjs.entry.js +1 -1
- package/dist/cjs/{toast-0bf1e688.js → toast-f810e550.js} +8 -8
- package/dist/cjs/toast-f810e550.js.map +1 -0
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/ChatUIComponent/ChatDocumentMessageBubble.js +1 -1
- package/dist/collection/components/ChatUIComponent/ChatImageMessageBubble.js +1 -1
- package/dist/collection/components/ChatUIComponent/ChatVideoMessageBubble.js +1 -1
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js +61 -14
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/ReactionContainer.js +2 -2
- package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js +7 -6
- package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/attachment-preview/attachment-preview.js +39 -8
- package/dist/collection/components/ChatUIComponent/shared/attachment-preview/attachment-preview.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/document-message/document-message.js +53 -3
- 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/image-message/image-message.js +19 -1
- 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/message-bubble/message-bubble.js +47 -7
- package/dist/collection/components/ChatUIComponent/shared/message-bubble/message-bubble.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/message-date-pill/message-date-pill.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/new chat/new-chat.stories.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/outgoing-text-message-bubble/outgoing-text-message-bubble.js +19 -1
- package/dist/collection/components/ChatUIComponent/shared/outgoing-text-message-bubble/outgoing-text-message-bubble.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/reply-message-container/reply-message-container.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/video-message/video-message.js +20 -2
- package/dist/collection/components/ChatUIComponent/shared/video-message/video-message.js.map +1 -1
- package/dist/collection/components/my-component/my-component.js +1 -1
- package/dist/collection/components/my-component/web-chat/FLOW.js +1 -1
- package/dist/collection/components/my-component/web-chat/FLOW.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/WebChat.js +113 -12
- package/dist/collection/components/my-component/web-chat/WebChat.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/bootstrap.js +7 -0
- package/dist/collection/components/my-component/web-chat/bootstrap.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/data-fetch.js +14 -5
- package/dist/collection/components/my-component/web-chat/data-fetch.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/mqtt-host.js +152 -41
- package/dist/collection/components/my-component/web-chat/mqtt-host.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/offline-host.js +212 -0
- package/dist/collection/components/my-component/web-chat/offline-host.js.map +1 -0
- package/dist/collection/components/my-component/web-chat/public-send.js +96 -21
- 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 +47 -28
- package/dist/collection/components/my-component/web-chat/shell-render.js.map +1 -1
- package/dist/collection/components/theme-provider.js +114 -45
- package/dist/collection/components/theme-provider.js.map +1 -1
- package/dist/collection/constants/chat-creds.js +2 -2
- package/dist/collection/demos/custom-ui-demo-elements.js +2 -2
- package/dist/collection/demos/custom-ui-demo-elements.js.map +1 -1
- package/dist/collection/global/expose-sdk.js +29 -0
- package/dist/collection/global/expose-sdk.js.map +1 -0
- package/dist/collection/index.js +10 -141
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/lib/chat/index.js +3 -0
- package/dist/collection/lib/chat/index.js.map +1 -1
- package/dist/collection/lib/chat/media-limits.js +21 -0
- package/dist/collection/lib/chat/media-limits.js.map +1 -0
- package/dist/collection/lib/chat/media-outbox.js +43 -0
- package/dist/collection/lib/chat/media-outbox.js.map +1 -0
- package/dist/collection/lib/chat/preview-kind.js +41 -0
- package/dist/collection/lib/chat/preview-kind.js.map +1 -0
- package/dist/collection/lib/chat/send-media.js +5 -2
- package/dist/collection/lib/chat/send-media.js.map +1 -1
- package/dist/collection/lib/custom-ui/contracts.js +1 -1
- package/dist/collection/lib/custom-ui/contracts.js.map +1 -1
- package/dist/collection/lib/custom-ui/index.js +1 -1
- package/dist/collection/lib/custom-ui/index.js.map +1 -1
- package/dist/collection/lib/custom-ui/public-api.js +1 -0
- package/dist/collection/lib/custom-ui/public-api.js.map +1 -1
- package/dist/collection/lib/destroy-chat.js +15 -16
- package/dist/collection/lib/destroy-chat.js.map +1 -0
- package/dist/collection/lib/mqtt/inbound-queue.js +17 -0
- package/dist/collection/lib/mqtt/inbound-queue.js.map +1 -0
- package/dist/collection/lib/mqtt/index.js +2 -1
- package/dist/collection/lib/mqtt/index.js.map +1 -1
- package/dist/collection/lib/mqtt/session.js +50 -6
- package/dist/collection/lib/mqtt/session.js.map +1 -1
- package/dist/collection/lib/offline/client.js +167 -0
- package/dist/collection/lib/offline/client.js.map +1 -0
- package/dist/collection/lib/offline/idb.js +181 -0
- package/dist/collection/lib/offline/idb.js.map +1 -0
- package/dist/collection/lib/offline/index.js +10 -0
- package/dist/collection/lib/offline/index.js.map +1 -0
- package/dist/collection/lib/offline/memory-db.js +64 -0
- package/dist/collection/lib/offline/memory-db.js.map +1 -0
- package/dist/collection/lib/offline/merge.js +24 -0
- package/dist/collection/lib/offline/merge.js.map +1 -0
- package/dist/collection/lib/offline/multitab.js +47 -0
- package/dist/collection/lib/offline/multitab.js.map +1 -0
- package/dist/collection/lib/offline/types.js +2 -0
- package/dist/collection/lib/offline/types.js.map +1 -0
- package/dist/collection/lib/toast.js +6 -6
- package/dist/collection/lib/toast.js.map +1 -1
- package/dist/collection/sdk/api.js +4 -0
- package/dist/collection/sdk/api.js.map +1 -0
- package/dist/collection/sdk/composition.js +43 -0
- package/dist/collection/sdk/composition.js.map +1 -0
- package/dist/collection/sdk/headless-api.js +37 -0
- package/dist/collection/sdk/headless-api.js.map +1 -0
- package/dist/collection/sdk/index.js +11 -0
- package/dist/collection/sdk/index.js.map +1 -0
- package/dist/collection/sdk/init.js +207 -0
- package/dist/collection/sdk/init.js.map +1 -0
- package/dist/collection/sdk/instance.js +63 -0
- package/dist/collection/sdk/instance.js.map +1 -0
- package/dist/collection/sdk/react-bridge.js +145 -0
- package/dist/collection/sdk/react-bridge.js.map +1 -0
- package/dist/collection/sdk/runtime-controls.js +54 -0
- package/dist/collection/sdk/runtime-controls.js.map +1 -0
- package/dist/collection/sdk/slots.js +57 -0
- package/dist/collection/sdk/slots.js.map +1 -0
- package/dist/collection/sdk/theme-tokens.js +99 -0
- package/dist/collection/sdk/theme-tokens.js.map +1 -0
- package/dist/collection/sdk/webchat-api.js +36 -0
- package/dist/collection/sdk/webchat-api.js.map +1 -0
- package/dist/collection/testing/chat-assets-mock.js +45 -0
- package/dist/collection/testing/chat-creds-mock.js +18 -0
- package/dist/collection/testing/emoji-picker-mock.js +2 -0
- package/dist/collection/testing/file-mock.js +1 -0
- package/dist/collection/testing/groupcast-mock.js +7 -0
- package/dist/collection/testing/helpers-mock.js +4 -0
- package/dist/collection/testing/iso-chat-sdk-mock.js +19 -0
- package/dist/collection/testing/toast-mock.js +2 -0
- package/dist/components/ChatFooter.js +62 -15
- package/dist/components/ChatFooter.js.map +1 -1
- package/dist/components/ChatSidebar.js +1 -1
- package/dist/components/{GroupCast.js → GroupCast2.js} +2 -2
- package/dist/components/GroupCast2.js.map +1 -0
- package/dist/components/WebChat.js +643 -312
- package/dist/components/WebChat.js.map +1 -1
- package/dist/components/WebChatBody.js +8 -7
- package/dist/components/WebChatBody.js.map +1 -1
- package/dist/components/attachment-preview2.js +40 -9
- package/dist/components/attachment-preview2.js.map +1 -1
- package/dist/components/chat-app.js +3 -3
- package/dist/components/chat-app.js.map +1 -1
- package/dist/components/chat-assets.js +1 -1
- package/dist/components/chat-creds.js +2 -2
- package/dist/components/chat-creds.js.map +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-tile2.js +1 -1
- package/dist/components/chat-video-message-bubble.js +1 -1
- package/dist/components/client.js +728 -0
- package/dist/components/client.js.map +1 -0
- package/dist/components/contact-info2.js +2 -117
- package/dist/components/contact-info2.js.map +1 -1
- package/dist/components/contracts.js +1 -1
- package/dist/components/contracts.js.map +1 -1
- package/dist/components/destroy-chat.js +14 -16
- package/dist/components/destroy-chat.js.map +1 -1
- package/dist/components/document-message2.js +35 -5
- package/dist/components/document-message2.js.map +1 -1
- package/dist/components/forward-message.js +2 -2
- package/dist/components/group-cast.js +1 -1
- package/dist/components/{groupcast2.js → groupcast.js} +1 -1
- package/dist/components/groupcast.js.map +1 -0
- package/dist/components/image-message2.js +3 -1
- package/dist/components/image-message2.js.map +1 -1
- package/dist/components/incoming-text-message-bubble2.js +1 -1
- package/dist/components/index.js +551 -60
- package/dist/components/index.js.map +1 -1
- package/dist/components/index2.js +1 -1
- package/dist/components/index2.js.map +1 -1
- package/dist/components/media-limits.js +24 -0
- package/dist/components/media-limits.js.map +1 -0
- package/dist/components/member-add.js +1 -1
- package/dist/components/message-bubble2.js +31 -7
- package/dist/components/message-bubble2.js.map +1 -1
- package/dist/components/message-date-pill2.js +1 -1
- package/dist/components/messages.js +131 -0
- package/dist/components/messages.js.map +1 -0
- package/dist/components/my-component.js +1 -1
- package/dist/components/outgoing-text-message-bubble2.js +3 -1
- package/dist/components/outgoing-text-message-bubble2.js.map +1 -1
- package/dist/components/preview-kind.js +30 -0
- package/dist/components/preview-kind.js.map +1 -0
- package/dist/components/reaction-container.js +2 -2
- package/dist/components/reply-message-container2.js +1 -1
- package/dist/components/theme-provider2.js +56 -44
- package/dist/components/theme-provider2.js.map +1 -1
- package/dist/components/theme-tokens.js +102 -0
- package/dist/components/theme-tokens.js.map +1 -0
- package/dist/components/toast.js +6 -6
- package/dist/components/toast.js.map +1 -1
- package/dist/components/video-message2.js +4 -2
- package/dist/components/video-message2.js.map +1 -1
- package/dist/esm/app-globals-2beecb81.js +36 -0
- package/dist/esm/app-globals-2beecb81.js.map +1 -0
- package/dist/esm/attachment-preview_22.entry.js +120 -42
- package/dist/esm/attachment-preview_22.entry.js.map +1 -1
- package/dist/esm/audio-bubble_4.entry.js +39 -9
- package/dist/esm/audio-bubble_4.entry.js.map +1 -1
- package/dist/esm/chat-app.entry.js +2 -2
- package/dist/esm/chat-app.entry.js.map +1 -1
- package/dist/esm/{chat-assets-e3173222.js → chat-assets-bb056958.js} +2 -2
- package/dist/esm/{chat-assets-e3173222.js.map → chat-assets-bb056958.js.map} +1 -1
- package/dist/esm/{chat-creds-5d0982fc.js → chat-creds-aafad4d0.js} +3 -3
- package/dist/esm/chat-creds-aafad4d0.js.map +1 -0
- 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 +1 -1
- package/dist/esm/chat-video-message-bubble.entry.js +1 -1
- package/dist/esm/client-4a3e00da.js +477 -0
- package/dist/esm/client-4a3e00da.js.map +1 -0
- package/dist/esm/{contracts-614be4db.js → contracts-50f4ddae.js} +2 -2
- package/dist/esm/contracts-50f4ddae.js.map +1 -0
- package/dist/esm/destroy-chat-d0ee28d6.js +22 -0
- package/dist/esm/destroy-chat-d0ee28d6.js.map +1 -0
- package/dist/esm/doublecheck-261763ef.js +32 -0
- package/dist/esm/doublecheck-261763ef.js.map +1 -0
- package/dist/esm/{drawer-8f721119.js → drawer-74c188f1.js} +2 -2
- package/dist/esm/{drawer-8f721119.js.map → drawer-74c188f1.js.map} +1 -1
- package/dist/esm/forward-memebers.entry.js +3 -3
- package/dist/esm/forward-message.entry.js +2 -2
- package/dist/esm/group-chat-contacts.entry.js +2 -2
- package/dist/esm/{group-members-806fd7a2.js → group-members-05414da2.js} +2 -118
- package/dist/esm/group-members-05414da2.js.map +1 -0
- package/dist/esm/{groupcast-2ce7187f.js → groupcast-9c7d2a32.js} +2 -2
- package/dist/esm/{groupcast-2ce7187f.js.map → groupcast-9c7d2a32.js.map} +1 -1
- package/dist/esm/{helpers-4c6d09a7.js → helpers-f33b895c.js} +2 -2
- package/dist/esm/{helpers-4c6d09a7.js.map → helpers-f33b895c.js.map} +1 -1
- package/dist/esm/{index-beb184c6.js → index-4c865e34.js} +2 -2
- package/dist/esm/index-4c865e34.js.map +1 -0
- package/dist/esm/index.js +17 -171
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/isometrik-webchat.js +10 -2
- package/dist/esm/isometrik-webchat.js.map +1 -1
- package/dist/esm/loader.js +10 -2
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/login-page_3.entry.js +691 -359
- package/dist/esm/login-page_3.entry.js.map +1 -1
- package/dist/esm/media-gallery.entry.js +1 -1
- package/dist/esm/media-limits-3fa07c09.js +152 -0
- package/dist/esm/media-limits-3fa07c09.js.map +1 -0
- package/dist/esm/member-add.entry.js +5 -5
- package/dist/esm/message-bubble.entry.js +30 -8
- package/dist/esm/message-bubble.entry.js.map +1 -1
- package/dist/esm/my-component.entry.js +1 -1
- package/dist/esm/new-chat-sidebar.entry.js +3 -3
- package/dist/esm/reaction-container.entry.js +4 -4
- package/dist/esm/runtime-controls-cf599fe2.js +623 -0
- package/dist/esm/runtime-controls-cf599fe2.js.map +1 -0
- package/dist/esm/send-media-917dcc2f.js +353 -0
- package/dist/esm/send-media-917dcc2f.js.map +1 -0
- package/dist/esm/signup-page.entry.js +1 -1
- package/dist/esm/{toast-d8ea763c.js → toast-533dd183.js} +8 -8
- package/dist/esm/toast-533dd183.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.css +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-0731d488.js +2 -0
- package/dist/isometrik-webchat/p-0731d488.js.map +1 -0
- package/dist/isometrik-webchat/{p-a15092d9.entry.js → p-1854b156.entry.js} +2 -2
- package/dist/isometrik-webchat/p-1854b156.entry.js.map +1 -0
- package/dist/isometrik-webchat/{p-5fea3fd2.entry.js → p-2d3e8cd4.entry.js} +2 -2
- package/dist/isometrik-webchat/p-315eee9a.js +2 -0
- package/dist/isometrik-webchat/p-315eee9a.js.map +1 -0
- package/dist/isometrik-webchat/{p-e7f58d3f.entry.js → p-39b626ed.entry.js} +2 -2
- package/dist/isometrik-webchat/{p-eb1f3118.entry.js → p-3c70c22c.entry.js} +2 -2
- package/dist/isometrik-webchat/p-4cb54460.js +2 -0
- package/dist/isometrik-webchat/p-4cb54460.js.map +1 -0
- package/dist/isometrik-webchat/{p-f24cdbbb.js → p-5162774c.js} +1 -1
- package/dist/isometrik-webchat/p-5162774c.js.map +1 -0
- package/dist/isometrik-webchat/p-53ee98a7.entry.js +2 -0
- package/dist/isometrik-webchat/p-53ee98a7.entry.js.map +1 -0
- package/dist/isometrik-webchat/{p-5cbc1a16.entry.js → p-586f6978.entry.js} +2 -2
- package/dist/isometrik-webchat/{p-5f7eebbf.entry.js → p-5d243250.entry.js} +2 -2
- package/dist/isometrik-webchat/{p-23df1c24.js → p-5d98a8a0.js} +2 -2
- package/dist/isometrik-webchat/p-7f415f28.js +2 -0
- package/dist/isometrik-webchat/p-7f415f28.js.map +1 -0
- package/dist/isometrik-webchat/{p-d386acfe.js → p-7fd2c1ad.js} +1 -1
- package/dist/isometrik-webchat/p-7fd2c1ad.js.map +1 -0
- package/dist/isometrik-webchat/{p-e5884258.js → p-9982fa21.js} +2 -2
- package/dist/isometrik-webchat/{p-4db39c93.js → p-a5707f12.js} +2 -2
- package/dist/isometrik-webchat/{p-af775c83.entry.js → p-a876991d.entry.js} +2 -2
- package/dist/isometrik-webchat/{p-7b80b0b2.js → p-adc45831.js} +1 -1
- package/dist/isometrik-webchat/p-adc45831.js.map +1 -0
- package/dist/isometrik-webchat/p-ae168135.js +2 -0
- package/dist/isometrik-webchat/p-ae168135.js.map +1 -0
- package/dist/isometrik-webchat/{p-a6897edc.js → p-b1330793.js} +1 -1
- package/dist/isometrik-webchat/p-b1330793.js.map +1 -0
- package/dist/isometrik-webchat/p-b61d6c0c.entry.js +2 -0
- package/dist/isometrik-webchat/p-b61d6c0c.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-b667a9fc.js +2 -0
- package/dist/isometrik-webchat/p-b667a9fc.js.map +1 -0
- package/dist/isometrik-webchat/p-b857775d.entry.js +2 -0
- package/dist/isometrik-webchat/p-bdcdf1c5.js +2 -0
- package/dist/isometrik-webchat/p-bdcdf1c5.js.map +1 -0
- package/dist/isometrik-webchat/p-c0c19621.entry.js +2 -0
- package/dist/isometrik-webchat/{p-064d6200.entry.js → p-ca47d693.entry.js} +2 -2
- package/dist/isometrik-webchat/p-d720cf14.entry.js +2 -0
- package/dist/isometrik-webchat/{p-53695fc6.entry.js.map → p-d720cf14.entry.js.map} +1 -1
- package/dist/isometrik-webchat/{p-5c22ee37.entry.js → p-d892b4d4.entry.js} +2 -2
- package/dist/isometrik-webchat/{p-7eb12da3.js → p-dd62bd69.js} +2 -2
- package/dist/isometrik-webchat/p-eb54f75d.js +2 -0
- package/dist/isometrik-webchat/p-eb54f75d.js.map +1 -0
- package/dist/isometrik-webchat/p-f1fbf3be.entry.js +2 -0
- package/dist/isometrik-webchat/p-f1fbf3be.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-fb705915.entry.js +2 -0
- package/dist/isometrik-webchat/p-fb705915.entry.js.map +1 -0
- package/dist/isometrik-webchat/{p-2f6bb0a4.entry.js → p-fd6ce589.entry.js} +2 -2
- package/dist/isometrik-webchat/p-fdd327f5.entry.js +2 -0
- package/dist/types/components/ChatUIComponent/Footer/ChatFooter.d.ts +1 -0
- package/dist/types/components/ChatUIComponent/shared/attachment-preview/attachment-preview.d.ts +2 -0
- package/dist/types/components/ChatUIComponent/shared/document-message/document-message.d.ts +5 -0
- package/dist/types/components/ChatUIComponent/shared/image-message/image-message.d.ts +1 -0
- package/dist/types/components/ChatUIComponent/shared/message-bubble/message-bubble.d.ts +3 -0
- package/dist/types/components/ChatUIComponent/shared/outgoing-text-message-bubble/outgoing-text-message-bubble.d.ts +1 -0
- package/dist/types/components/ChatUIComponent/shared/video-message/video-message.d.ts +1 -0
- package/dist/types/components/my-component/web-chat/FLOW.d.ts +1 -1
- package/dist/types/components/my-component/web-chat/mqtt-host.d.ts +13 -0
- package/dist/types/components/my-component/web-chat/offline-host.d.ts +22 -0
- package/dist/types/components/theme-provider.d.ts +22 -27
- package/dist/types/components.d.ts +84 -11
- package/dist/types/demos/custom-ui-demo-elements.d.ts +1 -1
- package/dist/types/global/expose-sdk.d.ts +1 -0
- package/dist/types/index.d.ts +3 -44
- package/dist/types/lib/chat/index.d.ts +3 -0
- package/dist/types/lib/chat/media-limits.d.ts +11 -0
- package/dist/types/lib/chat/media-outbox.d.ts +8 -0
- package/dist/types/lib/chat/preview-kind.d.ts +30 -0
- package/dist/types/lib/custom-ui/contracts.d.ts +1 -1
- package/dist/types/lib/custom-ui/index.d.ts +1 -1
- package/dist/types/lib/custom-ui/public-api.d.ts +1 -1
- package/dist/types/lib/destroy-chat.d.ts +2 -0
- package/dist/types/lib/mqtt/inbound-queue.d.ts +7 -0
- package/dist/types/lib/mqtt/index.d.ts +2 -1
- package/dist/types/lib/mqtt/session.d.ts +22 -0
- package/dist/types/lib/offline/client.d.ts +44 -0
- package/dist/types/lib/offline/idb.d.ts +36 -0
- package/dist/types/lib/offline/index.d.ts +10 -0
- package/dist/types/lib/offline/memory-db.d.ts +20 -0
- package/dist/types/lib/offline/merge.d.ts +3 -0
- package/dist/types/lib/offline/multitab.d.ts +13 -0
- package/dist/types/lib/offline/types.d.ts +63 -0
- package/dist/types/sdk/api.d.ts +3 -0
- package/dist/types/sdk/composition.d.ts +32 -0
- package/dist/types/sdk/headless-api.d.ts +37 -0
- package/dist/types/sdk/index.d.ts +10 -0
- package/dist/types/sdk/init.d.ts +87 -0
- package/dist/types/sdk/instance.d.ts +15 -0
- package/dist/types/sdk/react-bridge.d.ts +64 -0
- package/dist/types/sdk/runtime-controls.d.ts +14 -0
- package/dist/types/sdk/slots.d.ts +15 -0
- package/dist/types/sdk/theme-tokens.d.ts +22 -0
- package/dist/types/sdk/webchat-api.d.ts +22 -0
- package/docs/ARCHITECTURE.md +272 -0
- package/docs/CUSTOMIZATION.md +236 -0
- package/docs/INTEGRATION.md +286 -0
- package/docs/RELIABILITY.md +51 -0
- package/docs/theme-tokens.template.css +72 -0
- package/package.json +8 -2
- package/readme.md +38 -17
- package/dist/cjs/app-globals-3a1e7e63.js +0 -7
- package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
- package/dist/cjs/chat-creds-cf537d4b.js.map +0 -1
- package/dist/cjs/contracts-31632812.js.map +0 -1
- package/dist/cjs/destroy-chat-be25dec7.js +0 -26
- package/dist/cjs/destroy-chat-be25dec7.js.map +0 -1
- package/dist/cjs/doublecheck-997afc94.js +0 -7
- package/dist/cjs/doublecheck-997afc94.js.map +0 -1
- package/dist/cjs/group-members-73ad1074.js.map +0 -1
- package/dist/cjs/index-1a26d11d.js.map +0 -1
- package/dist/cjs/toast-0bf1e688.js.map +0 -1
- package/dist/components/GroupCast.js.map +0 -1
- package/dist/components/groupcast2.js.map +0 -1
- package/dist/esm/app-globals-0f993ce5.js +0 -5
- package/dist/esm/app-globals-0f993ce5.js.map +0 -1
- package/dist/esm/chat-creds-5d0982fc.js.map +0 -1
- package/dist/esm/contracts-614be4db.js.map +0 -1
- package/dist/esm/destroy-chat-e2ebe165.js +0 -24
- package/dist/esm/destroy-chat-e2ebe165.js.map +0 -1
- package/dist/esm/doublecheck-5e208ef0.js +0 -5
- package/dist/esm/doublecheck-5e208ef0.js.map +0 -1
- package/dist/esm/group-members-806fd7a2.js.map +0 -1
- package/dist/esm/index-beb184c6.js.map +0 -1
- package/dist/esm/toast-d8ea763c.js.map +0 -1
- package/dist/isometrik-webchat/p-01fd0eb4.entry.js +0 -2
- package/dist/isometrik-webchat/p-01fd0eb4.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-09fc122b.entry.js +0 -2
- package/dist/isometrik-webchat/p-09fc122b.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-1c53e658.js +0 -2
- package/dist/isometrik-webchat/p-1c53e658.js.map +0 -1
- package/dist/isometrik-webchat/p-1df58381.entry.js +0 -2
- package/dist/isometrik-webchat/p-1df58381.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-3c690532.entry.js +0 -2
- package/dist/isometrik-webchat/p-3c690532.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-3c8cbd5f.js +0 -2
- package/dist/isometrik-webchat/p-3c8cbd5f.js.map +0 -1
- package/dist/isometrik-webchat/p-4e762019.js +0 -2
- package/dist/isometrik-webchat/p-4e762019.js.map +0 -1
- package/dist/isometrik-webchat/p-53695fc6.entry.js +0 -2
- package/dist/isometrik-webchat/p-7b80b0b2.js.map +0 -1
- package/dist/isometrik-webchat/p-9924b1bf.entry.js +0 -2
- package/dist/isometrik-webchat/p-a15092d9.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-a6897edc.js.map +0 -1
- package/dist/isometrik-webchat/p-b2bf55b1.entry.js +0 -2
- package/dist/isometrik-webchat/p-bfecfa97.entry.js +0 -2
- package/dist/isometrik-webchat/p-d386acfe.js.map +0 -1
- package/dist/isometrik-webchat/p-e1255160.js +0 -2
- package/dist/isometrik-webchat/p-e1255160.js.map +0 -1
- package/dist/isometrik-webchat/p-f24cdbbb.js.map +0 -1
- /package/dist/isometrik-webchat/{p-5fea3fd2.entry.js.map → p-2d3e8cd4.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-e7f58d3f.entry.js.map → p-39b626ed.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-eb1f3118.entry.js.map → p-3c70c22c.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-5cbc1a16.entry.js.map → p-586f6978.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-5f7eebbf.entry.js.map → p-5d243250.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-23df1c24.js.map → p-5d98a8a0.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-e5884258.js.map → p-9982fa21.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-4db39c93.js.map → p-a5707f12.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-af775c83.entry.js.map → p-a876991d.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-bfecfa97.entry.js.map → p-b857775d.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-9924b1bf.entry.js.map → p-c0c19621.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-064d6200.entry.js.map → p-ca47d693.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-5c22ee37.entry.js.map → p-d892b4d4.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-7eb12da3.js.map → p-dd62bd69.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-2f6bb0a4.entry.js.map → p-fd6ce589.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-b2bf55b1.entry.js.map → p-fdd327f5.entry.js.map} +0 -0
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const M="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02LjAwMDA0IDE2LjI5MjlMMTUuNjQ2NSA2LjY0NjQ1TDE2LjM1MzYgNy4zNTM1Nkw2LjM1MzU5IDE3LjM1MzZDNi4yNTk4MiAxNy40NDczIDYuMTMyNjUgMTcuNSA2LjAwMDA0IDE3LjVDNS44Njc0MyAxNy41IDUuNzQwMjUgMTcuNDQ3MyA1LjY0NjQ4IDE3LjM1MzZMMS42NDY0OCAxMy4zNTM2TDIuMzUzNTkgMTIuNjQ2NUw2LjAwMDA0IDE2LjI5MjlaIiBmaWxsPSJjdXJyZW50Q29sb3IiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEyLjAwMDQgMTYuMjkzTDIxLjY0NjQgNi42NDY0N0wyMi4zNTM1IDcuMzUzNTZMMTIuMzU0IDE3LjM1MzZDMTIuMTU4NyAxNy41NDg4IDExLjg0MjIgMTcuNTQ4OCAxMS42NDY5IDE3LjM1MzZMMTAuMTQ2NSAxNS44NTM2TDEwLjg1MzUgMTUuMTQ2NEwxMi4wMDA0IDE2LjI5M1oiIGZpbGw9ImN1cnJlbnRDb2xvciIvPjwvc3ZnPgo=";const N=M;export{N as D};
|
|
2
|
-
//# sourceMappingURL=p-1c53e658.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["doublecheckSvg","DoubleCheck"],"sources":["src/assets/svg/doublecheck.svg"],"sourcesContent":["<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\"><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M6.00004 16.2929L15.6465 6.64645L16.3536 7.35356L6.35359 17.3536C6.25982 17.4473 6.13265 17.5 6.00004 17.5C5.86743 17.5 5.74025 17.4473 5.64648 17.3536L1.64648 13.3536L2.35359 12.6465L6.00004 16.2929Z\" fill=\"currentColor\"/><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M12.0004 16.293L21.6464 6.64647L22.3535 7.35356L12.354 17.3536C12.1587 17.5488 11.8422 17.5488 11.6469 17.3536L10.1465 15.8536L10.8535 15.1464L12.0004 16.293Z\" fill=\"currentColor\"/></svg>\n"],"mappings":"AAAA,MAAMA,EAAiB,qyBAAqyB,MAAAC,EAAeD,S","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as a,a as t,h as s}from"./p-17a96a2a.js";import{D as e}from"./p-1c53e658.js";const i="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik05LjAwMDA0IDE2LjI5MjlMMTguNjQ2NSA2LjY0NjQ1TDE5LjM1MzYgNy4zNTM1Nkw5LjM1MzU5IDE3LjM1MzZDOS4yNTk4MiAxNy40NDczIDkuMTMyNjUgMTcuNSA5LjAwMDA0IDE3LjVDOC44Njc0MyAxNy41IDguNzQwMjUgMTcuNDQ3MyA4LjY0NjQ4IDE3LjM1MzZMNC42NDY0OCAxMy4zNTM2TDUuMzUzNTkgMTIuNjQ2NUw5LjAwMDA0IDE2LjI5MjlaIiBmaWxsPSJjdXJyZW50Q29sb3IiLz48L3N2Zz4K";const n=i;const r=class{constructor(s){a(this,s);this.reactionAdded=t(this,"reaction-added",7);this.reactionRemoved=t(this,"reaction-removed",7);this.onReactionClick=a=>{var t,s;const e=((t=this.reactions)===null||t===void 0?void 0:t[a])||[];const i=Array.isArray(e)&&e.includes((s=this.userMetaData)===null||s===void 0?void 0:s.userId);const n={messageId:this.messageId,emojiId:a};if(i)this.reactionRemoved.emit(n);else this.reactionAdded.emit(n);this.showEmojiPicker=false};this.isSelf=false;this.time=undefined;this.timeColor="var(--text-secondary)";this.isRead=false;this.isDelivered=undefined;this.reactions={};this.messageId=undefined;this.userMetaData=undefined;this.showReactionOnHover=false;this.isForwarded=false;this.backgroundColor=undefined;this.borderRadius="var(--rounded-12)";this.padding="var(--space-8) var(--space-12)";this.showReactionButton=false;this.showEmojiPicker=false}formatTime(a){if(a===null||a===undefined||a==="")return"";const t=new Date(Number(a));if(Number.isNaN(t.getTime()))return String(a);return new Intl.DateTimeFormat("en-US",{hour:"2-digit",minute:"2-digit",hour12:true}).format(t)}ticksIcon(a=false){return s("span",{class:{tick:true,read:a},style:{["--tick-mask"]:`url(${e})`}})}renderTicks(){if(!this.isSelf)return null;if(this.isRead===true)return this.ticksIcon(true);if(this.isDelivered===true||this.isDelivered==="true")return this.ticksIcon(false);if(this.isDelivered==="pending")return s("span",{class:"tick",style:{background:"none",WebkitMask:"none",mask:"none"}},"⏱");return s("span",{class:"tick",style:{["--tick-mask"]:`url(${n})`}})}renderReactions(){const a=Object.keys(this.reactions||{}).map((a=>({emojiId:a,users:this.reactions[a]}))).filter((a=>Array.isArray(a.users)&&a.users.length>0));if(!a.length)return null;const t=a.slice(0,2);const e=a.length>2?a.length-2:0;return s("div",{class:"reactions-display"},t.map((a=>s("span",{class:"reaction-item",onClick:()=>this.onReactionClick(a.emojiId)},a.emojiId," ",a.users.length))),e>0?s("span",{class:"reaction-item"},"+",e):null)}render(){const a=this.showReactionOnHover&&(this.showReactionButton||this.showEmojiPicker);return s("div",{key:"d57a8a9356d543f53848914920abfc2b5713208a",class:{"message-container":true,self:!!this.isSelf},style:{["--mb-bg"]:this.backgroundColor||"var(--bg-secondary)",["--mb-radius"]:this.borderRadius||"var(--rounded-12)",["--mb-padding"]:this.padding||"var(--space-8) var(--space-12)",["--time-color"]:this.timeColor||"var(--text-secondary)"},onMouseEnter:()=>{if(this.showReactionOnHover)this.showReactionButton=true},onMouseLeave:()=>{this.showReactionButton=false}},this.isForwarded?s("div",{class:"forwarded"},"Forwarded"):null,a?s("div",{class:"reactions-display"},s("span",{class:"reaction-item",onClick:()=>this.showEmojiPicker=!this.showEmojiPicker},"🙂"),this.showEmojiPicker?["👍","❤️","😂","😮","😢"].map((a=>s("span",{class:"reaction-item",onClick:()=>this.onReactionClick(a)},a))):null):null,s("div",{key:"d6c6625563f87d2b9974c0e563619acbd01885c1",class:"body-slot"},s("slot",{key:"9cd881873170ea093a9a8238b55506eba239fdba"})),this.renderReactions(),s("div",{key:"e4fb2d70459ed362c4abcac7a0b7e949583caa41",class:"time-stamp-container"},s("span",{key:"fa2a86208c52df88a89edee55c685a9367149f05"},this.formatTime(this.time)),this.renderTicks()))}};r.style=":host { display: block; max-width: var(--w-full); font-family: var(--font-primary); }\n .message-container {\n position: relative;\n display: flex;\n flex-direction: column;\n gap: var(--gap-4);\n padding: var(--mb-padding);\n border-radius: var(--mb-radius);\n background: var(--mb-bg);\n }\n .message-container.self { align-items: stretch; }\n .forwarded { font-size: var(--text-10); opacity: 0.7; color: var(--text-secondary); }\n .reactions-display { display: flex; gap: var(--gap-4); flex-wrap: wrap; margin-top: var(--gap-4); }\n .reaction-item {\n cursor: pointer; font-size: var(--text-14);\n background: var(--bg-tertiary);\n border-radius: var(--rounded-10); padding: var(--gap-2) var(--gap-6);\n }\n .time-stamp-container {\n display: flex; align-items: center; gap: var(--gap-4);\n justify-content: flex-end; margin-top: var(--gap-2);\n font-size: var(--text-10); color: var(--time-color);\n white-space: nowrap;\n }\n .tick {\n display: inline-block;\n width: var(--text-18);\n height: var(--text-18);\n flex-shrink: 0;\n background-color: var(--text-tertiary);\n -webkit-mask: var(--tick-mask) center / contain no-repeat;\n mask: var(--tick-mask) center / contain no-repeat;\n }\n .tick.read { background-color: var(--brand); }\n .body-slot { width: var(--w-full); }";export{r as message_bubble};
|
|
2
|
-
//# sourceMappingURL=p-1df58381.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["singlecheckSvg","SingleCheck","MessageBubble","this","onReactionClick","emojiId","users","_a","reactions","already","Array","isArray","includes","_b","userMetaData","userId","detail","messageId","reactionRemoved","emit","reactionAdded","showEmojiPicker","formatTime","value","undefined","d","Date","Number","isNaN","getTime","String","Intl","DateTimeFormat","hour","minute","hour12","format","ticksIcon","read","h","class","tick","style","DoubleCheck","renderTicks","isSelf","isRead","isDelivered","background","WebkitMask","mask","renderReactions","entries","Object","keys","map","filter","r","length","visible","slice","remaining","onClick","render","showActions","showReactionOnHover","showReactionButton","key","self","backgroundColor","borderRadius","padding","timeColor","onMouseEnter","onMouseLeave","isForwarded","e","time"],"sources":["src/assets/svg/singlecheck.svg","src/components/ChatUIComponent/shared/message-bubble/message-bubble.tsx"],"sourcesContent":["<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\"><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M9.00004 16.2929L18.6465 6.64645L19.3536 7.35356L9.35359 17.3536C9.25982 17.4473 9.13265 17.5 9.00004 17.5C8.86743 17.5 8.74025 17.4473 8.64648 17.3536L4.64648 13.3536L5.35359 12.6465L9.00004 16.2929Z\" fill=\"currentColor\"/></svg>\n","import { Component, Prop, h, Event, EventEmitter, State } from '@stencil/core';\nimport DoubleCheck from '../../../../assets/svg/doublecheck.svg';\nimport SingleCheck from '../../../../assets/svg/singlecheck.svg';\n\n/**\n * Shared message chrome (Stencil) — timestamp, delivery ticks, reactions, forward badge.\n * Body via default slot.\n */\n@Component({\n tag: 'message-bubble',\n shadow: true,\n styles: `\n :host { display: block; max-width: var(--w-full); font-family: var(--font-primary); }\n .message-container {\n position: relative;\n display: flex;\n flex-direction: column;\n gap: var(--gap-4);\n padding: var(--mb-padding);\n border-radius: var(--mb-radius);\n background: var(--mb-bg);\n }\n .message-container.self { align-items: stretch; }\n .forwarded { font-size: var(--text-10); opacity: 0.7; color: var(--text-secondary); }\n .reactions-display { display: flex; gap: var(--gap-4); flex-wrap: wrap; margin-top: var(--gap-4); }\n .reaction-item {\n cursor: pointer; font-size: var(--text-14);\n background: var(--bg-tertiary);\n border-radius: var(--rounded-10); padding: var(--gap-2) var(--gap-6);\n }\n .time-stamp-container {\n display: flex; align-items: center; gap: var(--gap-4);\n justify-content: flex-end; margin-top: var(--gap-2);\n font-size: var(--text-10); color: var(--time-color);\n white-space: nowrap;\n }\n .tick {\n display: inline-block;\n width: var(--text-18);\n height: var(--text-18);\n flex-shrink: 0;\n background-color: var(--text-tertiary);\n -webkit-mask: var(--tick-mask) center / contain no-repeat;\n mask: var(--tick-mask) center / contain no-repeat;\n }\n .tick.read { background-color: var(--brand); }\n .body-slot { width: var(--w-full); }\n `,\n})\nexport class MessageBubble {\n @Prop() isSelf: boolean = false;\n @Prop() time: string;\n @Prop() timeColor: string = 'var(--text-secondary)';\n @Prop() isRead: boolean = false;\n @Prop() isDelivered: string | boolean;\n @Prop() reactions: Record<string, string[]> = {};\n @Prop() messageId: string;\n @Prop() userMetaData: any;\n @Prop() showReactionOnHover: boolean = false;\n @Prop() isForwarded: boolean = false;\n @Prop() backgroundColor: string;\n @Prop() borderRadius: string = 'var(--rounded-12)';\n @Prop() padding: string = 'var(--space-8) var(--space-12)';\n\n @Event({ eventName: 'reaction-added', bubbles: true, composed: true })\n reactionAdded: EventEmitter<{ messageId: string; emojiId: string }>;\n\n @Event({ eventName: 'reaction-removed', bubbles: true, composed: true })\n reactionRemoved: EventEmitter<{ messageId: string; emojiId: string }>;\n\n @State() private showReactionButton = false;\n @State() private showEmojiPicker = false;\n\n private formatTime(value: string | number) {\n if (value === null || value === undefined || value === '') return '';\n // sentAt is unix ms; Number(\"1789…\") works, new Date(\"1789…\") does not\n const d = new Date(Number(value));\n if (Number.isNaN(d.getTime())) return String(value);\n return new Intl.DateTimeFormat('en-US', {\n hour: '2-digit',\n minute: '2-digit',\n hour12: true,\n }).format(d);\n }\n\n private onReactionClick = (emojiId: string) => {\n const users = this.reactions?.[emojiId] || [];\n const already = Array.isArray(users) && users.includes(this.userMetaData?.userId);\n const detail = { messageId: this.messageId, emojiId };\n if (already) this.reactionRemoved.emit(detail);\n else this.reactionAdded.emit(detail);\n this.showEmojiPicker = false;\n };\n\n private ticksIcon(read = false) {\n return (\n <span\n class={{ tick: true, read }}\n style={{ ['--tick-mask' as any]: `url(${DoubleCheck})` }}\n />\n );\n }\n\n private renderTicks() {\n if (!this.isSelf) return null;\n if (this.isRead === true) return this.ticksIcon(true);\n if (this.isDelivered === true || this.isDelivered === 'true') return this.ticksIcon(false);\n if (this.isDelivered === 'pending') return <span class=\"tick\" style={{ background: 'none', WebkitMask: 'none', mask: 'none' } as any}>⏱</span>;\n return <span class=\"tick\" style={{ ['--tick-mask' as any]: `url(${SingleCheck})` }} />;\n }\n\n private renderReactions() {\n const entries = Object.keys(this.reactions || {})\n .map(emojiId => ({ emojiId, users: this.reactions[emojiId] }))\n .filter(r => Array.isArray(r.users) && r.users.length > 0);\n if (!entries.length) return null;\n const visible = entries.slice(0, 2);\n const remaining = entries.length > 2 ? entries.length - 2 : 0;\n return (\n <div class=\"reactions-display\">\n {visible.map(r => (\n <span class=\"reaction-item\" onClick={() => this.onReactionClick(r.emojiId)}>\n {r.emojiId} {r.users.length}\n </span>\n ))}\n {remaining > 0 ? <span class=\"reaction-item\">+{remaining}</span> : null}\n </div>\n );\n }\n\n render() {\n const showActions = this.showReactionOnHover && (this.showReactionButton || this.showEmojiPicker);\n return (\n <div\n class={{ 'message-container': true, self: !!this.isSelf }}\n style={{\n ['--mb-bg' as any]: this.backgroundColor || 'var(--bg-secondary)',\n ['--mb-radius' as any]: this.borderRadius || 'var(--rounded-12)',\n ['--mb-padding' as any]: this.padding || 'var(--space-8) var(--space-12)',\n ['--time-color' as any]: this.timeColor || 'var(--text-secondary)',\n\n }}\n onMouseEnter={() => {\n if (this.showReactionOnHover) this.showReactionButton = true;\n }}\n onMouseLeave={() => {\n this.showReactionButton = false;\n }}\n >\n {this.isForwarded ? <div class=\"forwarded\">Forwarded</div> : null}\n {showActions ? (\n <div class=\"reactions-display\">\n <span class=\"reaction-item\" onClick={() => (this.showEmojiPicker = !this.showEmojiPicker)}>\n 🙂\n </span>\n {this.showEmojiPicker\n ? ['👍', '❤️', '😂', '😮', '😢'].map(e => (\n <span class=\"reaction-item\" onClick={() => this.onReactionClick(e)}>\n {e}\n </span>\n ))\n : null}\n </div>\n ) : null}\n <div class=\"body-slot\">\n <slot />\n </div>\n {this.renderReactions()}\n <div class=\"time-stamp-container\">\n <span>{this.formatTime(this.time)}</span>\n {this.renderTicks()}\n </div>\n </div>\n );\n }\n}\n"],"mappings":"sFAAA,MAAMA,EAAiB,ifAAif,MAAAC,EAAeD,E,MCiD1gBE,EAAa,M,yHAoChBC,KAAAC,gBAAmBC,I,QACzB,MAAMC,IAAQC,EAAAJ,KAAKK,aAAS,MAAAD,SAAA,SAAAA,EAAGF,KAAY,GAC3C,MAAMI,EAAUC,MAAMC,QAAQL,IAAUA,EAAMM,UAASC,EAAAV,KAAKW,gBAAY,MAAAD,SAAA,SAAAA,EAAEE,QAC1E,MAAMC,EAAS,CAAEC,UAAWd,KAAKc,UAAWZ,WAC5C,GAAII,EAASN,KAAKe,gBAAgBC,KAAKH,QAClCb,KAAKiB,cAAcD,KAAKH,GAC7Bb,KAAKkB,gBAAkB,KAAK,E,YAzCJ,M,mCAEE,wB,YACF,M,0CAEoB,G,8EAGP,M,iBACR,M,iDAEA,oB,aACL,iC,wBAQY,M,qBACH,K,CAE3B,UAAAC,CAAWC,GACjB,GAAIA,IAAU,MAAQA,IAAUC,WAAaD,IAAU,GAAI,MAAO,GAElE,MAAME,EAAI,IAAIC,KAAKC,OAAOJ,IAC1B,GAAII,OAAOC,MAAMH,EAAEI,WAAY,OAAOC,OAAOP,GAC7C,OAAO,IAAIQ,KAAKC,eAAe,QAAS,CACtCC,KAAM,UACNC,OAAQ,UACRC,OAAQ,OACPC,OAAOX,E,CAYJ,SAAAY,CAAUC,EAAO,OACvB,OACEC,EAAA,QACEC,MAAO,CAAEC,KAAM,KAAMH,QACrBI,MAAO,CAAE,CAAC,eAAuB,OAAOC,O,CAKtC,WAAAC,GACN,IAAKzC,KAAK0C,OAAQ,OAAO,KACzB,GAAI1C,KAAK2C,SAAW,KAAM,OAAO3C,KAAKkC,UAAU,MAChD,GAAIlC,KAAK4C,cAAgB,MAAQ5C,KAAK4C,cAAgB,OAAQ,OAAO5C,KAAKkC,UAAU,OACpF,GAAIlC,KAAK4C,cAAgB,UAAW,OAAOR,EAAA,QAAMC,MAAM,OAAOE,MAAO,CAAEM,WAAY,OAAQC,WAAY,OAAQC,KAAM,SAAe,KACpI,OAAOX,EAAA,QAAMC,MAAM,OAAOE,MAAO,CAAE,CAAC,eAAuB,OAAOzC,O,CAG5D,eAAAkD,GACN,MAAMC,EAAUC,OAAOC,KAAKnD,KAAKK,WAAa,IAC3C+C,KAAIlD,IAAO,CAAOA,UAASC,MAAOH,KAAKK,UAAUH,OACjDmD,QAAOC,GAAK/C,MAAMC,QAAQ8C,EAAEnD,QAAUmD,EAAEnD,MAAMoD,OAAS,IAC1D,IAAKN,EAAQM,OAAQ,OAAO,KAC5B,MAAMC,EAAUP,EAAQQ,MAAM,EAAG,GACjC,MAAMC,EAAYT,EAAQM,OAAS,EAAIN,EAAQM,OAAS,EAAI,EAC5D,OACEnB,EAAA,OAAKC,MAAM,qBACRmB,EAAQJ,KAAIE,GACXlB,EAAA,QAAMC,MAAM,gBAAgBsB,QAAS,IAAM3D,KAAKC,gBAAgBqD,EAAEpD,UAC/DoD,EAAEpD,QAAO,IAAGoD,EAAEnD,MAAMoD,UAGxBG,EAAY,EAAItB,EAAA,QAAMC,MAAM,iBAAe,IAAGqB,GAAoB,K,CAKzE,MAAAE,GACE,MAAMC,EAAc7D,KAAK8D,sBAAwB9D,KAAK+D,oBAAsB/D,KAAKkB,iBACjF,OACEkB,EAAA,OAAA4B,IAAA,2CACE3B,MAAO,CAAE,oBAAqB,KAAM4B,OAAQjE,KAAK0C,QACjDH,MAAO,CACL,CAAC,WAAmBvC,KAAKkE,iBAAmB,sBAC5C,CAAC,eAAuBlE,KAAKmE,cAAgB,oBAC7C,CAAC,gBAAwBnE,KAAKoE,SAAW,iCACzC,CAAC,gBAAwBpE,KAAKqE,WAAa,yBAG7CC,aAAc,KACZ,GAAItE,KAAK8D,oBAAqB9D,KAAK+D,mBAAqB,IAAI,EAE9DQ,aAAc,KACZvE,KAAK+D,mBAAqB,KAAK,GAGhC/D,KAAKwE,YAAcpC,EAAA,OAAKC,MAAM,aAAW,aAAmB,KAC5DwB,EACCzB,EAAA,OAAKC,MAAM,qBACTD,EAAA,QAAMC,MAAM,gBAAgBsB,QAAS,IAAO3D,KAAKkB,iBAAmBlB,KAAKkB,iBAAgB,MAGxFlB,KAAKkB,gBACF,CAAC,KAAM,KAAM,KAAM,KAAM,MAAMkC,KAAIqB,GACjCrC,EAAA,QAAMC,MAAM,gBAAgBsB,QAAS,IAAM3D,KAAKC,gBAAgBwE,IAC7DA,KAGL,MAEJ,KACJrC,EAAA,OAAA4B,IAAA,2CAAK3B,MAAM,aACTD,EAAA,QAAA4B,IAAA,8CAEDhE,KAAKgD,kBACNZ,EAAA,OAAA4B,IAAA,2CAAK3B,MAAM,wBACTD,EAAA,QAAA4B,IAAA,4CAAOhE,KAAKmB,WAAWnB,KAAK0E,OAC3B1E,KAAKyC,e","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,a as i,h as s,g as e}from"./p-17a96a2a.js";import{h as n}from"./p-e5884258.js";import{r as h,e as r}from"./p-d28c5548.js";import{i as o,j as a,k as c,l}from"./p-4db39c93.js";import"./p-f24cdbbb.js";class u{constructor(){this.listeners={}}on(t,i,s){if(!this.listeners[t]){this.listeners[t]=new Set}if(s===null||s===void 0?void 0:s.once){const s=(...e)=>{this.un(t,s);i(...e)};this.listeners[t].add(s);return()=>this.un(t,s)}this.listeners[t].add(i);return()=>this.un(t,i)}un(t,i){var s;(s=this.listeners[t])===null||s===void 0?void 0:s.delete(i)}once(t,i){return this.on(t,i,{once:true})}unAll(){this.listeners={}}emit(t,...i){if(this.listeners[t]){this.listeners[t].forEach((t=>t(...i)))}}}class d extends u{constructor(t){super();this.subscriptions=[];this.isDestroyed=false;this.options=t}onInit(){return}_init(t){if(this.isDestroyed){this.subscriptions=[];this.isDestroyed=false}this.wavesurfer=t;this.onInit()}destroy(){this.emit("destroy");this.subscriptions.forEach((t=>t()));this.subscriptions=[];this.isDestroyed=true;this.wavesurfer=undefined}}var f=undefined&&undefined.__awaiter||function(t,i,s,e){function n(t){return t instanceof s?t:new s((function(i){i(t)}))}return new(s||(s=Promise))((function(s,h){function r(t){try{a(e.next(t))}catch(t){h(t)}}function o(t){try{a(e["throw"](t))}catch(t){h(t)}}function a(t){t.done?s(t.value):n(t.value).then(r,o)}a((e=e.apply(t,i||[])).next())}))};function v(t,i){return f(this,void 0,void 0,(function*(){const s=new AudioContext({sampleRate:i});try{return yield s.decodeAudioData(t)}finally{if(s.state!=="closed"){yield s.close().catch((()=>undefined))}}}))}function p(t){const i=t[0];if(i.some((t=>t>1||t<-1))){const s=i.length;let e=0;for(let t=0;t<s;t++){const s=Math.abs(i[t]);if(s>e)e=s}for(const i of t){for(let t=0;t<s;t++){i[t]/=e}}}return t}function g(t,i){if(!t||t.length===0){throw new Error("channelData must be a non-empty array")}if(i<=0){throw new Error("duration must be greater than 0")}if(typeof t[0]==="number")t=[t];if(!t[0]||t[0].length===0){throw new Error("channelData must contain non-empty channel arrays")}p(t);const s=t.map((t=>t instanceof Float32Array?t:Float32Array.from(t)));return{duration:i,length:s[0].length,sampleRate:s[0].length/i,numberOfChannels:s.length,getChannelData:t=>{const i=s[t];if(!i){throw new Error(`Channel ${t} not found`)}return i},copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}const m={decode:v,createBuffer:g};function b(t,i){const s=i.xmlns?document.createElementNS(i.xmlns,t):document.createElement(t);for(const[t,e]of Object.entries(i)){if(t==="children"&&e){for(const[t,i]of Object.entries(e)){if(i instanceof Node){s.appendChild(i)}else if(typeof i==="string"){s.appendChild(document.createTextNode(i))}else{s.appendChild(b(t,i))}}}else if(t==="style"){Object.assign(s.style,e)}else if(t==="textContent"){s.textContent=e}else{s.setAttribute(t,e.toString())}}return s}function y(t,i,s){const e=b(t,i||{});s===null||s===void 0?void 0:s.appendChild(e);return e}function M(t){if(t instanceof HTMLElement)return true;return typeof t==="object"&&t!==null&&t.nodeType===Node.ELEMENT_NODE&&typeof t.style==="object"}const x=Object.freeze({__proto__:null,createElement:y,isHTMLElement:M,default:y});var w=undefined&&undefined.__awaiter||function(t,i,s,e){function n(t){return t instanceof s?t:new s((function(i){i(t)}))}return new(s||(s=Promise))((function(s,h){function r(t){try{a(e.next(t))}catch(t){h(t)}}function o(t){try{a(e["throw"](t))}catch(t){h(t)}}function a(t){t.done?s(t.value):n(t.value).then(r,o)}a((e=e.apply(t,i||[])).next())}))};function N(t,i,s){return w(this,void 0,void 0,(function*(){var e;if(!t.body||!t.headers)return;const n=t.body.getReader();const h=Number(t.headers.get("Content-Length"))||0;let r=0;const o=()=>{n.cancel()};if(s){if(s.aborted){n.cancel();return}s.addEventListener("abort",o,{once:true})}try{while(true){const t=yield n.read();if(t.done){break}r+=((e=t.value)===null||e===void 0?void 0:e.length)||0;if(h>0){const t=Math.round(r/h*100);i(t)}}}catch(t){if(t instanceof DOMException&&t.name==="AbortError")return;console.warn("Progress tracking error:",t)}finally{if(s){s.removeEventListener("abort",o)}}}))}function T(t,i,s){return w(this,void 0,void 0,(function*(){var e;const n=yield fetch(t,s);if(n.status>=400){throw new Error(`Failed to fetch ${t}: ${n.status} (${n.statusText})`)}N(n.clone(),i,(e=s===null||s===void 0?void 0:s.signal)!==null&&e!==void 0?e:undefined);return n.blob()}))}const D={fetchBlob:T};function k(t){let i=t;const s=new Set;return{get value(){return i},set(t){if(!Object.is(i,t)){i=t;s.forEach((t=>t(i)))}},update(t){this.set(t(i))},subscribe(t){s.add(t);return()=>s.delete(t)}}}function j(t,i){const s=k(t());i.forEach((i=>i.subscribe((()=>{const i=t();if(!Object.is(s.value,i)){s.set(i)}}))));return{get value(){return s.value},subscribe(t){return s.subscribe(t)}}}function I(t,i){let s;const e=()=>{if(s){s();s=undefined}s=t()};const n=i.map((t=>t.subscribe(e)));e();return()=>{if(s){s();s=undefined}n.forEach((t=>t()))}}var S=undefined&&undefined.__awaiter||function(t,i,s,e){function n(t){return t instanceof s?t:new s((function(i){i(t)}))}return new(s||(s=Promise))((function(s,h){function r(t){try{a(e.next(t))}catch(t){h(t)}}function o(t){try{a(e["throw"](t))}catch(t){h(t)}}function a(t){t.done?s(t.value):n(t.value).then(r,o)}a((e=e.apply(t,i||[])).next())}))};class E extends u{get isPlayingSignal(){return this._isPlaying}get currentTimeSignal(){return this._currentTime}get durationSignal(){return this._duration}get volumeSignal(){return this._volume}get mutedSignal(){return this._muted}get playbackRateSignal(){return this._playbackRate}get seekingSignal(){return this._seeking}constructor(t){super();this.isExternalMedia=false;this._ownBlobUrl=null;this.reactiveMediaEventCleanups=[];if(t.media){this.media=t.media;this.isExternalMedia=true}else{this.media=document.createElement("audio")}this._isPlaying=k(false);this._currentTime=k(0);this._duration=k(0);this._volume=k(this.media.volume);this._muted=k(this.media.muted);this._playbackRate=k(this.media.playbackRate||1);this._seeking=k(false);this.setupReactiveMediaEvents();if(t.mediaControls){this.media.controls=true}if(t.autoplay){this.media.autoplay=true}if(t.playbackRate!=null){this.onMediaEvent("canplay",(()=>{if(t.playbackRate!=null){this.media.playbackRate=t.playbackRate}}),{once:true})}}setupReactiveMediaEvents(){this.reactiveMediaEventCleanups.push(this.onMediaEvent("play",(()=>{this._isPlaying.set(true)})));this.reactiveMediaEventCleanups.push(this.onMediaEvent("pause",(()=>{this._isPlaying.set(false)})));this.reactiveMediaEventCleanups.push(this.onMediaEvent("ended",(()=>{this._isPlaying.set(false)})));this.reactiveMediaEventCleanups.push(this.onMediaEvent("timeupdate",(()=>{this._currentTime.set(this.media.currentTime)})));this.reactiveMediaEventCleanups.push(this.onMediaEvent("durationchange",(()=>{this._duration.set(this.media.duration||0)})));this.reactiveMediaEventCleanups.push(this.onMediaEvent("loadedmetadata",(()=>{this._duration.set(this.media.duration||0)})));this.reactiveMediaEventCleanups.push(this.onMediaEvent("seeking",(()=>{this._seeking.set(true)})));this.reactiveMediaEventCleanups.push(this.onMediaEvent("seeked",(()=>{this._seeking.set(false)})));this.reactiveMediaEventCleanups.push(this.onMediaEvent("volumechange",(()=>{this._volume.set(this.media.volume);this._muted.set(this.media.muted)})));this.reactiveMediaEventCleanups.push(this.onMediaEvent("ratechange",(()=>{this._playbackRate.set(this.media.playbackRate)})))}onMediaEvent(t,i,s){this.media.addEventListener(t,i,s);return()=>this.media.removeEventListener(t,i,s)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){if(this._ownBlobUrl){URL.revokeObjectURL(this._ownBlobUrl);this._ownBlobUrl=null}}canPlayType(t){return this.media.canPlayType(t)!==""}setSrc(t,i){const s=this.getSrc();if(t&&s===t)return;this.revokeSrc();const e=i instanceof Blob&&(this.canPlayType(i.type)||!t)?URL.createObjectURL(i):t;if(e!==t){this._ownBlobUrl=e}if(s){this.media.removeAttribute("src")}if(e||t){try{this.media.src=e}catch(i){this.media.src=t}}}destroy(){this.reactiveMediaEventCleanups.forEach((t=>t()));this.reactiveMediaEventCleanups=[];this.revokeSrc();this.unAll();if(this.isExternalMedia)return;this.media.pause();this.media.removeAttribute("src");this.media.load();this.media.remove()}setMediaElement(t){this.reactiveMediaEventCleanups.forEach((t=>t()));this.reactiveMediaEventCleanups=[];this.media=t;this.setupReactiveMediaEvents()}play(){return S(this,void 0,void 0,(function*(){try{return yield this.media.play()}catch(t){if(t instanceof DOMException&&t.name==="AbortError"){return}throw t}}))}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(t){this.media.currentTime=Math.max(0,Math.min(t,this.getDuration()))}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(t){this.media.volume=t}getMuted(){return this.media.muted}setMuted(t){this.media.muted=t}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(t,i){if(i!=null){this.media.preservesPitch=i}this.media.playbackRate=t}getMediaElement(){return this.media}setSinkId(t){const i=this.media;return i.setSinkId(t)}}const A=128;const C=8e3;const L=10;function z(t){if(t<0)return 0;if(t>1)return 1;return t}function P({width:t,height:i,length:s,options:e,pixelRatio:n}){const h=i/2;const r=e.barWidth?e.barWidth*n:1;const o=e.barGap?e.barGap*n:e.barWidth?r/2:0;const a=e.barRadius||0;const c=e.barMinHeight?e.barMinHeight*n:0;const l=r+o||1;const u=s>0?t/l/s:0;return{halfHeight:h,barWidth:r,barGap:o,barRadius:a,barMinHeight:c,barIndexScale:u,barSpacing:l}}function O({maxTop:t,maxBottom:i,halfHeight:s,vScale:e,barMinHeight:n=0,barAlign:h}){let r=Math.round(t*s*e);const o=Math.round(i*s*e);let a=r+o||1;if(a<n){a=n;if(!h){r=a/2}}return{topHeight:r,totalHeight:a}}function R({barAlign:t,halfHeight:i,topHeight:s,totalHeight:e,canvasHeight:n}){if(t==="top")return 0;if(t==="bottom")return n-e;return i-s}function W({channelData:t,barIndexScale:i,barSpacing:s,barWidth:e,halfHeight:n,vScale:h,canvasHeight:r,barAlign:o,barMinHeight:a}){const c=t[0]||[];const l=t[1]||c;const u=c.length;const d=[];let f=0;let v=0;let p=0;for(let t=0;t<=u;t++){const u=Math.round(t*i);if(u>f){const{topHeight:t,totalHeight:i}=O({maxTop:v,maxBottom:p,halfHeight:n,vScale:h,barMinHeight:a,barAlign:o});const c=R({barAlign:o,halfHeight:n,topHeight:t,totalHeight:i,canvasHeight:r});d.push({x:f*s,y:c,width:e,height:i});f=u;v=0;p=0}const g=Math.abs(c[t]||0);const m=Math.abs(l[t]||0);if(g>v)v=g;if(m>p)p=m}return d}function U(t,i,s){const e=i-t.left;const n=s-t.top;const h=e/t.width;const r=n/t.height;return[h,r]}function H({optionsHeight:t,optionsSplitChannels:i,parentHeight:s,numberOfChannels:e,defaultHeight:n=A}){if(t==null)return n;const h=Number(t);if(!isNaN(h))return h;if(t==="auto"){const t=s||n;if(i===null||i===void 0?void 0:i.every((t=>!t.overlay))){return t/e}return t}return n}function V(t){return Math.max(1,t||1)}function Y(t){return Boolean(t.barWidth||t.barGap||t.barAlign)}function Q(t,i,s){if(!Array.isArray(t))return t||"";if(t.length===0)return"#999";if(t.length<2)return t[0]||"";const e=document.createElement("canvas");const n=e.getContext("2d");if(!n)return t[0]||"";const h=s||e.height*i;const r=n.createLinearGradient(0,0,0,h);const o=1/(t.length-1);t.forEach(((t,i)=>{r.addColorStop(i*o,t)}));return r}function F({duration:t,minPxPerSec:i=0,parentWidth:s,fillParent:e,pixelRatio:n}){const h=Math.ceil(t*i);const r=h>s;const o=Boolean(e&&!r);const a=(o?s:h)*n;return{scrollWidth:h,isScrollable:r,useParentWidth:o,width:a}}function $(t,i){if(!Y(i))return t;const s=i.barWidth||.5;const e=i.barGap||s/2;const n=s+e;if(n===0)return t;return Math.floor(t/n)*n}function B({clientWidth:t,totalWidth:i,options:s}){const e=Math.min(C,t,i);return $(e,s)}function Z({channelData:t,offset:i,clampedWidth:s,totalWidth:e}){return t.map((t=>{const n=Math.floor(i/e*t.length);const h=Math.floor((i+s)/e*t.length);return t.slice(n,h)}))}function _(t){return t>L}function G({scrollLeft:t,totalWidth:i,numCanvases:s}){if(i===0)return[0];const e=t/i;const n=Math.floor(e*s);return[n-1,n,n+1]}function X({channelData:t,barHeight:i,normalize:s,maxPeak:e}){var n;const h=i||1;if(!s)return h;const r=t[0];if(!r||r.length===0)return h;let o=e!==null&&e!==void 0?e:0;if(!e){for(let t=0;t<r.length;t++){const i=(n=r[t])!==null&&n!==void 0?n:0;const s=Math.abs(i);if(s>o)o=s}}if(!o)return h;return h/o}function q({channelData:t,width:i,height:s,vScale:e}){const n=s/2;const h=t[0]||[];const r=t[1]||h;const o=[h,r];return o.map(((t,s)=>{const h=t.length;const r=h?i/h:0;const o=n;const a=s===0?-1:1;const c=[{x:0,y:o}];let l=0;let u=0;for(let i=0;i<=h;i++){const s=Math.round(i*r);if(s>l){const t=Math.round(u*n*e)||1;const i=o+t*a;c.push({x:l,y:i});l=s;u=0}const h=Math.abs(t[i]||0);if(h>u)u=h}c.push({x:l,y:o});return c}))}function J(t){const i=t*2;const s=i<0?Math.floor(i):Math.ceil(i);return s/2}function K(t){const i=t._cleanup;if(typeof i==="function"){i()}}function tt(t,i={}){const{threshold:s=3,mouseButton:e=0,touchDelay:n=100}=i;const h=k(null);const r=new Map;const o=matchMedia("(pointer: coarse)").matches;let a=()=>void 0;const c=i=>{if(i.button!==e)return;if(r.has(i.pointerId))return;r.set(i.pointerId,i);if(r.size>1){return}const c=i.pointerId;let l=i.clientX;let u=i.clientY;let d=false;const f=Date.now();const v=t.getBoundingClientRect();const{left:p,top:g}=v;const m=t=>{if(t.pointerId!==c)return;if(t.defaultPrevented||r.size>1){return}if(o&&Date.now()-f<n)return;const i=t.clientX;const e=t.clientY;const a=i-l;const v=e-u;if(d||Math.abs(a)>s||Math.abs(v)>s){t.preventDefault();t.stopPropagation();if(!d){h.set({type:"start",x:l-p,y:u-g});d=true}h.set({type:"move",x:i-p,y:e-g,deltaX:a,deltaY:v});l=i;u=e}};const b=t=>{if(!r.delete(t.pointerId))return;if(t.pointerId===c&&d){const i=t.clientX;const s=t.clientY;h.set({type:"end",x:i-p,y:s-g})}if(r.size===0){a()}};const y=t=>{if(!t.relatedTarget||t.relatedTarget===document.documentElement){b(t)}};const M=t=>{if(d){t.stopPropagation();t.preventDefault()}};const x=t=>{if(t.defaultPrevented||r.size>1){return}if(d){t.preventDefault()}};document.addEventListener("pointermove",m);document.addEventListener("pointerup",b);document.addEventListener("pointerout",y);document.addEventListener("pointercancel",y);document.addEventListener("touchmove",x,{passive:false});document.addEventListener("click",M,{capture:true});a=()=>{document.removeEventListener("pointermove",m);document.removeEventListener("pointerup",b);document.removeEventListener("pointerout",y);document.removeEventListener("pointercancel",y);document.removeEventListener("touchmove",x);setTimeout((()=>{document.removeEventListener("click",M,{capture:true})}),10)}};t.addEventListener("pointerdown",c);const l=()=>{a();t.removeEventListener("pointerdown",c);r.clear();K(h)};return{signal:h,cleanup:l}}function it(t){const{scrollLeft:i,scrollWidth:s,clientWidth:e}=t;if(s===0){return{startX:0,endX:1}}const n=i/s;const h=(i+e)/s;return{startX:Math.max(0,Math.min(1,n)),endX:Math.max(0,Math.min(1,h))}}function st(t){return{left:t.scrollLeft,right:t.scrollLeft+t.clientWidth}}function et(t){const i=k({scrollLeft:t.scrollLeft,scrollWidth:t.scrollWidth,clientWidth:t.clientWidth});const s=j((()=>it(i.value)),[i]);const e=j((()=>st(i.value)),[i]);const n=()=>{i.set({scrollLeft:t.scrollLeft,scrollWidth:t.scrollWidth,clientWidth:t.clientWidth})};t.addEventListener("scroll",n,{passive:true});const h=()=>{t.removeEventListener("scroll",n);K(i)};return{scrollData:i,percentages:s,bounds:e,cleanup:h}}var nt=undefined&&undefined.__awaiter||function(t,i,s,e){function n(t){return t instanceof s?t:new s((function(i){i(t)}))}return new(s||(s=Promise))((function(s,h){function r(t){try{a(e.next(t))}catch(t){h(t)}}function o(t){try{a(e["throw"](t))}catch(t){h(t)}}function a(t){t.done?s(t.value):n(t.value).then(r,o)}a((e=e.apply(t,i||[])).next())}))};var ht=undefined&&undefined.__rest||function(t,i){var s={};for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&i.indexOf(e)<0)s[e]=t[e];if(t!=null&&typeof Object.getOwnPropertySymbols==="function")for(var n=0,e=Object.getOwnPropertySymbols(t);n<e.length;n++){if(i.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(t,e[n]))s[e[n]]=t[e[n]]}return s};const rt=60;const ot=10;const at=ot*rt;class ct extends u{constructor(t,i){super();this.timeouts=[];this.isScrollable=false;this.audioData=null;this.resizeObserver=null;this.lastContainerWidth=0;this.isDragging=false;this.subscriptions=[];this.unsubscribeOnScroll=[];this.dragStream=null;this.scrollStream=null;this.containerInlinePadding=0;this.onClickWrapper=t=>{const i=this.wrapper.getBoundingClientRect();const[s,e]=U(i,t.clientX,t.clientY);this.emit("click",s,e)};this.onDblClickWrapper=t=>{const i=this.wrapper.getBoundingClientRect();const[s,e]=U(i,t.clientX,t.clientY);this.emit("dblclick",s,e)};this.subscriptions=[];this.options=t;const s=this.parentFromOptionsContainer(t.container);this.parent=s;const[e,n]=this.initHtml();s.appendChild(e);this.container=e;this.scrollContainer=n.querySelector(".scroll");this.wrapper=n.querySelector(".wrapper");this.canvasWrapper=n.querySelector(".canvases");this.progressWrapper=n.querySelector(".progress");this.cursor=n.querySelector(".cursor");this.calculateInlinePadding();if(i){n.appendChild(i)}this.initEvents()}parentFromOptionsContainer(t){let i;if(typeof t==="string"){i=document.querySelector(t)}else if(M(t)){i=t}if(!i){throw new Error("Container not found")}return i}initEvents(){this.wrapper.addEventListener("click",this.onClickWrapper);this.wrapper.addEventListener("dblclick",this.onDblClickWrapper);if(this.options.dragToSeek===true||typeof this.options.dragToSeek==="object"){this.initDrag()}this.scrollStream=et(this.scrollContainer);const t=I((()=>{const{startX:t,endX:i}=this.scrollStream.percentages.value;const{left:s,right:e}=this.scrollStream.bounds.value;this.emit("scroll",t,i,s,e)}),[this.scrollStream.percentages,this.scrollStream.bounds]);this.subscriptions.push(t);if(typeof ResizeObserver==="function"){const t=this.createDelay(100);this.resizeObserver=new ResizeObserver((()=>{t().then((()=>this.onContainerResize())).catch((()=>undefined))}));this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const t=this.parent.clientWidth;this.calculateInlinePadding();if(t===this.lastContainerWidth&&this.options.height!=="auto")return;this.lastContainerWidth=t;this.reRender();this.emit("resize")}initDrag(){if(this.dragStream)return;this.dragStream=tt(this.wrapper);const t=I((()=>{const t=this.dragStream.signal.value;if(!t)return;const i=this.wrapper.getBoundingClientRect().width;const s=z(t.x/i);if(t.type==="start"){this.isDragging=true;this.emit("dragstart",s)}else if(t.type==="move"){this.emit("drag",s)}else if(t.type==="end"){this.isDragging=false;this.emit("dragend",s)}}),[this.dragStream.signal]);this.subscriptions.push(t)}calculateInlinePadding(){const{paddingLeft:t,paddingRight:i}=getComputedStyle(this.scrollContainer);const s=parseFloat(t)+parseFloat(i);this.containerInlinePadding=Number.isNaN(s)?0:s}initHtml(){const t=document.createElement("div");const i=t.attachShadow({mode:"open"});const s=this.options.cspNonce&&typeof this.options.cspNonce==="string"?this.options.cspNonce.replace(/"/g,""):"";i.innerHTML=`\n <style${s?` nonce="${s}"`:""}>\n :host {\n user-select: none;\n min-width: 1px;\n }\n :host audio {\n display: block;\n width: 100%;\n }\n :host .scroll {\n overflow-x: auto;\n overflow-y: hidden;\n width: 100%;\n position: relative;\n }\n :host .noScrollbar {\n scrollbar-color: transparent;\n scrollbar-width: none;\n }\n :host .noScrollbar::-webkit-scrollbar {\n display: none;\n -webkit-appearance: none;\n }\n :host .wrapper {\n position: relative;\n overflow: visible;\n z-index: 2;\n }\n :host .canvases {\n min-height: ${this.getHeight(this.options.height,this.options.splitChannels)}px;\n pointer-events: none;\n }\n :host .canvases > div {\n position: relative;\n }\n :host canvas {\n display: block;\n position: absolute;\n top: 0;\n image-rendering: pixelated;\n }\n :host .progress {\n pointer-events: none;\n position: absolute;\n z-index: 2;\n top: 0;\n left: 0;\n width: 0;\n height: 100%;\n overflow: hidden;\n }\n :host .progress > div {\n position: relative;\n }\n :host .cursor {\n pointer-events: none;\n position: absolute;\n z-index: 5;\n top: 0;\n left: 0;\n height: 100%;\n border-radius: 2px;\n }\n </style>\n\n <div class="scroll" part="scroll">\n <div class="wrapper" part="wrapper">\n <div class="canvases" part="canvases"></div>\n <div class="progress" part="progress"></div>\n <div class="cursor" part="cursor"></div>\n </div>\n </div>\n `;return[t,i]}setOptions(t){var i;if(this.options.container!==t.container){const i=this.parentFromOptionsContainer(t.container);i.appendChild(this.container);this.parent=i}if(t.dragToSeek===true||typeof this.options.dragToSeek==="object"){this.initDrag()}else{(i=this.dragStream)===null||i===void 0?void 0:i.cleanup();this.dragStream=null}this.options=t;this.reRender()}getWrapper(){return this.wrapper}getWidth(){return this.scrollContainer.clientWidth-this.containerInlinePadding}getScroll(){return this.scrollContainer.scrollLeft}setScroll(t){this.scrollContainer.scrollLeft=t}setScrollPercentage(t){const{scrollWidth:i}=this.scrollContainer;const s=i*t;this.setScroll(s)}destroy(){var t;this.wrapper.removeEventListener("click",this.onClickWrapper);this.wrapper.removeEventListener("dblclick",this.onDblClickWrapper);this.timeouts.forEach((t=>t()));this.timeouts=[];this.subscriptions.forEach((t=>t()));this.container.remove();if(this.resizeObserver){this.resizeObserver.disconnect();this.resizeObserver=null}(t=this.unsubscribeOnScroll)===null||t===void 0?void 0:t.forEach((t=>t()));this.unsubscribeOnScroll=[];if(this.dragStream){this.dragStream.cleanup();this.dragStream=null}if(this.scrollStream){this.scrollStream.cleanup();this.scrollStream=null}}createDelay(t=10){let i;let s;const e=()=>{if(i){clearTimeout(i);i=undefined}if(s){s();s=undefined}};this.timeouts.push(e);return()=>new Promise(((n,h)=>{e();s=h;i=setTimeout((()=>{i=undefined;s=undefined;n()}),t)}))}getHeight(t,i){var s;const e=((s=this.audioData)===null||s===void 0?void 0:s.numberOfChannels)||1;return H({optionsHeight:t,optionsSplitChannels:i,parentHeight:this.parent.clientHeight,numberOfChannels:e,defaultHeight:A})}convertColorValues(t,i){return Q(t,this.getPixelRatio(),i===null||i===void 0?void 0:i.canvas.height)}getPixelRatio(){return V(window.devicePixelRatio)}renderBarWaveform(t,i,s,e){const{width:n,height:h}=s.canvas;const{halfHeight:r,barWidth:o,barRadius:a,barIndexScale:c,barSpacing:l,barMinHeight:u}=P({width:n,height:h,length:(t[0]||[]).length,options:i,pixelRatio:this.getPixelRatio()});const d=W({channelData:t,barIndexScale:c,barSpacing:l,barWidth:o,halfHeight:r,vScale:e,canvasHeight:h,barAlign:i.barAlign,barMinHeight:u});s.beginPath();for(const t of d){if(a&&"roundRect"in s){s.roundRect(t.x,t.y,t.width,t.height,a)}else{s.rect(t.x,t.y,t.width,t.height)}}s.fill();s.closePath()}renderLineWaveform(t,i,s,e){const{width:n,height:h}=s.canvas;const r=q({channelData:t,width:n,height:h,vScale:e});s.beginPath();for(const t of r){if(!t.length)continue;s.moveTo(t[0].x,t[0].y);for(let i=1;i<t.length;i++){const e=t[i];s.lineTo(e.x,e.y)}}s.fill();s.closePath()}renderWaveform(t,i,s){s.fillStyle=this.convertColorValues(i.waveColor,s);if(i.renderFunction){i.renderFunction(t,s);return}const e=X({channelData:t,barHeight:i.barHeight,normalize:i.normalize,maxPeak:i.maxPeak});if(Y(i)){this.renderBarWaveform(t,i,s,e);return}this.renderLineWaveform(t,i,s,e)}renderSingleCanvas(t,i,s,e,n,h,r){const o=this.getPixelRatio();const a=document.createElement("canvas");a.width=Math.round(s*o);a.height=Math.round(e*o);a.style.width=`${s}px`;a.style.height=`${e}px`;a.style.left=`${Math.round(n)}px`;h.appendChild(a);const c=a.getContext("2d");if(i.renderFunction){c.fillStyle=this.convertColorValues(i.waveColor,c);i.renderFunction(t,c)}else{this.renderWaveform(t,i,c)}if(a.width>0&&a.height>0){const t=a.cloneNode();const s=t.getContext("2d");s.drawImage(a,0,0);s.globalCompositeOperation="source-in";s.fillStyle=this.convertColorValues(i.progressColor,s);s.fillRect(0,0,a.width,a.height);r.appendChild(t)}}renderMultiCanvas(t,i,s,e,n,h){const r=this.getPixelRatio();const{clientWidth:o}=this.scrollContainer;const a=s/r;const c=B({clientWidth:o,totalWidth:a,options:i});let l={};if(c===0)return;const u=s=>{if(s<0||s>=f)return;if(l[s])return;l[s]=true;const r=s*c;let o=Math.min(a-r,c);o=$(o,i);if(o<=0)return;const u=Z({channelData:t,offset:r,clampedWidth:o,totalWidth:a});this.renderSingleCanvas(u,i,o,e,r,n,h)};const d=()=>{if(_(Object.keys(l).length)){n.innerHTML="";h.innerHTML="";l={}}};const f=Math.ceil(a/c);if(!this.isScrollable){for(let t=0;t<f;t++){u(t)}return}const v=G({scrollLeft:this.scrollContainer.scrollLeft,totalWidth:a,numCanvases:f});v.forEach((t=>u(t)));if(f>1){const t=this.on("scroll",(()=>{const{scrollLeft:t}=this.scrollContainer;d();G({scrollLeft:t,totalWidth:a,numCanvases:f}).forEach((t=>u(t)))}));this.unsubscribeOnScroll.push(t)}}renderChannel(t,i,s,e){var{overlay:n}=i,h=ht(i,["overlay"]);const r=document.createElement("div");const o=this.getHeight(h.height,h.splitChannels);r.style.height=`${o}px`;if(n&&e>0){r.style.marginTop=`-${o}px`}this.canvasWrapper.style.minHeight=`${o}px`;this.canvasWrapper.appendChild(r);const a=r.cloneNode();this.progressWrapper.appendChild(a);this.renderMultiCanvas(t,h,s,o,r,a)}render(t){return nt(this,void 0,void 0,(function*(){var i;this.timeouts.forEach((t=>t()));this.timeouts=[];this.unsubscribeOnScroll.forEach((t=>t()));this.unsubscribeOnScroll=[];this.canvasWrapper.innerHTML="";this.progressWrapper.innerHTML="";if(this.options.width!=null){this.scrollContainer.style.width=typeof this.options.width==="number"?`${this.options.width}px`:this.options.width}const s=this.getPixelRatio();const e=this.scrollContainer.clientWidth-this.containerInlinePadding;const{scrollWidth:n,isScrollable:h,useParentWidth:r,width:o}=F({duration:t.duration,minPxPerSec:this.options.minPxPerSec||0,parentWidth:e,fillParent:this.options.fillParent,pixelRatio:s});this.isScrollable=h;this.wrapper.style.width=r?"100%":`${n}px`;this.scrollContainer.style.overflowX=this.isScrollable?"auto":"hidden";this.scrollContainer.classList.toggle("noScrollbar",!!this.options.hideScrollbar);this.cursor.style.backgroundColor=`${this.options.cursorColor||this.options.progressColor}`;this.cursor.style.width=`${this.options.cursorWidth}px`;this.audioData=t;this.emit("render");if(this.options.splitChannels){for(let s=0;s<t.numberOfChannels;s++){const e=Object.assign(Object.assign({},this.options),(i=this.options.splitChannels)===null||i===void 0?void 0:i[s]);this.renderChannel([t.getChannelData(s)],e,o,s)}}else{const i=[t.getChannelData(0)];if(t.numberOfChannels>1)i.push(t.getChannelData(1));this.renderChannel(i,this.options,o,0)}Promise.resolve().then((()=>this.emit("rendered")))}))}reRender(){this.unsubscribeOnScroll.forEach((t=>t()));this.unsubscribeOnScroll=[];if(!this.audioData)return;const{scrollWidth:t}=this.scrollContainer;const{right:i}=this.progressWrapper.getBoundingClientRect();this.render(this.audioData);if(!this.isScrollable&&this.scrollContainer.scrollLeft){this.scrollContainer.scrollLeft=0}else if(this.isScrollable&&t!==this.scrollContainer.scrollWidth){const{right:t}=this.progressWrapper.getBoundingClientRect();const s=J(t-i);this.scrollContainer.scrollLeft+=s}}zoom(t){this.options.minPxPerSec=t;this.reRender()}scrollIntoView(t,i=false){var s;const{scrollLeft:e,scrollWidth:n,clientWidth:h}=this.scrollContainer;const r=t*n;const o=e;const a=e+h;const c=h/2;if(this.isDragging){const t=30;if(r+t>a){this.scrollContainer.scrollLeft+=t}else if(r-t<o){this.scrollContainer.scrollLeft-=t}}else{if(r<o||r>a){this.scrollContainer.scrollLeft=r-(this.options.autoCenter?c:0)}const t=r-e-c;if(i&&this.options.autoCenter&&t>0){const i=(s=this.audioData)===null||s===void 0?void 0:s.duration;if(i===undefined||i<=0){this.scrollContainer.scrollLeft+=t;return}const e=n/i;if(e<=at){this.scrollContainer.scrollLeft+=Math.min(t,ot)}else{this.scrollContainer.scrollLeft+=t}}}}renderProgress(t,i){if(isNaN(t))return;const s=t*100;this.canvasWrapper.style.clipPath=`polygon(${s}% 0%, 100% 0%, 100% 100%, ${s}% 100%)`;this.progressWrapper.style.width=`${s}%`;this.cursor.style.left=`${s}%`;this.cursor.style.transform=this.options.cursorWidth?`translateX(-${t*this.options.cursorWidth}px)`:"";if(this.isScrollable&&this.options.autoScroll&&this.audioData&&this.audioData.duration>0){this.scrollIntoView(t,i)}}exportImage(t,i,s){return nt(this,void 0,void 0,(function*(){const e=this.canvasWrapper.querySelectorAll("canvas");if(!e.length){throw new Error("No waveform data")}if(s==="dataURL"){const s=Array.from(e).map((s=>s.toDataURL(t,i)));return Promise.resolve(s)}return Promise.all(Array.from(e).map((s=>new Promise(((e,n)=>{s.toBlob((t=>{if(t){e(t)}else{n(new Error("Could not export image"))}}),t,i)})))))}))}}class lt extends u{constructor(){super(...arguments);this.animationFrameId=null;this.isRunning=false}start(){if(this.isRunning)return;this.isRunning=true;const t=()=>{if(!this.isRunning)return;this.emit("tick");this.animationFrameId=requestAnimationFrame(t)};t()}stop(){this.isRunning=false;if(this.animationFrameId!==null){cancelAnimationFrame(this.animationFrameId);this.animationFrameId=null}}destroy(){this.stop();this.unAll()}}var ut=undefined&&undefined.__awaiter||function(t,i,s,e){function n(t){return t instanceof s?t:new s((function(i){i(t)}))}return new(s||(s=Promise))((function(s,h){function r(t){try{a(e.next(t))}catch(t){h(t)}}function o(t){try{a(e["throw"](t))}catch(t){h(t)}}function a(t){t.done?s(t.value):n(t.value).then(r,o)}a((e=e.apply(t,i||[])).next())}))};function dt(){const t=globalThis.navigator;if(!(t===null||t===void 0?void 0:t.audioSession))return;try{t.audioSession.type="playback"}catch(t){console.warn("Setting navigator.audioSession.type failed:",t)}}class ft extends u{constructor(t){super();this.bufferNode=null;this.playStartTime=0;this.playbackPosition=0;this._muted=false;this._playbackRate=1;this._duration=undefined;this.buffer=null;this.currentSrc="";this.paused=true;this.crossOrigin=null;this.seeking=false;this.autoplay=false;this.addEventListener=this.on;this.removeEventListener=this.un;this._destroyed=false;dt();this.audioContext=t||new AudioContext;this.gainNode=this.audioContext.createGain();this.gainNode.connect(this.audioContext.destination)}load(){return ut(this,void 0,void 0,(function*(){return}))}remove(){this.destroy()}destroy(){if(this._destroyed)return;this._destroyed=true;this.currentSrc="";if(this.bufferNode){this.bufferNode.onended=null;try{this.bufferNode.stop()}catch(t){}this.bufferNode.disconnect();this.bufferNode=null}this.gainNode.disconnect();if(typeof this.audioContext.close==="function"){Promise.resolve(this.audioContext.close.call(this.audioContext)).catch((()=>undefined))}this.buffer=null;this.unAll()}get src(){return this.currentSrc}set src(t){this.currentSrc=t;this._duration=undefined;if(!t){this.buffer=null;this.emit("emptied");return}fetch(t).then((i=>{if(i.status>=400){throw new Error(`Failed to fetch ${t}: ${i.status} (${i.statusText})`)}return i.arrayBuffer()})).then((i=>{if(this.currentSrc!==t)return null;return this.audioContext.decodeAudioData(i)})).then((i=>{if(this.currentSrc!==t)return;this.buffer=i;this.emit("loadedmetadata");this.emit("canplay");if(this.autoplay)this.play()})).catch((t=>{console.error("WebAudioPlayer load error:",t)}))}_play(){if(!this.paused)return;this.paused=false;if(this.bufferNode){this.bufferNode.onended=null;this.bufferNode.disconnect()}this.bufferNode=this.audioContext.createBufferSource();if(this.buffer){this.bufferNode.buffer=this.buffer}this.bufferNode.playbackRate.value=this._playbackRate;this.bufferNode.connect(this.gainNode);let t=this.playbackPosition;if(t>=this.duration||t<0){t=0;this.playbackPosition=0}this.bufferNode.start(this.audioContext.currentTime,t);this.playStartTime=this.audioContext.currentTime;this.bufferNode.onended=()=>{if(!this.paused&&this.duration-this.currentTime<.01){this.pause();this.emit("ended")}}}_pause(){this.paused=true;if(this.bufferNode){this.bufferNode.onended=null;try{this.bufferNode.stop()}catch(t){}}this.playbackPosition+=(this.audioContext.currentTime-this.playStartTime)*this._playbackRate}play(){return ut(this,void 0,void 0,(function*(){if(!this.paused)return;this._play();this.emit("play")}))}pause(){if(this.paused)return;this._pause();this.emit("pause")}stopAt(t){const i=(t-this.currentTime)/this._playbackRate;const s=this.bufferNode;s===null||s===void 0?void 0:s.stop(this.audioContext.currentTime+i);s===null||s===void 0?void 0:s.addEventListener("ended",(()=>{if(s===this.bufferNode){this.bufferNode=null;this.pause();this.playbackPosition=Math.min(t,this.duration);this.emit("timeupdate")}}),{once:true})}setSinkId(t){return ut(this,void 0,void 0,(function*(){const i=this.audioContext;return i.setSinkId(t)}))}get playbackRate(){return this._playbackRate}set playbackRate(t){const i=!this.paused;if(i)this._pause();this._playbackRate=t;if(i)this._play();if(this.bufferNode){this.bufferNode.playbackRate.value=t}}get currentTime(){return this.paused?this.playbackPosition:this.playbackPosition+(this.audioContext.currentTime-this.playStartTime)*this._playbackRate}set currentTime(t){const i=!this.paused;if(i)this._pause();this.playbackPosition=t;if(i)this._play();this.emit("seeking");this.emit("timeupdate")}get duration(){var t,i;return(t=this._duration)!==null&&t!==void 0?t:((i=this.buffer)===null||i===void 0?void 0:i.duration)||0}set duration(t){this._duration=t}get volume(){return this.gainNode.gain.value}set volume(t){this.gainNode.gain.value=t;this.emit("volumechange")}get muted(){return this._muted}set muted(t){if(this._muted===t)return;this._muted=t;if(this._muted){this.gainNode.disconnect()}else{this.gainNode.connect(this.audioContext.destination)}}canPlayType(t){return/^(audio|video)\//.test(t)}getGainNode(){return this.gainNode}getChannelData(){const t=[];if(!this.buffer)return t;const i=this.buffer.numberOfChannels;for(let s=0;s<i;s++){t.push(this.buffer.getChannelData(s))}return t}removeAttribute(t){switch(t){case"src":this.src="";break;case"playbackRate":this.playbackRate=0;break;case"currentTime":this.currentTime=0;break;case"duration":this.duration=0;break;case"volume":this.volume=0;break;case"muted":this.muted=false;break}}}function vt(t){var i,s,e,n,h,r;const o=(i=t===null||t===void 0?void 0:t.currentTime)!==null&&i!==void 0?i:k(0);const a=(s=t===null||t===void 0?void 0:t.duration)!==null&&s!==void 0?s:k(0);const c=(e=t===null||t===void 0?void 0:t.isPlaying)!==null&&e!==void 0?e:k(false);const l=(n=t===null||t===void 0?void 0:t.isSeeking)!==null&&n!==void 0?n:k(false);const u=(h=t===null||t===void 0?void 0:t.volume)!==null&&h!==void 0?h:k(1);const d=(r=t===null||t===void 0?void 0:t.playbackRate)!==null&&r!==void 0?r:k(1);const f=k(null);const v=k(null);const p=k("");const g=k(0);const m=k(0);const b=j((()=>!c.value),[c]);const y=j((()=>f.value!==null),[f]);const M=j((()=>y.value&&a.value>0),[y,a]);const x=j((()=>o.value),[o]);const w=j((()=>a.value>0?o.value/a.value:0),[o,a]);const N={currentTime:o,duration:a,isPlaying:c,isPaused:b,isSeeking:l,volume:u,playbackRate:d,audioBuffer:f,peaks:v,url:p,zoom:g,scrollPosition:m,canPlay:y,isReady:M,progress:x,progressPercent:w};const T={setCurrentTime:t=>{const i=Math.max(0,Math.min(a.value||Infinity,t));o.set(i)},setDuration:t=>{a.set(Math.max(0,t))},setPlaying:t=>{c.set(t)},setSeeking:t=>{l.set(t)},setVolume:t=>{const i=Math.max(0,Math.min(1,t));u.set(i)},setPlaybackRate:t=>{const i=Math.max(.1,Math.min(16,t));d.set(i)},setAudioBuffer:t=>{f.set(t);if(t){a.set(t.duration)}},setPeaks:t=>{v.set(t)},setUrl:t=>{p.set(t)},setZoom:t=>{g.set(Math.max(0,t))},setScrollPosition:t=>{m.set(Math.max(0,t))}};return{state:N,actions:T}}var pt=undefined&&undefined.__awaiter||function(t,i,s,e){function n(t){return t instanceof s?t:new s((function(i){i(t)}))}return new(s||(s=Promise))((function(s,h){function r(t){try{a(e.next(t))}catch(t){h(t)}}function o(t){try{a(e["throw"](t))}catch(t){h(t)}}function a(t){t.done?s(t.value):n(t.value).then(r,o)}a((e=e.apply(t,i||[])).next())}))};const gt={waveColor:"#999",progressColor:"#555",cursorWidth:1,minPxPerSec:0,fillParent:true,interact:true,dragToSeek:false,autoScroll:true,autoCenter:true,sampleRate:8e3};class mt extends E{static create(t){return new mt(t)}getState(){return this.wavesurferState}getRenderer(){return this.renderer}constructor(t){const i=t.media||(t.backend==="WebAudio"?new ft:undefined);super({media:i,mediaControls:t.mediaControls,autoplay:t.autoplay,playbackRate:t.audioRate});this.plugins=[];this.decodedData=null;this.stopAtPosition=null;this.subscriptions=[];this.mediaSubscriptions=[];this.abortController=null;this._isDestroyed=false;this._loadVersion=0;this.options=Object.assign({},gt,t);const{state:s,actions:e}=vt({isPlaying:this.isPlayingSignal,currentTime:this.currentTimeSignal,duration:this.durationSignal,volume:this.volumeSignal,playbackRate:this.playbackRateSignal,isSeeking:this.seekingSignal});this.wavesurferState=s;this.wavesurferActions=e;this.timer=new lt;const n=i?undefined:this.getMediaElement();this.renderer=new ct(this.options,n);this.initPlayerEvents();this.initRendererEvents();this.initTimerEvents();this.initPlugins();const h=this.options.url||this.getSrc()||"";Promise.resolve().then((()=>{this.emit("init");const{peaks:t,duration:i}=this.options;if(h||t&&i){this.load(h,t,i).catch((()=>{}))}}))}updateProgress(t=this.getCurrentTime()){this.renderer.renderProgress(t/this.getDuration(),this.isPlaying());return t}initTimerEvents(){this.subscriptions.push(this.timer.on("tick",(()=>{if(!this.isSeeking()){const t=this.updateProgress();this.emit("timeupdate",t);this.emit("audioprocess",t);if(this.stopAtPosition!=null&&this.isPlaying()&&t>=this.stopAtPosition){const t=this.stopAtPosition;this.pause();this.setTime(t)}}})))}initPlayerEvents(){if(this.isPlaying()){this.emit("play");this.timer.start()}this.mediaSubscriptions.push(this.onMediaEvent("timeupdate",(()=>{const t=this.updateProgress();this.emit("timeupdate",t)})),this.onMediaEvent("play",(()=>{this.emit("play");this.timer.start()})),this.onMediaEvent("pause",(()=>{this.emit("pause");this.timer.stop();this.stopAtPosition=null})),this.onMediaEvent("emptied",(()=>{this.timer.stop();this.stopAtPosition=null})),this.onMediaEvent("ended",(()=>{this.emit("timeupdate",this.getDuration());this.emit("finish");this.stopAtPosition=null})),this.onMediaEvent("seeking",(()=>{this.emit("seeking",this.getCurrentTime())})),this.onMediaEvent("error",(()=>{var t;this.emit("error",(t=this.getMediaElement().error)!==null&&t!==void 0?t:new Error("Media error"));this.stopAtPosition=null})))}initRendererEvents(){this.subscriptions.push(this.renderer.on("click",((t,i)=>{if(this.options.interact){this.seekTo(t);this.emit("interaction",t*this.getDuration());this.emit("click",t,i)}})),this.renderer.on("dblclick",((t,i)=>{this.emit("dblclick",t,i)})),this.renderer.on("scroll",((t,i,s,e)=>{const n=this.getDuration();this.emit("scroll",t*n,i*n,s,e)})),this.renderer.on("render",(()=>{this.emit("redraw")})),this.renderer.on("rendered",(()=>{this.emit("redrawcomplete")})),this.renderer.on("dragstart",(t=>{this.emit("dragstart",t)})),this.renderer.on("dragend",(t=>{this.emit("dragend",t)})),this.renderer.on("resize",(()=>{this.emit("resize")})));{let t;const i=this.renderer.on("drag",(i=>{var s;if(!this.options.interact)return;this.renderer.renderProgress(i);clearTimeout(t);let e=0;const n=this.options.dragToSeek;if(this.isPlaying()){e=0}else if(n===true){e=200}else if(n&&typeof n==="object"){e=(s=n.debounceTime)!==null&&s!==void 0?s:200}t=setTimeout((()=>{this.seekTo(i)}),e);this.emit("interaction",i*this.getDuration());this.emit("drag",i)}));this.subscriptions.push((()=>{clearTimeout(t);i()}))}}initPlugins(){var t;if(!((t=this.options.plugins)===null||t===void 0?void 0:t.length))return;this.options.plugins.forEach((t=>{this.registerPlugin(t)}))}unsubscribePlayerEvents(){this.mediaSubscriptions.forEach((t=>t()));this.mediaSubscriptions=[]}setOptions(t){this.options=Object.assign({},this.options,t);if(t.duration&&!t.peaks){this.decodedData=m.createBuffer(this.exportPeaks(),t.duration)}if(t.peaks&&t.duration){this.decodedData=m.createBuffer(t.peaks,t.duration)}this.renderer.setOptions(this.options);if(t.audioRate){this.setPlaybackRate(t.audioRate)}if(t.mediaControls!=null){this.getMediaElement().controls=t.mediaControls}}registerPlugin(t){if(this.plugins.includes(t)){return t}t._init(this);this.plugins.push(t);const i=t.once("destroy",(()=>{this.plugins=this.plugins.filter((i=>i!==t));this.subscriptions=this.subscriptions.filter((t=>t!==i))}));this.subscriptions.push(i);return t}unregisterPlugin(t){this.plugins=this.plugins.filter((i=>i!==t));t.destroy()}getWrapper(){return this.renderer.getWrapper()}getWidth(){return this.renderer.getWidth()}getScroll(){return this.renderer.getScroll()}setScroll(t){return this.renderer.setScroll(t)}setScrollTime(t){const i=t/this.getDuration();this.renderer.setScrollPercentage(i)}getActivePlugins(){return this.plugins}loadAudio(t,i,s,e){return pt(this,void 0,void 0,(function*(){var n;const h=++this._loadVersion;this._isDestroyed=false;this.emit("load",t);if(!this.options.media&&this.isPlaying())this.pause();this.decodedData=null;this.stopAtPosition=null;(n=this.abortController)===null||n===void 0?void 0:n.abort();this.abortController=null;if(!i&&!s){const s=this.options.fetchParams||{};if(window.AbortController&&!s.signal){this.abortController=new AbortController;s.signal=this.abortController.signal}const e=t=>this.emit("loading",t);i=yield D.fetchBlob(t,e,s);if(this._isDestroyed||h!==this._loadVersion)return;const n=this.options.blobMimeType;if(n){i=new Blob([i],{type:n})}}if(this._isDestroyed||h!==this._loadVersion)return;this.setSrc(t,i);const r=yield new Promise((t=>{const i=e||this.getDuration();if(i){t(i)}else{this.mediaSubscriptions.push(this.onMediaEvent("loadedmetadata",(()=>t(this.getDuration())),{once:true}))}}));if(this._isDestroyed||h!==this._loadVersion)return;if(!t&&!i){const t=this.getMediaElement();if(t instanceof ft){t.duration=r}}if(s){this.decodedData=m.createBuffer(s,r||0)}else if(i){const t=yield i.arrayBuffer();if(this._isDestroyed||h!==this._loadVersion)return;this.decodedData=yield m.decode(t,this.options.sampleRate)}if(this._isDestroyed||h!==this._loadVersion)return;if(this.decodedData){this.emit("decode",this.getDuration());this.renderer.render(this.decodedData)}this.emit("ready",this.getDuration())}))}load(t,i,s){return pt(this,void 0,void 0,(function*(){try{return yield this.loadAudio(t,undefined,i,s)}catch(t){this.emit("error",t);throw t}}))}loadBlob(t,i,s){return pt(this,void 0,void 0,(function*(){try{return yield this.loadAudio("",t,i,s)}catch(t){this.emit("error",t);throw t}}))}zoom(t){if(!this.decodedData){throw new Error("No audio loaded")}this.renderer.zoom(t);this.emit("zoom",t)}getDecodedData(){return this.decodedData}exportPeaks({channels:t=2,maxLength:i=8e3,precision:s=1e4}={}){if(!this.decodedData){throw new Error("The audio has not been decoded yet")}const e=Math.min(t,this.decodedData.numberOfChannels);const n=[];for(let t=0;t<e;t++){const e=this.decodedData.getChannelData(t);const h=[];const r=e.length/i;for(let t=0;t<i;t++){const i=e.slice(Math.floor(t*r),Math.ceil((t+1)*r));let n=0;for(let t=0;t<i.length;t++){const s=i[t];if(Math.abs(s)>Math.abs(n))n=s}h.push(Math.round(n*s)/s)}n.push(h)}return n}getDuration(){let t=super.getDuration()||0;if((t===0||t===Infinity)&&this.decodedData){t=this.decodedData.duration}return t}toggleInteraction(t){this.options.interact=t}setTime(t){this.stopAtPosition=null;super.setTime(t);this.updateProgress(t);this.emit("timeupdate",t)}seekTo(t){const i=this.getDuration()*t;this.setTime(i)}play(t,i){const s=Object.create(null,{play:{get:()=>super.play}});return pt(this,void 0,void 0,(function*(){if(t!=null){this.setTime(t)}const e=yield s.play.call(this);if(i!=null){if(this.media instanceof ft){this.media.stopAt(i)}else{this.stopAtPosition=i}}return e}))}playPause(){return pt(this,void 0,void 0,(function*(){return this.isPlaying()?this.pause():this.play()}))}stop(){this.pause();this.setTime(0)}skip(t){this.setTime(this.getCurrentTime()+t)}empty(){this.load("",[[0]],.001)}setMediaElement(t){this.unsubscribePlayerEvents();super.setMediaElement(t);this.initPlayerEvents()}exportImage(){return pt(this,arguments,void 0,(function*(t="image/png",i=1,s="dataURL"){return this.renderer.exportImage(t,i,s)}))}destroy(){var t;this._isDestroyed=true;this.emit("destroy");(t=this.abortController)===null||t===void 0?void 0:t.abort();this.plugins.forEach((t=>t.destroy()));this.subscriptions.forEach((t=>t()));this.unsubscribePlayerEvents();this.timer.destroy();this.renderer.destroy();super.destroy()}}mt.BasePlugin=d;mt.dom=x;function bt(t,i,s,e){return new(s||(s=Promise))((function(n,h){function r(t){try{a(e.next(t))}catch(t){h(t)}}function o(t){try{a(e.throw(t))}catch(t){h(t)}}function a(t){var i;t.done?n(t.value):(i=t.value,i instanceof s?i:new s((function(t){t(i)}))).then(r,o)}a((e=e.apply(t,i||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class yt{constructor(){this.listeners={}}on(t,i,s){if(this.listeners[t]||(this.listeners[t]=new Set),null==s?void 0:s.once){const s=(...e)=>{this.un(t,s),i(...e)};return this.listeners[t].add(s),()=>this.un(t,s)}return this.listeners[t].add(i),()=>this.un(t,i)}un(t,i){var s;null===(s=this.listeners[t])||void 0===s||s.delete(i)}once(t,i){return this.on(t,i,{once:!0})}unAll(){this.listeners={}}emit(t,...i){this.listeners[t]&&this.listeners[t].forEach((t=>t(...i)))}}class Mt extends yt{constructor(t){super(),this.subscriptions=[],this.isDestroyed=!1,this.options=t}onInit(){}_init(t){this.isDestroyed&&(this.subscriptions=[],this.isDestroyed=!1),this.wavesurfer=t,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach((t=>t())),this.subscriptions=[],this.isDestroyed=!0,this.wavesurfer=void 0}}class xt extends yt{constructor(){super(...arguments),this.animationFrameId=null,this.isRunning=!1}start(){if(this.isRunning)return;this.isRunning=!0;const t=()=>{this.isRunning&&(this.emit("tick"),this.animationFrameId=requestAnimationFrame(t))};t()}stop(){this.isRunning=!1,null!==this.animationFrameId&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}destroy(){this.stop(),this.unAll()}}const wt=100,Nt=["audio/webm","audio/wav","audio/mpeg","audio/mp4","audio/mp3"];class Tt extends Mt{constructor(t){var i,s,e,n,h,r;super(Object.assign(Object.assign({},t),{audioBitsPerSecond:null!==(i=t.audioBitsPerSecond)&&void 0!==i?i:128e3,scrollingWaveform:null!==(s=t.scrollingWaveform)&&void 0!==s&&s,scrollingWaveformWindow:null!==(e=t.scrollingWaveformWindow)&&void 0!==e?e:5,continuousWaveform:null!==(n=t.continuousWaveform)&&void 0!==n&&n,renderRecordedAudio:null===(h=t.renderRecordedAudio)||void 0===h||h,mediaRecorderTimeslice:null!==(r=t.mediaRecorderTimeslice)&&void 0!==r?r:void 0})),this.stream=null,this.mediaRecorder=null,this.dataWindow=null,this.isWaveformPaused=!1,this.lastStartTime=0,this.lastDuration=0,this.duration=0,this.micStream=null,this.recordedBlobUrl=null,this.timer=new xt,this.subscriptions.push(this.timer.on("tick",(()=>{const t=performance.now()-this.lastStartTime;this.duration=this.isPaused()?this.duration:this.lastDuration+t,this.emit("record-progress",this.duration)})))}static create(t){return new Tt(t||{})}renderMicStream(t){var i;const s=new AudioContext,e=s.createMediaStreamSource(t),n=s.createAnalyser();e.connect(n),(this.options.continuousWaveform||this.options.scrollingWaveform)&&(n.fftSize=32);const h=n.frequencyBinCount,r=new Float32Array(h);let o=0;this.wavesurfer&&(null!==(i=this.originalOptions)&&void 0!==i||(this.originalOptions=Object.assign({},this.wavesurfer.options)),this.wavesurfer.options.interact=!1,this.options.scrollingWaveform&&(this.wavesurfer.options.cursorWidth=0,this.wavesurfer.options.normalize=!0,this.wavesurfer.options.maxPeak=1));const a=setInterval((()=>{var t,i,s,e;if(!this.isWaveformPaused){if(n.getFloatTimeDomainData(r),this.options.scrollingWaveform){const t=Math.floor((this.options.scrollingWaveformWindow||0)*wt);let i=0;for(let t=0;t<h;t++){const s=Math.abs(r[t]);s>i&&(i=s)}this.dataWindow||(this.dataWindow=new Float32Array(t));const s=new Float32Array(t);if(this.dataWindow&&this.dataWindow.length>0){const i=t-1,e=this.dataWindow.slice(-i);s.set(e,0)}s[t-1]=i,this.dataWindow=s}else if(this.options.continuousWaveform){if(!this.dataWindow){const s=this.options.continuousWaveformDuration?Math.round(this.options.continuousWaveformDuration*wt):(null!==(i=null===(t=this.wavesurfer)||void 0===t?void 0:t.getWidth())&&void 0!==i?i:0)*window.devicePixelRatio;this.dataWindow=new Float32Array(s)}let s=0;for(let t=0;t<h;t++){const i=Math.abs(r[t]);i>s&&(s=i)}if(o+1>this.dataWindow.length){const t=new Float32Array(2*this.dataWindow.length);t.set(this.dataWindow,0),this.dataWindow=t}this.dataWindow[o]=s,o++}else this.dataWindow=r;if(this.wavesurfer){const t=(null!==(e=null===(s=this.dataWindow)||void 0===s?void 0:s.length)&&void 0!==e?e:0)/wt;this.wavesurfer.load("",[this.dataWindow],this.options.scrollingWaveform?this.options.scrollingWaveformWindow:t).then((()=>{this.wavesurfer&&this.options.continuousWaveform&&(this.wavesurfer.setTime(this.getDuration()/1e3),this.wavesurfer.options.minPxPerSec||this.wavesurfer.setOptions({minPxPerSec:this.wavesurfer.getWidth()/this.wavesurfer.getDuration()}))})).catch((t=>{console.error("Error rendering real-time recording data:",t)}))}}}),10);return{onDestroy:()=>{clearInterval(a),null==e||e.disconnect(),null==s||s.close()},onEnd:()=>{this.isWaveformPaused=!0,this.stopMic()}}}startMic(t){return bt(this,void 0,void 0,(function*(){let i;this.micStream&&this.stopMic();try{i=yield navigator.mediaDevices.getUserMedia({audio:null==t||t})}catch(i){throw new Error("Error accessing the microphone: "+i.message)}const s=this.renderMicStream(i);return this.micStream=s,this.unsubscribeDestroy=this.once("destroy",s.onDestroy),this.unsubscribeRecordEnd=this.once("record-end",s.onEnd),this.stream=i,i}))}stopMic(){var t,i,s;null===(t=this.micStream)||void 0===t||t.onDestroy(),null===(i=this.unsubscribeDestroy)||void 0===i||i.call(this),null===(s=this.unsubscribeRecordEnd)||void 0===s||s.call(this),this.micStream=null,this.unsubscribeDestroy=void 0,this.unsubscribeRecordEnd=void 0,this.stream&&(this.stream.getTracks().forEach((t=>t.stop())),this.stream=null,this.mediaRecorder=null)}startRecording(t){return bt(this,void 0,void 0,(function*(){const i=this.stream||(yield this.startMic(t));this.dataWindow=null;const s=this.mediaRecorder||new MediaRecorder(i,{mimeType:this.options.mimeType||Nt.find((t=>MediaRecorder.isTypeSupported(t))),audioBitsPerSecond:this.options.audioBitsPerSecond});this.mediaRecorder=s,this.stopRecording();const e=[];s.ondataavailable=t=>{t.data.size>0&&e.push(t.data),this.emit("record-data-available",t.data)};const n=t=>{var i;const n=new Blob(e,{type:s.mimeType});this.emit(t,n),this.options.renderRecordedAudio&&(this.applyOriginalOptionsIfNeeded(),this.recordedBlobUrl&&URL.revokeObjectURL(this.recordedBlobUrl),this.recordedBlobUrl=URL.createObjectURL(n),null===(i=this.wavesurfer)||void 0===i||i.load(this.recordedBlobUrl))};s.onpause=()=>n("record-pause"),s.onstop=()=>n("record-end"),s.start(this.options.mediaRecorderTimeslice),this.lastStartTime=performance.now(),this.lastDuration=0,this.duration=0,this.isWaveformPaused=!1,this.timer.start(),this.emit("record-start")}))}getDuration(){return this.duration}isRecording(){var t;return"recording"===(null===(t=this.mediaRecorder)||void 0===t?void 0:t.state)}isPaused(){var t;return"paused"===(null===(t=this.mediaRecorder)||void 0===t?void 0:t.state)}isActive(){var t;return"inactive"!==(null===(t=this.mediaRecorder)||void 0===t?void 0:t.state)}stopRecording(){var t;this.isActive()&&(null===(t=this.mediaRecorder)||void 0===t||t.stop(),this.timer.stop())}pauseRecording(){var t,i;this.isRecording()&&(this.isWaveformPaused=!0,null===(t=this.mediaRecorder)||void 0===t||t.requestData(),null===(i=this.mediaRecorder)||void 0===i||i.pause(),this.timer.stop(),this.lastDuration=this.duration)}resumeRecording(){var t;this.isPaused()&&(this.isWaveformPaused=!1,null===(t=this.mediaRecorder)||void 0===t||t.resume(),this.timer.start(),this.lastStartTime=performance.now(),this.emit("record-resume"))}static getAvailableAudioDevices(){return bt(this,void 0,void 0,(function*(){return navigator.mediaDevices.enumerateDevices().then((t=>t.filter((t=>"audioinput"===t.kind))))}))}destroy(){this.applyOriginalOptionsIfNeeded(),super.destroy(),this.stopRecording(),this.stopMic(),this.recordedBlobUrl&&(URL.revokeObjectURL(this.recordedBlobUrl),this.recordedBlobUrl=null)}applyOriginalOptionsIfNeeded(){this.wavesurfer&&this.originalOptions&&(this.wavesurfer.setOptions(this.originalOptions),delete this.originalOptions)}}const Dt=class{constructor(s){t(this,s);this.recordingProgress=i(this,"recordingProgress",7);this.recordingError=i(this,"recordingError",7);this.wavesurfer=null;this.recordPlugin=null;this.waveformContainer=null;this.loadAbortController=null;this.currentLoadingUrl=null;this.initializationInterval=null;this.pauseAudioHandler=()=>{if(!this.wavesurfer)return;this.isPlaying=false;this.wavesurfer.pause();this.audioDuration=n(Math.round(this.wavesurfer.getDuration()))};this.playAudioHandler=()=>{if(!this.wavesurfer){const t=this.initWaveSurfer();if(t){this.wavesurfer.once("ready",(()=>{this.isPlaying=true;this.wavesurfer.play()}))}return}this.isPlaying=true;this.wavesurfer.play()};this.audioUrl=undefined;this.audioWaveColor="#C5C5C5";this.audioProgressColor="#4A76FD";this.textColor="#4A76FD";this.isSelf=false;this.borderRadius="";this.bgColor="";this.time="";this.isRead=false;this.isDelivered=false;this.showFooter=false;this.messageId="";this.timeColor="";this.reactions={};this.messageType=undefined;this.liveRecord=false;this.isPlaying=false;this.audioDuration="0:00";this.currentAudioId=null;this.waveformContainerReady=false;this.initializationAttempts=0}componentWillLoad(){if(typeof mt!=="function"){console.error("WaveSurfer is not available as a function. Import may be failing.")}}componentDidLoad(){if(this.liveRecord){void this.startLiveRecording();return}if(this.initializationInterval){clearInterval(this.initializationInterval)}this.initializationInterval=setInterval((()=>{this.initializationAttempts++;if(this.waveformContainer&&this.audioUrl){this.initWaveSurfer();if(this.wavesurfer){clearInterval(this.initializationInterval)}}if(this.initializationAttempts>=10){clearInterval(this.initializationInterval)}}),500)}resolveWaveColor(){const t=(this.audioProgressColor||this.audioWaveColor||"").trim();if(t&&!t.startsWith("var("))return t;const i=getComputedStyle(this.el).getPropertyValue("--brand").trim();return i||"#2563eb"}ensureRecordWaveSurfer(){var t;if(!((t=this.waveformContainer)===null||t===void 0?void 0:t.isConnected))return false;if(this.wavesurfer&&this.recordPlugin)return true;if(this.wavesurfer){this.wavesurfer.destroy();this.wavesurfer=null;this.recordPlugin=null}const i=Math.max(this.waveformContainer.clientWidth||0,this.el.clientWidth||0,160);const s=this.resolveWaveColor();this.wavesurfer=mt.create({container:this.waveformContainer,waveColor:s,progressColor:s,height:28,width:i,barWidth:2,barGap:2,barRadius:2,interact:false,cursorWidth:0});this.recordPlugin=this.wavesurfer.registerPlugin(Tt.create({scrollingWaveform:true,renderRecordedAudio:false}));this.recordPlugin.on("record-progress",(t=>{this.recordingProgress.emit(t);this.audioDuration=n(Math.round(t/1e3))}));return true}async startLiveRecording(){var t;try{for(let i=0;i<20;i++){if(((t=this.waveformContainer)===null||t===void 0?void 0:t.isConnected)&&(this.waveformContainer.clientWidth>0||this.el.clientWidth>0)){break}await new Promise((t=>requestAnimationFrame((()=>t(null)))))}if(!this.ensureRecordWaveSurfer()){this.recordingError.emit("Waveform not ready");return false}await this.recordPlugin.startRecording();requestAnimationFrame((()=>{var t;const i=((t=this.waveformContainer)===null||t===void 0?void 0:t.clientWidth)||this.el.clientWidth;if(i&&this.wavesurfer){try{this.wavesurfer.setOptions({width:i})}catch(t){}}}));return true}catch(t){console.error(t);this.recordingError.emit((t===null||t===void 0?void 0:t.message)||"Microphone access denied");return false}}async pauseLiveRecording(){var t;(t=this.recordPlugin)===null||t===void 0?void 0:t.pauseRecording()}async resumeLiveRecording(){var t;(t=this.recordPlugin)===null||t===void 0?void 0:t.resumeRecording()}async stopLiveRecording(){if(!this.recordPlugin)return null;if(!this.recordPlugin.isRecording()&&!this.recordPlugin.isPaused()){this.cleanupRecord();return null}return new Promise((t=>{const i=i=>{this.cleanupRecord();t(i)};this.recordPlugin.once("record-end",(t=>i(t||null)));try{this.recordPlugin.stopRecording()}catch(t){i(null)}}))}async cancelLiveRecording(){var t,i,s,e;try{if(((i=(t=this.recordPlugin)===null||t===void 0?void 0:t.isRecording)===null||i===void 0?void 0:i.call(t))||((e=(s=this.recordPlugin)===null||s===void 0?void 0:s.isPaused)===null||e===void 0?void 0:e.call(s))){this.recordPlugin.stopRecording()}}catch(t){}this.cleanupRecord()}cleanupRecord(){var t,i;try{(i=(t=this.recordPlugin)===null||t===void 0?void 0:t.stopMic)===null||i===void 0?void 0:i.call(t)}catch(t){}if(this.wavesurfer){try{this.wavesurfer.destroy()}catch(t){}}this.wavesurfer=null;this.recordPlugin=null}initWaveSurfer(){if(!this.waveformContainer){console.error("Waveform container reference is missing");return false}if(!this.waveformContainer.isConnected){console.error("Waveform container is not connected to DOM");return false}if(!this.audioUrl){console.error("Audio URL is missing");return false}try{this.abortCurrentLoad();if(this.wavesurfer){this.wavesurfer.destroy();this.wavesurfer=null}this.loadAbortController=new AbortController;this.currentLoadingUrl=this.audioUrl;this.wavesurfer=mt.create({container:this.waveformContainer,waveColor:this.isSelf?"#000000":this.audioWaveColor,progressColor:this.audioProgressColor,height:40,barHeight:1,barWidth:4,barRadius:3,barGap:4,normalize:true,sampleRate:6e4,fetchParams:{signal:this.loadAbortController.signal}});if(!this.wavesurfer){console.error("Failed to create WaveSurfer instance");return false}this.wavesurfer.load(this.audioUrl);this.wavesurfer.on("ready",(()=>{if(this.currentLoadingUrl===this.audioUrl){const t=this.wavesurfer.getDuration();const i=n(Math.round(t));this.audioDuration=i}}));this.wavesurfer.on("audioprocess",(()=>{const t=Math.max(0,this.wavesurfer.getDuration()-this.wavesurfer.getCurrentTime());this.audioDuration=n(Math.round(t))}));this.wavesurfer.on("finish",(()=>{this.isPlaying=false;this.wavesurfer.seekTo(0);this.audioDuration=n(Math.round(this.wavesurfer.getDuration()))}));this.wavesurfer.on("error",(t=>{if(t.name!=="AbortError"){console.error("WaveSurfer error:",t)}}));return true}catch(t){console.error("Error initializing WaveSurfer:",t);return false}}abortCurrentLoad(){if(this.loadAbortController){this.loadAbortController.abort();this.loadAbortController=null}this.currentLoadingUrl=null}disconnectedCallback(){this.abortCurrentLoad();this.cleanupRecord();if(this.wavesurfer){this.wavesurfer.destroy();this.wavesurfer=null}this.isPlaying=false;if(this.initializationInterval){clearInterval(this.initializationInterval)}}chatChanged(t,i){if(t!==i){if(this.wavesurfer&&this.isPlaying){this.wavesurfer.pause();this.isPlaying=false}this.audioDuration="0:00";setTimeout((()=>{if(this.waveformContainer&&t){this.initWaveSurfer()}}),100)}}render(){const t=this.liveRecord;return s("div",{key:"fcf59ce63746eac2c6b7bc88cd7a7e50e97fad4b",style:{background:t?"transparent":this.bgColor||(this.isSelf?"var(--bg-outgoing-message)":"var(--bg-incoming-message)"),borderRadius:t?"0":this.borderRadius||"7.5px",color:this.textColor||"inherit",padding:t?"0":"10px",width:t?"100%":"336px",maxWidth:"100%",boxSizing:"border-box"}},s("div",{key:"5d5c18d89fa32e40dfbdb8a04e38a00825fd74c4",style:{display:"flex",alignItems:"center",gap:t?"0":"10px",width:"100%"}},t?null:s("button",{type:"button","aria-label":this.isPlaying?"Pause":"Play",style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"18px",color:"inherit"},onClick:()=>this.isPlaying?this.pauseAudioHandler():this.playAudioHandler()},this.isPlaying?"❚❚":"▶"),s("div",{key:"e2b865bfc959a3cbd2493e84946867ad1aea045f",class:"wave-host",ref:t=>{this.waveformContainer=t},style:{flex:"1",height:t?"28px":"40px",minHeight:t?"28px":"40px",minWidth:"0"}})),t?null:s("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"10px",marginTop:"4px"}},s("span",null,this.audioDuration),this.showFooter?s("span",{style:{color:this.timeColor}},this.time?(()=>{try{const t=new Date(Number(this.time));if(Number.isNaN(t.getTime()))return this.time;return new Intl.DateTimeFormat("en-US",{hour:"2-digit",minute:"2-digit",hour12:true}).format(t)}catch(t){return this.time}})():"",this.isSelf?this.isRead?" ✓✓":this.isDelivered?" ✓✓":" ✓":""):null))}get el(){return e(this)}static get watchers(){return{audioUrl:["chatChanged"]}}};Dt.style=":host {\n display: block;\n width: 100%;\n height: 100%;\n min-width: 0;\n box-sizing: border-box;\n }\n .wave-host {\n width: 100%;\n height: 100%;\n min-width: 0;\n min-height: 28px;\n }";const kt="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPgo8c3ZnIHdpZHRoPSI4MDBweCIgaGVpZ2h0PSI4MDBweCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNNS42MjUgMTVDNS42MjUgMTQuNTg1OCA1LjI4OTIxIDE0LjI1IDQuODc1IDE0LjI1QzQuNDYwNzkgMTQuMjUgNC4xMjUgMTQuNTg1OCA0LjEyNSAxNUg1LjYyNVpNNC44NzUgMTZINC4xMjVINC44NzVaTTE5LjI3NSAxNUMxOS4yNzUgMTQuNTg1OCAxOC45MzkyIDE0LjI1IDE4LjUyNSAxNC4yNUMxOC4xMTA4IDE0LjI1IDE3Ljc3NSAxNC41ODU4IDE3Ljc3NSAxNUgxOS4yNzVaTTExLjEwODYgMTUuNTM4N0MxMC44NTM5IDE1Ljg2NTMgMTAuOTEyMSAxNi4zMzY2IDExLjIzODcgMTYuNTkxNEMxMS41NjUzIDE2Ljg0NjEgMTIuMDM2NiAxNi43ODc5IDEyLjI5MTQgMTYuNDYxM0wxMS4xMDg2IDE1LjUzODdaTTE2LjE5MTQgMTEuNDYxM0MxNi40NDYxIDExLjEzNDcgMTYuMzg3OSAxMC42NjM0IDE2LjA2MTMgMTAuNDA4NkMxNS43MzQ3IDEwLjE1MzkgMTUuMjYzNCAxMC4yMTIxIDE1LjAwODYgMTAuNTM4N0wxNi4xOTE0IDExLjQ2MTNaTTExLjEwODYgMTYuNDYxM0MxMS4zNjM0IDE2Ljc4NzkgMTEuODM0NyAxNi44NDYxIDEyLjE2MTMgMTYuNTkxNEMxMi40ODc5IDE2LjMzNjYgMTIuNTQ2MSAxNS44NjUzIDEyLjI5MTQgMTUuNTM4N0wxMS4xMDg2IDE2LjQ2MTNaTTguMzkxMzggMTAuNTM4N0M4LjEzNjYyIDEwLjIxMjEgNy42NjUzMyAxMC4xNTM5IDcuMzM4NzMgMTAuNDA4NkM3LjAxMjEyIDEwLjY2MzQgNi45NTM4NyAxMS4xMzQ3IDcuMjA4NjIgMTEuNDYxM0w4LjM5MTM4IDEwLjUzODdaTTEwLjk1IDE2QzEwLjk1IDE2LjQxNDIgMTEuMjg1OCAxNi43NSAxMS43IDE2Ljc1QzEyLjExNDIgMTYuNzUgMTIuNDUgMTYuNDE0MiAxMi40NSAxNkgxMC45NVpNMTIuNDUgNUMxMi40NSA0LjU4NTc5IDEyLjExNDIgNC4yNSAxMS43IDQuMjVDMTEuMjg1OCA0LjI1IDEwLjk1IDQuNTg1NzkgMTAuOTUgNUgxMi40NVpNNC4xMjUgMTVWMTZINS42MjVWMTVINC4xMjVaTTQuMTI1IDE2QzQuMTI1IDE4LjA1MzEgNS43NTI1NyAxOS43NSA3LjggMTkuNzVWMTguMjVDNi42MTY1NyAxOC4yNSA1LjYyNSAxNy4yNjA3IDUuNjI1IDE2SDQuMTI1Wk03LjggMTkuNzVIMTUuNlYxOC4yNUg3LjhWMTkuNzVaTTE1LjYgMTkuNzVDMTcuNjQ3NCAxOS43NSAxOS4yNzUgMTguMDUzMSAxOS4yNzUgMTZIMTcuNzc1QzE3Ljc3NSAxNy4yNjA3IDE2Ljc4MzQgMTguMjUgMTUuNiAxOC4yNVYxOS43NVpNMTkuMjc1IDE2VjE1SDE3Ljc3NVYxNkgxOS4yNzVaTTEyLjI5MTQgMTYuNDYxM0wxNi4xOTE0IDExLjQ2MTNMMTUuMDA4NiAxMC41Mzg3TDExLjEwODYgMTUuNTM4N0wxMi4yOTE0IDE2LjQ2MTNaTTEyLjI5MTQgMTUuNTM4N0w4LjM5MTM4IDEwLjUzODdMNy4yMDg2MiAxMS40NjEzTDExLjEwODYgMTYuNDYxM0wxMi4yOTE0IDE1LjUzODdaTTEyLjQ1IDE2VjVIMTAuOTVWMTZIMTIuNDVaIiBmaWxsPSIjMDAwMDAwIi8+Cjwvc3ZnPg==";const jt=kt;const It=class{constructor(s){t(this,s);this.tagUserClick=i(this,"tagUserClick",7);this.bgColor=undefined;this.borderRadius="6px";this.padding="10px";this.docName=undefined;this.width=undefined;this.height=undefined;this.documentNameBg=undefined;this.documentNamePadding=undefined;this.time=undefined;this.href=undefined;this.fileName=undefined;this.isRead=undefined;this.isSelf=undefined;this.isDelivered=undefined;this.docType="";this.textColor=undefined;this.message=undefined;this.mentionedUsers=[];this.messageId=undefined;this.reactions={};this.userMetaData=undefined;this.messageType=undefined;this.timeColor=undefined;this.showReactionOnHover=false;this.borderWidth=undefined;this.borderColor=undefined;this.borderStyle=undefined}truncateDocName(t){const i=t.lastIndexOf(".");const s=i!==-1?t.slice(0,i):t;const e=i!==-1?t.slice(i):"";const n=40-e.length;if(s.length<=n){return{firstLine:s.slice(0,Math.min(20,s.length)),secondLine:`${s.slice(20)}${e}`}}const h=s.slice(0,n-3)+"...";return{firstLine:h.slice(0,20),secondLine:`${h.slice(20)}${e}`}}iconSrc(){const t=(this.docType||"").toLowerCase();const i=(this.docName||this.fileName||"").toLowerCase();if(t.includes("spreadsheet")||t.includes("excel")||/\.xlsx?$/.test(i)||i.endsWith(".csv"))return o;if(t.includes("rtf")||i.endsWith(".rtf"))return a;if(t.includes("text/plain")||i.endsWith(".txt"))return c;return l}render(){const t=this.truncateDocName(this.docName||"Document");const i=this.message&&!String(this.message).includes("AttachmentMessage:");return s("message-bubble",{key:"94fe5e9b944b8043f7d21da67d56bd0a94613377",isSelf:!!this.isSelf,time:this.time,timeColor:this.timeColor,isRead:this.isRead,isDelivered:this.isDelivered,reactions:this.reactions,messageId:this.messageId,userMetaData:this.userMetaData,isForwarded:this.messageType===1,backgroundColor:this.bgColor||"var(--bg-secondary)",borderRadius:this.borderRadius||"6px",padding:this.padding||"10px",showReactionOnHover:this.showReactionOnHover},s("div",{key:"1198854dd3aa5f18e73550e86053e77dbc936409",class:"doc-container",style:{backgroundColor:this.documentNameBg||"var(--bg-tertiary)",width:this.width||"auto"}},s("div",{key:"0aca7f3453dd4cb00f6105f1ca18d926d8efdf24",class:"document-name",style:{padding:this.documentNamePadding||"5px 10px 5px 0"}},s("span",{key:"b98bcb671c73ca6500c52249429f8303548d5a04",class:"attachment-icon"},s("img",{key:"b9a6c9ed0827994813dc5100236bb3ff74e927f2",src:this.iconSrc(),alt:""})),s("span",{key:"333f5385409b143f1232b6364485b6e84a1f8047"},t.firstLine,s("br",{key:"935710220f739f90eabb87ea6de85e81edeacd0e"}),t.secondLine)),s("a",{key:"6c3fd001ef1edec41f815dd11ce6c6a0fda7dad4",class:"download-btn",href:this.href,download:this.fileName,target:"_blank",rel:"noopener noreferrer","aria-label":"Download"},s("img",{key:"0fb2d7fda4c077b0b4da7effdf7190521fd28f20",src:jt,alt:""}))),i?s("div",{style:{fontSize:"8px",color:this.textColor,marginTop:"4px"}},h(this.message,this.mentionedUsers,(t=>r(this.tagUserClick,t)),!!this.isSelf)):null)}};It.style=":host { display: block; }\n .doc-container {\n display: flex; align-items: center; justify-content: space-between; gap: 8px;\n border-radius: 8px; padding: 4px 8px;\n }\n .document-name {\n display: flex; align-items: center; gap: 8px; word-break: break-word;\n font-size: 12px; line-height: 1.35;\n }\n .attachment-icon { display: flex; flex-shrink: 0; width: 24px; height: 30px; align-items: center; justify-content: center; }\n .attachment-icon img { width: 24px; height: 24px; object-fit: contain; display: block; }\n .download-btn {\n display: flex; align-items: center; justify-content: center;\n flex-shrink: 0; line-height: 0;\n }\n .download-btn img {\n width: 28px; height: 28px; display: block;\n filter: var(--svg-icon-filter);\n }";const St=class{constructor(s){t(this,s);this.tagUserClick=i(this,"tagUserClick",7);this.openGallery=t=>{var i;(i=this.onImageClick)===null||i===void 0?void 0:i.call(this,t);this.galleryOpen=true};this.bgColor=undefined;this.borderRadius="10px";this.padding="10px";this.imageSrc=undefined;this.message=undefined;this.height="220px";this.width="250px";this.time=undefined;this.isRead=undefined;this.isSelf=undefined;this.isDelivered=undefined;this.textColor=undefined;this.allAttachments=undefined;this.isMediaGalleryOpen=undefined;this.onImageClick=undefined;this.mentionedUsers=[];this.totalMedia=0;this.mediaType=undefined;this.loadingMediaGallery=undefined;this.messageId=undefined;this.reactions={};this.userMetaData=undefined;this.messageType=undefined;this.timeColor=undefined;this.showReactionOnHover=false;this.borderWidth=undefined;this.borderColor=undefined;this.borderStyle=undefined;this.galleryOpen=false}render(){const t=this.message&&!String(this.message).includes("AttachmentMessage:");return s("div",{key:"19c188f64d94fce0375cc619d9afbf208c3075b0"},s("message-bubble",{key:"3a00af150abc7d107a90e76458fafdfd3389c3b7",isSelf:!!this.isSelf,time:this.time,timeColor:this.timeColor,isRead:this.isRead,isDelivered:this.isDelivered,reactions:this.reactions,messageId:this.messageId,userMetaData:this.userMetaData,isForwarded:this.messageType===1,backgroundColor:this.bgColor,borderRadius:this.borderRadius||"10px",padding:this.padding||"10px",showReactionOnHover:this.showReactionOnHover},s("div",{key:"1484a65d6018059a0905be46028e740196ebff8e",class:"image-container",style:{width:this.width||"250px",height:this.height||"220px",borderRadius:this.borderRadius},onClick:this.openGallery},s("img",{key:"c49d11cf6f6f87141d5a8765cf9b4c256ffc3be5",src:this.imageSrc,alt:"image"}),this.totalMedia>0?s("span",{class:"mediaCount"}," + ",this.totalMedia):null),t?s("div",{style:{fontSize:"14px",color:this.textColor,marginTop:"4px"}},h(this.message,this.mentionedUsers,(t=>r(this.tagUserClick,t)),!!this.isSelf)):null),this.galleryOpen?s("div",{class:"gallery-overlay",onClick:()=>this.galleryOpen=false},s("button",{type:"button",class:"gallery-close","aria-label":"Close"},"×"),s("img",{src:this.imageSrc,alt:"full",onClick:t=>t.stopPropagation()})):null)}};St.style=":host { display: block; font-family: var(--font-primary); }\n .image-container { cursor: pointer; overflow: hidden; position: relative; }\n .image-container img { width: var(--w-full); height: var(--h-full); object-fit: cover; display: block; }\n .mediaCount {\n position: absolute; right: var(--space-8); bottom: var(--space-8);\n background: var(--overlay); color: var(--text-on-brand);\n padding: var(--gap-2) var(--gap-6); border-radius: var(--rounded-8); font-size: var(--text-12);\n }\n .gallery-overlay {\n position: fixed; inset: 0; background: var(--overlay); z-index: 9999;\n display: flex; align-items: center; justify-content: center;\n }\n .gallery-overlay img { max-width: 90vw; max-height: 90vh; object-fit: contain; }\n .gallery-close {\n position: absolute; top: var(--space-16); right: var(--space-16);\n color: var(--text-on-brand); font-size: var(--text-24);\n background: transparent; border: none; cursor: pointer;\n }";const Et=class{constructor(s){t(this,s);this.tagUserClick=i(this,"tagUserClick",7);this.playVideo=()=>{const t=this.videoEl();if(!t)return;t.play();this.isPlaying=true};this.pauseVideo=()=>{const t=this.videoEl();if(!t)return;t.pause();this.isPlaying=false};this.toggle=()=>this.isPlaying?this.pauseVideo():this.playVideo();this.fullscreen=()=>{var t;const i=this.videoEl();(t=i===null||i===void 0?void 0:i.requestFullscreen)===null||t===void 0?void 0:t.call(i)};this.bgColor=undefined;this.borderRadius="10px";this.padding="10px";this.videoSrc=undefined;this.videoType="video/mp4";this.time=undefined;this.height="150px";this.width="150px";this.playing=undefined;this.isRead=undefined;this.isSelf=undefined;this.isDelivered=undefined;this.textColor=undefined;this.message=undefined;this.mentionedUsers=[];this.messageId=undefined;this.reactions={};this.userMetaData=undefined;this.messageType=undefined;this.timeColor=undefined;this.showReactionOnHover=false;this.type=undefined;this.borderWidth=undefined;this.borderColor=undefined;this.borderStyle=undefined;this.isPlaying=false}videoEl(){var t;return((t=this.el.shadowRoot)===null||t===void 0?void 0:t.querySelector("video"))||null}render(){const t=this.message&&!String(this.message).includes("AttachmentMessage:");return s("message-bubble",{key:"53af459d4e8ca4043b42d7d8b9fa420bd6262d6c",isSelf:!!this.isSelf,time:this.time,timeColor:this.timeColor,isRead:this.isRead,isDelivered:this.isDelivered,reactions:this.reactions,messageId:this.messageId,userMetaData:this.userMetaData,isForwarded:this.messageType===1,backgroundColor:this.bgColor,borderRadius:this.borderRadius||"10px",padding:this.padding||"10px",showReactionOnHover:this.showReactionOnHover},s("div",{key:"56e1d8c7818bd520bf05af11df528cf4caf4bdd1",class:"video-wrap"},s("video",{key:"ee7fe48179d98574e8c5a0b0013fb8d41a4f87e0",style:{height:this.height||"150px",width:this.width||"150px",objectFit:"cover",borderRadius:this.borderRadius||"8px"},onClick:this.toggle},s("source",{key:"8a6cd53a2e83f2d95e55baedf4b0226435d1d785",src:this.videoSrc,type:this.videoType||"video/mp4"})),s("div",{key:"f6effc32d79d9c09dabdece9ecfb89959eca8e7d",class:"controls"},!this.isPlaying?s("button",{type:"button",onClick:this.playVideo,"aria-label":"Play"},"▶"):s("button",{type:"button",onClick:this.pauseVideo,"aria-label":"Pause"},"❚❚"),s("button",{key:"e9900ec1cbdce69521fb5cc5b1ff6d417d013dbf",type:"button",class:"video_fullscreen",onClick:this.fullscreen,"aria-label":"Fullscreen"},"⛶"))),t?s("div",{style:{fontSize:"14px",color:this.textColor,marginTop:"4px"}},h(this.message,this.mentionedUsers,(t=>r(this.tagUserClick,t)),!!this.isSelf)):null)}get el(){return e(this)}};Et.style=":host { display: block; position: relative; }\n .video-wrap { position: relative; width: fit-content; }\n .controls {\n position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none;\n }\n .controls button {\n pointer-events: auto; border: none; background: var(--overlay); color: var(--text-on-brand);\n cursor: pointer; padding: 8px 10px; border-radius: 8px; margin: 0 4px;\n }\n .video_fullscreen { position: absolute; right: 8px; bottom: 8px; }";export{Dt as audio_bubble,It as document_message,St as image_message,Et as video_message};
|
|
2
|
-
//# sourceMappingURL=p-3c690532.entry.js.map
|