bstp-agent-widget 0.2.46 → 0.2.48

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.
@@ -15691,12 +15691,15 @@ var ub = ({ ...e }) => {
15691
15691
  };
15692
15692
  ub.Body = cb, ub.Footer = lb;
15693
15693
  var db = {
15694
- root: "_root_n2lga_1",
15695
- inner: "_inner_n2lga_6",
15696
- content: "_content_n2lga_12",
15697
- header: "_header_n2lga_22",
15698
- body: "_body_n2lga_32",
15699
- title: "_title_n2lga_37"
15694
+ root: "_root_1i7u8_1",
15695
+ inner: "_inner_1i7u8_6",
15696
+ content: "_content_1i7u8_12",
15697
+ header: "_header_1i7u8_20",
15698
+ headerMeta: "_headerMeta_1i7u8_32",
15699
+ statusDot: "_statusDot_1i7u8_39",
15700
+ topSubHeader: "_topSubHeader_1i7u8_46",
15701
+ body: "_body_1i7u8_57",
15702
+ title: "_title_1i7u8_62"
15700
15703
  };
15701
15704
  //#endregion
15702
15705
  //#region node_modules/marked/lib/marked.esm.js
@@ -23747,8 +23750,8 @@ function YO({ ...e }) {
23747
23750
  }
23748
23751
  //#endregion
23749
23752
  //#region src/components/AgentChat/AgentChatDrawer.tsx
