@mobilon-dev/chotto 0.3.120 → 0.3.121

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 (222) hide show
  1. package/dist/chotto.css +1 -1
  2. package/dist/components/1_atoms/ButtonContextMenu/ButtonContextMenu.vue.js +29 -4
  3. package/dist/components/1_atoms/ButtonContextMenu/ButtonContextMenu.vue2.js +40 -59
  4. package/dist/components/1_atoms/ContactContextMenu/ContactContextMenu.vue.js +47 -4
  5. package/dist/components/1_atoms/ContactContextMenu/ContactContextMenu.vue2.js +55 -82
  6. package/dist/components/1_atoms/ContextMenu/ContextMenu.vue.js +86 -51
  7. package/dist/components/1_atoms/EmbedPreview/EmbedPreview.vue.js +32 -4
  8. package/dist/components/1_atoms/EmbedPreview/EmbedPreview.vue2.js +7 -28
  9. package/dist/components/1_atoms/EmojiGlyph/EmojiGlyph.vue.js +22 -35
  10. package/dist/components/1_atoms/EmojiGlyph/EmojiGlyph.vue2.js +30 -2
  11. package/dist/components/1_atoms/LinkPreview/LinkPreview.vue.js +37 -4
  12. package/dist/components/1_atoms/LinkPreview/LinkPreview.vue2.js +7 -21
  13. package/dist/components/1_atoms/LoadingIndicator/LoadingIndicator.vue.js +30 -19
  14. package/dist/components/1_atoms/Tooltip/Tooltip.vue.js +70 -4
  15. package/dist/components/1_atoms/Tooltip/Tooltip.vue2.js +76 -108
  16. package/dist/components/1_icons/AvatarIcon.vue.js +8 -8
  17. package/dist/components/1_icons/CheckIcon.vue.js +26 -13
  18. package/dist/components/1_icons/CloseButtonIcon.vue.js +16 -10
  19. package/dist/components/1_icons/CloseIcon.vue.js +16 -10
  20. package/dist/components/1_icons/ContactCRMIcon.vue.js +16 -10
  21. package/dist/components/1_icons/DeletedMessageIcon.vue.js +27 -0
  22. package/dist/components/1_icons/MenuIcon.vue.js +16 -10
  23. package/dist/components/1_icons/MessageStatus/ErrorStatusIcon.vue.js +23 -3
  24. package/dist/components/1_icons/MessageStatus/ErrorStatusIcon.vue2.js +12 -21
  25. package/dist/components/1_icons/MessageStatus/PendingStatusIcon.vue.js +36 -4
  26. package/dist/components/1_icons/MessageStatus/PendingStatusIcon.vue2.js +11 -26
  27. package/dist/components/1_icons/MessageStatus/ReadStatusIcon.vue.js +23 -3
  28. package/dist/components/1_icons/MessageStatus/ReadStatusIcon.vue2.js +12 -21
  29. package/dist/components/1_icons/MessageStatus/ReceivedStatusIcon.vue.js +23 -3
  30. package/dist/components/1_icons/MessageStatus/ReceivedStatusIcon.vue2.js +11 -20
  31. package/dist/components/1_icons/MessageStatus/SentStatusIcon.vue.js +33 -4
  32. package/dist/components/1_icons/MessageStatus/SentStatusIcon.vue2.js +11 -23
  33. package/dist/components/1_icons/SearchIcon.vue.js +29 -17
  34. package/dist/components/1_icons/SettingsIcon.vue.js +8 -8
  35. package/dist/components/1_icons/TelegramIcon.vue.js +32 -20
  36. package/dist/components/1_icons/VerifiedBadge.vue.js +25 -19
  37. package/dist/components/1_icons/WhatsAppIcon.vue.js +32 -20
  38. package/dist/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.js +552 -402
  39. package/dist/components/2_blocks/CommunicationPanel/CommunicationPanelAttributeIndicator.vue.js +101 -58
  40. package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelCheckIcon.vue.js +14 -8
  41. package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelConfirmSpinner.vue.js +7 -7
  42. package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelMaxIcon.vue.js +7 -7
  43. package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelPhoneIcon.vue.js +19 -13
  44. package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelSMSIcon.vue.js +16 -10
  45. package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelSubmenuMaxIcon.vue.js +35 -23
  46. package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelSubmenuPhoneIcon.vue.js +32 -20
  47. package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelSubmenuSMSIcon.vue.js +17 -11
  48. package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelSubmenuTelegramIcon.vue.js +8 -8
  49. package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelSubmenuWhatsAppIcon.vue.js +32 -20
  50. package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelTelegramIcon.vue.js +33 -21
  51. package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelUnconfirmedIcon.vue.js +7 -7
  52. package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelWhatsAppIcon.vue.js +8 -8
  53. package/dist/components/2_blocks/FeedFoundItem/FeedFoundItem.vue.js +74 -4
  54. package/dist/components/2_blocks/FeedFoundItem/FeedFoundItem.vue2.js +12 -46
  55. package/dist/components/2_blocks/FeedFoundObjects/FeedFoundObjects.vue.js +62 -4
  56. package/dist/components/2_blocks/FeedFoundObjects/FeedFoundObjects.vue2.js +15 -36
  57. package/dist/components/2_blocks/FeedSearch/FeedSearch.vue.js +49 -4
  58. package/dist/components/2_blocks/FeedSearch/FeedSearch.vue2.js +22 -45
  59. package/dist/components/2_chatinput_elements/ButtonCommandsSelector/ButtonCommandsSelector.vue.js +36 -4
  60. package/dist/components/2_chatinput_elements/ButtonCommandsSelector/ButtonCommandsSelector.vue2.js +19 -37
  61. package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue.js +62 -4
  62. package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue2.js +80 -98
  63. package/dist/components/2_chatinput_elements/ButtonEmojiPicker/icons/SmilesIcon.vue.js +31 -27
  64. package/dist/components/2_chatinput_elements/ButtonEmojiPicker/icons/SmilesIcon.vue2.js +13 -2
  65. package/dist/components/2_chatinput_elements/ButtonTemplateSelector/ButtonTemplateSelector.vue.js +72 -4
  66. package/dist/components/2_chatinput_elements/ButtonTemplateSelector/ButtonTemplateSelector.vue2.js +47 -83
  67. package/dist/components/2_chatinput_elements/ButtonTemplateSelector/icons/ChatTemplatesIcon.vue.js +19 -21
  68. package/dist/components/2_chatinput_elements/ButtonTemplateSelector/icons/ChatTemplatesIcon.vue2.js +13 -2
  69. package/dist/components/2_chatinput_elements/ButtonWabaTemplateSelector/ButtonWabaTemplateSelector.vue.js +76 -45
  70. package/dist/components/2_chatinput_elements/FilePreview/FilePreview.vue.js +100 -4
  71. package/dist/components/2_chatinput_elements/FilePreview/FilePreview.vue2.js +16 -91
  72. package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue.js +79 -4
  73. package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue2.js +88 -111
  74. package/dist/components/2_chatinput_elements/FileUploader/icons/FileUploaderIcon.vue.js +15 -17
  75. package/dist/components/2_chatinput_elements/FileUploader/icons/FileUploaderIcon.vue2.js +13 -2
  76. package/dist/components/2_chatinput_elements/PlaceholderComponent/PlaceholderComponent.vue.js +39 -33
  77. package/dist/components/2_chatinput_elements/StickerPicker/StickerPicker.vue.js +220 -4
  78. package/dist/components/2_chatinput_elements/StickerPicker/StickerPicker.vue2.js +146 -256
  79. package/dist/components/2_chatinput_elements/StickerPicker/icons/StickerIcon.vue.js +39 -41
  80. package/dist/components/2_chatinput_elements/StickerPicker/icons/StickerIcon.vue2.js +13 -2
  81. package/dist/components/2_chatinput_elements/TemplateSelector/TemplateSelector.vue.js +233 -163
  82. package/dist/components/2_chatinput_elements/TextFormatToolbar/TextFormatToolbar.vue.js +164 -4
  83. package/dist/components/2_chatinput_elements/TextFormatToolbar/TextFormatToolbar.vue2.js +87 -175
  84. package/dist/components/2_chatinput_elements/WABAAttachmentSection/WABAAttachmentSection.vue.js +73 -4
  85. package/dist/components/2_chatinput_elements/WABAAttachmentSection/WABAAttachmentSection.vue2.js +32 -58
  86. package/dist/components/2_chatinput_elements/WABAQuickReplyButtons/WABAQuickReplyButtons.vue.js +47 -4
  87. package/dist/components/2_chatinput_elements/WABAQuickReplyButtons/WABAQuickReplyButtons.vue2.js +10 -23
  88. package/dist/components/2_chatinput_elements/WABASeparatedQuickButtons/WABASeparatedQuickButtons.vue.js +52 -4
  89. package/dist/components/2_chatinput_elements/WABASeparatedQuickButtons/WABASeparatedQuickButtons.vue2.js +8 -26
  90. package/dist/components/2_chatinput_elements/WABATemplateSelector/WABATemplateSelector.vue.js +299 -220
  91. package/dist/components/2_chatlist_elements/ChatFilter/ChatFilter.vue.js +41 -35
  92. package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue.js +306 -4
  93. package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue2.js +143 -323
  94. package/dist/components/2_chatlist_elements/ChatItem/icons/AudioIcon.vue.js +18 -12
  95. package/dist/components/2_chatlist_elements/ChatItem/icons/FileIcon.vue.js +23 -11
  96. package/dist/components/2_chatlist_elements/ChatItem/icons/ImageIcon.vue.js +7 -7
  97. package/dist/components/2_chatlist_elements/ChatItem/icons/MissedCallIcon.vue.js +34 -22
  98. package/dist/components/2_chatlist_elements/ChatItem/icons/StickerIcon.vue.js +15 -9
  99. package/dist/components/2_chatlist_elements/ChatItem/icons/VideoIcon.vue.js +26 -14
  100. package/dist/components/2_chatlist_elements/ChatItem/icons/VoiceIcon.vue.js +7 -7
  101. package/dist/components/2_chatlist_elements/ChatTabs/ChatTabs.vue.js +52 -24
  102. package/dist/components/2_elements/AudioRecorder/AudioRecorder.vue.js +84 -4
  103. package/dist/components/2_elements/AudioRecorder/AudioRecorder.vue2.js +36 -68
  104. package/dist/components/2_elements/ChannelSelector/ChannelSelector.vue.js +71 -37
  105. package/dist/components/2_elements/ChatInfo/ChatInfo.vue.js +83 -62
  106. package/dist/components/2_elements/ChatPanel/ChatPanel.vue.js +41 -29
  107. package/dist/components/2_elements/ContactInfo/ContactInfo.vue.js +176 -115
  108. package/dist/components/2_elements/ThemeMode/ThemeMode.vue.js +48 -27
  109. package/dist/components/2_elements/UserProfile/UserProfile.vue.js +58 -28
  110. package/dist/components/2_elements/VideoRecorder/VideoRecorder.vue.js +54 -4
  111. package/dist/components/2_elements/VideoRecorder/VideoRecorder.vue2.js +22 -42
  112. package/dist/components/2_feed_elements/AudioMessage/AudioMessage.vue.js +460 -4
  113. package/dist/components/2_feed_elements/AudioMessage/AudioMessage.vue2.js +181 -499
  114. package/dist/components/2_feed_elements/BaseEditMessage/BaseEditMessage.vue.js +19 -4
  115. package/dist/components/2_feed_elements/BaseEditMessage/BaseEditMessage.vue2.js +12 -22
  116. package/dist/components/2_feed_elements/BaseReplyMessage/BaseReplyMessage.vue.js +26 -4
  117. package/dist/components/2_feed_elements/BaseReplyMessage/BaseReplyMessage.vue2.js +26 -39
  118. package/dist/components/2_feed_elements/CallMessage/CallMessage.vue.js +482 -4
  119. package/dist/components/2_feed_elements/CallMessage/CallMessage.vue2.js +148 -448
  120. package/dist/components/2_feed_elements/CallMessage/icons/IncomingCallIcon.vue.js +17 -19
  121. package/dist/components/2_feed_elements/CallMessage/icons/IncomingCallIcon.vue2.js +13 -2
  122. package/dist/components/2_feed_elements/CallMessage/icons/OutgoingCallIcon.vue.js +17 -19
  123. package/dist/components/2_feed_elements/CallMessage/icons/OutgoingCallIcon.vue2.js +13 -2
  124. package/dist/components/2_feed_elements/DateMessage/DateMessage.vue.js +17 -4
  125. package/dist/components/2_feed_elements/DateMessage/DateMessage.vue2.js +7 -7
  126. package/dist/components/2_feed_elements/DateMessageSticky/DateMessageSticky.vue.js +16 -3
  127. package/dist/components/2_feed_elements/DateMessageSticky/DateMessageSticky.vue2.js +7 -7
  128. package/dist/components/2_feed_elements/DeletedMessageContent/DeletedMessageContent.vue.js +67 -4
  129. package/dist/components/2_feed_elements/DeletedMessageContent/DeletedMessageContent.vue2.js +11 -43
  130. package/dist/components/2_feed_elements/DelimiterMessage/DelimiterMessage.vue.js +47 -4
  131. package/dist/components/2_feed_elements/DelimiterMessage/DelimiterMessage.vue2.js +37 -46
  132. package/dist/components/2_feed_elements/EditTextMessage/EditTextMessage.vue.js +22 -4
  133. package/dist/components/2_feed_elements/EditTextMessage/EditTextMessage.vue2.js +8 -15
  134. package/dist/components/2_feed_elements/FeedKeyboard/FeedKeyboard.vue.js +43 -4
  135. package/dist/components/2_feed_elements/FeedKeyboard/FeedKeyboard.vue2.js +10 -25
  136. package/dist/components/2_feed_elements/FeedReplyQuote/FeedReplyQuote.vue.js +52 -4
  137. package/dist/components/2_feed_elements/FeedReplyQuote/FeedReplyQuote.vue2.js +16 -39
  138. package/dist/components/2_feed_elements/FileMessage/FileMessage.vue.js +270 -4
  139. package/dist/components/2_feed_elements/FileMessage/FileMessage.vue2.js +95 -274
  140. package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue.js +409 -4
  141. package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue2.js +143 -422
  142. package/dist/components/2_feed_elements/MessageKeyboard/MessageKeyboard.vue.js +39 -4
  143. package/dist/components/2_feed_elements/MessageKeyboard/MessageKeyboard.vue2.js +12 -22
  144. package/dist/components/2_feed_elements/MessageReactions/MessageReactions.vue.js +57 -4
  145. package/dist/components/2_feed_elements/MessageReactions/MessageReactions.vue2.js +41 -69
  146. package/dist/components/2_feed_elements/MessageReactions/MessageReactionsOverlay.vue.js +97 -4
  147. package/dist/components/2_feed_elements/MessageReactions/MessageReactionsOverlay.vue2.js +102 -173
  148. package/dist/components/2_feed_elements/MessageReactions/icons/DeleteIcon.vue.js +32 -20
  149. package/dist/components/2_feed_elements/MessageReactions/icons/EditIcon.vue.js +32 -20
  150. package/dist/components/2_feed_elements/MessageReactions/icons/ExpandReactionsIcon.vue.js +17 -11
  151. package/dist/components/2_feed_elements/MessageReactions/icons/MessageActionsIcon.vue.js +16 -10
  152. package/dist/components/2_feed_elements/MessageReactions/icons/ReplyIcon.vue.js +17 -11
  153. package/dist/components/2_feed_elements/MessageSmsInvite/MessageSmsInvite.vue.js +22 -4
  154. package/dist/components/2_feed_elements/MessageSmsInvite/MessageSmsInvite.vue2.js +17 -23
  155. package/dist/components/2_feed_elements/MessageStatusIndicator/MessageStatusIndicator.vue.js +28 -4
  156. package/dist/components/2_feed_elements/MessageStatusIndicator/MessageStatusIndicator.vue2.js +27 -29
  157. package/dist/components/2_feed_elements/MissedCallMessage/MissedCallMessage.vue.js +142 -4
  158. package/dist/components/2_feed_elements/MissedCallMessage/MissedCallMessage.vue2.js +33 -121
  159. package/dist/components/2_feed_elements/MissedCallMessage/icons/MissedCallIcon.vue.js +34 -22
  160. package/dist/components/2_feed_elements/ReplyAudioMessage/ReplyAudioMessage.vue.js +55 -4
  161. package/dist/components/2_feed_elements/ReplyAudioMessage/ReplyAudioMessage.vue2.js +8 -30
  162. package/dist/components/2_feed_elements/ReplyCallMessage/ReplyCallMessage.vue.js +47 -4
  163. package/dist/components/2_feed_elements/ReplyCallMessage/ReplyCallMessage.vue2.js +9 -25
  164. package/dist/components/2_feed_elements/ReplyFileMessage/ReplyFileMessage.vue.js +56 -4
  165. package/dist/components/2_feed_elements/ReplyFileMessage/ReplyFileMessage.vue2.js +8 -37
  166. package/dist/components/2_feed_elements/ReplyImageMessage/ReplyImageMessage.vue.js +72 -4
  167. package/dist/components/2_feed_elements/ReplyImageMessage/ReplyImageMessage.vue2.js +10 -59
  168. package/dist/components/2_feed_elements/ReplyStickerMessage/ReplyStickerMessage.vue.js +142 -4
  169. package/dist/components/2_feed_elements/ReplyStickerMessage/ReplyStickerMessage.vue2.js +34 -118
  170. package/dist/components/2_feed_elements/ReplyTextMessage/ReplyTextMessage.vue.js +49 -4
  171. package/dist/components/2_feed_elements/ReplyTextMessage/ReplyTextMessage.vue2.js +15 -53
  172. package/dist/components/2_feed_elements/ReplyVideoMessage/ReplyVideoMessage.vue.js +94 -4
  173. package/dist/components/2_feed_elements/ReplyVideoMessage/ReplyVideoMessage.vue2.js +10 -76
  174. package/dist/components/2_feed_elements/SplashScreen/SplashScreen.vue.js +18 -4
  175. package/dist/components/2_feed_elements/SplashScreen/SplashScreen.vue2.js +9 -17
  176. package/dist/components/2_feed_elements/StickerMessage/StickerMessage.vue.js +348 -4
  177. package/dist/components/2_feed_elements/StickerMessage/StickerMessage.vue2.js +97 -339
  178. package/dist/components/2_feed_elements/SystemMessage/SystemMessage.vue.js +17 -4
  179. package/dist/components/2_feed_elements/SystemMessage/SystemMessage.vue2.js +7 -7
  180. package/dist/components/2_feed_elements/TextMessage/TextMessage.vue.js +308 -4
  181. package/dist/components/2_feed_elements/TextMessage/TextMessage.vue2.js +89 -299
  182. package/dist/components/2_feed_elements/TypingMessage/TypingMessage.vue.js +37 -4
  183. package/dist/components/2_feed_elements/TypingMessage/TypingMessage.vue2.js +7 -21
  184. package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue.js +321 -4
  185. package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue2.js +96 -338
  186. package/dist/components/2_modals/ConfirmDeleteMessage/ConfirmDeleteMessage.vue.js +64 -4
  187. package/dist/components/2_modals/ConfirmDeleteMessage/ConfirmDeleteMessage.vue3.js +10 -45
  188. package/dist/components/2_modals/CreateChat/CreateChat.vue.js +36 -19
  189. package/dist/components/2_modals/CreateChat2/CreateChat2.vue.js +140 -92
  190. package/dist/components/2_modals/CreateDialog/CreateDialog.vue.js +96 -49
  191. package/dist/components/2_modals/Modal/Modal.vue.js +59 -50
  192. package/dist/components/2_modals/ModalFullscreen/ModalFullscreen.vue.js +51 -38
  193. package/dist/components/2_modals/ModalNoFooter/ModalNoFooter.vue.js +39 -30
  194. package/dist/components/2_modals/ModalVideoRecorder/ModalVideoRecorder.vue.js +155 -4
  195. package/dist/components/2_modals/ModalVideoRecorder/ModalVideoRecorder.vue2.js +49 -121
  196. package/dist/components/2_modals/SelectUser/SelectUser.vue.js +60 -43
  197. package/dist/components/2_modals/SelectUser2/SelectUser2.vue.js +41 -24
  198. package/dist/components/3_compounds/ChatInput/ChatInput.vue.js +170 -4
  199. package/dist/components/3_compounds/ChatInput/ChatInput.vue2.js +239 -336
  200. package/dist/components/3_compounds/ChatInput/icons/ArrowIcon.vue.js +43 -25
  201. package/dist/components/3_compounds/ChatInput/icons/SendIcon.vue.js +25 -21
  202. package/dist/components/3_compounds/ChatInput/icons/SendIcon.vue2.js +13 -2
  203. package/dist/components/3_compounds/ChatList/ChatList.vue.js +256 -166
  204. package/dist/components/3_compounds/ChatList/ChatListHeader.vue.js +57 -39
  205. package/dist/components/3_compounds/ChatList/icons/LogoIcon.vue.js +6 -6
  206. package/dist/components/3_compounds/Feed/Feed.vue.js +185 -4
  207. package/dist/components/3_compounds/Feed/Feed.vue2.js +161 -305
  208. package/dist/components/3_compounds/SideBar/SideBar.vue.js +279 -202
  209. package/dist/components/4_layouts/AdaptiveExtendedLayout/AdaptiveExtendedLayout.vue.js +43 -36
  210. package/dist/components/4_layouts/BaseLayout/BaseLayout.vue.js +5 -5
  211. package/dist/components/4_layouts/ChatWrapper/ChatWrapper.vue.js +32 -4
  212. package/dist/components/4_layouts/ChatWrapper/ChatWrapper.vue2.js +7 -29
  213. package/dist/components/4_layouts/ExtendedLayout/ExtendedLayout.vue.js +7 -7
  214. package/dist/components/4_layouts/FeedLayout/FeedLayout.vue.js +8 -8
  215. package/dist/components/5_containers/BaseContainer/BaseContainer.vue.js +33 -18
  216. package/dist/components/5_containers/FloatContainer/FloatContainer.vue.js +90 -59
  217. package/dist/types/src/apps/data/chats.d.ts +9 -2
  218. package/dist/types/src/components/2_chatlist_elements/ChatItem/stories/ChatItem.stories.d.ts +1 -0
  219. package/dist/types/src/components/2_chatlist_elements/ChatItem/types.d.ts +2 -0
  220. package/package.json +1 -1
  221. package/dist/components/2_feed_elements/DeletedMessageContent/icons/DeletedMessageIcon.vue.js +0 -21
  222. /package/dist/types/src/components/{2_feed_elements/DeletedMessageContent/icons → 1_icons}/DeletedMessageIcon.vue.d.ts +0 -0
