@flowengage/react-chatbot 5.0.63 → 5.0.64

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.
@@ -29357,36 +29357,23 @@ function wk() {
29357
29357
  e[r] = !0, t.id = r;
29358
29358
  });
29359
29359
  }
29360
- var Tk = [], Ek = 2.5;
29361
- function Dk(e) {
29362
- if (!e || Tk.length === 0) return;
29363
- let t = e.toLowerCase(), n = [];
29364
- for (let r of Tk) {
29365
- let i = r.label.toLowerCase().split(/\s+/), a = -1, o = i.length >= 3 ? 3 : i.length;
29366
- for (let e = Math.min(5, i.length); e >= o; e--) {
29367
- let n = i.slice(0, e).join(" "), r = t.indexOf(n);
29368
- if (r >= 0) {
29369
- a = r;
29370
- break;
29371
- }
29360
+ var Tk = [], Ek = 5e3, Dk = null;
29361
+ function Ok() {
29362
+ if (Dk !== null && (clearInterval(Dk), Dk = null), Tk.length === 0) return;
29363
+ let e = Tk.shift();
29364
+ CD(e.el), $("highlight seq[0] at TTS start", e.label), Tk.length !== 0 && (Dk = setInterval(() => {
29365
+ if (Tk.length === 0) {
29366
+ clearInterval(Dk), Dk = null;
29367
+ return;
29372
29368
  }
29373
- let s = a > 0 ? e.slice(0, a).split(/\s+/).filter(Boolean).length : 0;
29374
- n.push({
29375
- el: r.el,
29376
- label: r.label,
29377
- delay: Math.round(s / Ek * 1e3)
29378
- });
29379
- }
29380
- Tk.length = 0, n.sort((e, t) => e.delay - t.delay);
29381
- for (let e = 1; e < n.length; e++) n[e].delay < n[e - 1].delay + 400 && (n[e].delay = n[e - 1].delay + 400);
29382
- for (let { el: e, label: t, delay: r } of n) setTimeout(() => {
29383
- CD(e), $(`highlight ✓ word-sync +${r}ms`, t);
29384
- }, r);
29369
+ let e = Tk.shift();
29370
+ CD(e.el), $("highlight ✓ seq interval", e.label);
29371
+ }, Ek));
29385
29372
  }
29386
- function Ok() {
29387
- Tk.length = 0;
29373
+ function kk() {
29374
+ Dk !== null && (clearInterval(Dk), Dk = null), Tk.length = 0;
29388
29375
  }
29389
- function kk(e) {
29376
+ function Ak(e) {
29390
29377
  let t = e.siteId || null, n = (e.apiBaseUrl || "").replace(/\/$/, ""), r = typeof e.getLastUserVoiceText == "function" ? e.getLastUserVoiceText : null, i = [], a = {
29391
29378
  flowengage_navigate: async (n) => {
29392
29379
  $("flowengage_navigate ▶ raw parameters:", n);
@@ -29662,7 +29649,7 @@ function kk(e) {
29662
29649
  }
29663
29650
  //#endregion
29664
29651
  //#region src/utils/wrapVoiceToolsForLogging.js
29665
- function Ak(e) {
29652
+ function jk(e) {
29666
29653
  return !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).map(([e, t]) => [e, async (n) => {
29667
29654
  let r = Rn();
29668
29655
  r ? console.log("[FlowEngage:voice-tool] ▶", e, n) : console.info(`[FlowEngage] voice tool » ${e}`);
@@ -29679,7 +29666,7 @@ function Ak(e) {
29679
29666
  }
29680
29667
  //#endregion
29681
29668
  //#region src/components/FlowEngageWidget.jsx
29682
- var jk = {
29669
+ var Mk = {
29683
29670
  blue: "#135bd8",
29684
29671
  red: "#ef334b",
29685
29672
  yellow: "#ffbd2e",
@@ -29687,7 +29674,7 @@ var jk = {
29687
29674
  highlight: "rgba(255,255,255,0.9)",
29688
29675
  green: "#10b981"
29689
29676
  };
29690
- function Mk(e) {
29677
+ function Nk(e) {
29691
29678
  if (!Array.isArray(e) || e.length < 2) return "linear-gradient(145deg, #dce8f022 0%, #e8dff522 45%, #f5e0e022 100%), #f7f8fa";
29692
29679
  let [t, n, r] = e;
29693
29680
  return e.length >= 3 && r ? [
@@ -29701,12 +29688,12 @@ function Mk(e) {
29701
29688
  "#f7f8fa"
29702
29689
  ].join(", ");
29703
29690
  }
29704
- function Nk(e) {
29691
+ function Pk(e) {
29705
29692
  if (!e || typeof e != "string") return "#1a1a1a";
29706
29693
  let t = e.replace("#", ""), n = t.length === 3 ? t.split("").map((e) => e + e).join("") : t, r = parseInt(n.slice(0, 2), 16) / 255, i = parseInt(n.slice(2, 4), 16) / 255, a = parseInt(n.slice(4, 6), 16) / 255, o = (e) => e <= .04045 ? e / 12.92 : ((e + .055) / 1.055) ** 2.4;
29707
29694
  return .2126 * o(r) + .7152 * o(i) + .0722 * o(a) > .179 ? "#1a1a1a" : "#ffffff";
29708
29695
  }
29709
- function Pk({ logo: t, style: n }) {
29696
+ function Fk({ logo: t, style: n }) {
29710
29697
  if (!t) return null;
29711
29698
  if (typeof t == "string") return /* @__PURE__ */ g("img", {
29712
29699
  src: t,
@@ -29731,7 +29718,7 @@ function Pk({ logo: t, style: n }) {
29731
29718
  children: r
29732
29719
  }) : null;
29733
29720
  }
29734
- function Fk({ title: e }) {
29721
+ function Ik({ title: e }) {
29735
29722
  return /* @__PURE__ */ g("div", {
29736
29723
  style: {
29737
29724
  width: "100%",
@@ -29749,18 +29736,18 @@ function Fk({ title: e }) {
29749
29736
  children: String(e || "FE").split(/\s+/).filter(Boolean).slice(0, 2).map((e) => e[0]?.toUpperCase() || "").join("") || "FE"
29750
29737
  });
29751
29738
  }
29752
- function Ik(e, t) {
29739
+ function Lk(e, t) {
29753
29740
  let n = (t || "").trim();
29754
29741
  return n ? !!(/\b(let'?s|let us)\s+(end|stop|finish|wrap up|close)\s+(the\s+)?(voice\s+)?(session|call|chat)\b/i.test(n) || /\bend\s+(this\s+)?(the\s+)?(voice\s+)?(session|call|chat)\b/i.test(n) || /\b(hang\s+up|disconnect)\b/i.test(n) || /\b(that'?s all|we'?re done)\b/i.test(n) || e === "bot" && (/\b(I'?ll|I will|Let me|I can|I'?m going to)\s+(end|close)\s+(the\s+)?(voice\s+)?(session|call)\b/i.test(n) || /\b(ending|closing)\s+(the\s+)?(voice\s+)?session\b|\bvoice\s+session\s+(is\s+)?(now\s+)?(ended|over|closing)\b/i.test(n) || /\b(session|call)\s+(is\s+)?(now\s+)?(ended|over)\b/i.test(n) || /\bwe\s+can\s+end\s+(the\s+)?(session|call)?\s*(here|now)\b/i.test(n) || /\b(wrapping\s+up|signing\s+off)\b/i.test(n)) || /^(goodbye|bye|that'?s all|we'?re done|hang up|disconnect)\b/i.test(n)) : !1;
29755
29742
  }
29756
- function Lk({ orbColors: e, ...t }) {
29743
+ function Rk({ orbColors: e, ...t }) {
29757
29744
  return /* @__PURE__ */ g(dO, {
29758
29745
  colors: e,
29759
29746
  ...t
29760
29747
  });
29761
29748
  }
29762
- function Rk({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMobile: a, isClosing: o }) {
29763
- let s = n || jk.green, c = Nk(s), l = a ? 72 : 94, u = /* @__PURE__ */ _("div", {
29749
+ function zk({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMobile: a, isClosing: o }) {
29750
+ let s = n || Mk.green, c = Pk(s), l = a ? 72 : 94, u = /* @__PURE__ */ _("div", {
29764
29751
  style: {
29765
29752
  display: "flex",
29766
29753
  alignItems: a ? "flex-end" : "center",
@@ -29881,7 +29868,7 @@ function Rk({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMo
29881
29868
  delay: 0
29882
29869
  },
29883
29870
  style: { flexShrink: 0 },
29884
- children: /* @__PURE__ */ g(Lk, {
29871
+ children: /* @__PURE__ */ g(Rk, {
29885
29872
  size: l,
29886
29873
  orbColors: t
29887
29874
  })
@@ -29913,8 +29900,8 @@ function Rk({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMo
29913
29900
  children: u
29914
29901
  })] });
29915
29902
  }
29916
- function zk({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onClose: a, isMobile: o, isClosing: s }) {
29917
- let c = n || jk.green, l = Nk(c);
29903
+ function Bk({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onClose: a, isMobile: o, isClosing: s }) {
29904
+ let c = n || Mk.green, l = Pk(c);
29918
29905
  return /* @__PURE__ */ _(Dm.div, {
29919
29906
  initial: {
29920
29907
  scale: 50 / 350,
@@ -29985,7 +29972,7 @@ function zk({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onC
29985
29972
  children: /* @__PURE__ */ g("polyline", { points: "6 9 12 15 18 9" })
29986
29973
  })
29987
29974
  }),
29988
- /* @__PURE__ */ g(Lk, {
29975
+ /* @__PURE__ */ g(Rk, {
29989
29976
  size: 72,
29990
29977
  orbColors: t
29991
29978
  }),
@@ -30054,20 +30041,20 @@ function zk({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onC
30054
30041
  ]
30055
30042
  });
30056
30043
  }
30057
- function Bk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i, siteId: a, apiBaseUrl: s, chatId: l, historyRef: u, onMessageSync: d, voiceEndCounter: f }) {
30058
- let [h, v] = m("idle"), [y, b] = m(!1), [x, S] = m(!1), C = p(null), w = p(""), T = p(async () => {}), ee = p(!1), te = p(!1), ne = p(!1), re = p(!1), E = p("minimized"), ie = p(null), ae = p(null), oe = p(null), D = p(0), se = p(!1), ce = p("idle"), le = p(!1), ue = p(null), de = p(null), fe = p(!1), pe = p(""), me = o((e = "minimized") => {
30044
+ function Vk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i, siteId: a, apiBaseUrl: s, chatId: l, historyRef: u, onMessageSync: d, voiceEndCounter: f }) {
30045
+ let [h, v] = m("idle"), [y, b] = m(!1), [x, S] = m(!1), C = p(null), w = p(""), T = p(async () => {}), ee = p(!1), te = p(!1), ne = p(!1), re = p(!1), E = p("minimized"), ie = p(null), ae = p(null), oe = p(null), D = p(0), se = p(!1), ce = p("idle"), le = p(!1), ue = p(null), de = p(null), fe = p(!1), pe = o((e = "minimized") => {
30059
30046
  E.current = e, re.current = !0, queueMicrotask(() => {
30060
30047
  ee.current || (ee.current = !0, T.current?.());
30061
30048
  });
30062
- }, [u]), he = o(async (e) => {
30049
+ }, [u]), me = o(async (e) => {
30063
30050
  re.current = !0;
30064
30051
  try {
30065
30052
  wD();
30066
30053
  } catch {}
30067
30054
  try {
30068
- Ok();
30055
+ kk();
30069
30056
  } catch {}
30070
- if (pe.current = "", a) try {
30057
+ if (a) try {
30071
30058
  Ve(a);
30072
30059
  } catch {}
30073
30060
  try {
@@ -30098,10 +30085,10 @@ function Bk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30098
30085
  l,
30099
30086
  s
30100
30087
  ]);
30101
- return T.current = () => he(E.current === "chat" ? t : n), c(() => {
30088
+ return T.current = () => me(E.current === "chat" ? t : n), c(() => {
30102
30089
  te.current = y;
30103
30090
  }, [y]), c(() => {
30104
- f && me("chat");
30091
+ f && pe("chat");
30105
30092
  }, [f]), c(() => {
30106
30093
  let e = !1, i = null, o = null, c = null;
30107
30094
  return (async () => {
@@ -30139,7 +30126,7 @@ function Bk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30139
30126
  }
30140
30127
  Ne();
30141
30128
  } });
30142
- let t = Ak(kk({
30129
+ let t = jk(Ak({
30143
30130
  siteId: a || null,
30144
30131
  apiBaseUrl: s || null,
30145
30132
  getLastUserVoiceText: () => w.current,
@@ -30169,7 +30156,7 @@ function Bk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30169
30156
  m && m.includes("|") && (x = m.split("|").map((e) => e.trim()).filter(Boolean).reduce((e, t) => e.length <= t.length ? e : t));
30170
30157
  let S = x || y || "this page";
30171
30158
  g ? f ? (_.overrides = { agent: { firstMessage: `I've navigated you to the ${S} page. Let me walk you through what's here.` } }, console.log(`[FlowEngage] 🔄 Agent-nav resume: firstMessage set for "${S}" (${p})`)) : d ? _.overrides = { agent: { firstMessage: "I'm still here. Go ahead!" } } : h || (_.overrides = { agent: { firstMessage: `Hi! I see you are currently on the ${S} page. Are you looking for something specific here?` } }, console.log(`[FlowEngage] 🏠 Page-context override: "${S}" for ${p}`)) : d && (_.overrides = { agent: { firstMessage: "" } });
30172
- let T = !1, oe = f ? `NAVIGATION RESUME — Your intro has been spoken. NOW — without waiting for the visitor to say anything — call flowengage_highlight for the first content section on this page, then speak one sentence about it. Continue section by section (highlight + one sentence each) until you have covered the key content. Prior conversation context:\n${(a ? je(a) : null)?.transcript || ""}\n\n` : null, he = await vD.startSession({
30159
+ let T = !1, oe = f ? `NAVIGATION RESUME — Your intro has been spoken. NOW — without waiting for the visitor to say anything — call flowengage_highlight for the first content section on this page, then speak one sentence about it. Continue section by section (highlight + one sentence each) until you have covered the key content. Prior conversation context:\n${(a ? je(a) : null)?.transcript || ""}\n\n` : null, me = await vD.startSession({
30173
30160
  ..._,
30174
30161
  onConnect: ({ conversationId: e }) => {
30175
30162
  ie.current = e, ae.current = Date.now(), console.log("[FlowEngage] 🎙️ AI chat session connected:", e);
@@ -30178,11 +30165,11 @@ function Bk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30178
30165
  onModeChange: ({ mode: t }) => {
30179
30166
  if (!e) {
30180
30167
  if (t === "speaking") {
30181
- de.current &&= (clearTimeout(de.current), null), v("speaking"), ce.current = "speaking", le.current = !0, fe.current = !1, ue.current &&= (clearTimeout(ue.current), null), pe.current &&= (Dk(pe.current), "");
30168
+ de.current &&= (clearTimeout(de.current), null), v("speaking"), ce.current = "speaking", le.current = !0, fe.current = !1, ue.current &&= (clearTimeout(ue.current), null), Ok();
30182
30169
  return;
30183
30170
  }
30184
30171
  if (ce.current = "listening", se.current) {
30185
- se.current = !1, me();
30172
+ se.current = !1, pe();
30186
30173
  return;
30187
30174
  }
30188
30175
  if (oe && !T) {
@@ -30204,7 +30191,7 @@ function Bk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30204
30191
  if (e) return;
30205
30192
  let n = t.role === "user" ? "user" : "bot", r = t.message || t.text || t.content || "";
30206
30193
  if (r) {
30207
- if (n === "bot" && (ce.current === "speaking" ? Dk(r) : pe.current = r), n === "user" && (w.current = r, fe.current = !0, de.current &&= (clearTimeout(de.current), null), ue.current &&= (clearTimeout(ue.current), null)), u.current = [...u.current, {
30194
+ 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, {
30208
30195
  sender: n,
30209
30196
  message: r,
30210
30197
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
@@ -30212,14 +30199,14 @@ function Bk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30212
30199
  let e = bO(u.current);
30213
30200
  e && Ae(a, e);
30214
30201
  } catch {}
30215
- if (Ik(n, r)) {
30216
- me("minimized");
30202
+ if (Lk(n, r)) {
30203
+ pe("minimized");
30217
30204
  return;
30218
30205
  }
30219
30206
  if (te.current && n === "bot" && /are you still there|still there\??|hello\?|anyone there|checking in|you there|are you available|is anyone|did you step away/i.test(r)) if (D.current += 1, D.current === 2) try {
30220
30207
  C.current?.sendContextualUpdate?.("IMPORTANT: The visitor is muted and has not responded to your last 2 checks. Make exactly ONE more check. If there is still no response, say: 'I feel like you are not active, so I'm ending this session. You can connect with me anytime.' then immediately call the flowengage_end_session tool to end the voice session. Do NOT ask again after that.");
30221
30208
  } catch {}
30222
- else D.current >= 5 && me("minimized");
30209
+ else D.current >= 5 && pe("minimized");
30223
30210
  }
30224
30211
  },
30225
30212
  onError: (t) => {
@@ -30232,7 +30219,7 @@ function Bk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30232
30219
  try {
30233
30220
  C.current?.setMicMuted?.(!0);
30234
30221
  } catch {}
30235
- b(!0), v("error"), me("chat");
30222
+ b(!0), v("error"), pe("chat");
30236
30223
  }
30237
30224
  },
30238
30225
  onDisconnect: (t) => {
@@ -30249,21 +30236,21 @@ function Bk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30249
30236
  try {
30250
30237
  C.current?.setMicMuted?.(!0);
30251
30238
  } catch {}
30252
- b(!0), me("chat");
30239
+ b(!0), pe("chat");
30253
30240
  }
30254
30241
  });
30255
30242
  if (e) {
30256
- he.endSession().catch(() => {});
30243
+ me.endSession().catch(() => {});
30257
30244
  return;
30258
30245
  }
30259
- i = he, C.current = he, v("listening");
30246
+ i = me, C.current = me, v("listening");
30260
30247
  try {
30261
30248
  let e = typeof window < "u" ? window.location.href : "", r = "[]";
30262
30249
  try {
30263
30250
  r = await t.list_page_forms();
30264
30251
  } catch {}
30265
30252
  let i = d && !f ? `RESUMING PRIOR SESSION — DO NOT GREET. The visitor is continuing the same conversation after a page reload. Do not introduce yourself or re-state your capabilities. Wait silently until the visitor speaks; if you must speak first, briefly acknowledge where you left off in one short sentence.\nPrior transcript:\n${n?.transcript || ""}\n\n` : "";
30266
- he.sendContextualUpdate(`${i}Page: ${e}. SiteId: ${a || "unknown"}. Forms: ${r}. Voice: call end_voice_session or say you are ending the session to stop.`);
30253
+ me.sendContextualUpdate(`${i}Page: ${e}. SiteId: ${a || "unknown"}. Forms: ${r}. Voice: call end_voice_session or say you are ending the session to stop.`);
30267
30254
  } catch {}
30268
30255
  if (typeof window < "u") {
30269
30256
  let t = window.location.pathname, n = () => {
@@ -30322,7 +30309,7 @@ function Bk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30322
30309
  r,
30323
30310
  a,
30324
30311
  s,
30325
- me
30312
+ pe
30326
30313
  ]), c(() => {
30327
30314
  if (!x) return;
30328
30315
  let e = (e) => {
@@ -30376,7 +30363,7 @@ function Bk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30376
30363
  },
30377
30364
  children: "Muted"
30378
30365
  }),
30379
- /* @__PURE__ */ g(Lk, {
30366
+ /* @__PURE__ */ g(Rk, {
30380
30367
  size: 72,
30381
30368
  voiceState: h,
30382
30369
  isMuted: y,
@@ -30508,7 +30495,7 @@ function Bk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30508
30495
  children: [
30509
30496
  /* @__PURE__ */ _("button", {
30510
30497
  onClick: () => {
30511
- S(!1), E.current = "chat", he(t);
30498
+ S(!1), E.current = "chat", me(t);
30512
30499
  },
30513
30500
  style: {
30514
30501
  display: "flex",
@@ -30537,7 +30524,7 @@ function Bk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30537
30524
  }),
30538
30525
  /* @__PURE__ */ _("button", {
30539
30526
  onClick: () => {
30540
- S(!1), E.current = "minimized", he(n);
30527
+ S(!1), E.current = "minimized", me(n);
30541
30528
  },
30542
30529
  style: {
30543
30530
  display: "flex",
@@ -30614,7 +30601,7 @@ function Bk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30614
30601
  ]
30615
30602
  });
30616
30603
  }
30617
- function Vk({ orbColors: e }) {
30604
+ function Hk({ orbColors: e }) {
30618
30605
  return /* @__PURE__ */ g("div", {
30619
30606
  style: {
30620
30607
  flexShrink: 0,
@@ -30624,13 +30611,13 @@ function Vk({ orbColors: e }) {
30624
30611
  alignItems: "center",
30625
30612
  justifyContent: "center"
30626
30613
  },
30627
- children: /* @__PURE__ */ g(Lk, {
30614
+ children: /* @__PURE__ */ g(Rk, {
30628
30615
  size: 36,
30629
30616
  orbColors: e
30630
30617
  })
30631
30618
  });
30632
30619
  }
30633
- var Hk = () => /* @__PURE__ */ g("div", {
30620
+ var Uk = () => /* @__PURE__ */ g("div", {
30634
30621
  style: {
30635
30622
  display: "flex",
30636
30623
  marginBottom: "12px",
@@ -30660,7 +30647,7 @@ var Hk = () => /* @__PURE__ */ g("div", {
30660
30647
  } }, e))
30661
30648
  })
30662
30649
  });
30663
- function Uk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i, quickChatOptions: a, onQuickChatSelect: o, isMobile: s, chatHistory: l, isAiTyping: u, isAgentTyping: d, activeScreen: f, agentName: v, agentHeadshot: y, fallbackAgentName: b, input: x, setInput: S, onSubmit: C, isConversationEnded: w, isLoading: T, isRateLimited: ee, rateLimitMessage: te, selectedFile: ne, onFileSelect: re, onRemoveSelectedFile: E, attachmentError: ie, isUploadingAttachment: ae, requiresEmail: oe, emailInput: D, setEmailInput: se, emailError: ce, emailCaptureSuccess: le, replyContext: ue, setReplyContext: de, webRTCError: fe, micError: pe, setMicError: me, dismissCallError: he, activeCallId: ge, isCallMuted: _e, toggleCallMute: ve, endWebRTCCall: ye, formatCallDuration: be, callDurationSeconds: xe, isCallMinimized: Se, onExpand: Ce, onCollapse: we, onStartVoice: Te, onNewChat: Ee, onEndConversation: De, showPoweredBy: Oe, getVisitorChatHistory: ke, getVisitorChatThread: Ae, resumeChat: je, isSessionRestoring: Me, isClosing: O }) {
30650
+ function Wk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i, quickChatOptions: a, onQuickChatSelect: o, isMobile: s, chatHistory: l, isAiTyping: u, isAgentTyping: d, activeScreen: f, agentName: v, agentHeadshot: y, fallbackAgentName: b, input: x, setInput: S, onSubmit: C, isConversationEnded: w, isLoading: T, isRateLimited: ee, rateLimitMessage: te, selectedFile: ne, onFileSelect: re, onRemoveSelectedFile: E, attachmentError: ie, isUploadingAttachment: ae, requiresEmail: oe, emailInput: D, setEmailInput: se, emailError: ce, emailCaptureSuccess: le, replyContext: ue, setReplyContext: de, webRTCError: fe, micError: pe, setMicError: me, dismissCallError: he, activeCallId: ge, isCallMuted: _e, toggleCallMute: ve, endWebRTCCall: ye, formatCallDuration: be, callDurationSeconds: xe, isCallMinimized: Se, onExpand: Ce, onCollapse: we, onStartVoice: Te, onNewChat: Ee, onEndConversation: De, showPoweredBy: Oe, getVisitorChatHistory: ke, getVisitorChatThread: Ae, resumeChat: je, isSessionRestoring: Me, isClosing: O }) {
30664
30651
  let Ne = l.length > 0, Pe = T || ee || w, Fe = !!ge, [Ie, Le] = m(!1), [Re, ze] = m(!1), [Be, Ve] = m([]), [He, Ue] = m(!1), [We, Ge] = m(null), [Ke, qe] = m([]), Je = p(null), Ye = async () => {
30665
30652
  Le(!1), ze(!0), Ue(!0), Ge(null);
30666
30653
  try {
@@ -30785,7 +30772,7 @@ function Uk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
30785
30772
  justifyContent: "center",
30786
30773
  height: "40px"
30787
30774
  },
30788
- children: i ? /* @__PURE__ */ g(Pk, {
30775
+ children: i ? /* @__PURE__ */ g(Fk, {
30789
30776
  logo: i,
30790
30777
  style: {
30791
30778
  height: "34px",
@@ -30798,7 +30785,7 @@ function Uk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
30798
30785
  height: "40px",
30799
30786
  flexShrink: 0
30800
30787
  },
30801
- children: /* @__PURE__ */ g(Fk, { title: e.chatTitle })
30788
+ children: /* @__PURE__ */ g(Ik, { title: e.chatTitle })
30802
30789
  })
30803
30790
  }), /* @__PURE__ */ g("div", {
30804
30791
  style: {
@@ -31286,11 +31273,11 @@ function Uk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
31286
31273
  isLoading: T,
31287
31274
  isAgentTyping: d,
31288
31275
  setReplyContext: de,
31289
- TypingDots: Hk,
31276
+ TypingDots: Uk,
31290
31277
  primaryColor: n,
31291
31278
  agentHeadshot: y,
31292
31279
  agentDisplayName: v || b,
31293
- botAvatarNode: /* @__PURE__ */ g(Vk, { orbColors: t })
31280
+ botAvatarNode: /* @__PURE__ */ g(Hk, { orbColors: t })
31294
31281
  }) : Me ? /* @__PURE__ */ _("div", {
31295
31282
  style: {
31296
31283
  flex: 1,
@@ -31331,7 +31318,7 @@ function Uk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
31331
31318
  padding: "28px 24px"
31332
31319
  },
31333
31320
  children: [
31334
- /* @__PURE__ */ g(Lk, {
31321
+ /* @__PURE__ */ g(Rk, {
31335
31322
  size: 94,
31336
31323
  orbColors: t
31337
31324
  }),
@@ -31472,7 +31459,7 @@ function Uk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
31472
31459
  ]
31473
31460
  });
31474
31461
  }
31475
- function Wk() {
31462
+ function Gk() {
31476
31463
  let { status: e, runtimeConfig: t, resolvedConfig: n, chatHistory: r, isOpen: i, activeScreen: a, isHumanHandled: s, agentName: l, agentHeadshot: u, visitorEmail: h, isAgentTyping: v, isAiTyping: y, isLoading: b, isRateLimited: x, rateLimitMessage: S, isConversationEnded: C, incomingCall: w, activeCallId: T, callConnectionState: ee, callConnectedAt: te, isCallMuted: ne, webRTCError: re, language: E, chatId: ie, historyRef: ae, onMessageSync: oe, sendMessage: D, uploadChatFile: se, openWidget: ce, captureVisitorEmail: le, setVoiceMode: ue, endConversation: de, startNewChat: me, acceptCall: he, rejectCall: ge, endWebRTCCall: _e, toggleCallMute: ve, dismissCallError: ye, startTyping: be, stopTyping: xe, updateTypingDraft: Se, getVisitorChatHistory: Ce, getVisitorChatThread: we, resumeChat: Te, isSessionRestoring: Ee, openToChatCounter: De, voiceEndCounter: Oe } = Ln();
31477
31464
  c(() => {
31478
31465
  try {
@@ -31490,7 +31477,7 @@ function Wk() {
31490
31477
  }, Fe = {
31491
31478
  ...ke.features || {},
31492
31479
  ...Ae.features || {}
31493
- }, Ie = Fe.voice !== !1, Re = Array.isArray(Ne.orbColors) && Ne.orbColors.length > 0 ? Ne.orbColors : null, ze = Ne.buttonColor || Ne.primaryColor || Re?.[0] || "#3B82F6", Be = Ne.position || "bottom-right", Ve = O.fallbackAgentName || "Agent", He = Mk(Re ?? Ne.chatBgColors), Ue = O.logo || O.logoUrl || null, We = E || "en", Ge = ke.recommendations?.[We] || [], Ke = (Ae.recommendations?.[We] ?? Ge).filter((e) => String(e?.label ?? "").trim()).map((e, t) => ({
31480
+ }, Ie = Fe.voice !== !1, Re = Array.isArray(Ne.orbColors) && Ne.orbColors.length > 0 ? Ne.orbColors : null, ze = Ne.buttonColor || Ne.primaryColor || Re?.[0] || "#3B82F6", Be = Ne.position || "bottom-right", Ve = O.fallbackAgentName || "Agent", He = Nk(Re ?? Ne.chatBgColors), Ue = O.logo || O.logoUrl || null, We = E || "en", Ge = ke.recommendations?.[We] || [], Ke = (Ae.recommendations?.[We] ?? Ge).filter((e) => String(e?.label ?? "").trim()).map((e, t) => ({
31494
31481
  id: e.key || `qr-${t}`,
31495
31482
  label: e.label,
31496
31483
  message: e.label,
@@ -31754,7 +31741,7 @@ function Wk() {
31754
31741
  onWheel: (e) => e.stopPropagation(),
31755
31742
  onTouchMove: (e) => e.stopPropagation(),
31756
31743
  children: [
31757
- A === "entry_prompt" && /* @__PURE__ */ g(Rk, {
31744
+ A === "entry_prompt" && /* @__PURE__ */ g(zk, {
31758
31745
  copy: Ze,
31759
31746
  orbColors: Re,
31760
31747
  primaryColor: ze,
@@ -31837,13 +31824,13 @@ function Wk() {
31837
31824
  children: ee === "connected" ? `${Ht(_t)} with ${nt}` : `Tap to return to ${nt}`
31838
31825
  })]
31839
31826
  })]
31840
- }), /* @__PURE__ */ g(Lk, {
31827
+ }), /* @__PURE__ */ g(Rk, {
31841
31828
  size: 50,
31842
31829
  orbColors: Re,
31843
31830
  onClick: T && Dt ? Lt : Ie ? Kt : Jt
31844
31831
  })]
31845
31832
  }),
31846
- A === "connection_modal" && /* @__PURE__ */ g(zk, {
31833
+ A === "connection_modal" && /* @__PURE__ */ g(Bk, {
31847
31834
  copy: Ze,
31848
31835
  orbColors: Re,
31849
31836
  primaryColor: ze,
@@ -31853,7 +31840,7 @@ function Wk() {
31853
31840
  isMobile: Nt,
31854
31841
  isClosing: kt
31855
31842
  }),
31856
- A === "voice_mode" && /* @__PURE__ */ g(Bk, {
31843
+ A === "voice_mode" && /* @__PURE__ */ g(Vk, {
31857
31844
  orbColors: Re,
31858
31845
  onEnterChat: Jt,
31859
31846
  onEndChat: Yt,
@@ -31885,7 +31872,7 @@ function Wk() {
31885
31872
  orbColors: Re,
31886
31873
  chatHistory: r
31887
31874
  }),
31888
- A === "text_chat" && /* @__PURE__ */ g(Uk, {
31875
+ A === "text_chat" && /* @__PURE__ */ g(Wk, {
31889
31876
  isClosing: kt,
31890
31877
  copy: Ze,
31891
31878
  orbColors: Re,
@@ -31950,7 +31937,7 @@ function Wk() {
31950
31937
  }
31951
31938
  //#endregion
31952
31939
  //#region src/components/ErrorBoundary.jsx
31953
- var Gk = class extends e.Component {
31940
+ var Kk = class extends e.Component {
31954
31941
  constructor(e) {
31955
31942
  super(e), this.state = { hasError: !1 };
31956
31943
  }
@@ -31965,4 +31952,4 @@ var Gk = class extends e.Component {
31965
31952
  }
31966
31953
  };
31967
31954
  //#endregion
31968
- export { dO as AnimatedOrb, Gk as ErrorBoundary, Rr as FlowEngageProvider, Wk as FlowEngageWidget, Ln as useFlowEngage };
31955
+ export { dO as AnimatedOrb, Kk as ErrorBoundary, Rr as FlowEngageProvider, Gk as FlowEngageWidget, Ln as useFlowEngage };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowengage/react-chatbot",
3
- "version": "5.0.63",
3
+ "version": "5.0.64",
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",