@phonghq/go-chat 1.0.22 → 1.0.24

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 (41) hide show
  1. package/README.md +1 -1
  2. package/dist/assets/icons/IconSetting.vue.d.ts +2 -0
  3. package/dist/chat/App.vue.d.ts +2 -0
  4. package/dist/chat/page/home/ChatList.vue.d.ts +1 -1
  5. package/dist/chat/page/home/ChatMessageItem.vue.d.ts +11 -0
  6. package/dist/chat/page/home/Home.vue.d.ts +3 -0
  7. package/dist/components/chat/call/Calling.vue.d.ts +2 -0
  8. package/dist/components/chat/common/switch/SwitchBase.vue.d.ts +14 -0
  9. package/dist/components/chat/common/tab/TabBase.vue.d.ts +30 -0
  10. package/dist/composable/useListConversations.d.ts +46 -0
  11. package/dist/constant/color.d.ts +2 -2
  12. package/dist/go-chat.es.js +28483 -28311
  13. package/dist/go-chat.umd.js +13 -13
  14. package/dist/style.css +1 -1
  15. package/dist/test/assets/icons/IconSetting.vue.js +33 -0
  16. package/dist/test/chat/App.vue.js +105 -77
  17. package/dist/test/chat/page/home/ChatList.vue.js +226 -124
  18. package/dist/test/chat/page/home/ChatMessage.vue.js +19 -164
  19. package/dist/test/chat/page/home/ChatMessageItem.vue.js +321 -0
  20. package/dist/test/chat/page/home/Home.vue.js +14 -8
  21. package/dist/test/chat/page/home/HomeHeader.vue.js +18 -12
  22. package/dist/test/chat/page/home/InputChat.vue.js +62 -33
  23. package/dist/test/components/chat/call/Calling.vue.js +19 -22
  24. package/dist/test/components/chat/common/switch/SwitchBase.vue.js +70 -0
  25. package/dist/test/components/chat/common/tab/TabBase.vue.js +85 -0
  26. package/dist/test/components/chat/select/SelectBase.vue.js +15 -17
  27. package/dist/test/composable/useInitData.js +7 -4
  28. package/dist/test/composable/useListConversations.js +122 -0
  29. package/dist/test/composable/usePlivo.js +9 -3
  30. package/dist/test/constant/color.js +4 -2
  31. package/dist/test/types/chat/call.js +2 -1
  32. package/dist/test/utils/chat/auth.js +14 -0
  33. package/dist/test/utils/chat/phone-string.js +1 -1
  34. package/dist/types/chat/auth.d.ts +2 -0
  35. package/dist/types/chat/call.d.ts +1 -0
  36. package/dist/types/chat/global.d.ts +2 -1
  37. package/dist/types/conversation.d.ts +1 -0
  38. package/dist/types/message.d.ts +5 -0
  39. package/dist/utils/chat/auth.d.ts +5 -0
  40. package/dist/utils/chat/phone-string.d.ts +1 -1
  41. package/package.json +1 -1
@@ -5,16 +5,23 @@ import 'vue3-emoji-picker/css';
5
5
  import dayjs from 'dayjs';
6
6
  import { DATE_FORMATS, TIME_ZONE_UTC } from '../../../constant/datetime';
7
7
  import { dataProfile } from '../../../utils/chat/auth';
8
- import { ref } from 'vue';
8
+ import { computed, ref } from 'vue';
9
9
  import PopoverBase from '../../../components/chat/common/popover/PopoverBase.vue';
10
+ import SwitchBase from '../../../components/chat/common/switch/SwitchBase.vue';
10
11
  const props = withDefaults(defineProps(), {});
11
12
  const emit = defineEmits();
13
+ const ChatModeOptions = [
14
+ { value: '0', label: 'Go Chat' },
15
+ { value: '1', label: 'Go sms' }
16
+ ];
17
+ const modeLabel = computed(() => ChatModeOptions.find((v) => v.value === mode.value)?.label ?? '');
12
18
  const keyword = defineModel();
13
19
  let chatId = 1;
14
20
  const refInputImage = ref(null);
15
21
  const isLoadingImage = ref([]);
16
22
  const chatInputRef = ref(null);
17
23
  const emojiOpen = ref(false);
24
+ const mode = ref('0');
18
25
  const handleSendMessage = async (type) => {
19
26
  const tempId = Date.now();
20
27
  let messageContent = '';
@@ -77,11 +84,30 @@ const __VLS_ctx = {
77
84
  let __VLS_elements;
78
85
  let __VLS_components;
79
86
  let __VLS_directives;
87
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
88
+ ...{ class: "z-10" },
89
+ ...{ style: {} },
90
+ });
91
+ if (__VLS_ctx.dataProfile?.user_type == 'tenant') {
92
+ // @ts-ignore
93
+ [dataProfile,];
94
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
95
+ ...{ class: "mb-2" },
96
+ });
97
+ /** @type {[typeof SwitchBase, ]} */ ;
98
+ // @ts-ignore
99
+ const __VLS_0 = __VLS_asFunctionalComponent(SwitchBase, new SwitchBase({
100
+ label: "Active sms",
101
+ }));
102
+ const __VLS_1 = __VLS_0({
103
+ label: "Active sms",
104
+ }, ...__VLS_functionalComponentArgsRest(__VLS_0));
105
+ }
80
106
  __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
