@flowengage/react-chatbot 6.0.32 → 6.0.34

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.
@@ -506,43 +506,43 @@ var k = (e) => {
506
506
  let l = new ArrayBuffer(t), u = new Uint8Array(l);
507
507
  for (r = 0; r < n; r += 4) a = at[e.charCodeAt(r)], o = at[e.charCodeAt(r + 1)], s = at[e.charCodeAt(r + 2)], c = at[e.charCodeAt(r + 3)], u[i++] = a << 2 | o >> 4, u[i++] = (o & 15) << 4 | s >> 2, u[i++] = (s & 3) << 6 | c & 63;
508
508
  return l;
509
- }, A = typeof ArrayBuffer == "function", ot = (e, t) => {
509
+ }, ot = typeof ArrayBuffer == "function", st = (e, t) => {
510
510
  if (typeof e != "string") return {
511
511
  type: "message",
512
- data: ct(e, t)
512
+ data: lt(e, t)
513
513
  };
514
514
  let n = e.charAt(0);
515
515
  return n === "b" ? {
516
516
  type: "message",
517
- data: st(e.substring(1), t)
517
+ data: ct(e.substring(1), t)
518
518
  } : Je[n] ? e.length > 1 ? {
519
519
  type: Je[n],
520
520
  data: e.substring(1)
521
521
  } : { type: Je[n] } : Ye;
522
- }, st = (e, t) => A ? ct(k(e), t) : {
522
+ }, ct = (e, t) => ot ? lt(k(e), t) : {
523
523
  base64: !0,
524
524
  data: e
525
- }, ct = (e, t) => {
525
+ }, lt = (e, t) => {
526
526
  switch (t) {
527
527
  case "blob": return e instanceof Blob ? e : new Blob([e]);
528
528
  default: return e instanceof ArrayBuffer ? e : e.buffer;
529
529
  }
530
- }, lt = "", ut = (e, t) => {
530
+ }, ut = "", dt = (e, t) => {
531
531
  let n = e.length, r = Array(n), i = 0;
532
532
  e.forEach((e, a) => {
533
533
  $e(e, !1, (e) => {
534
- r[a] = e, ++i === n && t(r.join(lt));
534
+ r[a] = e, ++i === n && t(r.join(ut));
535
535
  });
536
536
  });
537
- }, dt = (e, t) => {
538
- let n = e.split(lt), r = [];
537
+ }, ft = (e, t) => {
538
+ let n = e.split(ut), r = [];
539
539
  for (let e = 0; e < n.length; e++) {
540
- let i = ot(n[e], t);
540
+ let i = st(n[e], t);
541
541
  if (r.push(i), i.type === "error") break;
542
542
  }
543
543
  return r;
544
544
  };
