@flowengage/react-chatbot 1.8.11 → 1.8.12

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.
@@ -3429,8 +3429,8 @@ function tr({ siteId: e, config: t, children: n, language: r = "en" }) {
3429
3429
  let t = Yn(e);
3430
3430
  b((e) => {
3431
3431
  if (!e.length) return t;
3432
- let n = e[e.length - 1], r = t[0];
3433
- return n && r && n.sender === r.sender && n.message === r.message ? e : [...e, ...t];
3432
+ let n = new Set(e.map((e) => `${e.sender}\0${e.message}`)), r = t.filter((e) => !n.has(`${e.sender}\0${e.message}`));
3433
+ return r.length ? [...e, ...r] : e;
3434
3434
  });
3435
3435
  };
3436
3436
  try {
@@ -29492,7 +29492,9 @@ function ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
29492
29492
  onMessage: (t) => {
29493
29493
  if (e) return;
29494
29494
  let n = t.role === "user" ? "user" : "bot", r = t.message || t.text || t.content || "";
29495
- r && (n === "user" && (C.current = r), s.current = [...s.current, {
29495
+ if (!r) return;
29496
+ let i = s.current, a = i.length > 0 ? i[i.length - 1] : null;
29497
+ a && a.sender === n && a.message === r || (n === "user" && (C.current = r), s.current = [...i, {
29496
29498
  sender: n,
29497
29499
  message: r,
29498
29500
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
@@ -29508,7 +29510,7 @@ function ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
29508
29510
  try {
29509
29511
  S.current?.setMicMuted?.(!0);
29510
29512
  } catch {}
29511
- y(!0), h("error"), oe("chat");
29513
+ y(!0), h("error"), oe("minimized");
29512
29514
  }
29513
29515
  },
29514
29516
  onDisconnect: () => {
@@ -29521,7 +29523,7 @@ function ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
29521
29523
  try {
29522
29524
  S.current?.setMicMuted?.(!0);
29523
29525
  } catch {}
29524
- y(!0), oe("chat");
29526
+ y(!0), oe("minimized");
29525
29527
  }
29526
29528
  }
29527
29529
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowengage/react-chatbot",
3
- "version": "1.8.11",
3
+ "version": "1.8.12",
4
4
  "description": "Embeddable AI chat widget for React — powered by FlowEngage. Drop it in with a single siteId.",
5
5
  "keywords": [
6
6
  "chatbot",