@eloquentai/chat-sdk 0.21.23-dev → 0.22.0-dev

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.
@@ -2,9 +2,9 @@ import { jsx as x, jsxs as U, Fragment as Qe } from "react/jsx-runtime";
2
2
  import { ChevronDown as qo, X as gr, Copy as nl, ThumbsUp as rl, ThumbsDown as il, FileSearch as ol, CheckCircle as al, Info as sl, XCircle as ll, AlertTriangle as cl, ArrowUp as ul, RefreshCcw as fl } from "lucide-react";
3
3
  import { clsx as pl } from "clsx";
4
4
  import { twMerge as dl } from "tailwind-merge";
5
- import { useDebounce as br } from "@uidotdev/usehooks";
6
5
  import * as ue from "react";
7
- import { createContext as pn, useContext as dn, useEffect as ie, useState as W, useMemo as st, useRef as se, useCallback as X } from "react";
6
+ import { useState as V, useEffect as ee, createContext as pn, useContext as dn, useMemo as st, useRef as se, useCallback as X } from "react";
7
+ import { useDebounce as br } from "@uidotdev/usehooks";
8
8
  import * as Xe from "@radix-ui/react-scroll-area";
9
9
  import { ScrollArea as hl } from "@radix-ui/react-scroll-area";
10
10
  import * as Pe from "@radix-ui/react-dialog";
@@ -15,16 +15,16 @@ import { z as Z } from "zod";
15
15
  import xl from "react-dom/client";
16
16
  try {
17
17
  let e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
18
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "6ca28615-a531-4191-bc51-3f65410ee9ef", e._sentryDebugIdIdentifier = "sentry-dbid-6ca28615-a531-4191-bc51-3f65410ee9ef");
18
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "7e004ec1-5b88-49cb-bdff-54e0780f81c8", e._sentryDebugIdIdentifier = "sentry-dbid-7e004ec1-5b88-49cb-bdff-54e0780f81c8");
19
19
  } catch {
20
20
  }
21
21
  {
22
22
  let e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
23
- e.SENTRY_RELEASE = { id: "be760d734bae692620fdf359bcf06c0d37ac68da" };
23
+ e.SENTRY_RELEASE = { id: "4089cd93a55f7ad7a85e68697b7a8b652a1be95b" };
24
24
  }
