@cloudflare/realtimekit-ui 1.0.9-staging.1 → 1.0.9-staging.3

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.
Files changed (683) hide show
  1. package/dist/browser.js +1 -1
  2. package/dist/cjs/ChatHead-e13f3b0e.js +13 -0
  3. package/dist/cjs/{TextMessage-23aacf34.js → TextMessage-7bb3e1fd.js} +1 -1
  4. package/dist/cjs/{chat-e37da504.js → chat-717e517d.js} +2 -2
  5. package/dist/cjs/{notification-822d615a.js → config-8c9ac89a.js} +2 -37
  6. package/dist/cjs/{ChatHead-6416d6cf.js → date-61ffcd0a.js} +0 -10
  7. package/dist/cjs/{debounce-5ee900cc.js → debounce-a3e0d9e7.js} +1 -1
  8. package/dist/cjs/index-05554ce6.js +62 -2
  9. package/dist/cjs/{index-fb18156f.js → index-8d07e125.js} +1 -1
  10. package/dist/cjs/index.cjs.js +13 -12
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/cjs/{merge-ca0928c5.js → merge-73e2770b.js} +1 -1
  13. package/dist/cjs/notification-567fe887.js +39 -0
  14. package/dist/cjs/realtimekit-ui.cjs.js +1 -1
  15. package/dist/cjs/rtk-ai-toggle.cjs.entry.js +2 -2
  16. package/dist/cjs/rtk-ai-transcriptions.cjs.entry.js +4 -3
  17. package/dist/cjs/rtk-ai.cjs.entry.js +2 -2
  18. package/dist/cjs/rtk-audio-grid.cjs.entry.js +2 -2
  19. package/dist/cjs/rtk-audio-tile.cjs.entry.js +2 -2
  20. package/dist/cjs/rtk-audio-visualizer_4.cjs.entry.js +2 -2
  21. package/dist/cjs/rtk-avatar_24.cjs.entry.js +2568 -0
  22. package/dist/cjs/rtk-breakout-room-manager_3.cjs.entry.js +397 -0
  23. package/dist/cjs/rtk-breakout-rooms-manager_9.cjs.entry.js +986 -0
  24. package/dist/cjs/rtk-breakout-rooms-toggle.cjs.entry.js +2 -2
  25. package/dist/cjs/rtk-camera-selector_2.cjs.entry.js +2 -2
  26. package/dist/cjs/rtk-camera-toggle.cjs.entry.js +2 -2
  27. package/dist/cjs/rtk-caption-toggle.cjs.entry.js +2 -2
  28. package/dist/cjs/rtk-channel-creator.cjs.entry.js +163 -0
  29. package/dist/cjs/rtk-channel-details.cjs.entry.js +49 -0
  30. package/dist/cjs/rtk-channel-header.cjs.entry.js +83 -0
  31. package/dist/cjs/rtk-channel-selector-ui.cjs.entry.js +6 -6
  32. package/dist/cjs/rtk-chat-composer-ui.cjs.entry.js +3 -3
  33. package/dist/cjs/rtk-chat-message.cjs.entry.js +118 -0
  34. package/dist/cjs/rtk-chat-messages-ui.cjs.entry.js +200 -0
  35. package/dist/cjs/rtk-chat-search-results.cjs.entry.js +57 -0
  36. package/dist/cjs/rtk-chat-selector-ui.cjs.entry.js +3 -3
  37. package/dist/cjs/rtk-chat-toggle.cjs.entry.js +10 -14
  38. package/dist/cjs/rtk-clock.cjs.entry.js +2 -2
  39. package/dist/cjs/rtk-controlbar-button.cjs.entry.js +2 -2
  40. package/dist/cjs/rtk-controlbar.cjs.entry.js +2 -2
  41. package/dist/cjs/rtk-debugger-audio_4.cjs.entry.js +686 -0
  42. package/dist/cjs/rtk-debugger-toggle.cjs.entry.js +2 -2
  43. package/dist/cjs/rtk-dialog-manager.cjs.entry.js +154 -0
  44. package/dist/cjs/rtk-dialog.cjs.entry.js +93 -0
  45. package/dist/cjs/rtk-ended-screen.cjs.entry.js +2 -2
  46. package/dist/cjs/rtk-file-dropzone.cjs.entry.js +2 -2
  47. package/dist/cjs/rtk-file-message_3.cjs.entry.js +148 -0
  48. package/dist/cjs/rtk-fullscreen-toggle.cjs.entry.js +2 -2
  49. package/dist/cjs/rtk-grid-pagination.cjs.entry.js +2 -2
  50. package/dist/cjs/rtk-grid.cjs.entry.js +2 -2
  51. package/dist/cjs/rtk-header.cjs.entry.js +2 -2
  52. package/dist/cjs/rtk-idle-screen.cjs.entry.js +2 -2
  53. package/dist/cjs/rtk-image-viewer.cjs.entry.js +2 -2
  54. package/dist/cjs/rtk-information-tooltip.cjs.entry.js +2 -2
  55. package/dist/cjs/rtk-leave-button.cjs.entry.js +2 -2
  56. package/dist/cjs/rtk-livestream-indicator_3.cjs.entry.js +2 -2
  57. package/dist/cjs/rtk-livestream-toggle.cjs.entry.js +2 -2
  58. package/dist/cjs/rtk-logo.cjs.entry.js +77 -0
  59. package/dist/cjs/rtk-meeting-title.cjs.entry.js +2 -2
  60. package/dist/cjs/rtk-message-list-view.cjs.entry.js +3 -3
  61. package/dist/cjs/rtk-mic-toggle.cjs.entry.js +2 -2
  62. package/dist/cjs/rtk-mixed-grid.cjs.entry.js +2 -2
  63. package/dist/cjs/rtk-more-toggle.cjs.entry.js +2 -2
  64. package/dist/cjs/rtk-mute-all-button.cjs.entry.js +2 -2
  65. package/dist/cjs/rtk-name-tag.cjs.entry.js +2 -2
  66. package/dist/cjs/rtk-network-indicator.cjs.entry.js +2 -2
  67. package/dist/cjs/rtk-notification.cjs.entry.js +71 -0
  68. package/dist/cjs/rtk-notifications.cjs.entry.js +588 -0
  69. package/dist/cjs/rtk-participant-count.cjs.entry.js +2 -2
  70. package/dist/cjs/rtk-participant-setup.cjs.entry.js +2 -2
  71. package/dist/cjs/rtk-participant_2.cjs.entry.js +3 -3
  72. package/dist/cjs/rtk-participants-audio.cjs.entry.js +2 -2
  73. package/dist/cjs/rtk-participants-stage-list_4.cjs.entry.js +2 -2
  74. package/dist/cjs/rtk-participants-toggle.cjs.entry.js +3 -3
  75. package/dist/cjs/rtk-participants.cjs.entry.js +3 -3
  76. package/dist/cjs/rtk-pip-toggle.cjs.entry.js +2 -2
  77. package/dist/cjs/rtk-plugin-main_2.cjs.entry.js +2 -2
  78. package/dist/cjs/rtk-plugins-toggle.cjs.entry.js +3 -3
  79. package/dist/cjs/rtk-plugins_2.cjs.entry.js +2 -2
  80. package/dist/cjs/rtk-poll_2.cjs.entry.js +2 -2
  81. package/dist/cjs/rtk-polls-toggle.cjs.entry.js +3 -3
  82. package/dist/cjs/rtk-recording-indicator.cjs.entry.js +2 -2
  83. package/dist/cjs/rtk-recording-toggle.cjs.entry.js +2 -2
  84. package/dist/cjs/rtk-screen-share-toggle.cjs.entry.js +2 -2
  85. package/dist/cjs/rtk-screenshare-view.cjs.entry.js +2 -2
  86. package/dist/cjs/rtk-settings-audio_2.cjs.entry.js +2 -2
  87. package/dist/cjs/rtk-settings-toggle.cjs.entry.js +2 -2
  88. package/dist/cjs/rtk-settings.cjs.entry.js +2 -2
  89. package/dist/cjs/rtk-setup-screen.cjs.entry.js +2 -2
  90. package/dist/cjs/rtk-sidebar-ui.cjs.entry.js +2 -2
  91. package/dist/cjs/rtk-sidebar.cjs.entry.js +4 -4
  92. package/dist/cjs/rtk-simple-grid.cjs.entry.js +2 -2
  93. package/dist/cjs/rtk-spotlight-grid.cjs.entry.js +2 -2
  94. package/dist/cjs/rtk-spotlight-indicator.cjs.entry.js +2 -2
  95. package/dist/cjs/rtk-stage-toggle.cjs.entry.js +2 -2
  96. package/dist/cjs/rtk-stage.cjs.entry.js +2 -2
  97. package/dist/cjs/rtk-transcript.cjs.entry.js +2 -2
  98. package/dist/cjs/rtk-transcripts.cjs.entry.js +2 -2
  99. package/dist/cjs/rtk-ui-provider.cjs.entry.js +2 -2
  100. package/dist/cjs/rtk-waiting-screen.cjs.entry.js +2 -2
  101. package/dist/cjs/{sidebar-89748c6c.js → sidebar-2ad915b1.js} +1 -1
  102. package/dist/cjs/{ui-store-e096fdc6.js → ui-store-1cb28da8.js} +72 -79
  103. package/dist/collection/components/rtk-ai/rtk-ai.js +1 -1
  104. package/dist/collection/components/rtk-ai-toggle/rtk-ai-toggle.js +1 -1
  105. package/dist/collection/components/rtk-ai-transcriptions/rtk-ai-transcriptions.js +1 -1
  106. package/dist/collection/components/rtk-audio-grid/rtk-audio-grid.js +1 -1
  107. package/dist/collection/components/rtk-audio-tile/rtk-audio-tile.js +2 -2
  108. package/dist/collection/components/rtk-audio-visualizer/rtk-audio-visualizer.js +2 -2
  109. package/dist/collection/components/rtk-avatar/rtk-avatar.js +2 -2
  110. package/dist/collection/components/rtk-breakout-room-manager/rtk-breakout-room-manager.js +7 -11
  111. package/dist/collection/components/rtk-breakout-room-participants/rtk-breakout-room-participants.js +1 -1
  112. package/dist/collection/components/rtk-breakout-room-toggle/rtk-breakout-rooms-toggle.js +2 -2
  113. package/dist/collection/components/rtk-breakout-rooms-manager/rtk-breakout-rooms-manager.js +2 -2
  114. package/dist/collection/components/rtk-broadcast-message-modal/rtk-broadcast-message-modal.js +1 -1
  115. package/dist/collection/components/rtk-camera-selector/rtk-camera-selector.js +1 -1
  116. package/dist/collection/components/rtk-camera-toggle/rtk-camera-toggle.js +1 -1
  117. package/dist/collection/components/rtk-caption-toggle/rtk-caption-toggle.js +1 -1
  118. package/dist/collection/components/rtk-channel-creator/rtk-channel-creator.js +6 -3
  119. package/dist/collection/components/rtk-channel-details/rtk-channel-details.js +3 -2
  120. package/dist/collection/components/rtk-channel-header/rtk-channel-header.js +2 -1
  121. package/dist/collection/components/rtk-channel-selector-ui/rtk-channel-selector-ui.js +6 -3
  122. package/dist/collection/components/rtk-channel-selector-view/rtk-channel-selector-view.js +3 -3
  123. package/dist/collection/components/rtk-chat/rtk-chat.js +7 -104
  124. package/dist/collection/components/rtk-chat-composer-ui/rtk-chat-composer-ui.js +1 -1
  125. package/dist/collection/components/rtk-chat-composer-view/rtk-chat-composer-view.js +1 -1
  126. package/dist/collection/components/rtk-chat-message/rtk-chat-message.js +4 -3
  127. package/dist/collection/components/rtk-chat-messages-ui/rtk-chat-messages-ui.js +14 -5
  128. package/dist/collection/components/rtk-chat-messages-ui-paginated/rtk-chat-messages-ui-paginated.js +5 -3
  129. package/dist/collection/components/rtk-chat-search-results/rtk-chat-search-results.js +3 -2
  130. package/dist/collection/components/rtk-chat-selector-ui/rtk-chat-selector-ui.js +1 -1
  131. package/dist/collection/components/rtk-chat-toggle/rtk-chat-toggle.js +7 -9
  132. package/dist/collection/components/rtk-confirmation-modal/rtk-confirmation-modal.js +1 -1
  133. package/dist/collection/components/rtk-controlbar/rtk-controlbar.js +1 -1
  134. package/dist/collection/components/rtk-counter/rtk-counter.js +1 -1
  135. package/dist/collection/components/rtk-debugger/rtk-debugger.js +1 -1
  136. package/dist/collection/components/rtk-debugger-audio/rtk-debugger-audio.js +1 -1
  137. package/dist/collection/components/rtk-debugger-screenshare/rtk-debugger-screenshare.js +1 -1
  138. package/dist/collection/components/rtk-debugger-system/rtk-debugger-system.js +1 -1
  139. package/dist/collection/components/rtk-debugger-toggle/rtk-debugger-toggle.js +1 -1
  140. package/dist/collection/components/rtk-debugger-video/rtk-debugger-video.js +1 -1
  141. package/dist/collection/components/rtk-dialog/rtk-dialog.js +1 -1
  142. package/dist/collection/components/rtk-dialog-manager/rtk-dialog-manager.js +1 -7
  143. package/dist/collection/components/rtk-draft-attachment-view/rtk-draft-attachment-view.js +1 -1
  144. package/dist/collection/components/rtk-emoji-picker/rtk-emoji-picker.js +1 -1
  145. package/dist/collection/components/rtk-emoji-picker-button/rtk-emoji-picker-button.js +1 -1
  146. package/dist/collection/components/rtk-ended-screen/rtk-ended-screen.js +1 -1
  147. package/dist/collection/components/rtk-file-dropzone/rtk-file-dropzone.js +1 -1
  148. package/dist/collection/components/rtk-file-message/rtk-file-message.js +4 -3
  149. package/dist/collection/components/rtk-file-picker-button/rtk-file-picker-button.js +2 -2
  150. package/dist/collection/components/rtk-fullscreen-toggle/rtk-fullscreen-toggle.js +1 -1
  151. package/dist/collection/components/rtk-grid/rtk-grid.js +1 -1
  152. package/dist/collection/components/rtk-grid-pagination/rtk-grid-pagination.js +1 -1
  153. package/dist/collection/components/rtk-header/rtk-header.js +1 -1
  154. package/dist/collection/components/rtk-idle-screen/rtk-idle-screen.js +1 -1
  155. package/dist/collection/components/rtk-image-message/rtk-image-message.js +6 -5
  156. package/dist/collection/components/rtk-image-message-view/rtk-image-message-view.js +1 -1
  157. package/dist/collection/components/rtk-image-viewer/rtk-image-viewer.js +1 -1
  158. package/dist/collection/components/rtk-join-stage/rtk-join-stage.js +1 -1
  159. package/dist/collection/components/rtk-leave-button/rtk-leave-button.js +1 -1
  160. package/dist/collection/components/rtk-leave-meeting/rtk-leave-meeting.js +1 -1
  161. package/dist/collection/components/rtk-livestream-indicator/rtk-livestream-indicator.js +1 -1
  162. package/dist/collection/components/rtk-livestream-player/rtk-livestream-player.js +1 -1
  163. package/dist/collection/components/rtk-livestream-toggle/rtk-livestream-toggle.js +1 -1
  164. package/dist/collection/components/rtk-logo/rtk-logo.js +1 -1
  165. package/dist/collection/components/rtk-meeting/rtk-meeting.js +1 -1
  166. package/dist/collection/components/rtk-meeting-title/rtk-meeting-title.js +1 -1
  167. package/dist/collection/components/rtk-menu/rtk-menu.js +1 -1
  168. package/dist/collection/components/rtk-menu-item/rtk-menu-item.js +1 -1
  169. package/dist/collection/components/rtk-menu-list/rtk-menu-list.js +1 -1
  170. package/dist/collection/components/rtk-message-view/rtk-message-view.css +26 -12
  171. package/dist/collection/components/rtk-message-view/rtk-message-view.js +23 -1
  172. package/dist/collection/components/rtk-mic-toggle/rtk-mic-toggle.js +1 -1
  173. package/dist/collection/components/rtk-microphone-selector/rtk-microphone-selector.js +1 -1
  174. package/dist/collection/components/rtk-mixed-grid/rtk-mixed-grid.js +1 -1
  175. package/dist/collection/components/rtk-more-toggle/rtk-more-toggle.js +1 -1
  176. package/dist/collection/components/rtk-mute-all-button/rtk-mute-all-button.js +1 -1
  177. package/dist/collection/components/rtk-mute-all-confirmation/rtk-mute-all-confirmation.js +1 -1
  178. package/dist/collection/components/rtk-name-tag/rtk-name-tag.js +2 -2
  179. package/dist/collection/components/rtk-network-indicator/rtk-network-indicator.js +2 -2
  180. package/dist/collection/components/rtk-notification/rtk-notification.js +1 -1
  181. package/dist/collection/components/rtk-notifications/rtk-notifications.js +1 -1
  182. package/dist/collection/components/rtk-overlay-modal/rtk-overlay-modal.js +1 -1
  183. package/dist/collection/components/rtk-paginated-list/rtk-paginated-list.css +2 -1
  184. package/dist/collection/components/rtk-paginated-list/rtk-paginated-list.js +4 -20
  185. package/dist/collection/components/rtk-participant/rtk-participant.js +2 -2
  186. package/dist/collection/components/rtk-participant-count/rtk-participant-count.js +1 -1
  187. package/dist/collection/components/rtk-participant-setup/rtk-participant-setup.js +2 -2
  188. package/dist/collection/components/rtk-participant-tile/rtk-participant-tile.js +3 -3
  189. package/dist/collection/components/rtk-participants/rtk-participants.js +1 -1
  190. package/dist/collection/components/rtk-participants-audio/rtk-participants-audio.js +1 -1
  191. package/dist/collection/components/rtk-participants-stage-list/rtk-participants-stage-list.js +1 -1
  192. package/dist/collection/components/rtk-participants-stage-queue/rtk-participants-stage-queue.js +1 -1
  193. package/dist/collection/components/rtk-participants-toggle/rtk-participants-toggle.js +1 -1
  194. package/dist/collection/components/rtk-participants-viewer-list/rtk-participants-viewer-list.js +1 -1
  195. package/dist/collection/components/rtk-participants-waiting-list/rtk-participants-waiting-list.js +1 -1
  196. package/dist/collection/components/rtk-permissions-message/rtk-permissions-message.js +1 -1
  197. package/dist/collection/components/rtk-pip-toggle/rtk-pip-toggle.js +1 -1
  198. package/dist/collection/components/rtk-plugin-main/rtk-plugin-main.js +1 -1
  199. package/dist/collection/components/rtk-plugins/rtk-plugins.js +1 -1
  200. package/dist/collection/components/rtk-plugins-toggle/rtk-plugins-toggle.js +1 -1
  201. package/dist/collection/components/rtk-poll/rtk-poll.js +1 -1
  202. package/dist/collection/components/rtk-poll-form/rtk-poll-form.js +1 -1
  203. package/dist/collection/components/rtk-polls/rtk-polls.js +1 -1
  204. package/dist/collection/components/rtk-polls-toggle/rtk-polls-toggle.js +1 -1
  205. package/dist/collection/components/rtk-recording-indicator/rtk-recording-indicator.js +1 -1
  206. package/dist/collection/components/rtk-recording-toggle/rtk-recording-toggle.js +1 -1
  207. package/dist/collection/components/rtk-screen-share-toggle/rtk-screen-share-toggle.js +1 -1
  208. package/dist/collection/components/rtk-screenshare-view/rtk-screenshare-view.js +2 -2
  209. package/dist/collection/components/rtk-settings/rtk-settings.js +1 -1
  210. package/dist/collection/components/rtk-settings-audio/rtk-settings-audio.js +1 -1
  211. package/dist/collection/components/rtk-settings-toggle/rtk-settings-toggle.js +1 -1
  212. package/dist/collection/components/rtk-settings-video/rtk-settings-video.js +1 -1
  213. package/dist/collection/components/rtk-setup-screen/rtk-setup-screen.js +1 -1
  214. package/dist/collection/components/rtk-sidebar/rtk-sidebar.css +2 -0
  215. package/dist/collection/components/rtk-sidebar/rtk-sidebar.js +1 -1
  216. package/dist/collection/components/rtk-sidebar-ui/rtk-sidebar-ui.js +1 -1
  217. package/dist/collection/components/rtk-simple-grid/rtk-simple-grid.js +1 -1
  218. package/dist/collection/components/rtk-speaker-selector/rtk-speaker-selector.js +1 -1
  219. package/dist/collection/components/rtk-spotlight-grid/rtk-spotlight-grid.js +1 -1
  220. package/dist/collection/components/rtk-spotlight-indicator/rtk-spotlight-indicator.js +1 -1
  221. package/dist/collection/components/rtk-stage/rtk-stage.js +1 -1
  222. package/dist/collection/components/rtk-stage-toggle/rtk-stage-toggle.js +1 -1
  223. package/dist/collection/components/rtk-switch/rtk-switch.js +1 -1
  224. package/dist/collection/components/rtk-tab-bar/rtk-tab-bar.js +1 -1
  225. package/dist/collection/components/rtk-text-composer-view/rtk-text-composer-view.js +1 -1
  226. package/dist/collection/components/rtk-text-message/rtk-text-message.js +4 -3
  227. package/dist/collection/components/rtk-transcript/rtk-transcript.js +1 -1
  228. package/dist/collection/components/rtk-transcripts/rtk-transcripts.js +1 -1
  229. package/dist/collection/components/rtk-ui-provider/rtk-ui-provider.js +1 -1
  230. package/dist/collection/components/rtk-viewer-count/rtk-viewer-count.js +1 -1
  231. package/dist/collection/components/rtk-waiting-screen/rtk-waiting-screen.js +1 -1
  232. package/dist/collection/utils/chat.js +1 -1
  233. package/dist/collection/utils/flags.js +1 -7
  234. package/dist/components/index.js +7 -7
  235. package/dist/components/{p-c7ca0840.js → p-013ffc19.js} +3 -3
  236. package/dist/components/{p-cfbd1c8a.js → p-024ef28a.js} +2 -2
  237. package/dist/components/{p-7827c27d.js → p-027ec380.js} +6 -6
  238. package/dist/components/{p-d926df40.js → p-06e20f42.js} +2 -2
  239. package/dist/components/{p-9db751ca.js → p-08382c59.js} +5 -5
  240. package/dist/components/{p-dcb240cb.js → p-0bbd0056.js} +2 -2
  241. package/dist/components/{p-9cc8f284.js → p-102b6df8.js} +2 -2
  242. package/dist/components/{p-517eed51.js → p-121e073d.js} +2 -2
  243. package/dist/components/{p-bcd9ae7c.js → p-1f320625.js} +48 -325
  244. package/dist/components/{p-bdb2d1f9.js → p-244cbe7b.js} +2 -2
  245. package/dist/components/{p-073066d9.js → p-2508ac98.js} +2 -2
  246. package/dist/components/{p-b3f547d5.js → p-2590f470.js} +3 -3
  247. package/dist/components/{p-59bdb49b.js → p-25ca06f2.js} +2 -2
  248. package/dist/components/{p-4ac416da.js → p-27fea689.js} +4 -4
  249. package/dist/components/{p-5183c437.js → p-2d08ab28.js} +2 -2
  250. package/dist/components/{p-68ea23a4.js → p-2ea7652f.js} +2 -2
  251. package/dist/components/{p-8aa0a20a.js → p-30ac9705.js} +6 -21
  252. package/dist/components/{p-750e6dd1.js → p-31c44fed.js} +6 -6
  253. package/dist/components/{p-c46fca60.js → p-32609f9f.js} +12 -9
  254. package/dist/components/{p-0599a377.js → p-32bf6a44.js} +4 -4
  255. package/dist/components/{p-a05c75f3.js → p-335f937c.js} +2 -2
  256. package/dist/components/{p-f7bea1a7.js → p-33a87325.js} +2 -2
  257. package/dist/components/{p-a960414f.js → p-3d3fa677.js} +2 -2
  258. package/dist/components/{p-a3948b63.js → p-3fa8f1e1.js} +2 -2
  259. package/dist/components/{p-bbe38af7.js → p-47c25f64.js} +1 -1
  260. package/dist/components/{p-e16baa62.js → p-498c01a6.js} +2 -2
  261. package/dist/components/{p-aceb63f7.js → p-4b542718.js} +2 -2
  262. package/dist/components/{p-4db644b9.js → p-4c7f1a19.js} +2 -2
  263. package/dist/components/{p-3de94128.js → p-51de7af3.js} +1 -1
  264. package/dist/components/{p-cc3e758a.js → p-52d1525c.js} +2 -2
  265. package/dist/components/{p-f5f0b499.js → p-560e7a4f.js} +1 -1
  266. package/dist/components/{p-93e1439e.js → p-566c1155.js} +1 -1
  267. package/dist/components/{p-9c762c7c.js → p-5b03154d.js} +3 -3
  268. package/dist/components/{p-21caffae.js → p-5f26bba3.js} +2 -2
  269. package/dist/components/{p-42672814.js → p-63953295.js} +2 -2
  270. package/dist/components/{p-f92f9ef2.js → p-6756b222.js} +2 -2
  271. package/dist/components/{p-53ff409b.js → p-68c9100f.js} +2 -2
  272. package/dist/components/{p-34688fcf.js → p-6c1b380d.js} +12 -12
  273. package/dist/components/{p-00d593e1.js → p-6cbaf90a.js} +2 -2
  274. package/dist/components/{p-4163391e.js → p-6eabd1ad.js} +3 -3
  275. package/dist/components/{p-92738209.js → p-6f340109.js} +1 -1
  276. package/dist/components/{p-ba1f008f.js → p-724074c4.js} +5 -5
  277. package/dist/components/{p-82b52967.js → p-7481511c.js} +2 -2
  278. package/dist/components/{p-6f1af797.js → p-78b61cce.js} +1 -1
  279. package/dist/components/{p-f45ff21a.js → p-7a322c43.js} +3 -3
  280. package/dist/components/{p-bf700149.js → p-7fc0dc2f.js} +73 -79
  281. package/dist/components/{p-e727691a.js → p-82c678d6.js} +7 -7
  282. package/dist/components/{p-4a194b9f.js → p-82f8c924.js} +2 -2
  283. package/dist/components/{p-b15d2763.js → p-84e5b453.js} +2 -2
  284. package/dist/components/{p-0a74af4f.js → p-88e50eea.js} +17 -15
  285. package/dist/components/{p-a234bf1a.js → p-97e1e186.js} +2 -2
  286. package/dist/components/{p-ac19035c.js → p-9c2c0760.js} +7 -7
  287. package/dist/components/{p-26a20701.js → p-9e87b2c9.js} +2 -2
  288. package/dist/components/{p-4d154773.js → p-9fd18352.js} +2 -2
  289. package/dist/components/{p-c46abf5d.js → p-a0c8422f.js} +4 -4
  290. package/dist/components/{p-484bc00f.js → p-a10b9faa.js} +2 -2
  291. package/dist/components/{p-0ebf838c.js → p-a159952c.js} +2 -2
  292. package/dist/components/{p-dbdc62e6.js → p-a29c01fc.js} +2 -2
  293. package/dist/components/{p-54c33b11.js → p-a4b26604.js} +4 -4
  294. package/dist/components/{p-a2f4f9e3.js → p-aae4c250.js} +1 -1
  295. package/dist/components/{p-8c5e42ea.js → p-afe77b50.js} +2 -2
  296. package/dist/components/{p-9645c983.js → p-b1338b4f.js} +3 -3
  297. package/dist/components/{p-47230f49.js → p-b397a600.js} +10 -14
  298. package/dist/components/{p-8dd72d80.js → p-b6ee1a32.js} +2 -2
  299. package/dist/components/{p-00cddac4.js → p-b762cf1e.js} +11 -11
  300. package/dist/components/{p-3260a0fe.js → p-bb8f2597.js} +6 -6
  301. package/dist/components/{p-bfd30b77.js → p-be9fe914.js} +7 -7
  302. package/dist/components/{p-176c5195.js → p-c078ae06.js} +2 -2
  303. package/dist/components/{p-00b48a12.js → p-c07e3e6d.js} +2 -2
  304. package/dist/components/{p-221a4186.js → p-c515acba.js} +2 -2
  305. package/dist/components/{p-61e6e7be.js → p-cf503999.js} +2 -2
  306. package/dist/components/{p-66eda965.js → p-d06d1eac.js} +2 -2
  307. package/dist/components/{p-0abe4b8a.js → p-dab9d3d6.js} +1 -1
  308. package/dist/components/{p-58e7fbf9.js → p-e48cd596.js} +4 -4
  309. package/dist/components/{p-963afa79.js → p-e732b5ee.js} +4 -4
  310. package/dist/components/{p-e248d815.js → p-e87b68de.js} +5 -5
  311. package/dist/components/{p-1425697e.js → p-eb7df0eb.js} +6 -6
  312. package/dist/components/{p-1fb97660.js → p-ef71b75e.js} +5 -5
  313. package/dist/components/{p-1d32657e.js → p-fa7412e2.js} +2 -2
  314. package/dist/components/{p-23ab84b1.js → p-fc21299d.js} +2 -2
  315. package/dist/components/{p-2ecff14a.js → p-fdb67d1f.js} +2 -2
  316. package/dist/components/rtk-ai-toggle.js +4 -4
  317. package/dist/components/rtk-ai-transcriptions.js +1 -1
  318. package/dist/components/rtk-ai.js +3 -3
  319. package/dist/components/rtk-audio-grid.js +2 -2
  320. package/dist/components/rtk-audio-tile.js +5 -5
  321. package/dist/components/rtk-audio-visualizer.js +1 -1
  322. package/dist/components/rtk-avatar.js +1 -1
  323. package/dist/components/rtk-breakout-room-manager.js +1 -1
  324. package/dist/components/rtk-breakout-room-participants.js +1 -1
  325. package/dist/components/rtk-breakout-rooms-manager.js +1 -1
  326. package/dist/components/rtk-breakout-rooms-toggle.js +4 -4
  327. package/dist/components/rtk-broadcast-message-modal.js +1 -1
  328. package/dist/components/rtk-camera-selector.js +1 -1
  329. package/dist/components/rtk-camera-toggle.js +4 -4
  330. package/dist/components/rtk-caption-toggle.js +4 -4
  331. package/dist/components/rtk-channel-creator.js +209 -1
  332. package/dist/components/rtk-channel-details.js +1 -1
  333. package/dist/components/rtk-channel-header.js +146 -1
  334. package/dist/components/rtk-channel-selector-ui.js +7 -7
  335. package/dist/components/rtk-channel-selector-view.js +1 -1
  336. package/dist/components/rtk-chat-composer-ui.js +6 -6
  337. package/dist/components/rtk-chat-composer-view.js +1 -1
  338. package/dist/components/rtk-chat-message.js +1 -1
  339. package/dist/components/rtk-chat-messages-ui-paginated.js +1 -1
  340. package/dist/components/rtk-chat-messages-ui.js +302 -1
  341. package/dist/components/rtk-chat-search-results.js +146 -1
  342. package/dist/components/rtk-chat-selector-ui.js +3 -3
  343. package/dist/components/rtk-chat-toggle.js +12 -16
  344. package/dist/components/rtk-chat.js +1 -1
  345. package/dist/components/rtk-clock.js +2 -2
  346. package/dist/components/rtk-confirmation-modal.js +1 -1
  347. package/dist/components/rtk-controlbar-button.js +1 -1
  348. package/dist/components/rtk-controlbar.js +2 -2
  349. package/dist/components/rtk-counter.js +1 -1
  350. package/dist/components/rtk-debugger-audio.js +1 -1
  351. package/dist/components/rtk-debugger-screenshare.js +1 -1
  352. package/dist/components/rtk-debugger-system.js +1 -1
  353. package/dist/components/rtk-debugger-toggle.js +4 -4
  354. package/dist/components/rtk-debugger-video.js +1 -1
  355. package/dist/components/rtk-debugger.js +1 -1
  356. package/dist/components/rtk-dialog-manager.js +305 -1
  357. package/dist/components/rtk-dialog.js +1 -1
  358. package/dist/components/rtk-draft-attachment-view.js +1 -1
  359. package/dist/components/rtk-emoji-picker-button.js +1 -1
  360. package/dist/components/rtk-emoji-picker.js +1 -1
  361. package/dist/components/rtk-ended-screen.js +3 -3
  362. package/dist/components/rtk-file-dropzone.js +2 -2
  363. package/dist/components/rtk-file-message-view.js +1 -1
  364. package/dist/components/rtk-file-message.js +1 -1
  365. package/dist/components/rtk-file-picker-button.js +1 -1
  366. package/dist/components/rtk-fullscreen-toggle.js +1 -1
  367. package/dist/components/rtk-grid-pagination.js +2 -2
  368. package/dist/components/rtk-grid.js +8 -8
  369. package/dist/components/rtk-header.js +2 -2
  370. package/dist/components/rtk-idle-screen.js +4 -4
  371. package/dist/components/rtk-image-message-view.js +1 -1
  372. package/dist/components/rtk-image-message.js +1 -1
  373. package/dist/components/rtk-image-viewer.js +2 -2
  374. package/dist/components/rtk-information-tooltip.js +2 -2
  375. package/dist/components/rtk-join-stage.js +1 -1
  376. package/dist/components/rtk-leave-button.js +4 -4
  377. package/dist/components/rtk-leave-meeting.js +1 -1
  378. package/dist/components/rtk-livestream-indicator.js +1 -1
  379. package/dist/components/rtk-livestream-player.js +1 -1
  380. package/dist/components/rtk-livestream-toggle.js +4 -4
  381. package/dist/components/rtk-logo.js +1 -1
  382. package/dist/components/rtk-markdown-view.js +1 -1
  383. package/dist/components/rtk-meeting-title.js +2 -2
  384. package/dist/components/rtk-meeting.js +46 -226
  385. package/dist/components/rtk-menu-item.js +1 -1
  386. package/dist/components/rtk-menu-list.js +1 -1
  387. package/dist/components/rtk-menu.js +1 -1
  388. package/dist/components/rtk-message-list-view.js +3 -3
  389. package/dist/components/rtk-message-view.js +1 -1
  390. package/dist/components/rtk-mic-toggle.js +4 -4
  391. package/dist/components/rtk-microphone-selector.js +1 -1
  392. package/dist/components/rtk-mixed-grid.js +5 -5
  393. package/dist/components/rtk-more-toggle.js +4 -4
  394. package/dist/components/rtk-mute-all-button.js +4 -4
  395. package/dist/components/rtk-mute-all-confirmation.js +1 -1
  396. package/dist/components/rtk-name-tag.js +1 -1
  397. package/dist/components/rtk-network-indicator.js +2 -2
  398. package/dist/components/rtk-notification.js +1 -1
  399. package/dist/components/rtk-notifications.js +629 -1
  400. package/dist/components/rtk-overlay-modal.js +1 -1
  401. package/dist/components/rtk-paginated-list.js +1 -1
  402. package/dist/components/rtk-participant-count.js +2 -2
  403. package/dist/components/rtk-participant-setup.js +2 -2
  404. package/dist/components/rtk-participant-tile.js +1 -1
  405. package/dist/components/rtk-participant.js +1 -1
  406. package/dist/components/rtk-participants-audio.js +3 -3
  407. package/dist/components/rtk-participants-stage-list.js +1 -1
  408. package/dist/components/rtk-participants-stage-queue.js +1 -1
  409. package/dist/components/rtk-participants-toggle.js +5 -5
  410. package/dist/components/rtk-participants-viewer-list.js +1 -1
  411. package/dist/components/rtk-participants-waiting-list.js +1 -1
  412. package/dist/components/rtk-participants.js +12 -12
  413. package/dist/components/rtk-permissions-message.js +1 -1
  414. package/dist/components/rtk-pip-toggle.js +4 -4
  415. package/dist/components/rtk-plugin-main.js +1 -1
  416. package/dist/components/rtk-plugins-toggle.js +5 -5
  417. package/dist/components/rtk-plugins.js +1 -1
  418. package/dist/components/rtk-poll-form.js +1 -1
  419. package/dist/components/rtk-poll.js +1 -1
  420. package/dist/components/rtk-polls-toggle.js +5 -5
  421. package/dist/components/rtk-polls.js +1 -1
  422. package/dist/components/rtk-recording-indicator.js +2 -2
  423. package/dist/components/rtk-recording-toggle.js +4 -4
  424. package/dist/components/rtk-screen-share-toggle.js +4 -4
  425. package/dist/components/rtk-screenshare-view.js +2 -2
  426. package/dist/components/rtk-settings-audio.js +1 -1
  427. package/dist/components/rtk-settings-toggle.js +4 -4
  428. package/dist/components/rtk-settings-video.js +1 -1
  429. package/dist/components/rtk-settings.js +10 -10
  430. package/dist/components/rtk-setup-screen.js +6 -6
  431. package/dist/components/rtk-sidebar-ui.js +1 -1
  432. package/dist/components/rtk-sidebar.js +9 -9
  433. package/dist/components/rtk-simple-grid.js +2 -2
  434. package/dist/components/rtk-speaker-selector.js +1 -1
  435. package/dist/components/rtk-spinner.js +1 -1
  436. package/dist/components/rtk-spotlight-grid.js +2 -2
  437. package/dist/components/rtk-spotlight-indicator.js +1 -1
  438. package/dist/components/rtk-stage-toggle.js +4 -4
  439. package/dist/components/rtk-stage.js +2 -2
  440. package/dist/components/rtk-switch.js +1 -1
  441. package/dist/components/rtk-tab-bar.js +1 -1
  442. package/dist/components/rtk-text-composer-view.js +1 -1
  443. package/dist/components/rtk-text-message-view.js +1 -1
  444. package/dist/components/rtk-text-message.js +1 -1
  445. package/dist/components/rtk-transcript.js +1 -1
  446. package/dist/components/rtk-transcripts.js +3 -3
  447. package/dist/components/rtk-ui-provider.js +2 -2
  448. package/dist/components/rtk-viewer-count.js +1 -1
  449. package/dist/components/rtk-waiting-screen.js +3 -3
  450. package/dist/docs/docs-components.json +2362 -2606
  451. package/dist/docs/docs-vscode.json +17 -13
  452. package/dist/esm/ChatHead-15c2f8d4.js +11 -0
  453. package/dist/esm/{TextMessage-5f73acf3.js → TextMessage-ca92045e.js} +1 -1
  454. package/dist/esm/{chat-d13dedd6.js → chat-ff185374.js} +2 -2
  455. package/dist/esm/{notification-b6d024c7.js → config-e684aa4d.js} +3 -37
  456. package/dist/esm/{ChatHead-11b92a26.js → date-b1f78dea.js} +1 -10
  457. package/dist/esm/{debounce-6e6d522e.js → debounce-3ea4df36.js} +1 -1
  458. package/dist/esm/{file-849468c1.js → file-6114f1a9.js} +1 -1
  459. package/dist/esm/index-c1fb98bb.js +62 -2
  460. package/dist/esm/{index-e1ee8258.js → index-e65afca5.js} +1 -1
  461. package/dist/esm/index.js +7 -6
  462. package/dist/esm/loader.js +13463 -13501
  463. package/dist/esm/{merge-783d3076.js → merge-7ffc04b3.js} +1 -1
  464. package/dist/esm/notification-78afaabf.js +37 -0
  465. package/dist/esm/realtimekit-ui.js +1 -1
  466. package/dist/esm/rtk-ai-toggle.entry.js +2 -2
  467. package/dist/esm/rtk-ai-transcriptions.entry.js +5 -4
  468. package/dist/esm/rtk-ai.entry.js +2 -2
  469. package/dist/esm/rtk-audio-grid.entry.js +2 -2
  470. package/dist/esm/rtk-audio-tile.entry.js +2 -2
  471. package/dist/esm/rtk-audio-visualizer_4.entry.js +2 -2
  472. package/dist/esm/rtk-avatar_24.entry.js +2541 -0
  473. package/dist/esm/rtk-breakout-room-manager_3.entry.js +391 -0
  474. package/dist/esm/rtk-breakout-rooms-manager_9.entry.js +974 -0
  475. package/dist/esm/rtk-breakout-rooms-toggle.entry.js +2 -2
  476. package/dist/esm/rtk-camera-selector_2.entry.js +2 -2
  477. package/dist/esm/rtk-camera-toggle.entry.js +2 -2
  478. package/dist/esm/rtk-caption-toggle.entry.js +2 -2
  479. package/dist/{components/p-9de3508b.js → esm/rtk-channel-creator.entry.js} +12 -64
  480. package/dist/esm/rtk-channel-details.entry.js +45 -0
  481. package/dist/{components/p-5d3d3990.js → esm/rtk-channel-header.entry.js} +9 -78
  482. package/dist/esm/rtk-channel-selector-ui.entry.js +6 -6
  483. package/dist/esm/rtk-chat-composer-ui.entry.js +3 -3
  484. package/dist/esm/rtk-chat-message.entry.js +114 -0
  485. package/dist/{components/p-2e3b02b3.js → esm/rtk-chat-messages-ui.entry.js} +14 -122
  486. package/dist/esm/rtk-chat-search-results.entry.js +53 -0
  487. package/dist/esm/rtk-chat-selector-ui.entry.js +3 -3
  488. package/dist/esm/rtk-chat-toggle.entry.js +10 -14
  489. package/dist/esm/rtk-clock.entry.js +2 -2
  490. package/dist/esm/rtk-controlbar-button.entry.js +2 -2
  491. package/dist/esm/rtk-controlbar.entry.js +2 -2
  492. package/dist/esm/rtk-debugger-audio_4.entry.js +679 -0
  493. package/dist/esm/rtk-debugger-toggle.entry.js +2 -2
  494. package/dist/{components/p-99a61e45.js → esm/rtk-dialog-manager.entry.js} +10 -179
  495. package/dist/esm/rtk-dialog.entry.js +89 -0
  496. package/dist/esm/rtk-ended-screen.entry.js +2 -2
  497. package/dist/esm/rtk-file-dropzone.entry.js +2 -2
  498. package/dist/esm/rtk-file-message_3.entry.js +142 -0
  499. package/dist/esm/rtk-fullscreen-toggle.entry.js +2 -2
  500. package/dist/esm/rtk-grid-pagination.entry.js +2 -2
  501. package/dist/esm/rtk-grid.entry.js +2 -2
  502. package/dist/esm/rtk-header.entry.js +2 -2
  503. package/dist/esm/rtk-idle-screen.entry.js +2 -2
  504. package/dist/esm/rtk-image-viewer.entry.js +4 -4
  505. package/dist/esm/rtk-information-tooltip.entry.js +2 -2
  506. package/dist/esm/rtk-leave-button.entry.js +2 -2
  507. package/dist/esm/rtk-livestream-indicator_3.entry.js +2 -2
  508. package/dist/esm/rtk-livestream-toggle.entry.js +2 -2
  509. package/dist/esm/rtk-logo.entry.js +73 -0
  510. package/dist/esm/rtk-meeting-title.entry.js +2 -2
  511. package/dist/esm/rtk-message-list-view.entry.js +3 -3
  512. package/dist/esm/rtk-mic-toggle.entry.js +2 -2
  513. package/dist/esm/rtk-mixed-grid.entry.js +2 -2
  514. package/dist/esm/rtk-more-toggle.entry.js +2 -2
  515. package/dist/esm/rtk-mute-all-button.entry.js +2 -2
  516. package/dist/esm/rtk-name-tag.entry.js +3 -3
  517. package/dist/esm/rtk-network-indicator.entry.js +2 -2
  518. package/dist/esm/rtk-notification.entry.js +67 -0
  519. package/dist/{components/p-2ec901a0.js → esm/rtk-notifications.entry.js} +13 -60
  520. package/dist/esm/rtk-participant-count.entry.js +2 -2
  521. package/dist/esm/rtk-participant-setup.entry.js +2 -2
  522. package/dist/esm/rtk-participant_2.entry.js +4 -4
  523. package/dist/esm/rtk-participants-audio.entry.js +2 -2
  524. package/dist/esm/rtk-participants-stage-list_4.entry.js +2 -2
  525. package/dist/esm/rtk-participants-toggle.entry.js +3 -3
  526. package/dist/esm/rtk-participants.entry.js +3 -3
  527. package/dist/esm/rtk-pip-toggle.entry.js +2 -2
  528. package/dist/esm/rtk-plugin-main_2.entry.js +3 -3
  529. package/dist/esm/rtk-plugins-toggle.entry.js +3 -3
  530. package/dist/esm/rtk-plugins_2.entry.js +2 -2
  531. package/dist/esm/rtk-poll_2.entry.js +3 -3
  532. package/dist/esm/rtk-polls-toggle.entry.js +3 -3
  533. package/dist/esm/rtk-recording-indicator.entry.js +2 -2
  534. package/dist/esm/rtk-recording-toggle.entry.js +2 -2
  535. package/dist/esm/rtk-screen-share-toggle.entry.js +2 -2
  536. package/dist/esm/rtk-screenshare-view.entry.js +2 -2
  537. package/dist/esm/rtk-settings-audio_2.entry.js +2 -2
  538. package/dist/esm/rtk-settings-toggle.entry.js +2 -2
  539. package/dist/esm/rtk-settings.entry.js +2 -2
  540. package/dist/esm/rtk-setup-screen.entry.js +3 -3
  541. package/dist/esm/rtk-sidebar-ui.entry.js +2 -2
  542. package/dist/esm/rtk-sidebar.entry.js +4 -4
  543. package/dist/esm/rtk-simple-grid.entry.js +2 -2
  544. package/dist/esm/rtk-spotlight-grid.entry.js +2 -2
  545. package/dist/esm/rtk-spotlight-indicator.entry.js +2 -2
  546. package/dist/esm/rtk-stage-toggle.entry.js +2 -2
  547. package/dist/esm/rtk-stage.entry.js +2 -2
  548. package/dist/esm/rtk-transcript.entry.js +2 -2
  549. package/dist/esm/rtk-transcripts.entry.js +2 -2
  550. package/dist/esm/rtk-ui-provider.entry.js +2 -2
  551. package/dist/esm/rtk-waiting-screen.entry.js +2 -2
  552. package/dist/esm/{sidebar-11ec6514.js → sidebar-030fff49.js} +1 -1
  553. package/dist/esm/{string-5e8dab07.js → string-068ce30a.js} +1 -1
  554. package/dist/esm/{ui-store-db94a9fe.js → ui-store-9e486e1b.js} +73 -79
  555. package/dist/realtimekit-ui/index.esm.js +1 -1
  556. package/dist/realtimekit-ui/{p-02c21f58.entry.js → p-013ae8ca.entry.js} +1 -1
  557. package/dist/realtimekit-ui/{p-072435bb.entry.js → p-0689d68b.entry.js} +1 -1
  558. package/dist/realtimekit-ui/{p-b6b382fb.js → p-084b6f30.js} +1 -1
  559. package/dist/realtimekit-ui/{p-02af251d.entry.js → p-0898c8ee.entry.js} +1 -1
  560. package/dist/realtimekit-ui/{p-68b7d8b8.entry.js → p-09869644.entry.js} +1 -1
  561. package/dist/realtimekit-ui/{p-c2ee481a.entry.js → p-11c964cf.entry.js} +1 -1
  562. package/dist/realtimekit-ui/{p-30f406f2.entry.js → p-124eb1c7.entry.js} +1 -1
  563. package/dist/realtimekit-ui/{p-2158fcad.js → p-12e4cb4a.js} +1 -1
  564. package/dist/realtimekit-ui/{p-b8b1abc1.entry.js → p-158b1b0c.entry.js} +1 -1
  565. package/dist/realtimekit-ui/{p-f79c9388.entry.js → p-17c6d2fa.entry.js} +1 -1
  566. package/dist/realtimekit-ui/{p-695de0a5.entry.js → p-2b373e53.entry.js} +1 -1
  567. package/dist/realtimekit-ui/p-2d7b969d.entry.js +1 -0
  568. package/dist/realtimekit-ui/{p-fd9eecef.entry.js → p-32030329.entry.js} +1 -1
  569. package/dist/realtimekit-ui/p-3369f405.entry.js +1 -0
  570. package/dist/realtimekit-ui/p-382270d8.js +1 -0
  571. package/dist/realtimekit-ui/{p-55db56a1.entry.js → p-38aec474.entry.js} +1 -1
  572. package/dist/realtimekit-ui/{p-13b16cf1.entry.js → p-3a325310.entry.js} +1 -1
  573. package/dist/realtimekit-ui/{p-66923aef.entry.js → p-3b8de127.entry.js} +1 -1
  574. package/dist/realtimekit-ui/{p-ba7da0d6.entry.js → p-3d0c4257.entry.js} +1 -1
  575. package/dist/realtimekit-ui/{p-6d0a4f84.entry.js → p-3e02ec0b.entry.js} +1 -1
  576. package/dist/realtimekit-ui/p-40be18ee.js +1 -0
  577. package/dist/realtimekit-ui/{p-e8b1dd81.entry.js → p-4554a674.entry.js} +1 -1
  578. package/dist/realtimekit-ui/p-474ba04f.entry.js +1 -0
  579. package/dist/realtimekit-ui/p-487e808a.entry.js +1 -0
  580. package/dist/realtimekit-ui/p-4ab26f1f.entry.js +1 -0
  581. package/dist/realtimekit-ui/{p-b026c868.entry.js → p-4eba1baa.entry.js} +1 -1
  582. package/dist/realtimekit-ui/p-50157a65.entry.js +1 -0
  583. package/dist/realtimekit-ui/p-51e949d6.entry.js +1 -0
  584. package/dist/realtimekit-ui/{p-2e3dfcc9.entry.js → p-53ac3d30.entry.js} +1 -1
  585. package/dist/realtimekit-ui/{p-7adbebd6.entry.js → p-54a31e02.entry.js} +1 -1
  586. package/dist/realtimekit-ui/{p-1667420d.entry.js → p-5a2d8313.entry.js} +1 -1
  587. package/dist/realtimekit-ui/p-5b2d97fc.js +1 -0
  588. package/dist/realtimekit-ui/{p-2ce32db5.entry.js → p-5bbfdabe.entry.js} +1 -1
  589. package/dist/realtimekit-ui/p-60a29b69.entry.js +1 -0
  590. package/dist/realtimekit-ui/{p-36ac26b8.entry.js → p-60b39e38.entry.js} +1 -1
  591. package/dist/realtimekit-ui/{p-8aa0ba79.entry.js → p-61d3f74f.entry.js} +1 -1
  592. package/dist/realtimekit-ui/{p-bcd4a3a3.entry.js → p-62e0a141.entry.js} +1 -1
  593. package/dist/realtimekit-ui/{p-6fd30714.entry.js → p-643194e4.entry.js} +1 -1
  594. package/dist/realtimekit-ui/p-6a45f305.js +1 -0
  595. package/dist/realtimekit-ui/{p-8ce4ce1e.entry.js → p-6adb2de4.entry.js} +1 -1
  596. package/dist/realtimekit-ui/{p-efabd2ce.js → p-6f211c3e.js} +1 -1
  597. package/dist/realtimekit-ui/{p-af6545ce.entry.js → p-74e1b5a6.entry.js} +1 -1
  598. package/dist/realtimekit-ui/p-7786e9a7.entry.js +1 -0
  599. package/dist/realtimekit-ui/{p-02e2abe9.entry.js → p-77e04fb7.entry.js} +1 -1
  600. package/dist/realtimekit-ui/{p-ded15279.entry.js → p-788f26c4.entry.js} +1 -1
  601. package/dist/realtimekit-ui/p-78d19559.entry.js +1 -0
  602. package/dist/realtimekit-ui/{p-f547518b.entry.js → p-7b999408.entry.js} +1 -1
  603. package/dist/realtimekit-ui/{p-09c73782.js → p-80c856cd.js} +1 -1
  604. package/dist/realtimekit-ui/{p-99b12b35.entry.js → p-871d8fbf.entry.js} +1 -1
  605. package/dist/realtimekit-ui/{p-24e68e61.entry.js → p-882d07c9.entry.js} +1 -1
  606. package/dist/realtimekit-ui/{p-601b236f.entry.js → p-8b189438.entry.js} +1 -1
  607. package/dist/realtimekit-ui/{p-5c98d979.entry.js → p-8c55a630.entry.js} +1 -1
  608. package/dist/realtimekit-ui/{p-94478817.entry.js → p-8f512d69.entry.js} +1 -1
  609. package/dist/realtimekit-ui/{p-87bc8bbd.js → p-91ea043c.js} +1 -1
  610. package/dist/realtimekit-ui/{p-141c5a96.js → p-91fd286c.js} +1 -1
  611. package/dist/realtimekit-ui/p-930f0255.entry.js +1 -0
  612. package/dist/realtimekit-ui/p-93b84c22.js +1 -0
  613. package/dist/realtimekit-ui/{p-388ea8ba.entry.js → p-941f159e.entry.js} +1 -1
  614. package/dist/realtimekit-ui/{p-f51eda1c.entry.js → p-949b2b6a.entry.js} +1 -1
  615. package/dist/realtimekit-ui/{p-73eccbf9.entry.js → p-986e7389.entry.js} +1 -1
  616. package/dist/realtimekit-ui/{p-e32f2f7d.entry.js → p-98ee3341.entry.js} +1 -1
  617. package/dist/realtimekit-ui/p-99801804.entry.js +1 -0
  618. package/dist/realtimekit-ui/{p-6d2d135b.entry.js → p-9ad2c746.entry.js} +1 -1
  619. package/dist/realtimekit-ui/p-9c1f42dd.entry.js +1 -0
  620. package/dist/realtimekit-ui/{p-5c7cacf3.entry.js → p-9cbf286a.entry.js} +1 -1
  621. package/dist/realtimekit-ui/{p-04057bfb.entry.js → p-9d3cf603.entry.js} +1 -1
  622. package/dist/realtimekit-ui/{p-e2a6c7ca.entry.js → p-a0563ab4.entry.js} +1 -1
  623. package/dist/realtimekit-ui/{p-1c0dc0e4.entry.js → p-a319e81f.entry.js} +1 -1
  624. package/dist/realtimekit-ui/{p-2735b1d8.entry.js → p-a4372f65.entry.js} +1 -1
  625. package/dist/realtimekit-ui/{p-2e91528d.entry.js → p-a9126c12.entry.js} +1 -1
  626. package/dist/realtimekit-ui/{p-433b1cf8.entry.js → p-a9dd63ef.entry.js} +1 -1
  627. package/dist/realtimekit-ui/{p-8191b1a0.entry.js → p-aa757cd3.entry.js} +1 -1
  628. package/dist/realtimekit-ui/{p-0ee296a5.entry.js → p-ad26f7fd.entry.js} +1 -1
  629. package/dist/realtimekit-ui/{p-9aa52462.entry.js → p-ad887be1.entry.js} +1 -1
  630. package/dist/realtimekit-ui/{p-008ff55b.entry.js → p-ae7319ac.entry.js} +1 -1
  631. package/dist/realtimekit-ui/p-b387e9a1.entry.js +1 -0
  632. package/dist/realtimekit-ui/{p-cbcb71ff.entry.js → p-b388b4c6.entry.js} +1 -1
  633. package/dist/realtimekit-ui/{p-7f6469ed.entry.js → p-bbf76104.entry.js} +1 -1
  634. package/dist/realtimekit-ui/p-bc1a2b04.entry.js +1 -0
  635. package/dist/realtimekit-ui/p-c1d026d1.entry.js +1 -0
  636. package/dist/realtimekit-ui/{p-850768a7.entry.js → p-c5c965b8.entry.js} +1 -1
  637. package/dist/realtimekit-ui/p-c7711712.entry.js +1 -0
  638. package/dist/realtimekit-ui/p-cdacd242.entry.js +1 -0
  639. package/dist/realtimekit-ui/{p-c83bb4db.entry.js → p-cdf8bc21.entry.js} +1 -1
  640. package/dist/realtimekit-ui/{p-3950823a.entry.js → p-d0384d90.entry.js} +1 -1
  641. package/dist/realtimekit-ui/{p-6602bcb7.entry.js → p-d0bba739.entry.js} +1 -1
  642. package/dist/realtimekit-ui/p-d8962ea0.entry.js +1 -0
  643. package/dist/realtimekit-ui/{p-38c285b6.entry.js → p-d95ce443.entry.js} +1 -1
  644. package/dist/realtimekit-ui/{p-c878323a.entry.js → p-d9cad67f.entry.js} +1 -1
  645. package/dist/realtimekit-ui/{p-4bc037d7.entry.js → p-dbd07824.entry.js} +1 -1
  646. package/dist/realtimekit-ui/{p-83cc0429.entry.js → p-de75d48d.entry.js} +1 -1
  647. package/dist/realtimekit-ui/{p-cfaf19a1.entry.js → p-e62593a2.entry.js} +1 -1
  648. package/dist/realtimekit-ui/{p-fdb4f92c.js → p-e720b51e.js} +1 -1
  649. package/dist/realtimekit-ui/{p-9e75367a.entry.js → p-e7b83772.entry.js} +1 -1
  650. package/dist/realtimekit-ui/p-e87928f7.js +1 -0
  651. package/dist/realtimekit-ui/{p-3a58bc75.entry.js → p-e925ca8a.entry.js} +1 -1
  652. package/dist/realtimekit-ui/{p-a3fb7ff3.entry.js → p-f0f6c282.entry.js} +1 -1
  653. package/dist/realtimekit-ui/{p-d403ae25.entry.js → p-f775be53.entry.js} +1 -1
  654. package/dist/realtimekit-ui/{p-d369eb4f.entry.js → p-fee7bd4f.entry.js} +1 -1
  655. package/dist/realtimekit-ui/realtimekit-ui.esm.js +1 -1
  656. package/dist/types/components/rtk-channel-creator/rtk-channel-creator.d.ts +3 -0
  657. package/dist/types/components/rtk-channel-details/rtk-channel-details.d.ts +1 -0
  658. package/dist/types/components/rtk-channel-header/rtk-channel-header.d.ts +1 -0
  659. package/dist/types/components/rtk-channel-selector-ui/rtk-channel-selector-ui.d.ts +3 -0
  660. package/dist/types/components/rtk-chat/rtk-chat.d.ts +0 -9
  661. package/dist/types/components/rtk-chat-message/rtk-chat-message.d.ts +1 -0
  662. package/dist/types/components/rtk-chat-messages-ui/rtk-chat-messages-ui.d.ts +3 -0
  663. package/dist/types/components/rtk-chat-search-results/rtk-chat-search-results.d.ts +1 -0
  664. package/dist/types/components/rtk-file-message/rtk-file-message.d.ts +1 -0
  665. package/dist/types/components/rtk-image-message/rtk-image-message.d.ts +1 -0
  666. package/dist/types/components/rtk-message-view/rtk-message-view.d.ts +2 -0
  667. package/dist/types/components/rtk-text-message/rtk-text-message.d.ts +1 -0
  668. package/dist/types/components.d.ts +104 -0
  669. package/dist/types/types/props.d.ts +1 -0
  670. package/dist/types/utils/chat.d.ts +1 -1
  671. package/dist/types/utils/flags.d.ts +15 -0
  672. package/package.json +1 -1
  673. package/dist/cjs/rtk-avatar_54.cjs.entry.js +0 -6421
  674. package/dist/components/p-d9e57455.js +0 -148
  675. package/dist/esm/rtk-avatar_54.entry.js +0 -6364
  676. package/dist/realtimekit-ui/p-173457a5.js +0 -1
  677. package/dist/realtimekit-ui/p-47314bc7.js +0 -1
  678. package/dist/realtimekit-ui/p-4ec9d2bb.entry.js +0 -1
  679. package/dist/realtimekit-ui/p-5e4404d2.entry.js +0 -1
  680. package/dist/realtimekit-ui/p-5e510bd4.entry.js +0 -1
  681. package/dist/realtimekit-ui/p-89ebff3d.js +0 -1
  682. package/dist/realtimekit-ui/p-b0debce4.js +0 -1
  683. package/dist/realtimekit-ui/p-d3717b05.entry.js +0 -1
