@phonghq/go-chat 1.0.71 → 1.0.72

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 (388) hide show
  1. package/dist/go-chat.es.js +11162 -11147
  2. package/dist/go-chat.umd.js +21 -21
  3. package/dist/style.css +1 -1
  4. package/package.json +1 -1
  5. package/dist/assets/icons/call/IconClock.vue.d.ts +0 -2
  6. package/dist/assets/icons/call/IconClock.vue.js +0 -22
  7. package/dist/assets/icons/call/IconClose.vue.d.ts +0 -2
  8. package/dist/assets/icons/call/IconClose.vue.js +0 -26
  9. package/dist/assets/icons/call/IconMic.vue.d.ts +0 -14
  10. package/dist/assets/icons/call/IconMic.vue.js +0 -123
  11. package/dist/assets/icons/call/IconPhone.vue.d.ts +0 -2
  12. package/dist/assets/icons/call/IconPhone.vue.js +0 -22
  13. package/dist/assets/icons/call/IconPhoneBase.vue.d.ts +0 -2
  14. package/dist/assets/icons/call/IconPhoneBase.vue.js +0 -20
  15. package/dist/assets/icons/call/IconPhoneCancel.vue.d.ts +0 -14
  16. package/dist/assets/icons/call/IconPhoneCancel.vue.js +0 -46
  17. package/dist/assets/icons/call/IconSoundDownload.vue.d.ts +0 -2
  18. package/dist/assets/icons/call/IconSoundDownload.vue.js +0 -50
  19. package/dist/assets/icons/call/IconSpeaker.vue.d.ts +0 -14
  20. package/dist/assets/icons/call/IconSpeaker.vue.js +0 -62
  21. package/dist/assets/icons/customer-appointment/IconFilter.vue.d.ts +0 -2
  22. package/dist/assets/icons/customer-appointment/IconFilter.vue.js +0 -53
  23. package/dist/assets/icons/customer-detail/IconArrow.vue.d.ts +0 -2
  24. package/dist/assets/icons/customer-detail/IconArrow.vue.js +0 -22
  25. package/dist/assets/icons/customer-detail/IconCheck.vue.d.ts +0 -2
  26. package/dist/assets/icons/customer-detail/IconCheck.vue.js +0 -27
  27. package/dist/assets/icons/customer-detail/IconDate.vue.d.ts +0 -2
  28. package/dist/assets/icons/customer-detail/IconDate.vue.js +0 -43
  29. package/dist/assets/icons/customer-detail/IconGroup.vue.d.ts +0 -2
  30. package/dist/assets/icons/customer-detail/IconGroup.vue.js +0 -48
  31. package/dist/assets/icons/customer-detail/IconMessage.vue.d.ts +0 -2
  32. package/dist/assets/icons/customer-detail/IconMessage.vue.js +0 -28
  33. package/dist/assets/icons/customer-detail/IconNote.vue.d.ts +0 -2
  34. package/dist/assets/icons/customer-detail/IconNote.vue.js +0 -29
  35. package/dist/assets/icons/customer-detail/IconPhone.vue.d.ts +0 -14
  36. package/dist/assets/icons/customer-detail/IconPhone.vue.js +0 -41
  37. package/dist/assets/icons/customer-detail/IconPin.vue.d.ts +0 -2
  38. package/dist/assets/icons/customer-detail/IconPin.vue.js +0 -29
  39. package/dist/assets/icons/customer-detail/IconSearch.vue.d.ts +0 -2
  40. package/dist/assets/icons/customer-detail/IconSearch.vue.js +0 -29
  41. package/dist/assets/icons/global/IconAiCheck.vue.d.ts +0 -2
  42. package/dist/assets/icons/global/IconAiCheck.vue.js +0 -28
  43. package/dist/assets/icons/global/IconArrowLeft.vue.d.ts +0 -2
  44. package/dist/assets/icons/global/IconArrowLeft.vue.js +0 -29
  45. package/dist/assets/icons/global/IconBackspace.vue.d.ts +0 -2
  46. package/dist/assets/icons/global/IconBackspace.vue.js +0 -28
  47. package/dist/assets/icons/global/IconCloseCircle.vue.d.ts +0 -2
  48. package/dist/assets/icons/global/IconCloseCircle.vue.js +0 -36
  49. package/dist/assets/icons/global/IconPhone.vue.d.ts +0 -2
  50. package/dist/assets/icons/global/IconPhone.vue.js +0 -19
  51. package/dist/assets/icons/global/IconPlan.vue.d.ts +0 -14
  52. package/dist/assets/icons/global/IconPlan.vue.js +0 -39
  53. package/dist/assets/icons/global/IconPlus.vue.d.ts +0 -2
  54. package/dist/assets/icons/global/IconPlus.vue.js +0 -22
  55. package/dist/assets/icons/global/IconSearch.vue.d.ts +0 -32
  56. package/dist/assets/icons/global/IconSearch.vue.js +0 -68
  57. package/dist/assets/icons/global/IconSms.vue.d.ts +0 -2
  58. package/dist/assets/icons/global/IconSms.vue.js +0 -22
  59. package/dist/assets/icons/global/IconUser.vue.d.ts +0 -2
  60. package/dist/assets/icons/global/IconUser.vue.js +0 -25
  61. package/dist/chat/App.vue.d.ts +0 -21
  62. package/dist/chat/App.vue.js +0 -1020
  63. package/dist/chat/main.d.ts +0 -7
  64. package/dist/chat/main.js +0 -7
  65. package/dist/chat/page/customer-appointment/CustomerAppointment.vue.d.ts +0 -2
  66. package/dist/chat/page/customer-appointment/CustomerAppointment.vue.js +0 -207
  67. package/dist/chat/page/customer-check-in/CollapseCheckIn.vue.d.ts +0 -12
  68. package/dist/chat/page/customer-check-in/CollapseCheckIn.vue.js +0 -80
  69. package/dist/chat/page/customer-check-in/CustomerCheckIn.vue.d.ts +0 -2
  70. package/dist/chat/page/customer-check-in/CustomerCheckIn.vue.js +0 -138
  71. package/dist/chat/page/customer-detail/CustomerDetail.vue.d.ts +0 -7
  72. package/dist/chat/page/customer-detail/CustomerDetail.vue.js +0 -233
  73. package/dist/chat/page/customer-detail/SubInformation.vue.d.ts +0 -16
  74. package/dist/chat/page/customer-detail/SubInformation.vue.js +0 -102
  75. package/dist/chat/page/error/Error.vue.d.ts +0 -2
  76. package/dist/chat/page/error/Error.vue.js +0 -64
  77. package/dist/chat/page/home/ChatList.vue.d.ts +0 -98
  78. package/dist/chat/page/home/ChatList.vue.js +0 -621
  79. package/dist/chat/page/home/ChatMessage.vue.d.ts +0 -21
  80. package/dist/chat/page/home/ChatMessage.vue.js +0 -200
  81. package/dist/chat/page/home/ChatMessageItem.vue.d.ts +0 -19
  82. package/dist/chat/page/home/ChatMessageItem.vue.js +0 -358
  83. package/dist/chat/page/home/ChatMessageItem2.vue.d.ts +0 -19
  84. package/dist/chat/page/home/ChatMessageItem2.vue.js +0 -351
  85. package/dist/chat/page/home/DropZone.vue.d.ts +0 -13
  86. package/dist/chat/page/home/DropZone.vue.js +0 -130
  87. package/dist/chat/page/home/Home.vue.d.ts +0 -25
  88. package/dist/chat/page/home/Home.vue.js +0 -430
  89. package/dist/chat/page/home/HomeHeader.vue.d.ts +0 -14
  90. package/dist/chat/page/home/HomeHeader.vue.js +0 -248
  91. package/dist/chat/page/home/InputChat.vue.d.ts +0 -27
  92. package/dist/chat/page/home/InputChat.vue.js +0 -412
  93. package/dist/chat/page/home/NewCustomer.vue.d.ts +0 -7
  94. package/dist/chat/page/home/NewCustomer.vue.js +0 -81
  95. package/dist/chat/page/home/PhoneNumpad.vue.d.ts +0 -18
  96. package/dist/chat/page/home/PhoneNumpad.vue.js +0 -143
  97. package/dist/chat/page/setting/Setting.vue.d.ts +0 -2
  98. package/dist/chat/page/setting/Setting.vue.js +0 -277
  99. package/dist/chat/page/setting/SettingSuccess.vue.d.ts +0 -2
  100. package/dist/chat/page/setting/SettingSuccess.vue.js +0 -33
  101. package/dist/components/chat/ScrollEvent/ScrollEvent.vue.d.ts +0 -24
  102. package/dist/components/chat/ScrollEvent/ScrollEvent.vue.js +0 -207
  103. package/dist/components/chat/call/Calling.vue.d.ts +0 -17
  104. package/dist/components/chat/call/Calling.vue.js +0 -607
  105. package/dist/components/chat/call/TimeLeft.vue.d.ts +0 -5
  106. package/dist/components/chat/call/TimeLeft.vue.js +0 -59
  107. package/dist/components/chat/card/CardCustomerDetail.vue.d.ts +0 -13
  108. package/dist/components/chat/card/CardCustomerDetail.vue.js +0 -28
  109. package/dist/components/chat/common/collapse/CollapseBase.vue.d.ts +0 -20
  110. package/dist/components/chat/common/collapse/CollapseBase.vue.js +0 -59
  111. package/dist/components/chat/common/input/InputSearch.vue.d.ts +0 -16
  112. package/dist/components/chat/common/input/InputSearch.vue.js +0 -71
  113. package/dist/components/chat/common/modal/Modal.vue.d.ts +0 -94
  114. package/dist/components/chat/common/modal/Modal.vue.js +0 -260
  115. package/dist/components/chat/common/popover/PopoverBase.vue.d.ts +0 -35
  116. package/dist/components/chat/common/popover/PopoverBase.vue.js +0 -148
  117. package/dist/components/chat/common/spin/BaseSpin.vue.d.ts +0 -10
  118. package/dist/components/chat/common/spin/BaseSpin.vue.js +0 -43
  119. package/dist/components/chat/common/switch/SwitchBase.vue.d.ts +0 -17
  120. package/dist/components/chat/common/switch/SwitchBase.vue.js +0 -76
  121. package/dist/components/chat/common/tab/TabBase.vue.d.ts +0 -30
  122. package/dist/components/chat/common/tab/TabBase.vue.js +0 -86
  123. package/dist/components/chat/common/tabs/TabBase.vue.d.ts +0 -18
  124. package/dist/components/chat/common/tabs/TabBase.vue.js +0 -93
  125. package/dist/components/chat/customer/Avatar.vue.d.ts +0 -12
  126. package/dist/components/chat/customer/Avatar.vue.js +0 -127
  127. package/dist/components/chat/layout/mobile/Footer.vue.d.ts +0 -2
  128. package/dist/components/chat/layout/mobile/Footer.vue.js +0 -114
  129. package/dist/components/chat/select/SelectBase.vue.d.ts +0 -24
  130. package/dist/components/chat/select/SelectBase.vue.js +0 -105
  131. package/dist/components/common/CustomLoading.vue.d.ts +0 -2
  132. package/dist/components/common/CustomLoading.vue.js +0 -19
  133. package/dist/components/common/Notification/NotificationDescription.vue.d.ts +0 -7
  134. package/dist/components/common/Notification/NotificationDescription.vue.js +0 -38
  135. package/dist/components/common/button/ButtonBase.vue.d.ts +0 -22
  136. package/dist/components/common/button/ButtonBase.vue.js +0 -78
  137. package/dist/components/common/button/ButtonToggle.vue.d.ts +0 -20
  138. package/dist/components/common/button/ButtonToggle.vue.js +0 -70
  139. package/dist/components/common/checkbox/CCheckboxNumber.vue.d.ts +0 -16
  140. package/dist/components/common/checkbox/CCheckboxNumber.vue.js +0 -48
  141. package/dist/components/common/collapse/BaseCollapse.vue.d.ts +0 -12
  142. package/dist/components/common/collapse/BaseCollapse.vue.js +0 -36
  143. package/dist/components/common/collapse/BaseCollapseItem.vue.d.ts +0 -4
  144. package/dist/components/common/collapse/BaseCollapseItem.vue.js +0 -22
  145. package/dist/components/common/drawer/DrawerBase.vue.d.ts +0 -39
  146. package/dist/components/common/drawer/DrawerBase.vue.js +0 -126
  147. package/dist/components/common/drawer/DrawerBaseCustom.vue.d.ts +0 -33
  148. package/dist/components/common/drawer/DrawerBaseCustom.vue.js +0 -135
  149. package/dist/components/common/dropdown/DropdownBase.vue.d.ts +0 -21
  150. package/dist/components/common/dropdown/DropdownBase.vue.js +0 -91
  151. package/dist/components/common/input/CInputSearch.vue.d.ts +0 -14
  152. package/dist/components/common/input/CInputSearch.vue.js +0 -62
  153. package/dist/components/common/modal/ModalBase.vue.d.ts +0 -35
  154. package/dist/components/common/modal/ModalBase.vue.js +0 -187
  155. package/dist/components/common/popover/PopoverBase.vue.d.ts +0 -3
  156. package/dist/components/common/popover/PopoverBase.vue.js +0 -36
  157. package/dist/components/common/select/SelectBase.vue.d.ts +0 -28
  158. package/dist/components/common/select/SelectBase.vue.js +0 -102
  159. package/dist/components/common/slider/BaseSlider.vue.d.ts +0 -11
  160. package/dist/components/common/slider/BaseSlider.vue.js +0 -70
  161. package/dist/components/common/spin/CSpin.vue.d.ts +0 -9
  162. package/dist/components/common/spin/CSpin.vue.js +0 -41
  163. package/dist/components/common/tooltip/TooltipBase.vue.d.ts +0 -2
  164. package/dist/components/common/tooltip/TooltipBase.vue.js +0 -8
  165. package/dist/components/layout/PageError.vue.d.ts +0 -2
  166. package/dist/components/layout/PageError.vue.js +0 -91
  167. package/dist/components/ui/button/CButton.vue.d.ts +0 -19
  168. package/dist/components/ui/button/CButton.vue.js +0 -49
  169. package/dist/components/ui/button/c-button.d.ts +0 -7
  170. package/dist/components/ui/button/c-button.js +0 -26
  171. package/dist/components/ui/checkbox/Checkbox.vue.d.ts +0 -18
  172. package/dist/components/ui/checkbox/Checkbox.vue.js +0 -79
  173. package/dist/components/ui/checkbox/index.d.ts +0 -1
  174. package/dist/components/ui/checkbox/index.js +0 -1
  175. package/dist/components/ui/collapsible/Collapsible.vue.d.ts +0 -16
  176. package/dist/components/ui/collapsible/Collapsible.vue.js +0 -47
  177. package/dist/components/ui/collapsible/CollapsibleContent.vue.d.ts +0 -10
  178. package/dist/components/ui/collapsible/CollapsibleContent.vue.js +0 -41
  179. package/dist/components/ui/collapsible/CollapsibleTrigger.vue.d.ts +0 -10
  180. package/dist/components/ui/collapsible/CollapsibleTrigger.vue.js +0 -35
  181. package/dist/components/ui/collapsible/index.d.ts +0 -3
  182. package/dist/components/ui/collapsible/index.js +0 -3
  183. package/dist/components/ui/dialog/Dialog.vue.d.ts +0 -14
  184. package/dist/components/ui/dialog/Dialog.vue.js +0 -42
  185. package/dist/components/ui/dialog/DialogClose.vue.d.ts +0 -10
  186. package/dist/components/ui/dialog/DialogClose.vue.js +0 -35
  187. package/dist/components/ui/dialog/DialogContent.vue.d.ts +0 -29
  188. package/dist/components/ui/dialog/DialogContent.vue.js +0 -84
  189. package/dist/components/ui/dialog/DialogDescription.vue.d.ts +0 -14
  190. package/dist/components/ui/dialog/DialogDescription.vue.js +0 -43
  191. package/dist/components/ui/dialog/DialogFooter.vue.d.ts +0 -13
  192. package/dist/components/ui/dialog/DialogFooter.vue.js +0 -26
  193. package/dist/components/ui/dialog/DialogHeader.vue.d.ts +0 -13
  194. package/dist/components/ui/dialog/DialogHeader.vue.js +0 -26
  195. package/dist/components/ui/dialog/DialogScrollContent.vue.d.ts +0 -30
  196. package/dist/components/ui/dialog/DialogScrollContent.vue.js +0 -99
  197. package/dist/components/ui/dialog/DialogTitle.vue.d.ts +0 -14
  198. package/dist/components/ui/dialog/DialogTitle.vue.js +0 -43
  199. package/dist/components/ui/dialog/DialogTrigger.vue.d.ts +0 -10
  200. package/dist/components/ui/dialog/DialogTrigger.vue.js +0 -35
  201. package/dist/components/ui/dialog/index.d.ts +0 -9
  202. package/dist/components/ui/dialog/index.js +0 -9
  203. package/dist/components/ui/drawer/Drawer.vue.d.ts +0 -26
  204. package/dist/components/ui/drawer/Drawer.vue.js +0 -48
  205. package/dist/components/ui/drawer/DrawerContent.vue.d.ts +0 -33
  206. package/dist/components/ui/drawer/DrawerContent.vue.js +0 -81
  207. package/dist/components/ui/drawer/DrawerDescription.vue.d.ts +0 -14
  208. package/dist/components/ui/drawer/DrawerDescription.vue.js +0 -42
  209. package/dist/components/ui/drawer/DrawerFooter.vue.d.ts +0 -13
  210. package/dist/components/ui/drawer/DrawerFooter.vue.js +0 -26
  211. package/dist/components/ui/drawer/DrawerHeader.vue.d.ts +0 -13
  212. package/dist/components/ui/drawer/DrawerHeader.vue.js +0 -26
  213. package/dist/components/ui/drawer/DrawerOverlay.vue.d.ts +0 -7
  214. package/dist/components/ui/drawer/DrawerOverlay.vue.js +0 -37
  215. package/dist/components/ui/drawer/DrawerTitle.vue.d.ts +0 -14
  216. package/dist/components/ui/drawer/DrawerTitle.vue.js +0 -42
  217. package/dist/components/ui/drawer/index.d.ts +0 -8
  218. package/dist/components/ui/drawer/index.js +0 -8
  219. package/dist/components/ui/dropdown-menu/DropdownMenu.vue.d.ts +0 -14
  220. package/dist/components/ui/dropdown-menu/DropdownMenu.vue.js +0 -41
  221. package/dist/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue.d.ts +0 -20
  222. package/dist/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue.js +0 -79
  223. package/dist/components/ui/dropdown-menu/DropdownMenuContent.vue.d.ts +0 -28
  224. package/dist/components/ui/dropdown-menu/DropdownMenuContent.vue.js +0 -61
  225. package/dist/components/ui/dropdown-menu/DropdownMenuGroup.vue.d.ts +0 -10
  226. package/dist/components/ui/dropdown-menu/DropdownMenuGroup.vue.js +0 -35
  227. package/dist/components/ui/dropdown-menu/DropdownMenuItem.vue.d.ts +0 -15
  228. package/dist/components/ui/dropdown-menu/DropdownMenuItem.vue.js +0 -43
  229. package/dist/components/ui/dropdown-menu/DropdownMenuLabel.vue.d.ts +0 -15
  230. package/dist/components/ui/dropdown-menu/DropdownMenuLabel.vue.js +0 -43
  231. package/dist/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue.d.ts +0 -14
  232. package/dist/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue.js +0 -41
  233. package/dist/components/ui/dropdown-menu/DropdownMenuRadioItem.vue.d.ts +0 -18
  234. package/dist/components/ui/dropdown-menu/DropdownMenuRadioItem.vue.js +0 -80
  235. package/dist/components/ui/dropdown-menu/DropdownMenuSeparator.vue.d.ts +0 -7
  236. package/dist/components/ui/dropdown-menu/DropdownMenuSeparator.vue.js +0 -37
  237. package/dist/components/ui/dropdown-menu/DropdownMenuShortcut.vue.d.ts +0 -13
  238. package/dist/components/ui/dropdown-menu/DropdownMenuShortcut.vue.js +0 -26
  239. package/dist/components/ui/dropdown-menu/DropdownMenuSub.vue.d.ts +0 -14
  240. package/dist/components/ui/dropdown-menu/DropdownMenuSub.vue.js +0 -41
  241. package/dist/components/ui/dropdown-menu/DropdownMenuSubContent.vue.d.ts +0 -30
  242. package/dist/components/ui/dropdown-menu/DropdownMenuSubContent.vue.js +0 -46
  243. package/dist/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue.d.ts +0 -14
  244. package/dist/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue.js +0 -58
  245. package/dist/components/ui/dropdown-menu/DropdownMenuTrigger.vue.d.ts +0 -10
  246. package/dist/components/ui/dropdown-menu/DropdownMenuTrigger.vue.js +0 -41
  247. package/dist/components/ui/dropdown-menu/index.d.ts +0 -15
  248. package/dist/components/ui/dropdown-menu/index.js +0 -15
  249. package/dist/components/ui/popover/Popover.vue.d.ts +0 -14
  250. package/dist/components/ui/popover/Popover.vue.js +0 -41
  251. package/dist/components/ui/popover/PopoverContent.vue.d.ts +0 -28
  252. package/dist/components/ui/popover/PopoverContent.vue.js +0 -60
  253. package/dist/components/ui/popover/PopoverTrigger.vue.d.ts +0 -10
  254. package/dist/components/ui/popover/PopoverTrigger.vue.js +0 -35
  255. package/dist/components/ui/popover/index.d.ts +0 -3
  256. package/dist/components/ui/popover/index.js +0 -3
  257. package/dist/components/ui/radio-group/RadioGroup.vue.d.ts +0 -18
  258. package/dist/components/ui/radio-group/RadioGroup.vue.js +0 -46
  259. package/dist/components/ui/radio-group/RadioGroupItem.vue.d.ts +0 -7
  260. package/dist/components/ui/radio-group/RadioGroupItem.vue.js +0 -71
  261. package/dist/components/ui/radio-group/index.d.ts +0 -2
  262. package/dist/components/ui/radio-group/index.js +0 -2
  263. package/dist/components/ui/select/Select.vue.d.ts +0 -20
  264. package/dist/components/ui/select/Select.vue.js +0 -49
  265. package/dist/components/ui/select/SelectContent.vue.d.ts +0 -24
  266. package/dist/components/ui/select/SelectContent.vue.js +0 -98
  267. package/dist/components/ui/select/SelectGroup.vue.d.ts +0 -10
  268. package/dist/components/ui/select/SelectGroup.vue.js +0 -37
  269. package/dist/components/ui/select/SelectItem.vue.d.ts +0 -18
  270. package/dist/components/ui/select/SelectItem.vue.js +0 -73
  271. package/dist/components/ui/select/SelectItemText.vue.d.ts +0 -10
  272. package/dist/components/ui/select/SelectItemText.vue.js +0 -37
  273. package/dist/components/ui/select/SelectLabel.vue.d.ts +0 -14
  274. package/dist/components/ui/select/SelectLabel.vue.js +0 -40
  275. package/dist/components/ui/select/SelectScrollDownButton.vue.d.ts +0 -14
  276. package/dist/components/ui/select/SelectScrollDownButton.vue.js +0 -58
  277. package/dist/components/ui/select/SelectScrollUpButton.vue.d.ts +0 -14
  278. package/dist/components/ui/select/SelectScrollUpButton.vue.js +0 -58
  279. package/dist/components/ui/select/SelectSeparator.vue.d.ts +0 -7
  280. package/dist/components/ui/select/SelectSeparator.vue.js +0 -39
  281. package/dist/components/ui/select/SelectTrigger.vue.d.ts +0 -17
  282. package/dist/components/ui/select/SelectTrigger.vue.js +0 -49
  283. package/dist/components/ui/select/SelectValue.vue.d.ts +0 -10
  284. package/dist/components/ui/select/SelectValue.vue.js +0 -37
  285. package/dist/components/ui/select/index.d.ts +0 -11
  286. package/dist/components/ui/select/index.js +0 -11
  287. package/dist/components/ui/slider/Slider.vue.d.ts +0 -13
  288. package/dist/components/ui/slider/Slider.vue.js +0 -155
  289. package/dist/components/ui/slider/index.d.ts +0 -1
  290. package/dist/components/ui/slider/index.js +0 -1
  291. package/dist/components/ui/switch/Switch.vue.d.ts +0 -18
  292. package/dist/components/ui/switch/Switch.vue.js +0 -61
  293. package/dist/components/ui/switch/index.d.ts +0 -1
  294. package/dist/components/ui/switch/index.js +0 -1
  295. package/dist/components/ui/tabs/Tabs.vue.d.ts +0 -20
  296. package/dist/components/ui/tabs/Tabs.vue.js +0 -54
  297. package/dist/components/ui/tabs/TabsContent.vue.d.ts +0 -14
  298. package/dist/components/ui/tabs/TabsContent.vue.js +0 -44
  299. package/dist/components/ui/tabs/TabsList.vue.d.ts +0 -14
  300. package/dist/components/ui/tabs/TabsList.vue.js +0 -44
  301. package/dist/components/ui/tabs/TabsTrigger.vue.d.ts +0 -14
  302. package/dist/components/ui/tabs/TabsTrigger.vue.js +0 -45
  303. package/dist/components/ui/tabs/index.d.ts +0 -4
  304. package/dist/components/ui/tabs/index.js +0 -4
  305. package/dist/composable/useDigibot.d.ts +0 -7
  306. package/dist/composable/useDigibot.js +0 -23
  307. package/dist/composable/useInitData.d.ts +0 -12
  308. package/dist/composable/useInitData.js +0 -99
  309. package/dist/composable/useListConversations.d.ts +0 -55
  310. package/dist/composable/useListConversations.js +0 -209
  311. package/dist/composable/useListentEvent.d.ts +0 -5
  312. package/dist/composable/useListentEvent.js +0 -51
  313. package/dist/composable/usePlivo.d.ts +0 -17
  314. package/dist/composable/usePlivo.js +0 -207
  315. package/dist/constant/color.d.ts +0 -22
  316. package/dist/constant/color.js +0 -47
  317. package/dist/constant/datetime.d.ts +0 -6
  318. package/dist/constant/datetime.js +0 -6
  319. package/dist/constant/general.d.ts +0 -11
  320. package/dist/constant/general.js +0 -12
  321. package/dist/constant/message.d.ts +0 -8
  322. package/dist/constant/message.js +0 -8
  323. package/dist/constant/mqtt.d.ts +0 -7
  324. package/dist/constant/mqtt.js +0 -18
  325. package/dist/constant/user.d.ts +0 -8
  326. package/dist/constant/user.js +0 -9
  327. package/dist/lib/utils.d.ts +0 -2
  328. package/dist/lib/utils.js +0 -5
  329. package/dist/plugins/axios-gci.d.ts +0 -3
  330. package/dist/plugins/axios-gci.js +0 -25
  331. package/dist/plugins/axios.d.ts +0 -3
  332. package/dist/plugins/axios.js +0 -84
  333. package/dist/plugins/mqtt.d.ts +0 -8
  334. package/dist/plugins/mqtt.js +0 -189
  335. package/dist/plugins/pocketbase.d.ts +0 -5
  336. package/dist/plugins/pocketbase.js +0 -15
  337. package/dist/plugins/sdk.d.ts +0 -18
  338. package/dist/plugins/sdk.js +0 -73
  339. package/dist/plugins/websocket.d.ts +0 -15
  340. package/dist/plugins/websocket.js +0 -151
  341. package/dist/types/chat/auth.d.ts +0 -41
  342. package/dist/types/chat/auth.js +0 -1
  343. package/dist/types/chat/call.d.ts +0 -19
  344. package/dist/types/chat/call.js +0 -23
  345. package/dist/types/chat/global.d.ts +0 -32
  346. package/dist/types/chat/global.js +0 -1
  347. package/dist/types/chat/promise.d.ts +0 -17
  348. package/dist/types/chat/promise.js +0 -1
  349. package/dist/types/chat/user.d.ts +0 -88
  350. package/dist/types/chat/user.js +0 -1
  351. package/dist/types/conversation.d.ts +0 -23
  352. package/dist/types/conversation.js +0 -1
  353. package/dist/types/global.d.ts +0 -11
  354. package/dist/types/global.js +0 -15
  355. package/dist/types/message.d.ts +0 -52
  356. package/dist/types/message.js +0 -1
  357. package/dist/utils/chat/cache.d.ts +0 -7
  358. package/dist/utils/chat/cache.js +0 -63
  359. package/dist/utils/chat/chat-router.d.ts +0 -3
  360. package/dist/utils/chat/chat-router.js +0 -8
  361. package/dist/utils/chat/page-error.d.ts +0 -4
  362. package/dist/utils/chat/page-error.js +0 -25
  363. package/dist/utils/chat/phone-string.d.ts +0 -1
  364. package/dist/utils/chat/phone-string.js +0 -4
  365. package/dist/utils/chat/store/auth.d.ts +0 -62
  366. package/dist/utils/chat/store/auth.js +0 -93
  367. package/dist/utils/chat/store/call.d.ts +0 -15
  368. package/dist/utils/chat/store/call.js +0 -160
  369. package/dist/utils/chat/store/conversation.d.ts +0 -13
  370. package/dist/utils/chat/store/conversation.js +0 -69
  371. package/dist/utils/chat/store/message.d.ts +0 -31
  372. package/dist/utils/chat/store/message.js +0 -74
  373. package/dist/utils/chat/store/user.d.ts +0 -200
  374. package/dist/utils/chat/store/user.js +0 -43
  375. package/dist/utils/debounce.d.ts +0 -1
  376. package/dist/utils/debounce.js +0 -9
  377. package/dist/utils/json.d.ts +0 -2
  378. package/dist/utils/json.js +0 -18
  379. package/dist/utils/logger.d.ts +0 -3
  380. package/dist/utils/logger.js +0 -5
  381. package/dist/utils/string-helper.d.ts +0 -2
  382. package/dist/utils/string-helper.js +0 -40
  383. package/dist/views/NotTenantPhone.vue.d.ts +0 -9
  384. package/dist/views/NotTenantPhone.vue.js +0 -99
  385. package/dist/views/home/phone-numpad/ConvercationList.vue.d.ts +0 -18
  386. package/dist/views/home/phone-numpad/ConvercationList.vue.js +0 -174
  387. package/dist/views/home/phone-numpad/PhoneNumpad.vue.d.ts +0 -28
  388. package/dist/views/home/phone-numpad/PhoneNumpad.vue.js +0 -377