25
25
  if (typeof window < "u") {
26
26
  const e = "development";
27
- import("./index-CDh5zBW4.js").then((t) => {
27
+ import("./index-Cp3ZK4ca.js").then((t) => {
28
28
  t.init({
29
29
  dsn: void 0,
30
30
  environment: e,
@@ -50,7 +50,11 @@ async function kl(e) {
50
50
  }
51
51
  }
52
52
  function hn(e) {
53
- const { className: t, bgColor: n, fgColor: r, src: i, ...o } = e;
53
+ const { className: t, bgColor: n, fgColor: r, src: i, ...o } = e, [a, s] = V(!1);
54
+ ee(() => {
55
+ s(!1);
56
+ }, [i]);
57
+ const l = !i || a;
54
58
  return /* @__PURE__ */ x(
55
59
  "div",
56
60
  {
@@ -59,14 +63,7 @@ function hn(e) {
59
63
  t
60
64
  ),
61
65
  ...o,
62
- children: i ? /* @__PURE__ */ x(
63
- "img",
64
- {
65
- src: i,
66
- alt: "Assistant Logo",
67
- className: "shrink-0 w-full h-full object-contain rounded-full"
68
- }
69
- ) : /* @__PURE__ */ U("svg", { viewBox: "0 0 80 80", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
66
+ children: l ? /* @__PURE__ */ U("svg", { viewBox: "0 0 80 80", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
70
67
  /* @__PURE__ */ x("circle", { cx: "40", cy: "40", r: "40", fill: n || "#6F33B7" }),
71
68
  /* @__PURE__ */ x(
72
69
  "path",
@@ -77,7 +74,15 @@ function hn(e) {
77
74
  fill: r || "#000000"
78
75
  }
79
76
  )
80
- ] })
77
+ ] }) : /* @__PURE__ */ x(
78
+ "img",
79
+ {
80
+ src: i,
81
+ alt: "Assistant Logo",
82
+ className: "shrink-0 w-full h-full object-contain rounded-full",
83
+ onError: () => s(!0)
84
+ }
85
+ )
81
86
  }
82
87
  );
83
88
  }
@@ -325,13 +330,13 @@ function Yo({ isWaiting: e = !1, ...t }) {
325
330
  alignment: bl.TopCenter
326
331
  })
327
332
  }), s = wl(a, "State Machine 1", "waiting");
328
- return ie(() => {
333
+ return ee(() => {
329
334
  if (s)
330
335
  try {
331
336
  s.value = e;
332
337
  } catch {
333
338
  }
334
- }, [a, s, e]), ie(() => {
339
+ }, [a, s, e]), ee(() => {
335
340
  a && r?.();
336
341
  }, [a]), /* @__PURE__ */ x(
337
342
  "div",
@@ -346,8 +351,8 @@ function Yo({ isWaiting: e = !1, ...t }) {
346
351
  );
347
352
  }
348
353
  function Ml(e, t = 50, n = !0) {
349
- const [r, i] = W("");
350
- return ie(() => {
354
+ const [r, i] = V("");
355
+ return ee(() => {
351
356
  if (!n) return;
352
357
  let o = 0;
353
358
  const s = ((c, u) => {
@@ -431,14 +436,14 @@ be.prototype.property = "";
431
436
  be.prototype.spaceSeparated = !1;
432
437
  be.prototype.space = void 0;
433
438
  let Hl = 0;
434
- const j = tt(), te = tt(), Jn = tt(), I = tt(), Q = tt(), lt = tt(), we = tt();
439
+ const j = tt(), ne = tt(), Jn = tt(), I = tt(), Q = tt(), lt = tt(), we = tt();
435
440
  function tt() {
436
441
  return 2 ** ++Hl;
437
442
  }
438
443
  const Qn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
439
444
  __proto__: null,
440
445
  boolean: j,
441
- booleanish: te,
446
+ booleanish: ne,
442
447
  commaOrSpaceSeparated: we,
443
448
  commaSeparated: lt,
444
449
  number: I,
@@ -491,10 +496,10 @@ function mt(e) {
491
496
  const Qo = mt({
492
497
  properties: {
493
498
  ariaActiveDescendant: null,
494
- ariaAtomic: te,
499
+ ariaAtomic: ne,
495
500
  ariaAutoComplete: null,
496
- ariaBusy: te,
497
- ariaChecked: te,
501
+ ariaBusy: ne,
502
+ ariaChecked: ne,
498
503
  ariaColCount: I,
499
504
  ariaColIndex: I,
500
505
  ariaColSpan: I,
@@ -502,36 +507,36 @@ const Qo = mt({
502
507
  ariaCurrent: null,
503
508
  ariaDescribedBy: Q,
504
509
  ariaDetails: null,
505
- ariaDisabled: te,
510
+ ariaDisabled: ne,
506
511
  ariaDropEffect: Q,
507
512
  ariaErrorMessage: null,
508
- ariaExpanded: te,
513
+ ariaExpanded: ne,
509
514
  ariaFlowTo: Q,
510
- ariaGrabbed: te,
515
+ ariaGrabbed: ne,
511
516
  ariaHasPopup: null,
512
- ariaHidden: te,
517
+ ariaHidden: ne,
513
518
  ariaInvalid: null,
514
519
  ariaKeyShortcuts: null,
515
520
  ariaLabel: null,
516
521
  ariaLabelledBy: Q,
517
522
  ariaLevel: I,
518
523
  ariaLive: null,
519
- ariaModal: te,
520
- ariaMultiLine: te,
521
- ariaMultiSelectable: te,
524
+ ariaModal: ne,
525
+ ariaMultiLine: ne,
526
+ ariaMultiSelectable: ne,
522
527
  ariaOrientation: null,
523
528
  ariaOwns: Q,
524
529
  ariaPlaceholder: null,
525
530
  ariaPosInSet: I,
526
- ariaPressed: te,
527
- ariaReadOnly: te,
531
+ ariaPressed: ne,
532
+ ariaReadOnly: ne,
528
533
  ariaRelevant: null,
529
- ariaRequired: te,
534
+ ariaRequired: ne,
530
535
  ariaRoleDescription: Q,
531
536
  ariaRowCount: I,
532
537
  ariaRowIndex: I,
533
538
  ariaRowSpan: I,
534
- ariaSelected: te,
539
+ ariaSelected: ne,
535
540
  ariaSetSize: I,
536
541
  ariaSort: null,
537
542
  ariaValueMax: I,
@@ -585,7 +590,7 @@ const Vl = mt({
585
590
  cols: I,
586
591
  colSpan: null,
587
592
  content: null,
588
- contentEditable: te,
593
+ contentEditable: ne,
589
594
  controls: j,
590
595
  controlsList: Q,
591
596
  coords: I | lt,
@@ -599,7 +604,7 @@ const Vl = mt({
599
604
  dirName: null,
600
605
  disabled: j,
601
606
  download: Jn,
602
- draggable: te,
607
+ draggable: ne,
603
608
  encType: null,
604
609
  enterKeyHint: null,
605
610
  fetchPriority: null,
@@ -770,7 +775,7 @@ const Vl = mt({
770
775
  sizes: null,
771
776
  slot: null,
772
777
  span: I,
773
- spellCheck: te,
778
+ spellCheck: ne,
774
779
  src: null,
775
780
  srcDoc: null,
776
781
  srcLang: null,
@@ -785,7 +790,7 @@ const Vl = mt({
785
790
  type: null,
786
791
  typeMustMatch: j,
787
792
  useMap: null,
788
- value: te,
793
+ value: ne,
789
794
  width: I,
790
795
  wrap: null,
791
796
  writingSuggestions: null,
@@ -877,7 +882,7 @@ const Vl = mt({
877
882
  // `<table>`
878
883
  scheme: null,
879
884
  // `<meta>`
880
- scrolling: te,
885
+ scrolling: ne,
881
886
  // `<frame>`. Use overflow in the child context
882
887
  standby: null,
883
888
  // `<object>`
@@ -1615,12 +1620,12 @@ function ec() {
1615
1620
  var _ = P(), R = M(r);
1616
1621
  if (R) {
1617
1622
  if (w(), !M(i)) return v("property missing ':'");
1618
- var z = M(o), V = _({
1623
+ var z = M(o), $ = _({
1619
1624
  type: p,
1620
1625
  property: h(R[0].replace(e, f)),
1621
1626
  value: z ? h(z[0].replace(e, f)) : f
1622
1627
  });
1623
- return M(a), V;
1628
+ return M(a), $;
1624
1629
  }
1625
1630
  }
1626
1631
  function A() {
@@ -5544,7 +5549,7 @@ function Eu(e, t, n) {
5544
5549
  return g === null || q(g) ? A(g) : H(g) ? (e.consume(g), N) : n(g);
5545
5550
  }
5546
5551
  function A(g) {
5547
- return g === 45 && i === 2 ? (e.consume(g), V) : g === 60 && i === 1 ? (e.consume(g), ne) : g === 62 && i === 4 ? (e.consume(g), me) : g === 63 && i === 3 ? (e.consume(g), m) : g === 93 && i === 5 ? (e.consume(g), Te) : q(g) && (i === 6 || i === 7) ? (e.exit("htmlFlowData"), e.check(ku, Ne, _)(g)) : g === null || q(g) ? (e.exit("htmlFlowData"), _(g)) : (e.consume(g), A);
5552
+ return g === 45 && i === 2 ? (e.consume(g), $) : g === 60 && i === 1 ? (e.consume(g), re) : g === 62 && i === 4 ? (e.consume(g), me) : g === 63 && i === 3 ? (e.consume(g), m) : g === 93 && i === 5 ? (e.consume(g), Te) : q(g) && (i === 6 || i === 7) ? (e.exit("htmlFlowData"), e.check(ku, Ne, _)(g)) : g === null || q(g) ? (e.exit("htmlFlowData"), _(g)) : (e.consume(g), A);
5548
5553
  }
5549
5554
  function _(g) {
5550
5555
  return e.check(Su, R, Ne)(g);
@@ -5555,10 +5560,10 @@ function Eu(e, t, n) {
5555
5560
  function z(g) {
5556
5561
  return g === null || q(g) ? _(g) : (e.enter("htmlFlowData"), A(g));
5557
5562
  }
5558
- function V(g) {
5563
+ function $(g) {
5559
5564
  return g === 45 ? (e.consume(g), m) : A(g);
5560
5565
  }
5561
- function ne(g) {
5566
+ function re(g) {
5562
5567
  return g === 47 ? (e.consume(g), a = "", Ce) : A(g);
5563
5568
  }
5564
5569
  function Ce(g) {
@@ -5618,35 +5623,35 @@ function Tu(e, t, n) {
5618
5623
  return m === 45 ? (e.consume(m), p) : n(m);
5619
5624
  }
5620
5625
  function f(m) {
5621
- return m === null ? n(m) : m === 45 ? (e.consume(m), d) : q(m) ? (a = f, ne(m)) : (e.consume(m), f);
5626
+ return m === null ? n(m) : m === 45 ? (e.consume(m), d) : q(m) ? (a = f, re(m)) : (e.consume(m), f);
5622
5627
  }
5623
5628
  function d(m) {
5624
5629
  return m === 45 ? (e.consume(m), p) : f(m);
5625
5630
  }
5626
5631
  function p(m) {
5627
- return m === 62 ? V(m) : m === 45 ? d(m) : f(m);
5632
+ return m === 62 ? $(m) : m === 45 ? d(m) : f(m);
5628
5633
  }
5629
5634
  function h(m) {
5630
5635
  const me = "CDATA[";
5631
5636
  return m === me.charCodeAt(o++) ? (e.consume(m), o === me.length ? b : h) : n(m);
5632
5637
  }
5633
5638
  function b(m) {
5634
- return m === null ? n(m) : m === 93 ? (e.consume(m), k) : q(m) ? (a = b, ne(m)) : (e.consume(m), b);
5639
+ return m === null ? n(m) : m === 93 ? (e.consume(m), k) : q(m) ? (a = b, re(m)) : (e.consume(m), b);
5635
5640
  }
5636
5641
  function k(m) {
5637
5642
  return m === 93 ? (e.consume(m), y) : b(m);
5638
5643
  }
5639
5644
  function y(m) {
5640
- return m === 62 ? V(m) : m === 93 ? (e.consume(m), y) : b(m);
5645
+ return m === 62 ? $(m) : m === 93 ? (e.consume(m), y) : b(m);
5641
5646
  }
5642
5647
  function S(m) {
5643
- return m === null || m === 62 ? V(m) : q(m) ? (a = S, ne(m)) : (e.consume(m), S);
5648
+ return m === null || m === 62 ? $(m) : q(m) ? (a = S, re(m)) : (e.consume(m), S);
5644
5649
  }
5645
5650
  function C(m) {
5646
- return m === null ? n(m) : m === 63 ? (e.consume(m), P) : q(m) ? (a = C, ne(m)) : (e.consume(m), C);
5651
+ return m === null ? n(m) : m === 63 ? (e.consume(m), P) : q(m) ? (a = C, re(m)) : (e.consume(m), C);
5647
5652
  }
5648
5653
  function P(m) {
5649
- return m === 62 ? V(m) : C(m);
5654
+ return m === 62 ? $(m) : C(m);
5650
5655
  }
5651
5656
  function O(m) {
5652
5657
  return he(m) ? (e.consume(m), v) : n(m);
@@ -5655,25 +5660,25 @@ function Tu(e, t, n) {
5655
5660
  return m === 45 || ce(m) ? (e.consume(m), v) : M(m);
5656
5661
  }
5657
5662
  function M(m) {
5658
- return q(m) ? (a = M, ne(m)) : H(m) ? (e.consume(m), M) : V(m);
5663
+ return q(m) ? (a = M, re(m)) : H(m) ? (e.consume(m), M) : $(m);
5659
5664
  }
5660
5665
  function T(m) {
5661
5666
  return m === 45 || ce(m) ? (e.consume(m), T) : m === 47 || m === 62 || J(m) ? D(m) : n(m);
5662
5667
  }
5663
5668
  function D(m) {
5664
- return m === 47 ? (e.consume(m), V) : m === 58 || m === 95 || he(m) ? (e.consume(m), w) : q(m) ? (a = D, ne(m)) : H(m) ? (e.consume(m), D) : V(m);
5669
+ return m === 47 ? (e.consume(m), $) : m === 58 || m === 95 || he(m) ? (e.consume(m), w) : q(m) ? (a = D, re(m)) : H(m) ? (e.consume(m), D) : $(m);
5665
5670
  }
5666
5671
  function w(m) {
5667
5672
  return m === 45 || m === 46 || m === 58 || m === 95 || ce(m) ? (e.consume(m), w) : N(m);
5668
5673
  }
5669
5674
  function N(m) {
5670
- return m === 61 ? (e.consume(m), A) : q(m) ? (a = N, ne(m)) : H(m) ? (e.consume(m), N) : D(m);
5675
+ return m === 61 ? (e.consume(m), A) : q(m) ? (a = N, re(m)) : H(m) ? (e.consume(m), N) : D(m);
5671
5676
  }
5672
5677
  function A(m) {
5673
- return m === null || m === 60 || m === 61 || m === 62 || m === 96 ? n(m) : m === 34 || m === 39 ? (e.consume(m), i = m, _) : q(m) ? (a = A, ne(m)) : H(m) ? (e.consume(m), A) : (e.consume(m), R);
5678
+ return m === null || m === 60 || m === 61 || m === 62 || m === 96 ? n(m) : m === 34 || m === 39 ? (e.consume(m), i = m, _) : q(m) ? (a = A, re(m)) : H(m) ? (e.consume(m), A) : (e.consume(m), R);
5674
5679
  }
5675
5680
  function _(m) {
5676
- return m === i ? (e.consume(m), i = void 0, z) : m === null ? n(m) : q(m) ? (a = _, ne(m)) : (e.consume(m), _);
5681
+ return m === i ? (e.consume(m), i = void 0, z) : m === null ? n(m) : q(m) ? (a = _, re(m)) : (e.consume(m), _);
5677
5682
  }
5678
5683
  function R(m) {
5679
5684
  return m === null || m === 34 || m === 39 || m === 60 || m === 61 || m === 96 ? n(m) : m === 47 || m === 62 || J(m) ? D(m) : (e.consume(m), R);
@@ -5681,10 +5686,10 @@ function Tu(e, t, n) {
5681
5686
  function z(m) {
5682
5687
  return m === 47 || m === 62 || J(m) ? D(m) : n(m);
5683
5688
  }
5684
- function V(m) {
5689
+ function $(m) {
5685
5690
  return m === 62 ? (e.consume(m), e.exit("htmlTextData"), e.exit("htmlText"), t) : n(m);
5686
5691
  }
5687
- function ne(m) {
5692
+ function re(m) {
5688
5693
  return e.exit("htmlTextData"), e.enter("lineEnding"), e.consume(m), e.exit("lineEnding"), Ce;
5689
5694
  }
5690
5695
  function Ce(m) {
@@ -6311,8 +6316,8 @@ function bf(e, t, n) {
6311
6316
  }
6312
6317
  function M(N, A) {
6313
6318
  return _;
6314
- function _(R, z, V) {
6315
- let ne, Ce, Te, m;
6319
+ function _(R, z, $) {
6320
+ let re, Ce, Te, m;
6316
6321
  return Array.isArray(R) ? (
6317
6322
  /* c8 ignore next 1 */
6318
6323
  Ne(R)
@@ -6323,10 +6328,10 @@ function bf(e, t, n) {
6323
6328
  R
6324
6329
  ])
6325
6330
  ) : me(R);
6326
- function me(re) {
6331
+ function me(ie) {
6327
6332
  return Ge;
6328
6333
  function Ge(Re) {
6329
- const Fe = Re !== null && re[Re], nt = Re !== null && re.null, Ht = [
6334
+ const Fe = Re !== null && ie[Re], nt = Re !== null && ie.null, Ht = [
6330
6335
  // To do: add more extension tests.
6331
6336
  /* c8 ignore next 2 */
6332
6337
  ...Array.isArray(Fe) ? Fe : Fe ? [Fe] : [],
@@ -6335,13 +6340,13 @@ function bf(e, t, n) {
6335
6340
  return Ne(Ht)(Re);
6336
6341
  }
6337
6342
  }
6338
- function Ne(re) {
6339
- return ne = re, Ce = 0, re.length === 0 ? V : g(re[Ce]);
6343
+ function Ne(ie) {
6344
+ return re = ie, Ce = 0, ie.length === 0 ? $ : g(ie[Ce]);
6340
6345
  }
6341
- function g(re) {
6346
+ function g(ie) {
6342
6347
  return Ge;
6343
6348
  function Ge(Re) {
6344
- return m = D(), Te = re, re.partial || (c.currentConstruct = re), re.name && c.parser.constructs.disable.null.includes(re.name) ? pe() : re.tokenize.call(
6349
+ return m = D(), Te = ie, ie.partial || (c.currentConstruct = ie), ie.name && c.parser.constructs.disable.null.includes(ie.name) ? pe() : ie.tokenize.call(
6345
6350
  // If we do have fields, create an object w/ `context` as its
6346
6351
  // prototype.
6347
6352
  // This allows a “live binding”, which is needed for `interrupt`.
@@ -6352,11 +6357,11 @@ function bf(e, t, n) {
6352
6357
  )(Re);
6353
6358
  }
6354
6359
  }
6355
- function K(re) {
6360
+ function K(ie) {
6356
6361
  return N(Te, m), z;
6357
6362
  }
6358
- function pe(re) {
6359
- return m.restore(), ++Ce < ne.length ? g(ne[Ce]) : V;
6363
+ function pe(ie) {
6364
+ return m.restore(), ++Ce < re.length ? g(re[Ce]) : $;
6360
6365
  }
6361
6366
  }
6362
6367
  }
@@ -6367,9 +6372,9 @@ function bf(e, t, n) {
6367
6372
  const N = h(), A = c.previous, _ = c.currentConstruct, R = c.events.length, z = Array.from(s);
6368
6373
  return {
6369
6374
  from: R,
6370
- restore: V
6375
+ restore: $
6371
6376
  };
6372
- function V() {
6377
+ function $() {
6373
6378
  r = N, c.previous = A, c.currentConstruct = _, c.events.length = R, s = z, w();
6374
6379
  }
6375
6380
  }
@@ -6568,7 +6573,7 @@ function Af(e) {
6568
6573
  characterEscapeValue: w,
6569
6574
  characterReferenceMarkerHexadecimal: pe,
6570
6575
  characterReferenceMarkerNumeric: pe,
6571
- characterReferenceValue: re,
6576
+ characterReferenceValue: ie,
6572
6577
  characterReference: Ge,
6573
6578
  codeFenced: l(k),
6574
6579
  codeFencedFence: b,
@@ -6590,11 +6595,11 @@ function Af(e) {
6590
6595
  htmlFlowData: w,
6591
6596
  htmlText: l(R),
6592
6597
  htmlTextData: w,
6593
- image: l(ne),
6598
+ image: l(re),
6594
6599
  label: Te,
6595
6600
  labelText: Ce,
6596
6601
  lineEnding: N,
6597
- link: l(V),
6602
+ link: l($),
6598
6603
  listItem: l(),
6599
6604
  listOrdered: l(),
6600
6605
  listUnordered: l(),
@@ -6627,14 +6632,14 @@ function Af(e) {
6627
6632
  buffer: a,
6628
6633
  resume: u,
6629
6634
  data: n
6630
- }, $ = [];
6635
+ }, W = [];
6631
6636
  let Y = -1;
6632
6637
  for (; ++Y < E.length; )
6633
6638
  if (E[Y][1].type === "listOrdered" || E[Y][1].type === "listUnordered")
6634
6639
  if (E[Y][0] === "enter")
6635
- $.push(Y);
6640
+ W.push(Y);
6636
6641
  else {
6637
- const Oe = $.pop();
6642
+ const Oe = W.pop();
6638
6643
  Y = i(E, Oe, Y);
6639
6644
  }
6640
6645
  for (Y = -1; ++Y < E.length; ) {
@@ -6663,9 +6668,9 @@ function Af(e) {
6663
6668
  return L;
6664
6669
  }
6665
6670
  function i(E, L, B) {
6666
- let $ = L - 1, Y = -1, Oe = !1, Ke, Be, yt, wt;
6667
- for (; ++$ <= B; ) {
6668
- const ye = E[$];
6671
+ let W = L - 1, Y = -1, Oe = !1, Ke, Be, yt, wt;
6672
+ for (; ++W <= B; ) {
6673
+ const ye = E[W];
6669
6674
  switch (ye[1].type) {
6670
6675
  case "listUnordered":
6671
6676
  case "listOrdered":
@@ -6674,7 +6679,7 @@ function Af(e) {
6674
6679
  break;
6675
6680
  }
6676
6681
  case "lineEndingBlank": {
6677
- ye[0] === "enter" && (Ke && !wt && !Y && !yt && (yt = $), wt = void 0);
6682
+ ye[0] === "enter" && (Ke && !wt && !Y && !yt && (yt = W), wt = void 0);
6678
6683
  break;
6679
6684
  }
6680
6685
  case "linePrefix":
@@ -6688,7 +6693,7 @@ function Af(e) {
6688
6693
  }
6689
6694
  if (!Y && ye[0] === "enter" && ye[1].type === "listItemPrefix" || Y === -1 && ye[0] === "exit" && (ye[1].type === "listUnordered" || ye[1].type === "listOrdered")) {
6690
6695
  if (Ke) {
6691
- let rt = $;
6696
+ let rt = W;
6692
6697
  for (Be = void 0; rt--; ) {
6693
6698
  const Ue = E[rt];
6694
6699
  if (Ue[1].type === "lineEnding" || Ue[1].type === "lineEndingBlank") {
@@ -6696,7 +6701,7 @@ function Af(e) {
6696
6701
  Be && (E[Be][1].type = "lineEndingBlank", Oe = !0), Ue[1].type = "lineEnding", Be = rt;
6697
6702
  } else if (!(Ue[1].type === "linePrefix" || Ue[1].type === "blockQuotePrefix" || Ue[1].type === "blockQuotePrefixWhitespace" || Ue[1].type === "blockQuoteMarker" || Ue[1].type === "listItemIndent")) break;
6698
6703
  }
6699
- yt && (!Be || yt < Be) && (Ke._spread = !0), Ke.end = Object.assign({}, Be ? E[Be][1].start : ye[1].end), E.splice(Be || $, 0, ["exit", Ke, ye[2]]), $++, B++;
6704
+ yt && (!Be || yt < Be) && (Ke._spread = !0), Ke.end = Object.assign({}, Be ? E[Be][1].start : ye[1].end), E.splice(Be || W, 0, ["exit", Ke, ye[2]]), W++, B++;
6700
6705
  }
6701
6706
  if (ye[1].type === "listItemPrefix") {
6702
6707
  const rt = {
@@ -6706,7 +6711,7 @@ function Af(e) {
6706
6711
  // @ts-expect-error: we’ll add `end` in a second.
6707
6712
  end: void 0
6708
6713
  };
6709
- Ke = rt, E.splice($, 0, ["enter", rt, ye[2]]), $++, B++, yt = void 0, wt = !0;
6714
+ Ke = rt, E.splice(W, 0, ["enter", rt, ye[2]]), W++, B++, yt = void 0, wt = !0;
6710
6715
  }
6711
6716
  }
6712
6717
  }
@@ -6714,8 +6719,8 @@ function Af(e) {
6714
6719
  }
6715
6720
  function o(E, L) {
6716
6721
  return B;
6717
- function B($) {
6718
- s.call(this, E($), $), L && L.call(this, $);
6722
+ function B(W) {
6723
+ s.call(this, E(W), W), L && L.call(this, W);
6719
6724
  }
6720
6725
  }
6721
6726
  function a() {
@@ -6738,9 +6743,9 @@ function Af(e) {
6738
6743
  }
6739
6744
  }
6740
6745
  function c(E, L) {
6741
- const B = this.stack.pop(), $ = this.tokenStack.pop();
6742
- if ($)
6743
- $[0].type !== E.type && (L ? L.call(this, E, $[0]) : ($[1] || Ei).call(this, E, $[0]));
6746
+ const B = this.stack.pop(), W = this.tokenStack.pop();
6747
+ if (W)
6748
+ W[0].type !== E.type && (L ? L.call(this, E, W[0]) : (W[1] || Ei).call(this, E, W[0]));
6744
6749
  else throw new Error("Cannot close `" + E.type + "` (" + It({
6745
6750
  start: E.start,
6746
6751
  end: E.end
@@ -6809,12 +6814,12 @@ function Af(e) {
6809
6814
  }
6810
6815
  function D(E) {
6811
6816
  const B = this.stack[this.stack.length - 1].children;
6812
- let $ = B[B.length - 1];
6813
- (!$ || $.type !== "text") && ($ = el(), $.position = {
6817
+ let W = B[B.length - 1];
6818
+ (!W || W.type !== "text") && (W = el(), W.position = {
6814
6819
  start: Ve(E.start),
6815
6820
  // @ts-expect-error: we’ll add `end` later.
6816
6821
  end: void 0
6817
- }, B.push($)), this.stack.push($);
6822
+ }, B.push(W)), this.stack.push(W);
6818
6823
  }
6819
6824
  function w(E) {
6820
6825
  const L = this.stack.pop();
@@ -6844,7 +6849,7 @@ function Af(e) {
6844
6849
  const E = this.resume(), L = this.stack[this.stack.length - 1];
6845
6850
  L.value = E;
6846
6851
  }
6847
- function V() {
6852
+ function $() {
6848
6853
  const E = this.stack[this.stack.length - 1];
6849
6854
  if (this.data.inReference) {
6850
6855
  const L = this.data.referenceType || "shortcut";
@@ -6853,7 +6858,7 @@ function Af(e) {
6853
6858
  delete E.identifier, delete E.label;
6854
6859
  this.data.referenceType = void 0;
6855
6860
  }
6856
- function ne() {
6861
+ function re() {
6857
6862
  const E = this.stack[this.stack.length - 1];
6858
6863
  if (this.data.inReference) {
6859
6864
  const L = this.data.referenceType || "shortcut";
@@ -6869,8 +6874,8 @@ function Af(e) {
6869
6874
  function Te() {
6870
6875
  const E = this.stack[this.stack.length - 1], L = this.resume(), B = this.stack[this.stack.length - 1];
6871
6876
  if (this.data.inReference = !0, B.type === "link") {
6872
- const $ = E.children;
6873
- B.children = $;
6877
+ const W = E.children;
6878
+ B.children = W;
6874
6879
  } else
6875
6880
  B.alt = L;
6876
6881
  }
@@ -6895,12 +6900,12 @@ function Af(e) {
6895
6900
  function pe(E) {
6896
6901
  this.data.characterReferenceType = E.type;
6897
6902
  }
6898
- function re(E) {
6903
+ function ie(E) {
6899
6904
  const L = this.sliceSerialize(E), B = this.data.characterReferenceType;
6900
- let $;
6901
- B ? ($ = da(L, B === "characterReferenceMarkerNumeric" ? 10 : 16), this.data.characterReferenceType = void 0) : $ = Nr(L);
6905
+ let W;
6906
+ B ? (W = da(L, B === "characterReferenceMarkerNumeric" ? 10 : 16), this.data.characterReferenceType = void 0) : W = Nr(L);
6902
6907
  const Y = this.stack[this.stack.length - 1];
6903
- Y.value += $;
6908
+ Y.value += W;
6904
6909
  }
6905
6910
  function Ge(E) {
6906
6911
  const L = this.stack.pop();
@@ -11563,9 +11568,9 @@ function Qi({
11563
11568
  showTimestamp: o = !0,
11564
11569
  showTail: a = !0
11565
11570
  }) {
11566
- const s = !t, [l, c] = W(!1), [u, f] = W(
11571
+ const s = !t, [l, c] = V(!1), [u, f] = V(
11567
11572
  null
11568
- ), [d, p] = W(!1), [h, b] = W(!1), k = kr(), { collectUserFeedback: y, onMessageClick: S } = mn(), C = !e.isWelcomeMessage && typeof S == "function", P = Ml(
11573
+ ), [d, p] = V(!1), [h, b] = V(!1), k = kr(), { collectUserFeedback: y, onMessageClick: S } = mn(), C = !e.isWelcomeMessage && typeof S == "function", P = Ml(
11569
11574
  e.content,
11570
11575
  15,
11571
11576
  n && s
@@ -11800,15 +11805,12 @@ function wm({
11800
11805
  ) }, i);
11801
11806
  }
11802
11807
  function xm(e) {
11803
- const { className: t, src: n, ...r } = e;
11804
- return /* @__PURE__ */ x("div", { className: F("w-full h-full", t), ...r, children: n ? /* @__PURE__ */ x(
11805
- "img",
11806
- {
11807
- src: n,
11808
- alt: "Assistant Logo",
11809
- className: "w-full h-full object-contain"
11810
- }
11811
- ) : /* @__PURE__ */ U("svg", { viewBox: "0 0 80 80", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
11808
+ const { className: t, src: n, ...r } = e, [i, o] = V(!1);
11809
+ ee(() => {
11810
+ o(!1);
11811
+ }, [n]);
11812
+ const a = !n || i;
11813
+ return /* @__PURE__ */ x("div", { className: F("w-full h-full", t), ...r, children: a ? /* @__PURE__ */ U("svg", { viewBox: "0 0 80 80", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
11812
11814
  /* @__PURE__ */ x("rect", { width: "80", height: "80", fill: "#6F33B7" }),
11813
11815
  /* @__PURE__ */ x(
11814
11816
  "path",
@@ -11819,7 +11821,15 @@ function xm(e) {
11819
11821
  fill: "white"
11820
11822
  }
11821
11823
  )
11822
- ] }) });
11824
+ ] }) : /* @__PURE__ */ x(
11825
+ "img",
11826
+ {
11827
+ src: n,
11828
+ alt: "Assistant Logo",
11829
+ className: "w-full h-full object-contain",
11830
+ onError: () => o(!0)
11831
+ }
11832
+ ) });
11823
11833
  }
11824
11834
  const os = pn(null), vm = {
11825
11835
  isVisible: !1,
@@ -11836,7 +11846,7 @@ function as() {
11836
11846
  ), vm);
11837
11847
  }
11838
11848
  function km() {
11839
- const e = mn(), t = as(), n = se(null), r = se(!0), [i, o] = W(!1), [a, s] = W(!1), l = (d) => d.scrollHeight - d.scrollTop <= d.clientHeight + 60, c = (d) => {
11849
+ const e = mn(), t = as(), n = se(null), r = se(!0), [i, o] = V(!1), [a, s] = V(!1), l = (d) => d.scrollHeight - d.scrollTop <= d.clientHeight + 60, c = (d) => {
11840
11850
  const p = d.target;
11841
11851
  l(p) ? (o(!1), s(!1)) : (o(!0), s(!0));
11842
11852
  }, u = (d = "smooth") => {
@@ -11848,9 +11858,9 @@ function km() {
11848
11858
  });
11849
11859
  }
11850
11860
  };
11851
- ie(() => {
11861
+ ee(() => {
11852
11862
  r.current ? (u("instant"), r.current = !1) : a || u();
11853
- }, [e.messages, a]), ie(() => {
11863
+ }, [e.messages, a]), ee(() => {
11854
11864
  const d = n.current?.querySelector(
11855
11865
  "div.chat-interface-body"
11856
11866
  );
@@ -12019,7 +12029,7 @@ const Xi = {
12019
12029
  );
12020
12030
  };
12021
12031
  function _m() {
12022
- const { error: e } = vn(), t = !!e, n = mn(), r = se(null), [i, o] = W(""), a = Sm(), s = kr(), l = () => i.trim() && !t ? { backgroundColor: s.userBubbleColor } : {}, c = () => n.suggestedMessages ? /* @__PURE__ */ x(
12032
+ const { error: e } = vn(), t = !!e, n = mn(), r = se(null), [i, o] = V(""), a = Sm(), s = kr(), l = () => i.trim() && !t ? { backgroundColor: s.userBubbleColor } : {}, c = () => n.suggestedMessages ? /* @__PURE__ */ x(
12023
12033
  "div",
12024
12034
  {
12025
12035
  className: "w-full px-4 pb-10 -mt-20 overflow-x-auto no-scrollbar z-10 cursor-grab",
@@ -12251,7 +12261,7 @@ function ps({
12251
12261
  ] }, "chat-interface-sekelton");
12252
12262
  }
12253
12263
  function Nm(e) {
12254
- const { isOpen: t = !1, isMobile: n, onCleanChat: r, onClose: i, theme: o } = e, a = br(t, 10), [s, l] = W(!1), c = fs({
12264
+ const { isOpen: t = !1, isMobile: n, onCleanChat: r, onClose: i, theme: o } = e, a = br(t, 10), [s, l] = V(!1), c = fs({
12255
12265
  isOpen: a,
12256
12266
  isMobile: n
12257
12267
  }), u = () => s ? /* @__PURE__ */ U(yr, { className: c, children: [
@@ -12288,7 +12298,7 @@ function Nm(e) {
12288
12298
  ) }) });
12289
12299
  }
12290
12300
  function jn({ children: e, head: t, ...n }) {
12291
- const [r, i] = W(null), o = r?.contentWindow?.document?.head, a = r?.contentWindow?.document?.body;
12301
+ const [r, i] = V(null), o = r?.contentWindow?.document?.head, a = r?.contentWindow?.document?.body;
12292
12302
  return /* @__PURE__ */ U("iframe", { ...n, ref: i, children: [
12293
12303
  o && Kn(t, o),
12294
12304
  a && Kn(e, a)
@@ -12304,8 +12314,8 @@ function Om({
12304
12314
  onMessageClick: r,
12305
12315
  autoHideDelay: i
12306
12316
  }) {
12307
- const [o, a] = W(!1), [s, l] = W("entering"), c = kr();
12308
- return ie(() => {
12317
+ const [o, a] = V(!1), [s, l] = V("entering"), c = kr();
12318
+ return ee(() => {
12309
12319
  if (t) {
12310
12320
  a(!0), l("entering");
12311
12321
  const u = setTimeout(() => {
@@ -12549,8 +12559,8 @@ function Pm({
12549
12559
  (R) => !N.has(R.id)
12550
12560
  );
12551
12561
  if (!(A.length === 0 && _.length === 0)) {
12552
- const R = p(D, T), z = A.length === 1 && _.length === 0, V = A.length > 1 && _.length === 0;
12553
- R && z ? k(A[0]) : R && V ? y(T, A) : S(
12562
+ const R = p(D, T), z = A.length === 1 && _.length === 0, $ = A.length > 1 && _.length === 0;
12563
+ R && z ? k(A[0]) : R && $ ? y(T, A) : S(
12554
12564
  T,
12555
12565
  A,
12556
12566
  _
@@ -12595,10 +12605,10 @@ function Pm({
12595
12605
  ), M = () => {
12596
12606
  l.current += 1, v("high");
12597
12607
  };
12598
- return ie(() => {
12608
+ return ee(() => {
12599
12609
  const T = l.current > 0 ? "high" : i ? "medium" : "low";
12600
12610
  v(T);
12601
- }, [i, v]), ie(() => (t && e ? P() : O(), O), [t, e, P, O]), ie(() => O, [O]), {
12611
+ }, [i, v]), ee(() => (t && e ? P() : O(), O), [t, e, P, O]), ee(() => O, [O]), {
12602
12612
  setPollingMode: v,
12603
12613
  expectMessage: M,
12604
12614
  startPolling: P,
@@ -13011,11 +13021,11 @@ const hs = (e) => {
13011
13021
  }
13012
13022
  }, A && (_.API.GraphQL.modelIntrospection = A);
13013
13023
  }
13014
- const V = l ? {
13024
+ const $ = l ? {
13015
13025
  status: l && l.toLowerCase(),
13016
13026
  totpEnabled: c?.includes("TOTP") ?? !1,
13017
13027
  smsEnabled: c?.includes("SMS") ?? !1
13018
- } : void 0, ne = u ? {
13028
+ } : void 0, re = u ? {
13019
13029
  minLength: u.passwordPolicyMinLength,
13020
13030
  requireLowercase: u.passwordPolicyCharacters?.includes("REQUIRES_LOWERCASE") ?? !1,
13021
13031
  requireUppercase: u.passwordPolicyCharacters?.includes("REQUIRES_UPPERCASE") ?? !1,
@@ -13037,8 +13047,8 @@ const hs = (e) => {
13037
13047
  userAttributes: Te,
13038
13048
  userPoolClientId: v,
13039
13049
  userPoolId: O,
13040
- mfa: V,
13041
- passwordFormat: ne,
13050
+ mfa: $,
13051
+ passwordFormat: re,
13042
13052
  loginWith: {
13043
13053
  username: !(m || me),
13044
13054
  email: m,
@@ -13075,10 +13085,10 @@ const hs = (e) => {
13075
13085
  if (w && (_.API = {
13076
13086
  ..._.API,
13077
13087
  REST: w.reduce((K, pe) => {
13078
- const { name: re, endpoint: Ge, region: Re, service: Fe } = pe;
13088
+ const { name: ie, endpoint: Ge, region: Re, service: Fe } = pe;
13079
13089
  return {
13080
13090
  ...K,
13081
- [re]: {
13091
+ [ie]: {
13082
13092
  endpoint: Ge,
13083
13093
  ...Fe ? { service: Fe } : void 0,
13084
13094
  ...Re ? { region: Re } : void 0
@@ -13690,10 +13700,10 @@ function _g(e) {
13690
13700
  t += ys[e[n]];
13691
13701
  return t;
13692
13702
  }
13693
- var ee;
13703
+ var te;
13694
13704
  (function(e) {
13695
13705
  e.WebUnknown = "0", e.React = "1", e.NextJs = "2", e.Angular = "3", e.VueJs = "4", e.Nuxt = "5", e.Svelte = "6", e.ServerSideUnknown = "100", e.ReactSSR = "101", e.NextJsSSR = "102", e.AngularSSR = "103", e.VueJsSSR = "104", e.NuxtSSR = "105", e.SvelteSSR = "106", e.ReactNative = "201", e.Expo = "202";
13696
- })(ee || (ee = {}));
13706
+ })(te || (te = {}));
13697
13707
  var io;
13698
13708
  (function(e) {
13699
13709
  e.AI = "ai", e.API = "api", e.Auth = "auth", e.Analytics = "analytics", e.DataStore = "datastore", e.Geo = "geo", e.InAppMessaging = "inappmessaging", e.Interactions = "interactions", e.Predictions = "predictions", e.PubSub = "pubsub", e.PushNotification = "pushnotification", e.Storage = "storage";
@@ -13796,26 +13806,26 @@ function jg() {
13796
13806
  }
13797
13807
  const Hg = [
13798
13808
  // First, detect mobile
13799
- { platform: ee.Expo, detectionMethod: Ug },
13800
- { platform: ee.ReactNative, detectionMethod: Bg },
13809
+ { platform: te.Expo, detectionMethod: Ug },
13810
+ { platform: te.ReactNative, detectionMethod: Bg },
13801
13811
  // Next, detect web frameworks
13802
- { platform: ee.NextJs, detectionMethod: Dg },
13803
- { platform: ee.Nuxt, detectionMethod: Mg },
13804
- { platform: ee.Angular, detectionMethod: qg },
13805
- { platform: ee.React, detectionMethod: Ig },
13806
- { platform: ee.VueJs, detectionMethod: Ng },
13807
- { platform: ee.Svelte, detectionMethod: Og },
13808
- { platform: ee.WebUnknown, detectionMethod: jg },
13812
+ { platform: te.NextJs, detectionMethod: Dg },
13813
+ { platform: te.Nuxt, detectionMethod: Mg },
13814
+ { platform: te.Angular, detectionMethod: qg },
13815
+ { platform: te.React, detectionMethod: Ig },
13816
+ { platform: te.VueJs, detectionMethod: Ng },
13817
+ { platform: te.Svelte, detectionMethod: Og },
13818
+ { platform: te.WebUnknown, detectionMethod: jg },
13809
13819
  // Last, detect ssr frameworks
13810
- { platform: ee.NextJsSSR, detectionMethod: Pg },
13811
- { platform: ee.NuxtSSR, detectionMethod: zg },
13812
- { platform: ee.ReactSSR, detectionMethod: Tg },
13813
- { platform: ee.VueJsSSR, detectionMethod: Rg },
13814
- { platform: ee.AngularSSR, detectionMethod: Fg },
13815
- { platform: ee.SvelteSSR, detectionMethod: Lg }
13820
+ { platform: te.NextJsSSR, detectionMethod: Pg },
13821
+ { platform: te.NuxtSSR, detectionMethod: zg },
13822
+ { platform: te.ReactSSR, detectionMethod: Tg },
13823
+ { platform: te.VueJsSSR, detectionMethod: Rg },
13824
+ { platform: te.AngularSSR, detectionMethod: Fg },
13825
+ { platform: te.SvelteSSR, detectionMethod: Lg }
13816
13826
  ];
13817
13827
  function Vg() {
13818
- return Hg.find((e) => e.detectionMethod())?.platform || ee.ServerSideUnknown;
13828
+ return Hg.find((e) => e.detectionMethod())?.platform || te.ServerSideUnknown;
13819
13829
  }
13820
13830
  let Rt;
13821
13831
  const Hn = [];
@@ -13829,7 +13839,7 @@ const $g = 10, Wg = 10, Gg = 1e3, xs = () => {
13829
13839
  Hn.forEach((e) => {
13830
13840
  e();
13831
13841
  });
13832
- yo(ee.ServerSideUnknown, $g), yo(ee.WebUnknown, Wg);
13842
+ yo(te.ServerSideUnknown, $g), yo(te.WebUnknown, Wg);
13833
13843
  }
13834
13844
  return Rt;
13835
13845
  };
@@ -15813,8 +15823,8 @@ function rw({
15813
15823
  onError: n,
15814
15824
  chatSettings: r
15815
15825
  }) {
15816
- const [i, o] = W(!1), a = se(!1), s = se(null), { publishError: l } = vn(), c = r?.app_sync_url, u = r?.app_sync_region, f = r?.app_sync_api_key;
15817
- ie(() => {
15826
+ const [i, o] = V(!1), a = se(!1), s = se(null), { publishError: l } = vn(), c = r?.app_sync_url, u = r?.app_sync_region, f = r?.app_sync_api_key;
15827
+ ee(() => {
15818
15828
  (c || u || f) && (Xr.configure(
15819
15829
  Pl(c, f, u)
15820
15830
  ), o(!0));
@@ -15913,9 +15923,9 @@ function iw({
15913
15923
  const { saveConversationData: d, clearConversationData: p, updateLastActivity: h } = Ur({ appId: e }), { publishApiError: b } = vn(), { showCognition: k, hideCognition: y } = as(), S = X(
15914
15924
  (w, N) => {
15915
15925
  y(), l((A) => {
15916
- const _ = A.filter((V) => !V.isThinking);
15926
+ const _ = A.filter(($) => !$.isThinking);
15917
15927
  if (!w.response.content || _.some(
15918
- (V) => V.id === w.message_id
15928
+ ($) => $.id === w.message_id
15919
15929
  ))
15920
15930
  return _;
15921
15931
  const z = [
@@ -15987,7 +15997,7 @@ function iw({
15987
15997
  });
15988
15998
  l(
15989
15999
  (z) => z.map(
15990
- (V) => V.id === N.id ? { ...V, id: R.message_id } : V
16000
+ ($) => $.id === N.id ? { ...$, id: R.message_id } : $
15991
16001
  )
15992
16002
  ), v();
15993
16003
  } catch (_) {
@@ -16083,9 +16093,9 @@ class ow {
16083
16093
  }
16084
16094
  const Zt = /* @__PURE__ */ new Map(), en = /* @__PURE__ */ new Map();
16085
16095
  function aw(e, t, n) {
16086
- const r = n?.dedupe !== !1, [i, o] = W(
16096
+ const r = n?.dedupe !== !1, [i, o] = V(
16087
16097
  () => Zt.get(e)
16088
- ), { publishApiError: a } = vn(), [s, l] = W(void 0), [c, u] = W(!1), f = se(!0);
16098
+ ), { publishApiError: a } = vn(), [s, l] = V(void 0), [c, u] = V(!1), f = se(!0);
16089
16099
  se(() => (f.current = !0, () => {
16090
16100
  f.current = !1;
16091
16101
  }));
@@ -16111,8 +16121,8 @@ function aw(e, t, n) {
16111
16121
  return { data: i, error: s, isLoading: c, fetch: d };
16112
16122
  }
16113
16123
  function sw(e) {
16114
- const { appId: t, initialUserId: n } = e, { getSavedConversationData: r } = Ur({ appId: t }), [i, o] = W(!1), [a, s] = W(""), [l, c] = W(""), [u, f] = W(null);
16115
- return ie(() => {
16124
+ const { appId: t, initialUserId: n } = e, { getSavedConversationData: r } = Ur({ appId: t }), [i, o] = V(!1), [a, s] = V(""), [l, c] = V(""), [u, f] = V(null);
16125
+ return ee(() => {
16116
16126
  const d = r();
16117
16127
  d?.userId ? d?.externalId !== n ? (s(d.userId), f(n)) : (s(d?.userId), f(d.externalId)) : n ? (s(n), f(n)) : s(crypto.randomUUID()), c(d?.deviceId || crypto.randomUUID()), o(!0);
16118
16128
  }, [r, n]), {
@@ -16136,13 +16146,13 @@ function lw({
16136
16146
  isConversationExpired: s,
16137
16147
  clearConversationData: l,
16138
16148
  getSavedConversationData: c
16139
- } = Ur({ appId: e }), { current: u } = se(Dl()), [f] = W(
16149
+ } = Ur({ appId: e }), { current: u } = se(Dl()), [f] = V(
16140
16150
  new ow({
16141
16151
  baseURL: u,
16142
16152
  appId: e
16143
16153
  })
16144
- ), [d, p] = W(null), [h, b] = W(null), [k, y] = W([]), [S, C] = W(!1), O = aw(`sdk-boot-${e}`, () => f.boot()).fetch;
16145
- return ie(() => {
16154
+ ), [d, p] = V(null), [h, b] = V(null), [k, y] = V([]), [S, C] = V(!1), O = aw(`sdk-boot-${e}`, () => f.boot()).fetch;
16155
+ return ee(() => {
16146
16156
  if (s())
16147
16157
  l();
16148
16158
  else {
@@ -16155,7 +16165,7 @@ function lw({
16155
16165
  id: v
16156
16166
  }), T && T.length > 0 && y(T));
16157
16167
  }
16158
- }, [c, s, l]), ie(() => {
16168
+ }, [c, s, l]), ee(() => {
16159
16169
  if (!a) return;
16160
16170
  (async () => {
16161
16171
  const [M, T] = await kl(O());
@@ -16187,16 +16197,16 @@ function lw({
16187
16197
  };
16188
16198
  }
16189
16199
  function cw(e) {
16190
- const [t, n] = W(!1), [r, i] = W(
16200
+ const [t, n] = V(!1), [r, i] = V(
16191
16201
  null
16192
16202
  ), o = e ?? t, a = typeof window > "u";
16193
- return ie(() => {
16203
+ return ee(() => {
16194
16204
  if (a) return;
16195
16205
  const s = () => {
16196
16206
  n(window.innerWidth <= 640);
16197
16207
  };
16198
16208
  return s(), window.addEventListener("resize", s), () => window.removeEventListener("resize", s);
16199
- }, [a]), ie(() => {
16209
+ }, [a]), ee(() => {
16200
16210
  if (a) return;
16201
16211
  const s = document.createElement("div");
16202
16212
  return s.className = "eloquent-ai-chat-portal", s.style.position = "relative", s.style.zIndex = "30", document.body.appendChild(s), i(s), () => {
@@ -16232,9 +16242,9 @@ function uw({
16232
16242
  appId: t,
16233
16243
  initialUserId: n,
16234
16244
  initialUserName: r
16235
- }), C = Lm({ chatProps: i, chatSettings: b }), [P, O] = W(a ?? l), v = br(P, 200), [M, T] = W(
16245
+ }), C = Lm({ chatProps: i, chatSettings: b }), [P, O] = V(a ?? l), v = br(P, 200), [M, T] = V(
16236
16246
  i?.messages ?? []
16237
- ), [D, w] = W(k), [N, A] = W({
16247
+ ), [D, w] = V(k), [N, A] = V({
16238
16248
  text: "",
16239
16249
  isVisible: !1,
16240
16250
  autoHideDelay: s
@@ -16252,11 +16262,11 @@ function uw({
16252
16262
  setCurrentConversation: w,
16253
16263
  chatOpen: P
16254
16264
  });
16255
- ie(() => {
16265
+ ee(() => {
16256
16266
  y.length > 0 && T(y);
16257
- }, [y]), ie(() => {
16267
+ }, [y]), ee(() => {
16258
16268
  k && w(k);
16259
- }, [k]), ie(() => {
16269
+ }, [k]), ee(() => {
16260
16270
  D && d && h?.identifyUser({
16261
16271
  userId: u,
16262
16272
  userName: f,
@@ -16266,15 +16276,15 @@ function uw({
16266
16276
  });
16267
16277
  }, [d, u, f, p, D, h]);
16268
16278
  const z = X(() => {
16269
- A((V) => ({
16270
- ...V,
16279
+ A(($) => ({
16280
+ ...$,
16271
16281
  isVisible: !1
16272
16282
  }));
16273
16283
  }, []);
16274
- return ie(() => {
16275
- b?.auto_display_welcome_message && b?.welcome_message && S && A((V) => ({
16276
- ...V,
16277
- text: b.welcome_message || V.text,
16284
+ return ee(() => {
16285
+ b?.auto_display_welcome_message && b?.welcome_message && S && A(($) => ({
16286
+ ...$,
16287
+ text: b.welcome_message || $.text,
16278
16288
  isVisible: !0
16279
16289
  }));
16280
16290
  }, [
@@ -16297,7 +16307,7 @@ function uw({
16297
16307
  };
16298
16308
  }
16299
16309
  function fw() {
16300
- const [e, t] = W(!1), [n, r] = W(null), i = se(null), o = se(null), a = X((l = "") => {
16310
+ const [e, t] = V(!1), [n, r] = V(null), i = se(null), o = se(null), a = X((l = "") => {
16301
16311
  const c = () => {
16302
16312
  r(l), t(!0), o.current = null, i.current && clearTimeout(i.current), i.current = setTimeout(() => {
16303
16313
  i.current = null, o.current && c();
@@ -16323,7 +16333,7 @@ function pw({
16323
16333
  const dw = ({
16324
16334
  children: e
16325
16335
  }) => {
16326
- const [t, n] = W(null), r = Cm(n), a = {
16336
+ const [t, n] = V(null), r = Cm(n), a = {
16327
16337
  error: t,
16328
16338
  publishApiError: r,
16329
16339
  publishError: (s) => n(s),
@@ -16512,4 +16522,4 @@ export {
16512
16522
  ra as g,
16513
16523
  Aw as r
16514
16524
  };
16515
- //# sourceMappingURL=index-BBJNdFGo.js.map
16525
+ //# sourceMappingURL=index-hI0BPrdU.js.map