@flowengage/react-chatbot 8.0.74 → 8.0.77
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.
|
@@ -2913,7 +2913,7 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
2913
2913
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
2914
2914
|
}]);
|
|
2915
2915
|
}, []), w = o(() => {
|
|
2916
|
-
S((e) => [...e, {
|
|
2916
|
+
S((e) => e.slice(-3).some((e) => (e.sender === "bot" || e.sender === "assistant") && /already on (that|this|the)\b/i.test(String(e.message || ""))) ? e : [...e, {
|
|
2917
2917
|
id: `nav-already-${e.length}-${Math.random().toString(36).slice(2, 8)}`,
|
|
2918
2918
|
sender: "bot",
|
|
2919
2919
|
message: "Looks like you're already on this page!",
|
|
@@ -3326,7 +3326,7 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3326
3326
|
return;
|
|
3327
3327
|
}
|
|
3328
3328
|
let i = t || n;
|
|
3329
|
-
|
|
3329
|
+
i && setTimeout(() => {
|
|
3330
3330
|
let e = cr(null, i);
|
|
3331
3331
|
e && lr(e);
|
|
3332
3332
|
}, 300);
|
|
@@ -3669,13 +3669,19 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3669
3669
|
n === "not-found" ? C() : n === "already-on-page" && w();
|
|
3670
3670
|
return;
|
|
3671
3671
|
}
|
|
3672
|
-
|
|
3672
|
+
t && setTimeout(() => {
|
|
3673
3673
|
let e = cr(null, t);
|
|
3674
3674
|
e && lr(e);
|
|
3675
3675
|
}, 300);
|
|
3676
3676
|
});
|
|
3677
3677
|
}
|
|
3678
|
-
else {
|
|
3678
|
+
else if (o.highlight?.section) {
|
|
3679
|
+
let e = o.highlight.section;
|
|
3680
|
+
setTimeout(() => {
|
|
3681
|
+
let t = cr(null, e);
|
|
3682
|
+
t && lr(t);
|
|
3683
|
+
}, 150);
|
|
3684
|
+
} else {
|
|
3679
3685
|
let e = [...s].reverse().find((e) => e.sender === "bot" || e.sender === "assistant");
|
|
3680
3686
|
if (e?.message) {
|
|
3681
3687
|
let t = Dr(e.message);
|
|
@@ -12166,7 +12172,7 @@ function vg(e) {
|
|
|
12166
12172
|
if (typeof window < "u" && window.__fe_user_nav_during_speech) {
|
|
12167
12173
|
let e = window.__fe_user_nav_during_speech, t = window.location.pathname;
|
|
12168
12174
|
if (Date.now() - e.ts >= 3e4) window.__fe_user_nav_during_speech = null;
|
|
12169
|
-
else return $("flowengage_highlight ✖ blocked — user navigated during speech", e), `NAV_CHANGED: The visitor navigated from "${e.fromPageName}" to "${e.toPageName}" (current path: ${t}) while you were speaking. STOP the current walkthrough immediately. DO NOT call
|
|
12175
|
+
else return $("flowengage_highlight ✖ blocked — user navigated during speech", e), `NAV_CHANGED: The visitor navigated from "${e.fromPageName}" to "${e.toPageName}" (current path: ${t}) while you were speaking. STOP the current walkthrough immediately. DO NOT call fwh-highlight-mvp again. Say out loud: "I see you've navigated to the ${e.toPageName} page — do you want me to continue what I was explaining, or shall I guide you through this page?" Wait for the visitor's answer before doing anything else.`;
|
|
12170
12176
|
}
|
|
12171
12177
|
hg();
|
|
12172
12178
|
let i = ((e) => e && e.replace(/^\d+\.\s*/, "").replace(/^["']|["']$/g, "").trim())(r), a = cr(n || null, i || null);
|
|
@@ -12312,7 +12318,9 @@ function vg(e) {
|
|
|
12312
12318
|
"fwh-request-email-mvp": async () => ($("fwh-request-email-mvp ▶"), typeof e.requestEmailCollection == "function" && e.requestEmailCollection(), "EMAIL_BOX_SHOWN. An email input text box is now visible to the visitor. Say EXACTLY: \"Please enter your email in the text box to continue.\" Then stop and wait silently — do NOT ask them to say it aloud, do NOT repeat, and do NOT answer any other question until you receive the EMAIL_SAVED message."),
|
|
12313
12319
|
"fwh-get-current-page-mvp": async () => {
|
|
12314
12320
|
if ($("fwh-get-current-page-mvp ▶"), typeof window > "u") return "Cannot determine current page (no browser context).";
|
|
12315
|
-
let e = window.location.href, t = window.location.pathname, n = document.title || ""
|
|
12321
|
+
let e = window.location.href, t = window.location.pathname, n = document.title || "";
|
|
12322
|
+
if (yr()) return $("fwh-get-current-page-mvp ✓ 404 detected", { url: e }), `CURRENT_PAGE_NOT_FOUND. The visitor is currently on a 404 / page-not-found error page (${e}). There is no real content here. Do NOT describe this page, do NOT list sections, do NOT offer a walkthrough, and do NOT describe it from your own knowledge. Tell the visitor plainly that the page they are on doesn't exist, and offer to take them somewhere that does.`;
|
|
12323
|
+
let { headings: r, pageTitleHeading: i, introText: a } = gg();
|
|
12316
12324
|
$("fwh-get-current-page-mvp ✓", {
|
|
12317
12325
|
url: e,
|
|
12318
12326
|
path: t,
|
|
@@ -13142,7 +13150,7 @@ function Mg({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
13142
13150
|
ts: Date.now()
|
|
13143
13151
|
});
|
|
13144
13152
|
try {
|
|
13145
|
-
N.current?.sendUserMessage?.(`[SYSTEM: I navigated away mid-walkthrough — I am now on the "${l}" page (${i}). Page title: "${a}". Sections: ${JSON.stringify(o)}. STOP everything. Do NOT describe the new page. Say EXACTLY: "I see you've navigated to the ${l} page — would you like me to continue what I was explaining, or shall I walk you through this page?" Then wait for my answer. IF I say continue/yes/carry on: resume speaking verbally from where you left off — do NOT call
|
|
13153
|
+
N.current?.sendUserMessage?.(`[SYSTEM: I navigated away mid-walkthrough — I am now on the "${l}" page (${i}). Page title: "${a}". Sections: ${JSON.stringify(o)}. STOP everything. Do NOT describe the new page. Say EXACTLY: "I see you've navigated to the ${l} page — would you like me to continue what I was explaining, or shall I walk you through this page?" Then wait for my answer. IF I say continue/yes/carry on: resume speaking verbally from where you left off — do NOT call fwh-navigate-mvp, do NOT call fwh-highlight-mvp, the visitor will navigate themselves if needed. IF I want to hear about this page: call fwh-highlight-mvp for sections of "${l}" only.]`);
|
|
13146
13154
|
} catch {}
|
|
13147
13155
|
};
|
|
13148
13156
|
c = window.history.pushState.bind(window.history), window.history.pushState = (...e) => {
|