23750
- 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 }) {
23751
- let D = Math.max(280, S + b.offset);
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 A = Math.max(280, S + b.offset), j = _.hasCustomerToken && _.hasGenaiToken;
23752
23755
  return f(() => {
23753
23756
  if (typeof document > "u") return;
23754
23757
  let t = document.documentElement;
@@ -23756,13 +23759,13 @@ function XO({ opened: e, onClose: t, zIndex: n, withinPortal: r, withOverlay: i
23756
23759
  t.style.setProperty("--agent-widget-drawer-width", "0px");
23757
23760
  return;
23758
23761
  }
23759
- return t.style.setProperty("--agent-widget-drawer-width", `${D}px`), () => {
23762
+ return t.style.setProperty("--agent-widget-drawer-width", `${A}px`), () => {
23760
23763
  t.style.setProperty("--agent-widget-drawer-width", "0px");
23761
23764
  };
23762
- }, [e, D]), /* @__PURE__ */ T(w, { children: /* @__PURE__ */ E(ub, {
23765
+ }, [e, A]), /* @__PURE__ */ T(w, { children: /* @__PURE__ */ E(ub, {
23763
23766
  opened: e,
23764
23767
  onClose: t,
23765
- size: D,
23768
+ size: A,
23766
23769
  zIndex: n,
23767
23770
  withinPortal: r,
23768
23771
  overlayProps: i ? {
@@ -23784,32 +23787,47 @@ function XO({ opened: e, onClose: t, zIndex: n, withinPortal: r, withOverlay: i
23784
23787
  },
23785
23788
  styles: { content: {
23786
23789
  marginTop: C,
23787
- height: `calc(100vh - ${C}px)`
23790
+ marginRight: D,
23791
+ height: `calc(100dvh - ${C}px)`,
23792
+ borderRadius: O,
23793
+ boxShadow: k ? "0 16px 40px rgba(15, 23, 42, 0.24)" : "none"
23788
23794
  } },
23789
- title: /* @__PURE__ */ T(Y, { children: /* @__PURE__ */ E(kl, {
23790
- gap: "xs",
23791
- align: "center",
23792
- wrap: "nowrap",
23793
- children: [
23794
- g,
23795
- /* @__PURE__ */ T(Xd, {
23796
- size: "xs",
23797
- c: "dimmed",
23798
- children: _.customerId ? `#${_.customerId}` : "#-"
23799
- }),
23800
- /* @__PURE__ */ T(Xd, {
23801
- size: "xs",
23802
- c: _.hasCustomerToken ? "green" : "red",
23803
- children: _.hasCustomerToken ? "cust✓" : "cust✗"
23804
- }),
23805
- /* @__PURE__ */ T(Xd, {
23806
- size: "xs",
23807
- c: _.hasGenaiToken ? "green" : "red",
23808
- children: _.hasGenaiToken ? "genai✓" : "genai✗"
23809
- })
23810
- ]
23811
- }) }),
23795
+ title: /* @__PURE__ */ E(Y, { children: [/* @__PURE__ */ T(Xd, {
23796
+ className: db.title,
23797
+ children: g
23798
+ }), /* @__PURE__ */ E(Y, {
23799
+ className: db.headerMeta,
23800
+ children: [/* @__PURE__ */ T(Y, {
23801
+ className: db.statusDot,
23802
+ style: { background: j ? "#22c55e" : "#ef4444" }
23803
+ }), /* @__PURE__ */ E(Xd, {
23804
+ size: "10",
23805
+ c: "dimmed",
23806
+ children: [j ? "Online" : "Offline", " · Billing Intelligence"]
23807
+ })]
23808
+ })] }),
23812
23809
  children: [
23810
+ /* @__PURE__ */ E(Y, {
23811
+ className: db.topSubHeader,
23812
+ children: [/* @__PURE__ */ T(Xd, {
23813
+ size: "10",
23814
+ fw: 700,
23815
+ c: "white",
23816
+ children: "Exceeder SelfCare agent"
23817
+ }), /* @__PURE__ */ E(kl, {
23818
+ gap: 8,
23819
+ wrap: "nowrap",
23820
+ children: [/* @__PURE__ */ T(Xd, {
23821
+ size: "10",
23822
+ c: _.hasCustomerToken ? "white" : "rgba(255,255,255,0.65)",
23823
+ children: "Billing Dispute"
23824
+ }), /* @__PURE__ */ T(Xd, {
23825
+ size: "10",
23826
+ c: _.hasGenaiToken ? "white" : "rgba(255,255,255,0.65)",
23827
+ children: "Active"
23828
+ })]
23829
+ })]
23830
+ }),
23813
23831
  /* @__PURE__ */ E(ub.Body, { children: [l && /* @__PURE__ */ T(Xd, {
23814
23832
  size: "xs",
23815
23833
  c: "red",
@@ -29120,59 +29138,62 @@ var XF = 1e4, ZF = {
29120
29138
  };
29121
29139
  function QF({ ui: e }) {
29122
29140
  YF();
29123
- 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 = {
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 = {
29124
29142
  bottom: e?.fabBottomOffset ?? ZF.bottom,
29125
29143
  right: e?.fabRightOffset ?? ZF.right
29126
- }, { messages: u, composerText: d, setComposerText: f, isLoading: p, error: m, sendMessage: h, sendInitialMessage: g, canSend: v } = zF(), { runtimeInfo: y, refreshRuntimeInfo: b } = BF(), x = ek({ skipSelector: "button, input, textarea, [role=\"button\"]" }), S = VF({ axis: "y" }), C = VF({
29144
+ }, { messages: p, composerText: m, setComposerText: h, isLoading: g, error: v, sendMessage: y, sendInitialMessage: b, canSend: x } = zF(), { runtimeInfo: S, refreshRuntimeInfo: C } = BF(), D = ek({ skipSelector: "button, input, textarea, [role=\"button\"]" }), O = VF({ axis: "y" }), k = VF({
29127
29145
  axis: "x",
29128
29146
  direction: -1
29129
- }), D = UF([u.length, p]), { isListening: O, isSupported: k, startListening: A, stopListening: j, reset: M } = WF({
29147
+ }), A = UF([p.length, g]), { isListening: j, isSupported: M, startListening: N, stopListening: P, reset: F } = WF({
29130
29148
  lang: GF(),
29131
29149
  continuous: !0,
29132
29150
  pauseOnSubmit: !0,
29133
- onTextChange: f
29134
- }), N = _(() => /* @__PURE__ */ T(Xd, {
29151
+ onTextChange: h
29152
+ }), ee = _(() => /* @__PURE__ */ T(Xd, {
29135
29153
  fw: 800,
29136
- children: "Agent Chat"
29137
- }), []), P = async () => {
29138
- n(), await b(), await g();
29154
+ children: e?.drawerTitle ?? e?.fabButtonLabel ?? "Agent Chat"
29155
+ }), [e?.drawerTitle, e?.fabButtonLabel]), te = async () => {
29156
+ n(), await C(), await b();
29139
29157
  };
29140
29158
  return /* @__PURE__ */ E(w, { children: [!t && /* @__PURE__ */ T(nk, {
29141
- onClick: () => void P(),
29159
+ onClick: () => void te(),
29142
29160
  zIndex: i,
29143
- position: l,
29161
+ position: f,
29144
29162
  color: e?.accentColor,
29145
29163
  label: e?.fabButtonLabel
29146
29164
  }), /* @__PURE__ */ T(XO, {
29147
29165
  opened: t,
29148
29166
  onClose: () => {
29149
- O && j(), r();
29167
+ j && P(), r();
29150
29168
  },
29151
29169
  zIndex: i,
29152
29170
  withinPortal: a,
29153
29171
  withOverlay: o,
29154
29172
  topOffset: c,
29155
29173
  drawerBaseWidth: s,
29156
- messages: u,
29157
- composerText: d,
29158
- onComposerTextChange: f,
29159
- isLoading: p,
29160
- error: m,
29161
- canSend: v,
29174
+ drawerRightOffset: l,
29175
+ drawerBorderRadius: u,
29176
+ drawerShadow: d,
29177
+ messages: p,
29178
+ composerText: m,
29179
+ onComposerTextChange: h,
29180
+ isLoading: g,
29181
+ error: v,
29182
+ canSend: x,
29162
29183
  onSubmit: () => {
29163
- O && j(), M(), h(d);
29184
+ j && P(), F(), y(m);
29164
29185
  },
29165
- isListening: O,
29166
- isVoiceSupported: k,
29186
+ isListening: j,
29187
+ isVoiceSupported: M,
29167
29188
  onToggleVoice: () => {
29168
- O ? j() : (f(""), A());
29189
+ j ? P() : (h(""), N());
29169
29190
  },
29170
- drawerTitle: N,
29171
- runtimeInfo: y,
29172
- scrollViewportRef: D,
29173
- drawerDraggable: x,
29174
- drawerResizableWidth: C,
29175
- drawerResizableHeight: S
29191
+ drawerTitle: ee,
29192
+ runtimeInfo: S,
29193
+ scrollViewportRef: A,
29194
+ drawerDraggable: D,
29195
+ drawerResizableWidth: k,
29196
+ drawerResizableHeight: O
29176
29197
  })] });
29177
29198
  }
29178
29199
  //#endregion