545
- function ft() {
545
+ function pt() {
546
546
  return new TransformStream({ transform(e, t) {
547
547
  rt(e, (n) => {
548
548
  let r = n.length, i;
@@ -560,41 +560,41 @@ function ft() {
560
560
  });
561
561
  } });
562
562
  }
563
- var pt;
564
- function mt(e) {
563
+ var mt;
564
+ function ht(e) {
565
565
  return e.reduce((e, t) => e + t.length, 0);
566
566
  }
567
- function ht(e, t) {
567
+ function gt(e, t) {
568
568
  if (e[0].length === t) return e.shift();
569
569
  let n = new Uint8Array(t), r = 0;
570
570
  for (let i = 0; i < t; i++) n[i] = e[0][r++], r === e[0].length && (e.shift(), r = 0);
571
571
  return e.length && r < e[0].length && (e[0] = e[0].slice(r)), n;
572
572
  }
573
- function gt(e, t) {
574
- pt ||= new TextDecoder();
573
+ function _t(e, t) {
574
+ mt ||= new TextDecoder();
575
575
  let n = [], r = 0, i = -1, a = !1;
576
576
  return new TransformStream({ transform(o, s) {
577
577
  for (n.push(o);;) {
578
578
  if (r === 0) {
579
- if (mt(n) < 1) break;
580
- let e = ht(n, 1);
579
+ if (ht(n) < 1) break;
580
+ let e = gt(n, 1);
581
581
  a = (e[0] & 128) == 128, i = e[0] & 127, r = i < 126 ? 3 : i === 126 ? 1 : 2;
582
582
  } else if (r === 1) {
583
- if (mt(n) < 2) break;
584
- let e = ht(n, 2);
583
+ if (ht(n) < 2) break;
584
+ let e = gt(n, 2);
585
585
  i = new DataView(e.buffer, e.byteOffset, e.length).getUint16(0), r = 3;
586
586
  } else if (r === 2) {
587
- if (mt(n) < 8) break;
588
- let e = ht(n, 8), t = new DataView(e.buffer, e.byteOffset, e.length), a = t.getUint32(0);
587
+ if (ht(n) < 8) break;
588
+ let e = gt(n, 8), t = new DataView(e.buffer, e.byteOffset, e.length), a = t.getUint32(0);
589
589
  if (a > 2 ** 21 - 1) {
590
590
  s.enqueue(Ye);
591
591
  break;
592
592
  }
593
593
  i = a * 2 ** 32 + t.getUint32(4), r = 3;
594
594
  } else {
595
- if (mt(n) < i) break;
596
- let e = ht(n, i);
597
- s.enqueue(ot(a ? e : pt.decode(e), t)), r = 0;
595
+ if (ht(n) < i) break;
596
+ let e = gt(n, i);
597
+ s.enqueue(st(a ? e : mt.decode(e), t)), r = 0;
598
598
  }
599
599
  if (i === 0 || i > e) {
600
600
  s.enqueue(Ye);
@@ -605,21 +605,21 @@ function gt(e, t) {
605
605
  }
606
606
  //#endregion
607
607
  //#region node_modules/@socket.io/component-emitter/lib/esm/index.js
608
- function j(e) {
609
- if (e) return _t(e);
608
+ function A(e) {
609
+ if (e) return vt(e);
610
610
  }
611
- function _t(e) {
612
- for (var t in j.prototype) e[t] = j.prototype[t];
611
+ function vt(e) {
612
+ for (var t in A.prototype) e[t] = A.prototype[t];
613
613
  return e;
614
614
  }
615
- j.prototype.on = j.prototype.addEventListener = function(e, t) {
615
+ A.prototype.on = A.prototype.addEventListener = function(e, t) {
616
616
  return this._callbacks = this._callbacks || {}, (this._callbacks["$" + e] = this._callbacks["$" + e] || []).push(t), this;
617
- }, j.prototype.once = function(e, t) {
617
+ }, A.prototype.once = function(e, t) {
618
618
  function n() {
619
619
  this.off(e, n), t.apply(this, arguments);
620
620
  }
621
621
  return n.fn = t, this.on(e, n), this;
622
- }, j.prototype.off = j.prototype.removeListener = j.prototype.removeAllListeners = j.prototype.removeEventListener = function(e, t) {
622
+ }, A.prototype.off = A.prototype.removeListener = A.prototype.removeAllListeners = A.prototype.removeEventListener = function(e, t) {
623
623
  if (this._callbacks = this._callbacks || {}, arguments.length == 0) return this._callbacks = {}, this;
624
624
  var n = this._callbacks["$" + e];
625
625
  if (!n) return this;
@@ -629,7 +629,7 @@ j.prototype.on = j.prototype.addEventListener = function(e, t) {
629
629
  break;
630
630
  }
631
631
  return n.length === 0 && delete this._callbacks["$" + e], this;
632
- }, j.prototype.emit = function(e) {
632
+ }, A.prototype.emit = function(e) {
633
633
  this._callbacks = this._callbacks || {};
634
634
  for (var t = Array(arguments.length - 1), n = this._callbacks["$" + e], r = 1; r < arguments.length; r++) t[r - 1] = arguments[r];
635
635
  if (n) {
@@ -637,22 +637,22 @@ j.prototype.on = j.prototype.addEventListener = function(e, t) {
637
637
  for (var r = 0, i = n.length; r < i; ++r) n[r].apply(this, t);
638
638
  }
639
639
  return this;
640
- }, j.prototype.emitReserved = j.prototype.emit, j.prototype.listeners = function(e) {
640
+ }, A.prototype.emitReserved = A.prototype.emit, A.prototype.listeners = function(e) {
641
641
  return this._callbacks = this._callbacks || {}, this._callbacks["$" + e] || [];
642
- }, j.prototype.hasListeners = function(e) {
642
+ }, A.prototype.hasListeners = function(e) {
643
643
  return !!this.listeners(e).length;
644
644
  };
645
645
  //#endregion
646
646
  //#region node_modules/engine.io-client/build/esm/globals.js
647
- var vt = typeof Promise == "function" && typeof Promise.resolve == "function" ? (e) => Promise.resolve().then(e) : (e, t) => t(e, 0), yt = typeof self < "u" ? self : typeof window < "u" ? window : Function("return this")(), bt = "arraybuffer";
647
+ var yt = typeof Promise == "function" && typeof Promise.resolve == "function" ? (e) => Promise.resolve().then(e) : (e, t) => t(e, 0), j = typeof self < "u" ? self : typeof window < "u" ? window : Function("return this")(), bt = "arraybuffer";
648
648
  //#endregion
649
649
  //#region node_modules/engine.io-client/build/esm/util.js
650
650
  function xt(e, ...t) {
651
651
  return t.reduce((t, n) => (e.hasOwnProperty(n) && (t[n] = e[n]), t), {});
652
652
  }
653
- var St = yt.setTimeout, Ct = yt.clearTimeout;
653
+ var St = j.setTimeout, Ct = j.clearTimeout;
654
654
  function wt(e, t) {
655
- t.useNativeTimers ? (e.setTimeoutFn = St.bind(yt), e.clearTimeoutFn = Ct.bind(yt)) : (e.setTimeoutFn = yt.setTimeout.bind(yt), e.clearTimeoutFn = yt.clearTimeout.bind(yt));
655
+ t.useNativeTimers ? (e.setTimeoutFn = St.bind(j), e.clearTimeoutFn = Ct.bind(j)) : (e.setTimeoutFn = j.setTimeout.bind(j), e.clearTimeoutFn = j.clearTimeout.bind(j));
656
656
  }
657
657
  var Tt = 1.33;
658
658
  function Et(e) {
@@ -687,7 +687,7 @@ var jt = class extends Error {
687
687
  constructor(e, t, n) {
688
688
  super(e), this.description = t, this.context = n, this.type = "TransportError";
689
689
  }
690
- }, Mt = class extends j {
690
+ }, Mt = class extends A {
691
691
  constructor(e) {
692
692
  super(), this.writable = !1, wt(this, e), this.opts = e, this.query = e.query, this.socket = e.socket, this.supportsBinary = !e.forceBase64;
693
693
  }
@@ -707,7 +707,7 @@ var jt = class extends Error {
707
707
  this.readyState = "open", this.writable = !0, super.emitReserved("open");
708
708
  }
709
709
  onData(e) {
710
- let t = ot(e, this.socket.binaryType);
710
+ let t = st(e, this.socket.binaryType);
711
711
  this.onPacket(t);
712
712
  }
713
713
  onPacket(e) {
@@ -759,7 +759,7 @@ var jt = class extends Error {
759
759
  this._polling = !0, this.doPoll(), this.emitReserved("poll");
760
760
  }
761
761
  onData(e) {
762
- dt(e, this.socket.binaryType).forEach((e) => {
762
+ ft(e, this.socket.binaryType).forEach((e) => {
763
763
  if (this.readyState === "opening" && e.type === "open" && this.onOpen(), e.type === "close") return this.onClose({ description: "transport closed by the server" }), !1;
764
764
  this.onPacket(e);
765
765
  }), this.readyState !== "closed" && (this._polling = !1, this.emitReserved("pollComplete"), this.readyState === "open" && this._poll());
@@ -771,7 +771,7 @@ var jt = class extends Error {
771
771
  this.readyState === "open" ? e() : this.once("open", e);
772
772
  }
773
773
  write(e) {
774
- this.writable = !1, ut(e, (e) => {
774
+ this.writable = !1, dt(e, (e) => {
775
775
  this.doWrite(e, () => {
776
776
  this.writable = !0, this.emitReserved("drain");
777
777
  });
@@ -811,7 +811,7 @@ var Lt = class extends Nt {
811
811
  this.onError("xhr poll error", e, t);
812
812
  }), this.pollXhr = e;
813
813
  }
814
- }, Rt = class e extends j {
814
+ }, Rt = class e extends A {
815
815
  constructor(e, t, n) {
816
816
  super(), this.createRequest = e, wt(this, n), this._opts = n, this._method = n.method || "GET", this._uri = t, this._data = n.data === void 0 ? null : n.data, this._create();
817
817
  }
@@ -870,7 +870,7 @@ var Lt = class extends Nt {
870
870
  if (Rt.requestsCount = 0, Rt.requests = {}, typeof document < "u") {
871
871
  if (typeof attachEvent == "function") attachEvent("onunload", zt);
872
872
  else if (typeof addEventListener == "function") {
873
- let e = "onpagehide" in yt ? "pagehide" : "unload";
873
+ let e = "onpagehide" in j ? "pagehide" : "unload";
874
874
  addEventListener(e, zt, !1);
875
875
  }
876
876
  }
@@ -896,7 +896,7 @@ function Ht(e) {
896
896
  if (typeof XMLHttpRequest < "u" && (!t || Ft)) return new XMLHttpRequest();
897
897
  } catch {}
898
898
  if (!t) try {
899
- return new yt[["Active", "Object"].join("X")]("Microsoft.XMLHTTP");
899
+ return new j[["Active", "Object"].join("X")]("Microsoft.XMLHTTP");
900
900
  } catch {}
901
901
  }
902
902
  //#endregion
@@ -931,7 +931,7 @@ var Ut = typeof navigator < "u" && typeof navigator.product == "string" && navig
931
931
  try {
932
932
  this.doWrite(n, e);
933
933
  } catch {}
934
- r && vt(() => {
934
+ r && yt(() => {
935
935
  this.writable = !0, this.emitReserved("drain");
936
936
  }, this.setTimeoutFn);
937
937
  });
@@ -944,7 +944,7 @@ var Ut = typeof navigator < "u" && typeof navigator.product == "string" && navig
944
944
  let e = this.opts.secure ? "wss" : "ws", t = this.query || {};
945
945
  return this.opts.timestampRequests && (t[this.opts.timestampParam] = Ot()), this.supportsBinary || (t.b64 = 1), this.createUri(e, t);
946
946
  }
947
- }, Gt = yt.WebSocket || yt.MozWebSocket, Kt = {
947
+ }, Gt = j.WebSocket || j.MozWebSocket, Kt = {
948
948
  websocket: class extends Wt {
949
949
  createSocket(e, t, n) {
950
950
  return Ut ? new Gt(e, t, n) : t ? new Gt(e, t) : new Gt(e);
@@ -969,7 +969,7 @@ var Ut = typeof navigator < "u" && typeof navigator.product == "string" && navig
969
969
  this.onError("webtransport error", e);
970
970
  }), this._transport.ready.then(() => {
971
971
  this._transport.createBidirectionalStream().then((e) => {
972
- let t = gt(2 ** 53 - 1, this.socket.binaryType), n = e.readable.pipeThrough(t).getReader(), r = ft();
972
+ let t = _t(2 ** 53 - 1, this.socket.binaryType), n = e.readable.pipeThrough(t).getReader(), r = pt();
973
973
  r.readable.pipeTo(e.writable), this._writer = r.writable.getWriter();
974
974
  let i = () => {
975
975
  n.read().then(({ done: e, value: t }) => {
@@ -987,7 +987,7 @@ var Ut = typeof navigator < "u" && typeof navigator.product == "string" && navig
987
987
  for (let t = 0; t < e.length; t++) {
988
988
  let n = e[t], r = t === e.length - 1;
989
989
  this._writer.write(n).then(() => {
990
- r && vt(() => {
990
+ r && yt(() => {
991
991
  this.writable = !0, this.emitReserved("drain");
992
992
  }, this.setTimeoutFn);
993
993
  });
@@ -1039,7 +1039,7 @@ var Qt = typeof addEventListener == "function" && typeof removeEventListener ==
1039
1039
  Qt && addEventListener("offline", () => {
1040
1040
  $t.forEach((e) => e());
1041
1041
  }, !1);
1042
- var en = class e extends j {
1042
+ var en = class e extends A {
1043
1043
  constructor(e, t) {
1044
1044
  if (super(), this.binaryType = bt, this.writeBuffer = [], this._prevBufferLen = 0, this._pingInterval = -1, this._pingTimeout = -1, this._maxPayload = -1, this._pingTimeoutTime = Infinity, e && typeof e == "object" && (t = e, e = null), e) {
1045
1045
  let n = Yt(e);
@@ -1145,7 +1145,7 @@ var en = class e extends j {
1145
1145
  _hasPingExpired() {
1146
1146
  if (!this._pingTimeoutTime) return !0;
1147
1147
  let e = Date.now() > this._pingTimeoutTime;
1148
- return e && (this._pingTimeoutTime = 0, vt(() => {
1148
+ return e && (this._pingTimeoutTime = 0, yt(() => {
1149
1149
  this._onClose("ping timeout");
1150
1150
  }, this.setTimeoutFn)), e;
1151
1151
  }
@@ -1364,7 +1364,7 @@ var vn = class {
1364
1364
  let t = fn(e), n = this.encodeAsString(t.packet), r = t.buffers;
1365
1365
  return r.unshift(n), r;
1366
1366
  }
1367
- }, yn = class e extends j {
1367
+ }, yn = class e extends A {
1368
1368
  constructor(e) {
1369
1369
  super(), this.opts = Object.assign({
1370
1370
  reviver: void 0,
@@ -1497,7 +1497,7 @@ var On = Object.freeze({
1497
1497
  disconnecting: 1,
1498
1498
  newListener: 1,
1499
1499
  removeListener: 1
1500
- }), kn = class extends j {
1500
+ }), kn = class extends A {
1501
1501
  constructor(e, t, n) {
1502
1502
  super(), this.connected = !1, this.recovered = !1, this.receiveBuffer = [], this.sendBuffer = [], this._queue = [], this._queueSeq = 0, this.ids = 0, this.acks = {}, this.flags = {}, this.io = e, this.nsp = t, n && n.auth && (this.auth = n.auth), this._opts = Object.assign({}, n), this.io._autoConnect && this.open();
1503
1503
  }
@@ -1750,7 +1750,7 @@ An.prototype.duration = function() {
1750
1750
  };
1751
1751
  //#endregion
1752
1752
  //#region node_modules/socket.io-client/build/esm/manager.js
1753
- var jn = class extends j {
1753
+ var jn = class extends A {
1754
1754
  constructor(e, t) {
1755
1755
  super(), this.nsps = {}, this.subs = [], e && typeof e == "object" && (t = e, e = void 0), t ||= {}, t.path = t.path || "/socket.io", this.opts = t, wt(this, t), this.reconnection(t.reconnection !== !1), this.reconnectionAttempts(t.reconnectionAttempts || Infinity), this.reconnectionDelay(t.reconnectionDelay || 1e3), this.reconnectionDelayMax(t.reconnectionDelayMax || 5e3), this.randomizationFactor(t.randomizationFactor ?? .5), this.backoff = new An({
1756
1756
  min: this.reconnectionDelay(),
@@ -1823,7 +1823,7 @@ var jn = class extends j {
1823
1823
  }
1824
1824
  }
1825
1825
  ondecoded(e) {
1826
- vt(() => {
1826
+ yt(() => {
1827
1827
  this.emitReserved("packet", e);
1828
1828
  }, this.setTimeoutFn);
1829
1829
  }
@@ -2836,7 +2836,7 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
2836
2836
  let i = f(() => e ? {
2837
2837
  ...t || {},
2838
2838
  siteId: e
2839
- } : t || null, [e, t]), [a, s] = m(0), [l, u] = m("booting"), [d, h] = m(null), [_, v] = m(null), [y, b] = m(""), [x, S] = m([]), [C, w] = m(ve().isOpen), [T, te] = m(ve().activeScreen), [ne, re] = m(ve().isHumanHandled), [E, D] = m(ve().agentName), [se, de] = m(ve().agentHeadshot), [fe, pe] = m(() => be(i?.siteId)), [me, Se] = m(!1), [Ce, we] = m(!1), [Ee, De] = m("idle"), [Oe, ke] = m(!1), [Ae, je] = m(!1), [Me, Ne] = m(""), [Fe, Ie] = m(!1), [Le, Re] = m(0), [ze, Be] = m(0), [Ve, He] = m(!1), [O, Ue] = m(null), [qe, Je] = m(null), [Ye, Xe] = m("idle"), [Ze, Qe] = m(null), [$e, et] = m(!1), [tt, nt] = m(""), [rt, it] = m(!1), at = p(null), k = p(null), A = p(""), ot = p(!1), st = p(null), ct = p(null), lt = p(null), ut = p(null), dt = p(null), ft = p(null), pt = p([]), mt = p(null), ht = p(null), gt = p(null), j = p(!1), _t = p(!1), vt = p(""), yt = p(null), bt = p(null), xt = p([]), St = p(0), Ct = p(E), wt = p([]), Tt = p(!1), Et = p(!1), Dt = p(i), Ot = p({
2839
+ } : t || null, [e, t]), [a, s] = m(0), [l, u] = m("booting"), [d, h] = m(null), [_, v] = m(null), [y, b] = m(""), [x, S] = m([]), [C, w] = m(ve().isOpen), [T, te] = m(ve().activeScreen), [ne, re] = m(ve().isHumanHandled), [E, D] = m(ve().agentName), [se, de] = m(ve().agentHeadshot), [fe, pe] = m(() => be(i?.siteId)), [me, Se] = m(!1), [Ce, we] = m(!1), [Ee, De] = m("idle"), [Oe, ke] = m(!1), [Ae, je] = m(!1), [Me, Ne] = m(""), [Fe, Ie] = m(!1), [Le, Re] = m(0), [ze, Be] = m(0), [Ve, He] = m(!1), [O, Ue] = m(null), [qe, Je] = m(null), [Ye, Xe] = m("idle"), [Ze, Qe] = m(null), [$e, et] = m(!1), [tt, nt] = m(""), [rt, it] = m(!1), at = p(null), k = p(null), ot = p(""), st = p(!1), ct = p(null), lt = p(null), ut = p(null), dt = p(null), ft = p(null), pt = p(null), mt = p([]), ht = p(null), gt = p(null), _t = p(null), A = p(!1), vt = p(!1), yt = p(""), j = p(null), bt = p(null), xt = p([]), St = p(0), Ct = p(E), wt = p([]), Tt = p(!1), Et = p(!1), Dt = p(i), Ot = p({
2840
2840
  notifyRouteChange: () => {},
2841
2841
  cleanup: () => {}
2842
2842
  }), kt = o((e = {}) => {
@@ -2847,7 +2847,7 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
2847
2847
  return Number.isFinite(t) && t > 0 ? t : ae;
2848
2848
  }, [i, _]);
2849
2849
  c(() => {
2850
- ct.current = O;
2850
+ lt.current = O;
2851
2851
  }, [O]), c(() => {
2852
2852
  Ct.current = E;
2853
2853
  }, [E]), c(() => {
@@ -2858,7 +2858,7 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
2858
2858
  let jt = () => {
2859
2859
  nt("");
2860
2860
  }, Mt = o(() => {
2861
- gt.current &&= (window.clearTimeout(gt.current), null);
2861
+ _t.current &&= (window.clearTimeout(_t.current), null);
2862
2862
  }, []), Nt = (e) => {
2863
2863
  let t = typeof e == "string" ? e.trim().toLowerCase() : "";
2864
2864
  return pe(t), xe(t, i?.siteId), t;
@@ -2868,8 +2868,8 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
2868
2868
  e && pe(be(e));
2869
2869
  }, [i?.siteId]);
2870
2870
  let Pt = (e = "unspecified") => {
2871
- let t = mt.current || ft.current?.callId, n = St.current, r = yt.current;
2872
- if (yt.current = null, St.current = 0, r && r.state !== "inactive") {
2871
+ let t = ht.current || pt.current?.callId, n = St.current, r = j.current;
2872
+ if (j.current = null, St.current = 0, r && r.state !== "inactive") {
2873
2873
  r.onstop = () => {
2874
2874
  let e = xt.current;
2875
2875
  if (xt.current = [], e.length > 0 && t && k.current) {
@@ -2895,18 +2895,18 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
2895
2895
  } catch {}
2896
2896
  bt.current = null;
2897
2897
  }
2898
- lt.current &&= (lt.current.close(), null), ut.current &&= (ut.current.getTracks().forEach((e) => e.stop()), null), dt.current &&= (dt.current.srcObject = null, dt.current.remove(), null), Mt(), ft.current = null, pt.current = [], mt.current = null, ht.current = null, j.current = !1, et(!1), Ue(null), Je(null), Xe("idle"), Qe(null);
2898
+ ut.current &&= (ut.current.close(), null), dt.current &&= (dt.current.getTracks().forEach((e) => e.stop()), null), ft.current &&= (ft.current.srcObject = null, ft.current.remove(), null), Mt(), pt.current = null, mt.current = [], ht.current = null, gt.current = null, A.current = !1, et(!1), Ue(null), Je(null), Xe("idle"), Qe(null);
2899
2899
  }, Ft = (e = (/* @__PURE__ */ new Date()).toISOString()) => {
2900
- let t = at.current, n = mt.current || ft.current?.callId;
2901
- if (!(!t?.connected || !n || j.current)) {
2902
- j.current = !0, t.emit("call:connected", {
2900
+ let t = at.current, n = ht.current || pt.current?.callId;
2901
+ if (!(!t?.connected || !n || A.current)) {
2902
+ A.current = !0, t.emit("call:connected", {
2903
2903
  callId: n,
2904
- chatId: A.current,
2904
+ chatId: ot.current,
2905
2905
  connectedAt: e
2906
2906
  });
2907
2907
  try {
2908
- let e = ut.current, t = dt.current?.srcObject;
2909
- if (e && t && !yt.current) {
2908
+ let e = dt.current, t = ft.current?.srcObject;
2909
+ if (e && t && !j.current) {
2910
2910
  xt.current = [];
2911
2911
  let n = new (window.AudioContext || window.webkitAudioContext)();
2912
2912
  bt.current = n;
@@ -2915,7 +2915,7 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
2915
2915
  let i = window.MediaRecorder.isTypeSupported("audio/webm") ? "audio/webm" : "audio/mp4", a = new window.MediaRecorder(r.stream, { mimeType: i });
2916
2916
  a.ondataavailable = (e) => {
2917
2917
  e.data && e.data.size > 0 && xt.current.push(e.data);
2918
- }, yt.current = a, St.current = Date.now(), a.start(1e3), setTimeout(() => {
2918
+ }, j.current = a, St.current = Date.now(), a.start(1e3), setTimeout(() => {
2919
2919
  try {
2920
2920
  if (!window.speechSynthesis) return;
2921
2921
  let e = new SpeechSynthesisUtterance("This call is being recorded for quality and training purposes.");
@@ -2945,53 +2945,53 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
2945
2945
  }
2946
2946
  }, It = (e = {}) => {
2947
2947
  if (!e.callId) return;
2948
- let t = ht.current === e.callId, n = mt.current === e.callId, r = ct.current?.callId === e.callId;
2948
+ let t = gt.current === e.callId, n = ht.current === e.callId, r = lt.current?.callId === e.callId;
2949
2949
  if (!(!t && !n && !r)) {
2950
2950
  if (Mt(), Ue(null), t || n) {
2951
- mt.current = e.callId, Je(e.callId), Xe((e) => e === "connected" ? e : "connecting"), w(!0);
2951
+ ht.current = e.callId, Je(e.callId), Xe((e) => e === "connected" ? e : "connecting"), w(!0);
2952
2952
  return;
2953
2953
  }
2954
2954
  Xe("idle");
2955
2955
  }
2956
2956
  }, Lt = (e = {}) => {
2957
2957
  if (!e.callId) return;
2958
- let t = ht.current === e.callId, n = mt.current === e.callId, r = ct.current?.callId === e.callId;
2958
+ let t = gt.current === e.callId, n = ht.current === e.callId, r = lt.current?.callId === e.callId;
2959
2959
  if (!(!t && !n && !r)) {
2960
2960
  if (Mt(), n) {
2961
2961
  Pt();
2962
2962
  return;
2963
2963
  }
2964
- ht.current = null, ft.current = null, pt.current = [], Ue(null), Xe("idle");
2964
+ gt.current = null, pt.current = null, mt.current = [], Ue(null), Xe("idle");
2965
2965
  }
2966
2966
  }, Rt = async (e = {}) => {
2967
- let t = lt.current, n = at.current, r = e.sdpOffer || e.offer?.sdp;
2967
+ let t = ut.current, n = at.current, r = e.sdpOffer || e.offer?.sdp;
2968
2968
  if (!t || !n?.connected || !r || !e.callId) {
2969
2969
  console.log("[FlowEngageProvider] deferring remote offer until peer/socket ready", {
2970
2970
  callId: e.callId,
2971
- chatId: A.current,
2971
+ chatId: ot.current,
2972
2972
  hasPeerConnection: !!t,
2973
2973
  socketConnected: !!n?.connected,
2974
2974
  hasOffer: !!r
2975
- }), ft.current = e;
2975
+ }), pt.current = e;
2976
2976
  return;
2977
2977
  }
2978
2978
  if (await t.setRemoteDescription(new RTCSessionDescription({
2979
2979
  type: "offer",
2980
2980
  sdp: r
2981
- })), pt.current.length > 0) {
2981
+ })), mt.current.length > 0) {
2982
2982
  console.log("[FlowEngageProvider] flushing queued agent ICE candidates after remote offer", {
2983
2983
  callId: e.callId,
2984
- chatId: A.current,
2985
- queuedCount: pt.current.length
2984
+ chatId: ot.current,
2985
+ queuedCount: mt.current.length
2986
2986
  });
2987
- for (let e of pt.current) await t.addIceCandidate(new RTCIceCandidate(e));
2988
- pt.current = [];
2987
+ for (let e of mt.current) await t.addIceCandidate(new RTCIceCandidate(e));
2988
+ mt.current = [];
2989
2989
  }
2990
2990
  let i = await t.createAnswer();
2991
2991
  await t.setLocalDescription(i), n.emit("call:answer", {
2992
2992
  callId: e.callId,
2993
2993
  sdpAnswer: i.sdp,
2994
- chatId: A.current
2994
+ chatId: ot.current
2995
2995
  });
2996
2996
  };
2997
2997
  c(() => {
@@ -3017,8 +3017,8 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
3017
3017
  if (!e) return;
3018
3018
  let a = t.siteId, o = he(a), s = Te(a), c = "";
3019
3019
  try {
3020
- let e = ot.current, r = st.current;
3021
- if (ot.current = !1, st.current = null, c = (await We({
3020
+ let e = st.current, r = ct.current;
3021
+ if (st.current = !1, ct.current = null, c = (await We({
3022
3022
  apiBaseUrl: t.apiBaseUrl,
3023
3023
  userId: n.userId,
3024
3024
  siteId: a,
@@ -3031,7 +3031,7 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
3031
3031
  } catch (e) {
3032
3032
  console.warn("[FlowEngageProvider] resolve-session failed, reusing persisted or ephemeral chat id", e?.message || e), c = o || ue(), _e(a, c);
3033
3033
  }
3034
- A.current = c;
3034
+ ot.current = c;
3035
3035
  let l = Ke({
3036
3036
  apiBaseUrl: t.apiBaseUrl,
3037
3037
  userId: n.userId,
@@ -3154,14 +3154,14 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
3154
3154
  e.agent?.name,
3155
3155
  Ct.current
3156
3156
  ], "Agent");
3157
- jt(), Mt(), j.current = !1, Ue({
3157
+ jt(), Mt(), A.current = !1, Ue({
3158
3158
  callId: e.callId,
3159
3159
  from: e.from || "owner",
3160
3160
  agentId: e.agentId || null,
3161
3161
  agentName: t
3162
3162
  }), D((e) => Ir([t, e], "Agent")), Xe("incoming"), Qe(null), w(!0);
3163
3163
  }), f.on("call:offer", async (e = {}) => {
3164
- ft.current = e;
3164
+ pt.current = e;
3165
3165
  try {
3166
3166
  await Rt(e);
3167
3167
  } catch (e) {
@@ -3174,15 +3174,15 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
3174
3174
  console.warn("[FlowEngageProvider] ignoring invalid ICE candidate payload", e);
3175
3175
  return;
3176
3176
  }
3177
- if (!lt.current || !lt.current.remoteDescription) {
3177
+ if (!ut.current || !ut.current.remoteDescription) {
3178
3178
  console.log("[FlowEngageProvider] queueing agent ICE candidate until peer/remote description is ready", {
3179
3179
  callId: e.callId,
3180
- chatId: e.chatId || A.current,
3181
- queueSize: pt.current.length + 1
3182
- }), pt.current.push(t);
3180
+ chatId: e.chatId || ot.current,
3181
+ queueSize: mt.current.length + 1
3182
+ }), mt.current.push(t);
3183
3183
  return;
3184
3184
  }
3185
- await lt.current.addIceCandidate(new RTCIceCandidate(t));
3185
+ await ut.current.addIceCandidate(new RTCIceCandidate(t));
3186
3186
  } catch (e) {
3187
3187
  console.error("[FlowEngageProvider] failed to add ICE candidate", e);
3188
3188
  }
@@ -3200,12 +3200,12 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
3200
3200
  Lt(e);
3201
3201
  }), f.on("call:connected", (e = {}) => {
3202
3202
  if (!e.callId) return;
3203
- let t = ht.current === e.callId, n = mt.current === e.callId, r = ft.current?.callId === e.callId, i = ct.current?.callId === e.callId;
3203
+ let t = gt.current === e.callId, n = ht.current === e.callId, r = pt.current?.callId === e.callId, i = lt.current?.callId === e.callId;
3204
3204
  if (!t && !n && !r) {
3205
3205
  i && (Ue(null), Xe("idle"));
3206
3206
  return;
3207
3207
  }
3208
- j.current = !0, ht.current = null, mt.current = e.callId, Je(e.callId), Ue(null), Xe("connected"), Qe(e.connectedAt || (/* @__PURE__ */ new Date()).toISOString()), w(!0);
3208
+ A.current = !0, gt.current = null, ht.current = e.callId, Je(e.callId), Ue(null), Xe("connected"), Qe(e.connectedAt || (/* @__PURE__ */ new Date()).toISOString()), w(!0);
3209
3209
  }), f.on("call:unavailable", (e = {}) => {
3210
3210
  Pt("socket:call_unavailable"), nt(Pr(e, "This visitor is not available for a call right now.")), w(!0);
3211
3211
  }), f.on("call:error", (e = {}) => {
@@ -3252,7 +3252,7 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
3252
3252
  a
3253
3253
  ]), c(() => () => {
3254
3254
  if (Fe && !Tt.current && wt.current.length > 0) {
3255
- let e = A.current, t = wt.current, n = k.current;
3255
+ let e = ot.current, t = wt.current, n = k.current;
3256
3256
  n && e && t.length > 0 && (console.log("[FlowEngageProvider] safety-net: syncing voice transcript on unmount"), n.beaconSyncVoice(e, t) || n.syncVoice(e, t).catch(() => {}), Tt.current = !0);
3257
3257
  }
3258
3258
  }, [Fe, _]);
@@ -3262,7 +3262,7 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
3262
3262
  !e || !y || zt.current !== C && (C && zt.current !== null ? (e.updateChatStatus(y, "open").catch(() => {}), Bt.current = !0) : zt.current === !0 && e.updateChatStatus(y, "widget_closed").catch(() => {}), zt.current = C);
3263
3263
  }, [C, y]), c(() => {
3264
3264
  let e = () => {
3265
- let e = A.current, t = k.current;
3265
+ let e = ot.current, t = k.current;
3266
3266
  !e || !t || typeof navigator > "u" || t.beaconWidgetClosed?.(e) || t.updateChatStatus(e, "widget_closed").catch(() => {});
3267
3267
  };
3268
3268
  return window.addEventListener("pagehide", e), () => window.removeEventListener("pagehide", e);
@@ -3282,10 +3282,10 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
3282
3282
  ]);
3283
3283
  let Vt = async () => {
3284
3284
  if (!(!O?.callId || !k.current || !at.current || !y)) {
3285
- jt(), ht.current = O.callId, Mt();
3285
+ jt(), gt.current = O.callId, Mt();
3286
3286
  try {
3287
3287
  let e = await navigator.mediaDevices.getUserMedia({ audio: !0 });
3288
- ut.current = e;
3288
+ dt.current = e;
3289
3289
  let t = [{ urls: "stun:stun.l.google.com:19302" }];
3290
3290
  try {
3291
3291
  let e = await k.current.getIceServersConfig();
@@ -3294,7 +3294,7 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
3294
3294
  console.warn("[FlowEngageProvider] ice-config fetch failed, using STUN default", e);
3295
3295
  }
3296
3296
  let n = new RTCPeerConnection({ iceServers: t });
3297
- lt.current = n, n.onconnectionstatechange = () => {
3297
+ ut.current = n, n.onconnectionstatechange = () => {
3298
3298
  let e = n.connectionState;
3299
3299
  if (e === "connected") {
3300
3300
  let e = (/* @__PURE__ */ new Date()).toISOString();
@@ -3333,21 +3333,21 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
3333
3333
  });
3334
3334
  }, n.ontrack = (e) => {
3335
3335
  let [t] = e.streams || [], [n] = t?.getAudioTracks?.() || [];
3336
- if (!dt.current) {
3336
+ if (!ft.current) {
3337
3337
  let e = document.createElement("audio");
3338
- e.id = "flowengage-remote-audio", e.autoplay = !0, e.playsInline = !0, e.onplay = () => {}, e.onpause = () => {}, e.onended = () => {}, e.onerror = (e) => {}, dt.current = e, document.body.appendChild(e);
3338
+ e.id = "flowengage-remote-audio", e.autoplay = !0, e.playsInline = !0, e.onplay = () => {}, e.onpause = () => {}, e.onended = () => {}, e.onerror = (e) => {}, ft.current = e, document.body.appendChild(e);
3339
3339
  }
3340
- dt.current.srcObject = e.streams[0];
3341
- let r = O?.callId, i = r && (ht.current === r || mt.current === r);
3342
- if (!j.current && i) {
3340
+ ft.current.srcObject = e.streams[0];
3341
+ let r = O?.callId, i = r && (gt.current === r || ht.current === r);
3342
+ if (!A.current && i) {
3343
3343
  let e = (/* @__PURE__ */ new Date()).toISOString();
3344
- Xe("connected"), Qe((t) => t || e), mt.current = r, Je(r), Ft(e);
3344
+ Xe("connected"), Qe((t) => t || e), ht.current = r, Je(r), Ft(e);
3345
3345
  }
3346
- dt.current.srcObject = t || null;
3347
- let a = dt.current.play?.();
3346
+ ft.current.srcObject = t || null;
3347
+ let a = ft.current.play?.();
3348
3348
  a?.catch && a.catch((e) => {});
3349
3349
  };
3350
- let r = ft.current;
3350
+ let r = pt.current;
3351
3351
  r && (console.log("[FlowEngageProvider] found pending remote offer during accept", {
3352
3352
  callId: r.callId || O.callId,
3353
3353
  chatId: y
@@ -3357,9 +3357,9 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
3357
3357
  })), await k.current.acceptCall(O.callId, y), at.current?.emit("call:accepted", {
3358
3358
  callId: O.callId,
3359
3359
  chatId: y
3360
- }), mt.current = O.callId, Je(O.callId), Xe((e) => e === "connected" || j.current ? "connected" : "connecting"), Ue(null), w(!0);
3360
+ }), ht.current = O.callId, Je(O.callId), Xe((e) => e === "connected" || A.current ? "connected" : "connecting"), Ue(null), w(!0);
3361
3361
  } catch (e) {
3362
- if (ht.current = null, Pt("accept_call_failed"), e?.status === 404 || e?.status === 409 || e?.status === 422) {
3362
+ if (gt.current = null, Pt("accept_call_failed"), e?.status === 404 || e?.status === 409 || e?.status === 422) {
3363
3363
  nt(Pr(e, "This visitor call is no longer available."));
3364
3364
  return;
3365
3365
  }
@@ -3400,10 +3400,10 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
3400
3400
  return;
3401
3401
  }
3402
3402
  let e = O.callId;
3403
- return Mt(), gt.current = window.setTimeout(() => {
3404
- ct.current?.callId === e && ht.current !== e && mt.current !== e && Ut.current();
3403
+ return Mt(), _t.current = window.setTimeout(() => {
3404
+ lt.current?.callId === e && gt.current !== e && ht.current !== e && Ut.current();
3405
3405
  }, oe), () => {
3406
- gt.current &&= (window.clearTimeout(gt.current), null);
3406
+ _t.current &&= (window.clearTimeout(_t.current), null);
3407
3407
  };
3408
3408
  }, [
3409
3409
  qe,
@@ -3424,7 +3424,7 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
3424
3424
  Pt("end_call_finally");
3425
3425
  }
3426
3426
  }, Gt = () => {
3427
- let e = ut.current?.getAudioTracks?.() || [], t = lt.current?.getSenders?.().map((e) => e.track).filter((e) => e?.kind === "audio") || [], n = [...e, ...t].filter(Boolean);
3427
+ let e = dt.current?.getAudioTracks?.() || [], t = ut.current?.getSenders?.().map((e) => e.track).filter((e) => e?.kind === "audio") || [], n = [...e, ...t].filter(Boolean);
3428
3428
  if (n.length === 0) return;
3429
3429
  let r = !$e;
3430
3430
  n.forEach((e) => {
@@ -3445,10 +3445,10 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
3445
3445
  }
3446
3446
  }, qt = async (e) => {
3447
3447
  let t = Nt(e);
3448
- if (!t || !k.current || !A.current) return t;
3448
+ if (!t || !k.current || !ot.current) return t;
3449
3449
  try {
3450
3450
  await k.current.trackVisitor({
3451
- chatId: A.current,
3451
+ chatId: ot.current,
3452
3452
  currentPagePath: typeof window < "u" && window.location.pathname || "/",
3453
3453
  email: t
3454
3454
  });
@@ -3457,18 +3457,18 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
3457
3457
  }
3458
3458
  return t;
3459
3459
  }, Jt = () => {
3460
- !y || !at.current?.connected || _t.current || (_t.current = !0, at.current.emit("typing:start", {
3460
+ !y || !at.current?.connected || vt.current || (vt.current = !0, at.current.emit("typing:start", {
3461
3461
  chatId: y,
3462
3462
  sender: "user"
3463
3463
  }));
3464
3464
  }, Yt = () => {
3465
- !y || !at.current?.connected || !_t.current || (_t.current = !1, at.current.emit("typing:stop", {
3465
+ !y || !at.current?.connected || !vt.current || (vt.current = !1, at.current.emit("typing:stop", {
3466
3466
  chatId: y,
3467
3467
  sender: "user"
3468
3468
  }));
3469
3469
  }, Xt = (e = "") => {
3470
3470
  let t = typeof e == "string" ? e : "";
3471
- !y || !at.current?.connected || t !== "" && vt.current === t || (vt.current = t, at.current.emit("typing:update", {
3471
+ !y || !at.current?.connected || t !== "" && yt.current === t || (yt.current = t, at.current.emit("typing:update", {
3472
3472
  chatId: y,
3473
3473
  sender: "user",
3474
3474
  text: t
@@ -3608,13 +3608,13 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
3608
3608
  At
3609
3609
  ]), c(() => {
3610
3610
  let e = () => {
3611
- let e = A.current, t = k.current;
3611
+ let e = ot.current, t = k.current;
3612
3612
  if (!t || !e) return;
3613
- if (Et.current && wt.current.length > 0 && Pe(), !Tt.current && wt.current.length > 0 && (t.beaconSyncVoice(e, wt.current) || t.syncVoice(e, wt.current).catch(() => {}), Tt.current = !0), mt.current) {
3614
- t.beaconEndWebRTCCall(mt.current, e);
3613
+ if (Et.current && wt.current.length > 0 && Pe(), !Tt.current && wt.current.length > 0 && (t.beaconSyncVoice(e, wt.current) || t.syncVoice(e, wt.current).catch(() => {}), Tt.current = !0), ht.current) {
3614
+ t.beaconEndWebRTCCall(ht.current, e);
3615
3615
  return;
3616
3616
  }
3617
- let n = ht.current || ct.current?.callId;
3617
+ let n = gt.current || lt.current?.callId;
3618
3618
  n && t.beaconCustomerUnavailable(n, e);
3619
3619
  };
3620
3620
  return window.addEventListener("pagehide", e), window.addEventListener("beforeunload", e), () => {
@@ -3623,9 +3623,9 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
3623
3623
  }, []);
3624
3624
  let nn = o(() => {
3625
3625
  let e = i?.siteId;
3626
- ge(e), ot.current = !0, st.current = null, at.current?.disconnect(), S([]), b(""), A.current = "", He(!1), re(!1), D(null), de(null), it(!0), s((e) => e + 1);
3626
+ ge(e), st.current = !0, ct.current = null, at.current?.disconnect(), S([]), b(""), ot.current = "", He(!1), re(!1), D(null), de(null), it(!0), s((e) => e + 1);
3627
3627
  }, [i?.siteId]), rn = o((e) => {
3628
- i?.siteId, ot.current = !1, st.current = e, at.current?.disconnect(), S([]), b(""), A.current = "", He(!1), re(!1), D(null), de(null), it(!0), s((e) => e + 1);
3628
+ i?.siteId, st.current = !1, ct.current = e, at.current?.disconnect(), S([]), b(""), ot.current = "", He(!1), re(!1), D(null), de(null), it(!0), s((e) => e + 1);
3629
3629
  }, [i?.siteId]), an = f(() => ({
3630
3630
  status: l,
3631
3631
  error: d,
@@ -29401,7 +29401,7 @@ function Sk(e) {
29401
29401
  for (; Date.now() < c && (await new Promise((e) => setTimeout(e, 250)), s = xk(), !(s.length >= 1)););
29402
29402
  bk(), $("flowengage_navigate → page headings collected:", s);
29403
29403
  let l = s.length ? s.join(" | ") : "none", u = s.length ? "Use ONLY these exact heading strings for flowengage_highlight." : "No headings were collected from the live DOM — use your knowledge base heading strings for this page to call flowengage_highlight. Follow RULE 1: call each highlight BEFORE describing its section (transition → highlight → content).";
29404
- return i ? (wr(), `OK_NAVIGATE_SPA. Visitor is now on: ${r} (page: "${o}") | Section headings: ${l}. ${u} MANDATORY: call flowengage_highlight for EVERY section before describing it never give a plain summary. Do NOT say "I have navigated you" or "I've taken you to" — start the highlighted walkthrough immediately.`) : (wr(), `OK_NAVIGATE_SPA. CURRENT PAGE IS: ${r} (page: "${o}") | Section headings: ${l}. ${u} MANDATORY: call flowengage_highlight for EVERY section before describing it never give a plain summary. Describe THIS page only — do not mention the page you tried to navigate to.`);
29404
+ return i ? (wr(), `OK_NAVIGATE_SPA. Visitor is now on: ${r} (page: "${o}") | Section headings: ${l}. ${u} Speak 2-3 sentences about this page from your knowledge, then IMMEDIATELY ask: "Is there a specific section or topic you'd like to know more about?" Do NOT highlight or walkthrough unless the visitor explicitly requests it. Do NOT say "I have navigated you" or "I've taken you to".`) : (wr(), `OK_NAVIGATE_SPA. CURRENT PAGE IS: ${r} (page: "${o}") | Section headings: ${l}. ${u} Speak 2-3 sentences about this page from your knowledge, then IMMEDIATELY ask: "Is there a specific section or topic you'd like to know more about?" Describe THIS page only — do not mention the page you tried to navigate to.`);
29405
29405
  } catch {}
29406
29406
  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.";
29407
29407
  } catch (e) {
@@ -29499,7 +29499,7 @@ function Sk(e) {
29499
29499
  url: e,
29500
29500
  path: t,
29501
29501
  title: n
29502
- }), $("flowengage_get_current_page → page headings collected:", r), `CURRENT_PAGE. URL: ${e} | Path: ${t} | Title: ${n} | Section headings: ${i}. Use ONLY these exact heading strings for flowengage_highlight — never invent or abbreviate section names.`;
29502
+ }), $("flowengage_get_current_page → page headings collected:", r), `CURRENT_PAGE. URL: ${e} | Path: ${t} | Title: ${n} | Section headings: ${i}. Give 1-2 sentences about this page, then ask: "Is there a specific section or topic you'd like to know more about?" Use ONLY these exact heading strings for flowengage_highlight — never invent or abbreviate section names.`;
29503
29503
  },
29504
29504
  flowengage_list_forms: async () => {
29505
29505
  let e = XO(), t = ZO();
@@ -30164,7 +30164,7 @@ function Pk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
30164
30164
  e && Ae(i, e);
30165
30165
  } catch {}
30166
30166
  if (Ak(n, r)) {
30167
- fe("minimized");
30167
+ D.current = !0;
30168
30168
  return;
30169
30169
  }
30170
30170
  if (ee.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 (oe.current += 1, oe.current === 2) try {
@@ -31400,27 +31400,27 @@ function Rk() {
31400
31400
  pr();
31401
31401
  } catch {}
31402
31402
  }, []), c(() => {
31403
- Ee && A !== "voice_mode" && A !== "text_chat" && A !== "call_screen" && (ue?.(!1), ot("text_chat"));
31403
+ Ee && k !== "voice_mode" && k !== "text_chat" && k !== "call_screen" && (ue?.(!1), ot("text_chat"));
31404
31404
  }, [Ee]);
31405
31405
  let Oe = t?.widgetSettings || {}, ke = n?.widgetSettings || {}, Ae = {
31406
31406
  ...Oe.branding || {},
31407
31407
  ...ke.branding || {}
31408
- }, Ne = {
31408
+ }, je = {
31409
31409
  ...Oe.theme || {},
31410
31410
  ...ke.theme || {}
31411
- }, Pe = {
31411
+ }, Ne = {
31412
31412
  ...Oe.features || {},
31413
31413
  ...ke.features || {}
31414
- }, Ie = Pe.voice !== !1, Le = Array.isArray(Ne.orbColors) && Ne.orbColors.length > 0 ? Ne.orbColors : null, ze = Ne.buttonColor || Ne.primaryColor || Le?.[0] || "#3B82F6", Be = {
31414
+ }, Pe = Ne.voice !== !1, Ie = Array.isArray(je.orbColors) && je.orbColors.length > 0 ? je.orbColors : null, Le = je.buttonColor || je.primaryColor || Ie?.[0] || "#3B82F6", ze = {
31415
31415
  small: 50,
31416
31416
  medium: 64,
31417
31417
  large: 80
31418
- }, Ve = Be[Ne.orbSize] || Be.small, He = Ne.position || "bottom-right", O = Ae.fallbackAgentName || "Agent", Ue = Tk(Le ?? Ne.chatBgColors), We = Ae.logo || Ae.logoUrl || null, Ge = E || "en", Ke = Oe.recommendations?.[Ge] || [], qe = (ke.recommendations?.[Ge] ?? Ke).filter((e) => String(e?.label ?? "").trim()).map((e, t) => ({
31418
+ }, Be = ze[je.orbSize] || ze.small, Ve = je.position || "bottom-right", He = Ae.fallbackAgentName || "Agent", O = Tk(Ie ?? je.chatBgColors), Ue = Ae.logo || Ae.logoUrl || null, We = E || "en", Ge = Oe.recommendations?.[We] || [], Ke = (ke.recommendations?.[We] ?? Ge).filter((e) => String(e?.label ?? "").trim()).map((e, t) => ({
31419
31419
  id: e.key || `qr-${t}`,
31420
31420
  label: e.label,
31421
31421
  message: e.label,
31422
31422
  text: e.label
31423
- })), Je = Array.isArray(Ae.quickChatOptions) && Ae.quickChatOptions.length > 0 ? Ae.quickChatOptions : qe, Ye = Ae.hideWatermark === !0 ? !1 : Ae.showPoweredBy !== !1, Xe = Ae.chatbotEnabled !== !1 && Ne.chatbotEnabled !== !1, Ze = Oe.greetings?.[E] || ke.greetings?.[E] || Ae.introGreeting || "Hello, I'm here to help you know more about OpenSense Labs.", Qe = {
31423
+ })), qe = Array.isArray(Ae.quickChatOptions) && Ae.quickChatOptions.length > 0 ? Ae.quickChatOptions : Ke, Je = Ae.hideWatermark === !0 ? !1 : Ae.showPoweredBy !== !1, Ye = Ae.chatbotEnabled !== !1 && je.chatbotEnabled !== !1, Xe = Oe.greetings?.[E] || ke.greetings?.[E] || Ae.introGreeting || "Hello, I'm here to help you know more about OpenSense Labs.", Ze = {
31424
31424
  entryPrompt: Ae.entryPrompt || "Do you want to explore in a new way?",
31425
31425
  yesLabel: Ae.yesLabel || "Yes",
31426
31426
  laterLabel: Ae.laterLabel || "Later",
@@ -31428,20 +31428,20 @@ function Rk() {
31428
31428
  voiceLabel: Ae.voiceLabel || "Voice",
31429
31429
  textLabel: Ae.textLabel || "Text",
31430
31430
  chatTitle: Ae.headerName || "Chat with FlowEngage",
31431
- introGreeting: Ze,
31431
+ introGreeting: Xe,
31432
31432
  inputPlaceholder: Ae.inputPlaceholder || "Type your message",
31433
31433
  analysingLabel: Ae.analysingLabel || "analysing..."
31434
- }, $e = ke.elevenLabsAgentId || t?.elevenLabsAgentId || null, et = t?.siteId || n?.siteId || null, tt = t?.apiBaseUrl || "", nt = f(() => l && String(l).trim() || t?.ownerName && String(t.ownerName).trim() || t?.websiteName && String(t.websiteName).trim() || "Agent", [
31434
+ }, Qe = ke.elevenLabsAgentId || t?.elevenLabsAgentId || null, $e = t?.siteId || n?.siteId || null, et = t?.apiBaseUrl || "", tt = f(() => l && String(l).trim() || t?.ownerName && String(t.ownerName).trim() || t?.websiteName && String(t.websiteName).trim() || "Agent", [
31435
31435
  l,
31436
31436
  t?.ownerName,
31437
31437
  t?.websiteName
31438
- ]), rt = u && String(u).trim() || t?.ownerProfileImageUrl && String(t.ownerProfileImageUrl).trim() || null, it = r.some((e) => e.sender === "user"), at = f(() => {
31438
+ ]), nt = u && String(u).trim() || t?.ownerProfileImageUrl && String(t.ownerProfileImageUrl).trim() || null, rt = r.some((e) => e.sender === "user"), it = f(() => {
31439
31439
  let e = r.findIndex((e) => e.sender === "user");
31440
31440
  return e === -1 ? !1 : r.slice(e + 1).some((e) => e.sender === "bot" || e.sender === "ai" || e.sender === "agent");
31441
- }, [r]), k = !!(ke._dashboardLivePreview || Oe._dashboardLivePreview), [A, ot] = m(() => k ? "text_chat" : "entry_prompt"), [st, ct] = m(""), [lt, ut] = m(null), [dt, ft] = m(h || ""), [pt, mt] = m(""), [ht, gt] = m(!1), [j, _t] = m(0), [vt, yt] = m(null), [bt, xt] = m(null), [St, Ct] = m(""), [wt, Tt] = m(!1), [Et, Dt] = m(!1), [Ot, kt] = m(!1), At = p(null), jt = p(!1), Mt = !h && it && at && A !== "voice_mode";
31441
+ }, [r]), at = !!(ke._dashboardLivePreview || Oe._dashboardLivePreview), [k, ot] = m(() => at ? "text_chat" : "entry_prompt"), [st, ct] = m(""), [lt, ut] = m(null), [dt, ft] = m(h || ""), [pt, mt] = m(""), [ht, gt] = m(!1), [_t, A] = m(0), [vt, yt] = m(null), [j, bt] = m(null), [xt, St] = m(""), [Ct, wt] = m(!1), [Tt, Et] = m(!1), [Dt, Ot] = m(!1), kt = p(null), At = p(!1), jt = !h && rt && it && k !== "voice_mode";
31442
31442
  d(() => {
31443
- if (e !== "ready" || jt.current) return;
31444
- if (jt.current = !0, !Ie) {
31443
+ if (e !== "ready" || At.current) return;
31444
+ if (At.current = !0, !Pe) {
31445
31445
  ot("minimized_orb");
31446
31446
  return;
31447
31447
  }
@@ -31449,8 +31449,7 @@ function Rk() {
31449
31449
  try {
31450
31450
  t = Tr().shouldResumeVoice;
31451
31451
  } catch {}
31452
- let n = Fe(), r = et ? je(et) : null, i = n || !!r?.transcript;
31453
- if (t) {
31452
+ if (Fe(), t) {
31454
31453
  ce?.({ notifyChatInitiated: !0 }), ue?.(!0), ot("voice_mode");
31455
31454
  return;
31456
31455
  }
@@ -31458,96 +31457,92 @@ function Rk() {
31458
31457
  ce?.({ notifyChatInitiated: !1 }), ot("text_chat");
31459
31458
  return;
31460
31459
  }
31461
- if (i) {
31462
- ce?.({ notifyChatInitiated: !0 }), ue?.(!0), ot("voice_mode");
31463
- return;
31464
- }
31465
- if (et) try {
31466
- Me(et);
31460
+ if ($e) try {
31461
+ Me($e);
31467
31462
  } catch {}
31468
- if (fe(et)) {
31463
+ if (fe($e)) {
31469
31464
  ot("minimized_orb");
31470
31465
  return;
31471
31466
  }
31472
31467
  }, [e, r]);
31473
- let [Nt, Pt] = m(() => typeof window < "u" && window.matchMedia("(max-width: 640px)").matches);
31468
+ let [Mt, Nt] = m(() => typeof window < "u" && window.matchMedia("(max-width: 640px)").matches);
31474
31469
  c(() => {
31475
- let e = window.matchMedia("(max-width: 640px)"), t = (e) => Pt(e.matches);
31470
+ let e = window.matchMedia("(max-width: 640px)"), t = (e) => Nt(e.matches);
31476
31471
  return e.addEventListener("change", t), () => e.removeEventListener("change", t);
31477
31472
  }, []), c(() => {
31478
31473
  ft(h || ""), h && mt("");
31479
31474
  }, [h]);
31480
- let Ft = o(() => {
31481
- xt(null), Ct("");
31482
- }, []), It = o((e) => {
31475
+ let Pt = o(() => {
31476
+ bt(null), St("");
31477
+ }, []), Ft = o((e) => {
31483
31478
  let t = qD(e);
31484
31479
  if (t) {
31485
- xt(null), Ct(t);
31480
+ bt(null), St(t);
31486
31481
  return;
31487
31482
  }
31488
- xt(e), Ct("");
31483
+ bt(e), St("");
31489
31484
  }, []);
31490
31485
  c(() => {
31491
31486
  if (!te || ee !== "connected") {
31492
- _t(0);
31487
+ A(0);
31493
31488
  return;
31494
31489
  }
31495
31490
  let e = () => {
31496
31491
  let e = new Date(te).getTime();
31497
- isNaN(e) || _t(Math.max(0, Math.floor((Date.now() - e) / 1e3)));
31492
+ isNaN(e) || A(Math.max(0, Math.floor((Date.now() - e) / 1e3)));
31498
31493
  };
31499
31494
  e();
31500
31495
  let t = window.setInterval(e, 1e3);
31501
31496
  return () => window.clearInterval(t);
31502
31497
  }, [te, ee]);
31503
- let Lt = o(() => {
31504
- ot("call_screen"), Dt(!1);
31505
- }, []), Rt = o(() => {
31506
- ot("text_chat"), Dt(!0);
31498
+ let It = o(() => {
31499
+ ot("call_screen"), Et(!1);
31500
+ }, []), Lt = o(() => {
31501
+ ot("text_chat"), Et(!0);
31507
31502
  }, []);
31508
31503
  c(() => {
31509
31504
  let e = w?.callId || T || null;
31510
31505
  if (!e) {
31511
- At.current = null;
31506
+ kt.current = null;
31512
31507
  return;
31513
31508
  }
31514
31509
  if (w?.callId || ee === "connecting" || ee === "connected") {
31515
- if (A === "minimized_orb" && Et && T && !w?.callId) {
31516
- At.current = e;
31510
+ if (k === "minimized_orb" && Tt && T && !w?.callId) {
31511
+ kt.current = e;
31517
31512
  return;
31518
31513
  }
31519
- !(!i || A === "minimized_orb" || A === "voice_mode") && At.current === e || (console.log("[FlowEngageWidget] forcing call UI to front", {
31514
+ !(!i || k === "minimized_orb" || k === "voice_mode") && kt.current === e || (console.log("[FlowEngageWidget] forcing call UI to front", {
31520
31515
  forcedKey: e,
31521
31516
  isOpen: i,
31522
- surface: A,
31517
+ surface: k,
31523
31518
  hasIncomingCall: !!w?.callId,
31524
31519
  activeCallId: T,
31525
31520
  callConnectionState: ee
31526
- }), At.current = e, A === "voice_mode" && ue?.(!1), ce?.(), Lt());
31521
+ }), kt.current = e, k === "voice_mode" && ue?.(!1), ce?.(), It());
31527
31522
  }
31528
31523
  }, [
31529
31524
  T,
31530
31525
  ee,
31531
- Lt,
31526
+ It,
31532
31527
  w?.callId,
31533
31528
  i,
31534
31529
  ce,
31535
31530
  ue,
31536
- A
31531
+ k
31537
31532
  ]), c(() => {
31538
- !w && !T && A === "call_screen" && ot("text_chat");
31533
+ !w && !T && k === "call_screen" && ot("text_chat");
31539
31534
  }, [
31540
31535
  w,
31541
31536
  T,
31542
- A
31537
+ k
31543
31538
  ]), c(() => {
31544
- !T && Et && Dt(!1);
31545
- }, [T, Et]), c(() => {
31539
+ !T && Tt && Et(!1);
31540
+ }, [T, Tt]), c(() => {
31546
31541
  if (!s || C) {
31547
31542
  Se?.(""), xe?.();
31548
31543
  return;
31549
31544
  }
31550
- if (!st.trim() || bt) {
31545
+ if (!st.trim() || j) {
31551
31546
  Se?.("");
31552
31547
  let e = window.setTimeout(() => xe?.(), 100);
31553
31548
  return () => window.clearTimeout(e);
@@ -31559,20 +31554,20 @@ function Rk() {
31559
31554
  };
31560
31555
  }, [
31561
31556
  st,
31562
- bt,
31557
+ j,
31563
31558
  s,
31564
31559
  C,
31565
31560
  be,
31566
31561
  xe,
31567
31562
  Se
31568
31563
  ]);
31569
- let zt = (e) => e ? {
31564
+ let Rt = (e) => e ? {
31570
31565
  replyTo: e.messageId || e.id || null,
31571
31566
  replyToContent: (e.replyToContent || e.message || "").replace(/<[^>]+>/g, "").trim().slice(0, 200),
31572
31567
  replyToSender: e.sender || null
31573
- } : null, Bt = async (e) => {
31568
+ } : null, zt = async (e) => {
31574
31569
  if (e.preventDefault(), C) return;
31575
- if (Mt) {
31570
+ if (jt) {
31576
31571
  let e = dt.trim().toLowerCase();
31577
31572
  if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)) {
31578
31573
  mt("Please enter a valid email so we can continue helping you.");
@@ -31581,36 +31576,36 @@ function Rk() {
31581
31576
  await le(e), mt(""), gt(!0), setTimeout(() => gt(!1), 3e3);
31582
31577
  return;
31583
31578
  }
31584
- let t = zt(lt);
31585
- if (!st.trim() && !bt) return;
31586
- if (bt) {
31579
+ let t = Rt(lt);
31580
+ if (!st.trim() && !j) return;
31581
+ if (j) {
31587
31582
  try {
31588
- Tt(!0), Ct("");
31589
- let e = await se(bt), n = e?.data || e, r = st.trim() || `Shared file: ${YD(bt)}`;
31590
- ct(""), ut(null), Ft(), await D(r, "", t, {
31583
+ wt(!0), St("");
31584
+ let e = await se(j), n = e?.data || e, r = st.trim() || `Shared file: ${YD(j)}`;
31585
+ ct(""), ut(null), Pt(), await D(r, "", t, {
31591
31586
  type: "file",
31592
31587
  metadata: {
31593
31588
  fileUrl: n?.fileUrl,
31594
- fileName: n?.fileName || bt.name,
31595
- fileType: n?.fileType || bt.type,
31596
- fileSize: n?.fileSize || bt.size
31589
+ fileName: n?.fileName || j.name,
31590
+ fileType: n?.fileType || j.type,
31591
+ fileSize: n?.fileSize || j.size
31597
31592
  }
31598
31593
  });
31599
31594
  } catch (e) {
31600
- Ct(e?.message || "Failed to upload the selected file.");
31595
+ St(e?.message || "Failed to upload the selected file.");
31601
31596
  } finally {
31602
- Tt(!1);
31597
+ wt(!1);
31603
31598
  }
31604
31599
  return;
31605
31600
  }
31606
31601
  let n = st.trim();
31607
31602
  ct(""), ut(null), await D(n, "", t);
31608
- }, Vt = o(() => {
31603
+ }, Bt = o(() => {
31609
31604
  r.length !== 0 && me?.();
31610
- }, [r.length, me]), Ht = (e) => {
31605
+ }, [r.length, me]), Vt = (e) => {
31611
31606
  let t = Math.floor(e / 60);
31612
31607
  return `${String(t).padStart(2, "0")}:${String(e % 60).padStart(2, "0")}`;
31613
- }, Ut = o(async (e) => {
31608
+ }, Ht = o(async (e) => {
31614
31609
  if (C || b) return;
31615
31610
  let t = e.message || e.label || e.text || "";
31616
31611
  t.trim() && await D(t.trim(), "");
@@ -31618,44 +31613,44 @@ function Rk() {
31618
31613
  C,
31619
31614
  b,
31620
31615
  D
31621
- ]), Wt = Nt && A === "entry_prompt" ? { inset: 0 } : Nt && A === "text_chat" ? {
31616
+ ]), Ut = Mt && k === "entry_prompt" ? { inset: 0 } : Mt && k === "text_chat" ? {
31622
31617
  left: 0,
31623
31618
  right: 0,
31624
31619
  bottom: 0
31625
- } : Nt && A === "call_screen" ? {
31620
+ } : Mt && k === "call_screen" ? {
31626
31621
  left: 0,
31627
31622
  right: 0,
31628
31623
  bottom: 0,
31629
31624
  height: "90dvh",
31630
31625
  overflow: "hidden",
31631
31626
  borderRadius: "16px 16px 0 0"
31632
- } : Nt && A === "connection_modal" ? {
31627
+ } : Mt && k === "connection_modal" ? {
31633
31628
  left: "12px",
31634
31629
  right: "12px",
31635
31630
  bottom: "12px"
31636
- } : A === "call_screen" ? {
31631
+ } : k === "call_screen" ? {
31637
31632
  width: "min(350px, calc(100vw - 40px))",
31638
31633
  height: "min(640px, calc(100vh - 120px))",
31639
31634
  borderRadius: "22px",
31640
31635
  overflow: "hidden",
31641
- ...He === "bottom-left" ? {
31636
+ ...Ve === "bottom-left" ? {
31642
31637
  left: "1.5rem",
31643
31638
  bottom: "1.5rem"
31644
31639
  } : {
31645
31640
  right: "1.5rem",
31646
31641
  bottom: "1.5rem"
31647
31642
  }
31648
- } : He === "bottom-left" ? {
31643
+ } : Ve === "bottom-left" ? {
31649
31644
  left: "1.5rem",
31650
31645
  bottom: "1.5rem"
31651
31646
  } : {
31652
31647
  right: "1.5rem",
31653
31648
  bottom: "1.5rem"
31654
- }, Gt = o(() => {
31655
- A !== "minimized_orb" && (kt(!0), setTimeout(() => {
31656
- ot("minimized_orb"), kt(!1), T && Dt(!0);
31649
+ }, Wt = o(() => {
31650
+ k !== "minimized_orb" && (Ot(!0), setTimeout(() => {
31651
+ ot("minimized_orb"), Ot(!1), T && Et(!0);
31657
31652
  }, 280));
31658
- }, [T, A]), Kt = () => ot("connection_modal"), qt = () => {
31653
+ }, [T, k]), Gt = () => ot("connection_modal"), Kt = () => {
31659
31654
  try {
31660
31655
  let e = window.AudioContext || window.webkitAudioContext;
31661
31656
  if (e) {
@@ -31664,35 +31659,35 @@ function Rk() {
31664
31659
  }
31665
31660
  } catch {}
31666
31661
  ce({ notifyChatInitiated: !0 }), ue?.(!0), ot("voice_mode");
31667
- }, Jt = () => {
31662
+ }, qt = () => {
31668
31663
  ce({ notifyChatInitiated: !0 }), ue?.(!1), ot("text_chat");
31669
- }, Yt = () => {
31670
- ue?.(!1), Gt();
31664
+ }, Jt = () => {
31665
+ ue?.(!1), Wt();
31671
31666
  };
31672
- return e !== "ready" || !Xe || Pe.chat === !1 ? null : /* @__PURE__ */ _("div", {
31667
+ return e !== "ready" || !Ye || Ne.chat === !1 ? null : /* @__PURE__ */ _("div", {
31673
31668
  className: "flowengage-widget-root",
31674
31669
  style: {
31675
31670
  position: "fixed",
31676
31671
  zIndex: 999999,
31677
- ...Wt
31672
+ ...Ut
31678
31673
  },
31679
31674
  onWheel: (e) => e.stopPropagation(),
31680
31675
  onTouchMove: (e) => e.stopPropagation(),
31681
31676
  children: [
31682
- A === "entry_prompt" && /* @__PURE__ */ g(Mk, {
31683
- copy: Qe,
31684
- orbColors: Le,
31685
- primaryColor: ze,
31677
+ k === "entry_prompt" && /* @__PURE__ */ g(Mk, {
31678
+ copy: Ze,
31679
+ orbColors: Ie,
31680
+ primaryColor: Le,
31686
31681
  onYes: () => {
31687
- pe(et), qt();
31682
+ pe($e), Kt();
31688
31683
  },
31689
31684
  onLater: () => {
31690
- pe(et), Gt();
31685
+ pe($e), Wt();
31691
31686
  },
31692
- isMobile: Nt,
31693
- isClosing: Ot
31687
+ isMobile: Mt,
31688
+ isClosing: Dt
31694
31689
  }),
31695
- A === "minimized_orb" && /* @__PURE__ */ _(Dm.div, {
31690
+ k === "minimized_orb" && /* @__PURE__ */ _(Dm.div, {
31696
31691
  layoutId: "fe-main-orb",
31697
31692
  initial: {
31698
31693
  scale: .4,
@@ -31711,14 +31706,14 @@ function Rk() {
31711
31706
  transformOrigin: "bottom right",
31712
31707
  display: "inline-flex",
31713
31708
  flexDirection: "column",
31714
- alignItems: He === "bottom-left" ? "flex-start" : "flex-end",
31709
+ alignItems: Ve === "bottom-left" ? "flex-start" : "flex-end",
31715
31710
  gap: "10px"
31716
31711
  },
31717
31712
  children: [T && /* @__PURE__ */ _("button", {
31718
31713
  type: "button",
31719
- onClick: Lt,
31714
+ onClick: It,
31720
31715
  style: {
31721
- maxWidth: Nt ? "220px" : "240px",
31716
+ maxWidth: Mt ? "220px" : "240px",
31722
31717
  padding: "10px 14px",
31723
31718
  borderRadius: "18px",
31724
31719
  border: "1px solid rgba(255,255,255,0.7)",
@@ -31759,86 +31754,86 @@ function Rk() {
31759
31754
  marginTop: "2px",
31760
31755
  whiteSpace: "nowrap"
31761
31756
  },
31762
- children: ee === "connected" ? `${Ht(j)} with ${nt}` : `Tap to return to ${nt}`
31757
+ children: ee === "connected" ? `${Vt(_t)} with ${tt}` : `Tap to return to ${tt}`
31763
31758
  })]
31764
31759
  })]
31765
31760
  }), /* @__PURE__ */ g(jk, {
31766
- size: Ve,
31767
- orbColors: Le,
31768
- onClick: T ? Lt : Ie ? Kt : Jt
31761
+ size: Be,
31762
+ orbColors: Ie,
31763
+ onClick: T ? It : Pe ? Gt : qt
31769
31764
  })]
31770
31765
  }),
31771
- A === "connection_modal" && /* @__PURE__ */ g(Nk, {
31772
- copy: Qe,
31773
- orbColors: Le,
31774
- primaryColor: ze,
31775
- onVoice: qt,
31776
- onText: Jt,
31777
- onClose: Gt,
31778
- isMobile: Nt,
31779
- isClosing: Ot
31766
+ k === "connection_modal" && /* @__PURE__ */ g(Nk, {
31767
+ copy: Ze,
31768
+ orbColors: Ie,
31769
+ primaryColor: Le,
31770
+ onVoice: Kt,
31771
+ onText: qt,
31772
+ onClose: Wt,
31773
+ isMobile: Mt,
31774
+ isClosing: Dt
31780
31775
  }),
31781
- A === "voice_mode" && /* @__PURE__ */ g(Pk, {
31782
- orbColors: Le,
31783
- onEnterChat: Jt,
31784
- onEndChat: Yt,
31785
- agentId: $e,
31786
- siteId: et,
31787
- apiBaseUrl: tt,
31776
+ k === "voice_mode" && /* @__PURE__ */ g(Pk, {
31777
+ orbColors: Ie,
31778
+ onEnterChat: qt,
31779
+ onEndChat: Jt,
31780
+ agentId: Qe,
31781
+ siteId: $e,
31782
+ apiBaseUrl: et,
31788
31783
  chatId: ie,
31789
31784
  historyRef: ae,
31790
31785
  onMessageSync: oe,
31791
31786
  voiceEndCounter: De
31792
31787
  }, "voice"),
31793
- A === "call_screen" && /* @__PURE__ */ g(gO, {
31788
+ k === "call_screen" && /* @__PURE__ */ g(gO, {
31794
31789
  incomingCall: w,
31795
31790
  activeCallId: T,
31796
31791
  callConnectionState: ee,
31797
- callDurationSeconds: j,
31792
+ callDurationSeconds: _t,
31798
31793
  isCallMuted: ne,
31799
- agentName: nt,
31800
- agentHeadshot: rt,
31801
- fallbackAgentName: O,
31794
+ agentName: tt,
31795
+ agentHeadshot: nt,
31796
+ fallbackAgentName: He,
31802
31797
  acceptCall: he,
31803
31798
  rejectCall: ge,
31804
31799
  endWebRTCCall: _e,
31805
31800
  toggleCallMute: ve,
31806
- formatCallDuration: Ht,
31807
- onMinimize: Rt,
31808
- primaryColor: ze,
31809
- orbColors: Le,
31801
+ formatCallDuration: Vt,
31802
+ onMinimize: Lt,
31803
+ primaryColor: Le,
31804
+ orbColors: Ie,
31810
31805
  chatHistory: r
31811
31806
  }),
31812
- A === "text_chat" && /* @__PURE__ */ g(Lk, {
31813
- isClosing: Ot,
31814
- copy: Qe,
31815
- orbColors: Le,
31816
- primaryColor: ze,
31817
- chatBgGradient: Ue,
31818
- logo: We,
31819
- quickChatOptions: Je,
31820
- onQuickChatSelect: Ut,
31821
- isMobile: Nt,
31807
+ k === "text_chat" && /* @__PURE__ */ g(Lk, {
31808
+ isClosing: Dt,
31809
+ copy: Ze,
31810
+ orbColors: Ie,
31811
+ primaryColor: Le,
31812
+ chatBgGradient: O,
31813
+ logo: Ue,
31814
+ quickChatOptions: qe,
31815
+ onQuickChatSelect: Ht,
31816
+ isMobile: Mt,
31822
31817
  chatHistory: r,
31823
31818
  isAiTyping: y,
31824
31819
  isAgentTyping: v,
31825
31820
  activeScreen: a,
31826
- agentName: nt,
31827
- agentHeadshot: rt,
31828
- fallbackAgentName: O,
31821
+ agentName: tt,
31822
+ agentHeadshot: nt,
31823
+ fallbackAgentName: He,
31829
31824
  input: st,
31830
31825
  setInput: ct,
31831
- onSubmit: Bt,
31826
+ onSubmit: zt,
31832
31827
  isConversationEnded: C,
31833
31828
  isLoading: b,
31834
31829
  isRateLimited: x,
31835
31830
  rateLimitMessage: S,
31836
- selectedFile: bt,
31837
- onFileSelect: It,
31838
- onRemoveSelectedFile: Ft,
31839
- attachmentError: St,
31840
- isUploadingAttachment: wt,
31841
- requiresEmail: Mt,
31831
+ selectedFile: j,
31832
+ onFileSelect: Ft,
31833
+ onRemoveSelectedFile: Pt,
31834
+ attachmentError: xt,
31835
+ isUploadingAttachment: Ct,
31836
+ requiresEmail: jt,
31842
31837
  emailInput: dt,
31843
31838
  setEmailInput: ft,
31844
31839
  emailError: pt,
@@ -31853,15 +31848,15 @@ function Rk() {
31853
31848
  isCallMuted: ne,
31854
31849
  toggleCallMute: ve,
31855
31850
  endWebRTCCall: _e,
31856
- formatCallDuration: Ht,
31857
- callDurationSeconds: j,
31858
- onCollapse: Gt,
31859
- onStartVoice: qt,
31860
- onNewChat: Vt,
31861
- onMinimize: Rt,
31862
- onExpand: Lt,
31851
+ formatCallDuration: Vt,
31852
+ callDurationSeconds: _t,
31853
+ onCollapse: Wt,
31854
+ onStartVoice: Kt,
31855
+ onNewChat: Bt,
31856
+ onMinimize: Lt,
31857
+ onExpand: It,
31863
31858
  isCallMinimized: !!T,
31864
- showPoweredBy: Ye,
31859
+ showPoweredBy: Je,
31865
31860
  getVisitorChatHistory: Ce,
31866
31861
  resumeChat: we,
31867
31862
  isSessionRestoring: Te