@burtson-labs/bandit-engine 2.0.128 → 2.0.130
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/{chat-MLDKHXUH.mjs → chat-KITNRSFA.mjs} +4 -4
- package/dist/{chunk-FWFDOSRM.mjs → chunk-BVYSGIWG.mjs} +2 -2
- package/dist/{chunk-BQW7DSJ6.mjs → chunk-JONBKV2S.mjs} +177 -302
- package/dist/chunk-JONBKV2S.mjs.map +1 -0
- package/dist/{chunk-N3TVVQVS.mjs → chunk-PA4VYO4R.mjs} +207 -69
- package/dist/chunk-PA4VYO4R.mjs.map +1 -0
- package/dist/{chunk-LQJ6OD7F.mjs → chunk-POQY66ZJ.mjs} +322 -154
- package/dist/chunk-POQY66ZJ.mjs.map +1 -0
- package/dist/{chunk-QDTMVQWD.mjs → chunk-R7LKVTK7.mjs} +5 -5
- package/dist/index.js +2154 -1977
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/management/management.js +587 -409
- package/dist/management/management.js.map +1 -1
- package/dist/management/management.mjs +4 -4
- package/dist/modals/chat-modal/chat-modal.js +16 -3
- package/dist/modals/chat-modal/chat-modal.js.map +1 -1
- package/dist/modals/chat-modal/chat-modal.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-BQW7DSJ6.mjs.map +0 -1
- package/dist/chunk-LQJ6OD7F.mjs.map +0 -1
- package/dist/chunk-N3TVVQVS.mjs.map +0 -1
- /package/dist/{chat-MLDKHXUH.mjs.map → chat-KITNRSFA.mjs.map} +0 -0
- /package/dist/{chunk-FWFDOSRM.mjs.map → chunk-BVYSGIWG.mjs.map} +0 -0
- /package/dist/{chunk-QDTMVQWD.mjs.map → chunk-R7LKVTK7.mjs.map} +0 -0
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-ONQMRE2G.mjs";
|
|
4
4
|
import {
|
|
5
5
|
StreamingMarkdown_default
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BVYSGIWG.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useMCPToolsStore
|
|
9
9
|
} from "./chunk-K2JGFKEB.mjs";
|
|
@@ -16,7 +16,6 @@ import {
|
|
|
16
16
|
CloseIcon,
|
|
17
17
|
ComposeIcon,
|
|
18
18
|
ExpandMoreIcon,
|
|
19
|
-
FeedbackButton,
|
|
20
19
|
FeedbackIcon,
|
|
21
20
|
FeedbackModal,
|
|
22
21
|
GhostIcon,
|
|
@@ -39,7 +38,7 @@ import {
|
|
|
39
38
|
useNotificationService,
|
|
40
39
|
useTTS,
|
|
41
40
|
useVoiceStore
|
|
42
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-JONBKV2S.mjs";
|
|
43
42
|
import {
|
|
44
43
|
brandingService_default,
|
|
45
44
|
detectMessageMood,
|
|
@@ -81,7 +80,7 @@ import {
|
|
|
81
80
|
} from "./chunk-KCI46M23.mjs";
|
|
82
81
|
|
|
83
82
|
// src/chat/chat.tsx
|
|
84
|
-
import { useCallback as useCallback6, useEffect as
|
|
83
|
+
import { useCallback as useCallback6, useEffect as useEffect17, useLayoutEffect, useMemo as useMemo4, useRef as useRef15, useState as useState19 } from "react";
|
|
85
84
|
|
|
86
85
|
// src/chat/custom-logo.tsx
|
|
87
86
|
import React, { useEffect } from "react";
|
|
@@ -168,7 +167,7 @@ var Logo = ({ visible, atTop = false }) => {
|
|
|
168
167
|
var custom_logo_default = Logo;
|
|
169
168
|
|
|
170
169
|
// src/chat/chat.tsx
|
|
171
|
-
import { Box as
|
|
170
|
+
import { Box as Box20, ThemeProvider, CssBaseline, CircularProgress as CircularProgress4, Typography as Typography15 } from "@mui/material";
|
|
172
171
|
import { createTheme } from "@mui/material/styles";
|
|
173
172
|
|
|
174
173
|
// src/chat/canvas-panel.tsx
|
|
@@ -850,7 +849,7 @@ var ChatMessages = ({
|
|
|
850
849
|
StreamingMarkdown_default,
|
|
851
850
|
{
|
|
852
851
|
content: linkifyCitations(stripSourcesForDisplay(content), parseWebSources(content)),
|
|
853
|
-
isStreaming: isStreaming && isLast,
|
|
852
|
+
isStreaming: isStreaming && isLast && !workingMatch,
|
|
854
853
|
sources: sourceSummaries
|
|
855
854
|
}
|
|
856
855
|
),
|
|
@@ -873,7 +872,8 @@ var ChatMessages = ({
|
|
|
873
872
|
memoryUpdated: entry.memoryUpdated && !isPlaceholder,
|
|
874
873
|
sourceFiles: rawSources,
|
|
875
874
|
isMobile,
|
|
876
|
-
cancelled: entry.cancelled
|
|
875
|
+
cancelled: entry.cancelled,
|
|
876
|
+
revealActionsOnHover: !isLast && !isMobile
|
|
877
877
|
}
|
|
878
878
|
) }, index);
|
|
879
879
|
}),
|
|
@@ -5348,7 +5348,7 @@ import {
|
|
|
5348
5348
|
Avatar as Avatar6,
|
|
5349
5349
|
alpha as alpha8
|
|
5350
5350
|
} from "@mui/material";
|
|
5351
|
-
import { X as CloseIcon6, X as ClearIcon, Search as SearchIcon, Folder as FolderIcon4, MoreVertical as MoreVertIcon3, Trash2 as DeleteSweepIcon, Inbox as InboxIcon3, Plus as AddIcon4, Settings as SettingsIcon, Brain as MemoryIcon, LogOut as LogOutIcon, House as HomeLucideIcon, RefreshCw as SyncLucideIcon, CircleAlert as SyncErrorIcon, SlidersHorizontal as ManagementIcon } from "lucide-react";
|
|
5351
|
+
import { X as CloseIcon6, X as ClearIcon, Search as SearchIcon, Folder as FolderIcon4, MoreVertical as MoreVertIcon3, Trash2 as DeleteSweepIcon, Inbox as InboxIcon3, Plus as AddIcon4, Settings as SettingsIcon, Brain as MemoryIcon, LogOut as LogOutIcon, House as HomeLucideIcon, RefreshCw as SyncLucideIcon, CircleAlert as SyncErrorIcon, SlidersHorizontal as ManagementIcon, MessageSquare as FeedbackMenuIcon } from "lucide-react";
|
|
5352
5352
|
import { useTheme as useTheme13 } from "@mui/material/styles";
|
|
5353
5353
|
|
|
5354
5354
|
// src/chat/project-management-modal.tsx
|
|
@@ -6938,6 +6938,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6938
6938
|
const [searchQuery, setSearchQuery] = useState14("");
|
|
6939
6939
|
const [menuAnchorEl, setMenuAnchorEl] = useState14(null);
|
|
6940
6940
|
const [clearConfirmOpen, setClearConfirmOpen] = useState14(false);
|
|
6941
|
+
const [feedbackOpen, setFeedbackOpen] = useState14(false);
|
|
6941
6942
|
const [moveModalOpen, setMoveModalOpen] = useState14(false);
|
|
6942
6943
|
const [conversationToMove, setConversationToMove] = useState14(null);
|
|
6943
6944
|
const [renameProjectId, setRenameProjectId] = useState14(null);
|
|
@@ -7758,7 +7759,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
7758
7759
|
currentProjectId: conversationToMove.projectId
|
|
7759
7760
|
}
|
|
7760
7761
|
),
|
|
7761
|
-
/* @__PURE__ */
|
|
7762
|
+
/* @__PURE__ */ jsxs13(
|
|
7762
7763
|
Menu5,
|
|
7763
7764
|
{
|
|
7764
7765
|
anchorEl: menuAnchorEl,
|
|
@@ -7772,20 +7773,43 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
7772
7773
|
vertical: "bottom",
|
|
7773
7774
|
horizontal: "right"
|
|
7774
7775
|
},
|
|
7775
|
-
children:
|
|
7776
|
-
|
|
7777
|
-
|
|
7778
|
-
|
|
7779
|
-
|
|
7780
|
-
|
|
7781
|
-
|
|
7782
|
-
|
|
7783
|
-
|
|
7784
|
-
|
|
7785
|
-
|
|
7786
|
-
|
|
7787
|
-
|
|
7788
|
-
|
|
7776
|
+
children: [
|
|
7777
|
+
preferences.feedbackEnabled && /* @__PURE__ */ jsxs13(
|
|
7778
|
+
MenuItem5,
|
|
7779
|
+
{
|
|
7780
|
+
onClick: () => {
|
|
7781
|
+
setFeedbackOpen(true);
|
|
7782
|
+
handleMenuClose();
|
|
7783
|
+
},
|
|
7784
|
+
children: [
|
|
7785
|
+
/* @__PURE__ */ jsx16(ListItemIcon3, { children: /* @__PURE__ */ jsx16(FeedbackMenuIcon, { size: 16 }) }),
|
|
7786
|
+
/* @__PURE__ */ jsx16(ListItemText3, { children: "Send feedback" })
|
|
7787
|
+
]
|
|
7788
|
+
}
|
|
7789
|
+
),
|
|
7790
|
+
/* @__PURE__ */ jsxs13(
|
|
7791
|
+
MenuItem5,
|
|
7792
|
+
{
|
|
7793
|
+
onClick: () => {
|
|
7794
|
+
setClearConfirmOpen(true);
|
|
7795
|
+
handleMenuClose();
|
|
7796
|
+
},
|
|
7797
|
+
sx: { color: theme.palette.error.main },
|
|
7798
|
+
children: [
|
|
7799
|
+
/* @__PURE__ */ jsx16(ListItemIcon3, { children: /* @__PURE__ */ jsx16(DeleteSweepIcon, { size: 16, color: theme.palette.error.main }) }),
|
|
7800
|
+
/* @__PURE__ */ jsx16(ListItemText3, { children: "Clear All Conversations" })
|
|
7801
|
+
]
|
|
7802
|
+
}
|
|
7803
|
+
)
|
|
7804
|
+
]
|
|
7805
|
+
}
|
|
7806
|
+
),
|
|
7807
|
+
preferences.feedbackEnabled && /* @__PURE__ */ jsx16(
|
|
7808
|
+
FeedbackModal,
|
|
7809
|
+
{
|
|
7810
|
+
open: feedbackOpen,
|
|
7811
|
+
onClose: () => setFeedbackOpen(false),
|
|
7812
|
+
feedbackEmail: usePackageSettingsStore.getState().settings?.feedbackEmail
|
|
7789
7813
|
}
|
|
7790
7814
|
),
|
|
7791
7815
|
/* @__PURE__ */ jsxs13(
|
|
@@ -9694,14 +9718,170 @@ var UnderReview = () => {
|
|
|
9694
9718
|
};
|
|
9695
9719
|
var UnderReview_default = UnderReview;
|
|
9696
9720
|
|
|
9721
|
+
// src/components/feedback/FeedbackPulse.tsx
|
|
9722
|
+
import { useEffect as useEffect15, useRef as useRef13, useState as useState18 } from "react";
|
|
9723
|
+
import { Box as Box18, IconButton as IconButton13, Paper as Paper2, Slide as Slide2, Typography as Typography14 } from "@mui/material";
|
|
9724
|
+
import { useTheme as useTheme18, alpha as alpha11 } from "@mui/material/styles";
|
|
9725
|
+
import { X as CloseIcon8 } from "lucide-react";
|
|
9726
|
+
import { Fragment as Fragment12, jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
9727
|
+
var STORAGE_KEY2 = "bandit-feedback-pulse-last";
|
|
9728
|
+
var COOLDOWN_DAYS = 14;
|
|
9729
|
+
var MIN_SESSION_MS = 5 * 60 * 1e3;
|
|
9730
|
+
var MIN_MESSAGES_SENT = 2;
|
|
9731
|
+
var CHECK_INTERVAL_MS = 30 * 1e3;
|
|
9732
|
+
var readLastInteraction = () => {
|
|
9733
|
+
try {
|
|
9734
|
+
return Number(localStorage.getItem(STORAGE_KEY2)) || 0;
|
|
9735
|
+
} catch {
|
|
9736
|
+
return 0;
|
|
9737
|
+
}
|
|
9738
|
+
};
|
|
9739
|
+
var recordInteraction = (outcome) => {
|
|
9740
|
+
try {
|
|
9741
|
+
localStorage.setItem(STORAGE_KEY2, String(Date.now()));
|
|
9742
|
+
} catch {
|
|
9743
|
+
}
|
|
9744
|
+
debugLogger.info("FeedbackPulse: interaction recorded", { outcome });
|
|
9745
|
+
};
|
|
9746
|
+
var FeedbackPulse = ({ isMobile, feedbackEmail }) => {
|
|
9747
|
+
const theme = useTheme18();
|
|
9748
|
+
const [visible, setVisible] = useState18(false);
|
|
9749
|
+
const [thanked, setThanked] = useState18(false);
|
|
9750
|
+
const [modalOpen, setModalOpen] = useState18(false);
|
|
9751
|
+
const mountedAtRef = useRef13(Date.now());
|
|
9752
|
+
const baselineMessagesRef = useRef13(null);
|
|
9753
|
+
const totalMessages = useConversationStore(
|
|
9754
|
+
(s) => s.conversations.reduce((n, c) => n + c.history.length, 0)
|
|
9755
|
+
);
|
|
9756
|
+
const hydrated = useConversationStore((s) => s._hasHydrated);
|
|
9757
|
+
useEffect15(() => {
|
|
9758
|
+
if (hydrated && baselineMessagesRef.current === null) {
|
|
9759
|
+
baselineMessagesRef.current = totalMessages;
|
|
9760
|
+
}
|
|
9761
|
+
}, [hydrated, totalMessages]);
|
|
9762
|
+
useEffect15(() => {
|
|
9763
|
+
const cooldownMs = COOLDOWN_DAYS * 24 * 60 * 60 * 1e3;
|
|
9764
|
+
const forced = typeof window !== "undefined" && new URLSearchParams(window.location.search).has("feedbackPulse");
|
|
9765
|
+
const check = () => {
|
|
9766
|
+
if (visible || thanked || modalOpen) return;
|
|
9767
|
+
if (forced) {
|
|
9768
|
+
setVisible(true);
|
|
9769
|
+
return;
|
|
9770
|
+
}
|
|
9771
|
+
if (Date.now() - readLastInteraction() < cooldownMs) return;
|
|
9772
|
+
if (Date.now() - mountedAtRef.current < MIN_SESSION_MS) return;
|
|
9773
|
+
const baseline = baselineMessagesRef.current;
|
|
9774
|
+
if (baseline === null) return;
|
|
9775
|
+
const sentThisSession = useConversationStore.getState().conversations.reduce((n, c) => n + c.history.length, 0) - baseline;
|
|
9776
|
+
if (sentThisSession < MIN_MESSAGES_SENT) return;
|
|
9777
|
+
setVisible(true);
|
|
9778
|
+
};
|
|
9779
|
+
if (forced) check();
|
|
9780
|
+
const timer = setInterval(check, CHECK_INTERVAL_MS);
|
|
9781
|
+
return () => clearInterval(timer);
|
|
9782
|
+
}, [visible, thanked, modalOpen]);
|
|
9783
|
+
const answer = (outcome) => {
|
|
9784
|
+
recordInteraction(outcome);
|
|
9785
|
+
if (outcome === "bad") {
|
|
9786
|
+
setVisible(false);
|
|
9787
|
+
setModalOpen(true);
|
|
9788
|
+
return;
|
|
9789
|
+
}
|
|
9790
|
+
setThanked(true);
|
|
9791
|
+
setTimeout(() => {
|
|
9792
|
+
setVisible(false);
|
|
9793
|
+
setThanked(false);
|
|
9794
|
+
}, 1600);
|
|
9795
|
+
};
|
|
9796
|
+
const dismiss = () => {
|
|
9797
|
+
recordInteraction("dismissed");
|
|
9798
|
+
setVisible(false);
|
|
9799
|
+
};
|
|
9800
|
+
const choice = (emoji, label, outcome) => /* @__PURE__ */ jsxs17(
|
|
9801
|
+
Box18,
|
|
9802
|
+
{
|
|
9803
|
+
component: "button",
|
|
9804
|
+
type: "button",
|
|
9805
|
+
onClick: () => answer(outcome),
|
|
9806
|
+
sx: {
|
|
9807
|
+
font: "inherit",
|
|
9808
|
+
display: "flex",
|
|
9809
|
+
flexDirection: "column",
|
|
9810
|
+
alignItems: "center",
|
|
9811
|
+
gap: 0.25,
|
|
9812
|
+
px: 1.5,
|
|
9813
|
+
py: 0.75,
|
|
9814
|
+
border: "none",
|
|
9815
|
+
borderRadius: 2,
|
|
9816
|
+
cursor: "pointer",
|
|
9817
|
+
bgcolor: "transparent",
|
|
9818
|
+
color: theme.palette.text.secondary,
|
|
9819
|
+
transition: "background-color 0.15s ease, transform 0.1s ease",
|
|
9820
|
+
"&:hover": {
|
|
9821
|
+
bgcolor: alpha11(theme.palette.text.primary, 0.06),
|
|
9822
|
+
color: theme.palette.text.primary
|
|
9823
|
+
},
|
|
9824
|
+
"&:active": { transform: "scale(0.96)" }
|
|
9825
|
+
},
|
|
9826
|
+
children: [
|
|
9827
|
+
/* @__PURE__ */ jsx21(Box18, { component: "span", sx: { fontSize: "1.3rem", lineHeight: 1 }, children: emoji }),
|
|
9828
|
+
/* @__PURE__ */ jsx21(Typography14, { variant: "caption", sx: { fontWeight: 600 }, children: label })
|
|
9829
|
+
]
|
|
9830
|
+
}
|
|
9831
|
+
);
|
|
9832
|
+
return /* @__PURE__ */ jsxs17(Fragment12, { children: [
|
|
9833
|
+
/* @__PURE__ */ jsx21(Slide2, { direction: isMobile ? "down" : "up", in: visible, mountOnEnter: true, unmountOnExit: true, children: /* @__PURE__ */ jsx21(
|
|
9834
|
+
Paper2,
|
|
9835
|
+
{
|
|
9836
|
+
elevation: 0,
|
|
9837
|
+
sx: {
|
|
9838
|
+
position: "fixed",
|
|
9839
|
+
zIndex: 1350,
|
|
9840
|
+
...isMobile ? {
|
|
9841
|
+
top: `calc(${theme.spacing(8)} + env(safe-area-inset-top, 0px))`,
|
|
9842
|
+
left: "50%",
|
|
9843
|
+
transform: "translateX(-50%) !important",
|
|
9844
|
+
width: "min(92vw, 360px)"
|
|
9845
|
+
} : { bottom: 24, right: 24, width: 320 },
|
|
9846
|
+
p: 1.5,
|
|
9847
|
+
borderRadius: 3,
|
|
9848
|
+
border: `1px solid ${theme.palette.divider}`,
|
|
9849
|
+
bgcolor: theme.palette.background.paper,
|
|
9850
|
+
boxShadow: `0 12px 40px ${alpha11(theme.palette.common.black, theme.palette.mode === "dark" ? 0.5 : 0.18)}`
|
|
9851
|
+
},
|
|
9852
|
+
children: thanked ? /* @__PURE__ */ jsx21(Typography14, { sx: { textAlign: "center", py: 1.5, fontWeight: 600 }, children: "Thanks for the feedback! \u{1F64C}" }) : /* @__PURE__ */ jsxs17(Fragment12, { children: [
|
|
9853
|
+
/* @__PURE__ */ jsxs17(Box18, { sx: { display: "flex", alignItems: "center", mb: 0.5 }, children: [
|
|
9854
|
+
/* @__PURE__ */ jsx21(Typography14, { variant: "body2", sx: { fontWeight: 600, flex: 1 }, children: "How's Bandit doing?" }),
|
|
9855
|
+
/* @__PURE__ */ jsx21(IconButton13, { size: "small", onClick: dismiss, "aria-label": "Dismiss feedback prompt", children: /* @__PURE__ */ jsx21(CloseIcon8, { size: 16 }) })
|
|
9856
|
+
] }),
|
|
9857
|
+
/* @__PURE__ */ jsxs17(Box18, { sx: { display: "flex", justifyContent: "space-evenly" }, children: [
|
|
9858
|
+
choice("\u{1F60A}", "Good", "good"),
|
|
9859
|
+
choice("\u{1F610}", "Fine", "fine"),
|
|
9860
|
+
choice("\u{1F641}", "Bad", "bad")
|
|
9861
|
+
] })
|
|
9862
|
+
] })
|
|
9863
|
+
}
|
|
9864
|
+
) }),
|
|
9865
|
+
/* @__PURE__ */ jsx21(
|
|
9866
|
+
FeedbackModal,
|
|
9867
|
+
{
|
|
9868
|
+
open: modalOpen,
|
|
9869
|
+
onClose: () => setModalOpen(false),
|
|
9870
|
+
feedbackEmail
|
|
9871
|
+
}
|
|
9872
|
+
)
|
|
9873
|
+
] });
|
|
9874
|
+
};
|
|
9875
|
+
var FeedbackPulse_default = FeedbackPulse;
|
|
9876
|
+
|
|
9697
9877
|
// src/components/ConnectionStatus.tsx
|
|
9698
|
-
import { Box as
|
|
9699
|
-
import { jsx as
|
|
9878
|
+
import { Box as Box19, Chip as Chip5, useTheme as useTheme19 } from "@mui/material";
|
|
9879
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
9700
9880
|
var ConnectionStatus = ({
|
|
9701
9881
|
showWhenGood = false,
|
|
9702
9882
|
position = "top"
|
|
9703
9883
|
}) => {
|
|
9704
|
-
const theme =
|
|
9884
|
+
const theme = useTheme19();
|
|
9705
9885
|
const { isOnline, connectionQuality, isSlowConnection } = useNetworkStatus();
|
|
9706
9886
|
if (connectionQuality === "fast" && !showWhenGood) {
|
|
9707
9887
|
return null;
|
|
@@ -9710,28 +9890,28 @@ var ConnectionStatus = ({
|
|
|
9710
9890
|
switch (connectionQuality) {
|
|
9711
9891
|
case "offline":
|
|
9712
9892
|
return {
|
|
9713
|
-
icon: /* @__PURE__ */
|
|
9893
|
+
icon: /* @__PURE__ */ jsx22(WifiOffIcon, { sx: { fontSize: 16 } }),
|
|
9714
9894
|
label: "Offline",
|
|
9715
9895
|
color: "error",
|
|
9716
9896
|
severity: "high"
|
|
9717
9897
|
};
|
|
9718
9898
|
case "slow":
|
|
9719
9899
|
return {
|
|
9720
|
-
icon: /* @__PURE__ */
|
|
9900
|
+
icon: /* @__PURE__ */ jsx22(SignalWifi2BarIcon, { sx: { fontSize: 16 } }),
|
|
9721
9901
|
label: "Slow connection",
|
|
9722
9902
|
color: "warning",
|
|
9723
9903
|
severity: "medium"
|
|
9724
9904
|
};
|
|
9725
9905
|
case "fast":
|
|
9726
9906
|
return {
|
|
9727
|
-
icon: /* @__PURE__ */
|
|
9907
|
+
icon: /* @__PURE__ */ jsx22(WifiIcon, { sx: { fontSize: 16 } }),
|
|
9728
9908
|
label: "Connected",
|
|
9729
9909
|
color: "success",
|
|
9730
9910
|
severity: "low"
|
|
9731
9911
|
};
|
|
9732
9912
|
default:
|
|
9733
9913
|
return {
|
|
9734
|
-
icon: /* @__PURE__ */
|
|
9914
|
+
icon: /* @__PURE__ */ jsx22(WifiIcon, { sx: { fontSize: 16 } }),
|
|
9735
9915
|
label: "Unknown",
|
|
9736
9916
|
color: "default",
|
|
9737
9917
|
severity: "low"
|
|
@@ -9739,8 +9919,8 @@ var ConnectionStatus = ({
|
|
|
9739
9919
|
}
|
|
9740
9920
|
};
|
|
9741
9921
|
const config = getStatusConfig();
|
|
9742
|
-
return /* @__PURE__ */
|
|
9743
|
-
|
|
9922
|
+
return /* @__PURE__ */ jsx22(
|
|
9923
|
+
Box19,
|
|
9744
9924
|
{
|
|
9745
9925
|
sx: {
|
|
9746
9926
|
position: "fixed",
|
|
@@ -9755,7 +9935,7 @@ var ConnectionStatus = ({
|
|
|
9755
9935
|
"100%": { opacity: 1 }
|
|
9756
9936
|
}
|
|
9757
9937
|
},
|
|
9758
|
-
children: /* @__PURE__ */
|
|
9938
|
+
children: /* @__PURE__ */ jsx22(
|
|
9759
9939
|
Chip5,
|
|
9760
9940
|
{
|
|
9761
9941
|
icon: config.icon,
|
|
@@ -9779,7 +9959,7 @@ var ConnectionStatus = ({
|
|
|
9779
9959
|
};
|
|
9780
9960
|
|
|
9781
9961
|
// src/hooks/useVoiceMode.ts
|
|
9782
|
-
import { useEffect as
|
|
9962
|
+
import { useEffect as useEffect16, useRef as useRef14 } from "react";
|
|
9783
9963
|
var RMS_BASELINE = 128;
|
|
9784
9964
|
var RMS_NORMALIZER = 128;
|
|
9785
9965
|
var computeRms = (data) => {
|
|
@@ -9809,11 +9989,11 @@ var useVoiceMode = (config) => {
|
|
|
9809
9989
|
const setError = useVoiceModeStore((state) => state.setError);
|
|
9810
9990
|
const resetTransientState = useVoiceModeStore((state) => state.resetTransientState);
|
|
9811
9991
|
const setLastTranscript = useVoiceModeStore((state) => state.setLastTranscript);
|
|
9812
|
-
const configRef =
|
|
9813
|
-
|
|
9992
|
+
const configRef = useRef14(config);
|
|
9993
|
+
useEffect16(() => {
|
|
9814
9994
|
configRef.current = config;
|
|
9815
9995
|
}, [config]);
|
|
9816
|
-
|
|
9996
|
+
useEffect16(() => {
|
|
9817
9997
|
if (!enabled) {
|
|
9818
9998
|
return () => void 0;
|
|
9819
9999
|
}
|
|
@@ -10068,7 +10248,7 @@ var useVoiceMode = (config) => {
|
|
|
10068
10248
|
};
|
|
10069
10249
|
|
|
10070
10250
|
// src/chat/chat.tsx
|
|
10071
|
-
import { Fragment as
|
|
10251
|
+
import { Fragment as Fragment13, jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
10072
10252
|
var ChatContent = () => {
|
|
10073
10253
|
const packageSettings = usePackageSettingsStore((state) => state.settings);
|
|
10074
10254
|
const UnderReviewView = packageSettings?.components?.UnderReview ?? UnderReview_default;
|
|
@@ -10077,8 +10257,8 @@ var ChatContent = () => {
|
|
|
10077
10257
|
const ossMode = isOSSMode() || !packageSettings?.featureFlags?.subscriptionType;
|
|
10078
10258
|
const playgroundBypassAccess = packageSettings?.playgroundBypassAuth || typeof window !== "undefined" && window.location.pathname.includes("/playground");
|
|
10079
10259
|
const notificationService = useNotificationService();
|
|
10080
|
-
const [selectedTheme, setSelectedTheme] =
|
|
10081
|
-
const [themeLoading, setThemeLoading] =
|
|
10260
|
+
const [selectedTheme, setSelectedTheme] = useState19(null);
|
|
10261
|
+
const [themeLoading, setThemeLoading] = useState19(true);
|
|
10082
10262
|
const token = authenticationService.getToken();
|
|
10083
10263
|
const claims = token ? authenticationService.parseJwtClaims(token) : null;
|
|
10084
10264
|
const baseTheme = themeMap_default[selectedTheme ?? "bandit-dark"] || banditDarkTheme;
|
|
@@ -10130,12 +10310,12 @@ var ChatContent = () => {
|
|
|
10130
10310
|
} = useVoiceStore();
|
|
10131
10311
|
const isVoiceModeEnabled = useVoiceModeStore((state) => state.enabled);
|
|
10132
10312
|
const canvasOpen = useCanvasStore((state) => state.open);
|
|
10133
|
-
const previousVoiceModeEnabledRef =
|
|
10134
|
-
const historyRef =
|
|
10135
|
-
|
|
10313
|
+
const previousVoiceModeEnabledRef = useRef15(isVoiceModeEnabled);
|
|
10314
|
+
const historyRef = useRef15(history);
|
|
10315
|
+
useEffect17(() => {
|
|
10136
10316
|
historyRef.current = history;
|
|
10137
10317
|
}, [history]);
|
|
10138
|
-
|
|
10318
|
+
useEffect17(() => {
|
|
10139
10319
|
if (!hydrated) return;
|
|
10140
10320
|
const params = new URLSearchParams(window.location.search);
|
|
10141
10321
|
const title = params.get("title") || "";
|
|
@@ -10151,7 +10331,7 @@ var ChatContent = () => {
|
|
|
10151
10331
|
stop: ttsStop,
|
|
10152
10332
|
isAvailable: isTTSAvailable
|
|
10153
10333
|
} = useTTS();
|
|
10154
|
-
|
|
10334
|
+
useEffect17(() => {
|
|
10155
10335
|
const timer = setTimeout(() => {
|
|
10156
10336
|
const isAuthenticated = authenticationService.isAuthenticated();
|
|
10157
10337
|
if (!initialized || availableVoices.length === 0) {
|
|
@@ -10165,7 +10345,7 @@ var ChatContent = () => {
|
|
|
10165
10345
|
}, 500);
|
|
10166
10346
|
return () => clearTimeout(timer);
|
|
10167
10347
|
}, [initialized, availableVoices.length, loadVoicesFromAPI, token]);
|
|
10168
|
-
|
|
10348
|
+
useEffect17(() => {
|
|
10169
10349
|
const isAuthenticated = authenticationService.isAuthenticated();
|
|
10170
10350
|
if (packageSettings?.gatewayApiUrl && availableVoices.length === 0 && !initialized) {
|
|
10171
10351
|
if (token && isAuthenticated) {
|
|
@@ -10177,17 +10357,17 @@ var ChatContent = () => {
|
|
|
10177
10357
|
}
|
|
10178
10358
|
}, [packageSettings?.gatewayApiUrl, availableVoices.length, initialized, loadVoicesFromAPI, token]);
|
|
10179
10359
|
const provider = useAIProviderStore((state) => state.provider);
|
|
10180
|
-
const inputRef =
|
|
10181
|
-
const [pastedImages, setPastedImages] =
|
|
10182
|
-
const inputContainerRef =
|
|
10183
|
-
const [inputHeight, setInputHeight] =
|
|
10184
|
-
const [isSubmitting, setIsSubmitting] =
|
|
10185
|
-
const [pendingMessage, setPendingMessage] =
|
|
10360
|
+
const inputRef = useRef15(null);
|
|
10361
|
+
const [pastedImages, setPastedImages] = useState19([]);
|
|
10362
|
+
const inputContainerRef = useRef15(null);
|
|
10363
|
+
const [inputHeight, setInputHeight] = useState19(80);
|
|
10364
|
+
const [isSubmitting, setIsSubmitting] = useState19(false);
|
|
10365
|
+
const [pendingMessage, setPendingMessage] = useState19(null);
|
|
10186
10366
|
const { conversations, currentId, _hasHydrated, hydrate, toggleIncognito } = useConversationStore();
|
|
10187
10367
|
const isTemporaryChat = Boolean(conversations.find((c) => c.id === currentId)?.incognito);
|
|
10188
|
-
const [isMobile, setIsMobile] =
|
|
10189
|
-
const [drawerOpen, setDrawerOpen] =
|
|
10190
|
-
const [mobileConversationsOpen, setMobileConversationsOpen] =
|
|
10368
|
+
const [isMobile, setIsMobile] = useState19(false);
|
|
10369
|
+
const [drawerOpen, setDrawerOpen] = useState19(false);
|
|
10370
|
+
const [mobileConversationsOpen, setMobileConversationsOpen] = useState19(false);
|
|
10191
10371
|
const { generateName } = useConversationNameGenerator();
|
|
10192
10372
|
const { preferences } = usePreferencesStore();
|
|
10193
10373
|
const { containerRef: chatContainerRef, targetRef: scrollTargetRef, scrollToBottom, getScrollState } = useAutoScroll({
|
|
@@ -10199,27 +10379,27 @@ var ChatContent = () => {
|
|
|
10199
10379
|
const chatContainerEl = chatContainerRef.current;
|
|
10200
10380
|
const scrollTargetEl = scrollTargetRef.current;
|
|
10201
10381
|
const { isSlowConnection, connectionQuality, trackRequestStart, trackRequestEnd } = useNetworkStatus();
|
|
10202
|
-
const [showScrollToBottom, setShowScrollToBottom] =
|
|
10203
|
-
const [streamBuffer, setStreamBuffer] =
|
|
10204
|
-
const [responseStarted, setResponseStarted] =
|
|
10205
|
-
const [isStreaming, setIsStreaming] =
|
|
10206
|
-
const [isThinking, setIsThinking] =
|
|
10382
|
+
const [showScrollToBottom, setShowScrollToBottom] = useState19(false);
|
|
10383
|
+
const [streamBuffer, setStreamBuffer] = useState19("");
|
|
10384
|
+
const [responseStarted, setResponseStarted] = useState19(false);
|
|
10385
|
+
const [isStreaming, setIsStreaming] = useState19(false);
|
|
10386
|
+
const [isThinking, setIsThinking] = useState19(false);
|
|
10207
10387
|
const initialLogoState = history.length === 0;
|
|
10208
|
-
const [logoVisible, setLogoVisible] =
|
|
10209
|
-
const [logoShouldRender, setLogoShouldRender] =
|
|
10210
|
-
const streamingGraceUntilRef =
|
|
10388
|
+
const [logoVisible, setLogoVisible] = useState19(initialLogoState);
|
|
10389
|
+
const [logoShouldRender, setLogoShouldRender] = useState19(initialLogoState);
|
|
10390
|
+
const streamingGraceUntilRef = useRef15(0);
|
|
10211
10391
|
const GRACE_MS = 450;
|
|
10212
10392
|
const GRACE_OFFSET_DESKTOP = 28;
|
|
10213
10393
|
const GRACE_OFFSET_MOBILE = 20;
|
|
10214
|
-
const followStreamRef =
|
|
10215
|
-
const lastSpokenResponseRef =
|
|
10216
|
-
const previousConversationIdRef =
|
|
10217
|
-
const logoFadeTimeoutRef =
|
|
10218
|
-
const [branding, setBranding] =
|
|
10219
|
-
const [brandingLoading, setBrandingLoading] =
|
|
10220
|
-
const isBrandingLoadInProgressRef =
|
|
10394
|
+
const followStreamRef = useRef15(true);
|
|
10395
|
+
const lastSpokenResponseRef = useRef15(null);
|
|
10396
|
+
const previousConversationIdRef = useRef15(null);
|
|
10397
|
+
const logoFadeTimeoutRef = useRef15(null);
|
|
10398
|
+
const [branding, setBranding] = useState19(null);
|
|
10399
|
+
const [brandingLoading, setBrandingLoading] = useState19(true);
|
|
10400
|
+
const isBrandingLoadInProgressRef = useRef15(false);
|
|
10221
10401
|
const logoOnly = history.length === 0 && !brandingLoading;
|
|
10222
|
-
|
|
10402
|
+
useEffect17(() => {
|
|
10223
10403
|
const isEmptyConversation = (history?.length ?? 0) === 0;
|
|
10224
10404
|
const isSending = Boolean(pendingMessage);
|
|
10225
10405
|
const shouldShowLogo = isEmptyConversation && !isSending;
|
|
@@ -10249,7 +10429,7 @@ var ChatContent = () => {
|
|
|
10249
10429
|
}, 500);
|
|
10250
10430
|
}
|
|
10251
10431
|
}, [history, pendingMessage]);
|
|
10252
|
-
|
|
10432
|
+
useEffect17(() => {
|
|
10253
10433
|
if (!brandingLoading && !themeLoading) {
|
|
10254
10434
|
return;
|
|
10255
10435
|
}
|
|
@@ -10265,18 +10445,18 @@ var ChatContent = () => {
|
|
|
10265
10445
|
}, 2500);
|
|
10266
10446
|
return () => window.clearTimeout(timeoutId);
|
|
10267
10447
|
}, [brandingLoading, themeLoading, selectedTheme]);
|
|
10268
|
-
|
|
10448
|
+
useEffect17(() => () => {
|
|
10269
10449
|
if (logoFadeTimeoutRef.current) {
|
|
10270
10450
|
window.clearTimeout(logoFadeTimeoutRef.current);
|
|
10271
10451
|
logoFadeTimeoutRef.current = null;
|
|
10272
10452
|
}
|
|
10273
10453
|
}, []);
|
|
10274
|
-
|
|
10454
|
+
useEffect17(() => {
|
|
10275
10455
|
if (isStreaming && streamBuffer.trim() === "") {
|
|
10276
10456
|
streamingGraceUntilRef.current = Date.now() + GRACE_MS;
|
|
10277
10457
|
}
|
|
10278
10458
|
}, [isStreaming, streamBuffer]);
|
|
10279
|
-
|
|
10459
|
+
useEffect17(() => {
|
|
10280
10460
|
if (!isStreaming) return;
|
|
10281
10461
|
const container = chatContainerRef.current;
|
|
10282
10462
|
if (!container) return;
|
|
@@ -10287,13 +10467,13 @@ var ChatContent = () => {
|
|
|
10287
10467
|
container.scrollTo({ top: targetTop, behavior: "smooth" });
|
|
10288
10468
|
}
|
|
10289
10469
|
}, [streamBuffer, isStreaming, isMobile, chatContainerRef]);
|
|
10290
|
-
|
|
10470
|
+
useEffect17(() => {
|
|
10291
10471
|
if (!_hasHydrated) {
|
|
10292
10472
|
debugLogger.info("Chat component triggering conversation store hydration");
|
|
10293
10473
|
hydrate();
|
|
10294
10474
|
}
|
|
10295
10475
|
}, [_hasHydrated, hydrate]);
|
|
10296
|
-
|
|
10476
|
+
useEffect17(() => {
|
|
10297
10477
|
const loadBrandingAndTheme = async () => {
|
|
10298
10478
|
if (isBrandingLoadInProgressRef.current) {
|
|
10299
10479
|
debugLogger.warn("Branding loading already in progress, skipping");
|
|
@@ -10482,7 +10662,7 @@ var ChatContent = () => {
|
|
|
10482
10662
|
window.removeEventListener("bandit-theme-changed", handleThemeChange);
|
|
10483
10663
|
};
|
|
10484
10664
|
}, []);
|
|
10485
|
-
|
|
10665
|
+
useEffect17(() => {
|
|
10486
10666
|
if (!chatContainerEl) return;
|
|
10487
10667
|
const blurInputOnTouchScroll = () => {
|
|
10488
10668
|
if (document.activeElement === inputRef.current) inputRef.current?.blur();
|
|
@@ -10490,13 +10670,13 @@ var ChatContent = () => {
|
|
|
10490
10670
|
chatContainerEl.addEventListener("touchmove", blurInputOnTouchScroll, { passive: true });
|
|
10491
10671
|
return () => chatContainerEl.removeEventListener("touchmove", blurInputOnTouchScroll);
|
|
10492
10672
|
}, [chatContainerEl]);
|
|
10493
|
-
|
|
10673
|
+
useEffect17(() => {
|
|
10494
10674
|
const handleResize = () => setIsMobile(window.innerWidth <= 768);
|
|
10495
10675
|
handleResize();
|
|
10496
10676
|
window.addEventListener("resize", handleResize);
|
|
10497
10677
|
return () => window.removeEventListener("resize", handleResize);
|
|
10498
10678
|
}, []);
|
|
10499
|
-
|
|
10679
|
+
useEffect17(() => {
|
|
10500
10680
|
const setViewportHeight = () => {
|
|
10501
10681
|
document.documentElement.style.setProperty(
|
|
10502
10682
|
"--vh",
|
|
@@ -10507,7 +10687,7 @@ var ChatContent = () => {
|
|
|
10507
10687
|
window.addEventListener("resize", setViewportHeight);
|
|
10508
10688
|
return () => window.removeEventListener("resize", setViewportHeight);
|
|
10509
10689
|
}, []);
|
|
10510
|
-
|
|
10690
|
+
useEffect17(() => {
|
|
10511
10691
|
if (!chatContainerEl) return;
|
|
10512
10692
|
let rafId = null;
|
|
10513
10693
|
const update = () => {
|
|
@@ -10526,7 +10706,7 @@ var ChatContent = () => {
|
|
|
10526
10706
|
chatContainerEl.removeEventListener(SCROLL_STATE_CHANGED_EVENT, update);
|
|
10527
10707
|
};
|
|
10528
10708
|
}, [chatContainerEl, getScrollState]);
|
|
10529
|
-
|
|
10709
|
+
useEffect17(() => {
|
|
10530
10710
|
if (!chatContainerEl) return;
|
|
10531
10711
|
let observer = null;
|
|
10532
10712
|
let rafId = null;
|
|
@@ -10561,7 +10741,7 @@ var ChatContent = () => {
|
|
|
10561
10741
|
if (observer) observer.disconnect();
|
|
10562
10742
|
};
|
|
10563
10743
|
}, [chatContainerEl, scrollTargetEl, scrollTargetRef, getScrollState, inputHeight, history.length]);
|
|
10564
|
-
|
|
10744
|
+
useEffect17(() => {
|
|
10565
10745
|
const isTransitioning = isStreaming || streamBuffer.trim() === "";
|
|
10566
10746
|
const delay = isTransitioning ? 400 : 100;
|
|
10567
10747
|
const timer = setTimeout(() => {
|
|
@@ -10604,7 +10784,7 @@ var ChatContent = () => {
|
|
|
10604
10784
|
return () => clearTimeout(scrollTimer);
|
|
10605
10785
|
}
|
|
10606
10786
|
}, [history, isStreaming, scrollToBottom, getScrollState, isMobile, chatContainerRef]);
|
|
10607
|
-
|
|
10787
|
+
useEffect17(() => {
|
|
10608
10788
|
const observer = new ResizeObserver(() => {
|
|
10609
10789
|
if (inputContainerRef.current)
|
|
10610
10790
|
setInputHeight(inputContainerRef.current.offsetHeight);
|
|
@@ -10615,7 +10795,7 @@ var ChatContent = () => {
|
|
|
10615
10795
|
}
|
|
10616
10796
|
return () => observer.disconnect();
|
|
10617
10797
|
}, []);
|
|
10618
|
-
|
|
10798
|
+
useEffect17(() => {
|
|
10619
10799
|
if (!hydrated || !_hasHydrated) return;
|
|
10620
10800
|
if (currentId === null) {
|
|
10621
10801
|
useAIQueryStore.setState({ history: [] });
|
|
@@ -10664,7 +10844,7 @@ var ChatContent = () => {
|
|
|
10664
10844
|
setResponse,
|
|
10665
10845
|
setComponentStatus
|
|
10666
10846
|
]);
|
|
10667
|
-
|
|
10847
|
+
useEffect17(() => {
|
|
10668
10848
|
debugLogger.info("Chat component conversation state", {
|
|
10669
10849
|
hasHydrated: _hasHydrated,
|
|
10670
10850
|
conversationCount: conversations.length,
|
|
@@ -10673,7 +10853,7 @@ var ChatContent = () => {
|
|
|
10673
10853
|
storeState: "main-chat"
|
|
10674
10854
|
});
|
|
10675
10855
|
}, [_hasHydrated, conversations, currentId]);
|
|
10676
|
-
|
|
10856
|
+
useEffect17(() => {
|
|
10677
10857
|
if (!_hasHydrated || !chatContainerEl) return;
|
|
10678
10858
|
let rafId = null;
|
|
10679
10859
|
const sync = () => {
|
|
@@ -10863,7 +11043,7 @@ var ChatContent = () => {
|
|
|
10863
11043
|
onInterrupt: handleVoiceInterrupt,
|
|
10864
11044
|
onError: (message) => notificationService?.showError?.(message)
|
|
10865
11045
|
});
|
|
10866
|
-
|
|
11046
|
+
useEffect17(() => {
|
|
10867
11047
|
const previouslyEnabled = previousVoiceModeEnabledRef.current;
|
|
10868
11048
|
previousVoiceModeEnabledRef.current = isVoiceModeEnabled;
|
|
10869
11049
|
if (!previouslyEnabled && isVoiceModeEnabled) {
|
|
@@ -10888,7 +11068,7 @@ var ChatContent = () => {
|
|
|
10888
11068
|
}
|
|
10889
11069
|
}
|
|
10890
11070
|
}, [isVoiceModeEnabled, ttsStop]);
|
|
10891
|
-
|
|
11071
|
+
useEffect17(() => {
|
|
10892
11072
|
if (!isVoiceModeEnabled || !isStreaming) {
|
|
10893
11073
|
return;
|
|
10894
11074
|
}
|
|
@@ -10908,7 +11088,7 @@ var ChatContent = () => {
|
|
|
10908
11088
|
}
|
|
10909
11089
|
lastSpokenResponseRef.current = null;
|
|
10910
11090
|
}, [isStreaming, isVoiceModeEnabled, ttsStop]);
|
|
10911
|
-
|
|
11091
|
+
useEffect17(() => {
|
|
10912
11092
|
if (!isVoiceModeEnabled) {
|
|
10913
11093
|
lastSpokenResponseRef.current = null;
|
|
10914
11094
|
return;
|
|
@@ -10988,10 +11168,10 @@ var ChatContent = () => {
|
|
|
10988
11168
|
}
|
|
10989
11169
|
};
|
|
10990
11170
|
if (!hydrated || brandingLoading || themeLoading) {
|
|
10991
|
-
return /* @__PURE__ */
|
|
10992
|
-
/* @__PURE__ */
|
|
10993
|
-
/* @__PURE__ */
|
|
10994
|
-
|
|
11171
|
+
return /* @__PURE__ */ jsxs18(ThemeProvider, { theme: banditTheme, children: [
|
|
11172
|
+
/* @__PURE__ */ jsx23(CssBaseline, {}),
|
|
11173
|
+
/* @__PURE__ */ jsxs18(
|
|
11174
|
+
Box20,
|
|
10995
11175
|
{
|
|
10996
11176
|
sx: (theme) => ({
|
|
10997
11177
|
minHeight: "100dvh",
|
|
@@ -11004,8 +11184,8 @@ var ChatContent = () => {
|
|
|
11004
11184
|
color: theme.palette.text.primary
|
|
11005
11185
|
}),
|
|
11006
11186
|
children: [
|
|
11007
|
-
/* @__PURE__ */
|
|
11008
|
-
/* @__PURE__ */
|
|
11187
|
+
/* @__PURE__ */ jsx23(CircularProgress4, { size: 32, thickness: 4 }),
|
|
11188
|
+
/* @__PURE__ */ jsx23(Typography15, { variant: "body2", color: "text.secondary", children: "Preparing your workspace..." })
|
|
11009
11189
|
]
|
|
11010
11190
|
}
|
|
11011
11191
|
)
|
|
@@ -11013,15 +11193,15 @@ var ChatContent = () => {
|
|
|
11013
11193
|
}
|
|
11014
11194
|
const userHasAccess = playgroundBypassAccess || ossMode || claims?.roles?.includes("super-user") || claims?.roles?.includes("admin");
|
|
11015
11195
|
if (!userHasAccess) {
|
|
11016
|
-
return /* @__PURE__ */
|
|
11017
|
-
/* @__PURE__ */
|
|
11018
|
-
/* @__PURE__ */
|
|
11196
|
+
return /* @__PURE__ */ jsxs18(ThemeProvider, { theme: banditTheme, children: [
|
|
11197
|
+
/* @__PURE__ */ jsx23(CssBaseline, {}),
|
|
11198
|
+
/* @__PURE__ */ jsx23(UnderReviewView, {})
|
|
11019
11199
|
] });
|
|
11020
11200
|
}
|
|
11021
|
-
return /* @__PURE__ */
|
|
11022
|
-
/* @__PURE__ */
|
|
11023
|
-
/* @__PURE__ */
|
|
11024
|
-
|
|
11201
|
+
return /* @__PURE__ */ jsxs18(ThemeProvider, { theme: banditTheme, children: [
|
|
11202
|
+
/* @__PURE__ */ jsx23(CssBaseline, {}),
|
|
11203
|
+
/* @__PURE__ */ jsxs18(
|
|
11204
|
+
Box20,
|
|
11025
11205
|
{
|
|
11026
11206
|
sx: (theme) => ({
|
|
11027
11207
|
display: "flex",
|
|
@@ -11050,7 +11230,7 @@ var ChatContent = () => {
|
|
|
11050
11230
|
transition: "left 0.3s ease-in-out, width 0.3s ease-in-out, transform 0.3s ease-in-out, border-radius 0.3s ease-in-out"
|
|
11051
11231
|
}),
|
|
11052
11232
|
children: [
|
|
11053
|
-
/* @__PURE__ */
|
|
11233
|
+
/* @__PURE__ */ jsx23(
|
|
11054
11234
|
chat_app_bar_default,
|
|
11055
11235
|
{
|
|
11056
11236
|
availableModels,
|
|
@@ -11064,9 +11244,9 @@ var ChatContent = () => {
|
|
|
11064
11244
|
onMobileConversationsOpenChange: setMobileConversationsOpen
|
|
11065
11245
|
}
|
|
11066
11246
|
),
|
|
11067
|
-
isTemporaryChat && /* @__PURE__ */
|
|
11068
|
-
/* @__PURE__ */
|
|
11069
|
-
|
|
11247
|
+
isTemporaryChat && /* @__PURE__ */ jsxs18(Fragment13, { children: [
|
|
11248
|
+
/* @__PURE__ */ jsx23(
|
|
11249
|
+
Box20,
|
|
11070
11250
|
{
|
|
11071
11251
|
sx: (theme) => ({
|
|
11072
11252
|
position: "absolute",
|
|
@@ -11078,8 +11258,8 @@ var ChatContent = () => {
|
|
|
11078
11258
|
})
|
|
11079
11259
|
}
|
|
11080
11260
|
),
|
|
11081
|
-
/* @__PURE__ */
|
|
11082
|
-
|
|
11261
|
+
/* @__PURE__ */ jsxs18(
|
|
11262
|
+
Box20,
|
|
11083
11263
|
{
|
|
11084
11264
|
sx: (theme) => ({
|
|
11085
11265
|
position: "absolute",
|
|
@@ -11103,10 +11283,10 @@ var ChatContent = () => {
|
|
|
11103
11283
|
whiteSpace: "nowrap"
|
|
11104
11284
|
}),
|
|
11105
11285
|
children: [
|
|
11106
|
-
/* @__PURE__ */
|
|
11286
|
+
/* @__PURE__ */ jsx23(Box20, { component: "span", "aria-hidden": true, sx: { fontSize: "0.9rem", lineHeight: 1 }, children: "\u{1F47B}" }),
|
|
11107
11287
|
"Temporary chat",
|
|
11108
|
-
/* @__PURE__ */
|
|
11109
|
-
|
|
11288
|
+
/* @__PURE__ */ jsx23(
|
|
11289
|
+
Box20,
|
|
11110
11290
|
{
|
|
11111
11291
|
component: "button",
|
|
11112
11292
|
type: "button",
|
|
@@ -11140,8 +11320,8 @@ var ChatContent = () => {
|
|
|
11140
11320
|
}
|
|
11141
11321
|
)
|
|
11142
11322
|
] }),
|
|
11143
|
-
/* @__PURE__ */
|
|
11144
|
-
|
|
11323
|
+
/* @__PURE__ */ jsx23(
|
|
11324
|
+
Box20,
|
|
11145
11325
|
{
|
|
11146
11326
|
ref: chatContainerRef,
|
|
11147
11327
|
sx: {
|
|
@@ -11161,8 +11341,8 @@ var ChatContent = () => {
|
|
|
11161
11341
|
msOverflowStyle: "none",
|
|
11162
11342
|
"&::-webkit-scrollbar": { display: "none" }
|
|
11163
11343
|
},
|
|
11164
|
-
children: /* @__PURE__ */
|
|
11165
|
-
|
|
11344
|
+
children: /* @__PURE__ */ jsxs18(
|
|
11345
|
+
Box20,
|
|
11166
11346
|
{
|
|
11167
11347
|
sx: {
|
|
11168
11348
|
width: "100%",
|
|
@@ -11175,8 +11355,8 @@ var ChatContent = () => {
|
|
|
11175
11355
|
logoShouldRender && !brandingLoading && (() => {
|
|
11176
11356
|
const headerMode = branding?.headerMode ?? "logo";
|
|
11177
11357
|
if (headerMode === "minimal") {
|
|
11178
|
-
return /* @__PURE__ */
|
|
11179
|
-
|
|
11358
|
+
return /* @__PURE__ */ jsx23(
|
|
11359
|
+
Box20,
|
|
11180
11360
|
{
|
|
11181
11361
|
sx: (theme) => ({
|
|
11182
11362
|
textAlign: "center",
|
|
@@ -11187,13 +11367,13 @@ var ChatContent = () => {
|
|
|
11187
11367
|
transition: "opacity 0.5s ease",
|
|
11188
11368
|
color: theme.palette.text.primary
|
|
11189
11369
|
}),
|
|
11190
|
-
children: /* @__PURE__ */
|
|
11370
|
+
children: /* @__PURE__ */ jsx23(Typography15, { sx: { fontWeight: 500, fontSize: { xs: "1.5rem", md: "1.9rem" }, lineHeight: 1.2 }, children: "What can I help with?" })
|
|
11191
11371
|
}
|
|
11192
11372
|
);
|
|
11193
11373
|
}
|
|
11194
11374
|
if (headerMode === "text") {
|
|
11195
|
-
return /* @__PURE__ */
|
|
11196
|
-
|
|
11375
|
+
return /* @__PURE__ */ jsx23(
|
|
11376
|
+
Box20,
|
|
11197
11377
|
{
|
|
11198
11378
|
sx: (theme) => ({
|
|
11199
11379
|
textAlign: "center",
|
|
@@ -11204,14 +11384,14 @@ var ChatContent = () => {
|
|
|
11204
11384
|
transition: "opacity 0.5s ease",
|
|
11205
11385
|
color: theme.palette.text.primary
|
|
11206
11386
|
}),
|
|
11207
|
-
children: /* @__PURE__ */
|
|
11387
|
+
children: /* @__PURE__ */ jsx23(Typography15, { sx: { fontWeight: 600, fontSize: { xs: "1.6rem", md: "2.1rem" }, lineHeight: 1.2 }, children: branding?.brandingText?.trim() || "Bandit AI" })
|
|
11208
11388
|
}
|
|
11209
11389
|
);
|
|
11210
11390
|
}
|
|
11211
|
-
return branding?.logoBase64 ? /* @__PURE__ */
|
|
11391
|
+
return branding?.logoBase64 ? /* @__PURE__ */ jsx23(custom_logo_default, { visible: logoVisible, atTop: true }) : /* @__PURE__ */ jsx23(bandit_chat_logo_default, { visible: logoVisible, atTop: true });
|
|
11212
11392
|
})(),
|
|
11213
|
-
/* @__PURE__ */
|
|
11214
|
-
|
|
11393
|
+
/* @__PURE__ */ jsx23(
|
|
11394
|
+
Box20,
|
|
11215
11395
|
{
|
|
11216
11396
|
sx: {
|
|
11217
11397
|
margin: "0 auto",
|
|
@@ -11220,7 +11400,7 @@ var ChatContent = () => {
|
|
|
11220
11400
|
flexShrink: 0,
|
|
11221
11401
|
px: isMobile ? 0 : 0
|
|
11222
11402
|
},
|
|
11223
|
-
children: /* @__PURE__ */
|
|
11403
|
+
children: /* @__PURE__ */ jsx23(
|
|
11224
11404
|
chat_messages_default,
|
|
11225
11405
|
{
|
|
11226
11406
|
isStreaming,
|
|
@@ -11244,7 +11424,7 @@ var ChatContent = () => {
|
|
|
11244
11424
|
)
|
|
11245
11425
|
}
|
|
11246
11426
|
),
|
|
11247
|
-
showScrollToBottom && /* @__PURE__ */
|
|
11427
|
+
showScrollToBottom && /* @__PURE__ */ jsx23(
|
|
11248
11428
|
chat_scroll_to_bottom_button_default,
|
|
11249
11429
|
{
|
|
11250
11430
|
inputHeight,
|
|
@@ -11253,8 +11433,8 @@ var ChatContent = () => {
|
|
|
11253
11433
|
onClick: handleScrollToBottomClick
|
|
11254
11434
|
}
|
|
11255
11435
|
),
|
|
11256
|
-
history.length === 0 && componentStatus !== "Loading" && !isMobile && /* @__PURE__ */
|
|
11257
|
-
|
|
11436
|
+
history.length === 0 && componentStatus !== "Loading" && !isMobile && /* @__PURE__ */ jsx23(
|
|
11437
|
+
Box20,
|
|
11258
11438
|
{
|
|
11259
11439
|
sx: (theme) => ({
|
|
11260
11440
|
position: "absolute",
|
|
@@ -11272,8 +11452,8 @@ var ChatContent = () => {
|
|
|
11272
11452
|
})
|
|
11273
11453
|
}
|
|
11274
11454
|
),
|
|
11275
|
-
/* @__PURE__ */
|
|
11276
|
-
|
|
11455
|
+
/* @__PURE__ */ jsxs18(
|
|
11456
|
+
Box20,
|
|
11277
11457
|
{
|
|
11278
11458
|
sx: {
|
|
11279
11459
|
display: "flex",
|
|
@@ -11284,11 +11464,11 @@ var ChatContent = () => {
|
|
|
11284
11464
|
maxWidth: "768px"
|
|
11285
11465
|
},
|
|
11286
11466
|
children: [
|
|
11287
|
-
/* @__PURE__ */
|
|
11288
|
-
history.length === 0 && componentStatus !== "Loading" && !pendingMessage && preferences.chatSuggestionsEnabled && /* @__PURE__ */
|
|
11289
|
-
/* @__PURE__ */
|
|
11290
|
-
/* @__PURE__ */
|
|
11291
|
-
/* @__PURE__ */
|
|
11467
|
+
/* @__PURE__ */ jsx23(Box20, { sx: { flex: "1 1 auto" } }),
|
|
11468
|
+
history.length === 0 && componentStatus !== "Loading" && !pendingMessage && preferences.chatSuggestionsEnabled && /* @__PURE__ */ jsx23(Box20, { sx: { marginBottom: "20px" }, children: /* @__PURE__ */ jsx23(QuerySuggestionPicker, { onSend: handleSend, inputHeight }) }),
|
|
11469
|
+
/* @__PURE__ */ jsx23(rate_limit_prompt_default, {}),
|
|
11470
|
+
/* @__PURE__ */ jsx23(ask_user_card_default, {}),
|
|
11471
|
+
/* @__PURE__ */ jsx23(
|
|
11292
11472
|
chat_input_default,
|
|
11293
11473
|
{
|
|
11294
11474
|
inputValue,
|
|
@@ -11315,24 +11495,12 @@ var ChatContent = () => {
|
|
|
11315
11495
|
]
|
|
11316
11496
|
}
|
|
11317
11497
|
),
|
|
11318
|
-
preferences.feedbackEnabled &&
|
|
11319
|
-
|
|
11320
|
-
{
|
|
11321
|
-
fullScreen: false,
|
|
11322
|
-
zIndex: 1300,
|
|
11323
|
-
feedbackEmail: packageSettings?.feedbackEmail,
|
|
11324
|
-
absolute: true,
|
|
11325
|
-
position: {
|
|
11326
|
-
bottom: 20,
|
|
11327
|
-
right: 20
|
|
11328
|
-
}
|
|
11329
|
-
}
|
|
11330
|
-
),
|
|
11331
|
-
/* @__PURE__ */ jsx22(ConnectionStatus, { position: "top", showWhenGood: false })
|
|
11498
|
+
preferences.feedbackEnabled && /* @__PURE__ */ jsx23(FeedbackPulse_default, { isMobile, feedbackEmail: packageSettings?.feedbackEmail }),
|
|
11499
|
+
/* @__PURE__ */ jsx23(ConnectionStatus, { position: "top", showWhenGood: false })
|
|
11332
11500
|
]
|
|
11333
11501
|
}
|
|
11334
11502
|
),
|
|
11335
|
-
/* @__PURE__ */
|
|
11503
|
+
/* @__PURE__ */ jsx23(canvas_panel_default, { isMobile })
|
|
11336
11504
|
] });
|
|
11337
11505
|
};
|
|
11338
11506
|
var Chat = () => {
|
|
@@ -11358,13 +11526,13 @@ var Chat = () => {
|
|
|
11358
11526
|
});
|
|
11359
11527
|
if (!allowUnauthenticated && !bypassAuth && !authenticationService.isAuthenticated()) {
|
|
11360
11528
|
debugLogger.debug("User is not authenticated, redirecting to login");
|
|
11361
|
-
return /* @__PURE__ */
|
|
11529
|
+
return /* @__PURE__ */ jsx23(Navigate, { to: "/login", replace: true });
|
|
11362
11530
|
}
|
|
11363
|
-
return /* @__PURE__ */
|
|
11531
|
+
return /* @__PURE__ */ jsx23(ChatContent, {});
|
|
11364
11532
|
};
|
|
11365
11533
|
var chat_default = Chat;
|
|
11366
11534
|
|
|
11367
11535
|
export {
|
|
11368
11536
|
chat_default
|
|
11369
11537
|
};
|
|
11370
|
-
//# sourceMappingURL=chunk-
|
|
11538
|
+
//# sourceMappingURL=chunk-POQY66ZJ.mjs.map
|