@flowengage/react-chatbot 8.0.128 → 8.0.129
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.
|
@@ -4142,7 +4142,11 @@ function yi({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
4142
4142
|
}
|
|
4143
4143
|
S(pi(p)), Array.isArray(f.cart_actions) && f.cart_actions.length && w(f.cart_actions), M(!!f.is_human_handled), A(f.is_human_handled ? "agent" : "ai"), I(!1), we(!1), await U.current.updateChatStatus(y, "messageSent");
|
|
4144
4144
|
} catch (e) {
|
|
4145
|
-
S((e) => e.filter((e) =>
|
|
4145
|
+
S((e) => e.filter((e) => !e.isStreaming).map((e) => e.id === d ? {
|
|
4146
|
+
...e,
|
|
4147
|
+
isPending: !1,
|
|
4148
|
+
failed: !0
|
|
4149
|
+
} : e)), I(!1), we(!1), e.status === 429 ? (Ee(!0), Oe(e.message), window.setTimeout(() => {
|
|
4146
4150
|
Ee(!1), Oe("");
|
|
4147
4151
|
}, ee)) : h(e);
|
|
4148
4152
|
}
|
|
@@ -10523,7 +10527,7 @@ function zg({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
10523
10527
|
e.map((e) => {
|
|
10524
10528
|
if (e.type === "call_recording" || typeof e.message == "string" && e.message.includes("AI chat recording")) return null;
|
|
10525
10529
|
if (e.type === "nav_pref_choice") return /* @__PURE__ */ g(Rg, { siteId: d?.siteId }, e.id || e.messageId);
|
|
10526
|
-
let t = e.sender === "system", n = e.sender === "user", r = e.sender === "ai" || e.sender === "bot", o = e.sender === "agent", c = e.isPending, f = e.type === "file" && e.metadata?.fileUrl,
|
|
10530
|
+
let t = e.sender === "system", n = e.sender === "user", r = e.sender === "ai" || e.sender === "bot", o = e.sender === "agent", c = e.isPending, f = e.failed, p = e.type === "file" && e.metadata?.fileUrl, m = e.agent_name || e.agentName || e.metadata?.agentName || l, v = typeof e.sender_headshot == "string" && e.sender_headshot.trim() || typeof s == "string" && s.trim() || null, S = xg(e.replyToContent || e.replyContext?.message || ""), C = e.replyToSender === "user" ? "You" : e.replyToSender === "agent" ? "Agent" : e.replyToSender === "ai" || e.replyToSender === "bot" ? "AI Assistant" : "Message";
|
|
10527
10531
|
return t ? /* @__PURE__ */ g("div", {
|
|
10528
10532
|
style: {
|
|
10529
10533
|
display: "flex",
|
|
@@ -10569,8 +10573,8 @@ function zg({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
10569
10573
|
marginTop: !c && (r || o) ? "22px" : "0px"
|
|
10570
10574
|
},
|
|
10571
10575
|
children: r ? u || /* @__PURE__ */ g(hg, { size: 16 }) : /* @__PURE__ */ g(Lg, {
|
|
10572
|
-
src:
|
|
10573
|
-
name:
|
|
10576
|
+
src: v || "",
|
|
10577
|
+
name: m,
|
|
10574
10578
|
imgStyle: {
|
|
10575
10579
|
width: "100%",
|
|
10576
10580
|
height: "100%",
|
|
@@ -10623,12 +10627,12 @@ function zg({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
10623
10627
|
color: n ? "#fff" : "#111827",
|
|
10624
10628
|
fontSize: "14px",
|
|
10625
10629
|
fontWeight: 400,
|
|
10626
|
-
opacity: c ? .55 : 1,
|
|
10630
|
+
opacity: c || e.failed ? .55 : 1,
|
|
10627
10631
|
transition: "opacity 0.3s ease",
|
|
10628
10632
|
wordBreak: "break-word",
|
|
10629
10633
|
width: "fit-content"
|
|
10630
10634
|
},
|
|
10631
|
-
children: [
|
|
10635
|
+
children: [S && /* @__PURE__ */ _("div", {
|
|
10632
10636
|
style: {
|
|
10633
10637
|
marginBottom: "8px",
|
|
10634
10638
|
borderRadius: "14px",
|
|
@@ -10643,7 +10647,7 @@ function zg({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
10643
10647
|
marginBottom: "2px",
|
|
10644
10648
|
fontWeight: 600
|
|
10645
10649
|
},
|
|
10646
|
-
children:
|
|
10650
|
+
children: C
|
|
10647
10651
|
}), /* @__PURE__ */ g("div", {
|
|
10648
10652
|
style: {
|
|
10649
10653
|
display: "-webkit-box",
|
|
@@ -10651,9 +10655,9 @@ function zg({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
10651
10655
|
WebkitBoxOrient: "vertical",
|
|
10652
10656
|
overflow: "hidden"
|
|
10653
10657
|
},
|
|
10654
|
-
children:
|
|
10658
|
+
children: S
|
|
10655
10659
|
})]
|
|
10656
|
-
}),
|
|
10660
|
+
}), p ? (() => {
|
|
10657
10661
|
let t = e.metadata.fileType || "", r = e.metadata.fileName || e.message || "File", i = Pg(e.metadata.fileSize), a = t.startsWith("image/"), o = `shared file: ${r}`.toLowerCase(), s = (e.message || "").trim(), c = s && s.toLowerCase() !== o && !s.toLowerCase().startsWith("shared file:"), l = t === "application/pdf" ? {
|
|
10658
10662
|
color: "#ef4444",
|
|
10659
10663
|
label: "PDF"
|
|
@@ -10859,6 +10863,13 @@ function zg({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
10859
10863
|
fontStyle: "italic"
|
|
10860
10864
|
},
|
|
10861
10865
|
children: "sending…"
|
|
10866
|
+
}) : f ? /* @__PURE__ */ g("span", {
|
|
10867
|
+
style: {
|
|
10868
|
+
fontSize: "10px",
|
|
10869
|
+
color: "#dc2626",
|
|
10870
|
+
fontWeight: 500
|
|
10871
|
+
},
|
|
10872
|
+
children: "Not sent — tap send to try again"
|
|
10862
10873
|
}) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("span", {
|
|
10863
10874
|
style: {
|
|
10864
10875
|
fontSize: "10px",
|
|
@@ -15593,7 +15604,7 @@ function K_() {
|
|
|
15593
15604
|
...I.pageVisibility || {}
|
|
15594
15605
|
};
|
|
15595
15606
|
return Array.isArray(e.allowedPaths) ? e.allowedPaths.filter(Boolean) : [];
|
|
15596
|
-
})(), Ge = We.length === 0 || We.some((e) => e === "*" || e === "/*" ? !0 : e.endsWith("/*") ? Ue.startsWith(e.slice(0, -1)) : Ue.replace(/\/$/, "") === e.replace(/\/$/, "")), Ke = xe.greetings?.[A] || I.greetings?.[A] || L.introGreeting ||
|
|
15607
|
+
})(), Ge = We.length === 0 || We.some((e) => e === "*" || e === "/*" ? !0 : e.endsWith("/*") ? Ue.startsWith(e.slice(0, -1)) : Ue.replace(/\/$/, "") === e.replace(/\/$/, "")), Ke = xe.greetings?.[A] || I.greetings?.[A] || L.introGreeting || (t?.websiteName && String(t.websiteName).trim() ? `Hello, I'm here to help you know more about ${String(t.websiteName).trim()}.` : "Hello, I'm here to help — what would you like to know?"), qe = {
|
|
15597
15608
|
entryPrompt: L.entryPrompt || "Do you want to explore in a new way?",
|
|
15598
15609
|
yesLabel: L.yesLabel || "Yes",
|
|
15599
15610
|
laterLabel: L.laterLabel || "Later",
|