81
107
  ...{ class: "flex gap-2" },
82
108
  });
83
109
  __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
84
- ...{ class: "w-full relative grow" },
110
+ ...{ class: "relative grow" },
85
111
  });
86
112
  __VLS_asFunctionalElement(__VLS_elements.input)({
87
113
  ...{ onKeydown: (...[$event]) => {
@@ -89,7 +115,7 @@ __VLS_asFunctionalElement(__VLS_elements.input)({
89
115
  // @ts-ignore
90
116
  [handleSendMessage,];
91
117
  } },
92
- ...{ class: "w-full chat-input h-11 px-4 border border-chat-haze-200" },
118
+ ...{ class: "w-full chat-input !rounded-xl h-11 px-4 border border-chat-haze-200" },
93
119
  ref: "chatInputRef",
94
120
  placeholder: "Send Message",
95
121
  });
@@ -102,17 +128,17 @@ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
102
128
  });
103
129
  /** @type {[typeof PopoverBase, typeof PopoverBase, ]} */ ;
104
130
  // @ts-ignore
105
- const __VLS_0 = __VLS_asFunctionalComponent(PopoverBase, new PopoverBase({
131
+ const __VLS_4 = __VLS_asFunctionalComponent(PopoverBase, new PopoverBase({
106
132
  open: (__VLS_ctx.emojiOpen),
107
133
  align: "end",
108
134
  side: "top",
109
135
  }));
110
- const __VLS_1 = __VLS_0({
136
+ const __VLS_5 = __VLS_4({
111
137
  open: (__VLS_ctx.emojiOpen),
112
138
  align: "end",
113
139
  side: "top",
114
- }, ...__VLS_functionalComponentArgsRest(__VLS_0));
115
- const { default: __VLS_3 } = __VLS_2.slots;
140
+ }, ...__VLS_functionalComponentArgsRest(__VLS_4));
141
+ const { default: __VLS_7 } = __VLS_6.slots;
116
142
  // @ts-ignore
117
143
  [emojiOpen,];
118
144
  __VLS_asFunctionalElement(__VLS_elements.button, __VLS_elements.button)({
@@ -121,64 +147,64 @@ __VLS_asFunctionalElement(__VLS_elements.button, __VLS_elements.button)({
121
147
  // @ts-ignore
122
148
  [emojiOpen, emojiOpen,];
123
149
  } },
124
- ...{ class: "" },
150
+ ...{ class: "h-11 w-10" },
125
151
  });
126
152
  {
127
- const { content: __VLS_4 } = __VLS_2.slots;
128
- const __VLS_5 = {}.EmojiPicker;
153
+ const { content: __VLS_8 } = __VLS_6.slots;
154
+ const __VLS_9 = {}.EmojiPicker;
129
155
  /** @type {[typeof __VLS_components.EmojiPicker, typeof __VLS_components.emojiPicker, ]} */ ;
130
156
  // @ts-ignore
131
157
  EmojiPicker;
132
158
  // @ts-ignore
133
- const __VLS_6 = __VLS_asFunctionalComponent(__VLS_5, new __VLS_5({
159
+ const __VLS_10 = __VLS_asFunctionalComponent(__VLS_9, new __VLS_9({
134
160
  ...{ 'onSelect': {} },
135
161
  ...{ class: "!w-[300px]" },
136
162
  native: (true),
137
163
  offset: (2),
138
164
  hideSearch: true,
139
165
  }));
140
- const __VLS_7 = __VLS_6({
166
+ const __VLS_11 = __VLS_10({
141
167
  ...{ 'onSelect': {} },
142
168
  ...{ class: "!w-[300px]" },
143
169
  native: (true),
144
170
  offset: (2),
145
171
  hideSearch: true,
146
- }, ...__VLS_functionalComponentArgsRest(__VLS_6));
147
- let __VLS_9;
148
- let __VLS_10;
149
- const __VLS_11 = ({ select: {} },
172
+ }, ...__VLS_functionalComponentArgsRest(__VLS_10));
173
+ let __VLS_13;
174
+ let __VLS_14;
175
+ const __VLS_15 = ({ select: {} },
150
176
  { onSelect: (__VLS_ctx.onSelectEmoji) });
151
177
  // @ts-ignore
152
178
  [onSelectEmoji,];
153
- var __VLS_8;
179
+ var __VLS_12;
154
180
  }
155
- var __VLS_2;
156
- const __VLS_13 = {}.EmojiPicker;
181
+ var __VLS_6;
182
+ const __VLS_17 = {}.EmojiPicker;
157
183
  /** @type {[typeof __VLS_components.EmojiPicker, typeof __VLS_components.emojiPicker, ]} */ ;
158
184
  // @ts-ignore
159
185
  EmojiPicker;
160
186
  // @ts-ignore
161
- const __VLS_14 = __VLS_asFunctionalComponent(__VLS_13, new __VLS_13({
187
+ const __VLS_18 = __VLS_asFunctionalComponent(__VLS_17, new __VLS_17({
162
188
  ...{ 'onSelect': {} },
163
189
  ...{ class: "opacity-0 pointer-events-none absolute" },
164
190
  native: (true),
165
191
  offset: (2),
166
192
  hideSearch: true,
167
193
  }));
168
- const __VLS_15 = __VLS_14({
194
+ const __VLS_19 = __VLS_18({
169
195
  ...{ 'onSelect': {} },
170
196
  ...{ class: "opacity-0 pointer-events-none absolute" },
171
197
  native: (true),
172
198
  offset: (2),
173
199
  hideSearch: true,
174
- }, ...__VLS_functionalComponentArgsRest(__VLS_14));
175
- let __VLS_17;
176
- let __VLS_18;
177
- const __VLS_19 = ({ select: {} },
200
+ }, ...__VLS_functionalComponentArgsRest(__VLS_18));
201
+ let __VLS_21;
202
+ let __VLS_22;
203
+ const __VLS_23 = ({ select: {} },
178
204
  { onSelect: (__VLS_ctx.onSelectEmoji) });
179
205
  // @ts-ignore
180
206
  [onSelectEmoji,];
181
- var __VLS_16;
207
+ var __VLS_20;
182
208
  __VLS_asFunctionalElement(__VLS_elements.button, __VLS_elements.button)({
183
209
  ...{ onClick: (...[$event]) => {
184
210
  __VLS_ctx.handleSendMessage('message');
@@ -189,8 +215,8 @@ __VLS_asFunctionalElement(__VLS_elements.button, __VLS_elements.button)({
189
215
  });
190
216
  /** @type {[typeof IconPlan, ]} */ ;
191
217
  // @ts-ignore
192
- const __VLS_21 = __VLS_asFunctionalComponent(IconPlan, new IconPlan({}));
193
- const __VLS_22 = __VLS_21({}, ...__VLS_functionalComponentArgsRest(__VLS_21));
218
+ const __VLS_25 = __VLS_asFunctionalComponent(IconPlan, new IconPlan({}));
219
+ const __VLS_26 = __VLS_25({}, ...__VLS_functionalComponentArgsRest(__VLS_25));
194
220
  __VLS_asFunctionalElement(__VLS_elements.label, __VLS_elements.label)({
195
221
  ...{ class: "shrink-0 cursor-pointer relative" },
196
222
  });
@@ -209,20 +235,21 @@ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
209
235
  });
210
236
  /** @type {[typeof IconPlus, ]} */ ;
211
237
  // @ts-ignore
212
- const __VLS_25 = __VLS_asFunctionalComponent(IconPlus, new IconPlus({
238
+ const __VLS_29 = __VLS_asFunctionalComponent(IconPlus, new IconPlus({
213
239
  ...{ class: "text-white" },
214
240
  }));
215
- const __VLS_26 = __VLS_25({
241
+ const __VLS_30 = __VLS_29({
216
242
  ...{ class: "text-white" },
217
- }, ...__VLS_functionalComponentArgsRest(__VLS_25));
218
- /** @type {__VLS_StyleScopedClasses['']} */ ;
243
+ }, ...__VLS_functionalComponentArgsRest(__VLS_29));
244
+ /** @type {__VLS_StyleScopedClasses['z-10']} */ ;
245
+ /** @type {__VLS_StyleScopedClasses['mb-2']} */ ;
219
246
  /** @type {__VLS_StyleScopedClasses['flex']} */ ;
220
247
  /** @type {__VLS_StyleScopedClasses['gap-2']} */ ;
221
- /** @type {__VLS_StyleScopedClasses['w-full']} */ ;
222
248
  /** @type {__VLS_StyleScopedClasses['relative']} */ ;
223
249
  /** @type {__VLS_StyleScopedClasses['grow']} */ ;
224
250
  /** @type {__VLS_StyleScopedClasses['w-full']} */ ;
225
251
  /** @type {__VLS_StyleScopedClasses['chat-input']} */ ;
252
+ /** @type {__VLS_StyleScopedClasses['!rounded-xl']} */ ;
226
253
  /** @type {__VLS_StyleScopedClasses['h-11']} */ ;
227
254
  /** @type {__VLS_StyleScopedClasses['px-4']} */ ;
228
255
  /** @type {__VLS_StyleScopedClasses['border']} */ ;
@@ -232,6 +259,8 @@ const __VLS_26 = __VLS_25({
232
259
  /** @type {__VLS_StyleScopedClasses['absolute']} */ ;
233
260
  /** @type {__VLS_StyleScopedClasses['right-0']} */ ;
234
261
  /** @type {__VLS_StyleScopedClasses['bottom-0']} */ ;
262
+ /** @type {__VLS_StyleScopedClasses['h-11']} */ ;
263
+ /** @type {__VLS_StyleScopedClasses['w-10']} */ ;
235
264
  /** @type {__VLS_StyleScopedClasses['!w-[300px]']} */ ;
236
265
  /** @type {__VLS_StyleScopedClasses['opacity-0']} */ ;
237
266
  /** @type {__VLS_StyleScopedClasses['pointer-events-none']} */ ;
@@ -3,7 +3,6 @@ import IconPhone from '../../../assets/icons/call/IconPhone.vue';
3
3
  import { dataProfile } from '../../../utils/chat/auth.js';
4
4
  import { useCallHelper } from '../../../composable/useCallHelper';
5
5
  import IconPhoneCancel from '../../../assets/icons/call/IconPhoneCancel.vue';
6
- import { removeHandleWebSK } from '../../../plugins/websocket';
7
6
  import { downloadRecord } from '../../../utils/chat/call';
8
7
  import DrawerBaseCustom from '../../../components/common/drawer/DrawerBaseCustom.vue';
9
8
  import Avatar from '../../../components/chat/customer/Avatar.vue';
@@ -14,7 +13,9 @@ import IconClose from '../../../assets/icons/call/IconClose.vue';
14
13
  import { usePlivo } from '../../../composable/usePlivo';
15
14
  import { PLIVO_CALL_STATUS } from '../../../types/chat/call';
16
15
  import IconMic from '../../../assets/icons/call/IconMic.vue';
17
- const { call, end, handleMedia, startIncomingCall, handleCallAnswer, callAnswer, uuid, startPeerConnection } = useCallHelper();
16
+ const props = withDefaults(defineProps(), {});
17
+ const emit = defineEmits();
18
+ const {} = useCallHelper();
18
19
  const handlePlivoCallBack = (status, data) => {
19
20
  if (status == PLIVO_CALL_STATUS.RINGING) {
20
21
  getUserOffer(data?.phone ?? '');
@@ -27,7 +28,9 @@ const handlePlivoCallBack = (status, data) => {
27
28
  }
28
29
  else if (status == PLIVO_CALL_STATUS.CALL_END) {
29
30
  errorMessage.value = data?.message ?? '';
30
- endCall();
31
+ const closeModal = data?.reason == 'ORIGINATOR_CANCEL';
32
+ emit('endCall', userRemoter.value);
33
+ endCall({ closeModal });
31
34
  callStatus.value = status;
32
35
  }
33
36
  else if (status == PLIVO_CALL_STATUS.CALL_START) {
@@ -36,8 +39,6 @@ const handlePlivoCallBack = (status, data) => {
36
39
  }
37
40
  };
38
41
  const { plivoLogin, plivoCallAnswer, plivoCall, plivoEndCall, plivoCallSwishMute } = usePlivo(handlePlivoCallBack);
39
- const props = withDefaults(defineProps(), {});
40
- const emit = defineEmits();
41
42
  const STATUS_LABEL = computed(() => {
42
43
  return {
43
44
  [PLIVO_CALL_STATUS.CONNECTING]: 'Connecting...',
@@ -46,7 +47,8 @@ const STATUS_LABEL = computed(() => {
46
47
  [PLIVO_CALL_STATUS.CONNECT_FAILED]: errorMessage.value || 'Connect Error',
47
48
  [PLIVO_CALL_STATUS.CALL_START]: '',
48
49
  [PLIVO_CALL_STATUS.CALL_END]: errorMessage.value || 'Call Ended',
49
- [PLIVO_CALL_STATUS.NO_ANSWER]: 'No Answer'
50
+ [PLIVO_CALL_STATUS.NO_ANSWER]: 'No Answer',
51
+ [PLIVO_CALL_STATUS.CANCEL]: ''
50
52
  };
51
53
  });
52
54
  const label = computed(() => STATUS_LABEL.value[callStatus.value] ?? '');
@@ -67,7 +69,7 @@ onMounted(async () => {
67
69
  await plivoLogin('');
68
70
  });
69
71
  onUnmounted(() => {
70
- removeHandleWebSK('call-message');
72
+ // removeHandleWebSK('call-message')
71
73
  if (timer)
72
74
  clearInterval(timer);
73
75
  if (timeOut)
@@ -85,15 +87,14 @@ function startTimer() {
85
87
  }, 1000);
86
88
  }
87
89
  function endCall(option) {
90
+ if (option?.closeModal || true) {
91
+ drawerVisible.value = false;
92
+ drawerVisibleRef.value?.close();
93
+ }
88
94
  plivoEndCall(callStatus.value);
89
95
  callStatus.value = PLIVO_CALL_STATUS.CALL_END;
90
- uuidEnd = uuid.value;
91
96
  clearInterval(timer);
92
97
  disable.value = false;
93
- if (option?.closeModal) {
94
- drawerVisible.value = false;
95
- drawerVisibleRef.value?.close();
96
- }
97
98
  isMute.value = false;
98
99
  duration.value = '00:00';
99
100
  if (timer)
@@ -282,9 +283,9 @@ const { default: __VLS_8 } = __VLS_2.slots;
282
283
  __VLS_asFunctionalElement(__VLS_elements.h2, __VLS_elements.h2)({
283
284
  ...{ class: "text-2xl font-semibold" },
284
285
  });
285
- (__VLS_ctx.userRemoter?.username);
286
+ (__VLS_ctx.userRemoter?.username || __VLS_ctx.formatPhone10number(__VLS_ctx.userRemoter?.phone ?? ''));
286
287
  // @ts-ignore
287
- [userRemoter,];
288
+ [userRemoter, userRemoter, formatPhone10number,];
288
289
  __VLS_asFunctionalElement(__VLS_elements.p, __VLS_elements.p)({
289
290
  ...{ class: "text-gray-400 mt-1" },
290
291
  });
@@ -299,7 +300,7 @@ const { default: __VLS_8 } = __VLS_2.slots;
299
300
  [callStatus, PLIVO_CALL_STATUS,];
300
301
  __VLS_asFunctionalElement(__VLS_elements.button, __VLS_elements.button)({
301
302
  ...{ onClick: (__VLS_ctx.answer) },
302
- ...{ class: "w-16 h-16 bg-[#22C55E] hover:bg-green-600 text-white rounded-full flex items-center justify-center shadow-lg transition" },
303
+ ...{ class: "w-16 h-16 bg-chat-success hover:bg-green-600 text-white rounded-full flex items-center justify-center shadow-lg transition" },
303
304
  });
304
305
  // @ts-ignore
305
306
  [answer,];
@@ -377,7 +378,7 @@ const { default: __VLS_8 } = __VLS_2.slots;
377
378
  // @ts-ignore
378
379
  [endCall,];
379
380
  } },
380
- ...{ class: "w-16 h-16 rounded-full bg-[#EF4444] hover:bg-red-700 flex items-center justify-center" },
381
+ ...{ class: "w-16 h-16 rounded-full bg-chat-error hover:bg-red-700 flex items-center justify-center" },
381
382
  });
382
383
  /** @type {[typeof IconPhoneCancel, ]} */ ;
383
384
  // @ts-ignore
@@ -392,10 +393,6 @@ const { default: __VLS_8 } = __VLS_2.slots;
392
393
  [duration,];
393
394
  }
394
395
  var __VLS_2;
395
- __VLS_asFunctionalElement(__VLS_elements.audio, __VLS_elements.audio)({
396
- id: "go-chat-remote-audio",
397
- autoplay: true,
398
- });
399
396
  /** @type {__VLS_StyleScopedClasses['']} */ ;
400
397
  /** @type {__VLS_StyleScopedClasses['flex']} */ ;
401
398
  /** @type {__VLS_StyleScopedClasses['flex-col']} */ ;
@@ -425,7 +422,7 @@ __VLS_asFunctionalElement(__VLS_elements.audio, __VLS_elements.audio)({
425
422
  /** @type {__VLS_StyleScopedClasses['mt-10']} */ ;
426
423
  /** @type {__VLS_StyleScopedClasses['w-16']} */ ;
427
424
  /** @type {__VLS_StyleScopedClasses['h-16']} */ ;
428
- /** @type {__VLS_StyleScopedClasses['bg-[#22C55E]']} */ ;
425
+ /** @type {__VLS_StyleScopedClasses['bg-chat-success']} */ ;
429
426
  /** @type {__VLS_StyleScopedClasses['hover:bg-green-600']} */ ;
430
427
  /** @type {__VLS_StyleScopedClasses['text-white']} */ ;
431
428
  /** @type {__VLS_StyleScopedClasses['rounded-full']} */ ;
@@ -470,7 +467,7 @@ __VLS_asFunctionalElement(__VLS_elements.audio, __VLS_elements.audio)({
470
467
  /** @type {__VLS_StyleScopedClasses['w-16']} */ ;
471
468
  /** @type {__VLS_StyleScopedClasses['h-16']} */ ;
472
469
  /** @type {__VLS_StyleScopedClasses['rounded-full']} */ ;
473
- /** @type {__VLS_StyleScopedClasses['bg-[#EF4444]']} */ ;
470
+ /** @type {__VLS_StyleScopedClasses['bg-chat-error']} */ ;
474
471
  /** @type {__VLS_StyleScopedClasses['hover:bg-red-700']} */ ;
475
472
  /** @type {__VLS_StyleScopedClasses['flex']} */ ;
476
473
  /** @type {__VLS_StyleScopedClasses['items-center']} */ ;
@@ -0,0 +1,70 @@
1
+ /// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
2
+ const props = withDefaults(defineProps(), {});
3
+ const result = defineModel();
4
+ debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
5
+ const __VLS_modelEmit = defineEmits();
6
+ const __VLS_defaults = {};
7
+ const __VLS_ctx = {
8
+ ...{},
9
+ ...{},
10
+ ...{},
11
+ ...{},
12
+ ...{},
13
+ };
14
+ let __VLS_elements;
15
+ let __VLS_components;
16
+ let __VLS_directives;
17
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
18
+ ...{ onClick: (...[$event]) => {
19
+ __VLS_ctx.result = !__VLS_ctx.result;
20
+ // @ts-ignore
21
+ [result, result,];
22
+ } },
23
+ ...{ class: "flex items-center gap-2 cursor-pointer w-max" },
24
+ });
25
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
26
+ ...{ class: "w-10 h-5 flex items-center bg-chat-haze-300 rounded-full p-1 cursor-pointer transition" },
27
+ ...{ class: (__VLS_ctx.result ? 'bg-chat-primary' : 'bg-chat-haze-300') },
28
+ });
29
+ // @ts-ignore
30
+ [result,];
31
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
32
+ ...{ class: "bg-white w-4 h-4 rounded-full shadow transform transition" },
33
+ ...{ class: (__VLS_ctx.result ? 'translate-x-4' : '') },
34
+ });
35
+ // @ts-ignore
36
+ [result,];
37
+ __VLS_asFunctionalElement(__VLS_elements.span, __VLS_elements.span)({
38
+ ...{ class: "font-semibold" },
39
+ });
40
+ (__VLS_ctx.label ?? '');
41
+ // @ts-ignore
42
+ [label,];
43
+ /** @type {__VLS_StyleScopedClasses['flex']} */ ;
44
+ /** @type {__VLS_StyleScopedClasses['items-center']} */ ;
45
+ /** @type {__VLS_StyleScopedClasses['gap-2']} */ ;
46
+ /** @type {__VLS_StyleScopedClasses['cursor-pointer']} */ ;
47
+ /** @type {__VLS_StyleScopedClasses['w-max']} */ ;
48
+ /** @type {__VLS_StyleScopedClasses['w-10']} */ ;
49
+ /** @type {__VLS_StyleScopedClasses['h-5']} */ ;
50
+ /** @type {__VLS_StyleScopedClasses['flex']} */ ;
51
+ /** @type {__VLS_StyleScopedClasses['items-center']} */ ;
52
+ /** @type {__VLS_StyleScopedClasses['bg-chat-haze-300']} */ ;
53
+ /** @type {__VLS_StyleScopedClasses['rounded-full']} */ ;
54
+ /** @type {__VLS_StyleScopedClasses['p-1']} */ ;
55
+ /** @type {__VLS_StyleScopedClasses['cursor-pointer']} */ ;
56
+ /** @type {__VLS_StyleScopedClasses['transition']} */ ;
57
+ /** @type {__VLS_StyleScopedClasses['bg-white']} */ ;
58
+ /** @type {__VLS_StyleScopedClasses['w-4']} */ ;
59
+ /** @type {__VLS_StyleScopedClasses['h-4']} */ ;
60
+ /** @type {__VLS_StyleScopedClasses['rounded-full']} */ ;
61
+ /** @type {__VLS_StyleScopedClasses['shadow']} */ ;
62
+ /** @type {__VLS_StyleScopedClasses['transform']} */ ;
63
+ /** @type {__VLS_StyleScopedClasses['transition']} */ ;
64
+ /** @type {__VLS_StyleScopedClasses['font-semibold']} */ ;
65
+ const __VLS_export = (await import('vue')).defineComponent({
66
+ __typeEmits: {},
67
+ __typeProps: {},
68
+ props: {},
69
+ });
70
+ export default {};
@@ -0,0 +1,85 @@
1
+ const props = withDefaults(defineProps(), {});
2
+ const emit = defineEmits();
3
+ const active = defineModel('active');
4
+ const handleTabClick = (tab) => {
5
+ active.value = tab.value;
6
+ emit('change', tab.value);
7
+ };
8
+ debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
9
+ const __VLS_modelEmit = defineEmits();
10
+ const __VLS_defaults = {};
11
+ const __VLS_ctx = {
12
+ ...{},
13
+ ...{},
14
+ ...{},
15
+ ...{},
16
+ ...{},
17
+ };
18
+ let __VLS_elements;
19
+ let __VLS_components;
20
+ let __VLS_directives;
21
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
22
+ ...{ class: "w-full" },
23
+ });
24
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
25
+ ...{ class: "flex p-1 bg-chat-haze-200 w-max rounded-xl" },
26
+ });
27
+ for (const [tab] of __VLS_getVForSourceType((__VLS_ctx.tabs))) {
28
+ // @ts-ignore
29
+ [tabs,];
30
+ __VLS_asFunctionalElement(__VLS_elements.button, __VLS_elements.button)({
31
+ ...{ onClick: (...[$event]) => {
32
+ __VLS_ctx.handleTabClick(tab);
33
+ // @ts-ignore
34
+ [handleTabClick,];
35
+ } },
36
+ key: (tab.value),
37
+ ...{ class: "px-4 py-2 rounded-xl text-sm font-medium relative" },
38
+ ...{ class: (__VLS_ctx.active === tab.value ? 'bg-white' : '') },
39
+ });
40
+ // @ts-ignore
41
+ [active,];
42
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
43
+ ...{ class: "w-5 h-5 bg-chat-error rounded-full absolute -top-[8px] -right-2 text-white" },
44
+ });
45
+ __VLS_asFunctionalDirective(__VLS_directives.vShow)(null, { ...__VLS_directiveBindingRestFields, value: (tab.badge) }, null, null);
46
+ (tab.badge);
47
+ (tab.label);
48
+ }
49
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
50
+ ...{ class: "mt-4" },
51
+ });
52
+ var __VLS_0 = {};
53
+ var __VLS_1 = __VLS_tryAsConstant(__VLS_ctx.active);
54
+ // @ts-ignore
55
+ [active,];
56
+ /** @type {__VLS_StyleScopedClasses['w-full']} */ ;
57
+ /** @type {__VLS_StyleScopedClasses['flex']} */ ;
58
+ /** @type {__VLS_StyleScopedClasses['p-1']} */ ;
59
+ /** @type {__VLS_StyleScopedClasses['bg-chat-haze-200']} */ ;
60
+ /** @type {__VLS_StyleScopedClasses['w-max']} */ ;
61
+ /** @type {__VLS_StyleScopedClasses['rounded-xl']} */ ;
62
+ /** @type {__VLS_StyleScopedClasses['px-4']} */ ;
63
+ /** @type {__VLS_StyleScopedClasses['py-2']} */ ;
64
+ /** @type {__VLS_StyleScopedClasses['rounded-xl']} */ ;
65
+ /** @type {__VLS_StyleScopedClasses['text-sm']} */ ;
66
+ /** @type {__VLS_StyleScopedClasses['font-medium']} */ ;
67
+ /** @type {__VLS_StyleScopedClasses['relative']} */ ;
68
+ /** @type {__VLS_StyleScopedClasses['w-5']} */ ;
69
+ /** @type {__VLS_StyleScopedClasses['h-5']} */ ;
70
+ /** @type {__VLS_StyleScopedClasses['bg-chat-error']} */ ;
71
+ /** @type {__VLS_StyleScopedClasses['rounded-full']} */ ;
72
+ /** @type {__VLS_StyleScopedClasses['absolute']} */ ;
73
+ /** @type {__VLS_StyleScopedClasses['-top-[8px]']} */ ;
74
+ /** @type {__VLS_StyleScopedClasses['-right-2']} */ ;
75
+ /** @type {__VLS_StyleScopedClasses['text-white']} */ ;
76
+ /** @type {__VLS_StyleScopedClasses['mt-4']} */ ;
77
+ // @ts-ignore
78
+ var __VLS_2 = __VLS_1, __VLS_3 = __VLS_0;
79
+ const __VLS_base = (await import('vue')).defineComponent({
80
+ __typeEmits: {},
81
+ __typeProps: {},
82
+ props: {},
83
+ });
84
+ const __VLS_export = {};
85
+ export default {};
@@ -37,12 +37,8 @@ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
37
37
  });
38
38
  // @ts-ignore
39
39
  [toggle,];
40
- __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
41
- ...{ class: "cursor-pointer pointer-events-none" },
42
- });
43
- var __VLS_0 = {};
44
40
  __VLS_asFunctionalElement(__VLS_elements.ul, __VLS_elements.ul)({
45
- ...{ class: "w-max absolute right-0 z-10 mt-1 max-h-48 overflow-auto rounded-md border border-gray-200 bg-white shadow-lg" },
41
+ ...{ class: "w-max absolute -top-4 -translate-y-full left-0 z-10 mt-1 max-h-48 overflow-auto rounded-md shadow-custom bg-white shadow-lg" },
46
42
  });
47
43
  __VLS_asFunctionalDirective(__VLS_directives.vShow)(null, { ...__VLS_directiveBindingRestFields, value: (__VLS_ctx.open) }, null, null);
48
44
  // @ts-ignore
@@ -57,37 +53,39 @@ for (const [option, idx] of __VLS_getVForSourceType((__VLS_ctx.options))) {
57
53
  [select,];
58
54
  } },
59
55
  key: (idx),
60
- ...{ class: "cursor-pointer text-black px-3 py-2 hover:bg-chat-haze-200" },
61
- ...{ class: ({ 'bg-primary !text-white': option.value === __VLS_ctx.modelValue }) },
56
+ ...{ class: "cursor-pointer text-black px-6 py-2 hover:bg-chat-haze-200 border-b border-chat-haze-200" },
62
57
  });
63
- // @ts-ignore
64
- [modelValue,];
65
58
  (option.label);
66
59
  }
