@flowengage/react-chatbot 8.0.139 → 8.0.141
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.
|
@@ -9645,7 +9645,7 @@ async function cg(e) {
|
|
|
9645
9645
|
type: "VisitorSpeech",
|
|
9646
9646
|
active: u
|
|
9647
9647
|
}))), a ? ve = !1 : !ve && ae >= Kh ? (ve = !0, l?.({ mode: "user-speaking" })) : ve && ae === 0 && (ve = !1), a && !oe && !ue && ae >= c) {
|
|
9648
|
-
oe = !0, re = !1
|
|
9648
|
+
oe = !0, re = !1;
|
|
9649
9649
|
let e = pe.playedMs();
|
|
9650
9650
|
pe.stop(), ie = !1, se = !1, le && !ue && (clearTimeout(le), le = null), de = !1, E.send(JSON.stringify({
|
|
9651
9651
|
type: "VisitorInterrupted",
|
|
@@ -9722,7 +9722,7 @@ async function cg(e) {
|
|
|
9722
9722
|
ne && !oe && console.log(`[FlowEngage] interrupted by the server, not the widget: loudest speech ${F.toFixed(3)} (needs ${P}), longest run ${ce} frames, echo cancellation ${me ? "on" : "off"}, speech model ${I ? "on" : "off"}`), A(), pe.stop(), se = !1, ie = !1, ne = !1, re = !1, le && !ue && (clearTimeout(le), le = null), de = !1, l?.({ mode: "listening" });
|
|
9723
9723
|
break;
|
|
9724
9724
|
case "AgentStartedSpeaking":
|
|
9725
|
-
ie = !0, ne = !0, oe = !1,
|
|
9725
|
+
ie = !0, ne = !0, oe = !1, F = 0, ce = 0, l?.({ mode: "speaking" });
|
|
9726
9726
|
break;
|
|
9727
9727
|
case "AgentAudioDone":
|
|
9728
9728
|
se = !1, A(), fe(), pe.isPlaying() || (ne = !1, l?.({ mode: re ? "thinking" : "listening" }));
|
|
@@ -12875,10 +12875,10 @@ function Q_(e, t) {
|
|
|
12875
12875
|
}
|
|
12876
12876
|
function $_(e, t, n = 6) {
|
|
12877
12877
|
let r = String(t || "").toLowerCase().trim();
|
|
12878
|
-
if (!r) return
|
|
12878
|
+
if (!r) return Infinity;
|
|
12879
12879
|
let i = e;
|
|
12880
|
-
for (let e = 0; e
|
|
12881
|
-
return
|
|
12880
|
+
for (let e = 0; e <= n && i; e++, i = i.parentElement) if ((i.innerText || i.textContent || "").toLowerCase().includes(r)) return e;
|
|
12881
|
+
return Infinity;
|
|
12882
12882
|
}
|
|
12883
12883
|
function ev(e, t, n) {
|
|
12884
12884
|
let r = [];
|
|
@@ -12902,9 +12902,8 @@ function ev(e, t, n) {
|
|
|
12902
12902
|
let o = a.filter(({ s: e }) => e === i).map(({ el: e }) => e);
|
|
12903
12903
|
if (o.length === 1) return o[0];
|
|
12904
12904
|
if (n) {
|
|
12905
|
-
let e = o.
|
|
12906
|
-
if (e.length === 1) return
|
|
12907
|
-
e.length > 1 && (o = e);
|
|
12905
|
+
let e = o.map((e) => $_(e, n)), t = Math.min(...e);
|
|
12906
|
+
if (t !== Infinity && (o = o.filter((n, r) => e[r] === t)), o.length === 1) return o[0];
|
|
12908
12907
|
}
|
|
12909
12908
|
let s = Array.isArray(t) ? t.filter((e) => e && e.isConnected) : [];
|
|
12910
12909
|
if (s.length) {
|
|
@@ -13411,7 +13410,7 @@ function ov(e) {
|
|
|
13411
13410
|
i.scrollIntoView(!0);
|
|
13412
13411
|
}
|
|
13413
13412
|
await Rg(i), i.focus?.(), await Bg(i), Vg(i), i.click();
|
|
13414
|
-
let e = (i.textContent || i.value || i.getAttribute("aria-label") || "").trim().slice(0, 80) || "button", t = `OK_CLICK ${e}`;
|
|
13413
|
+
let e = (i.innerText || i.textContent || i.value || i.getAttribute("aria-label") || "").replace(/\s+/g, " ").trim().slice(0, 80) || "button", t = `OK_CLICK ${e}`;
|
|
13415
13414
|
return $("fwh-click-button-mvp ✓", t), mg(`Clicked ${e}`, {
|
|
13416
13415
|
spinner: !1,
|
|
13417
13416
|
icon: "✅",
|