@@ -1,33 +1,23 @@
1
- import { defineComponent as Ge, inject as Oe, watch as p, ref as b, computed as v, provide as Ue, nextTick as F, unref as r, onMounted as Ve, onUnmounted as Ye, createElementBlock as g, openBlock as h, normalizeClass as q, toDisplayString as N, Fragment as ie, createElementVNode as f, createVNode as z, createCommentVNode as V, renderList as Xe, createBlock as Je, renderSlot as oe, withDirectives as Qe, withKeys as Ze, vModelText as et } from "vue";
2
- import { useImmediateDebouncedRef as tt } from "../../../hooks/useImmediateDebouncedRef.js";
3
- import { MAX_ATTACHED_FILES as se, resolveMessageDraftStore as nt, useMessageDraft as lt, getDraftFiles as it } from "../../../hooks/useMessageDraft.js";
4
- import { useEmojiNative as ot } from "../../../hooks/useEmojiNative.js";
1
+ import { defineComponent as Pe, inject as _e, watch as d, ref as v, computed as p, provide as qe, nextTick as A, unref as ze, onMounted as je, onUnmounted as ke } from "vue";
2
+ import { useImmediateDebouncedRef as Ne } from "../../../hooks/useImmediateDebouncedRef.js";
3
+ import { MAX_ATTACHED_FILES as ue, resolveMessageDraftStore as Be, useMessageDraft as Oe, getDraftFiles as Ge } from "../../../hooks/useMessageDraft.js";
4
+ import { useEmojiNative as Ye } from "../../../hooks/useEmojiNative.js";
5
5
  /* empty css */