60
+ __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
61
+ ...{ class: "cursor-pointer pointer-events-none" },
62
+ });
63
+ var __VLS_0 = {};
67
64
  /** @type {__VLS_StyleScopedClasses['relative']} */ ;
68
65
  /** @type {__VLS_StyleScopedClasses['inline-block']} */ ;
69
66
  /** @type {__VLS_StyleScopedClasses['w-full']} */ ;
70
- /** @type {__VLS_StyleScopedClasses['cursor-pointer']} */ ;
71
- /** @type {__VLS_StyleScopedClasses['pointer-events-none']} */ ;
72
67
  /** @type {__VLS_StyleScopedClasses['w-max']} */ ;
73
68
  /** @type {__VLS_StyleScopedClasses['absolute']} */ ;
74
- /** @type {__VLS_StyleScopedClasses['right-0']} */ ;
69
+ /** @type {__VLS_StyleScopedClasses['-top-4']} */ ;
70
+ /** @type {__VLS_StyleScopedClasses['-translate-y-full']} */ ;
71
+ /** @type {__VLS_StyleScopedClasses['left-0']} */ ;
75
72
  /** @type {__VLS_StyleScopedClasses['z-10']} */ ;
76
73
  /** @type {__VLS_StyleScopedClasses['mt-1']} */ ;
