@rqmii_immersive/agent-react-sdk 5.3.4 → 5.4.0
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.
- package/dist/{RqmiiCloudAvatarPlayer-Bi44g7bl.js → RqmiiCloudAvatarPlayer-Cit_rrpj.js} +2472 -2478
- package/dist/RqmiiCloudAvatarPlayer-Cit_rrpj.js.map +1 -0
- package/dist/{RqmiiCloudAvatarPlayer-DDtkCYFJ.cjs → RqmiiCloudAvatarPlayer-DUQwPcpd.cjs} +293 -293
- package/dist/RqmiiCloudAvatarPlayer-DUQwPcpd.cjs.map +1 -0
- package/dist/agent-react-sdk.css +1 -1
- package/dist/components/RqmiiAgentRoom.d.ts +1 -1
- package/dist/components/RqmiiAgentRoom.d.ts.map +1 -1
- package/dist/core/managers/audio.d.ts +1 -3
- package/dist/core/managers/audio.d.ts.map +1 -1
- package/dist/embed.js +805 -799
- package/dist/embed.js.map +1 -1
- package/dist/hooks/use-rqmii-connection.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/provider/RqmiiAgentProvider.d.ts +1 -1
- package/dist/provider/RqmiiAgentProvider.d.ts.map +1 -1
- package/dist/provider/use-manager-lifecycle.d.ts +0 -2
- package/dist/provider/use-manager-lifecycle.d.ts.map +1 -1
- package/dist/types/index.d.ts +29 -7
- package/dist/types/index.d.ts.map +1 -1
- package/dist/ui/RqmiiAgentChat.d.ts +2 -2
- package/dist/ui/RqmiiAgentChat.d.ts.map +1 -1
- package/dist/ui/agent-data.d.ts.map +1 -1
- package/dist/ui/chat/ChatBox.d.ts.map +1 -1
- package/dist/ui/chat/chat-box-content.d.ts.map +1 -1
- package/dist/ui/chat/consent-dialog.d.ts +4 -2
- package/dist/ui/chat/consent-dialog.d.ts.map +1 -1
- package/dist/ui/chat/feedback.d.ts +3 -1
- package/dist/ui/chat/feedback.d.ts.map +1 -1
- package/dist/ui/chat/markdown.d.ts +12 -0
- package/dist/ui/chat/markdown.d.ts.map +1 -0
- package/dist/ui/chat/markdown.test.d.ts +2 -0
- package/dist/ui/chat/markdown.test.d.ts.map +1 -0
- package/dist/ui/chat/panels.d.ts.map +1 -1
- package/dist/ui/chat/utils.d.ts +17 -7
- package/dist/ui/chat/utils.d.ts.map +1 -1
- package/dist/ui/chat/utils.test.d.ts +2 -0
- package/dist/ui/chat/utils.test.d.ts.map +1 -0
- package/dist/ui.cjs +28 -22
- package/dist/ui.cjs.map +1 -1
- package/dist/ui.js +1396 -1105
- package/dist/ui.js.map +1 -1
- package/package.json +1 -1
- package/dist/RqmiiCloudAvatarPlayer-Bi44g7bl.js.map +0 -1
- package/dist/RqmiiCloudAvatarPlayer-DDtkCYFJ.cjs.map +0 -1
package/dist/ui.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { E as
|
|
3
|
-
import { jsx as n, jsxs as
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { A as de, u as Ea, g as He, j as ge, h as pe, i as oa, l as sa, k as ra, R as za, c as Sa } from "./RqmiiCloudAvatarPlayer-Cit_rrpj.js";
|
|
2
|
+
import { E as gi, d as pi } from "./RqmiiCloudAvatarPlayer-Cit_rrpj.js";
|
|
3
|
+
import { jsx as n, jsxs as v, Fragment as Te } from "react/jsx-runtime";
|
|
4
|
+
import A, { useContext as xa, createContext as Ma, forwardRef as la, createElement as Le, useState as y, useEffect as I, useRef as B, useLayoutEffect as We, useCallback as ie, useMemo as $ } from "react";
|
|
5
|
+
const wa = {
|
|
6
6
|
sendMessage: "Stuur 'n boodskap",
|
|
7
7
|
send: "Stuur",
|
|
8
8
|
close: "Sluit",
|
|
@@ -45,7 +45,7 @@ const Ea = {
|
|
|
45
45
|
leadFormEmail: "E-pos",
|
|
46
46
|
leadFormPhone: "Foon",
|
|
47
47
|
leadFormMessage: "Jou boodskap"
|
|
48
|
-
},
|
|
48
|
+
}, Pa = {
|
|
49
49
|
sendMessage: "Dërgo një mesazh",
|
|
50
50
|
send: "Dërgo",
|
|
51
51
|
close: "Mbyll",
|
|
@@ -88,7 +88,7 @@ const Ea = {
|
|
|
88
88
|
leadFormEmail: "Email",
|
|
89
89
|
leadFormPhone: "Telefoni",
|
|
90
90
|
leadFormMessage: "Mesazhi juaj"
|
|
91
|
-
},
|
|
91
|
+
}, Ca = {
|
|
92
92
|
sendMessage: "اكتب رسالة",
|
|
93
93
|
send: "إرسال",
|
|
94
94
|
close: "إغلاق",
|
|
@@ -131,7 +131,7 @@ const Ea = {
|
|
|
131
131
|
leadFormEmail: "البريد الإلكتروني",
|
|
132
132
|
leadFormPhone: "رقم الهاتف",
|
|
133
133
|
leadFormMessage: "رسالتك"
|
|
134
|
-
},
|
|
134
|
+
}, La = {
|
|
135
135
|
sendMessage: "اكتب رسالة",
|
|
136
136
|
send: "إرسال",
|
|
137
137
|
close: "إغلاق",
|
|
@@ -174,7 +174,7 @@ const Ea = {
|
|
|
174
174
|
leadFormEmail: "البريد الإلكتروني",
|
|
175
175
|
leadFormPhone: "رقم الهاتف",
|
|
176
176
|
leadFormMessage: "رسالتك"
|
|
177
|
-
},
|
|
177
|
+
}, Aa = {
|
|
178
178
|
sendMessage: "اكتب رسالة",
|
|
179
179
|
send: "إرسال",
|
|
180
180
|
close: "إغلاق",
|
|
@@ -217,7 +217,7 @@ const Ea = {
|
|
|
217
217
|
leadFormEmail: "البريد الإلكتروني",
|
|
218
218
|
leadFormPhone: "رقم الهاتف",
|
|
219
219
|
leadFormMessage: "رسالتك"
|
|
220
|
-
},
|
|
220
|
+
}, _a = {
|
|
221
221
|
sendMessage: "Mesaj göndər",
|
|
222
222
|
send: "Göndər",
|
|
223
223
|
close: "Bağla",
|
|
@@ -260,7 +260,7 @@ const Ea = {
|
|
|
260
260
|
leadFormEmail: "E-poçt",
|
|
261
261
|
leadFormPhone: "Telefon",
|
|
262
262
|
leadFormMessage: "Mesajınız"
|
|
263
|
-
},
|
|
263
|
+
}, qa = {
|
|
264
264
|
sendMessage: "Bidali mezua",
|
|
265
265
|
send: "Bidali",
|
|
266
266
|
close: "Itxi",
|
|
@@ -303,7 +303,7 @@ const Ea = {
|
|
|
303
303
|
leadFormEmail: "Helbide elektronikoa",
|
|
304
304
|
leadFormPhone: "Telefonoa",
|
|
305
305
|
leadFormMessage: "Zure mezua"
|
|
306
|
-
},
|
|
306
|
+
}, Ia = {
|
|
307
307
|
sendMessage: "Адправіць паведамленне",
|
|
308
308
|
send: "Адправіць",
|
|
309
309
|
close: "Зачыніць",
|
|
@@ -346,7 +346,7 @@ const Ea = {
|
|
|
346
346
|
leadFormEmail: "Электронная пошта",
|
|
347
347
|
leadFormPhone: "Тэлефон",
|
|
348
348
|
leadFormMessage: "Ваша паведамленне"
|
|
349
|
-
},
|
|
349
|
+
}, Va = {
|
|
350
350
|
sendMessage: "একটি বার্তা পাঠান",
|
|
351
351
|
send: "পাঠান",
|
|
352
352
|
close: "বন্ধ করুন",
|
|
@@ -389,7 +389,7 @@ const Ea = {
|
|
|
389
389
|
leadFormEmail: "ইমেইল",
|
|
390
390
|
leadFormPhone: "ফোন",
|
|
391
391
|
leadFormMessage: "আপনার বার্তা"
|
|
392
|
-
},
|
|
392
|
+
}, Na = {
|
|
393
393
|
sendMessage: "Pošalji poruku",
|
|
394
394
|
send: "Pošalji",
|
|
395
395
|
close: "Zatvori",
|
|
@@ -432,7 +432,7 @@ const Ea = {
|
|
|
432
432
|
leadFormEmail: "E-mail",
|
|
433
433
|
leadFormPhone: "Telefon",
|
|
434
434
|
leadFormMessage: "Vaša poruka"
|
|
435
|
-
},
|
|
435
|
+
}, ja = {
|
|
436
436
|
sendMessage: "Изпрати съобщение",
|
|
437
437
|
send: "Изпрати",
|
|
438
438
|
close: "Затвори",
|
|
@@ -475,7 +475,7 @@ const Ea = {
|
|
|
475
475
|
leadFormEmail: "Имейл",
|
|
476
476
|
leadFormPhone: "Телефон",
|
|
477
477
|
leadFormMessage: "Вашето съобщение"
|
|
478
|
-
},
|
|
478
|
+
}, Da = {
|
|
479
479
|
sendMessage: "Enviar un missatge",
|
|
480
480
|
send: "Enviar",
|
|
481
481
|
close: "Tancar",
|
|
@@ -518,7 +518,7 @@ const Ea = {
|
|
|
518
518
|
leadFormEmail: "Correu electrònic",
|
|
519
519
|
leadFormPhone: "Telèfon",
|
|
520
520
|
leadFormMessage: "El teu missatge"
|
|
521
|
-
},
|
|
521
|
+
}, Ra = {
|
|
522
522
|
sendMessage: "发送消息",
|
|
523
523
|
send: "发送",
|
|
524
524
|
close: "关闭",
|
|
@@ -561,7 +561,7 @@ const Ea = {
|
|
|
561
561
|
leadFormEmail: "电子邮箱",
|
|
562
562
|
leadFormPhone: "电话",
|
|
563
563
|
leadFormMessage: "您的留言"
|
|
564
|
-
},
|
|
564
|
+
}, Ba = {
|
|
565
565
|
sendMessage: "Pošalji poruku",
|
|
566
566
|
send: "Pošalji",
|
|
567
567
|
close: "Zatvori",
|
|
@@ -604,7 +604,7 @@ const Ea = {
|
|
|
604
604
|
leadFormEmail: "E-mail",
|
|
605
605
|
leadFormPhone: "Telefon",
|
|
606
606
|
leadFormMessage: "Vaša poruka"
|
|
607
|
-
},
|
|
607
|
+
}, Ga = {
|
|
608
608
|
sendMessage: "Poslat zprávu",
|
|
609
609
|
send: "Odeslat",
|
|
610
610
|
close: "Zavřít",
|
|
@@ -647,7 +647,7 @@ const Ea = {
|
|
|
647
647
|
leadFormEmail: "E-mail",
|
|
648
648
|
leadFormPhone: "Telefon",
|
|
649
649
|
leadFormMessage: "Vaše zpráva"
|
|
650
|
-
},
|
|
650
|
+
}, Ua = {
|
|
651
651
|
sendMessage: "Send en besked",
|
|
652
652
|
send: "Send",
|
|
653
653
|
close: "Luk",
|
|
@@ -690,7 +690,7 @@ const Ea = {
|
|
|
690
690
|
leadFormEmail: "E-mail",
|
|
691
691
|
leadFormPhone: "Telefon",
|
|
692
692
|
leadFormMessage: "Din besked"
|
|
693
|
-
},
|
|
693
|
+
}, Ka = {
|
|
694
694
|
sendMessage: "Stuur een bericht",
|
|
695
695
|
send: "Verzenden",
|
|
696
696
|
close: "Sluiten",
|
|
@@ -733,7 +733,7 @@ const Ea = {
|
|
|
733
733
|
leadFormEmail: "E-mail",
|
|
734
734
|
leadFormPhone: "Telefoon",
|
|
735
735
|
leadFormMessage: "Uw bericht"
|
|
736
|
-
},
|
|
736
|
+
}, Oa = {
|
|
737
737
|
sendMessage: "Send a message",
|
|
738
738
|
send: "Send",
|
|
739
739
|
close: "Close",
|
|
@@ -776,7 +776,7 @@ const Ea = {
|
|
|
776
776
|
leadFormEmail: "Email",
|
|
777
777
|
leadFormPhone: "Phone",
|
|
778
778
|
leadFormMessage: "Your message"
|
|
779
|
-
},
|
|
779
|
+
}, Ya = {
|
|
780
780
|
sendMessage: "Saada sõnum",
|
|
781
781
|
send: "Saada",
|
|
782
782
|
close: "Sulge",
|
|
@@ -819,7 +819,7 @@ const Ea = {
|
|
|
819
819
|
leadFormEmail: "E-post",
|
|
820
820
|
leadFormPhone: "Telefon",
|
|
821
821
|
leadFormMessage: "Teie sõnum"
|
|
822
|
-
},
|
|
822
|
+
}, Qa = {
|
|
823
823
|
sendMessage: "Lähetä viesti",
|
|
824
824
|
send: "Lähetä",
|
|
825
825
|
close: "Sulje",
|
|
@@ -862,7 +862,7 @@ const Ea = {
|
|
|
862
862
|
leadFormEmail: "Sähköposti",
|
|
863
863
|
leadFormPhone: "Puhelin",
|
|
864
864
|
leadFormMessage: "Viestisi"
|
|
865
|
-
},
|
|
865
|
+
}, Ha = {
|
|
866
866
|
sendMessage: "Envoyer un message",
|
|
867
867
|
send: "Envoyer",
|
|
868
868
|
close: "Fermer",
|
|
@@ -905,7 +905,7 @@ const Ea = {
|
|
|
905
905
|
leadFormEmail: "E-mail",
|
|
906
906
|
leadFormPhone: "Téléphone",
|
|
907
907
|
leadFormMessage: "Votre message"
|
|
908
|
-
},
|
|
908
|
+
}, Wa = {
|
|
909
909
|
sendMessage: "Enviar unha mensaxe",
|
|
910
910
|
send: "Enviar",
|
|
911
911
|
close: "Pechar",
|
|
@@ -948,7 +948,7 @@ const Ea = {
|
|
|
948
948
|
leadFormEmail: "Correo electrónico",
|
|
949
949
|
leadFormPhone: "Teléfono",
|
|
950
950
|
leadFormMessage: "A túa mensaxe"
|
|
951
|
-
},
|
|
951
|
+
}, $a = {
|
|
952
952
|
sendMessage: "Nachricht senden",
|
|
953
953
|
send: "Senden",
|
|
954
954
|
close: "Schließen",
|
|
@@ -991,7 +991,7 @@ const Ea = {
|
|
|
991
991
|
leadFormEmail: "E-Mail",
|
|
992
992
|
leadFormPhone: "Telefon",
|
|
993
993
|
leadFormMessage: "Ihre Nachricht"
|
|
994
|
-
},
|
|
994
|
+
}, Za = {
|
|
995
995
|
sendMessage: "Αποστολή μηνύματος",
|
|
996
996
|
send: "Αποστολή",
|
|
997
997
|
close: "Κλείσιμο",
|
|
@@ -1034,7 +1034,7 @@ const Ea = {
|
|
|
1034
1034
|
leadFormEmail: "E-mail",
|
|
1035
1035
|
leadFormPhone: "Τηλέφωνο",
|
|
1036
1036
|
leadFormMessage: "Το μήνυμά σας"
|
|
1037
|
-
},
|
|
1037
|
+
}, Ja = {
|
|
1038
1038
|
sendMessage: "સંદેશ મોકલો",
|
|
1039
1039
|
send: "મોકલો",
|
|
1040
1040
|
close: "બંધ કરો",
|
|
@@ -1077,7 +1077,7 @@ const Ea = {
|
|
|
1077
1077
|
leadFormEmail: "ઇમેઇલ",
|
|
1078
1078
|
leadFormPhone: "ફોન",
|
|
1079
1079
|
leadFormMessage: "તમારો સંદેશ"
|
|
1080
|
-
},
|
|
1080
|
+
}, Xa = {
|
|
1081
1081
|
sendMessage: "संदेश भेजें",
|
|
1082
1082
|
send: "भेजें",
|
|
1083
1083
|
close: "बंद करें",
|
|
@@ -1120,7 +1120,7 @@ const Ea = {
|
|
|
1120
1120
|
leadFormEmail: "ईमेल",
|
|
1121
1121
|
leadFormPhone: "फ़ोन",
|
|
1122
1122
|
leadFormMessage: "आपका संदेश"
|
|
1123
|
-
},
|
|
1123
|
+
}, et = {
|
|
1124
1124
|
sendMessage: "Üzenet küldése",
|
|
1125
1125
|
send: "Küldés",
|
|
1126
1126
|
close: "Bezárás",
|
|
@@ -1163,7 +1163,7 @@ const Ea = {
|
|
|
1163
1163
|
leadFormEmail: "E-mail",
|
|
1164
1164
|
leadFormPhone: "Telefon",
|
|
1165
1165
|
leadFormMessage: "Üzenete"
|
|
1166
|
-
},
|
|
1166
|
+
}, at = {
|
|
1167
1167
|
sendMessage: "Kirim pesan",
|
|
1168
1168
|
send: "Kirim",
|
|
1169
1169
|
close: "Tutup",
|
|
@@ -1206,7 +1206,7 @@ const Ea = {
|
|
|
1206
1206
|
leadFormEmail: "Email",
|
|
1207
1207
|
leadFormPhone: "Telepon",
|
|
1208
1208
|
leadFormMessage: "Pesan Anda"
|
|
1209
|
-
},
|
|
1209
|
+
}, tt = {
|
|
1210
1210
|
sendMessage: "Invia un messaggio",
|
|
1211
1211
|
send: "Invia",
|
|
1212
1212
|
close: "Chiudi",
|
|
@@ -1249,7 +1249,7 @@ const Ea = {
|
|
|
1249
1249
|
leadFormEmail: "E-mail",
|
|
1250
1250
|
leadFormPhone: "Telefono",
|
|
1251
1251
|
leadFormMessage: "Il tuo messaggio"
|
|
1252
|
-
},
|
|
1252
|
+
}, nt = {
|
|
1253
1253
|
sendMessage: "メッセージを送信",
|
|
1254
1254
|
send: "送信",
|
|
1255
1255
|
close: "閉じる",
|
|
@@ -1292,7 +1292,7 @@ const Ea = {
|
|
|
1292
1292
|
leadFormEmail: "メールアドレス",
|
|
1293
1293
|
leadFormPhone: "電話番号",
|
|
1294
1294
|
leadFormMessage: "メッセージ"
|
|
1295
|
-
},
|
|
1295
|
+
}, it = {
|
|
1296
1296
|
sendMessage: "ಸಂದೇಶ ಕಳುಹಿಸಿ",
|
|
1297
1297
|
send: "ಕಳುಹಿಸಿ",
|
|
1298
1298
|
close: "ಮುಚ್ಚಿ",
|
|
@@ -1335,7 +1335,7 @@ const Ea = {
|
|
|
1335
1335
|
leadFormEmail: "ಇಮೇಲ್",
|
|
1336
1336
|
leadFormPhone: "ಫೋನ್",
|
|
1337
1337
|
leadFormMessage: "ನಿಮ್ಮ ಸಂದೇಶ"
|
|
1338
|
-
},
|
|
1338
|
+
}, ot = {
|
|
1339
1339
|
sendMessage: "Хабарлама жіберу",
|
|
1340
1340
|
send: "Жіберу",
|
|
1341
1341
|
close: "Жабу",
|
|
@@ -1378,7 +1378,7 @@ const Ea = {
|
|
|
1378
1378
|
leadFormEmail: "Электрондық пошта",
|
|
1379
1379
|
leadFormPhone: "Телефон",
|
|
1380
1380
|
leadFormMessage: "Сіздің хабарламаңыз"
|
|
1381
|
-
},
|
|
1381
|
+
}, st = {
|
|
1382
1382
|
sendMessage: "메시지 보내기",
|
|
1383
1383
|
send: "보내기",
|
|
1384
1384
|
close: "닫기",
|
|
@@ -1421,7 +1421,7 @@ const Ea = {
|
|
|
1421
1421
|
leadFormEmail: "이메일",
|
|
1422
1422
|
leadFormPhone: "전화번호",
|
|
1423
1423
|
leadFormMessage: "메시지"
|
|
1424
|
-
},
|
|
1424
|
+
}, rt = {
|
|
1425
1425
|
sendMessage: "Sūtīt ziņojumu",
|
|
1426
1426
|
send: "Sūtīt",
|
|
1427
1427
|
close: "Aizvērt",
|
|
@@ -1464,7 +1464,7 @@ const Ea = {
|
|
|
1464
1464
|
leadFormEmail: "E-pasts",
|
|
1465
1465
|
leadFormPhone: "Tālrunis",
|
|
1466
1466
|
leadFormMessage: "Jūsu ziņojums"
|
|
1467
|
-
},
|
|
1467
|
+
}, lt = {
|
|
1468
1468
|
sendMessage: "Siųsti žinutę",
|
|
1469
1469
|
send: "Siųsti",
|
|
1470
1470
|
close: "Uždaryti",
|
|
@@ -1507,7 +1507,7 @@ const Ea = {
|
|
|
1507
1507
|
leadFormEmail: "El. paštas",
|
|
1508
1508
|
leadFormPhone: "Telefonas",
|
|
1509
1509
|
leadFormMessage: "Jūsų žinutė"
|
|
1510
|
-
},
|
|
1510
|
+
}, ct = {
|
|
1511
1511
|
sendMessage: "Испрати порака",
|
|
1512
1512
|
send: "Испрати",
|
|
1513
1513
|
close: "Затвори",
|
|
@@ -1550,7 +1550,7 @@ const Ea = {
|
|
|
1550
1550
|
leadFormEmail: "Е-пошта",
|
|
1551
1551
|
leadFormPhone: "Телефон",
|
|
1552
1552
|
leadFormMessage: "Вашата порака"
|
|
1553
|
-
},
|
|
1553
|
+
}, dt = {
|
|
1554
1554
|
sendMessage: "Hantar mesej",
|
|
1555
1555
|
send: "Hantar",
|
|
1556
1556
|
close: "Tutup",
|
|
@@ -1593,7 +1593,7 @@ const Ea = {
|
|
|
1593
1593
|
leadFormEmail: "E-mel",
|
|
1594
1594
|
leadFormPhone: "Telefon",
|
|
1595
1595
|
leadFormMessage: "Mesej anda"
|
|
1596
|
-
},
|
|
1596
|
+
}, ut = {
|
|
1597
1597
|
sendMessage: "ഒരു സന്ദേശം അയയ്ക്കുക",
|
|
1598
1598
|
send: "അയയ്ക്കുക",
|
|
1599
1599
|
close: "അടയ്ക്കുക",
|
|
@@ -1636,7 +1636,7 @@ const Ea = {
|
|
|
1636
1636
|
leadFormEmail: "ഇമെയിൽ",
|
|
1637
1637
|
leadFormPhone: "ഫോൺ",
|
|
1638
1638
|
leadFormMessage: "നിങ്ങളുടെ സന്ദേശം"
|
|
1639
|
-
},
|
|
1639
|
+
}, mt = {
|
|
1640
1640
|
sendMessage: "संदेश पाठवा",
|
|
1641
1641
|
send: "पाठवा",
|
|
1642
1642
|
close: "बंद करा",
|
|
@@ -1679,7 +1679,7 @@ const Ea = {
|
|
|
1679
1679
|
leadFormEmail: "ईमेल",
|
|
1680
1680
|
leadFormPhone: "फोन",
|
|
1681
1681
|
leadFormMessage: "तुमचा संदेश"
|
|
1682
|
-
},
|
|
1682
|
+
}, ht = {
|
|
1683
1683
|
sendMessage: "Send en melding",
|
|
1684
1684
|
send: "Send",
|
|
1685
1685
|
close: "Lukk",
|
|
@@ -1722,7 +1722,7 @@ const Ea = {
|
|
|
1722
1722
|
leadFormEmail: "E-post",
|
|
1723
1723
|
leadFormPhone: "Telefon",
|
|
1724
1724
|
leadFormMessage: "Din melding"
|
|
1725
|
-
},
|
|
1725
|
+
}, gt = {
|
|
1726
1726
|
sendMessage: "پیامی بنویسید",
|
|
1727
1727
|
send: "ارسال",
|
|
1728
1728
|
close: "بستن",
|
|
@@ -1765,7 +1765,7 @@ const Ea = {
|
|
|
1765
1765
|
leadFormEmail: "ایمیل",
|
|
1766
1766
|
leadFormPhone: "تلفن",
|
|
1767
1767
|
leadFormMessage: "پیام شما"
|
|
1768
|
-
},
|
|
1768
|
+
}, pt = {
|
|
1769
1769
|
sendMessage: "Wyślij wiadomość",
|
|
1770
1770
|
send: "Wyślij",
|
|
1771
1771
|
close: "Zamknij",
|
|
@@ -1808,7 +1808,7 @@ const Ea = {
|
|
|
1808
1808
|
leadFormEmail: "E-mail",
|
|
1809
1809
|
leadFormPhone: "Telefon",
|
|
1810
1810
|
leadFormMessage: "Twoja wiadomość"
|
|
1811
|
-
},
|
|
1811
|
+
}, bt = {
|
|
1812
1812
|
sendMessage: "Enviar mensagem",
|
|
1813
1813
|
send: "Enviar",
|
|
1814
1814
|
close: "Fechar",
|
|
@@ -1851,7 +1851,7 @@ const Ea = {
|
|
|
1851
1851
|
leadFormEmail: "E-mail",
|
|
1852
1852
|
leadFormPhone: "Telefone",
|
|
1853
1853
|
leadFormMessage: "Sua mensagem"
|
|
1854
|
-
},
|
|
1854
|
+
}, ft = {
|
|
1855
1855
|
sendMessage: "ਇੱਕ ਸੁਨੇਹਾ ਭੇਜੋ",
|
|
1856
1856
|
send: "ਭੇਜੋ",
|
|
1857
1857
|
close: "ਬੰਦ ਕਰੋ",
|
|
@@ -1894,7 +1894,7 @@ const Ea = {
|
|
|
1894
1894
|
leadFormEmail: "ਈਮੇਲ",
|
|
1895
1895
|
leadFormPhone: "ਫ਼ੋਨ",
|
|
1896
1896
|
leadFormMessage: "ਤੁਹਾਡਾ ਸੁਨੇਹਾ"
|
|
1897
|
-
},
|
|
1897
|
+
}, kt = {
|
|
1898
1898
|
sendMessage: "Trimite un mesaj",
|
|
1899
1899
|
send: "Trimite",
|
|
1900
1900
|
close: "Închide",
|
|
@@ -1937,7 +1937,7 @@ const Ea = {
|
|
|
1937
1937
|
leadFormEmail: "E-mail",
|
|
1938
1938
|
leadFormPhone: "Telefon",
|
|
1939
1939
|
leadFormMessage: "Mesajul dumneavoastră"
|
|
1940
|
-
},
|
|
1940
|
+
}, vt = {
|
|
1941
1941
|
sendMessage: "Отправить сообщение",
|
|
1942
1942
|
send: "Отправить",
|
|
1943
1943
|
close: "Закрыть",
|
|
@@ -1980,7 +1980,7 @@ const Ea = {
|
|
|
1980
1980
|
leadFormEmail: "Электронная почта",
|
|
1981
1981
|
leadFormPhone: "Телефон",
|
|
1982
1982
|
leadFormMessage: "Ваше сообщение"
|
|
1983
|
-
},
|
|
1983
|
+
}, yt = {
|
|
1984
1984
|
sendMessage: "Пошаљи поруку",
|
|
1985
1985
|
send: "Пошаљи",
|
|
1986
1986
|
close: "Затвори",
|
|
@@ -2023,7 +2023,7 @@ const Ea = {
|
|
|
2023
2023
|
leadFormEmail: "Имејл",
|
|
2024
2024
|
leadFormPhone: "Телефон",
|
|
2025
2025
|
leadFormMessage: "Ваша порука"
|
|
2026
|
-
},
|
|
2026
|
+
}, Ft = {
|
|
2027
2027
|
sendMessage: "Poslať správu",
|
|
2028
2028
|
send: "Odoslať",
|
|
2029
2029
|
close: "Zavrieť",
|
|
@@ -2066,7 +2066,7 @@ const Ea = {
|
|
|
2066
2066
|
leadFormEmail: "E-mail",
|
|
2067
2067
|
leadFormPhone: "Telefón",
|
|
2068
2068
|
leadFormMessage: "Vaša správa"
|
|
2069
|
-
},
|
|
2069
|
+
}, Tt = {
|
|
2070
2070
|
sendMessage: "Pošlji sporočilo",
|
|
2071
2071
|
send: "Pošlji",
|
|
2072
2072
|
close: "Zapri",
|
|
@@ -2109,7 +2109,7 @@ const Ea = {
|
|
|
2109
2109
|
leadFormEmail: "E-pošta",
|
|
2110
2110
|
leadFormPhone: "Telefon",
|
|
2111
2111
|
leadFormMessage: "Vaše sporočilo"
|
|
2112
|
-
},
|
|
2112
|
+
}, Et = {
|
|
2113
2113
|
sendMessage: "Enviar un mensaje",
|
|
2114
2114
|
send: "Enviar",
|
|
2115
2115
|
close: "Cerrar",
|
|
@@ -2152,7 +2152,7 @@ const Ea = {
|
|
|
2152
2152
|
leadFormEmail: "Correo electrónico",
|
|
2153
2153
|
leadFormPhone: "Teléfono",
|
|
2154
2154
|
leadFormMessage: "Tu mensaje"
|
|
2155
|
-
},
|
|
2155
|
+
}, zt = {
|
|
2156
2156
|
sendMessage: "Tuma ujumbe",
|
|
2157
2157
|
send: "Tuma",
|
|
2158
2158
|
close: "Funga",
|
|
@@ -2195,7 +2195,7 @@ const Ea = {
|
|
|
2195
2195
|
leadFormEmail: "Barua pepe",
|
|
2196
2196
|
leadFormPhone: "Simu",
|
|
2197
2197
|
leadFormMessage: "Ujumbe wako"
|
|
2198
|
-
},
|
|
2198
|
+
}, St = {
|
|
2199
2199
|
sendMessage: "Skicka ett meddelande",
|
|
2200
2200
|
send: "Skicka",
|
|
2201
2201
|
close: "Stäng",
|
|
@@ -2238,7 +2238,7 @@ const Ea = {
|
|
|
2238
2238
|
leadFormEmail: "E-post",
|
|
2239
2239
|
leadFormPhone: "Telefon",
|
|
2240
2240
|
leadFormMessage: "Ditt meddelande"
|
|
2241
|
-
},
|
|
2241
|
+
}, xt = {
|
|
2242
2242
|
sendMessage: "Magpadala ng mensahe",
|
|
2243
2243
|
send: "Ipadala",
|
|
2244
2244
|
close: "Isara",
|
|
@@ -2281,7 +2281,7 @@ const Ea = {
|
|
|
2281
2281
|
leadFormEmail: "Email",
|
|
2282
2282
|
leadFormPhone: "Telepono",
|
|
2283
2283
|
leadFormMessage: "Ang iyong mensahe"
|
|
2284
|
-
},
|
|
2284
|
+
}, Mt = {
|
|
2285
2285
|
sendMessage: "ஒரு செய்தி அனுப்பவும்",
|
|
2286
2286
|
send: "அனுப்பு",
|
|
2287
2287
|
close: "மூடு",
|
|
@@ -2324,7 +2324,7 @@ const Ea = {
|
|
|
2324
2324
|
leadFormEmail: "மின்னஞ்சல்",
|
|
2325
2325
|
leadFormPhone: "தொலைபேசி",
|
|
2326
2326
|
leadFormMessage: "உங்கள் செய்தி"
|
|
2327
|
-
},
|
|
2327
|
+
}, wt = {
|
|
2328
2328
|
sendMessage: "సందేశం పంపండి",
|
|
2329
2329
|
send: "పంపు",
|
|
2330
2330
|
close: "మూసివేయండి",
|
|
@@ -2367,7 +2367,7 @@ const Ea = {
|
|
|
2367
2367
|
leadFormEmail: "ఇమెయిల్",
|
|
2368
2368
|
leadFormPhone: "ఫోన్",
|
|
2369
2369
|
leadFormMessage: "మీ సందేశం"
|
|
2370
|
-
},
|
|
2370
|
+
}, Pt = {
|
|
2371
2371
|
sendMessage: "ส่งข้อความ",
|
|
2372
2372
|
send: "ส่ง",
|
|
2373
2373
|
close: "ปิด",
|
|
@@ -2410,7 +2410,7 @@ const Ea = {
|
|
|
2410
2410
|
leadFormEmail: "อีเมล",
|
|
2411
2411
|
leadFormPhone: "โทรศัพท์",
|
|
2412
2412
|
leadFormMessage: "ข้อความของคุณ"
|
|
2413
|
-
},
|
|
2413
|
+
}, Ct = {
|
|
2414
2414
|
sendMessage: "Mesaj gönder",
|
|
2415
2415
|
send: "Gönder",
|
|
2416
2416
|
close: "Kapat",
|
|
@@ -2453,7 +2453,7 @@ const Ea = {
|
|
|
2453
2453
|
leadFormEmail: "E-posta",
|
|
2454
2454
|
leadFormPhone: "Telefon",
|
|
2455
2455
|
leadFormMessage: "Mesajınız"
|
|
2456
|
-
},
|
|
2456
|
+
}, Lt = {
|
|
2457
2457
|
sendMessage: "Надіслати повідомлення",
|
|
2458
2458
|
send: "Надіслати",
|
|
2459
2459
|
close: "Закрити",
|
|
@@ -2496,7 +2496,7 @@ const Ea = {
|
|
|
2496
2496
|
leadFormEmail: "Електронна пошта",
|
|
2497
2497
|
leadFormPhone: "Телефон",
|
|
2498
2498
|
leadFormMessage: "Ваше повідомлення"
|
|
2499
|
-
},
|
|
2499
|
+
}, At = {
|
|
2500
2500
|
sendMessage: "پیغام بھیجیں",
|
|
2501
2501
|
send: "بھیجیں",
|
|
2502
2502
|
close: "بند کریں",
|
|
@@ -2539,7 +2539,7 @@ const Ea = {
|
|
|
2539
2539
|
leadFormEmail: "ای میل",
|
|
2540
2540
|
leadFormPhone: "فون",
|
|
2541
2541
|
leadFormMessage: "آپ کا پیغام"
|
|
2542
|
-
},
|
|
2542
|
+
}, _t = {
|
|
2543
2543
|
sendMessage: "Gửi tin nhắn",
|
|
2544
2544
|
send: "Gửi",
|
|
2545
2545
|
close: "Đóng",
|
|
@@ -2582,7 +2582,7 @@ const Ea = {
|
|
|
2582
2582
|
leadFormEmail: "Email",
|
|
2583
2583
|
leadFormPhone: "Điện thoại",
|
|
2584
2584
|
leadFormMessage: "Tin nhắn của bạn"
|
|
2585
|
-
},
|
|
2585
|
+
}, qt = {
|
|
2586
2586
|
sendMessage: "Anfon neges",
|
|
2587
2587
|
send: "Anfon",
|
|
2588
2588
|
close: "Cau",
|
|
@@ -2625,69 +2625,69 @@ const Ea = {
|
|
|
2625
2625
|
leadFormEmail: "E-bost",
|
|
2626
2626
|
leadFormPhone: "Ffôn",
|
|
2627
2627
|
leadFormMessage: "Eich neges"
|
|
2628
|
-
},
|
|
2629
|
-
af:
|
|
2630
|
-
sq:
|
|
2631
|
-
ar:
|
|
2632
|
-
"ar-eg":
|
|
2633
|
-
"ar-sa":
|
|
2634
|
-
az:
|
|
2635
|
-
eu:
|
|
2636
|
-
be:
|
|
2637
|
-
bn:
|
|
2638
|
-
bs:
|
|
2639
|
-
bg:
|
|
2640
|
-
ca:
|
|
2641
|
-
zh:
|
|
2642
|
-
hr:
|
|
2643
|
-
cs:
|
|
2644
|
-
da:
|
|
2645
|
-
nl:
|
|
2646
|
-
en:
|
|
2647
|
-
et:
|
|
2648
|
-
fi:
|
|
2649
|
-
fr:
|
|
2650
|
-
gl:
|
|
2651
|
-
de:
|
|
2652
|
-
el:
|
|
2653
|
-
gu:
|
|
2654
|
-
hi:
|
|
2655
|
-
hu:
|
|
2656
|
-
id:
|
|
2657
|
-
it:
|
|
2658
|
-
ja:
|
|
2659
|
-
kn:
|
|
2660
|
-
kk:
|
|
2661
|
-
ko:
|
|
2662
|
-
lv:
|
|
2663
|
-
lt
|
|
2664
|
-
mk:
|
|
2665
|
-
ms:
|
|
2666
|
-
ml:
|
|
2667
|
-
mr:
|
|
2668
|
-
no:
|
|
2669
|
-
fa:
|
|
2670
|
-
pl:
|
|
2671
|
-
pt:
|
|
2672
|
-
pa:
|
|
2673
|
-
ro:
|
|
2674
|
-
ru:
|
|
2675
|
-
sr:
|
|
2676
|
-
sk:
|
|
2677
|
-
sl:
|
|
2678
|
-
es:
|
|
2679
|
-
sw:
|
|
2680
|
-
sv:
|
|
2681
|
-
tl:
|
|
2682
|
-
ta:
|
|
2683
|
-
te:
|
|
2684
|
-
th:
|
|
2685
|
-
tr:
|
|
2686
|
-
uk:
|
|
2687
|
-
ur:
|
|
2688
|
-
vi:
|
|
2689
|
-
cy:
|
|
2690
|
-
},
|
|
2628
|
+
}, $e = {
|
|
2629
|
+
af: wa,
|
|
2630
|
+
sq: Pa,
|
|
2631
|
+
ar: Ca,
|
|
2632
|
+
"ar-eg": La,
|
|
2633
|
+
"ar-sa": Aa,
|
|
2634
|
+
az: _a,
|
|
2635
|
+
eu: qa,
|
|
2636
|
+
be: Ia,
|
|
2637
|
+
bn: Va,
|
|
2638
|
+
bs: Na,
|
|
2639
|
+
bg: ja,
|
|
2640
|
+
ca: Da,
|
|
2641
|
+
zh: Ra,
|
|
2642
|
+
hr: Ba,
|
|
2643
|
+
cs: Ga,
|
|
2644
|
+
da: Ua,
|
|
2645
|
+
nl: Ka,
|
|
2646
|
+
en: Oa,
|
|
2647
|
+
et: Ya,
|
|
2648
|
+
fi: Qa,
|
|
2649
|
+
fr: Ha,
|
|
2650
|
+
gl: Wa,
|
|
2651
|
+
de: $a,
|
|
2652
|
+
el: Za,
|
|
2653
|
+
gu: Ja,
|
|
2654
|
+
hi: Xa,
|
|
2655
|
+
hu: et,
|
|
2656
|
+
id: at,
|
|
2657
|
+
it: tt,
|
|
2658
|
+
ja: nt,
|
|
2659
|
+
kn: it,
|
|
2660
|
+
kk: ot,
|
|
2661
|
+
ko: st,
|
|
2662
|
+
lv: rt,
|
|
2663
|
+
lt,
|
|
2664
|
+
mk: ct,
|
|
2665
|
+
ms: dt,
|
|
2666
|
+
ml: ut,
|
|
2667
|
+
mr: mt,
|
|
2668
|
+
no: ht,
|
|
2669
|
+
fa: gt,
|
|
2670
|
+
pl: pt,
|
|
2671
|
+
pt: bt,
|
|
2672
|
+
pa: ft,
|
|
2673
|
+
ro: kt,
|
|
2674
|
+
ru: vt,
|
|
2675
|
+
sr: yt,
|
|
2676
|
+
sk: Ft,
|
|
2677
|
+
sl: Tt,
|
|
2678
|
+
es: Et,
|
|
2679
|
+
sw: zt,
|
|
2680
|
+
sv: St,
|
|
2681
|
+
tl: xt,
|
|
2682
|
+
ta: Mt,
|
|
2683
|
+
te: wt,
|
|
2684
|
+
th: Pt,
|
|
2685
|
+
tr: Ct,
|
|
2686
|
+
uk: Lt,
|
|
2687
|
+
ur: At,
|
|
2688
|
+
vi: _t,
|
|
2689
|
+
cy: qt
|
|
2690
|
+
}, Ae = [
|
|
2691
2691
|
{ value: "af", label: "Afrikaans", dir: "ltr" },
|
|
2692
2692
|
{ value: "sq", label: "Shqip", dir: "ltr" },
|
|
2693
2693
|
{ value: "ar-eg", label: "العربية (مصر)", dir: "rtl" },
|
|
@@ -2748,23 +2748,23 @@ const Ea = {
|
|
|
2748
2748
|
{ value: "ur", label: "اردو", dir: "rtl" },
|
|
2749
2749
|
{ value: "vi", label: "Tiếng Việt", dir: "ltr" },
|
|
2750
2750
|
{ value: "cy", label: "Cymraeg", dir: "ltr" }
|
|
2751
|
-
],
|
|
2751
|
+
], Ze = Ae.map(
|
|
2752
2752
|
(a) => a.value
|
|
2753
2753
|
);
|
|
2754
|
-
function
|
|
2755
|
-
return
|
|
2754
|
+
function Je(a) {
|
|
2755
|
+
return Ae.find((e) => e.value === a) || Ae.find((e) => e.value === "en");
|
|
2756
2756
|
}
|
|
2757
|
-
function
|
|
2758
|
-
return
|
|
2757
|
+
function z(a, e) {
|
|
2758
|
+
return $e[a]?.[e] || $e.en[e] || e;
|
|
2759
2759
|
}
|
|
2760
|
-
function
|
|
2761
|
-
const t = Array.isArray(a) ? a.filter((i) =>
|
|
2762
|
-
return !t.includes(e) &&
|
|
2760
|
+
function ye(a, e = "en") {
|
|
2761
|
+
const t = Array.isArray(a) ? a.filter((i) => Ze.includes(i)) : [];
|
|
2762
|
+
return !t.includes(e) && Ze.includes(e) && t.unshift(e), t.length ? [...new Set(t)] : ["ar-sa"];
|
|
2763
2763
|
}
|
|
2764
|
-
const
|
|
2764
|
+
const Xe = {
|
|
2765
2765
|
id: null,
|
|
2766
2766
|
name: "Agent",
|
|
2767
|
-
agentType:
|
|
2767
|
+
agentType: de.TEXT,
|
|
2768
2768
|
useText: !0,
|
|
2769
2769
|
useVoice: !1,
|
|
2770
2770
|
faceImage: null,
|
|
@@ -2775,67 +2775,105 @@ const $e = {
|
|
|
2775
2775
|
welcomeMessages: {},
|
|
2776
2776
|
conversation: { default_language: "ar-sa", languages: ["ar-sa"], suggested_messages: {} },
|
|
2777
2777
|
widget: {
|
|
2778
|
-
appearance: {
|
|
2778
|
+
appearance: {
|
|
2779
|
+
position: "right",
|
|
2780
|
+
show_branding: !0,
|
|
2781
|
+
show_topbar_avatar_image: !0,
|
|
2782
|
+
font: "Cairo",
|
|
2783
|
+
footer_content: {},
|
|
2784
|
+
theme: { mode: "dark", accent_color: null, end_call_button_color: null }
|
|
2785
|
+
},
|
|
2779
2786
|
behavior: {
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2787
|
+
default_open: !1,
|
|
2788
|
+
conversation_ended_screen: {
|
|
2789
|
+
post_chat_rating_enabled: !1,
|
|
2790
|
+
show_conversation_id: !0
|
|
2791
|
+
},
|
|
2792
|
+
welcome_bubble: {
|
|
2793
|
+
enabled: !1,
|
|
2794
|
+
delay_seconds: 3,
|
|
2795
|
+
sound_enabled: !1
|
|
2796
|
+
},
|
|
2784
2797
|
typing_indicator_enabled: !0,
|
|
2785
2798
|
suggested_messages: {}
|
|
2799
|
+
},
|
|
2800
|
+
consent: {
|
|
2801
|
+
enabled: !1,
|
|
2802
|
+
one_time: !0,
|
|
2803
|
+
content: {}
|
|
2786
2804
|
}
|
|
2787
2805
|
}
|
|
2788
2806
|
};
|
|
2789
|
-
function
|
|
2790
|
-
if (!a) return
|
|
2791
|
-
const e = a, t = e.agent_type || e.agentType ||
|
|
2807
|
+
function ve(a) {
|
|
2808
|
+
if (!a) return Xe;
|
|
2809
|
+
const e = a, t = e.agent_type || e.agentType || de.TEXT, i = typeof e.use_text == "boolean" ? e.use_text : typeof e.useText == "boolean" ? e.useText : t !== de.VOICE, o = typeof e.use_voice == "boolean" ? e.use_voice : typeof e.useVoice == "boolean" ? e.useVoice : t === de.TEXT_AND_VOICE || t === de.CLOUD_AVATAR || t === de.DESKTOP_AVATAR, s = e.conversation || e.agent_customization?.conversation || {}, r = e.speech || e.agent_customization?.speech || {}, c = s.default_language || "ar-sa", l = ye(s.languages, c), d = e.widget || e.agent_customization?.widget || e.widget_customization || null, m = d?.appearance, u = d?.behavior, h = d, F = typeof m?.hide_branding == "boolean" ? !m.hide_branding : typeof m?.show_branding == "boolean" ? m.show_branding : !0, b = typeof m?.show_topbar_avatar_image == "boolean" ? m.show_topbar_avatar_image : typeof m?.showTopbarAvatarImage == "boolean" ? m.showTopbarAvatarImage : typeof d?.show_topbar_avatar_image == "boolean" ? d.show_topbar_avatar_image : typeof d?.showTopbarAvatarImage == "boolean" ? d.showTopbarAvatarImage : typeof e.show_topbar_avatar_image == "boolean" ? e.show_topbar_avatar_image : typeof e.showTopbarAvatarImage == "boolean" ? e.showTopbarAvatarImage : !0, M = u?.suggested_messages || d?.suggested_messages || s.suggested_messages || s.suggestedMessages || {}, S = typeof u?.default_open == "boolean" ? u.default_open : typeof u?.defaultOpen == "boolean" ? u.defaultOpen : typeof d?.default_open == "boolean" ? d.default_open : typeof d?.defaultOpen == "boolean" ? d.defaultOpen : typeof e.default_open == "boolean" ? e.default_open : typeof e.defaultOpen == "boolean" ? e.defaultOpen : !1, T = typeof m?.font == "string" ? m.font : typeof d?.font == "string" ? d.font : typeof e.font == "string" ? e.font : "Cairo", k = (() => {
|
|
2810
|
+
const U = (T || "").trim().toLowerCase().replace(/[-_]/g, " ");
|
|
2811
|
+
return U === "readex pro" || U === "readex" ? "Readex Pro" : U === "noto sans" || U === "noto" || U === "noto sans arabic" ? "Noto Sans" : "Cairo";
|
|
2812
|
+
})(), p = d?.consent || e.consent || e.consent_config || null, g = typeof p?.enabled == "boolean" ? p.enabled : !1, w = typeof p?.one_time == "boolean" ? p.one_time : typeof p?.oneTime == "boolean" ? p.oneTime : !0, E = p?.content || p?.body || {}, f = u?.conversation_ended_screen, P = {
|
|
2813
|
+
post_chat_rating_enabled: typeof f?.post_chat_rating_enabled == "boolean" ? f.post_chat_rating_enabled : typeof u?.post_chat_rating_enabled == "boolean" ? u.post_chat_rating_enabled : !1,
|
|
2814
|
+
show_conversation_id: typeof f?.show_conversation_id == "boolean" ? f.show_conversation_id : typeof f?.showConversationId == "boolean" ? f.showConversationId : !0
|
|
2815
|
+
}, C = u?.welcome_bubble, _ = {
|
|
2816
|
+
enabled: typeof C?.enabled == "boolean" ? C.enabled : !1,
|
|
2817
|
+
delay_seconds: typeof C?.delay_seconds == "number" ? C.delay_seconds : 3,
|
|
2818
|
+
sound_enabled: typeof C?.sound_enabled == "boolean" ? C.sound_enabled : !1
|
|
2819
|
+
}, x = m?.theme, j = {
|
|
2820
|
+
mode: x?.mode === "light" ? "light" : "dark",
|
|
2821
|
+
accent_color: typeof x?.accent_color == "string" ? x.accent_color : null,
|
|
2822
|
+
end_call_button_color: typeof x?.end_call_button_color == "string" ? x.end_call_button_color : null
|
|
2823
|
+
}, R = h ? {
|
|
2792
2824
|
appearance: {
|
|
2793
|
-
brand_color: m?.brand_color,
|
|
2794
2825
|
position: m?.position || "right",
|
|
2795
|
-
show_branding:
|
|
2796
|
-
|
|
2826
|
+
show_branding: F,
|
|
2827
|
+
show_topbar_avatar_image: b,
|
|
2828
|
+
font: k,
|
|
2829
|
+
footer_content: m?.footer_content || {},
|
|
2830
|
+
theme: j
|
|
2797
2831
|
},
|
|
2798
2832
|
behavior: {
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
welcome_bubble_sound_enabled: typeof u?.welcome_bubble_sound_enabled == "boolean" ? u.welcome_bubble_sound_enabled : !1,
|
|
2833
|
+
default_open: S,
|
|
2834
|
+
conversation_ended_screen: P,
|
|
2835
|
+
welcome_bubble: _,
|
|
2803
2836
|
typing_indicator_enabled: typeof u?.typing_indicator_enabled == "boolean" ? u.typing_indicator_enabled : !0,
|
|
2804
|
-
suggested_messages:
|
|
2837
|
+
suggested_messages: M
|
|
2838
|
+
},
|
|
2839
|
+
consent: {
|
|
2840
|
+
enabled: g,
|
|
2841
|
+
one_time: w,
|
|
2842
|
+
content: E
|
|
2805
2843
|
}
|
|
2806
|
-
} : void 0,
|
|
2807
|
-
Object.entries(
|
|
2808
|
-
),
|
|
2844
|
+
} : void 0, D = e.consent || e.consent_config || null, L = s.welcome_message || s.welcomeMessage || e.welcome_message || e.welcomeMessage || {}, G = Object.fromEntries(
|
|
2845
|
+
Object.entries(L).filter(([, U]) => typeof U == "string").map(([U, J]) => [U, J.slice(0, 1e3)])
|
|
2846
|
+
), N = typeof e.allow_interrupt == "boolean" ? e.allow_interrupt : typeof r.allow_interrupt == "boolean" ? r.allow_interrupt : !0, Y = typeof e.allow_welcome_message_interrupt == "boolean" ? e.allow_welcome_message_interrupt : typeof r.allow_welcome_message_interrupt == "boolean" ? r.allow_welcome_message_interrupt : !1, O = (typeof e.face_image == "string" ? e.face_image : null) || (typeof e.faceImage == "string" ? e.faceImage : null) || null;
|
|
2809
2847
|
return {
|
|
2810
2848
|
id: e.id || null,
|
|
2811
|
-
name: e.name ||
|
|
2849
|
+
name: e.name || Xe.name,
|
|
2812
2850
|
agentType: t,
|
|
2813
2851
|
useText: i,
|
|
2814
|
-
useVoice:
|
|
2815
|
-
faceImage:
|
|
2816
|
-
allowInterrupt:
|
|
2817
|
-
allowWelcomeMessageInterrupt:
|
|
2818
|
-
welcomeMessages:
|
|
2819
|
-
languages:
|
|
2820
|
-
defaultLanguage:
|
|
2852
|
+
useVoice: o,
|
|
2853
|
+
faceImage: O,
|
|
2854
|
+
allowInterrupt: N,
|
|
2855
|
+
allowWelcomeMessageInterrupt: Y,
|
|
2856
|
+
welcomeMessages: G,
|
|
2857
|
+
languages: l,
|
|
2858
|
+
defaultLanguage: l.includes(c) ? c : l[0],
|
|
2821
2859
|
conversation: {
|
|
2822
2860
|
default_language: c,
|
|
2823
|
-
languages:
|
|
2824
|
-
suggested_messages:
|
|
2861
|
+
languages: l,
|
|
2862
|
+
suggested_messages: M
|
|
2825
2863
|
},
|
|
2826
|
-
widget:
|
|
2827
|
-
consent:
|
|
2828
|
-
enabled:
|
|
2829
|
-
title:
|
|
2830
|
-
body:
|
|
2831
|
-
acceptLabel:
|
|
2832
|
-
declineLabel:
|
|
2833
|
-
termsUrl:
|
|
2834
|
-
privacyUrl:
|
|
2864
|
+
widget: R || void 0,
|
|
2865
|
+
consent: D ? {
|
|
2866
|
+
enabled: D.enabled ?? !1,
|
|
2867
|
+
title: D.title || void 0,
|
|
2868
|
+
body: D.body || void 0,
|
|
2869
|
+
acceptLabel: D.accept_label || D.acceptLabel || void 0,
|
|
2870
|
+
declineLabel: D.decline_label || D.declineLabel || void 0,
|
|
2871
|
+
termsUrl: D.terms_url || D.termsUrl || void 0,
|
|
2872
|
+
privacyUrl: D.privacy_url || D.privacyUrl || void 0
|
|
2835
2873
|
} : void 0
|
|
2836
2874
|
};
|
|
2837
2875
|
}
|
|
2838
|
-
async function
|
|
2876
|
+
async function It({
|
|
2839
2877
|
restUrl: a,
|
|
2840
2878
|
identifier: e,
|
|
2841
2879
|
withCredentials: t = !1,
|
|
@@ -2843,7 +2881,7 @@ async function Ct({
|
|
|
2843
2881
|
}) {
|
|
2844
2882
|
if (!a) throw new Error("Missing restUrl");
|
|
2845
2883
|
if (!e) throw new Error("Missing identifier (agent_id or api_key)");
|
|
2846
|
-
const
|
|
2884
|
+
const o = await fetch(`${a}/agent/${e}/customization`, {
|
|
2847
2885
|
method: "GET",
|
|
2848
2886
|
mode: "cors",
|
|
2849
2887
|
credentials: t ? "include" : "omit",
|
|
@@ -2852,29 +2890,29 @@ async function Ct({
|
|
|
2852
2890
|
},
|
|
2853
2891
|
signal: i
|
|
2854
2892
|
});
|
|
2855
|
-
if (!
|
|
2856
|
-
throw new Error(`Failed to load agent customization: ${
|
|
2857
|
-
const
|
|
2858
|
-
return
|
|
2859
|
-
id:
|
|
2860
|
-
name:
|
|
2861
|
-
company_name:
|
|
2862
|
-
agent_type:
|
|
2863
|
-
use_voice:
|
|
2864
|
-
use_text:
|
|
2865
|
-
face_image:
|
|
2866
|
-
conversation:
|
|
2867
|
-
widget:
|
|
2868
|
-
allow_interrupt:
|
|
2869
|
-
allow_welcome_message_interrupt:
|
|
2870
|
-
welcome_message:
|
|
2893
|
+
if (!o.ok)
|
|
2894
|
+
throw new Error(`Failed to load agent customization: ${o.status}`);
|
|
2895
|
+
const s = await o.json();
|
|
2896
|
+
return ve({
|
|
2897
|
+
id: s.id,
|
|
2898
|
+
name: s.name,
|
|
2899
|
+
company_name: s.company_name,
|
|
2900
|
+
agent_type: s.agent_type,
|
|
2901
|
+
use_voice: s.use_voice,
|
|
2902
|
+
use_text: s.use_text,
|
|
2903
|
+
face_image: s.face_image,
|
|
2904
|
+
conversation: s.conversation,
|
|
2905
|
+
widget: s.widget,
|
|
2906
|
+
allow_interrupt: s.allow_interrupt,
|
|
2907
|
+
allow_welcome_message_interrupt: s.allow_welcome_message_interrupt,
|
|
2908
|
+
welcome_message: s.welcome_message
|
|
2871
2909
|
});
|
|
2872
2910
|
}
|
|
2873
|
-
async function
|
|
2911
|
+
async function li({ restUrl: a, apiKey: e, agentId: t, signal: i }) {
|
|
2874
2912
|
if (!a) throw new Error("Missing restUrl");
|
|
2875
|
-
const
|
|
2876
|
-
if (!
|
|
2877
|
-
const
|
|
2913
|
+
const o = e || t;
|
|
2914
|
+
if (!o) throw new Error("Provide one of apiKey or agentId");
|
|
2915
|
+
const s = await fetch(`${a}/agent/${o}`, {
|
|
2878
2916
|
method: "GET",
|
|
2879
2917
|
mode: "cors",
|
|
2880
2918
|
credentials: "omit",
|
|
@@ -2883,24 +2921,24 @@ async function Zn({ restUrl: a, apiKey: e, agentId: t, signal: i }) {
|
|
|
2883
2921
|
},
|
|
2884
2922
|
signal: i
|
|
2885
2923
|
});
|
|
2886
|
-
if (!
|
|
2887
|
-
let r = `HTTP ${
|
|
2924
|
+
if (!s.ok) {
|
|
2925
|
+
let r = `HTTP ${s.status}`;
|
|
2888
2926
|
try {
|
|
2889
|
-
const
|
|
2890
|
-
r =
|
|
2927
|
+
const l = await s.json();
|
|
2928
|
+
r = l?.detail || l?.message || r;
|
|
2891
2929
|
} catch {
|
|
2892
2930
|
}
|
|
2893
2931
|
throw new Error(r);
|
|
2894
2932
|
}
|
|
2895
|
-
return
|
|
2933
|
+
return ve(await s.json());
|
|
2896
2934
|
}
|
|
2897
|
-
function
|
|
2935
|
+
function Vt(a, e) {
|
|
2898
2936
|
if (!e) return a;
|
|
2899
2937
|
let { useVoice: t, useText: i } = a;
|
|
2900
2938
|
return typeof e.use_voice == "boolean" && (t = e.use_voice), typeof e.use_text == "boolean" && (i = e.use_text), t === a.useVoice && i === a.useText ? a : { ...a, useVoice: t, useText: i };
|
|
2901
2939
|
}
|
|
2902
|
-
function
|
|
2903
|
-
return a.agentType ===
|
|
2940
|
+
function Ee(a) {
|
|
2941
|
+
return a.agentType === de.CLOUD_AVATAR || a.agentType === de.DESKTOP_AVATAR ? "avatar" : a.useText && a.useVoice ? "text_and_voice" : a.useVoice ? "voice" : "text";
|
|
2904
2942
|
}
|
|
2905
2943
|
/**
|
|
2906
2944
|
* @license lucide-react v1.24.0 - ISC
|
|
@@ -2908,21 +2946,21 @@ function ve(a) {
|
|
|
2908
2946
|
* This source code is licensed under the ISC license.
|
|
2909
2947
|
* See the LICENSE file in the root directory of this source tree.
|
|
2910
2948
|
*/
|
|
2911
|
-
const
|
|
2949
|
+
const ca = (...a) => a.filter((e, t, i) => !!e && e.trim() !== "" && i.indexOf(e) === t).join(" ").trim();
|
|
2912
2950
|
/**
|
|
2913
2951
|
* @license lucide-react v1.24.0 - ISC
|
|
2914
2952
|
*
|
|
2915
2953
|
* This source code is licensed under the ISC license.
|
|
2916
2954
|
* See the LICENSE file in the root directory of this source tree.
|
|
2917
2955
|
*/
|
|
2918
|
-
const
|
|
2956
|
+
const Nt = (a) => a.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
2919
2957
|
/**
|
|
2920
2958
|
* @license lucide-react v1.24.0 - ISC
|
|
2921
2959
|
*
|
|
2922
2960
|
* This source code is licensed under the ISC license.
|
|
2923
2961
|
* See the LICENSE file in the root directory of this source tree.
|
|
2924
2962
|
*/
|
|
2925
|
-
const
|
|
2963
|
+
const jt = (a) => a.replace(
|
|
2926
2964
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
2927
2965
|
(e, t, i) => i ? i.toUpperCase() : t.toLowerCase()
|
|
2928
2966
|
);
|
|
@@ -2932,8 +2970,8 @@ const At = (a) => a.replace(
|
|
|
2932
2970
|
* This source code is licensed under the ISC license.
|
|
2933
2971
|
* See the LICENSE file in the root directory of this source tree.
|
|
2934
2972
|
*/
|
|
2935
|
-
const
|
|
2936
|
-
const e =
|
|
2973
|
+
const ea = (a) => {
|
|
2974
|
+
const e = jt(a);
|
|
2937
2975
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
2938
2976
|
};
|
|
2939
2977
|
/**
|
|
@@ -2942,7 +2980,7 @@ const Ze = (a) => {
|
|
|
2942
2980
|
* This source code is licensed under the ISC license.
|
|
2943
2981
|
* See the LICENSE file in the root directory of this source tree.
|
|
2944
2982
|
*/
|
|
2945
|
-
var
|
|
2983
|
+
var Ce = {
|
|
2946
2984
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2947
2985
|
width: 24,
|
|
2948
2986
|
height: 24,
|
|
@@ -2959,36 +2997,36 @@ var Me = {
|
|
|
2959
2997
|
* This source code is licensed under the ISC license.
|
|
2960
2998
|
* See the LICENSE file in the root directory of this source tree.
|
|
2961
2999
|
*/
|
|
2962
|
-
const
|
|
3000
|
+
const Dt = (a) => {
|
|
2963
3001
|
for (const e in a)
|
|
2964
3002
|
if (e.startsWith("aria-") || e === "role" || e === "title")
|
|
2965
3003
|
return !0;
|
|
2966
3004
|
return !1;
|
|
2967
|
-
},
|
|
2968
|
-
({ color: a, size: e, strokeWidth: t, absoluteStrokeWidth: i, className:
|
|
3005
|
+
}, Rt = Ma({}), Bt = () => xa(Rt), Gt = la(
|
|
3006
|
+
({ color: a, size: e, strokeWidth: t, absoluteStrokeWidth: i, className: o = "", children: s, iconNode: r, ...c }, l) => {
|
|
2969
3007
|
const {
|
|
2970
|
-
size:
|
|
3008
|
+
size: d = 24,
|
|
2971
3009
|
strokeWidth: m = 2,
|
|
2972
3010
|
absoluteStrokeWidth: u = !1,
|
|
2973
3011
|
color: h = "currentColor",
|
|
2974
|
-
className:
|
|
2975
|
-
} =
|
|
2976
|
-
return
|
|
3012
|
+
className: F = ""
|
|
3013
|
+
} = Bt() ?? {}, b = i ?? u ? Number(t ?? m) * 24 / Number(e ?? d) : t ?? m;
|
|
3014
|
+
return Le(
|
|
2977
3015
|
"svg",
|
|
2978
3016
|
{
|
|
2979
|
-
ref:
|
|
2980
|
-
...
|
|
2981
|
-
width: e ??
|
|
2982
|
-
height: e ??
|
|
3017
|
+
ref: l,
|
|
3018
|
+
...Ce,
|
|
3019
|
+
width: e ?? d ?? Ce.width,
|
|
3020
|
+
height: e ?? d ?? Ce.height,
|
|
2983
3021
|
stroke: a ?? h,
|
|
2984
3022
|
strokeWidth: b,
|
|
2985
|
-
className:
|
|
2986
|
-
...!
|
|
3023
|
+
className: ca("lucide", F, o),
|
|
3024
|
+
...!s && !Dt(c) && { "aria-hidden": "true" },
|
|
2987
3025
|
...c
|
|
2988
3026
|
},
|
|
2989
3027
|
[
|
|
2990
|
-
...r.map(([
|
|
2991
|
-
...Array.isArray(
|
|
3028
|
+
...r.map(([M, S]) => Le(M, S)),
|
|
3029
|
+
...Array.isArray(s) ? s : [s]
|
|
2992
3030
|
]
|
|
2993
3031
|
);
|
|
2994
3032
|
}
|
|
@@ -2999,20 +3037,20 @@ const Vt = (a) => {
|
|
|
2999
3037
|
* This source code is licensed under the ISC license.
|
|
3000
3038
|
* See the LICENSE file in the root directory of this source tree.
|
|
3001
3039
|
*/
|
|
3002
|
-
const
|
|
3003
|
-
const t =
|
|
3004
|
-
({ className: i, ...
|
|
3005
|
-
ref:
|
|
3040
|
+
const H = (a, e) => {
|
|
3041
|
+
const t = la(
|
|
3042
|
+
({ className: i, ...o }, s) => Le(Gt, {
|
|
3043
|
+
ref: s,
|
|
3006
3044
|
iconNode: e,
|
|
3007
|
-
className:
|
|
3008
|
-
`lucide-${
|
|
3045
|
+
className: ca(
|
|
3046
|
+
`lucide-${Nt(ea(a))}`,
|
|
3009
3047
|
`lucide-${a}`,
|
|
3010
3048
|
i
|
|
3011
3049
|
),
|
|
3012
|
-
...
|
|
3050
|
+
...o
|
|
3013
3051
|
})
|
|
3014
3052
|
);
|
|
3015
|
-
return t.displayName =
|
|
3053
|
+
return t.displayName = ea(a), t;
|
|
3016
3054
|
};
|
|
3017
3055
|
/**
|
|
3018
3056
|
* @license lucide-react v1.24.0 - ISC
|
|
@@ -3020,94 +3058,94 @@ const Y = (a, e) => {
|
|
|
3020
3058
|
* This source code is licensed under the ISC license.
|
|
3021
3059
|
* See the LICENSE file in the root directory of this source tree.
|
|
3022
3060
|
*/
|
|
3023
|
-
const
|
|
3061
|
+
const Ut = [
|
|
3024
3062
|
["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
|
|
3025
3063
|
["path", { d: "M12 19V5", key: "x0mq9r" }]
|
|
3026
|
-
],
|
|
3064
|
+
], Kt = H("arrow-up", Ut);
|
|
3027
3065
|
/**
|
|
3028
3066
|
* @license lucide-react v1.24.0 - ISC
|
|
3029
3067
|
*
|
|
3030
3068
|
* This source code is licensed under the ISC license.
|
|
3031
3069
|
* See the LICENSE file in the root directory of this source tree.
|
|
3032
3070
|
*/
|
|
3033
|
-
const
|
|
3071
|
+
const Ot = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], Yt = H("chevron-left", Ot);
|
|
3034
3072
|
/**
|
|
3035
3073
|
* @license lucide-react v1.24.0 - ISC
|
|
3036
3074
|
*
|
|
3037
3075
|
* This source code is licensed under the ISC license.
|
|
3038
3076
|
* See the LICENSE file in the root directory of this source tree.
|
|
3039
3077
|
*/
|
|
3040
|
-
const
|
|
3078
|
+
const Qt = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], da = H("chevron-down", Qt);
|
|
3041
3079
|
/**
|
|
3042
3080
|
* @license lucide-react v1.24.0 - ISC
|
|
3043
3081
|
*
|
|
3044
3082
|
* This source code is licensed under the ISC license.
|
|
3045
3083
|
* See the LICENSE file in the root directory of this source tree.
|
|
3046
3084
|
*/
|
|
3047
|
-
const
|
|
3085
|
+
const Ht = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]], Wt = H("chevron-up", Ht);
|
|
3048
3086
|
/**
|
|
3049
3087
|
* @license lucide-react v1.24.0 - ISC
|
|
3050
3088
|
*
|
|
3051
3089
|
* This source code is licensed under the ISC license.
|
|
3052
3090
|
* See the LICENSE file in the root directory of this source tree.
|
|
3053
3091
|
*/
|
|
3054
|
-
const
|
|
3092
|
+
const $t = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], ze = H("loader-circle", $t);
|
|
3055
3093
|
/**
|
|
3056
3094
|
* @license lucide-react v1.24.0 - ISC
|
|
3057
3095
|
*
|
|
3058
3096
|
* This source code is licensed under the ISC license.
|
|
3059
3097
|
* See the LICENSE file in the root directory of this source tree.
|
|
3060
3098
|
*/
|
|
3061
|
-
const
|
|
3099
|
+
const Zt = [
|
|
3062
3100
|
["path", { d: "M15 3h6v6", key: "1q9fwt" }],
|
|
3063
3101
|
["path", { d: "m21 3-7 7", key: "1l2asr" }],
|
|
3064
3102
|
["path", { d: "m3 21 7-7", key: "tjx5ai" }],
|
|
3065
3103
|
["path", { d: "M9 21H3v-6", key: "wtvkvv" }]
|
|
3066
|
-
],
|
|
3104
|
+
], Jt = H("maximize-2", Zt);
|
|
3067
3105
|
/**
|
|
3068
3106
|
* @license lucide-react v1.24.0 - ISC
|
|
3069
3107
|
*
|
|
3070
3108
|
* This source code is licensed under the ISC license.
|
|
3071
3109
|
* See the LICENSE file in the root directory of this source tree.
|
|
3072
3110
|
*/
|
|
3073
|
-
const
|
|
3111
|
+
const Xt = [
|
|
3074
3112
|
["path", { d: "M12 19v3", key: "npa21l" }],
|
|
3075
3113
|
["path", { d: "M15 9.34V5a3 3 0 0 0-5.68-1.33", key: "1gzdoj" }],
|
|
3076
3114
|
["path", { d: "M16.95 16.95A7 7 0 0 1 5 12v-2", key: "cqa7eg" }],
|
|
3077
3115
|
["path", { d: "M18.89 13.23A7 7 0 0 0 19 12v-2", key: "16hl24" }],
|
|
3078
3116
|
["path", { d: "m2 2 20 20", key: "1ooewy" }],
|
|
3079
3117
|
["path", { d: "M9 9v3a3 3 0 0 0 5.12 2.12", key: "r2i35w" }]
|
|
3080
|
-
],
|
|
3118
|
+
], Ve = H("mic-off", Xt);
|
|
3081
3119
|
/**
|
|
3082
3120
|
* @license lucide-react v1.24.0 - ISC
|
|
3083
3121
|
*
|
|
3084
3122
|
* This source code is licensed under the ISC license.
|
|
3085
3123
|
* See the LICENSE file in the root directory of this source tree.
|
|
3086
3124
|
*/
|
|
3087
|
-
const
|
|
3125
|
+
const en = [
|
|
3088
3126
|
["path", { d: "M12 19v3", key: "npa21l" }],
|
|
3089
3127
|
["path", { d: "M19 10v2a7 7 0 0 1-14 0v-2", key: "1vc78b" }],
|
|
3090
3128
|
["rect", { x: "9", y: "2", width: "6", height: "13", rx: "3", key: "s6n7sd" }]
|
|
3091
|
-
],
|
|
3129
|
+
], Se = H("mic", en);
|
|
3092
3130
|
/**
|
|
3093
3131
|
* @license lucide-react v1.24.0 - ISC
|
|
3094
3132
|
*
|
|
3095
3133
|
* This source code is licensed under the ISC license.
|
|
3096
3134
|
* See the LICENSE file in the root directory of this source tree.
|
|
3097
3135
|
*/
|
|
3098
|
-
const
|
|
3136
|
+
const an = [
|
|
3099
3137
|
["path", { d: "m14 10 7-7", key: "oa77jy" }],
|
|
3100
3138
|
["path", { d: "M20 10h-6V4", key: "mjg0md" }],
|
|
3101
3139
|
["path", { d: "m3 21 7-7", key: "tjx5ai" }],
|
|
3102
3140
|
["path", { d: "M4 14h6v6", key: "rmj7iw" }]
|
|
3103
|
-
],
|
|
3141
|
+
], xe = H("minimize-2", an);
|
|
3104
3142
|
/**
|
|
3105
3143
|
* @license lucide-react v1.24.0 - ISC
|
|
3106
3144
|
*
|
|
3107
3145
|
* This source code is licensed under the ISC license.
|
|
3108
3146
|
* See the LICENSE file in the root directory of this source tree.
|
|
3109
3147
|
*/
|
|
3110
|
-
const
|
|
3148
|
+
const tn = [
|
|
3111
3149
|
[
|
|
3112
3150
|
"path",
|
|
3113
3151
|
{
|
|
@@ -3123,14 +3161,14 @@ const $t = [
|
|
|
3123
3161
|
key: "10hv5p"
|
|
3124
3162
|
}
|
|
3125
3163
|
]
|
|
3126
|
-
],
|
|
3164
|
+
], Ne = H("phone-off", tn);
|
|
3127
3165
|
/**
|
|
3128
3166
|
* @license lucide-react v1.24.0 - ISC
|
|
3129
3167
|
*
|
|
3130
3168
|
* This source code is licensed under the ISC license.
|
|
3131
3169
|
* See the LICENSE file in the root directory of this source tree.
|
|
3132
3170
|
*/
|
|
3133
|
-
const
|
|
3171
|
+
const nn = [
|
|
3134
3172
|
[
|
|
3135
3173
|
"path",
|
|
3136
3174
|
{
|
|
@@ -3138,24 +3176,24 @@ const Zt = [
|
|
|
3138
3176
|
key: "9njp5v"
|
|
3139
3177
|
}
|
|
3140
3178
|
]
|
|
3141
|
-
],
|
|
3179
|
+
], je = H("phone", nn);
|
|
3142
3180
|
/**
|
|
3143
3181
|
* @license lucide-react v1.24.0 - ISC
|
|
3144
3182
|
*
|
|
3145
3183
|
* This source code is licensed under the ISC license.
|
|
3146
3184
|
* See the LICENSE file in the root directory of this source tree.
|
|
3147
3185
|
*/
|
|
3148
|
-
const
|
|
3186
|
+
const on = [
|
|
3149
3187
|
["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
|
|
3150
3188
|
["path", { d: "M3 3v5h5", key: "1xhq8a" }]
|
|
3151
|
-
],
|
|
3189
|
+
], sn = H("rotate-ccw", on);
|
|
3152
3190
|
/**
|
|
3153
3191
|
* @license lucide-react v1.24.0 - ISC
|
|
3154
3192
|
*
|
|
3155
3193
|
* This source code is licensed under the ISC license.
|
|
3156
3194
|
* See the LICENSE file in the root directory of this source tree.
|
|
3157
3195
|
*/
|
|
3158
|
-
const
|
|
3196
|
+
const rn = [
|
|
3159
3197
|
[
|
|
3160
3198
|
"path",
|
|
3161
3199
|
{
|
|
@@ -3163,46 +3201,81 @@ const en = [
|
|
|
3163
3201
|
key: "r04s7s"
|
|
3164
3202
|
}
|
|
3165
3203
|
]
|
|
3166
|
-
],
|
|
3204
|
+
], ln = H("star", rn);
|
|
3167
3205
|
/**
|
|
3168
3206
|
* @license lucide-react v1.24.0 - ISC
|
|
3169
3207
|
*
|
|
3170
3208
|
* This source code is licensed under the ISC license.
|
|
3171
3209
|
* See the LICENSE file in the root directory of this source tree.
|
|
3172
3210
|
*/
|
|
3173
|
-
const
|
|
3211
|
+
const cn = [
|
|
3174
3212
|
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
3175
3213
|
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
3176
|
-
],
|
|
3177
|
-
},
|
|
3178
|
-
function
|
|
3179
|
-
return typeof window < "u" && window.innerWidth <=
|
|
3214
|
+
], De = H("x", cn), oe = () => {
|
|
3215
|
+
}, dn = 767;
|
|
3216
|
+
function _e() {
|
|
3217
|
+
return typeof window < "u" && window.innerWidth <= dn;
|
|
3180
3218
|
}
|
|
3181
3219
|
function V(...a) {
|
|
3182
3220
|
return a.filter(Boolean).join(" ");
|
|
3183
3221
|
}
|
|
3184
|
-
function
|
|
3185
|
-
|
|
3222
|
+
function un(a) {
|
|
3223
|
+
const e = (a || "").trim().toLowerCase().replace(/[-_]/g, " ");
|
|
3224
|
+
return e === "readex pro" || e === "readex" ? "'Readex Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif" : e === "noto sans" || e === "noto" || e === "noto sans arabic" ? "'Noto Sans', 'Noto Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif" : "'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif";
|
|
3186
3225
|
}
|
|
3187
|
-
function
|
|
3188
|
-
|
|
3226
|
+
function aa(a) {
|
|
3227
|
+
if (!a) return "#ffffff";
|
|
3228
|
+
const e = a.replace("#", "").trim();
|
|
3229
|
+
let t = e;
|
|
3230
|
+
if (e.length === 3 && (t = e.split("").map((c) => c + c).join("")), t.length < 6) return "#ffffff";
|
|
3231
|
+
const i = parseInt(t.substring(0, 2), 16), o = parseInt(t.substring(2, 4), 16), s = parseInt(t.substring(4, 6), 16);
|
|
3232
|
+
return Number.isNaN(i) || Number.isNaN(o) || Number.isNaN(s) ? "#ffffff" : (i * 299 + o * 587 + s * 114) / 1e3 >= 128 ? "#000000" : "#ffffff";
|
|
3233
|
+
}
|
|
3234
|
+
function Re(a) {
|
|
3235
|
+
const e = {
|
|
3236
|
+
"--rqmii-font-family": un(a?.font)
|
|
3237
|
+
}, t = a?.theme?.accent_color?.trim();
|
|
3238
|
+
if (t) {
|
|
3239
|
+
const o = aa(t);
|
|
3240
|
+
e["--rqmii-accent"] = t, e["--rqmii-accent-text"] = o, e["--rqmii-message-user"] = t, e["--rqmii-message-user-text"] = o;
|
|
3241
|
+
}
|
|
3242
|
+
const i = a?.theme?.end_call_button_color?.trim();
|
|
3243
|
+
if (i) {
|
|
3244
|
+
const o = aa(i);
|
|
3245
|
+
e["--rqmii-end-call-bg"] = i, e["--rqmii-end-call-text"] = o;
|
|
3246
|
+
}
|
|
3247
|
+
return e;
|
|
3248
|
+
}
|
|
3249
|
+
function mn(a) {
|
|
3250
|
+
const e = (a || "").trim().toLowerCase().replace(/[-_]/g, " ");
|
|
3251
|
+
return e === "readex pro" || e === "readex" ? "https://fonts.googleapis.com/css2?family=Readex+Pro:wght@400;500;600;700&display=swap" : e === "noto sans" || e === "noto" || e === "noto sans arabic" ? "https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&family=Noto+Sans+Arabic:wght@400;500;600;700&display=swap" : "https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700&display=swap";
|
|
3252
|
+
}
|
|
3253
|
+
function ua(a) {
|
|
3254
|
+
if (typeof document > "u") return;
|
|
3255
|
+
const e = mn(a);
|
|
3256
|
+
if (document.querySelector(`link[data-rqmii-font="${e}"]`)) return;
|
|
3257
|
+
const i = document.createElement("link");
|
|
3258
|
+
i.rel = "stylesheet", i.href = e, i.setAttribute("data-rqmii-font", e), document.head.appendChild(i);
|
|
3259
|
+
}
|
|
3260
|
+
function Z(a) {
|
|
3261
|
+
return "";
|
|
3189
3262
|
}
|
|
3190
3263
|
function re(a) {
|
|
3191
3264
|
return a.startsWith("ar") || ["fa", "ur", "he"].includes(a) ? "rtl" : "ltr";
|
|
3192
3265
|
}
|
|
3193
|
-
function
|
|
3266
|
+
function Be(a) {
|
|
3194
3267
|
const e = Math.floor(a / 60).toString().padStart(2, "0"), t = (a % 60).toString().padStart(2, "0");
|
|
3195
3268
|
return `${e}:${t}`;
|
|
3196
3269
|
}
|
|
3197
|
-
function
|
|
3270
|
+
function hn(a = !0) {
|
|
3198
3271
|
const [e, t] = y(0);
|
|
3199
3272
|
return I(() => {
|
|
3200
3273
|
if (!a) return;
|
|
3201
|
-
const i = setInterval(() => t((
|
|
3274
|
+
const i = setInterval(() => t((o) => o + 1), 1e3);
|
|
3202
3275
|
return () => clearInterval(i);
|
|
3203
3276
|
}, [a]), e;
|
|
3204
3277
|
}
|
|
3205
|
-
function
|
|
3278
|
+
function gn() {
|
|
3206
3279
|
const [a, e] = y(null);
|
|
3207
3280
|
return I(() => {
|
|
3208
3281
|
const t = window.visualViewport;
|
|
@@ -3213,66 +3286,66 @@ function sn() {
|
|
|
3213
3286
|
};
|
|
3214
3287
|
}, []), a;
|
|
3215
3288
|
}
|
|
3216
|
-
function
|
|
3217
|
-
const t =
|
|
3289
|
+
function pn(a, e) {
|
|
3290
|
+
const t = B([]);
|
|
3218
3291
|
t.current = a.match(/\S+\s*/g) || [a];
|
|
3219
|
-
const [i,
|
|
3292
|
+
const [i, o] = y(
|
|
3220
3293
|
() => e ? Math.min(1, t.current.length) : t.current.length
|
|
3221
3294
|
);
|
|
3222
3295
|
return I(() => {
|
|
3223
3296
|
if (!e || !a) {
|
|
3224
|
-
|
|
3297
|
+
o(t.current.length);
|
|
3225
3298
|
return;
|
|
3226
3299
|
}
|
|
3227
|
-
if (
|
|
3228
|
-
const
|
|
3229
|
-
|
|
3300
|
+
if (o((r) => Math.max(1, r)), t.current.length <= 1) return;
|
|
3301
|
+
const s = setInterval(() => {
|
|
3302
|
+
o((r) => r >= t.current.length ? (clearInterval(s), r) : r + 1);
|
|
3230
3303
|
}, 50);
|
|
3231
|
-
return () => clearInterval(
|
|
3304
|
+
return () => clearInterval(s);
|
|
3232
3305
|
}, [a, e]), t.current.slice(0, i).join("");
|
|
3233
3306
|
}
|
|
3234
|
-
const
|
|
3235
|
-
const [
|
|
3307
|
+
const bn = A.lazy(() => import("./Orb-BLYExpBk.js").then((a) => ({ default: a.RqmiiOrb }))), Ge = A.memo(function({ language: e, languages: t, onChange: i }) {
|
|
3308
|
+
const [o, s] = y(!1), r = B(null), c = Je(e), l = ye(t, e).map((d) => Je(d)).filter(Boolean);
|
|
3236
3309
|
return I(() => {
|
|
3237
|
-
if (!
|
|
3238
|
-
const
|
|
3239
|
-
r.current?.contains(m.target) ||
|
|
3310
|
+
if (!o) return;
|
|
3311
|
+
const d = (m) => {
|
|
3312
|
+
r.current?.contains(m.target) || s(!1);
|
|
3240
3313
|
};
|
|
3241
|
-
return document.addEventListener("mousedown",
|
|
3242
|
-
}, [
|
|
3243
|
-
/* @__PURE__ */
|
|
3314
|
+
return document.addEventListener("mousedown", d), () => document.removeEventListener("mousedown", d);
|
|
3315
|
+
}, [o]), /* @__PURE__ */ v("div", { className: "rqmii-chat-language", ref: r, children: [
|
|
3316
|
+
/* @__PURE__ */ v("button", { type: "button", className: "rqmii-chat-pill", onClick: () => s((d) => !d), children: [
|
|
3244
3317
|
/* @__PURE__ */ n("span", { children: c?.label || e }),
|
|
3245
|
-
/* @__PURE__ */ n(
|
|
3318
|
+
/* @__PURE__ */ n(da, { size: 16 })
|
|
3246
3319
|
] }),
|
|
3247
|
-
|
|
3320
|
+
o && l.length > 1 && /* @__PURE__ */ n("div", { className: "rqmii-chat-language-menu", children: l.map((d) => /* @__PURE__ */ n(
|
|
3248
3321
|
"button",
|
|
3249
3322
|
{
|
|
3250
3323
|
type: "button",
|
|
3251
|
-
className: V("rqmii-chat-language-item",
|
|
3324
|
+
className: V("rqmii-chat-language-item", d.value === e && "is-selected"),
|
|
3252
3325
|
onClick: () => {
|
|
3253
|
-
i(
|
|
3326
|
+
i(d.value), s(!1);
|
|
3254
3327
|
},
|
|
3255
|
-
children:
|
|
3328
|
+
children: d.label
|
|
3256
3329
|
},
|
|
3257
|
-
|
|
3330
|
+
d.value
|
|
3258
3331
|
)) })
|
|
3259
3332
|
] });
|
|
3260
|
-
}),
|
|
3261
|
-
const
|
|
3262
|
-
return !
|
|
3263
|
-
|
|
3333
|
+
}), ue = A.memo(function({ language: e = "en", brand: t = "rqmii", agent: i }) {
|
|
3334
|
+
const o = i?.widget?.appearance, s = o?.show_branding !== !1, r = o?.footer_content?.[e], c = !!r?.trim();
|
|
3335
|
+
return !s && !c ? /* @__PURE__ */ n("div", { style: { padding: 11 } }) : /* @__PURE__ */ v("div", { className: "rqmii-chat-footer", children: [
|
|
3336
|
+
s && /* @__PURE__ */ v("p", { children: [
|
|
3264
3337
|
"Powered by ",
|
|
3265
3338
|
/* @__PURE__ */ n("strong", { children: t })
|
|
3266
3339
|
] }),
|
|
3267
3340
|
c && /* @__PURE__ */ n("p", { children: r })
|
|
3268
3341
|
] });
|
|
3269
|
-
}),
|
|
3342
|
+
}), te = A.memo(function({
|
|
3270
3343
|
agent: e,
|
|
3271
3344
|
size: t = "large",
|
|
3272
3345
|
active: i = !1,
|
|
3273
|
-
className:
|
|
3346
|
+
className: o = ""
|
|
3274
3347
|
}) {
|
|
3275
|
-
const
|
|
3348
|
+
const s = e?.faceImage, r = !s || s === "orb";
|
|
3276
3349
|
return /* @__PURE__ */ n(
|
|
3277
3350
|
"div",
|
|
3278
3351
|
{
|
|
@@ -3281,860 +3354,1015 @@ const ln = j.lazy(() => import("./Orb-BLYExpBk.js").then((a) => ({ default: a.Rq
|
|
|
3281
3354
|
`rqmii-agent-avatar--${t}`,
|
|
3282
3355
|
i && "is-active",
|
|
3283
3356
|
r && "is-orb",
|
|
3284
|
-
|
|
3357
|
+
o
|
|
3285
3358
|
),
|
|
3286
|
-
children: r ? /* @__PURE__ */ n(
|
|
3359
|
+
children: r ? /* @__PURE__ */ n(A.Suspense, { fallback: null, children: /* @__PURE__ */ n(bn, { className: "rqmii-agent-avatar-orb" }) }) : /* @__PURE__ */ n(
|
|
3287
3360
|
"img",
|
|
3288
3361
|
{
|
|
3289
|
-
src:
|
|
3362
|
+
src: s,
|
|
3290
3363
|
alt: e?.name || "Agent"
|
|
3291
3364
|
}
|
|
3292
3365
|
)
|
|
3293
3366
|
}
|
|
3294
3367
|
);
|
|
3295
|
-
}),
|
|
3296
|
-
return /* @__PURE__ */ n("button", { type: "button", className: V("rqmii-chat-open-button",
|
|
3368
|
+
}), ma = A.memo(function({ agent: e, onClick: t, className: i = "", position: o = "fixed", active: s = !1 }) {
|
|
3369
|
+
return /* @__PURE__ */ n("button", { type: "button", className: V("rqmii-chat-open-button", o === "fixed" && "is-fixed", i), onClick: t, "aria-label": "Open chat", children: /* @__PURE__ */ n(te, { agent: e, size: "button", active: s }) });
|
|
3297
3370
|
});
|
|
3298
|
-
function
|
|
3371
|
+
function fn() {
|
|
3299
3372
|
try {
|
|
3300
3373
|
const a = window.AudioContext || window.webkitAudioContext;
|
|
3301
3374
|
if (!a) return;
|
|
3302
|
-
const e = new a(), t = e.currentTime, i = e.createOscillator(),
|
|
3303
|
-
i.type = "sine", i.frequency.setValueAtTime(880, t), i.frequency.setValueAtTime(1180, t + 0.12),
|
|
3375
|
+
const e = new a(), t = e.currentTime, i = e.createOscillator(), o = e.createGain();
|
|
3376
|
+
i.type = "sine", i.frequency.setValueAtTime(880, t), i.frequency.setValueAtTime(1180, t + 0.12), o.gain.setValueAtTime(1e-4, t), o.gain.exponentialRampToValueAtTime(0.18, t + 0.02), o.gain.exponentialRampToValueAtTime(1e-4, t + 0.32), i.connect(o), o.connect(e.destination), i.start(t), i.stop(t + 0.34), i.onended = () => {
|
|
3304
3377
|
e.close();
|
|
3305
3378
|
};
|
|
3306
3379
|
} catch {
|
|
3307
3380
|
}
|
|
3308
3381
|
}
|
|
3309
|
-
const
|
|
3310
|
-
const [c,
|
|
3382
|
+
const kn = A.memo(function({ message: e, delaySeconds: t, soundEnabled: i, language: o, buttonPosition: s = "right", onClick: r }) {
|
|
3383
|
+
const [c, l] = y(!1), d = e.trim();
|
|
3311
3384
|
return I(() => {
|
|
3312
|
-
if (!
|
|
3385
|
+
if (!d) return;
|
|
3313
3386
|
const u = setTimeout(() => {
|
|
3314
|
-
|
|
3387
|
+
l(!0), i && fn();
|
|
3315
3388
|
}, Math.max(0, t) * 1e3);
|
|
3316
3389
|
return () => clearTimeout(u);
|
|
3317
|
-
}, [
|
|
3390
|
+
}, [d, t, i]), !c || !d ? null : /* @__PURE__ */ n(
|
|
3318
3391
|
"button",
|
|
3319
3392
|
{
|
|
3320
3393
|
type: "button",
|
|
3321
|
-
className: V("rqmii-chat-welcome-bubble",
|
|
3322
|
-
dir: re(
|
|
3394
|
+
className: V("rqmii-chat-welcome-bubble", s === "right" ? "is-right" : "is-left", Z()),
|
|
3395
|
+
dir: re(o),
|
|
3323
3396
|
onClick: r,
|
|
3324
|
-
"aria-label":
|
|
3325
|
-
children:
|
|
3397
|
+
"aria-label": d,
|
|
3398
|
+
children: d
|
|
3326
3399
|
}
|
|
3327
3400
|
);
|
|
3328
|
-
}),
|
|
3329
|
-
const [r, c] = y(""),
|
|
3401
|
+
}), Me = A.memo(function({ language: e, placeholder: t, onSend: i, disabled: o = !1, variant: s = "text" }) {
|
|
3402
|
+
const [r, c] = y(""), l = B(null), d = 168, m = () => {
|
|
3330
3403
|
const u = r.trim();
|
|
3331
|
-
!u ||
|
|
3404
|
+
!u || o || (i(u), c(""), l.current && (l.current.style.height = "auto"));
|
|
3332
3405
|
};
|
|
3333
|
-
return /* @__PURE__ */
|
|
3406
|
+
return /* @__PURE__ */ v("div", { className: V("rqmii-chat-input", Z(), s === "voice" && "is-voice"), children: [
|
|
3334
3407
|
/* @__PURE__ */ n(
|
|
3335
3408
|
"textarea",
|
|
3336
3409
|
{
|
|
3337
|
-
ref:
|
|
3410
|
+
ref: l,
|
|
3338
3411
|
value: r,
|
|
3339
|
-
disabled:
|
|
3340
|
-
rows:
|
|
3412
|
+
disabled: o,
|
|
3413
|
+
rows: s === "compact" ? 2 : 3,
|
|
3341
3414
|
dir: re(e),
|
|
3342
|
-
placeholder: t ||
|
|
3415
|
+
placeholder: t || z(e, "sendMessage"),
|
|
3343
3416
|
onChange: (u) => {
|
|
3344
3417
|
c(u.target.value);
|
|
3345
|
-
const h =
|
|
3346
|
-
h && (h.style.height = "auto", h.style.height = `${Math.min(h.scrollHeight,
|
|
3418
|
+
const h = l.current;
|
|
3419
|
+
h && (h.style.height = "auto", h.style.height = `${Math.min(h.scrollHeight, d)}px`);
|
|
3347
3420
|
},
|
|
3348
3421
|
onKeyDown: (u) => {
|
|
3349
3422
|
u.key === "Enter" && !u.shiftKey && (u.preventDefault(), m());
|
|
3350
3423
|
}
|
|
3351
3424
|
}
|
|
3352
3425
|
),
|
|
3353
|
-
/* @__PURE__ */ n("button", { type: "button", onClick: m, disabled: !r.trim() ||
|
|
3426
|
+
/* @__PURE__ */ n("button", { type: "button", onClick: m, disabled: !r.trim() || o, "aria-label": z(e, "send"), children: /* @__PURE__ */ n(Kt, { size: 20 }) })
|
|
3354
3427
|
] });
|
|
3355
|
-
}),
|
|
3356
|
-
const i =
|
|
3357
|
-
return /* @__PURE__ */ n(
|
|
3358
|
-
}),
|
|
3359
|
-
function
|
|
3360
|
-
return typeof window > "u" ?
|
|
3428
|
+
}), vn = A.memo(function({ text: e, streaming: t }) {
|
|
3429
|
+
const i = pn(e, t);
|
|
3430
|
+
return /* @__PURE__ */ n(Te, { children: i });
|
|
3431
|
+
}), qe = 133, yn = qe + 44, Fn = 767, ke = 36, Tn = 8, ta = ke + Tn;
|
|
3432
|
+
function En() {
|
|
3433
|
+
return typeof window > "u" ? qe : window.innerWidth <= Fn ? yn : qe;
|
|
3361
3434
|
}
|
|
3362
|
-
function
|
|
3435
|
+
function zn(a) {
|
|
3363
3436
|
return a === "rtl" ? "right" : "left";
|
|
3364
3437
|
}
|
|
3365
|
-
function
|
|
3438
|
+
function Sn(a, e, t, i) {
|
|
3366
3439
|
if (!a.length) return null;
|
|
3367
|
-
const
|
|
3368
|
-
return t === "right" ?
|
|
3440
|
+
const o = Math.max(...a.map((r) => r.offsetTop)), s = a.filter((r) => r.offsetTop >= o - 0.5);
|
|
3441
|
+
return t === "right" ? s.find((r) => r.offsetLeft + r.offsetWidth > e - i) || null : s.find((r) => r.offsetLeft < i) || null;
|
|
3369
3442
|
}
|
|
3370
|
-
function
|
|
3371
|
-
for (let
|
|
3372
|
-
const
|
|
3373
|
-
if (!
|
|
3374
|
-
t === "right" ?
|
|
3443
|
+
function na(a, e, t, i) {
|
|
3444
|
+
for (let o = 0; o < 2; o++) {
|
|
3445
|
+
const s = Sn(a, e, t, i);
|
|
3446
|
+
if (!s) break;
|
|
3447
|
+
t === "right" ? s.style.marginRight = `${i}px` : s.style.marginLeft = `${i}px`, s.style.maxWidth = `calc(100% - ${i}px)`;
|
|
3375
3448
|
}
|
|
3376
3449
|
}
|
|
3377
|
-
const
|
|
3378
|
-
const [
|
|
3379
|
-
|
|
3380
|
-
|
|
3450
|
+
const xn = A.memo(function({ suggestions: e, language: t, onClick: i }) {
|
|
3451
|
+
const [o, s] = y(!1), [r, c] = y(!1), [l, d] = y(null), [m, u] = y(null), h = B(null), F = B([]), b = re(t || "en"), M = zn(b), S = (T) => {
|
|
3452
|
+
T.forEach((k) => {
|
|
3453
|
+
k && (k.style.maxWidth = "", k.style.marginRight = "", k.style.marginLeft = "");
|
|
3381
3454
|
});
|
|
3382
3455
|
};
|
|
3383
|
-
return
|
|
3384
|
-
const
|
|
3385
|
-
if (!
|
|
3386
|
-
const
|
|
3387
|
-
const
|
|
3388
|
-
|
|
3389
|
-
const
|
|
3390
|
-
for (let
|
|
3391
|
-
const
|
|
3392
|
-
if (
|
|
3393
|
-
return
|
|
3456
|
+
return We(() => {
|
|
3457
|
+
const T = h.current;
|
|
3458
|
+
if (!T || o) return;
|
|
3459
|
+
const k = () => {
|
|
3460
|
+
const g = F.current;
|
|
3461
|
+
S(g);
|
|
3462
|
+
const w = T.clientWidth, E = En(), f = () => {
|
|
3463
|
+
for (let C = 0; C < g.length; C++) {
|
|
3464
|
+
const _ = g[C];
|
|
3465
|
+
if (_ && _.offsetTop + _.offsetHeight > E + 0.5)
|
|
3466
|
+
return C;
|
|
3394
3467
|
}
|
|
3395
3468
|
return null;
|
|
3396
3469
|
};
|
|
3397
|
-
let P =
|
|
3470
|
+
let P = f();
|
|
3398
3471
|
if (P !== null)
|
|
3399
|
-
for (let
|
|
3400
|
-
|
|
3401
|
-
const
|
|
3402
|
-
|
|
3403
|
-
const
|
|
3404
|
-
if (
|
|
3405
|
-
P =
|
|
3472
|
+
for (let C = 0; C <= g.length; C++) {
|
|
3473
|
+
S(g);
|
|
3474
|
+
const _ = g.slice(0, P).filter((j) => !!j);
|
|
3475
|
+
na(_, w, M, ta);
|
|
3476
|
+
const x = f();
|
|
3477
|
+
if (x === null || x >= P) break;
|
|
3478
|
+
P = x;
|
|
3406
3479
|
}
|
|
3407
|
-
if (
|
|
3408
|
-
const
|
|
3409
|
-
u(
|
|
3480
|
+
if (d(P), c(P !== null), P !== null) {
|
|
3481
|
+
const C = g.slice(0, P).filter((x) => !!x), _ = C.length ? Math.max(...C.map((x) => x.offsetTop + x.offsetHeight)) : ke;
|
|
3482
|
+
u(_ - ke);
|
|
3410
3483
|
} else
|
|
3411
3484
|
u(null);
|
|
3412
3485
|
};
|
|
3413
|
-
|
|
3414
|
-
const
|
|
3415
|
-
return
|
|
3416
|
-
|
|
3486
|
+
k();
|
|
3487
|
+
const p = typeof ResizeObserver < "u" ? new ResizeObserver(k) : null;
|
|
3488
|
+
return p?.observe(T), () => {
|
|
3489
|
+
p?.disconnect(), S(F.current);
|
|
3417
3490
|
};
|
|
3418
|
-
}, [e,
|
|
3419
|
-
const
|
|
3420
|
-
if (!
|
|
3421
|
-
const
|
|
3422
|
-
|
|
3423
|
-
const
|
|
3424
|
-
return u(
|
|
3425
|
-
|
|
3491
|
+
}, [e, o, M]), We(() => {
|
|
3492
|
+
const T = h.current;
|
|
3493
|
+
if (!T || !o) return;
|
|
3494
|
+
const k = F.current.filter((g) => !!g);
|
|
3495
|
+
S(F.current), na(k, T.clientWidth, M, ta);
|
|
3496
|
+
const p = k.length ? Math.max(...k.map((g) => g.offsetTop + g.offsetHeight)) : ke;
|
|
3497
|
+
return u(p - ke), () => {
|
|
3498
|
+
S(F.current);
|
|
3426
3499
|
};
|
|
3427
|
-
}, [
|
|
3428
|
-
e.map((
|
|
3429
|
-
const
|
|
3500
|
+
}, [o, e, M]), e.length ? /* @__PURE__ */ n("div", { className: V("rqmii-suggested-messages", o && "is-expanded", r && "has-overflow"), dir: b, children: /* @__PURE__ */ v("div", { ref: h, className: V("rqmii-suggested-messages-inner", o ? "is-expanded" : "is-collapsed"), children: [
|
|
3501
|
+
e.map((T, k) => {
|
|
3502
|
+
const p = !o && l !== null && k >= l;
|
|
3430
3503
|
return /* @__PURE__ */ n(
|
|
3431
3504
|
"button",
|
|
3432
3505
|
{
|
|
3433
|
-
ref: (
|
|
3434
|
-
|
|
3506
|
+
ref: (g) => {
|
|
3507
|
+
F.current[k] = g;
|
|
3435
3508
|
},
|
|
3436
3509
|
type: "button",
|
|
3437
3510
|
className: "rqmii-suggested-message",
|
|
3438
|
-
onClick: () => i(
|
|
3439
|
-
style:
|
|
3440
|
-
"aria-hidden":
|
|
3441
|
-
tabIndex:
|
|
3442
|
-
children:
|
|
3511
|
+
onClick: () => i(T),
|
|
3512
|
+
style: p ? { visibility: "hidden" } : void 0,
|
|
3513
|
+
"aria-hidden": p || void 0,
|
|
3514
|
+
tabIndex: p ? -1 : void 0,
|
|
3515
|
+
children: T
|
|
3443
3516
|
},
|
|
3444
|
-
|
|
3517
|
+
k
|
|
3445
3518
|
);
|
|
3446
3519
|
}),
|
|
3447
3520
|
r && /* @__PURE__ */ n(
|
|
3448
3521
|
"button",
|
|
3449
3522
|
{
|
|
3450
3523
|
type: "button",
|
|
3451
|
-
className: V("rqmii-suggested-messages-toggle",
|
|
3524
|
+
className: V("rqmii-suggested-messages-toggle", M === "left" && "is-start-left"),
|
|
3452
3525
|
style: m != null ? { top: m, bottom: "auto" } : void 0,
|
|
3453
|
-
onClick: () =>
|
|
3454
|
-
"aria-label":
|
|
3455
|
-
"aria-expanded":
|
|
3456
|
-
children:
|
|
3526
|
+
onClick: () => s((T) => (T && h.current && (h.current.scrollTop = 0), !T)),
|
|
3527
|
+
"aria-label": o ? "Show less" : "Show more",
|
|
3528
|
+
"aria-expanded": o,
|
|
3529
|
+
children: o ? /* @__PURE__ */ n(Wt, { size: 14 }) : /* @__PURE__ */ n(da, { size: 14 })
|
|
3457
3530
|
}
|
|
3458
3531
|
)
|
|
3459
3532
|
] }) }) : null;
|
|
3460
|
-
}),
|
|
3533
|
+
}), Mn = A.memo(function({ language: e }) {
|
|
3461
3534
|
const t = re(e || "en");
|
|
3462
|
-
return /* @__PURE__ */ n("div", { className: "rqmii-chat-message-row", children: /* @__PURE__ */
|
|
3535
|
+
return /* @__PURE__ */ n("div", { className: "rqmii-chat-message-row", children: /* @__PURE__ */ v("div", { className: "rqmii-chat-message rqmii-chat-typing-indicator", dir: t, children: [
|
|
3463
3536
|
/* @__PURE__ */ n("span", { className: "rqmii-chat-typing-dot" }),
|
|
3464
3537
|
/* @__PURE__ */ n("span", { className: "rqmii-chat-typing-dot" }),
|
|
3465
3538
|
/* @__PURE__ */ n("span", { className: "rqmii-chat-typing-dot" })
|
|
3466
3539
|
] }) });
|
|
3467
3540
|
});
|
|
3468
|
-
function
|
|
3541
|
+
function wn(a) {
|
|
3469
3542
|
return a === "message";
|
|
3470
3543
|
}
|
|
3471
|
-
const
|
|
3544
|
+
const Pn = {
|
|
3472
3545
|
name: "leadFormName",
|
|
3473
3546
|
email: "leadFormEmail",
|
|
3474
3547
|
phone: "leadFormPhone",
|
|
3475
3548
|
message: "leadFormMessage"
|
|
3476
|
-
},
|
|
3477
|
-
const r =
|
|
3478
|
-
const
|
|
3479
|
-
return `${
|
|
3480
|
-
},
|
|
3481
|
-
|
|
3482
|
-
},
|
|
3483
|
-
if (
|
|
3484
|
-
if (t.fields.some((
|
|
3485
|
-
b(
|
|
3549
|
+
}, Cn = A.memo(function({ messageId: e, form: t, language: i, textDirection: o, formSubmitted: s }) {
|
|
3550
|
+
const r = Ea(), [c, l] = y({}), [d, m] = y(!1), [u, h] = y(!!s), [F, b] = y(null), M = t.title || z(i, "leadFormTitle"), S = (p) => {
|
|
3551
|
+
const g = Pn[p.key];
|
|
3552
|
+
return `${g ? z(i, g) : p.label}${p.required ? "*" : ""}`;
|
|
3553
|
+
}, T = (p, g) => {
|
|
3554
|
+
l((w) => ({ ...w, [p]: g })), F && b(null);
|
|
3555
|
+
}, k = async (p) => {
|
|
3556
|
+
if (p.preventDefault(), d || u) return;
|
|
3557
|
+
if (t.fields.some((E) => E.required && !c[E.key]?.trim())) {
|
|
3558
|
+
b(z(i, "leadFormRequiredError"));
|
|
3486
3559
|
return;
|
|
3487
3560
|
}
|
|
3488
|
-
const
|
|
3489
|
-
for (const
|
|
3490
|
-
const
|
|
3491
|
-
|
|
3561
|
+
const w = {};
|
|
3562
|
+
for (const E of t.fields) {
|
|
3563
|
+
const f = c[E.key]?.trim();
|
|
3564
|
+
f && (w[E.key] = f);
|
|
3492
3565
|
}
|
|
3493
3566
|
m(!0), b(null);
|
|
3494
3567
|
try {
|
|
3495
|
-
await r.submitLead({ agentId: t.agentId, collectedData:
|
|
3568
|
+
await r.submitLead({ agentId: t.agentId, collectedData: w }), h(!0), r.setMessages(
|
|
3496
3569
|
r.messages.map(
|
|
3497
|
-
(
|
|
3570
|
+
(E) => E.id === e ? { ...E, formSubmitted: !0 } : E
|
|
3498
3571
|
)
|
|
3499
3572
|
);
|
|
3500
|
-
} catch (
|
|
3501
|
-
b(
|
|
3573
|
+
} catch (E) {
|
|
3574
|
+
b(E?.message || z(i, "leadFormGenericError"));
|
|
3502
3575
|
} finally {
|
|
3503
3576
|
m(!1);
|
|
3504
3577
|
}
|
|
3505
3578
|
};
|
|
3506
|
-
return u ? /* @__PURE__ */ n("div", { className: "rqmii-chat-message-row rqmii-chat-lead-form-row", children: /* @__PURE__ */ n("div", { className: "rqmii-chat-lead-form rqmii-chat-lead-form--done", dir:
|
|
3507
|
-
/* @__PURE__ */ n("div", { className: "rqmii-chat-lead-form-title", children:
|
|
3508
|
-
t.fields.map((
|
|
3509
|
-
const
|
|
3510
|
-
return
|
|
3579
|
+
return u ? /* @__PURE__ */ n("div", { className: "rqmii-chat-message-row rqmii-chat-lead-form-row", children: /* @__PURE__ */ n("div", { className: "rqmii-chat-lead-form rqmii-chat-lead-form--done", dir: o, children: /* @__PURE__ */ n("div", { className: "rqmii-chat-lead-form-success", children: z(i, "leadFormSuccess") }) }) }) : /* @__PURE__ */ n("div", { className: "rqmii-chat-message-row rqmii-chat-lead-form-row", children: /* @__PURE__ */ v("form", { className: "rqmii-chat-lead-form", dir: o, onSubmit: k, children: [
|
|
3580
|
+
/* @__PURE__ */ n("div", { className: "rqmii-chat-lead-form-title", children: M }),
|
|
3581
|
+
t.fields.map((p) => {
|
|
3582
|
+
const g = S(p), w = p.type === "email" ? "email" : p.type === "date" ? "date" : "text";
|
|
3583
|
+
return wn(p.key) ? /* @__PURE__ */ n(
|
|
3511
3584
|
"textarea",
|
|
3512
3585
|
{
|
|
3513
3586
|
className: "rqmii-chat-lead-form-input rqmii-chat-lead-form-textarea",
|
|
3514
|
-
placeholder:
|
|
3515
|
-
value: c[
|
|
3516
|
-
onChange: (
|
|
3517
|
-
disabled:
|
|
3587
|
+
placeholder: g,
|
|
3588
|
+
value: c[p.key] || "",
|
|
3589
|
+
onChange: (E) => T(p.key, E.target.value),
|
|
3590
|
+
disabled: d,
|
|
3518
3591
|
rows: 4
|
|
3519
3592
|
},
|
|
3520
|
-
|
|
3593
|
+
p.key
|
|
3521
3594
|
) : /* @__PURE__ */ n(
|
|
3522
3595
|
"input",
|
|
3523
3596
|
{
|
|
3524
3597
|
className: "rqmii-chat-lead-form-input",
|
|
3525
|
-
type:
|
|
3526
|
-
placeholder:
|
|
3527
|
-
value: c[
|
|
3528
|
-
onChange: (
|
|
3529
|
-
disabled:
|
|
3598
|
+
type: w,
|
|
3599
|
+
placeholder: g,
|
|
3600
|
+
value: c[p.key] || "",
|
|
3601
|
+
onChange: (E) => T(p.key, E.target.value),
|
|
3602
|
+
disabled: d
|
|
3530
3603
|
},
|
|
3531
|
-
|
|
3604
|
+
p.key
|
|
3532
3605
|
);
|
|
3533
3606
|
}),
|
|
3534
|
-
|
|
3535
|
-
/* @__PURE__ */ n("button", { type: "submit", className: "rqmii-chat-lead-form-submit", disabled:
|
|
3607
|
+
F && /* @__PURE__ */ n("div", { className: "rqmii-chat-lead-form-error", children: F }),
|
|
3608
|
+
/* @__PURE__ */ n("button", { type: "submit", className: "rqmii-chat-lead-form-submit", disabled: d, children: d ? z(i, "loading") : z(i, "submit") })
|
|
3536
3609
|
] }) });
|
|
3537
|
-
}),
|
|
3610
|
+
}), Ln = A.memo(function({ message: e, textDirection: t, language: i }) {
|
|
3538
3611
|
if (e.role === "lead_form" && e.form)
|
|
3539
|
-
return /* @__PURE__ */ n(
|
|
3540
|
-
const
|
|
3541
|
-
return /* @__PURE__ */ n("div", { className: V("rqmii-chat-message-row",
|
|
3542
|
-
}),
|
|
3543
|
-
const
|
|
3612
|
+
return /* @__PURE__ */ n(Cn, { messageId: e.id, form: e.form, language: i, textDirection: t, formSubmitted: e.formSubmitted });
|
|
3613
|
+
const o = e.role === "user" || e.sender === "user";
|
|
3614
|
+
return /* @__PURE__ */ n("div", { className: V("rqmii-chat-message-row", o && "is-user"), children: /* @__PURE__ */ n("div", { className: "rqmii-chat-message", dir: t, children: /* @__PURE__ */ n(vn, { text: e.text, streaming: e.streaming }) }) });
|
|
3615
|
+
}), Ue = A.memo(function({ messages: e, partialTranscript: t, language: i, showTypingIndicator: o }) {
|
|
3616
|
+
const s = B(null), r = re(i || "en"), c = B(e.length);
|
|
3544
3617
|
return I(() => {
|
|
3545
|
-
if (!
|
|
3546
|
-
const
|
|
3547
|
-
c.current = e.length,
|
|
3548
|
-
}, [e, t]), /* @__PURE__ */
|
|
3549
|
-
e.map((
|
|
3550
|
-
|
|
3618
|
+
if (!s.current) return;
|
|
3619
|
+
const l = e.length !== c.current;
|
|
3620
|
+
c.current = e.length, s.current.scrollIntoView({ behavior: l ? "smooth" : "instant", block: "end" });
|
|
3621
|
+
}, [e, t]), /* @__PURE__ */ v("div", { className: "rqmii-chat-messages", children: [
|
|
3622
|
+
e.map((l) => /* @__PURE__ */ n(Ln, { message: l, textDirection: r, language: i || "en" }, l.id || `${l.role}-${l.text}`)),
|
|
3623
|
+
o && /* @__PURE__ */ n(Mn, { language: i }),
|
|
3551
3624
|
t && /* @__PURE__ */ n("div", { className: "rqmii-chat-message-row is-user is-partial", children: /* @__PURE__ */ n("div", { className: "rqmii-chat-message", dir: r, children: t }) }),
|
|
3552
|
-
/* @__PURE__ */ n("div", { ref:
|
|
3625
|
+
/* @__PURE__ */ n("div", { ref: s })
|
|
3553
3626
|
] });
|
|
3554
|
-
}),
|
|
3555
|
-
return /* @__PURE__ */
|
|
3627
|
+
}), ha = A.memo(function({ message: e, onRetry: t, onClose: i, language: o = "en" }) {
|
|
3628
|
+
return /* @__PURE__ */ v("div", { className: "rqmii-chat-panel rqmii-chat-panel--error", children: [
|
|
3556
3629
|
i && /* @__PURE__ */ n("button", { type: "button", className: "rqmii-error-close", onClick: i, children: "×" }),
|
|
3557
|
-
/* @__PURE__ */ n("p", { children: e ||
|
|
3558
|
-
t && /* @__PURE__ */
|
|
3559
|
-
/* @__PURE__ */ n(
|
|
3560
|
-
/* @__PURE__ */ n("span", { children:
|
|
3630
|
+
/* @__PURE__ */ n("p", { children: e || z(o, "connectionFailed") }),
|
|
3631
|
+
t && /* @__PURE__ */ v("button", { type: "button", className: "rqmii-chat-retry", onClick: t, children: [
|
|
3632
|
+
/* @__PURE__ */ n(sn, { size: 16 }),
|
|
3633
|
+
/* @__PURE__ */ n("span", { children: z(o, "retry") })
|
|
3561
3634
|
] })
|
|
3562
3635
|
] });
|
|
3563
|
-
}),
|
|
3564
|
-
function
|
|
3565
|
-
const [
|
|
3566
|
-
return /* @__PURE__ */ n("div", { className: "rqmii-chat-rating-stars", role: "radiogroup", children: Array.from({ length:
|
|
3567
|
-
const
|
|
3636
|
+
}), An = 5;
|
|
3637
|
+
function ga({ rating: a, onRate: e, readonly: t, size: i = 28 }) {
|
|
3638
|
+
const [o, s] = y(0), r = o || a;
|
|
3639
|
+
return /* @__PURE__ */ n("div", { className: "rqmii-chat-rating-stars", role: "radiogroup", children: Array.from({ length: An }, (c, l) => {
|
|
3640
|
+
const d = l + 1, m = d <= r;
|
|
3568
3641
|
return /* @__PURE__ */ n(
|
|
3569
3642
|
"button",
|
|
3570
3643
|
{
|
|
3571
3644
|
type: "button",
|
|
3572
3645
|
className: V("rqmii-chat-star", m && "is-filled", t && "is-readonly"),
|
|
3573
3646
|
disabled: t,
|
|
3574
|
-
"aria-label": `${
|
|
3575
|
-
"aria-checked":
|
|
3647
|
+
"aria-label": `${d}`,
|
|
3648
|
+
"aria-checked": d === a,
|
|
3576
3649
|
role: "radio",
|
|
3577
|
-
onMouseEnter: () => !t &&
|
|
3578
|
-
onMouseLeave: () => !t &&
|
|
3579
|
-
onClick: () => !t && e?.(
|
|
3580
|
-
children: /* @__PURE__ */ n(
|
|
3650
|
+
onMouseEnter: () => !t && s(d),
|
|
3651
|
+
onMouseLeave: () => !t && s(0),
|
|
3652
|
+
onClick: () => !t && e?.(d),
|
|
3653
|
+
children: /* @__PURE__ */ n(ln, { size: i, fill: m ? "currentColor" : "none" })
|
|
3581
3654
|
},
|
|
3582
|
-
|
|
3655
|
+
d
|
|
3583
3656
|
);
|
|
3584
3657
|
}) });
|
|
3585
3658
|
}
|
|
3586
|
-
function
|
|
3659
|
+
function _n({
|
|
3587
3660
|
language: a,
|
|
3588
3661
|
rating: e,
|
|
3589
3662
|
endedBy: t,
|
|
3590
3663
|
sessionId: i,
|
|
3591
|
-
interactive:
|
|
3592
|
-
showTellUsMore:
|
|
3593
|
-
|
|
3594
|
-
|
|
3664
|
+
interactive: o,
|
|
3665
|
+
showTellUsMore: s,
|
|
3666
|
+
showRating: r = !0,
|
|
3667
|
+
showConversationId: c = !0,
|
|
3668
|
+
onRate: l,
|
|
3669
|
+
onTellUsMore: d
|
|
3595
3670
|
}) {
|
|
3596
|
-
const
|
|
3597
|
-
return /* @__PURE__ */
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3671
|
+
const m = e > 0 ? z(a, "ratingThankYou") : z(a, "ratingQuestion"), u = t === "user" ? z(a, "youEnded") : z(a, "agentEnded");
|
|
3672
|
+
return /* @__PURE__ */ v(
|
|
3673
|
+
"div",
|
|
3674
|
+
{
|
|
3675
|
+
className: V("rqmii-chat-rating", !r && "rqmii-chat-rating--unrated", Z()),
|
|
3676
|
+
dir: re(a),
|
|
3677
|
+
children: [
|
|
3678
|
+
r && /* @__PURE__ */ v(Te, { children: [
|
|
3679
|
+
/* @__PURE__ */ n("div", { className: "rqmii-chat-rating-header", children: m }),
|
|
3680
|
+
/* @__PURE__ */ n(ga, { rating: e, onRate: l, readonly: !o }),
|
|
3681
|
+
s && /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-rating-more", onClick: d, children: z(a, "tellUsMore") })
|
|
3682
|
+
] }),
|
|
3683
|
+
/* @__PURE__ */ v("div", { className: "rqmii-chat-rating-meta", children: [
|
|
3684
|
+
/* @__PURE__ */ n("div", { children: u }),
|
|
3685
|
+
c && i && /* @__PURE__ */ v("div", { children: [
|
|
3686
|
+
z(a, "sessionIdLabel"),
|
|
3687
|
+
" ",
|
|
3688
|
+
/* @__PURE__ */ n("span", { children: i })
|
|
3689
|
+
] })
|
|
3690
|
+
] })
|
|
3691
|
+
]
|
|
3692
|
+
}
|
|
3693
|
+
);
|
|
3610
3694
|
}
|
|
3611
|
-
function
|
|
3695
|
+
function qn({
|
|
3612
3696
|
agent: a,
|
|
3613
3697
|
language: e,
|
|
3614
3698
|
rating: t,
|
|
3615
3699
|
onBack: i,
|
|
3616
|
-
onMinimize:
|
|
3617
|
-
onSubmit:
|
|
3700
|
+
onMinimize: o,
|
|
3701
|
+
onSubmit: s
|
|
3618
3702
|
}) {
|
|
3619
|
-
const [r, c] = y(""), [
|
|
3703
|
+
const [r, c] = y(""), [l, d] = y(!1), m = r.trim().length > 0 && !l, u = async () => {
|
|
3620
3704
|
if (m) {
|
|
3621
|
-
|
|
3705
|
+
d(!0);
|
|
3622
3706
|
try {
|
|
3623
|
-
await
|
|
3707
|
+
await s(r.trim());
|
|
3624
3708
|
} finally {
|
|
3625
|
-
|
|
3709
|
+
d(!1);
|
|
3626
3710
|
}
|
|
3627
3711
|
}
|
|
3628
3712
|
};
|
|
3629
|
-
return /* @__PURE__ */
|
|
3630
|
-
/* @__PURE__ */
|
|
3631
|
-
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick: i, "aria-label": "Back", children: /* @__PURE__ */ n(
|
|
3632
|
-
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick:
|
|
3713
|
+
return /* @__PURE__ */ v("div", { className: V("rqmii-chat-panel rqmii-chat-panel--feedback", Z()), dir: re(e), children: [
|
|
3714
|
+
/* @__PURE__ */ v("div", { className: "rqmii-chat-topbar", children: [
|
|
3715
|
+
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick: i, "aria-label": "Back", children: /* @__PURE__ */ n(Yt, { size: 20 }) }),
|
|
3716
|
+
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick: o, "aria-label": z(e, "minimize"), children: /* @__PURE__ */ n(xe, { size: 20 }) })
|
|
3633
3717
|
] }),
|
|
3634
|
-
/* @__PURE__ */
|
|
3635
|
-
/* @__PURE__ */ n(
|
|
3636
|
-
/* @__PURE__ */ n(
|
|
3637
|
-
/* @__PURE__ */ n("div", { className: "rqmii-chat-feedback-title", children:
|
|
3638
|
-
/* @__PURE__ */ n("div", { className: "rqmii-chat-feedback-subtitle", children:
|
|
3718
|
+
/* @__PURE__ */ v("div", { className: "rqmii-chat-feedback-body", children: [
|
|
3719
|
+
/* @__PURE__ */ n(te, { agent: a, size: "hero" }),
|
|
3720
|
+
/* @__PURE__ */ n(ga, { rating: t, readonly: !0 }),
|
|
3721
|
+
/* @__PURE__ */ n("div", { className: "rqmii-chat-feedback-title", children: z(e, "ratingThankYou") }),
|
|
3722
|
+
/* @__PURE__ */ n("div", { className: "rqmii-chat-feedback-subtitle", children: z(e, "feedbackSubtitle") }),
|
|
3639
3723
|
/* @__PURE__ */ n(
|
|
3640
3724
|
"textarea",
|
|
3641
3725
|
{
|
|
3642
3726
|
className: "rqmii-chat-feedback-input",
|
|
3643
3727
|
value: r,
|
|
3644
3728
|
dir: re(e),
|
|
3645
|
-
placeholder:
|
|
3729
|
+
placeholder: z(e, "feedbackPlaceholder"),
|
|
3646
3730
|
onChange: (h) => c(h.target.value)
|
|
3647
3731
|
}
|
|
3648
3732
|
),
|
|
3649
|
-
/* @__PURE__ */ n("div", { className: "rqmii-chat-feedback-actions", children: /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-feedback-submit", onClick: u, disabled: !m, children:
|
|
3733
|
+
/* @__PURE__ */ n("div", { className: "rqmii-chat-feedback-actions", children: /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-feedback-submit", onClick: u, disabled: !m, children: l ? /* @__PURE__ */ n(ze, { className: "rqmii-chat-spin", size: 18 }) : z(e, "submit") }) })
|
|
3650
3734
|
] }),
|
|
3651
|
-
/* @__PURE__ */ n(
|
|
3735
|
+
/* @__PURE__ */ n(ue, { language: e, agent: a })
|
|
3652
3736
|
] });
|
|
3653
3737
|
}
|
|
3654
|
-
const
|
|
3655
|
-
function
|
|
3738
|
+
const In = A.lazy(() => import("./RqmiiCloudAvatarPlayer-Cit_rrpj.js").then((a) => a.e).then((a) => ({ default: a.RqmiiCloudAvatarPlayer })));
|
|
3739
|
+
function Fe(a) {
|
|
3656
3740
|
if (!(a == null || typeof window > "u" || window.innerWidth >= 768))
|
|
3657
3741
|
return {
|
|
3658
3742
|
top: `${window.innerHeight - a}px`,
|
|
3659
3743
|
bottom: 0
|
|
3660
3744
|
};
|
|
3661
3745
|
}
|
|
3662
|
-
const
|
|
3663
|
-
const
|
|
3664
|
-
|
|
3665
|
-
const
|
|
3666
|
-
return window.addEventListener("resize",
|
|
3746
|
+
const Vn = A.memo(function({ agent: e, language: t, languages: i, onLanguageChange: o, onClose: s, onSend: r, isVoiceEnabled: c = !1, isAudioPlaying: l = !1, isVoiceSetupLoading: d = !1, onStartVoice: m, visualViewportHeight: u, disabled: h = !1, error: F, suggestions: b, onSuggestionClick: M, compact: S = !1 }) {
|
|
3747
|
+
const T = Fe(u), [k, p] = A.useState(_e);
|
|
3748
|
+
A.useEffect(() => {
|
|
3749
|
+
const f = () => p(_e());
|
|
3750
|
+
return window.addEventListener("resize", f), () => window.removeEventListener("resize", f);
|
|
3667
3751
|
}, []);
|
|
3668
|
-
const
|
|
3669
|
-
return /* @__PURE__ */
|
|
3670
|
-
/* @__PURE__ */
|
|
3752
|
+
const g = S && !k, w = g ? "start" : "hero", E = b && b.length > 0;
|
|
3753
|
+
return /* @__PURE__ */ v("div", { className: V("rqmii-chat-panel rqmii-chat-panel--start", g && "rqmii-chat-panel--start-compact", Z()), style: T, children: [
|
|
3754
|
+
/* @__PURE__ */ v("div", { className: "rqmii-chat-topbar", children: [
|
|
3671
3755
|
/* @__PURE__ */ n("span", {}),
|
|
3672
|
-
/* @__PURE__ */
|
|
3673
|
-
/* @__PURE__ */ n(
|
|
3674
|
-
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick:
|
|
3756
|
+
/* @__PURE__ */ v("div", { className: "rqmii-chat-topbar-actions", children: [
|
|
3757
|
+
/* @__PURE__ */ n(Ge, { language: t, languages: i, onChange: o }),
|
|
3758
|
+
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick: s, children: /* @__PURE__ */ n(De, { size: 20 }) })
|
|
3675
3759
|
] })
|
|
3676
3760
|
] }),
|
|
3677
|
-
/* @__PURE__ */
|
|
3678
|
-
c ? /* @__PURE__ */
|
|
3679
|
-
/* @__PURE__ */ n(
|
|
3680
|
-
/* @__PURE__ */ n("button", { type: "button", className: V("rqmii-chat-call-button",
|
|
3681
|
-
] }) : /* @__PURE__ */ n(
|
|
3761
|
+
/* @__PURE__ */ v("div", { className: "rqmii-chat-start-body", children: [
|
|
3762
|
+
c ? /* @__PURE__ */ v("div", { className: V("rqmii-chat-call-avatar-wrap", g && "is-compact"), children: [
|
|
3763
|
+
/* @__PURE__ */ n(te, { agent: e, size: w, active: l }),
|
|
3764
|
+
/* @__PURE__ */ n("button", { type: "button", className: V("rqmii-chat-call-button", g && "is-compact"), onClick: m, disabled: d, "aria-label": z(t, "startVoice"), children: d ? /* @__PURE__ */ n(ze, { className: "rqmii-chat-spin", size: g ? 18 : 24 }) : /* @__PURE__ */ n(je, { size: g ? 18 : 24 }) })
|
|
3765
|
+
] }) : /* @__PURE__ */ n(te, { agent: e, size: w }),
|
|
3682
3766
|
/* @__PURE__ */ n("div", { className: "rqmii-chat-agent-name", children: e.name }),
|
|
3683
|
-
|
|
3767
|
+
F && /* @__PURE__ */ n("div", { className: "rqmii-chat-error-text", children: F })
|
|
3684
3768
|
] }),
|
|
3685
|
-
|
|
3686
|
-
/* @__PURE__ */ n(
|
|
3687
|
-
/* @__PURE__ */ n(
|
|
3769
|
+
E && /* @__PURE__ */ n("div", { className: "rqmii-chat-start-suggestions", children: /* @__PURE__ */ n(xn, { suggestions: b, language: t, onClick: (f) => M?.(f) }) }),
|
|
3770
|
+
/* @__PURE__ */ n(Me, { language: t, onSend: r, disabled: h }),
|
|
3771
|
+
/* @__PURE__ */ n(ue, { language: t, agent: e })
|
|
3688
3772
|
] });
|
|
3689
|
-
}),
|
|
3690
|
-
const m =
|
|
3691
|
-
return /* @__PURE__ */
|
|
3692
|
-
/* @__PURE__ */
|
|
3773
|
+
}), Nn = A.memo(function({ agent: e, language: t, languages: i, onLanguageChange: o, onClose: s, onStartVoice: r, isVoiceSetupLoading: c = !1, isAudioPlaying: l, visualViewportHeight: d }) {
|
|
3774
|
+
const m = Fe(d);
|
|
3775
|
+
return /* @__PURE__ */ v("div", { className: V("rqmii-chat-panel rqmii-chat-panel--voice-start", Z()), style: m, children: [
|
|
3776
|
+
/* @__PURE__ */ v("div", { className: "rqmii-chat-topbar", children: [
|
|
3693
3777
|
/* @__PURE__ */ n("span", {}),
|
|
3694
|
-
/* @__PURE__ */
|
|
3695
|
-
/* @__PURE__ */ n(
|
|
3696
|
-
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick:
|
|
3778
|
+
/* @__PURE__ */ v("div", { className: "rqmii-chat-topbar-actions", children: [
|
|
3779
|
+
/* @__PURE__ */ n(Ge, { language: t, languages: i, onChange: o }),
|
|
3780
|
+
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick: s, children: /* @__PURE__ */ n(De, { size: 20 }) })
|
|
3697
3781
|
] })
|
|
3698
3782
|
] }),
|
|
3699
|
-
/* @__PURE__ */
|
|
3700
|
-
/* @__PURE__ */
|
|
3701
|
-
/* @__PURE__ */ n(
|
|
3702
|
-
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-call-button", onClick: r, disabled: c, "aria-label":
|
|
3783
|
+
/* @__PURE__ */ v("div", { className: "rqmii-chat-call-body", children: [
|
|
3784
|
+
/* @__PURE__ */ v("div", { className: "rqmii-chat-call-avatar-wrap", children: [
|
|
3785
|
+
/* @__PURE__ */ n(te, { agent: e, size: "hero", active: l }),
|
|
3786
|
+
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-call-button", onClick: r, disabled: c, "aria-label": z(t, "startVoice"), children: c ? /* @__PURE__ */ n(ze, { className: "rqmii-chat-spin", size: 24 }) : /* @__PURE__ */ n(je, { size: 24 }) })
|
|
3703
3787
|
] }),
|
|
3704
|
-
/* @__PURE__ */
|
|
3705
|
-
|
|
3788
|
+
/* @__PURE__ */ v("div", { className: "rqmii-chat-agent-name", children: [
|
|
3789
|
+
z(t, "call"),
|
|
3706
3790
|
" ",
|
|
3707
3791
|
e.name
|
|
3708
3792
|
] })
|
|
3709
3793
|
] }),
|
|
3710
|
-
/* @__PURE__ */ n(
|
|
3794
|
+
/* @__PURE__ */ n(ue, { language: t, agent: e })
|
|
3711
3795
|
] });
|
|
3712
|
-
}),
|
|
3713
|
-
const
|
|
3714
|
-
return /* @__PURE__ */
|
|
3715
|
-
/* @__PURE__ */
|
|
3716
|
-
/* @__PURE__ */ n(
|
|
3717
|
-
|
|
3796
|
+
}), jn = A.memo(function({ agent: e, language: t, onEndSession: i, onMinimize: o, messages: s, partialTranscript: r, onSend: c, isAudioPlaying: l, isVoiceEnabled: d, onToggleVoice: m, isListening: u, isSpeaking: h, isLoading: F, isAgentThinking: b, isAgentSpeaking: M, onStartVoice: S, elapsed: T, visualViewportHeight: k, waitingForResponse: p }) {
|
|
3797
|
+
const g = pa({ language: t, isListening: u, isLoading: F, isSpeaking: h, isAudioPlaying: l, isAgentThinking: b, isAgentSpeaking: M, persistentListening: !1 }), w = Fe(k), E = e.widget?.appearance?.show_topbar_avatar_image !== !1;
|
|
3798
|
+
return /* @__PURE__ */ v("div", { className: V("rqmii-chat-panel rqmii-chat-panel--conversation", Z()), style: w, children: [
|
|
3799
|
+
/* @__PURE__ */ v("div", { className: "rqmii-chat-header", children: [
|
|
3800
|
+
E && /* @__PURE__ */ n(te, { agent: e, size: "header", active: l }),
|
|
3801
|
+
d && g && /* @__PURE__ */ n("div", { className: V("rqmii-chat-header-status", !E && "is-expanded"), children: /* @__PURE__ */ n("span", { children: g }) }),
|
|
3718
3802
|
/* @__PURE__ */ n("div", { className: "rqmii-chat-header-spacer" }),
|
|
3719
|
-
/* @__PURE__ */
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button is-danger", onClick: i, "aria-label":
|
|
3803
|
+
/* @__PURE__ */ v("div", { className: "rqmii-chat-header-actions", children: [
|
|
3804
|
+
o && /* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick: o, "aria-label": z(t, "minimize"), children: /* @__PURE__ */ n(xe, { size: 20 }) }),
|
|
3805
|
+
d && /* @__PURE__ */ n("button", { type: "button", className: V("rqmii-chat-circle-button", h && "is-active"), onClick: m, "aria-label": u ? z(t, "stopVoice") : z(t, "startVoice"), children: u ? /* @__PURE__ */ n(Se, { size: 20 }) : /* @__PURE__ */ n(Ve, { size: 20 }) }),
|
|
3806
|
+
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button is-danger", onClick: i, "aria-label": z(t, "endCall"), children: /* @__PURE__ */ n(Ne, { size: 20 }) })
|
|
3723
3807
|
] })
|
|
3724
3808
|
] }),
|
|
3725
|
-
/* @__PURE__ */ n(
|
|
3726
|
-
|
|
3727
|
-
/* @__PURE__ */ n(
|
|
3728
|
-
/* @__PURE__ */ n(
|
|
3809
|
+
/* @__PURE__ */ n(Ue, { messages: s, partialTranscript: r, language: t, showTypingIndicator: p }),
|
|
3810
|
+
d && /* @__PURE__ */ n("div", { className: "rqmii-chat-session-counter", children: Be(T) }),
|
|
3811
|
+
/* @__PURE__ */ n(Me, { language: t, onSend: c }),
|
|
3812
|
+
/* @__PURE__ */ n(ue, { language: t, agent: e })
|
|
3729
3813
|
] });
|
|
3730
|
-
}),
|
|
3731
|
-
const b =
|
|
3732
|
-
return /* @__PURE__ */
|
|
3733
|
-
/* @__PURE__ */
|
|
3734
|
-
/* @__PURE__ */ n("span", { className: V("rqmii-chat-live-dot",
|
|
3735
|
-
/* @__PURE__ */ n("span", { children:
|
|
3736
|
-
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick:
|
|
3814
|
+
}), Dn = A.memo(function({ agent: e, language: t, onEndSession: i, onMinimize: o, isListening: s, isLoading: r, isSpeaking: c, isAudioPlaying: l, isAgentThinking: d, isAgentSpeaking: m, onToggleVoice: u, elapsed: h, visualViewportHeight: F }) {
|
|
3815
|
+
const b = pa({ language: t, isListening: s, isLoading: r, isSpeaking: c, isAudioPlaying: l, isAgentThinking: d, isAgentSpeaking: m, persistentListening: !0 }), M = Fe(F);
|
|
3816
|
+
return /* @__PURE__ */ v("div", { className: V("rqmii-chat-panel rqmii-chat-panel--voice-call", Z()), style: M, children: [
|
|
3817
|
+
/* @__PURE__ */ v("div", { className: "rqmii-chat-call-status", children: [
|
|
3818
|
+
/* @__PURE__ */ n("span", { className: V("rqmii-chat-live-dot", s && "is-live") }),
|
|
3819
|
+
/* @__PURE__ */ n("span", { children: Be(h) }),
|
|
3820
|
+
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick: o, children: /* @__PURE__ */ n(xe, { size: 20 }) })
|
|
3737
3821
|
] }),
|
|
3738
|
-
/* @__PURE__ */
|
|
3739
|
-
/* @__PURE__ */ n(
|
|
3822
|
+
/* @__PURE__ */ v("div", { className: "rqmii-chat-voice-frame", children: [
|
|
3823
|
+
/* @__PURE__ */ n(te, { agent: e, size: "hero", active: l }),
|
|
3740
3824
|
/* @__PURE__ */ n("div", { className: "rqmii-chat-agent-name", children: e.name }),
|
|
3741
|
-
/* @__PURE__ */ n("div", { className: V("rqmii-chat-status-pill", !b && "is-empty"), children: b ||
|
|
3742
|
-
/* @__PURE__ */
|
|
3743
|
-
/* @__PURE__ */ n("button", { type: "button", className: V("rqmii-chat-circle-button", c && "is-active"), onClick: u, children:
|
|
3744
|
-
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button is-danger", onClick: i, "aria-label":
|
|
3825
|
+
/* @__PURE__ */ n("div", { className: V("rqmii-chat-status-pill", !b && "is-empty"), children: b || z(t, "listening") }),
|
|
3826
|
+
/* @__PURE__ */ v("div", { className: "rqmii-chat-voice-actions", children: [
|
|
3827
|
+
/* @__PURE__ */ n("button", { type: "button", className: V("rqmii-chat-circle-button", c && "is-active"), onClick: u, children: s ? /* @__PURE__ */ n(Se, { size: 20 }) : /* @__PURE__ */ n(Ve, { size: 20 }) }),
|
|
3828
|
+
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button is-danger", onClick: i, "aria-label": z(t, "endCall"), children: /* @__PURE__ */ n(Ne, { size: 20 }) })
|
|
3745
3829
|
] })
|
|
3746
3830
|
] }),
|
|
3747
|
-
/* @__PURE__ */ n(
|
|
3831
|
+
/* @__PURE__ */ n(ue, { language: t, agent: e })
|
|
3748
3832
|
] });
|
|
3749
3833
|
});
|
|
3750
|
-
function
|
|
3751
|
-
return t ?
|
|
3834
|
+
function pa({ language: a, isListening: e, isLoading: t, isSpeaking: i, isAudioPlaying: o, isAgentThinking: s, isAgentSpeaking: r, persistentListening: c = !1 }) {
|
|
3835
|
+
return t ? z(a, "loading") : i ? z(a, "listening") : o || r ? z(a, "talkToInterrupt") : s ? z(a, "processing") : e && c ? z(a, "listening") : null;
|
|
3752
3836
|
}
|
|
3753
|
-
const
|
|
3837
|
+
const Rn = A.memo(function({ agent: e, language: t, onRestore: i, onClose: o, isListening: s, isAudioPlaying: r, isSpeaking: c, onToggleVoice: l, elapsed: d, variant: m = "voice" }) {
|
|
3754
3838
|
const u = m === "text";
|
|
3755
|
-
return /* @__PURE__ */
|
|
3756
|
-
/* @__PURE__ */ n(
|
|
3757
|
-
!u && /* @__PURE__ */ n("span", { className: "rqmii-chat-minimized-time", children:
|
|
3758
|
-
/* @__PURE__ */
|
|
3759
|
-
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick: i, "aria-label":
|
|
3760
|
-
!u && /* @__PURE__ */ n("button", { type: "button", className: V("rqmii-chat-circle-button", c && "is-active"), onClick:
|
|
3761
|
-
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button is-danger", onClick:
|
|
3839
|
+
return /* @__PURE__ */ v("div", { className: V("rqmii-chat-minimized", Z()), children: [
|
|
3840
|
+
/* @__PURE__ */ n(te, { agent: e, size: "minimized", active: r }),
|
|
3841
|
+
!u && /* @__PURE__ */ n("span", { className: "rqmii-chat-minimized-time", children: Be(d) }),
|
|
3842
|
+
/* @__PURE__ */ v("div", { className: "rqmii-chat-minimized-actions", children: [
|
|
3843
|
+
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", onClick: i, "aria-label": z(t, "maximize"), children: /* @__PURE__ */ n(Jt, { size: 20 }) }),
|
|
3844
|
+
!u && /* @__PURE__ */ n("button", { type: "button", className: V("rqmii-chat-circle-button", c && "is-active"), onClick: l, "aria-label": s ? z(t, "stopVoice") : z(t, "startVoice"), children: s ? /* @__PURE__ */ n(Se, { size: 20 }) : /* @__PURE__ */ n(Ve, { size: 20 }) }),
|
|
3845
|
+
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button is-danger", onClick: o, "aria-label": z(t, "endCall"), children: /* @__PURE__ */ n(Ne, { size: 20 }) })
|
|
3762
3846
|
] })
|
|
3763
3847
|
] });
|
|
3764
|
-
}),
|
|
3848
|
+
}), Bn = A.memo(function({
|
|
3765
3849
|
agent: e,
|
|
3766
3850
|
language: t,
|
|
3767
3851
|
languages: i,
|
|
3768
|
-
chatKind:
|
|
3769
|
-
messages:
|
|
3852
|
+
chatKind: o,
|
|
3853
|
+
messages: s,
|
|
3770
3854
|
onLanguageChange: r,
|
|
3771
3855
|
onMinimize: c,
|
|
3772
|
-
onStartNewVoice:
|
|
3773
|
-
onStartNewText:
|
|
3856
|
+
onStartNewVoice: l,
|
|
3857
|
+
onStartNewText: d,
|
|
3774
3858
|
isVoiceSetupLoading: m = !1,
|
|
3775
3859
|
visualViewportHeight: u,
|
|
3776
3860
|
rating: h,
|
|
3777
|
-
endedBy:
|
|
3861
|
+
endedBy: F,
|
|
3778
3862
|
sessionId: b,
|
|
3779
|
-
ratingInteractive:
|
|
3780
|
-
showTellUsMore:
|
|
3781
|
-
onRate:
|
|
3782
|
-
onTellUsMore:
|
|
3863
|
+
ratingInteractive: M,
|
|
3864
|
+
showTellUsMore: S,
|
|
3865
|
+
onRate: T,
|
|
3866
|
+
onTellUsMore: k
|
|
3783
3867
|
}) {
|
|
3784
|
-
const
|
|
3785
|
-
|
|
3868
|
+
const p = Fe(u), g = e.widget?.behavior?.conversation_ended_screen, w = !!g?.post_chat_rating_enabled, E = g?.show_conversation_id ?? !0, f = /* @__PURE__ */ n(
|
|
3869
|
+
_n,
|
|
3786
3870
|
{
|
|
3787
3871
|
language: t,
|
|
3788
3872
|
rating: h,
|
|
3789
|
-
endedBy:
|
|
3873
|
+
endedBy: F,
|
|
3790
3874
|
sessionId: b,
|
|
3791
|
-
interactive:
|
|
3792
|
-
showTellUsMore:
|
|
3793
|
-
|
|
3794
|
-
|
|
3875
|
+
interactive: M,
|
|
3876
|
+
showTellUsMore: S,
|
|
3877
|
+
showRating: w,
|
|
3878
|
+
showConversationId: E,
|
|
3879
|
+
onRate: T,
|
|
3880
|
+
onTellUsMore: k
|
|
3795
3881
|
}
|
|
3796
|
-
)
|
|
3797
|
-
/* @__PURE__ */ n(
|
|
3882
|
+
), P = o === "voice" || o === "text_and_voice", C = o === "text" || o === "text_and_voice", _ = /* @__PURE__ */ v("div", { className: "rqmii-chat-topbar-actions rqmii-chat-topbar-actions--ended", children: [
|
|
3883
|
+
/* @__PURE__ */ n(Ge, { language: t, languages: i, onChange: r }),
|
|
3798
3884
|
/* @__PURE__ */ n(
|
|
3799
3885
|
"button",
|
|
3800
3886
|
{
|
|
3801
3887
|
type: "button",
|
|
3802
3888
|
className: "rqmii-chat-circle-button",
|
|
3803
3889
|
onClick: c,
|
|
3804
|
-
"aria-label":
|
|
3805
|
-
children: /* @__PURE__ */ n(
|
|
3890
|
+
"aria-label": z(t, "minimize"),
|
|
3891
|
+
children: /* @__PURE__ */ n(xe, { size: 20 })
|
|
3806
3892
|
}
|
|
3807
3893
|
),
|
|
3808
|
-
|
|
3894
|
+
P && /* @__PURE__ */ n(
|
|
3809
3895
|
"button",
|
|
3810
3896
|
{
|
|
3811
3897
|
type: "button",
|
|
3812
3898
|
className: "rqmii-chat-circle-button rqmii-chat-circle-button--call-start",
|
|
3813
|
-
onClick:
|
|
3899
|
+
onClick: l,
|
|
3814
3900
|
disabled: m,
|
|
3815
|
-
"aria-label":
|
|
3816
|
-
children: m ? /* @__PURE__ */ n(
|
|
3901
|
+
"aria-label": z(t, "startVoice"),
|
|
3902
|
+
children: m ? /* @__PURE__ */ n(ze, { className: "rqmii-chat-spin", size: 20 }) : /* @__PURE__ */ n(je, { size: 20 })
|
|
3817
3903
|
}
|
|
3818
3904
|
)
|
|
3819
3905
|
] });
|
|
3820
|
-
|
|
3821
|
-
/* @__PURE__ */
|
|
3822
|
-
/* @__PURE__ */
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
/* @__PURE__ */
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3906
|
+
if (o === "voice")
|
|
3907
|
+
return /* @__PURE__ */ v("div", { className: V("rqmii-chat-panel rqmii-chat-panel--voice-call", Z()), style: p, children: [
|
|
3908
|
+
/* @__PURE__ */ v("div", { className: "rqmii-chat-topbar", children: [
|
|
3909
|
+
/* @__PURE__ */ n("span", {}),
|
|
3910
|
+
_
|
|
3911
|
+
] }),
|
|
3912
|
+
/* @__PURE__ */ v("div", { className: "rqmii-chat-voice-frame", children: [
|
|
3913
|
+
/* @__PURE__ */ n(te, { agent: e, size: "hero" }),
|
|
3914
|
+
/* @__PURE__ */ n("div", { className: "rqmii-chat-agent-name", children: e.name }),
|
|
3915
|
+
f
|
|
3916
|
+
] }),
|
|
3917
|
+
/* @__PURE__ */ n(ue, { language: t, agent: e })
|
|
3918
|
+
] });
|
|
3919
|
+
const x = e.widget?.appearance?.show_topbar_avatar_image !== !1;
|
|
3920
|
+
return /* @__PURE__ */ v("div", { className: V("rqmii-chat-panel rqmii-chat-panel--conversation", Z()), style: p, children: [
|
|
3921
|
+
/* @__PURE__ */ v("div", { className: "rqmii-chat-topbar", children: [
|
|
3922
|
+
x ? /* @__PURE__ */ n(te, { agent: e, size: "header" }) : /* @__PURE__ */ n("span", {}),
|
|
3923
|
+
_
|
|
3835
3924
|
] }),
|
|
3836
|
-
/* @__PURE__ */ n(
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
/* @__PURE__ */ n(
|
|
3925
|
+
/* @__PURE__ */ n(Ue, { messages: s, language: t }),
|
|
3926
|
+
f,
|
|
3927
|
+
C && /* @__PURE__ */ n(Me, { language: t, onSend: d }),
|
|
3928
|
+
/* @__PURE__ */ n(ue, { language: t, agent: e })
|
|
3840
3929
|
] });
|
|
3841
|
-
}),
|
|
3842
|
-
const { streamingUrl:
|
|
3843
|
-
return /* @__PURE__ */
|
|
3844
|
-
/* @__PURE__ */
|
|
3845
|
-
/* @__PURE__ */ n(
|
|
3846
|
-
!
|
|
3847
|
-
r && /* @__PURE__ */ n("div", { className: "rqmii-avatar-overlay", children:
|
|
3848
|
-
/* @__PURE__ */
|
|
3849
|
-
/* @__PURE__ */ n(
|
|
3930
|
+
}), ba = A.memo(function({ agent: e, language: t, onClose: i }) {
|
|
3931
|
+
const { streamingUrl: o, isCloudStreamConnected: s, cloudStreamError: r } = He(), { isAvatarSpeaking: c } = He(), { messages: l, sendTextMessage: d } = ge();
|
|
3932
|
+
return /* @__PURE__ */ v("div", { className: V("rqmii-avatar-panel", Z()), children: [
|
|
3933
|
+
/* @__PURE__ */ v("div", { className: "rqmii-avatar-stream", children: [
|
|
3934
|
+
/* @__PURE__ */ n(A.Suspense, { fallback: /* @__PURE__ */ n("div", { className: "rqmii-avatar-overlay", children: z(t, "loading") }), children: /* @__PURE__ */ n(In, { autoConnect: !0, muted: !1 }) }),
|
|
3935
|
+
!o && /* @__PURE__ */ n("div", { className: "rqmii-avatar-overlay", children: z(t, "loading") }),
|
|
3936
|
+
r && /* @__PURE__ */ n("div", { className: "rqmii-avatar-overlay", children: z(t, "connectionFailed") }),
|
|
3937
|
+
/* @__PURE__ */ v("div", { className: "rqmii-avatar-controls", children: [
|
|
3938
|
+
/* @__PURE__ */ n(te, { agent: e, size: "header", active: c }),
|
|
3850
3939
|
/* @__PURE__ */ n("div", { className: "rqmii-chat-header-spacer" }),
|
|
3851
|
-
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", disabled: !
|
|
3852
|
-
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button is-danger", onClick: i, children: /* @__PURE__ */ n(
|
|
3940
|
+
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button", disabled: !s, children: /* @__PURE__ */ n(Se, { size: 20 }) }),
|
|
3941
|
+
/* @__PURE__ */ n("button", { type: "button", className: "rqmii-chat-circle-button is-danger", onClick: i, children: /* @__PURE__ */ n(De, { size: 20 }) })
|
|
3853
3942
|
] })
|
|
3854
3943
|
] }),
|
|
3855
|
-
e.useText && /* @__PURE__ */
|
|
3856
|
-
/* @__PURE__ */ n(
|
|
3857
|
-
/* @__PURE__ */ n(
|
|
3858
|
-
/* @__PURE__ */ n(
|
|
3944
|
+
e.useText && /* @__PURE__ */ v("div", { className: "rqmii-avatar-sidebar", children: [
|
|
3945
|
+
/* @__PURE__ */ n(Ue, { messages: l, language: t }),
|
|
3946
|
+
/* @__PURE__ */ n(Me, { language: t, onSend: d, variant: "compact" }),
|
|
3947
|
+
/* @__PURE__ */ n(ue, { language: t, agent: e })
|
|
3859
3948
|
] })
|
|
3860
3949
|
] });
|
|
3861
3950
|
});
|
|
3862
|
-
function
|
|
3863
|
-
const
|
|
3864
|
-
return
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3951
|
+
function Gn(a) {
|
|
3952
|
+
const e = a.trim(), t = e.toLowerCase();
|
|
3953
|
+
return t.startsWith("javascript:") || t.startsWith("data:") || t.startsWith("vbscript:") ? "#" : e;
|
|
3954
|
+
}
|
|
3955
|
+
function se(a) {
|
|
3956
|
+
const e = [], t = /(\[([^\]]+)\]\(([^)]+)\))|(\*\*([^*]+)\*\*|__([^_]+)__)|(\*([^*]+)\*|_([^_]+)_)|(~~([^~]+)~~)|(`([^`]+)`)/g;
|
|
3957
|
+
let i = 0, o;
|
|
3958
|
+
for (; (o = t.exec(a)) !== null; ) {
|
|
3959
|
+
o.index > i && e.push(a.slice(i, o.index));
|
|
3960
|
+
const s = `inline-${o.index}-${o[0]}`;
|
|
3961
|
+
if (o[1]) {
|
|
3962
|
+
const r = o[2], c = o[3];
|
|
3963
|
+
e.push(
|
|
3964
|
+
/* @__PURE__ */ n(
|
|
3965
|
+
"a",
|
|
3966
|
+
{
|
|
3967
|
+
href: Gn(c),
|
|
3968
|
+
target: "_blank",
|
|
3969
|
+
rel: "noopener noreferrer",
|
|
3970
|
+
className: "rqmii-markdown-link",
|
|
3971
|
+
children: se(r)
|
|
3972
|
+
},
|
|
3973
|
+
s
|
|
3974
|
+
)
|
|
3975
|
+
);
|
|
3976
|
+
} else if (o[4]) {
|
|
3977
|
+
const r = o[5] || o[6];
|
|
3978
|
+
e.push(
|
|
3979
|
+
/* @__PURE__ */ n("strong", { className: "rqmii-markdown-strong", children: se(r) }, s)
|
|
3980
|
+
);
|
|
3981
|
+
} else if (o[7]) {
|
|
3982
|
+
const r = o[8] || o[9];
|
|
3983
|
+
e.push(
|
|
3984
|
+
/* @__PURE__ */ n("em", { className: "rqmii-markdown-em", children: se(r) }, s)
|
|
3985
|
+
);
|
|
3986
|
+
} else if (o[10]) {
|
|
3987
|
+
const r = o[11];
|
|
3988
|
+
e.push(
|
|
3989
|
+
/* @__PURE__ */ n("del", { className: "rqmii-markdown-del", children: se(r) }, s)
|
|
3990
|
+
);
|
|
3991
|
+
} else if (o[12]) {
|
|
3992
|
+
const r = o[13];
|
|
3993
|
+
e.push(
|
|
3994
|
+
/* @__PURE__ */ n("code", { className: "rqmii-markdown-code", children: r }, s)
|
|
3995
|
+
);
|
|
3996
|
+
}
|
|
3997
|
+
i = t.lastIndex;
|
|
3998
|
+
}
|
|
3999
|
+
return i < a.length && e.push(a.slice(i)), e;
|
|
4000
|
+
}
|
|
4001
|
+
function ia(a, e) {
|
|
4002
|
+
const t = a.split(`
|
|
4003
|
+
`);
|
|
4004
|
+
return t.length === 1 ? se(t[0]) : t.map((i, o) => /* @__PURE__ */ v(A.Fragment, { children: [
|
|
4005
|
+
o > 0 && /* @__PURE__ */ n("br", {}),
|
|
4006
|
+
se(i)
|
|
4007
|
+
] }, `${e}-ln-${o}`));
|
|
4008
|
+
}
|
|
4009
|
+
function Un({
|
|
4010
|
+
content: a,
|
|
4011
|
+
className: e = ""
|
|
4012
|
+
}) {
|
|
4013
|
+
if (!a || !a.trim()) return null;
|
|
4014
|
+
const t = a.replace(/\r\n/g, `
|
|
4015
|
+
`).split(/\n{2,}/), i = [];
|
|
4016
|
+
return t.forEach((o, s) => {
|
|
4017
|
+
const r = o.trim();
|
|
4018
|
+
if (!r) return;
|
|
4019
|
+
const c = `block-${s}`;
|
|
4020
|
+
if (r.startsWith("#")) {
|
|
4021
|
+
const l = r.match(/^(#{1,6})\s+(.+)$/s);
|
|
4022
|
+
if (l) {
|
|
4023
|
+
const d = l[1].length, m = l[2].trim(), u = se(m);
|
|
4024
|
+
d === 1 ? i.push(/* @__PURE__ */ n("h3", { className: "rqmii-markdown-h1", children: u }, c)) : d === 2 ? i.push(/* @__PURE__ */ n("h4", { className: "rqmii-markdown-h2", children: u }, c)) : i.push(/* @__PURE__ */ n("h5", { className: "rqmii-markdown-h3", children: u }, c));
|
|
4025
|
+
return;
|
|
4026
|
+
}
|
|
4027
|
+
}
|
|
4028
|
+
if (r.startsWith(">")) {
|
|
4029
|
+
const l = r.split(`
|
|
4030
|
+
`).map((d) => d.replace(/^>\s?/, "")).join(`
|
|
4031
|
+
`);
|
|
4032
|
+
i.push(
|
|
4033
|
+
/* @__PURE__ */ n("blockquote", { className: "rqmii-markdown-blockquote", children: ia(l, c) }, c)
|
|
4034
|
+
);
|
|
4035
|
+
return;
|
|
4036
|
+
}
|
|
4037
|
+
if (/^[-*]\s+/m.test(r)) {
|
|
4038
|
+
const l = r.split(`
|
|
4039
|
+
`);
|
|
4040
|
+
if (l.every((m) => /^[-*]\s+/.test(m.trim()) || m.trim() === "")) {
|
|
4041
|
+
const m = l.map((u) => u.trim().replace(/^[-*]\s+/, "")).filter(Boolean);
|
|
4042
|
+
i.push(
|
|
4043
|
+
/* @__PURE__ */ n("ul", { className: "rqmii-markdown-ul", children: m.map((u, h) => /* @__PURE__ */ n("li", { children: se(u) }, `${c}-li-${h}`)) }, c)
|
|
4044
|
+
);
|
|
4045
|
+
return;
|
|
4046
|
+
}
|
|
4047
|
+
}
|
|
4048
|
+
if (/^\d+\.\s+/m.test(r)) {
|
|
4049
|
+
const l = r.split(`
|
|
4050
|
+
`);
|
|
4051
|
+
if (l.every((m) => /^\d+\.\s+/.test(m.trim()) || m.trim() === "")) {
|
|
4052
|
+
const m = l.map((u) => u.trim().replace(/^\d+\.\s+/, "")).filter(Boolean);
|
|
4053
|
+
i.push(
|
|
4054
|
+
/* @__PURE__ */ n("ol", { className: "rqmii-markdown-ol", children: m.map((u, h) => /* @__PURE__ */ n("li", { children: se(u) }, `${c}-li-${h}`)) }, c)
|
|
4055
|
+
);
|
|
4056
|
+
return;
|
|
4057
|
+
}
|
|
4058
|
+
}
|
|
4059
|
+
i.push(
|
|
4060
|
+
/* @__PURE__ */ n("p", { className: "rqmii-markdown-p", children: ia(r, c) }, c)
|
|
4061
|
+
);
|
|
4062
|
+
}), /* @__PURE__ */ n("div", { className: `rqmii-markdown ${e}`.trim(), children: i });
|
|
4063
|
+
}
|
|
4064
|
+
const Kn = A.memo(Un);
|
|
4065
|
+
function On({
|
|
4066
|
+
language: a,
|
|
4067
|
+
content: e,
|
|
4068
|
+
config: t,
|
|
4069
|
+
agent: i,
|
|
4070
|
+
onAccept: o,
|
|
4071
|
+
onDecline: s
|
|
4072
|
+
}) {
|
|
4073
|
+
const r = e || t?.body?.[a] || z(a, "consentBody") || "", c = t?.acceptLabel?.[a] || z(a, "consentAccept"), l = t?.declineLabel?.[a] || z(a, "consentDecline");
|
|
4074
|
+
return /* @__PURE__ */ v(
|
|
4075
|
+
"div",
|
|
4076
|
+
{
|
|
4077
|
+
className: V(
|
|
4078
|
+
"rqmii-chat-panel rqmii-chat-panel--start rqmii-chat-panel--consent",
|
|
4079
|
+
Z()
|
|
3892
4080
|
),
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
{
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
4081
|
+
dir: re(a),
|
|
4082
|
+
children: [
|
|
4083
|
+
/* @__PURE__ */ n("div", { className: "rqmii-chat-consent-body", children: /* @__PURE__ */ n(Kn, { content: r }) }),
|
|
4084
|
+
/* @__PURE__ */ v("div", { className: "rqmii-chat-consent-actions", children: [
|
|
4085
|
+
/* @__PURE__ */ n(
|
|
4086
|
+
"button",
|
|
4087
|
+
{
|
|
4088
|
+
type: "button",
|
|
4089
|
+
className: "rqmii-chat-consent-button rqmii-chat-consent-button--decline",
|
|
4090
|
+
onClick: s,
|
|
4091
|
+
children: l
|
|
4092
|
+
}
|
|
4093
|
+
),
|
|
4094
|
+
/* @__PURE__ */ n(
|
|
4095
|
+
"button",
|
|
4096
|
+
{
|
|
4097
|
+
type: "button",
|
|
4098
|
+
className: "rqmii-chat-consent-button rqmii-chat-consent-button--accept",
|
|
4099
|
+
onClick: o,
|
|
4100
|
+
children: c
|
|
4101
|
+
}
|
|
4102
|
+
)
|
|
4103
|
+
] })
|
|
4104
|
+
]
|
|
4105
|
+
}
|
|
4106
|
+
);
|
|
3905
4107
|
}
|
|
3906
|
-
function
|
|
4108
|
+
function Yn(a) {
|
|
3907
4109
|
return a ? typeof a == "string" ? a : typeof a == "object" && typeof a.text == "string" ? a.text : "" : "";
|
|
3908
4110
|
}
|
|
3909
|
-
function
|
|
4111
|
+
function Qn(a) {
|
|
3910
4112
|
return a === "text" || a === "voice" || a === "text_and_voice";
|
|
3911
4113
|
}
|
|
3912
|
-
const
|
|
4114
|
+
const Ke = A.memo(function({
|
|
3913
4115
|
agent: e,
|
|
3914
4116
|
language: t,
|
|
3915
4117
|
languages: i,
|
|
3916
|
-
onLanguageChange:
|
|
3917
|
-
onEndSession:
|
|
4118
|
+
onLanguageChange: o = oe,
|
|
4119
|
+
onEndSession: s = oe,
|
|
3918
4120
|
onMinimize: r,
|
|
3919
4121
|
messages: c,
|
|
3920
|
-
onSendMessage:
|
|
3921
|
-
isPreview:
|
|
4122
|
+
onSendMessage: l,
|
|
4123
|
+
isPreview: d = !1,
|
|
3922
4124
|
chatKind: m,
|
|
3923
4125
|
sdk: u,
|
|
3924
4126
|
renderPanel: h,
|
|
3925
|
-
messagesRef:
|
|
4127
|
+
messagesRef: F,
|
|
3926
4128
|
initialText: b,
|
|
3927
|
-
autoStartVoice:
|
|
4129
|
+
autoStartVoice: M
|
|
3928
4130
|
}) {
|
|
3929
|
-
const
|
|
4131
|
+
const S = e.widget?.consent || e.consent, T = !!S?.enabled, k = S?.content?.[t] || S?.body?.[t] || "", p = S?.one_time !== !1, g = e.id ? `rqmii_consent_${e.id}` : null, [w, E] = y(() => {
|
|
4132
|
+
if (!T || !k) return !0;
|
|
4133
|
+
if (p && g && typeof window < "u")
|
|
4134
|
+
try {
|
|
4135
|
+
return window.localStorage.getItem(g) === "true";
|
|
4136
|
+
} catch {
|
|
4137
|
+
return !1;
|
|
4138
|
+
}
|
|
4139
|
+
return !1;
|
|
4140
|
+
}), f = m || Ee(e), [P, C] = y(() => f === "voice" && u.isSessionReady || f === "voice" && !!M), [_, x] = y(() => (f === "text" || f === "text_and_voice") && u.isSessionReady || !!b || f === "text_and_voice" && !!M), [j, R] = y(!1), [D, L] = y(!1), [G, N] = y(null), O = hn(f === "voice" && P || f === "text_and_voice" && _), U = gn(), J = T && !!k && !w && !d, X = Qn(f), { events: W } = pe();
|
|
3930
4141
|
I(() => {
|
|
3931
|
-
if (!
|
|
3932
|
-
const
|
|
3933
|
-
|
|
3934
|
-
},
|
|
3935
|
-
|
|
4142
|
+
if (!W) return;
|
|
4143
|
+
const Q = () => {
|
|
4144
|
+
X && _e() && R(!0);
|
|
4145
|
+
}, be = () => {
|
|
4146
|
+
X && R(!1);
|
|
3936
4147
|
};
|
|
3937
|
-
return
|
|
3938
|
-
|
|
4148
|
+
return W.on("minimize_chat", Q), W.on("maximize_chat", be), () => {
|
|
4149
|
+
W.off("minimize_chat", Q), W.off("maximize_chat", be);
|
|
3939
4150
|
};
|
|
3940
|
-
}, [
|
|
3941
|
-
const
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
4151
|
+
}, [W, X]);
|
|
4152
|
+
const ee = ie(() => {
|
|
4153
|
+
if (p && g && typeof window < "u")
|
|
4154
|
+
try {
|
|
4155
|
+
window.localStorage.setItem(g, "true");
|
|
4156
|
+
} catch {
|
|
4157
|
+
}
|
|
4158
|
+
E(!0);
|
|
4159
|
+
}, [p, g]), K = ie(() => {
|
|
4160
|
+
r ? r() : s();
|
|
4161
|
+
}, [r, s]), me = (Q) => {
|
|
4162
|
+
o(Q), d || u.changeSessionLanguage(Q);
|
|
4163
|
+
}, ae = ie((Q) => {
|
|
4164
|
+
if (N(null), L(!0), l) {
|
|
4165
|
+
l(Q);
|
|
3948
4166
|
return;
|
|
3949
4167
|
}
|
|
3950
|
-
u.sendTextMessage(
|
|
3951
|
-
}, [
|
|
4168
|
+
u.sendTextMessage(Q);
|
|
4169
|
+
}, [l, u]);
|
|
3952
4170
|
I(() => {
|
|
3953
|
-
|
|
4171
|
+
F && (F.current = u.messages);
|
|
3954
4172
|
});
|
|
3955
|
-
const
|
|
4173
|
+
const le = B(!1);
|
|
3956
4174
|
I(() => {
|
|
3957
|
-
|
|
4175
|
+
le.current || (b ? (le.current = !0, ae(b)) : M && (le.current = !0, N(null), L(!0), u.isVoiceActive || u.startVoice()));
|
|
3958
4176
|
}, []), I(() => {
|
|
3959
|
-
|
|
3960
|
-
}, [
|
|
3961
|
-
|
|
3962
|
-
}, [
|
|
3963
|
-
const
|
|
3964
|
-
|
|
4177
|
+
D && u.isSessionReady && (L(!1), f === "voice" ? C(!0) : x(!0));
|
|
4178
|
+
}, [D, u.isSessionReady, f]), I(() => {
|
|
4179
|
+
D && u.error && (L(!1), N(u.error));
|
|
4180
|
+
}, [D, u.error]);
|
|
4181
|
+
const ce = ie(() => {
|
|
4182
|
+
N(null), L(!0), u.isVoiceActive || u.startVoice();
|
|
3965
4183
|
}, [u]);
|
|
3966
|
-
if (u.error && !
|
|
3967
|
-
if (
|
|
3968
|
-
return /* @__PURE__ */ n(
|
|
3969
|
-
|
|
4184
|
+
if (u.error && !d && (_ || P)) return /* @__PURE__ */ n(ha, { message: u.error, language: t, onClose: s });
|
|
4185
|
+
if (J)
|
|
4186
|
+
return /* @__PURE__ */ n(
|
|
4187
|
+
On,
|
|
4188
|
+
{
|
|
4189
|
+
language: t,
|
|
4190
|
+
content: k,
|
|
4191
|
+
config: e.consent,
|
|
4192
|
+
agent: e,
|
|
4193
|
+
onAccept: ee,
|
|
4194
|
+
onDecline: K
|
|
4195
|
+
}
|
|
4196
|
+
);
|
|
4197
|
+
const he = {
|
|
3970
4198
|
agent: e,
|
|
3971
4199
|
language: t,
|
|
3972
4200
|
languages: i,
|
|
3973
|
-
chatKind:
|
|
4201
|
+
chatKind: f,
|
|
3974
4202
|
sdk: u,
|
|
3975
|
-
isPreview:
|
|
3976
|
-
onLanguageChange:
|
|
3977
|
-
onClose:
|
|
3978
|
-
onMinimize:
|
|
3979
|
-
onRestore:
|
|
3980
|
-
onSend:
|
|
3981
|
-
voiceStarted:
|
|
3982
|
-
conversationStarted:
|
|
3983
|
-
isMinimized:
|
|
3984
|
-
elapsed:
|
|
3985
|
-
setVoiceStarted:
|
|
3986
|
-
setConversationStarted:
|
|
4203
|
+
isPreview: d,
|
|
4204
|
+
onLanguageChange: me,
|
|
4205
|
+
onClose: s,
|
|
4206
|
+
onMinimize: X ? () => R(!0) : void 0,
|
|
4207
|
+
onRestore: X ? () => R(!1) : void 0,
|
|
4208
|
+
onSend: ae,
|
|
4209
|
+
voiceStarted: P,
|
|
4210
|
+
conversationStarted: _,
|
|
4211
|
+
isMinimized: j,
|
|
4212
|
+
elapsed: O,
|
|
4213
|
+
setVoiceStarted: C,
|
|
4214
|
+
setConversationStarted: x
|
|
3987
4215
|
};
|
|
3988
|
-
return h ? /* @__PURE__ */ n(
|
|
3989
|
-
|
|
4216
|
+
return h ? /* @__PURE__ */ n(Te, { children: h(he) }) : /* @__PURE__ */ n(Hn, { ...he, connecting: D, connectError: G, visualViewportHeight: U, onCloseWidget: r ?? s, initiateVoice: ce, onSendSuggestion: (Q) => {
|
|
4217
|
+
N(null), L(!0), u.sendSuggestion?.(Q);
|
|
3990
4218
|
} });
|
|
3991
|
-
}),
|
|
3992
|
-
const
|
|
3993
|
-
if (
|
|
3994
|
-
if (
|
|
3995
|
-
return /* @__PURE__ */ n(
|
|
3996
|
-
if (
|
|
3997
|
-
return /* @__PURE__ */ n(
|
|
3998
|
-
if (
|
|
3999
|
-
return /* @__PURE__ */ n(
|
|
4000
|
-
if (!h && (
|
|
4001
|
-
const
|
|
4002
|
-
|
|
4003
|
-
},
|
|
4004
|
-
return /* @__PURE__ */ n(
|
|
4219
|
+
}), Hn = A.memo(function({ agent: e, language: t, languages: i, chatKind: o, sdk: s, onLanguageChange: r, onClose: c, onMinimize: l, onRestore: d, onSend: m, voiceStarted: u, conversationStarted: h, isMinimized: F, elapsed: b, setVoiceStarted: M, setConversationStarted: S, visualViewportHeight: T, connecting: k = !1, connectError: p = null, onCloseWidget: g, initiateVoice: w, onSendSuggestion: E }) {
|
|
4220
|
+
const f = e.widget?.behavior?.typing_indicator_enabled ?? !0, P = o === "text" ? s.waitingForResponse && f : !1, C = s.messages;
|
|
4221
|
+
if (o === "avatar") return /* @__PURE__ */ n(ba, { agent: e, language: t, onClose: c });
|
|
4222
|
+
if (F)
|
|
4223
|
+
return /* @__PURE__ */ n(Rn, { agent: e, language: t, onRestore: d, onClose: c, isListening: s.isVoiceActive, isAudioPlaying: s.isAudioPlaying, isSpeaking: s.vad.isSpeaking, onToggleVoice: s.toggleVoice, elapsed: b, variant: o === "text" ? "text" : "voice" });
|
|
4224
|
+
if (o === "voice" && u)
|
|
4225
|
+
return /* @__PURE__ */ n(Dn, { agent: e, language: t, onEndSession: c, onMinimize: l, isListening: s.isVoiceActive, isLoading: s.vad.isLoading, isSpeaking: s.vad.isSpeaking, isAudioPlaying: s.isAudioPlaying, isAgentThinking: s.isAgentThinking, isAgentSpeaking: s.isAgentSpeaking, onToggleVoice: s.toggleVoice, elapsed: b, visualViewportHeight: T });
|
|
4226
|
+
if (o === "voice")
|
|
4227
|
+
return /* @__PURE__ */ n(Nn, { agent: e, language: t, languages: i, onLanguageChange: r, onClose: g, isAudioPlaying: s.isAudioPlaying, isVoiceSetupLoading: s.isVoiceSetupLoading || k, onStartVoice: w, visualViewportHeight: T });
|
|
4228
|
+
if (!h && (s.messages.length === 0 || k)) {
|
|
4229
|
+
const _ = (e.widget?.behavior?.suggested_messages?.[t] || e.conversation?.suggested_messages?.[t])?.filter((R) => R.trim()) || void 0, x = (R) => {
|
|
4230
|
+
s.sendSuggestion ? E(R) : m?.(R);
|
|
4231
|
+
}, j = o === "text_and_voice" || Ee(e) === "text_and_voice";
|
|
4232
|
+
return /* @__PURE__ */ n(Vn, { agent: e, language: t, languages: i, onLanguageChange: r, onClose: g, onSend: m, isVoiceEnabled: j, isAudioPlaying: s.isAudioPlaying, isVoiceSetupLoading: s.isVoiceSetupLoading || k, onStartVoice: w, visualViewportHeight: T, disabled: k, error: p || void 0, suggestions: _, onSuggestionClick: x, compact: !!_ });
|
|
4005
4233
|
}
|
|
4006
|
-
return /* @__PURE__ */ n(
|
|
4007
|
-
}),
|
|
4008
|
-
function
|
|
4009
|
-
const [i,
|
|
4010
|
-
|
|
4234
|
+
return /* @__PURE__ */ n(jn, { agent: e, language: t, onEndSession: c, messages: C, partialTranscript: Yn(s.partialTranscript), onSend: m, isAudioPlaying: s.isAudioPlaying, isVoiceEnabled: o === "text_and_voice", isListening: s.isVoiceActive, isSpeaking: s.vad.isSpeaking, isLoading: s.vad.isLoading, isAgentThinking: s.isAgentThinking, isAgentSpeaking: s.isAgentSpeaking, onToggleVoice: s.toggleVoice, onStartVoice: s.startVoice, onMinimize: l, elapsed: b, visualViewportHeight: T, waitingForResponse: P });
|
|
4235
|
+
}), Wn = { isListening: !1, isLoading: !1, isSpeaking: !1, toggle: async () => !1 };
|
|
4236
|
+
function fa({ isSessionReady: a, sendTextMessage: e, messages: t }) {
|
|
4237
|
+
const [i, o] = y(null), [s, r] = y(null), c = ie(() => {
|
|
4238
|
+
o((l) => (l && (a ? e(l) : r(l)), null));
|
|
4011
4239
|
}, [a, e]);
|
|
4012
4240
|
return I(() => {
|
|
4013
4241
|
i && t.length !== 0 && c();
|
|
4014
4242
|
}, [t, i, c]), I(() => {
|
|
4015
4243
|
if (!i) return;
|
|
4016
|
-
const
|
|
4017
|
-
return () => clearTimeout(
|
|
4244
|
+
const l = setTimeout(c, 5e3);
|
|
4245
|
+
return () => clearTimeout(l);
|
|
4018
4246
|
}, [i, c]), I(() => {
|
|
4019
|
-
!
|
|
4020
|
-
}, [a,
|
|
4247
|
+
!s || !a || (e(s), r(null));
|
|
4248
|
+
}, [a, s, e]), { pendingWelcomeText: i, pendingMessage: s, setPendingWelcomeText: o, setPendingMessage: r, sendPendingWelcomeText: c };
|
|
4021
4249
|
}
|
|
4022
|
-
function
|
|
4023
|
-
const [t, i] = y(!1), [
|
|
4250
|
+
function Oe({ isSessionReady: a, signalClientReady: e }) {
|
|
4251
|
+
const [t, i] = y(!1), [o, s] = y(void 0), r = B(!1);
|
|
4024
4252
|
return I(() => {
|
|
4025
|
-
!a || r.current || !t || (r.current = !0, e(
|
|
4026
|
-
}, [a, t,
|
|
4027
|
-
a ? (r.current = !0, e(
|
|
4253
|
+
!a || r.current || !t || (r.current = !0, e(o), i(!1));
|
|
4254
|
+
}, [a, t, o, e]), { emitClientReady: ie((l) => {
|
|
4255
|
+
a ? (r.current = !0, e(l)) : (s(l), i(!0));
|
|
4028
4256
|
}, [a, e]) };
|
|
4029
4257
|
}
|
|
4030
|
-
const
|
|
4031
|
-
function
|
|
4032
|
-
const { isPreview: e = !1, ...t } = a, { messages: i, sendTextMessage:
|
|
4258
|
+
const $n = 300;
|
|
4259
|
+
function Zn(a) {
|
|
4260
|
+
const { isPreview: e = !1, ...t } = a, { messages: i, sendTextMessage: o, emitUserMessage: s, addLocalMessage: r, clearMessages: c } = ge(), { changeSessionLanguage: l, clearSessionHistory: d, signalClientReady: m, error: u, isSessionReady: h, isAgentThinking: F, isAgentSpeaking: b } = pe(), M = B(!1), S = B(null), T = B(!1), [k, p] = y(!1), [g, w] = y(null), [E, f] = y(!1), P = B(i.length);
|
|
4033
4261
|
I(() => {
|
|
4034
4262
|
if (i.length > P.current) {
|
|
4035
|
-
const
|
|
4036
|
-
|
|
4263
|
+
const L = i[i.length - 1];
|
|
4264
|
+
L.role === "assistant" && L.streaming && f(!1);
|
|
4037
4265
|
}
|
|
4038
4266
|
P.current = i.length;
|
|
4039
|
-
}, [i]),
|
|
4040
|
-
|
|
4267
|
+
}, [i]), oa("message_rate_limited", ie(() => {
|
|
4268
|
+
f(!1);
|
|
4041
4269
|
}, [])), I(() => {
|
|
4042
|
-
if (!h || !
|
|
4043
|
-
const
|
|
4044
|
-
if (
|
|
4045
|
-
|
|
4046
|
-
const
|
|
4047
|
-
m(
|
|
4270
|
+
if (!h || !k || T.current) return;
|
|
4271
|
+
const L = S.current;
|
|
4272
|
+
if (L === null) return;
|
|
4273
|
+
T.current = !0, S.current = null, r("user", L), w(null);
|
|
4274
|
+
const G = a.agent.welcomeMessages?.[a.language];
|
|
4275
|
+
m(G ? { welcomeMessage: G } : void 0);
|
|
4048
4276
|
const N = setTimeout(() => {
|
|
4049
|
-
|
|
4050
|
-
},
|
|
4277
|
+
s(L), f(!0);
|
|
4278
|
+
}, $n);
|
|
4051
4279
|
return () => clearTimeout(N);
|
|
4052
|
-
}, [h,
|
|
4053
|
-
const
|
|
4054
|
-
|
|
4055
|
-
}, [c]),
|
|
4280
|
+
}, [h, k, m, s, r]);
|
|
4281
|
+
const C = $(() => g ? [{ id: "first-user", role: "user", text: g }, ...i] : i, [g, i]), _ = ie(() => {
|
|
4282
|
+
w(null), c();
|
|
4283
|
+
}, [c]), x = {
|
|
4056
4284
|
emitClientReady: m,
|
|
4057
|
-
sendMessage: (
|
|
4058
|
-
|
|
4285
|
+
sendMessage: (L) => {
|
|
4286
|
+
o(L);
|
|
4059
4287
|
},
|
|
4060
|
-
queueForWelcome:
|
|
4061
|
-
enableVoice:
|
|
4062
|
-
disableVoice:
|
|
4288
|
+
queueForWelcome: oe,
|
|
4289
|
+
enableVoice: oe,
|
|
4290
|
+
disableVoice: oe,
|
|
4063
4291
|
language: a.language,
|
|
4064
4292
|
isSessionReady: h,
|
|
4065
4293
|
supportsVoice: !1,
|
|
4066
4294
|
isVoiceActive: !1,
|
|
4067
4295
|
chatKind: "text"
|
|
4068
|
-
},
|
|
4069
|
-
a.onSessionStart?.(),
|
|
4070
|
-
},
|
|
4071
|
-
a.onTextSend ? a.onTextSend(
|
|
4296
|
+
}, j = (L, G) => {
|
|
4297
|
+
a.onSessionStart?.(), M.current ? (f(!0), G.sendMessage(L)) : (M.current = !0, w(L), S.current = L, p(!0), f(!0));
|
|
4298
|
+
}, R = (L) => {
|
|
4299
|
+
a.onTextSend ? a.onTextSend(L, x) : j(L, x);
|
|
4072
4300
|
};
|
|
4073
4301
|
return /* @__PURE__ */ n(
|
|
4074
|
-
|
|
4302
|
+
Ke,
|
|
4075
4303
|
{
|
|
4076
4304
|
...t,
|
|
4077
4305
|
isPreview: e,
|
|
4078
4306
|
chatKind: "text",
|
|
4079
4307
|
sdk: {
|
|
4080
|
-
messages:
|
|
4081
|
-
sendTextMessage:
|
|
4082
|
-
clearMessages:
|
|
4083
|
-
clearSessionHistory:
|
|
4308
|
+
messages: C,
|
|
4309
|
+
sendTextMessage: R,
|
|
4310
|
+
clearMessages: _,
|
|
4311
|
+
clearSessionHistory: d,
|
|
4084
4312
|
isAudioPlaying: !1,
|
|
4085
4313
|
partialTranscript: null,
|
|
4086
|
-
changeSessionLanguage:
|
|
4314
|
+
changeSessionLanguage: l,
|
|
4087
4315
|
error: u,
|
|
4088
|
-
isAgentThinking:
|
|
4316
|
+
isAgentThinking: F,
|
|
4089
4317
|
isAgentSpeaking: b,
|
|
4090
4318
|
isVoiceSetupLoading: !1,
|
|
4091
4319
|
isVoiceActive: !1,
|
|
4092
4320
|
isSessionReady: h,
|
|
4093
|
-
vad:
|
|
4094
|
-
startVoice:
|
|
4095
|
-
prepareVoice:
|
|
4096
|
-
toggleVoice:
|
|
4321
|
+
vad: Wn,
|
|
4322
|
+
startVoice: oe,
|
|
4323
|
+
prepareVoice: oe,
|
|
4324
|
+
toggleVoice: oe,
|
|
4097
4325
|
signalClientReady: m,
|
|
4098
|
-
waitingForResponse:
|
|
4099
|
-
sendSuggestion:
|
|
4326
|
+
waitingForResponse: E,
|
|
4327
|
+
sendSuggestion: R
|
|
4100
4328
|
}
|
|
4101
4329
|
}
|
|
4102
4330
|
);
|
|
4103
4331
|
}
|
|
4104
|
-
function
|
|
4105
|
-
const { isPreview: e = !1, ...t } = a, { messages: i, sendTextMessage:
|
|
4332
|
+
function Jn(a) {
|
|
4333
|
+
const { isPreview: e = !1, ...t } = a, { messages: i, sendTextMessage: o, clearMessages: s } = ge(), { isAudioPlaying: r, partialTranscript: c } = sa(), { changeSessionLanguage: l, clearSessionHistory: d, signalClientReady: m, error: u, isSessionReady: h, isAgentThinking: F, isAgentSpeaking: b } = pe(), { setPendingWelcomeText: M, setPendingMessage: S } = fa({ isSessionReady: h, sendTextMessage: o, messages: i }), { emitClientReady: T } = Oe({ isSessionReady: h, signalClientReady: m }), [k, p] = y(!1), g = ra({
|
|
4106
4334
|
enabled: !0,
|
|
4107
4335
|
preloadStream: !1
|
|
4108
|
-
}), { isLoading:
|
|
4336
|
+
}), { isLoading: w, isListening: E, toggle: f } = g, P = w, C = E || k;
|
|
4109
4337
|
I(() => {
|
|
4110
|
-
!
|
|
4111
|
-
}, [
|
|
4112
|
-
const
|
|
4338
|
+
!k || !h || w || E || f();
|
|
4339
|
+
}, [k, h, w, E, f]);
|
|
4340
|
+
const _ = () => {
|
|
4113
4341
|
a.onSessionStart?.();
|
|
4114
|
-
},
|
|
4115
|
-
emitClientReady:
|
|
4342
|
+
}, x = {
|
|
4343
|
+
emitClientReady: T,
|
|
4116
4344
|
sendMessage: (N) => {
|
|
4117
|
-
h ?
|
|
4345
|
+
h ? o(N) : S(N);
|
|
4118
4346
|
},
|
|
4119
|
-
queueForWelcome: (N) =>
|
|
4120
|
-
enableVoice: () =>
|
|
4347
|
+
queueForWelcome: (N) => M(N),
|
|
4348
|
+
enableVoice: () => p(!0),
|
|
4121
4349
|
disableVoice: () => {
|
|
4122
|
-
|
|
4350
|
+
p(!1), E && f();
|
|
4123
4351
|
},
|
|
4124
4352
|
language: a.language,
|
|
4125
4353
|
isSessionReady: h,
|
|
4126
4354
|
supportsVoice: !0,
|
|
4127
|
-
isVoiceActive:
|
|
4355
|
+
isVoiceActive: C,
|
|
4128
4356
|
chatKind: "voice"
|
|
4129
|
-
},
|
|
4130
|
-
|
|
4131
|
-
const
|
|
4132
|
-
N.emitClientReady(
|
|
4133
|
-
},
|
|
4357
|
+
}, j = (N) => {
|
|
4358
|
+
_(), N.enableVoice();
|
|
4359
|
+
const Y = a.agent.welcomeMessages?.[a.language];
|
|
4360
|
+
N.emitClientReady(Y ? { welcomeMessage: Y } : void 0);
|
|
4361
|
+
}, R = (N) => {
|
|
4134
4362
|
N.isVoiceActive ? N.disableVoice() : N.enableVoice();
|
|
4135
4363
|
};
|
|
4136
4364
|
return /* @__PURE__ */ n(
|
|
4137
|
-
|
|
4365
|
+
Ke,
|
|
4138
4366
|
{
|
|
4139
4367
|
...t,
|
|
4140
4368
|
isPreview: e,
|
|
@@ -4143,439 +4371,502 @@ function Bn(a) {
|
|
|
4143
4371
|
messages: i,
|
|
4144
4372
|
sendTextMessage: () => {
|
|
4145
4373
|
},
|
|
4146
|
-
clearMessages:
|
|
4147
|
-
clearSessionHistory:
|
|
4374
|
+
clearMessages: s,
|
|
4375
|
+
clearSessionHistory: d,
|
|
4148
4376
|
isAudioPlaying: r,
|
|
4149
4377
|
partialTranscript: c,
|
|
4150
|
-
changeSessionLanguage:
|
|
4378
|
+
changeSessionLanguage: l,
|
|
4151
4379
|
error: u,
|
|
4152
|
-
isAgentThinking:
|
|
4380
|
+
isAgentThinking: F,
|
|
4153
4381
|
isAgentSpeaking: b,
|
|
4154
4382
|
isVoiceSetupLoading: P,
|
|
4155
|
-
isVoiceActive:
|
|
4383
|
+
isVoiceActive: C,
|
|
4156
4384
|
isSessionReady: h,
|
|
4157
|
-
vad:
|
|
4385
|
+
vad: g,
|
|
4158
4386
|
startVoice: () => {
|
|
4159
|
-
a.onVoiceStart ? a.onVoiceStart(
|
|
4387
|
+
a.onVoiceStart ? a.onVoiceStart(x) : j(x);
|
|
4160
4388
|
},
|
|
4161
4389
|
prepareVoice: () => {
|
|
4162
4390
|
},
|
|
4163
4391
|
toggleVoice: () => {
|
|
4164
|
-
a.onVoiceToggle ? a.onVoiceToggle(
|
|
4392
|
+
a.onVoiceToggle ? a.onVoiceToggle(x) : R(x);
|
|
4165
4393
|
},
|
|
4166
4394
|
signalClientReady: m
|
|
4167
4395
|
}
|
|
4168
4396
|
}
|
|
4169
4397
|
);
|
|
4170
4398
|
}
|
|
4171
|
-
const
|
|
4172
|
-
function
|
|
4173
|
-
const { isPreview: e = !1, ...t } = a, { messages: i, sendTextMessage:
|
|
4399
|
+
const Xn = 300;
|
|
4400
|
+
function ei(a) {
|
|
4401
|
+
const { isPreview: e = !1, ...t } = a, { messages: i, sendTextMessage: o, emitUserMessage: s, addLocalMessage: r, clearMessages: c } = ge(), { isAudioPlaying: l, partialTranscript: d } = sa(), { changeSessionLanguage: m, clearSessionHistory: u, signalClientReady: h, error: F, isSessionReady: b, isAgentThinking: M, isAgentSpeaking: S } = pe(), { emitClientReady: T } = Oe({ isSessionReady: b, signalClientReady: h }), [k, p] = y(!1), g = B(null), [w, E] = y(!1), f = B(null), [P, C] = y(!1), _ = B(!1), x = B(!1), j = B(!1), [R, D] = y(null), [L, G] = y(!1), N = B(i.length);
|
|
4174
4402
|
I(() => {
|
|
4175
4403
|
if (i.length > N.current) {
|
|
4176
|
-
const
|
|
4177
|
-
|
|
4404
|
+
const q = i[i.length - 1];
|
|
4405
|
+
q.role === "assistant" && q.streaming && G(!1);
|
|
4178
4406
|
}
|
|
4179
4407
|
N.current = i.length;
|
|
4180
|
-
}, [i]),
|
|
4181
|
-
|
|
4408
|
+
}, [i]), oa("message_rate_limited", ie(() => {
|
|
4409
|
+
G(!1);
|
|
4182
4410
|
}, []));
|
|
4183
|
-
const
|
|
4411
|
+
const Y = ra({
|
|
4184
4412
|
enabled: !0,
|
|
4185
4413
|
preloadStream: !1
|
|
4186
|
-
}), { isLoading: O, isListening:
|
|
4414
|
+
}), { isLoading: O, isListening: U, toggle: J } = Y, X = O, W = U || k;
|
|
4187
4415
|
I(() => {
|
|
4188
|
-
!
|
|
4189
|
-
}, [
|
|
4190
|
-
if (!b || !
|
|
4191
|
-
const
|
|
4192
|
-
if (
|
|
4193
|
-
|
|
4194
|
-
const
|
|
4195
|
-
h(
|
|
4196
|
-
const
|
|
4197
|
-
|
|
4198
|
-
},
|
|
4199
|
-
return () => clearTimeout(
|
|
4200
|
-
}, [b,
|
|
4201
|
-
if (!b || !P ||
|
|
4202
|
-
const
|
|
4203
|
-
|
|
4204
|
-
}, [b, P,
|
|
4205
|
-
const
|
|
4206
|
-
|
|
4207
|
-
}, [c]),
|
|
4416
|
+
!k || !b || O || U || J();
|
|
4417
|
+
}, [k, b, O, U, J]), I(() => {
|
|
4418
|
+
if (!b || !w || j.current) return;
|
|
4419
|
+
const q = g.current;
|
|
4420
|
+
if (q === null) return;
|
|
4421
|
+
j.current = !0, g.current = null, r("user", q), D(null);
|
|
4422
|
+
const ne = a.agent.welcomeMessages?.[a.language];
|
|
4423
|
+
h(ne ? { welcomeMessage: ne } : void 0);
|
|
4424
|
+
const Pe = setTimeout(() => {
|
|
4425
|
+
s(q), G(!0);
|
|
4426
|
+
}, Xn);
|
|
4427
|
+
return () => clearTimeout(Pe);
|
|
4428
|
+
}, [b, w, h, s, r]), I(() => {
|
|
4429
|
+
if (!b || !P || _.current) return;
|
|
4430
|
+
const q = f.current;
|
|
4431
|
+
q !== null && (_.current = !0, f.current = null, r("user", q), s(q), G(!0), C(!1));
|
|
4432
|
+
}, [b, P, s, r]);
|
|
4433
|
+
const ee = $(() => R ? [{ id: "first-user", role: "user", text: R }, ...i] : i, [R, i]), K = ie(() => {
|
|
4434
|
+
D(null), x.current = !1, j.current = !1, c();
|
|
4435
|
+
}, [c]), me = () => {
|
|
4208
4436
|
a.onSessionStart?.();
|
|
4209
|
-
},
|
|
4210
|
-
emitClientReady: (
|
|
4211
|
-
|
|
4437
|
+
}, ae = {
|
|
4438
|
+
emitClientReady: (q) => {
|
|
4439
|
+
j.current = !0, x.current = !0, T(q);
|
|
4212
4440
|
},
|
|
4213
|
-
sendMessage: (
|
|
4214
|
-
|
|
4441
|
+
sendMessage: (q) => {
|
|
4442
|
+
o(q);
|
|
4215
4443
|
},
|
|
4216
4444
|
queueForWelcome: () => {
|
|
4217
4445
|
},
|
|
4218
|
-
enableVoice: () =>
|
|
4446
|
+
enableVoice: () => p(!0),
|
|
4219
4447
|
disableVoice: () => {
|
|
4220
|
-
|
|
4448
|
+
p(!1), U && J();
|
|
4221
4449
|
},
|
|
4222
4450
|
language: a.language,
|
|
4223
4451
|
isSessionReady: b,
|
|
4224
4452
|
supportsVoice: !0,
|
|
4225
|
-
isVoiceActive:
|
|
4453
|
+
isVoiceActive: W,
|
|
4226
4454
|
chatKind: "text_and_voice"
|
|
4227
|
-
},
|
|
4228
|
-
|
|
4229
|
-
}, ce = (
|
|
4230
|
-
|
|
4231
|
-
const
|
|
4232
|
-
|
|
4233
|
-
},
|
|
4234
|
-
|
|
4235
|
-
},
|
|
4236
|
-
messages:
|
|
4237
|
-
sendTextMessage: (
|
|
4238
|
-
a.onTextSend ? a.onTextSend(
|
|
4455
|
+
}, le = (q, ne) => {
|
|
4456
|
+
me(), !x.current && !j.current ? (x.current = !0, a.onStartText?.(), D(q), g.current = q, E(!0), G(!0)) : (x.current = !0, G(!0), ne.sendMessage(q));
|
|
4457
|
+
}, ce = (q) => {
|
|
4458
|
+
me(), x.current = !0, j.current = !0, a.onStartVoice?.(), q.enableVoice();
|
|
4459
|
+
const ne = a.agent.welcomeMessages?.[a.language];
|
|
4460
|
+
q.emitClientReady(ne ? { welcomeMessage: ne } : void 0);
|
|
4461
|
+
}, he = (q) => {
|
|
4462
|
+
q.isVoiceActive ? q.disableVoice() : q.enableVoice();
|
|
4463
|
+
}, we = {
|
|
4464
|
+
messages: ee,
|
|
4465
|
+
sendTextMessage: (q) => {
|
|
4466
|
+
a.onTextSend ? a.onTextSend(q, ae) : le(q, ae);
|
|
4239
4467
|
},
|
|
4240
|
-
clearMessages:
|
|
4468
|
+
clearMessages: K,
|
|
4241
4469
|
clearSessionHistory: u,
|
|
4242
|
-
isAudioPlaying:
|
|
4243
|
-
partialTranscript:
|
|
4470
|
+
isAudioPlaying: l,
|
|
4471
|
+
partialTranscript: d,
|
|
4244
4472
|
changeSessionLanguage: m,
|
|
4245
|
-
error:
|
|
4246
|
-
isAgentThinking:
|
|
4247
|
-
isAgentSpeaking:
|
|
4248
|
-
isVoiceSetupLoading:
|
|
4249
|
-
isVoiceActive:
|
|
4473
|
+
error: F,
|
|
4474
|
+
isAgentThinking: M,
|
|
4475
|
+
isAgentSpeaking: S,
|
|
4476
|
+
isVoiceSetupLoading: X,
|
|
4477
|
+
isVoiceActive: W,
|
|
4250
4478
|
isSessionReady: b,
|
|
4251
|
-
vad:
|
|
4479
|
+
vad: Y,
|
|
4252
4480
|
startVoice: () => {
|
|
4253
|
-
a.onVoiceStart ? a.onVoiceStart(
|
|
4481
|
+
a.onVoiceStart ? a.onVoiceStart(ae) : ce(ae);
|
|
4254
4482
|
},
|
|
4255
4483
|
prepareVoice: () => {
|
|
4256
4484
|
},
|
|
4257
4485
|
toggleVoice: () => {
|
|
4258
|
-
a.onVoiceToggle ? a.onVoiceToggle(
|
|
4486
|
+
a.onVoiceToggle ? a.onVoiceToggle(ae) : he(ae);
|
|
4259
4487
|
},
|
|
4260
4488
|
signalClientReady: h,
|
|
4261
|
-
waitingForResponse:
|
|
4262
|
-
sendSuggestion: (
|
|
4263
|
-
|
|
4489
|
+
waitingForResponse: L,
|
|
4490
|
+
sendSuggestion: (q) => {
|
|
4491
|
+
me(), x.current = !0, j.current = !0, a.onStartVoice?.(), p(!0), f.current = q, C(!0);
|
|
4264
4492
|
}
|
|
4265
4493
|
};
|
|
4266
4494
|
return /* @__PURE__ */ n(
|
|
4267
|
-
|
|
4495
|
+
Ke,
|
|
4268
4496
|
{
|
|
4269
4497
|
...t,
|
|
4270
4498
|
isPreview: e,
|
|
4271
4499
|
chatKind: a.textOnly ? "text" : "text_and_voice",
|
|
4272
|
-
sdk:
|
|
4500
|
+
sdk: we
|
|
4273
4501
|
}
|
|
4274
4502
|
);
|
|
4275
4503
|
}
|
|
4276
|
-
function
|
|
4277
|
-
const { isPreview: e = !1, agent: t, language: i, languages:
|
|
4278
|
-
return
|
|
4504
|
+
function ai(a) {
|
|
4505
|
+
const { isPreview: e = !1, agent: t, language: i, languages: o, onLanguageChange: s, onEndSession: r, onMinimize: c, messages: l, onSendMessage: d } = a, m = r || c || oe, { messages: u, sendTextMessage: h, clearMessages: F } = ge(), { changeSessionLanguage: b, clearSessionHistory: M, signalClientReady: S, error: T, isSessionReady: k, isAgentThinking: p, isAgentSpeaking: g } = pe();
|
|
4506
|
+
return fa({ isSessionReady: k, sendTextMessage: h, messages: u }), Oe({ isSessionReady: k, signalClientReady: S }), T && !e ? /* @__PURE__ */ n(ha, { message: T, language: i, onClose: m }) : /* @__PURE__ */ n(ba, { agent: t, language: i, onClose: m });
|
|
4279
4507
|
}
|
|
4280
|
-
function
|
|
4281
|
-
const [
|
|
4282
|
-
|
|
4508
|
+
function ci({ agent: a, defaultOpen: e, className: t = "", preview: i = !1, ChatBoxComponent: o }) {
|
|
4509
|
+
const s = e !== void 0 ? e : a.widget?.behavior?.default_open ?? !1, [r, c] = A.useState(s), [l, d] = A.useState(a.defaultLanguage), m = $(() => ye(a.languages, a.defaultLanguage), [a.defaultLanguage, a.languages]);
|
|
4510
|
+
A.useEffect(() => {
|
|
4283
4511
|
d(a.defaultLanguage);
|
|
4284
|
-
}, [a.defaultLanguage]),
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4512
|
+
}, [a.defaultLanguage]), A.useEffect(() => {
|
|
4513
|
+
c(s);
|
|
4514
|
+
}, [s]);
|
|
4515
|
+
const u = a.widget?.appearance?.theme?.mode === "light" ? "light" : "dark", h = $(() => Re(a.widget?.appearance), [a.widget?.appearance]);
|
|
4516
|
+
return /* @__PURE__ */ v(
|
|
4517
|
+
"div",
|
|
4518
|
+
{
|
|
4519
|
+
className: V("rqmii-chat-surface", `rqmii-theme-${u}`, i && "is-preview", t),
|
|
4520
|
+
"data-theme": u,
|
|
4521
|
+
style: h,
|
|
4522
|
+
children: [
|
|
4523
|
+
!r && /* @__PURE__ */ n(ma, { agent: a, onClick: () => c(!0), position: i ? "static" : "fixed" }),
|
|
4524
|
+
r && /* @__PURE__ */ n(o, { agent: a, language: l, languages: m, onLanguageChange: d, onClose: () => c(!1), isPreview: i })
|
|
4525
|
+
]
|
|
4526
|
+
}
|
|
4527
|
+
);
|
|
4288
4528
|
}
|
|
4289
|
-
function
|
|
4290
|
-
const [r, c] = y(() => t ?
|
|
4529
|
+
function ti({ restUrl: a, identifier: e, fallbackAgent: t, withCredentials: i = !1, children: o, onError: s }) {
|
|
4530
|
+
const [r, c] = y(() => t ? ve(t) : null), [l, d] = y(null);
|
|
4291
4531
|
return I(() => {
|
|
4292
|
-
t && (c(
|
|
4532
|
+
t && (c(ve(t)), d(null));
|
|
4293
4533
|
}, [t]), I(() => {
|
|
4294
4534
|
if (!e || t) return;
|
|
4295
4535
|
const m = new AbortController();
|
|
4296
|
-
return
|
|
4297
|
-
m.signal.aborted || (
|
|
4536
|
+
return d(null), It({ restUrl: a, identifier: e, withCredentials: i, signal: m.signal }).then(c).catch((u) => {
|
|
4537
|
+
m.signal.aborted || (t || d(u), s?.(u));
|
|
4298
4538
|
}), () => m.abort();
|
|
4299
|
-
}, [t, e,
|
|
4539
|
+
}, [t, e, s, a, i]), l ? /* @__PURE__ */ n("div", { className: "rqmii-chat-panel rqmii-chat-panel--error", children: l.message || "Could not load agent" }) : r ? /* @__PURE__ */ n(Te, { children: o(r) }) : /* @__PURE__ */ n("div", { className: "rqmii-chat-panel rqmii-chat-panel--error", children: "Loading" });
|
|
4300
4540
|
}
|
|
4301
|
-
function
|
|
4302
|
-
const
|
|
4303
|
-
switch (
|
|
4541
|
+
function Ie({ agent: a, language: e, languages: t, onLanguageChange: i, onEndSession: o, onMinimize: s, onStartText: r, onStartVoice: c, textOnly: l, messages: d, onSendMessage: m, isPreview: u, onSessionStart: h, initialText: F, autoStartVoice: b }) {
|
|
4542
|
+
const M = Ee(a), S = { agent: a, language: e, languages: t, onLanguageChange: i, onEndSession: o, onMinimize: s, messages: d, onSendMessage: m, isPreview: u, onSessionStart: h, initialText: F, autoStartVoice: b };
|
|
4543
|
+
switch (M) {
|
|
4304
4544
|
case "avatar":
|
|
4305
|
-
return /* @__PURE__ */ n(
|
|
4545
|
+
return /* @__PURE__ */ n(ai, { ...S });
|
|
4306
4546
|
case "voice":
|
|
4307
|
-
return /* @__PURE__ */ n(
|
|
4547
|
+
return /* @__PURE__ */ n(Jn, { ...S });
|
|
4308
4548
|
case "text_and_voice":
|
|
4309
|
-
return /* @__PURE__ */ n(
|
|
4549
|
+
return /* @__PURE__ */ n(ei, { ...S, onStartText: r, onStartVoice: c, textOnly: l });
|
|
4310
4550
|
case "text":
|
|
4311
4551
|
default:
|
|
4312
|
-
return /* @__PURE__ */ n(
|
|
4552
|
+
return /* @__PURE__ */ n(Zn, { ...S });
|
|
4313
4553
|
}
|
|
4314
4554
|
}
|
|
4315
|
-
function
|
|
4555
|
+
function ni({
|
|
4316
4556
|
agent: a,
|
|
4317
4557
|
language: e,
|
|
4318
4558
|
languages: t,
|
|
4319
4559
|
startMode: i,
|
|
4320
|
-
directive:
|
|
4321
|
-
open:
|
|
4560
|
+
directive: o,
|
|
4561
|
+
open: s,
|
|
4322
4562
|
onOpen: r,
|
|
4323
4563
|
onLanguageChange: c,
|
|
4324
|
-
onMinimize:
|
|
4325
|
-
onStartNewSession:
|
|
4564
|
+
onMinimize: l,
|
|
4565
|
+
onStartNewSession: d,
|
|
4326
4566
|
onSessionStart: m,
|
|
4327
4567
|
onStartText: u,
|
|
4328
4568
|
onStartVoice: h
|
|
4329
4569
|
}) {
|
|
4330
|
-
const { connectionState:
|
|
4570
|
+
const { connectionState: F, isConnected: b, isSessionTerminated: M, creditExhausted: S, session: T, endSession: k, submitFeedback: p, interrupt: g } = pe(), { messages: w } = ge(), E = B(!1), f = B(null), [P, C] = y(null), [_, x] = y(0), [j, R] = y(!1), [D, L] = y(!1), [G, N] = y(!1);
|
|
4331
4571
|
I(() => {
|
|
4332
|
-
b && (
|
|
4572
|
+
b && (E.current = !0);
|
|
4333
4573
|
}, [b]), I(() => {
|
|
4334
4574
|
if (P) return;
|
|
4335
|
-
let
|
|
4336
|
-
|
|
4337
|
-
sessionId:
|
|
4338
|
-
endedBy:
|
|
4339
|
-
reason:
|
|
4575
|
+
let K = null;
|
|
4576
|
+
M || F === "ended" ? K = f.current === "user" ? "user_ended" : "terminated" : F === "failed" ? S ? K = "credits_exhausted" : E.current ? K = "connection_lost" : K = "failed" : S && (K = "credits_exhausted"), K && C({
|
|
4577
|
+
sessionId: T.sessionId,
|
|
4578
|
+
endedBy: f.current ?? "agent",
|
|
4579
|
+
reason: K
|
|
4340
4580
|
});
|
|
4341
|
-
}, [
|
|
4342
|
-
const
|
|
4343
|
-
|
|
4344
|
-
}, O = P?.sessionId ?? null,
|
|
4345
|
-
|
|
4346
|
-
}),
|
|
4347
|
-
},
|
|
4581
|
+
}, [M, F, S, T.sessionId, P]);
|
|
4582
|
+
const Y = () => {
|
|
4583
|
+
f.current = "user", g(), k();
|
|
4584
|
+
}, O = P?.sessionId ?? null, U = (K) => {
|
|
4585
|
+
j || (x(K), O && p({ sessionId: O, rating: K, endedBy: P?.endedBy }).catch(() => {
|
|
4586
|
+
}), G || (N(!0), L(!0)));
|
|
4587
|
+
}, J = async (K) => {
|
|
4348
4588
|
if (O)
|
|
4349
4589
|
try {
|
|
4350
|
-
await
|
|
4590
|
+
await p({ sessionId: O, feedback: K, endedBy: P?.endedBy });
|
|
4351
4591
|
} catch {
|
|
4352
4592
|
}
|
|
4353
|
-
|
|
4593
|
+
R(!0), L(!1);
|
|
4354
4594
|
};
|
|
4355
|
-
if (!
|
|
4356
|
-
return /* @__PURE__ */ n(
|
|
4357
|
-
const
|
|
4358
|
-
return
|
|
4359
|
-
|
|
4595
|
+
if (!s)
|
|
4596
|
+
return /* @__PURE__ */ n(ma, { agent: a, onClick: r, active: F === "connected" });
|
|
4597
|
+
const X = Ee(a), W = a.agentType === "cloud_avatar" || a.agentType === "desktop_avatar", ee = i === "text";
|
|
4598
|
+
return W ? /* @__PURE__ */ n(
|
|
4599
|
+
Ie,
|
|
4360
4600
|
{
|
|
4361
4601
|
agent: a,
|
|
4362
4602
|
language: e,
|
|
4363
4603
|
languages: t,
|
|
4364
4604
|
onLanguageChange: c,
|
|
4365
|
-
onEndSession:
|
|
4366
|
-
onMinimize:
|
|
4605
|
+
onEndSession: Y,
|
|
4606
|
+
onMinimize: l,
|
|
4367
4607
|
onSessionStart: m,
|
|
4368
4608
|
onStartText: u,
|
|
4369
4609
|
onStartVoice: h,
|
|
4370
|
-
textOnly:
|
|
4610
|
+
textOnly: ee
|
|
4371
4611
|
}
|
|
4372
|
-
) : P ?
|
|
4373
|
-
|
|
4612
|
+
) : P ? D && O ? /* @__PURE__ */ n(
|
|
4613
|
+
qn,
|
|
4374
4614
|
{
|
|
4375
4615
|
agent: a,
|
|
4376
4616
|
language: e,
|
|
4377
|
-
rating:
|
|
4378
|
-
onBack: () =>
|
|
4379
|
-
onMinimize:
|
|
4380
|
-
onSubmit:
|
|
4617
|
+
rating: _,
|
|
4618
|
+
onBack: () => L(!1),
|
|
4619
|
+
onMinimize: l,
|
|
4620
|
+
onSubmit: J
|
|
4381
4621
|
}
|
|
4382
4622
|
) : /* @__PURE__ */ n(
|
|
4383
|
-
|
|
4623
|
+
Bn,
|
|
4384
4624
|
{
|
|
4385
4625
|
agent: a,
|
|
4386
4626
|
language: e,
|
|
4387
4627
|
languages: t,
|
|
4388
|
-
chatKind:
|
|
4389
|
-
messages:
|
|
4628
|
+
chatKind: X === "avatar" ? "text" : X,
|
|
4629
|
+
messages: w,
|
|
4390
4630
|
onLanguageChange: c,
|
|
4391
|
-
onMinimize:
|
|
4392
|
-
onStartNewVoice: () =>
|
|
4393
|
-
onStartNewText: (
|
|
4394
|
-
rating:
|
|
4631
|
+
onMinimize: l,
|
|
4632
|
+
onStartNewVoice: () => d("voice"),
|
|
4633
|
+
onStartNewText: (K) => d("text", K),
|
|
4634
|
+
rating: _,
|
|
4395
4635
|
endedBy: P.endedBy,
|
|
4396
4636
|
sessionId: O,
|
|
4397
|
-
ratingInteractive: !
|
|
4398
|
-
showTellUsMore:
|
|
4399
|
-
onRate:
|
|
4400
|
-
onTellUsMore: () =>
|
|
4637
|
+
ratingInteractive: !j,
|
|
4638
|
+
showTellUsMore: G && !j,
|
|
4639
|
+
onRate: U,
|
|
4640
|
+
onTellUsMore: () => L(!0)
|
|
4401
4641
|
}
|
|
4402
4642
|
) : /* @__PURE__ */ n(
|
|
4403
|
-
|
|
4643
|
+
Ie,
|
|
4404
4644
|
{
|
|
4405
4645
|
agent: a,
|
|
4406
4646
|
language: e,
|
|
4407
4647
|
languages: t,
|
|
4408
4648
|
onLanguageChange: c,
|
|
4409
|
-
onEndSession:
|
|
4410
|
-
onMinimize:
|
|
4649
|
+
onEndSession: Y,
|
|
4650
|
+
onMinimize: l,
|
|
4411
4651
|
onSessionStart: m,
|
|
4412
4652
|
onStartText: u,
|
|
4413
4653
|
onStartVoice: h,
|
|
4414
|
-
textOnly:
|
|
4415
|
-
initialText:
|
|
4416
|
-
autoStartVoice:
|
|
4654
|
+
textOnly: ee,
|
|
4655
|
+
initialText: o?.mode === "text" ? o.text : void 0,
|
|
4656
|
+
autoStartVoice: o?.mode === "voice"
|
|
4417
4657
|
}
|
|
4418
4658
|
);
|
|
4419
4659
|
}
|
|
4420
|
-
function
|
|
4421
|
-
|
|
4660
|
+
function di(a) {
|
|
4661
|
+
const {
|
|
4662
|
+
wsUrl: e,
|
|
4663
|
+
restUrl: t,
|
|
4664
|
+
apiKey: i,
|
|
4665
|
+
agentId: o,
|
|
4666
|
+
agent: s,
|
|
4667
|
+
language: r,
|
|
4668
|
+
defaultOpen: c,
|
|
4669
|
+
open: l,
|
|
4670
|
+
className: d = "",
|
|
4671
|
+
debug: m = !1,
|
|
4672
|
+
withCredentials: u = !1,
|
|
4673
|
+
onError: h,
|
|
4674
|
+
onInitialized: F,
|
|
4675
|
+
config: b,
|
|
4676
|
+
promptOverrides: M,
|
|
4677
|
+
clientTools: S,
|
|
4678
|
+
onMinimize: T,
|
|
4679
|
+
onOpen: k
|
|
4680
|
+
} = a;
|
|
4681
|
+
if ([!!i, !!o].filter(Boolean).length > 1)
|
|
4422
4682
|
throw new Error("RqmiiAgentChat: only one of apiKey, or agentId may be provided");
|
|
4423
|
-
return /* @__PURE__ */ n(
|
|
4424
|
-
|
|
4683
|
+
return /* @__PURE__ */ n(ti, { restUrl: t, identifier: i || o, fallbackAgent: s, withCredentials: u, onError: h, children: (w) => /* @__PURE__ */ n(
|
|
4684
|
+
ii,
|
|
4425
4685
|
{
|
|
4426
|
-
wsUrl:
|
|
4427
|
-
restUrl:
|
|
4428
|
-
apiKey:
|
|
4429
|
-
agentId:
|
|
4430
|
-
agent:
|
|
4431
|
-
language:
|
|
4432
|
-
defaultOpen:
|
|
4433
|
-
open:
|
|
4686
|
+
wsUrl: e,
|
|
4687
|
+
restUrl: t,
|
|
4688
|
+
apiKey: i,
|
|
4689
|
+
agentId: o,
|
|
4690
|
+
agent: w,
|
|
4691
|
+
language: r,
|
|
4692
|
+
defaultOpen: c,
|
|
4693
|
+
open: l,
|
|
4434
4694
|
className: d,
|
|
4435
|
-
pcmOptions: l,
|
|
4436
4695
|
debug: m,
|
|
4437
4696
|
withCredentials: u,
|
|
4438
4697
|
onError: h,
|
|
4439
|
-
onInitialized:
|
|
4698
|
+
onInitialized: F,
|
|
4440
4699
|
config: b,
|
|
4441
|
-
promptOverrides:
|
|
4442
|
-
clientTools:
|
|
4443
|
-
onMinimize:
|
|
4444
|
-
onOpen:
|
|
4700
|
+
promptOverrides: M,
|
|
4701
|
+
clientTools: S,
|
|
4702
|
+
onMinimize: T,
|
|
4703
|
+
onOpen: k
|
|
4445
4704
|
}
|
|
4446
4705
|
) });
|
|
4447
4706
|
}
|
|
4448
|
-
function
|
|
4449
|
-
const
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4707
|
+
function ii({ wsUrl: a, restUrl: e, apiKey: t, agentId: i, agent: o, language: s, defaultOpen: r, open: c, className: l, debug: d, withCredentials: m, onError: u, onInitialized: h, config: F, promptOverrides: b, clientTools: M, onMinimize: S, onOpen: T }) {
|
|
4708
|
+
const k = r !== void 0 ? r : o.widget?.behavior?.default_open ?? !1, [p, g] = y(k), w = c !== void 0 ? c : p;
|
|
4709
|
+
I(() => {
|
|
4710
|
+
c === void 0 && g(k);
|
|
4711
|
+
}, [k, c]);
|
|
4712
|
+
const [E, f] = y(!1), [P, C] = y(s || o.defaultLanguage), [_, x] = y("idle"), [j, R] = y(0), [D, L] = y(null), [G, N] = y(!1), Y = o.agentType === "cloud_avatar" || o.agentType === "desktop_avatar", O = Y, U = o.widget?.behavior?.welcome_bubble, J = o.welcomeMessages?.[P] || "", X = !w && !G && !O && !!U?.enabled && !!J.trim(), W = $(() => ye(o.languages, o.defaultLanguage), [o.defaultLanguage, o.languages]);
|
|
4713
|
+
I(() => {
|
|
4714
|
+
ua(o.widget?.appearance?.font);
|
|
4715
|
+
}, [o.widget?.appearance?.font]);
|
|
4716
|
+
const ee = $(() => _ === "text" ? { ...F ?? {}, use_voice: !1, use_text: !0 } : F, [F, _]), K = $(
|
|
4717
|
+
() => Vt(o, ee),
|
|
4718
|
+
[o, ee]
|
|
4719
|
+
), me = !O && K.useVoice, ae = Y ? w : E, le = $(() => ({
|
|
4453
4720
|
...t ? { apiKey: t } : {},
|
|
4454
4721
|
...i ? { agentId: i } : {},
|
|
4455
4722
|
language: P,
|
|
4456
|
-
config:
|
|
4457
|
-
...
|
|
4458
|
-
}), [i, t, P,
|
|
4459
|
-
|
|
4460
|
-
const
|
|
4723
|
+
config: ee,
|
|
4724
|
+
...b ? { promptOverrides: b } : {}
|
|
4725
|
+
}), [i, t, P, ee, b]), ce = B(null), he = B(!1), Q = B(j), be = Q.current !== j;
|
|
4726
|
+
Q.current = j, E && (!he.current || be) && (ce.current = le), he.current = E, E || (ce.current = null);
|
|
4727
|
+
const Ye = E && ce.current ? ce.current : le;
|
|
4461
4728
|
I(() => {
|
|
4462
|
-
|
|
4463
|
-
}, [
|
|
4464
|
-
const
|
|
4465
|
-
|
|
4466
|
-
} : (
|
|
4467
|
-
|
|
4468
|
-
}, [
|
|
4469
|
-
|
|
4470
|
-
},
|
|
4471
|
-
|
|
4472
|
-
},
|
|
4473
|
-
c === void 0 &&
|
|
4474
|
-
},
|
|
4475
|
-
c === void 0 &&
|
|
4476
|
-
},
|
|
4477
|
-
|
|
4478
|
-
};
|
|
4729
|
+
C(s || o.defaultLanguage);
|
|
4730
|
+
}, [o.defaultLanguage, s]);
|
|
4731
|
+
const we = $(() => u ? (fe) => {
|
|
4732
|
+
x("idle"), u(fe);
|
|
4733
|
+
} : (fe) => {
|
|
4734
|
+
x("idle");
|
|
4735
|
+
}, [u]), q = () => {
|
|
4736
|
+
x("text"), f(!0);
|
|
4737
|
+
}, ne = () => {
|
|
4738
|
+
x("voice"), f(!0);
|
|
4739
|
+
}, Pe = () => {
|
|
4740
|
+
c === void 0 && g(!1), S?.();
|
|
4741
|
+
}, ka = () => {
|
|
4742
|
+
c === void 0 && g(!0), N(!0), T?.();
|
|
4743
|
+
}, va = (fe, Fa) => {
|
|
4744
|
+
L(fe === "text" ? { mode: "text", text: Fa ?? "" } : { mode: "voice" }), x(fe), f(!0), R((Ta) => Ta + 1);
|
|
4745
|
+
}, Qe = o.widget?.appearance?.theme?.mode === "light" ? "light" : "dark", ya = $(() => Re(o.widget?.appearance), [o.widget?.appearance]);
|
|
4479
4746
|
return /* @__PURE__ */ n(
|
|
4480
|
-
|
|
4747
|
+
Sa,
|
|
4481
4748
|
{
|
|
4482
4749
|
wsUrl: a,
|
|
4483
4750
|
restUrl: e,
|
|
4484
|
-
session:
|
|
4485
|
-
connect:
|
|
4486
|
-
enableAudio:
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4751
|
+
session: Ye,
|
|
4752
|
+
connect: ae,
|
|
4753
|
+
enableAudio: me,
|
|
4754
|
+
debug: d,
|
|
4755
|
+
withCredentials: m,
|
|
4756
|
+
onError: we,
|
|
4757
|
+
onInitialized: h,
|
|
4758
|
+
clientTools: M,
|
|
4759
|
+
children: /* @__PURE__ */ v(
|
|
4760
|
+
"div",
|
|
4761
|
+
{
|
|
4762
|
+
className: V(
|
|
4763
|
+
"rqmii-chat-surface",
|
|
4764
|
+
`rqmii-theme-${Qe}`,
|
|
4765
|
+
o.widget?.appearance?.position === "left" && "rqmii-position-left",
|
|
4766
|
+
l
|
|
4767
|
+
),
|
|
4768
|
+
"data-theme": Qe,
|
|
4769
|
+
style: ya,
|
|
4770
|
+
dir: "ltr",
|
|
4771
|
+
children: [
|
|
4772
|
+
X && /* @__PURE__ */ n(
|
|
4773
|
+
kn,
|
|
4774
|
+
{
|
|
4775
|
+
message: J,
|
|
4776
|
+
delaySeconds: U?.delay_seconds ?? 3,
|
|
4777
|
+
soundEnabled: !!U?.sound_enabled,
|
|
4778
|
+
language: P,
|
|
4779
|
+
buttonPosition: o.widget?.appearance?.position === "left" ? "left" : "right",
|
|
4780
|
+
onClick: () => N(!0)
|
|
4781
|
+
}
|
|
4782
|
+
),
|
|
4783
|
+
/* @__PURE__ */ n(
|
|
4784
|
+
ni,
|
|
4785
|
+
{
|
|
4786
|
+
agent: o,
|
|
4787
|
+
language: P,
|
|
4788
|
+
languages: W,
|
|
4789
|
+
startMode: _,
|
|
4790
|
+
directive: D,
|
|
4791
|
+
open: w,
|
|
4792
|
+
onOpen: ka,
|
|
4793
|
+
onLanguageChange: C,
|
|
4794
|
+
onMinimize: Pe,
|
|
4795
|
+
onStartNewSession: va,
|
|
4796
|
+
onSessionStart: () => f(!0),
|
|
4797
|
+
onStartText: q,
|
|
4798
|
+
onStartVoice: ne
|
|
4799
|
+
}
|
|
4800
|
+
)
|
|
4801
|
+
]
|
|
4802
|
+
}
|
|
4803
|
+
)
|
|
4524
4804
|
},
|
|
4525
|
-
|
|
4805
|
+
j
|
|
4526
4806
|
);
|
|
4527
4807
|
}
|
|
4528
|
-
function
|
|
4529
|
-
const c =
|
|
4808
|
+
function ui(a) {
|
|
4809
|
+
const { agent: e, language: t, open: i = !0, className: o = "", messages: s, onSendMessage: r, onClose: c } = a, l = $(() => ve(e), [e]), [d, m] = y(i), [u, h] = y(t || l.defaultLanguage), F = $(() => ye(l.languages, l.defaultLanguage), [l.defaultLanguage, l.languages]), b = l.widget?.appearance?.theme?.mode === "light" ? "light" : "dark", M = $(() => Re(l.widget?.appearance), [l.widget?.appearance]);
|
|
4530
4810
|
return I(() => {
|
|
4531
|
-
|
|
4532
|
-
}, [
|
|
4533
|
-
|
|
4534
|
-
}, [
|
|
4535
|
-
|
|
4811
|
+
t && h(t);
|
|
4812
|
+
}, [t]), I(() => {
|
|
4813
|
+
m(i);
|
|
4814
|
+
}, [i]), I(() => {
|
|
4815
|
+
ua(l.widget?.appearance?.font);
|
|
4816
|
+
}, [l.widget?.appearance?.font]), /* @__PURE__ */ n(za, { wsUrl: "", restUrl: "", enableAudio: !1, children: /* @__PURE__ */ n(
|
|
4817
|
+
"div",
|
|
4536
4818
|
{
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4819
|
+
className: V("rqmii-chat-surface is-preview", `rqmii-theme-${b}`, o),
|
|
4820
|
+
"data-theme": b,
|
|
4821
|
+
style: M,
|
|
4822
|
+
dir: "ltr",
|
|
4823
|
+
children: d ? /* @__PURE__ */ n(
|
|
4824
|
+
Ie,
|
|
4825
|
+
{
|
|
4826
|
+
agent: l,
|
|
4827
|
+
language: u,
|
|
4828
|
+
languages: F,
|
|
4829
|
+
onLanguageChange: h,
|
|
4830
|
+
onEndSession: () => {
|
|
4831
|
+
m(!1), c?.();
|
|
4832
|
+
},
|
|
4833
|
+
onMinimize: () => {
|
|
4834
|
+
m(!1), c?.();
|
|
4835
|
+
},
|
|
4836
|
+
messages: s,
|
|
4837
|
+
onSendMessage: r,
|
|
4838
|
+
isPreview: !0
|
|
4839
|
+
}
|
|
4840
|
+
) : null
|
|
4550
4841
|
}
|
|
4551
|
-
)
|
|
4842
|
+
) });
|
|
4552
4843
|
}
|
|
4553
4844
|
export {
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4845
|
+
On as ConsentDialog,
|
|
4846
|
+
Bn as EndedChatPanel,
|
|
4847
|
+
gi as EpicPixelStreamingPlayer,
|
|
4848
|
+
qn as FeedbackPanel,
|
|
4849
|
+
Ae as RQMII_CHAT_LANGUAGES,
|
|
4850
|
+
Ze as RQMII_CHAT_LANGUAGE_VALUES,
|
|
4851
|
+
_n as RatingBar,
|
|
4852
|
+
te as RqmiiAgentAvatar,
|
|
4853
|
+
di as RqmiiAgentChat,
|
|
4854
|
+
ui as RqmiiAgentChatPreview,
|
|
4855
|
+
Sa as RqmiiAgentRoom,
|
|
4856
|
+
ai as RqmiiAvatarChatBox,
|
|
4857
|
+
ue as RqmiiChatFooter,
|
|
4858
|
+
ma as RqmiiChatOpenButton,
|
|
4859
|
+
ci as RqmiiChatSurface,
|
|
4860
|
+
pi as RqmiiCloudAvatarPlayer,
|
|
4861
|
+
ei as RqmiiTextAndVoiceChatBox,
|
|
4862
|
+
Zn as RqmiiTextChatBox,
|
|
4863
|
+
Jn as RqmiiVoiceChatBox,
|
|
4864
|
+
li as fetchAgentConfig,
|
|
4865
|
+
It as fetchAgentCustomization,
|
|
4866
|
+
Je as getChatLanguage,
|
|
4867
|
+
z as getChatText,
|
|
4868
|
+
ye as normalizeChatLanguages,
|
|
4869
|
+
ve as normalizePublicAgent,
|
|
4870
|
+
Ee as resolveChatKind
|
|
4580
4871
|
};
|
|
4581
4872
|
//# sourceMappingURL=ui.js.map
|