@flowengage/react-chatbot 5.0.47 → 5.0.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -29499,6 +29499,15 @@ function Ck(e) {
|
|
|
29499
29499
|
}
|
|
29500
29500
|
},
|
|
29501
29501
|
flowengage_end_session: async () => ($("flowengage_end_session ▶"), typeof e.requestEndSession == "function" && e.requestEndSession(), "Voice session is ending."),
|
|
29502
|
+
flowengage_get_current_page: async () => {
|
|
29503
|
+
if ($("flowengage_get_current_page ▶"), typeof window > "u") return "Cannot determine current page (no browser context).";
|
|
29504
|
+
let e = window.location.href, t = window.location.pathname, n = document.title || "";
|
|
29505
|
+
return $("flowengage_get_current_page ✓", {
|
|
29506
|
+
url: e,
|
|
29507
|
+
path: t,
|
|
29508
|
+
title: n
|
|
29509
|
+
}), `CURRENT_PAGE. URL: ${e} | Path: ${t} | Title: ${n}. Use THIS as the definitive current page — not any previously navigated URL.`;
|
|
29510
|
+
},
|
|
29502
29511
|
flowengage_list_forms: async () => {
|
|
29503
29512
|
let e = ZO(), t = QO();
|
|
29504
29513
|
return $("flowengage_list_forms ✓", `${e.length} field(s)`, `${t.length} button(s)`), JSON.stringify({
|
|
@@ -30127,7 +30136,7 @@ function Pk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
|
|
|
30127
30136
|
if (e) return;
|
|
30128
30137
|
let n = t.role === "user" ? "user" : "bot", r = t.message || t.text || t.content || "";
|
|
30129
30138
|
if (r) {
|
|
30130
|
-
if (n === "user" && (w.current = r, fe.current = !0, de.current &&= (clearTimeout(de.current), null),
|
|
30139
|
+
if (n === "user" && (w.current = r, fe.current = !0, de.current &&= (clearTimeout(de.current), null), ue.current &&= (clearTimeout(ue.current), null)), u.current = [...u.current, {
|
|
30131
30140
|
sender: n,
|
|
30132
30141
|
message: r,
|
|
30133
30142
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -30216,7 +30225,11 @@ function Pk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
|
|
|
30216
30225
|
}, 0)));
|
|
30217
30226
|
}
|
|
30218
30227
|
})(), () => {
|
|
30219
|
-
e = !0, re.current = !0
|
|
30228
|
+
e = !0, re.current = !0;
|
|
30229
|
+
try {
|
|
30230
|
+
CD();
|
|
30231
|
+
} catch {}
|
|
30232
|
+
kr(), ue.current &&= (clearTimeout(ue.current), null), de.current &&= (clearTimeout(de.current), null), le.current = !1, fe.current = !1, ce.current = "idle", o && typeof window < "u" && (window.history.pushState = o), c && typeof window < "u" && window.removeEventListener("popstate", c);
|
|
30220
30233
|
let t = i || C.current, n = ie.current, r = ae.current;
|
|
30221
30234
|
if (t?.endSession?.().catch(() => {}), n && l && s) {
|
|
30222
30235
|
let e = r ? Math.round((Date.now() - r) / 1e3) : 0, t = JSON.stringify({
|