@phonghq/go-chat 1.0.4 → 1.0.6

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 (296) hide show
  1. package/dist/assets/icons/IconArrowLeft.vue.d.ts +2 -0
  2. package/dist/assets/icons/IconPhone.vue.d.ts +2 -0
  3. package/dist/assets/icons/IconPlan.vue.d.ts +2 -0
  4. package/dist/assets/icons/IconPlus.vue.d.ts +2 -0
  5. package/dist/assets/icons/IconSearch.vue.d.ts +32 -0
  6. package/dist/assets/icons/call/IconMic.vue.d.ts +14 -0
  7. package/dist/assets/icons/call/IconPhone.vue.d.ts +2 -0
  8. package/dist/assets/icons/call/IconPhoneCancel.vue.d.ts +2 -0
  9. package/dist/assets/icons/call/IconSpeaker.vue.d.ts +14 -0
  10. package/dist/assets/icons/customer-appointment/IconFilter.vue.d.ts +2 -0
  11. package/dist/assets/icons/customer-detail/IconArrow.vue.d.ts +2 -0
  12. package/dist/assets/icons/customer-detail/IconCheck.vue.d.ts +2 -0
  13. package/dist/assets/icons/customer-detail/IconDate.vue.d.ts +2 -0
  14. package/dist/assets/icons/customer-detail/IconGroup.vue.d.ts +2 -0
  15. package/dist/assets/icons/customer-detail/IconMessage.vue.d.ts +2 -0
  16. package/dist/assets/icons/customer-detail/IconNote.vue.d.ts +2 -0
  17. package/dist/assets/icons/customer-detail/IconPhone.vue.d.ts +2 -0
  18. package/dist/assets/icons/customer-detail/IconPin.vue.d.ts +2 -0
  19. package/dist/assets/icons/customer-detail/IconSearch.vue.d.ts +2 -0
  20. package/dist/chat/App.vue.d.ts +5 -0
  21. package/dist/chat/main.d.ts +6 -0
  22. package/dist/chat/page/customer-appointment/CustomerAppointment.vue.d.ts +2 -0
  23. package/dist/chat/page/customer-check-in/CollapseCheckIn.vue.d.ts +12 -0
  24. package/dist/chat/page/customer-check-in/CustomerCheckIn.vue.d.ts +2 -0
  25. package/dist/chat/page/customer-detail/CustomerDetail.vue.d.ts +7 -0
  26. package/dist/chat/page/customer-detail/SubInformation.vue.d.ts +16 -0
  27. package/dist/chat/page/error/Error.vue.d.ts +2 -0
  28. package/dist/chat/page/home/ChatList.vue.d.ts +20 -0
  29. package/dist/chat/page/home/ChatMessage.vue.d.ts +17 -0
  30. package/dist/chat/page/home/Home.vue.d.ts +14 -0
  31. package/dist/chat/page/home/HomeHeader.vue.d.ts +10 -0
  32. package/dist/chat/page/home/InputChat.vue.d.ts +19 -0
  33. package/dist/chat/page/home/NewCustomer.vue.d.ts +6 -0
  34. package/dist/components/ListenEvent.vue.d.ts +2 -0
  35. package/dist/components/chat/ScrollEvent/ScrollEvent.vue.d.ts +22 -0
  36. package/dist/components/chat/call/Calling.vue.d.ts +7 -0
  37. package/dist/components/chat/card/CardCustomerDetail.vue.d.ts +13 -0
  38. package/dist/components/chat/common/collapse/CollapseBase.vue.d.ts +20 -0
  39. package/dist/components/chat/common/input/InputSearch.vue.d.ts +16 -0
  40. package/dist/components/chat/common/popover/PopoverBase.vue.d.ts +35 -0
  41. package/dist/components/chat/common/spin/BaseSpin.vue.d.ts +2 -0
  42. package/dist/components/chat/customer/Avatar.vue.d.ts +12 -0
  43. package/dist/components/chat/layout/mobile/Footer.vue.d.ts +2 -0
  44. package/dist/components/common/CustomLoading.vue.d.ts +2 -0
  45. package/dist/components/common/Notification/NotificationDescription.vue.d.ts +7 -0
  46. package/dist/components/common/button/ButtonBase.vue.d.ts +22 -0
  47. package/dist/components/common/button/ButtonToggle.vue.d.ts +20 -0
  48. package/dist/components/common/checkbox/CCheckboxNumber.vue.d.ts +16 -0
  49. package/dist/components/common/collapse/BaseCollapse.vue.d.ts +12 -0
  50. package/dist/components/common/collapse/BaseCollapseItem.vue.d.ts +4 -0
  51. package/dist/components/common/drawer/DrawerBase.vue.d.ts +39 -0
  52. package/dist/components/common/dropdown/DropdownBase.vue.d.ts +21 -0
  53. package/dist/components/common/input/CInputSearch.vue.d.ts +14 -0
  54. package/dist/components/common/modal/ModalBase.vue.d.ts +35 -0
  55. package/dist/components/common/popover/PopoverBase.vue.d.ts +3 -0
  56. package/dist/components/common/slider/BaseSlider.vue.d.ts +11 -0
  57. package/dist/components/common/spin/CSpin.vue.d.ts +9 -0
  58. package/dist/components/common/tooltip/TooltipBase.vue.d.ts +2 -0
  59. package/dist/components/layout/Blank.vue.d.ts +9 -0
  60. package/dist/components/layout/Default.vue.d.ts +9 -0
  61. package/dist/components/modal/Confirm.vue.d.ts +2 -0
  62. package/dist/components/ui/button/CButton.vue.d.ts +19 -0
  63. package/dist/components/ui/button/c-button.d.ts +7 -0
  64. package/dist/components/ui/checkbox/Checkbox.vue.d.ts +18 -0
  65. package/dist/components/ui/checkbox/index.d.ts +1 -0
  66. package/dist/components/ui/collapsible/Collapsible.vue.d.ts +16 -0
  67. package/dist/components/ui/collapsible/CollapsibleContent.vue.d.ts +10 -0
  68. package/dist/components/ui/collapsible/CollapsibleTrigger.vue.d.ts +10 -0
  69. package/dist/components/ui/collapsible/index.d.ts +3 -0
  70. package/dist/components/ui/dialog/Dialog.vue.d.ts +14 -0
  71. package/dist/components/ui/dialog/DialogClose.vue.d.ts +10 -0
  72. package/dist/components/ui/dialog/DialogContent.vue.d.ts +29 -0
  73. package/dist/components/ui/dialog/DialogDescription.vue.d.ts +14 -0
  74. package/dist/components/ui/dialog/DialogFooter.vue.d.ts +13 -0
  75. package/dist/components/ui/dialog/DialogHeader.vue.d.ts +13 -0
  76. package/dist/components/ui/dialog/DialogScrollContent.vue.d.ts +30 -0
  77. package/dist/components/ui/dialog/DialogTitle.vue.d.ts +14 -0
  78. package/dist/components/ui/dialog/DialogTrigger.vue.d.ts +10 -0
  79. package/dist/components/ui/dialog/index.d.ts +9 -0
  80. package/dist/components/ui/drawer/Drawer.vue.d.ts +26 -0
  81. package/dist/components/ui/drawer/DrawerContent.vue.d.ts +33 -0
  82. package/dist/components/ui/drawer/DrawerDescription.vue.d.ts +14 -0
  83. package/dist/components/ui/drawer/DrawerFooter.vue.d.ts +13 -0
  84. package/dist/components/ui/drawer/DrawerHeader.vue.d.ts +13 -0
  85. package/dist/components/ui/drawer/DrawerOverlay.vue.d.ts +7 -0
  86. package/dist/components/ui/drawer/DrawerTitle.vue.d.ts +14 -0
  87. package/dist/components/ui/drawer/index.d.ts +8 -0
  88. package/dist/components/ui/dropdown-menu/DropdownMenu.vue.d.ts +14 -0
  89. package/dist/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue.d.ts +20 -0
  90. package/dist/components/ui/dropdown-menu/DropdownMenuContent.vue.d.ts +28 -0
  91. package/dist/components/ui/dropdown-menu/DropdownMenuGroup.vue.d.ts +10 -0
  92. package/dist/components/ui/dropdown-menu/DropdownMenuItem.vue.d.ts +15 -0
  93. package/dist/components/ui/dropdown-menu/DropdownMenuLabel.vue.d.ts +15 -0
  94. package/dist/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue.d.ts +14 -0
  95. package/dist/components/ui/dropdown-menu/DropdownMenuRadioItem.vue.d.ts +18 -0
  96. package/dist/components/ui/dropdown-menu/DropdownMenuSeparator.vue.d.ts +7 -0
  97. package/dist/components/ui/dropdown-menu/DropdownMenuShortcut.vue.d.ts +13 -0
  98. package/dist/components/ui/dropdown-menu/DropdownMenuSub.vue.d.ts +14 -0
  99. package/dist/components/ui/dropdown-menu/DropdownMenuSubContent.vue.d.ts +30 -0
  100. package/dist/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue.d.ts +14 -0
  101. package/dist/components/ui/dropdown-menu/DropdownMenuTrigger.vue.d.ts +10 -0
  102. package/dist/components/ui/dropdown-menu/index.d.ts +15 -0
  103. package/dist/components/ui/popover/Popover.vue.d.ts +14 -0
  104. package/dist/components/ui/popover/PopoverContent.vue.d.ts +28 -0
  105. package/dist/components/ui/popover/PopoverTrigger.vue.d.ts +10 -0
  106. package/dist/components/ui/popover/index.d.ts +3 -0
  107. package/dist/components/ui/radio-group/RadioGroup.vue.d.ts +18 -0
  108. package/dist/components/ui/radio-group/RadioGroupItem.vue.d.ts +7 -0
  109. package/dist/components/ui/radio-group/index.d.ts +2 -0
  110. package/dist/components/ui/slider/Slider.vue.d.ts +13 -0
  111. package/dist/components/ui/slider/index.d.ts +1 -0
  112. package/dist/components/ui/switch/Switch.vue.d.ts +18 -0
  113. package/dist/components/ui/switch/index.d.ts +1 -0
  114. package/dist/composable/useCallHelper.d.ts +23 -0
  115. package/dist/composable/useDigibot.d.ts +7 -0
  116. package/dist/composable/useInitData.d.ts +11 -0
  117. package/dist/composable/useModalConfirm.d.ts +5 -0
  118. package/dist/constant/color.d.ts +22 -0
  119. package/dist/constant/datetime.d.ts +5 -0
  120. package/dist/constant/general.d.ts +8 -0
  121. package/dist/constant/message.d.ts +8 -0
  122. package/dist/constant/mqtt.d.ts +4 -0
  123. package/dist/constant/user.d.ts +8 -0
  124. package/dist/lib/utils.d.ts +2 -0
  125. package/dist/plugins/axios-gci.d.ts +3 -0
  126. package/dist/plugins/axios.d.ts +3 -0
  127. package/dist/plugins/mqtt.d.ts +10 -0
  128. package/dist/plugins/sdk.d.ts +19 -0
  129. package/dist/plugins/websocket.d.ts +4 -0
  130. package/dist/style.css +1 -1
  131. package/dist/test/assets/icons/IconArrowLeft.vue.js +29 -0
  132. package/dist/test/assets/icons/IconPhone.vue.js +19 -0
  133. package/dist/test/assets/icons/IconPlan.vue.js +19 -0
  134. package/dist/test/assets/icons/IconPlus.vue.js +22 -0
  135. package/dist/test/assets/icons/IconSearch.vue.js +68 -0
  136. package/dist/test/assets/icons/call/IconMic.vue.js +123 -0
  137. package/dist/test/assets/icons/call/IconPhone.vue.js +35 -0
  138. package/dist/test/assets/icons/call/IconPhoneCancel.vue.js +35 -0
  139. package/dist/test/assets/icons/call/IconSpeaker.vue.js +62 -0
  140. package/dist/test/assets/icons/customer-appointment/IconFilter.vue.js +53 -0
  141. package/dist/test/assets/icons/customer-detail/IconArrow.vue.js +22 -0
  142. package/dist/test/assets/icons/customer-detail/IconCheck.vue.js +27 -0
  143. package/dist/test/assets/icons/customer-detail/IconDate.vue.js +43 -0
  144. package/dist/test/assets/icons/customer-detail/IconGroup.vue.js +48 -0
  145. package/dist/test/assets/icons/customer-detail/IconMessage.vue.js +28 -0
  146. package/dist/test/assets/icons/customer-detail/IconNote.vue.js +29 -0
  147. package/dist/test/assets/icons/customer-detail/IconPhone.vue.js +21 -0
  148. package/dist/test/assets/icons/customer-detail/IconPin.vue.js +29 -0
  149. package/dist/test/assets/icons/customer-detail/IconSearch.vue.js +29 -0
  150. package/dist/test/chat/App.vue.js +502 -0
  151. package/dist/test/chat/main.js +6 -0
  152. package/dist/test/chat/page/customer-appointment/CustomerAppointment.vue.js +207 -0
  153. package/dist/test/chat/page/customer-check-in/CollapseCheckIn.vue.js +80 -0
  154. package/dist/test/chat/page/customer-check-in/CustomerCheckIn.vue.js +136 -0
  155. package/dist/test/chat/page/customer-detail/CustomerDetail.vue.js +235 -0
  156. package/dist/test/chat/page/customer-detail/SubInformation.vue.js +102 -0
  157. package/dist/test/chat/page/error/Error.vue.js +64 -0
  158. package/dist/test/chat/page/home/ChatList.vue.js +387 -0
  159. package/dist/test/chat/page/home/ChatMessage.vue.js +295 -0
  160. package/dist/test/chat/page/home/Home.vue.js +332 -0
  161. package/dist/test/chat/page/home/HomeHeader.vue.js +127 -0
  162. package/dist/test/chat/page/home/InputChat.vue.js +255 -0
  163. package/dist/test/chat/page/home/NewCustomer.vue.js +84 -0
  164. package/dist/test/components/ListenEvent.vue.js +45 -0
  165. package/dist/test/components/chat/ScrollEvent/ScrollEvent.vue.js +197 -0
  166. package/dist/test/components/chat/call/Calling.vue.js +291 -0
  167. package/dist/test/components/chat/card/CardCustomerDetail.vue.js +28 -0
  168. package/dist/test/components/chat/common/collapse/CollapseBase.vue.js +59 -0
  169. package/dist/test/components/chat/common/input/InputSearch.vue.js +71 -0
  170. package/dist/test/components/chat/common/popover/PopoverBase.vue.js +148 -0
  171. package/dist/test/components/chat/common/spin/BaseSpin.vue.js +12 -0
  172. package/dist/test/components/chat/customer/Avatar.vue.js +101 -0
  173. package/dist/test/components/chat/layout/mobile/Footer.vue.js +109 -0
  174. package/dist/test/components/common/CustomLoading.vue.js +19 -0
  175. package/dist/test/components/common/Notification/NotificationDescription.vue.js +38 -0
  176. package/dist/test/components/common/button/ButtonBase.vue.js +78 -0
  177. package/dist/test/components/common/button/ButtonToggle.vue.js +70 -0
  178. package/dist/test/components/common/checkbox/CCheckboxNumber.vue.js +48 -0
  179. package/dist/test/components/common/collapse/BaseCollapse.vue.js +36 -0
  180. package/dist/test/components/common/collapse/BaseCollapseItem.vue.js +22 -0
  181. package/dist/test/components/common/drawer/DrawerBase.vue.js +126 -0
  182. package/dist/test/components/common/dropdown/DropdownBase.vue.js +91 -0
  183. package/dist/test/components/common/input/CInputSearch.vue.js +62 -0
  184. package/dist/test/components/common/modal/ModalBase.vue.js +164 -0
  185. package/dist/test/components/common/popover/PopoverBase.vue.js +36 -0
  186. package/dist/test/components/common/slider/BaseSlider.vue.js +70 -0
  187. package/dist/test/components/common/spin/CSpin.vue.js +41 -0
  188. package/dist/test/components/common/tooltip/TooltipBase.vue.js +8 -0
  189. package/dist/test/components/layout/Blank.vue.js +19 -0
  190. package/dist/test/components/layout/Default.vue.js +21 -0
  191. package/dist/test/components/modal/Confirm.vue.js +164 -0
  192. package/dist/test/components/ui/button/CButton.vue.js +49 -0
  193. package/dist/test/components/ui/button/c-button.js +26 -0
  194. package/dist/test/components/ui/checkbox/Checkbox.vue.js +79 -0
  195. package/dist/test/components/ui/checkbox/index.js +1 -0
  196. package/dist/test/components/ui/collapsible/Collapsible.vue.js +47 -0
  197. package/dist/test/components/ui/collapsible/CollapsibleContent.vue.js +41 -0
  198. package/dist/test/components/ui/collapsible/CollapsibleTrigger.vue.js +35 -0
  199. package/dist/test/components/ui/collapsible/index.js +3 -0
  200. package/dist/test/components/ui/dialog/Dialog.vue.js +42 -0
  201. package/dist/test/components/ui/dialog/DialogClose.vue.js +35 -0
  202. package/dist/test/components/ui/dialog/DialogContent.vue.js +84 -0
  203. package/dist/test/components/ui/dialog/DialogDescription.vue.js +43 -0
  204. package/dist/test/components/ui/dialog/DialogFooter.vue.js +26 -0
  205. package/dist/test/components/ui/dialog/DialogHeader.vue.js +26 -0
  206. package/dist/test/components/ui/dialog/DialogScrollContent.vue.js +99 -0
  207. package/dist/test/components/ui/dialog/DialogTitle.vue.js +43 -0
  208. package/dist/test/components/ui/dialog/DialogTrigger.vue.js +35 -0
  209. package/dist/test/components/ui/dialog/index.js +9 -0
  210. package/dist/test/components/ui/drawer/Drawer.vue.js +48 -0
  211. package/dist/test/components/ui/drawer/DrawerContent.vue.js +81 -0
  212. package/dist/test/components/ui/drawer/DrawerDescription.vue.js +42 -0
  213. package/dist/test/components/ui/drawer/DrawerFooter.vue.js +26 -0
  214. package/dist/test/components/ui/drawer/DrawerHeader.vue.js +26 -0
  215. package/dist/test/components/ui/drawer/DrawerOverlay.vue.js +37 -0
  216. package/dist/test/components/ui/drawer/DrawerTitle.vue.js +42 -0
  217. package/dist/test/components/ui/drawer/index.js +8 -0
  218. package/dist/test/components/ui/dropdown-menu/DropdownMenu.vue.js +41 -0
  219. package/dist/test/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue.js +79 -0
  220. package/dist/test/components/ui/dropdown-menu/DropdownMenuContent.vue.js +61 -0
  221. package/dist/test/components/ui/dropdown-menu/DropdownMenuGroup.vue.js +35 -0
  222. package/dist/test/components/ui/dropdown-menu/DropdownMenuItem.vue.js +43 -0
  223. package/dist/test/components/ui/dropdown-menu/DropdownMenuLabel.vue.js +43 -0
  224. package/dist/test/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue.js +41 -0
  225. package/dist/test/components/ui/dropdown-menu/DropdownMenuRadioItem.vue.js +80 -0
  226. package/dist/test/components/ui/dropdown-menu/DropdownMenuSeparator.vue.js +37 -0
  227. package/dist/test/components/ui/dropdown-menu/DropdownMenuShortcut.vue.js +26 -0
  228. package/dist/test/components/ui/dropdown-menu/DropdownMenuSub.vue.js +41 -0
  229. package/dist/test/components/ui/dropdown-menu/DropdownMenuSubContent.vue.js +46 -0
  230. package/dist/test/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue.js +58 -0
  231. package/dist/test/components/ui/dropdown-menu/DropdownMenuTrigger.vue.js +41 -0
  232. package/dist/test/components/ui/dropdown-menu/index.js +15 -0
  233. package/dist/test/components/ui/popover/Popover.vue.js +41 -0
  234. package/dist/test/components/ui/popover/PopoverContent.vue.js +60 -0
  235. package/dist/test/components/ui/popover/PopoverTrigger.vue.js +35 -0
  236. package/dist/test/components/ui/popover/index.js +3 -0
  237. package/dist/test/components/ui/radio-group/RadioGroup.vue.js +46 -0
  238. package/dist/test/components/ui/radio-group/RadioGroupItem.vue.js +71 -0
  239. package/dist/test/components/ui/radio-group/index.js +2 -0
  240. package/dist/test/components/ui/slider/Slider.vue.js +155 -0
  241. package/dist/test/components/ui/slider/index.js +1 -0
  242. package/dist/test/components/ui/switch/Switch.vue.js +61 -0
  243. package/dist/test/components/ui/switch/index.js +1 -0
  244. package/dist/test/composable/useCallHelper.js +170 -0
  245. package/dist/test/composable/useDigibot.js +22 -0
  246. package/dist/test/composable/useInitData.js +84 -0
  247. package/dist/test/composable/useModalConfirm.js +39 -0
  248. package/dist/test/constant/color.js +43 -0
  249. package/dist/test/constant/datetime.js +5 -0
  250. package/dist/test/constant/general.js +9 -0
  251. package/dist/test/constant/message.js +8 -0
  252. package/dist/test/constant/mqtt.js +11 -0
  253. package/dist/test/constant/user.js +9 -0
  254. package/dist/test/lib/utils.js +5 -0
  255. package/dist/test/plugins/axios-gci.js +25 -0
  256. package/dist/test/plugins/axios.js +85 -0
  257. package/dist/test/plugins/mqtt.js +128 -0
  258. package/dist/test/plugins/sdk.js +83 -0
  259. package/dist/test/plugins/websocket.js +65 -0
  260. package/dist/test/types/call.js +1 -0
  261. package/dist/test/types/chat/auth.js +1 -0
  262. package/dist/test/types/chat/global.js +1 -0
  263. package/dist/test/types/chat/promise.js +1 -0
  264. package/dist/test/types/chat/user.js +1 -0
  265. package/dist/test/types/conversation.js +1 -0
  266. package/dist/test/types/global.js +15 -0
  267. package/dist/test/types/message.js +1 -0
  268. package/dist/test/utils/chat/auth.js +51 -0
  269. package/dist/test/utils/chat/call.js +61 -0
  270. package/dist/test/utils/chat/chat-router.js +8 -0
  271. package/dist/test/utils/chat/conversation.js +7 -0
  272. package/dist/test/utils/chat/message.js +42 -0
  273. package/dist/test/utils/chat/user.js +33 -0
  274. package/dist/test/utils/debounce.js +9 -0
  275. package/dist/test/utils/json.js +18 -0
  276. package/dist/test/utils/logger.js +5 -0
  277. package/dist/test/utils/string-helper.js +27 -0
  278. package/dist/types/call.d.ts +4 -0
  279. package/dist/types/chat/auth.d.ts +37 -0
  280. package/dist/types/chat/global.d.ts +7 -0
  281. package/dist/types/chat/promise.d.ts +17 -0
  282. package/dist/types/chat/user.d.ts +88 -0
  283. package/dist/types/conversation.d.ts +18 -0
  284. package/dist/types/global.d.ts +11 -0
  285. package/dist/types/message.d.ts +43 -0
  286. package/dist/utils/chat/auth.d.ts +45 -0
  287. package/dist/utils/chat/call.d.ts +5 -0
  288. package/dist/utils/chat/chat-router.d.ts +3 -0
  289. package/dist/utils/chat/conversation.d.ts +3 -0
  290. package/dist/utils/chat/message.d.ts +17 -0
  291. package/dist/utils/chat/user.d.ts +193 -0
  292. package/dist/utils/debounce.d.ts +1 -0
  293. package/dist/utils/json.d.ts +2 -0
  294. package/dist/utils/logger.d.ts +3 -0
  295. package/dist/utils/string-helper.d.ts +1 -0
  296. package/package.json +1 -1
