@phonghq/go-chat 1.0.49 → 1.0.50

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.
@@ -330,11 +330,13 @@ else {
330
330
  // @ts-ignore
331
331
  const __VLS_27 = __VLS_asFunctionalComponent(Calling, new Calling({
332
332
  ...{ 'onUserCalling': {} },
333
+ ...{ 'onEndCall': {} },
333
334
  ref: "callingRef",
334
335
  responsive: (__VLS_ctx.responsiveRender),
335
336
  }));
336
337
  const __VLS_28 = __VLS_27({
337
338
  ...{ 'onUserCalling': {} },
339
+ ...{ 'onEndCall': {} },
338
340
  ref: "callingRef",
339
341
  responsive: (__VLS_ctx.responsiveRender),
340
342
  }, ...__VLS_functionalComponentArgsRest(__VLS_27));
@@ -358,8 +360,26 @@ else {
358
360
  // @ts-ignore
359
361
  [responsiveRender, emit,];
360
362
  } });
363
+ const __VLS_33 = ({ endCall: {} },
364
+ { onEndCall: (...[$event]) => {
365
+ if (!!(!__VLS_ctx.isRouterReady))
366
+ return;
367
+ if (!!(__VLS_ctx.currentPage == __VLS_ctx.PAGE.TENANT_ERROR))
368
+ return;
369
+ if (!!(__VLS_ctx.currentPage == __VLS_ctx.PAGE.REGISTER_TENANT))
370
+ return;
371
+ if (!!(__VLS_ctx.currentPage == __VLS_ctx.PAGE.REGISTER_SUCCESS))
372
+ return;
373
+ if (!!(__VLS_ctx.currentPage == __VLS_ctx.PAGE.NOT_TENANT_PHONE))
374
+ return;
375
+ if (!(__VLS_ctx.isLib))
376
+ return;
377
+ __VLS_ctx.emit('endCall');
378
+ // @ts-ignore
379
+ [emit,];
380
+ } });
361
381
  /** @type {typeof __VLS_ctx.callingRef} */ ;
362
- var __VLS_33 = {};
382
+ var __VLS_34 = {};
363
383
  // @ts-ignore
364
384
  [callingRef,];
365
385
  var __VLS_29;
@@ -403,8 +423,8 @@ else {
403
423
  });
404
424
  /** @type {[typeof IconArrowLeft, ]} */ ;
405
425
  // @ts-ignore
406
- const __VLS_36 = __VLS_asFunctionalComponent(IconArrowLeft, new IconArrowLeft({}));
407
- const __VLS_37 = __VLS_36({}, ...__VLS_functionalComponentArgsRest(__VLS_36));
426
+ const __VLS_37 = __VLS_asFunctionalComponent(IconArrowLeft, new IconArrowLeft({}));
427
+ const __VLS_38 = __VLS_37({}, ...__VLS_functionalComponentArgsRest(__VLS_37));
408
428
  __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
409
429
  ...{ class: "ml-3" },
410
430
  });
@@ -465,15 +485,15 @@ else {
465
485
  });
466
486
  /** @type {[typeof IconCloseCircle, ]} */ ;
467
487
  // @ts-ignore
468
- const __VLS_40 = __VLS_asFunctionalComponent(IconCloseCircle, new IconCloseCircle({}));
469
- const __VLS_41 = __VLS_40({}, ...__VLS_functionalComponentArgsRest(__VLS_40));
488
+ const __VLS_41 = __VLS_asFunctionalComponent(IconCloseCircle, new IconCloseCircle({}));
489
+ const __VLS_42 = __VLS_41({}, ...__VLS_functionalComponentArgsRest(__VLS_41));
470
490
  }
471
491
  __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
472
492
  ...{ class: "grow overflow-hidden" },
473
493
  });
474
494
  /** @type {[typeof ChatList, ]} */ ;
475
495
  // @ts-ignore
