bstp-agent-widget 0.2.48 → 0.2.50
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/agent-widget.js +48 -45
- package/dist/agent-widget.js.map +1 -1
- package/dist/bstp-agent-widget.css +1 -1
- package/package.json +1 -1
- package/src/lib/index.d.ts +1 -0
package/dist/agent-widget.js
CHANGED
|
@@ -15691,15 +15691,15 @@ var ub = ({ ...e }) => {
|
|
|
15691
15691
|
};
|
|
15692
15692
|
ub.Body = cb, ub.Footer = lb;
|
|
15693
15693
|
var db = {
|
|
15694
|
-
root: "
|
|
15695
|
-
inner: "
|
|
15696
|
-
content: "
|
|
15697
|
-
header: "
|
|
15698
|
-
headerMeta: "
|
|
15699
|
-
statusDot: "
|
|
15700
|
-
topSubHeader: "
|
|
15701
|
-
body: "
|
|
15702
|
-
title: "
|
|
15694
|
+
root: "_root_emg6a_1",
|
|
15695
|
+
inner: "_inner_emg6a_6",
|
|
15696
|
+
content: "_content_emg6a_12",
|
|
15697
|
+
header: "_header_emg6a_20",
|
|
15698
|
+
headerMeta: "_headerMeta_emg6a_32",
|
|
15699
|
+
statusDot: "_statusDot_emg6a_39",
|
|
15700
|
+
topSubHeader: "_topSubHeader_emg6a_46",
|
|
15701
|
+
body: "_body_emg6a_57",
|
|
15702
|
+
title: "_title_emg6a_62"
|
|
15703
15703
|
};
|
|
15704
15704
|
//#endregion
|
|
15705
15705
|
//#region node_modules/marked/lib/marked.esm.js
|
|
@@ -23750,8 +23750,8 @@ function YO({ ...e }) {
|
|
|
23750
23750
|
}
|
|
23751
23751
|
//#endregion
|
|
23752
23752
|
//#region src/components/AgentChat/AgentChatDrawer.tsx
|
|
23753
|
-
function XO({ opened: e, onClose: t, zIndex: n, withinPortal: r, withOverlay: i = !0, messages: a, composerText: o, onComposerTextChange: s, isLoading: c, error: l, canSend: u, onSubmit: d, isListening: p, isVoiceSupported: m, onToggleVoice: h, drawerTitle: g, runtimeInfo: _, scrollViewportRef: v, drawerDraggable: y, drawerResizableWidth: b, drawerResizableHeight: x, drawerBaseWidth: S = 420, topOffset: C = 0, drawerRightOffset: D = 0, drawerBorderRadius: O = 0, drawerShadow: k = !1 }) {
|
|
23754
|
-
let
|
|
23753
|
+
function XO({ opened: e, onClose: t, zIndex: n, withinPortal: r, withOverlay: i = !0, messages: a, composerText: o, onComposerTextChange: s, isLoading: c, error: l, canSend: u, onSubmit: d, isListening: p, isVoiceSupported: m, onToggleVoice: h, drawerTitle: g, runtimeInfo: _, scrollViewportRef: v, drawerDraggable: y, drawerResizableWidth: b, drawerResizableHeight: x, drawerBaseWidth: S = 420, topOffset: C = 0, drawerRightOffset: D = 0, drawerBorderRadius: O = 0, drawerShadow: k = !1, drawerHeaderHeight: A = 56 }) {
|
|
23754
|
+
let j = Math.max(280, S + b.offset), M = _.hasCustomerToken && _.hasGenaiToken;
|
|
23755
23755
|
return f(() => {
|
|
23756
23756
|
if (typeof document > "u") return;
|
|
23757
23757
|
let t = document.documentElement;
|
|
@@ -23759,13 +23759,13 @@ function XO({ opened: e, onClose: t, zIndex: n, withinPortal: r, withOverlay: i
|
|
|
23759
23759
|
t.style.setProperty("--agent-widget-drawer-width", "0px");
|
|
23760
23760
|
return;
|
|
23761
23761
|
}
|
|
23762
|
-
return t.style.setProperty("--agent-widget-drawer-width", `${
|
|
23762
|
+
return t.style.setProperty("--agent-widget-drawer-width", `${j}px`), () => {
|
|
23763
23763
|
t.style.setProperty("--agent-widget-drawer-width", "0px");
|
|
23764
23764
|
};
|
|
23765
|
-
}, [e,
|
|
23765
|
+
}, [e, j]), /* @__PURE__ */ T(w, { children: /* @__PURE__ */ E(ub, {
|
|
23766
23766
|
opened: e,
|
|
23767
23767
|
onClose: t,
|
|
23768
|
-
size:
|
|
23768
|
+
size: j,
|
|
23769
23769
|
zIndex: n,
|
|
23770
23770
|
withinPortal: r,
|
|
23771
23771
|
overlayProps: i ? {
|
|
@@ -23783,14 +23783,16 @@ function XO({ opened: e, onClose: t, zIndex: n, withinPortal: r, withOverlay: i
|
|
|
23783
23783
|
classNames: {
|
|
23784
23784
|
root: db.root,
|
|
23785
23785
|
inner: db.inner,
|
|
23786
|
-
content: db.content
|
|
23786
|
+
content: db.content,
|
|
23787
|
+
header: db.header
|
|
23787
23788
|
},
|
|
23788
23789
|
styles: { content: {
|
|
23789
23790
|
marginTop: C,
|
|
23790
23791
|
marginRight: D,
|
|
23791
23792
|
height: `calc(100dvh - ${C}px)`,
|
|
23792
23793
|
borderRadius: O,
|
|
23793
|
-
boxShadow: k ? "0 16px 40px rgba(15, 23, 42, 0.24)" : "none"
|
|
23794
|
+
boxShadow: k ? "0 16px 40px rgba(15, 23, 42, 0.24)" : "none",
|
|
23795
|
+
"--agent-widget-drawer-header-height": `${A}px`
|
|
23794
23796
|
} },
|
|
23795
23797
|
title: /* @__PURE__ */ E(Y, { children: [/* @__PURE__ */ T(Xd, {
|
|
23796
23798
|
className: db.title,
|
|
@@ -23799,11 +23801,11 @@ function XO({ opened: e, onClose: t, zIndex: n, withinPortal: r, withOverlay: i
|
|
|
23799
23801
|
className: db.headerMeta,
|
|
23800
23802
|
children: [/* @__PURE__ */ T(Y, {
|
|
23801
23803
|
className: db.statusDot,
|
|
23802
|
-
style: { background:
|
|
23804
|
+
style: { background: M ? "#22c55e" : "#ef4444" }
|
|
23803
23805
|
}), /* @__PURE__ */ E(Xd, {
|
|
23804
23806
|
size: "10",
|
|
23805
23807
|
c: "dimmed",
|
|
23806
|
-
children: [
|
|
23808
|
+
children: [M ? "Online" : "Offline", " · Billing Intelligence"]
|
|
23807
23809
|
})]
|
|
23808
23810
|
})] }),
|
|
23809
23811
|
children: [
|
|
@@ -23934,7 +23936,7 @@ function XO({ opened: e, onClose: t, zIndex: n, withinPortal: r, withOverlay: i
|
|
|
23934
23936
|
position: "absolute",
|
|
23935
23937
|
top: 0,
|
|
23936
23938
|
bottom: 0,
|
|
23937
|
-
left:
|
|
23939
|
+
left: -4,
|
|
23938
23940
|
width: "8px",
|
|
23939
23941
|
...b.style,
|
|
23940
23942
|
zIndex: 10
|
|
@@ -29138,33 +29140,33 @@ var XF = 1e4, ZF = {
|
|
|
29138
29140
|
};
|
|
29139
29141
|
function QF({ ui: e }) {
|
|
29140
29142
|
YF();
|
|
29141
|
-
let [t, { open: n, close: r }] = mt(!1), i = e?.zIndex ?? XF, a = e?.withinPortal ?? !0, o = e?.withOverlay ?? !0, s = e?.drawerWidth ?? 420, c = e?.topOffset ?? 0, l = e?.drawerRightOffset ?? 0, u = e?.drawerBorderRadius ?? 0, d = e?.drawerShadow ?? !1, f = {
|
|
29143
|
+
let [t, { open: n, close: r }] = mt(!1), i = e?.zIndex ?? XF, a = e?.withinPortal ?? !0, o = e?.withOverlay ?? !0, s = e?.drawerWidth ?? 420, c = e?.topOffset ?? 0, l = e?.drawerRightOffset ?? 0, u = e?.drawerBorderRadius ?? 0, d = e?.drawerShadow ?? !1, f = e?.drawerHeaderHeight ?? 56, p = {
|
|
29142
29144
|
bottom: e?.fabBottomOffset ?? ZF.bottom,
|
|
29143
29145
|
right: e?.fabRightOffset ?? ZF.right
|
|
29144
|
-
}, { messages:
|
|
29146
|
+
}, { messages: m, composerText: h, setComposerText: g, isLoading: v, error: y, sendMessage: b, sendInitialMessage: x, canSend: S } = zF(), { runtimeInfo: C, refreshRuntimeInfo: D } = BF(), O = ek({ skipSelector: "button, input, textarea, [role=\"button\"]" }), k = VF({ axis: "y" }), A = VF({
|
|
29145
29147
|
axis: "x",
|
|
29146
29148
|
direction: -1
|
|
29147
|
-
}),
|
|
29149
|
+
}), j = UF([m.length, v]), { isListening: M, isSupported: N, startListening: P, stopListening: F, reset: ee } = WF({
|
|
29148
29150
|
lang: GF(),
|
|
29149
29151
|
continuous: !0,
|
|
29150
29152
|
pauseOnSubmit: !0,
|
|
29151
|
-
onTextChange:
|
|
29152
|
-
}),
|
|
29153
|
+
onTextChange: g
|
|
29154
|
+
}), te = _(() => /* @__PURE__ */ T(Xd, {
|
|
29153
29155
|
fw: 800,
|
|
29154
29156
|
children: e?.drawerTitle ?? e?.fabButtonLabel ?? "Agent Chat"
|
|
29155
|
-
}), [e?.drawerTitle, e?.fabButtonLabel]),
|
|
29156
|
-
n(), await
|
|
29157
|
+
}), [e?.drawerTitle, e?.fabButtonLabel]), I = async () => {
|
|
29158
|
+
n(), await D(), await x();
|
|
29157
29159
|
};
|
|
29158
29160
|
return /* @__PURE__ */ E(w, { children: [!t && /* @__PURE__ */ T(nk, {
|
|
29159
|
-
onClick: () => void
|
|
29161
|
+
onClick: () => void I(),
|
|
29160
29162
|
zIndex: i,
|
|
29161
|
-
position:
|
|
29163
|
+
position: p,
|
|
29162
29164
|
color: e?.accentColor,
|
|
29163
29165
|
label: e?.fabButtonLabel
|
|
29164
29166
|
}), /* @__PURE__ */ T(XO, {
|
|
29165
29167
|
opened: t,
|
|
29166
29168
|
onClose: () => {
|
|
29167
|
-
|
|
29169
|
+
M && F(), r();
|
|
29168
29170
|
},
|
|
29169
29171
|
zIndex: i,
|
|
29170
29172
|
withinPortal: a,
|
|
@@ -29174,26 +29176,27 @@ function QF({ ui: e }) {
|
|
|
29174
29176
|
drawerRightOffset: l,
|
|
29175
29177
|
drawerBorderRadius: u,
|
|
29176
29178
|
drawerShadow: d,
|
|
29177
|
-
|
|
29178
|
-
|
|
29179
|
-
|
|
29180
|
-
|
|
29181
|
-
|
|
29182
|
-
|
|
29179
|
+
drawerHeaderHeight: f,
|
|
29180
|
+
messages: m,
|
|
29181
|
+
composerText: h,
|
|
29182
|
+
onComposerTextChange: g,
|
|
29183
|
+
isLoading: v,
|
|
29184
|
+
error: y,
|
|
29185
|
+
canSend: S,
|
|
29183
29186
|
onSubmit: () => {
|
|
29184
|
-
|
|
29187
|
+
M && F(), ee(), b(h);
|
|
29185
29188
|
},
|
|
29186
|
-
isListening:
|
|
29187
|
-
isVoiceSupported:
|
|
29189
|
+
isListening: M,
|
|
29190
|
+
isVoiceSupported: N,
|
|
29188
29191
|
onToggleVoice: () => {
|
|
29189
|
-
|
|
29192
|
+
M ? F() : (g(""), P());
|
|
29190
29193
|
},
|
|
29191
|
-
drawerTitle:
|
|
29192
|
-
runtimeInfo:
|
|
29193
|
-
scrollViewportRef:
|
|
29194
|
-
drawerDraggable:
|
|
29195
|
-
drawerResizableWidth:
|
|
29196
|
-
drawerResizableHeight:
|
|
29194
|
+
drawerTitle: te,
|
|
29195
|
+
runtimeInfo: C,
|
|
29196
|
+
scrollViewportRef: j,
|
|
29197
|
+
drawerDraggable: O,
|
|
29198
|
+
drawerResizableWidth: A,
|
|
29199
|
+
drawerResizableHeight: k
|
|
29197
29200
|
})] });
|
|
29198
29201
|
}
|
|
29199
29202
|
//#endregion
|