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