@@ -0,0 +1,295 @@
1
+ /// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
2
+ import Avatar from '../../../components/chat/customer/Avatar.vue';
3
+ import { dataProfile } from '../../../utils/chat/auth';
4
+ import { nextTick, ref } from 'vue';
5
+ import ScrollEvent from '../../../components/chat/ScrollEvent/ScrollEvent.vue';
6
+ import { MessageState } from '../../../constant/message';
7
+ import NewCustomer from '../../../chat/page/home/NewCustomer.vue';
8
+ const props = withDefaults(defineProps(), {});
9
+ const emit = defineEmits();
10
+ const scrollEventRef = ref(null);
11
+ const scrollBottom = () => {
12
+ nextTick(() => {
13
+ const eleIdContentChat = document.getElementById('content-chat');
14
+ if (eleIdContentChat) {
15
+ eleIdContentChat.scrollTop = eleIdContentChat.scrollHeight;
16
+ }
17
+ });
18
+ };
19
+ const shouldShowAvatar = (index) => {
20
+ if (index === 0)
21
+ return true;
22
+ return props.message[index - 1].sender_id !== props.message[index].sender_id;
23
+ };
24
+ const isEndMessage = (index) => {
25
+ if (props.message?.length == index + 1)
26
+ return true;
27
+ return props.message[index + 1].sender_id !== props.message[index].sender_id;
28
+ };
29
+ const handleScrollTop = () => {
30
+ emit('scrollTop');
31
+ };
32
+ const hideScrollEvent = () => {
33
+ scrollEventRef.value?.hideLoading();
34
+ scrollEventRef.value?.fixedScroll();
35
+ };
36
+ const getMessageStateText = (item) => {
37
+ const state = item.state;
38
+ switch (state) {
39
+ case MessageState.Sending:
40
+ return 'Sending...';
41
+ case MessageState.Uploading:
42
+ return 'Uploading...';
43
+ case MessageState.Sent:
44
+ return '';
45
+ case MessageState.Read:
46
+ return 'Seen';
47
+ case MessageState.Failed:
48
+ return item.error || 'Message failed';
49
+ default:
50
+ return '';
51
+ }
52
+ };
53
+ const __VLS_exposed = { scrollBottom, hideScrollEvent };
54
+ defineExpose(__VLS_exposed);
55
+ debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
56
+ const __VLS_defaults = {};
57
+ const __VLS_ctx = {
58
+ ...{},
59
+ ...{},
60
+ ...{},
61
+ ...{},
62
+ ...{},
63
+ };
64
+ let __VLS_elements;
65
+ let __VLS_components;
66
+ let __VLS_directives;
67
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
68
+ ...{ class: "relative overflow-hidden" },
69
+ });
70
+ /** @type {[typeof ScrollEvent, typeof ScrollEvent, ]} */ ;
71
+ // @ts-ignore
72
+ const __VLS_0 = __VLS_asFunctionalComponent(ScrollEvent, new ScrollEvent({
73
+ ...{ 'onGetDataTop': {} },
74
+ ...{ class: "bg-white h-full flex flex-col overflow-auto" },
75
+ id: "content-chat",
76
+ top: true,
77
+ ref: "scrollEventRef",
78
+ }));
79
+ const __VLS_1 = __VLS_0({
80
+ ...{ 'onGetDataTop': {} },
81
+ ...{ class: "bg-white h-full flex flex-col overflow-auto" },
82
+ id: "content-chat",
83
+ top: true,
84
+ ref: "scrollEventRef",
85
+ }, ...__VLS_functionalComponentArgsRest(__VLS_0));
86
+ let __VLS_3;
87
+ let __VLS_4;
88
+ const __VLS_5 = ({ getDataTop: {} },
89
+ { onGetDataTop: (__VLS_ctx.handleScrollTop) });
90
+ /** @type {typeof __VLS_ctx.scrollEventRef} */ ;
91
+ var __VLS_6 = {};
92
+ const { default: __VLS_8 } = __VLS_2.slots;
93
+ // @ts-ignore
94
+ [handleScrollTop, scrollEventRef,];
95
+ if (__VLS_ctx.showNewCustomer) {
96
+ // @ts-ignore
97
+ [showNewCustomer,];
98
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
99
+ ...{ class: "shrink-0 h-[500px]" },
100
+ });
101
+ /** @type {[typeof NewCustomer, ]} */ ;
102
+ // @ts-ignore
103
+ const __VLS_9 = __VLS_asFunctionalComponent(NewCustomer, new NewCustomer({
104
+ ...{ class: "h-full" },
105
+ data: (__VLS_ctx.data),
106
+ }));
107
+ const __VLS_10 = __VLS_9({
108
+ ...{ class: "h-full" },
109
+ data: (__VLS_ctx.data),
110
+ }, ...__VLS_functionalComponentArgsRest(__VLS_9));
111
+ // @ts-ignore
112
+ [data,];
113
+ }
114
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
115
+ ...{ class: "chat-padding-page" },
116
+ });
117
+ for (const [item, index] of __VLS_getVForSourceType((__VLS_ctx.message))) {
118
+ (item.id);
119
+ // @ts-ignore
120
+ [message,];
121
+ if (item.sender_id !== __VLS_ctx.dataProfile?.id) {
122
+ // @ts-ignore
123
+ [dataProfile,];
124
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
125
+ ...{ class: "flex items-end gap-2 mt-2" },
126
+ ...{ class: ({ 'mt-4': __VLS_ctx.shouldShowAvatar(index) }) },
127
+ });
128
+ // @ts-ignore
129
+ [shouldShowAvatar,];
130
+ if (item.state != __VLS_ctx.MessageState.Sending) {
131
+ // @ts-ignore
132
+ [MessageState,];
133
+ if (__VLS_ctx.shouldShowAvatar(index)) {
134
+ // @ts-ignore
135
+ [shouldShowAvatar,];
136
+ /** @type {[typeof Avatar, ]} */ ;
137
+ // @ts-ignore
138
+ const __VLS_13 = __VLS_asFunctionalComponent(Avatar, new Avatar({
139
+ src: (__VLS_ctx.data?.avatar ?? ''),
140
+ color: (__VLS_ctx.data?.color),
141
+ name: (__VLS_ctx.data?.username),
142
+ size: (__VLS_ctx.response == 'mobile' ? 'sm' : 'md'),
143
+ ...{ class: (__VLS_ctx.response == 'mobile' ? 'translate-y-[-2px]' : '') },
144
+ }));
145
+ const __VLS_14 = __VLS_13({
146
+ src: (__VLS_ctx.data?.avatar ?? ''),
147
+ color: (__VLS_ctx.data?.color),
148
+ name: (__VLS_ctx.data?.username),
149
+ size: (__VLS_ctx.response == 'mobile' ? 'sm' : 'md'),
150
+ ...{ class: (__VLS_ctx.response == 'mobile' ? 'translate-y-[-2px]' : '') },
151
+ }, ...__VLS_functionalComponentArgsRest(__VLS_13));
152
+ // @ts-ignore
153
+ [data, data, data, response, response,];
154
+ }
155
+ else {
156
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
157
+ ...{ class: (__VLS_ctx.response == 'mobile' ? 'w-8' : 'w-12') },
158
+ });
159
+ // @ts-ignore
160
+ [response,];
161
+ }
162
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
163
+ ...{ class: "bg-[#E4E4E4D4] text-chat-haze-600 px-3 py-2 rounded-2xl max-w-xs" },
164
+ ...{ class: ({
165
+ 'rounded-tl-none': !__VLS_ctx.shouldShowAvatar(index),
166
+ 'rounded-bl-none': !__VLS_ctx.isEndMessage(index)
167
+ }) },
168
+ });
169
+ // @ts-ignore
170
+ [shouldShowAvatar, isEndMessage,];
171
+ if (item.message) {
172
+ __VLS_asFunctionalElement(__VLS_elements.div)({
173
+ ...{ style: ({ wordBreak: 'break-word' }) },
174
+ });
175
+ __VLS_asFunctionalDirective(__VLS_directives.vHtml)(null, { ...__VLS_directiveBindingRestFields, value: (item.message) }, null, null);
176
+ }
177
+ else if (item.attachments.length) {
178
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({});
179
+ __VLS_asFunctionalElement(__VLS_elements.img)({
180
+ ...{ onLoad: (() => {
181
+ if (index == __VLS_ctx.message.length - 1) {
182
+ __VLS_ctx.scrollBottom();
183
+ }
184
+ }) },
185
+ src: (item.attachments[0]?.file_path),
186
+ alt: "avatar",
187
+ });
188
+ // @ts-ignore
189
+ [message, scrollBottom,];
190
+ }
191
+ }
192
+ }
193
+ else {
194
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
195
+ ...{ class: "flex flex-col items-end mt-2" },
196
+ ...{ class: ({ 'mt-4': __VLS_ctx.shouldShowAvatar(index) }) },
197
+ });
198
+ // @ts-ignore
199
+ [shouldShowAvatar,];
200
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
201
+ ...{ class: "bg-[#D0DFEC] text-[#266699] px-3 py-2 rounded-2xl max-w-xs" },
202
+ ...{ class: ({
203
+ 'rounded-tr-none': !__VLS_ctx.shouldShowAvatar(index),
204
+ 'rounded-br-none': !__VLS_ctx.isEndMessage(index)
205
+ }) },
206
+ });
207
+ // @ts-ignore
208
+ [shouldShowAvatar, isEndMessage,];
209
+ if (item.message) {
210
+ __VLS_asFunctionalElement(__VLS_elements.div)({
211
+ ...{ style: ({ wordBreak: 'break-word' }) },
212
+ });
213
+ __VLS_asFunctionalDirective(__VLS_directives.vHtml)(null, { ...__VLS_directiveBindingRestFields, value: (item.message) }, null, null);
214
+ }
215
+ else if (item?.attachments?.length) {
216
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({});
217
+ __VLS_asFunctionalElement(__VLS_elements.img)({
218
+ ...{ onLoad: (() => {
219
+ if (index == __VLS_ctx.message.length - 1) {
220
+ __VLS_ctx.scrollBottom();
221
+ }
222
+ }) },
223
+ src: (item.attachments[0]?.file_path),
224
+ alt: "avatar",
225
+ });
226
+ // @ts-ignore
227
+ [message, scrollBottom,];
228
+ }
229
+ if ((index == __VLS_ctx.message.length - 1 && __VLS_ctx.getMessageStateText(item)) ||
230
+ item.state == __VLS_ctx.MessageState.Failed) {
231
+ // @ts-ignore
232
+ [message, MessageState, getMessageStateText,];
233
+ __VLS_asFunctionalElement(__VLS_elements.span, __VLS_elements.span)({
234
+ ...{ class: "text-chat-haze-200 text-xs mt-1" },
235
+ ...{ class: ({ 'text-danger': item.state == __VLS_ctx.MessageState.Failed }) },
236
+ });
237
+ // @ts-ignore
238
+ [MessageState,];
239
+ (__VLS_ctx.getMessageStateText(item));
240
+ // @ts-ignore
241
+ [getMessageStateText,];
242
+ }
243
+ }
244
+ }
245
+ var __VLS_2;
246
+ /** @type {__VLS_StyleScopedClasses['relative']} */ ;
247
+ /** @type {__VLS_StyleScopedClasses['overflow-hidden']} */ ;
248
+ /** @type {__VLS_StyleScopedClasses['bg-white']} */ ;
249
+ /** @type {__VLS_StyleScopedClasses['h-full']} */ ;
250
+ /** @type {__VLS_StyleScopedClasses['flex']} */ ;
251
+ /** @type {__VLS_StyleScopedClasses['flex-col']} */ ;
252
+ /** @type {__VLS_StyleScopedClasses['overflow-auto']} */ ;
253
+ /** @type {__VLS_StyleScopedClasses['shrink-0']} */ ;
254
+ /** @type {__VLS_StyleScopedClasses['h-[500px]']} */ ;
255
+ /** @type {__VLS_StyleScopedClasses['h-full']} */ ;
256
+ /** @type {__VLS_StyleScopedClasses['chat-padding-page']} */ ;
257
+ /** @type {__VLS_StyleScopedClasses['flex']} */ ;
258
+ /** @type {__VLS_StyleScopedClasses['items-end']} */ ;
259
+ /** @type {__VLS_StyleScopedClasses['gap-2']} */ ;
260
+ /** @type {__VLS_StyleScopedClasses['mt-2']} */ ;
261
+ /** @type {__VLS_StyleScopedClasses['mt-4']} */ ;
262
+ /** @type {__VLS_StyleScopedClasses['bg-[#E4E4E4D4]']} */ ;
263
+ /** @type {__VLS_StyleScopedClasses['text-chat-haze-600']} */ ;
264
+ /** @type {__VLS_StyleScopedClasses['px-3']} */ ;
265
+ /** @type {__VLS_StyleScopedClasses['py-2']} */ ;
266
+ /** @type {__VLS_StyleScopedClasses['rounded-2xl']} */ ;
267
+ /** @type {__VLS_StyleScopedClasses['max-w-xs']} */ ;
268
+ /** @type {__VLS_StyleScopedClasses['rounded-tl-none']} */ ;
269
+ /** @type {__VLS_StyleScopedClasses['rounded-bl-none']} */ ;
270
+ /** @type {__VLS_StyleScopedClasses['flex']} */ ;
271
+ /** @type {__VLS_StyleScopedClasses['flex-col']} */ ;
272
+ /** @type {__VLS_StyleScopedClasses['items-end']} */ ;
273
+ /** @type {__VLS_StyleScopedClasses['mt-2']} */ ;
274
+ /** @type {__VLS_StyleScopedClasses['mt-4']} */ ;
275
+ /** @type {__VLS_StyleScopedClasses['bg-[#D0DFEC]']} */ ;
276
+ /** @type {__VLS_StyleScopedClasses['text-[#266699]']} */ ;
277
+ /** @type {__VLS_StyleScopedClasses['px-3']} */ ;
278
+ /** @type {__VLS_StyleScopedClasses['py-2']} */ ;
279
+ /** @type {__VLS_StyleScopedClasses['rounded-2xl']} */ ;
280
+ /** @type {__VLS_StyleScopedClasses['max-w-xs']} */ ;
281
+ /** @type {__VLS_StyleScopedClasses['rounded-tr-none']} */ ;
282
+ /** @type {__VLS_StyleScopedClasses['rounded-br-none']} */ ;
283
+ /** @type {__VLS_StyleScopedClasses['text-chat-haze-200']} */ ;
284
+ /** @type {__VLS_StyleScopedClasses['text-xs']} */ ;
285
+ /** @type {__VLS_StyleScopedClasses['mt-1']} */ ;
286
+ /** @type {__VLS_StyleScopedClasses['text-danger']} */ ;
287
+ // @ts-ignore
288
+ var __VLS_7 = __VLS_6;
289
+ const __VLS_export = (await import('vue')).defineComponent({
290
+ setup: () => (__VLS_exposed),
291
+ __typeEmits: {},
292
+ __typeProps: {},
293
+ props: {},
294
+ });
295
+ export default {};
@@ -0,0 +1,332 @@
1
+ /// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
2
+ import HomeHeader from '../../../chat/page/home/HomeHeader.vue';
3
+ import NewCustomer from '../../../chat/page/home/NewCustomer.vue';
4
+ import InputChat from '../../../chat/page/home/InputChat.vue';
5
+ import { getCountUnread, getDetailReceiver, getMessage, sendMessage, upLoadImage } from '../../../utils/chat/message';
6
+ import { nextTick, onMounted, onUnmounted, ref, shallowRef } from 'vue';
7
+ import ChatMessage from '../../../chat/page/home/ChatMessage.vue';
8
+ import { addHandleMqttMessage, connectMqtt, publishMessage, removeHandleMqttMessage, subscribeToTopic, unsubscribeFromTopic } from '../../../plugins/mqtt';
9
+ import { TOPIC_DETAIL_CHAT, TOPIC_HOME } from '../../../constant/mqtt';
10
+ import { dataProfile } from '../../../utils/chat/auth';
11
+ import dayjs from 'dayjs';
12
+ import { DATE_FORMATS } from '../../../constant/datetime';
13
+ import { MessageState } from '../../../constant/message';
14
+ const props = withDefaults(defineProps(), {});
15
+ const emit = defineEmits();
16
+ let page = 1;
17
+ let pageCount = 1;
18
+ let topic = '';
19
+ const isLoading = ref(false);
20
+ const infoUser = shallowRef(null);
21
+ const listMessage = ref([]);
22
+ const chatMessageRef = ref(null);
23
+ onMounted(() => {
24
+ });
25
+ onUnmounted(() => {
26
+ handleDisconnectMqtt();
27
+ });
28
+ const showNewCustomer = ref(false);
29
+ const handleConnectMqtt = async () => {
30
+ try {
31
+ await connectMqtt();
32
+ topic = TOPIC_DETAIL_CHAT + infoUser.value?.conversation_id;
33
+ subscribeToTopic(topic);
34
+ addHandleMqttMessage('chat-home', topic, mqttMessageHandler);
35
+ }
36
+ catch (error) {
37
+ console.error(error);
38
+ }
39
+ };
40
+ const handleDisconnectMqtt = async () => {
41
+ const topic = TOPIC_DETAIL_CHAT + infoUser.value?.conversation_id;
42
+ unsubscribeFromTopic(topic);
43
+ removeHandleMqttMessage('chat-home');
44
+ };
45
+ const mqttMessageHandler = (topic, message) => {
46
+ if (infoUser.value?.id && message?.sender_id?.toString() == infoUser.value?.id?.toString() || true) {
47
+ const index = listMessage.value.findIndex((item) => item.id === message?.id);
48
+ if (index < 0) {
49
+ listMessage.value.push(message);
50
+ }
51
+ else {
52
+ listMessage.value[index] = message;
53
+ }
54
+ chatMessageRef.value?.scrollBottom();
55
+ }
56
+ };
57
+ const handleGetMessage = async () => {
58
+ try {
59
+ const id = props.receiverId;
60
+ const params = { page: page, receiver_id: props.receiverId };
61
+ let res = await getMessage(params);
62
+ res.items = res.items.reverse();
63
+ page = res._meta?.currentPage || 1;
64
+ pageCount = res._meta?.pageCount || 1;
65
+ if (id == props.receiverId)
66
+ listMessage.value.unshift(...res.items);
67
+ }
68
+ catch (error) {
69
+ console.error(error);
70
+ }
71
+ };
72
+ const handleScrollTop = async () => {
73
+ if (page >= pageCount) {
74
+ chatMessageRef.value?.hideScrollEvent();
75
+ return;
76
+ }
77
+ page = page + 1;
78
+ await handleGetMessage();
79
+ chatMessageRef.value?.hideScrollEvent();
80
+ };
81
+ const handleGetDetailReceiver = async (data) => {
82
+ const id = props.receiverId;
83
+ if (data)
84
+ infoUser.value = data;
85
+ const res = (await getDetailReceiver(props.receiverId)) ?? null;
86
+ if (id == props.receiverId) {
87
+ infoUser.value = res;
88
+ await handleConnectMqtt();
89
+ }
90
+ };
91
+ const getData = async (data) => {
92
+ try {
93
+ isLoading.value = true;
94
+ listMessage.value = [];
95
+ await Promise.allSettled([handleGetMessage(), handleGetDetailReceiver(data)]);
96
+ // readMessages(infoUser.value?.conversation_id)
97
+ await nextTick();
98
+ chatMessageRef.value?.scrollBottom();
99
+ }
100
+ catch (error) {
101
+ console.error(error);
102
+ }
103
+ finally {
104
+ isLoading.value = false;
105
+ }
106
+ };
107
+ const updateMessageItem = (id, data) => {
108
+ const index = listMessage.value.findIndex((e) => e.id == id);
109
+ if (index > -1) {
110
+ const item = listMessage.value[index];
111
+ listMessage.value[index] = { ...item, ...data };
112
+ console.log({ ...item, ...data });
113
+ }
114
+ };
115
+ const handleSendMessage = async (data) => {
116
+ try {
117
+ listMessage.value.push({ ...data, state: MessageState.Sending });
118
+ publishMessage(topic, {
119
+ ...data,
120
+ state: MessageState.Sending
121
+ });
122
+ let file_upload = [];
123
+ if (data?.attachments?.length) {
124
+ updateMessageItem(data.id, { state: MessageState.Uploading });
125
+ file_upload = await handleUploadImage(data?.attachments[0].file_local);
126
+ }
127
+ updateMessageItem(data.id, { state: MessageState.Sending });
128
+ chatMessageRef.value?.scrollBottom();
129
+ const formData = new FormData();
130
+ formData.append('message', data.message ?? '');
131
+ formData.append('receiver_id', infoUser.value?.id ?? '');
132
+ if (file_upload.length) {
133
+ formData.append('url', file_upload[0]?.url ?? '');
134
+ }
135
+ await sendMessage(formData);
136
+ publishMessage(topic, {
137
+ ...data,
138
+ state: MessageState.Sent,
139
+ attachments: file_upload
140
+ ? [
141
+ {
142
+ file_name: data.attachments[0]?.file_name ?? '',
143
+ file_path: file_upload[0]?.url ?? ''
144
+ }
145
+ ]
146
+ : []
147
+ });
148
+ updateMessageItem(data.id, { state: MessageState.Sent });
149
+ publicTopicConversationUpdate(false, data?.message ?? '');
150
+ }
151
+ catch (error) {
152
+ updateMessageItem(data.id, {
153
+ state: MessageState.Failed,
154
+ error: typeof error?.message == 'string' ? error.message : ''
155
+ });
156
+ console.log(error.message);
157
+ }
158
+ };
159
+ const handleUploadImage = async (file) => {
160
+ if (file == null || file == undefined)
161
+ return [];
162
+ if (file.size > 1 * 1024 * 1024) {
163
+ throw new Error('File size exceeds limit');
164
+ }
165
+ const formData = new FormData();
166
+ formData.append('file', file);
167
+ const res = await upLoadImage(formData);
168
+ return res;
169
+ };
170
+ const publicTopicConversationUpdate = async (isSendImg, message) => {
171
+ const res = await getCountUnread({
172
+ conversation_id: infoUser.value?.conversation_id ?? 0,
173
+ receiver_id: Number(infoUser.value?.id)
174
+ });
175
+ const current = dayjs().format(DATE_FORMATS['DATE_FORMAT_FULL']);
176
+ const dataMessageForReceiver = {
177
+ id: infoUser.value?.conversation_id ?? 0,
178
+ receiver_id: Number(dataProfile.value?.id ?? 0),
179
+ username: dataProfile.value?.username ?? '',
180
+ customer_phone: dataProfile.value?.phone ?? '',
181
+ avatar: dataProfile.value?.avatar ?? '',
182
+ last_message: isSendImg ? `${infoUser.value?.username} sent images` : message,
183
+ last_message_time: current,
184
+ created_at: current,
185
+ updated_at: current,
186
+ unread_count: (res?.unread_count ?? 0) + 1,
187
+ status: 1,
188
+ color: dataProfile.value?.color ?? ''
189
+ };
190
+ publishMessage(`${TOPIC_HOME[0] + Number(infoUser.value?.id)}`, JSON.stringify(dataMessageForReceiver));
191
+ const dataMessageMyself = {
192
+ id: infoUser.value?.conversation_id ?? 0,
193
+ receiver_id: Number(dataProfile.value?.id ?? 0),
194
+ username: infoUser.value?.username ?? '',
195
+ customer_phone: infoUser.value?.phone ?? '',
196
+ avatar: infoUser.value?.avatar ?? '',
197
+ last_message: isSendImg ? `${infoUser.value?.username} sent images` : message,
198
+ last_message_time: current,
199
+ created_at: current,
200
+ updated_at: current,
201
+ unread_count: 0,
202
+ status: 1,
203
+ color: infoUser.value?.color
204
+ };
205
+ publishMessage(`${TOPIC_HOME[0] + Number(dataProfile.value?.id)}`, JSON.stringify(dataMessageMyself));
206
+ };
207
+ const call = () => {
208
+ if (infoUser.value) {
209
+ emit('call', infoUser.value);
210
+ }
211
+ };
212
+ const __VLS_exposed = { getData };
213
+ defineExpose(__VLS_exposed);
214
+ debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
215
+ const __VLS_defaults = {};
216
+ const __VLS_ctx = {
217
+ ...{},
218
+ ...{},
219
+ ...{},
220
+ ...{},
221
+ ...{},
222
+ };
223
+ let __VLS_elements;
224
+ let __VLS_components;
225
+ let __VLS_directives;
226
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
227
+ ...{ class: "h-full flex flex-col overflow-hidden" },
228
+ });
229
+ /** @type {[typeof HomeHeader, ]} */ ;
230
+ // @ts-ignore
231
+ const __VLS_0 = __VLS_asFunctionalComponent(HomeHeader, new HomeHeader({
232
+ ...{ 'onCall': {} },
233
+ ...{ class: "shrink-0" },
234
+ data: (__VLS_ctx.infoUser),
235
+ }));
236
+ const __VLS_1 = __VLS_0({
237
+ ...{ 'onCall': {} },
238
+ ...{ class: "shrink-0" },
239
+ data: (__VLS_ctx.infoUser),
240
+ }, ...__VLS_functionalComponentArgsRest(__VLS_0));
241
+ let __VLS_3;
242
+ let __VLS_4;
243
+ const __VLS_5 = ({ call: {} },
244
+ { onCall: (__VLS_ctx.call) });
245
+ // @ts-ignore
246
+ [infoUser, call,];
247
+ var __VLS_2;
248
+ if (__VLS_ctx.listMessage?.length) {
249
+ // @ts-ignore
250
+ [listMessage,];
251
+ /** @type {[typeof ChatMessage, ]} */ ;
252
+ // @ts-ignore
253
+ const __VLS_7 = __VLS_asFunctionalComponent(ChatMessage, new ChatMessage({
254
+ ...{ 'onScrollTop': {} },
255
+ ref: "chatMessageRef",
256
+ data: (__VLS_ctx.infoUser),
257
+ message: (__VLS_ctx.listMessage),
258
+ ...{ class: "grow" },
259
+ response: (__VLS_ctx.response),
260
+ showNewCustomer: (__VLS_ctx.page >= __VLS_ctx.pageCount),
261
+ }));
262
+ const __VLS_8 = __VLS_7({
263
+ ...{ 'onScrollTop': {} },
264
+ ref: "chatMessageRef",
265
+ data: (__VLS_ctx.infoUser),
266
+ message: (__VLS_ctx.listMessage),
267
+ ...{ class: "grow" },
268
+ response: (__VLS_ctx.response),
269
+ showNewCustomer: (__VLS_ctx.page >= __VLS_ctx.pageCount),
270
+ }, ...__VLS_functionalComponentArgsRest(__VLS_7));
271
+ let __VLS_10;
272
+ let __VLS_11;
273
+ const __VLS_12 = ({ scrollTop: {} },
274
+ { onScrollTop: (__VLS_ctx.handleScrollTop) });
275
+ /** @type {typeof __VLS_ctx.chatMessageRef} */ ;
276
+ var __VLS_13 = {};
277
+ // @ts-ignore
278
+ [infoUser, listMessage, response, page, pageCount, handleScrollTop, chatMessageRef,];
279
+ var __VLS_9;
280
+ }
281
+ else if (!__VLS_ctx.isLoading) {
282
+ // @ts-ignore
283
+ [isLoading,];
284
+ /** @type {[typeof NewCustomer, ]} */ ;
285
+ // @ts-ignore
286
+ const __VLS_16 = __VLS_asFunctionalComponent(NewCustomer, new NewCustomer({
287
+ data: (__VLS_ctx.infoUser),
288
+ ...{ class: "grow" },
289
+ }));
290
+ const __VLS_17 = __VLS_16({
291
+ data: (__VLS_ctx.infoUser),
292
+ ...{ class: "grow" },
293
+ }, ...__VLS_functionalComponentArgsRest(__VLS_16));
294
+ // @ts-ignore
295
+ [infoUser,];
296
+ }
297
+ /** @type {[typeof InputChat, ]} */ ;
298
+ // @ts-ignore
299
+ const __VLS_20 = __VLS_asFunctionalComponent(InputChat, new InputChat({
300
+ ...{ 'onSendMessage': {} },
301
+ data: (__VLS_ctx.infoUser),
302
+ ...{ class: "p-6" },
303
+ }));
304
+ const __VLS_21 = __VLS_20({
305
+ ...{ 'onSendMessage': {} },
306
+ data: (__VLS_ctx.infoUser),
307
+ ...{ class: "p-6" },
308
+ }, ...__VLS_functionalComponentArgsRest(__VLS_20));
309
+ let __VLS_23;
310
+ let __VLS_24;
311
+ const __VLS_25 = ({ sendMessage: {} },
312
+ { onSendMessage: (__VLS_ctx.handleSendMessage) });
313
+ // @ts-ignore
314
+ [infoUser, handleSendMessage,];
315
+ var __VLS_22;
316
+ /** @type {__VLS_StyleScopedClasses['h-full']} */ ;
317
+ /** @type {__VLS_StyleScopedClasses['flex']} */ ;
318
+ /** @type {__VLS_StyleScopedClasses['flex-col']} */ ;
319
+ /** @type {__VLS_StyleScopedClasses['overflow-hidden']} */ ;
320
+ /** @type {__VLS_StyleScopedClasses['shrink-0']} */ ;
321
+ /** @type {__VLS_StyleScopedClasses['grow']} */ ;
322
+ /** @type {__VLS_StyleScopedClasses['grow']} */ ;
323
+ /** @type {__VLS_StyleScopedClasses['p-6']} */ ;
324
+ // @ts-ignore
325
+ var __VLS_14 = __VLS_13;
326
+ const __VLS_export = (await import('vue')).defineComponent({
327
+ setup: () => (__VLS_exposed),
328
+ __typeEmits: {},
329
+ __typeProps: {},
330
+ props: {},
331
+ });
332
+ export default {};