@phonghq/go-chat 1.0.0 → 1.0.1

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 (285) hide show
  1. package/README.md +4 -0
  2. package/dist/assets/icons/IconArrowLeft.vue.d.ts +2 -0
  3. package/dist/assets/icons/IconArrowLeft.vue.js +29 -0
  4. package/dist/assets/icons/IconPhone.vue.d.ts +2 -0
  5. package/dist/assets/icons/IconPhone.vue.js +19 -0
  6. package/dist/assets/icons/IconPlan.vue.d.ts +2 -0
  7. package/dist/assets/icons/IconPlan.vue.js +19 -0
  8. package/dist/assets/icons/IconPlus.vue.d.ts +2 -0
  9. package/dist/assets/icons/IconPlus.vue.js +22 -0
  10. package/dist/assets/icons/IconSearch.vue.d.ts +32 -0
  11. package/dist/assets/icons/IconSearch.vue.js +68 -0
  12. package/dist/assets/icons/call/IconMic.vue.d.ts +14 -0
  13. package/dist/assets/icons/call/IconMic.vue.js +123 -0
  14. package/dist/assets/icons/call/IconPhone.vue.d.ts +2 -0
  15. package/dist/assets/icons/call/IconPhone.vue.js +35 -0
  16. package/dist/assets/icons/call/IconPhoneCancel.vue.d.ts +2 -0
  17. package/dist/assets/icons/call/IconPhoneCancel.vue.js +35 -0
  18. package/dist/assets/icons/call/IconSpeaker.vue.d.ts +14 -0
  19. package/dist/assets/icons/call/IconSpeaker.vue.js +62 -0
  20. package/dist/assets/icons/customer-appointment/IconFilter.vue.d.ts +2 -0
  21. package/dist/assets/icons/customer-appointment/IconFilter.vue.js +53 -0
  22. package/dist/assets/icons/customer-detail/IconArrow.vue.d.ts +2 -0
  23. package/dist/assets/icons/customer-detail/IconArrow.vue.js +22 -0
  24. package/dist/assets/icons/customer-detail/IconCheck.vue.d.ts +2 -0
  25. package/dist/assets/icons/customer-detail/IconCheck.vue.js +27 -0
  26. package/dist/assets/icons/customer-detail/IconDate.vue.d.ts +2 -0
  27. package/dist/assets/icons/customer-detail/IconDate.vue.js +43 -0
  28. package/dist/assets/icons/customer-detail/IconGroup.vue.d.ts +2 -0
  29. package/dist/assets/icons/customer-detail/IconGroup.vue.js +48 -0
  30. package/dist/assets/icons/customer-detail/IconMessage.vue.d.ts +2 -0
  31. package/dist/assets/icons/customer-detail/IconMessage.vue.js +28 -0
  32. package/dist/assets/icons/customer-detail/IconNote.vue.d.ts +2 -0
  33. package/dist/assets/icons/customer-detail/IconNote.vue.js +29 -0
  34. package/dist/assets/icons/customer-detail/IconPhone.vue.d.ts +2 -0
  35. package/dist/assets/icons/customer-detail/IconPhone.vue.js +21 -0
  36. package/dist/assets/icons/customer-detail/IconPin.vue.d.ts +2 -0
  37. package/dist/assets/icons/customer-detail/IconPin.vue.js +29 -0
  38. package/dist/assets/icons/customer-detail/IconSearch.vue.d.ts +2 -0
  39. package/dist/assets/icons/customer-detail/IconSearch.vue.js +29 -0
  40. package/dist/chat/App.vue.d.ts +5 -0
  41. package/dist/chat/App.vue.js +505 -0
  42. package/dist/chat/main.d.ts +3 -0
  43. package/dist/chat/main.js +2 -0
  44. package/dist/chat/page/customer-appointment/CustomerApointment.vue.d.ts +2 -0
  45. package/dist/chat/page/customer-appointment/CustomerApointment.vue.js +207 -0
  46. package/dist/chat/page/customer-check-in/CollapseCheckIn.vue.d.ts +12 -0
  47. package/dist/chat/page/customer-check-in/CollapseCheckIn.vue.js +80 -0
  48. package/dist/chat/page/customer-check-in/CustomerCheckIn.vue.d.ts +2 -0
  49. package/dist/chat/page/customer-check-in/CustomerCheckIn.vue.js +136 -0
  50. package/dist/chat/page/customer-detail/CustomerDetail.vue.d.ts +7 -0
  51. package/dist/chat/page/customer-detail/CustomerDetail.vue.js +234 -0
  52. package/dist/chat/page/customer-detail/SubInformation.vue.d.ts +16 -0
  53. package/dist/chat/page/customer-detail/SubInformation.vue.js +102 -0
  54. package/dist/chat/page/error/Error.vue.d.ts +2 -0
  55. package/dist/chat/page/error/Error.vue.js +64 -0
  56. package/dist/chat/page/home/ChatList.vue.d.ts +20 -0
  57. package/dist/chat/page/home/ChatList.vue.js +382 -0
  58. package/dist/chat/page/home/ChatMessage.vue.d.ts +16 -0
  59. package/dist/chat/page/home/ChatMessage.vue.js +271 -0
  60. package/dist/chat/page/home/Home.vue.d.ts +14 -0
  61. package/dist/chat/page/home/Home.vue.js +327 -0
  62. package/dist/chat/page/home/HomeHeader.vue.d.ts +10 -0
  63. package/dist/chat/page/home/HomeHeader.vue.js +122 -0
  64. package/dist/chat/page/home/InputChat.vue.d.ts +19 -0
  65. package/dist/chat/page/home/InputChat.vue.js +224 -0
  66. package/dist/chat/page/home/NewCustomer.vue.d.ts +6 -0
  67. package/dist/chat/page/home/NewCustomer.vue.js +82 -0
  68. package/dist/components/ListenEvent.vue.d.ts +2 -0
  69. package/dist/components/ListenEvent.vue.js +47 -0
  70. package/dist/components/chat/ScrollEvent/ScrollEvent.vue.d.ts +22 -0
  71. package/dist/components/chat/ScrollEvent/ScrollEvent.vue.js +197 -0
  72. package/dist/components/chat/call/Calling.vue.d.ts +7 -0
  73. package/dist/components/chat/call/Calling.vue.js +261 -0
  74. package/dist/components/chat/card/CardCustomerDetail.vue.d.ts +13 -0
  75. package/dist/components/chat/card/CardCustomerDetail.vue.js +28 -0
  76. package/dist/components/chat/common/collapse/CollapseBase.vue.d.ts +20 -0
  77. package/dist/components/chat/common/collapse/CollapseBase.vue.js +59 -0
  78. package/dist/components/chat/common/input/InputSearch.vue.d.ts +16 -0
  79. package/dist/components/chat/common/input/InputSearch.vue.js +71 -0
  80. package/dist/components/chat/common/popover/PopoverBase.vue.d.ts +35 -0
  81. package/dist/components/chat/common/popover/PopoverBase.vue.js +148 -0
  82. package/dist/components/chat/common/spin/BaseSpin.vue.d.ts +2 -0
  83. package/dist/components/chat/common/spin/BaseSpin.vue.js +12 -0
  84. package/dist/components/chat/customer/Avatar.vue.d.ts +11 -0
  85. package/dist/components/chat/customer/Avatar.vue.js +79 -0
  86. package/dist/components/chat/layout/mobile/Footer.vue.d.ts +2 -0
  87. package/dist/components/chat/layout/mobile/Footer.vue.js +109 -0
  88. package/dist/components/common/CustomLoading.vue.d.ts +2 -0
  89. package/dist/components/common/CustomLoading.vue.js +19 -0
  90. package/dist/components/common/Notification/NotificationDescription.vue.d.ts +7 -0
  91. package/dist/components/common/Notification/NotificationDescription.vue.js +38 -0
  92. package/dist/components/common/button/ButtonBase.vue.d.ts +22 -0
  93. package/dist/components/common/button/ButtonBase.vue.js +78 -0
  94. package/dist/components/common/button/ButtonToggle.vue.d.ts +20 -0
  95. package/dist/components/common/button/ButtonToggle.vue.js +70 -0
  96. package/dist/components/common/checkbox/CCheckboxNumber.vue.d.ts +16 -0
  97. package/dist/components/common/checkbox/CCheckboxNumber.vue.js +48 -0
  98. package/dist/components/common/collapse/BaseCollapse.vue.d.ts +12 -0
  99. package/dist/components/common/collapse/BaseCollapse.vue.js +36 -0
  100. package/dist/components/common/collapse/BaseCollapseItem.vue.d.ts +4 -0
  101. package/dist/components/common/collapse/BaseCollapseItem.vue.js +22 -0
  102. package/dist/components/common/drawer/DrawerBase.vue.d.ts +39 -0
  103. package/dist/components/common/drawer/DrawerBase.vue.js +126 -0
  104. package/dist/components/common/dropdown/DropdownBase.vue.d.ts +21 -0
  105. package/dist/components/common/dropdown/DropdownBase.vue.js +91 -0
  106. package/dist/components/common/input/CInputSearch.vue.d.ts +14 -0
  107. package/dist/components/common/input/CInputSearch.vue.js +62 -0
  108. package/dist/components/common/modal/ModalBase.vue.d.ts +35 -0
  109. package/dist/components/common/modal/ModalBase.vue.js +164 -0
  110. package/dist/components/common/popover/PopoverBase.vue.d.ts +3 -0
  111. package/dist/components/common/popover/PopoverBase.vue.js +36 -0
  112. package/dist/components/common/slider/BaseSlider.vue.d.ts +11 -0
  113. package/dist/components/common/slider/BaseSlider.vue.js +70 -0
  114. package/dist/components/common/spin/CSpin.vue.d.ts +9 -0
  115. package/dist/components/common/spin/CSpin.vue.js +41 -0
  116. package/dist/components/common/tooltip/TooltipBase.vue.d.ts +2 -0
  117. package/dist/components/common/tooltip/TooltipBase.vue.js +8 -0
  118. package/dist/components/layout/Blank.vue.d.ts +9 -0
  119. package/dist/components/layout/Blank.vue.js +19 -0
  120. package/dist/components/layout/Default.vue.d.ts +9 -0
  121. package/dist/components/layout/Default.vue.js +21 -0
  122. package/dist/components/modal/Confirm.vue.d.ts +2 -0
  123. package/dist/components/modal/Confirm.vue.js +164 -0
  124. package/dist/components/ui/button/CButton.vue.d.ts +19 -0
  125. package/dist/components/ui/button/CButton.vue.js +49 -0
  126. package/dist/components/ui/button/c-button.d.ts +7 -0
  127. package/dist/components/ui/button/c-button.js +26 -0
  128. package/dist/components/ui/checkbox/Checkbox.vue.d.ts +18 -0
  129. package/dist/components/ui/checkbox/Checkbox.vue.js +79 -0
  130. package/dist/components/ui/checkbox/index.d.ts +1 -0
  131. package/dist/components/ui/checkbox/index.js +1 -0
  132. package/dist/components/ui/collapsible/Collapsible.vue.d.ts +16 -0
  133. package/dist/components/ui/collapsible/Collapsible.vue.js +47 -0
  134. package/dist/components/ui/collapsible/CollapsibleContent.vue.d.ts +10 -0
  135. package/dist/components/ui/collapsible/CollapsibleContent.vue.js +41 -0
  136. package/dist/components/ui/collapsible/CollapsibleTrigger.vue.d.ts +10 -0
  137. package/dist/components/ui/collapsible/CollapsibleTrigger.vue.js +35 -0
  138. package/dist/components/ui/collapsible/index.d.ts +3 -0
  139. package/dist/components/ui/collapsible/index.js +3 -0
  140. package/dist/components/ui/dialog/Dialog.vue.d.ts +14 -0
  141. package/dist/components/ui/dialog/Dialog.vue.js +42 -0
  142. package/dist/components/ui/dialog/DialogClose.vue.d.ts +10 -0
  143. package/dist/components/ui/dialog/DialogClose.vue.js +35 -0
  144. package/dist/components/ui/dialog/DialogContent.vue.d.ts +29 -0
  145. package/dist/components/ui/dialog/DialogContent.vue.js +84 -0
  146. package/dist/components/ui/dialog/DialogDescription.vue.d.ts +14 -0
  147. package/dist/components/ui/dialog/DialogDescription.vue.js +43 -0
  148. package/dist/components/ui/dialog/DialogFooter.vue.d.ts +13 -0
  149. package/dist/components/ui/dialog/DialogFooter.vue.js +26 -0
  150. package/dist/components/ui/dialog/DialogHeader.vue.d.ts +13 -0
  151. package/dist/components/ui/dialog/DialogHeader.vue.js +26 -0
  152. package/dist/components/ui/dialog/DialogScrollContent.vue.d.ts +30 -0
  153. package/dist/components/ui/dialog/DialogScrollContent.vue.js +99 -0
  154. package/dist/components/ui/dialog/DialogTitle.vue.d.ts +14 -0
  155. package/dist/components/ui/dialog/DialogTitle.vue.js +43 -0
  156. package/dist/components/ui/dialog/DialogTrigger.vue.d.ts +10 -0
  157. package/dist/components/ui/dialog/DialogTrigger.vue.js +35 -0
  158. package/dist/components/ui/dialog/index.d.ts +9 -0
  159. package/dist/components/ui/dialog/index.js +9 -0
  160. package/dist/components/ui/drawer/Drawer.vue.d.ts +26 -0
  161. package/dist/components/ui/drawer/Drawer.vue.js +48 -0
  162. package/dist/components/ui/drawer/DrawerContent.vue.d.ts +33 -0
  163. package/dist/components/ui/drawer/DrawerContent.vue.js +81 -0
  164. package/dist/components/ui/drawer/DrawerDescription.vue.d.ts +14 -0
  165. package/dist/components/ui/drawer/DrawerDescription.vue.js +42 -0
  166. package/dist/components/ui/drawer/DrawerFooter.vue.d.ts +13 -0
  167. package/dist/components/ui/drawer/DrawerFooter.vue.js +26 -0
  168. package/dist/components/ui/drawer/DrawerHeader.vue.d.ts +13 -0
  169. package/dist/components/ui/drawer/DrawerHeader.vue.js +26 -0
  170. package/dist/components/ui/drawer/DrawerOverlay.vue.d.ts +7 -0
  171. package/dist/components/ui/drawer/DrawerOverlay.vue.js +37 -0
  172. package/dist/components/ui/drawer/DrawerTitle.vue.d.ts +14 -0
  173. package/dist/components/ui/drawer/DrawerTitle.vue.js +42 -0
  174. package/dist/components/ui/drawer/index.d.ts +8 -0
  175. package/dist/components/ui/drawer/index.js +8 -0
  176. package/dist/components/ui/dropdown-menu/DropdownMenu.vue.d.ts +14 -0
  177. package/dist/components/ui/dropdown-menu/DropdownMenu.vue.js +41 -0
  178. package/dist/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue.d.ts +20 -0
  179. package/dist/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue.js +79 -0
  180. package/dist/components/ui/dropdown-menu/DropdownMenuContent.vue.d.ts +28 -0
  181. package/dist/components/ui/dropdown-menu/DropdownMenuContent.vue.js +61 -0
  182. package/dist/components/ui/dropdown-menu/DropdownMenuGroup.vue.d.ts +10 -0
  183. package/dist/components/ui/dropdown-menu/DropdownMenuGroup.vue.js +35 -0
  184. package/dist/components/ui/dropdown-menu/DropdownMenuItem.vue.d.ts +15 -0
  185. package/dist/components/ui/dropdown-menu/DropdownMenuItem.vue.js +43 -0
  186. package/dist/components/ui/dropdown-menu/DropdownMenuLabel.vue.d.ts +15 -0
  187. package/dist/components/ui/dropdown-menu/DropdownMenuLabel.vue.js +43 -0
  188. package/dist/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue.d.ts +14 -0
  189. package/dist/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue.js +41 -0
  190. package/dist/components/ui/dropdown-menu/DropdownMenuRadioItem.vue.d.ts +18 -0
  191. package/dist/components/ui/dropdown-menu/DropdownMenuRadioItem.vue.js +80 -0
  192. package/dist/components/ui/dropdown-menu/DropdownMenuSeparator.vue.d.ts +7 -0
  193. package/dist/components/ui/dropdown-menu/DropdownMenuSeparator.vue.js +37 -0
  194. package/dist/components/ui/dropdown-menu/DropdownMenuShortcut.vue.d.ts +13 -0
  195. package/dist/components/ui/dropdown-menu/DropdownMenuShortcut.vue.js +26 -0
  196. package/dist/components/ui/dropdown-menu/DropdownMenuSub.vue.d.ts +14 -0
  197. package/dist/components/ui/dropdown-menu/DropdownMenuSub.vue.js +41 -0
  198. package/dist/components/ui/dropdown-menu/DropdownMenuSubContent.vue.d.ts +30 -0
  199. package/dist/components/ui/dropdown-menu/DropdownMenuSubContent.vue.js +46 -0
  200. package/dist/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue.d.ts +14 -0
  201. package/dist/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue.js +58 -0
  202. package/dist/components/ui/dropdown-menu/DropdownMenuTrigger.vue.d.ts +10 -0
  203. package/dist/components/ui/dropdown-menu/DropdownMenuTrigger.vue.js +41 -0
  204. package/dist/components/ui/dropdown-menu/index.d.ts +15 -0
  205. package/dist/components/ui/dropdown-menu/index.js +15 -0
  206. package/dist/components/ui/popover/Popover.vue.d.ts +14 -0
  207. package/dist/components/ui/popover/Popover.vue.js +41 -0
  208. package/dist/components/ui/popover/PopoverContent.vue.d.ts +28 -0
  209. package/dist/components/ui/popover/PopoverContent.vue.js +60 -0
  210. package/dist/components/ui/popover/PopoverTrigger.vue.d.ts +10 -0
  211. package/dist/components/ui/popover/PopoverTrigger.vue.js +35 -0
  212. package/dist/components/ui/popover/index.d.ts +3 -0
  213. package/dist/components/ui/popover/index.js +3 -0
  214. package/dist/components/ui/radio-group/RadioGroup.vue.d.ts +18 -0
  215. package/dist/components/ui/radio-group/RadioGroup.vue.js +46 -0
  216. package/dist/components/ui/radio-group/RadioGroupItem.vue.d.ts +7 -0
  217. package/dist/components/ui/radio-group/RadioGroupItem.vue.js +71 -0
  218. package/dist/components/ui/radio-group/index.d.ts +2 -0
  219. package/dist/components/ui/radio-group/index.js +2 -0
  220. package/dist/components/ui/slider/Slider.vue.d.ts +13 -0
  221. package/dist/components/ui/slider/Slider.vue.js +155 -0
  222. package/dist/components/ui/slider/index.d.ts +1 -0
  223. package/dist/components/ui/slider/index.js +1 -0
  224. package/dist/components/ui/switch/Switch.vue.d.ts +18 -0
  225. package/dist/components/ui/switch/Switch.vue.js +61 -0
  226. package/dist/components/ui/switch/index.d.ts +1 -0
  227. package/dist/components/ui/switch/index.js +1 -0
  228. package/dist/composable/useCallHelper.d.ts +23 -0
  229. package/dist/composable/useCallHelper.js +182 -0
  230. package/dist/composable/useInitData.d.ts +11 -0
  231. package/dist/composable/useInitData.js +82 -0
  232. package/dist/composable/useModalConfirm.d.ts +5 -0
  233. package/dist/composable/useModalConfirm.js +39 -0
  234. package/dist/constant/color.d.ts +22 -0
  235. package/dist/constant/color.js +43 -0
  236. package/dist/constant/datetime.d.ts +5 -0
  237. package/dist/constant/datetime.js +5 -0
  238. package/dist/constant/general.d.ts +8 -0
  239. package/dist/constant/general.js +9 -0
  240. package/dist/constant/message.d.ts +8 -0
  241. package/dist/constant/message.js +8 -0
  242. package/dist/constant/mqtt.d.ts +4 -0
  243. package/dist/constant/mqtt.js +11 -0
  244. package/dist/constant/user.d.ts +8 -0
  245. package/dist/constant/user.js +9 -0
  246. package/dist/go-chat.es.js +66195 -2840
  247. package/dist/go-chat.umd.js +23 -3
  248. package/dist/lib/utils.d.ts +2 -0
  249. package/dist/lib/utils.js +5 -0
  250. package/dist/plugins/axios-gci.d.ts +3 -0
  251. package/dist/plugins/axios-gci.js +25 -0
  252. package/dist/plugins/axios.d.ts +3 -0
  253. package/dist/plugins/axios.js +85 -0
  254. package/dist/plugins/mqtt.d.ts +9 -0
  255. package/dist/plugins/mqtt.js +129 -0
  256. package/dist/plugins/sdk.d.ts +19 -0
  257. package/dist/plugins/sdk.js +83 -0
  258. package/dist/plugins/websocket.d.ts +1 -0
  259. package/dist/plugins/websocket.js +26 -0
  260. package/dist/stores/general.d.ts +48 -0
  261. package/dist/stores/general.js +39 -0
  262. package/dist/style.css +1 -1
  263. package/dist/types/chat/user.d.ts +88 -0
  264. package/dist/types/chat/user.js +1 -0
  265. package/dist/types/conversation.d.ts +18 -0
  266. package/dist/types/conversation.js +1 -0
  267. package/dist/utils/chat/auth.d.ts +45 -0
  268. package/dist/utils/chat/auth.js +51 -0
  269. package/dist/utils/chat/call.d.ts +1 -0
  270. package/dist/utils/chat/call.js +10 -0
  271. package/dist/utils/chat/chat-router.d.ts +3 -0
  272. package/dist/utils/chat/chat-router.js +9 -0
  273. package/dist/utils/chat/conversation.d.ts +3 -0
  274. package/dist/utils/chat/conversation.js +7 -0
  275. package/dist/utils/chat/message.d.ts +17 -0
  276. package/dist/utils/chat/message.js +42 -0
  277. package/dist/utils/chat/user.d.ts +193 -0
  278. package/dist/utils/chat/user.js +33 -0
  279. package/dist/utils/debounce.d.ts +1 -0
  280. package/dist/utils/debounce.js +9 -0
  281. package/dist/utils/logger.d.ts +3 -0
  282. package/dist/utils/logger.js +5 -0
  283. package/dist/utils/string-helper.d.ts +1 -0
  284. package/dist/utils/string-helper.js +27 -0
  285. package/package.json +8 -7