6
6
  /* empty css */
7
- import { t as m } from "../../../locale/useLocale.js";
7
+ import { t as y } from "../../../locale/useLocale.js";
8
8
  /* empty css */
9
9
  import "../../../node_modules/linkifyjs/dist/linkify.js";
10
10
  import "../../../node_modules/linkify-string/dist/linkify-string.js";
11
11
  import "../../../functions/parseMarkdown.js";
12
- import { textToAppleEmojiHtml as st, textContainsEmoji as at, previousGraphemeIndex as ae, nextGraphemeIndex as re, snapIndexToGrapheme as ce } from "../../../functions/renderAppleEmojis.js";
13
- import { useStartEdit as rt, hideEditPreview as ct } from "../../../hooks/messages/useStartEdit.js";
14
- import { canStartEditLastSent as ut, isEditableLastSentCandidate as dt } from "../../../hooks/messages/canStartEditLastSent.js";
15
- import { buildEditPayload as ft } from "../../../hooks/messages/buildEditPayload.js";
16
- import pt from "./icons/SendIcon.vue.js";
17
- import ue from "./icons/ArrowIcon.vue.js";
18
- import ht from "../../2_chatinput_elements/TextFormatToolbar/TextFormatToolbar.vue.js";
19
- import mt from "../../2_chatinput_elements/FilePreview/FilePreview.vue.js";
20
- const vt = {
21
- key: 0,
22
- class: "chat-input__disabled-placeholder",
23
- "data-testid": "chat-input-disabled-placeholder"
24
- }, gt = ["id"], yt = ["id"], St = { class: "chat-input__file-counter" }, _t = { class: "chat-input__file-chips-wrap" }, xt = ["aria-label"], bt = ["aria-label"], It = { class: "chat-input__inline-buttons" }, Ct = {
25
- key: 0,
26
- class: "chat-input__input chat-input__disabled-placeholder"
27
- }, Ft = {
28
- key: 1,
29
- class: "chat-input__input-wrap"
30
- }, Tt = ["innerHTML"], Et = ["disabled", "placeholder"], At = ["disabled"], wt = { class: "" }, Mt = { class: "chat-input__third-line" }, Y = 40, Jt = /* @__PURE__ */ Ge({
12
+ import { textToAppleEmojiHtml as Ue, textContainsEmoji as Ve, snapIndexToGrapheme as ce, previousGraphemeIndex as fe, nextGraphemeIndex as de } from "../../../functions/renderAppleEmojis.js";
13
+ import { useStartEdit as Xe, hideEditPreview as $e } from "../../../hooks/messages/useStartEdit.js";
14
+ import { canStartEditLastSent as Je, isEditableLastSentCandidate as Qe } from "../../../hooks/messages/canStartEditLastSent.js";
15
+ import { buildEditPayload as Ze } from "../../../hooks/messages/buildEditPayload.js";
16
+ import et from "./icons/SendIcon.vue.js";
17
+ import tt from "./icons/ArrowIcon.vue.js";
18
+ import nt from "../../2_chatinput_elements/TextFormatToolbar/TextFormatToolbar.vue.js";
19
+ import ot from "../../2_chatinput_elements/FilePreview/FilePreview.vue.js";
20
+ const K = 40, Tt = /* @__PURE__ */ Pe({
31
21
  __name: "ChatInput",
32
22
  props: {
33
23
  state: {
@@ -57,7 +47,7 @@ const vt = {
57
47
  maxAttachedFiles: {
58
48
  type: Number,
59
49
  required: !1,
60
- default: se
50
+ default: ue
61
51
  },
62
52
  resolveEditLastSentMessage: {
63
53
  type: Function,
@@ -66,45 +56,46 @@ const vt = {
66
56
  }
67
57
  },
68
58
  emits: ["send", "typing"],
69
- setup(M, { emit: de }) {
70
- const D = de, I = Oe("chatAppId"), fe = nt(I), { resetMessage: pe, getMessage: o, setMessageText: H, setForceSendMessage: he, resetEdit: me, removeMessageFile: ve } = lt(I), { startEdit: ge } = rt(I), { isNative: ye, emojiSrc: Se } = ot(I);
71
- let X = o().id;
72
- p(
73
- () => o().id,
59
+ setup(pe, { expose: me, emit: he }) {
60
+ me();
61
+ const w = he, E = _e("chatAppId"), G = Be(E), { resetMessage: Y, getMessage: l, setMessageText: b, setForceSendMessage: U, resetEdit: V, removeMessageFile: X } = Oe(E), { startEdit: $ } = Xe(E), { isNative: J, emojiSrc: Q } = Ye(E);
62
+ let H = l().id;
63
+ d(
64
+ () => l().id,
74
65
  (e) => {
75
- X = e;
66
+ H = e;
76
67
  }
77
68
  );
78
- const l = b(), T = b(), L = b(), E = b(null), R = b(!1), _e = tt("", 2e3), B = b(!1), j = b(!1);
79
- let y = null;
80
- const S = v(() => it(o()));
81
- function K() {
82
- const e = L.value;
69
+ const o = v(), T = v(), M = v(), S = v(null), F = v(!1), Z = Ne("", 2e3), P = v(!1), _ = v(!1);
70
+ let f = null;
71
+ const x = p(() => Ge(l()));
72
+ function W() {
73
+ const e = M.value;
83
74
  if (!e) {
84
- B.value = !1, j.value = !1;
75
+ P.value = !1, _.value = !1;
85
76
  return;
86
77
  }
87
78
  const t = e.scrollWidth - e.clientWidth;
88
- B.value = e.scrollLeft > 1, j.value = t - e.scrollLeft > 1;
79
+ P.value = e.scrollLeft > 1, _.value = t - e.scrollLeft > 1;
89
80
  }
90
- function xe(e) {
81
+ function ee(e) {
91
82
  const t = e.firstElementChild;
92
83
  if (!t) return e.clientWidth;
93
84
  const n = parseFloat(getComputedStyle(e).gap) || 8;
94
85
  return t.offsetWidth + n;
95
86
  }
96
- function J(e) {
97
- const t = L.value;
87
+ function ge(e) {
88
+ const t = M.value;
98
89
  if (!t) return;
99
- const n = xe(t);
90
+ const n = ee(t);
100
91
  t.scrollBy({ left: e === "right" ? n : -n, behavior: "smooth" });
101
92
  }
102
- function Q() {
103
- y == null || y.disconnect();
104
- const e = L.value;
105
- e && (y = new ResizeObserver(() => K()), y.observe(e));
93
+ function q() {
94
+ f == null || f.disconnect();
95
+ const e = M.value;
96
+ e && (f = new ResizeObserver(() => W()), f.observe(e));
106
97
  }
107
- function be(e) {
98
+ function ve(e) {
108
99
  return e.preview ?? {
109
100
  isImage: !1,
110
101
  isVideo: !1,
@@ -113,283 +104,283 @@ const vt = {
113
104
  fileSize: ""
114
105
  };
115
106
  }
116
- const Ie = v(
117
- () => st(o().text || "", E.value, Se.value)
118
- ), A = v(
119
- () => !ye.value && at(o().text || "")
120
- ), _ = () => {
121
- if (!T.value || !l.value) return;
122
- const e = l.value, t = T.value, n = Math.max(0, e.offsetWidth - e.clientWidth);
107
+ const ye = p(
108
+ () => Ue(l().text || "", S.value, Q.value)
109
+ ), L = p(
110
+ () => !J.value && Ve(l().text || "")
111
+ ), m = () => {
112
+ if (!T.value || !o.value) return;
113
+ const e = o.value, t = T.value, n = Math.max(0, e.offsetWidth - e.clientWidth);
123
114
  t.style.right = n > 0 ? `${n}px` : "", t.scrollTop = e.scrollTop;
124
115
  };
125
- let w = 0;
126
- function $() {
127
- E.value = null;
116
+ let h = 0;
117
+ function z() {
118
+ S.value = null;
128
119
  }
129
- function Ce(e = "nearest") {
130
- const t = l.value;
131
- if (!t || !A.value) return;
132
- const n = t.value, i = ce(n, t.selectionStart, e), a = ce(n, t.selectionEnd, e);
133
- (i !== t.selectionStart || a !== t.selectionEnd) && t.setSelectionRange(i, a);
120
+ function te(e = "nearest") {
121
+ const t = o.value;
122
+ if (!t || !L.value) return;
123
+ const n = t.value, s = ce(n, t.selectionStart, e), r = ce(n, t.selectionEnd, e);
124
+ (s !== t.selectionStart || r !== t.selectionEnd) && t.setSelectionRange(s, r);
134
125
  }
135
- function G() {
136
- Ce("nearest"), C();
126
+ function ne() {
127
+ te("nearest"), I();
137
128
  }
138
- function Fe(e) {
139
- var a, c, u;
140
- const t = o(), n = l.value;
141
- if (!ut({
129
+ function oe(e) {
130
+ var r, a, u;
131
+ const t = l(), n = o.value;
132
+ if (!Je({
142
133
  key: e.key,
143
134
  altKey: e.altKey,
144
135
  metaKey: e.metaKey,
145
136
  ctrlKey: e.ctrlKey,
146
137
  shiftKey: e.shiftKey,
147
- hasResolver: typeof s.resolveEditLastSentMessage == "function",
148
- disabled: s.state === "disabled",
138
+ hasResolver: typeof i.resolveEditLastSentMessage == "function",
139
+ disabled: i.state === "disabled",
149
140
  isRecording: t.isRecording,
150
141
  draftText: t.text ?? "",
151
- replyMessageId: (a = t.reply) == null ? void 0 : a.messageId,
152
- editMessageId: (c = t.edit) == null ? void 0 : c.messageId,
142
+ replyMessageId: (r = t.reply) == null ? void 0 : r.messageId,
143
+ editMessageId: (a = t.edit) == null ? void 0 : a.messageId,
153
144
  textareaText: (n == null ? void 0 : n.value) ?? t.text ?? "",
154
145
  selectionStart: (n == null ? void 0 : n.selectionStart) ?? 0
155
146
  })) return !1;
156
- const i = (u = s.resolveEditLastSentMessage) == null ? void 0 : u.call(s);
157
- return dt(i) ? (e.preventDefault(), ge(ft(i)), !0) : !1;
147
+ const s = (u = i.resolveEditLastSentMessage) == null ? void 0 : u.call(i);
148
+ return Qe(s) ? (e.preventDefault(), $(Ze(s)), !0) : !1;
158
149
  }
159
- function Te(e) {
160
- if (Fe(e) || !A.value || e.key !== "ArrowLeft" && e.key !== "ArrowRight" || e.altKey || e.metaKey || e.ctrlKey) return;
161
- const t = l.value;
150
+ function Se(e) {
151
+ if (oe(e) || !L.value || e.key !== "ArrowLeft" && e.key !== "ArrowRight" || e.altKey || e.metaKey || e.ctrlKey) return;
152
+ const t = o.value;
162
153
  if (!t) return;
163
- const n = t.value, i = t.selectionStart !== t.selectionEnd;
154
+ const n = t.value, s = t.selectionStart !== t.selectionEnd;
164
155
  if (e.shiftKey) {
165
- requestAnimationFrame(() => G());
156
+ requestAnimationFrame(() => ne());
166
157
  return;
167
158
  }
168
- if (i) {
159
+ if (s) {
169
160
  e.preventDefault();
170
- const u = e.key === "ArrowLeft" ? t.selectionStart : t.selectionEnd, x = e.key === "ArrowLeft" ? ae(n, u) : re(n, u);
171
- t.setSelectionRange(x, x), C();
161
+ const u = e.key === "ArrowLeft" ? t.selectionStart : t.selectionEnd, g = e.key === "ArrowLeft" ? fe(n, u) : de(n, u);
162
+ t.setSelectionRange(g, g), I();
172
163
  return;
173
164
  }
174
165
  e.preventDefault();
175
- const a = t.selectionStart, c = e.key === "ArrowLeft" ? ae(n, a) : re(n, a);
176
- t.setSelectionRange(c, c), C();
166
+ const r = t.selectionStart, a = e.key === "ArrowLeft" ? fe(n, r) : de(n, r);
167
+ t.setSelectionRange(a, a), I();
177
168
  }
178
- function C() {
179
- if (!A.value) {
180
- $();
169
+ function I() {
170
+ if (!L.value) {
171
+ z();
181
172
  return;
182
173
  }
183
- w && cancelAnimationFrame(w), w = requestAnimationFrame(() => {
184
- var c;
185
- w = 0;
186
- const e = l.value;
174
+ h && cancelAnimationFrame(h), h = requestAnimationFrame(() => {
175
+ var a;
176
+ h = 0;
177
+ const e = o.value;
187
178
  if (!e) {
188
- $();
179
+ z();
189
180
  return;
190
181
  }
191
182
  const t = e.selectionStart, n = e.selectionEnd;
192
183
  if (t === n) {
193
- E.value !== null && (E.value = null, F(_));
184
+ S.value !== null && (S.value = null, A(m));
194
185
  return;
195
186
  }
196
- const i = E.value;
197
- if (i && i.start === t && i.end === n) return;
198
- const a = ((c = T.value) == null ? void 0 : c.scrollTop) ?? 0;
199
- E.value = { start: t, end: n }, F(() => {
200
- T.value && (T.value.scrollTop = a), _();
187
+ const s = S.value;
188
+ if (s && s.start === t && s.end === n) return;
189
+ const r = ((a = T.value) == null ? void 0 : a.scrollTop) ?? 0;
190
+ S.value = { start: t, end: n }, A(() => {
191
+ T.value && (T.value.scrollTop = r), m();
201
192
  });
202
193
  });
203
194
  }
204
- function Ee(e) {
205
- e.buttons && C();
195
+ function xe(e) {
196
+ e.buttons && I();
206
197
  }
207
- function Z() {
208
- document.activeElement === l.value && C();
198
+ function j() {
199
+ document.activeElement === o.value && I();
209
200
  }
210
- const s = M, ee = v(
211
- () => s.state === "disabled" && !!s.disabledPlaceholder
212
- ), te = v(() => {
213
- const e = Number(s.maxAttachedFiles);
214
- return Number.isFinite(e) && e > 0 ? Math.floor(e) : se;
201
+ const i = pe, Ie = p(
202
+ () => i.state === "disabled" && !!i.disabledPlaceholder
203
+ ), k = p(() => {
204
+ const e = Number(i.maxAttachedFiles);
205
+ return Number.isFinite(e) && e > 0 ? Math.floor(e) : ue;
215
206
  });
216
- Ue("maxAttachedFiles", te);
217
- const Ae = v(
218
- () => m("component.ChatInput.FilesSelectedCount").replace("{count}", String(S.value.length)).replace("{max}", String(te.value))
219
- ), we = v(() => !!(s.state == "disabled" || o().text == "" && !S.value.length || o().isRecording)), Me = v(() => {
207
+ qe("maxAttachedFiles", k);
208
+ const Ae = p(
209
+ () => y("component.ChatInput.FilesSelectedCount").replace("{count}", String(x.value.length)).replace("{max}", String(k.value))
210
+ ), Ee = p(() => !!(i.state == "disabled" || l().text == "" && !x.value.length || l().isRecording)), Te = p(() => {
220
211
  var t;
221
- if (s.inputButtonColor)
222
- return s.inputButtonColor;
223
- if (!((t = s.selectedChannel) != null && t.channelId))
212
+ if (i.inputButtonColor)
213
+ return i.inputButtonColor;
214
+ if (!((t = i.selectedChannel) != null && t.channelId))
224
215
  return "#25D366";
225
- const e = s.selectedChannel.channelId.toLowerCase();
216
+ const e = i.selectedChannel.channelId.toLowerCase();
226
217
  return e.includes("whatsapp") || e.includes("waba") ? "#25D366" : e.includes("telegram") ? "#37AFE2" : e.includes("sms") ? "#6C757D" : e.includes("max") ? "#4B0082" : "#25D366";
227
- }), Le = v(() => {
218
+ }), Fe = p(() => {
228
219
  var t;
229
- if (!((t = s.selectedChannel) != null && t.channelId))
230
- return m("component.ChatInput.InputPlaceholder");
231
- const e = s.selectedChannel.channelId.toLowerCase();
232
- return e.includes("whatsapp") || e.includes("waba") ? m("component.ChatInput.WhatsappInputPlaceholder") : e.includes("telegram") ? m("component.ChatInput.TelegramInputPlaceholder") : e.includes("sms") ? m("component.ChatInput.SmsInputPlaceholder") : e.includes("max") ? m("component.ChatInput.MaxInputPlaceholder") : m("component.ChatInput.InputPlaceholder");
220
+ if (!((t = i.selectedChannel) != null && t.channelId))
221
+ return y("component.ChatInput.InputPlaceholder");
222
+ const e = i.selectedChannel.channelId.toLowerCase();
223
+ return e.includes("whatsapp") || e.includes("waba") ? y("component.ChatInput.WhatsappInputPlaceholder") : e.includes("telegram") ? y("component.ChatInput.TelegramInputPlaceholder") : e.includes("sms") ? y("component.ChatInput.SmsInputPlaceholder") : e.includes("max") ? y("component.ChatInput.MaxInputPlaceholder") : y("component.ChatInput.InputPlaceholder");
233
224
  });
234
- p(
235
- () => _e.value,
225
+ d(
226
+ () => Z.value,
236
227
  () => {
237
- D("typing");
228
+ w("typing");
238
229
  }
239
230
  );
240
- function ne(e = !1) {
241
- F(() => {
242
- if (e && !R.value) return;
243
- const t = l.value;
244
- t && (k(t), e && (R.value = !1), P(t), requestAnimationFrame(() => P(t)));
231
+ function N(e = !1) {
232
+ A(() => {
233
+ if (e && !F.value) return;
234
+ const t = o.value;
235
+ t && (C(t), e && (F.value = !1), D(t), requestAnimationFrame(() => D(t)));
245
236
  });
246
237
  }
247
- p(
248
- () => o().edit,
238
+ d(
239
+ () => l().edit,
249
240
  (e) => {
250
- (e == null ? void 0 : e.messageId) != null && (R.value = !0, ne(!0));
241
+ (e == null ? void 0 : e.messageId) != null && (F.value = !0, N(!0));
251
242
  }
252
- ), p(
253
- () => o().reply,
243
+ ), d(
244
+ () => l().reply,
254
245
  (e) => {
255
- (e == null ? void 0 : e.messageId) != null && ne();
246
+ (e == null ? void 0 : e.messageId) != null && N();
256
247
  }
257
- ), p(
258
- () => s.focusOnInputArea,
248
+ ), d(
249
+ () => i.focusOnInputArea,
259
250
  () => {
260
- s.focusOnInputArea && F(() => {
261
- const e = r(l);
251
+ i.focusOnInputArea && A(() => {
252
+ const e = ze(o);
262
253
  e == null || e.focus();
263
254
  });
264
255
  },
265
256
  { immediate: !0 }
266
- ), p(
267
- () => o().text,
257
+ ), d(
258
+ () => l().text,
268
259
  () => {
269
- const e = l.value;
270
- e && (k(e), R.value && (R.value = !1, P(e), requestAnimationFrame(() => P(e))));
260
+ const e = o.value;
261
+ e && (C(e), F.value && (F.value = !1, D(e), requestAnimationFrame(() => D(e))));
271
262
  },
272
263
  { immediate: !0, flush: "post" }
273
- ), p(
274
- () => o().id,
264
+ ), d(
265
+ () => l().id,
275
266
  () => {
276
- const e = l.value;
277
- e && (W(e), requestAnimationFrame(() => {
278
- const t = l.value;
279
- t && k(t);
267
+ const e = o.value;
268
+ e && (R(e), requestAnimationFrame(() => {
269
+ const t = o.value;
270
+ t && C(t);
280
271
  }));
281
272
  }
282
- ), p(A, (e) => {
283
- e && F(() => {
284
- const t = l.value;
273
+ ), d(L, (e) => {
274
+ e && A(() => {
275
+ const t = o.value;
285
276
  if (!t) return;
286
277
  const n = t.scrollTop;
287
- k(t), t.scrollTop = n, _(), requestAnimationFrame(_);
278
+ C(t), t.scrollTop = n, m(), requestAnimationFrame(m);
288
279
  });
289
280
  });
290
- function W(e) {
291
- const t = o().inputHeight;
292
- e.style.height = (t || Y) + "px", (!t || t <= Y) && (e.style.overflowY = "hidden");
281
+ function R(e) {
282
+ const t = l().inputHeight;
283
+ e.style.height = (t || K) + "px", (!t || t <= K) && (e.style.overflowY = "hidden");
293
284
  }
294
- function Re(e) {
285
+ function se(e) {
295
286
  const t = parseFloat(e.style.height);
296
- Number.isFinite(t) && (o().inputHeight = t);
287
+ Number.isFinite(t) && (l().inputHeight = t);
297
288
  }
298
- function k(e) {
299
- const t = o().text || "";
289
+ function C(e) {
290
+ const t = l().text || "";
300
291
  if (e.value !== t || e.clientWidth === 0) {
301
- W(e);
292
+ R(e);
302
293
  return;
303
294
  }
304
295
  const n = e.scrollTop;
305
296
  e.style.height = "auto";
306
- const i = getComputedStyle(e), a = parseFloat(i.fontSize) || 16, c = parseFloat(i.lineHeight) || a * 1.4, u = Y, x = c * 11, U = e.scrollHeight, qe = t.split(`
307
- `).length > 1, d = document.createElement("div");
308
- d.style.position = "absolute", d.style.visibility = "hidden", d.style.whiteSpace = "nowrap", d.style.font = i.font, d.style.fontSize = i.fontSize, d.style.fontFamily = i.fontFamily, d.style.fontWeight = i.fontWeight, d.style.letterSpacing = i.letterSpacing, d.textContent = t, document.body.appendChild(d);
309
- const Ne = d.offsetWidth;
310
- document.body.removeChild(d);
311
- const ze = parseFloat(i.paddingLeft) || 0, Be = parseFloat(i.paddingRight) || 0, je = e.clientWidth - ze - Be, $e = Ne > je, le = qe || $e;
312
- if (le && U <= u + 1) {
313
- W(e);
297
+ const s = getComputedStyle(e), r = parseFloat(s.fontSize) || 16, a = parseFloat(s.lineHeight) || r * 1.4, u = K, g = a * 11, O = e.scrollHeight, Le = t.split(`
298
+ `).length > 1, c = document.createElement("div");
299
+ c.style.position = "absolute", c.style.visibility = "hidden", c.style.whiteSpace = "nowrap", c.style.font = s.font, c.style.fontSize = s.fontSize, c.style.fontFamily = s.fontFamily, c.style.fontWeight = s.fontWeight, c.style.letterSpacing = s.letterSpacing, c.textContent = t, document.body.appendChild(c);
300
+ const Re = c.offsetWidth;
301
+ document.body.removeChild(c);
302
+ const De = parseFloat(s.paddingLeft) || 0, He = parseFloat(s.paddingRight) || 0, We = e.clientWidth - De - He, Ke = Re > We, ae = Le || Ke;
303
+ if (ae && O <= u + 1) {
304
+ R(e);
314
305
  return;
315
306
  }
316
- t.trim() && le ? U <= x ? (e.style.height = U + "px", e.style.overflowY = "hidden") : (e.style.height = x + "px", e.style.overflowY = "auto", e.scrollTop = n) : (e.style.height = u + "px", e.style.overflowY = "hidden"), Re(e), _(), requestAnimationFrame(_);
307
+ t.trim() && ae ? O <= g ? (e.style.height = O + "px", e.style.overflowY = "hidden") : (e.style.height = g + "px", e.style.overflowY = "auto", e.scrollTop = n) : (e.style.height = u + "px", e.style.overflowY = "hidden"), se(e), m(), requestAnimationFrame(m);
317
308
  }
318
- function P(e) {
319
- if (s.state === "disabled" || o().isRecording) return;
309
+ function D(e) {
310
+ if (i.state === "disabled" || l().isRecording) return;
320
311
  const t = e.value.length;
321
- e.focus(), e.setSelectionRange(t, t), e.scrollTop = e.scrollHeight, _();
312
+ e.focus(), e.setSelectionRange(t, t), e.scrollTop = e.scrollHeight, m();
322
313
  }
323
- p(
324
- () => o().forceSend,
314
+ d(
315
+ () => l().forceSend,
325
316
  () => {
326
- o().forceSend && (O(), he(!1));
317
+ l().forceSend && (B(), U(!1));
327
318
  }
328
319
  );
329
- const ke = (e) => {
320
+ const Ce = (e) => {
330
321
  const t = e.target;
331
- D("typing", t.value), C();
322
+ w("typing", t.value), I();
332
323
  };
333
- p(
334
- S,
324
+ d(
325
+ x,
335
326
  (e, t) => {
336
- F(() => {
337
- Q(), K();
338
- const n = L.value;
327
+ A(() => {
328
+ q(), W();
329
+ const n = M.value;
339
330
  n && e.length > ((t == null ? void 0 : t.length) ?? 0) && n.scrollTo({ left: n.scrollWidth, behavior: "smooth" });
340
331
  });
341
332
  },
342
333
  { flush: "post" }
343
- ), Ve(() => {
344
- const e = l.value;
345
- e && (W(e), k(e)), Q(), K(), document.addEventListener("selectionchange", Z);
346
- }), Ye(() => {
347
- fe.commitChatDraftToList(X), document.removeEventListener("selectionchange", Z), y == null || y.disconnect(), w && cancelAnimationFrame(w);
334
+ ), je(() => {
335
+ const e = o.value;
336
+ e && (R(e), C(e)), q(), W(), document.addEventListener("selectionchange", j);
337
+ }), ke(() => {
338
+ G.commitChatDraftToList(H), document.removeEventListener("selectionchange", j), f == null || f.disconnect(), h && cancelAnimationFrame(h);
348
339
  });
349
- const De = (e) => {
340
+ const we = (e) => {
350
341
  if (e.shiftKey) {
351
- if (l.value instanceof HTMLTextAreaElement) {
352
- let t = l.value.selectionStart;
353
- t && (l.value.setRangeText(`
354
- `, t, t, "end"), H(l.value.value));
342
+ if (o.value instanceof HTMLTextAreaElement) {
343
+ let t = o.value.selectionStart;
344
+ t && (o.value.setRangeText(`
345
+ `, t, t, "end"), b(o.value.value));
355
346
  }
356
347
  e.preventDefault();
357
348
  } else if (e.ctrlKey) {
358
- if (l.value instanceof HTMLTextAreaElement) {
359
- let t = l.value.selectionStart;
360
- t && (l.value.setRangeText(`
361
- `, t, t, "end"), H(l.value.value));
349
+ if (o.value instanceof HTMLTextAreaElement) {
350
+ let t = o.value.selectionStart;
351
+ t && (o.value.setRangeText(`
352
+ `, t, t, "end"), b(o.value.value));
362
353
  }
363
354
  e.preventDefault();
364
355
  } else
365
- e.preventDefault(), O();
366
- }, He = (e) => {
367
- if (l.value) {
368
- const t = l.value.value;
369
- l.value.value = e.newText;
370
- const n = e.newText.length - (t.length - (e.end - e.start)), i = e.start + n;
371
- H(e.newText), F(() => {
372
- l.value && (l.value.setSelectionRange(i, i), l.value.focus());
356
+ e.preventDefault(), B();
357
+ }, be = (e) => {
358
+ if (o.value) {
359
+ const t = o.value.value;
360
+ o.value.value = e.newText;
361
+ const n = e.newText.length - (t.length - (e.end - e.start)), s = e.start + n;
362
+ b(e.newText), A(() => {
363
+ o.value && (o.value.setSelectionRange(s, s), o.value.focus());
373
364
  });
374
365
  }
375
366
  };
376
- function Ke(e) {
377
- ve(e);
367
+ function Me(e) {
368
+ X(e);
378
369
  }
379
- function We() {
380
- me(), H(""), ct(I), l.value && l.value.focus();
370
+ function le() {
371
+ V(), b(""), $e(E), o.value && o.value.focus();
381
372
  }
382
- function Pe() {
383
- const e = o();
373
+ function ie() {
374
+ const e = l();
384
375
  return e.edit ? (e.text ?? "").trim() === (e.edit.text ?? "").trim() : !1;
385
376
  }
386
- const O = () => {
387
- const e = b(o());
388
- if (e.value.edit && Pe() && !S.value.length) {
389
- We();
377
+ const B = () => {
378
+ const e = v(l());
379
+ if (e.value.edit && ie() && !x.value.length) {
380
+ le();
390
381
  return;
391
382
  }
392
- if (e.value.text != "" || S.value.length) {
383
+ if (e.value.text != "" || x.value.length) {
393
384
  const t = {
394
385
  type: "",
395
386
  text: "",
@@ -397,134 +388,46 @@ const vt = {
397
388
  filename: "",
398
389
  size: "",
399
390
  reply: void 0
400
- }, n = S.value;
391
+ }, n = x.value;
401
392
  if (n.length) {
402
- const i = e.value.text.trim();
403
- n.forEach((a, c) => {
404
- var x;
393
+ const s = e.value.text.trim();
394
+ n.forEach((r, a) => {
395
+ var g;
405
396
  const u = {
406
- type: "message." + a.type,
407
- url: a.url,
408
- filename: a.name,
409
- size: (x = a.size) == null ? void 0 : x.toString(),
410
- text: c === 0 ? i : ""
397
+ type: "message." + r.type,
398
+ url: r.url,
399
+ filename: r.name,
400
+ size: (g = r.size) == null ? void 0 : g.toString(),
401
+ text: a === 0 ? s : ""
411
402
  };
412
- c === 0 && (e.value.reply && (u.reply = e.value.reply), e.value.edit && (u.edit = e.value.edit)), D("send", u);
403
+ a === 0 && (e.value.reply && (u.reply = e.value.reply), e.value.edit && (u.edit = e.value.edit)), w("send", u);
413
404
  });
414
405
  } else
415
- t.type = "message.text", t.text = e.value.text.trim(), e.value.reply && (t.reply = e.value.reply), e.value.edit && (t.edit = e.value.edit), D("send", t);
416
- pe(), l.value && l.value.focus();
406
+ t.type = "message.text", t.text = e.value.text.trim(), e.value.reply && (t.reply = e.value.reply), e.value.edit && (t.edit = e.value.edit), w("send", t);
407
+ Y(), o.value && o.value.focus();
417
408
  }
418
- };
419
- return (e, t) => (h(), g("div", {
420
- class: q(["chat-input__container", { "chat-input__container--disabled-notice": ee.value }]),
421
- "data-testid": "chat-input"
422
- }, [
423
- ee.value ? (h(), g("div", vt, N(M.disabledPlaceholder), 1)) : (h(), g(ie, { key: 1 }, [
424
- f("div", {
425
- id: "chat-input-reply-line-" + r(I),
426
- class: "chat-input__reply-line",
427
- "data-testid": "chat-input-reply-line"
428
- }, null, 8, gt),
429
- f("div", {
430
- id: "chat-input-file-line-" + r(I),
431
- class: q(["chat-input__file-line", { "chat-input__file-line--visible": S.value.length > 0 }])
432
- }, [
433
- f("span", St, [
434
- f("span", null, N(r(m)("component.ChatInput.FilesSelected")), 1),
435
- f("span", null, N(Ae.value), 1)
436
- ]),
437
- f("div", _t, [
438
- B.value ? (h(), g("button", {
439
- key: 0,
440
- type: "button",
441
- class: "chat-input__file-scroll chat-input__file-scroll--left",
442
- "aria-label": r(m)("component.ChatInput.FilesScrollLeft"),
443
- onClick: t[0] || (t[0] = (n) => J("left"))
444
- }, [
445
- z(r(ue))
446
- ], 8, xt)) : V("", !0),
447
- f("div", {
448
- ref_key: "refFileChips",
449
- ref: L,
450
- class: "chat-input__file-chips",
451
- onScroll: K
452
- }, [
453
- (h(!0), g(ie, null, Xe(S.value, (n, i) => (h(), Je(mt, {
454
- key: (n.url || n.name || "") + "-" + i,
455
- "file-info": be(n),
456
- onReset: (a) => Ke(i)
457
- }, null, 8, ["file-info", "onReset"]))), 128))
458
- ], 544),
459
- j.value ? (h(), g("button", {
460
- key: 1,
461
- type: "button",
462
- class: "chat-input__file-scroll chat-input__file-scroll--right",
463
- "aria-label": r(m)("component.ChatInput.FilesScrollRight"),
464
- onClick: t[1] || (t[1] = (n) => J("right"))
465
- }, [
466
- z(r(ue))
467
- ], 8, bt)) : V("", !0)
468
- ])
469
- ], 10, yt),
470
- f("div", It, [
471
- oe(e.$slots, "inline-buttons", {}, void 0, !0)
472
- ]),
473
- M.disabledPlaceholder && r(o)().isRecording ? (h(), g("div", Ct, N(M.disabledPlaceholder), 1)) : (h(), g("div", Ft, [
474
- A.value ? (h(), g("div", {
475
- key: 0,
476
- ref_key: "refMirror",
477
- ref: T,
478
- class: "chat-input__input-mirror",
479
- "aria-hidden": "true",
480
- innerHTML: Ie.value
481
- }, null, 8, Tt)) : V("", !0),
482
- Qe(f("textarea", {
483
- ref_key: "refInput",
484
- ref: l,
485
- "onUpdate:modelValue": t[2] || (t[2] = (n) => r(o)().text = n),
486
- rows: "1",
487
- "data-testid": "chat-input-textarea",
488
- disabled: M.state == "disabled" || r(o)().isRecording,
489
- class: q(["chat-input__input", { "chat-input__input--emoji-images": A.value }]),
490
- placeholder: Le.value,
491
- onKeydown: [
492
- Te,
493
- Ze(De, ["enter"])
494
- ],
495
- onInput: ke,
496
- onScroll: _,
497
- onSelect: C,
498
- onMouseup: G,
499
- onKeyup: G,
500
- onMousemove: Ee,
501
- onBlur: $
502
- }, null, 42, Et), [
503
- [et, r(o)().text]
504
- ])
505
- ])),
506
- z(ht, {
507
- textarea: l.value,
508
- onFormatApplied: He
509
- }, null, 8, ["textarea"]),
510
- f("button", {
511
- type: "button",
512
- class: q(["chat-input__button", { "chat-input__button-disabled": we.value }]),
513
- "data-testid": "chat-input-send",
514
- disabled: r(o)().isRecording,
515
- onClick: O
516
- }, [
517
- f("span", wt, [
518
- z(r(pt), { color: Me.value }, null, 8, ["color"])
519
- ])
520
- ], 10, At),
521
- f("div", Mt, [
522
- oe(e.$slots, "buttons", {}, void 0, !0)
523
- ])
524
- ], 64))
525
- ], 2));
409
+ }, re = { emit: w, chatAppId: E, messageDraftStore: G, resetMessage: Y, getMessage: l, setMessageText: b, setForceSendMessage: U, resetEdit: V, removeMessageFile: X, startEdit: $, isNative: J, emojiSrc: Q, get ownedDraftId() {
410
+ return H;
411
+ }, set ownedDraftId(e) {
412
+ H = e;
413
+ }, refInput: o, refMirror: T, refFileChips: M, selectionRange: S, focusAtEndAfterResize: F, typing: Z, canScrollLeft: P, canScrollRight: _, get fileChipsObserver() {
414
+ return f;
415
+ }, set fileChipsObserver(e) {
416
+ f = e;
417
+ }, attachedFiles: x, updateFileScrollState: W, getFileScrollStep: ee, scrollFiles: ge, setupFileChipsObserver: q, previewOf: ve, emojiMirrorHtml: ye, useEmojiMirror: L, syncMirrorScroll: m, get selectionSyncRaf() {
418
+ return h;
419
+ }, set selectionSyncRaf(e) {
420
+ h = e;
421
+ }, clearSelectionHighlight: z, snapTextareaCaret: te, snapCaretAndUpdateSelection: ne, tryStartEditLastSent: oe, onInputKeydown: Se, updateSelectionState: I, onInputMouseMove: xe, onDocumentSelectionChange: j, props: i, showDisabledNotice: Ie, maxAttachedFiles: k, filesSelectedCount: Ae, disabledSendButton: Ee, sendIconColor: Te, inputPlaceholder: Fe, scheduleInputFocusAtEnd: N, INPUT_MIN_HEIGHT: K, applySavedInputHeight: R, persistInputHeight: se, resizeTextarea: C, applyFocusAtEnd: D, sendTyping: Ce, keyEnter: we, handleFormatApplied: be, removeAttachedFile: Me, cancelEditMode: le, isEditTextUnchanged: ie, sendMessage: B, get t() {
422
+ return y;
423
+ }, get SendIcon() {
424
+ return et;
425
+ }, get ArrowIcon() {
426
+ return tt;
427
+ }, TextFormatToolbar: nt, FilePreview: ot };
428
+ return Object.defineProperty(re, "__isScriptSetup", { enumerable: !1, value: !0 }), re;
526
429
  }
527
430
  });
528
431
  export {
529
- Jt as default
432
+ Tt as default
530
433
  };