@@ -0,0 +1,2568 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index$1 = require('./index-05554ce6.js');
6
+ const uiStore = require('./ui-store-1cb28da8.js');
7
+ const string = require('./string-9bce3253.js');
8
+ const index = require('./index-8d07e125.js');
9
+ const debounce = require('./debounce-a3e0d9e7.js');
10
+ const chat = require('./chat-717e517d.js');
11
+ const file = require('./file-0b9afa34.js');
12
+ const merge = require('./merge-73e2770b.js');
13
+ const index$2 = require('./index-821d14b7.js');
14
+ const config = require('./config-8c9ac89a.js');
15
+ const ResizeObserver_es = require('./ResizeObserver.es-ba961f16.js');
16
+ const floatingUi_dom_esm = require('./floating-ui.dom.esm-705e65f3.js');
17
+ const date = require('./date-61ffcd0a.js');
18
+ const scroll = require('./scroll-c6404609.js');
19
+
20
+ const rtkAvatarCss = ":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:flex;height:var(--rtk-space-32, 128px);width:var(--rtk-space-32, 128px);align-items:center;justify-content:center;font-size:28px;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)));overflow:clip;border-radius:9999px;-webkit-user-select:none;-moz-user-select:none;user-select:none}rtk-icon{height:50%;width:50%}.image-ctr{display:flex;height:100%;width:100%;align-items:center;justify-content:center;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-600, 255 255 255 / 0.52))}img{height:var(--rtk-space-0, 0px);width:var(--rtk-space-0, 0px);-o-object-fit:cover;object-fit:cover}img.loaded{height:100%;width:100%}.initials{display:flex;height:100%;width:100%;align-items:center;justify-content:center;text-transform:uppercase}.image{display:flex;height:100%;width:100%;align-items:center;justify-content:center}.image img{display:none;height:100%;width:100%;-o-object-fit:cover;object-fit:cover}.image img.loaded{display:block}:host([variant='hexagon']){border-radius:var(--rtk-border-radius-none, 0);clip-path:polygon(50% 0, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%)}:host([variant='square']){border-radius:var(--rtk-border-radius-none, 0);clip-path:polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)}:host([size='sm']){height:var(--rtk-space-14, 56px);width:var(--rtk-space-14, 56px);font-size:12px}:host([size='md']){height:var(--rtk-space-28, 112px);width:var(--rtk-space-28, 112px)}:host([size='lg']){height:var(--rtk-space-32, 128px);width:var(--rtk-space-32, 128px)}";
21
+ const RtkAvatarStyle0 = rtkAvatarCss;
22
+
23
+ var __decorate$h = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
24
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
25
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
26
+ r = Reflect.decorate(decorators, target, key, desc);
27
+ else
28
+ for (var i = decorators.length - 1; i >= 0; i--)
29
+ if (d = decorators[i])
30
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
31
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
32
+ };
33
+ const RtkAvatar = class {
34
+ constructor(hostRef) {
35
+ index$1.registerInstance(this, hostRef);
36
+ /** Avatar type */
37
+ this.variant = 'circular';
38
+ /** Icon pack */
39
+ this.iconPack = uiStore.defaultIconPack;
40
+ /** Language */
41
+ this.t = uiStore.useLanguage();
42
+ this.imageState = 'loading';
43
+ this.getAvatar = () => {
44
+ var _a;
45
+ const name = string.formatName(((_a = this.participant) === null || _a === void 0 ? void 0 : _a.name) || '');
46
+ let picture;
47
+ if (this.participant != null && 'picture' in this.participant) {
48
+ picture = this.participant.picture;
49
+ }
50
+ if (picture && picture.length > 0 && this.imageState !== 'errored') {
51
+ return (index$1.h("div", { class: "image-ctr" }, this.imageState === 'loading' && index$1.h("rtk-spinner", { iconPack: this.iconPack }), index$1.h("img", { src: picture, class: { loaded: this.imageState === 'loaded' }, loading: "lazy", title: name, onLoad: () => (this.imageState = 'loaded'), onError: () => (this.imageState = 'errored'), part: "image" })));
52
+ }
53
+ const initials = string.getInitials(name);
54
+ return (index$1.h("div", { class: "initials", title: name, part: "initials" }, initials));
55
+ };
56
+ }
57
+ render() {
58
+ return (index$1.h(index$1.Host, { key: 'c1a0be37edb75c40b275ad59af85cee7df3f1cdf' }, this.getAvatar(), index$1.h("slot", { key: '1cd71e7494a09d68a52051edc279911dc3168515' })));
59
+ }
60
+ };
61
+ __decorate$h([
62
+ index.SyncWithStore()
63
+ ], RtkAvatar.prototype, "iconPack", void 0);
64
+ __decorate$h([
65
+ index.SyncWithStore()
66
+ ], RtkAvatar.prototype, "t", void 0);
67
+ RtkAvatar.style = RtkAvatarStyle0;
68
+
69
+ const rtkButtonCss = ":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{--icon-size:var(--rtk-button-icon-size, var(--rtk-space-5, 20px));--transition-property:var(--rtk-transition-property, all);--transition-duration:100ms;display:inline-flex;height:var(--rtk-space-8, 32px);cursor:pointer;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255));font-size:14px;-webkit-user-select:none;-moz-user-select:none;user-select:none;border-radius:var(--rtk-border-radius-sm, 4px);transition-property:var(--transition-property);transition-duration:var(--transition-duration)}button{box-sizing:border-box;background-color:transparent;color:inherit;border:var(--rtk-border-width-sm, 1px) solid transparent;padding-left:var(--rtk-space-2, 8px);padding-right:var(--rtk-space-2, 8px);display:inline-flex;flex-grow:1;justify-content:center;vertical-align:baseline;gap:var(--rtk-space-1, 4px);transition-property:var(--transition-property);transition-duration:var(--transition-duration);outline:none;height:inherit;border-radius:inherit;fill:inherit;cursor:inherit;font-weight:inherit;font-family:inherit;font-size:inherit;line-height:inherit}.start,.content,.end{align-self:center}::slotted(rtk-icon),::slotted(rtk-spinner){height:var(--icon-size);width:var(--icon-size)}:host([variant='primary']){color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)))}:host(:hover){--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-600, 13 81 253) / var(--tw-bg-opacity))}button:focus-visible{border-color:rgb(var(--rtk-colors-text-1000, 255 255 255))}:host(:active){--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-700, 2 70 253) / var(--tw-bg-opacity))}:host([disabled]:not([disabled='false'])){cursor:not-allowed;opacity:0.6}:host([variant='secondary']){--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}:host([variant='secondary']:hover){--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}:host([variant='secondary']:active){--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity))}:host([variant='danger']){--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-bg-opacity))}:host([variant='danger']:hover){background-color:rgba(var(--rtk-colors-danger, 255 45 45) / 0.7)}:host([variant='danger']:active){--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-bg-opacity))}:host([variant='ghost']){background-color:transparent;color:inherit}:host([variant='ghost'].active){--tw-text-opacity:1;color:rgba(var(--rtk-colors-brand-300, 73 124 253) / var(--tw-text-opacity))}:host([variant='ghost']:hover){--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}:host([variant='ghost']:active){--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}:host([kind='icon']){--icon-size:var(--rtk-space-5, 20px);width:var(--rtk-space-8, 32px)}:host([kind='icon']) button{padding-left:var(--rtk-space-0, 0px);padding-right:var(--rtk-space-0, 0px)}:host([kind='wide']){width:100%}:host([size='lg']){--icon-size:var(--rtk-space-5, 20px);height:var(--rtk-space-10, 40px);font-size:16px}:host([size='lg'][kind='icon']){--icon-size:var(--rtk-space-6, 24px);height:var(--rtk-space-10, 40px);width:var(--rtk-space-10, 40px)}:host([size='sm']){--icon-size:var(--rtk-space-4, 16px);height:var(--rtk-space-6, 24px);font-size:12px}:host([size='sm'][kind='icon']){height:var(--rtk-space-6, 24px);width:var(--rtk-space-6, 24px)}";
70
+ const RtkButtonStyle0 = rtkButtonCss;
71
+
72
+ const RtkButton = class {
73
+ constructor(hostRef) {
74
+ index$1.registerInstance(this, hostRef);
75
+ /** Button variant */
76
+ this.variant = 'primary';
77
+ /** Button type */
78
+ this.kind = 'button';
79
+ /** Whether to reverse order of children */
80
+ this.reverse = false;
81
+ /** Where the button is disabled or not */
82
+ this.disabled = false;
83
+ /** Button type */
84
+ this.type = 'button';
85
+ }
86
+ render() {
87
+ return (index$1.h(index$1.Host, { key: '0f96cef4ae77a2be8013fa5d62d39626734eeced' }, index$1.h("button", { key: '8c06d5f5cc71779b8d56f31d2dd77b8d35e8b280', part: "button", type: this.type, disabled: this.disabled }, index$1.h("span", { key: 'ae741ddf8cc914f9493c26330b1f322541f64223', class: "start" }, index$1.h("slot", { key: '18275dab42a4dd38b5a59463ffca227e4a6df3c8', name: "start" })), index$1.h("span", { key: 'c2b912515b6edc2966c4cdb282c89022aa05c13f', class: "content", part: "content" }, index$1.h("slot", { key: '5d87993198e16a3b5f38e62979fa2ee5637a059d' })), index$1.h("span", { key: '0bc907da23ea362f8ae0b3fdf88452b1c3881078', class: "end" }, index$1.h("slot", { key: '0862eeefcfa5765ce605b99a04aab88222ed6e68', name: "end" })))));
88
+ }
89
+ static get delegatesFocus() { return true; }
90
+ };
91
+ RtkButton.style = RtkButtonStyle0;
92
+
93
+ const rtkChannelSelectorViewCss = ".scrollbar {\n /* For Firefox */\n scrollbar-width: thin;\n scrollbar-color: var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent);\n}\n\n/* For WebKit */\n.scrollbar::-webkit-scrollbar {\n height: var(--rtk-space-1\\.5, 6px);\n width: var(--rtk-space-1\\.5, 6px);\n border-radius: 9999px;\n background-color: var(--rtk-scrollbar-background, transparent);\n}\n\n.scrollbar::-webkit-scrollbar-thumb {\n border-radius: 9999px;\n background-color: var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)));\n}\n\n\n:host {\n display: flex;\n flex-direction: column;\n width: 100%;\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));\n position: relative;\n z-index: 10;\n height: var(--rtk-space-12, 48px);\n min-height: 48px;\n}\n\n.dropdown-trigger {\n height: 100%;\n width: 100%;\n border-width: var(--rtk-border-width-none, 0);\n border-style: none;\n padding: var(--rtk-space-4, 16px);\n display: flex;\n align-items: center;\n justify-content: space-between;\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));\n font-size: 14px;\n color: rgb(var(--rtk-colors-text-1000, 255 255 255));\n cursor: pointer;\n position: absolute;\n z-index: 20;\n}\n\n.dropdown-trigger span {\n display: flex;\n flex: 1 1 0%;\n align-items: center;\n justify-content: space-between;\n}\n\n.dropdown-trigger rtk-icon {\n margin-left: var(--rtk-space-1, 4px);\n height: var(--rtk-space-5, 20px);\n width: var(--rtk-space-5, 20px);\n flex-shrink: 0;\n}\n\n@container chatcontainer (height < 360px) {\n .dropdown-trigger {\n padding: var(--rtk-space-2, 8px);\n }\n .dropdown {\n top: var(--rtk-space-8, 32px) !important;\n }\n .search-container {\n padding-left: var(--rtk-space-0, 0px) !important;\n padding-right: var(--rtk-space-0, 0px) !important;\n padding-top: var(--rtk-space-0, 0px) !important;\n padding-bottom: var(--rtk-space-0, 0px) !important;\n }\n input {\n height: var(--rtk-space-8, 32px) !important;\n border-radius: var(--rtk-border-radius-none, 0) !important;\n }\n .channel {\n height: var(--rtk-space-8, 32px) !important;\n border-radius: var(--rtk-border-radius-sm, 4px) !important;\n }\n .avatar-icon {\n height: var(--rtk-space-3, 12px) !important;\n width: var(--rtk-space-3, 12px) !important;\n padding: var(--rtk-space-1, 4px) !important;\n }\n\n rtk-avatar {\n height: var(--rtk-space-5, 20px) !important;\n width: var(--rtk-space-5, 20px) !important;\n }\n}\n\n.dropdown {\n position: absolute;\n width: 100%;\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));\n top: var(--rtk-space-12, 48px);\n z-index: 10;\n animation: 0.3s slide-down ease;\n}\n\n.dropdown .channels-container {\n max-height: var(--rtk-space-80, 320px);\n}\n\n.list {\n display: flex;\n flex-direction: column;\n}\n\n.list .channel .channel-data {\n align-items: flex-start;\n}\n\n.unread-count {\n display: flex;\n justify-content: center;\n height: var(--rtk-space-5, 20px);\n min-width: var(--rtk-space-3, 12px);\n border-radius: 9999px;\n padding-left: var(--rtk-space-1, 4px);\n padding-right: var(--rtk-space-1, 4px);\n font-size: 12px;\n line-height: 1.25rem;\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));\n color: rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)));\n}\n\ninput {\n height: var(--rtk-space-9, 36px);\n width: 100%;\n padding-left: var(--rtk-space-3, 12px);\n padding-right: var(--rtk-space-3, 12px);\n box-sizing: border-box;\n border-width: var(--rtk-border-width-none, 0);\n border-style: none;\n outline: 2px solid transparent;\n outline-offset: 2px;\n border-radius: var(--rtk-border-radius-sm, 4px);\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity));\n color: rgb(var(--rtk-colors-text-1000, 255 255 255));\n}\n\n.search-container {\n display: flex;\n flex-shrink: 0;\n flex-grow: 0;\n flex-basis: auto;\n align-items: center;\n padding-top: var(--rtk-space-3, 12px);\n padding-bottom: var(--rtk-space-3, 12px);\n padding-left: var(--rtk-space-2, 8px);\n padding-right: var(--rtk-space-2, 8px);\n border-bottom: var(--rtk-border-width-sm, 1px) solid rgb(var(--rtk-colors-background-700, 44 44 44));\n}\n\n.search-container rtk-icon {\n margin-left: calc(var(--rtk-space-8, 32px) * -1);\n height: var(--rtk-space-5, 20px);\n width: var(--rtk-space-5, 20px);\n color: rgb(var(--rtk-colors-text-800, 255 255 255 / 0.76));\n}\n\n.channels-container {\n display: flex;\n flex-direction: column;\n gap: var(--rtk-space-1, 4px);\n padding: var(--rtk-space-2, 8px);\n flex: 1 1 auto;\n overflow-y: auto;\n}\n\n.channel {\n flex-shrink: 0;\n box-sizing: border-box;\n border-width: var(--rtk-border-width-none, 0);\n border-style: none;\n background-color: transparent;\n outline: 2px solid transparent;\n outline-offset: 2px;\n cursor: pointer;\n border-radius: var(--rtk-border-radius-md, 8px);\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--rtk-space-2, 8px);\n height: var(--rtk-space-16, 64px);\n width: 100%;\n padding-left: var(--rtk-space-2, 8px);\n padding-right: var(--rtk-space-3, 12px);\n color: rgb(var(--rtk-colors-text-1000, 255 255 255));\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n\n.channel:hover {\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity));\n}\n\n.channel .channel-data {\n flex: 1 1 0%;\n align-items: center;\n justify-content: space-between;\n display: flex;\n gap: var(--rtk-space-2, 8px);\n}\n\n.channel .name {\n font-size: 16px;\n}\n\n.channel .name, \n .channel .last-message {\n max-width: var(--rtk-space-40, 160px);\n text-align: left;\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 1;\n}\n\n.channel .no-message {\n font-style: italic;\n}\n\n.channel rtk-avatar {\n height: var(--rtk-space-12, 48px);\n width: var(--rtk-space-12, 48px);\n overflow: clip;\n border-radius: 9999px;\n font-size: 14px;\n}\n\n.channel .avatar-icon {\n height: var(--rtk-space-6, 24px);\n width: var(--rtk-space-6, 24px);\n padding: var(--rtk-space-3, 12px);\n color: rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)));\n overflow: clip;\n border-radius: 9999px;\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));\n}\n\n.channel time, \n .channel .last-message {\n font-size: 12px;\n color: rgb(var(--rtk-colors-text-800, 255 255 255 / 0.76));\n}\n\n.channel.active {\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-brand-300, 73 124 253) / var(--tw-bg-opacity));\n color: rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)));\n}\n\n.channel.active .unread-count {\n background-color: rgb(var(--rtk-colors-text-on-brand-800, var(--rtk-colors-text-800, 255 255 255 / 0.76)));\n --tw-text-opacity: 1;\n color: rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-text-opacity));\n}\n\n.channel.active time {\n color: rgb(var(--rtk-colors-text-on-brand-800, var(--rtk-colors-text-800, 255 255 255 / 0.76)));\n}\n\n.channel.active .last-message {\n color: rgb(var(--rtk-colors-text-on-brand-700, var(--rtk-colors-text-700, 255 255 255 / 0.64)));\n}\n\n.channel.active rtk-avatar {\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));\n color: rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)));\n}\n\n.col {\n gap: var(--rtk-space-1, 4px);\n display: flex;\n flex-direction: column;\n}\n\n.channel-meta {\n flex-shrink: 0;\n align-items: flex-end;\n}\n\n@keyframes slide-down {\n from {\n transform: translateY(-50px);\n }\n to {\n transform: translateY(0%);\n }\n}\n";
94
+ const RtkChannelSelectorViewStyle0 = rtkChannelSelectorViewCss;
95
+
96
+ var __decorate$g = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
97
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
98
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
99
+ r = Reflect.decorate(decorators, target, key, desc);
100
+ else
101
+ for (var i = decorators.length - 1; i >= 0; i--)
102
+ if (d = decorators[i])
103
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
104
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
105
+ };
106
+ const RtkChannelSelectorView = class {
107
+ constructor(hostRef) {
108
+ index$1.registerInstance(this, hostRef);
109
+ this.channelChange = index$1.createEvent(this, "channelChange", 7);
110
+ /** Disables search bar (default = false) */
111
+ this.disableSearch = false;
112
+ /** Hides avatar (default = false) */
113
+ this.hideAvatar = false;
114
+ /** Icon Pack */
115
+ this.iconPack = uiStore.defaultIconPack;
116
+ /** Language */
117
+ this.t = uiStore.useLanguage();
118
+ /** Render as dropdown or list (default = list) */
119
+ this.viewAs = 'list';
120
+ this.searchQuery = '';
121
+ this.showDropdown = false;
122
+ this.calculateListHeight = debounce.debounce(() => {
123
+ if (this.viewAs === 'list' && this.$listEl) {
124
+ let height = 0;
125
+ const slotEl = this.$el.shadowRoot.querySelector('slot[name="header"]');
126
+ if (slotEl) {
127
+ slotEl.assignedElements().forEach((e) => (height += e.offsetHeight));
128
+ }
129
+ if (this.$searchEl) {
130
+ height += this.$searchEl.offsetHeight;
131
+ }
132
+ this.$listEl.style.height = `${window.innerHeight - height - 16}px`;
133
+ }
134
+ }, 60);
135
+ this.getFilteredChannels = () => {
136
+ if (this.searchQuery.trim() === '') {
137
+ return this.channels;
138
+ }
139
+ return this.channels.filter((channel) => {
140
+ return channel['name'].toLowerCase().includes(this.searchQuery.toLowerCase());
141
+ });
142
+ };
143
+ this.toggleDropdown = () => {
144
+ this.showDropdown = !this.showDropdown;
145
+ };
146
+ this.getChannelById = (id) => {
147
+ return this.channels.find((channel) => channel.id === id);
148
+ };
149
+ this.getTotalUnreads = () => {
150
+ return this.channels.reduce((acc, curr) => {
151
+ return acc + curr.unreadCount;
152
+ }, 0);
153
+ };
154
+ this.onChannelClickHandler = (channel) => {
155
+ this.channelChange.emit(channel);
156
+ if (this.viewAs === 'dropdown') {
157
+ this.showDropdown = false;
158
+ }
159
+ };
160
+ }
161
+ connectedCallback() {
162
+ this.resizeObserver = new ResizeObserver(this.calculateListHeight);
163
+ }
164
+ componentDidLoad() {
165
+ this.resizeObserver.observe(this.$el);
166
+ this.calculateListHeight();
167
+ }
168
+ disconnectedCallback() {
169
+ var _a;
170
+ (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
171
+ this.calculateListHeight.cancel();
172
+ }
173
+ getTimeLabel(messageDate) {
174
+ const today = new Date();
175
+ const yesterday = new Date(today);
176
+ yesterday.setDate(today.getDate() - 1);
177
+ const firstDayOfWeek = new Date(today);
178
+ firstDayOfWeek.setDate(today.getDate() - today.getDay() - 1);
179
+ if (messageDate.toDateString() === today.toDateString()) {
180
+ return messageDate.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
181
+ }
182
+ else if (messageDate.toDateString() === yesterday.toDateString()) {
183
+ return this.t('date.yesteday');
184
+ }
185
+ else if (messageDate > firstDayOfWeek) {
186
+ const weekdays = [
187
+ 'date.sunday',
188
+ 'date.monday',
189
+ 'date.tuesday',
190
+ 'date.wednesday',
191
+ 'date.thursday',
192
+ 'date.friday',
193
+ 'date.saturday',
194
+ ];
195
+ return this.t(weekdays[messageDate.getDay()]);
196
+ }
197
+ else {
198
+ return Intl.DateTimeFormat([], {
199
+ day: '2-digit',
200
+ month: '2-digit',
201
+ year: '2-digit',
202
+ }).format(messageDate);
203
+ }
204
+ }
205
+ render() {
206
+ const filteredChannels = this.getFilteredChannels();
207
+ const shouldShowDropdown = this.viewAs === 'list' || (this.viewAs === 'dropdown' && this.showDropdown);
208
+ return (index$1.h(index$1.Host, { key: 'adc8ab4b9c8c865998588fbd9766296f18b3e48e' }, this.viewAs === 'list' && index$1.h("slot", { key: 'e5740725a4349472ca2eb1fb0816eb2311a99838', name: "header" }), shouldShowDropdown && (index$1.h("div", { key: '425adc920c28e0421e07bb0bd9f61b31c42fcda9', class: {
209
+ dropdown: this.viewAs === 'dropdown',
210
+ scrollbar: this.viewAs === 'dropdown',
211
+ list: this.viewAs === 'list',
212
+ } }, !this.disableSearch && (index$1.h("div", { key: '9fbbc48d8489f2a6490729fac1fecdef1838e84a', class: "search-container", ref: (el) => (this.$searchEl = el) }, index$1.h("input", { key: 'f7fb43662d50274f80380b735ef9f5fc0b215442', type: "text", placeholder: this.t('chat.search_conversations'), value: this.searchQuery, onInput: (e) => (this.searchQuery = e.target.value) }), index$1.h("rtk-icon", { key: 'af76e65a1397d2a6e557a28b687e26aef641c568', icon: this.iconPack.search }))), index$1.h("div", { key: '0711a9cfcc811269a5020dc41030c0daee5cc8bf', class: "channels-container scrollbar", ref: (el) => (this.$listEl = el) }, filteredChannels.map((channel) => {
213
+ return (index$1.h("button", { class: { channel: true, active: this.selectedChannelId === channel.id }, onClick: () => this.onChannelClickHandler(channel) }, !this.hideAvatar && (index$1.h("div", null, channel.icon ? (index$1.h("rtk-icon", { class: "avatar-icon", icon: this.iconPack[channel.icon] })) : (index$1.h("rtk-avatar", { participant: {
214
+ name: channel.name,
215
+ picture: channel.avatarUrl,
216
+ } })))), index$1.h("div", { class: "channel-data" }, index$1.h("div", { class: "col" }, index$1.h("div", { class: "name" }, channel.name), channel.latestMessage && (index$1.h("div", { class: {
217
+ 'last-message': true,
218
+ 'no-message': !channel.latestMessage,
219
+ } }, index$1.h("rtk-text-message-view", { isMarkdown: true, text: channel.latestMessage })))), index$1.h("div", { class: "col channel-meta" }, channel.latestMessageTime && (index$1.h("time", { class: "time" }, this.getTimeLabel(channel.latestMessageTime))), channel.unreadCount > 0 && (index$1.h("div", { class: "unread-count" }, channel.unreadCount))))));
220
+ })))), this.viewAs === 'dropdown' && (index$1.h("button", { key: '0c87f90d6d0fe22284995ab7259689f80a862829', class: "dropdown-trigger", onClick: this.toggleDropdown }, index$1.h("span", { key: 'd1a364f2c5c57d19702d0b8707ca661c1dc4c14f' }, this.selectedChannelId &&
221
+ `${this.t('to')} ${this.getChannelById(this.selectedChannelId).name}`, this.getTotalUnreads() > 0 && (index$1.h("div", { key: 'bf789f9df82851825bc6ea12a19a5f37ab74aefe', class: "unread-count" }, this.getTotalUnreads()))), index$1.h("rtk-icon", { key: 'c0d03f883f4c46b2698be0f197751fc0470717ea', icon: this.showDropdown ? this.iconPack.chevron_up : this.iconPack.chevron_down })))));
222
+ }
223
+ get $el() { return index$1.getElement(this); }
224
+ };
225
+ __decorate$g([
226
+ index.SyncWithStore()
227
+ ], RtkChannelSelectorView.prototype, "iconPack", void 0);
228
+ __decorate$g([
229
+ index.SyncWithStore()
230
+ ], RtkChannelSelectorView.prototype, "t", void 0);
231
+ RtkChannelSelectorView.style = RtkChannelSelectorViewStyle0;
232
+
233
+ const rtkChatCss = ":host {\n line-height: initial;\n font-family: var(--rtk-font-family, sans-serif);\n\n font-feature-settings: normal;\n font-variation-settings: normal;\n}\n\np {\n margin: var(--rtk-space-0, 0px);\n padding: var(--rtk-space-0, 0px);\n}\n\n.scrollbar {\n /* For Firefox */\n scrollbar-width: thin;\n scrollbar-color: var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent);\n}\n\n/* For WebKit */\n.scrollbar::-webkit-scrollbar {\n height: var(--rtk-space-1\\.5, 6px);\n width: var(--rtk-space-1\\.5, 6px);\n border-radius: 9999px;\n background-color: var(--rtk-scrollbar-background, transparent);\n}\n\n.scrollbar::-webkit-scrollbar-thumb {\n border-radius: 9999px;\n background-color: var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)));\n}\n\n\n:host {\n display: flex;\n height: 100%;\n width: 100%;\n flex-direction: column;\n font-size: 14px;\n position: relative;\n color: rgb(var(--rtk-colors-text-1000, 255 255 255));\n}\n\nh3 {\n margin: var(--rtk-space-0, 0px);\n display: flex;\n height: var(--rtk-space-12, 48px);\n align-items: center;\n justify-content: center;\n font-size: 16px;\n font-weight: 400;\n color: rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88));\n text-align: center;\n}\n\n#dropzone {\n position: absolute;\n top: var(--rtk-space-0, 0px);\n right: var(--rtk-space-0, 0px);\n bottom: var(--rtk-space-0, 0px);\n left: var(--rtk-space-0, 0px);\n z-index: 10;\n display: none;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));\n color: rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64));\n}\n\n#dropzone.active {\n display: flex;\n animation: 0.2s slide-up ease-in;\n}\n\nrtk-chat-messages-ui,\nrtk-chat-messages-ui-paginated {\n flex: 1 0 0;\n}\n\nrtk-chat-composer-view {\n margin: var(--rtk-space-2, 8px);\n}\n\n.chat-container {\n display: flex;\n height: 100%;\n width: 100%;\n flex-direction: row;\n container-type: size;\n container-name: chatcontainer;\n}\n\n@container chatcontainer (height < 360px) {\n rtk-channel-selector-view {\n height: var(--rtk-space-8, 32px);\n min-height: 24px;\n }\n}\n\n.chat {\n display: flex;\n flex: 1 1 0%;\n flex-direction: column;\n}\n\n.banner {\n height: 100%;\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n}\n\n.banner .welcome-new-channel {\n width: var(--rtk-space-48, 192px);\n}\n\n.banner .create-channel-illustration {\n height: var(--rtk-space-40, 160px);\n width: var(--rtk-space-40, 160px);\n}\n\n.channel-selector-header {\n box-sizing: border-box;\n height: var(--rtk-space-16, 64px);\n padding: var(--rtk-space-4, 16px);\n display: flex;\n justify-content: space-between;\n border-bottom: var(--rtk-border-width-sm, 1px) solid rgb(var(--rtk-colors-background-700, 44 44 44));\n}\n\n.channel-selector-header .channel-create-btn {\n width: var(--rtk-space-8, 32px);\n justify-content: center;\n}\n\n.channel-selector-header .channel-create-btn:hover {\n --tw-text-opacity: 1;\n color: rgba(var(--rtk-colors-brand-300, 73 124 253) / var(--tw-text-opacity));\n}\n\n.view-chats-btn {\n margin-top: var(--rtk-space-4, 16px);\n}\n\n.selector-container {\n z-index: 50;\n width: 100%;\n max-width: var(--rtk-space-80, 320px);\n border-right: var(--rtk-border-width-sm, 1px) solid rgb(var(--rtk-colors-background-600, 60 60 60));\n}\n\n.selector-container.hide {\n display: none;\n}\n\n.mobile-close-btn {\n display: none;\n}\n\n.selector-container.mobile {\n height: 100%;\n width: 100%;\n max-width: 100%;\n position: absolute;\n top: var(--rtk-space-0, 0px);\n right: var(--rtk-space-0, 0px);\n bottom: var(--rtk-space-0, 0px);\n left: var(--rtk-space-0, 0px);\n background-color: rgba(var(--rtk-colors-background-1000, 8 8 8) / 0.6);\n display: flex;\n}\n\n.selector-container.mobile rtk-channel-selector-view {\n max-width: var(--rtk-space-96, 384px);\n animation: 0.3s swipe-in;\n}\n\n.selector-container.mobile .mobile-close-btn {\n margin-top: var(--rtk-space-4, 16px);\n margin-bottom: var(--rtk-space-4, 16px);\n margin-left: var(--rtk-space-6, 24px);\n margin-right: var(--rtk-space-6, 24px);\n display: block;\n}\n\n.pinned-messages-header {\n display: flex;\n align-items: center;\n gap: var(--rtk-space-2, 8px);\n padding: var(--rtk-space-2, 8px);\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity));\n font-size: 12px;\n cursor: pointer;\n}\n\n.pinned-messages-header rtk-icon {\n height: var(--rtk-space-3, 12px);\n width: var(--rtk-space-3, 12px);\n}\n\n.pinned-messages-header:hover {\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));\n}\n\n.pinned-messages-header.active {\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));\n}\n\n@keyframes swipe-in {\n from {\n transform: translateX(-100%);\n }\n to {\n transform: translateX(0);\n }\n}\n";
234
+ const RtkChatStyle0 = rtkChatCss;
235
+
236
+ var __decorate$f = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
237
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
238
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
239
+ r = Reflect.decorate(decorators, target, key, desc);
240
+ else
241
+ for (var i = decorators.length - 1; i >= 0; i--)
242
+ if (d = decorators[i])
243
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
244
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
245
+ };
246
+ const RtkChat = class {
247
+ constructor(hostRef) {
248
+ index$1.registerInstance(this, hostRef);
249
+ this.stateUpdate = index$1.createEvent(this, "rtkStateUpdate", 7);
250
+ this.chatUpdateListener = ({ message }) => {
251
+ if (message.channelId)
252
+ return;
253
+ if (!this.displayFilter || this.displayFilter(message)) {
254
+ this.addToChatGroup(message);
255
+ // shallow copy to trigger render
256
+ this.chatGroups = Object.assign({}, this.chatGroups);
257
+ }
258
+ };
259
+ this.chatPermissionUpdateListener = () => {
260
+ this.canSend = this.meeting.self.permissions.chatPublic.canSend;
261
+ this.canSendTextMessage = this.meeting.self.permissions.chatPublic.text;
262
+ this.canSendFiles = this.meeting.self.permissions.chatPublic.files;
263
+ };
264
+ /** Config */
265
+ this.config = uiStore.createDefaultConfig();
266
+ /** Icon pack */
267
+ this.iconPack = uiStore.defaultIconPack;
268
+ /** Language */
269
+ this.t = uiStore.useLanguage();
270
+ /** disables private chat */
271
+ this.disablePrivateChat = false;
272
+ /** Can current user pin/unpin messages */
273
+ this.canPinMessages = false;
274
+ /**
275
+ * @deprecated
276
+ * Beta API, will change in future
277
+ * List of target presets allowed as private chat recipient
278
+ */
279
+ this.privatePresetFilter = [];
280
+ /**
281
+ * @deprecated
282
+ * Beta API, will change in future
283
+ * A filter function for messages to be displayed
284
+ */
285
+ this.displayFilter = undefined;
286
+ this.unreadCountGroups = {};
287
+ this.chatGroups = { everyone: [] };
288
+ this.selectedGroup = 'everyone';
289
+ this.now = new Date();
290
+ this.dropzoneActivated = false;
291
+ this.showLatestMessageButton = false;
292
+ this.canSend = false;
293
+ this.canSendTextMessage = false;
294
+ this.canSendFiles = false;
295
+ this.canPrivateMessage = false;
296
+ this.canSendPrivateTexts = false;
297
+ this.canSendPrivateFiles = false;
298
+ this.emojiPickerEnabled = false;
299
+ this.chatRecipientId = 'everyone';
300
+ this.participants = [];
301
+ this.channels = [];
302
+ this.editingMessage = null;
303
+ this.replyMessage = null;
304
+ this.searchQuery = '';
305
+ this.selectorState = 'hide';
306
+ this.creatingChannel = false;
307
+ this.showPinnedMessages = false;
308
+ this.channelMap = new Map();
309
+ this.onDragOver = (e) => {
310
+ e.preventDefault();
311
+ this.dropzoneActivated = true;
312
+ };
313
+ this.onDragLeave = () => {
314
+ this.dropzoneActivated = false;
315
+ };
316
+ this.onDrop = (e) => {
317
+ e.preventDefault();
318
+ this.dropzoneActivated = false;
319
+ chat.handleFilesDataTransfer(e.dataTransfer.items, (type, file) => {
320
+ var _a, _b, _c, _d;
321
+ switch (type) {
322
+ case 'image':
323
+ if (this.isFileMessagingAllowed()) {
324
+ (_b = (_a = this.meeting) === null || _a === void 0 ? void 0 : _a.chat) === null || _b === void 0 ? void 0 : _b.sendImageMessage(file, this.getRecipientPeerIds());
325
+ }
326
+ break;
327
+ case 'file':
328
+ if (this.isFileMessagingAllowed()) {
329
+ (_d = (_c = this.meeting) === null || _c === void 0 ? void 0 : _c.chat) === null || _d === void 0 ? void 0 : _d.sendFileMessage(file, this.getRecipientPeerIds());
330
+ }
331
+ break;
332
+ }
333
+ });
334
+ };
335
+ this.disconnectMeeting = (meeting) => {
336
+ var _a, _b, _c, _d, _e, _f;
337
+ if (this.isPrivateChatSupported()) {
338
+ meeting === null || meeting === void 0 ? void 0 : meeting.participants.joined.removeListener('participantJoined', this.onParticipantUpdate);
339
+ meeting === null || meeting === void 0 ? void 0 : meeting.participants.joined.removeListener('participantLeft', this.onParticipantUpdate);
340
+ }
341
+ (_a = meeting === null || meeting === void 0 ? void 0 : meeting.chat) === null || _a === void 0 ? void 0 : _a.removeListener('chatUpdate', this.chatUpdateListener);
342
+ (_b = meeting === null || meeting === void 0 ? void 0 : meeting.chat) === null || _b === void 0 ? void 0 : _b.removeListener('channelCreate', this.onChannelCreateOrUpdate);
343
+ (_c = meeting === null || meeting === void 0 ? void 0 : meeting.chat) === null || _c === void 0 ? void 0 : _c.removeListener('channelUpdate', this.onChannelCreateOrUpdate);
344
+ (_d = meeting === null || meeting === void 0 ? void 0 : meeting.chat) === null || _d === void 0 ? void 0 : _d.removeListener('channelMessageUpdate', this.onChannelCreateOrUpdate);
345
+ (_f = (_e = meeting === null || meeting === void 0 ? void 0 : meeting.participants) === null || _e === void 0 ? void 0 : _e.all) === null || _f === void 0 ? void 0 : _f.removeListener('participantsUpdate', this.onChannelCreateOrUpdate);
346
+ meeting.self.permissions.removeListener('*', this.chatPermissionUpdateListener);
347
+ };
348
+ this.getFilteredParticipants = () => {
349
+ if (this.privatePresetFilter.length === 0)
350
+ return this.participants;
351
+ return this.participants.filter((p) => this.privatePresetFilter.includes(p.presetName));
352
+ };
353
+ this.onParticipantUpdate = () => {
354
+ this.participants = this.meeting.participants.joined
355
+ .toArray()
356
+ .filter((p) => this.privatePresetFilter.length === 0 || this.privatePresetFilter.includes(p.presetName));
357
+ // if selected participant leaves, reset state to everyone
358
+ if (this.selectedParticipant && !this.participants.includes(this.selectedParticipant)) {
359
+ this.selectedParticipant = null;
360
+ this.chatRecipientId = this.selectedGroup = 'everyone';
361
+ }
362
+ };
363
+ this.updateUnreadCountGroups = (obj) => {
364
+ this.unreadCountGroups = Object.assign(Object.assign({}, this.unreadCountGroups), obj);
365
+ };
366
+ this.isPrivateChatSupported = () => {
367
+ return this.canPrivateMessage && !this.disablePrivateChat;
368
+ };
369
+ this.updateRecipients = (event) => {
370
+ const { id } = event.detail;
371
+ this.chatRecipientId = id;
372
+ this.selectedParticipant = this.participants.find((p) => p.userId === id);
373
+ if (this.chatRecipientId !== 'everyone') {
374
+ const allParticipants = [this.chatRecipientId, this.meeting.self.userId];
375
+ const targetKey = chat.generateChatGroupKey(allParticipants);
376
+ this.selectedGroup = targetKey;
377
+ }
378
+ else {
379
+ this.selectedGroup = 'everyone';
380
+ }
381
+ this.updateUnreadCountGroups({ [this.selectedGroup]: 0 });
382
+ };
383
+ this.isTextMessagingAllowed = () => {
384
+ if (this.chatRecipientId === 'everyone') {
385
+ // public chat
386
+ return this.canSend && this.canSendTextMessage;
387
+ }
388
+ // private chat
389
+ return this.canPrivateMessage && this.canSendPrivateTexts;
390
+ };
391
+ this.isFileMessagingAllowed = () => {
392
+ if (this.chatRecipientId === 'everyone') {
393
+ // public chat
394
+ return this.canSend && this.canSendFiles;
395
+ }
396
+ // private chat
397
+ return this.canPrivateMessage && this.canSendPrivateFiles;
398
+ };
399
+ this.onChannelChanged = (e) => {
400
+ const channel = e.detail;
401
+ if (channel.id.includes(chat.TEMPORARY_CHANNEL_PREFIX)) {
402
+ this.createDMChannel(channel.id.replace(chat.TEMPORARY_CHANNEL_PREFIX, ''));
403
+ }
404
+ else {
405
+ this.selectedChannelId = channel.id;
406
+ }
407
+ this.cleanup();
408
+ if (this.selectorState !== 'desktop') {
409
+ this.selectorState = 'hide';
410
+ }
411
+ };
412
+ this.createDMChannel = async (memberId) => {
413
+ this.creatingChannel = true;
414
+ const newChannel = await this.meeting.chat.createChannel('Direct Message', [memberId], {
415
+ visibility: 'private',
416
+ isDirectMessage: true,
417
+ });
418
+ this.creatingChannel = false;
419
+ this.selectedChannelId = newChannel.id;
420
+ };
421
+ this.cleanup = () => {
422
+ this.editingMessage = null;
423
+ this.replyMessage = null;
424
+ this.searchQuery = '';
425
+ };
426
+ this.onQuotedMessageDismiss = () => {
427
+ this.replyMessage = null;
428
+ };
429
+ this.onChannelCreateOrUpdate = (channel) => {
430
+ if (channel) {
431
+ this.channelMap.set(channel.id, channel);
432
+ }
433
+ else {
434
+ this.meeting.chat.channels.forEach((chan) => this.channelMap.set(chan.id, chan));
435
+ }
436
+ const allChannels = Array.from(this.channelMap.values());
437
+ const channels = allChannels
438
+ .filter((channel) => !chat.isDirectMessageChannel(channel))
439
+ .sort((a, b) => chat.alphabeticalSorter(a.displayName, b.displayName));
440
+ const membersWithChannel = allChannels.filter(chat.isDirectMessageChannel).map((channel) => {
441
+ return Object.assign(Object.assign({}, channel), { displayName: this.getMemberDisplayName(channel) });
442
+ });
443
+ const membersWithoutChannel = this.meeting.participants.all
444
+ .toArray()
445
+ .filter((member) => {
446
+ if (member.userId === this.meeting.self.userId)
447
+ return false;
448
+ const matcher = chat.getDMComparator([this.meeting.self.userId, member.userId]);
449
+ return membersWithChannel.every((channel) => chat.getDMComparator(channel.memberIds) !== matcher);
450
+ })
451
+ .map((member) => {
452
+ return {
453
+ id: `${chat.TEMPORARY_CHANNEL_PREFIX}${member.userId}`,
454
+ displayName: member.name,
455
+ displayPictureUrl: member.picture,
456
+ isDirectMessage: true,
457
+ unreadCount: 0,
458
+ };
459
+ });
460
+ const dms = [...membersWithChannel, ...membersWithoutChannel].sort((a, b) => chat.alphabeticalSorter(a.displayName, b.displayName));
461
+ this.channels = [...channels, ...dms];
462
+ // select channel only if it is created in db
463
+ const nonTemporaryChannel = [...channels, ...membersWithChannel];
464
+ if (!this.selectedChannelId && nonTemporaryChannel.length !== 0) {
465
+ this.selectedChannelId = nonTemporaryChannel[0].id;
466
+ }
467
+ };
468
+ this.getMemberDisplayName = (channel) => {
469
+ var _a;
470
+ let id;
471
+ if (channel.memberIds.length === 1) {
472
+ // channel with self
473
+ id = channel.memberIds[0];
474
+ }
475
+ else {
476
+ id =
477
+ channel.memberIds[0] === this.meeting.self.userId
478
+ ? channel.memberIds[1]
479
+ : channel.memberIds[0];
480
+ }
481
+ const member = this.meeting.participants.all.toArray().find((member) => member.userId === id);
482
+ return (_a = member === null || member === void 0 ? void 0 : member.name) !== null && _a !== void 0 ? _a : id;
483
+ };
484
+ this.onNewMessageHandler = async (e) => {
485
+ const message = e.detail;
486
+ this.meeting.chat.sendMessage(message, this.getRecipientPeerIds());
487
+ };
488
+ this.onEditMessageHandler = async (e) => {
489
+ var _a, _b;
490
+ await ((_b = (_a = this.meeting) === null || _a === void 0 ? void 0 : _a.chat) === null || _b === void 0 ? void 0 : _b.editTextMessage(this.editingMessage.id, e.detail, this.editingMessage.channelId));
491
+ this.editingMessage = null;
492
+ };
493
+ this.onEditCancel = () => {
494
+ this.editingMessage = null;
495
+ };
496
+ this.onPinMessage = (event) => {
497
+ const message = event.detail;
498
+ if (message.pinned) {
499
+ this.meeting.chat.unpin(message.id);
500
+ }
501
+ else {
502
+ this.meeting.chat.pin(message.id);
503
+ }
504
+ };
505
+ this.onDeleteMessage = (event) => {
506
+ const message = event.detail;
507
+ this.meeting.chat.deleteMessage(message.id);
508
+ };
509
+ this.getPrivateChatRecipients = () => {
510
+ const participants = this.getFilteredParticipants().map((participant) => {
511
+ const key = chat.generateChatGroupKey([participant.userId, this.meeting.self.userId]);
512
+ const result = {
513
+ id: participant.userId,
514
+ name: participant.name,
515
+ avatarUrl: participant.picture,
516
+ unreadCount: this.unreadCountGroups[key],
517
+ };
518
+ return result;
519
+ });
520
+ const everyone = {
521
+ id: 'everyone',
522
+ name: this.t('chat.everyone'),
523
+ icon: 'participants',
524
+ unreadCount: this.unreadCountGroups['everyone'],
525
+ };
526
+ return [everyone, ...participants];
527
+ };
528
+ this.onTogglePinnedMessages = () => {
529
+ this.showPinnedMessages = !this.showPinnedMessages;
530
+ };
531
+ this.renderPinnedMessagesHeader = () => {
532
+ if (this.meeting.chat.pinned.length === 0)
533
+ return null;
534
+ return (index$1.h("rtk-tooltip", { label: this.t('chat.toggle_pinned_msgs') }, index$1.h("div", { class: { 'pinned-messages-header': true, active: this.showPinnedMessages }, onClick: this.onTogglePinnedMessages }, index$1.h("rtk-icon", { icon: this.iconPack.pin }), this.t('chat.pinned_msgs'), ` (${this.meeting.chat.pinned.length})`)));
535
+ };
536
+ }
537
+ connectedCallback() {
538
+ if (!this.meeting)
539
+ return;
540
+ this.meetingChanged(this.meeting);
541
+ if (this.meeting && !this.meeting.chat) {
542
+ return;
543
+ }
544
+ if (this.isFileMessagingAllowed()) {
545
+ this.host.addEventListener('dragover', this.onDragOver);
546
+ this.host.addEventListener('dragleave', this.onDragLeave);
547
+ this.host.addEventListener('drop', this.onDrop);
548
+ }
549
+ }
550
+ onEditMessageInit(event) {
551
+ if (event.detail.flags.isReply) {
552
+ this.replyMessage = event.detail.payload;
553
+ }
554
+ else if (event.detail.flags.isEdit) {
555
+ this.editingMessage = event.detail.payload;
556
+ }
557
+ }
558
+ disconnectedCallback() {
559
+ var _a;
560
+ (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
561
+ this.disconnectMeeting(this.meeting);
562
+ this.host.removeEventListener('dragover', this.onDragOver);
563
+ this.host.removeEventListener('dragleave', this.onDragLeave);
564
+ this.host.removeEventListener('drop', this.onDrop);
565
+ }
566
+ meetingChanged(meeting, oldMeeting) {
567
+ var _a, _b, _c, _d, _e, _f;
568
+ if (oldMeeting != undefined)
569
+ this.disconnectMeeting(oldMeeting);
570
+ if (meeting && !meeting.chat)
571
+ return;
572
+ if (meeting != null) {
573
+ this.canSend = meeting.self.permissions.chatPublic.canSend;
574
+ this.canSendTextMessage = meeting.self.permissions.chatPublic.text;
575
+ this.canSendFiles = meeting.self.permissions.chatPublic.files;
576
+ this.canPrivateMessage = !!(((_a = meeting.self.permissions.chatPrivate) === null || _a === void 0 ? void 0 : _a.canSend) ||
577
+ ((_b = meeting.self.permissions.chatPrivate) === null || _b === void 0 ? void 0 : _b.canReceive));
578
+ this.canSendPrivateTexts = !!((_c = meeting.self.permissions.chatPrivate) === null || _c === void 0 ? void 0 : _c.text);
579
+ this.canSendPrivateFiles = !!((_d = meeting.self.permissions.chatPrivate) === null || _d === void 0 ? void 0 : _d.files);
580
+ this.canPinMessages =
581
+ ((_e = meeting === null || meeting === void 0 ? void 0 : meeting.__internals__) === null || _e === void 0 ? void 0 : _e.features.hasFeature(uiStore.FlagsmithFeatureFlags.PINNED_MESSAGES)) &&
582
+ meeting.self.permissions.pinParticipant;
583
+ this.initializeChatGroups();
584
+ // shallow copy to trigger render
585
+ this.chatGroups = Object.assign({}, this.chatGroups);
586
+ meeting.self.permissions.on('*', this.chatPermissionUpdateListener);
587
+ this.onParticipantUpdate();
588
+ (_f = meeting.chat) === null || _f === void 0 ? void 0 : _f.addListener('chatUpdate', this.chatUpdateListener);
589
+ if (this.isPrivateChatSupported()) {
590
+ meeting.participants.joined.addListener('participantJoined', this.onParticipantUpdate);
591
+ meeting.participants.joined.addListener('participantLeft', this.onParticipantUpdate);
592
+ }
593
+ }
594
+ }
595
+ chatGroupsChanged(chatGroups) {
596
+ var _a, _b;
597
+ if (!this.isPrivateChatSupported()) {
598
+ return;
599
+ }
600
+ const unreadCounts = {};
601
+ for (const key in chatGroups) {
602
+ const lastReadTimestamp = (_a = uiStore.chatUnreadTimestamps[key]) !== null && _a !== void 0 ? _a : 0;
603
+ unreadCounts[key] = chatGroups[key].filter((c) => c.type == 'chat' &&
604
+ c.message.time > lastReadTimestamp &&
605
+ c.message.userId !== this.meeting.self.userId).length;
606
+ if (key ===
607
+ chat.generateChatGroupKey([this.meeting.self.userId, (_b = this.selectedParticipant) === null || _b === void 0 ? void 0 : _b.userId]) ||
608
+ (key === 'everyone' && this.selectedParticipant === null)) {
609
+ unreadCounts[key] = 0;
610
+ uiStore.chatUnreadTimestamps[key] = new Date();
611
+ }
612
+ }
613
+ this.updateUnreadCountGroups(unreadCounts);
614
+ }
615
+ initializeChatGroups() {
616
+ var _a;
617
+ (_a = this.meeting.chat) === null || _a === void 0 ? void 0 : _a.messages.forEach((message) => {
618
+ if (!this.displayFilter || this.displayFilter(message)) {
619
+ this.addToChatGroup(message);
620
+ }
621
+ });
622
+ }
623
+ onDisplayFilterChanged(newFilter, oldFilter) {
624
+ if (newFilter !== oldFilter) {
625
+ this.chatGroups = {};
626
+ this.initializeChatGroups();
627
+ }
628
+ }
629
+ addToChatGroup(message) {
630
+ var _a;
631
+ const parsedMessage = chat.parseMessageForTarget(message);
632
+ let key = 'everyone';
633
+ if (((_a = parsedMessage.targetUserIds) === null || _a === void 0 ? void 0 : _a.length) > 0) {
634
+ const allParticipants = new Set([
635
+ parsedMessage.userId,
636
+ ...parsedMessage.targetUserIds,
637
+ ]);
638
+ key = chat.generateChatGroupKey(Array.from(allParticipants));
639
+ }
640
+ if (this.chatGroups[key] === undefined)
641
+ this.chatGroups[key] = [];
642
+ let isEditedMessage = false;
643
+ let messages = [];
644
+ this.chatGroups[key].forEach((chat) => {
645
+ if (chat.type === 'chat' && chat.message.id === message.id) {
646
+ isEditedMessage = true;
647
+ messages.push({ type: 'chat', message: parsedMessage });
648
+ }
649
+ else {
650
+ messages.push(chat);
651
+ }
652
+ });
653
+ if (!isEditedMessage) {
654
+ messages.push({ type: 'chat', message: parsedMessage });
655
+ }
656
+ this.chatGroups[key] = messages;
657
+ }
658
+ getRecipientPeerIds() {
659
+ let peerIds = [];
660
+ if (this.chatRecipientId !== 'everyone') {
661
+ peerIds = [this.selectedParticipant.id];
662
+ }
663
+ return peerIds;
664
+ }
665
+ channelSwitchListener(e) {
666
+ this.onChannelChanged(e);
667
+ }
668
+ renderComposerUI() {
669
+ var _a, _b, _c;
670
+ if (this.chatRecipientId === 'everyone') {
671
+ if (!this.canSendTextMessage && !this.canSendFiles)
672
+ return null;
673
+ }
674
+ else {
675
+ if (!this.canSendPrivateTexts && !this.canSendPrivateFiles)
676
+ return null;
677
+ }
678
+ const uiProps = { iconPack: this.iconPack, t: this.t, size: this.size };
679
+ const message = this.editingMessage ? this.editingMessage.message : '';
680
+ const quotedMessage = this.replyMessage ? this.replyMessage.message : '';
681
+ return (index$1.h("rtk-chat-composer-view", Object.assign({ message: message, storageKey: (_a = this.selectedChannelId) !== null && _a !== void 0 ? _a : `draft-${this.selectedChannelId}`, quotedMessage: quotedMessage, isEditing: !!this.editingMessage, canSendTextMessage: this.isTextMessagingAllowed(), canSendFiles: this.isFileMessagingAllowed(), disableEmojiPicker: !!((_c = (_b = this.meeting) === null || _b === void 0 ? void 0 : _b.__internals__) === null || _c === void 0 ? void 0 : _c.features.hasFeature(uiStore.FlagsmithFeatureFlags.DISABLE_EMOJI_PICKER)), maxLength: this.meeting.chat.maxTextLimit, rateLimits: this.meeting.chat.rateLimits, inputTextPlaceholder: this.t('chat.message_placeholder'), onNewMessage: this.onNewMessageHandler, onEditMessage: this.onEditMessageHandler, onEditCancel: this.onEditCancel, onQuotedMessageDismiss: this.onQuotedMessageDismiss }, uiProps), index$1.h("slot", { name: "chat-addon", slot: "chat-addon" })));
682
+ }
683
+ render() {
684
+ var _a;
685
+ if (!this.meeting) {
686
+ return null;
687
+ }
688
+ let chatMessages = this.chatGroups[this.selectedGroup] || [];
689
+ if (this.showPinnedMessages && this.meeting.chat.pinned.length !== 0) {
690
+ chatMessages = chatMessages.filter((chat) => chat.type === 'chat' && chat.message.pinned);
691
+ }
692
+ return (index$1.h(index$1.Host, null, index$1.h("div", { class: "chat-container" }, index$1.h("div", { class: "chat" }, this.isFileMessagingAllowed() && (index$1.h("div", { id: "dropzone", class: { active: this.dropzoneActivated }, part: "dropzone" }, index$1.h("rtk-icon", { icon: this.iconPack.attach }), index$1.h("p", null, this.t('chat.send_attachment')))), this.renderPinnedMessagesHeader(), this.isPrivateChatSupported() && (index$1.h("rtk-channel-selector-view", { channels: this.getPrivateChatRecipients(), selectedChannelId: ((_a = this.selectedParticipant) === null || _a === void 0 ? void 0 : _a.userId) || 'everyone', onChannelChange: this.updateRecipients, t: this.t, viewAs: "dropdown" })), index$1.h("rtk-chat-messages-ui-paginated", { meeting: this.meeting, onPinMessage: this.onPinMessage, onDeleteMessage: this.onDeleteMessage, size: this.size, iconPack: this.iconPack, t: this.t }), this.renderComposerUI()))));
693
+ }
694
+ get host() { return index$1.getElement(this); }
695
+ static get watchers() { return {
696
+ "meeting": ["meetingChanged"],
697
+ "chatGroups": ["chatGroupsChanged"],
698
+ "displayFilter": ["onDisplayFilterChanged"]
699
+ }; }
700
+ };
701
+ __decorate$f([
702
+ index.SyncWithStore()
703
+ ], RtkChat.prototype, "meeting", void 0);
704
+ __decorate$f([
705
+ index.SyncWithStore()
706
+ ], RtkChat.prototype, "config", void 0);
707
+ __decorate$f([
708
+ index.SyncWithStore()
709
+ ], RtkChat.prototype, "iconPack", void 0);
710
+ __decorate$f([
711
+ index.SyncWithStore()
712
+ ], RtkChat.prototype, "t", void 0);
713
+ RtkChat.style = RtkChatStyle0;
714
+
715
+ const rtkChatComposerViewCss = ":host {\n display: flex;\n flex-direction: column;\n font-family: var(--rtk-font-family, sans-serif);\n font-size: 14px;\n position: relative;\n}\n\n.quoted-message-container {\n margin-bottom: var(--rtk-space-2, 8px);\n display: flex;\n justify-content: space-between;\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));\n color: rgb(var(--rtk-colors-text-1000, 255 255 255));\n border-radius: var(--rtk-border-radius-md, 8px);\n border: var(--rtk-border-width-sm, 1px) solid rgb(var(--rtk-colors-background-600, 60 60 60));\n}\n\n.quoted-message-container .quoted-message {\n flex: 1 1 0%;\n padding: var(--rtk-space-2, 8px);\n border-radius: var(--rtk-border-radius-md, 8px);\n max-height: var(--rtk-space-24, 96px);\n overflow-y: auto;\n word-break: break-all;\n}\n\n.quoted-message-container .quoted-message blockquote {\n display: none;\n}\n\n.quoted-message-container rtk-icon.dismiss {\n margin-left: auto;\n height: var(--rtk-space-5, 20px);\n width: var(--rtk-space-5, 20px);\n padding: var(--rtk-space-2, 8px);\n border-radius: var(--rtk-border-radius-md, 8px);\n color: rgb(var(--rtk-colors-text-600, 255 255 255 / 0.52));\n}\n\n.quoted-message-container rtk-icon.dismiss:hover {\n cursor: pointer;\n color: rgb(var(--rtk-colors-text-1000, 255 255 255));\n}\n\n.quoted-message-container rtk-icon.dismiss {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n\n.composer-container {\n position: relative;\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));\n border-radius: var(--rtk-border-radius-md, 8px);\n overflow: hidden;\n border: var(--rtk-border-width-sm, 1px) solid rgb(var(--rtk-colors-background-600, 60 60 60));\n}\n\n.composer-container > .composers {\n min-height: 60px;\n }\n\n@container chatcontainer (height < 360px) {\n .composer-container > .composers {\n min-height: 30px;\n }\n}\n\n.chat-buttons {\n padding: var(--rtk-space-3, 12px);\n display: flex;\n align-items: center;\n justify-content: space-between;\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));\n color: rgb(var(--rtk-colors-text-1000, 255 255 255));\n}\n\n.chat-buttons .right {\n z-index: 10;\n}\n\n.chat-buttons .right .edit-buttons {\n display: flex;\n gap: var(--rtk-space-2, 8px);\n}\n\n.chat-buttons > div {\n display: flex;\n align-items: center;\n}\n\nrtk-emoji-picker {\n z-index: 20;\n position: absolute;\n top: calc(var(--rtk-space-72, 288px) * -1);\n border-top: var(--rtk-border-width-sm, 1px) solid rgb(var(--rtk-colors-background-600, 60 60 60));\n animation: 0.3s slide-up ease;\n}\n\n@keyframes slide-up {\n from {\n transform: translateY(100%);\n }\n to {\n transform: translateY(0%);\n }\n}\n";
716
+ const RtkChatComposerViewStyle0 = rtkChatComposerViewCss;
717
+
718
+ var __decorate$e = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
719
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
720
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
721
+ r = Reflect.decorate(decorators, target, key, desc);
722
+ else
723
+ for (var i = decorators.length - 1; i >= 0; i--)
724
+ if (d = decorators[i])
725
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
726
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
727
+ };
728
+ const messageLimits = {
729
+ messagesSent: 0,
730
+ startTime: 0,
731
+ };
732
+ const RtkChatComposerView = class {
733
+ constructor(hostRef) {
734
+ index$1.registerInstance(this, hostRef);
735
+ this.onNewMessage = index$1.createEvent(this, "newMessage", 7);
736
+ this.onEditMessage = index$1.createEvent(this, "editMessage", 7);
737
+ this.onEditCancel = index$1.createEvent(this, "editCancel", 7);
738
+ this.onQuotedMessageDismiss = index$1.createEvent(this, "quotedMessageDismiss", 7);
739
+ /** Whether user can send text messages */
740
+ this.canSendTextMessage = true;
741
+ /** Whether user can send file messages */
742
+ this.canSendFiles = true;
743
+ /** Message to be pre-populated */
744
+ this.message = '';
745
+ /** Quote message to be displayed */
746
+ this.quotedMessage = '';
747
+ /** Key for storing message in localStorage */
748
+ this.storageKey = 'rtk-text-message';
749
+ /** Placeholder for text input */
750
+ this.inputTextPlaceholder = 'Enter your message';
751
+ /** Sets composer to edit mode */
752
+ this.isEditing = false;
753
+ /** Icon pack */
754
+ this.iconPack = uiStore.defaultIconPack;
755
+ /** Language */
756
+ this.t = uiStore.useLanguage();
757
+ /** Whether to show emoji picker */
758
+ this.disableEmojiPicker = false;
759
+ /** Rate limits */
760
+ this.rateLimits = {
761
+ period: 60,
762
+ maxInvocations: 60,
763
+ };
764
+ this.fileToUpload = null;
765
+ this.isEmojiPickerOpen = false;
766
+ this.disableSendButton = false;
767
+ this.rateLimitsBreached = false;
768
+ this.textMessage = '';
769
+ this.sendFile = () => {
770
+ if (!this.canSendFiles) {
771
+ return;
772
+ }
773
+ if (this.fileToUpload.type === 'image') {
774
+ this.onNewMessage.emit({
775
+ type: 'image',
776
+ image: this.fileToUpload.file,
777
+ });
778
+ }
779
+ else {
780
+ this.onNewMessage.emit({ type: 'file', file: this.fileToUpload.file });
781
+ }
782
+ this.fileToUpload = null;
783
+ };
784
+ this.handleSendMessage = () => {
785
+ if (!this.canSendTextMessage || this.rateLimitsBreached) {
786
+ return;
787
+ }
788
+ if (this.fileToUpload !== null) {
789
+ this.sendFile();
790
+ return;
791
+ }
792
+ const message = this.textMessage;
793
+ const currentTime = Date.now();
794
+ if (currentTime - messageLimits.startTime > this.rateLimits.period * 1000) {
795
+ messageLimits.startTime = currentTime;
796
+ messageLimits.messagesSent = 0;
797
+ }
798
+ messageLimits.messagesSent += 1;
799
+ this.checkRateLimitBreached(currentTime);
800
+ if (message.length > 0) {
801
+ if (this.quotedMessage.length !== 0) {
802
+ this.onNewMessage.emit({
803
+ type: 'text',
804
+ message,
805
+ });
806
+ }
807
+ else {
808
+ this.onNewMessage.emit({ type: 'text', message });
809
+ }
810
+ this.cleanup();
811
+ }
812
+ };
813
+ this.handleEditMessage = () => {
814
+ this.onEditMessage.emit(this.textMessage);
815
+ this.cleanup();
816
+ };
817
+ this.handleEditCancel = () => {
818
+ this.onEditCancel.emit();
819
+ this.cleanup();
820
+ };
821
+ this.onTextChangeHandler = (event) => {
822
+ var _a;
823
+ this.textMessage = event.detail;
824
+ if (this.textMessage.length >= ((_a = this.maxLength) !== null && _a !== void 0 ? _a : chat.MAX_TEXT_LENGTH)) {
825
+ this.disableSendButton = true;
826
+ }
827
+ else if (this.disableSendButton) {
828
+ this.disableSendButton = false;
829
+ }
830
+ uiStore.gracefulStorage.setItem(this.storageKey, event.detail);
831
+ };
832
+ this.onKeyDownHandler = (event) => {
833
+ if (event.key === 'Enter' && event.shiftKey) {
834
+ return;
835
+ }
836
+ if (this.disableSendButton) {
837
+ return;
838
+ }
839
+ if (event.key === 'Enter') {
840
+ event.preventDefault();
841
+ if (this.isEditing) {
842
+ this.handleEditMessage();
843
+ }
844
+ else {
845
+ this.handleSendMessage();
846
+ }
847
+ }
848
+ };
849
+ this.onFileUploadHandler = (type, file) => {
850
+ this.fileToUpload = { type, file };
851
+ };
852
+ this.onQuotedMessageDismissHandler = () => {
853
+ this.onQuotedMessageDismiss.emit();
854
+ };
855
+ this.cleanup = () => {
856
+ this.textMessage = '';
857
+ this.fileToUpload = null;
858
+ uiStore.gracefulStorage.setItem(this.storageKey, '');
859
+ this.$textComposer.setText('', true);
860
+ this.isEmojiPickerOpen = false;
861
+ };
862
+ this.onKeyDownHandler = this.onKeyDownHandler.bind(this);
863
+ }
864
+ connectedCallback() {
865
+ this.textMessage = this.message || uiStore.gracefulStorage.getItem(this.storageKey) || '';
866
+ this.checkRateLimitBreached(Date.now());
867
+ }
868
+ componentWillUpdate() {
869
+ this.textMessage = this.message || uiStore.gracefulStorage.getItem(this.storageKey) || '';
870
+ }
871
+ componentDidLoad() {
872
+ if (this.message) {
873
+ index$1.writeTask(() => this.$textComposer.setText(this.message, true));
874
+ }
875
+ }
876
+ checkRateLimitBreached(currentTime) {
877
+ // Check if the function call is within limits
878
+ if (messageLimits.messagesSent >= this.rateLimits.maxInvocations) {
879
+ this.disableSendButton = true;
880
+ this.rateLimitsBreached = true;
881
+ const timeRemainingForReset = currentTime - messageLimits.startTime + this.rateLimits.period * 1000;
882
+ setTimeout(() => {
883
+ messageLimits.messagesSent = 0;
884
+ messageLimits.startTime = Date.now();
885
+ this.disableSendButton = false;
886
+ this.rateLimitsBreached = false;
887
+ }, timeRemainingForReset);
888
+ }
889
+ }
890
+ render() {
891
+ var _a;
892
+ const uiProps = { iconPack: this.iconPack, t: this.t };
893
+ return (index$1.h(index$1.Host, { key: '06455539e3067eb1c1c592b551d0ef99eba2f331' }, this.canSendTextMessage && this.isEmojiPickerOpen && (index$1.h("rtk-emoji-picker", Object.assign({ key: 'fe83b0ab9562cc0e1c61f89e4b441ef592edfa1a', part: "emoji-picker", onPickerClose: () => {
894
+ this.isEmojiPickerOpen = false;
895
+ }, onRtkEmojiClicked: (e) => {
896
+ this.textMessage += e.detail;
897
+ this.$textComposer.setText(this.textMessage, true);
898
+ } }, uiProps))), index$1.h("slot", { key: '8653c2e805e41adf5958941cc10ff01d43f97792', name: "chat-addon" }), this.quotedMessage && this.quotedMessage.length !== 0 && (index$1.h("div", { key: '82b9bf5203a799709e980d61ab827b9daf8292e6', class: "quoted-message-container", part: "quoted-message-container" }, index$1.h("div", { key: '4b9fe8f382da7075e815c329f2d7dca17ce0f694', class: "quoted-message scrollbar" }, index$1.h("rtk-text-message-view", { key: '7a16547e83d9bca43794e46e56c5a9c743a9929a', text: this.quotedMessage, isMarkdown: true })), index$1.h("div", { key: '5691b8d882016cda66cd2faf3858bc38cd53458c' }, index$1.h("rtk-icon", { key: '2d5b222bd5eaac6d46812b704674f52f86efdb92', "aria-label": this.t('dismiss'), class: "dismiss", icon: this.iconPack.dismiss, onClick: this.onQuotedMessageDismissHandler })))), index$1.h("div", { key: 'd7638411df9ae1b2cbef8cae66d0af2b7ad310e6', class: "composer-container" }, index$1.h("div", { key: 'ca1ee222584fdd27e53989d28b6ce583c6b0c400', class: "composers" }, this.fileToUpload && (index$1.h("rtk-draft-attachment-view", Object.assign({ key: 'd511c900c71a97f8f92640b73a7575dcd267de88' }, uiProps, { attachment: this.fileToUpload, onDeleteAttachment: () => (this.fileToUpload = null) }))), !this.fileToUpload && (index$1.h("rtk-text-composer-view", { key: '08f214184853dcedeccb5f07dac2a0a308269793', value: this.textMessage, placeholder: this.inputTextPlaceholder, onTextChange: this.onTextChangeHandler, keyDownHandler: this.onKeyDownHandler, maxLength: (_a = this.maxLength) !== null && _a !== void 0 ? _a : chat.MAX_TEXT_LENGTH, rateLimitBreached: this.rateLimitsBreached, t: this.t, iconPack: this.iconPack, ref: (el) => (this.$textComposer = el) }))), index$1.h("div", { key: '9b6cbe7cb8529c8e60f8cc9e13cc95ca64504efc', class: "chat-buttons", part: "chat-buttons" }, index$1.h("div", { key: '30e24e8edf58179ef20ccd436d3833ba177ebb0d', class: "left", part: "chat-buttons-left" }, !this.fileToUpload && !this.isEditing && (index$1.h("div", { key: '54ad294bedab1c0bc7c02a72c4f3f51bc10bba85' }, this.canSendFiles && [
899
+ index$1.h("rtk-file-picker-button", Object.assign({ key: '1a0760e05a183b6c8da2ff02e33ecd40bfdb6e97' }, uiProps, { onFileChange: (event) => this.onFileUploadHandler('file', event.detail) })),
900
+ index$1.h("rtk-file-picker-button", Object.assign({ key: '5d6cf1928c8edb6737b367807c93152ad62cea36', filter: "image/*", label: this.t('chat.send_img'), icon: "image", onFileChange: (event) => this.onFileUploadHandler('image', event.detail) }, uiProps)),
901
+ ], this.canSendTextMessage && !this.disableEmojiPicker && (index$1.h("rtk-emoji-picker-button", Object.assign({ key: '50f14152b8d15009104e9b1dd05ee5e1ec49ab16', isActive: this.isEmojiPickerOpen, onClick: () => {
902
+ this.isEmojiPickerOpen = !this.isEmojiPickerOpen;
903
+ } }, uiProps))), index$1.h("slot", { key: '1e1fe81e1e196fc8d679bfc2d6ed0c6402c74a4a', name: "chat-buttons" })))), index$1.h("div", { key: '272526b7c81ed1acd028beceb3869c584e94308f', class: "right", part: "chat-buttons-right" }, !this.isEditing && (index$1.h("rtk-tooltip", { key: '6750abf323b2f1c951661c44390eb97d3ec71544', variant: "primary", label: this.t('chat.send_msg'), delay: 2000 }, index$1.h("rtk-button", { key: 'a159fa6dcc1f8ede64085abd8286a69ad86b7002', kind: "icon", disabled: this.disableSendButton, onClick: () => this.handleSendMessage(), title: this.t('chat.send_msg') }, index$1.h("rtk-icon", { key: 'bb26a3a7954727859f5566ecc60d746ac6700b7b', icon: this.iconPack.send })))), this.isEditing && (index$1.h("div", { key: '5ef512e3fc236510a518e76ce027f0c8fc1c9a0c', class: "edit-buttons" }, index$1.h("rtk-tooltip", { key: 'e18ae7567350d32b18a70de8cb2c1af0830353bc', variant: "secondary", label: this.t('cancel'), delay: 2000 }, index$1.h("rtk-button", { key: '4f4aa2e44308a393314ab95244c87a3b8d4b282c', kind: "icon", variant: "secondary", onClick: () => this.handleEditCancel(), title: this.t('cancel') }, index$1.h("rtk-icon", { key: 'a4a99fe9ae34707cb63f63461a4728baf70e3e7a', icon: this.iconPack.dismiss }))), index$1.h("rtk-tooltip", { key: '789315dbf551ba74d004459981532fa9a467ac45', variant: "primary", label: this.t('chat.update_msg'), delay: 2000 }, index$1.h("rtk-button", { key: '61da43993c2da9b8bd00796544030e9b4cb45f12', kind: "icon", onClick: () => this.handleEditMessage(), title: this.t('chat.send_msg') }, index$1.h("rtk-icon", { key: 'e45aab29b0f6553ed2d7f370a8817bdccdabe42e', icon: this.iconPack.checkmark }))))))))));
904
+ }
905
+ };
906
+ __decorate$e([
907
+ index.SyncWithStore()
908
+ ], RtkChatComposerView.prototype, "iconPack", void 0);
909
+ __decorate$e([
910
+ index.SyncWithStore()
911
+ ], RtkChatComposerView.prototype, "t", void 0);
912
+ RtkChatComposerView.style = RtkChatComposerViewStyle0;
913
+
914
+ const rtkChatMessagesUiPaginatedCss = ":host{display:flex;flex-direction:column;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));flex:1 0 0px}";
915
+ const RtkChatMessagesUiPaginatedStyle0 = rtkChatMessagesUiPaginatedCss;
916
+
917
+ var __decorate$d = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
918
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
919
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
920
+ r = Reflect.decorate(decorators, target, key, desc);
921
+ else
922
+ for (var i = decorators.length - 1; i >= 0; i--)
923
+ if (d = decorators[i])
924
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
925
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
926
+ };
927
+ const RtkChatMessagesUiPaginated = class {
928
+ constructor(hostRef) {
929
+ index$1.registerInstance(this, hostRef);
930
+ this.editMessageInit = index$1.createEvent(this, "editMessageInit", 7);
931
+ this.onPinMessage = index$1.createEvent(this, "pinMessage", 7);
932
+ this.onDeleteMessage = index$1.createEvent(this, "deleteMessage", 7);
933
+ this.stateUpdate = index$1.createEvent(this, "rtkStateUpdate", 7);
934
+ /** Icon pack */
935
+ this.iconPack = uiStore.defaultIconPack;
936
+ /** Language */
937
+ this.t = uiStore.useLanguage();
938
+ /** Whether to align chat bubbles to the left */
939
+ this.leftAlign = false;
940
+ this.permissionsChanged = false;
941
+ this.pageSize = 25;
942
+ this.lastReadMessageIndex = -1;
943
+ this.permissionsUpdateListener = () => {
944
+ this.permissionsChanged = !this.permissionsChanged;
945
+ };
946
+ this.maybeMarkChannelAsRead = (messages) => {
947
+ if (!this.selectedChannelId)
948
+ return;
949
+ if (messages.length === 0)
950
+ return;
951
+ if (this.lastReadMessageIndex !== -1)
952
+ return;
953
+ const latestMsg = messages.at(0).time > messages.at(-1).time ? messages.at(0) : messages.at(-1);
954
+ if (!latestMsg.channelIndex)
955
+ return;
956
+ this.lastReadMessageIndex = parseInt(latestMsg.channelIndex, 10);
957
+ this.meeting.chat.markLastReadMessage(this.selectedChannelId, latestMsg);
958
+ };
959
+ this.getChatMessages = async (timestamp, size, reversed) => {
960
+ const { messages } = await this.meeting.chat.getMessages(timestamp, size, reversed, undefined, this.selectedChannelId);
961
+ this.maybeMarkChannelAsRead(messages);
962
+ return messages;
963
+ };
964
+ this.createChatNodes = (data) => {
965
+ /**
966
+ * NOTE(callmetarush): When between pages the message's isContinued
967
+ * will fail in current implementation
968
+ */
969
+ return data.map((message, idx) => {
970
+ var _a;
971
+ const isContinued = message.userId === ((_a = data[idx - 1]) === null || _a === void 0 ? void 0 : _a.userId);
972
+ return this.createChatNode(message, isContinued);
973
+ });
974
+ };
975
+ this.disconnectMeeting = (meeting) => {
976
+ var _a, _b;
977
+ (_a = meeting === null || meeting === void 0 ? void 0 : meeting.chat) === null || _a === void 0 ? void 0 : _a.removeListener('chatUpdate', this.chatUpdateListener);
978
+ (_b = this.meeting) === null || _b === void 0 ? void 0 : _b.self.permissions.removeListener('permissionsUpdate', this.permissionsUpdateListener);
979
+ };
980
+ this.getMessageActions = (message) => {
981
+ const actions = [];
982
+ // const isSelf = this.meeting.self.userId === message.userId;
983
+ // const chatMessagePermissions = this.meeting.self.permissions?.chatMessage;
984
+ // const canEdit =
985
+ // chatMessagePermissions === undefined
986
+ // ? isSelf
987
+ // : chatMessagePermissions.canEdit === 'ALL' ||
988
+ // (chatMessagePermissions.canEdit === 'SELF' && isSelf);
989
+ // const canDelete =
990
+ // chatMessagePermissions === undefined
991
+ // ? isSelf
992
+ // : chatMessagePermissions.canDelete === 'ALL' ||
993
+ // (chatMessagePermissions.canDelete === 'SELF' && isSelf);
994
+ if (this.meeting.self.permissions.pinParticipant) {
995
+ actions.push({
996
+ id: 'pin_message',
997
+ label: message.pinned ? this.t('unpin') : this.t('pin'),
998
+ icon: this.iconPack.pin,
999
+ });
1000
+ }
1001
+ // if (canDelete) {
1002
+ // actions.push({
1003
+ // id: 'delete_message',
1004
+ // label: this.t('chat.delete_msg'),
1005
+ // icon: this.iconPack.delete,
1006
+ // });
1007
+ // }
1008
+ return actions;
1009
+ };
1010
+ this.onMessageActionHandler = (actionId, message) => {
1011
+ switch (actionId) {
1012
+ case 'pin_message':
1013
+ this.onPinMessage.emit(message);
1014
+ break;
1015
+ case 'delete_message':
1016
+ this.onDeleteMessage.emit(message);
1017
+ break;
1018
+ }
1019
+ };
1020
+ this.createChatNode = (message, isContinued) => {
1021
+ var _a, _b, _c, _d;
1022
+ if (message.targetUserIds.length !== 0)
1023
+ return null; // don't render private messages
1024
+ let displayPicture;
1025
+ if (this.meeting.meta.viewType === 'CHAT') {
1026
+ displayPicture = (_a = this.meeting.participants.all
1027
+ .toArray()
1028
+ .find((p) => p.userId === message.userId)) === null || _a === void 0 ? void 0 : _a.picture;
1029
+ }
1030
+ else {
1031
+ if (this.meeting.self.userId === message.userId) {
1032
+ displayPicture = this.meeting.self.picture;
1033
+ }
1034
+ else {
1035
+ displayPicture =
1036
+ (_c = (_b = this.meeting.participants.joined
1037
+ .toArray()
1038
+ .find((member) => member.userId === message.userId)) === null || _b === void 0 ? void 0 : _b.picture) !== null && _c !== void 0 ? _c : (_d = this.meeting.participants.waitlisted.toArray().find((p) => p.userId === message.userId)) === null || _d === void 0 ? void 0 : _d.picture;
1039
+ }
1040
+ }
1041
+ const isSelf = message.userId === this.meeting.self.userId;
1042
+ const viewType = isSelf ? 'outgoing' : 'incoming';
1043
+ return (index$1.h("div", { class: { pinned: message.pinned } }, index$1.h("div", { class: "message-wrapper" }, index$1.h("rtk-message-view", { time: message.time, actions: this.getMessageActions(message), authorName: message.displayName, isSelf: isSelf, avatarUrl: displayPicture, hideAuthorName: isContinued, viewType: viewType, variant: "bubble", onAction: (event) => this.onMessageActionHandler(event.detail, message) }, index$1.h("div", null, index$1.h("div", { class: "body" }, message.type === 'text' && (index$1.h("rtk-text-message-view", { text: message.message, isMarkdown: true })), message.type === 'file' && (index$1.h("rtk-file-message-view", { name: message.name, url: message.link, size: message.size })), message.type === 'image' && (index$1.h("rtk-image-message-view", { url: message.link, onPreview: () => {
1044
+ this.stateUpdate.emit({ image: message });
1045
+ } }))), message.pinned && (index$1.h("div", { class: "pin-icon", part: "pin-icon" }, index$1.h("rtk-icon", { icon: this.iconPack.pin, size: "sm" }))))))));
1046
+ };
1047
+ this.chatUpdateListener = (data) => {
1048
+ if (this.selectedChannelId && data.message.channelId !== this.selectedChannelId)
1049
+ return;
1050
+ if (data.action === 'add') {
1051
+ this.$paginatedListRef.onNewNode(data.message);
1052
+ this.lastReadMessageIndex = -1;
1053
+ this.maybeMarkChannelAsRead([data.message]);
1054
+ }
1055
+ else if (data.action === 'delete') {
1056
+ this.$paginatedListRef.onNodeDelete(data.message.id);
1057
+ }
1058
+ else if (data.action === 'edit') {
1059
+ this.$paginatedListRef.onNodeUpdate(data.message.id, data.message);
1060
+ }
1061
+ };
1062
+ }
1063
+ componentDidLoad() {
1064
+ const slotted = this.host.shadowRoot.querySelector('slot');
1065
+ if (!slotted)
1066
+ return;
1067
+ this.children = slotted.assignedElements()[0];
1068
+ }
1069
+ connectedCallback() {
1070
+ this.meetingChanged(this.meeting);
1071
+ }
1072
+ disconnectedCallback() {
1073
+ this.disconnectMeeting(this.meeting);
1074
+ }
1075
+ meetingChanged(meeting, oldMeeting) {
1076
+ var _a;
1077
+ if (oldMeeting != undefined)
1078
+ this.disconnectMeeting(oldMeeting);
1079
+ if (meeting && !meeting.chat)
1080
+ return;
1081
+ if (meeting != null) {
1082
+ (_a = meeting.chat) === null || _a === void 0 ? void 0 : _a.addListener('chatUpdate', this.chatUpdateListener);
1083
+ meeting.self.permissions.addListener('permissionsUpdate', this.permissionsUpdateListener);
1084
+ }
1085
+ this.permissionsUpdateListener();
1086
+ }
1087
+ channelChanged() {
1088
+ this.lastReadMessageIndex = -1;
1089
+ }
1090
+ render() {
1091
+ return (index$1.h(index$1.Host, { key: '9716b4db0dbae3308a056693341635d93c0d1227' }, index$1.h("rtk-paginated-list", { key: '4b540e565aa0d7031ad8c84f35cadb07d207abfe', ref: (el) => (this.$paginatedListRef = el), pageSize: this.pageSize, pagesAllowed: 3, fetchData: this.getChatMessages, createNodes: this.createChatNodes, selectedItemId: this.selectedChannelId, emptyListLabel: this.t('chat.empty_channel') }, index$1.h("slot", { key: '41ffb56aea7e02f3c20f8ea261638d6fd9d80232' }))));
1092
+ }
1093
+ get host() { return index$1.getElement(this); }
1094
+ static get watchers() { return {
1095
+ "meeting": ["meetingChanged"],
1096
+ "selectedChannelId": ["channelChanged"]
1097
+ }; }
1098
+ };
1099
+ __decorate$d([
1100
+ index.SyncWithStore()
1101
+ ], RtkChatMessagesUiPaginated.prototype, "meeting", void 0);
1102
+ __decorate$d([
1103
+ index.SyncWithStore()
1104
+ ], RtkChatMessagesUiPaginated.prototype, "iconPack", void 0);
1105
+ __decorate$d([
1106
+ index.SyncWithStore()
1107
+ ], RtkChatMessagesUiPaginated.prototype, "t", void 0);
1108
+ RtkChatMessagesUiPaginated.style = RtkChatMessagesUiPaginatedStyle0;
1109
+
1110
+ const rtkDraftAttachmentViewCss = ":host{display:flex;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));border-top-left-radius:var(--rtk-border-radius-md, 8px);border-top-right-radius:var(--rtk-border-radius-md, 8px)}.preview-overlay{position:absolute;top:var(--rtk-space-0, 0px);right:var(--rtk-space-0, 0px);bottom:var(--rtk-space-0, 0px);left:var(--rtk-space-0, 0px);background-color:inherit}.preview{position:absolute;top:var(--rtk-space-4, 16px);left:var(--rtk-space-4, 16px);max-width:-moz-fit-content;max-width:fit-content;max-height:var(--rtk-space-20, 80px)}.preview:hover rtk-tooltip{display:block}.preview rtk-tooltip{position:absolute;top:calc(var(--rtk-space-1, 4px) * -1);left:calc(var(--rtk-space-1, 4px) * -1);display:none;margin-left:calc(var(--rtk-space-1, 4px) * -1);margin-top:calc(var(--rtk-space-1, 4px) * -1)}.preview rtk-button{display:flex;height:var(--rtk-space-4, 16px);width:var(--rtk-space-4, 16px);align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity));border:1px solid rgb(var(--rtk-colors-text-1000, 255 255 255))}.preview rtk-icon{height:var(--rtk-space-3, 12px);width:var(--rtk-space-3, 12px);color:rgb(var(--rtk-colors-text-1000, 255 255 255))}.preview-image{height:var(--rtk-space-16, 64px);width:var(--rtk-space-16, 64px);-o-object-fit:cover;object-fit:cover;max-height:100%;max-width:100%;overflow:clip;border-radius:var(--rtk-border-radius-md, 8px)}.preview-file{padding-left:var(--rtk-space-3, 12px);padding-right:var(--rtk-space-3, 12px);padding-top:var(--rtk-space-2, 8px);padding-bottom:var(--rtk-space-2, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:var(--rtk-border-radius-md, 8px);max-width:200px}";
1111
+ const RtkDraftAttachmentViewStyle0 = rtkDraftAttachmentViewCss;
1112
+
1113
+ var __decorate$c = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1114
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1115
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
1116
+ r = Reflect.decorate(decorators, target, key, desc);
1117
+ else
1118
+ for (var i = decorators.length - 1; i >= 0; i--)
1119
+ if (d = decorators[i])
1120
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1121
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1122
+ };
1123
+ const RtkDraftAttachmentView = class {
1124
+ constructor(hostRef) {
1125
+ index$1.registerInstance(this, hostRef);
1126
+ this.onDeleteAttachment = index$1.createEvent(this, "deleteAttachment", 7);
1127
+ /** Icon pack */
1128
+ this.iconPack = uiStore.defaultIconPack;
1129
+ /** Language */
1130
+ this.t = uiStore.useLanguage();
1131
+ /** Attachment to display */
1132
+ this.attachment = null;
1133
+ this.filePreview = null;
1134
+ this.fileReader = new FileReader();
1135
+ this.generatePreview = () => {
1136
+ if (this.attachment.type === 'image') {
1137
+ this.fileReader.readAsDataURL(this.attachment.file);
1138
+ }
1139
+ else if (this.attachment.type === 'file') {
1140
+ this.filePreview = this.attachment.file.name;
1141
+ }
1142
+ };
1143
+ this.onDeleteClickHandler = () => {
1144
+ this.filePreview = null;
1145
+ this.onDeleteAttachment.emit();
1146
+ };
1147
+ }
1148
+ onAttachmentChange() {
1149
+ this.generatePreview();
1150
+ }
1151
+ connectedCallback() {
1152
+ this.fileReader.onload = (e) => {
1153
+ if (typeof e.target.result === 'string') {
1154
+ this.filePreview = e.target.result;
1155
+ }
1156
+ };
1157
+ // this.fileReader.onloadstart = () => {};
1158
+ // this.fileReader.onloadend = () => {};
1159
+ }
1160
+ componentWillLoad() {
1161
+ this.onAttachmentChange();
1162
+ }
1163
+ render() {
1164
+ return (index$1.h(index$1.Host, { key: '22c8ff3317b6247dc6a0fa2088f28dc293de9738' }, index$1.h("div", { key: '317c0e6a06849af0af42d81353dc0002b82185a5', class: "preview-overlay" }, index$1.h("div", { key: '94d0d35a3696725b59341303760212cf6e01c8a7', class: "preview" }, index$1.h("rtk-tooltip", { key: '3171acf60f22a80cbcbf9d3d6f8cf5ac61b67b67', label: this.t('chat.cancel_upload') }, index$1.h("rtk-button", { key: '37d1055de9d59318c0f7f612dee3304838142968', variant: "secondary", kind: "icon", onClick: this.onDeleteClickHandler }, index$1.h("rtk-icon", { key: '9988b389300e0c6bd404d02440d7b3d323f384dd', icon: this.iconPack.dismiss }))), this.attachment.type === 'image' ? (index$1.h("img", { class: "preview-image", src: this.filePreview })) : (index$1.h("div", { class: "preview-file" }, index$1.h("span", null, this.filePreview)))))));
1165
+ }
1166
+ static get watchers() { return {
1167
+ "attachment": ["onAttachmentChange"]
1168
+ }; }
1169
+ };
1170
+ __decorate$c([
1171
+ index.SyncWithStore()
1172
+ ], RtkDraftAttachmentView.prototype, "iconPack", void 0);
1173
+ __decorate$c([
1174
+ index.SyncWithStore()
1175
+ ], RtkDraftAttachmentView.prototype, "t", void 0);
1176
+ RtkDraftAttachmentView.style = RtkDraftAttachmentViewStyle0;
1177
+
1178
+ const EMOJI_ASSET_URL = 'https://rtk-assets.realtime.cloudflare.com/assets/emojis-data.json';
1179
+ let cachedEmojis;
1180
+ /**
1181
+ * fetches the latest emoji list from CDN
1182
+ * @returns list of emojis
1183
+ */
1184
+ const fetchEmojis = async () => {
1185
+ if (!cachedEmojis) {
1186
+ const emojis = await fetch(EMOJI_ASSET_URL);
1187
+ cachedEmojis = emojis.json();
1188
+ }
1189
+ return cachedEmojis;
1190
+ };
1191
+
1192
+ const rtkEmojiPickerCss = ":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}:host{width:100%}.emoji-parent{box-sizing:border-box;display:inline-flex;height:var(--rtk-space-64, 256px);width:100%;max-width:640px;flex-direction:column;padding:var(--rtk-space-2, 8px);padding-bottom:var(--rtk-space-0, 0px);-webkit-user-select:none;-moz-user-select:none;user-select:none;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255))}.close-parent{display:flex;flex:1 1 0%;justify-content:flex-end;padding:var(--rtk-space-0, 0px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255))}#emoji-grid{margin-top:var(--rtk-space-2, 8px);box-sizing:border-box;display:flex;flex-direction:row;flex-wrap:wrap;align-content:flex-start;overflow-x:hidden;overflow-y:scroll;height:100%;grid-auto-rows:minmax(min-content, max-content)}#loader{display:flex;height:100%;width:100%;align-items:center;justify-content:center}input{display:block;height:var(--rtk-space-8, 32px);padding-left:var(--rtk-space-2, 8px);padding-right:var(--rtk-space-2, 8px);font-size:14px;border-width:var(--rtk-border-width-none, 0);border-style:solid;border-style:none;border-color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64));--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88))}input::-moz-placeholder{color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64))}input::placeholder{color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64))}input{border-radius:var(--rtk-border-radius-sm, 4px);outline:2px solid transparent;outline-offset:2px;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;border:var(--rtk-border-width-sm, 1px) solid rgb(var(--rtk-colors-background-600, 60 60 60))}input:focus{--tw-border-opacity:1;border-color:rgba(var(--rtk-colors-brand-300, 73 124 253) / var(--tw-border-opacity));--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);--tw-ring-color:rgba(var(--rtk-colors-brand-300, 73 124 253) / var(--tw-ring-opacity));--tw-ring-opacity:0.3}.emoji{height:var(--rtk-space-10, 40px);width:var(--rtk-space-10, 40px);font-size:20px;color:rgb(var(--rtk-colors-text-1000, 255 255 255))}";
1193
+ const RtkEmojiPickerStyle0 = rtkEmojiPickerCss;
1194
+
1195
+ var __decorate$b = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1196
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1197
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
1198
+ r = Reflect.decorate(decorators, target, key, desc);
1199
+ else
1200
+ for (var i = decorators.length - 1; i >= 0; i--)
1201
+ if (d = decorators[i])
1202
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1203
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1204
+ };
1205
+ const RtkEmojiPicker = class {
1206
+ constructor(hostRef) {
1207
+ index$1.registerInstance(this, hostRef);
1208
+ this.pickerClose = index$1.createEvent(this, "pickerClose", 7);
1209
+ this.emojiClicked = index$1.createEvent(this, "rtkEmojiClicked", 7);
1210
+ /** Icon pack */
1211
+ this.iconPack = uiStore.defaultIconPack;
1212
+ /** Language */
1213
+ this.t = uiStore.useLanguage();
1214
+ /** Controls whether or not to focus on mount */
1215
+ this.focusWhenOpened = true;
1216
+ this.filterVal = '';
1217
+ this.filteredEmojis = [];
1218
+ }
1219
+ componentWillLoad() {
1220
+ // Don't use async here as it will block the render
1221
+ fetchEmojis().then((e) => {
1222
+ this.emojiList = e;
1223
+ this.handleInputChange(this.inputElement);
1224
+ });
1225
+ }
1226
+ componentDidLoad() {
1227
+ if (this.focusWhenOpened) {
1228
+ this.inputElement.focus();
1229
+ }
1230
+ }
1231
+ handleInputChange(target) {
1232
+ this.filterVal = target.value;
1233
+ const regex = new RegExp(`([^,]*?${this.filterVal}[^,]*):(\\d+)`, 'g');
1234
+ this.filteredEmojis = Array.from(this.emojiList['search'].matchAll(regex)).map((m) => {
1235
+ return { name: m[1], emoji: this.emojiList['emojis'][m[2]] };
1236
+ });
1237
+ }
1238
+ handleEmojiClick(emoji) {
1239
+ this.emojiClicked.emit(emoji);
1240
+ }
1241
+ mapEmojiList() {
1242
+ var _a;
1243
+ if (((_a = this.emojiList) === null || _a === void 0 ? void 0 : _a.length) > 0) {
1244
+ return (index$1.h("div", { id: "loader" }, index$1.h("rtk-spinner", { iconPack: this.iconPack })));
1245
+ }
1246
+ return (index$1.h("div", { id: "emoji-grid", class: "scrollbar max-w-40" }, this.filteredEmojis.map((e) => (index$1.h("rtk-button", { key: `emoji-button-${e.name}`, class: "emoji", variant: "ghost", kind: "icon", title: e.name, onClick: () => this.handleEmojiClick(e.emoji) }, e.emoji)))));
1247
+ }
1248
+ render() {
1249
+ return (index$1.h(index$1.Host, { key: '48f4159ff5232b9d03fdcabf2d39e4375ca4fa14' }, index$1.h("div", { key: '20f86592a9dc47231c0c6cf33484af981533e21d', class: 'close-parent' }, index$1.h("rtk-button", { key: 'cff61f9c8fa0c1e0a8b6dc9433abedf914f9ded0', variant: "ghost", kind: "icon", class: "close", onClick: () => { var _a; return (_a = this.pickerClose) === null || _a === void 0 ? void 0 : _a.emit(); }, "aria-label": this.t('close') }, index$1.h("rtk-icon", { key: '56a12d4cc55b80ea026c92906466ebb10bf6cd6e', icon: this.iconPack.dismiss }))), index$1.h("div", { key: 'b48a1933b33f9886f39955ecbd046ffff370719b', class: 'emoji-parent' }, index$1.h("input", { key: '40d0f74a160358c3214b810de0f2ee6f286f1af7', value: this.filterVal, onInput: (event) => this.handleInputChange(event.target), placeholder: this.t('search'), ref: (el) => (this.inputElement = el) }), this.mapEmojiList())));
1250
+ }
1251
+ };
1252
+ __decorate$b([
1253
+ index.SyncWithStore()
1254
+ ], RtkEmojiPicker.prototype, "iconPack", void 0);
1255
+ __decorate$b([
1256
+ index.SyncWithStore()
1257
+ ], RtkEmojiPicker.prototype, "t", void 0);
1258
+ RtkEmojiPicker.style = RtkEmojiPickerStyle0;
1259
+
1260
+ const rtkEmojiPickerButtonCss = ":host{}";
1261
+ const RtkEmojiPickerButtonStyle0 = rtkEmojiPickerButtonCss;
1262
+
1263
+ var __decorate$a = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1264
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1265
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
1266
+ r = Reflect.decorate(decorators, target, key, desc);
1267
+ else
1268
+ for (var i = decorators.length - 1; i >= 0; i--)
1269
+ if (d = decorators[i])
1270
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1271
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1272
+ };
1273
+ const RtkEmojiPickerButton = class {
1274
+ constructor(hostRef) {
1275
+ index$1.registerInstance(this, hostRef);
1276
+ /** Icon pack */
1277
+ this.iconPack = uiStore.defaultIconPack;
1278
+ /** Language */
1279
+ this.t = uiStore.useLanguage();
1280
+ }
1281
+ render() {
1282
+ return (index$1.h("rtk-tooltip", { key: '9826128cb78d2cb79a21b4dcb877ecc1ab020090', label: this.t('chat.send_emoji') }, index$1.h("rtk-button", { key: '07fd6bcc6ffdb58278c843748f771a2597f8edcd', variant: "ghost", kind: "icon", class: { active: this.isActive }, title: this.t('chat.send_emoji') }, index$1.h("rtk-icon", { key: '30f352d18771bd542d9ca4ff1a4615ef5958ec7d', icon: this.iconPack.emoji_multiple }))));
1283
+ }
1284
+ };
1285
+ __decorate$a([
1286
+ index.SyncWithStore()
1287
+ ], RtkEmojiPickerButton.prototype, "iconPack", void 0);
1288
+ __decorate$a([
1289
+ index.SyncWithStore()
1290
+ ], RtkEmojiPickerButton.prototype, "t", void 0);
1291
+ RtkEmojiPickerButton.style = RtkEmojiPickerButtonStyle0;
1292
+
1293
+ const rtkFileMessageViewCss = ":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.file{display:flex;align-items:center;gap:var(--rtk-space-1, 4px);padding-left:var(--rtk-space-2, 8px);padding-right:var(--rtk-space-2, 8px);padding-top:var(--rtk-space-1, 4px);padding-bottom:var(--rtk-space-1, 4px);min-width:var(--rtk-space-40, 160px);max-width:var(--rtk-space-64, 256px);border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64))}.file .file-data{margin-left:var(--rtk-space-1, 4px);flex:1 1 0%}.file .file-data .name{word-break:break-all;color:rgb(var(--rtk-colors-text-1000, 255 255 255));overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.file .file-data .file-data-split{margin-top:var(--rtk-space-0\\.5, 2px);display:flex;align-items:center;font-size:12px}.file .file-data .file-data-split .ext{margin-right:var(--rtk-space-2, 8px);text-transform:uppercase;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.file .file-data .file-data-split .divider{height:var(--rtk-space-4, 16px);width:var(--rtk-space-0\\.5, 2px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.file .file-data .file-data-split .size{margin-left:var(--rtk-space-2, 8px)}";
1294
+ const RtkFileMessageViewStyle0 = rtkFileMessageViewCss;
1295
+
1296
+ var __decorate$9 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1297
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1298
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
1299
+ r = Reflect.decorate(decorators, target, key, desc);
1300
+ else
1301
+ for (var i = decorators.length - 1; i >= 0; i--)
1302
+ if (d = decorators[i])
1303
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1304
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1305
+ };
1306
+ const RtkFileMessageView = class {
1307
+ constructor(hostRef) {
1308
+ index$1.registerInstance(this, hostRef);
1309
+ /** Icon pack */
1310
+ this.iconPack = uiStore.defaultIconPack;
1311
+ }
1312
+ render() {
1313
+ return (index$1.h("div", { key: 'd2cbeddc138f81c05da1656ee7f59c170e83bd1e', class: "file" }, index$1.h("rtk-button", { key: 'b0ee90c3493c24e938b6ea88a317c642e4afc003', variant: "secondary", kind: "icon", onClick: () => file.downloadFile(string.sanitizeLink(this.url), { name: this.name, fallbackName: 'file' }), part: "button" }, index$1.h("rtk-icon", { key: 'c1b25c655b5c87bf95948abfa461f8b58ff79195', icon: this.iconPack.download })), index$1.h("div", { key: 'c961a8ce93d4ff4405590787a88b5a9bbdbf56ab', class: "file-data" }, index$1.h("div", { key: 'bd178354d166c7816d6fabb72f7bba70fd711415', class: "name" }, this.name), index$1.h("div", { key: '59a791ae9f94a13b4005a0d8f79d09687fe3fc4c', class: "file-data-split" }, index$1.h("div", { key: 'b31421fdf786d92eed0decec9d3b247530413aa9', class: "ext" }, file.getExtension(this.name)), index$1.h("span", { key: '7a0a2a188b3e0b6bee0cf54d3afe29c2454788bb', class: "divider" }), index$1.h("div", { key: 'b217b87fa0737732aae10662b82d337d7258e6d7', class: "size" }, file.getFileSize(this.size))))));
1314
+ }
1315
+ };
1316
+ __decorate$9([
1317
+ index.SyncWithStore()
1318
+ ], RtkFileMessageView.prototype, "iconPack", void 0);
1319
+ RtkFileMessageView.style = RtkFileMessageViewStyle0;
1320
+
1321
+ const rtkFilePickerButtonCss = ":host{}";
1322
+ const RtkFilePickerButtonStyle0 = rtkFilePickerButtonCss;
1323
+
1324
+ var __decorate$8 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1325
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1326
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
1327
+ r = Reflect.decorate(decorators, target, key, desc);
1328
+ else
1329
+ for (var i = decorators.length - 1; i >= 0; i--)
1330
+ if (d = decorators[i])
1331
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1332
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1333
+ };
1334
+ const RtkFilePickerButton = class {
1335
+ constructor(hostRef) {
1336
+ index$1.registerInstance(this, hostRef);
1337
+ this.onFileChange = index$1.createEvent(this, "fileChange", 7);
1338
+ /** Icon */
1339
+ this.icon = 'attach';
1340
+ /** Icon pack */
1341
+ this.iconPack = uiStore.defaultIconPack;
1342
+ /** Language */
1343
+ this.t = uiStore.useLanguage();
1344
+ this.uploadFile = () => {
1345
+ const input = this.fileInputField;
1346
+ input.type = 'file';
1347
+ if (this.filter) {
1348
+ input.accept = this.filter;
1349
+ }
1350
+ input.onchange = (e) => {
1351
+ const { validity, files: [file], } = e.target;
1352
+ if (validity.valid) {
1353
+ this.onFileChange.emit(file);
1354
+ }
1355
+ };
1356
+ input.click();
1357
+ };
1358
+ }
1359
+ connectedCallback() {
1360
+ this.fileInputField = document.createElement('input');
1361
+ }
1362
+ disconnectedCallback() {
1363
+ // For GC
1364
+ this.fileInputField = undefined;
1365
+ }
1366
+ render() {
1367
+ const label = this.label || this.t('chat.send_file');
1368
+ const icon = this.iconPack[this.icon];
1369
+ return (index$1.h("rtk-tooltip", { key: '90e405f39792f7ea0430c55e9b5ba0da72ce2a4a', label: label }, index$1.h("rtk-button", { key: 'f0957e7a9668afd9e25e866ea2acbb6891123bbe', variant: "ghost", kind: "icon", onClick: () => this.uploadFile(), title: label }, index$1.h("rtk-icon", { key: '1955f524343683974831b28629291428637aa8fc', icon: icon }))));
1370
+ }
1371
+ };
1372
+ __decorate$8([
1373
+ index.SyncWithStore()
1374
+ ], RtkFilePickerButton.prototype, "iconPack", void 0);
1375
+ __decorate$8([
1376
+ index.SyncWithStore()
1377
+ ], RtkFilePickerButton.prototype, "t", void 0);
1378
+ RtkFilePickerButton.style = RtkFilePickerButtonStyle0;
1379
+
1380
+ const rtkIconCss = ":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:block;height:var(--rtk-space-10, 40px);outline:2px solid transparent;outline-offset:2px}:host .icon-wrapper{display:flex;height:100%;width:100%;flex-direction:column;align-items:center}:host svg{height:100%;width:100%;outline:2px solid transparent;outline-offset:2px}:host([size='xl']){box-sizing:border-box;display:block;height:var(--rtk-space-16, 64px) !important;width:var(--rtk-space-16, 64px) !important;--rtk-spinner-color:currentColor}:host([size='md']){box-sizing:border-box;display:block;height:var(--rtk-space-6, 24px) !important;width:var(--rtk-space-6, 24px) !important;--rtk-spinner-color:currentColor}:host([size='sm']){box-sizing:border-box;display:block;height:var(--rtk-space-4, 16px) !important;width:var(--rtk-space-4, 16px) !important;--rtk-spinner-color:currentColor}:host([variant='secondary']) .icon-wrapper{--tw-text-opacity:1;color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-text-opacity))}:host([variant='danger']) .icon-wrapper{--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))}";
1381
+ const RtkIconStyle0 = rtkIconCss;
1382
+
1383
+ const parseIcon = (icon) => {
1384
+ try {
1385
+ return JSON.parse(icon);
1386
+ }
1387
+ catch (e) {
1388
+ return icon;
1389
+ }
1390
+ };
1391
+ const RtkIcon = class {
1392
+ constructor(hostRef) {
1393
+ index$1.registerInstance(this, hostRef);
1394
+ /** Icon variant */
1395
+ this.variant = 'primary';
1396
+ /** Size */
1397
+ this.size = 'lg';
1398
+ }
1399
+ render() {
1400
+ return (index$1.h(index$1.Host, { key: 'fbacb1ee3dd4c1ca7aa612f08e938601df73036c' }, index$1.h("div", { key: '04c026967cb7aa3acb3fba09fcf5b0d33f45e2b0', class: "icon-wrapper", innerHTML: parseIcon(this.icon), part: "wrapper" })));
1401
+ }
1402
+ };
1403
+ RtkIcon.style = RtkIconStyle0;
1404
+
1405
+ const rtkImageMessageViewCss = ":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.image-spinner{cursor:wait}.image-errored{cursor:not-allowed}.image{display:block;font-family:var(--rtk-font-family, sans-serif);color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88));position:relative;height:var(--rtk-space-40, 160px);max-width:var(--rtk-space-64, 256px);cursor:pointer}.image img{display:none;height:100%;width:100%;border-radius:var(--rtk-border-radius-sm, 4px);-o-object-fit:cover;object-fit:cover}.image .image-spinner{display:flex;height:100%;width:100%;flex-direction:column;align-items:center;justify-content:center;border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}.image .image-spinner rtk-spinner{--tw-text-opacity:1;color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-text-opacity))}.image .image-errored{display:flex;height:100%;width:100%;flex-direction:column;align-items:center;justify-content:center;border-radius:var(--rtk-border-radius-sm, 4px);background-color:rgba(var(--rtk-colors-danger, 255 45 45) / 0.1);--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))}.image .actions{display:none;height:var(--rtk-space-8, 32px);align-items:center;position:absolute;top:var(--rtk-space-2, 8px);right:var(--rtk-space-2, 8px);border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255));overflow:hidden;--tw-shadow:0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.image .actions .action{height:var(--rtk-space-8, 32px);width:var(--rtk-space-8, 32px);border-radius:var(--rtk-border-radius-none, 0);border-width:var(--rtk-border-width-none, 0);border-style:none;background-color:transparent;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.image .actions .action:hover{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.image.loaded img{display:block}.image.loaded .image-spinner{display:none}.image:hover .actions,.image:focus .actions{display:flex}";
1406
+ const RtkImageMessageViewStyle0 = rtkImageMessageViewCss;
1407
+
1408
+ var __decorate$7 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1409
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1410
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
1411
+ r = Reflect.decorate(decorators, target, key, desc);
1412
+ else
1413
+ for (var i = decorators.length - 1; i >= 0; i--)
1414
+ if (d = decorators[i])
1415
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1416
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1417
+ };
1418
+ const RtkImageMessageView = class {
1419
+ constructor(hostRef) {
1420
+ index$1.registerInstance(this, hostRef);
1421
+ this.onPreview = index$1.createEvent(this, "preview", 7);
1422
+ /** Icon pack */
1423
+ this.iconPack = uiStore.defaultIconPack;
1424
+ /** Language */
1425
+ this.t = uiStore.useLanguage();
1426
+ this.status = 'loading';
1427
+ }
1428
+ render() {
1429
+ return (index$1.h("div", { key: '259bdc1102c6026dd10388ae759f67608c777b5f', class: { image: true, loaded: this.status === 'loaded' } }, index$1.h("img", { key: 'dbcb8d497fee3710f4474ec3ac0ce9a9b4f1bb49', src: string.sanitizeLink(this.url), onLoad: () => {
1430
+ this.status = 'loaded';
1431
+ }, onError: () => {
1432
+ this.status = 'errored';
1433
+ }, onClick: () => {
1434
+ if (this.status === 'loaded') {
1435
+ this.onPreview.emit(this.url);
1436
+ }
1437
+ } }), this.status === 'loading' && (index$1.h("div", { key: 'b0ecfada4428e1cb8c3625cc4ce3d2a5bae058ab', class: "image-spinner", title: this.t('chat.img.loading'), "aria-label": this.t('chat.img.loading') }, index$1.h("rtk-spinner", { key: 'fff61c6522d8bcb7de1345bb6505721ee6c6325e', iconPack: this.iconPack }))), this.status === 'errored' && (index$1.h("div", { key: 'c07e2cf6e9a94d375802c974e519d859ab48aa9b', class: "image-errored", title: this.t('chat.error.img_not_found'), "aria-label": this.t('chat.error.img_not_found') }, index$1.h("rtk-icon", { key: '83108f4f0396d77778463601a4f18d8593b0ffe7', icon: this.iconPack.image_off }))), this.status === 'loaded' && (index$1.h("div", { key: '96b5aafbd94eec920ae1cad14f09ab4a44571bd7', class: "actions" }, index$1.h("rtk-button", { key: 'a87ec11cc8de472aeb356689b49b6b366bd67f28', class: "action", variant: "secondary", kind: "icon", onClick: () => {
1438
+ this.onPreview.emit(this.url);
1439
+ } }, index$1.h("rtk-icon", { key: '543478c786b709ac477d4482874608c0b394b27c', icon: this.iconPack.full_screen_maximize })), index$1.h("rtk-button", { key: '6ce6d94a965688c7ec6ee64f79a4d13dda9651e3', class: "action", variant: "secondary", kind: "icon", onClick: () => file.downloadFile(this.url, { fallbackName: 'image' }) }, index$1.h("rtk-icon", { key: '3b1d67fbdd667e0d006e342c37f6e78c90fd2e34', icon: this.iconPack.download }))))));
1440
+ }
1441
+ };
1442
+ __decorate$7([
1443
+ index.SyncWithStore()
1444
+ ], RtkImageMessageView.prototype, "iconPack", void 0);
1445
+ __decorate$7([
1446
+ index.SyncWithStore()
1447
+ ], RtkImageMessageView.prototype, "t", void 0);
1448
+ RtkImageMessageView.style = RtkImageMessageViewStyle0;
1449
+
1450
+ const rtkMarkdownViewCss = ":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{overflow-wrap:break-word}a{color:currentColor}.block-quote,blockquote{margin:var(--rtk-space-0, 0px);margin-bottom:var(--rtk-space-3, 12px);--tw-border-spacing-x:1px;--tw-border-spacing-y:1px;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y);border-top-width:var(--rtk-border-width-none, 0);border-bottom-width:var(--rtk-border-width-none, 0);border-left-width:var(--rtk-border-width-md, 2px);border-right-width:var(--rtk-border-width-none, 0);border-style:solid;padding:var(--rtk-space-0\\.5, 2px);padding-left:var(--rtk-space-2, 8px);border-radius:var(--rtk-border-radius-sm, 4px);border-top-left-radius:var(--rtk-border-radius-none, 0);border-bottom-left-radius:var(--rtk-border-radius-none, 0)}pre{white-space:pre-wrap}";
1451
+ const RtkMarkdownViewStyle0 = rtkMarkdownViewCss;
1452
+
1453
+ const RtkMarkdownView = class {
1454
+ constructor(hostRef) {
1455
+ index$1.registerInstance(this, hostRef);
1456
+ /** max length of text to render as markdown */
1457
+ this.maxLength = chat.MAX_TEXT_LENGTH;
1458
+ this.restoreEmpty = (content, tag, renderCallback) => {
1459
+ return content.trim().length === 0 ? `${tag}${content}${tag}` : renderCallback(content);
1460
+ };
1461
+ this.renderLink = (content) => {
1462
+ return (index$1.h("a", { class: "link", href: content, target: "_blank", rel: "noopener noreferrer" }, content));
1463
+ };
1464
+ this.renderBold = (content) => {
1465
+ if (typeof content === 'string') {
1466
+ return this.restoreEmpty(content, '*', (c) => index$1.h("b", null, c));
1467
+ }
1468
+ return index$1.h("b", null, this.renderTokens(content));
1469
+ };
1470
+ this.renderItalic = (content) => {
1471
+ if (typeof content === 'string') {
1472
+ return this.restoreEmpty(content, '_', (c) => index$1.h("i", null, c));
1473
+ }
1474
+ return index$1.h("i", null, this.renderTokens(content));
1475
+ };
1476
+ this.renderStrikethrough = (content) => {
1477
+ if (typeof content === 'string') {
1478
+ return this.restoreEmpty(content, '~', (c) => index$1.h("s", null, c));
1479
+ }
1480
+ return index$1.h("b", null, this.renderTokens(content));
1481
+ };
1482
+ this.renderPlainText = (content) => {
1483
+ if (typeof content === 'string') {
1484
+ return content;
1485
+ }
1486
+ return index$1.h("p", null, this.renderTokens(content));
1487
+ };
1488
+ this.renderTokens = (tokens) => {
1489
+ return tokens.map((token) => {
1490
+ switch (token.type) {
1491
+ case 'a':
1492
+ if (typeof token.content === 'string') {
1493
+ return this.renderLink(token.content);
1494
+ }
1495
+ case 'b':
1496
+ return this.renderBold(token.content);
1497
+ case 'i':
1498
+ return this.renderItalic(token.content);
1499
+ case 's':
1500
+ return this.renderStrikethrough(token.content);
1501
+ case 'q':
1502
+ return index$1.h("span", { class: "block-quote" });
1503
+ case 'plain_text':
1504
+ default:
1505
+ return this.renderPlainText(token.content);
1506
+ }
1507
+ });
1508
+ };
1509
+ }
1510
+ renderMessage(text) {
1511
+ let lines = text.split('\n');
1512
+ let isCodeBlock = false;
1513
+ if (lines[0] === '```' && lines[lines.length - 1] === '```') {
1514
+ isCodeBlock = true;
1515
+ lines = lines.slice(1, -1);
1516
+ }
1517
+ const message = lines.map((line) => {
1518
+ const tokens = chat.parseRichText(line);
1519
+ return index$1.h("p", null, this.renderTokens(tokens));
1520
+ });
1521
+ if (isCodeBlock) {
1522
+ return index$1.h("pre", { style: { whiteSpace: 'pre', overflow: 'scroll' } }, lines.join('\n'));
1523
+ }
1524
+ return message;
1525
+ }
1526
+ render() {
1527
+ const slicedMessage = this.text.slice(0, this.maxLength);
1528
+ const withReply = chat.extractReplyBlock(slicedMessage, true);
1529
+ const withoutReply = chat.stripOutReplyBlock(slicedMessage);
1530
+ return (index$1.h("p", { key: '9544292f118f2c6975a807d6bcc2d307c70b2940' }, withReply.length !== 0 && index$1.h("blockquote", { key: '294bca9889738148fd51ecd8487d2d98b5adee4b' }, this.renderMessage(withReply)), withoutReply.length !== 0 && this.renderMessage(withoutReply)));
1531
+ }
1532
+ };
1533
+ RtkMarkdownView.style = RtkMarkdownViewStyle0;
1534
+
1535
+ const sm = 640;
1536
+ const md = 768;
1537
+ const lg = 1080;
1538
+ const xl = 2160;
1539
+ const breakpoints = {
1540
+ sm: sm,
1541
+ md: md,
1542
+ lg: lg,
1543
+ xl: xl
1544
+ };
1545
+
1546
+ /**
1547
+ * Get the screen breakpoint from a given width
1548
+ * @param width The width of the container
1549
+ * @returns The screen breakpoint value
1550
+ */
1551
+ const getSize = (width) => {
1552
+ if (width >= breakpoints.lg)
1553
+ return 'lg';
1554
+ else if (width >= breakpoints.md)
1555
+ return 'md';
1556
+ else
1557
+ return 'sm';
1558
+ };
1559
+
1560
+ const rtkMeetingCss = ":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{box-sizing:border-box;display:flex;flex-direction:column;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88));overflow:hidden;position:fixed;top:var(--rtk-space-0, 0px);right:var(--rtk-space-0, 0px);bottom:var(--rtk-space-0, 0px);left:var(--rtk-space-0, 0px);height:100%;width:100%}:host([mode='fill']){position:relative}";
1561
+ const RtkMeetingStyle0 = rtkMeetingCss;
1562
+
1563
+ const RtkMeeting = class {
1564
+ constructor(hostRef) {
1565
+ index$1.registerInstance(this, hostRef);
1566
+ this.statesUpdate = index$1.createEvent(this, "rtkStatesUpdate", 7);
1567
+ /** Since RtkMeeting by design works as a provider for component, to be in sync with other providers, added provider id */
1568
+ this.providerId = 'provider-' + Math.floor(Math.random() * 100);
1569
+ this.roomJoinedListener = () => {
1570
+ this.updateStates({ meeting: 'joined' });
1571
+ };
1572
+ this.waitlistedListener = () => {
1573
+ this.updateStates({ meeting: 'waiting' });
1574
+ };
1575
+ this.roomLeftListener = ({ state }) => {
1576
+ // Let socketConnectionUpdate listener handle this case.
1577
+ if (state === 'disconnected' || state === 'failed')
1578
+ return;
1579
+ this.updateStates({ meeting: 'ended', roomLeftState: state });
1580
+ };
1581
+ this.mediaPermissionUpdateListener = ({ kind, message }) => {
1582
+ if (['audio', 'video'].includes(kind)) {
1583
+ if ((message === 'DENIED' || message === 'SYSTEM_DENIED') &&
1584
+ (this.peerStore || uiStore.uiStore).state.states.activeDebugger !== true) {
1585
+ const permissionModalSettings = {
1586
+ enabled: true,
1587
+ kind,
1588
+ };
1589
+ this.updateStates({ activePermissionsMessage: permissionModalSettings });
1590
+ }
1591
+ }
1592
+ };
1593
+ this.socketConnectionUpdateListener = ({ state }) => {
1594
+ if (state === 'failed') {
1595
+ setTimeout(() => {
1596
+ this.meeting.leave('disconnected');
1597
+ }, this.leaveRoomTimer);
1598
+ }
1599
+ };
1600
+ this.peerStore = null; // peer specific store for this meeting peer instance
1601
+ /** Whether to load config from preset */
1602
+ this.loadConfigFromPreset = false;
1603
+ /** Whether to apply the design system on the document root from config */
1604
+ this.applyDesignSystem = false;
1605
+ /** Fill type */
1606
+ this.mode = 'fixed';
1607
+ /** Whether participant should leave when this component gets unmounted */
1608
+ this.leaveOnUnmount = false;
1609
+ /** Language */
1610
+ this.t = uiStore.useLanguage();
1611
+ /** UI Config */
1612
+ this.config = uiStore.createDefaultConfig();
1613
+ /** Grid layout */
1614
+ this.gridLayout = 'row';
1615
+ /** Icon pack */
1616
+ this.iconPack = uiStore.defaultIconPack;
1617
+ this.handleChangingMeeting = (destinationMeetingId) => {
1618
+ const currentStates = (this.peerStore || uiStore.uiStore).state.states;
1619
+ this.updateStates({
1620
+ activeBreakoutRoomsManager: Object.assign(Object.assign({}, currentStates.activeBreakoutRoomsManager), { destinationMeetingId }),
1621
+ });
1622
+ };
1623
+ }
1624
+ connectedCallback() {
1625
+ var _a;
1626
+ if (typeof window !== 'undefined') {
1627
+ this.authErrorListener = (ev) => {
1628
+ if (ev.detail.message.includes('401')) {
1629
+ this.updateStates({ meeting: 'ended', roomLeftState: 'unauthorized' });
1630
+ }
1631
+ };
1632
+ window.addEventListener('rtkError', this.authErrorListener);
1633
+ }
1634
+ // Initialize default values
1635
+ this.leaveRoomTimer = 10000;
1636
+ this.loadConfigFromPreset = true;
1637
+ this.applyDesignSystem = true;
1638
+ // Setup event listeners
1639
+ this.setupStoreRequestListener();
1640
+ this.setupStateUpdateListener();
1641
+ this.meetingChanged(this.meeting);
1642
+ this.iconPackChanged(this.iconPack);
1643
+ this.tChanged(this.t);
1644
+ this.configChanged(this.config);
1645
+ this.resizeObserver = new ResizeObserver_es.index(() => this.handleResize());
1646
+ this.resizeObserver.observe(this.host);
1647
+ if (this.applyDesignSystem &&
1648
+ ((_a = this.config) === null || _a === void 0 ? void 0 : _a.designTokens) != null &&
1649
+ typeof document !== 'undefined' &&
1650
+ (this.peerStore || uiStore.uiStore).state.states.activeDebugger !== true) {
1651
+ merge.provideRtkDesignSystem(document.documentElement, this.config.designTokens);
1652
+ }
1653
+ }
1654
+ disconnectedCallback() {
1655
+ var _a;
1656
+ if (this.leaveOnUnmount) {
1657
+ (_a = this.meeting) === null || _a === void 0 ? void 0 : _a.leaveRoom();
1658
+ }
1659
+ this.resizeObserver.disconnect();
1660
+ window.removeEventListener('rtkError', this.authErrorListener);
1661
+ // Remove event listeners
1662
+ if (this.storeRequestListener) {
1663
+ this.host.removeEventListener('rtkRequestStore', this.storeRequestListener);
1664
+ this.storeRequestListener = null;
1665
+ }
1666
+ if (this.stateUpdateListener) {
1667
+ this.host.removeEventListener('rtkStateUpdate', this.stateUpdateListener);
1668
+ this.stateUpdateListener = null;
1669
+ }
1670
+ // Clear meeting listeners
1671
+ if (this.meeting) {
1672
+ this.clearListeners(this.meeting);
1673
+ }
1674
+ }
1675
+ setupStoreRequestListener() {
1676
+ // Remove existing listener if any
1677
+ if (this.storeRequestListener) {
1678
+ this.host.removeEventListener('rtkRequestStore', this.storeRequestListener);
1679
+ }
1680
+ // Listen for store requests from child components
1681
+ this.storeRequestListener = (event) => {
1682
+ // Provide peer specific store if available, otherwise fall back to global store
1683
+ if (!this.peerStore)
1684
+ return;
1685
+ const storeToProvide = this.peerStore;
1686
+ const responseEvent = new CustomEvent('rtkProvideStore', {
1687
+ detail: { store: storeToProvide, requestId: event.detail.requestId },
1688
+ });
1689
+ document.dispatchEvent(responseEvent);
1690
+ // Stop the event from bubbling further to prevent other meetings from handling it
1691
+ event.stopPropagation();
1692
+ };
1693
+ this.host.addEventListener('rtkRequestStore', this.storeRequestListener);
1694
+ }
1695
+ setupStateUpdateListener() {
1696
+ if (this.stateUpdateListener) {
1697
+ this.host.removeEventListener('rtkStateUpdate', this.stateUpdateListener);
1698
+ }
1699
+ this.stateUpdateListener = (event) => {
1700
+ const eventTarget = event.target;
1701
+ if (!this.host.contains(eventTarget)) {
1702
+ return;
1703
+ }
1704
+ this.updateStates(event.detail);
1705
+ };
1706
+ this.host.addEventListener('rtkStateUpdate', this.stateUpdateListener);
1707
+ }
1708
+ clearListeners(meeting) {
1709
+ if (!meeting)
1710
+ return;
1711
+ meeting.self.removeListener('roomLeft', this.roomLeftListener);
1712
+ meeting.self.removeListener('roomJoined', this.roomJoinedListener);
1713
+ meeting.self.removeListener('waitlisted', this.waitlistedListener);
1714
+ meeting.self.removeListener('mediaPermissionUpdate', this.mediaPermissionUpdateListener);
1715
+ meeting.meta.removeListener('socketConnectionUpdate', this.socketConnectionUpdateListener);
1716
+ }
1717
+ meetingChanged(meeting) {
1718
+ var _a, _b;
1719
+ if (!meeting)
1720
+ return;
1721
+ // Create peer specific store for this meeting peer instance
1722
+ if (meeting) {
1723
+ this.peerStore = uiStore.createPeerStore({
1724
+ meeting,
1725
+ config: this.config,
1726
+ iconPack: this.iconPack,
1727
+ t: this.t,
1728
+ providerId: this.providerId,
1729
+ });
1730
+ // Notify components that peer specific store is now available
1731
+ document.dispatchEvent(new CustomEvent('rtkPeerStoreReady', {
1732
+ detail: {
1733
+ peerId: meeting.self.id,
1734
+ },
1735
+ }));
1736
+ }
1737
+ else {
1738
+ this.peerStore = null;
1739
+ }
1740
+ this.updateStates({ viewType: meeting.meta.viewType });
1741
+ if (this.loadConfigFromPreset && meeting.self.config != null) {
1742
+ const theme = meeting.self.config;
1743
+ const { config: config$1, data } = config.generateConfig(theme, meeting);
1744
+ this.config = config$1;
1745
+ if (this.showSetupScreen == null) {
1746
+ this.showSetupScreen = data.showSetupScreen;
1747
+ }
1748
+ if (meeting.connectedMeetings.supportsConnectedMeetings &&
1749
+ ((_a = (this.peerStore || uiStore.uiStore).state.states.activeBreakoutRoomsManager) === null || _a === void 0 ? void 0 : _a.destinationMeetingId)) {
1750
+ this.showSetupScreen = false;
1751
+ }
1752
+ }
1753
+ if (this.applyDesignSystem &&
1754
+ ((_b = this.config) === null || _b === void 0 ? void 0 : _b.designTokens) != null &&
1755
+ typeof document !== 'undefined' &&
1756
+ (this.peerStore || uiStore.uiStore).state.states.activeDebugger !== true) {
1757
+ merge.provideRtkDesignSystem(document.documentElement, this.config.designTokens);
1758
+ }
1759
+ meeting.self.addListener('roomJoined', this.roomJoinedListener);
1760
+ meeting.self.addListener('waitlisted', this.waitlistedListener);
1761
+ meeting.self.addListener('roomLeft', this.roomLeftListener);
1762
+ meeting.self.addListener('mediaPermissionUpdate', this.mediaPermissionUpdateListener);
1763
+ meeting.meta.addListener('socketConnectionUpdate', this.socketConnectionUpdateListener);
1764
+ if (meeting.connectedMeetings.supportsConnectedMeetings) {
1765
+ meeting.connectedMeetings.once('changingMeeting', this.handleChangingMeeting);
1766
+ }
1767
+ if (meeting.self.roomJoined) {
1768
+ this.updateStates({ meeting: 'joined' });
1769
+ }
1770
+ else {
1771
+ if (this.showSetupScreen) {
1772
+ this.updateStates({ meeting: 'setup' });
1773
+ }
1774
+ else {
1775
+ meeting.joinRoom();
1776
+ }
1777
+ }
1778
+ window.removeEventListener('rtkError', this.authErrorListener);
1779
+ }
1780
+ iconPackChanged(newIconPack) {
1781
+ if (this.peerStore) {
1782
+ this.peerStore.state.iconPack = newIconPack;
1783
+ }
1784
+ }
1785
+ tChanged(newT) {
1786
+ if (this.peerStore) {
1787
+ this.peerStore.state.t = newT;
1788
+ }
1789
+ }
1790
+ configChanged(config) {
1791
+ if (this.peerStore) {
1792
+ this.peerStore.state.config = config;
1793
+ }
1794
+ if ((config === null || config === void 0 ? void 0 : config.designTokens) &&
1795
+ typeof document !== 'undefined' &&
1796
+ (this.peerStore || uiStore.uiStore).state.states.activeDebugger !== true) {
1797
+ merge.provideRtkDesignSystem(document.documentElement, config.designTokens);
1798
+ }
1799
+ }
1800
+ handleResize() {
1801
+ this.size = getSize(this.host.clientWidth);
1802
+ }
1803
+ updateStates(states) {
1804
+ // Use peer specific store if available, otherwise fall back to global store
1805
+ const targetStore = this.peerStore || uiStore.uiStore;
1806
+ const newStates = Object.assign({}, targetStore.state.states);
1807
+ targetStore.state.states = merge.deepMerge(newStates, states);
1808
+ // Emit unscoped event for backward compatibility
1809
+ this.statesUpdate.emit(targetStore.state.states);
1810
+ // Also emit a scoped event that only this meeting's components should listen to
1811
+ const scopedEvent = new CustomEvent('rtkStatesUpdate', {
1812
+ detail: targetStore.state.states,
1813
+ bubbles: true,
1814
+ composed: true,
1815
+ });
1816
+ this.host.dispatchEvent(scopedEvent);
1817
+ }
1818
+ render() {
1819
+ const defaults = {
1820
+ meeting: this.meeting,
1821
+ size: this.size,
1822
+ states: (this.peerStore || uiStore.uiStore).state.states,
1823
+ config: this.config || uiStore.createDefaultConfig(),
1824
+ iconPack: this.iconPack,
1825
+ t: this.t,
1826
+ };
1827
+ if ((this.peerStore || uiStore.uiStore).state.states.viewType === 'CHAT') {
1828
+ return index$1.h("rtk-chat", Object.assign({}, defaults));
1829
+ }
1830
+ const elementProps = {
1831
+ 'rtk-grid': {
1832
+ layout: this.gridLayout,
1833
+ },
1834
+ };
1835
+ return index$1.h(index$2.Render, { element: "rtk-meeting", defaults: defaults, asHost: true, elementProps: elementProps });
1836
+ }
1837
+ get host() { return index$1.getElement(this); }
1838
+ static get watchers() { return {
1839
+ "meeting": ["meetingChanged"],
1840
+ "iconPack": ["iconPackChanged"],
1841
+ "t": ["tChanged"],
1842
+ "config": ["configChanged"]
1843
+ }; }
1844
+ };
1845
+ RtkMeeting.style = RtkMeetingStyle0;
1846
+
1847
+ const rtkMenuCss = ":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{position:relative;display:inline-block;color:rgb(var(--rtk-colors-text-1000, 255 255 255))}#menu-list{position:absolute;z-index:20;display:none}";
1848
+ const RtkMenuStyle0 = rtkMenuCss;
1849
+
1850
+ var __decorate$6 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1851
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1852
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
1853
+ r = Reflect.decorate(decorators, target, key, desc);
1854
+ else
1855
+ for (var i = decorators.length - 1; i >= 0; i--)
1856
+ if (d = decorators[i])
1857
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1858
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1859
+ };
1860
+ const RtkMenu$1 = class {
1861
+ constructor(hostRef) {
1862
+ index$1.registerInstance(this, hostRef);
1863
+ this.clickedThis = false;
1864
+ /** Placement of menu */
1865
+ this.placement = 'bottom-end';
1866
+ /** Offset in px */
1867
+ this.offset = 10;
1868
+ /** Icon pack */
1869
+ this.iconPack = uiStore.defaultIconPack;
1870
+ /** Language */
1871
+ this.t = uiStore.useLanguage();
1872
+ this.handleOutsideClick = () => {
1873
+ // handles clicking on other menu triggers
1874
+ if (!this.clickedThis) {
1875
+ // if other trigger is clicked, hide this menu-list
1876
+ this.menuListEl.style.display = 'none';
1877
+ }
1878
+ // reset the value
1879
+ this.clickedThis = false;
1880
+ };
1881
+ }
1882
+ componentDidLoad() {
1883
+ document.addEventListener('click', this.handleOutsideClick);
1884
+ this.update();
1885
+ }
1886
+ disconnectedCallback() {
1887
+ document.removeEventListener('click', this.handleOutsideClick);
1888
+ }
1889
+ update() {
1890
+ floatingUi_dom_esm.computePosition(this.triggerEl, this.menuListEl, {
1891
+ placement: this.placement,
1892
+ middleware: [floatingUi_dom_esm.offset(this.offset), floatingUi_dom_esm.flip(), floatingUi_dom_esm.shift({ padding: 5 })],
1893
+ }).then(({ x, y }) => {
1894
+ Object.assign(this.menuListEl.style, {
1895
+ left: `${x}px`,
1896
+ top: `${y}px`,
1897
+ });
1898
+ });
1899
+ }
1900
+ render() {
1901
+ return (index$1.h(index$1.Host, { key: 'a814ea3dde902a15cb6fb0db8a9c2409c240537f' }, index$1.h("span", { key: 'de2447524c6a1787a6b9442ccb9c3d56a33e9f4f', id: "trigger", ref: (el) => (this.triggerEl = el), onClick: () => {
1902
+ this.clickedThis = true;
1903
+ if (this.menuListEl.style.display !== 'block') {
1904
+ this.menuListEl.style.display = 'block';
1905
+ this.update();
1906
+ }
1907
+ else {
1908
+ this.menuListEl.style.display = 'none';
1909
+ }
1910
+ } }, index$1.h("slot", { key: 'fb566f431ceca452fad8b564cfb777bc90411a02', name: "trigger" })), index$1.h("span", { key: '50b030d301e54677d19cc21dadcec53f566b14cf', part: "menu-list", id: "menu-list", ref: (el) => (this.menuListEl = el) }, index$1.h("slot", { key: '59ce6c30c39155fec448114fd25752585d95c87d' }))));
1911
+ }
1912
+ };
1913
+ __decorate$6([
1914
+ index.SyncWithStore()
1915
+ ], RtkMenu$1.prototype, "iconPack", void 0);
1916
+ __decorate$6([
1917
+ index.SyncWithStore()
1918
+ ], RtkMenu$1.prototype, "t", void 0);
1919
+ RtkMenu$1.style = RtkMenuStyle0;
1920
+
1921
+ const rtkMenuItemCss = ":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:flex;align-items:center;padding-left:var(--rtk-space-3, 12px);padding-right:var(--rtk-space-3, 12px);padding-top:var(--rtk-space-2, 8px);padding-bottom:var(--rtk-space-2, 8px);cursor:pointer;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;color:rgb(var(--rtk-colors-text-1000, 255 255 255));font-size:14px}::slotted([slot='start']){margin-right:var(--rtk-space-2, 8px)}::slotted([slot='end']){margin-left:var(--rtk-space-2, 8px)}:host(:hover){--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}:host(.red){--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))}";
1922
+ const RtkMenuItemStyle0 = rtkMenuItemCss;
1923
+
1924
+ var __decorate$5 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1925
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1926
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
1927
+ r = Reflect.decorate(decorators, target, key, desc);
1928
+ else
1929
+ for (var i = decorators.length - 1; i >= 0; i--)
1930
+ if (d = decorators[i])
1931
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1932
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1933
+ };
1934
+ const RtkMenuItem = class {
1935
+ constructor(hostRef) {
1936
+ index$1.registerInstance(this, hostRef);
1937
+ /** Icon pack */
1938
+ this.iconPack = uiStore.defaultIconPack;
1939
+ /** Language */
1940
+ this.t = uiStore.useLanguage();
1941
+ }
1942
+ render() {
1943
+ return (index$1.h(index$1.Host, { key: 'f0316fee5ac5fd2124ee26ac2664172007ad1c54' }, index$1.h("slot", { key: '994a3a27f743462a3ae0a4c95bc5de672119fdb6', name: "start" }), index$1.h("slot", { key: '24594ecaffb46a4b0458032596570fee37e6ae00' }), index$1.h("slot", { key: '4ede22267a24a37c508591b0148a1e1b2c391fc9', name: "end" })));
1944
+ }
1945
+ };
1946
+ __decorate$5([
1947
+ index.SyncWithStore()
1948
+ ], RtkMenuItem.prototype, "iconPack", void 0);
1949
+ __decorate$5([
1950
+ index.SyncWithStore()
1951
+ ], RtkMenuItem.prototype, "t", void 0);
1952
+ RtkMenuItem.style = RtkMenuItemStyle0;
1953
+
1954
+ const rtkMenuListCss = ":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:flex;width:-moz-max-content;width:max-content;flex-direction:column;padding-top:var(--rtk-space-2, 8px);padding-bottom:var(--rtk-space-2, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255));overflow:hidden;border-radius:var(--rtk-border-radius-sm, 4px);--tw-shadow:0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}";
1955
+ const RtkMenuListStyle0 = rtkMenuListCss;
1956
+
1957
+ var __decorate$4 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1958
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1959
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
1960
+ r = Reflect.decorate(decorators, target, key, desc);
1961
+ else
1962
+ for (var i = decorators.length - 1; i >= 0; i--)
1963
+ if (d = decorators[i])
1964
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1965
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1966
+ };
1967
+ const RtkMenuList = class {
1968
+ constructor(hostRef) {
1969
+ index$1.registerInstance(this, hostRef);
1970
+ /** Icon pack */
1971
+ this.iconPack = uiStore.defaultIconPack;
1972
+ /** Language */
1973
+ this.t = uiStore.useLanguage();
1974
+ }
1975
+ render() {
1976
+ return (index$1.h(index$1.Host, { key: 'c0974bc340294b197aa8310e5a9913126ac22c48' }, index$1.h("slot", { key: '1a660db36c713285203569957959663497803c5e' })));
1977
+ }
1978
+ };
1979
+ __decorate$4([
1980
+ index.SyncWithStore()
1981
+ ], RtkMenuList.prototype, "iconPack", void 0);
1982
+ __decorate$4([
1983
+ index.SyncWithStore()
1984
+ ], RtkMenuList.prototype, "t", void 0);
1985
+ RtkMenuList.style = RtkMenuListStyle0;
1986
+
1987
+ const rtkMessageViewCss = ":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}:host{max-width:var(--rtk-space-96, 384px)}.message-wrapper{display:flex;flex-direction:row-reverse;align-items:flex-start;gap:var(--rtk-space-2, 8px)}.message-wrapper.incoming{flex-direction:row}.message{display:flex;flex-direction:column;align-items:flex-end}.incoming .message{display:flex;flex-direction:column;align-items:flex-start}.header{margin-top:var(--rtk-space-1, 4px);margin-bottom:var(--rtk-space-1, 4px);align-self:flex-end;color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88));font-size:12px;font-weight:600}.incoming .header{align-self:flex-start}.body{display:flex;flex-direction:column;min-width:var(--rtk-space-24, 96px);font-family:var(--rtk-font-family, sans-serif);color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88));font-size:14px;line-height:1.375;position:relative}.bubble{max-width:90%;padding:var(--rtk-space-2, 8px);border-width:1px;border-style:solid;--tw-border-opacity:1;border-color:rgba(var(--rtk-colors-brand-600, 13 81 253) / var(--tw-border-opacity));--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)));border-radius:var(--rtk-border-radius-md, 8px)}.incoming .bubble{--tw-border-opacity:1;border-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-border-opacity));--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88))}.metadata{margin-top:var(--rtk-space-2, 8px);align-self:flex-end;font-size:10px;color:rgb(var(--rtk-colors-text-800, 255 255 255 / 0.76))}.avatar{display:none}rtk-menu{position:absolute;right:var(--rtk-space-0, 0px);top:var(--rtk-space-0, 0px);border-radius:var(--rtk-border-radius-lg, 12px)}rtk-menu rtk-icon{height:var(--rtk-space-4, 16px);width:var(--rtk-space-4, 16px);cursor:pointer}.actions{display:flex;align-items:center;justify-content:center;padding-left:var(--rtk-space-2, 8px);padding-bottom:var(--rtk-space-2, 8px);padding-top:var(--rtk-space-1, 4px);padding-right:var(--rtk-space-1, 4px);border-radius:var(--rtk-border-radius-md, 8px);border-width:var(--rtk-border-width-none, 0);border-style:none;background:radial-gradient(\n at top right,\n rgb(var(--rtk-colors-brand-300, 73 124 253)) 60%,\n rgba(255, 255, 255, 0) 80%\n )}.actions rtk-icon{height:var(--rtk-space-4, 16px);width:var(--rtk-space-4, 16px);color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)))}.incoming .actions{background:radial-gradient(\n at top right,\n rgb(var(--rtk-colors-background-800, 30 30 30)) 60%,\n rgba(255, 255, 255, 0) 80%\n )}.incoming .actions rtk-icon{color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88))}.incoming rtk-avatar{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88))}@media (min-width: 400px){.avatar{display:flex;width:var(--rtk-space-6, 24px)}.avatar rtk-avatar{height:var(--rtk-space-6, 24px);width:var(--rtk-space-6, 24px);font-size:10px;overflow:clip;border-radius:9999px}}@media (hover: hover){rtk-menu{visibility:hidden}.body:hover rtk-menu{visibility:visible}}";
1988
+ const RtkMessageViewStyle0 = rtkMessageViewCss;
1989
+
1990
+ var __decorate$3 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1991
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1992
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
1993
+ r = Reflect.decorate(decorators, target, key, desc);
1994
+ else
1995
+ for (var i = decorators.length - 1; i >= 0; i--)
1996
+ if (d = decorators[i])
1997
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1998
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1999
+ };
2000
+ const RtkMessageView = class {
2001
+ constructor(hostRef) {
2002
+ index$1.registerInstance(this, hostRef);
2003
+ this.onAction = index$1.createEvent(this, "action", 7);
2004
+ /** List of actions to show in menu */
2005
+ this.actions = [];
2006
+ /** Appearance */
2007
+ this.variant = 'bubble';
2008
+ /** Render */
2009
+ this.viewType = 'outgoing';
2010
+ /** Hides avatar */
2011
+ this.hideAvatar = false;
2012
+ /** Is the message sent by the current user */
2013
+ this.isSelf = false;
2014
+ /** Hides author display label */
2015
+ this.hideAuthorName = false;
2016
+ /** Hides metadata (time) */
2017
+ this.hideMetadata = false;
2018
+ /** Icon pack */
2019
+ this.iconPack = uiStore.defaultIconPack;
2020
+ }
2021
+ renderActions() {
2022
+ return (index$1.h("rtk-menu", { placement: "top-end", offset: 1 }, index$1.h("button", { slot: "trigger", class: "actions" }, index$1.h("rtk-icon", { icon: this.iconPack.chevron_down })), index$1.h("rtk-menu-list", null, this.actions.map((action) => (index$1.h("rtk-menu-item", { onClick: () => this.onAction.emit(action.id) }, action.icon && index$1.h("rtk-icon", { icon: action.icon, slot: "start" }), action.label))))));
2023
+ }
2024
+ render() {
2025
+ return (index$1.h(index$1.Host, { key: '61882011f477f816296277a4f2d5622d224e47f0' }, index$1.h("div", { key: 'ae21bfc0c499879da6a2167f0cad5203475de696', class: { 'message-wrapper': true, [this.viewType]: true } }, !this.hideAvatar && (index$1.h("aside", { key: '73b10ebb1dccdc4e2c9258f185eb14f07d11d542', class: "avatar", part: "avatar" }, index$1.h("rtk-avatar", { key: 'e07971bf9d7738fb2dcc015d339a13d5dca7c6f7', participant: { name: this.authorName, picture: this.avatarUrl }, size: "sm" }))), index$1.h("div", { key: '1e24801f717589e598c4160bea7ab10a59acfcc2', class: "message", part: "message" }, !this.hideAuthorName && (index$1.h("div", { key: '3178f750ad798b7d83508f82ead36ee5407fee4c', class: "header" }, this.authorName, " ", this.isSelf ? ' (You)' : '')), index$1.h("div", { key: '056445ef0c557d7d756330df5778ad8bc2d41e60', class: { body: true, bubble: this.variant === 'bubble' } }, index$1.h("slot", { key: '6d5486666ce2238e4387c2621d562b24704a9317' }), !this.hideMetadata && !!this.time && (index$1.h("div", { key: '1d4b9bdbb3aaf288dce4b43a31354df3d413b2b4', class: "metadata", title: date.formatDateTime(this.time) }, date.elapsedDuration(this.time, new Date(Date.now())))), this.actions.length !== 0 && this.renderActions())))));
2026
+ }
2027
+ };
2028
+ __decorate$3([
2029
+ index.SyncWithStore()
2030
+ ], RtkMessageView.prototype, "iconPack", void 0);
2031
+ RtkMessageView.style = RtkMessageViewStyle0;
2032
+
2033
+ const rtkPaginatedListCss = ".scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}:host{position:relative;display:flex;flex-direction:column;flex:1}.container{box-sizing:border-box;display:flex;flex-direction:column-reverse;padding-top:var(--rtk-space-4, 16px);padding-bottom:var(--rtk-space-4, 16px);padding-left:var(--rtk-space-2, 8px);padding-right:var(--rtk-space-2, 8px);flex:1 0 0px;overflow-y:scroll}.file-picker{display:none}.chat *:first-child{margin-top:var(--rtk-space-0, 0px)}.chat .head{display:flex;align-items:center}.chat .head .name{margin-right:var(--rtk-space-4, 16px);font-size:12px;font-weight:700}.chat .head .time{font-size:12px;color:rgb(var(--rtk-colors-text-800, 255 255 255 / 0.76))}.chat .body{margin-top:var(--rtk-space-2, 8px);margin-bottom:var(--rtk-space-2, 8px);overflow-wrap:break-word;font-size:14px;line-height:1.375}.chat .body .emoji{font-size:24px}p{margin-top:var(--rtk-space-0, 0px);margin-bottom:var(--rtk-space-3, 12px)}rtk-text-message,rtk-image-message,rtk-file-message{margin-top:var(--rtk-space-4, 16px);display:block;padding-left:var(--rtk-space-3, 12px);padding-right:var(--rtk-space-3, 12px);font-family:var(--rtk-font-family, sans-serif);color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88));box-sizing:border-box}*[is-continued]{margin-top:var(--rtk-space-3, 12px)}rtk-text-message[is-continued]{margin-top:var(--rtk-space-2, 8px)}.chat .image{position:relative;height:var(--rtk-space-40, 160px);max-width:var(--rtk-space-64, 256px);cursor:pointer}.chat .image img{display:none;height:100%;width:100%;border-radius:var(--rtk-border-radius-sm, 4px);-o-object-fit:cover;object-fit:cover}.chat .image .image-spinner{display:flex;height:100%;width:100%;flex-direction:column;align-items:center;justify-content:center;border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}.chat .image .image-spinner rtk-spinner{--tw-text-opacity:1;color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-text-opacity))}.chat .image .image-errored{display:flex;height:100%;width:100%;flex-direction:column;align-items:center;justify-content:center;border-radius:var(--rtk-border-radius-sm, 4px);background-color:rgba(var(--rtk-colors-danger, 255 45 45) / 0.1);--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))}.chat .image .actions{display:none;height:var(--rtk-space-8, 32px);align-items:center;position:absolute;top:var(--rtk-space-2, 8px);right:var(--rtk-space-2, 8px);border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255));overflow:hidden;--tw-shadow:0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.chat .image .actions .action{height:var(--rtk-space-8, 32px);width:var(--rtk-space-8, 32px);border-radius:var(--rtk-border-radius-none, 0);border-width:var(--rtk-border-width-none, 0);border-style:none;background-color:transparent;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.chat .image .actions .action:hover{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.image.loaded img{display:block}.image.loaded .image-spinner{display:none}.image:hover .actions,.image:focus .actions{display:flex}.chat .file{display:flex;align-items:center;gap:var(--rtk-space-1, 4px);padding-left:var(--rtk-space-2, 8px);padding-right:var(--rtk-space-2, 8px);padding-top:var(--rtk-space-1\\.5, 6px);padding-bottom:var(--rtk-space-1\\.5, 6px);border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64))}.chat .file .file-data{flex:1 1 0%}.chat .file .file-data .name{word-break:break-all;color:rgb(var(--rtk-colors-text-1000, 255 255 255));overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.chat .file .file-data .file-data-split{margin-top:var(--rtk-space-0\\.5, 2px);display:flex;align-items:center;font-size:12px}.chat .file .file-data .file-data-split .ext{margin-right:var(--rtk-space-2, 8px);text-transform:uppercase;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.chat .file .file-data .file-data-split .divider{height:var(--rtk-space-4, 16px);width:var(--rtk-space-0\\.5, 2px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.chat .file .file-data .file-data-split .size{margin-left:var(--rtk-space-2, 8px)}.smallest-dom-element{width:1px}#top-scroll{transform:translateY(20vh)}#bottom-scroll{transform:translateY(-20vh)}a{--tw-text-opacity:1;color:rgba(var(--rtk-colors-brand-300, 73 124 253) / var(--tw-text-opacity));text-decoration-line:none}a:hover{text-decoration-line:underline}.show-new-messages-ctr{pointer-events:none;position:absolute;bottom:var(--rtk-space-2, 8px);right:var(--rtk-space-4, 16px);z-index:10;margin-top:calc(var(--rtk-space-14, 56px) * -1);--tw-translate-y:var(--rtk-space-28, 112px);transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));opacity:0;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.show-new-messages-ctr.active{--tw-translate-y:var(--rtk-space-0, 0px);transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));opacity:1}.show-new-messages{pointer-events:auto;border-radius:9999px}.show-new-messages:hover{border-radius:9999px;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);--tw-ring-opacity:1;--tw-ring-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-ring-opacity));--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}rtk-spinner,.empty-list{margin:auto}.page-wrapper{margin-left:var(--rtk-space-1, 4px);margin-right:var(--rtk-space-1, 4px)}.message-wrapper{margin-bottom:var(--rtk-space-2, 8px)}.pinned .message-wrapper{position:relative}.pinned .pin-icon{position:absolute;right:calc(var(--rtk-space-1, 4px) * -1);top:calc(var(--rtk-space-1, 4px) * -1);display:flex;border-radius:var(--rtk-border-radius-sm, 4px)}.pinned rtk-message-view{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));padding-top:var(--rtk-space-1, 4px);padding-bottom:var(--rtk-space-1, 4px)}";
2034
+ const RtkPaginatedListStyle0 = rtkPaginatedListCss;
2035
+
2036
+ var __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
2037
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2038
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
2039
+ r = Reflect.decorate(decorators, target, key, desc);
2040
+ else
2041
+ for (var i = decorators.length - 1; i >= 0; i--)
2042
+ if (d = decorators[i])
2043
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2044
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
2045
+ };
2046
+ const RtkPaginatedList = class {
2047
+ constructor(hostRef) {
2048
+ index$1.registerInstance(this, hostRef);
2049
+ /** Icon pack */
2050
+ this.iconPack = uiStore.defaultIconPack;
2051
+ /** Language */
2052
+ this.t = uiStore.useLanguage();
2053
+ /** label to show when empty */
2054
+ this.emptyListLabel = null;
2055
+ this.isLoading = false;
2056
+ this.rerenderBoolean = false;
2057
+ /**
2058
+ * This gets disabled when the user scrolls up and the bottom node
2059
+ * is not visible anymore.
2060
+ */
2061
+ this.shouldRenderNewNodes = true;
2062
+ /**
2063
+ * This gets disabled when the user scrolls up and the bottom node
2064
+ * is not visible anymore.
2065
+ */
2066
+ this.hasNewNodesToRender = false;
2067
+ this.showEmptyListLabel = false;
2068
+ /**
2069
+ * This is a private variable not a state
2070
+ * since we want to debounce rerenders
2071
+ *
2072
+ * A list of pages where each page contains a number of Nodes
2073
+ * [
2074
+ * [Node 1, Node 2, Node 3.... Node N],
2075
+ * [Node 1, Node 2, Node 3.... Node N],
2076
+ * ]
2077
+ */
2078
+ this.pagesToRender = [[]];
2079
+ this.currentTime = () => {
2080
+ return new Date().getTime();
2081
+ };
2082
+ this.observe = (el) => {
2083
+ if (!el)
2084
+ return;
2085
+ this.intersectionObserver.observe(el);
2086
+ };
2087
+ }
2088
+ /**
2089
+ * On a new node created
2090
+ */
2091
+ async onNewNode(node) {
2092
+ if (!this.shouldRenderNewNodes) {
2093
+ this.hasNewNodesToRender = true;
2094
+ return;
2095
+ }
2096
+ this.addNodeToRender(node, false);
2097
+ this.rerender();
2098
+ }
2099
+ /**
2100
+ * On node deleted
2101
+ */
2102
+ async onNodeDelete(key) {
2103
+ const oldLength = this.pagesToRender.flat().length;
2104
+ this.pagesToRender = this.pagesToRender.map((page) => page.filter((item) => item.id !== key));
2105
+ if (oldLength !== this.pagesToRender.flat().length) {
2106
+ this.rerender();
2107
+ }
2108
+ }
2109
+ /**
2110
+ * On node updated
2111
+ */
2112
+ async onNodeUpdate(key, newItem) {
2113
+ let shouldRerender = false;
2114
+ this.pagesToRender = this.pagesToRender.map((page) => page.map((item) => {
2115
+ if (item.id === key) {
2116
+ shouldRerender = true;
2117
+ return newItem;
2118
+ }
2119
+ return item;
2120
+ }));
2121
+ if (shouldRerender)
2122
+ this.rerender();
2123
+ }
2124
+ onItemChanged(newItemId, oldItemId) {
2125
+ if (newItemId !== oldItemId) {
2126
+ this.pagesToRender = [[]];
2127
+ this.loadFirstPage().then(() => this.rerender());
2128
+ }
2129
+ }
2130
+ connectedCallback() {
2131
+ this.rerender = debounce.debounce(this.rerender.bind(this), 50, { maxWait: 200 });
2132
+ this.autoScroll = true;
2133
+ this.intersectionObserver = new IntersectionObserver((entries) => {
2134
+ index$1.writeTask(() => {
2135
+ for (const entry of entries) {
2136
+ if (entry.target.id === 'bottom-scroll') {
2137
+ if (entry.isIntersecting)
2138
+ this.loadBottom();
2139
+ else
2140
+ this.shouldRenderNewNodes = false;
2141
+ }
2142
+ if (entry.target.id === 'top-scroll' && entry.isIntersecting) {
2143
+ this.loadTop();
2144
+ }
2145
+ }
2146
+ });
2147
+ });
2148
+ }
2149
+ disconnectedCallback() {
2150
+ this.intersectionObserver.disconnect();
2151
+ }
2152
+ componentDidLoad() {
2153
+ /**
2154
+ * Adding observes here so that on the first render we scroll down
2155
+ * and shouldRenderNewNodes remains true
2156
+ */
2157
+ this.loadFirstPage();
2158
+ this.observe(this.$topRef);
2159
+ this.observe(this.$bottomRef);
2160
+ }
2161
+ componentDidRender() {
2162
+ if (this.shouldRenderNewNodes && this.autoScroll)
2163
+ scroll.smoothScrollToBottom(this.$paginatedList);
2164
+ }
2165
+ loadFirstPage() {
2166
+ return this.loadPage(this.currentTime(), this.pageSize, true, (data) => {
2167
+ if (data.length === 0) {
2168
+ this.showEmptyListLabel = true;
2169
+ }
2170
+ });
2171
+ }
2172
+ loadTop() {
2173
+ /**
2174
+ * If there is only one unfilled page or no page, no need to check
2175
+ * for top since it will be empty
2176
+ */
2177
+ if (this.pagesToRender.length === 0)
2178
+ return;
2179
+ if (this.pagesToRender.length === 1 && this.pagesToRender[0].length < this.pageSize)
2180
+ return;
2181
+ /**
2182
+ * TODO: Make this more flexible currently this only works with chat
2183
+ */
2184
+ const oldestVNode = this.pagesToRender[0][0];
2185
+ const oldestTimestamp = oldestVNode.timeMs;
2186
+ // TODO: scrollIntoView
2187
+ const onPageRendered = () => { }; // oldestVNode.$elm$?.scrollIntoView();
2188
+ this.loadPage(oldestTimestamp - 1, this.pageSize, true, onPageRendered);
2189
+ }
2190
+ loadBottom() {
2191
+ /**
2192
+ * If there is only one unfilled page or no page, no need to check
2193
+ * for top since it will be empty
2194
+ */
2195
+ if (this.pagesToRender.length === 0) {
2196
+ this.shouldRenderNewNodes = true;
2197
+ return;
2198
+ }
2199
+ if (this.pagesToRender.length === 1 && this.pagesToRender[0].length < this.pageSize) {
2200
+ this.shouldRenderNewNodes = true;
2201
+ return;
2202
+ }
2203
+ const newestVNode = this.pagesToRender.at(-1).at(-1);
2204
+ const newestTimestamp = newestVNode.timeMs;
2205
+ // TODO: scrollIntoView
2206
+ const onPageRendered = () => scroll.smoothScrollToBottom(this.$paginatedList);
2207
+ this.loadPage(newestTimestamp + 1, this.pageSize, false, onPageRendered);
2208
+ }
2209
+ addNodeToRender(node, addToStart) {
2210
+ if (addToStart) {
2211
+ const firstPage = this.pagesToRender[0];
2212
+ if (firstPage && (firstPage === null || firstPage === void 0 ? void 0 : firstPage.length) < this.pageSize) {
2213
+ /**
2214
+ * If first page is not full then just add to that page
2215
+ */
2216
+ firstPage.unshift(node);
2217
+ }
2218
+ else {
2219
+ /**
2220
+ * If first page is full then add a new page to the start
2221
+ */
2222
+ const newPage = [node];
2223
+ this.pagesToRender.unshift(newPage);
2224
+ this.removeLastPageIfNeeded(false);
2225
+ }
2226
+ }
2227
+ else {
2228
+ const [lastPage] = this.pagesToRender.slice(-1);
2229
+ if (lastPage && (lastPage === null || lastPage === void 0 ? void 0 : lastPage.length) < this.pageSize) {
2230
+ /**
2231
+ * If last page is not full then just add it
2232
+ */
2233
+ lastPage.push(node);
2234
+ }
2235
+ else {
2236
+ /**
2237
+ * If last page is full add a new page with just
2238
+ * this node
2239
+ */
2240
+ const newPage = [node];
2241
+ this.pagesToRender.push(newPage);
2242
+ this.removeLastPageIfNeeded(true);
2243
+ }
2244
+ }
2245
+ }
2246
+ /**
2247
+ * @param start
2248
+ * @param end
2249
+ * @param reversed Defines whether to add the page at the beginning or the end
2250
+ * @param onPageLoaded Callback for when all new nodes are rendered
2251
+ */
2252
+ async loadPage(timestamp, size, reversed, onPageRendered = () => { }) {
2253
+ this.isLoading = true;
2254
+ const data = (await this.fetchData(timestamp, size, reversed));
2255
+ this.isLoading = false;
2256
+ if (!(data === null || data === void 0 ? void 0 : data.length)) {
2257
+ /**
2258
+ * While scrolling down if there were no new items found
2259
+ * then start rendering new nodes;
2260
+ */
2261
+ if (!reversed) {
2262
+ this.hasNewNodesToRender = false;
2263
+ this.shouldRenderNewNodes = true;
2264
+ }
2265
+ onPageRendered([]);
2266
+ return;
2267
+ }
2268
+ data.forEach((node) => this.addNodeToRender(node, reversed));
2269
+ this.rerender();
2270
+ onPageRendered(data);
2271
+ }
2272
+ rerender() {
2273
+ this.rerenderBoolean = !this.rerenderBoolean;
2274
+ }
2275
+ removeLastPageIfNeeded(removeFromStart) {
2276
+ if (this.pagesToRender.length > this.pagesAllowed) {
2277
+ if (removeFromStart)
2278
+ this.pagesToRender.shift();
2279
+ else
2280
+ this.pagesToRender.pop();
2281
+ }
2282
+ }
2283
+ onDownArrowClicked() {
2284
+ /**
2285
+ * Load the freshest pages
2286
+ */
2287
+ this.loadBottom();
2288
+ }
2289
+ render() {
2290
+ var _a;
2291
+ /**
2292
+ * div.container is flex=column-reverse
2293
+ * which is why div#bottom-scroll comes before div#top-scroll
2294
+ * div.page-wrapper prevents reversal of messages
2295
+ */
2296
+ return (index$1.h(index$1.Host, { key: 'bb4971c301060a02d6a9ad536fb633c0c87519c4' }, index$1.h("div", { key: '92a9524264d790fff447aefb7cc20a9da6958687', class: "scrollbar container", part: "container", ref: (el) => (this.$paginatedList = el) }, index$1.h("div", { key: 'e64bd91ea1e869b9a1f5e861959ee78306c17bee', class: { 'show-new-messages-ctr': true, active: !this.shouldRenderNewNodes } }, index$1.h("rtk-button", { key: '2471e6614616aa33c9ecd5d0c1f47d09fa00b481', class: "show-new-messages", kind: "icon", variant: "secondary", part: "show-new-messages", onClick: () => this.onDownArrowClicked() }, index$1.h("rtk-icon", { key: 'ed0b255c69fbaeecc883c0492fd5b810b8d429b8', icon: this.iconPack.chevron_down }))), index$1.h("div", { key: '509aa620d47e853fd4e73d5b6c30433156b0f1da', class: "smallest-dom-element", id: "bottom-scroll", ref: (el) => (this.$bottomRef = el) }), this.isLoading && this.pagesToRender.flat().length === 0 && index$1.h("rtk-spinner", { key: '47e60a2fcb103200d763b9af257babfca5ee6e3c', size: "lg" }), this.pagesToRender.flat().length === 0 && this.showEmptyListLabel ? (index$1.h("div", { class: "empty-list" }, (_a = this.emptyListLabel) !== null && _a !== void 0 ? _a : this.t('list.empty'))) : (index$1.h("div", { class: "page-wrapper" }, this.pagesToRender.map((page) => this.createNodes(page)))), index$1.h("div", { key: '64ab66547b004130f9f3d0b0976c27c5aeeb720e', class: "smallest-dom-element", id: "top-scroll", ref: (el) => (this.$topRef = el) }))));
2297
+ }
2298
+ static get watchers() { return {
2299
+ "selectedItemId": ["onItemChanged"]
2300
+ }; }
2301
+ };
2302
+ __decorate$2([
2303
+ index.SyncWithStore()
2304
+ ], RtkPaginatedList.prototype, "iconPack", void 0);
2305
+ __decorate$2([
2306
+ index.SyncWithStore()
2307
+ ], RtkPaginatedList.prototype, "t", void 0);
2308
+ RtkPaginatedList.style = RtkPaginatedListStyle0;
2309
+
2310
+ const rtkSpinnerCss = ":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{box-sizing:border-box;display:block;height:var(--rtk-space-10, 40px);width:var(--rtk-space-10, 40px);--rtk-spinner-color:currentColor}.spinner{height:100%;width:100%}@keyframes spin{to{transform:rotate(360deg)}}.spinner{animation:spin 1s linear infinite;border-radius:9999px;background-color:transparent;animation-duration:1.3s}:host([size='md']){height:var(--rtk-space-6, 24px);width:var(--rtk-space-6, 24px)}:host([size='sm']){height:var(--rtk-space-4, 16px);width:var(--rtk-space-4, 16px)}";
2311
+ const RtkSpinnerStyle0 = rtkSpinnerCss;
2312
+
2313
+ var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
2314
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2315
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
2316
+ r = Reflect.decorate(decorators, target, key, desc);
2317
+ else
2318
+ for (var i = decorators.length - 1; i >= 0; i--)
2319
+ if (d = decorators[i])
2320
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2321
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
2322
+ };
2323
+ const RtkSpinner = class {
2324
+ constructor(hostRef) {
2325
+ index$1.registerInstance(this, hostRef);
2326
+ /** Icon pack */
2327
+ this.iconPack = uiStore.defaultIconPack;
2328
+ /** Size */
2329
+ this.size = 'md';
2330
+ }
2331
+ render() {
2332
+ return (index$1.h(index$1.Host, { key: '896d7e13900a390f5c03df4e2af45163d61f6d09' }, index$1.h("rtk-icon", { key: 'dd05bbbb3eb9db982d85db131b82c2bcaf253a94', class: "spinner", icon: this.iconPack.spinner })));
2333
+ }
2334
+ };
2335
+ __decorate$1([
2336
+ index.SyncWithStore()
2337
+ ], RtkSpinner.prototype, "iconPack", void 0);
2338
+ RtkSpinner.style = RtkSpinnerStyle0;
2339
+
2340
+ const rtkTextComposerViewCss = ".chat-input {\n position: relative;\n z-index: 10;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n border-top-left-radius: var(--rtk-border-radius-md, 8px);\n border-top-right-radius: var(--rtk-border-radius-md, 8px)\n}\n\n .chat-input textarea {\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));\n box-sizing: border-box;\n padding: var(--rtk-space-3, 12px);\n color: rgb(var(--rtk-colors-text-1000, 255 255 255))\n}\n\n .chat-input textarea::-moz-placeholder {\n color: rgb(var(--rtk-colors-text-1000, 255 255 255))\n}\n\n .chat-input textarea::placeholder {\n color: rgb(var(--rtk-colors-text-1000, 255 255 255))\n}\n\n .chat-input textarea {\n font-family: var(--rtk-font-family, sans-serif);\n outline: 2px solid transparent;\n outline-offset: 2px;\n resize: none;\n overflow-y: auto;\n border-width: var(--rtk-border-width-none, 0);\n border-style: none;\n min-height: 60px;\n font-size: 14px\n}\n\n@container chatcontainer (height < 360px) {\n textarea {\n height: 30px !important;\n min-height: 30px !important\n }\n}\n\n.text-error {\n left: var(--rtk-space-0, 0px);\n z-index: 10;\n margin-top: var(--rtk-space-1, 4px);\n margin-left: var(--rtk-space-1, 4px);\n display: flex;\n width: -moz-fit-content;\n width: fit-content;\n align-items: center;\n justify-content: flex-start;\n border-radius: var(--rtk-border-radius-sm, 4px);\n --tw-border-opacity: 1;\n border-color: rgba(var(--rtk-colors-warning, 255 205 7) / var(--tw-border-opacity));\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity));\n padding-left: var(--rtk-space-2, 8px);\n padding-right: var(--rtk-space-2, 8px);\n font-size: 12px;\n font-weight: 600;\n --tw-text-opacity: 1;\n color: rgba(var(--rtk-colors-warning, 255 205 7) / var(--tw-text-opacity));\n border: 1px solid\n}\n\n#warning-indicator {\n margin-right: var(--rtk-space-1, 4px);\n height: var(--rtk-space-3, 12px);\n width: var(--rtk-space-3, 12px)\n}\n\n.text-error.breached {\n --tw-border-opacity: 1;\n border-color: rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-border-opacity));\n --tw-text-opacity: 1;\n color: rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))\n}";
2341
+ const RtkTextComposerViewStyle0 = rtkTextComposerViewCss;
2342
+
2343
+ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
2344
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2345
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
2346
+ r = Reflect.decorate(decorators, target, key, desc);
2347
+ else
2348
+ for (var i = decorators.length - 1; i >= 0; i--)
2349
+ if (d = decorators[i])
2350
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2351
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
2352
+ };
2353
+ const RtkTextComposerView = class {
2354
+ constructor(hostRef) {
2355
+ index$1.registerInstance(this, hostRef);
2356
+ this.onTextChange = index$1.createEvent(this, "textChange", 7);
2357
+ /** Disable the text input (default = false) */
2358
+ this.disabled = false;
2359
+ /** Boolean to indicate if rate limit is breached */
2360
+ this.rateLimitBreached = false;
2361
+ /** Keydown event handler function */
2362
+ this.keyDownHandler = () => { };
2363
+ /** Icon pack */
2364
+ this.iconPack = uiStore.defaultIconPack;
2365
+ /** Language */
2366
+ this.t = uiStore.useLanguage();
2367
+ this.maxLengthBreached = 0;
2368
+ this.onInputHandler = () => {
2369
+ const text = this.$textArea.value.trim();
2370
+ this.maybeResize(text);
2371
+ this.checkLength(text);
2372
+ this.onTextChange.emit(text);
2373
+ };
2374
+ this.maybeResize = (text) => {
2375
+ const newLines = [...text.matchAll(/\n/g)].length;
2376
+ this.$textArea.style.height = `${Math.min(200, 60 + 20 * newLines)}px`;
2377
+ };
2378
+ }
2379
+ componentDidLoad() {
2380
+ if (this.maxLength) {
2381
+ this.$textArea.maxLength = this.maxLength;
2382
+ }
2383
+ const text = this.$textArea.value.trim();
2384
+ if (text !== '') {
2385
+ this.maybeResize(text);
2386
+ }
2387
+ this.$textArea.focus();
2388
+ }
2389
+ /** Sets value of the text input */
2390
+ async setText(text, focus = false) {
2391
+ this.$textArea.value = text;
2392
+ this.maybeResize(text);
2393
+ if (focus) {
2394
+ this.$textArea.focus();
2395
+ }
2396
+ this.checkLength(text);
2397
+ this.onTextChange.emit(text);
2398
+ }
2399
+ checkLength(text) {
2400
+ // unicode code length
2401
+ const textLen = text.length;
2402
+ if (textLen + 10 >= this.maxLength) {
2403
+ this.maxLengthBreached = text.length;
2404
+ }
2405
+ else if (textLen + 10 < this.maxLength && this.maxLengthBreached > 0) {
2406
+ this.maxLengthBreached = 0;
2407
+ }
2408
+ }
2409
+ render() {
2410
+ return (index$1.h("div", { key: '16cc81323e6fb16e4d4a6622895ed7edc80f2db9', class: "chat-input", part: "chat-input-container" }, this.maxLengthBreached > 0 && (index$1.h("div", { key: '05fde7b4f3e084e464fcc3276f0ce1e0d909e6a7', class: 'text-error ' + (this.maxLengthBreached === this.maxLength ? 'breached' : '') }, index$1.h("rtk-icon", { key: 'd4101bf8933a9873605e88fbb617d8ae38bb56a1', id: "warning-indicator", icon: this.iconPack.warning, part: "warning-indicator" }), ' ', this.maxLengthBreached, " / ", this.maxLength, " ", this.t('chat.max_limit_warning'))), this.rateLimitBreached && (index$1.h("div", { key: '779a1c58114de2cce65a13ee3ea8cb308f7cd68a', class: 'text-error breached' }, index$1.h("rtk-icon", { key: '9dedd14d826b1437f434d92c985659ecc3bc1842', id: "warning-indicator", icon: this.iconPack.warning, part: "warning-indicator" }), ' ', this.t('chat.rate_limit_error'))), index$1.h("textarea", { key: 'f45f8f812ad668a86d2d0a22926bf437be44cbc9', ref: (el) => (this.$textArea = el), placeholder: this.placeholder, disabled: this.disabled, onInput: this.onInputHandler, onKeyDown: this.keyDownHandler, part: "chat-input", value: this.value })));
2411
+ }
2412
+ };
2413
+ __decorate([
2414
+ index.SyncWithStore()
2415
+ ], RtkTextComposerView.prototype, "iconPack", void 0);
2416
+ __decorate([
2417
+ index.SyncWithStore()
2418
+ ], RtkTextComposerView.prototype, "t", void 0);
2419
+ RtkTextComposerView.style = RtkTextComposerViewStyle0;
2420
+
2421
+ const rtkTextMessageViewCss = ":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.text{word-break:break-word;display:block;overflow-wrap:break-word;line-height:1.375}.text.emoji{font-size:24px}";
2422
+ const RtkTextMessageViewStyle0 = rtkTextMessageViewCss;
2423
+
2424
+ const RtkTextMessageView = class {
2425
+ constructor(hostRef) {
2426
+ index$1.registerInstance(this, hostRef);
2427
+ /** Renders text as markdown (default = true) */
2428
+ this.isMarkdown = false;
2429
+ }
2430
+ render() {
2431
+ return (index$1.h("p", { key: '3a9c21d67487ea40760163f0dd69152454049063', class: { text: true, emoji: string.hasOnlyEmojis(this.text) } }, this.isMarkdown ? index$1.h("rtk-markdown-view", { text: this.text }) : this.text));
2432
+ }
2433
+ };
2434
+ RtkTextMessageView.style = RtkTextMessageViewStyle0;
2435
+
2436
+ const rtkTooltipCss = ":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{--background-color:var(--rtk-tooltip-background-color, rgb(var(--rtk-colors-background-600, 60 60 60)));--color:var(--rtk-tooltip-color, rgb(var(--rtk-colors-text-1000, 255 255 255)));display:inline-flex}#trigger{display:block;width:100%;flex:1 1 0%}.tooltip{max-width:var(--rtk-space-64, 256px);position:fixed;z-index:20;display:none;width:-moz-max-content;width:max-content;padding-left:var(--rtk-space-2, 8px);padding-right:var(--rtk-space-2, 8px);padding-top:var(--rtk-space-1, 4px);padding-bottom:var(--rtk-space-1, 4px);border-radius:var(--rtk-border-radius-sm, 4px);--tw-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);font-size:12px}.tooltip,#arrow{position:absolute;background-color:var(--background-color);color:var(--color)}#arrow{position:absolute;height:var(--rtk-space-2, 8px);width:var(--rtk-space-2, 8px);transform:rotate(45deg)}:host([variant='primary']){--background-color:rgb(var(--rtk-colors-brand-500, 33 96 253));--color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)))}:host([kind='block']){display:block}";
2437
+ const RtkTooltipStyle0 = rtkTooltipCss;
2438
+
2439
+ const RtkMenu = class {
2440
+ constructor(hostRef) {
2441
+ index$1.registerInstance(this, hostRef);
2442
+ this.openChange = index$1.createEvent(this, "rtkOpenChange", 7);
2443
+ /** Tooltip label */
2444
+ this.label = '';
2445
+ /** Tooltip variant */
2446
+ this.variant = 'secondary';
2447
+ /** Disabled */
2448
+ this.disabled = false;
2449
+ /** Open */
2450
+ this.open = false;
2451
+ /** Tooltip kind */
2452
+ this.kind = 'inline';
2453
+ /** Placement of menu */
2454
+ this.placement = 'top';
2455
+ /** Delay before showing the tooltip */
2456
+ this.delay = 0;
2457
+ this.isInFocus = false;
2458
+ this.showMenu = () => {
2459
+ if (this.disabled)
2460
+ return;
2461
+ this.isInFocus = true;
2462
+ setTimeout(() => {
2463
+ if (this.isInFocus) {
2464
+ this.tooltipEl.style.display = 'block';
2465
+ this.update();
2466
+ this.openChange.emit(true);
2467
+ if (this.size === 'sm') {
2468
+ setTimeout(() => {
2469
+ if (this.isInFocus) {
2470
+ this.hideMenu();
2471
+ }
2472
+ }, 1000);
2473
+ }
2474
+ }
2475
+ }, this.delay);
2476
+ };
2477
+ this.hideMenu = () => {
2478
+ if (this.open || this.disabled)
2479
+ return;
2480
+ this.isInFocus = false;
2481
+ this.tooltipEl.style.display = 'none';
2482
+ this.openChange.emit(false);
2483
+ };
2484
+ }
2485
+ componentDidLoad() {
2486
+ this.triggerEl.addEventListener('focusin', this.showMenu);
2487
+ this.triggerEl.addEventListener('mouseenter', this.showMenu);
2488
+ this.triggerEl.addEventListener('focusout', this.hideMenu);
2489
+ this.triggerEl.addEventListener('mouseleave', this.hideMenu);
2490
+ index$1.writeTask(() => {
2491
+ this.openChanged(this.open);
2492
+ });
2493
+ }
2494
+ disconnectedCallback() {
2495
+ if (!this.triggerEl)
2496
+ return;
2497
+ this.triggerEl.removeEventListener('focusin', this.showMenu);
2498
+ this.triggerEl.removeEventListener('mouseenter', this.showMenu);
2499
+ this.triggerEl.removeEventListener('focusout', this.hideMenu);
2500
+ this.triggerEl.removeEventListener('mouseleave', this.hideMenu);
2501
+ this.triggerEl = undefined;
2502
+ }
2503
+ openChanged(open) {
2504
+ if (open) {
2505
+ this.showMenu();
2506
+ }
2507
+ else {
2508
+ this.hideMenu();
2509
+ }
2510
+ }
2511
+ update() {
2512
+ floatingUi_dom_esm.computePosition(this.triggerEl, this.tooltipEl, {
2513
+ placement: this.placement,
2514
+ middleware: [floatingUi_dom_esm.offset(8), floatingUi_dom_esm.flip(), floatingUi_dom_esm.shift({ padding: 5 }), floatingUi_dom_esm.arrow({ element: this.arrowEl })],
2515
+ }).then(({ x, y, placement, middlewareData }) => {
2516
+ Object.assign(this.tooltipEl.style, {
2517
+ left: `${x}px`,
2518
+ top: `${y}px`,
2519
+ });
2520
+ const { x: arrowX, y: arrowY } = middlewareData.arrow;
2521
+ const staticSide = {
2522
+ top: 'bottom',
2523
+ right: 'left',
2524
+ bottom: 'top',
2525
+ left: 'right',
2526
+ }[placement.split('-')[0]];
2527
+ Object.assign(this.arrowEl.style, {
2528
+ left: arrowX != null ? `${arrowX}px` : '',
2529
+ top: arrowY != null ? `${arrowY}px` : '',
2530
+ right: '',
2531
+ bottom: '',
2532
+ [staticSide]: '-4px',
2533
+ });
2534
+ });
2535
+ }
2536
+ render() {
2537
+ return (index$1.h(index$1.Host, { key: 'cee2142cb6afa3e002b614bd3dd18b710b749ac1' }, index$1.h("span", { key: '4ba5b4777592afc8eb0ae14b50e5ebbfbb43bd1f', part: "trigger", id: "trigger", ref: (el) => (this.triggerEl = el) }, index$1.h("slot", { key: 'fa1ecc3998424e21444324bf4b5c90d6891ab03f' })), index$1.h("div", { key: '39306bb13f784942525e0b8b203406512253be3d', part: "tooltip", class: "tooltip", id: "tooltip", role: "tooltip", ref: (el) => (this.tooltipEl = el) }, index$1.h("div", { key: 'd5bd2ca0781605c1ffe4cbeb1ade65430aed6691', id: "arrow", ref: (el) => (this.arrowEl = el), part: "arrow" }), this.label, index$1.h("slot", { key: 'c80c860e2c9cdcbe3c0e0ec97b8f4cd9c99abb78', name: "tooltip" }))));
2538
+ }
2539
+ static get watchers() { return {
2540
+ "open": ["openChanged"]
2541
+ }; }
2542
+ };
2543
+ RtkMenu.style = RtkTooltipStyle0;
2544
+
2545
+ exports.rtk_avatar = RtkAvatar;
2546
+ exports.rtk_button = RtkButton;
2547
+ exports.rtk_channel_selector_view = RtkChannelSelectorView;
2548
+ exports.rtk_chat = RtkChat;
2549
+ exports.rtk_chat_composer_view = RtkChatComposerView;
2550
+ exports.rtk_chat_messages_ui_paginated = RtkChatMessagesUiPaginated;
2551
+ exports.rtk_draft_attachment_view = RtkDraftAttachmentView;
2552
+ exports.rtk_emoji_picker = RtkEmojiPicker;
2553
+ exports.rtk_emoji_picker_button = RtkEmojiPickerButton;
2554
+ exports.rtk_file_message_view = RtkFileMessageView;
2555
+ exports.rtk_file_picker_button = RtkFilePickerButton;
2556
+ exports.rtk_icon = RtkIcon;
2557
+ exports.rtk_image_message_view = RtkImageMessageView;
2558
+ exports.rtk_markdown_view = RtkMarkdownView;
2559
+ exports.rtk_meeting = RtkMeeting;
2560
+ exports.rtk_menu = RtkMenu$1;
2561
+ exports.rtk_menu_item = RtkMenuItem;
2562
+ exports.rtk_menu_list = RtkMenuList;
2563
+ exports.rtk_message_view = RtkMessageView;
2564
+ exports.rtk_paginated_list = RtkPaginatedList;
2565
+ exports.rtk_spinner = RtkSpinner;
2566
+ exports.rtk_text_composer_view = RtkTextComposerView;
2567
+ exports.rtk_text_message_view = RtkTextMessageView;
2568
+ exports.rtk_tooltip = RtkMenu;