bstp-agent-widget 0.2.47 → 0.2.49

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_nppjj_1",
15695
- inner: "_inner_nppjj_6",
15696
- content: "_content_nppjj_12",
15697
- header: "_header_nppjj_19",
15698
- body: "_body_nppjj_29",
15699
- title: "_title_nppjj_34"
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"
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, drawerRightOffset: D = 0, drawerBorderRadius: O = 0, drawerShadow: k = !1 }) {
23751
- let A = 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, drawerHeaderHeight: A = 56 }) {
23754
+ let j = Math.max(280, S + b.offset), M = _.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", `${A}px`), () => {
23762
+ return t.style.setProperty("--agent-widget-drawer-width", `${j}px`), () => {
23760
23763
  t.style.setProperty("--agent-widget-drawer-width", "0px");
23761
23764
  };
23762
- }, [e, A]), /* @__PURE__ */ T(w, { children: /* @__PURE__ */ E(ub, {
23765
+ }, [e, j]), /* @__PURE__ */ T(w, { children: /* @__PURE__ */ E(ub, {
23763
23766
  opened: e,
23764
23767
  onClose: t,
23765
- size: A,
23768
+ size: j,
23766
23769
  zIndex: n,
23767
23770
  withinPortal: r,
23768
23771
  overlayProps: i ? {
@@ -23787,32 +23790,45 @@ function XO({ opened: e, onClose: t, zIndex: n, withinPortal: r, withOverlay: i
23787
23790
  marginRight: D,
23788
23791
  height: `calc(100dvh - ${C}px)`,
23789
23792
  borderRadius: O,
23790
- boxShadow: k ? "0 16px 40px rgba(15, 23, 42, 0.24)" : "none"
23793
+ boxShadow: k ? "0 16px 40px rgba(15, 23, 42, 0.24)" : "none",
23794
+ "--agent-widget-drawer-header-height": `${A}px`
23791
23795
  } },
23792
- title: /* @__PURE__ */ T(Y, { children: /* @__PURE__ */ E(kl, {
23793
- gap: "xs",
23794
- align: "center",
23795
- wrap: "nowrap",
23796
- children: [
23797
- g,
23798
- /* @__PURE__ */ T(Xd, {
23799
- size: "xs",
23800
- c: "dimmed",
23801
- children: _.customerId ? `#${_.customerId}` : "#-"
23802
- }),
23803
- /* @__PURE__ */ T(Xd, {
23804
- size: "xs",
23805
- c: _.hasCustomerToken ? "green" : "red",
23806
- children: _.hasCustomerToken ? "cust✓" : "cust✗"
23807
- }),
23808
- /* @__PURE__ */ T(Xd, {
23809
- size: "xs",
23810
- c: _.hasGenaiToken ? "green" : "red",
23811
- children: _.hasGenaiToken ? "genai✓" : "genai✗"
23812
- })
23813
- ]
23814
- }) }),
23796
+ title: /* @__PURE__ */ E(Y, { children: [/* @__PURE__ */ T(Xd, {
23797
+ className: db.title,
23798
+ children: g
23799
+ }), /* @__PURE__ */ E(Y, {
23800
+ className: db.headerMeta,
23801
+ children: [/* @__PURE__ */ T(Y, {
23802
+ className: db.statusDot,
23803
+ style: { background: M ? "#22c55e" : "#ef4444" }
23804
+ }), /* @__PURE__ */ E(Xd, {
23805
+ size: "10",
23806
+ c: "dimmed",
23807
+ children: [M ? "Online" : "Offline", " · Billing Intelligence"]
23808
+ })]
23809
+ })] }),
23815
23810
  children: [
23811
+ /* @__PURE__ */ E(Y, {
23812
+ className: db.topSubHeader,
23813
+ children: [/* @__PURE__ */ T(Xd, {
23814
+ size: "10",
23815
+ fw: 700,
23816
+ c: "white",
23817
+ children: "Exceeder SelfCare agent"
23818
+ }), /* @__PURE__ */ E(kl, {
23819
+ gap: 8,
23820
+ wrap: "nowrap",
23821
+ children: [/* @__PURE__ */ T(Xd, {
23822
+ size: "10",
23823
+ c: _.hasCustomerToken ? "white" : "rgba(255,255,255,0.65)",
23824
+ children: "Billing Dispute"
23825
+ }), /* @__PURE__ */ T(Xd, {
23826
+ size: "10",
23827
+ c: _.hasGenaiToken ? "white" : "rgba(255,255,255,0.65)",
23828
+ children: "Active"
23829
+ })]
23830
+ })]
23831
+ }),
23816
23832
  /* @__PURE__ */ E(ub.Body, { children: [l && /* @__PURE__ */ T(Xd, {
23817
23833
  size: "xs",
23818
23834
  c: "red",
@@ -29123,33 +29139,33 @@ var XF = 1e4, ZF = {
29123
29139
  };
29124
29140
  function QF({ ui: e }) {
29125
29141
  YF();
29126
- 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 = {
29142
+ 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 = {
29127
29143
  bottom: e?.fabBottomOffset ?? ZF.bottom,
29128
29144
  right: e?.fabRightOffset ?? ZF.right
29129
- }, { 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({
29145
+ }, { 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({
29130
29146
  axis: "x",
29131
29147
  direction: -1
29132
- }), A = UF([p.length, g]), { isListening: j, isSupported: M, startListening: N, stopListening: P, reset: F } = WF({
29148
+ }), j = UF([m.length, v]), { isListening: M, isSupported: N, startListening: P, stopListening: F, reset: ee } = WF({
29133
29149
  lang: GF(),
29134
29150
  continuous: !0,
29135
29151
  pauseOnSubmit: !0,
29136
- onTextChange: h
29137
- }), ee = _(() => /* @__PURE__ */ T(Xd, {
29152
+ onTextChange: g
29153
+ }), te = _(() => /* @__PURE__ */ T(Xd, {
29138
29154
  fw: 800,
29139
- children: "Agent Chat"
29140
- }), []), te = async () => {
29141
- n(), await C(), await b();
29155
+ children: e?.drawerTitle ?? e?.fabButtonLabel ?? "Agent Chat"
29156
+ }), [e?.drawerTitle, e?.fabButtonLabel]), I = async () => {
29157
+ n(), await D(), await x();
29142
29158
  };
29143
29159
  return /* @__PURE__ */ E(w, { children: [!t && /* @__PURE__ */ T(nk, {
29144
- onClick: () => void te(),
29160
+ onClick: () => void I(),
29145
29161
  zIndex: i,
29146
- position: f,
29162
+ position: p,
29147
29163
  color: e?.accentColor,
29148
29164
  label: e?.fabButtonLabel
29149
29165
  }), /* @__PURE__ */ T(XO, {
29150
29166
  opened: t,
29151
29167
  onClose: () => {
29152
- j && P(), r();
29168
+ M && F(), r();
29153
29169
  },
29154
29170
  zIndex: i,
29155
29171
  withinPortal: a,
@@ -29159,26 +29175,27 @@ function QF({ ui: e }) {
29159
29175
  drawerRightOffset: l,
29160
29176
  drawerBorderRadius: u,
29161
29177
  drawerShadow: d,
29162
- messages: p,
29163
- composerText: m,
29164
- onComposerTextChange: h,
29165
- isLoading: g,
29166
- error: v,
29167
- canSend: x,
29178
+ drawerHeaderHeight: f,
29179
+ messages: m,
29180
+ composerText: h,
29181
+ onComposerTextChange: g,
29182
+ isLoading: v,
29183
+ error: y,
29184
+ canSend: S,
29168
29185
  onSubmit: () => {
29169
- j && P(), F(), y(m);
29186
+ M && F(), ee(), b(h);
29170
29187
  },
29171
- isListening: j,
29172
- isVoiceSupported: M,
29188
+ isListening: M,
29189
+ isVoiceSupported: N,
29173
29190
  onToggleVoice: () => {
29174
- j ? P() : (h(""), N());
29191
+ M ? F() : (g(""), P());
29175
29192
  },
29176
- drawerTitle: ee,
29177
- runtimeInfo: S,
29178
- scrollViewportRef: A,
29179
- drawerDraggable: D,
29180
- drawerResizableWidth: k,
29181
- drawerResizableHeight: O
29193
+ drawerTitle: te,
29194
+ runtimeInfo: C,
29195
+ scrollViewportRef: j,
29196
+ drawerDraggable: O,
29197
+ drawerResizableWidth: A,
29198
+ drawerResizableHeight: k
29182
29199
  })] });
29183
29200
  }
29184
29201
  //#endregion