@@ -0,0 +1,261 @@
1
+ /// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
2
+ import { ref, onMounted, onUnmounted, watch } from 'vue';
3
+ import DrawerBase from '@/components/common/drawer/DrawerBase.vue';
4
+ import IconPhone from '@/assets/icons/call/IconPhone.vue';
5
+ import { dataProfile } from '@/utils/chat/auth.js';
6
+ import { addHandleMqttMessage, connectMqtt, removeHandleMqttMessage, subscribeToTopic, unsubscribeFromTopic } from '@/plugins/mqtt.js';
7
+ import { TOPIC_DETAIL_CALL } from '@/constant/mqtt.js';
8
+ import { useCallHelper } from '@/composable/useCallHelper';
9
+ import IconPhoneCancel from '@/assets/icons/call/IconPhoneCancel.vue';
10
+ const { handleOffer, handleOfferResponse, call, end, endPc, addIceCandidate, sendOfferOk } = useCallHelper();
11
+ const STATUS = {
12
+ CONNECTING: 'Connecting...',
13
+ CONNECTED: 'Ringing...',
14
+ CONNECT_FAILED: 'Connect Error',
15
+ CALLING: 'Calling...',
16
+ CALL_START: '',
17
+ CALL_END: 'Call Ended'
18
+ };
19
+ const callStatus = ref(STATUS.CONNECTING);
20
+ const duration = ref('00:00');
21
+ const drawerVisible = ref(false);
22
+ const disable = ref(false);
23
+ let timer = null;
24
+ let timeOut = null;
25
+ onMounted(() => {
26
+ // timeOut = setTimeout(() => {
27
+ // callStatus.value = 'Connected'
28
+ // startTimer()
29
+ // }, 2000)
30
+ });
31
+ onUnmounted(() => {
32
+ if (timer)
33
+ clearInterval(timer);
34
+ if (timeOut)
35
+ clearTimeout(timeOut);
36
+ });
37
+ function startTimer() {
38
+ let sec = 0;
39
+ timer = setInterval(() => {
40
+ sec++;
41
+ const m = String(Math.floor(sec / 60)).padStart(2, '0');
42
+ const s = String(sec % 60).padStart(2, '0');
43
+ duration.value = `${m}:${s}`;
44
+ }, 1000);
45
+ }
46
+ function toggleMute() {
47
+ alert('Mic toggled');
48
+ }
49
+ function toggleSpeaker() {
50
+ alert('Speaker toggled');
51
+ }
52
+ function endCall() {
53
+ callStatus.value = STATUS.CALL_END;
54
+ end('');
55
+ clearInterval(timer);
56
+ disable.value = false;
57
+ drawerVisible.value = false;
58
+ }
59
+ const open = () => {
60
+ drawerVisible.value = true;
61
+ disable.value = true;
62
+ };
63
+ const startCall = async (data) => {
64
+ try {
65
+ callStatus.value = STATUS.CONNECTING;
66
+ open();
67
+ await call(data);
68
+ callStatus.value = STATUS.CONNECTED;
69
+ }
70
+ catch (e) {
71
+ console.log(e);
72
+ callStatus.value = STATUS.CONNECT_FAILED;
73
+ }
74
+ };
75
+ const answer = () => {
76
+ callStatus.value = STATUS.CALL_START;
77
+ sendOfferOk();
78
+ };
79
+ const handleMqttMessage = async (topic, message) => {
80
+ if (topic == TOPIC_DETAIL_CALL + dataProfile.value?.id) {
81
+ console.log(message);
82
+ if (message?.type === 'offer') {
83
+ const status = await handleOffer(message);
84
+ if (status) {
85
+ callStatus.value = STATUS.CALLING;
86
+ open();
87
+ }
88
+ }
89
+ else if (message?.type === 'offer-response') {
90
+ await handleOfferResponse(message);
91
+ callStatus.value = STATUS.CALL_START;
92
+ }
93
+ else if (message?.type === 'candidate') {
94
+ addIceCandidate(message);
95
+ }
96
+ else if (message?.type === 'end-call') {
97
+ endPc(message?.link);
98
+ callStatus.value = STATUS.CALL_END;
99
+ }
100
+ }
101
+ };
102
+ const __VLS_exposed = { startCall, endCall };
103
+ defineExpose(__VLS_exposed);
104
+ watch(dataProfile, async (newValue, oldValue) => {
105
+ if (oldValue?.id && oldValue?.id != newValue?.id) {
106
+ unsubscribeFromTopic(TOPIC_DETAIL_CALL + oldValue?.id);
107
+ removeHandleMqttMessage('call-message');
108
+ }
109
+ if (newValue?.id && oldValue?.id != newValue?.id) {
110
+ await connectMqtt();
111
+ subscribeToTopic(TOPIC_DETAIL_CALL + newValue?.id);
112
+ addHandleMqttMessage('call-message', TOPIC_DETAIL_CALL + newValue?.id, handleMqttMessage);
113
+ }
114
+ }, { immediate: true });
115
+ debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
116
+ const __VLS_ctx = {
117
+ ...{},
118
+ ...{},
119
+ };
120
+ let __VLS_elements;
121
+ let __VLS_components;
122
+ let __VLS_directives;
123
+ /** @type {[typeof DrawerBase, typeof DrawerBase, ]} */ ;
124
+ // @ts-ignore
125
+ const __VLS_0 = __VLS_asFunctionalComponent(DrawerBase, new DrawerBase({
126
+ open: (__VLS_ctx.drawerVisible),
127
+ width: (500),
128
+ disableClose: (__VLS_ctx.disable),
129
+ }));
130
+ const __VLS_1 = __VLS_0({
131
+ open: (__VLS_ctx.drawerVisible),
132
+ width: (500),
133
+ disableClose: (__VLS_ctx.disable),
134
+ }, ...__VLS_functionalComponentArgsRest(__VLS_0));
135
+ const { default: __VLS_3 } = __VLS_2.slots;
136
+ // @ts-ignore
137
+ [drawerVisible, disable,];
138
+ {
139
+ const { content: __VLS_4 } = __VLS_2.slots;
140
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
141
+ ...{ class: "flex flex-col items-center justify-center h-screen bg-chat-haze-300 text-white relative" },
142
+ });
143
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
144
+ ...{ class: "w-32 h-32 rounded-full overflow-hidden mb-4 border-4 border-gray-700" },
145
+ });
146
+ __VLS_asFunctionalElement(__VLS_elements.img)({
147
+ src: "https://i.pravatar.cc/300",
148
+ alt: "avatar",
149
+ ...{ class: "w-full h-full object-cover" },
150
+ });
151
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
152
+ ...{ class: "text-center" },
153
+ });
154
+ __VLS_asFunctionalElement(__VLS_elements.h2, __VLS_elements.h2)({
155
+ ...{ class: "text-2xl font-semibold" },
156
+ });
157
+ __VLS_asFunctionalElement(__VLS_elements.p, __VLS_elements.p)({
158
+ ...{ class: "text-gray-400 mt-1" },
159
+ });
160
+ (__VLS_ctx.callStatus);
161
+ // @ts-ignore
162
+ [callStatus,];
163
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
164
+ ...{ class: "flex items-center justify-center gap-8 mt-10" },
165
+ });
166
+ if (__VLS_ctx.callStatus == __VLS_ctx.STATUS.CALLING) {
167
+ // @ts-ignore
168
+ [callStatus, STATUS,];
169
+ __VLS_asFunctionalElement(__VLS_elements.button, __VLS_elements.button)({
170
+ ...{ onClick: (__VLS_ctx.answer) },
171
+ ...{ class: "w-16 h-16 bg-[#22C55E] hover:bg-green-600 text-white rounded-full flex items-center justify-center shadow-lg transition" },
172
+ });
173
+ // @ts-ignore
174
+ [answer,];
175
+ /** @type {[typeof IconPhone, ]} */ ;
176
+ // @ts-ignore
177
+ const __VLS_5 = __VLS_asFunctionalComponent(IconPhone, new IconPhone({}));
178
+ const __VLS_6 = __VLS_5({}, ...__VLS_functionalComponentArgsRest(__VLS_5));
179
+ }
180
+ __VLS_asFunctionalElement(__VLS_elements.button, __VLS_elements.button)({
181
+ ...{ onClick: (__VLS_ctx.endCall) },
182
+ ...{ class: "w-16 h-16 rounded-full bg-[#EF4444] hover:bg-red-700 flex items-center justify-center" },
183
+ });
184
+ // @ts-ignore
185
+ [endCall,];
186
+ /** @type {[typeof IconPhoneCancel, ]} */ ;
187
+ // @ts-ignore
188
+ const __VLS_9 = __VLS_asFunctionalComponent(IconPhoneCancel, new IconPhoneCancel({}));
189
+ const __VLS_10 = __VLS_9({}, ...__VLS_functionalComponentArgsRest(__VLS_9));
190
+ __VLS_asFunctionalElement(__VLS_elements.p, __VLS_elements.p)({
191
+ ...{ class: "absolute bottom-6 text-gray-500 text-sm" },
192
+ });
193
+ (__VLS_ctx.duration);
194
+ // @ts-ignore
195
+ [duration,];
196
+ }
197
+ var __VLS_2;
198
+ __VLS_asFunctionalElement(__VLS_elements.audio, __VLS_elements.audio)({
199
+ id: "go-chat-local-audio",
200
+ autoplay: true,
201
+ muted: true,
202
+ });
203
+ __VLS_asFunctionalElement(__VLS_elements.audio, __VLS_elements.audio)({
204
+ id: "go-chat-remote-audio",
205
+ autoplay: true,
206
+ });
207
+ /** @type {__VLS_StyleScopedClasses['flex']} */ ;
208
+ /** @type {__VLS_StyleScopedClasses['flex-col']} */ ;
209
+ /** @type {__VLS_StyleScopedClasses['items-center']} */ ;
210
+ /** @type {__VLS_StyleScopedClasses['justify-center']} */ ;
211
+ /** @type {__VLS_StyleScopedClasses['h-screen']} */ ;
212
+ /** @type {__VLS_StyleScopedClasses['bg-chat-haze-300']} */ ;
213
+ /** @type {__VLS_StyleScopedClasses['text-white']} */ ;
214
+ /** @type {__VLS_StyleScopedClasses['relative']} */ ;
215
+ /** @type {__VLS_StyleScopedClasses['w-32']} */ ;
216
+ /** @type {__VLS_StyleScopedClasses['h-32']} */ ;
217
+ /** @type {__VLS_StyleScopedClasses['rounded-full']} */ ;
218
+ /** @type {__VLS_StyleScopedClasses['overflow-hidden']} */ ;
219
+ /** @type {__VLS_StyleScopedClasses['mb-4']} */ ;
220
+ /** @type {__VLS_StyleScopedClasses['border-4']} */ ;
221
+ /** @type {__VLS_StyleScopedClasses['border-gray-700']} */ ;
222
+ /** @type {__VLS_StyleScopedClasses['w-full']} */ ;
223
+ /** @type {__VLS_StyleScopedClasses['h-full']} */ ;
224
+ /** @type {__VLS_StyleScopedClasses['object-cover']} */ ;
225
+ /** @type {__VLS_StyleScopedClasses['text-center']} */ ;
226
+ /** @type {__VLS_StyleScopedClasses['text-2xl']} */ ;
227
+ /** @type {__VLS_StyleScopedClasses['font-semibold']} */ ;
228
+ /** @type {__VLS_StyleScopedClasses['text-gray-400']} */ ;
229
+ /** @type {__VLS_StyleScopedClasses['mt-1']} */ ;
230
+ /** @type {__VLS_StyleScopedClasses['flex']} */ ;
231
+ /** @type {__VLS_StyleScopedClasses['items-center']} */ ;
232
+ /** @type {__VLS_StyleScopedClasses['justify-center']} */ ;
233
+ /** @type {__VLS_StyleScopedClasses['gap-8']} */ ;
234
+ /** @type {__VLS_StyleScopedClasses['mt-10']} */ ;
235
+ /** @type {__VLS_StyleScopedClasses['w-16']} */ ;
236
+ /** @type {__VLS_StyleScopedClasses['h-16']} */ ;
237
+ /** @type {__VLS_StyleScopedClasses['bg-[#22C55E]']} */ ;
238
+ /** @type {__VLS_StyleScopedClasses['hover:bg-green-600']} */ ;
239
+ /** @type {__VLS_StyleScopedClasses['text-white']} */ ;
240
+ /** @type {__VLS_StyleScopedClasses['rounded-full']} */ ;
241
+ /** @type {__VLS_StyleScopedClasses['flex']} */ ;
242
+ /** @type {__VLS_StyleScopedClasses['items-center']} */ ;
243
+ /** @type {__VLS_StyleScopedClasses['justify-center']} */ ;
244
+ /** @type {__VLS_StyleScopedClasses['shadow-lg']} */ ;
245
+ /** @type {__VLS_StyleScopedClasses['transition']} */ ;
246
+ /** @type {__VLS_StyleScopedClasses['w-16']} */ ;
247
+ /** @type {__VLS_StyleScopedClasses['h-16']} */ ;
248
+ /** @type {__VLS_StyleScopedClasses['rounded-full']} */ ;
249
+ /** @type {__VLS_StyleScopedClasses['bg-[#EF4444]']} */ ;
250
+ /** @type {__VLS_StyleScopedClasses['hover:bg-red-700']} */ ;
251
+ /** @type {__VLS_StyleScopedClasses['flex']} */ ;
252
+ /** @type {__VLS_StyleScopedClasses['items-center']} */ ;
253
+ /** @type {__VLS_StyleScopedClasses['justify-center']} */ ;
254
+ /** @type {__VLS_StyleScopedClasses['absolute']} */ ;
255
+ /** @type {__VLS_StyleScopedClasses['bottom-6']} */ ;
256
+ /** @type {__VLS_StyleScopedClasses['text-gray-500']} */ ;
257
+ /** @type {__VLS_StyleScopedClasses['text-sm']} */ ;
258
+ const __VLS_export = (await import('vue')).defineComponent({
259
+ setup: () => (__VLS_exposed),
260
+ });
261
+ export default {};
@@ -0,0 +1,13 @@
1
+ declare var __VLS_1: {}, __VLS_3: {};
2
+ type __VLS_Slots = {} & {
3
+ header?: (props: typeof __VLS_1) => any;
4
+ } & {
5
+ content?: (props: typeof __VLS_3) => any;
6
+ };
7
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, __VLS_Slots>;
8
+ export default _default;
9
+ type __VLS_WithSlots<T, S> = T & {
10
+ new (): {
11
+ $slots: S;
12
+ };
13
+ };
@@ -0,0 +1,28 @@
1
+ /// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
2
+ debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
3
+ const __VLS_ctx = {};
4
+ let __VLS_elements;
5
+ let __VLS_components;
6
+ let __VLS_directives;
7
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
8
+ ...{ class: "bg-white border border-chat-haze-200 rounded-lg p-4" },
9
+ });
10
+ var __VLS_0 = {};
11
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
12
+ ...{ class: "border-t border-dashed border-chat-haze-200 my-2" },
13
+ });
14
+ var __VLS_2 = {};
15
+ /** @type {__VLS_StyleScopedClasses['bg-white']} */ ;
16
+ /** @type {__VLS_StyleScopedClasses['border']} */ ;
17
+ /** @type {__VLS_StyleScopedClasses['border-chat-haze-200']} */ ;
18
+ /** @type {__VLS_StyleScopedClasses['rounded-lg']} */ ;
19
+ /** @type {__VLS_StyleScopedClasses['p-4']} */ ;
20
+ /** @type {__VLS_StyleScopedClasses['border-t']} */ ;
21
+ /** @type {__VLS_StyleScopedClasses['border-dashed']} */ ;
22
+ /** @type {__VLS_StyleScopedClasses['border-chat-haze-200']} */ ;
23
+ /** @type {__VLS_StyleScopedClasses['my-2']} */ ;
24
+ // @ts-ignore
25
+ var __VLS_1 = __VLS_0, __VLS_3 = __VLS_2;
26
+ const __VLS_base = (await import('vue')).defineComponent({});
27
+ const __VLS_export = {};
28
+ export default {};
@@ -0,0 +1,20 @@
1
+ type __VLS_ModelProps = {
2
+ 'open'?: boolean | undefined;
3
+ };
4
+ declare var __VLS_12: {}, __VLS_19: {};
5
+ type __VLS_Slots = {} & {
6
+ trigger?: (props: typeof __VLS_12) => any;
7
+ } & {
8
+ default?: (props: typeof __VLS_19) => any;
9
+ };
10
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
+ "update:open": (value: boolean | undefined) => any;
12
+ }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
13
+ "onUpdate:open"?: ((value: boolean | undefined) => any) | undefined;
14
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, __VLS_Slots>;
15
+ export default _default;
16
+ type __VLS_WithSlots<T, S> = T & {
17
+ new (): {
18
+ $slots: S;
19
+ };
20
+ };
@@ -0,0 +1,59 @@
1
+ /// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
2
+ import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from '@/components/ui/collapsible';
3
+ const isOpen = defineModel('open');
4
+ debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
5
+ const __VLS_modelEmit = defineEmits();
6
+ const __VLS_ctx = {
7
+ ...{},
8
+ ...{},
9
+ ...{},
10
+ ...{},
11
+ ...{},
12
+ };
13
+ let __VLS_elements;
14
+ let __VLS_components;
15
+ let __VLS_directives;
16
+ const __VLS_0 = {}.Collapsible;
17
+ /** @type {[typeof __VLS_components.Collapsible, typeof __VLS_components.Collapsible, ]} */ ;
18
+ // @ts-ignore
19
+ Collapsible;
20
+ // @ts-ignore
21
+ const __VLS_1 = __VLS_asFunctionalComponent(__VLS_0, new __VLS_0({
22
+ open: (__VLS_ctx.isOpen),
23
+ }));
24
+ const __VLS_2 = __VLS_1({
25
+ open: (__VLS_ctx.isOpen),
26
+ }, ...__VLS_functionalComponentArgsRest(__VLS_1));
27
+ var __VLS_4 = {};
28
+ const { default: __VLS_5 } = __VLS_3.slots;
29
+ // @ts-ignore
30
+ [isOpen,];
31
+ const __VLS_6 = {}.CollapsibleTrigger;
32
+ /** @type {[typeof __VLS_components.CollapsibleTrigger, typeof __VLS_components.CollapsibleTrigger, ]} */ ;
33
+ // @ts-ignore
34
+ CollapsibleTrigger;
35
+ // @ts-ignore
36
+ const __VLS_7 = __VLS_asFunctionalComponent(__VLS_6, new __VLS_6({}));
37
+ const __VLS_8 = __VLS_7({}, ...__VLS_functionalComponentArgsRest(__VLS_7));
38
+ const { default: __VLS_10 } = __VLS_9.slots;
39
+ var __VLS_11 = {};
40
+ var __VLS_9;
41
+ const __VLS_13 = {}.CollapsibleContent;
42
+ /** @type {[typeof __VLS_components.CollapsibleContent, typeof __VLS_components.CollapsibleContent, ]} */ ;
43
+ // @ts-ignore
44
+ CollapsibleContent;
45
+ // @ts-ignore
46
+ const __VLS_14 = __VLS_asFunctionalComponent(__VLS_13, new __VLS_13({}));
47
+ const __VLS_15 = __VLS_14({}, ...__VLS_functionalComponentArgsRest(__VLS_14));
48
+ const { default: __VLS_17 } = __VLS_16.slots;
49
+ var __VLS_18 = {};
50
+ var __VLS_16;
51
+ var __VLS_3;
52
+ // @ts-ignore
53
+ var __VLS_12 = __VLS_11, __VLS_19 = __VLS_18;
54
+ const __VLS_base = (await import('vue')).defineComponent({
55
+ __typeEmits: {},
56
+ __typeProps: {},
57
+ });
58
+ const __VLS_export = {};
59
+ export default {};
@@ -0,0 +1,16 @@
1
+ import type { PAGE_RESPONSE } from '@/types/chat/global';
2
+ type Props = {
3
+ modelValue: string;
4
+ response: PAGE_RESPONSE;
5
+ placeholder?: string;
6
+ };
7
+ declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
8
+ search: (val: string) => any;
9
+ "update:modelValue": (val: string) => any;
10
+ }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
11
+ onSearch?: ((val: string) => any) | undefined;
12
+ "onUpdate:modelValue"?: ((val: string) => any) | undefined;
13
+ }>, {
14
+ placeholder: string;
15
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ export default _default;
@@ -0,0 +1,71 @@
1
+ /// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
2
+ import { computed } from 'vue';
3
+ import IconSearch from '@/assets/icons/IconSearch.vue';
4
+ import { useDebounce } from '@/utils/debounce';
5
+ const props = withDefaults(defineProps(), {
6
+ placeholder: 'Search...'
7
+ });
8
+ const emit = defineEmits();
9
+ const keyword = computed({
10
+ get: () => props.modelValue,
11
+ set: (val) => emit('update:modelValue', val)
12
+ });
13
+ const search = useDebounce(() => {
14
+ emit('search', keyword.value);
15
+ });
16
+ debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
17
+ const __VLS_defaults = {
18
+ placeholder: 'Search...'
19
+ };
20
+ const __VLS_ctx = {
21
+ ...{},
22
+ ...{},
23
+ ...{},
24
+ ...{},
25
+ ...{},
26
+ };
27
+ let __VLS_elements;
28
+ let __VLS_components;
29
+ let __VLS_directives;
30
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
31
+ ...{ class: "relative" },
32
+ });
33
+ __VLS_asFunctionalElement(__VLS_elements.span, __VLS_elements.span)({
34
+ ...{ class: "absolute inset-y-0 left-4 translate-y-1/2 bottom-1/2 flex items-center pointer-events-none text-gray-500" },
35
+ });
36
+ /** @type {[typeof IconSearch, ]} */ ;
37
+ // @ts-ignore
38
+ const __VLS_0 = __VLS_asFunctionalComponent(IconSearch, new IconSearch({}));
39
+ const __VLS_1 = __VLS_0({}, ...__VLS_functionalComponentArgsRest(__VLS_0));
40
+ __VLS_asFunctionalElement(__VLS_elements.input)({
41
+ ...{ onInput: (__VLS_ctx.search) },
42
+ ...{ class: "sc-full chat-input bg-[#F7F8F9] pr-4 py-3 pl-10" },
43
+ ...{ class: ({ '!bg-white': __VLS_ctx.response == 'mobile' }) },
44
+ placeholder: (props.placeholder),
45
+ });
46
+ (__VLS_ctx.keyword);
47
+ // @ts-ignore
48
+ [search, response, keyword,];
49
+ /** @type {__VLS_StyleScopedClasses['relative']} */ ;
50
+ /** @type {__VLS_StyleScopedClasses['absolute']} */ ;
51
+ /** @type {__VLS_StyleScopedClasses['inset-y-0']} */ ;
52
+ /** @type {__VLS_StyleScopedClasses['left-4']} */ ;
53
+ /** @type {__VLS_StyleScopedClasses['translate-y-1/2']} */ ;
54
+ /** @type {__VLS_StyleScopedClasses['bottom-1/2']} */ ;
55
+ /** @type {__VLS_StyleScopedClasses['flex']} */ ;
56
+ /** @type {__VLS_StyleScopedClasses['items-center']} */ ;
57
+ /** @type {__VLS_StyleScopedClasses['pointer-events-none']} */ ;
58
+ /** @type {__VLS_StyleScopedClasses['text-gray-500']} */ ;
59
+ /** @type {__VLS_StyleScopedClasses['sc-full']} */ ;
60
+ /** @type {__VLS_StyleScopedClasses['chat-input']} */ ;
61
+ /** @type {__VLS_StyleScopedClasses['bg-[#F7F8F9]']} */ ;
62
+ /** @type {__VLS_StyleScopedClasses['pr-4']} */ ;
63
+ /** @type {__VLS_StyleScopedClasses['py-3']} */ ;
64
+ /** @type {__VLS_StyleScopedClasses['pl-10']} */ ;
65
+ /** @type {__VLS_StyleScopedClasses['!bg-white']} */ ;
66
+ const __VLS_export = (await import('vue')).defineComponent({
67
+ __typeEmits: {},
68
+ __typeProps: {},
69
+ props: {},
70
+ });
71
+ export default {};
@@ -0,0 +1,35 @@
1
+ import type { PopoverContentProps } from "reka-ui";
2
+ type ShortPopoverContentProps = Pick<PopoverContentProps, 'side' | 'align' | 'sideOffset'> & {
3
+ delay?: number;
4
+ trigger?: 'hover' | 'click';
5
+ triggerClass?: string;
6
+ disabled?: boolean;
7
+ };
8
+ type __VLS_Props = ShortPopoverContentProps;
9
+ type __VLS_ModelProps = {
10
+ 'open'?: boolean;
11
+ };
12
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
13
+ declare var __VLS_19: {}, __VLS_30: {};
14
+ type __VLS_Slots = {} & {
15
+ default?: (props: typeof __VLS_19) => any;
16
+ } & {
17
+ content?: (props: typeof __VLS_30) => any;
18
+ };
19
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
20
+ "update:open": (value: boolean | undefined) => any;
21
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
22
+ "onUpdate:open"?: ((value: boolean | undefined) => any) | undefined;
23
+ }>, {
24
+ sideOffset: number;
25
+ align: "end" | "start" | "center";
26
+ delay: number;
27
+ trigger: "click" | "hover";
28
+ triggerClass: string;
29
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, __VLS_Slots>;
30
+ export default _default;
31
+ type __VLS_WithSlots<T, S> = T & {
32
+ new (): {
33
+ $slots: S;
34
+ };
35
+ };
@@ -0,0 +1,148 @@
1
+ /// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
2
+ import { Popover, PopoverContent, PopoverTrigger, } from '@/components/ui/popover';
3
+ const props = withDefaults(defineProps(), {
4
+ align: "center",
5
+ sideOffset: 4,
6
+ delay: 100,
7
+ trigger: 'click',
8
+ triggerClass: '',
9
+ });
10
+ let closeTimer = null;
11
+ const isOpen = defineModel('open');
12
+ function delaySetOpen(open, delay) {
13
+ if (props.disabled)
14
+ return;
15
+ if (closeTimer) {
16
+ clearTimeout(closeTimer);
17
+ closeTimer = null;
18
+ }
19
+ if (delay === 0) {
20
+ setOpen(open);
21
+ return;
22
+ }
23
+ closeTimer = setTimeout(() => {
24
+ setOpen(open);
25
+ closeTimer = null;
26
+ }, delay);
27
+ }
28
+ const setOpen = (value) => {
29
+ isOpen.value = value;
30
+ };
31
+ function onMouseEnter() {
32
+ if (props.trigger != 'hover')
33
+ return;
34
+ delaySetOpen(true, props.delay);
35
+ }
36
+ const onMouseLeave = () => {
37
+ if (props.trigger != 'hover')
38
+ return;
39
+ delaySetOpen(false, props.delay);
40
+ };
41
+ debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
42
+ const __VLS_modelEmit = defineEmits();
43
+ const __VLS_defaults = {
44
+ align: "center",
45
+ sideOffset: 4,
46
+ delay: 100,
47
+ trigger: 'click',
48
+ triggerClass: '',
49
+ };
50
+ const __VLS_ctx = {
51
+ ...{},
52
+ ...{},
53
+ ...{},
54
+ ...{},
55
+ ...{},
56
+ };
57
+ let __VLS_elements;
58
+ let __VLS_components;
59
+ let __VLS_directives;
60
+ const __VLS_0 = {}.Popover;
61
+ /** @type {[typeof __VLS_components.Popover, typeof __VLS_components.Popover, ]} */ ;
62
+ // @ts-ignore
63
+ Popover;
64
+ // @ts-ignore
65
+ const __VLS_1 = __VLS_asFunctionalComponent(__VLS_0, new __VLS_0({
66
+ ...{ 'onUpdate:open': {} },
67
+ open: (__VLS_ctx.isOpen),
68
+ }));
69
+ const __VLS_2 = __VLS_1({
70
+ ...{ 'onUpdate:open': {} },
71
+ open: (__VLS_ctx.isOpen),
72
+ }, ...__VLS_functionalComponentArgsRest(__VLS_1));
73
+ let __VLS_4;
74
+ let __VLS_5;
75
+ const __VLS_6 = ({ 'update:open': {} },
76
+ { 'onUpdate:open': ((val) => __VLS_ctx.isOpen = val) });
77
+ var __VLS_7 = {};
78
+ const { default: __VLS_8 } = __VLS_3.slots;
79
+ // @ts-ignore
80
+ [isOpen, isOpen,];
81
+ const __VLS_9 = {}.PopoverTrigger;
82
+ /** @type {[typeof __VLS_components.PopoverTrigger, typeof __VLS_components.PopoverTrigger, ]} */ ;
83
+ // @ts-ignore
84
+ PopoverTrigger;
85
+ // @ts-ignore
86
+ const __VLS_10 = __VLS_asFunctionalComponent(__VLS_9, new __VLS_9({
87
+ ...{ 'onMouseenter': {} },
88
+ ...{ 'onMouseleave': {} },
89
+ ...{ class: (props.triggerClass) },
90
+ }));
91
+ const __VLS_11 = __VLS_10({
92
+ ...{ 'onMouseenter': {} },
93
+ ...{ 'onMouseleave': {} },
94
+ ...{ class: (props.triggerClass) },
95
+ }, ...__VLS_functionalComponentArgsRest(__VLS_10));
96
+ let __VLS_13;
97
+ let __VLS_14;
98
+ const __VLS_15 = ({ mouseenter: {} },
99
+ { onMouseenter: (__VLS_ctx.onMouseEnter) });
100
+ const __VLS_16 = ({ mouseleave: {} },
101
+ { onMouseleave: (__VLS_ctx.onMouseLeave) });
102
+ const { default: __VLS_17 } = __VLS_12.slots;
103
+ // @ts-ignore
104
+ [onMouseEnter, onMouseLeave,];
105
+ var __VLS_18 = {};
106
+ var __VLS_12;
107
+ if (!__VLS_ctx.disabled) {
108
+ // @ts-ignore
109
+ [disabled,];
110
+ const __VLS_20 = {}.PopoverContent;
111
+ /** @type {[typeof __VLS_components.PopoverContent, typeof __VLS_components.PopoverContent, ]} */ ;
112
+ // @ts-ignore
113
+ PopoverContent;
114
+ // @ts-ignore
115
+ const __VLS_21 = __VLS_asFunctionalComponent(__VLS_20, new __VLS_20({
116
+ ...{ 'onMouseenter': {} },
117
+ ...{ 'onMouseleave': {} },
118
+ side: (__VLS_ctx.side),
119
+ align: (__VLS_ctx.align),
120
+ }));
121
+ const __VLS_22 = __VLS_21({
122
+ ...{ 'onMouseenter': {} },
123
+ ...{ 'onMouseleave': {} },
124
+ side: (__VLS_ctx.side),
125
+ align: (__VLS_ctx.align),
126
+ }, ...__VLS_functionalComponentArgsRest(__VLS_21));
127
+ let __VLS_24;
128
+ let __VLS_25;
129
+ const __VLS_26 = ({ mouseenter: {} },
130
+ { onMouseenter: (__VLS_ctx.onMouseEnter) });
131
+ const __VLS_27 = ({ mouseleave: {} },
132
+ { onMouseleave: (__VLS_ctx.onMouseLeave) });
133
+ const { default: __VLS_28 } = __VLS_23.slots;
134
+ // @ts-ignore
135
+ [onMouseEnter, onMouseLeave, side, align,];
136
+ var __VLS_29 = {};
137
+ var __VLS_23;
138
+ }
139
+ var __VLS_3;
140
+ // @ts-ignore
141
+ var __VLS_19 = __VLS_18, __VLS_30 = __VLS_29;
142
+ const __VLS_base = (await import('vue')).defineComponent({
143
+ __typeEmits: {},
144
+ __typeProps: {},
145
+ props: {},
146
+ });
147
+ const __VLS_export = {};
148
+ export default {};
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -0,0 +1,12 @@
1
+ /// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
2
+ debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
3
+ const __VLS_ctx = {};
4
+ let __VLS_elements;
5
+ let __VLS_components;
6
+ let __VLS_directives;
7
+ __VLS_asFunctionalElement(__VLS_elements.span, __VLS_elements.span)({
8
+ ...{ class: "loader" },
9
+ });
10
+ /** @type {__VLS_StyleScopedClasses['loader']} */ ;
11
+ const __VLS_export = (await import('vue')).defineComponent({});
12
+ export default {};