@flowengage/react-chatbot 5.0.55 → 5.0.57

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.
@@ -28832,39 +28832,53 @@ function $(...e) {
28832
28832
  function WO(e) {
28833
28833
  return new Promise((t) => setTimeout(t, e));
28834
28834
  }
28835
- var GO = "#flowengage-root, .flowengage-shell, .flowengage-widget-root";
28836
- function KO(e) {
28835
+ function GO(e = 10) {
28836
+ if (typeof document > "u") return [];
28837
+ try {
28838
+ let t = /* @__PURE__ */ new Set(), n = [], r = document.querySelectorAll("h1, h2, h3");
28839
+ for (let i of r) {
28840
+ if (qO(i)) continue;
28841
+ let r = (i.textContent || "").trim().replace(/\s+/g, " ");
28842
+ if (!(!r || r.length < 3 || r.length > 120) && !t.has(r.toLowerCase()) && (t.add(r.toLowerCase()), n.push(r), n.length >= e)) break;
28843
+ }
28844
+ return n;
28845
+ } catch {
28846
+ return [];
28847
+ }
28848
+ }
28849
+ var KO = "#flowengage-root, .flowengage-shell, .flowengage-widget-root";
28850
+ function qO(e) {
28837
28851
  if (!e || typeof e.closest != "function") return !1;
28838
28852
  try {
28839
- return !!e.closest(GO);
28853
+ return !!e.closest(KO);
28840
28854
  } catch {
28841
28855
  return !1;
28842
28856
  }
28843
28857
  }
28844
- function qO(e) {
28858
+ function JO(e) {
28845
28859
  try {
28846
28860
  let t = e.ownerDocument?.defaultView;
28847
28861
  if (t) return t.getComputedStyle(e);
28848
28862
  } catch {}
28849
28863
  return window.getComputedStyle(e);
28850
28864
  }
28851
- function JO(e) {
28865
+ function YO(e) {
28852
28866
  let t = /* @__PURE__ */ new Set();
28853
28867
  function n(r) {
28854
28868
  if (!r || t.has(r)) return;
28855
28869
  t.add(r), e(r);
28856
28870
  let i = r.querySelectorAll("iframe");
28857
- for (let e of i) if (!KO(e)) try {
28871
+ for (let e of i) if (!qO(e)) try {
28858
28872
  let t = e.contentDocument;
28859
28873
  t && n(t);
28860
28874
  } catch {}
28861
28875
  }
28862
28876
  typeof document < "u" && n(document);
28863
28877
  }
28864
- function YO(e) {
28878
+ function XO(e) {
28865
28879
  return e == null ? null : String(e).replace(/\u00a0/g, " ").replace(/\s*\*+\s*$/u, "").replace(/\s+/g, " ").trim();
28866
28880
  }
28867
- function XO(e) {
28881
+ function ZO(e) {
28868
28882
  let t = e.ownerDocument || document, n = e.getAttribute("aria-labelledby");
28869
28883
  if (n) {
28870
28884
  let e = n.trim().split(/\s+/).filter(Boolean), r = [];
@@ -28872,42 +28886,42 @@ function XO(e) {
28872
28886
  let e = t.getElementById(n);
28873
28887
  e?.textContent && r.push(e.textContent.trim());
28874
28888
  } catch {}
28875
- if (r.length) return YO(r.join(" "));
28889
+ if (r.length) return XO(r.join(" "));
28876
28890
  }
28877
- if (e.labels && e.labels.length) return YO(e.labels[0].textContent);
28891
+ if (e.labels && e.labels.length) return XO(e.labels[0].textContent);
28878
28892
  let r = e.id;
28879
28893
  if (r) try {
28880
28894
  let e = t.querySelector(`label[for="${CSS.escape(r)}"]`);
28881
- if (e) return YO(e.textContent);
28895
+ if (e) return XO(e.textContent);
28882
28896
  } catch {
28883
28897
  let e = t.querySelector(`label[for="${r.replace(/"/g, "\\\"")}"]`);
28884
- if (e) return YO(e.textContent);
28898
+ if (e) return XO(e.textContent);
28885
28899
  }
28886
28900
  let i = e.previousElementSibling;
28887
28901
  for (let e = 0; e < 6 && i; e += 1) {
28888
- if (i.tagName === "LABEL") return YO(i.textContent);
28902
+ if (i.tagName === "LABEL") return XO(i.textContent);
28889
28903
  let e = (i.className || "").toString().toLowerCase();
28890
28904
  if (/chakra-form__label|formlabel|field-label|form-label|mui-form-label/.test(e)) {
28891
- let e = YO(i.textContent);
28905
+ let e = XO(i.textContent);
28892
28906
  if (e) return e;
28893
28907
  }
28894
28908
  i = i.previousElementSibling;
28895
28909
  }
28896
28910
  let a = e.parentElement;
28897
28911
  for (let e = 0; e < 5 && a; e += 1) {
28898
- if (a.tagName === "LABEL") return YO(a.textContent);
28912
+ if (a.tagName === "LABEL") return XO(a.textContent);
28899
28913
  let e = a.querySelector?.(":scope > label, :scope > [class*='FormLabel'], :scope > [class*='form__label']");
28900
- if (e?.textContent) return YO(e.textContent);
28914
+ if (e?.textContent) return XO(e.textContent);
28901
28915
  a = a.parentElement;
28902
28916
  }
28903
28917
  let o = e.getAttribute("aria-label");
28904
- return o ? YO(o) : null;
28918
+ return o ? XO(o) : null;
28905
28919
  }
28906
- function ZO() {
28920
+ function QO() {
28907
28921
  let e = [];
28908
- return JO((t) => {
28922
+ return YO((t) => {
28909
28923
  e.push(...Array.from(t.querySelectorAll("input, select, textarea")).filter((e) => {
28910
- if (KO(e)) return !1;
28924
+ if (qO(e)) return !1;
28911
28925
  let t = (e.type || "").toLowerCase();
28912
28926
  if ([
28913
28927
  "hidden",
@@ -28916,32 +28930,32 @@ function ZO() {
28916
28930
  "image"
28917
28931
  ].includes(t) || e.disabled || e.readOnly) return !1;
28918
28932
  try {
28919
- let t = qO(e);
28933
+ let t = JO(e);
28920
28934
  if (t.display === "none" || t.visibility === "hidden") return !1;
28921
28935
  } catch {}
28922
28936
  return !0;
28923
28937
  }));
28924
28938
  }), e;
28925
28939
  }
28926
- function QO() {
28927
- return ZO().map((e, t) => ({
28940
+ function $O() {
28941
+ return QO().map((e, t) => ({
28928
28942
  formIndex: 0,
28929
28943
  fieldIndex: t,
28930
28944
  tag: e.tagName,
28931
28945
  type: e.type || "text",
28932
28946
  name: e.name || null,
28933
28947
  id: e.id || null,
28934
- label: XO(e),
28948
+ label: ZO(e),
28935
28949
  placeholder: e.placeholder || null
28936
28950
  }));
28937
28951
  }
28938
- function $O() {
28952
+ function ek() {
28939
28953
  let e = [];
28940
- return JO((t) => {
28954
+ return YO((t) => {
28941
28955
  e.push(...Array.from(t.querySelectorAll("button, [role=\"button\"], input[type=\"submit\"], input[type=\"button\"]")).filter((e) => {
28942
- if (KO(e) || e.disabled) return !1;
28956
+ if (qO(e) || e.disabled) return !1;
28943
28957
  try {
28944
- let t = qO(e);
28958
+ let t = JO(e);
28945
28959
  if (t.display === "none" || t.visibility === "hidden") return !1;
28946
28960
  } catch {}
28947
28961
  return !0;
@@ -28953,15 +28967,15 @@ function $O() {
28953
28967
  type: e.type || e.tagName
28954
28968
  }));
28955
28969
  }
28956
- function ek(e) {
28970
+ function tk(e) {
28957
28971
  return String(e || "").toLowerCase().replace(/\u00a0/g, " ").replace(/\*/g, "").replace(/\s+/g, " ").trim();
28958
28972
  }
28959
- function tk(e) {
28960
- let t = ek(e);
28973
+ function nk(e) {
28974
+ let t = tk(e);
28961
28975
  return t = t.replace(/\s+field\s*$/i, "").trim(), t;
28962
28976
  }
28963
- function nk(e, t) {
28964
- let n = tk(t);
28977
+ function rk(e, t) {
28978
+ let n = nk(t);
28965
28979
  if (!n) return 0;
28966
28980
  let r = (e.name || "").toLowerCase(), i = (e.id || "").toLowerCase();
28967
28981
  if (r === "url" && /url|website|domain|site|audit/.test(n) || (i === "url-input" || i.endsWith("-url-input")) && /url|website|domain|site|audit/.test(n)) return 100;
@@ -28969,12 +28983,12 @@ function nk(e, t) {
28969
28983
  e.name,
28970
28984
  e.id,
28971
28985
  e.placeholder,
28972
- XO(e),
28986
+ ZO(e),
28973
28987
  e.getAttribute("aria-label"),
28974
28988
  e.getAttribute("title"),
28975
28989
  e.getAttribute("data-testid"),
28976
28990
  e.getAttribute("autocomplete")
28977
- ].filter(Boolean).map((e) => ek(e)), o = 0;
28991
+ ].filter(Boolean).map((e) => tk(e)), o = 0;
28978
28992
  for (let e of a) {
28979
28993
  if (!e) continue;
28980
28994
  if (e.includes(n) || n.includes(e)) {
@@ -28989,16 +29003,16 @@ function nk(e, t) {
28989
29003
  }
28990
29004
  return o;
28991
29005
  }
28992
- var rk = 28;
28993
- function ik(e, t) {
29006
+ var ik = 28;
29007
+ function ak(e, t) {
28994
29008
  let n = null, r = 0;
28995
29009
  for (let i of e) {
28996
- let e = nk(i, t);
29010
+ let e = rk(i, t);
28997
29011
  e > r && (r = e, n = i);
28998
29012
  }
28999
- return !n || r < rk ? null : n;
29013
+ return !n || r < ik ? null : n;
29000
29014
  }
29001
- function ak(e, t, n) {
29015
+ function ok(e, t, n) {
29002
29016
  let r = String(t || "").toLowerCase().trim(), i = String(n || "").trim();
29003
29017
  if (!(/^https?:\/\//i.test(i) || /\.\w{2,}(\/|\s|$)/.test(i) || r.includes("url") || r.includes("website") || r.includes("domain") || r.includes("site"))) return null;
29004
29018
  let a = null, o = 0;
@@ -29018,7 +29032,7 @@ function ak(e, t, n) {
29018
29032
  t.name,
29019
29033
  t.id,
29020
29034
  t.placeholder,
29021
- XO(t),
29035
+ ZO(t),
29022
29036
  t.getAttribute("aria-label"),
29023
29037
  t.getAttribute("autocomplete")
29024
29038
  ].filter(Boolean).join(" ").toLowerCase();
@@ -29026,15 +29040,15 @@ function ak(e, t, n) {
29026
29040
  }
29027
29041
  return !a || o < 42 ? null : a;
29028
29042
  }
29029
- function ok(e) {
29043
+ function sk(e) {
29030
29044
  let t = String(e ?? "").trim();
29031
29045
  return t ? /^https?:\/\//i.test(t) ? !0 : /\.\w{2,}(\/|\s|$)/.test(t) : !1;
29032
29046
  }
29033
- function sk(e) {
29047
+ function ck(e) {
29034
29048
  let t = String(e ?? "").toLowerCase().trim();
29035
29049
  return t ? !!(t === "url" || t === "website" || t === "website url" || t === "website_url" || t === "enter website url" || t.includes("website") || t.includes("domain") || /(enter\s+website|site\s*url|page\s*url)/.test(t)) : !1;
29036
29050
  }
29037
- function ck(e) {
29051
+ function lk(e) {
29038
29052
  if (!e || e.tagName !== "INPUT" && e.tagName !== "TEXTAREA") return !1;
29039
29053
  let t = (e.type || "").toLowerCase();
29040
29054
  return ![
@@ -29046,22 +29060,22 @@ function ck(e) {
29046
29060
  "file"
29047
29061
  ].includes(t);
29048
29062
  }
29049
- function lk(e) {
29050
- if (!ck(e)) return !1;
29063
+ function uk(e) {
29064
+ if (!lk(e)) return !1;
29051
29065
  let t = (e.name || "").toLowerCase(), n = (e.id || "").toLowerCase(), r = [
29052
29066
  e.name,
29053
29067
  e.id,
29054
29068
  e.placeholder,
29055
- XO(e),
29069
+ ZO(e),
29056
29070
  e.getAttribute("aria-label")
29057
29071
  ].filter(Boolean).join(" ").toLowerCase();
29058
29072
  return t === "url" || n === "url-input" || n.endsWith("-url-input") || /(website\s*url|enter\s+website|site\s*url)/.test(r) || /(website|domain)/.test(r) && /(url|site)/.test(r);
29059
29073
  }
29060
- function uk(e, t, n) {
29061
- let r = String(t ?? ""), i = String(n ?? ""), a = pk(e, r) || ik(e, r) || ak(e, r, i);
29074
+ function dk(e, t, n) {
29075
+ let r = String(t ?? ""), i = String(n ?? ""), a = mk(e, r) || ak(e, r) || ok(e, r, i);
29062
29076
  if (!a) return [];
29063
29077
  let o = new Set([a]);
29064
- if (ok(i) && sk(r)) for (let t of e) t !== a && lk(t) && o.add(t);
29078
+ if (sk(i) && ck(r)) for (let t of e) t !== a && uk(t) && o.add(t);
29065
29079
  let s = Array.from(o);
29066
29080
  return s.sort((e, t) => {
29067
29081
  if (e === t) return 0;
@@ -29069,7 +29083,7 @@ function uk(e, t, n) {
29069
29083
  return n & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : n & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
29070
29084
  }), s;
29071
29085
  }
29072
- function dk(e, t) {
29086
+ function fk(e, t) {
29073
29087
  try {
29074
29088
  if (!e?.getBoundingClientRect || !t?.getBoundingClientRect) return Infinity;
29075
29089
  let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
@@ -29084,17 +29098,17 @@ function dk(e, t) {
29084
29098
  return Infinity;
29085
29099
  }
29086
29100
  }
29087
- function fk(e) {
29101
+ function pk(e) {
29088
29102
  if (!e || typeof e != "string") return null;
29089
29103
  let t = null;
29090
- return JO((n) => {
29104
+ return YO((n) => {
29091
29105
  try {
29092
29106
  let r = n.getElementById(e);
29093
- r && !KO(r) && r.matches?.("input, select, textarea") && (t = r);
29107
+ r && !qO(r) && r.matches?.("input, select, textarea") && (t = r);
29094
29108
  } catch {}
29095
29109
  }), t;
29096
29110
  }
29097
- function pk(e, t) {
29111
+ function mk(e, t) {
29098
29112
  let n = String(t ?? "").trim();
29099
29113
  if (!n) return null;
29100
29114
  let r = n.match(/^name:\s*([\w.-]+)$/i);
@@ -29104,12 +29118,12 @@ function pk(e, t) {
29104
29118
  }
29105
29119
  let i = n.match(/^id:\s*([\w.-]+)$/i);
29106
29120
  if (i) {
29107
- let e = fk(i[1]);
29121
+ let e = pk(i[1]);
29108
29122
  if (e) return e;
29109
29123
  }
29110
29124
  let a = n.startsWith("#") ? n.slice(1) : n;
29111
29125
  if (/^[\w-]+$/.test(a)) {
29112
- let e = fk(a);
29126
+ let e = pk(a);
29113
29127
  if (e) return e;
29114
29128
  }
29115
29129
  let o = n.toLowerCase().replace(/\s+/g, " ");
@@ -29119,7 +29133,7 @@ function pk(e, t) {
29119
29133
  }
29120
29134
  return null;
29121
29135
  }
29122
- function mk(e, t) {
29136
+ function hk(e, t) {
29123
29137
  let n = String(t || "").toLowerCase().trim();
29124
29138
  if (!n) return 0;
29125
29139
  let r = [
@@ -29135,13 +29149,13 @@ function mk(e, t) {
29135
29149
  for (let e of i) r.includes(e) && (a += 1);
29136
29150
  return a / i.length * 92;
29137
29151
  }
29138
- function hk(e, t) {
29152
+ function gk(e, t) {
29139
29153
  let n = [];
29140
- JO((e) => {
29154
+ YO((e) => {
29141
29155
  n.push(...Array.from(e.querySelectorAll("button, [role=\"button\"], input[type=\"submit\"], input[type=\"button\"]")).filter((e) => {
29142
- if (KO(e) || e.disabled) return !1;
29156
+ if (qO(e) || e.disabled) return !1;
29143
29157
  try {
29144
- let t = qO(e);
29158
+ let t = JO(e);
29145
29159
  if (t.display === "none" || t.visibility === "hidden") return !1;
29146
29160
  } catch {}
29147
29161
  return !0;
@@ -29149,7 +29163,7 @@ function hk(e, t) {
29149
29163
  });
29150
29164
  let r = 0, i = n.map((t) => ({
29151
29165
  el: t,
29152
- s: mk(t, e)
29166
+ s: hk(t, e)
29153
29167
  }));
29154
29168
  for (let { s: e } of i) e > r && (r = e);
29155
29169
  if (r < 36) return null;
@@ -29159,14 +29173,14 @@ function hk(e, t) {
29159
29173
  if (o.length) {
29160
29174
  let e = a[0], t = Infinity;
29161
29175
  for (let n of a) for (let r of o) {
29162
- let i = dk(n, r);
29176
+ let i = fk(n, r);
29163
29177
  i < t && (t = i, e = n);
29164
29178
  }
29165
29179
  return e;
29166
29180
  }
29167
29181
  return a[0];
29168
29182
  }
29169
- function gk(e) {
29183
+ function _k(e) {
29170
29184
  if (e == null) return {};
29171
29185
  if (typeof e == "string") {
29172
29186
  let t = e.trim();
@@ -29179,8 +29193,8 @@ function gk(e) {
29179
29193
  }
29180
29194
  return e;
29181
29195
  }
29182
- function _k(e) {
29183
- let t = gk(e);
29196
+ function vk(e) {
29197
+ let t = _k(e);
29184
29198
  if (Array.isArray(t) && t.length > 0) {
29185
29199
  let e = t[0];
29186
29200
  if (e?.field_key != null || e?.fieldKey != null) return t.map((e) => ({
@@ -29208,7 +29222,7 @@ function _k(e) {
29208
29222
  value: e?.value ?? e?.Value
29209
29223
  })) : [];
29210
29224
  }
29211
- function vk(e) {
29225
+ function yk(e) {
29212
29226
  if (!e || typeof e != "string") return [];
29213
29227
  let t = e.trim();
29214
29228
  if (!t || /\b[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}\b/i.test(t)) return [];
@@ -29227,7 +29241,7 @@ function vk(e) {
29227
29241
  }
29228
29242
  return [];
29229
29243
  }
29230
- function yk(e) {
29244
+ function bk(e) {
29231
29245
  if (!e || typeof e != "string") return [];
29232
29246
  let t = e.trim();
29233
29247
  if (!t) return [];
@@ -29263,17 +29277,17 @@ function yk(e) {
29263
29277
  }
29264
29278
  return n;
29265
29279
  }
29266
- function bk(e) {
29280
+ function xk(e) {
29267
29281
  if (!e || typeof e != "object") return null;
29268
29282
  let t = e.url ?? e.target_url ?? e.page_url ?? e.pageUrl ?? e.link ?? e.href ?? e.path;
29269
29283
  return t == null ? null : String(t).trim() || null;
29270
29284
  }
29271
- function xk(e) {
29285
+ function Sk(e) {
29272
29286
  if (!e || typeof e != "object") return null;
29273
29287
  let t = e.query ?? e.q ?? e.search ?? e.text ?? e.keywords;
29274
29288
  return t == null ? null : String(t).trim() || null;
29275
29289
  }
29276
- function Sk(e, t, n) {
29290
+ function Ck(e, t, n) {
29277
29291
  if (!n?.skipScroll) try {
29278
29292
  e.scrollIntoView({
29279
29293
  block: "center",
@@ -29328,7 +29342,7 @@ function Sk(e, t, n) {
29328
29342
  } catch {}
29329
29343
  return !0;
29330
29344
  }
29331
- function Ck() {
29345
+ function wk() {
29332
29346
  let e = {};
29333
29347
  document.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach((t) => {
29334
29348
  if (t.id) return;
@@ -29343,11 +29357,21 @@ function Ck() {
29343
29357
  e[r] = !0, t.id = r;
29344
29358
  });
29345
29359
  }
29346
- function wk(e) {
29360
+ var Tk = 5e3, Ek = [], Dk = !1;
29361
+ async function Ok() {
29362
+ if (!Dk) {
29363
+ for (Dk = !0; Ek.length > 0;) {
29364
+ let { el: e, label: t, resolve: n } = Ek.shift();
29365
+ CD(e), $("flowengage_highlight ✓ (queued)", t), n(`OK_HIGHLIGHT: "${t}". Continue speaking naturally — do NOT announce the highlight.`), Ek.length > 0 && await WO(Tk);
29366
+ }
29367
+ Dk = !1;
29368
+ }
29369
+ }
29370
+ function kk(e) {
29347
29371
  let t = e.siteId || null, n = (e.apiBaseUrl || "").replace(/\/$/, ""), r = typeof e.getLastUserVoiceText == "function" ? e.getLastUserVoiceText : null, i = [], a = {
29348
29372
  flowengage_navigate: async (n) => {
29349
29373
  $("flowengage_navigate ▶ raw parameters:", n);
29350
- let i = gk(n), a = bk(i), o = i.section_text ?? i.sectionText ?? i.section, s = Array.isArray(i.expected_landmarks) ? i.expected_landmarks : Array.isArray(i.expectedLandmarks) ? i.expectedLandmarks : [];
29374
+ let i = _k(n), a = xk(i), o = i.section_text ?? i.sectionText ?? i.section, s = Array.isArray(i.expected_landmarks) ? i.expected_landmarks : Array.isArray(i.expectedLandmarks) ? i.expectedLandmarks : [];
29351
29375
  if ($("flowengage_navigate · coerced:", {
29352
29376
  url: a,
29353
29377
  sectionText: o,
@@ -29394,7 +29418,15 @@ function wk(e) {
29394
29418
  let e = new URL(a, window.location.origin).pathname, t = Date.now() + 2e3;
29395
29419
  for (; Date.now() < t && !(typeof window < "u" && window.location.pathname === e);) await new Promise((e) => setTimeout(e, 80));
29396
29420
  let n = typeof window < "u" ? window.location.pathname : e, r = typeof window < "u" ? window.location.href : a, i = n === e, o = (n.split("/").filter(Boolean).pop() || "").replace(/[-_]/g, " ").replace(/\b\w/g, (e) => e.toUpperCase()) || "Home";
29397
- return $("flowengage_navigate → SPA nav complete. target:", e, "actual:", n), i ? (wr(), `OK_NAVIGATE_SPA. Visitor is now on: ${r} (page: "${o}"). Do NOT say "I have navigated you" or "I've taken you to" — the page is already loaded visually. Start immediately with highlights and content about THIS page.`) : (wr(), `OK_NAVIGATE_SPA. CURRENT PAGE IS: ${r} (page: "${o}"). The visitor manually navigated here. Describe THIS page only — do not mention the page you tried to navigate to.`);
29421
+ if ($("flowengage_navigate → SPA nav complete. target:", e, "actual:", n), i) {
29422
+ wr();
29423
+ let e = GO();
29424
+ return `OK_NAVIGATE_SPA. Visitor is now on: ${r} (page: "${o}").${e.length > 0 ? ` Section headings on this page (use these EXACTLY for flowengage_highlight — do not guess): ${e.map((e) => `"${e}"`).join(", ")}.` : ""} Do NOT say "I have navigated you" or "I've taken you to" — the page is already loaded visually. Speak about this page immediately and highlight the first relevant section.`;
29425
+ } else {
29426
+ wr();
29427
+ let e = GO();
29428
+ return `OK_NAVIGATE_SPA. CURRENT PAGE IS: ${r} (page: "${o}").${e.length > 0 ? ` Section headings on this page: ${e.map((e) => `"${e}"`).join(", ")}.` : ""} The visitor manually navigated here. Describe THIS page only — do not mention the page you tried to navigate to.`;
29429
+ }
29398
29430
  } catch {}
29399
29431
  return "OK_NAVIGATE_RELOADING. Navigating to the page now; the voice session will resume automatically on the new page. When the session resumes, immediately introduce the new page and continue guiding the visitor — do not wait for the user to speak first.";
29400
29432
  } catch (e) {
@@ -29410,14 +29442,20 @@ function wk(e) {
29410
29442
  },
29411
29443
  flowengage_highlight: async (e) => {
29412
29444
  $("flowengage_highlight ▶", e);
29413
- let t = gk(e), n = t?.section_id || t?.sectionId, r = t?.section_text || t?.sectionText;
29414
- Ck();
29415
- let i = hr(n || null, r || null);
29416
- return !i && r && (await new Promise((e) => setTimeout(e, 500)), Ck(), i = hr(null, r)), i ? (CD(i), $("flowengage_highlight ✓", r || n), `OK_HIGHLIGHT: "${r || n}". Continue immediately with your next sentence about this section — do NOT say "I've highlighted", "let me highlight", or anything about the highlight action. Just keep speaking naturally.`) : ($("flowengage_highlight ✖ no element for:", r || n), `HIGHLIGHT_NOT_FOUND: "${r || n}" — the section heading was not found on this page. Do NOT say "I apologize", "I'm sorry", "I couldn't find", or anything about a missing section. Continue speaking your next sentence about the content naturally. Try a shorter phrase next time (e.g. first 2-3 words of the heading).`);
29445
+ let t = _k(e), n = t?.section_id || t?.sectionId, r = t?.section_text || t?.sectionText, i = r || n || "";
29446
+ wk();
29447
+ let a = hr(n || null, r || null);
29448
+ return !a && r && (await new Promise((e) => setTimeout(e, 500)), wk(), a = hr(null, r)), a ? new Promise((e) => {
29449
+ Ek.push({
29450
+ el: a,
29451
+ label: i,
29452
+ resolve: e
29453
+ }), Ok();
29454
+ }) : ($("flowengage_highlight ✖ no element for:", i), `HIGHLIGHT_NOT_FOUND: "${i}" — section not found. Do NOT apologize or mention this. Continue speaking naturally. Try a shorter phrase (first 2-3 words) next time.`);
29417
29455
  },
29418
29456
  flowengage_read_content: async (e) => {
29419
29457
  $("flowengage_read_content ▶", e);
29420
- let t = gk(e), n = t?.section_text || t?.sectionText || "";
29458
+ let t = _k(e), n = t?.section_text || t?.sectionText || "";
29421
29459
  try {
29422
29460
  let e = "";
29423
29461
  if (n) {
@@ -29440,7 +29478,7 @@ function wk(e) {
29440
29478
  },
29441
29479
  flowengage_search: async (e) => {
29442
29480
  $("flowengage_search ▶", e);
29443
- let r = xk(gk(e));
29481
+ let r = Sk(_k(e));
29444
29482
  if ($("flowengage_search · query:", r, "siteId:", t, "apiBase:", n || "(empty)"), !r) return $("flowengage_search ✖ missing query"), "Missing query parameter.";
29445
29483
  if (!t) return $("flowengage_search ✖ no siteId"), "Site is not configured for search.";
29446
29484
  if (!n) return $("flowengage_search ✖ no api base"), "API base URL is missing; cannot search.";
@@ -29472,7 +29510,7 @@ function wk(e) {
29472
29510
  },
29473
29511
  flowengage_page_content: async (e) => {
29474
29512
  $("flowengage_page_content ▶", e);
29475
- let r = gk(e), i = r?.url || r?.page_url || "";
29513
+ let r = _k(e), i = r?.url || r?.page_url || "";
29476
29514
  if ($("flowengage_page_content · url:", i, "siteId:", t, "apiBase:", n || "(empty)"), !i) return $("flowengage_page_content ✖ missing url"), "Missing url parameter.";
29477
29515
  if (!t) return $("flowengage_page_content ✖ no siteId"), "Site is not configured.";
29478
29516
  if (!n) return $("flowengage_page_content ✖ no api base"), "API base URL is missing; cannot fetch page content.";
@@ -29513,7 +29551,7 @@ function wk(e) {
29513
29551
  }), `CURRENT_PAGE. URL: ${e} | Path: ${t} | Title: ${n}. Use THIS as the definitive current page — not any previously navigated URL.`;
29514
29552
  },
29515
29553
  flowengage_list_forms: async () => {
29516
- let e = QO(), t = $O();
29554
+ let e = $O(), t = ek();
29517
29555
  return $("flowengage_list_forms ✓", `${e.length} field(s)`, `${t.length} button(s)`), JSON.stringify({
29518
29556
  fields: e,
29519
29557
  buttons: t,
@@ -29523,10 +29561,10 @@ function wk(e) {
29523
29561
  flowengage_fill_form: async (e) => {
29524
29562
  try {
29525
29563
  $("flowengage_fill_form ▶ raw:", e), MO();
29526
- let t = _k(e);
29564
+ let t = vk(e);
29527
29565
  if (!t.length && r) {
29528
- let e = r(), n = vk(e);
29529
- n.length ? $("flowengage_fill_form · inferred URL from last user utterance (model omitted usable fields):", n) : (n = yk(e), n.length && $("flowengage_fill_form · inferred contact fields from last user utterance (empty tool params):", n)), n.length && (t = n);
29566
+ let e = r(), n = yk(e);
29567
+ n.length ? $("flowengage_fill_form · inferred URL from last user utterance (model omitted usable fields):", n) : (n = bk(e), n.length && $("flowengage_fill_form · inferred contact fields from last user utterance (empty tool params):", n)), n.length && (t = n);
29530
29568
  }
29531
29569
  if ($("flowengage_fill_form · normalized fields:", t), !t.length) return "No fields provided. Call flowengage_list_forms for field_key strings, then flowengage_fill_form with { \"fields\": [ { \"field_key\": \"<label or placeholder from list>\", \"value\": \"<user value>\" } ] }. Never use empty {}. Pass the value the user just said (email, message, name, URL) in fields.";
29532
29570
  let n = [];
@@ -29534,14 +29572,14 @@ function wk(e) {
29534
29572
  let t = e?.field_key ?? e?.fieldKey, r = e?.value;
29535
29573
  if (t == null || r == null) continue;
29536
29574
  TO(`Filling ${String(t)}...`, { spinner: !0 });
29537
- let a = ZO(), o = uk(a, String(t), r);
29575
+ let a = QO(), o = dk(a, String(t), r);
29538
29576
  if (o.length) {
29539
- for (let [e, t] of o.entries()) NO(t), await zO(t), Sk(t, r, { skipScroll: e > 0 }), PO(t), await WO(120);
29577
+ for (let [e, t] of o.entries()) NO(t), await zO(t), Ck(t, r, { skipScroll: e > 0 }), PO(t), await WO(120);
29540
29578
  i = o, n.push(String(t));
29541
29579
  continue;
29542
29580
  }
29543
- let s = pk(a, String(t));
29544
- s ||= ik(a, String(t)), s ||= ak(a, String(t), r), s && (NO(s), await zO(s), Sk(s, r), PO(s), await WO(120), i = [s], n.push(String(t)));
29581
+ let s = mk(a, String(t));
29582
+ s ||= ak(a, String(t)), s ||= ok(a, String(t), r), s && (NO(s), await zO(s), Ck(s, r), PO(s), await WO(120), i = [s], n.push(String(t)));
29545
29583
  }
29546
29584
  if (!n.length) return $("flowengage_fill_form ✖ no matches"), "Could not match any fields. Call flowengage_list_forms and use field_key values that match placeholder, label, name, or id (e.g. Enter Website URL). Ensure the form is on the page, not the chat panel.";
29547
29585
  let a = `OK_FILLED: ${n.join(", ")}`;
@@ -29562,9 +29600,9 @@ function wk(e) {
29562
29600
  }
29563
29601
  },
29564
29602
  flowengage_click_button: async (e) => {
29565
- let t = gk(e), n = (t.button_text ?? t.buttonText ?? t.text ?? "").trim();
29603
+ let t = _k(e), n = (t.button_text ?? t.buttonText ?? t.text ?? "").trim();
29566
29604
  if ($("flowengage_click_button ▶", n), !n) return "Missing button_text: pass the visible label, e.g. Conduct Audit.";
29567
- let r = hk(n, i);
29605
+ let r = gk(n, i);
29568
29606
  if (!r) return $("flowengage_click_button ✖ no match"), `Could not find a button matching "${n}". Call flowengage_list_forms to see button texts.`;
29569
29607
  try {
29570
29608
  TO(`Clicking ${n}...`, { spinner: !0 });
@@ -29608,7 +29646,7 @@ function wk(e) {
29608
29646
  }
29609
29647
  //#endregion
29610
29648
  //#region src/utils/wrapVoiceToolsForLogging.js
29611
- function Tk(e) {
29649
+ function Ak(e) {
29612
29650
  return !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).map(([e, t]) => [e, async (n) => {
29613
29651
  let r = Rn();
29614
29652
  r ? console.log("[FlowEngage:voice-tool] ▶", e, n) : console.info(`[FlowEngage] voice tool » ${e}`);
@@ -29625,7 +29663,7 @@ function Tk(e) {
29625
29663
  }
29626
29664
  //#endregion
29627
29665
  //#region src/components/FlowEngageWidget.jsx
29628
- var Ek = {
29666
+ var jk = {
29629
29667
  blue: "#135bd8",
29630
29668
  red: "#ef334b",
29631
29669
  yellow: "#ffbd2e",
@@ -29633,7 +29671,7 @@ var Ek = {
29633
29671
  highlight: "rgba(255,255,255,0.9)",
29634
29672
  green: "#10b981"
29635
29673
  };
29636
- function Dk(e) {
29674
+ function Mk(e) {
29637
29675
  if (!Array.isArray(e) || e.length < 2) return "linear-gradient(145deg, #dce8f022 0%, #e8dff522 45%, #f5e0e022 100%), #f7f8fa";
29638
29676
  let [t, n, r] = e;
29639
29677
  return e.length >= 3 && r ? [
@@ -29647,12 +29685,12 @@ function Dk(e) {
29647
29685
  "#f7f8fa"
29648
29686
  ].join(", ");
29649
29687
  }
29650
- function Ok(e) {
29688
+ function Nk(e) {
29651
29689
  if (!e || typeof e != "string") return "#1a1a1a";
29652
29690
  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;
29653
29691
  return .2126 * o(r) + .7152 * o(i) + .0722 * o(a) > .179 ? "#1a1a1a" : "#ffffff";
29654
29692
  }
29655
- function kk({ logo: t, style: n }) {
29693
+ function Pk({ logo: t, style: n }) {
29656
29694
  if (!t) return null;
29657
29695
  if (typeof t == "string") return /* @__PURE__ */ g("img", {
29658
29696
  src: t,
@@ -29677,7 +29715,7 @@ function kk({ logo: t, style: n }) {
29677
29715
  children: r
29678
29716
  }) : null;
29679
29717
  }
29680
- function Ak({ title: e }) {
29718
+ function Fk({ title: e }) {
29681
29719
  return /* @__PURE__ */ g("div", {
29682
29720
  style: {
29683
29721
  width: "100%",
@@ -29695,18 +29733,18 @@ function Ak({ title: e }) {
29695
29733
  children: String(e || "FE").split(/\s+/).filter(Boolean).slice(0, 2).map((e) => e[0]?.toUpperCase() || "").join("") || "FE"
29696
29734
  });
29697
29735
  }
29698
- function jk(e, t) {
29736
+ function Ik(e, t) {
29699
29737
  let n = (t || "").trim();
29700
29738
  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;
29701
29739
  }
29702
- function Mk({ orbColors: e, ...t }) {
29740
+ function Lk({ orbColors: e, ...t }) {
29703
29741
  return /* @__PURE__ */ g(dO, {
29704
29742
  colors: e,
29705
29743
  ...t
29706
29744
  });
29707
29745
  }
29708
- function Nk({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMobile: a, isClosing: o }) {
29709
- let s = n || Ek.green, c = Ok(s), l = a ? 72 : 94, u = /* @__PURE__ */ _("div", {
29746
+ function Rk({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMobile: a, isClosing: o }) {
29747
+ let s = n || jk.green, c = Nk(s), l = a ? 72 : 94, u = /* @__PURE__ */ _("div", {
29710
29748
  style: {
29711
29749
  display: "flex",
29712
29750
  alignItems: a ? "flex-end" : "center",
@@ -29827,7 +29865,7 @@ function Nk({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMo
29827
29865
  delay: 0
29828
29866
  },
29829
29867
  style: { flexShrink: 0 },
29830
- children: /* @__PURE__ */ g(Mk, {
29868
+ children: /* @__PURE__ */ g(Lk, {
29831
29869
  size: l,
29832
29870
  orbColors: t
29833
29871
  })
@@ -29859,8 +29897,8 @@ function Nk({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMo
29859
29897
  children: u
29860
29898
  })] });
29861
29899
  }
29862
- function Pk({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onClose: a, isMobile: o, isClosing: s }) {
29863
- let c = n || Ek.green, l = Ok(c);
29900
+ function zk({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onClose: a, isMobile: o, isClosing: s }) {
29901
+ let c = n || jk.green, l = Nk(c);
29864
29902
  return /* @__PURE__ */ _(Dm.div, {
29865
29903
  initial: {
29866
29904
  scale: 50 / 350,
@@ -29931,7 +29969,7 @@ function Pk({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onC
29931
29969
  children: /* @__PURE__ */ g("polyline", { points: "6 9 12 15 18 9" })
29932
29970
  })
29933
29971
  }),
29934
- /* @__PURE__ */ g(Mk, {
29972
+ /* @__PURE__ */ g(Lk, {
29935
29973
  size: 72,
29936
29974
  orbColors: t
29937
29975
  }),
@@ -30000,7 +30038,7 @@ function Pk({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onC
30000
30038
  ]
30001
30039
  });
30002
30040
  }
30003
- function Fk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i, siteId: a, apiBaseUrl: s, chatId: l, historyRef: u, onMessageSync: d, voiceEndCounter: f }) {
30041
+ function Bk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i, siteId: a, apiBaseUrl: s, chatId: l, historyRef: u, onMessageSync: d, voiceEndCounter: f }) {
30004
30042
  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") => {
30005
30043
  E.current = e, re.current = !0, queueMicrotask(() => {
30006
30044
  ee.current || (ee.current = !0, T.current?.());
@@ -30082,7 +30120,7 @@ function Fk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30082
30120
  }
30083
30121
  Ne();
30084
30122
  } });
30085
- let t = Tk(wk({
30123
+ let t = Ak(kk({
30086
30124
  siteId: a || null,
30087
30125
  apiBaseUrl: s || null,
30088
30126
  getLastUserVoiceText: () => w.current,
@@ -30155,7 +30193,7 @@ function Fk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30155
30193
  let e = bO(u.current);
30156
30194
  e && Ae(a, e);
30157
30195
  } catch {}
30158
- if (jk(n, r)) {
30196
+ if (Ik(n, r)) {
30159
30197
  pe("minimized");
30160
30198
  return;
30161
30199
  }
@@ -30319,7 +30357,7 @@ function Fk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30319
30357
  },
30320
30358
  children: "Muted"
30321
30359
  }),
30322
- /* @__PURE__ */ g(Mk, {
30360
+ /* @__PURE__ */ g(Lk, {
30323
30361
  size: 72,
30324
30362
  voiceState: h,
30325
30363
  isMuted: y,
@@ -30557,7 +30595,7 @@ function Fk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30557
30595
  ]
30558
30596
  });
30559
30597
  }
30560
- function Ik({ orbColors: e }) {
30598
+ function Vk({ orbColors: e }) {
30561
30599
  return /* @__PURE__ */ g("div", {
30562
30600
  style: {
30563
30601
  flexShrink: 0,
@@ -30567,13 +30605,13 @@ function Ik({ orbColors: e }) {
30567
30605
  alignItems: "center",
30568
30606
  justifyContent: "center"
30569
30607
  },
30570
- children: /* @__PURE__ */ g(Mk, {
30608
+ children: /* @__PURE__ */ g(Lk, {
30571
30609
  size: 36,
30572
30610
  orbColors: e
30573
30611
  })
30574
30612
  });
30575
30613
  }
30576
- var Lk = () => /* @__PURE__ */ g("div", {
30614
+ var Hk = () => /* @__PURE__ */ g("div", {
30577
30615
  style: {
30578
30616
  display: "flex",
30579
30617
  marginBottom: "12px",
@@ -30603,7 +30641,7 @@ var Lk = () => /* @__PURE__ */ g("div", {
30603
30641
  } }, e))
30604
30642
  })
30605
30643
  });
30606
- function Rk({ 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 }) {
30644
+ 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 }) {
30607
30645
  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 () => {
30608
30646
  Le(!1), ze(!0), Ue(!0), Ge(null);
30609
30647
  try {
@@ -30728,7 +30766,7 @@ function Rk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
30728
30766
  justifyContent: "center",
30729
30767
  height: "40px"
30730
30768
  },
30731
- children: i ? /* @__PURE__ */ g(kk, {
30769
+ children: i ? /* @__PURE__ */ g(Pk, {
30732
30770
  logo: i,
30733
30771
  style: {
30734
30772
  height: "34px",
@@ -30741,7 +30779,7 @@ function Rk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
30741
30779
  height: "40px",
30742
30780
  flexShrink: 0
30743
30781
  },
30744
- children: /* @__PURE__ */ g(Ak, { title: e.chatTitle })
30782
+ children: /* @__PURE__ */ g(Fk, { title: e.chatTitle })
30745
30783
  })
30746
30784
  }), /* @__PURE__ */ g("div", {
30747
30785
  style: {
@@ -31229,11 +31267,11 @@ function Rk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
31229
31267
  isLoading: T,
31230
31268
  isAgentTyping: d,
31231
31269
  setReplyContext: de,
31232
- TypingDots: Lk,
31270
+ TypingDots: Hk,
31233
31271
  primaryColor: n,
31234
31272
  agentHeadshot: y,
31235
31273
  agentDisplayName: v || b,
31236
- botAvatarNode: /* @__PURE__ */ g(Ik, { orbColors: t })
31274
+ botAvatarNode: /* @__PURE__ */ g(Vk, { orbColors: t })
31237
31275
  }) : Me ? /* @__PURE__ */ _("div", {
31238
31276
  style: {
31239
31277
  flex: 1,
@@ -31274,7 +31312,7 @@ function Rk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
31274
31312
  padding: "28px 24px"
31275
31313
  },
31276
31314
  children: [
31277
- /* @__PURE__ */ g(Mk, {
31315
+ /* @__PURE__ */ g(Lk, {
31278
31316
  size: 94,
31279
31317
  orbColors: t
31280
31318
  }),
@@ -31415,7 +31453,7 @@ function Rk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
31415
31453
  ]
31416
31454
  });
31417
31455
  }
31418
- function zk() {
31456
+ function Wk() {
31419
31457
  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();
31420
31458
  c(() => {
31421
31459
  try {
@@ -31433,7 +31471,7 @@ function zk() {
31433
31471
  }, Fe = {
31434
31472
  ...ke.features || {},
31435
31473
  ...Ae.features || {}
31436
- }, 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 = Dk(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) => ({
31474
+ }, 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) => ({
31437
31475
  id: e.key || `qr-${t}`,
31438
31476
  label: e.label,
31439
31477
  message: e.label,
@@ -31697,7 +31735,7 @@ function zk() {
31697
31735
  onWheel: (e) => e.stopPropagation(),
31698
31736
  onTouchMove: (e) => e.stopPropagation(),
31699
31737
  children: [
31700
- A === "entry_prompt" && /* @__PURE__ */ g(Nk, {
31738
+ A === "entry_prompt" && /* @__PURE__ */ g(Rk, {
31701
31739
  copy: Ze,
31702
31740
  orbColors: Re,
31703
31741
  primaryColor: ze,
@@ -31780,13 +31818,13 @@ function zk() {
31780
31818
  children: ee === "connected" ? `${Ht(_t)} with ${nt}` : `Tap to return to ${nt}`
31781
31819
  })]
31782
31820
  })]
31783
- }), /* @__PURE__ */ g(Mk, {
31821
+ }), /* @__PURE__ */ g(Lk, {
31784
31822
  size: 50,
31785
31823
  orbColors: Re,
31786
31824
  onClick: T && Dt ? Lt : Ie ? Kt : Jt
31787
31825
  })]
31788
31826
  }),
31789
- A === "connection_modal" && /* @__PURE__ */ g(Pk, {
31827
+ A === "connection_modal" && /* @__PURE__ */ g(zk, {
31790
31828
  copy: Ze,
31791
31829
  orbColors: Re,
31792
31830
  primaryColor: ze,
@@ -31796,7 +31834,7 @@ function zk() {
31796
31834
  isMobile: Nt,
31797
31835
  isClosing: kt
31798
31836
  }),
31799
- A === "voice_mode" && /* @__PURE__ */ g(Fk, {
31837
+ A === "voice_mode" && /* @__PURE__ */ g(Bk, {
31800
31838
  orbColors: Re,
31801
31839
  onEnterChat: Jt,
31802
31840
  onEndChat: Yt,
@@ -31828,7 +31866,7 @@ function zk() {
31828
31866
  orbColors: Re,
31829
31867
  chatHistory: r
31830
31868
  }),
31831
- A === "text_chat" && /* @__PURE__ */ g(Rk, {
31869
+ A === "text_chat" && /* @__PURE__ */ g(Uk, {
31832
31870
  isClosing: kt,
31833
31871
  copy: Ze,
31834
31872
  orbColors: Re,
@@ -31893,7 +31931,7 @@ function zk() {
31893
31931
  }
31894
31932
  //#endregion
31895
31933
  //#region src/components/ErrorBoundary.jsx
31896
- var Bk = class extends e.Component {
31934
+ var Gk = class extends e.Component {
31897
31935
  constructor(e) {
31898
31936
  super(e), this.state = { hasError: !1 };
31899
31937
  }
@@ -31908,4 +31946,4 @@ var Bk = class extends e.Component {
31908
31946
  }
31909
31947
  };
31910
31948
  //#endregion
31911
- export { dO as AnimatedOrb, Bk as ErrorBoundary, Rr as FlowEngageProvider, zk as FlowEngageWidget, Ln as useFlowEngage };
31949
+ export { dO as AnimatedOrb, Gk as ErrorBoundary, Rr as FlowEngageProvider, Wk as FlowEngageWidget, Ln as useFlowEngage };