77
74
  /** @type {__VLS_StyleScopedClasses['max-h-48']} */ ;
78
75
  /** @type {__VLS_StyleScopedClasses['overflow-auto']} */ ;
79
76
  /** @type {__VLS_StyleScopedClasses['rounded-md']} */ ;
80
- /** @type {__VLS_StyleScopedClasses['border']} */ ;
81
- /** @type {__VLS_StyleScopedClasses['border-gray-200']} */ ;
77
+ /** @type {__VLS_StyleScopedClasses['shadow-custom']} */ ;
82
78
  /** @type {__VLS_StyleScopedClasses['bg-white']} */ ;
83
79
  /** @type {__VLS_StyleScopedClasses['shadow-lg']} */ ;
84
80
  /** @type {__VLS_StyleScopedClasses['cursor-pointer']} */ ;
85
81
  /** @type {__VLS_StyleScopedClasses['text-black']} */ ;
86
- /** @type {__VLS_StyleScopedClasses['px-3']} */ ;
82
+ /** @type {__VLS_StyleScopedClasses['px-6']} */ ;
87
83
  /** @type {__VLS_StyleScopedClasses['py-2']} */ ;
88
84
  /** @type {__VLS_StyleScopedClasses['hover:bg-chat-haze-200']} */ ;
89
- /** @type {__VLS_StyleScopedClasses['bg-primary']} */ ;
90
- /** @type {__VLS_StyleScopedClasses['!text-white']} */ ;
85
+ /** @type {__VLS_StyleScopedClasses['border-b']} */ ;
86
+ /** @type {__VLS_StyleScopedClasses['border-chat-haze-200']} */ ;
87
+ /** @type {__VLS_StyleScopedClasses['cursor-pointer']} */ ;
88
+ /** @type {__VLS_StyleScopedClasses['pointer-events-none']} */ ;
91
89
  // @ts-ignore
