@eloquentai/chat-sdk 0.19.1-dev → 0.19.2-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.
- package/dist/components/chat/validations.d.ts +0 -6
- package/dist/index.mjs +134 -138
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as
|
2
|
-
import { version as ql, createContext as Jo, useContext as Xo, useState as z, useEffect as
|
1
|
+
import * as ce from "react";
|
2
|
+
import { version as ql, createContext as Jo, useContext as Xo, useState as z, useEffect as ae, useMemo as Et, useRef as Pe, useCallback as $e } from "react";
|
3
3
|
import { jsx as m, jsxs as D, Fragment as xt } from "react/jsx-runtime";
|
4
4
|
import { ChevronDown as Xa, X as Qa, Copy as Gl, ThumbsUp as Vl, ThumbsDown as Kl, FileSearch as Yl, CheckCircle as Jl, Info as Xl, XCircle as Ql, AlertTriangle as Zl, ArrowUp as ed, RefreshCcw as td } from "lucide-react";
|
5
5
|
import { clsx as nd } from "clsx";
|
@@ -11,11 +11,11 @@ import * as Ae from "@radix-ui/react-dialog";
|
|
11
11
|
import { useRive as sd, Layout as id, Alignment as ad, Fit as cd, useStateMachineInput as ud } from "@rive-app/react-canvas";
|
12
12
|
import * as Ut from "@radix-ui/react-avatar";
|
13
13
|
import { createPortal as fo } from "react-dom";
|
14
|
-
import { z as
|
14
|
+
import { z as he } from "zod";
|
15
15
|
import ld 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] = "
|
18
|
+
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "a063cbcc-1165-4ccb-a8df-a20a5c3379f7", e._sentryDebugIdIdentifier = "sentry-dbid-a063cbcc-1165-4ccb-a8df-a20a5c3379f7");
|
19
19
|
} catch {
|
20
20
|
}
|
21
21
|
const U = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__, st = "9.30.0", $ = globalThis;
|
@@ -5381,19 +5381,19 @@ function vt(e, t) {
|
|
5381
5381
|
});
|
5382
5382
|
if (!Z)
|
5383
5383
|
return console.warn(e, "not serialized"), null;
|
5384
|
-
let
|
5385
|
-
r.hasNode(e) ?
|
5386
|
-
const P = Object.assign(Z, { id:
|
5387
|
-
if (r.add(e, P),
|
5384
|
+
let ie;
|
5385
|
+
r.hasNode(e) ? ie = r.getId(e) : Yg(Z, v) || !L && Z.type === re.Text && !Z.isStyle && !Z.textContent.replace(/^\s+|\s+$/gm, "").length ? ie = an : ie = bs();
|
5386
|
+
const P = Object.assign(Z, { id: ie });
|
5387
|
+
if (r.add(e, P), ie === an)
|
5388
5388
|
return null;
|
5389
5389
|
w && w(e);
|
5390
|
-
let
|
5390
|
+
let ue = !f;
|
5391
5391
|
if (P.type === re.Element) {
|
5392
|
-
|
5392
|
+
ue = ue && !P.needBlock, delete P.needBlock;
|
5393
5393
|
const J = e.shadowRoot;
|
5394
5394
|
J && Zt(J) && (P.isShadowHost = !0);
|
5395
5395
|
}
|
5396
|
-
if ((P.type === re.Document || P.type === re.Element) &&
|
5396
|
+
if ((P.type === re.Document || P.type === re.Element) && ue) {
|
5397
5397
|
v.headWhitespace && P.type === re.Element && P.tagName === "head" && (L = !1);
|
5398
5398
|
const J = {
|
5399
5399
|
doc: n,
|
@@ -5841,7 +5841,7 @@ function Ar(...e) {
|
|
5841
5841
|
function ry(...e) {
|
5842
5842
|
return ws("clearTimeout")(...e);
|
5843
5843
|
}
|
5844
|
-
var M = /* @__PURE__ */ ((e) => (e[e.DomContentLoaded = 0] = "DomContentLoaded", e[e.Load = 1] = "Load", e[e.FullSnapshot = 2] = "FullSnapshot", e[e.IncrementalSnapshot = 3] = "IncrementalSnapshot", e[e.Meta = 4] = "Meta", e[e.Custom = 5] = "Custom", e[e.Plugin = 6] = "Plugin", e))(M || {}), O = /* @__PURE__ */ ((e) => (e[e.Mutation = 0] = "Mutation", e[e.MouseMove = 1] = "MouseMove", e[e.MouseInteraction = 2] = "MouseInteraction", e[e.Scroll = 3] = "Scroll", e[e.ViewportResize = 4] = "ViewportResize", e[e.Input = 5] = "Input", e[e.TouchMove = 6] = "TouchMove", e[e.MediaInteraction = 7] = "MediaInteraction", e[e.StyleSheetRule = 8] = "StyleSheetRule", e[e.CanvasMutation = 9] = "CanvasMutation", e[e.Font = 10] = "Font", e[e.Log = 11] = "Log", e[e.Drag = 12] = "Drag", e[e.StyleDeclaration = 13] = "StyleDeclaration", e[e.Selection = 14] = "Selection", e[e.AdoptedStyleSheet = 15] = "AdoptedStyleSheet", e[e.CustomElement = 16] = "CustomElement", e))(O || {}),
|
5844
|
+
var M = /* @__PURE__ */ ((e) => (e[e.DomContentLoaded = 0] = "DomContentLoaded", e[e.Load = 1] = "Load", e[e.FullSnapshot = 2] = "FullSnapshot", e[e.IncrementalSnapshot = 3] = "IncrementalSnapshot", e[e.Meta = 4] = "Meta", e[e.Custom = 5] = "Custom", e[e.Plugin = 6] = "Plugin", e))(M || {}), O = /* @__PURE__ */ ((e) => (e[e.Mutation = 0] = "Mutation", e[e.MouseMove = 1] = "MouseMove", e[e.MouseInteraction = 2] = "MouseInteraction", e[e.Scroll = 3] = "Scroll", e[e.ViewportResize = 4] = "ViewportResize", e[e.Input = 5] = "Input", e[e.TouchMove = 6] = "TouchMove", e[e.MediaInteraction = 7] = "MediaInteraction", e[e.StyleSheetRule = 8] = "StyleSheetRule", e[e.CanvasMutation = 9] = "CanvasMutation", e[e.Font = 10] = "Font", e[e.Log = 11] = "Log", e[e.Drag = 12] = "Drag", e[e.StyleDeclaration = 13] = "StyleDeclaration", e[e.Selection = 14] = "Selection", e[e.AdoptedStyleSheet = 15] = "AdoptedStyleSheet", e[e.CustomElement = 16] = "CustomElement", e))(O || {}), de = /* @__PURE__ */ ((e) => (e[e.MouseUp = 0] = "MouseUp", e[e.MouseDown = 1] = "MouseDown", e[e.Click = 2] = "Click", e[e.ContextMenu = 3] = "ContextMenu", e[e.DblClick = 4] = "DblClick", e[e.Focus = 5] = "Focus", e[e.Blur = 6] = "Blur", e[e.TouchStart = 7] = "TouchStart", e[e.TouchMove_Departed = 8] = "TouchMove_Departed", e[e.TouchEnd = 9] = "TouchEnd", e[e.TouchCancel = 10] = "TouchCancel", e))(de || {}), Ue = /* @__PURE__ */ ((e) => (e[e.Mouse = 0] = "Mouse", e[e.Pen = 1] = "Pen", e[e.Touch = 2] = "Touch", e))(Ue || {}), yt = /* @__PURE__ */ ((e) => (e[e.Play = 0] = "Play", e[e.Pause = 1] = "Pause", e[e.Seeked = 2] = "Seeked", e[e.VolumeChange = 3] = "VolumeChange", e[e.RateChange = 4] = "RateChange", e))(yt || {});
|
5845
5845
|
function vs(e) {
|
5846
5846
|
try {
|
5847
5847
|
return e.contentDocument;
|
@@ -6378,37 +6378,37 @@ function dy({
|
|
6378
6378
|
p = Ue.Pen;
|
6379
6379
|
break;
|
6380
6380
|
}
|
6381
|
-
p === Ue.Touch ?
|
6381
|
+
p === Ue.Touch ? de[d] === de.MouseDown ? g = "TouchStart" : de[d] === de.MouseUp && (g = "TouchEnd") : Ue.Pen;
|
6382
6382
|
} else Mo(f) && (p = Ue.Touch);
|
6383
|
-
p !== null ? (u = p, (g.startsWith("Touch") && p === Ue.Touch || g.startsWith("Mouse") && p === Ue.Mouse) && (p = null)) :
|
6383
|
+
p !== null ? (u = p, (g.startsWith("Touch") && p === Ue.Touch || g.startsWith("Mouse") && p === Ue.Mouse) && (p = null)) : de[d] === de.Click && (p = u, u = null);
|
6384
6384
|
const y = Mo(f) ? f.changedTouches[0] : f;
|
6385
6385
|
if (!y)
|
6386
6386
|
return;
|
6387
6387
|
const b = n.getId(h), { clientX: v, clientY: x } = y;
|
6388
6388
|
B(e)({
|
6389
|
-
type:
|
6389
|
+
type: de[g],
|
6390
6390
|
id: b,
|
6391
6391
|
x: v,
|
6392
6392
|
y: x,
|
6393
6393
|
...p !== null && { pointerType: p }
|
6394
6394
|
});
|
6395
6395
|
};
|
6396
|
-
return Object.keys(
|
6396
|
+
return Object.keys(de).filter(
|
6397
6397
|
(d) => Number.isNaN(Number(d)) && !d.endsWith("_Departed") && c[d] !== !1
|
6398
6398
|
).forEach((d) => {
|
6399
6399
|
let f = At(d);
|
6400
6400
|
const h = l(d);
|
6401
6401
|
if (window.PointerEvent)
|
6402
|
-
switch (
|
6403
|
-
case
|
6404
|
-
case
|
6402
|
+
switch (de[d]) {
|
6403
|
+
case de.MouseDown:
|
6404
|
+
case de.MouseUp:
|
6405
6405
|
f = f.replace(
|
6406
6406
|
"mouse",
|
6407
6407
|
"pointer"
|
6408
6408
|
);
|
6409
6409
|
break;
|
6410
|
-
case
|
6411
|
-
case
|
6410
|
+
case de.TouchStart:
|
6411
|
+
case de.TouchEnd:
|
6412
6412
|
return;
|
6413
6413
|
}
|
6414
6414
|
a.push(pe(f, h, t));
|
@@ -6508,7 +6508,7 @@ function py({
|
|
6508
6508
|
return;
|
6509
6509
|
const V = ys(C);
|
6510
6510
|
let L = lr(j, T, V), Z = !1;
|
6511
|
-
const
|
6511
|
+
const ie = Nr({
|
6512
6512
|
maskInputOptions: a,
|
6513
6513
|
tagName: T,
|
6514
6514
|
type: V
|
@@ -6518,7 +6518,7 @@ function py({
|
|
6518
6518
|
p,
|
6519
6519
|
h,
|
6520
6520
|
g,
|
6521
|
-
|
6521
|
+
ie
|
6522
6522
|
);
|
6523
6523
|
(V === "radio" || V === "checkbox") && (Z = C.checked), L = sn({
|
6524
6524
|
isMasked: P,
|
@@ -6529,8 +6529,8 @@ function py({
|
|
6529
6529
|
C,
|
6530
6530
|
d ? { text: L, isChecked: Z, userTriggered: S } : { text: L, isChecked: Z }
|
6531
6531
|
);
|
6532
|
-
const
|
6533
|
-
V === "radio" &&
|
6532
|
+
const ue = C.name;
|
6533
|
+
V === "radio" && ue && Z && t.querySelectorAll(`input[type="radio"][name="${ue}"]`).forEach((J) => {
|
6534
6534
|
if (J !== C) {
|
6535
6535
|
const ge = sn({
|
6536
6536
|
// share mask behavior of `target`
|
@@ -7462,9 +7462,9 @@ function ze(e = {}) {
|
|
7462
7462
|
recordCrossOriginIframes: V = !1,
|
7463
7463
|
recordAfter: L = e.recordAfter === "DOMContentLoaded" ? e.recordAfter : "load",
|
7464
7464
|
userTriggeredOnInput: Z = !1,
|
7465
|
-
collectFonts:
|
7465
|
+
collectFonts: ie = !1,
|
7466
7466
|
inlineImages: P = !1,
|
7467
|
-
plugins:
|
7467
|
+
plugins: ue,
|
7468
7468
|
keepIframeSrcFn: J = () => !1,
|
7469
7469
|
ignoreCSSAttributes: ge = /* @__PURE__ */ new Set([]),
|
7470
7470
|
errorHandler: Se,
|
@@ -7521,23 +7521,23 @@ function ze(e = {}) {
|
|
7521
7521
|
Qg();
|
7522
7522
|
let zt, pt = 0;
|
7523
7523
|
const jt = (W) => {
|
7524
|
-
for (const Ce of
|
7524
|
+
for (const Ce of ue || [])
|
7525
7525
|
Ce.eventProcessor && (W = Ce.eventProcessor(W));
|
7526
7526
|
return w && // Disable packing events which will be emitted to parent frames.
|
7527
7527
|
!G && (W = w(W)), W;
|
7528
7528
|
};
|
7529
7529
|
X = (W, Ce) => {
|
7530
7530
|
const F = W;
|
7531
|
-
if (F.timestamp = fr(), St[0]?.isFrozen() && F.type !== M.FullSnapshot && !(F.type === M.IncrementalSnapshot && F.data.source === O.Mutation) && St.forEach((
|
7531
|
+
if (F.timestamp = fr(), St[0]?.isFrozen() && F.type !== M.FullSnapshot && !(F.type === M.IncrementalSnapshot && F.data.source === O.Mutation) && St.forEach((le) => le.unfreeze()), ht)
|
7532
7532
|
t?.(jt(F), Ce);
|
7533
7533
|
else if (G) {
|
7534
|
-
const
|
7534
|
+
const le = {
|
7535
7535
|
type: "rrweb",
|
7536
7536
|
event: jt(F),
|
7537
7537
|
origin: window.location.origin,
|
7538
7538
|
isCheckout: Ce
|
7539
7539
|
};
|
7540
|
-
window.parent.postMessage(
|
7540
|
+
window.parent.postMessage(le, "*");
|
7541
7541
|
}
|
7542
7542
|
if (F.type === M.FullSnapshot)
|
7543
7543
|
zt = F, pt = 0;
|
@@ -7545,8 +7545,8 @@ function ze(e = {}) {
|
|
7545
7545
|
if (F.data.source === O.Mutation && F.data.isAttachIframe)
|
7546
7546
|
return;
|
7547
7547
|
pt++;
|
7548
|
-
const
|
7549
|
-
(
|
7548
|
+
const le = r && pt >= r, q = n && zt && F.timestamp - zt.timestamp > n;
|
7549
|
+
(le || q) && zr(!0);
|
7550
7550
|
}
|
7551
7551
|
};
|
7552
7552
|
const En = (W) => {
|
@@ -7585,7 +7585,7 @@ function ze(e = {}) {
|
|
7585
7585
|
recordCrossOriginIframes: V,
|
7586
7586
|
wrappedEmit: X
|
7587
7587
|
});
|
7588
|
-
for (const W of
|
7588
|
+
for (const W of ue || [])
|
7589
7589
|
W.getMirror && W.getMirror({
|
7590
7590
|
nodeMirror: Te,
|
7591
7591
|
crossOriginIframeMirror: tt.crossOriginIframeMirror,
|
@@ -7678,11 +7678,11 @@ function ze(e = {}) {
|
|
7678
7678
|
onSerialize: (F) => {
|
7679
7679
|
wu(F, Te) && tt.addIframe(F), vu(F, Te) && et.trackLinkElement(F), Do(F) && xn.addShadowRoot(F.shadowRoot, document);
|
7680
7680
|
},
|
7681
|
-
onIframeLoad: (F,
|
7682
|
-
tt.attachIframe(F,
|
7681
|
+
onIframeLoad: (F, le) => {
|
7682
|
+
tt.attachIframe(F, le), F.contentWindow && Wr.addWindow(F.contentWindow), xn.observeAttachShadow(F);
|
7683
7683
|
},
|
7684
|
-
onStylesheetLoad: (F,
|
7685
|
-
et.attachLinkElement(F,
|
7684
|
+
onStylesheetLoad: (F, le) => {
|
7685
|
+
et.attachLinkElement(F, le);
|
7686
7686
|
},
|
7687
7687
|
keepIframeSrcFn: J
|
7688
7688
|
});
|
@@ -7701,7 +7701,7 @@ function ze(e = {}) {
|
|
7701
7701
|
};
|
7702
7702
|
pr = zr;
|
7703
7703
|
try {
|
7704
|
-
const W = [], Ce = (
|
7704
|
+
const W = [], Ce = (le) => B(vy)(
|
7705
7705
|
{
|
7706
7706
|
onMutation: Ht,
|
7707
7707
|
mutationCb: En,
|
@@ -7796,8 +7796,8 @@ function ze(e = {}) {
|
|
7796
7796
|
recordCanvas: j,
|
7797
7797
|
inlineImages: P,
|
7798
7798
|
userTriggeredOnInput: Z,
|
7799
|
-
collectFonts:
|
7800
|
-
doc:
|
7799
|
+
collectFonts: ie,
|
7800
|
+
doc: le,
|
7801
7801
|
maskAttributeFn: v,
|
7802
7802
|
maskInputFn: x,
|
7803
7803
|
maskTextFn: E,
|
@@ -7813,7 +7813,7 @@ function ze(e = {}) {
|
|
7813
7813
|
processedNodeManager: Hr,
|
7814
7814
|
canvasManager: Wr,
|
7815
7815
|
ignoreCSSAttributes: ge,
|
7816
|
-
plugins:
|
7816
|
+
plugins: ue?.filter((q) => q.observer)?.map((q) => ({
|
7817
7817
|
observer: q.observer,
|
7818
7818
|
options: q.options,
|
7819
7819
|
callback: (jr) => X({
|
@@ -7827,9 +7827,9 @@ function ze(e = {}) {
|
|
7827
7827
|
},
|
7828
7828
|
{}
|
7829
7829
|
);
|
7830
|
-
tt.addLoadListener((
|
7830
|
+
tt.addLoadListener((le) => {
|
7831
7831
|
try {
|
7832
|
-
W.push(Ce(
|
7832
|
+
W.push(Ce(le.contentDocument));
|
7833
7833
|
} catch (q) {
|
7834
7834
|
console.warn(q);
|
7835
7835
|
}
|
@@ -7856,7 +7856,7 @@ function ze(e = {}) {
|
|
7856
7856
|
window
|
7857
7857
|
)
|
7858
7858
|
)), () => {
|
7859
|
-
W.forEach((
|
7859
|
+
W.forEach((le) => le()), Hr.destroy(), pr = void 0, uy();
|
7860
7860
|
};
|
7861
7861
|
} catch (W) {
|
7862
7862
|
console.warn(W);
|
@@ -8073,7 +8073,7 @@ function zy(e, t) {
|
|
8073
8073
|
const { source: n } = t.data;
|
8074
8074
|
if (Uy.has(n) && e.registerMutation(t.timestamp), n === O.Scroll && e.registerScroll(t.timestamp), qy(t)) {
|
8075
8075
|
const { type: r, id: o } = t.data, s = ze.mirror.getNode(o);
|
8076
|
-
s instanceof HTMLElement && r ===
|
8076
|
+
s instanceof HTMLElement && r === de.Click && e.registerClick(s);
|
8077
8077
|
}
|
8078
8078
|
} catch {
|
8079
8079
|
}
|
@@ -10428,7 +10428,7 @@ class F_ {
|
|
10428
10428
|
onError: Z
|
10429
10429
|
} = {}) {
|
10430
10430
|
this.name = "Replay";
|
10431
|
-
const
|
10431
|
+
const ie = D_({
|
10432
10432
|
mask: _,
|
10433
10433
|
unmask: I,
|
10434
10434
|
block: C,
|
@@ -10441,15 +10441,15 @@ class F_ {
|
|
10441
10441
|
maskInputOptions: { password: !0 },
|
10442
10442
|
maskTextFn: j,
|
10443
10443
|
maskInputFn: j,
|
10444
|
-
maskAttributeFn: (P,
|
10444
|
+
maskAttributeFn: (P, ue, J) => L_({
|
10445
10445
|
maskAttributes: w,
|
10446
10446
|
maskAllText: u,
|
10447
|
-
privacyOptions:
|
10447
|
+
privacyOptions: ie,
|
10448
10448
|
key: P,
|
10449
|
-
value:
|
10449
|
+
value: ue,
|
10450
10450
|
el: J
|
10451
10451
|
}),
|
10452
|
-
...
|
10452
|
+
...ie,
|
10453
10453
|
// Our defaults
|
10454
10454
|
slimDOMOptions: "all",
|
10455
10455
|
inlineStylesheet: !0,
|
@@ -10610,7 +10610,7 @@ function $_(e) {
|
|
10610
10610
|
}
|
10611
10611
|
{
|
10612
10612
|
let e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
|
10613
|
-
e.SENTRY_RELEASE = { id: "
|
10613
|
+
e.SENTRY_RELEASE = { id: "a9860e5b8b81cf1d8df0e83930ddcdaaad3be140" };
|
10614
10614
|
}
|
10615
10615
|
const H_ = "development";
|
10616
10616
|
$_({
|
@@ -10701,7 +10701,7 @@ function j_({
|
|
10701
10701
|
}
|
10702
10702
|
) });
|
10703
10703
|
}
|
10704
|
-
const Ns =
|
10704
|
+
const Ns = ce.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
10705
10705
|
"div",
|
10706
10706
|
{
|
10707
10707
|
ref: n,
|
@@ -10713,7 +10713,7 @@ const Ns = ue.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
|
10713
10713
|
}
|
10714
10714
|
));
|
10715
10715
|
Ns.displayName = "Card";
|
10716
|
-
const Os =
|
10716
|
+
const Os = ce.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
10717
10717
|
"div",
|
10718
10718
|
{
|
10719
10719
|
ref: n,
|
@@ -10722,7 +10722,7 @@ const Os = ue.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
|
10722
10722
|
}
|
10723
10723
|
));
|
10724
10724
|
Os.displayName = "CardHeader";
|
10725
|
-
const q_ =
|
10725
|
+
const q_ = ce.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
10726
10726
|
"div",
|
10727
10727
|
{
|
10728
10728
|
ref: n,
|
@@ -10734,7 +10734,7 @@ const q_ = ue.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
|
10734
10734
|
}
|
10735
10735
|
));
|
10736
10736
|
q_.displayName = "CardTitle";
|
10737
|
-
const G_ =
|
10737
|
+
const G_ = ce.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
10738
10738
|
"div",
|
10739
10739
|
{
|
10740
10740
|
ref: n,
|
@@ -10743,9 +10743,9 @@ const G_ = ue.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
|
10743
10743
|
}
|
10744
10744
|
));
|
10745
10745
|
G_.displayName = "CardDescription";
|
10746
|
-
const As =
|
10746
|
+
const As = ce.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m("div", { ref: n, className: A("p-6 pt-0", e), ...t }));
|
10747
10747
|
As.displayName = "CardContent";
|
10748
|
-
const Ms =
|
10748
|
+
const Ms = ce.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
10749
10749
|
"div",
|
10750
10750
|
{
|
10751
10751
|
ref: n,
|
@@ -10774,7 +10774,7 @@ const Yu = () => {
|
|
10774
10774
|
if (!e)
|
10775
10775
|
throw new Error("useTheme must be used within a ThemeProvider");
|
10776
10776
|
return e;
|
10777
|
-
}, Ju =
|
10777
|
+
}, Ju = ce.forwardRef(({ className: e, children: t, onViewportScroll: n, ...r }, o) => /* @__PURE__ */ D(
|
10778
10778
|
ot.Root,
|
10779
10779
|
{
|
10780
10780
|
ref: o,
|
@@ -10795,7 +10795,7 @@ const Yu = () => {
|
|
10795
10795
|
}
|
10796
10796
|
));
|
10797
10797
|
Ju.displayName = ot.Root.displayName;
|
10798
|
-
const Xu =
|
10798
|
+
const Xu = ce.forwardRef(({ className: e, orientation: t = "vertical", ...n }, r) => /* @__PURE__ */ m(
|
10799
10799
|
ot.ScrollAreaScrollbar,
|
10800
10800
|
{
|
10801
10801
|
ref: r,
|
@@ -10811,7 +10811,7 @@ const Xu = ue.forwardRef(({ className: e, orientation: t = "vertical", ...n }, r
|
|
10811
10811
|
}
|
10812
10812
|
));
|
10813
10813
|
Xu.displayName = ot.ScrollAreaScrollbar.displayName;
|
10814
|
-
const K_ = Ae.Root, Y_ = Ae.Portal, Qu =
|
10814
|
+
const K_ = Ae.Root, Y_ = Ae.Portal, Qu = ce.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
10815
10815
|
Ae.Overlay,
|
10816
10816
|
{
|
10817
10817
|
ref: n,
|
@@ -10823,7 +10823,7 @@ const K_ = Ae.Root, Y_ = Ae.Portal, Qu = ue.forwardRef(({ className: e, ...t },
|
|
10823
10823
|
}
|
10824
10824
|
));
|
10825
10825
|
Qu.displayName = Ae.Overlay.displayName;
|
10826
|
-
const Zu =
|
10826
|
+
const Zu = ce.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ D(Y_, { children: [
|
10827
10827
|
/* @__PURE__ */ m(Qu, {}),
|
10828
10828
|
/* @__PURE__ */ D(
|
10829
10829
|
Ae.Content,
|
@@ -10845,7 +10845,7 @@ const Zu = ue.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE_
|
|
10845
10845
|
)
|
10846
10846
|
] }));
|
10847
10847
|
Zu.displayName = Ae.Content.displayName;
|
10848
|
-
const el =
|
10848
|
+
const el = ce.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
10849
10849
|
Ae.Title,
|
10850
10850
|
{
|
10851
10851
|
ref: n,
|
@@ -10857,7 +10857,7 @@ const el = ue.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
|
10857
10857
|
}
|
10858
10858
|
));
|
10859
10859
|
el.displayName = Ae.Title.displayName;
|
10860
|
-
const tl =
|
10860
|
+
const tl = ce.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
10861
10861
|
Ae.Description,
|
10862
10862
|
{
|
10863
10863
|
ref: n,
|
@@ -10868,7 +10868,7 @@ const tl = ue.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
|
10868
10868
|
tl.displayName = Ae.Description.displayName;
|
10869
10869
|
function J_(e, t = 50, n = !0) {
|
10870
10870
|
const [r, o] = z("");
|
10871
|
-
return
|
10871
|
+
return ae(() => {
|
10872
10872
|
if (!n) return;
|
10873
10873
|
let s = 0;
|
10874
10874
|
const c = ((u, l) => {
|
@@ -10885,7 +10885,7 @@ function J_(e, t = 50, n = !0) {
|
|
10885
10885
|
const ua = ["Reviewing...", "Thinking...", "Validating..."];
|
10886
10886
|
function X_() {
|
10887
10887
|
const [e, t] = z(0);
|
10888
|
-
return
|
10888
|
+
return ae(() => {
|
10889
10889
|
const n = setInterval(() => {
|
10890
10890
|
t((r) => (r + 1) % ua.length);
|
10891
10891
|
}, 3e3);
|
@@ -10918,13 +10918,13 @@ function nl({ isWaiting: e = !1, ...t }) {
|
|
10918
10918
|
alignment: ad.TopCenter
|
10919
10919
|
})
|
10920
10920
|
}), c = ud(i, "State Machine 1", "waiting");
|
10921
|
-
return
|
10921
|
+
return ae(() => {
|
10922
10922
|
if (c)
|
10923
10923
|
try {
|
10924
10924
|
c.value = e;
|
10925
10925
|
} catch {
|
10926
10926
|
}
|
10927
|
-
}, [i, c, e]),
|
10927
|
+
}, [i, c, e]), ae(() => {
|
10928
10928
|
i && r?.();
|
10929
10929
|
}, [i]), /* @__PURE__ */ m(
|
10930
10930
|
"div",
|
@@ -11232,9 +11232,9 @@ function aw() {
|
|
11232
11232
|
});
|
11233
11233
|
}
|
11234
11234
|
};
|
11235
|
-
return
|
11235
|
+
return ae(() => {
|
11236
11236
|
n.current ? (u("instant"), n.current = !1) : s || u();
|
11237
|
-
}, [e.messages, s]),
|
11237
|
+
}, [e.messages, s]), ae(() => {
|
11238
11238
|
const l = t.current?.querySelector(
|
11239
11239
|
"div.chat-interface-body"
|
11240
11240
|
);
|
@@ -11292,7 +11292,7 @@ function aw() {
|
|
11292
11292
|
)
|
11293
11293
|
] });
|
11294
11294
|
}
|
11295
|
-
const ol =
|
11295
|
+
const ol = ce.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
11296
11296
|
"textarea",
|
11297
11297
|
{
|
11298
11298
|
className: A(
|
@@ -11496,7 +11496,7 @@ function fw() {
|
|
11496
11496
|
] })
|
11497
11497
|
] });
|
11498
11498
|
}
|
11499
|
-
const il =
|
11499
|
+
const il = ce.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
11500
11500
|
Ut.Root,
|
11501
11501
|
{
|
11502
11502
|
ref: n,
|
@@ -11508,7 +11508,7 @@ const il = ue.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
|
11508
11508
|
}
|
11509
11509
|
));
|
11510
11510
|
il.displayName = Ut.Root.displayName;
|
11511
|
-
const hw =
|
11511
|
+
const hw = ce.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
11512
11512
|
Ut.Image,
|
11513
11513
|
{
|
11514
11514
|
ref: n,
|
@@ -11517,7 +11517,7 @@ const hw = ue.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
|
11517
11517
|
}
|
11518
11518
|
));
|
11519
11519
|
hw.displayName = Ut.Image.displayName;
|
11520
|
-
const pw =
|
11520
|
+
const pw = ce.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(
|
11521
11521
|
Ut.Fallback,
|
11522
11522
|
{
|
11523
11523
|
ref: n,
|
@@ -12105,8 +12105,8 @@ const dl = (e) => {
|
|
12105
12105
|
region: b
|
12106
12106
|
}
|
12107
12107
|
});
|
12108
|
-
const { InAppMessaging: Z, Push:
|
12109
|
-
if (Z?.AWSPinpoint ||
|
12108
|
+
const { InAppMessaging: Z, Push: ie } = j ?? {};
|
12109
|
+
if (Z?.AWSPinpoint || ie?.AWSPinpoint) {
|
12110
12110
|
if (Z?.AWSPinpoint) {
|
12111
12111
|
const { appId: G, region: ke } = Z.AWSPinpoint;
|
12112
12112
|
L.Notifications = {
|
@@ -12118,8 +12118,8 @@ const dl = (e) => {
|
|
12118
12118
|
}
|
12119
12119
|
};
|
12120
12120
|
}
|
12121
|
-
if (
|
12122
|
-
const { appId: G, region: ke } =
|
12121
|
+
if (ie?.AWSPinpoint) {
|
12122
|
+
const { appId: G, region: ke } = ie.AWSPinpoint;
|
12123
12123
|
L.Notifications = {
|
12124
12124
|
...L.Notifications,
|
12125
12125
|
PushNotification: {
|
@@ -12148,7 +12148,7 @@ const dl = (e) => {
|
|
12148
12148
|
status: a && a.toLowerCase(),
|
12149
12149
|
totpEnabled: u?.includes("TOTP") ?? !1,
|
12150
12150
|
smsEnabled: u?.includes("SMS") ?? !1
|
12151
|
-
} : void 0,
|
12151
|
+
} : void 0, ue = l ? {
|
12152
12152
|
minLength: l.passwordPolicyMinLength,
|
12153
12153
|
requireLowercase: l.passwordPolicyCharacters?.includes("REQUIRES_LOWERCASE") ?? !1,
|
12154
12154
|
requireUppercase: l.passwordPolicyCharacters?.includes("REQUIRES_UPPERCASE") ?? !1,
|
@@ -12171,7 +12171,7 @@ const dl = (e) => {
|
|
12171
12171
|
userPoolClientId: w,
|
12172
12172
|
userPoolId: _,
|
12173
12173
|
mfa: P,
|
12174
|
-
passwordFormat:
|
12174
|
+
passwordFormat: ue,
|
12175
12175
|
loginWith: {
|
12176
12176
|
username: !(Se || Ht),
|
12177
12177
|
email: Se,
|
@@ -12986,7 +12986,7 @@ const Mv = {}, Dv = (e, t) => Mv[e]?.[t]?.additionalDetails, Lv = "aws-amplify",
|
|
12986
12986
|
}
|
12987
12987
|
return n;
|
12988
12988
|
}, Fv = (e) => Uv(e).map(([r, o]) => r && o ? `${r}/${o}` : r).join(" ");
|
12989
|
-
function
|
12989
|
+
function se(e) {
|
12990
12990
|
return typeof e == "function";
|
12991
12991
|
}
|
12992
12992
|
function Bv(e) {
|
@@ -13038,7 +13038,7 @@ var $s = function() {
|
|
13038
13038
|
else
|
13039
13039
|
i.remove(this);
|
13040
13040
|
var l = this.initialTeardown;
|
13041
|
-
if (
|
13041
|
+
if (se(l))
|
13042
13042
|
try {
|
13043
13043
|
l();
|
13044
13044
|
} catch (g) {
|
@@ -13101,10 +13101,10 @@ var $s = function() {
|
|
13101
13101
|
}();
|
13102
13102
|
$s.EMPTY;
|
13103
13103
|
function bl(e) {
|
13104
|
-
return e instanceof $s || e && "closed" in e &&
|
13104
|
+
return e instanceof $s || e && "closed" in e && se(e.remove) && se(e.add) && se(e.unsubscribe);
|
13105
13105
|
}
|
13106
13106
|
function Ma(e) {
|
13107
|
-
|
13107
|
+
se(e) ? e() : e.unsubscribe();
|
13108
13108
|
}
|
13109
13109
|
var $v = {
|
13110
13110
|
Promise: void 0
|
@@ -13195,7 +13195,7 @@ var Hs = function(e) {
|
|
13195
13195
|
Us(t, e);
|
13196
13196
|
function t(n, r, o) {
|
13197
13197
|
var s = e.call(this) || this, i;
|
13198
|
-
return
|
13198
|
+
return se(n) || !n ? i = {
|
13199
13199
|
next: n ?? void 0,
|
13200
13200
|
error: r ?? void 0,
|
13201
13201
|
complete: o ?? void 0
|
@@ -13292,13 +13292,13 @@ function La(e) {
|
|
13292
13292
|
return (t = e ?? $v.Promise) !== null && t !== void 0 ? t : Promise;
|
13293
13293
|
}
|
13294
13294
|
function Kv(e) {
|
13295
|
-
return e &&
|
13295
|
+
return e && se(e.next) && se(e.error) && se(e.complete);
|
13296
13296
|
}
|
13297
13297
|
function Yv(e) {
|
13298
13298
|
return e && e instanceof Hs || Kv(e) && bl(e);
|
13299
13299
|
}
|
13300
13300
|
function Jv(e) {
|
13301
|
-
return
|
13301
|
+
return se(e?.lift);
|
13302
13302
|
}
|
13303
13303
|
function Br(e) {
|
13304
13304
|
return function(t) {
|
@@ -13355,13 +13355,13 @@ var Xv = function(e) {
|
|
13355
13355
|
return e && typeof e.length == "number" && typeof e != "function";
|
13356
13356
|
};
|
13357
13357
|
function vl(e) {
|
13358
|
-
return
|
13358
|
+
return se(e?.then);
|
13359
13359
|
}
|
13360
13360
|
function Sl(e) {
|
13361
|
-
return
|
13361
|
+
return se(e[Ws]);
|
13362
13362
|
}
|
13363
13363
|
function El(e) {
|
13364
|
-
return Symbol.asyncIterator &&
|
13364
|
+
return Symbol.asyncIterator && se(e?.[Symbol.asyncIterator]);
|
13365
13365
|
}
|
13366
13366
|
function xl(e) {
|
13367
13367
|
return new TypeError("You provided " + (e !== null && typeof e == "object" ? "an invalid object" : "'" + e + "'") + " where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.");
|
@@ -13371,7 +13371,7 @@ function Qv() {
|
|
13371
13371
|
}
|
13372
13372
|
var Il = Qv();
|
13373
13373
|
function kl(e) {
|
13374
|
-
return
|
13374
|
+
return se(e?.[Il]);
|
13375
13375
|
}
|
13376
13376
|
function Cl(e) {
|
13377
13377
|
return Zw(this, arguments, function() {
|
@@ -13405,7 +13405,7 @@ function Cl(e) {
|
|
13405
13405
|
});
|
13406
13406
|
}
|
13407
13407
|
function Tl(e) {
|
13408
|
-
return
|
13408
|
+
return se(e?.getReader);
|
13409
13409
|
}
|
13410
13410
|
function js(e) {
|
13411
13411
|
if (e instanceof ve)
|
@@ -13429,7 +13429,7 @@ function js(e) {
|
|
13429
13429
|
function Zv(e) {
|
13430
13430
|
return new ve(function(t) {
|
13431
13431
|
var n = e[Ws]();
|
13432
|
-
if (
|
13432
|
+
if (se(n.subscribe))
|
13433
13433
|
return n.subscribe(t);
|
13434
13434
|
throw new TypeError("Provided object does not correctly implement Symbol.observable");
|
13435
13435
|
});
|
@@ -13580,7 +13580,7 @@ function cS(e, t) {
|
|
13580
13580
|
i ? n.complete() : n.next(s);
|
13581
13581
|
}, 0, !0);
|
13582
13582
|
}), function() {
|
13583
|
-
return
|
13583
|
+
return se(r?.return) && r.return();
|
13584
13584
|
};
|
13585
13585
|
});
|
13586
13586
|
}
|
@@ -14124,10 +14124,10 @@ var Be;
|
|
14124
14124
|
(function(e) {
|
14125
14125
|
e[e.PENDING = 0] = "PENDING", e[e.CONNECTED = 1] = "CONNECTED", e[e.FAILED = 2] = "FAILED";
|
14126
14126
|
})(Be || (Be = {}));
|
14127
|
-
var
|
14127
|
+
var fe;
|
14128
14128
|
(function(e) {
|
14129
14129
|
e[e.CLOSED = 0] = "CLOSED", e[e.READY = 1] = "READY", e[e.CONNECTING = 2] = "CONNECTING";
|
14130
|
-
})(
|
14130
|
+
})(fe || (fe = {}));
|
14131
14131
|
const l0 = {
|
14132
14132
|
accept: "application/json, text/javascript",
|
14133
14133
|
"content-encoding": "amz-1.0",
|
@@ -14354,7 +14354,7 @@ const ja = "wss://", _0 = /^https:\/\/\w{26}\.appsync-api\.\w{2}(?:(?:-\w{2,})+)
|
|
14354
14354
|
};
|
14355
14355
|
class R0 {
|
14356
14356
|
constructor(t) {
|
14357
|
-
this.subscriptionObserverMap = /* @__PURE__ */ new Map(), this.allowNoSubscriptions = !1, this.socketStatus =
|
14357
|
+
this.subscriptionObserverMap = /* @__PURE__ */ new Map(), this.allowNoSubscriptions = !1, this.socketStatus = fe.CLOSED, this.keepAliveTimestamp = Date.now(), this.promiseArray = [], this.connectionStateMonitor = new y0(), this.reconnectionMonitor = new b0(), this._establishConnection = async (n, r) => {
|
14358
14358
|
this.logger.debug(`Establishing WebSocket connection to ${n}`);
|
14359
14359
|
try {
|
14360
14360
|
await this._openConnection(n, r), await this._initiateHandshake();
|
@@ -14370,7 +14370,7 @@ class R0 {
|
|
14370
14370
|
* Mark the socket closed and release all active listeners
|
14371
14371
|
*/
|
14372
14372
|
close() {
|
14373
|
-
return this.socketStatus =
|
14373
|
+
return this.socketStatus = fe.CLOSED, this.connectionStateMonitor.record(xe.CONNECTION_FAILED), this.connectionStateMonitorSubscription.unsubscribe(), this.reconnectionMonitor.close(), new Promise((t, n) => {
|
14374
14374
|
this.awsRealTimeSocket ? (this.awsRealTimeSocket.onclose = (r) => {
|
14375
14375
|
this._closeSocket(), this.subscriptionObserverMap = /* @__PURE__ */ new Map(), this.awsRealTimeSocket = void 0, t();
|
14376
14376
|
}, this.awsRealTimeSocket.onerror = (r) => {
|
@@ -14413,10 +14413,10 @@ class R0 {
|
|
14413
14413
|
});
|
14414
14414
|
}
|
14415
14415
|
async connect(t) {
|
14416
|
-
this.socketStatus !==
|
14416
|
+
this.socketStatus !== fe.READY && await this._connectWebSocket(t);
|
14417
14417
|
}
|
14418
14418
|
async publish(t, n) {
|
14419
|
-
if (this.socketStatus !==
|
14419
|
+
if (this.socketStatus !== fe.READY)
|
14420
14420
|
throw new Error("Subscription has not been initialized");
|
14421
14421
|
return this._publishMessage(t, n);
|
14422
14422
|
}
|
@@ -14568,7 +14568,7 @@ class R0 {
|
|
14568
14568
|
}
|
14569
14569
|
_sendUnsubscriptionMessage(t) {
|
14570
14570
|
try {
|
14571
|
-
if (this.awsRealTimeSocket && this.awsRealTimeSocket.readyState === WebSocket.OPEN && this.socketStatus ===
|
14571
|
+
if (this.awsRealTimeSocket && this.awsRealTimeSocket.readyState === WebSocket.OPEN && this.socketStatus === fe.READY) {
|
14572
14572
|
const n = this._unsubscribeMessage(t), r = JSON.stringify(n);
|
14573
14573
|
this.awsRealTimeSocket.send(r);
|
14574
14574
|
}
|
@@ -14582,7 +14582,7 @@ class R0 {
|
|
14582
14582
|
_closeSocketIfRequired() {
|
14583
14583
|
if (!(this.subscriptionObserverMap.size > 0)) {
|
14584
14584
|
if (!this.awsRealTimeSocket) {
|
14585
|
-
this.socketStatus =
|
14585
|
+
this.socketStatus = fe.CLOSED;
|
14586
14586
|
return;
|
14587
14587
|
}
|
14588
14588
|
if (this.connectionStateMonitor.record(xe.CLOSING_CONNECTION), this.awsRealTimeSocket.bufferedAmount > 0)
|
@@ -14590,7 +14590,7 @@ class R0 {
|
|
14590
14590
|
else {
|
14591
14591
|
this.logger.debug("closing WebSocket...");
|
14592
14592
|
const t = this.awsRealTimeSocket;
|
14593
|
-
t.onclose = null, t.onerror = null, t.close(1e3), this.awsRealTimeSocket = void 0, this.socketStatus =
|
14593
|
+
t.onclose = null, t.onerror = null, t.close(1e3), this.awsRealTimeSocket = void 0, this.socketStatus = fe.CLOSED, this._closeSocket();
|
14594
14594
|
}
|
14595
14595
|
}
|
14596
14596
|
}
|
@@ -14652,7 +14652,7 @@ class R0 {
|
|
14652
14652
|
}
|
14653
14653
|
}
|
14654
14654
|
_errorDisconnect(t) {
|
14655
|
-
this.logger.debug(`Disconnect error: ${t}`), this.awsRealTimeSocket && (this._closeSocket(), this.awsRealTimeSocket.close()), this.socketStatus =
|
14655
|
+
this.logger.debug(`Disconnect error: ${t}`), this.awsRealTimeSocket && (this._closeSocket(), this.awsRealTimeSocket.close()), this.socketStatus = fe.CLOSED;
|
14656
14656
|
}
|
14657
14657
|
_closeSocket() {
|
14658
14658
|
this.keepAliveHeartbeatIntervalId && (clearInterval(this.keepAliveHeartbeatIntervalId), this.keepAliveHeartbeatIntervalId = void 0), this.connectionStateMonitor.record(xe.CLOSED);
|
@@ -14672,11 +14672,11 @@ class R0 {
|
|
14672
14672
|
}
|
14673
14673
|
}
|
14674
14674
|
_initializeWebSocketConnection({ appSyncGraphqlEndpoint: t, authenticationType: n, apiKey: r, region: o, additionalCustomHeaders: s }) {
|
14675
|
-
if (this.socketStatus !==
|
14675
|
+
if (this.socketStatus !== fe.READY)
|
14676
14676
|
return new Promise(async (i, c) => {
|
14677
|
-
if (this.promiseArray.push({ res: i, rej: c }), this.socketStatus ===
|
14677
|
+
if (this.promiseArray.push({ res: i, rej: c }), this.socketStatus === fe.CLOSED)
|
14678
14678
|
try {
|
14679
|
-
this.socketStatus =
|
14679
|
+
this.socketStatus = fe.CONNECTING;
|
14680
14680
|
const u = await Wl({
|
14681
14681
|
authenticationType: n,
|
14682
14682
|
payload: "{}",
|
@@ -14691,11 +14691,11 @@ class R0 {
|
|
14691
14691
|
})}`, h = I0(s), p = k0(t, h);
|
14692
14692
|
await this._establishRetryableConnection(p, f), this.promiseArray.forEach(({ res: g }) => {
|
14693
14693
|
this.logger.debug("Notifying connection successful"), g();
|
14694
|
-
}), this.socketStatus =
|
14694
|
+
}), this.socketStatus = fe.READY, this.promiseArray = [];
|
14695
14695
|
} catch (a) {
|
14696
14696
|
this.logger.debug("Connection exited with", a), this.promiseArray.forEach(({ rej: u }) => {
|
14697
14697
|
u(a);
|
14698
|
-
}), this.promiseArray = [], this.awsRealTimeSocket && this.awsRealTimeSocket.readyState === WebSocket.OPEN && this.awsRealTimeSocket.close(3001), this.awsRealTimeSocket = void 0, this.socketStatus =
|
14698
|
+
}), this.promiseArray = [], this.awsRealTimeSocket && this.awsRealTimeSocket.readyState === WebSocket.OPEN && this.awsRealTimeSocket.close(3001), this.awsRealTimeSocket = void 0, this.socketStatus = fe.CLOSED;
|
14699
14699
|
}
|
14700
14700
|
});
|
14701
14701
|
}
|
@@ -14906,28 +14906,25 @@ async function D0(e, t) {
|
|
14906
14906
|
}
|
14907
14907
|
};
|
14908
14908
|
}
|
14909
|
-
const L0 =
|
14910
|
-
message_id:
|
14911
|
-
|
14912
|
-
|
14913
|
-
|
14914
|
-
|
14915
|
-
|
14916
|
-
|
14917
|
-
|
14918
|
-
content: se.string()
|
14909
|
+
const L0 = he.object({
|
14910
|
+
message_id: he.string(),
|
14911
|
+
agent_id: he.string(),
|
14912
|
+
user_id: he.string(),
|
14913
|
+
chat_id: he.string(),
|
14914
|
+
created_at: he.string(),
|
14915
|
+
data: he.object({
|
14916
|
+
type: he.string(),
|
14917
|
+
content: he.string()
|
14919
14918
|
})
|
14920
14919
|
});
|
14921
|
-
|
14922
|
-
message_id:
|
14920
|
+
he.object({
|
14921
|
+
message_id: he.string(),
|
14923
14922
|
// message_id from api schema
|
14924
|
-
|
14925
|
-
|
14926
|
-
response: se.object({
|
14927
|
-
id: se.string(),
|
14923
|
+
response: he.object({
|
14924
|
+
id: he.string(),
|
14928
14925
|
// message_id from api schema
|
14929
|
-
type:
|
14930
|
-
content:
|
14926
|
+
type: he.string(),
|
14927
|
+
content: he.string()
|
14931
14928
|
})
|
14932
14929
|
});
|
14933
14930
|
function P0({
|
@@ -14936,11 +14933,11 @@ function P0({
|
|
14936
14933
|
chatSettings: n
|
14937
14934
|
}) {
|
14938
14935
|
const r = `/default/chat/${e}`, [o, s] = z(!1), i = n?.app_sync_url, c = n?.app_sync_region, a = n?.app_sync_api_key;
|
14939
|
-
|
14936
|
+
ae(() => {
|
14940
14937
|
(i || c || a) && (qs.configure(
|
14941
14938
|
rw(i, a, c)
|
14942
14939
|
), s(!0));
|
14943
|
-
}, [i, a, c]),
|
14940
|
+
}, [i, a, c]), ae(() => {
|
14944
14941
|
if (!o || !e) return;
|
14945
14942
|
let u = null;
|
14946
14943
|
return (async () => {
|
@@ -14958,7 +14955,6 @@ function P0({
|
|
14958
14955
|
console.log("Received response:", h);
|
14959
14956
|
const p = typeof h.data == "string" ? JSON.parse(h.data) : h.data, g = {
|
14960
14957
|
message_id: h.message_id,
|
14961
|
-
message_number: h.message_number,
|
14962
14958
|
response: {
|
14963
14959
|
id: h.message_id,
|
14964
14960
|
type: p.type,
|
@@ -15160,7 +15156,7 @@ function B0(e, t, n) {
|
|
15160
15156
|
}
|
15161
15157
|
function $0(e) {
|
15162
15158
|
const { appId: t, initialUserId: n } = e, { getSavedConversationData: r } = Ls({ appId: t }), [o, s] = z(!1), [i, c] = z(""), [a, u] = z(""), [l, d] = z(null);
|
15163
|
-
return
|
15159
|
+
return ae(() => {
|
15164
15160
|
const f = r();
|
15165
15161
|
f?.userId ? f?.externalId !== n ? (c(f.userId), d(n)) : (c(f?.userId), d(f.externalId)) : n ? (c(n), d(n)) : c(crypto.randomUUID()), u(f?.deviceId || crypto.randomUUID()), s(!0);
|
15166
15162
|
}, [r, n]), {
|
@@ -15189,7 +15185,7 @@ function H0({
|
|
15189
15185
|
appId: e
|
15190
15186
|
})
|
15191
15187
|
), [d, f] = z(null), [h, p] = z(null), [g, y] = z([]), [b, v] = z(!1), E = B0(`sdk-boot-${e}`, () => l.boot()).fetch;
|
15192
|
-
return
|
15188
|
+
return ae(() => {
|
15193
15189
|
if (i())
|
15194
15190
|
c();
|
15195
15191
|
else {
|
@@ -15202,7 +15198,7 @@ function H0({
|
|
15202
15198
|
id: _
|
15203
15199
|
}), I && I.length > 0 && y(I));
|
15204
15200
|
}
|
15205
|
-
}, [a, i, c]),
|
15201
|
+
}, [a, i, c]), ae(() => {
|
15206
15202
|
if (!s) return;
|
15207
15203
|
(async () => {
|
15208
15204
|
const [w, I] = await z_(E());
|
@@ -15236,12 +15232,12 @@ function W0(e) {
|
|
15236
15232
|
const [t, n] = z(!1), [r, o] = z(
|
15237
15233
|
null
|
15238
15234
|
), s = e ?? t;
|
15239
|
-
return
|
15235
|
+
return ae(() => {
|
15240
15236
|
const i = () => {
|
15241
15237
|
n(window.innerWidth <= 640);
|
15242
15238
|
};
|
15243
15239
|
return i(), window.addEventListener("resize", i), () => window.removeEventListener("resize", i);
|
15244
|
-
}, []),
|
15240
|
+
}, []), ae(() => {
|
15245
15241
|
const i = document.createElement("div");
|
15246
15242
|
return i.className = "eloquent-ai-chat-portal", i.style.position = "relative", i.style.zIndex = "30", document.body.appendChild(i), o(i), () => {
|
15247
15243
|
i.parentElement && i.parentElement.removeChild(i);
|
@@ -15283,11 +15279,11 @@ function z0({
|
|
15283
15279
|
setCurrentConversation: I,
|
15284
15280
|
setChatOpen: v
|
15285
15281
|
});
|
15286
|
-
return
|
15282
|
+
return ae(() => {
|
15287
15283
|
p.length > 0 && _(p);
|
15288
|
-
}, [p]),
|
15284
|
+
}, [p]), ae(() => {
|
15289
15285
|
h && I(h);
|
15290
|
-
}, [h]),
|
15286
|
+
}, [h]), ae(() => {
|
15291
15287
|
w && u && d?.identifyUser({
|
15292
15288
|
userId: a,
|
15293
15289
|
externalId: u,
|