476
- const __VLS_44 = __VLS_asFunctionalComponent(ChatList, new ChatList({
496
+ const __VLS_45 = __VLS_asFunctionalComponent(ChatList, new ChatList({
477
497
  ...{ 'onSelectReceiver': {} },
478
498
  ...{ 'onOpenPhoneNumpad': {} },
479
499
  ref: "chatListRef",
@@ -481,19 +501,19 @@ else {
481
501
  responsive: (__VLS_ctx.responsiveRender),
482
502
  receiverId: (__VLS_ctx.receiverId),
483
503
  }));
484
- const __VLS_45 = __VLS_44({
504
+ const __VLS_46 = __VLS_45({
485
505
  ...{ 'onSelectReceiver': {} },
486
506
  ...{ 'onOpenPhoneNumpad': {} },
487
507
  ref: "chatListRef",
488
508
  ...{ class: "w-full max-w-[500px] !bg-[#F9FAFC]" },
489
509
  responsive: (__VLS_ctx.responsiveRender),
490
510
  receiverId: (__VLS_ctx.receiverId),
491
- }, ...__VLS_functionalComponentArgsRest(__VLS_44));
492
- let __VLS_47;
511
+ }, ...__VLS_functionalComponentArgsRest(__VLS_45));
493
512
  let __VLS_48;
494
- const __VLS_49 = ({ selectReceiver: {} },
513
+ let __VLS_49;
514
+ const __VLS_50 = ({ selectReceiver: {} },
495
515
  { onSelectReceiver: (__VLS_ctx.selectReceiver) });
496
- const __VLS_50 = ({ openPhoneNumpad: {} },
516
+ const __VLS_51 = ({ openPhoneNumpad: {} },
497
517
  { onOpenPhoneNumpad: (...[$event]) => {
498
518
  if (!!(!__VLS_ctx.isRouterReady))
499
519
  return;
@@ -513,13 +533,13 @@ else {
513
533
  } });
514
534
  __VLS_asFunctionalDirective(__VLS_directives.vShow)(null, { ...__VLS_directiveBindingRestFields, value: (__VLS_ctx.currentPage == __VLS_ctx.PAGE.CHAT_LIST) }, null, null);
515
535
  /** @type {typeof __VLS_ctx.chatListRef} */ ;
516
- var __VLS_51 = {};
536
+ var __VLS_52 = {};
517
537
  // @ts-ignore
518
538
  [currentPage, PAGE, chatListRef,];
519
- var __VLS_46;
539
+ var __VLS_47;
520
540
  /** @type {[typeof HomeComponent, ]} */ ;
521
541
  // @ts-ignore
522
- const __VLS_54 = __VLS_asFunctionalComponent(HomeComponent, new HomeComponent({
542
+ const __VLS_55 = __VLS_asFunctionalComponent(HomeComponent, new HomeComponent({
523
543
  ...{ 'onCall': {} },
524
544
  ...{ 'onBack': {} },
525
545
  ...{ 'onInputFocus': {} },
@@ -529,7 +549,7 @@ else {
529
549
  conversation: (__VLS_ctx.currentConversation),
530
550
  responsive: (__VLS_ctx.responsiveRender),
531
551
  }));
532
- const __VLS_55 = __VLS_54({
552
+ const __VLS_56 = __VLS_55({
533
553
  ...{ 'onCall': {} },
534
554
  ...{ 'onBack': {} },
535
555
  ...{ 'onInputFocus': {} },
@@ -538,12 +558,12 @@ else {
538
558
  ...{ class: "h-full" },
539
559
  conversation: (__VLS_ctx.currentConversation),
540
560
  responsive: (__VLS_ctx.responsiveRender),
541
- }, ...__VLS_functionalComponentArgsRest(__VLS_54));
542
- let __VLS_57;
561
+ }, ...__VLS_functionalComponentArgsRest(__VLS_55));
543
562
  let __VLS_58;
544
- const __VLS_59 = ({ call: {} },
563
+ let __VLS_59;
564
+ const __VLS_60 = ({ call: {} },
545
565
  { onCall: (__VLS_ctx.handleCall) });
546
- const __VLS_60 = ({ back: {} },
566
+ const __VLS_61 = ({ back: {} },
547
567
  { onBack: (...[$event]) => {
548
568
  if (!!(!__VLS_ctx.isRouterReady))
549
569
  return;
@@ -561,60 +581,60 @@ else {
561
581
  // @ts-ignore
562
582
  [responsiveRender, currentPageConfig, receiverId, currentConversation, handleCall,];
563
583
  } });
564
- const __VLS_61 = ({ inputFocus: {} },
584
+ const __VLS_62 = ({ inputFocus: {} },
565
585
  { onInputFocus: (__VLS_ctx.handleReadMessage) });
566
586
  __VLS_asFunctionalDirective(__VLS_directives.vShow)(null, { ...__VLS_directiveBindingRestFields, value: (__VLS_ctx.currentPage == __VLS_ctx.PAGE.HOME) }, null, null);
567
587
  /** @type {typeof __VLS_ctx.homeComponentRef} */ ;
568
- var __VLS_62 = {};
588
+ var __VLS_63 = {};
569
589
  // @ts-ignore
570
590
  [currentPage, PAGE, handleReadMessage, homeComponentRef,];
571
- var __VLS_56;
591
+ var __VLS_57;
572
592
  if (__VLS_ctx.currentPage == __VLS_ctx.PAGE.CUSTOMER_DETAIL) {
573
593
  // @ts-ignore
574
594
  [currentPage, PAGE,];
575
595
  /** @type {[typeof CustomerDetail, ]} */ ;
576
596
  // @ts-ignore
577
- const __VLS_65 = __VLS_asFunctionalComponent(CustomerDetail, new CustomerDetail({
597
+ const __VLS_66 = __VLS_asFunctionalComponent(CustomerDetail, new CustomerDetail({
578
598
  ref: "customerDetailRef",
579
599
  receiverId: (__VLS_ctx.receiverId),
580
600
  ...{ class: "w-full h-full" },
581
601
  responsive: (__VLS_ctx.responsiveRender),
582
602
  }));
583
- const __VLS_66 = __VLS_65({
603
+ const __VLS_67 = __VLS_66({
584
604
  ref: "customerDetailRef",
585
605
  receiverId: (__VLS_ctx.receiverId),
586
606
  ...{ class: "w-full h-full" },
587
607
  responsive: (__VLS_ctx.responsiveRender),
588
- }, ...__VLS_functionalComponentArgsRest(__VLS_65));
608
+ }, ...__VLS_functionalComponentArgsRest(__VLS_66));
589
609
  /** @type {typeof __VLS_ctx.customerDetailRef} */ ;
590
- var __VLS_68 = {};
610
+ var __VLS_69 = {};
591
611
  // @ts-ignore
592
612
  [responsiveRender, receiverId, customerDetailRef,];
593
- var __VLS_67;
613
+ var __VLS_68;
594
614
  }
595
615
  if (__VLS_ctx.currentPage == __VLS_ctx.PAGE.CUSTOMER_CHECK_IN) {
596
616
  // @ts-ignore
597
617
  [currentPage, PAGE,];
598
618
  /** @type {[typeof CustomerCheckIn, ]} */ ;
599
619
  // @ts-ignore
600
- const __VLS_71 = __VLS_asFunctionalComponent(CustomerCheckIn, new CustomerCheckIn({
620
+ const __VLS_72 = __VLS_asFunctionalComponent(CustomerCheckIn, new CustomerCheckIn({
601
621
  ...{ class: "w-full h-full" },
602
622
  }));
603
- const __VLS_72 = __VLS_71({
623
+ const __VLS_73 = __VLS_72({
604
624
  ...{ class: "w-full h-full" },
605
- }, ...__VLS_functionalComponentArgsRest(__VLS_71));
625
+ }, ...__VLS_functionalComponentArgsRest(__VLS_72));
606
626
  }
607
627
  if (__VLS_ctx.currentPage == __VLS_ctx.PAGE.CUSTOMER_APPOINTMENT) {
608
628
  // @ts-ignore
609
629
  [currentPage, PAGE,];
610
630
  /** @type {[typeof CustomerAppointment, ]} */ ;
611
631
  // @ts-ignore
612
- const __VLS_75 = __VLS_asFunctionalComponent(CustomerAppointment, new CustomerAppointment({
632
+ const __VLS_76 = __VLS_asFunctionalComponent(CustomerAppointment, new CustomerAppointment({
613
633
  ...{ class: "w-full h-full" },
614
634
  }));
615
- const __VLS_76 = __VLS_75({
635
+ const __VLS_77 = __VLS_76({
616
636
  ...{ class: "w-full h-full" },
617
- }, ...__VLS_functionalComponentArgsRest(__VLS_75));
637
+ }, ...__VLS_functionalComponentArgsRest(__VLS_76));
618
638
  }
619
639
  }
620
640
  else {
@@ -623,7 +643,7 @@ else {
623
643
  });
624
644
  /** @type {[typeof ChatList, ]} */ ;
625
645
  // @ts-ignore
626
- const __VLS_79 = __VLS_asFunctionalComponent(ChatList, new ChatList({
646
+ const __VLS_80 = __VLS_asFunctionalComponent(ChatList, new ChatList({
627
647
  ...{ 'onSelectReceiver': {} },
628
648
  ...{ 'onOpenPhoneNumpad': {} },
629
649
  ref: "chatListRef",
@@ -631,19 +651,19 @@ else {
631
651
  responsive: (__VLS_ctx.responsiveRender),
632
652
  receiverId: (__VLS_ctx.receiverId),
633
653
  }));
634
- const __VLS_80 = __VLS_79({
654
+ const __VLS_81 = __VLS_80({
635
655
  ...{ 'onSelectReceiver': {} },
636
656
  ...{ 'onOpenPhoneNumpad': {} },
637
657
  ref: "chatListRef",
638
658
  ...{ class: "w-[38%] max-w-[500px] min-w-[300px] xl:min-w-[450px] border-r layout-border" },
639
659
  responsive: (__VLS_ctx.responsiveRender),
640
660
  receiverId: (__VLS_ctx.receiverId),
641
- }, ...__VLS_functionalComponentArgsRest(__VLS_79));
642
- let __VLS_82;
661
+ }, ...__VLS_functionalComponentArgsRest(__VLS_80));
643
662
  let __VLS_83;
644
- const __VLS_84 = ({ selectReceiver: {} },
663
+ let __VLS_84;
664
+ const __VLS_85 = ({ selectReceiver: {} },
645
665
  { onSelectReceiver: (__VLS_ctx.selectReceiver) });
646
- const __VLS_85 = ({ openPhoneNumpad: {} },
666
+ const __VLS_86 = ({ openPhoneNumpad: {} },
647
667
  { onOpenPhoneNumpad: (...[$event]) => {
648
668
  if (!!(!__VLS_ctx.isRouterReady))
649
669
  return;
@@ -662,10 +682,10 @@ else {
662
682
  [responsiveRender, receiverId, selectReceiver, handleOpenPhoneNumpad,];
663
683
  } });
664
684
  /** @type {typeof __VLS_ctx.chatListRef} */ ;
665
- var __VLS_86 = {};
685
+ var __VLS_87 = {};
666
686
  // @ts-ignore
667
687
  [chatListRef,];
668
- var __VLS_81;
688
+ var __VLS_82;
669
689
  __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
670
690
  ...{ class: "bg-white grow flex flex-col h-full overflow-hidden" },
671
691
  });
@@ -699,8 +719,8 @@ else {
699
719
  });
700
720
  /** @type {[typeof IconArrowLeft, ]} */ ;
701
721
  // @ts-ignore
702
- const __VLS_89 = __VLS_asFunctionalComponent(IconArrowLeft, new IconArrowLeft({}));
703
- const __VLS_90 = __VLS_89({}, ...__VLS_functionalComponentArgsRest(__VLS_89));
722
+ const __VLS_90 = __VLS_asFunctionalComponent(IconArrowLeft, new IconArrowLeft({}));
723
+ const __VLS_91 = __VLS_90({}, ...__VLS_functionalComponentArgsRest(__VLS_90));
704
724
  __VLS_asFunctionalElement(__VLS_elements.span, __VLS_elements.span)({
705
725
  ...{ class: "text-xl font-semibold text-chat-haze-900 ml-3" },
706
726
  });
@@ -713,7 +733,7 @@ else {
713
733
  });
714
734
  /** @type {[typeof HomeComponent, ]} */ ;
715
735
  // @ts-ignore
716
- const __VLS_93 = __VLS_asFunctionalComponent(HomeComponent, new HomeComponent({
736
+ const __VLS_94 = __VLS_asFunctionalComponent(HomeComponent, new HomeComponent({
717
737
  ...{ 'onCall': {} },
718
738
  ...{ 'onInputFocus': {} },
719
739
  ref: "homeComponentRef",
@@ -722,7 +742,7 @@ else {
722
742
  responsive: (__VLS_ctx.responsiveRender),
723
743
  conversation: (__VLS_ctx.currentConversation),
724
744
  }));
725
- const __VLS_94 = __VLS_93({
745
+ const __VLS_95 = __VLS_94({
726
746
  ...{ 'onCall': {} },
727
747
  ...{ 'onInputFocus': {} },
728
748
  ref: "homeComponentRef",
@@ -730,70 +750,70 @@ else {
730
750
  ...{ class: "h-full" },
731
751
  responsive: (__VLS_ctx.responsiveRender),
732
752
  conversation: (__VLS_ctx.currentConversation),
733
- }, ...__VLS_functionalComponentArgsRest(__VLS_93));
734
- let __VLS_96;
753
+ }, ...__VLS_functionalComponentArgsRest(__VLS_94));
735
754
  let __VLS_97;
736
- const __VLS_98 = ({ call: {} },
755
+ let __VLS_98;
756
+ const __VLS_99 = ({ call: {} },
737
757
  { onCall: (__VLS_ctx.handleCall) });
738
- const __VLS_99 = ({ inputFocus: {} },
758
+ const __VLS_100 = ({ inputFocus: {} },
739
759
  { onInputFocus: (__VLS_ctx.handleReadMessage) });
740
760
  __VLS_asFunctionalDirective(__VLS_directives.vShow)(null, { ...__VLS_directiveBindingRestFields, value: (__VLS_ctx.currentPage == __VLS_ctx.PAGE.HOME && __VLS_ctx.receiverId) }, null, null);
741
761
  /** @type {typeof __VLS_ctx.homeComponentRef} */ ;
742
- var __VLS_100 = {};
762
+ var __VLS_101 = {};
743
763
  // @ts-ignore
744
764
  [currentPage, PAGE, responsiveRender, receiverId, receiverId, currentConversation, handleCall, handleReadMessage, homeComponentRef,];
745
- var __VLS_95;
765
+ var __VLS_96;
746
766
  if (__VLS_ctx.currentPage == __VLS_ctx.PAGE.CUSTOMER_DETAIL) {
747
767
  // @ts-ignore
748
768
  [currentPage, PAGE,];
749
769
  /** @type {[typeof CustomerDetail, ]} */ ;
750
770
  // @ts-ignore
751
- const __VLS_103 = __VLS_asFunctionalComponent(CustomerDetail, new CustomerDetail({
771
+ const __VLS_104 = __VLS_asFunctionalComponent(CustomerDetail, new CustomerDetail({
752
772
  ref: "customerDetailRef",
753
773
  receiverId: (__VLS_ctx.receiverId),
754
774
  ...{ class: "h-full" },
755
775
  responsive: (__VLS_ctx.responsiveRender),
756
776
  }));
757
- const __VLS_104 = __VLS_103({
777
+ const __VLS_105 = __VLS_104({
758
778
  ref: "customerDetailRef",
759
779
  receiverId: (__VLS_ctx.receiverId),
760
780
  ...{ class: "h-full" },
761
781
  responsive: (__VLS_ctx.responsiveRender),
762
- }, ...__VLS_functionalComponentArgsRest(__VLS_103));
782
+ }, ...__VLS_functionalComponentArgsRest(__VLS_104));
763
783
  /** @type {typeof __VLS_ctx.customerDetailRef} */ ;
764
- var __VLS_106 = {};
784
+ var __VLS_107 = {};
765
785
  // @ts-ignore
766
786
  [responsiveRender, receiverId, customerDetailRef,];
767
- var __VLS_105;
787
+ var __VLS_106;
768
788
  }
769
789
  if (__VLS_ctx.currentPage == __VLS_ctx.PAGE.CUSTOMER_CHECK_IN) {
770
790
  // @ts-ignore
771
791
  [currentPage, PAGE,];
772
792
  /** @type {[typeof CustomerCheckIn, ]} */ ;
773
793
  // @ts-ignore
774
- const __VLS_109 = __VLS_asFunctionalComponent(CustomerCheckIn, new CustomerCheckIn({
794
+ const __VLS_110 = __VLS_asFunctionalComponent(CustomerCheckIn, new CustomerCheckIn({
775
795
  ...{ class: "h-full" },
776
796
  }));
777
- const __VLS_110 = __VLS_109({
797
+ const __VLS_111 = __VLS_110({
778
798
  ...{ class: "h-full" },
779
- }, ...__VLS_functionalComponentArgsRest(__VLS_109));
799
+ }, ...__VLS_functionalComponentArgsRest(__VLS_110));
780
800
  }
781
801
  if (__VLS_ctx.currentPage == __VLS_ctx.PAGE.CUSTOMER_APPOINTMENT) {
782
802
  // @ts-ignore
783
803
  [currentPage, PAGE,];
784
804
  /** @type {[typeof CustomerAppointment, ]} */ ;
785
805
  // @ts-ignore
786
- const __VLS_113 = __VLS_asFunctionalComponent(CustomerAppointment, new CustomerAppointment({
806
+ const __VLS_114 = __VLS_asFunctionalComponent(CustomerAppointment, new CustomerAppointment({
787
807
  ...{ class: "h-full" },
788
808
  }));
789
- const __VLS_114 = __VLS_113({
809
+ const __VLS_115 = __VLS_114({
790
810
  ...{ class: "h-full" },
791
- }, ...__VLS_functionalComponentArgsRest(__VLS_113));
811
+ }, ...__VLS_functionalComponentArgsRest(__VLS_114));
792
812
  }
793
813
  }
794
814
  /** @type {[typeof PhoneNumpad, ]} */ ;
795
815
  // @ts-ignore
796
- const __VLS_117 = __VLS_asFunctionalComponent(PhoneNumpad, new PhoneNumpad({
816
+ const __VLS_118 = __VLS_asFunctionalComponent(PhoneNumpad, new PhoneNumpad({
797
817
  ...{ 'onCall': {} },
798
818
  ref: "phoneNumpadRef",
799
819
  hideNumpad: (__VLS_ctx.isLib),
@@ -801,23 +821,23 @@ else {
801
821
  ...{ class: "bg-white shrink-0 border-l layout-border" },
802
822
  modelValue: "",
803
823
  }));
804
- const __VLS_118 = __VLS_117({
824
+ const __VLS_119 = __VLS_118({
805
825
  ...{ 'onCall': {} },
806
826
  ref: "phoneNumpadRef",
807
827
  hideNumpad: (__VLS_ctx.isLib),
808
828
  responsive: (__VLS_ctx.responsiveRender),
809
829
  ...{ class: "bg-white shrink-0 border-l layout-border" },
810
830
  modelValue: "",
811
- }, ...__VLS_functionalComponentArgsRest(__VLS_117));
812
- let __VLS_120;
831
+ }, ...__VLS_functionalComponentArgsRest(__VLS_118));
813
832
  let __VLS_121;
814
- const __VLS_122 = ({ call: {} },
833
+ let __VLS_122;
834
+ const __VLS_123 = ({ call: {} },
815
835
  { onCall: (__VLS_ctx.handleCall) });
816
836
  /** @type {typeof __VLS_ctx.phoneNumpadRef} */ ;
817
- var __VLS_123 = {};
837
+ var __VLS_124 = {};
818
838
  // @ts-ignore
819
839
  [isLib, responsiveRender, handleCall, phoneNumpadRef,];
820
- var __VLS_119;
840
+ var __VLS_120;
821
841
  }
822
842
  /** @type {__VLS_StyleScopedClasses['go-chat-main']} */ ;
823
843
  /** @type {__VLS_StyleScopedClasses['max-w-full']} */ ;
@@ -918,7 +938,7 @@ else {
918
938
  /** @type {__VLS_StyleScopedClasses['border-l']} */ ;
919
939
  /** @type {__VLS_StyleScopedClasses['layout-border']} */ ;
920
940
  // @ts-ignore
921
- var __VLS_34 = __VLS_33, __VLS_52 = __VLS_51, __VLS_63 = __VLS_62, __VLS_69 = __VLS_68, __VLS_87 = __VLS_86, __VLS_101 = __VLS_100, __VLS_107 = __VLS_106, __VLS_124 = __VLS_123;
941
+ var __VLS_35 = __VLS_34, __VLS_53 = __VLS_52, __VLS_64 = __VLS_63, __VLS_70 = __VLS_69, __VLS_88 = __VLS_87, __VLS_102 = __VLS_101, __VLS_108 = __VLS_107, __VLS_125 = __VLS_124;
922
942
  const __VLS_export = (await import('vue')).defineComponent({
923
943
  setup: () => (__VLS_exposed),
924
944
  __typeEmits: {},
@@ -235,7 +235,7 @@ if (__VLS_ctx.message.state != __VLS_ctx.MessageState.Sending || __VLS_ctx.isMyM
235
235
  }
236
236
  }) },
237
237
  src: (__VLS_ctx.message.attachments[0]?.file_path),
238
- alt: "avatar",
238
+ alt: "image",
239
239
  });
240
240
  // @ts-ignore
241
241
  [message, isLastMessage, scrollBottom,];
@@ -2,7 +2,7 @@
2
2
  import HomeHeader from '../../../chat/page/home/HomeHeader.vue';
3
3
  import NewCustomer from '../../../chat/page/home/NewCustomer.vue';
4
4
  import InputChat from '../../../chat/page/home/InputChat.vue';
5
- import { getDetailReceiver, getMessage, sendMessage, sendMessageSmsTest, upLoadImage } from '../../../utils/chat/store/message';
5
+ import { getDetailReceiver, getMessage, sendMessage, upLoadImage } from '../../../utils/chat/store/message';
6
6
  import { computed, nextTick, onMounted, onUnmounted, ref, shallowRef } from 'vue';
7
7
  import ChatMessage from '../../../chat/page/home/ChatMessage.vue';
8
8
  import { addHandleMqttMessage, connectMqtt, publishMessage, removeHandleMqttMessage, subscribeToTopic, unsubscribeFromTopic } from '../../../plugins/mqtt';
@@ -10,7 +10,6 @@ import { TOPIC_DETAIL_CHAT, TOPIC_PLIVO_SMS } from '../../../constant/mqtt';
10
10
  import { MessageState } from '../../../constant/message';
11
11
  import { publicTopicConversationUpdate } from '../../../utils/chat/store/conversation';
12
12
  import { getCache, removeOldestCache, setCache } from '../../../utils/chat/cache';
13
- import { dataProfile } from '../../../utils/chat/store/auth';
14
13
  import { digibotId } from '../../../composable/useDigibot';
15
14
  const props = withDefaults(defineProps(), {});
16
15
  const emit = defineEmits();
@@ -164,17 +163,7 @@ const handleSendMessage = async (data) => {
164
163
  if (file_upload?.length) {
165
164
  formData.append('url', file_upload[0]?.url ?? '');
166
165
  }
167
- if (dataProfile.value?.user_type == 'tenant') {
168
- await sendMessage(formData);
169
- }
170
- else {
171
- await sendMessageSmsTest({
172
- from: dataProfile.value?.phone ?? '',
173
- to: infoUser.value?.phone ?? '',
174
- host_id: infoUser.value?.tenant_id ?? '',
175
- text: data.message ?? ''
176
- });
177
- }
166
+ await sendMessage(formData);
178
167
  publishMessage(topic, {
179
168
  ...data,
180
169
  state: MessageState.Sent,
@@ -200,7 +189,7 @@ const handleSendMessage = async (data) => {
200
189
  console.log(error);
201
190
  updateMessageItem(data.id, {
202
191
  state: MessageState.Failed,
203
- error: typeof error?.messages == 'string' ? error.messages : ''
192
+ error: typeof error?.messages == 'string' ? error.messages : error
204
193
  });
205
194
  }
206
195
  };
@@ -213,6 +202,9 @@ const handleUploadImage = async (file) => {
213
202
  const formData = new FormData();
214
203
  formData.append('file', file);
215
204
  const res = await upLoadImage(formData);
205
+ if (res?.[0]?.error) {
206
+ throw new Error(res?.[0]?.errors ?? 'Error!');
207
+ }
216
208
  return res;
217
209
  };
218
210
  const call = () => {
@@ -161,82 +161,92 @@ __VLS_asFunctionalElement(__VLS_elements.textarea)({
161
161
  __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
162
162
  ...{ class: "flex gap-2 -translate-y-2" },
163
163
  });
164
- /** @type {[typeof PopoverBase, typeof PopoverBase, ]} */ ;
165
- // @ts-ignore
166
- const __VLS_0 = __VLS_asFunctionalComponent(PopoverBase, new PopoverBase({
167
- open: (__VLS_ctx.emojiOpen),
168
- align: "end",
169
- side: "top",
170
- }));
171
- const __VLS_1 = __VLS_0({
172
- open: (__VLS_ctx.emojiOpen),
173
- align: "end",
174
- side: "top",
175
- }, ...__VLS_functionalComponentArgsRest(__VLS_0));
176
- const { default: __VLS_3 } = __VLS_2.slots;
177
- // @ts-ignore
178
- [emojiOpen,];
179
- __VLS_asFunctionalElement(__VLS_elements.button, __VLS_elements.button)({
180
- ...{ onClick: (...[$event]) => {
181
- __VLS_ctx.emojiOpen = !__VLS_ctx.emojiOpen;
182
- // @ts-ignore
183
- [emojiOpen, emojiOpen,];
184
- } },
185
- ...{ class: "h-11 w-8" },
186
- });
187
- {
188
- const { content: __VLS_4 } = __VLS_2.slots;
189
- const __VLS_5 = {}.EmojiPicker;
164
+ if (!__VLS_ctx.dataProfile?.is_sms_active) {
165
+ // @ts-ignore
166
+ [dataProfile,];
167
+ /** @type {[typeof PopoverBase, typeof PopoverBase, ]} */ ;
168
+ // @ts-ignore
169
+ const __VLS_0 = __VLS_asFunctionalComponent(PopoverBase, new PopoverBase({
170
+ open: (__VLS_ctx.emojiOpen),
171
+ align: "end",
172
+ side: "top",
173
+ }));
174
+ const __VLS_1 = __VLS_0({
175
+ open: (__VLS_ctx.emojiOpen),
176
+ align: "end",
177
+ side: "top",
178
+ }, ...__VLS_functionalComponentArgsRest(__VLS_0));
179
+ const { default: __VLS_3 } = __VLS_2.slots;
180
+ // @ts-ignore
181
+ [emojiOpen,];
182
+ __VLS_asFunctionalElement(__VLS_elements.button, __VLS_elements.button)({
183
+ ...{ onClick: (...[$event]) => {
184
+ if (!(!__VLS_ctx.dataProfile?.is_sms_active))
185
+ return;
186
+ __VLS_ctx.emojiOpen = !__VLS_ctx.emojiOpen;
187
+ // @ts-ignore
188
+ [emojiOpen, emojiOpen,];
189
+ } },
190
+ ...{ class: "h-11 w-8" },
191
+ });
192
+ {
193
+ const { content: __VLS_4 } = __VLS_2.slots;
194
+ const __VLS_5 = {}.EmojiPicker;
195
+ /** @type {[typeof __VLS_components.EmojiPicker, typeof __VLS_components.emojiPicker, ]} */ ;
196
+ // @ts-ignore
197
+ EmojiPicker;
198
+ // @ts-ignore
199
+ const __VLS_6 = __VLS_asFunctionalComponent(__VLS_5, new __VLS_5({
200
+ ...{ 'onSelect': {} },
201
+ ...{ class: "!w-[300px]" },
202
+ native: (true),
203
+ offset: (2),
204
+ hideSearch: true,
205
+ }));
206
+ const __VLS_7 = __VLS_6({
207
+ ...{ 'onSelect': {} },
208
+ ...{ class: "!w-[300px]" },
209
+ native: (true),
210
+ offset: (2),
211
+ hideSearch: true,
212
+ }, ...__VLS_functionalComponentArgsRest(__VLS_6));
213
+ let __VLS_9;
214
+ let __VLS_10;
215
+ const __VLS_11 = ({ select: {} },
216
+ { onSelect: (__VLS_ctx.onSelectEmoji) });
217
+ // @ts-ignore
218
+ [onSelectEmoji,];
219
+ var __VLS_8;
220
+ }
221
+ var __VLS_2;
222
+ }
223
+ if (!__VLS_ctx.dataProfile?.is_sms_active) {
224
+ // @ts-ignore
225
+ [dataProfile,];
226
+ const __VLS_13 = {}.EmojiPicker;
190
227
  /** @type {[typeof __VLS_components.EmojiPicker, typeof __VLS_components.emojiPicker, ]} */ ;
191
228
  // @ts-ignore
192
229
  EmojiPicker;
193
230
  // @ts-ignore
194
- const __VLS_6 = __VLS_asFunctionalComponent(__VLS_5, new __VLS_5({
195
- ...{ 'onSelect': {} },
196
- ...{ class: "!w-[300px]" },
231
+ const __VLS_14 = __VLS_asFunctionalComponent(__VLS_13, new __VLS_13({
232
+ ...{ class: "opacity-0 pointer-events-none absolute" },
197
233
  native: (true),
198
234
  offset: (2),
199
235
  hideSearch: true,
200
236
  }));
201
- const __VLS_7 = __VLS_6({
202
- ...{ 'onSelect': {} },
203
- ...{ class: "!w-[300px]" },
237
+ const __VLS_15 = __VLS_14({
238
+ ...{ class: "opacity-0 pointer-events-none absolute" },
204
239
  native: (true),
205
240
  offset: (2),
206
241
  hideSearch: true,
207
- }, ...__VLS_functionalComponentArgsRest(__VLS_6));
208
- let __VLS_9;
209
- let __VLS_10;
210
- const __VLS_11 = ({ select: {} },
211
- { onSelect: (__VLS_ctx.onSelectEmoji) });
212
- // @ts-ignore
213
- [onSelectEmoji,];
214
- var __VLS_8;
242
+ }, ...__VLS_functionalComponentArgsRest(__VLS_14));
215
243
  }
216
- var __VLS_2;
217
- const __VLS_13 = {}.EmojiPicker;
218
- /** @type {[typeof __VLS_components.EmojiPicker, typeof __VLS_components.emojiPicker, ]} */ ;
219
- // @ts-ignore
220
- EmojiPicker;
221
- // @ts-ignore
222
- const __VLS_14 = __VLS_asFunctionalComponent(__VLS_13, new __VLS_13({
223
- ...{ class: "opacity-0 pointer-events-none absolute" },
224
- native: (true),
225
- offset: (2),
226
- hideSearch: true,
227
- }));
228
- const __VLS_15 = __VLS_14({
229
- ...{ class: "opacity-0 pointer-events-none absolute" },
230
- native: (true),
231
- offset: (2),
232
- hideSearch: true,
233
- }, ...__VLS_functionalComponentArgsRest(__VLS_14));
234
244
  __VLS_asFunctionalElement(__VLS_elements.label, __VLS_elements.label)({
235
245
  ...{ class: "cursor-pointer relative" },
236
246
  });
237
- __VLS_asFunctionalDirective(__VLS_directives.vShow)(null, { ...__VLS_directiveBindingRestFields, value: (!(__VLS_ctx.keyword != '' && __VLS_ctx.responsive == 'mobile')) }, null, null);
247
+ __VLS_asFunctionalDirective(__VLS_directives.vShow)(null, { ...__VLS_directiveBindingRestFields, value: (!(__VLS_ctx.keyword != '' && __VLS_ctx.responsive == 'mobile') && !__VLS_ctx.dataProfile?.is_sms_active) }, null, null);
238
248
  // @ts-ignore
239
- [keyword, responsive,];
249
+ [keyword, dataProfile, responsive,];
240
250
  __VLS_asFunctionalElement(__VLS_elements.input)({
241
251
  ...{ onChange: (__VLS_ctx.handleFileUpload) },
242
252
  type: "file",
@@ -111,9 +111,7 @@ function endCall(option) {
111
111
  drawerVisible.value = false;
112
112
  drawerVisibleRef.value?.close();
113
113
  }
114
- else {
115
- handleEmitEndCall(userRemoter.value, callType);
116
- }
114
+ handleEmitEndCall(userRemoter.value, callType);
117
115
  plivoEndCall(callStatus.value);
118
116
  callStatus.value = PLIVO_CALL_STATUS.CALL_END;
119
117
  clearInterval(timer);
@@ -131,7 +129,6 @@ const handleEmitEndCall = useDebounce((data, type) => {
131
129
  }, 500);
132
130
  const refreshToken = async () => {
133
131
  try {
134
- console.log('refreshToken: ');
135
132
  if (refreshTokenTimeOut) {
136
133
  clearTimeout(refreshTokenTimeOut);
137
134
  refreshTokenTimeOut = null;
@@ -144,7 +141,6 @@ const refreshToken = async () => {
144
141
  catch (e) {
145
142
  console.log(e);
146
143
  refreshTokenCount = refreshTokenCount + 1;
147
- console.log(refreshTokenCount);
148
144
  if (refreshTokenCount < 3) {
149
145
  setTimeout(() => refreshToken(), 60 * 1000);
150
146
  }
@@ -198,6 +194,7 @@ const getUserOffer = async (phone) => {
198
194
  let res = null;
199
195
  try {
200
196
  userRemoter.value = { phone, username: '' };
197
+ emit('userCalling', userRemoter.value);
201
198
  let data = {
202
199
  phone: formatPhone10number(phone, '1'),
203
200
  client_id: dataProfile.value?.tenant_id ?? ''