92
90
  var __VLS_1 = __VLS_0;
93
91
  const __VLS_base = (await import('vue')).defineComponent({
@@ -1,11 +1,10 @@
1
1
  import { ref } from 'vue';
2
2
  import { sdkInit } from '../plugins/sdk';
3
- import { dataProfile, getProfile, loginLink } from '../utils/chat/auth';
3
+ import { checkTenantPhone, dataProfile, getProfile, loginLink } from '../utils/chat/auth';
4
4
  import { routerPush } from '../utils/chat/chat-router';
5
5
  import { PAGE } from '../constant/general';
6
6
  import { subscribeToTopic, unsubscribeFromTopic } from '../plugins/mqtt';
7
7
  import { TOPIC_DETAIL_CALL } from '../constant/mqtt';
8
- import { getWebSocket, initWebSocket } from '../plugins/websocket';
9
8
  // import router from '../router'
10
9
  //PINIA
11
10
  export const isRouterReady = ref(false);
@@ -34,8 +33,12 @@ export function useInitData() {
34
33
  };
35
34
  const initData = async (props, response) => {
36
35
  const res = await getProfile();
37
- await getWebSocket();
38
- initWebSocket();
36
+ if (dataProfile.value?.user_type == 'tenant') {
37
+ await checkTenantPhone();
38
+ }
39
+ // await Promise.all([ getProfile(), checkTenantPhone()])
40
+ // await getWebSocket()
41
+ // initWebSocket()
39
42
  unsubscribeFromTopic(TOPIC_DETAIL_CALL + dataProfile.value?.id);
40
43
  subscribeToTopic(TOPIC_DETAIL_CALL + dataProfile.value?.id);
41
44
  // if((!res?.phone && res.tenant_id && !props.isLib)) {