@@ -1,54 +0,0 @@
1
- /// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
2
- import { reactiveOmit } from "@vueuse/core";
3
- import { TabsRoot, useForwardPropsEmits } from "reka-ui";
4
- import { cn } from "../../../lib/utils";
5
- const props = defineProps();
6
- const emits = defineEmits();
7
- const delegatedProps = reactiveOmit(props, "class");
8
- const forwarded = useForwardPropsEmits(delegatedProps, emits);
9
- debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
10
- const __VLS_ctx = {
11
- ...{},
12
- ...{},
13
- ...{},
14
- ...{},
15
- ...{},
16
- };
17
- let __VLS_elements;
18
- let __VLS_components;
19
- let __VLS_directives;
20
- const __VLS_0 = {}.TabsRoot;
21
- /** @type {[typeof __VLS_components.TabsRoot, typeof __VLS_components.TabsRoot, ]} */ ;
22
- // @ts-ignore
23
- TabsRoot;
24
- // @ts-ignore
25
- const __VLS_1 = __VLS_asFunctionalComponent(__VLS_0, new __VLS_0({
26
- dataSlot: "tabs",
27
- ...(__VLS_ctx.forwarded),
28
- ...{ class: (__VLS_ctx.cn('flex flex-col gap-2', props.class)) },
29
- }));
30
- const __VLS_2 = __VLS_1({
31
- dataSlot: "tabs",
32
- ...(__VLS_ctx.forwarded),
33
- ...{ class: (__VLS_ctx.cn('flex flex-col gap-2', props.class)) },
34
- }, ...__VLS_functionalComponentArgsRest(__VLS_1));
35
- var __VLS_4 = {};
36
- {
37
- const { default: __VLS_5 } = __VLS_3.slots;
38
- const [slotProps] = __VLS_getSlotParameters(__VLS_5);
39
- // @ts-ignore
40
- [forwarded, cn,];
41
- var __VLS_6 = {
42
- ...(slotProps),
43
- };
44
- __VLS_3.slots['' /* empty slot name completion */];
45
- }
46
- var __VLS_3;
47
- // @ts-ignore
48
- var __VLS_7 = __VLS_6;
49
- const __VLS_base = (await import('vue')).defineComponent({
50
- __typeEmits: {},
51
- __typeProps: {},
52
- });
53
- const __VLS_export = {};
54
- export default {};
@@ -1,14 +0,0 @@
1
- import type { TabsContentProps } from "reka-ui";
2
- import type { HTMLAttributes } from "vue";
3
- type __VLS_Props = TabsContentProps & {
4
- class?: HTMLAttributes["class"];
5
- };
6
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
7
- default?: ((props: {}) => any) | undefined;
8
- }>;
9
- export default _default;
10
- type __VLS_WithSlots<T, S> = T & {
11
- new (): {
12
- $slots: S;
13
- };
14
- };
@@ -1,44 +0,0 @@
1
- /// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
2
- import { reactiveOmit } from "@vueuse/core";
3
- import { TabsContent } from "reka-ui";
4
- import { cn } from "../../../lib/utils";
5
- const props = defineProps();
6
- const delegatedProps = reactiveOmit(props, "class");
7
- debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
8
- const __VLS_ctx = {
9
- ...{},
10
- ...{},
11
- ...{},
12
- ...{},
13
- };
14
- let __VLS_elements;
15
- let __VLS_components;
16
- let __VLS_directives;
17
- const __VLS_0 = {}.TabsContent;
18
- /** @type {[typeof __VLS_components.TabsContent, typeof __VLS_components.TabsContent, ]} */ ;
19
- // @ts-ignore
20
- TabsContent;
21
- // @ts-ignore
22
- const __VLS_1 = __VLS_asFunctionalComponent(__VLS_0, new __VLS_0({
23
- dataSlot: "tabs-content",
24
- ...{ class: (__VLS_ctx.cn('flex-1 outline-none', props.class)) },
25
- ...(__VLS_ctx.delegatedProps),
26
- }));
27
- const __VLS_2 = __VLS_1({
28
- dataSlot: "tabs-content",
29
- ...{ class: (__VLS_ctx.cn('flex-1 outline-none', props.class)) },
30
- ...(__VLS_ctx.delegatedProps),
31
- }, ...__VLS_functionalComponentArgsRest(__VLS_1));
32
- var __VLS_4 = {};
33
- const { default: __VLS_5 } = __VLS_3.slots;
34
- // @ts-ignore
35
- [cn, delegatedProps,];
36
- var __VLS_6 = {};
37
- var __VLS_3;
38
- // @ts-ignore
39
- var __VLS_7 = __VLS_6;
40
- const __VLS_base = (await import('vue')).defineComponent({
41
- __typeProps: {},
42
- });
43
- const __VLS_export = {};
44
- export default {};
@@ -1,14 +0,0 @@
1
- import type { TabsListProps } from "reka-ui";
2
- import type { HTMLAttributes } from "vue";
3
- type __VLS_Props = TabsListProps & {
4
- class?: HTMLAttributes["class"];
5
- };
6
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
7
- default?: ((props: {}) => any) | undefined;
8
- }>;
9
- export default _default;
10
- type __VLS_WithSlots<T, S> = T & {
11
- new (): {
12
- $slots: S;
13
- };
14
- };
@@ -1,44 +0,0 @@
1
- /// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
2
- import { reactiveOmit } from "@vueuse/core";
3
- import { TabsList } from "reka-ui";
4
- import { cn } from "../../../lib/utils";
5
- const props = defineProps();
6
- const delegatedProps = reactiveOmit(props, "class");
7
- debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
8
- const __VLS_ctx = {
9
- ...{},
10
- ...{},
11
- ...{},
12
- ...{},
13
- };
14
- let __VLS_elements;
15
- let __VLS_components;
16
- let __VLS_directives;
17
- const __VLS_0 = {}.TabsList;
18
- /** @type {[typeof __VLS_components.TabsList, typeof __VLS_components.TabsList, ]} */ ;
19
- // @ts-ignore
20
- TabsList;
21
- // @ts-ignore
22
- const __VLS_1 = __VLS_asFunctionalComponent(__VLS_0, new __VLS_0({
23
- dataSlot: "tabs-list",
24
- ...(__VLS_ctx.delegatedProps),
25
- ...{ class: (__VLS_ctx.cn('bg-chat-haze-200 inline-flex w-fit items-center justify-center rounded-xl p-[3px]', props.class)) },
26
- }));
27
- const __VLS_2 = __VLS_1({
28
- dataSlot: "tabs-list",
29
- ...(__VLS_ctx.delegatedProps),
30
- ...{ class: (__VLS_ctx.cn('bg-chat-haze-200 inline-flex w-fit items-center justify-center rounded-xl p-[3px]', props.class)) },
31
- }, ...__VLS_functionalComponentArgsRest(__VLS_1));
32
- var __VLS_4 = {};
33
- const { default: __VLS_5 } = __VLS_3.slots;
34
- // @ts-ignore
35
- [delegatedProps, cn,];
36
- var __VLS_6 = {};
37
- var __VLS_3;
38
- // @ts-ignore
39
- var __VLS_7 = __VLS_6;
40
- const __VLS_base = (await import('vue')).defineComponent({
41
- __typeProps: {},
42
- });
43
- const __VLS_export = {};
44
- export default {};
@@ -1,14 +0,0 @@
1
- import type { TabsTriggerProps } from "reka-ui";
2
- import type { HTMLAttributes } from "vue";
3
- type __VLS_Props = TabsTriggerProps & {
4
- class?: HTMLAttributes["class"];
5
- };
6
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
7
- default?: ((props: {}) => any) | undefined;
8
- }>;
9
- export default _default;
10
- type __VLS_WithSlots<T, S> = T & {
11
- new (): {
12
- $slots: S;
13
- };
14
- };
@@ -1,45 +0,0 @@
1
- /// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
2
- import { reactiveOmit } from "@vueuse/core";
3
- import { TabsTrigger, useForwardProps } from "reka-ui";
4
- import { cn } from "../../../lib/utils";
5
- const props = defineProps();
6
- const delegatedProps = reactiveOmit(props, "class");
7
- const forwardedProps = useForwardProps(delegatedProps);
8
- debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
9
- const __VLS_ctx = {
10
- ...{},
11
- ...{},
12
- ...{},
13
- ...{},
14
- };
15
- let __VLS_elements;
16
- let __VLS_components;
17
- let __VLS_directives;
18
- const __VLS_0 = {}.TabsTrigger;
19
- /** @type {[typeof __VLS_components.TabsTrigger, typeof __VLS_components.TabsTrigger, ]} */ ;
20
- // @ts-ignore
21
- TabsTrigger;
22
- // @ts-ignore
23
- const __VLS_1 = __VLS_asFunctionalComponent(__VLS_0, new __VLS_0({
24
- dataSlot: "tabs-trigger",
25
- ...{ class: (__VLS_ctx.cn('data-[state=active]:bg-white focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground inline-flex flex-1 items-center justify-center gap-1.5 rounded-xl px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow,background-color] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\'size-\'])]:size-4', props.class)) },
26
- ...(__VLS_ctx.forwardedProps),
27
- }));
28
- const __VLS_2 = __VLS_1({
29
- dataSlot: "tabs-trigger",
30
- ...{ class: (__VLS_ctx.cn('data-[state=active]:bg-white focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground inline-flex flex-1 items-center justify-center gap-1.5 rounded-xl px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow,background-color] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\'size-\'])]:size-4', props.class)) },
31
- ...(__VLS_ctx.forwardedProps),
32
- }, ...__VLS_functionalComponentArgsRest(__VLS_1));
33
- var __VLS_4 = {};
34
- const { default: __VLS_5 } = __VLS_3.slots;
35
- // @ts-ignore
36
- [cn, forwardedProps,];
37
- var __VLS_6 = {};
38
- var __VLS_3;
39
- // @ts-ignore
40
- var __VLS_7 = __VLS_6;
41
- const __VLS_base = (await import('vue')).defineComponent({
42
- __typeProps: {},
43
- });
44
- const __VLS_export = {};
45
- export default {};
@@ -1,4 +0,0 @@
1
- export { default as Tabs } from "./Tabs.vue";
2
- export { default as TabsContent } from "./TabsContent.vue";
3
- export { default as TabsList } from "./TabsList.vue";
4
- export { default as TabsTrigger } from "./TabsTrigger.vue";
@@ -1,4 +0,0 @@
1
- export { default as Tabs } from "./Tabs.vue";
2
- export { default as TabsContent } from "./TabsContent.vue";
3
- export { default as TabsList } from "./TabsList.vue";
4
- export { default as TabsTrigger } from "./TabsTrigger.vue";
@@ -1,7 +0,0 @@
1
- import type { IConversation } from '../types/conversation';
2
- export declare const digibotId = -98;
3
- export declare const digibotData: IConversation;
4
- export declare function useDigibot(): {
5
- digibotData: IConversation;
6
- digibotId: number;
7
- };
@@ -1,23 +0,0 @@
1
- //PINIA
2
- export const digibotId = -98;
3
- export const digibotData = {
4
- id: digibotId,
5
- receiver_id: digibotId,
6
- username: 'Gocheckin AI',
7
- phone: '',
8
- avatar: '',
9
- last_message: '',
10
- last_message_time: '',
11
- created_at: '',
12
- updated_at: '',
13
- unread_count: 0,
14
- status: 1,
15
- color: '#4F46E5',
16
- is_known: 1
17
- };
18
- export function useDigibot() {
19
- return {
20
- digibotData,
21
- digibotId,
22
- };
23
- }
@@ -1,12 +0,0 @@
1
- import type { PAGE_RESPONSIVE, GoChatProps } from '../types/chat/global';
2
- export declare const isRouterReady: import("vue").Ref<boolean, boolean>;
3
- export declare function useInitData(): {
4
- NOTIFY_ID_APPOINTMENT_NAME: string;
5
- initPage: (data: {
6
- props: GoChatProps;
7
- responsive: PAGE_RESPONSIVE;
8
- }) => Promise<{
9
- conversation_id?: string;
10
- is_known?: string;
11
- }>;
12
- };
@@ -1,99 +0,0 @@
1
- import { ref } from 'vue';
2
- import { sdkInit } from '../plugins/sdk';
3
- import { dataProfile, getProfile, loginLink } from '../utils/chat/store/auth';
4
- import { routerPush } from '../utils/chat/chat-router';
5
- import { PAGE } from '../constant/general';
6
- import { connectMqtt, subscribeToTopic, unsubscribeFromTopic } from '../plugins/mqtt';
7
- import { TOPIC_DETAIL_CALL } from '../constant/mqtt';
8
- // import router from '../router'
9
- //PINIA
10
- export const isRouterReady = ref(false);
11
- export function useInitData() {
12
- const NOTIFY_ID_APPOINTMENT_NAME = 'notifyIdAppointment';
13
- const initPage = async (data) => {
14
- try {
15
- isRouterReady.value = false;
16
- const sdk_res = await sdkInit(data.props);
17
- if (sdk_res.tenant_error) {
18
- const api_link_res = await loginApiLink();
19
- // if (api_link_res.client_error) {
20
- // routerPush(PAGE.TENANT_ERROR)
21
- // return
22
- // }
23
- }
24
- await initData(data.props, data.responsive);
25
- await connectMqtt();
26
- const res = checkNotificationParams();
27
- isRouterReady.value = true;
28
- return res;
29
- }
30
- catch (error) {
31
- isRouterReady.value = true;
32
- console.log(error);
33
- return {};
34
- }
35
- };
36
- const initData = async (props, responsive) => {
37
- await getProfile();
38
- if (dataProfile.value?.user_type == 'tenant') {
39
- // await checkTenantPhoneOnGapInsight()
40
- }
41
- unsubscribeFromTopic(TOPIC_DETAIL_CALL + dataProfile.value?.id);
42
- subscribeToTopic(TOPIC_DETAIL_CALL + dataProfile.value?.id);
43
- if (responsive == 'mobile') {
44
- routerPush(PAGE.CHAT_LIST);
45
- }
46
- else {
47
- routerPush(PAGE.HOME);
48
- }
49
- };
50
- const checkNotificationParams = () => {
51
- // return {conversation_id: '339', is_known: '1'}
52
- const queryString = window.location.search;
53
- const urlParams = new URLSearchParams(queryString);
54
- const conversation_id = urlParams.get('conversation_id') || '';
55
- const is_known = urlParams.get('is_known') || '';
56
- if (!conversation_id || !is_known)
57
- return {};
58
- clearApiParams();
59
- return { conversation_id, is_known };
60
- };
61
- const loginApiLink = async () => {
62
- try {
63
- const queryString = window.location.search;
64
- const urlParams = new URLSearchParams(queryString);
65
- const tenant_id = urlParams.get('tenant_id') || '';
66
- const phone = urlParams.get('phone') || '';
67
- const message = urlParams.get('message') || '';
68
- const customer_name = urlParams.get('customer_name') || '';
69
- const business_name = urlParams.get('business_name') || '';
70
- if (!tenant_id || !phone || !message || !customer_name || !business_name)
71
- return { client_error: true };
72
- const param = {
73
- tenant_id,
74
- phone,
75
- message,
76
- customer_name,
77
- business_name
78
- };
79
- await loginLink(param);
80
- clearApiParams();
81
- return {};
82
- }
83
- catch (error) {
84
- console.log(error);
85
- return { client_error: true };
86
- }
87
- finally {
88
- }
89
- };
90
- const clearApiParams = () => {
91
- const url = new URL(window.location.href);
92
- url.search = '';
93
- window.history.replaceState({}, document.title, url);
94
- };
95
- return {
96
- NOTIFY_ID_APPOINTMENT_NAME,
97
- initPage
98
- };
99
- }
@@ -1,55 +0,0 @@
1
- import type { IConversation, IParamGetConversation } from '../types/conversation';
2
- export declare const useListConversations: (is_known: number, is_tenant: boolean, checkConversationHasCustomer: (data: IConversation) => boolean) => {
3
- listConversations: import("vue").Ref<{
4
- id: number;
5
- receiver_id: number;
6
- username: string | null;
7
- phone: string;
8
- avatar: string | null;
9
- last_message: string;
10
- last_message_time: string;
11
- created_at: string;
12
- updated_at: string;
13
- unread_count: number;
14
- status: number;
15
- color: string;
16
- is_known: number;
17
- customer_id?: number | undefined;
18
- tenant_id?: number | undefined;
19
- }[], IConversation[] | {
20
- id: number;
21
- receiver_id: number;
22
- username: string | null;
23
- phone: string;
24
- avatar: string | null;
25
- last_message: string;
26
- last_message_time: string;
27
- created_at: string;
28
- updated_at: string;
29
- unread_count: number;
30
- status: number;
31
- color: string;
32
- is_known: number;
33
- customer_id?: number | undefined;
34
- tenant_id?: number | undefined;
35
- }[]>;
36
- params: import("vue").Ref<{
37
- page: number;
38
- search: string;
39
- }, {
40
- page: number;
41
- search: string;
42
- } | {
43
- page: number;
44
- search: string;
45
- }>;
46
- pageCount: import("vue").Ref<number, number>;
47
- getData: (data?: IParamGetConversation, option?: {
48
- reset?: boolean;
49
- hideLoading?: boolean;
50
- page?: number;
51
- is_mqtt?: boolean;
52
- }) => Promise<void>;
53
- handleReadMessage: (receiver_id: any) => void;
54
- getDataCache: () => boolean;
55
- };
@@ -1,209 +0,0 @@
1
- import { nextTick, onMounted, onUnmounted, ref } from 'vue';
2
- import { TOPIC_HOME } from '../constant/mqtt';
3
- import { addHandleMqttMessage, connectMqtt, publishMessage, removeHandleMqttMessage, subscribeToTopic, unsubscribeFromTopic } from '../plugins/mqtt';
4
- import { dataProfile } from '../utils/chat/store/auth';
5
- import { useDebounce } from '../utils/debounce';
6
- import { getConversation, getConversationView } from '../utils/chat/store/conversation';
7
- import { readMessages } from '../utils/chat/store/message';
8
- import dayjs from 'dayjs';
9
- import { useDigibot } from '../composable/useDigibot';
10
- import { getCache, setCache } from '../utils/chat/cache';
11
- const { digibotData, digibotId } = useDigibot();
12
- export const useListConversations = (is_known, is_tenant, checkConversationHasCustomer) => {
13
- const STORAGE_KEY = 'chat-conversation-';
14
- const pageCount = ref(0);
15
- const listConversations = ref([]);
16
- const params = ref({
17
- page: 1,
18
- search: ''
19
- });
20
- const isLoadingSearch = ref(false);
21
- onMounted(() => {
22
- handleConnectMqtt();
23
- document.addEventListener('visibilitychange', handleVisibilitychange);
24
- });
25
- onUnmounted(() => {
26
- document.removeEventListener('visibilitychange', handleVisibilitychange);
27
- handleDisconnectMqtt;
28
- });
29
- const handleVisibilitychange = () => {
30
- if (document.visibilityState === 'visible') {
31
- getDataMqtt();
32
- }
33
- };
34
- const handleDisconnectMqtt = () => {
35
- TOPIC_HOME.forEach((item) => {
36
- unsubscribeFromTopic(item + dataProfile.value?.id);
37
- removeHandleMqttMessage('chat-list-' + item + '-' + is_known);
38
- });
39
- if (dataProfile.value?.user_type == 'tenant') {
40
- // unsubscribeFromTopic(TOPIC_STATUS_USER + dataProfile.value?.id)
41
- // removeHandleMqttMessage('chat-list-' + TOPIC_STATUS_USER + '-' + is_known)
42
- }
43
- };
44
- const handleConnectMqtt = async () => {
45
- try {
46
- if (dataProfile.value) {
47
- await connectMqtt();
48
- TOPIC_HOME.forEach((item) => {
49
- if (is_known == 0) {
50
- subscribeToTopic(item + dataProfile.value?.id);
51
- }
52
- addHandleMqttMessage('chat-list-' + item + '-' + is_known, item + dataProfile.value?.id, mqttMessageHandler);
53
- });
54
- }
55
- }
56
- catch (error) {
57
- console.error(error);
58
- }
59
- };
60
- const mqttMessageHandler = async (topic, data) => {
61
- // if(topic == TOPIC_HOME[3] + dataProfile.value?.id ) {
62
- // getData({}, {reset: true})
63
- // return
64
- // }
65
- if ((data.is_known ?? 1) == is_known || (!is_tenant && is_known == 1)) {
66
- getDataMqttDebounce();
67
- if (topic ===
68
- TOPIC_HOME[0] + dataProfile.value?.id
69
- || topic === TOPIC_HOME[1] + dataProfile.value?.id) {
70
- const index = listConversations.value.findIndex(item => item.id === data.id);
71
- const hasChatBox = listConversations.value.findIndex(item => item.id === digibotId);
72
- if (index != -1) {
73
- let conversation = listConversations.value[index];
74
- data.username = conversation.username;
75
- data.color = conversation.color;
76
- data.receiver_id = conversation.receiver_id;
77
- data.phone = conversation.phone;
78
- listConversations.value.splice(index, 1);
79
- }
80
- else {
81
- if (is_known == 0) {
82
- const isHasCustomer = checkConversationHasCustomer(data);
83
- await nextTick();
84
- if (isHasCustomer)
85
- return;
86
- }
87
- const conversation = await getConversationView(data.id);
88
- data.username = conversation.username;
89
- data.color = conversation.color;
90
- data.receiver_id = conversation.receiver_id;
91
- data.phone = conversation.phone;
92
- }
93
- // data.receiver_id = data.receiver_id != dataProfile.value?.id ? data.receiver_id : data.sender_id
94
- if (is_known == 1) {
95
- listConversations.value.splice(1, 0, data);
96
- }
97
- else {
98
- listConversations.value.unshift(data);
99
- }
100
- }
101
- if (topic === TOPIC_HOME[2] + dataProfile.value?.id) {
102
- if (data.is_known == is_known) {
103
- const index = listConversations.value.findIndex((item) => item.id === data.id);
104
- if (index != -1) {
105
- listConversations.value[index].unread_count = 0;
106
- }
107
- }
108
- }
109
- // if (topic === TOPIC_HOME[2] + dataProfile.value?.id) {
110
- // listConversations.value.unshift(data?.conversations)
111
- // }
112
- // if (topic === TOPIC_STATUS_USER + dataProfile.value?.id) {
113
- // const index = listConversations.value.findIndex(
114
- // (e) => e.receiver_id == Number(data?.customer_id)
115
- // )
116
- // if (index != -1) {
117
- // listConversations.value[index].status = data.is_online ? 1 : 0
118
- // }
119
- // }
120
- }
121
- };
122
- const getDataMqttDebounce = useDebounce(() => {
123
- getDataMqtt();
124
- }, 5000);
125
- const getData = async (data, option) => {
126
- try {
127
- if (!is_tenant && is_known == 1)
128
- return;
129
- params.value = { ...params.value, ...(data ?? {}) };
130
- if (option?.reset) {
131
- params.value.page = 1;
132
- }
133
- const is_known_value = is_tenant ? is_known : undefined;
134
- const page_request = option?.page ?? params.value.page;
135
- const res = await getConversation({
136
- ...params.value,
137
- is_known: is_known_value,
138
- page: page_request
139
- });
140
- if (page_request <= 1 && !params.value?.search) {
141
- setCache(STORAGE_KEY + is_known, res.items);
142
- }
143
- if (option?.is_mqtt) {
144
- mergeChats(res?.items);
145
- return;
146
- }
147
- if (option?.reset) {
148
- listConversations.value = [];
149
- if (is_known == 1 && dataProfile.value?.user_type == 'tenant')
150
- listConversations.value.push(digibotData);
151
- await nextTick();
152
- }
153
- listConversations.value.push(...(res?.items ?? []));
154
- params.value.page = res?._meta?.currentPage || 1;
155
- pageCount.value = res?._meta?.pageCount || 1;
156
- }
157
- catch (error) {
158
- console.error(error);
159
- }
160
- finally {
161
- }
162
- };
163
- const mergeChats = (newChats) => {
164
- const map = new Map();
165
- listConversations.value.forEach((c) => {
166
- map.set(c.id, c);
167
- });
168
- newChats.forEach((c) => {
169
- map.set(c.id, {
170
- ...(map.get(c.id) ?? {}),
171
- ...c
172
- });
173
- });
174
- listConversations.value = Array.from(map.values()).sort((a, b) => dayjs(b.updated_at).valueOf() - dayjs(a.updated_at).valueOf());
175
- };
176
- const getDataMqtt = async () => {
177
- let page = params.value.page;
178
- for (let i = 1; i <= page; i++) {
179
- await getData(undefined, { page: i, is_mqtt: true });
180
- }
181
- };
182
- const getDataCache = () => {
183
- const cache_data = getCache(STORAGE_KEY + is_known);
184
- if (cache_data.data) {
185
- listConversations.value = [];
186
- listConversations.value.push(...(cache_data.data ?? []));
187
- return true;
188
- }
189
- return false;
190
- };
191
- const handleReadMessage = (receiver_id) => {
192
- const index = listConversations.value.findIndex((e) => e.receiver_id == receiver_id);
193
- if (index > -1) {
194
- if (listConversations.value[index].unread_count) {
195
- readMessages(listConversations.value[index].id);
196
- listConversations.value[index].unread_count = 0;
197
- publishMessage(TOPIC_HOME[1] + dataProfile.value?.id, listConversations.value[index]);
198
- }
199
- }
200
- };
201
- return {
202
- listConversations,
203
- params,
204
- pageCount,
205
- getData,
206
- handleReadMessage,
207
- getDataCache
208
- };
209
- };
@@ -1,5 +0,0 @@
1
- import type { PAGE_RESPONSIVE } from '../types/chat/global';
2
- export declare const responsiveObserver: import("vue").Ref<PAGE_RESPONSIVE, PAGE_RESPONSIVE>;
3
- export declare function useListenEvent(callBackResizeChange?: (data?: any) => void): {
4
- getResponsiveObserver: (is_init?: boolean) => void;
5
- };