@burtson-labs/bandit-engine 2.0.118 → 2.0.120
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-RGXA26FO.mjs → chat-QOF3GSGB.mjs} +2 -2
- package/dist/{chunk-RBMHAWU7.mjs → chunk-32R7DYFL.mjs} +776 -594
- package/dist/chunk-32R7DYFL.mjs.map +1 -0
- package/dist/{chunk-YLETAU5Y.mjs → chunk-CVBR7PUH.mjs} +2 -2
- package/dist/index.js +3137 -2940
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/management/management.js +1097 -900
- package/dist/management/management.js.map +1 -1
- package/dist/management/management.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-RBMHAWU7.mjs.map +0 -1
- /package/dist/{chat-RGXA26FO.mjs.map → chat-QOF3GSGB.mjs.map} +0 -0
- /package/dist/{chunk-YLETAU5Y.mjs.map → chunk-CVBR7PUH.mjs.map} +0 -0
|
@@ -21890,6 +21890,172 @@ var init_ask_user_card = __esm({
|
|
|
21890
21890
|
}
|
|
21891
21891
|
});
|
|
21892
21892
|
|
|
21893
|
+
// src/store/rateLimitStore.ts
|
|
21894
|
+
var import_zustand17, useRateLimitStore, parseRateLimitError;
|
|
21895
|
+
var init_rateLimitStore = __esm({
|
|
21896
|
+
"src/store/rateLimitStore.ts"() {
|
|
21897
|
+
"use strict";
|
|
21898
|
+
import_zustand17 = require("zustand");
|
|
21899
|
+
useRateLimitStore = (0, import_zustand17.create)((set) => ({
|
|
21900
|
+
prompt: null,
|
|
21901
|
+
show: (prompt) => set({ prompt }),
|
|
21902
|
+
dismiss: () => set({ prompt: null })
|
|
21903
|
+
}));
|
|
21904
|
+
parseRateLimitError = (error) => {
|
|
21905
|
+
if (!error || typeof error !== "object") {
|
|
21906
|
+
return null;
|
|
21907
|
+
}
|
|
21908
|
+
const response = error.response;
|
|
21909
|
+
const status = response?.status;
|
|
21910
|
+
const data = response?.data;
|
|
21911
|
+
const payload = data && typeof data === "object" ? data : {};
|
|
21912
|
+
const isRateLimited = status === 429 || payload.error === "rate_limited" || payload.upgrade === true;
|
|
21913
|
+
if (!isRateLimited) {
|
|
21914
|
+
return null;
|
|
21915
|
+
}
|
|
21916
|
+
const scope = payload.scope === "weekly" ? "weekly" : "session";
|
|
21917
|
+
const message = typeof payload.message === "string" ? payload.message : void 0;
|
|
21918
|
+
const haystack = `${message ?? ""}`.toLowerCase();
|
|
21919
|
+
const frontier = /frontier|premium|cloud|pro model/.test(haystack);
|
|
21920
|
+
return { scope, message, frontier };
|
|
21921
|
+
};
|
|
21922
|
+
}
|
|
21923
|
+
});
|
|
21924
|
+
|
|
21925
|
+
// src/chat/rate-limit-prompt.tsx
|
|
21926
|
+
var import_react47, import_material40, import_react_router_dom2, import_jsx_runtime40, RateLimitPrompt, rate_limit_prompt_default;
|
|
21927
|
+
var init_rate_limit_prompt = __esm({
|
|
21928
|
+
"src/chat/rate-limit-prompt.tsx"() {
|
|
21929
|
+
"use strict";
|
|
21930
|
+
import_react47 = require("react");
|
|
21931
|
+
import_material40 = require("@mui/material");
|
|
21932
|
+
import_react_router_dom2 = require("react-router-dom");
|
|
21933
|
+
init_lucide_icons();
|
|
21934
|
+
init_rateLimitStore();
|
|
21935
|
+
init_debugLogger();
|
|
21936
|
+
import_jsx_runtime40 = require("react/jsx-runtime");
|
|
21937
|
+
RateLimitPrompt = () => {
|
|
21938
|
+
const theme = (0, import_material40.useTheme)();
|
|
21939
|
+
const prompt = useRateLimitStore((s) => s.prompt);
|
|
21940
|
+
const dismiss = useRateLimitStore((s) => s.dismiss);
|
|
21941
|
+
const hasLoggedRouterWarningRef = (0, import_react47.useRef)(false);
|
|
21942
|
+
let navigate = null;
|
|
21943
|
+
try {
|
|
21944
|
+
navigate = (0, import_react_router_dom2.useNavigate)();
|
|
21945
|
+
} catch (error) {
|
|
21946
|
+
if (!hasLoggedRouterWarningRef.current) {
|
|
21947
|
+
debugLogger.warn("RateLimitPrompt: Navigation not available (missing Router context)", { error });
|
|
21948
|
+
hasLoggedRouterWarningRef.current = true;
|
|
21949
|
+
}
|
|
21950
|
+
navigate = null;
|
|
21951
|
+
}
|
|
21952
|
+
const safeNavigate = (to) => {
|
|
21953
|
+
if (typeof window !== "undefined" && /^https?:\/\//.test(to)) {
|
|
21954
|
+
window.location.href = to;
|
|
21955
|
+
return;
|
|
21956
|
+
}
|
|
21957
|
+
if (navigate) {
|
|
21958
|
+
navigate(to);
|
|
21959
|
+
} else if (typeof window !== "undefined") {
|
|
21960
|
+
window.location.href = to;
|
|
21961
|
+
}
|
|
21962
|
+
};
|
|
21963
|
+
const plansUrl = typeof window !== "undefined" && !(window.location.hostname === "banditailabs.com" || window.location.hostname.endsWith(".banditailabs.com") || window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1") ? "https://banditailabs.com/plans" : "/plans";
|
|
21964
|
+
if (!prompt) {
|
|
21965
|
+
return null;
|
|
21966
|
+
}
|
|
21967
|
+
const { scope, frontier } = prompt;
|
|
21968
|
+
const title = scope === "weekly" ? "You've reached your weekly limit" : "You've hit your session limit";
|
|
21969
|
+
const body = (() => {
|
|
21970
|
+
if (frontier) {
|
|
21971
|
+
return scope === "weekly" ? "You've used your weekly allowance on premium engines. Upgrade to keep chatting on the most capable models." : "You've hit your session limit on premium engines. It resets soon \u2014 or upgrade for higher limits and uninterrupted access.";
|
|
21972
|
+
}
|
|
21973
|
+
return scope === "weekly" ? "Your weekly chat allowance is used up. Upgrade to keep going without waiting." : "It resets shortly. Upgrade for higher limits and keep the conversation flowing.";
|
|
21974
|
+
})();
|
|
21975
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
21976
|
+
import_material40.Box,
|
|
21977
|
+
{
|
|
21978
|
+
role: "status",
|
|
21979
|
+
sx: {
|
|
21980
|
+
mb: 1.5,
|
|
21981
|
+
px: 2,
|
|
21982
|
+
py: 1.5,
|
|
21983
|
+
borderRadius: 2,
|
|
21984
|
+
display: "flex",
|
|
21985
|
+
alignItems: "flex-start",
|
|
21986
|
+
gap: 1.5,
|
|
21987
|
+
border: `1px solid ${theme.palette.primary.main}33`,
|
|
21988
|
+
bgcolor: theme.palette.primary.main + "0F",
|
|
21989
|
+
backdropFilter: "blur(8px)"
|
|
21990
|
+
},
|
|
21991
|
+
children: [
|
|
21992
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
21993
|
+
import_material40.Box,
|
|
21994
|
+
{
|
|
21995
|
+
sx: {
|
|
21996
|
+
mt: 0.25,
|
|
21997
|
+
display: "flex",
|
|
21998
|
+
alignItems: "center",
|
|
21999
|
+
justifyContent: "center",
|
|
22000
|
+
width: 32,
|
|
22001
|
+
height: 32,
|
|
22002
|
+
flexShrink: 0,
|
|
22003
|
+
borderRadius: "50%",
|
|
22004
|
+
bgcolor: theme.palette.primary.main + "22",
|
|
22005
|
+
color: theme.palette.primary.main
|
|
22006
|
+
},
|
|
22007
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(AutoAwesomeIcon, { fontSize: "small" })
|
|
22008
|
+
}
|
|
22009
|
+
),
|
|
22010
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_material40.Box, { sx: { flex: 1, minWidth: 0 }, children: [
|
|
22011
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_material40.Typography, { variant: "subtitle2", sx: { fontWeight: 600, color: theme.palette.text.primary }, children: title }),
|
|
22012
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_material40.Typography, { variant: "body2", sx: { color: theme.palette.text.secondary, mt: 0.25 }, children: body }),
|
|
22013
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_material40.Box, { sx: { display: "flex", gap: 1, mt: 1, flexWrap: "wrap" }, children: [
|
|
22014
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
22015
|
+
import_material40.Button,
|
|
22016
|
+
{
|
|
22017
|
+
size: "small",
|
|
22018
|
+
variant: "contained",
|
|
22019
|
+
disableElevation: true,
|
|
22020
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(AutoAwesomeIcon, { sx: { fontSize: "0.9rem" } }),
|
|
22021
|
+
onClick: () => {
|
|
22022
|
+
dismiss();
|
|
22023
|
+
safeNavigate(plansUrl);
|
|
22024
|
+
},
|
|
22025
|
+
sx: { textTransform: "none", fontWeight: 600, borderRadius: 2 },
|
|
22026
|
+
children: "Upgrade to keep chatting"
|
|
22027
|
+
}
|
|
22028
|
+
),
|
|
22029
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
22030
|
+
import_material40.Button,
|
|
22031
|
+
{
|
|
22032
|
+
size: "small",
|
|
22033
|
+
variant: "text",
|
|
22034
|
+
onClick: () => dismiss(),
|
|
22035
|
+
sx: { textTransform: "none", color: theme.palette.text.secondary },
|
|
22036
|
+
children: scope === "weekly" ? "Maybe later" : "I'll wait"
|
|
22037
|
+
}
|
|
22038
|
+
)
|
|
22039
|
+
] })
|
|
22040
|
+
] }),
|
|
22041
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
22042
|
+
import_material40.IconButton,
|
|
22043
|
+
{
|
|
22044
|
+
size: "small",
|
|
22045
|
+
"aria-label": "Dismiss upgrade prompt",
|
|
22046
|
+
onClick: () => dismiss(),
|
|
22047
|
+
sx: { color: theme.palette.text.secondary, mt: -0.5, mr: -0.5 },
|
|
22048
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(CloseIcon, { fontSize: "small" })
|
|
22049
|
+
}
|
|
22050
|
+
)
|
|
22051
|
+
]
|
|
22052
|
+
}
|
|
22053
|
+
);
|
|
22054
|
+
};
|
|
22055
|
+
rate_limit_prompt_default = RateLimitPrompt;
|
|
22056
|
+
}
|
|
22057
|
+
});
|
|
22058
|
+
|
|
21893
22059
|
// src/services/telemetry/otlpExporter.ts
|
|
21894
22060
|
function redactSecretsString(s) {
|
|
21895
22061
|
return s.replace(/\b(?:sk|tvly|ghp|gho|pk|rk)[-_][A-Za-z0-9]{8,}\b/gi, "[redacted]").replace(/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g, "[redacted-jwt]").replace(/\bBearer\s+[A-Za-z0-9._-]{8,}/gi, "Bearer [redacted]");
|
|
@@ -22215,11 +22381,11 @@ var init_telemetry = __esm({
|
|
|
22215
22381
|
});
|
|
22216
22382
|
|
|
22217
22383
|
// src/store/engineStore.ts
|
|
22218
|
-
var
|
|
22384
|
+
var import_zustand18, STORAGE_KEY2, readStored, useEngineStore;
|
|
22219
22385
|
var init_engineStore = __esm({
|
|
22220
22386
|
"src/store/engineStore.ts"() {
|
|
22221
22387
|
"use strict";
|
|
22222
|
-
|
|
22388
|
+
import_zustand18 = require("zustand");
|
|
22223
22389
|
init_packageSettingsStore();
|
|
22224
22390
|
init_authenticationService();
|
|
22225
22391
|
init_debugLogger();
|
|
@@ -22231,7 +22397,7 @@ var init_engineStore = __esm({
|
|
|
22231
22397
|
return null;
|
|
22232
22398
|
}
|
|
22233
22399
|
};
|
|
22234
|
-
useEngineStore = (0,
|
|
22400
|
+
useEngineStore = (0, import_zustand18.create)((set, get) => ({
|
|
22235
22401
|
selectedEngine: readStored(),
|
|
22236
22402
|
engines: [],
|
|
22237
22403
|
loaded: false,
|
|
@@ -22811,15 +22977,15 @@ The user explicitly asked you to remember this. Respond with a short third-perso
|
|
|
22811
22977
|
});
|
|
22812
22978
|
|
|
22813
22979
|
// src/chat/hooks/useMoodEngine.tsx
|
|
22814
|
-
var
|
|
22980
|
+
var import_react48, useMoodEngine, moodPromptMap;
|
|
22815
22981
|
var init_useMoodEngine = __esm({
|
|
22816
22982
|
"src/chat/hooks/useMoodEngine.tsx"() {
|
|
22817
22983
|
"use strict";
|
|
22818
|
-
|
|
22984
|
+
import_react48 = require("react");
|
|
22819
22985
|
init_prompts();
|
|
22820
22986
|
init_debugLogger();
|
|
22821
22987
|
useMoodEngine = () => {
|
|
22822
|
-
const [mood, setMood] = (0,
|
|
22988
|
+
const [mood, setMood] = (0, import_react48.useState)("neutral");
|
|
22823
22989
|
const analyzeMood = async (message) => {
|
|
22824
22990
|
try {
|
|
22825
22991
|
const detected = await detectMessageMood(message);
|
|
@@ -23033,12 +23199,12 @@ var init_mcp = __esm({
|
|
|
23033
23199
|
});
|
|
23034
23200
|
|
|
23035
23201
|
// src/chat/hooks/useAIProvider.tsx
|
|
23036
|
-
var
|
|
23202
|
+
var import_react49, lightBudget, medBudget, heavyBudget, modelConfigs, PERSONAL_TAG_HINTS, PERSONAL_TOPIC_HINTS, clamp, parseDateToEpoch, normalizeVectorMemory, isPersonalMemory, computeRecencyBoost, computeBoostedScore, formatMemoryLine, prepareAdvancedMemoryContext, useAIProvider;
|
|
23037
23203
|
var init_useAIProvider = __esm({
|
|
23038
23204
|
"src/chat/hooks/useAIProvider.tsx"() {
|
|
23039
23205
|
"use strict";
|
|
23040
23206
|
init_debugLogger();
|
|
23041
|
-
|
|
23207
|
+
import_react49 = require("react");
|
|
23042
23208
|
init_knowledgeStore();
|
|
23043
23209
|
init_aiProviderStore();
|
|
23044
23210
|
init_telemetry();
|
|
@@ -23053,6 +23219,7 @@ var init_useAIProvider = __esm({
|
|
|
23053
23219
|
init_preferencesStore();
|
|
23054
23220
|
init_mcp();
|
|
23055
23221
|
init_askUserStore();
|
|
23222
|
+
init_rateLimitStore();
|
|
23056
23223
|
lightBudget = {
|
|
23057
23224
|
maxTokens: 2048,
|
|
23058
23225
|
memoryTokenBudget: 750,
|
|
@@ -23340,25 +23507,25 @@ var init_useAIProvider = __esm({
|
|
|
23340
23507
|
inputRef,
|
|
23341
23508
|
onError
|
|
23342
23509
|
}) => {
|
|
23343
|
-
const currentSubRef = (0,
|
|
23344
|
-
const lastPartialRef = (0,
|
|
23510
|
+
const currentSubRef = (0, import_react49.useRef)(null);
|
|
23511
|
+
const lastPartialRef = (0, import_react49.useRef)({
|
|
23345
23512
|
text: "",
|
|
23346
23513
|
images: [],
|
|
23347
23514
|
usedDocs: [],
|
|
23348
23515
|
question: ""
|
|
23349
23516
|
});
|
|
23350
|
-
const flushTimerRef = (0,
|
|
23517
|
+
const flushTimerRef = (0, import_react49.useRef)(null);
|
|
23351
23518
|
const { provider } = useAIProviderStore.getState();
|
|
23352
23519
|
const { preferences } = usePreferencesStore.getState();
|
|
23353
23520
|
const { docs } = useKnowledgeStore.getState();
|
|
23354
23521
|
const { analyzeMood, moodTokenBoost } = useMoodEngine();
|
|
23355
23522
|
const { runMemoryScan } = useMemoryEnhancer();
|
|
23356
23523
|
const { isVectorEnabled, searchMemories, searchDocuments, getUserMemories } = useVectorStore();
|
|
23357
|
-
const pinnedVectorCacheRef = (0,
|
|
23524
|
+
const pinnedVectorCacheRef = (0, import_react49.useRef)({
|
|
23358
23525
|
fetchedAt: 0,
|
|
23359
23526
|
memories: []
|
|
23360
23527
|
});
|
|
23361
|
-
const getPinnedVectorMemories = (0,
|
|
23528
|
+
const getPinnedVectorMemories = (0, import_react49.useCallback)(async () => {
|
|
23362
23529
|
if (!isVectorEnabled) {
|
|
23363
23530
|
return [];
|
|
23364
23531
|
}
|
|
@@ -23383,7 +23550,7 @@ var init_useAIProvider = __esm({
|
|
|
23383
23550
|
flushTimerRef.current = null;
|
|
23384
23551
|
}
|
|
23385
23552
|
};
|
|
23386
|
-
const runAIProvider = (0,
|
|
23553
|
+
const runAIProvider = (0, import_react49.useCallback)(
|
|
23387
23554
|
async (systemPrompt, question, images) => {
|
|
23388
23555
|
if (!provider) {
|
|
23389
23556
|
debugLogger.error("No AI provider configured");
|
|
@@ -23400,6 +23567,7 @@ var init_useAIProvider = __esm({
|
|
|
23400
23567
|
setResponse("");
|
|
23401
23568
|
setStreamBuffer("");
|
|
23402
23569
|
clearFlushTimer();
|
|
23570
|
+
useRateLimitStore.getState().dismiss();
|
|
23403
23571
|
const imageList = Array.isArray(images) ? [...images] : [];
|
|
23404
23572
|
const conversationStoreState = useConversationStore.getState();
|
|
23405
23573
|
const { addToCurrent, replaceLastAnswer, conversations, currentId } = conversationStoreState;
|
|
@@ -23916,6 +24084,29 @@ ${protocol}`;
|
|
|
23916
24084
|
overrideComponentStatus("Idle");
|
|
23917
24085
|
setIsSubmitting(false);
|
|
23918
24086
|
setIsStreaming(false);
|
|
24087
|
+
const rateLimit = parseRateLimitError(err);
|
|
24088
|
+
if (rateLimit) {
|
|
24089
|
+
debugLogger.info("Chat hit usage limit (429) \u2014 showing upgrade prompt", {
|
|
24090
|
+
scope: rateLimit.scope,
|
|
24091
|
+
frontier: rateLimit.frontier
|
|
24092
|
+
});
|
|
24093
|
+
const { replaceLastAnswer: replaceLastAnswer2 } = useConversationStore.getState();
|
|
24094
|
+
replaceLastAnswer2(
|
|
24095
|
+
rateLimit.scope === "weekly" ? "_You've reached your weekly limit. Upgrade to keep chatting._" : "_You've hit your session limit. It resets soon \u2014 or upgrade for higher limits._",
|
|
24096
|
+
lastPartialRef.current.images,
|
|
24097
|
+
false,
|
|
24098
|
+
lastPartialRef.current.usedDocs,
|
|
24099
|
+
true
|
|
24100
|
+
);
|
|
24101
|
+
setResponse("");
|
|
24102
|
+
setStreamBuffer("");
|
|
24103
|
+
setIsThinking?.(false);
|
|
24104
|
+
setPendingMessage(null);
|
|
24105
|
+
setLogoVisible(false);
|
|
24106
|
+
useRateLimitStore.getState().show(rateLimit);
|
|
24107
|
+
telemetryEndTurn({ error: "rate_limited" });
|
|
24108
|
+
return;
|
|
24109
|
+
}
|
|
23919
24110
|
flushNow();
|
|
23920
24111
|
let partial = lastPartialRef.current.text || latestDisplayMessage || fullMessage;
|
|
23921
24112
|
if (partial && !partial.trim().endsWith("\u2026") && !partial.trim().endsWith("...")) {
|
|
@@ -24509,11 +24700,11 @@ ${inlineImageBlocks.join("\n\n")}` : "");
|
|
|
24509
24700
|
});
|
|
24510
24701
|
|
|
24511
24702
|
// src/hooks/useAutoScroll.ts
|
|
24512
|
-
var
|
|
24703
|
+
var import_react50, SCROLL_STATE_CHANGED_EVENT, useAutoScroll;
|
|
24513
24704
|
var init_useAutoScroll = __esm({
|
|
24514
24705
|
"src/hooks/useAutoScroll.ts"() {
|
|
24515
24706
|
"use strict";
|
|
24516
|
-
|
|
24707
|
+
import_react50 = require("react");
|
|
24517
24708
|
SCROLL_STATE_CHANGED_EVENT = "scrollStateChanged";
|
|
24518
24709
|
useAutoScroll = (options = {}) => {
|
|
24519
24710
|
const {
|
|
@@ -24522,10 +24713,10 @@ var init_useAutoScroll = __esm({
|
|
|
24522
24713
|
enabled = true,
|
|
24523
24714
|
isMobile = false
|
|
24524
24715
|
} = options;
|
|
24525
|
-
const containerRef = (0,
|
|
24526
|
-
const targetRef = (0,
|
|
24527
|
-
const shouldAutoScrollRef = (0,
|
|
24528
|
-
const isNearBottom = (0,
|
|
24716
|
+
const containerRef = (0, import_react50.useRef)(null);
|
|
24717
|
+
const targetRef = (0, import_react50.useRef)(null);
|
|
24718
|
+
const shouldAutoScrollRef = (0, import_react50.useRef)(true);
|
|
24719
|
+
const isNearBottom = (0, import_react50.useCallback)(() => {
|
|
24529
24720
|
const container = containerRef.current;
|
|
24530
24721
|
if (!container) return true;
|
|
24531
24722
|
const { scrollTop, scrollHeight, clientHeight } = container;
|
|
@@ -24533,7 +24724,7 @@ var init_useAutoScroll = __esm({
|
|
|
24533
24724
|
const effectiveThreshold = Math.max(threshold, 10);
|
|
24534
24725
|
return distanceFromBottom <= effectiveThreshold;
|
|
24535
24726
|
}, [threshold]);
|
|
24536
|
-
const scrollToBottom = (0,
|
|
24727
|
+
const scrollToBottom = (0, import_react50.useCallback)((forceBehavior) => {
|
|
24537
24728
|
if (!enabled) return;
|
|
24538
24729
|
const container = containerRef.current;
|
|
24539
24730
|
if (container) {
|
|
@@ -24560,7 +24751,7 @@ var init_useAutoScroll = __esm({
|
|
|
24560
24751
|
}
|
|
24561
24752
|
}
|
|
24562
24753
|
}, [enabled, behavior, isMobile]);
|
|
24563
|
-
const forceScrollToBottom = (0,
|
|
24754
|
+
const forceScrollToBottom = (0, import_react50.useCallback)(() => {
|
|
24564
24755
|
scrollToBottom("smooth");
|
|
24565
24756
|
const container = containerRef.current;
|
|
24566
24757
|
if (container) {
|
|
@@ -24578,7 +24769,7 @@ var init_useAutoScroll = __esm({
|
|
|
24578
24769
|
rafId = requestAnimationFrame(tick);
|
|
24579
24770
|
}
|
|
24580
24771
|
}, [scrollToBottom, isNearBottom]);
|
|
24581
|
-
const autoScrollIfNeeded = (0,
|
|
24772
|
+
const autoScrollIfNeeded = (0, import_react50.useCallback)(() => {
|
|
24582
24773
|
if (enabled && shouldAutoScrollRef.current && isNearBottom()) {
|
|
24583
24774
|
scrollToBottom();
|
|
24584
24775
|
const container = containerRef.current;
|
|
@@ -24599,7 +24790,7 @@ var init_useAutoScroll = __esm({
|
|
|
24599
24790
|
}
|
|
24600
24791
|
}, [enabled, isNearBottom, scrollToBottom]);
|
|
24601
24792
|
const containerElement = containerRef.current;
|
|
24602
|
-
(0,
|
|
24793
|
+
(0, import_react50.useEffect)(() => {
|
|
24603
24794
|
if (!containerElement) return;
|
|
24604
24795
|
const handleScroll = () => {
|
|
24605
24796
|
const currentlyNearBottom = isNearBottom();
|
|
@@ -24609,10 +24800,10 @@ var init_useAutoScroll = __esm({
|
|
|
24609
24800
|
containerElement.addEventListener("scroll", handleScroll, { passive: true });
|
|
24610
24801
|
return () => containerElement.removeEventListener("scroll", handleScroll);
|
|
24611
24802
|
}, [containerElement, isNearBottom]);
|
|
24612
|
-
(0,
|
|
24803
|
+
(0, import_react50.useEffect)(() => {
|
|
24613
24804
|
autoScrollIfNeeded();
|
|
24614
24805
|
});
|
|
24615
|
-
const getScrollState = (0,
|
|
24806
|
+
const getScrollState = (0, import_react50.useCallback)(() => {
|
|
24616
24807
|
const container = containerRef.current;
|
|
24617
24808
|
if (!container) {
|
|
24618
24809
|
return {
|
|
@@ -24650,24 +24841,24 @@ var init_useAutoScroll = __esm({
|
|
|
24650
24841
|
});
|
|
24651
24842
|
|
|
24652
24843
|
// src/hooks/useNetworkStatus.ts
|
|
24653
|
-
var
|
|
24844
|
+
var import_react51, useNetworkStatus;
|
|
24654
24845
|
var init_useNetworkStatus = __esm({
|
|
24655
24846
|
"src/hooks/useNetworkStatus.ts"() {
|
|
24656
24847
|
"use strict";
|
|
24657
|
-
|
|
24848
|
+
import_react51 = require("react");
|
|
24658
24849
|
useNetworkStatus = () => {
|
|
24659
|
-
const [networkStatus, setNetworkStatus] = (0,
|
|
24850
|
+
const [networkStatus, setNetworkStatus] = (0, import_react51.useState)({
|
|
24660
24851
|
isOnline: navigator.onLine,
|
|
24661
24852
|
isSlowConnection: false,
|
|
24662
24853
|
connectionQuality: "fast",
|
|
24663
24854
|
lastRequestTime: 0
|
|
24664
24855
|
});
|
|
24665
|
-
const trackRequestStart = (0,
|
|
24856
|
+
const trackRequestStart = (0, import_react51.useCallback)(() => {
|
|
24666
24857
|
const startTime = Date.now();
|
|
24667
24858
|
setNetworkStatus((prev) => ({ ...prev, lastRequestTime: startTime }));
|
|
24668
24859
|
return startTime;
|
|
24669
24860
|
}, []);
|
|
24670
|
-
const trackRequestEnd = (0,
|
|
24861
|
+
const trackRequestEnd = (0, import_react51.useCallback)((startTime) => {
|
|
24671
24862
|
const duration = Date.now() - startTime;
|
|
24672
24863
|
const isSlowConnection = duration > 2e3;
|
|
24673
24864
|
setNetworkStatus((prev) => ({
|
|
@@ -24676,7 +24867,7 @@ var init_useNetworkStatus = __esm({
|
|
|
24676
24867
|
connectionQuality: !navigator.onLine ? "offline" : isSlowConnection ? "slow" : "fast"
|
|
24677
24868
|
}));
|
|
24678
24869
|
}, []);
|
|
24679
|
-
(0,
|
|
24870
|
+
(0, import_react51.useEffect)(() => {
|
|
24680
24871
|
const handleOnline = () => {
|
|
24681
24872
|
setNetworkStatus((prev) => ({
|
|
24682
24873
|
...prev,
|
|
@@ -24698,7 +24889,7 @@ var init_useNetworkStatus = __esm({
|
|
|
24698
24889
|
window.removeEventListener("offline", handleOffline);
|
|
24699
24890
|
};
|
|
24700
24891
|
}, []);
|
|
24701
|
-
(0,
|
|
24892
|
+
(0, import_react51.useEffect)(() => {
|
|
24702
24893
|
const { connection } = navigator;
|
|
24703
24894
|
if (connection) {
|
|
24704
24895
|
const updateConnectionInfo = () => {
|
|
@@ -24736,17 +24927,17 @@ var init_useNetworkStatus = __esm({
|
|
|
24736
24927
|
});
|
|
24737
24928
|
|
|
24738
24929
|
// src/chat/project-management-modal.tsx
|
|
24739
|
-
var
|
|
24930
|
+
var import_react52, import_material41, import_lucide_react7, import_styles24, import_jsx_runtime41, DEFAULT_COLORS2, ProjectManagementModal, project_management_modal_default;
|
|
24740
24931
|
var init_project_management_modal = __esm({
|
|
24741
24932
|
"src/chat/project-management-modal.tsx"() {
|
|
24742
24933
|
"use strict";
|
|
24743
|
-
|
|
24744
|
-
|
|
24934
|
+
import_react52 = require("react");
|
|
24935
|
+
import_material41 = require("@mui/material");
|
|
24745
24936
|
import_lucide_react7 = require("lucide-react");
|
|
24746
24937
|
import_styles24 = require("@mui/material/styles");
|
|
24747
24938
|
init_projectStore();
|
|
24748
24939
|
init_conversationStore();
|
|
24749
|
-
|
|
24940
|
+
import_jsx_runtime41 = require("react/jsx-runtime");
|
|
24750
24941
|
DEFAULT_COLORS2 = [
|
|
24751
24942
|
"#2196F3",
|
|
24752
24943
|
"#4CAF50",
|
|
@@ -24764,7 +24955,7 @@ var init_project_management_modal = __esm({
|
|
|
24764
24955
|
onClose
|
|
24765
24956
|
}) => {
|
|
24766
24957
|
const theme = (0, import_styles24.useTheme)();
|
|
24767
|
-
const isMobile = (0,
|
|
24958
|
+
const isMobile = (0, import_material41.useMediaQuery)(theme.breakpoints.down("sm"));
|
|
24768
24959
|
const {
|
|
24769
24960
|
projects,
|
|
24770
24961
|
_hasHydrated,
|
|
@@ -24776,25 +24967,25 @@ var init_project_management_modal = __esm({
|
|
|
24776
24967
|
hydrate
|
|
24777
24968
|
} = useProjectStore();
|
|
24778
24969
|
const { getConversationsByProject } = useConversationStore();
|
|
24779
|
-
const [showCreateForm, setShowCreateForm] = (0,
|
|
24780
|
-
const [editingProject, setEditingProject] = (0,
|
|
24781
|
-
const [formData, setFormData] = (0,
|
|
24970
|
+
const [showCreateForm, setShowCreateForm] = (0, import_react52.useState)(false);
|
|
24971
|
+
const [editingProject, setEditingProject] = (0, import_react52.useState)(null);
|
|
24972
|
+
const [formData, setFormData] = (0, import_react52.useState)({
|
|
24782
24973
|
name: "",
|
|
24783
24974
|
description: "",
|
|
24784
24975
|
instructions: "",
|
|
24785
24976
|
color: DEFAULT_COLORS2[0]
|
|
24786
24977
|
});
|
|
24787
|
-
const [menuAnchor, setMenuAnchor] = (0,
|
|
24788
|
-
const [selectedProject, setSelectedProject] = (0,
|
|
24789
|
-
const [loading, setLoading] = (0,
|
|
24790
|
-
const [error, setError] = (0,
|
|
24791
|
-
const modalContainerRef = (0,
|
|
24792
|
-
(0,
|
|
24978
|
+
const [menuAnchor, setMenuAnchor] = (0, import_react52.useState)(null);
|
|
24979
|
+
const [selectedProject, setSelectedProject] = (0, import_react52.useState)(null);
|
|
24980
|
+
const [loading, setLoading] = (0, import_react52.useState)(false);
|
|
24981
|
+
const [error, setError] = (0, import_react52.useState)(null);
|
|
24982
|
+
const modalContainerRef = (0, import_react52.useRef)(null);
|
|
24983
|
+
(0, import_react52.useEffect)(() => {
|
|
24793
24984
|
if (open && !_hasHydrated) {
|
|
24794
24985
|
hydrate();
|
|
24795
24986
|
}
|
|
24796
24987
|
}, [open, _hasHydrated, hydrate]);
|
|
24797
|
-
(0,
|
|
24988
|
+
(0, import_react52.useEffect)(() => {
|
|
24798
24989
|
if (!open) {
|
|
24799
24990
|
setMenuAnchor(null);
|
|
24800
24991
|
setSelectedProject(null);
|
|
@@ -24904,8 +25095,8 @@ var init_project_management_modal = __esm({
|
|
|
24904
25095
|
const hoverSurface = (0, import_styles24.alpha)(theme.palette.primary.main, theme.palette.mode === "dark" ? 0.22 : 0.08);
|
|
24905
25096
|
const headerTitle = showCreateForm ? editingProject ? "Edit Project" : "Create Project" : "Manage Projects";
|
|
24906
25097
|
const headerSubtitle = showCreateForm ? "Name, describe, and color-code your project." : "Organize conversations into cohesive projects.";
|
|
24907
|
-
const content = /* @__PURE__ */ (0,
|
|
24908
|
-
|
|
25098
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
25099
|
+
import_material41.Box,
|
|
24909
25100
|
{
|
|
24910
25101
|
ref: modalContainerRef,
|
|
24911
25102
|
sx: {
|
|
@@ -24923,8 +25114,8 @@ var init_project_management_modal = __esm({
|
|
|
24923
25114
|
position: "relative"
|
|
24924
25115
|
},
|
|
24925
25116
|
children: [
|
|
24926
|
-
isMobile && /* @__PURE__ */ (0,
|
|
24927
|
-
|
|
25117
|
+
isMobile && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
25118
|
+
import_material41.Box,
|
|
24928
25119
|
{
|
|
24929
25120
|
sx: {
|
|
24930
25121
|
width: 56,
|
|
@@ -24937,8 +25128,8 @@ var init_project_management_modal = __esm({
|
|
|
24937
25128
|
}
|
|
24938
25129
|
}
|
|
24939
25130
|
),
|
|
24940
|
-
/* @__PURE__ */ (0,
|
|
24941
|
-
|
|
25131
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
25132
|
+
import_material41.Box,
|
|
24942
25133
|
{
|
|
24943
25134
|
sx: {
|
|
24944
25135
|
px: isMobile ? 1.5 : 2.75,
|
|
@@ -24950,8 +25141,8 @@ var init_project_management_modal = __esm({
|
|
|
24950
25141
|
gap: 1
|
|
24951
25142
|
},
|
|
24952
25143
|
children: [
|
|
24953
|
-
/* @__PURE__ */ (0,
|
|
24954
|
-
|
|
25144
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
25145
|
+
import_material41.Box,
|
|
24955
25146
|
{
|
|
24956
25147
|
sx: {
|
|
24957
25148
|
display: "flex",
|
|
@@ -24960,8 +25151,8 @@ var init_project_management_modal = __esm({
|
|
|
24960
25151
|
gap: 1
|
|
24961
25152
|
},
|
|
24962
25153
|
children: [
|
|
24963
|
-
/* @__PURE__ */ (0,
|
|
24964
|
-
|
|
25154
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
25155
|
+
import_material41.Box,
|
|
24965
25156
|
{
|
|
24966
25157
|
sx: {
|
|
24967
25158
|
display: "flex",
|
|
@@ -24971,9 +25162,9 @@ var init_project_management_modal = __esm({
|
|
|
24971
25162
|
flex: 1
|
|
24972
25163
|
},
|
|
24973
25164
|
children: [
|
|
24974
|
-
showCreateForm && /* @__PURE__ */ (0,
|
|
24975
|
-
/* @__PURE__ */ (0,
|
|
24976
|
-
|
|
25165
|
+
showCreateForm && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.IconButton, { onClick: resetForm, size: "small", sx: { mr: 0.5 }, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react7.ArrowLeft, { size: 16 }) }),
|
|
25166
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
25167
|
+
import_material41.Typography,
|
|
24977
25168
|
{
|
|
24978
25169
|
variant: "h6",
|
|
24979
25170
|
sx: {
|
|
@@ -24989,16 +25180,16 @@ var init_project_management_modal = __esm({
|
|
|
24989
25180
|
]
|
|
24990
25181
|
}
|
|
24991
25182
|
),
|
|
24992
|
-
/* @__PURE__ */ (0,
|
|
25183
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.IconButton, { onClick: handleClose, size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react7.X, {}) })
|
|
24993
25184
|
]
|
|
24994
25185
|
}
|
|
24995
25186
|
),
|
|
24996
|
-
/* @__PURE__ */ (0,
|
|
25187
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.Typography, { variant: "body2", color: "text.secondary", children: headerSubtitle })
|
|
24997
25188
|
]
|
|
24998
25189
|
}
|
|
24999
25190
|
),
|
|
25000
|
-
/* @__PURE__ */ (0,
|
|
25001
|
-
|
|
25191
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
25192
|
+
import_material41.Box,
|
|
25002
25193
|
{
|
|
25003
25194
|
sx: {
|
|
25004
25195
|
flex: 1,
|
|
@@ -25010,10 +25201,10 @@ var init_project_management_modal = __esm({
|
|
|
25010
25201
|
gap: 2.5
|
|
25011
25202
|
},
|
|
25012
25203
|
children: [
|
|
25013
|
-
error && /* @__PURE__ */ (0,
|
|
25014
|
-
showCreateForm ? /* @__PURE__ */ (0,
|
|
25015
|
-
/* @__PURE__ */ (0,
|
|
25016
|
-
|
|
25204
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.Alert, { severity: "error", onClose: () => setError(null), children: error }),
|
|
25205
|
+
showCreateForm ? /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_material41.Box, { sx: { display: "flex", flexDirection: "column", gap: 2 }, children: [
|
|
25206
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
25207
|
+
import_material41.TextField,
|
|
25017
25208
|
{
|
|
25018
25209
|
label: "Project name",
|
|
25019
25210
|
value: formData.name,
|
|
@@ -25024,8 +25215,8 @@ var init_project_management_modal = __esm({
|
|
|
25024
25215
|
autoFocus: true
|
|
25025
25216
|
}
|
|
25026
25217
|
),
|
|
25027
|
-
/* @__PURE__ */ (0,
|
|
25028
|
-
|
|
25218
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
25219
|
+
import_material41.TextField,
|
|
25029
25220
|
{
|
|
25030
25221
|
label: "Description (optional)",
|
|
25031
25222
|
value: formData.description,
|
|
@@ -25036,8 +25227,8 @@ var init_project_management_modal = __esm({
|
|
|
25036
25227
|
disabled: loading
|
|
25037
25228
|
}
|
|
25038
25229
|
),
|
|
25039
|
-
/* @__PURE__ */ (0,
|
|
25040
|
-
|
|
25230
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
25231
|
+
import_material41.TextField,
|
|
25041
25232
|
{
|
|
25042
25233
|
label: "Project instructions (optional)",
|
|
25043
25234
|
helperText: "Standing context the assistant uses for every chat in this project \u2014 goals, tone, key facts.",
|
|
@@ -25049,10 +25240,10 @@ var init_project_management_modal = __esm({
|
|
|
25049
25240
|
disabled: loading
|
|
25050
25241
|
}
|
|
25051
25242
|
),
|
|
25052
|
-
/* @__PURE__ */ (0,
|
|
25053
|
-
/* @__PURE__ */ (0,
|
|
25054
|
-
/* @__PURE__ */ (0,
|
|
25055
|
-
|
|
25243
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_material41.Box, { children: [
|
|
25244
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.Typography, { variant: "subtitle2", sx: { mb: 1 }, children: "Color" }),
|
|
25245
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.Box, { sx: { display: "flex", flexWrap: "wrap", gap: 1 }, children: DEFAULT_COLORS2.map((color) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
25246
|
+
import_material41.Box,
|
|
25056
25247
|
{
|
|
25057
25248
|
sx: {
|
|
25058
25249
|
width: 32,
|
|
@@ -25072,11 +25263,11 @@ var init_project_management_modal = __esm({
|
|
|
25072
25263
|
color
|
|
25073
25264
|
)) })
|
|
25074
25265
|
] })
|
|
25075
|
-
] }) : /* @__PURE__ */ (0,
|
|
25076
|
-
/* @__PURE__ */ (0,
|
|
25077
|
-
|
|
25266
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_material41.Box, { sx: { display: "flex", flexDirection: "column", gap: 2 }, children: [
|
|
25267
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
25268
|
+
import_material41.Button,
|
|
25078
25269
|
{
|
|
25079
|
-
startIcon: /* @__PURE__ */ (0,
|
|
25270
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react7.Plus, {}),
|
|
25080
25271
|
onClick: () => setShowCreateForm(true),
|
|
25081
25272
|
variant: "contained",
|
|
25082
25273
|
sx: {
|
|
@@ -25088,8 +25279,8 @@ var init_project_management_modal = __esm({
|
|
|
25088
25279
|
children: "Create project"
|
|
25089
25280
|
}
|
|
25090
25281
|
),
|
|
25091
|
-
projects.length === 0 ? /* @__PURE__ */ (0,
|
|
25092
|
-
|
|
25282
|
+
projects.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
25283
|
+
import_material41.Box,
|
|
25093
25284
|
{
|
|
25094
25285
|
sx: {
|
|
25095
25286
|
textAlign: "center",
|
|
@@ -25101,15 +25292,15 @@ var init_project_management_modal = __esm({
|
|
|
25101
25292
|
backgroundColor: subtleSurface
|
|
25102
25293
|
},
|
|
25103
25294
|
children: [
|
|
25104
|
-
/* @__PURE__ */ (0,
|
|
25105
|
-
/* @__PURE__ */ (0,
|
|
25106
|
-
/* @__PURE__ */ (0,
|
|
25295
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react7.Folder, { size: 48, style: { marginBottom: 8, opacity: 0.5 } }),
|
|
25296
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.Typography, { variant: "body1", sx: { fontWeight: 600 }, children: "No projects yet" }),
|
|
25297
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.Typography, { variant: "body2", children: "Create your first project to organize conversations." })
|
|
25107
25298
|
]
|
|
25108
25299
|
}
|
|
25109
|
-
) : /* @__PURE__ */ (0,
|
|
25300
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.List, { sx: { display: "flex", flexDirection: "column", gap: 1.25, py: 0 }, children: projects.map((project) => {
|
|
25110
25301
|
const conversationCount = getConversationsByProject(project.id).length;
|
|
25111
|
-
return /* @__PURE__ */ (0,
|
|
25112
|
-
|
|
25302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.ListItem, { disablePadding: true, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
25303
|
+
import_material41.Box,
|
|
25113
25304
|
{
|
|
25114
25305
|
sx: {
|
|
25115
25306
|
display: "flex",
|
|
@@ -25127,8 +25318,8 @@ var init_project_management_modal = __esm({
|
|
|
25127
25318
|
}
|
|
25128
25319
|
},
|
|
25129
25320
|
children: [
|
|
25130
|
-
/* @__PURE__ */ (0,
|
|
25131
|
-
|
|
25321
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
25322
|
+
import_material41.Avatar,
|
|
25132
25323
|
{
|
|
25133
25324
|
sx: {
|
|
25134
25325
|
bgcolor: project.color,
|
|
@@ -25136,21 +25327,21 @@ var init_project_management_modal = __esm({
|
|
|
25136
25327
|
height: 36,
|
|
25137
25328
|
fontSize: "1rem"
|
|
25138
25329
|
},
|
|
25139
|
-
children: /* @__PURE__ */ (0,
|
|
25330
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react7.Folder, { size: 16 })
|
|
25140
25331
|
}
|
|
25141
25332
|
),
|
|
25142
|
-
/* @__PURE__ */ (0,
|
|
25143
|
-
/* @__PURE__ */ (0,
|
|
25144
|
-
/* @__PURE__ */ (0,
|
|
25145
|
-
|
|
25333
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_material41.Box, { sx: { flex: 1, minWidth: 0 }, children: [
|
|
25334
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_material41.Box, { sx: { display: "flex", alignItems: "center", gap: 1, flexWrap: "wrap" }, children: [
|
|
25335
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
25336
|
+
import_material41.Typography,
|
|
25146
25337
|
{
|
|
25147
25338
|
variant: "subtitle1",
|
|
25148
25339
|
sx: { fontWeight: 600, overflow: "hidden", textOverflow: "ellipsis" },
|
|
25149
25340
|
children: project.name
|
|
25150
25341
|
}
|
|
25151
25342
|
),
|
|
25152
|
-
/* @__PURE__ */ (0,
|
|
25153
|
-
|
|
25343
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
25344
|
+
import_material41.Chip,
|
|
25154
25345
|
{
|
|
25155
25346
|
label: `${conversationCount}`,
|
|
25156
25347
|
size: "small",
|
|
@@ -25164,8 +25355,8 @@ var init_project_management_modal = __esm({
|
|
|
25164
25355
|
}
|
|
25165
25356
|
)
|
|
25166
25357
|
] }),
|
|
25167
|
-
project.description && /* @__PURE__ */ (0,
|
|
25168
|
-
|
|
25358
|
+
project.description && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
25359
|
+
import_material41.Typography,
|
|
25169
25360
|
{
|
|
25170
25361
|
variant: "body2",
|
|
25171
25362
|
color: "text.secondary",
|
|
@@ -25174,8 +25365,8 @@ var init_project_management_modal = __esm({
|
|
|
25174
25365
|
}
|
|
25175
25366
|
)
|
|
25176
25367
|
] }),
|
|
25177
|
-
/* @__PURE__ */ (0,
|
|
25178
|
-
|
|
25368
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
25369
|
+
import_material41.IconButton,
|
|
25179
25370
|
{
|
|
25180
25371
|
onClick: (e) => {
|
|
25181
25372
|
e.stopPropagation();
|
|
@@ -25187,7 +25378,7 @@ var init_project_management_modal = __esm({
|
|
|
25187
25378
|
mt: 0.25,
|
|
25188
25379
|
zIndex: 1
|
|
25189
25380
|
},
|
|
25190
|
-
children: /* @__PURE__ */ (0,
|
|
25381
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react7.MoreVertical, { size: 16 })
|
|
25191
25382
|
}
|
|
25192
25383
|
)
|
|
25193
25384
|
]
|
|
@@ -25198,8 +25389,8 @@ var init_project_management_modal = __esm({
|
|
|
25198
25389
|
]
|
|
25199
25390
|
}
|
|
25200
25391
|
),
|
|
25201
|
-
/* @__PURE__ */ (0,
|
|
25202
|
-
|
|
25392
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
25393
|
+
import_material41.Box,
|
|
25203
25394
|
{
|
|
25204
25395
|
sx: {
|
|
25205
25396
|
px: isMobile ? 1.5 : 2.75,
|
|
@@ -25209,9 +25400,9 @@ var init_project_management_modal = __esm({
|
|
|
25209
25400
|
justifyContent: "flex-end",
|
|
25210
25401
|
gap: 1
|
|
25211
25402
|
},
|
|
25212
|
-
children: showCreateForm ? /* @__PURE__ */ (0,
|
|
25213
|
-
/* @__PURE__ */ (0,
|
|
25214
|
-
|
|
25403
|
+
children: showCreateForm ? /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
|
|
25404
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
25405
|
+
import_material41.Button,
|
|
25215
25406
|
{
|
|
25216
25407
|
onClick: resetForm,
|
|
25217
25408
|
disabled: loading,
|
|
@@ -25219,22 +25410,22 @@ var init_project_management_modal = __esm({
|
|
|
25219
25410
|
children: "Cancel"
|
|
25220
25411
|
}
|
|
25221
25412
|
),
|
|
25222
|
-
/* @__PURE__ */ (0,
|
|
25223
|
-
|
|
25413
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
25414
|
+
import_material41.Button,
|
|
25224
25415
|
{
|
|
25225
25416
|
onClick: editingProject ? handleEditProject : handleCreateProject,
|
|
25226
25417
|
variant: "contained",
|
|
25227
25418
|
disabled: loading,
|
|
25228
|
-
startIcon: loading ? /* @__PURE__ */ (0,
|
|
25419
|
+
startIcon: loading ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.CircularProgress, { size: 16 }) : void 0,
|
|
25229
25420
|
sx: { textTransform: "none", borderRadius: 2 },
|
|
25230
25421
|
children: editingProject ? "Update project" : "Create project"
|
|
25231
25422
|
}
|
|
25232
25423
|
)
|
|
25233
|
-
] }) : /* @__PURE__ */ (0,
|
|
25424
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.Button, { onClick: handleClose, sx: { textTransform: "none", borderRadius: 2 }, children: "Close" })
|
|
25234
25425
|
}
|
|
25235
25426
|
),
|
|
25236
|
-
/* @__PURE__ */ (0,
|
|
25237
|
-
|
|
25427
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
25428
|
+
import_material41.Menu,
|
|
25238
25429
|
{
|
|
25239
25430
|
anchorEl: menuAnchor,
|
|
25240
25431
|
open: Boolean(menuAnchor),
|
|
@@ -25255,30 +25446,30 @@ var init_project_management_modal = __esm({
|
|
|
25255
25446
|
}
|
|
25256
25447
|
},
|
|
25257
25448
|
children: [
|
|
25258
|
-
/* @__PURE__ */ (0,
|
|
25259
|
-
|
|
25449
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
25450
|
+
import_material41.MenuItem,
|
|
25260
25451
|
{
|
|
25261
25452
|
onClick: () => {
|
|
25262
25453
|
if (!selectedProject) return;
|
|
25263
25454
|
startEdit(selectedProject);
|
|
25264
25455
|
},
|
|
25265
|
-
children: /* @__PURE__ */ (0,
|
|
25266
|
-
/* @__PURE__ */ (0,
|
|
25267
|
-
/* @__PURE__ */ (0,
|
|
25456
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_material41.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
25457
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react7.Pencil, { size: 16 }),
|
|
25458
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.Typography, { variant: "body2", color: "inherit", children: "Edit" })
|
|
25268
25459
|
] })
|
|
25269
25460
|
}
|
|
25270
25461
|
),
|
|
25271
|
-
/* @__PURE__ */ (0,
|
|
25272
|
-
|
|
25462
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
25463
|
+
import_material41.MenuItem,
|
|
25273
25464
|
{
|
|
25274
25465
|
onClick: () => {
|
|
25275
25466
|
if (!selectedProject) return;
|
|
25276
25467
|
handleDeleteProject(selectedProject);
|
|
25277
25468
|
},
|
|
25278
25469
|
sx: { color: theme.palette.error.main },
|
|
25279
|
-
children: /* @__PURE__ */ (0,
|
|
25280
|
-
/* @__PURE__ */ (0,
|
|
25281
|
-
/* @__PURE__ */ (0,
|
|
25470
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_material41.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
25471
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react7.Trash2, { size: 16 }),
|
|
25472
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.Typography, { variant: "body2", color: "inherit", children: "Delete" })
|
|
25282
25473
|
] })
|
|
25283
25474
|
}
|
|
25284
25475
|
)
|
|
@@ -25288,8 +25479,8 @@ var init_project_management_modal = __esm({
|
|
|
25288
25479
|
]
|
|
25289
25480
|
}
|
|
25290
25481
|
);
|
|
25291
|
-
return /* @__PURE__ */ (0,
|
|
25292
|
-
|
|
25482
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_jsx_runtime41.Fragment, { children: isMobile ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
25483
|
+
import_material41.SwipeableDrawer,
|
|
25293
25484
|
{
|
|
25294
25485
|
anchor: "bottom",
|
|
25295
25486
|
open,
|
|
@@ -25308,8 +25499,8 @@ var init_project_management_modal = __esm({
|
|
|
25308
25499
|
},
|
|
25309
25500
|
children: content
|
|
25310
25501
|
}
|
|
25311
|
-
) : /* @__PURE__ */ (0,
|
|
25312
|
-
|
|
25502
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
25503
|
+
import_material41.Modal,
|
|
25313
25504
|
{
|
|
25314
25505
|
open,
|
|
25315
25506
|
onClose: handleClose,
|
|
@@ -25329,18 +25520,18 @@ var init_project_management_modal = __esm({
|
|
|
25329
25520
|
});
|
|
25330
25521
|
|
|
25331
25522
|
// src/chat/move-conversation-modal.tsx
|
|
25332
|
-
var
|
|
25523
|
+
var import_react53, import_material42, import_lucide_react8, import_styles25, import_jsx_runtime42, MoveConversationModal, move_conversation_modal_default;
|
|
25333
25524
|
var init_move_conversation_modal = __esm({
|
|
25334
25525
|
"src/chat/move-conversation-modal.tsx"() {
|
|
25335
25526
|
"use strict";
|
|
25336
|
-
|
|
25337
|
-
|
|
25527
|
+
import_react53 = require("react");
|
|
25528
|
+
import_material42 = require("@mui/material");
|
|
25338
25529
|
import_lucide_react8 = require("lucide-react");
|
|
25339
25530
|
import_styles25 = require("@mui/material/styles");
|
|
25340
25531
|
init_projectStore();
|
|
25341
25532
|
init_conversationStore();
|
|
25342
25533
|
init_debugLogger();
|
|
25343
|
-
|
|
25534
|
+
import_jsx_runtime42 = require("react/jsx-runtime");
|
|
25344
25535
|
MoveConversationModal = ({
|
|
25345
25536
|
open,
|
|
25346
25537
|
onClose,
|
|
@@ -25350,15 +25541,15 @@ var init_move_conversation_modal = __esm({
|
|
|
25350
25541
|
const theme = (0, import_styles25.useTheme)();
|
|
25351
25542
|
const { projects, _hasHydrated, hydrate } = useProjectStore();
|
|
25352
25543
|
const { moveConversationToProject } = useConversationStore();
|
|
25353
|
-
const [selectedProjectId, setSelectedProjectId] = (0,
|
|
25544
|
+
const [selectedProjectId, setSelectedProjectId] = (0, import_react53.useState)(
|
|
25354
25545
|
currentProjectId
|
|
25355
25546
|
);
|
|
25356
|
-
(0,
|
|
25547
|
+
(0, import_react53.useEffect)(() => {
|
|
25357
25548
|
if (open && !_hasHydrated) {
|
|
25358
25549
|
hydrate();
|
|
25359
25550
|
}
|
|
25360
25551
|
}, [open, _hasHydrated, hydrate]);
|
|
25361
|
-
(0,
|
|
25552
|
+
(0, import_react53.useEffect)(() => {
|
|
25362
25553
|
setSelectedProjectId(currentProjectId);
|
|
25363
25554
|
}, [currentProjectId, open]);
|
|
25364
25555
|
const handleMove = async () => {
|
|
@@ -25377,8 +25568,8 @@ var init_move_conversation_modal = __esm({
|
|
|
25377
25568
|
};
|
|
25378
25569
|
const conversationCount = conversations.length;
|
|
25379
25570
|
const isMultiple = conversationCount > 1;
|
|
25380
|
-
return /* @__PURE__ */ (0,
|
|
25381
|
-
|
|
25571
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
25572
|
+
import_material42.Dialog,
|
|
25382
25573
|
{
|
|
25383
25574
|
open,
|
|
25384
25575
|
onClose,
|
|
@@ -25391,40 +25582,40 @@ var init_move_conversation_modal = __esm({
|
|
|
25391
25582
|
}
|
|
25392
25583
|
},
|
|
25393
25584
|
children: [
|
|
25394
|
-
/* @__PURE__ */ (0,
|
|
25585
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.DialogTitle, { children: [
|
|
25395
25586
|
"Move ",
|
|
25396
25587
|
isMultiple ? `${conversationCount} Conversations` : "Conversation"
|
|
25397
25588
|
] }),
|
|
25398
|
-
/* @__PURE__ */ (0,
|
|
25399
|
-
/* @__PURE__ */ (0,
|
|
25400
|
-
/* @__PURE__ */ (0,
|
|
25401
|
-
/* @__PURE__ */ (0,
|
|
25402
|
-
|
|
25589
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.DialogContent, { sx: { px: 3 }, children: [
|
|
25590
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Typography, { variant: "body2", color: "text.secondary", sx: { mb: 2 }, children: isMultiple ? `Select a project to move ${conversationCount} conversations to:` : `Select a project to move "${conversations[0]?.name}" to:` }),
|
|
25591
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.List, { children: [
|
|
25592
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.ListItem, { disablePadding: true, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
25593
|
+
import_material42.ListItemButton,
|
|
25403
25594
|
{
|
|
25404
25595
|
onClick: () => setSelectedProjectId(null),
|
|
25405
25596
|
selected: selectedProjectId === null,
|
|
25406
25597
|
children: [
|
|
25407
|
-
/* @__PURE__ */ (0,
|
|
25408
|
-
|
|
25598
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
25599
|
+
import_material42.Radio,
|
|
25409
25600
|
{
|
|
25410
25601
|
checked: selectedProjectId === null,
|
|
25411
25602
|
onChange: () => setSelectedProjectId(null),
|
|
25412
25603
|
size: "small"
|
|
25413
25604
|
}
|
|
25414
25605
|
) }),
|
|
25415
|
-
/* @__PURE__ */ (0,
|
|
25416
|
-
|
|
25606
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
25607
|
+
import_material42.Avatar,
|
|
25417
25608
|
{
|
|
25418
25609
|
sx: {
|
|
25419
25610
|
bgcolor: theme.palette.grey[400],
|
|
25420
25611
|
width: 32,
|
|
25421
25612
|
height: 32
|
|
25422
25613
|
},
|
|
25423
|
-
children: /* @__PURE__ */ (0,
|
|
25614
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react8.Inbox, {})
|
|
25424
25615
|
}
|
|
25425
25616
|
) }),
|
|
25426
|
-
/* @__PURE__ */ (0,
|
|
25427
|
-
|
|
25617
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
25618
|
+
import_material42.ListItemText,
|
|
25428
25619
|
{
|
|
25429
25620
|
primary: "No Project",
|
|
25430
25621
|
secondary: "Keep conversations ungrouped"
|
|
@@ -25433,34 +25624,34 @@ var init_move_conversation_modal = __esm({
|
|
|
25433
25624
|
]
|
|
25434
25625
|
}
|
|
25435
25626
|
) }),
|
|
25436
|
-
/* @__PURE__ */ (0,
|
|
25437
|
-
projects.map((project) => /* @__PURE__ */ (0,
|
|
25438
|
-
|
|
25627
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Divider, { sx: { my: 1 } }),
|
|
25628
|
+
projects.map((project) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.ListItem, { disablePadding: true, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
25629
|
+
import_material42.ListItemButton,
|
|
25439
25630
|
{
|
|
25440
25631
|
onClick: () => setSelectedProjectId(project.id),
|
|
25441
25632
|
selected: selectedProjectId === project.id,
|
|
25442
25633
|
children: [
|
|
25443
|
-
/* @__PURE__ */ (0,
|
|
25444
|
-
|
|
25634
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
25635
|
+
import_material42.Radio,
|
|
25445
25636
|
{
|
|
25446
25637
|
checked: selectedProjectId === project.id,
|
|
25447
25638
|
onChange: () => setSelectedProjectId(project.id),
|
|
25448
25639
|
size: "small"
|
|
25449
25640
|
}
|
|
25450
25641
|
) }),
|
|
25451
|
-
/* @__PURE__ */ (0,
|
|
25452
|
-
|
|
25642
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
25643
|
+
import_material42.Avatar,
|
|
25453
25644
|
{
|
|
25454
25645
|
sx: {
|
|
25455
25646
|
bgcolor: project.color,
|
|
25456
25647
|
width: 32,
|
|
25457
25648
|
height: 32
|
|
25458
25649
|
},
|
|
25459
|
-
children: /* @__PURE__ */ (0,
|
|
25650
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react8.Folder, {})
|
|
25460
25651
|
}
|
|
25461
25652
|
) }),
|
|
25462
|
-
/* @__PURE__ */ (0,
|
|
25463
|
-
|
|
25653
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
25654
|
+
import_material42.ListItemText,
|
|
25464
25655
|
{
|
|
25465
25656
|
primary: project.name,
|
|
25466
25657
|
secondary: project.description
|
|
@@ -25469,17 +25660,17 @@ var init_move_conversation_modal = __esm({
|
|
|
25469
25660
|
]
|
|
25470
25661
|
}
|
|
25471
25662
|
) }, project.id)),
|
|
25472
|
-
projects.length === 0 && /* @__PURE__ */ (0,
|
|
25663
|
+
projects.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Box, { sx: {
|
|
25473
25664
|
textAlign: "center",
|
|
25474
25665
|
py: 2,
|
|
25475
25666
|
color: theme.palette.text.secondary
|
|
25476
|
-
}, children: /* @__PURE__ */ (0,
|
|
25667
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Typography, { variant: "body2", children: "No projects available. Create a project first to organize conversations." }) })
|
|
25477
25668
|
] })
|
|
25478
25669
|
] }),
|
|
25479
|
-
/* @__PURE__ */ (0,
|
|
25480
|
-
/* @__PURE__ */ (0,
|
|
25481
|
-
/* @__PURE__ */ (0,
|
|
25482
|
-
|
|
25670
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.DialogActions, { sx: { px: 3, pb: 2 }, children: [
|
|
25671
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Button, { onClick: onClose, children: "Cancel" }),
|
|
25672
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
25673
|
+
import_material42.Button,
|
|
25483
25674
|
{
|
|
25484
25675
|
onClick: handleMove,
|
|
25485
25676
|
variant: "contained",
|
|
@@ -25500,15 +25691,15 @@ var init_move_conversation_modal = __esm({
|
|
|
25500
25691
|
});
|
|
25501
25692
|
|
|
25502
25693
|
// src/chat/simple-conversation-item.tsx
|
|
25503
|
-
var
|
|
25694
|
+
var import_react54, import_material43, import_lucide_react9, import_styles26, import_jsx_runtime43, SimpleConversationItem, simple_conversation_item_default;
|
|
25504
25695
|
var init_simple_conversation_item = __esm({
|
|
25505
25696
|
"src/chat/simple-conversation-item.tsx"() {
|
|
25506
25697
|
"use strict";
|
|
25507
|
-
|
|
25508
|
-
|
|
25698
|
+
import_react54 = require("react");
|
|
25699
|
+
import_material43 = require("@mui/material");
|
|
25509
25700
|
import_lucide_react9 = require("lucide-react");
|
|
25510
25701
|
import_styles26 = require("@mui/material/styles");
|
|
25511
|
-
|
|
25702
|
+
import_jsx_runtime43 = require("react/jsx-runtime");
|
|
25512
25703
|
SimpleConversationItem = ({
|
|
25513
25704
|
conversation,
|
|
25514
25705
|
isSelected,
|
|
@@ -25525,17 +25716,17 @@ var init_simple_conversation_item = __esm({
|
|
|
25525
25716
|
isTouchDragActive
|
|
25526
25717
|
}) => {
|
|
25527
25718
|
const theme = (0, import_styles26.useTheme)();
|
|
25528
|
-
const isMobile = (0,
|
|
25529
|
-
const [anchorEl, setAnchorEl] = (0,
|
|
25530
|
-
const [isEditing, setIsEditing] = (0,
|
|
25531
|
-
const [editName, setEditName] = (0,
|
|
25532
|
-
const [isDragging, setIsDragging] = (0,
|
|
25533
|
-
const [isTouchDragging, setIsTouchDragging] = (0,
|
|
25534
|
-
const [showRenameDialog, setShowRenameDialog] = (0,
|
|
25535
|
-
const longPressTimeoutRef = (0,
|
|
25536
|
-
const touchStartPointRef = (0,
|
|
25537
|
-
const activeTouchIdRef = (0,
|
|
25538
|
-
const suppressClickRef = (0,
|
|
25719
|
+
const isMobile = (0, import_material43.useMediaQuery)(theme.breakpoints.down("sm"));
|
|
25720
|
+
const [anchorEl, setAnchorEl] = (0, import_react54.useState)(null);
|
|
25721
|
+
const [isEditing, setIsEditing] = (0, import_react54.useState)(false);
|
|
25722
|
+
const [editName, setEditName] = (0, import_react54.useState)(conversation.name);
|
|
25723
|
+
const [isDragging, setIsDragging] = (0, import_react54.useState)(false);
|
|
25724
|
+
const [isTouchDragging, setIsTouchDragging] = (0, import_react54.useState)(false);
|
|
25725
|
+
const [showRenameDialog, setShowRenameDialog] = (0, import_react54.useState)(false);
|
|
25726
|
+
const longPressTimeoutRef = (0, import_react54.useRef)(null);
|
|
25727
|
+
const touchStartPointRef = (0, import_react54.useRef)(null);
|
|
25728
|
+
const activeTouchIdRef = (0, import_react54.useRef)(null);
|
|
25729
|
+
const suppressClickRef = (0, import_react54.useRef)(false);
|
|
25539
25730
|
const highlightText = (text, query) => {
|
|
25540
25731
|
if (!query || !query.trim()) {
|
|
25541
25732
|
return text;
|
|
@@ -25543,8 +25734,8 @@ var init_simple_conversation_item = __esm({
|
|
|
25543
25734
|
const regex = new RegExp(`(${query.trim()})`, "gi");
|
|
25544
25735
|
const parts = text.split(regex);
|
|
25545
25736
|
return parts.map(
|
|
25546
|
-
(part, index) => regex.test(part) ? /* @__PURE__ */ (0,
|
|
25547
|
-
|
|
25737
|
+
(part, index) => regex.test(part) ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
25738
|
+
import_material43.Box,
|
|
25548
25739
|
{
|
|
25549
25740
|
component: "span",
|
|
25550
25741
|
sx: {
|
|
@@ -25674,14 +25865,14 @@ var init_simple_conversation_item = __esm({
|
|
|
25674
25865
|
if (!isMobile) return;
|
|
25675
25866
|
finalizeTouchDrag();
|
|
25676
25867
|
};
|
|
25677
|
-
(0,
|
|
25868
|
+
(0, import_react54.useEffect)(() => {
|
|
25678
25869
|
if (!isTouchDragActive && isTouchDragging) {
|
|
25679
25870
|
setIsTouchDragging(false);
|
|
25680
25871
|
}
|
|
25681
25872
|
}, [isTouchDragActive, isTouchDragging]);
|
|
25682
|
-
return /* @__PURE__ */ (0,
|
|
25683
|
-
/* @__PURE__ */ (0,
|
|
25684
|
-
|
|
25873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
|
|
25874
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
25875
|
+
import_material43.Box,
|
|
25685
25876
|
{
|
|
25686
25877
|
"data-project-id": conversation.projectId ?? "__ungrouped",
|
|
25687
25878
|
draggable: !isMobile && !isEditing,
|
|
@@ -25733,7 +25924,7 @@ var init_simple_conversation_item = __esm({
|
|
|
25733
25924
|
}
|
|
25734
25925
|
},
|
|
25735
25926
|
children: [
|
|
25736
|
-
!isMobile && !isEditing && /* @__PURE__ */ (0,
|
|
25927
|
+
!isMobile && !isEditing && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
25737
25928
|
import_lucide_react9.GripVertical,
|
|
25738
25929
|
{
|
|
25739
25930
|
size: 16,
|
|
@@ -25741,9 +25932,9 @@ var init_simple_conversation_item = __esm({
|
|
|
25741
25932
|
style: { marginRight: 4, cursor: "grab" }
|
|
25742
25933
|
}
|
|
25743
25934
|
),
|
|
25744
|
-
/* @__PURE__ */ (0,
|
|
25745
|
-
isEditing ? /* @__PURE__ */ (0,
|
|
25746
|
-
|
|
25935
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_material43.Box, { sx: { flex: 1, minWidth: 0 }, children: [
|
|
25936
|
+
isEditing ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
25937
|
+
import_material43.TextField,
|
|
25747
25938
|
{
|
|
25748
25939
|
value: editName,
|
|
25749
25940
|
onChange: (e) => setEditName(e.target.value),
|
|
@@ -25765,8 +25956,8 @@ var init_simple_conversation_item = __esm({
|
|
|
25765
25956
|
}
|
|
25766
25957
|
}
|
|
25767
25958
|
}
|
|
25768
|
-
) : /* @__PURE__ */ (0,
|
|
25769
|
-
|
|
25959
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
25960
|
+
import_material43.Typography,
|
|
25770
25961
|
{
|
|
25771
25962
|
variant: "body2",
|
|
25772
25963
|
sx: {
|
|
@@ -25780,8 +25971,8 @@ var init_simple_conversation_item = __esm({
|
|
|
25780
25971
|
children: highlightText(conversation.name, searchQuery)
|
|
25781
25972
|
}
|
|
25782
25973
|
),
|
|
25783
|
-
!isEditing && snippet && /* @__PURE__ */ (0,
|
|
25784
|
-
|
|
25974
|
+
!isEditing && snippet && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
25975
|
+
import_material43.Typography,
|
|
25785
25976
|
{
|
|
25786
25977
|
variant: "caption",
|
|
25787
25978
|
sx: {
|
|
@@ -25799,8 +25990,8 @@ var init_simple_conversation_item = __esm({
|
|
|
25799
25990
|
}
|
|
25800
25991
|
)
|
|
25801
25992
|
] }),
|
|
25802
|
-
!isEditing && /* @__PURE__ */ (0,
|
|
25803
|
-
|
|
25993
|
+
!isEditing && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
25994
|
+
import_material43.IconButton,
|
|
25804
25995
|
{
|
|
25805
25996
|
onClick: handleMenuOpen,
|
|
25806
25997
|
size: "small",
|
|
@@ -25828,11 +26019,11 @@ var init_simple_conversation_item = __esm({
|
|
|
25828
26019
|
}
|
|
25829
26020
|
}
|
|
25830
26021
|
},
|
|
25831
|
-
children: /* @__PURE__ */ (0,
|
|
26022
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react9.MoreVertical, { size: 16 })
|
|
25832
26023
|
}
|
|
25833
26024
|
),
|
|
25834
|
-
/* @__PURE__ */ (0,
|
|
25835
|
-
|
|
26025
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
26026
|
+
import_material43.Menu,
|
|
25836
26027
|
{
|
|
25837
26028
|
anchorEl,
|
|
25838
26029
|
open: Boolean(anchorEl),
|
|
@@ -25858,17 +26049,17 @@ var init_simple_conversation_item = __esm({
|
|
|
25858
26049
|
}
|
|
25859
26050
|
},
|
|
25860
26051
|
children: [
|
|
25861
|
-
onRename && /* @__PURE__ */ (0,
|
|
25862
|
-
/* @__PURE__ */ (0,
|
|
25863
|
-
/* @__PURE__ */ (0,
|
|
26052
|
+
onRename && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_material43.MenuItem, { onClick: handleEdit, children: [
|
|
26053
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react9.Pencil, { size: 16 }) }),
|
|
26054
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.ListItemText, { children: "Rename" })
|
|
25864
26055
|
] }),
|
|
25865
|
-
onMove && /* @__PURE__ */ (0,
|
|
25866
|
-
/* @__PURE__ */ (0,
|
|
25867
|
-
/* @__PURE__ */ (0,
|
|
26056
|
+
onMove && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_material43.MenuItem, { onClick: handleMove, children: [
|
|
26057
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react9.MailOpen, { size: 16 }) }),
|
|
26058
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.ListItemText, { children: "Move to Project" })
|
|
25868
26059
|
] }),
|
|
25869
|
-
/* @__PURE__ */ (0,
|
|
25870
|
-
/* @__PURE__ */ (0,
|
|
25871
|
-
/* @__PURE__ */ (0,
|
|
26060
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_material43.MenuItem, { onClick: handleDelete, children: [
|
|
26061
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react9.Trash2, { size: 16 }) }),
|
|
26062
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.ListItemText, { children: "Delete" })
|
|
25872
26063
|
] })
|
|
25873
26064
|
]
|
|
25874
26065
|
}
|
|
@@ -25876,8 +26067,8 @@ var init_simple_conversation_item = __esm({
|
|
|
25876
26067
|
]
|
|
25877
26068
|
}
|
|
25878
26069
|
),
|
|
25879
|
-
isMobile && /* @__PURE__ */ (0,
|
|
25880
|
-
|
|
26070
|
+
isMobile && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
26071
|
+
import_material43.Dialog,
|
|
25881
26072
|
{
|
|
25882
26073
|
open: showRenameDialog,
|
|
25883
26074
|
onClose: () => {
|
|
@@ -25892,9 +26083,9 @@ var init_simple_conversation_item = __esm({
|
|
|
25892
26083
|
}
|
|
25893
26084
|
},
|
|
25894
26085
|
children: [
|
|
25895
|
-
/* @__PURE__ */ (0,
|
|
25896
|
-
/* @__PURE__ */ (0,
|
|
25897
|
-
|
|
26086
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.DialogTitle, { sx: { pb: 1 }, children: "Rename Conversation" }),
|
|
26087
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.DialogContent, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
26088
|
+
import_material43.TextField,
|
|
25898
26089
|
{
|
|
25899
26090
|
value: editName,
|
|
25900
26091
|
onChange: (e) => setEditName(e.target.value),
|
|
@@ -25906,9 +26097,9 @@ var init_simple_conversation_item = __esm({
|
|
|
25906
26097
|
}
|
|
25907
26098
|
}
|
|
25908
26099
|
) }),
|
|
25909
|
-
/* @__PURE__ */ (0,
|
|
25910
|
-
/* @__PURE__ */ (0,
|
|
25911
|
-
|
|
26100
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_material43.DialogActions, { sx: { px: 3, pb: 2 }, children: [
|
|
26101
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
26102
|
+
import_material43.Button,
|
|
25912
26103
|
{
|
|
25913
26104
|
onClick: () => {
|
|
25914
26105
|
setShowRenameDialog(false);
|
|
@@ -25917,8 +26108,8 @@ var init_simple_conversation_item = __esm({
|
|
|
25917
26108
|
children: "Cancel"
|
|
25918
26109
|
}
|
|
25919
26110
|
),
|
|
25920
|
-
/* @__PURE__ */ (0,
|
|
25921
|
-
|
|
26111
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
26112
|
+
import_material43.Button,
|
|
25922
26113
|
{
|
|
25923
26114
|
onClick: () => {
|
|
25924
26115
|
commitRename();
|
|
@@ -25940,18 +26131,18 @@ var init_simple_conversation_item = __esm({
|
|
|
25940
26131
|
});
|
|
25941
26132
|
|
|
25942
26133
|
// src/chat/project-header.tsx
|
|
25943
|
-
var
|
|
26134
|
+
var import_react55, import_material44, import_lucide_react10, import_styles27, import_jsx_runtime44, ProjectHeader, project_header_default;
|
|
25944
26135
|
var init_project_header = __esm({
|
|
25945
26136
|
"src/chat/project-header.tsx"() {
|
|
25946
26137
|
"use strict";
|
|
25947
|
-
|
|
25948
|
-
|
|
26138
|
+
import_react55 = require("react");
|
|
26139
|
+
import_material44 = require("@mui/material");
|
|
25949
26140
|
import_lucide_react10 = require("lucide-react");
|
|
25950
26141
|
import_styles27 = require("@mui/material/styles");
|
|
25951
26142
|
init_conversationStore();
|
|
25952
26143
|
init_projectStore();
|
|
25953
26144
|
init_debugLogger();
|
|
25954
|
-
|
|
26145
|
+
import_jsx_runtime44 = require("react/jsx-runtime");
|
|
25955
26146
|
ProjectHeader = ({
|
|
25956
26147
|
projectId,
|
|
25957
26148
|
projectName,
|
|
@@ -25968,10 +26159,10 @@ var init_project_header = __esm({
|
|
|
25968
26159
|
const theme = (0, import_styles27.useTheme)();
|
|
25969
26160
|
const { createNewConversation } = useConversationStore();
|
|
25970
26161
|
const { renameProject } = useProjectStore();
|
|
25971
|
-
const [isHovered, setIsHovered] = (0,
|
|
25972
|
-
const [isDragOver, setIsDragOver] = (0,
|
|
25973
|
-
const [renameDraft, setRenameDraft] = (0,
|
|
25974
|
-
const renameActionRef = (0,
|
|
26162
|
+
const [isHovered, setIsHovered] = (0, import_react55.useState)(false);
|
|
26163
|
+
const [isDragOver, setIsDragOver] = (0, import_react55.useState)(false);
|
|
26164
|
+
const [renameDraft, setRenameDraft] = (0, import_react55.useState)(projectName);
|
|
26165
|
+
const renameActionRef = (0, import_react55.useRef)("none");
|
|
25975
26166
|
const isUngrouped = projectId === null;
|
|
25976
26167
|
const Icon = isCollapsed ? import_lucide_react10.Folder : import_lucide_react10.FolderOpen;
|
|
25977
26168
|
const handleAddConversation = (e) => {
|
|
@@ -26017,8 +26208,8 @@ var init_project_header = __esm({
|
|
|
26017
26208
|
setRenameDraft(projectName);
|
|
26018
26209
|
onRenameComplete?.();
|
|
26019
26210
|
};
|
|
26020
|
-
return /* @__PURE__ */ (0,
|
|
26021
|
-
|
|
26211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
26212
|
+
import_material44.Box,
|
|
26022
26213
|
{
|
|
26023
26214
|
"data-project-id": projectId ?? "__ungrouped",
|
|
26024
26215
|
onMouseEnter: () => setIsHovered(true),
|
|
@@ -26034,37 +26225,37 @@ var init_project_header = __esm({
|
|
|
26034
26225
|
py: 1.5,
|
|
26035
26226
|
cursor: isUngrouped ? "default" : "pointer",
|
|
26036
26227
|
// No pointer cursor for ungrouped
|
|
26037
|
-
bgcolor: isDragOver || isTouchTarget ? (0,
|
|
26228
|
+
bgcolor: isDragOver || isTouchTarget ? (0, import_material44.alpha)(projectColor || theme.palette.primary.main, 0.1) : void 0,
|
|
26038
26229
|
border: isDragOver || isTouchTarget ? `2px dashed ${projectColor || theme.palette.primary.main}` : "2px solid transparent",
|
|
26039
26230
|
borderRadius: isDragOver || isTouchTarget ? 1 : 0,
|
|
26040
26231
|
transition: "all 0.2s ease",
|
|
26041
26232
|
"&:hover": !isUngrouped ? {
|
|
26042
26233
|
// Only show hover for projects, not ungrouped
|
|
26043
|
-
bgcolor: (0,
|
|
26234
|
+
bgcolor: (0, import_material44.alpha)(theme.palette.text.primary, 0.04)
|
|
26044
26235
|
} : {}
|
|
26045
26236
|
},
|
|
26046
26237
|
children: [
|
|
26047
|
-
/* @__PURE__ */ (0,
|
|
26048
|
-
|
|
26238
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
26239
|
+
import_material44.Avatar,
|
|
26049
26240
|
{
|
|
26050
26241
|
sx: {
|
|
26051
|
-
bgcolor: isUngrouped ? (0,
|
|
26242
|
+
bgcolor: isUngrouped ? (0, import_material44.alpha)(theme.palette.text.disabled, 0.1) : projectColor || theme.palette.grey[400],
|
|
26052
26243
|
width: 28,
|
|
26053
26244
|
height: 28,
|
|
26054
26245
|
mr: 1.5
|
|
26055
26246
|
},
|
|
26056
|
-
children: isUngrouped ? /* @__PURE__ */ (0,
|
|
26247
|
+
children: isUngrouped ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
26057
26248
|
import_lucide_react10.Inbox,
|
|
26058
26249
|
{
|
|
26059
26250
|
size: 16,
|
|
26060
26251
|
color: theme.palette.text.disabled,
|
|
26061
26252
|
style: { opacity: 0.7 }
|
|
26062
26253
|
}
|
|
26063
|
-
) : /* @__PURE__ */ (0,
|
|
26254
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Icon, { size: 16 })
|
|
26064
26255
|
}
|
|
26065
26256
|
),
|
|
26066
|
-
isRenaming && !isUngrouped ? /* @__PURE__ */ (0,
|
|
26067
|
-
|
|
26257
|
+
isRenaming && !isUngrouped ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
26258
|
+
import_material44.TextField,
|
|
26068
26259
|
{
|
|
26069
26260
|
value: renameDraft,
|
|
26070
26261
|
onChange: (e) => setRenameDraft(e.target.value),
|
|
@@ -26110,8 +26301,8 @@ var init_project_header = __esm({
|
|
|
26110
26301
|
}
|
|
26111
26302
|
}
|
|
26112
26303
|
}
|
|
26113
|
-
) : /* @__PURE__ */ (0,
|
|
26114
|
-
|
|
26304
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
26305
|
+
import_material44.Typography,
|
|
26115
26306
|
{
|
|
26116
26307
|
variant: "subtitle2",
|
|
26117
26308
|
sx: {
|
|
@@ -26123,8 +26314,8 @@ var init_project_header = __esm({
|
|
|
26123
26314
|
},
|
|
26124
26315
|
children: [
|
|
26125
26316
|
projectName,
|
|
26126
|
-
isDragOver && /* @__PURE__ */ (0,
|
|
26127
|
-
|
|
26317
|
+
isDragOver && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
26318
|
+
import_material44.Typography,
|
|
26128
26319
|
{
|
|
26129
26320
|
component: "span",
|
|
26130
26321
|
variant: "caption",
|
|
@@ -26139,13 +26330,13 @@ var init_project_header = __esm({
|
|
|
26139
26330
|
]
|
|
26140
26331
|
}
|
|
26141
26332
|
),
|
|
26142
|
-
/* @__PURE__ */ (0,
|
|
26143
|
-
|
|
26333
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
26334
|
+
import_material44.Chip,
|
|
26144
26335
|
{
|
|
26145
26336
|
label: conversationCount,
|
|
26146
26337
|
size: "small",
|
|
26147
26338
|
sx: {
|
|
26148
|
-
bgcolor: isUngrouped ? (0,
|
|
26339
|
+
bgcolor: isUngrouped ? (0, import_material44.alpha)(theme.palette.text.disabled, 0.1) : (0, import_material44.alpha)(projectColor || theme.palette.primary.main, 0.15),
|
|
26149
26340
|
color: isUngrouped ? theme.palette.text.disabled : projectColor || theme.palette.primary.main,
|
|
26150
26341
|
minWidth: 28,
|
|
26151
26342
|
height: 22,
|
|
@@ -26159,9 +26350,9 @@ var init_project_header = __esm({
|
|
|
26159
26350
|
}
|
|
26160
26351
|
}
|
|
26161
26352
|
),
|
|
26162
|
-
isRenaming && !isUngrouped && /* @__PURE__ */ (0,
|
|
26163
|
-
/* @__PURE__ */ (0,
|
|
26164
|
-
|
|
26353
|
+
isRenaming && !isUngrouped && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Box, { sx: { display: "flex", alignItems: "center", gap: 0.5, ml: 1 }, children: [
|
|
26354
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Tooltip, { title: "Cancel and remove", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
26355
|
+
import_material44.IconButton,
|
|
26165
26356
|
{
|
|
26166
26357
|
size: "small",
|
|
26167
26358
|
onMouseDown: (e) => {
|
|
@@ -26169,12 +26360,12 @@ var init_project_header = __esm({
|
|
|
26169
26360
|
renameActionRef.current = "delete";
|
|
26170
26361
|
onRenameCancelDelete ? onRenameCancelDelete() : cancelRename();
|
|
26171
26362
|
},
|
|
26172
|
-
sx: { color: (0,
|
|
26173
|
-
children: /* @__PURE__ */ (0,
|
|
26363
|
+
sx: { color: (0, import_material44.alpha)(theme.palette.error.main, 0.9) },
|
|
26364
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react10.X, { size: 16 })
|
|
26174
26365
|
}
|
|
26175
26366
|
) }),
|
|
26176
|
-
/* @__PURE__ */ (0,
|
|
26177
|
-
|
|
26367
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Tooltip, { title: "Save", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
26368
|
+
import_material44.IconButton,
|
|
26178
26369
|
{
|
|
26179
26370
|
size: "small",
|
|
26180
26371
|
onMouseDown: (e) => {
|
|
@@ -26183,39 +26374,39 @@ var init_project_header = __esm({
|
|
|
26183
26374
|
commitRename();
|
|
26184
26375
|
},
|
|
26185
26376
|
sx: { color: theme.palette.success.main },
|
|
26186
|
-
children: /* @__PURE__ */ (0,
|
|
26377
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react10.Check, { size: 16 })
|
|
26187
26378
|
}
|
|
26188
26379
|
) })
|
|
26189
26380
|
] }),
|
|
26190
|
-
isHovered && !isDragOver && !isUngrouped && !isRenaming && /* @__PURE__ */ (0,
|
|
26191
|
-
|
|
26381
|
+
isHovered && !isDragOver && !isUngrouped && !isRenaming && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Tooltip, { title: `Add conversation to ${projectName.toLowerCase()}`, arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
26382
|
+
import_material44.IconButton,
|
|
26192
26383
|
{
|
|
26193
26384
|
onClick: handleAddConversation,
|
|
26194
26385
|
size: "small",
|
|
26195
26386
|
sx: {
|
|
26196
26387
|
color: projectColor || theme.palette.primary.main,
|
|
26197
|
-
bgcolor: (0,
|
|
26388
|
+
bgcolor: (0, import_material44.alpha)(projectColor || theme.palette.primary.main, 0.1),
|
|
26198
26389
|
width: 24,
|
|
26199
26390
|
height: 24,
|
|
26200
26391
|
mr: 0.5,
|
|
26201
26392
|
"&:hover": {
|
|
26202
|
-
bgcolor: (0,
|
|
26393
|
+
bgcolor: (0, import_material44.alpha)(projectColor || theme.palette.primary.main, 0.2),
|
|
26203
26394
|
transform: "scale(1.1)"
|
|
26204
26395
|
},
|
|
26205
26396
|
transition: "all 0.2s ease"
|
|
26206
26397
|
},
|
|
26207
|
-
children: /* @__PURE__ */ (0,
|
|
26398
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react10.Plus, { size: 16 })
|
|
26208
26399
|
}
|
|
26209
26400
|
) }),
|
|
26210
|
-
!isUngrouped && !isRenaming && /* @__PURE__ */ (0,
|
|
26211
|
-
|
|
26401
|
+
!isUngrouped && !isRenaming && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
26402
|
+
import_material44.IconButton,
|
|
26212
26403
|
{
|
|
26213
26404
|
size: "small",
|
|
26214
26405
|
sx: {
|
|
26215
26406
|
color: theme.palette.text.secondary,
|
|
26216
26407
|
transition: "transform 0.2s ease"
|
|
26217
26408
|
},
|
|
26218
|
-
children: isCollapsed ? /* @__PURE__ */ (0,
|
|
26409
|
+
children: isCollapsed ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react10.ChevronDown, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react10.ChevronUp, { size: 16 })
|
|
26219
26410
|
}
|
|
26220
26411
|
)
|
|
26221
26412
|
]
|
|
@@ -26245,12 +26436,12 @@ var init_tooltips = __esm({
|
|
|
26245
26436
|
});
|
|
26246
26437
|
|
|
26247
26438
|
// src/chat/conversation-drawer.tsx
|
|
26248
|
-
var
|
|
26439
|
+
var import_react56, import_material45, import_lucide_react11, import_styles28, import_jsx_runtime45, BANDIT_AVATAR, coerceOptionalString, deriveInitials, ConversationDrawer, conversation_drawer_default;
|
|
26249
26440
|
var init_conversation_drawer = __esm({
|
|
26250
26441
|
"src/chat/conversation-drawer.tsx"() {
|
|
26251
26442
|
"use strict";
|
|
26252
|
-
|
|
26253
|
-
|
|
26443
|
+
import_react56 = require("react");
|
|
26444
|
+
import_material45 = require("@mui/material");
|
|
26254
26445
|
import_lucide_react11 = require("lucide-react");
|
|
26255
26446
|
import_styles28 = require("@mui/material/styles");
|
|
26256
26447
|
init_conversationStore();
|
|
@@ -26266,7 +26457,7 @@ var init_conversation_drawer = __esm({
|
|
|
26266
26457
|
init_project_header();
|
|
26267
26458
|
init_debugLogger();
|
|
26268
26459
|
init_tooltips();
|
|
26269
|
-
|
|
26460
|
+
import_jsx_runtime45 = require("react/jsx-runtime");
|
|
26270
26461
|
BANDIT_AVATAR = "https://cdn.burtson.ai/images/bandit-head.png";
|
|
26271
26462
|
coerceOptionalString = (value) => {
|
|
26272
26463
|
if (typeof value !== "string") return void 0;
|
|
@@ -26295,7 +26486,7 @@ var init_conversation_drawer = __esm({
|
|
|
26295
26486
|
};
|
|
26296
26487
|
ConversationDrawer = ({ open, onClose }) => {
|
|
26297
26488
|
const theme = (0, import_styles28.useTheme)();
|
|
26298
|
-
const isMobile = (0,
|
|
26489
|
+
const isMobile = (0, import_material45.useMediaQuery)(theme.breakpoints.down("sm"));
|
|
26299
26490
|
const { user: user2 } = useAuthenticationStore();
|
|
26300
26491
|
const baseRadius = typeof theme.shape.borderRadius === "number" ? theme.shape.borderRadius : parseFloat(theme.shape.borderRadius) || 0;
|
|
26301
26492
|
const drawerCornerRadius = baseRadius * 3;
|
|
@@ -26317,22 +26508,22 @@ var init_conversation_drawer = __esm({
|
|
|
26317
26508
|
createProject,
|
|
26318
26509
|
deleteProject
|
|
26319
26510
|
} = useProjectStore();
|
|
26320
|
-
const [projectManagementOpen, setProjectManagementOpen] = (0,
|
|
26321
|
-
const [memoryModalOpen, setMemoryModalOpen] = (0,
|
|
26322
|
-
const [collapsedProjects, setCollapsedProjects] = (0,
|
|
26323
|
-
const didInitCollapseRef = (0,
|
|
26324
|
-
const [searchQuery, setSearchQuery] = (0,
|
|
26325
|
-
const [menuAnchorEl, setMenuAnchorEl] = (0,
|
|
26326
|
-
const [clearConfirmOpen, setClearConfirmOpen] = (0,
|
|
26327
|
-
const [moveModalOpen, setMoveModalOpen] = (0,
|
|
26328
|
-
const [conversationToMove, setConversationToMove] = (0,
|
|
26329
|
-
const [renameProjectId, setRenameProjectId] = (0,
|
|
26330
|
-
const getCustomClaim = (0,
|
|
26511
|
+
const [projectManagementOpen, setProjectManagementOpen] = (0, import_react56.useState)(false);
|
|
26512
|
+
const [memoryModalOpen, setMemoryModalOpen] = (0, import_react56.useState)(false);
|
|
26513
|
+
const [collapsedProjects, setCollapsedProjects] = (0, import_react56.useState)(/* @__PURE__ */ new Set());
|
|
26514
|
+
const didInitCollapseRef = (0, import_react56.useRef)(false);
|
|
26515
|
+
const [searchQuery, setSearchQuery] = (0, import_react56.useState)("");
|
|
26516
|
+
const [menuAnchorEl, setMenuAnchorEl] = (0, import_react56.useState)(null);
|
|
26517
|
+
const [clearConfirmOpen, setClearConfirmOpen] = (0, import_react56.useState)(false);
|
|
26518
|
+
const [moveModalOpen, setMoveModalOpen] = (0, import_react56.useState)(false);
|
|
26519
|
+
const [conversationToMove, setConversationToMove] = (0, import_react56.useState)(null);
|
|
26520
|
+
const [renameProjectId, setRenameProjectId] = (0, import_react56.useState)(null);
|
|
26521
|
+
const getCustomClaim = (0, import_react56.useCallback)((key) => {
|
|
26331
26522
|
if (!user2) return void 0;
|
|
26332
26523
|
const record = user2;
|
|
26333
26524
|
return coerceOptionalString(record[key]);
|
|
26334
26525
|
}, [user2]);
|
|
26335
|
-
const userDisplayName = (0,
|
|
26526
|
+
const userDisplayName = (0, import_react56.useMemo)(() => {
|
|
26336
26527
|
if (!user2) return void 0;
|
|
26337
26528
|
const candidateFields = [
|
|
26338
26529
|
coerceOptionalString(user2.name),
|
|
@@ -26347,7 +26538,7 @@ var init_conversation_drawer = __esm({
|
|
|
26347
26538
|
if (trimmedEmail) return trimmedEmail;
|
|
26348
26539
|
return user2.sub;
|
|
26349
26540
|
}, [user2, getCustomClaim]);
|
|
26350
|
-
const userSecondaryText = (0,
|
|
26541
|
+
const userSecondaryText = (0, import_react56.useMemo)(() => {
|
|
26351
26542
|
if (!user2) return void 0;
|
|
26352
26543
|
const trimmedEmail = coerceOptionalString(user2.email);
|
|
26353
26544
|
if (trimmedEmail && trimmedEmail !== userDisplayName) {
|
|
@@ -26359,13 +26550,13 @@ var init_conversation_drawer = __esm({
|
|
|
26359
26550
|
}
|
|
26360
26551
|
return void 0;
|
|
26361
26552
|
}, [user2, userDisplayName]);
|
|
26362
|
-
const [avatarImage, setAvatarImage] = (0,
|
|
26363
|
-
(0,
|
|
26553
|
+
const [avatarImage, setAvatarImage] = (0, import_react56.useState)(BANDIT_AVATAR);
|
|
26554
|
+
(0, import_react56.useEffect)(() => {
|
|
26364
26555
|
const fresh = readPersistedToken();
|
|
26365
26556
|
const store = useAuthenticationStore.getState();
|
|
26366
26557
|
if (fresh && fresh !== store.token) store.setToken(fresh);
|
|
26367
26558
|
}, []);
|
|
26368
|
-
(0,
|
|
26559
|
+
(0, import_react56.useEffect)(() => {
|
|
26369
26560
|
let active2 = true;
|
|
26370
26561
|
let objectUrl = null;
|
|
26371
26562
|
const resolveAvatar2 = async () => {
|
|
@@ -26406,13 +26597,13 @@ var init_conversation_drawer = __esm({
|
|
|
26406
26597
|
};
|
|
26407
26598
|
}, [getCustomClaim]);
|
|
26408
26599
|
const avatarLabel = userDisplayName || user2?.email || "Bandit";
|
|
26409
|
-
const avatarInitials = (0,
|
|
26410
|
-
(0,
|
|
26600
|
+
const avatarInitials = (0, import_react56.useMemo)(() => deriveInitials(avatarLabel), [avatarLabel]);
|
|
26601
|
+
(0, import_react56.useEffect)(() => {
|
|
26411
26602
|
if (!projectsHydrated) {
|
|
26412
26603
|
hydrateProjects();
|
|
26413
26604
|
}
|
|
26414
26605
|
}, [projectsHydrated, hydrateProjects]);
|
|
26415
|
-
(0,
|
|
26606
|
+
(0, import_react56.useEffect)(() => {
|
|
26416
26607
|
if (projectsHydrated && !didInitCollapseRef.current) {
|
|
26417
26608
|
didInitCollapseRef.current = true;
|
|
26418
26609
|
if (projects && projects.length > 0) {
|
|
@@ -26425,7 +26616,7 @@ var init_conversation_drawer = __esm({
|
|
|
26425
26616
|
const end = Math.min(text.length, idx + query.length + 60);
|
|
26426
26617
|
return text.slice(start, end).replace(/\s+/g, " ").trim();
|
|
26427
26618
|
};
|
|
26428
|
-
const projectGroups = (0,
|
|
26619
|
+
const projectGroups = (0, import_react56.useMemo)(() => {
|
|
26429
26620
|
const groups = projects.map((project) => ({
|
|
26430
26621
|
id: project.id,
|
|
26431
26622
|
name: project.name,
|
|
@@ -26448,7 +26639,7 @@ var init_conversation_drawer = __esm({
|
|
|
26448
26639
|
}
|
|
26449
26640
|
return groups.filter((group) => group.conversations.length > 0 || group.id !== null);
|
|
26450
26641
|
}, [projects, conversations, collapsedProjects]);
|
|
26451
|
-
const filteredProjectGroups = (0,
|
|
26642
|
+
const filteredProjectGroups = (0, import_react56.useMemo)(() => {
|
|
26452
26643
|
if (!searchQuery.trim()) return projectGroups;
|
|
26453
26644
|
const query = searchQuery.toLowerCase();
|
|
26454
26645
|
return projectGroups.map((group) => {
|
|
@@ -26519,9 +26710,9 @@ var init_conversation_drawer = __esm({
|
|
|
26519
26710
|
setMoveModalOpen(false);
|
|
26520
26711
|
setConversationToMove(null);
|
|
26521
26712
|
};
|
|
26522
|
-
return /* @__PURE__ */ (0,
|
|
26523
|
-
/* @__PURE__ */ (0,
|
|
26524
|
-
|
|
26713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
|
|
26714
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
26715
|
+
import_material45.Drawer,
|
|
26525
26716
|
{
|
|
26526
26717
|
anchor: "left",
|
|
26527
26718
|
open,
|
|
@@ -26534,7 +26725,7 @@ var init_conversation_drawer = __esm({
|
|
|
26534
26725
|
width: isMobile ? `min(94vw, 360px)` : 340,
|
|
26535
26726
|
maxWidth: 360,
|
|
26536
26727
|
bgcolor: theme.palette.background.paper,
|
|
26537
|
-
borderRight: `1px solid ${isMobile ? (0,
|
|
26728
|
+
borderRight: `1px solid ${isMobile ? (0, import_material45.alpha)(theme.palette.divider, 0.4) : theme.palette.divider}`,
|
|
26538
26729
|
display: "flex",
|
|
26539
26730
|
flexDirection: "column",
|
|
26540
26731
|
height: isMobile ? `calc(100dvh - ${theme.spacing(4)})` : "100dvh",
|
|
@@ -26542,7 +26733,7 @@ var init_conversation_drawer = __esm({
|
|
|
26542
26733
|
bottom: isMobile ? theme.spacing(2) : 0,
|
|
26543
26734
|
left: 0,
|
|
26544
26735
|
borderRadius: isMobile ? `0 ${drawerCornerRadius}px ${drawerCornerRadius}px 0` : 0,
|
|
26545
|
-
boxShadow: isMobile ? `0 18px 36px ${(0,
|
|
26736
|
+
boxShadow: isMobile ? `0 18px 36px ${(0, import_material45.alpha)(theme.palette.common.black, 0.28)}` : "none",
|
|
26546
26737
|
overflow: "hidden"
|
|
26547
26738
|
}
|
|
26548
26739
|
},
|
|
@@ -26562,8 +26753,8 @@ var init_conversation_drawer = __esm({
|
|
|
26562
26753
|
}
|
|
26563
26754
|
},
|
|
26564
26755
|
children: [
|
|
26565
|
-
/* @__PURE__ */ (0,
|
|
26566
|
-
|
|
26756
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
26757
|
+
import_material45.Box,
|
|
26567
26758
|
{
|
|
26568
26759
|
sx: {
|
|
26569
26760
|
p: 2,
|
|
@@ -26574,8 +26765,8 @@ var init_conversation_drawer = __esm({
|
|
|
26574
26765
|
gap: 1
|
|
26575
26766
|
},
|
|
26576
26767
|
children: [
|
|
26577
|
-
/* @__PURE__ */ (0,
|
|
26578
|
-
|
|
26768
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Tooltip, { title: "Memories", arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
26769
|
+
import_material45.IconButton,
|
|
26579
26770
|
{
|
|
26580
26771
|
onClick: () => setMemoryModalOpen(true),
|
|
26581
26772
|
size: "small",
|
|
@@ -26584,14 +26775,14 @@ var init_conversation_drawer = __esm({
|
|
|
26584
26775
|
color: theme.palette.text.secondary,
|
|
26585
26776
|
"&:hover": {
|
|
26586
26777
|
color: theme.palette.primary.main,
|
|
26587
|
-
bgcolor: (0,
|
|
26778
|
+
bgcolor: (0, import_material45.alpha)(theme.palette.primary.main, 0.1)
|
|
26588
26779
|
}
|
|
26589
26780
|
},
|
|
26590
|
-
children: /* @__PURE__ */ (0,
|
|
26781
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react11.Brain, {})
|
|
26591
26782
|
}
|
|
26592
26783
|
) }),
|
|
26593
|
-
/* @__PURE__ */ (0,
|
|
26594
|
-
|
|
26784
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Tooltip, { title: tooltip("manageProjects"), arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
26785
|
+
import_material45.IconButton,
|
|
26595
26786
|
{
|
|
26596
26787
|
onClick: () => setProjectManagementOpen(true),
|
|
26597
26788
|
size: "small",
|
|
@@ -26600,14 +26791,14 @@ var init_conversation_drawer = __esm({
|
|
|
26600
26791
|
color: theme.palette.text.secondary,
|
|
26601
26792
|
"&:hover": {
|
|
26602
26793
|
color: theme.palette.primary.main,
|
|
26603
|
-
bgcolor: (0,
|
|
26794
|
+
bgcolor: (0, import_material45.alpha)(theme.palette.primary.main, 0.1)
|
|
26604
26795
|
}
|
|
26605
26796
|
},
|
|
26606
|
-
children: /* @__PURE__ */ (0,
|
|
26797
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react11.Folder, {})
|
|
26607
26798
|
}
|
|
26608
26799
|
) }),
|
|
26609
|
-
/* @__PURE__ */ (0,
|
|
26610
|
-
|
|
26800
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Tooltip, { title: tooltip("conversationOptions"), arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
26801
|
+
import_material45.IconButton,
|
|
26611
26802
|
{
|
|
26612
26803
|
onClick: handleMenuOpen,
|
|
26613
26804
|
size: "small",
|
|
@@ -26616,14 +26807,14 @@ var init_conversation_drawer = __esm({
|
|
|
26616
26807
|
color: theme.palette.text.secondary,
|
|
26617
26808
|
"&:hover": {
|
|
26618
26809
|
color: theme.palette.text.primary,
|
|
26619
|
-
bgcolor: (0,
|
|
26810
|
+
bgcolor: (0, import_material45.alpha)(theme.palette.text.primary, 0.1)
|
|
26620
26811
|
}
|
|
26621
26812
|
},
|
|
26622
|
-
children: /* @__PURE__ */ (0,
|
|
26813
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react11.MoreVertical, {})
|
|
26623
26814
|
}
|
|
26624
26815
|
) }),
|
|
26625
|
-
isMobile && /* @__PURE__ */ (0,
|
|
26626
|
-
|
|
26816
|
+
isMobile && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Tooltip, { title: tooltip("closeConversationsPanel"), children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
26817
|
+
import_material45.IconButton,
|
|
26627
26818
|
{
|
|
26628
26819
|
onClick: (e) => {
|
|
26629
26820
|
e.preventDefault();
|
|
@@ -26636,17 +26827,17 @@ var init_conversation_drawer = __esm({
|
|
|
26636
26827
|
color: theme.palette.text.secondary,
|
|
26637
26828
|
"&:hover": {
|
|
26638
26829
|
color: theme.palette.error.main,
|
|
26639
|
-
bgcolor: (0,
|
|
26830
|
+
bgcolor: (0, import_material45.alpha)(theme.palette.error.main, 0.1)
|
|
26640
26831
|
}
|
|
26641
26832
|
},
|
|
26642
|
-
children: /* @__PURE__ */ (0,
|
|
26833
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react11.X, {})
|
|
26643
26834
|
}
|
|
26644
26835
|
) })
|
|
26645
26836
|
]
|
|
26646
26837
|
}
|
|
26647
26838
|
),
|
|
26648
|
-
/* @__PURE__ */ (0,
|
|
26649
|
-
|
|
26839
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Box, { sx: { p: 2, pb: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
26840
|
+
import_material45.TextField,
|
|
26650
26841
|
{
|
|
26651
26842
|
fullWidth: true,
|
|
26652
26843
|
size: "small",
|
|
@@ -26655,24 +26846,24 @@ var init_conversation_drawer = __esm({
|
|
|
26655
26846
|
onChange: (e) => setSearchQuery(e.target.value),
|
|
26656
26847
|
variant: "outlined",
|
|
26657
26848
|
InputProps: {
|
|
26658
|
-
startAdornment: /* @__PURE__ */ (0,
|
|
26659
|
-
endAdornment: searchQuery && /* @__PURE__ */ (0,
|
|
26660
|
-
|
|
26849
|
+
startAdornment: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.InputAdornment, { position: "start", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react11.Search, { size: 16, color: theme.palette.text.secondary }) }),
|
|
26850
|
+
endAdornment: searchQuery && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.InputAdornment, { position: "end", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Tooltip, { title: tooltip("clearSearch"), children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
26851
|
+
import_material45.IconButton,
|
|
26661
26852
|
{
|
|
26662
26853
|
onClick: handleSearchClear,
|
|
26663
26854
|
size: "small",
|
|
26664
26855
|
edge: "end",
|
|
26665
26856
|
"aria-label": tooltip("clearSearch"),
|
|
26666
26857
|
sx: { color: theme.palette.text.secondary },
|
|
26667
|
-
children: /* @__PURE__ */ (0,
|
|
26858
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react11.X, { size: 16 })
|
|
26668
26859
|
}
|
|
26669
26860
|
) }) })
|
|
26670
26861
|
},
|
|
26671
26862
|
sx: {
|
|
26672
26863
|
"& .MuiOutlinedInput-root": {
|
|
26673
|
-
bgcolor: (0,
|
|
26864
|
+
bgcolor: (0, import_material45.alpha)(theme.palette.background.default, 0.5),
|
|
26674
26865
|
"&:hover": {
|
|
26675
|
-
bgcolor: (0,
|
|
26866
|
+
bgcolor: (0, import_material45.alpha)(theme.palette.background.default, 0.8)
|
|
26676
26867
|
},
|
|
26677
26868
|
"&.Mui-focused": {
|
|
26678
26869
|
bgcolor: theme.palette.background.default
|
|
@@ -26681,9 +26872,9 @@ var init_conversation_drawer = __esm({
|
|
|
26681
26872
|
}
|
|
26682
26873
|
}
|
|
26683
26874
|
) }),
|
|
26684
|
-
/* @__PURE__ */ (0,
|
|
26685
|
-
/* @__PURE__ */ (0,
|
|
26686
|
-
|
|
26875
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_material45.Box, { sx: { flex: 1, overflow: "auto", display: "flex", flexDirection: "column" }, children: [
|
|
26876
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
26877
|
+
import_material45.Box,
|
|
26687
26878
|
{
|
|
26688
26879
|
onClick: async () => {
|
|
26689
26880
|
const names = new Set(projects.map((p) => p.name));
|
|
@@ -26714,49 +26905,49 @@ var init_conversation_drawer = __esm({
|
|
|
26714
26905
|
alignItems: "center",
|
|
26715
26906
|
gap: 1.5,
|
|
26716
26907
|
cursor: "pointer",
|
|
26717
|
-
"&:hover": { bgcolor: (0,
|
|
26908
|
+
"&:hover": { bgcolor: (0, import_material45.alpha)(theme.palette.text.primary, 0.04) }
|
|
26718
26909
|
},
|
|
26719
26910
|
children: [
|
|
26720
|
-
/* @__PURE__ */ (0,
|
|
26721
|
-
|
|
26911
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
26912
|
+
import_material45.Box,
|
|
26722
26913
|
{
|
|
26723
26914
|
sx: {
|
|
26724
26915
|
width: 28,
|
|
26725
26916
|
height: 28,
|
|
26726
26917
|
borderRadius: "50%",
|
|
26727
|
-
bgcolor: (0,
|
|
26918
|
+
bgcolor: (0, import_material45.alpha)(theme.palette.success.main, 0.15),
|
|
26728
26919
|
display: "flex",
|
|
26729
26920
|
alignItems: "center",
|
|
26730
26921
|
justifyContent: "center",
|
|
26731
26922
|
flexShrink: 0
|
|
26732
26923
|
},
|
|
26733
|
-
children: /* @__PURE__ */ (0,
|
|
26924
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react11.Folder, { size: 16, color: theme.palette.success.main })
|
|
26734
26925
|
}
|
|
26735
26926
|
),
|
|
26736
|
-
/* @__PURE__ */ (0,
|
|
26737
|
-
|
|
26927
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
26928
|
+
import_material45.Typography,
|
|
26738
26929
|
{
|
|
26739
26930
|
variant: "subtitle2",
|
|
26740
26931
|
sx: { flex: 1, fontWeight: 600, fontSize: "0.875rem" },
|
|
26741
26932
|
children: "New Project"
|
|
26742
26933
|
}
|
|
26743
26934
|
),
|
|
26744
|
-
/* @__PURE__ */ (0,
|
|
26745
|
-
|
|
26935
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Tooltip, { title: tooltip("addProject"), arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
26936
|
+
import_material45.IconButton,
|
|
26746
26937
|
{
|
|
26747
26938
|
size: "small",
|
|
26748
26939
|
"aria-label": tooltip("addProject"),
|
|
26749
26940
|
sx: { color: theme.palette.success.main },
|
|
26750
|
-
children: /* @__PURE__ */ (0,
|
|
26941
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react11.Plus, { size: 16 })
|
|
26751
26942
|
}
|
|
26752
26943
|
) })
|
|
26753
26944
|
]
|
|
26754
26945
|
}
|
|
26755
26946
|
),
|
|
26756
|
-
/* @__PURE__ */ (0,
|
|
26757
|
-
filteredProjectGroups.map((group, index) => /* @__PURE__ */ (0,
|
|
26758
|
-
group.id === null && filteredProjectGroups.length > 1 && /* @__PURE__ */ (0,
|
|
26759
|
-
|
|
26947
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Divider, { sx: { opacity: 0.3 } }),
|
|
26948
|
+
filteredProjectGroups.map((group, index) => /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_material45.Box, { children: [
|
|
26949
|
+
group.id === null && filteredProjectGroups.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
26950
|
+
import_material45.Box,
|
|
26760
26951
|
{
|
|
26761
26952
|
sx: {
|
|
26762
26953
|
py: 2,
|
|
@@ -26766,9 +26957,9 @@ var init_conversation_drawer = __esm({
|
|
|
26766
26957
|
gap: 2
|
|
26767
26958
|
},
|
|
26768
26959
|
children: [
|
|
26769
|
-
/* @__PURE__ */ (0,
|
|
26770
|
-
/* @__PURE__ */ (0,
|
|
26771
|
-
/* @__PURE__ */ (0,
|
|
26960
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Divider, { sx: { flex: 1, opacity: 0.6 } }),
|
|
26961
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_material45.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
26962
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
26772
26963
|
import_lucide_react11.Inbox,
|
|
26773
26964
|
{
|
|
26774
26965
|
size: 14,
|
|
@@ -26776,8 +26967,8 @@ var init_conversation_drawer = __esm({
|
|
|
26776
26967
|
style: { opacity: 0.7 }
|
|
26777
26968
|
}
|
|
26778
26969
|
),
|
|
26779
|
-
/* @__PURE__ */ (0,
|
|
26780
|
-
|
|
26970
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
26971
|
+
import_material45.Typography,
|
|
26781
26972
|
{
|
|
26782
26973
|
variant: "caption",
|
|
26783
26974
|
sx: {
|
|
@@ -26791,12 +26982,12 @@ var init_conversation_drawer = __esm({
|
|
|
26791
26982
|
}
|
|
26792
26983
|
)
|
|
26793
26984
|
] }),
|
|
26794
|
-
/* @__PURE__ */ (0,
|
|
26985
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Divider, { sx: { flex: 1, opacity: 0.6 } })
|
|
26795
26986
|
]
|
|
26796
26987
|
}
|
|
26797
26988
|
),
|
|
26798
|
-
group.id !== null ? /* @__PURE__ */ (0,
|
|
26799
|
-
/* @__PURE__ */ (0,
|
|
26989
|
+
group.id !== null ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
|
|
26990
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
26800
26991
|
project_header_default,
|
|
26801
26992
|
{
|
|
26802
26993
|
projectId: group.id,
|
|
@@ -26825,8 +27016,8 @@ var init_conversation_drawer = __esm({
|
|
|
26825
27016
|
}
|
|
26826
27017
|
}
|
|
26827
27018
|
),
|
|
26828
|
-
/* @__PURE__ */ (0,
|
|
26829
|
-
group.conversations.map((conversation) => /* @__PURE__ */ (0,
|
|
27019
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Collapse, { in: !group.collapsed, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_material45.Box, { sx: { pb: 1 }, children: [
|
|
27020
|
+
group.conversations.map((conversation) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
26830
27021
|
simple_conversation_item_default,
|
|
26831
27022
|
{
|
|
26832
27023
|
conversation,
|
|
@@ -26846,8 +27037,8 @@ var init_conversation_drawer = __esm({
|
|
|
26846
27037
|
},
|
|
26847
27038
|
conversation.id
|
|
26848
27039
|
)),
|
|
26849
|
-
group.conversations.length === 0 && !group.collapsed && group.id !== null && /* @__PURE__ */ (0,
|
|
26850
|
-
|
|
27040
|
+
group.conversations.length === 0 && !group.collapsed && group.id !== null && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
27041
|
+
import_material45.Box,
|
|
26851
27042
|
{
|
|
26852
27043
|
sx: {
|
|
26853
27044
|
p: 3,
|
|
@@ -26855,17 +27046,17 @@ var init_conversation_drawer = __esm({
|
|
|
26855
27046
|
color: theme.palette.text.secondary
|
|
26856
27047
|
},
|
|
26857
27048
|
children: [
|
|
26858
|
-
/* @__PURE__ */ (0,
|
|
26859
|
-
/* @__PURE__ */ (0,
|
|
27049
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Typography, { variant: "body2", children: "No conversations in this project yet" }),
|
|
27050
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Typography, { variant: "caption", sx: { mt: 1, display: "block" }, children: "Drag conversations here or use the + button above" })
|
|
26860
27051
|
]
|
|
26861
27052
|
}
|
|
26862
27053
|
)
|
|
26863
27054
|
] }) }),
|
|
26864
|
-
/* @__PURE__ */ (0,
|
|
27055
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Divider, { sx: { opacity: 0.3 } })
|
|
26865
27056
|
] }) : (
|
|
26866
27057
|
// Special handling for ungrouped - no header, just conversations in scrollable area
|
|
26867
|
-
/* @__PURE__ */ (0,
|
|
26868
|
-
|
|
27058
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
27059
|
+
import_material45.Box,
|
|
26869
27060
|
{
|
|
26870
27061
|
sx: {
|
|
26871
27062
|
minHeight: 0,
|
|
@@ -26873,12 +27064,12 @@ var init_conversation_drawer = __esm({
|
|
|
26873
27064
|
overflow: "auto",
|
|
26874
27065
|
px: 1,
|
|
26875
27066
|
py: 1,
|
|
26876
|
-
bgcolor: (0,
|
|
27067
|
+
bgcolor: (0, import_material45.alpha)(theme.palette.background.default, 0.3),
|
|
26877
27068
|
borderRadius: "8px 8px 0 0",
|
|
26878
27069
|
mx: 1,
|
|
26879
27070
|
mb: 1
|
|
26880
27071
|
},
|
|
26881
|
-
children: group.conversations.map((conversation) => /* @__PURE__ */ (0,
|
|
27072
|
+
children: group.conversations.map((conversation) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
26882
27073
|
simple_conversation_item_default,
|
|
26883
27074
|
{
|
|
26884
27075
|
conversation,
|
|
@@ -26902,8 +27093,8 @@ var init_conversation_drawer = __esm({
|
|
|
26902
27093
|
)
|
|
26903
27094
|
)
|
|
26904
27095
|
] }, group.id || "ungrouped")),
|
|
26905
|
-
filteredProjectGroups.length === 0 && /* @__PURE__ */ (0,
|
|
26906
|
-
|
|
27096
|
+
filteredProjectGroups.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
27097
|
+
import_material45.Box,
|
|
26907
27098
|
{
|
|
26908
27099
|
sx: {
|
|
26909
27100
|
flex: 1,
|
|
@@ -26916,14 +27107,14 @@ var init_conversation_drawer = __esm({
|
|
|
26916
27107
|
color: theme.palette.text.secondary
|
|
26917
27108
|
},
|
|
26918
27109
|
children: [
|
|
26919
|
-
/* @__PURE__ */ (0,
|
|
26920
|
-
/* @__PURE__ */ (0,
|
|
27110
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Typography, { variant: "h6", sx: { mb: 1 }, children: searchQuery ? "No conversations found" : "No conversations yet" }),
|
|
27111
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Typography, { variant: "body2", sx: { mb: 3, maxWidth: 280 }, children: searchQuery ? `No conversations match "${searchQuery}"` : "Start your first conversation to begin organizing your chats into projects" })
|
|
26921
27112
|
]
|
|
26922
27113
|
}
|
|
26923
27114
|
)
|
|
26924
27115
|
] }),
|
|
26925
|
-
/* @__PURE__ */ (0,
|
|
26926
|
-
|
|
27116
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
27117
|
+
import_material45.Box,
|
|
26927
27118
|
{
|
|
26928
27119
|
onClick: user2 ? () => {
|
|
26929
27120
|
window.location.href = "/profile";
|
|
@@ -26933,19 +27124,19 @@ var init_conversation_drawer = __esm({
|
|
|
26933
27124
|
mt: "auto",
|
|
26934
27125
|
px: 2,
|
|
26935
27126
|
py: 1.75,
|
|
26936
|
-
borderTop: `1px solid ${(0,
|
|
27127
|
+
borderTop: `1px solid ${(0, import_material45.alpha)(theme.palette.divider, 0.6)}`,
|
|
26937
27128
|
display: "flex",
|
|
26938
27129
|
alignItems: "center",
|
|
26939
27130
|
gap: 1.5,
|
|
26940
27131
|
justifyContent: "center",
|
|
26941
|
-
bgcolor: (0,
|
|
27132
|
+
bgcolor: (0, import_material45.alpha)(theme.palette.background.default, isMobile ? 0.9 : 0.6),
|
|
26942
27133
|
cursor: user2 ? "pointer" : "default",
|
|
26943
27134
|
transition: "background-color 0.15s ease",
|
|
26944
|
-
"&:hover": user2 ? { bgcolor: (0,
|
|
27135
|
+
"&:hover": user2 ? { bgcolor: (0, import_material45.alpha)(theme.palette.primary.main, 0.08) } : void 0
|
|
26945
27136
|
},
|
|
26946
27137
|
children: [
|
|
26947
|
-
/* @__PURE__ */ (0,
|
|
26948
|
-
|
|
27138
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
27139
|
+
import_material45.Avatar,
|
|
26949
27140
|
{
|
|
26950
27141
|
src: avatarImage,
|
|
26951
27142
|
alt: avatarLabel,
|
|
@@ -26953,14 +27144,14 @@ var init_conversation_drawer = __esm({
|
|
|
26953
27144
|
width: 36,
|
|
26954
27145
|
height: 36,
|
|
26955
27146
|
fontSize: "0.95rem",
|
|
26956
|
-
bgcolor: (0,
|
|
27147
|
+
bgcolor: (0, import_material45.alpha)(theme.palette.primary.main, 0.12),
|
|
26957
27148
|
color: theme.palette.primary.main
|
|
26958
27149
|
},
|
|
26959
27150
|
children: avatarInitials
|
|
26960
27151
|
}
|
|
26961
27152
|
),
|
|
26962
|
-
/* @__PURE__ */ (0,
|
|
26963
|
-
|
|
27153
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
27154
|
+
import_material45.Box,
|
|
26964
27155
|
{
|
|
26965
27156
|
sx: {
|
|
26966
27157
|
minWidth: 0,
|
|
@@ -26972,8 +27163,8 @@ var init_conversation_drawer = __esm({
|
|
|
26972
27163
|
gap: 0.25
|
|
26973
27164
|
},
|
|
26974
27165
|
children: [
|
|
26975
|
-
/* @__PURE__ */ (0,
|
|
26976
|
-
|
|
27166
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
27167
|
+
import_material45.Typography,
|
|
26977
27168
|
{
|
|
26978
27169
|
variant: "subtitle2",
|
|
26979
27170
|
noWrap: true,
|
|
@@ -26981,8 +27172,8 @@ var init_conversation_drawer = __esm({
|
|
|
26981
27172
|
children: user2 ? userDisplayName : "Not signed in"
|
|
26982
27173
|
}
|
|
26983
27174
|
),
|
|
26984
|
-
/* @__PURE__ */ (0,
|
|
26985
|
-
|
|
27175
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
27176
|
+
import_material45.Typography,
|
|
26986
27177
|
{
|
|
26987
27178
|
variant: "caption",
|
|
26988
27179
|
noWrap: true,
|
|
@@ -26993,9 +27184,9 @@ var init_conversation_drawer = __esm({
|
|
|
26993
27184
|
]
|
|
26994
27185
|
}
|
|
26995
27186
|
),
|
|
26996
|
-
user2 && /* @__PURE__ */ (0,
|
|
26997
|
-
/* @__PURE__ */ (0,
|
|
26998
|
-
|
|
27187
|
+
user2 && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
|
|
27188
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
27189
|
+
import_material45.Box,
|
|
26999
27190
|
{
|
|
27000
27191
|
sx: {
|
|
27001
27192
|
flexShrink: 0,
|
|
@@ -27005,14 +27196,14 @@ var init_conversation_drawer = __esm({
|
|
|
27005
27196
|
width: 30,
|
|
27006
27197
|
height: 30,
|
|
27007
27198
|
borderRadius: "50%",
|
|
27008
|
-
border: `1px solid ${(0,
|
|
27199
|
+
border: `1px solid ${(0, import_material45.alpha)(theme.palette.divider, 0.8)}`,
|
|
27009
27200
|
color: theme.palette.text.secondary
|
|
27010
27201
|
},
|
|
27011
|
-
children: /* @__PURE__ */ (0,
|
|
27202
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react11.Settings, { size: 16 })
|
|
27012
27203
|
}
|
|
27013
27204
|
),
|
|
27014
|
-
/* @__PURE__ */ (0,
|
|
27015
|
-
|
|
27205
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
27206
|
+
import_material45.IconButton,
|
|
27016
27207
|
{
|
|
27017
27208
|
"aria-label": "Sign out",
|
|
27018
27209
|
title: "Sign out",
|
|
@@ -27025,11 +27216,11 @@ var init_conversation_drawer = __esm({
|
|
|
27025
27216
|
flexShrink: 0,
|
|
27026
27217
|
width: 30,
|
|
27027
27218
|
height: 30,
|
|
27028
|
-
border: `1px solid ${(0,
|
|
27219
|
+
border: `1px solid ${(0, import_material45.alpha)(theme.palette.error.main, 0.4)}`,
|
|
27029
27220
|
color: theme.palette.error.main,
|
|
27030
|
-
"&:hover": { bgcolor: (0,
|
|
27221
|
+
"&:hover": { bgcolor: (0, import_material45.alpha)(theme.palette.error.main, 0.1) }
|
|
27031
27222
|
},
|
|
27032
|
-
children: /* @__PURE__ */ (0,
|
|
27223
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react11.LogOut, { size: 16 })
|
|
27033
27224
|
}
|
|
27034
27225
|
)
|
|
27035
27226
|
] })
|
|
@@ -27039,15 +27230,15 @@ var init_conversation_drawer = __esm({
|
|
|
27039
27230
|
]
|
|
27040
27231
|
}
|
|
27041
27232
|
),
|
|
27042
|
-
/* @__PURE__ */ (0,
|
|
27233
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
27043
27234
|
project_management_modal_default,
|
|
27044
27235
|
{
|
|
27045
27236
|
open: projectManagementOpen,
|
|
27046
27237
|
onClose: () => setProjectManagementOpen(false)
|
|
27047
27238
|
}
|
|
27048
27239
|
),
|
|
27049
|
-
/* @__PURE__ */ (0,
|
|
27050
|
-
conversationToMove && /* @__PURE__ */ (0,
|
|
27240
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(memory_modal_default, { open: memoryModalOpen, onClose: () => setMemoryModalOpen(false) }),
|
|
27241
|
+
conversationToMove && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
27051
27242
|
move_conversation_modal_default,
|
|
27052
27243
|
{
|
|
27053
27244
|
open: moveModalOpen,
|
|
@@ -27056,8 +27247,8 @@ var init_conversation_drawer = __esm({
|
|
|
27056
27247
|
currentProjectId: conversationToMove.projectId
|
|
27057
27248
|
}
|
|
27058
27249
|
),
|
|
27059
|
-
/* @__PURE__ */ (0,
|
|
27060
|
-
|
|
27250
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
27251
|
+
import_material45.Menu,
|
|
27061
27252
|
{
|
|
27062
27253
|
anchorEl: menuAnchorEl,
|
|
27063
27254
|
open: Boolean(menuAnchorEl),
|
|
@@ -27070,8 +27261,8 @@ var init_conversation_drawer = __esm({
|
|
|
27070
27261
|
vertical: "bottom",
|
|
27071
27262
|
horizontal: "right"
|
|
27072
27263
|
},
|
|
27073
|
-
children: /* @__PURE__ */ (0,
|
|
27074
|
-
|
|
27264
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
27265
|
+
import_material45.MenuItem,
|
|
27075
27266
|
{
|
|
27076
27267
|
onClick: () => {
|
|
27077
27268
|
setClearConfirmOpen(true);
|
|
@@ -27079,27 +27270,27 @@ var init_conversation_drawer = __esm({
|
|
|
27079
27270
|
},
|
|
27080
27271
|
sx: { color: theme.palette.error.main },
|
|
27081
27272
|
children: [
|
|
27082
|
-
/* @__PURE__ */ (0,
|
|
27083
|
-
/* @__PURE__ */ (0,
|
|
27273
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react11.Trash2, { size: 16, color: theme.palette.error.main }) }),
|
|
27274
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.ListItemText, { children: "Clear All Conversations" })
|
|
27084
27275
|
]
|
|
27085
27276
|
}
|
|
27086
27277
|
)
|
|
27087
27278
|
}
|
|
27088
27279
|
),
|
|
27089
|
-
/* @__PURE__ */ (0,
|
|
27090
|
-
|
|
27280
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
27281
|
+
import_material45.Dialog,
|
|
27091
27282
|
{
|
|
27092
27283
|
open: clearConfirmOpen,
|
|
27093
27284
|
onClose: () => setClearConfirmOpen(false),
|
|
27094
27285
|
maxWidth: "sm",
|
|
27095
27286
|
fullWidth: true,
|
|
27096
27287
|
children: [
|
|
27097
|
-
/* @__PURE__ */ (0,
|
|
27098
|
-
/* @__PURE__ */ (0,
|
|
27099
|
-
/* @__PURE__ */ (0,
|
|
27100
|
-
/* @__PURE__ */ (0,
|
|
27101
|
-
/* @__PURE__ */ (0,
|
|
27102
|
-
|
|
27288
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.DialogTitle, { children: "Clear All Conversations?" }),
|
|
27289
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.DialogContent, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Typography, { children: "This will permanently delete all conversations and cannot be undone. Are you sure you want to continue?" }) }),
|
|
27290
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_material45.DialogActions, { children: [
|
|
27291
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Button, { onClick: () => setClearConfirmOpen(false), children: "Cancel" }),
|
|
27292
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
27293
|
+
import_material45.Button,
|
|
27103
27294
|
{
|
|
27104
27295
|
onClick: handleClearAllConfirm,
|
|
27105
27296
|
color: "error",
|
|
@@ -27118,12 +27309,12 @@ var init_conversation_drawer = __esm({
|
|
|
27118
27309
|
});
|
|
27119
27310
|
|
|
27120
27311
|
// src/chat/enhanced-mobile-conversations-modal.tsx
|
|
27121
|
-
var
|
|
27312
|
+
var import_react57, import_material46, import_lucide_react12, import_styles29, import_jsx_runtime46, BANDIT_AVATAR2, coerceOptionalString2, deriveInitials2, EnhancedMobileConversationsModal, enhanced_mobile_conversations_modal_default;
|
|
27122
27313
|
var init_enhanced_mobile_conversations_modal = __esm({
|
|
27123
27314
|
"src/chat/enhanced-mobile-conversations-modal.tsx"() {
|
|
27124
27315
|
"use strict";
|
|
27125
|
-
|
|
27126
|
-
|
|
27316
|
+
import_react57 = require("react");
|
|
27317
|
+
import_material46 = require("@mui/material");
|
|
27127
27318
|
import_lucide_react12 = require("lucide-react");
|
|
27128
27319
|
import_styles29 = require("@mui/material/styles");
|
|
27129
27320
|
init_conversationStore();
|
|
@@ -27138,7 +27329,7 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27138
27329
|
init_simple_conversation_item();
|
|
27139
27330
|
init_project_header();
|
|
27140
27331
|
init_debugLogger();
|
|
27141
|
-
|
|
27332
|
+
import_jsx_runtime46 = require("react/jsx-runtime");
|
|
27142
27333
|
BANDIT_AVATAR2 = "https://cdn.burtson.ai/images/bandit-head.png";
|
|
27143
27334
|
coerceOptionalString2 = (value) => {
|
|
27144
27335
|
if (typeof value !== "string") return void 0;
|
|
@@ -27189,25 +27380,25 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27189
27380
|
createProject,
|
|
27190
27381
|
deleteProject
|
|
27191
27382
|
} = useProjectStore();
|
|
27192
|
-
const [projectManagementOpen, setProjectManagementOpen] = (0,
|
|
27193
|
-
const [memoryModalOpen, setMemoryModalOpen] = (0,
|
|
27194
|
-
const [collapsedProjects, setCollapsedProjects] = (0,
|
|
27195
|
-
const didInitCollapseRef = (0,
|
|
27196
|
-
const [searchQuery, setSearchQuery] = (0,
|
|
27197
|
-
const [menuAnchorEl, setMenuAnchorEl] = (0,
|
|
27198
|
-
const [clearConfirmOpen, setClearConfirmOpen] = (0,
|
|
27199
|
-
const [moveModalOpen, setMoveModalOpen] = (0,
|
|
27200
|
-
const [conversationToMove, setConversationToMove] = (0,
|
|
27201
|
-
const [renameProjectId, setRenameProjectId] = (0,
|
|
27202
|
-
const [deletedConversationIds, setDeletedConversationIds] = (0,
|
|
27203
|
-
const [touchDragState, setTouchDragState] = (0,
|
|
27204
|
-
const [avatarImage, setAvatarImage] = (0,
|
|
27205
|
-
const getCustomClaim = (0,
|
|
27383
|
+
const [projectManagementOpen, setProjectManagementOpen] = (0, import_react57.useState)(false);
|
|
27384
|
+
const [memoryModalOpen, setMemoryModalOpen] = (0, import_react57.useState)(false);
|
|
27385
|
+
const [collapsedProjects, setCollapsedProjects] = (0, import_react57.useState)(/* @__PURE__ */ new Set());
|
|
27386
|
+
const didInitCollapseRef = (0, import_react57.useRef)(false);
|
|
27387
|
+
const [searchQuery, setSearchQuery] = (0, import_react57.useState)("");
|
|
27388
|
+
const [menuAnchorEl, setMenuAnchorEl] = (0, import_react57.useState)(null);
|
|
27389
|
+
const [clearConfirmOpen, setClearConfirmOpen] = (0, import_react57.useState)(false);
|
|
27390
|
+
const [moveModalOpen, setMoveModalOpen] = (0, import_react57.useState)(false);
|
|
27391
|
+
const [conversationToMove, setConversationToMove] = (0, import_react57.useState)(null);
|
|
27392
|
+
const [renameProjectId, setRenameProjectId] = (0, import_react57.useState)(null);
|
|
27393
|
+
const [deletedConversationIds, setDeletedConversationIds] = (0, import_react57.useState)(/* @__PURE__ */ new Set());
|
|
27394
|
+
const [touchDragState, setTouchDragState] = (0, import_react57.useState)({ conversationId: null, originProjectId: null, hoverProjectId: null });
|
|
27395
|
+
const [avatarImage, setAvatarImage] = (0, import_react57.useState)(BANDIT_AVATAR2);
|
|
27396
|
+
const getCustomClaim = (0, import_react57.useCallback)((key) => {
|
|
27206
27397
|
if (!user2) return void 0;
|
|
27207
27398
|
const record = user2;
|
|
27208
27399
|
return coerceOptionalString2(record[key]);
|
|
27209
27400
|
}, [user2]);
|
|
27210
|
-
const userDisplayName = (0,
|
|
27401
|
+
const userDisplayName = (0, import_react57.useMemo)(() => {
|
|
27211
27402
|
if (!user2) return void 0;
|
|
27212
27403
|
const candidateFields = [
|
|
27213
27404
|
coerceOptionalString2(user2.name),
|
|
@@ -27222,7 +27413,7 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27222
27413
|
if (trimmedEmail) return trimmedEmail;
|
|
27223
27414
|
return user2.sub;
|
|
27224
27415
|
}, [user2, getCustomClaim]);
|
|
27225
|
-
const userSecondaryText = (0,
|
|
27416
|
+
const userSecondaryText = (0, import_react57.useMemo)(() => {
|
|
27226
27417
|
if (!user2) return void 0;
|
|
27227
27418
|
const trimmedEmail = coerceOptionalString2(user2.email);
|
|
27228
27419
|
if (trimmedEmail && trimmedEmail !== userDisplayName) {
|
|
@@ -27234,7 +27425,7 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27234
27425
|
}
|
|
27235
27426
|
return void 0;
|
|
27236
27427
|
}, [user2, userDisplayName]);
|
|
27237
|
-
(0,
|
|
27428
|
+
(0, import_react57.useEffect)(() => {
|
|
27238
27429
|
if (!open) return;
|
|
27239
27430
|
const fresh = readPersistedToken();
|
|
27240
27431
|
const authStore = useAuthenticationStore.getState();
|
|
@@ -27279,18 +27470,18 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27279
27470
|
};
|
|
27280
27471
|
}, [open, getCustomClaim]);
|
|
27281
27472
|
const avatarLabel = userDisplayName || user2?.email || "Bandit";
|
|
27282
|
-
const avatarInitials = (0,
|
|
27473
|
+
const avatarInitials = (0, import_react57.useMemo)(() => deriveInitials2(avatarLabel), [avatarLabel]);
|
|
27283
27474
|
const buildSnippet = (text, query, idx) => {
|
|
27284
27475
|
const start = Math.max(0, idx - 40);
|
|
27285
27476
|
const end = Math.min(text.length, idx + query.length + 60);
|
|
27286
27477
|
return text.slice(start, end).replace(/\s+/g, " ").trim();
|
|
27287
27478
|
};
|
|
27288
|
-
(0,
|
|
27479
|
+
(0, import_react57.useEffect)(() => {
|
|
27289
27480
|
if (open && !projectsHydrated) {
|
|
27290
27481
|
hydrateProjects();
|
|
27291
27482
|
}
|
|
27292
27483
|
}, [open, projectsHydrated, hydrateProjects]);
|
|
27293
|
-
(0,
|
|
27484
|
+
(0, import_react57.useEffect)(() => {
|
|
27294
27485
|
if (projectsHydrated && !didInitCollapseRef.current) {
|
|
27295
27486
|
didInitCollapseRef.current = true;
|
|
27296
27487
|
if (projects && projects.length > 0) {
|
|
@@ -27298,7 +27489,7 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27298
27489
|
}
|
|
27299
27490
|
}
|
|
27300
27491
|
}, [projectsHydrated, projects]);
|
|
27301
|
-
const projectGroups = (0,
|
|
27492
|
+
const projectGroups = (0, import_react57.useMemo)(() => {
|
|
27302
27493
|
const visibleConversations = conversations.filter(
|
|
27303
27494
|
(conversation) => !deletedConversationIds.has(conversation.id)
|
|
27304
27495
|
);
|
|
@@ -27324,11 +27515,11 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27324
27515
|
}
|
|
27325
27516
|
return groups.filter((group) => group.conversations.length > 0 || group.id !== null);
|
|
27326
27517
|
}, [projects, conversations, collapsedProjects, deletedConversationIds]);
|
|
27327
|
-
const visibleConversationCount = (0,
|
|
27518
|
+
const visibleConversationCount = (0, import_react57.useMemo)(
|
|
27328
27519
|
() => projectGroups.reduce((total, group) => total + group.conversations.length, 0),
|
|
27329
27520
|
[projectGroups]
|
|
27330
27521
|
);
|
|
27331
|
-
const filteredProjectGroups = (0,
|
|
27522
|
+
const filteredProjectGroups = (0, import_react57.useMemo)(() => {
|
|
27332
27523
|
if (!searchQuery.trim()) return projectGroups;
|
|
27333
27524
|
const query = searchQuery.toLowerCase();
|
|
27334
27525
|
return projectGroups.map((group) => {
|
|
@@ -27353,14 +27544,14 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27353
27544
|
}).filter((group) => group.conversations.length > 0);
|
|
27354
27545
|
}, [projectGroups, searchQuery]);
|
|
27355
27546
|
const touchDragActive = Boolean(touchDragState.conversationId);
|
|
27356
|
-
const getProjectIdFromPoint = (0,
|
|
27547
|
+
const getProjectIdFromPoint = (0, import_react57.useCallback)((clientX, clientY) => {
|
|
27357
27548
|
if (typeof document === "undefined") return null;
|
|
27358
27549
|
const element = document.elementFromPoint(clientX, clientY);
|
|
27359
27550
|
if (!element) return null;
|
|
27360
27551
|
const projectNode = element.closest("[data-project-id]");
|
|
27361
27552
|
return projectNode?.getAttribute("data-project-id") ?? null;
|
|
27362
27553
|
}, []);
|
|
27363
|
-
const handleTouchDragStart = (0,
|
|
27554
|
+
const handleTouchDragStart = (0, import_react57.useCallback)((conversation, touch) => {
|
|
27364
27555
|
const initialHover = getProjectIdFromPoint(touch.clientX, touch.clientY);
|
|
27365
27556
|
setTouchDragState({
|
|
27366
27557
|
conversationId: conversation.id,
|
|
@@ -27368,7 +27559,7 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27368
27559
|
hoverProjectId: initialHover ?? (conversation.projectId ?? null)
|
|
27369
27560
|
});
|
|
27370
27561
|
}, [getProjectIdFromPoint]);
|
|
27371
|
-
const handleTouchDragMove = (0,
|
|
27562
|
+
const handleTouchDragMove = (0, import_react57.useCallback)((touch) => {
|
|
27372
27563
|
setTouchDragState((prev) => {
|
|
27373
27564
|
if (!prev.conversationId) return prev;
|
|
27374
27565
|
const hoverId = getProjectIdFromPoint(touch.clientX, touch.clientY);
|
|
@@ -27376,7 +27567,7 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27376
27567
|
return { ...prev, hoverProjectId: hoverId };
|
|
27377
27568
|
});
|
|
27378
27569
|
}, [getProjectIdFromPoint]);
|
|
27379
|
-
const handleTouchDragEnd = (0,
|
|
27570
|
+
const handleTouchDragEnd = (0, import_react57.useCallback)((touch) => {
|
|
27380
27571
|
setTouchDragState((prev) => {
|
|
27381
27572
|
if (!prev.conversationId) {
|
|
27382
27573
|
return { conversationId: null, originProjectId: null, hoverProjectId: null };
|
|
@@ -27404,11 +27595,11 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27404
27595
|
return { conversationId: null, originProjectId: null, hoverProjectId: null };
|
|
27405
27596
|
});
|
|
27406
27597
|
}, [getProjectIdFromPoint, moveConversationToProject]);
|
|
27407
|
-
const activeDragConversation = (0,
|
|
27598
|
+
const activeDragConversation = (0, import_react57.useMemo)(() => {
|
|
27408
27599
|
if (!touchDragState.conversationId) return null;
|
|
27409
27600
|
return conversations.find((conv) => conv.id === touchDragState.conversationId) || null;
|
|
27410
27601
|
}, [touchDragState.conversationId, conversations]);
|
|
27411
|
-
const activeHoverLabel = (0,
|
|
27602
|
+
const activeHoverLabel = (0, import_react57.useMemo)(() => {
|
|
27412
27603
|
if (!touchDragState.hoverProjectId) return "";
|
|
27413
27604
|
if (touchDragState.hoverProjectId === "__ungrouped") return "Ungrouped";
|
|
27414
27605
|
const project = projects.find((p) => p.id === touchDragState.hoverProjectId);
|
|
@@ -27457,7 +27648,7 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27457
27648
|
setMoveModalOpen(false);
|
|
27458
27649
|
setConversationToMove(null);
|
|
27459
27650
|
};
|
|
27460
|
-
(0,
|
|
27651
|
+
(0, import_react57.useEffect)(() => {
|
|
27461
27652
|
setDeletedConversationIds((prev) => {
|
|
27462
27653
|
let changed = false;
|
|
27463
27654
|
const active2 = new Set(conversations.map((conv) => conv.id));
|
|
@@ -27472,9 +27663,9 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27472
27663
|
return changed ? next : prev;
|
|
27473
27664
|
});
|
|
27474
27665
|
}, [conversations]);
|
|
27475
|
-
return /* @__PURE__ */ (0,
|
|
27476
|
-
/* @__PURE__ */ (0,
|
|
27477
|
-
|
|
27666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
27667
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
27668
|
+
import_material46.Modal,
|
|
27478
27669
|
{
|
|
27479
27670
|
open,
|
|
27480
27671
|
onClose,
|
|
@@ -27482,8 +27673,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27482
27673
|
display: "flex",
|
|
27483
27674
|
alignItems: "flex-end"
|
|
27484
27675
|
},
|
|
27485
|
-
children: /* @__PURE__ */ (0,
|
|
27486
|
-
|
|
27676
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Slide, { direction: "up", in: open, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
27677
|
+
import_material46.Box,
|
|
27487
27678
|
{
|
|
27488
27679
|
sx: {
|
|
27489
27680
|
width: "100%",
|
|
@@ -27496,8 +27687,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27496
27687
|
overflow: "hidden"
|
|
27497
27688
|
},
|
|
27498
27689
|
children: [
|
|
27499
|
-
/* @__PURE__ */ (0,
|
|
27500
|
-
|
|
27690
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
27691
|
+
import_material46.AppBar,
|
|
27501
27692
|
{
|
|
27502
27693
|
position: "static",
|
|
27503
27694
|
elevation: 0,
|
|
@@ -27506,10 +27697,10 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27506
27697
|
color: theme.palette.text.primary,
|
|
27507
27698
|
borderBottom: `1px solid ${theme.palette.divider}`
|
|
27508
27699
|
},
|
|
27509
|
-
children: /* @__PURE__ */ (0,
|
|
27510
|
-
/* @__PURE__ */ (0,
|
|
27511
|
-
visibleConversationCount > 0 && /* @__PURE__ */ (0,
|
|
27512
|
-
|
|
27700
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_material46.Toolbar, { children: [
|
|
27701
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Typography, { variant: "h6", sx: { flex: 1, fontWeight: 600 }, children: "Conversations" }),
|
|
27702
|
+
visibleConversationCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
27703
|
+
import_material46.Chip,
|
|
27513
27704
|
{
|
|
27514
27705
|
label: visibleConversationCount,
|
|
27515
27706
|
size: "small",
|
|
@@ -27521,44 +27712,44 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27521
27712
|
}
|
|
27522
27713
|
}
|
|
27523
27714
|
),
|
|
27524
|
-
/* @__PURE__ */ (0,
|
|
27525
|
-
|
|
27715
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
27716
|
+
import_material46.IconButton,
|
|
27526
27717
|
{
|
|
27527
27718
|
onClick: () => setMemoryModalOpen(true),
|
|
27528
27719
|
"aria-label": "Memory",
|
|
27529
27720
|
sx: { color: theme.palette.text.secondary },
|
|
27530
|
-
children: /* @__PURE__ */ (0,
|
|
27721
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react12.Brain, {})
|
|
27531
27722
|
}
|
|
27532
27723
|
),
|
|
27533
|
-
/* @__PURE__ */ (0,
|
|
27534
|
-
|
|
27724
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
27725
|
+
import_material46.IconButton,
|
|
27535
27726
|
{
|
|
27536
27727
|
onClick: () => setProjectManagementOpen(true),
|
|
27537
27728
|
sx: { color: theme.palette.text.secondary },
|
|
27538
|
-
children: /* @__PURE__ */ (0,
|
|
27729
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react12.Folder, {})
|
|
27539
27730
|
}
|
|
27540
27731
|
),
|
|
27541
|
-
/* @__PURE__ */ (0,
|
|
27542
|
-
|
|
27732
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
27733
|
+
import_material46.IconButton,
|
|
27543
27734
|
{
|
|
27544
27735
|
onClick: handleMenuOpen,
|
|
27545
27736
|
sx: { color: theme.palette.text.secondary },
|
|
27546
|
-
children: /* @__PURE__ */ (0,
|
|
27737
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react12.MoreVertical, {})
|
|
27547
27738
|
}
|
|
27548
27739
|
),
|
|
27549
|
-
/* @__PURE__ */ (0,
|
|
27550
|
-
|
|
27740
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
27741
|
+
import_material46.IconButton,
|
|
27551
27742
|
{
|
|
27552
27743
|
onClick: onClose,
|
|
27553
27744
|
sx: { color: theme.palette.text.secondary },
|
|
27554
|
-
children: /* @__PURE__ */ (0,
|
|
27745
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react12.X, {})
|
|
27555
27746
|
}
|
|
27556
27747
|
)
|
|
27557
27748
|
] })
|
|
27558
27749
|
}
|
|
27559
27750
|
),
|
|
27560
|
-
/* @__PURE__ */ (0,
|
|
27561
|
-
|
|
27751
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Box, { sx: { p: 2, pb: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
27752
|
+
import_material46.TextField,
|
|
27562
27753
|
{
|
|
27563
27754
|
fullWidth: true,
|
|
27564
27755
|
size: "small",
|
|
@@ -27567,22 +27758,22 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27567
27758
|
onChange: (e) => setSearchQuery(e.target.value),
|
|
27568
27759
|
variant: "outlined",
|
|
27569
27760
|
InputProps: {
|
|
27570
|
-
startAdornment: /* @__PURE__ */ (0,
|
|
27571
|
-
endAdornment: searchQuery && /* @__PURE__ */ (0,
|
|
27572
|
-
|
|
27761
|
+
startAdornment: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.InputAdornment, { position: "start", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react12.Search, { size: 16, color: theme.palette.text.secondary }) }),
|
|
27762
|
+
endAdornment: searchQuery && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.InputAdornment, { position: "end", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
27763
|
+
import_material46.IconButton,
|
|
27573
27764
|
{
|
|
27574
27765
|
onClick: handleSearchClear,
|
|
27575
27766
|
size: "small",
|
|
27576
27767
|
edge: "end",
|
|
27577
27768
|
sx: { color: theme.palette.text.secondary },
|
|
27578
|
-
children: /* @__PURE__ */ (0,
|
|
27769
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react12.X, { size: 16 })
|
|
27579
27770
|
}
|
|
27580
27771
|
) })
|
|
27581
27772
|
}
|
|
27582
27773
|
}
|
|
27583
27774
|
) }),
|
|
27584
|
-
/* @__PURE__ */ (0,
|
|
27585
|
-
|
|
27775
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
27776
|
+
import_material46.Box,
|
|
27586
27777
|
{
|
|
27587
27778
|
sx: {
|
|
27588
27779
|
flex: 1,
|
|
@@ -27593,8 +27784,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27593
27784
|
pb: 2
|
|
27594
27785
|
},
|
|
27595
27786
|
children: [
|
|
27596
|
-
touchDragActive && activeDragConversation && /* @__PURE__ */ (0,
|
|
27597
|
-
|
|
27787
|
+
touchDragActive && activeDragConversation && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
27788
|
+
import_material46.Box,
|
|
27598
27789
|
{
|
|
27599
27790
|
sx: {
|
|
27600
27791
|
position: "absolute",
|
|
@@ -27619,8 +27810,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27619
27810
|
overflow: "hidden"
|
|
27620
27811
|
},
|
|
27621
27812
|
children: [
|
|
27622
|
-
/* @__PURE__ */ (0,
|
|
27623
|
-
|
|
27813
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
27814
|
+
import_material46.Typography,
|
|
27624
27815
|
{
|
|
27625
27816
|
variant: "caption",
|
|
27626
27817
|
sx: {
|
|
@@ -27632,8 +27823,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27632
27823
|
},
|
|
27633
27824
|
children: [
|
|
27634
27825
|
"Move",
|
|
27635
|
-
/* @__PURE__ */ (0,
|
|
27636
|
-
|
|
27826
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
27827
|
+
import_material46.Box,
|
|
27637
27828
|
{
|
|
27638
27829
|
component: "span",
|
|
27639
27830
|
sx: {
|
|
@@ -27653,8 +27844,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27653
27844
|
]
|
|
27654
27845
|
}
|
|
27655
27846
|
),
|
|
27656
|
-
/* @__PURE__ */ (0,
|
|
27657
|
-
|
|
27847
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
27848
|
+
import_material46.Typography,
|
|
27658
27849
|
{
|
|
27659
27850
|
variant: "caption",
|
|
27660
27851
|
color: "inherit",
|
|
@@ -27662,11 +27853,11 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27662
27853
|
fontWeight: 500,
|
|
27663
27854
|
whiteSpace: "nowrap"
|
|
27664
27855
|
},
|
|
27665
|
-
children: activeHoverLabel ? /* @__PURE__ */ (0,
|
|
27856
|
+
children: activeHoverLabel ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
27666
27857
|
"to",
|
|
27667
27858
|
" ",
|
|
27668
|
-
/* @__PURE__ */ (0,
|
|
27669
|
-
|
|
27859
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
27860
|
+
import_material46.Box,
|
|
27670
27861
|
{
|
|
27671
27862
|
component: "span",
|
|
27672
27863
|
sx: {
|
|
@@ -27682,8 +27873,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27682
27873
|
]
|
|
27683
27874
|
}
|
|
27684
27875
|
),
|
|
27685
|
-
/* @__PURE__ */ (0,
|
|
27686
|
-
|
|
27876
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
27877
|
+
import_material46.Box,
|
|
27687
27878
|
{
|
|
27688
27879
|
onClick: async () => {
|
|
27689
27880
|
const names = new Set(projects.map((p) => p.name));
|
|
@@ -27717,8 +27908,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27717
27908
|
"&:hover": { bgcolor: (0, import_styles29.alpha)(theme.palette.text.primary, 0.04) }
|
|
27718
27909
|
},
|
|
27719
27910
|
children: [
|
|
27720
|
-
/* @__PURE__ */ (0,
|
|
27721
|
-
|
|
27911
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
27912
|
+
import_material46.Box,
|
|
27722
27913
|
{
|
|
27723
27914
|
sx: {
|
|
27724
27915
|
width: 28,
|
|
@@ -27730,25 +27921,25 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27730
27921
|
justifyContent: "center",
|
|
27731
27922
|
flexShrink: 0
|
|
27732
27923
|
},
|
|
27733
|
-
children: /* @__PURE__ */ (0,
|
|
27924
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react12.Folder, { size: 16, color: theme.palette.success.main })
|
|
27734
27925
|
}
|
|
27735
27926
|
),
|
|
27736
|
-
/* @__PURE__ */ (0,
|
|
27737
|
-
|
|
27927
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
27928
|
+
import_material46.Typography,
|
|
27738
27929
|
{
|
|
27739
27930
|
variant: "subtitle2",
|
|
27740
27931
|
sx: { flex: 1, fontWeight: 600, fontSize: "0.875rem" },
|
|
27741
27932
|
children: "New Project"
|
|
27742
27933
|
}
|
|
27743
27934
|
),
|
|
27744
|
-
/* @__PURE__ */ (0,
|
|
27935
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.IconButton, { size: "small", sx: { color: theme.palette.success.main }, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react12.Plus, { size: 16 }) })
|
|
27745
27936
|
]
|
|
27746
27937
|
}
|
|
27747
27938
|
),
|
|
27748
|
-
/* @__PURE__ */ (0,
|
|
27749
|
-
filteredProjectGroups.map((group, index) => /* @__PURE__ */ (0,
|
|
27750
|
-
group.id === null && filteredProjectGroups.length > 1 && /* @__PURE__ */ (0,
|
|
27751
|
-
|
|
27939
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Divider, { sx: { opacity: 0.3 } }),
|
|
27940
|
+
filteredProjectGroups.map((group, index) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_material46.Box, { children: [
|
|
27941
|
+
group.id === null && filteredProjectGroups.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
27942
|
+
import_material46.Box,
|
|
27752
27943
|
{
|
|
27753
27944
|
sx: {
|
|
27754
27945
|
py: 2,
|
|
@@ -27758,9 +27949,9 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27758
27949
|
gap: 2
|
|
27759
27950
|
},
|
|
27760
27951
|
children: [
|
|
27761
|
-
/* @__PURE__ */ (0,
|
|
27762
|
-
/* @__PURE__ */ (0,
|
|
27763
|
-
/* @__PURE__ */ (0,
|
|
27952
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Divider, { sx: { flex: 1, opacity: 0.6 } }),
|
|
27953
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_material46.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
27954
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
27764
27955
|
import_lucide_react12.Inbox,
|
|
27765
27956
|
{
|
|
27766
27957
|
size: 14,
|
|
@@ -27768,8 +27959,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27768
27959
|
style: { opacity: 0.7 }
|
|
27769
27960
|
}
|
|
27770
27961
|
),
|
|
27771
|
-
/* @__PURE__ */ (0,
|
|
27772
|
-
|
|
27962
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
27963
|
+
import_material46.Typography,
|
|
27773
27964
|
{
|
|
27774
27965
|
variant: "caption",
|
|
27775
27966
|
sx: {
|
|
@@ -27783,12 +27974,12 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27783
27974
|
}
|
|
27784
27975
|
)
|
|
27785
27976
|
] }),
|
|
27786
|
-
/* @__PURE__ */ (0,
|
|
27977
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Divider, { sx: { flex: 1, opacity: 0.6 } })
|
|
27787
27978
|
]
|
|
27788
27979
|
}
|
|
27789
27980
|
),
|
|
27790
|
-
group.id !== null ? /* @__PURE__ */ (0,
|
|
27791
|
-
/* @__PURE__ */ (0,
|
|
27981
|
+
group.id !== null ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
27982
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
27792
27983
|
project_header_default,
|
|
27793
27984
|
{
|
|
27794
27985
|
projectId: group.id,
|
|
@@ -27818,8 +28009,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27818
28009
|
isTouchTarget: touchDragActive && touchDragState.hoverProjectId === group.id
|
|
27819
28010
|
}
|
|
27820
28011
|
),
|
|
27821
|
-
/* @__PURE__ */ (0,
|
|
27822
|
-
|
|
28012
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Collapse, { in: !group.collapsed, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
28013
|
+
import_material46.Box,
|
|
27823
28014
|
{
|
|
27824
28015
|
"data-project-id": group.id ?? "__ungrouped",
|
|
27825
28016
|
sx: {
|
|
@@ -27829,7 +28020,7 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27829
28020
|
transition: "border 0.2s ease, background-color 0.2s ease",
|
|
27830
28021
|
backgroundColor: touchDragActive && touchDragState.hoverProjectId === group.id ? (0, import_styles29.alpha)(theme.palette.primary.main, 0.08) : "transparent"
|
|
27831
28022
|
},
|
|
27832
|
-
children: group.conversations.map((conversation) => /* @__PURE__ */ (0,
|
|
28023
|
+
children: group.conversations.map((conversation) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
27833
28024
|
simple_conversation_item_default,
|
|
27834
28025
|
{
|
|
27835
28026
|
conversation,
|
|
@@ -27863,8 +28054,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27863
28054
|
) })
|
|
27864
28055
|
] }) : (
|
|
27865
28056
|
// Special handling for ungrouped - no header, just conversations in scrollable area
|
|
27866
|
-
/* @__PURE__ */ (0,
|
|
27867
|
-
|
|
28057
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
28058
|
+
import_material46.Box,
|
|
27868
28059
|
{
|
|
27869
28060
|
sx: {
|
|
27870
28061
|
minHeight: 0,
|
|
@@ -27880,7 +28071,7 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27880
28071
|
backgroundColor: touchDragActive && touchDragState.hoverProjectId === "__ungrouped" ? (0, import_styles29.alpha)(theme.palette.primary.main, 0.08) : (0, import_styles29.alpha)(theme.palette.background.default, 0.3)
|
|
27881
28072
|
},
|
|
27882
28073
|
"data-project-id": "__ungrouped",
|
|
27883
|
-
children: group.conversations.map((conversation) => /* @__PURE__ */ (0,
|
|
28074
|
+
children: group.conversations.map((conversation) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
27884
28075
|
simple_conversation_item_default,
|
|
27885
28076
|
{
|
|
27886
28077
|
conversation,
|
|
@@ -27914,8 +28105,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27914
28105
|
)
|
|
27915
28106
|
)
|
|
27916
28107
|
] }, group.id || "ungrouped")),
|
|
27917
|
-
filteredProjectGroups.length === 0 && /* @__PURE__ */ (0,
|
|
27918
|
-
|
|
28108
|
+
filteredProjectGroups.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
28109
|
+
import_material46.Box,
|
|
27919
28110
|
{
|
|
27920
28111
|
sx: {
|
|
27921
28112
|
flex: 1,
|
|
@@ -27928,16 +28119,16 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27928
28119
|
color: theme.palette.text.secondary
|
|
27929
28120
|
},
|
|
27930
28121
|
children: [
|
|
27931
|
-
/* @__PURE__ */ (0,
|
|
27932
|
-
/* @__PURE__ */ (0,
|
|
28122
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Typography, { variant: "h6", sx: { mb: 1 }, children: searchQuery ? "No conversations found" : "No conversations yet" }),
|
|
28123
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Typography, { variant: "body2", sx: { mb: 3, maxWidth: 280 }, children: searchQuery ? `No conversations match "${searchQuery}"` : "Start your first conversation to begin organizing your chats into projects" })
|
|
27933
28124
|
]
|
|
27934
28125
|
}
|
|
27935
28126
|
)
|
|
27936
28127
|
]
|
|
27937
28128
|
}
|
|
27938
28129
|
),
|
|
27939
|
-
/* @__PURE__ */ (0,
|
|
27940
|
-
|
|
28130
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
28131
|
+
import_material46.Box,
|
|
27941
28132
|
{
|
|
27942
28133
|
onClick: user2 ? () => {
|
|
27943
28134
|
window.location.href = "/profile";
|
|
@@ -27954,8 +28145,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27954
28145
|
cursor: user2 ? "pointer" : "default"
|
|
27955
28146
|
},
|
|
27956
28147
|
children: [
|
|
27957
|
-
/* @__PURE__ */ (0,
|
|
27958
|
-
|
|
28148
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
28149
|
+
import_material46.Avatar,
|
|
27959
28150
|
{
|
|
27960
28151
|
src: avatarImage,
|
|
27961
28152
|
alt: avatarLabel,
|
|
@@ -27969,9 +28160,9 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27969
28160
|
children: avatarInitials
|
|
27970
28161
|
}
|
|
27971
28162
|
),
|
|
27972
|
-
/* @__PURE__ */ (0,
|
|
27973
|
-
/* @__PURE__ */ (0,
|
|
27974
|
-
|
|
28163
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_material46.Box, { sx: { display: "flex", flexDirection: "column", flex: 1, minWidth: 0, gap: 0.25 }, children: [
|
|
28164
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
28165
|
+
import_material46.Typography,
|
|
27975
28166
|
{
|
|
27976
28167
|
variant: "subtitle2",
|
|
27977
28168
|
noWrap: true,
|
|
@@ -27979,8 +28170,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27979
28170
|
children: user2 ? userDisplayName : "Not signed in"
|
|
27980
28171
|
}
|
|
27981
28172
|
),
|
|
27982
|
-
/* @__PURE__ */ (0,
|
|
27983
|
-
|
|
28173
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
28174
|
+
import_material46.Typography,
|
|
27984
28175
|
{
|
|
27985
28176
|
variant: "caption",
|
|
27986
28177
|
noWrap: true,
|
|
@@ -27989,9 +28180,9 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
27989
28180
|
}
|
|
27990
28181
|
)
|
|
27991
28182
|
] }),
|
|
27992
|
-
user2 && /* @__PURE__ */ (0,
|
|
27993
|
-
/* @__PURE__ */ (0,
|
|
27994
|
-
|
|
28183
|
+
user2 && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
28184
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
28185
|
+
import_material46.Box,
|
|
27995
28186
|
{
|
|
27996
28187
|
sx: {
|
|
27997
28188
|
flexShrink: 0,
|
|
@@ -28004,11 +28195,11 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
28004
28195
|
border: `1px solid ${(0, import_styles29.alpha)(theme.palette.divider, 0.8)}`,
|
|
28005
28196
|
color: theme.palette.text.secondary
|
|
28006
28197
|
},
|
|
28007
|
-
children: /* @__PURE__ */ (0,
|
|
28198
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react12.Settings, { size: 16 })
|
|
28008
28199
|
}
|
|
28009
28200
|
),
|
|
28010
|
-
/* @__PURE__ */ (0,
|
|
28011
|
-
|
|
28201
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
28202
|
+
import_material46.IconButton,
|
|
28012
28203
|
{
|
|
28013
28204
|
"aria-label": "Sign out",
|
|
28014
28205
|
title: "Sign out",
|
|
@@ -28025,7 +28216,7 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
28025
28216
|
color: theme.palette.error.main,
|
|
28026
28217
|
"&:hover": { bgcolor: (0, import_styles29.alpha)(theme.palette.error.main, 0.1) }
|
|
28027
28218
|
},
|
|
28028
|
-
children: /* @__PURE__ */ (0,
|
|
28219
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react12.LogOut, { size: 16 })
|
|
28029
28220
|
}
|
|
28030
28221
|
)
|
|
28031
28222
|
] })
|
|
@@ -28037,15 +28228,15 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
28037
28228
|
) })
|
|
28038
28229
|
}
|
|
28039
28230
|
),
|
|
28040
|
-
/* @__PURE__ */ (0,
|
|
28231
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
28041
28232
|
project_management_modal_default,
|
|
28042
28233
|
{
|
|
28043
28234
|
open: projectManagementOpen,
|
|
28044
28235
|
onClose: () => setProjectManagementOpen(false)
|
|
28045
28236
|
}
|
|
28046
28237
|
),
|
|
28047
|
-
/* @__PURE__ */ (0,
|
|
28048
|
-
conversationToMove && /* @__PURE__ */ (0,
|
|
28238
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(memory_modal_default, { open: memoryModalOpen, onClose: () => setMemoryModalOpen(false) }),
|
|
28239
|
+
conversationToMove && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
28049
28240
|
move_conversation_modal_default,
|
|
28050
28241
|
{
|
|
28051
28242
|
open: moveModalOpen,
|
|
@@ -28054,8 +28245,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
28054
28245
|
currentProjectId: conversationToMove.projectId
|
|
28055
28246
|
}
|
|
28056
28247
|
),
|
|
28057
|
-
/* @__PURE__ */ (0,
|
|
28058
|
-
|
|
28248
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
28249
|
+
import_material46.Menu,
|
|
28059
28250
|
{
|
|
28060
28251
|
anchorEl: menuAnchorEl,
|
|
28061
28252
|
open: Boolean(menuAnchorEl),
|
|
@@ -28068,8 +28259,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
28068
28259
|
vertical: "bottom",
|
|
28069
28260
|
horizontal: "right"
|
|
28070
28261
|
},
|
|
28071
|
-
children: /* @__PURE__ */ (0,
|
|
28072
|
-
|
|
28262
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
28263
|
+
import_material46.MenuItem,
|
|
28073
28264
|
{
|
|
28074
28265
|
onClick: () => {
|
|
28075
28266
|
setClearConfirmOpen(true);
|
|
@@ -28078,27 +28269,27 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
28078
28269
|
disabled: visibleConversationCount === 0,
|
|
28079
28270
|
sx: { color: theme.palette.error.main },
|
|
28080
28271
|
children: [
|
|
28081
|
-
/* @__PURE__ */ (0,
|
|
28082
|
-
/* @__PURE__ */ (0,
|
|
28272
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react12.Trash2, { size: 16, color: theme.palette.error.main }) }),
|
|
28273
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.ListItemText, { children: "Clear All Conversations" })
|
|
28083
28274
|
]
|
|
28084
28275
|
}
|
|
28085
28276
|
)
|
|
28086
28277
|
}
|
|
28087
28278
|
),
|
|
28088
|
-
/* @__PURE__ */ (0,
|
|
28089
|
-
|
|
28279
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
28280
|
+
import_material46.Dialog,
|
|
28090
28281
|
{
|
|
28091
28282
|
open: clearConfirmOpen,
|
|
28092
28283
|
onClose: () => setClearConfirmOpen(false),
|
|
28093
28284
|
maxWidth: "sm",
|
|
28094
28285
|
fullWidth: true,
|
|
28095
28286
|
children: [
|
|
28096
|
-
/* @__PURE__ */ (0,
|
|
28097
|
-
/* @__PURE__ */ (0,
|
|
28098
|
-
/* @__PURE__ */ (0,
|
|
28099
|
-
/* @__PURE__ */ (0,
|
|
28100
|
-
/* @__PURE__ */ (0,
|
|
28101
|
-
|
|
28287
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.DialogTitle, { children: "Clear All Conversations?" }),
|
|
28288
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.DialogContent, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Typography, { children: visibleConversationCount === 0 ? "No conversations available to clear." : `This will permanently delete ${visibleConversationCount} conversation${visibleConversationCount === 1 ? "" : "s"} and cannot be undone.` }) }),
|
|
28289
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_material46.DialogActions, { children: [
|
|
28290
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Button, { onClick: () => setClearConfirmOpen(false), children: "Cancel" }),
|
|
28291
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
28292
|
+
import_material46.Button,
|
|
28102
28293
|
{
|
|
28103
28294
|
onClick: handleClearAllConfirm,
|
|
28104
28295
|
color: "error",
|
|
@@ -28117,15 +28308,15 @@ var init_enhanced_mobile_conversations_modal = __esm({
|
|
|
28117
28308
|
});
|
|
28118
28309
|
|
|
28119
28310
|
// src/chat/chat-app-bar.tsx
|
|
28120
|
-
var
|
|
28311
|
+
var import_material47, import_react58, import_material48, import_react_router_dom3, import_shallow2, import_jsx_runtime47, CDN_BASE2, banditHead4, modelAvatars3, ChatAppBar, chat_app_bar_default;
|
|
28121
28312
|
var init_chat_app_bar = __esm({
|
|
28122
28313
|
"src/chat/chat-app-bar.tsx"() {
|
|
28123
28314
|
"use strict";
|
|
28124
|
-
import_material46 = require("@mui/material");
|
|
28125
|
-
init_modelStore();
|
|
28126
|
-
import_react57 = require("react");
|
|
28127
28315
|
import_material47 = require("@mui/material");
|
|
28128
|
-
|
|
28316
|
+
init_modelStore();
|
|
28317
|
+
import_react58 = require("react");
|
|
28318
|
+
import_material48 = require("@mui/material");
|
|
28319
|
+
import_react_router_dom3 = require("react-router-dom");
|
|
28129
28320
|
init_lucide_icons();
|
|
28130
28321
|
init_util();
|
|
28131
28322
|
init_conversation_drawer();
|
|
@@ -28139,7 +28330,7 @@ var init_chat_app_bar = __esm({
|
|
|
28139
28330
|
init_conversationSyncStore();
|
|
28140
28331
|
init_engineStore();
|
|
28141
28332
|
import_shallow2 = require("zustand/shallow");
|
|
28142
|
-
|
|
28333
|
+
import_jsx_runtime47 = require("react/jsx-runtime");
|
|
28143
28334
|
CDN_BASE2 = "https://cdn.burtson.ai/";
|
|
28144
28335
|
banditHead4 = `${CDN_BASE2}/images/bandit-head.png`;
|
|
28145
28336
|
modelAvatars3 = {
|
|
@@ -28158,12 +28349,12 @@ var init_chat_app_bar = __esm({
|
|
|
28158
28349
|
drawerOpen,
|
|
28159
28350
|
setDrawerOpen
|
|
28160
28351
|
}) => {
|
|
28161
|
-
const theme = (0,
|
|
28162
|
-
const isMobile = (0,
|
|
28163
|
-
const hasLoggedRouterWarningRef = (0,
|
|
28352
|
+
const theme = (0, import_material48.useTheme)();
|
|
28353
|
+
const isMobile = (0, import_material48.useMediaQuery)(theme.breakpoints.down("sm"));
|
|
28354
|
+
const hasLoggedRouterWarningRef = (0, import_react58.useRef)(false);
|
|
28164
28355
|
let navigate = null;
|
|
28165
28356
|
try {
|
|
28166
|
-
navigate = (0,
|
|
28357
|
+
navigate = (0, import_react_router_dom3.useNavigate)();
|
|
28167
28358
|
} catch (error) {
|
|
28168
28359
|
if (!hasLoggedRouterWarningRef.current) {
|
|
28169
28360
|
debugLogger.warn("ChatAppBar: Navigation not available (missing Router context)", { error });
|
|
@@ -28172,6 +28363,10 @@ var init_chat_app_bar = __esm({
|
|
|
28172
28363
|
navigate = null;
|
|
28173
28364
|
}
|
|
28174
28365
|
const safeNavigate = (to) => {
|
|
28366
|
+
if (typeof window !== "undefined" && /^https?:\/\//.test(to)) {
|
|
28367
|
+
window.location.href = to;
|
|
28368
|
+
return;
|
|
28369
|
+
}
|
|
28175
28370
|
if (navigate) {
|
|
28176
28371
|
navigate(to);
|
|
28177
28372
|
} else if (typeof window !== "undefined") {
|
|
@@ -28186,12 +28381,12 @@ var init_chat_app_bar = __esm({
|
|
|
28186
28381
|
menuBackground,
|
|
28187
28382
|
menuText
|
|
28188
28383
|
} = theme.palette.chat.appBar;
|
|
28189
|
-
const [modelAnchorEl, setModelAnchorEl] = (0,
|
|
28190
|
-
const [engineAnchorEl, setEngineAnchorEl] = (0,
|
|
28191
|
-
const [voiceAnchorEl, setVoiceAnchorEl] = (0,
|
|
28192
|
-
const [modalOpen, setModalOpen] = (0,
|
|
28193
|
-
const [confirmModelChangeOpen, setConfirmModelChangeOpen] = (0,
|
|
28194
|
-
const [pendingModel, setPendingModel] = (0,
|
|
28384
|
+
const [modelAnchorEl, setModelAnchorEl] = (0, import_react58.useState)(null);
|
|
28385
|
+
const [engineAnchorEl, setEngineAnchorEl] = (0, import_react58.useState)(null);
|
|
28386
|
+
const [voiceAnchorEl, setVoiceAnchorEl] = (0, import_react58.useState)(null);
|
|
28387
|
+
const [modalOpen, setModalOpen] = (0, import_react58.useState)(false);
|
|
28388
|
+
const [confirmModelChangeOpen, setConfirmModelChangeOpen] = (0, import_react58.useState)(false);
|
|
28389
|
+
const [pendingModel, setPendingModel] = (0, import_react58.useState)(null);
|
|
28195
28390
|
const { conversations, currentId, createNewConversation, _hasHydrated } = useConversationStore();
|
|
28196
28391
|
const { preferences } = usePreferencesStore();
|
|
28197
28392
|
const { settings: packageSettings } = usePackageSettingsStore();
|
|
@@ -28217,7 +28412,7 @@ var init_chat_app_bar = __esm({
|
|
|
28217
28412
|
triggerSync: state.runSync,
|
|
28218
28413
|
setSyncEnabled: state.setSyncEnabled
|
|
28219
28414
|
}), import_shallow2.shallow);
|
|
28220
|
-
(0,
|
|
28415
|
+
(0, import_react58.useEffect)(() => {
|
|
28221
28416
|
if (isPlaygroundMode3 && syncEnabled) {
|
|
28222
28417
|
void setSyncEnabled(false).catch((error) => {
|
|
28223
28418
|
debugLogger.warn("ChatAppBar: Failed to disable sync in playground", {
|
|
@@ -28235,16 +28430,16 @@ var init_chat_app_bar = __esm({
|
|
|
28235
28430
|
};
|
|
28236
28431
|
const syncIndicatorIcon = (() => {
|
|
28237
28432
|
if (isPlaygroundMode3 || !syncEnabled) {
|
|
28238
|
-
return /* @__PURE__ */ (0,
|
|
28433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(CloudOffIcon, { fontSize: "small", color: "disabled" });
|
|
28239
28434
|
}
|
|
28240
28435
|
switch (syncStatus) {
|
|
28241
28436
|
case "syncing":
|
|
28242
|
-
return /* @__PURE__ */ (0,
|
|
28437
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SyncIcon, { fontSize: "small", sx: syncSpinSx, color: "primary" });
|
|
28243
28438
|
case "error":
|
|
28244
|
-
return /* @__PURE__ */ (0,
|
|
28439
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ErrorOutlineIcon, { fontSize: "small", color: "error" });
|
|
28245
28440
|
case "idle":
|
|
28246
28441
|
default:
|
|
28247
|
-
return /* @__PURE__ */ (0,
|
|
28442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(CloudDoneIcon, { fontSize: "small", color: "success" });
|
|
28248
28443
|
}
|
|
28249
28444
|
})();
|
|
28250
28445
|
const syncTooltip = (() => {
|
|
@@ -28284,7 +28479,7 @@ var init_chat_app_bar = __esm({
|
|
|
28284
28479
|
const tier = String(getCurrentTier());
|
|
28285
28480
|
return tier !== "trial" && tier !== "expired" && tier !== "free" && tier !== "basic";
|
|
28286
28481
|
})();
|
|
28287
|
-
const plansPath = "/plans";
|
|
28482
|
+
const plansPath = typeof window !== "undefined" && !(window.location.hostname === "banditailabs.com" || window.location.hostname.endsWith(".banditailabs.com") || window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1") ? "https://banditailabs.com/plans" : "/plans";
|
|
28288
28483
|
const isTTSAvailable = !!packageSettings?.gatewayApiUrl && preferences.ttsEnabled && hasTTS();
|
|
28289
28484
|
const currentConversation = conversations.find((c) => c.id === currentId);
|
|
28290
28485
|
const conversationCountDisplay = conversations.length > 99 ? "99+" : conversations.length.toString();
|
|
@@ -28321,7 +28516,7 @@ var init_chat_app_bar = __esm({
|
|
|
28321
28516
|
const resolvedEngineId = currentEngine?.id ?? effectiveEngineId;
|
|
28322
28517
|
const cleanEngineName = (name) => (name || "").replace(/\s*\([^)]*\)\s*$/, "").trim();
|
|
28323
28518
|
const engineDisplay = cleanEngineName(currentEngine?.displayName) || "Engine";
|
|
28324
|
-
(0,
|
|
28519
|
+
(0, import_react58.useEffect)(() => {
|
|
28325
28520
|
useEngineStore.getState().fetchEngines();
|
|
28326
28521
|
}, []);
|
|
28327
28522
|
const pendingModelAvatar = useModelStore.getState().availableModels.find((m) => m.name === pendingModel)?.avatarBase64 || modelAvatars3[pendingModel || ""] || banditHead4;
|
|
@@ -28356,9 +28551,9 @@ var init_chat_app_bar = __esm({
|
|
|
28356
28551
|
}
|
|
28357
28552
|
safeNavigate("/");
|
|
28358
28553
|
}
|
|
28359
|
-
return /* @__PURE__ */ (0,
|
|
28360
|
-
/* @__PURE__ */ (0,
|
|
28361
|
-
|
|
28554
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
28555
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
28556
|
+
import_material48.Box,
|
|
28362
28557
|
{
|
|
28363
28558
|
sx: {
|
|
28364
28559
|
position: "fixed",
|
|
@@ -28378,8 +28573,8 @@ var init_chat_app_bar = __esm({
|
|
|
28378
28573
|
}
|
|
28379
28574
|
},
|
|
28380
28575
|
children: [
|
|
28381
|
-
/* @__PURE__ */ (0,
|
|
28382
|
-
|
|
28576
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
28577
|
+
import_material48.Box,
|
|
28383
28578
|
{
|
|
28384
28579
|
sx: {
|
|
28385
28580
|
display: "flex",
|
|
@@ -28399,17 +28594,17 @@ var init_chat_app_bar = __esm({
|
|
|
28399
28594
|
}
|
|
28400
28595
|
},
|
|
28401
28596
|
children: [
|
|
28402
|
-
/* @__PURE__ */ (0,
|
|
28403
|
-
|
|
28597
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Tooltip, { title: homeTooltip, arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28598
|
+
import_material48.IconButton,
|
|
28404
28599
|
{
|
|
28405
28600
|
onClick: goToHome,
|
|
28406
28601
|
sx: pillButtonStyles,
|
|
28407
28602
|
"aria-label": "Go to home page",
|
|
28408
|
-
children: /* @__PURE__ */ (0,
|
|
28603
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(HomeIcon, {})
|
|
28409
28604
|
}
|
|
28410
28605
|
) }),
|
|
28411
|
-
showLimitedAdminPanel() && /* @__PURE__ */ (0,
|
|
28412
|
-
|
|
28606
|
+
showLimitedAdminPanel() && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Tooltip, { title: "Management & Settings", arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28607
|
+
import_material48.IconButton,
|
|
28413
28608
|
{
|
|
28414
28609
|
onClick: () => safeNavigate(managementPath),
|
|
28415
28610
|
sx: {
|
|
@@ -28420,11 +28615,11 @@ var init_chat_app_bar = __esm({
|
|
|
28420
28615
|
}
|
|
28421
28616
|
},
|
|
28422
28617
|
"aria-label": "Open management settings",
|
|
28423
|
-
children: /* @__PURE__ */ (0,
|
|
28618
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SettingsIcon, {})
|
|
28424
28619
|
}
|
|
28425
28620
|
) }),
|
|
28426
|
-
/* @__PURE__ */ (0,
|
|
28427
|
-
|
|
28621
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Tooltip, { title: syncTooltip, arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
28622
|
+
import_material48.IconButton,
|
|
28428
28623
|
{
|
|
28429
28624
|
onClick: handleSyncBadgeClick,
|
|
28430
28625
|
disabled: syncButtonDisabled,
|
|
@@ -28439,8 +28634,8 @@ var init_chat_app_bar = __esm({
|
|
|
28439
28634
|
"aria-label": "Conversation sync status",
|
|
28440
28635
|
children: [
|
|
28441
28636
|
syncIndicatorIcon,
|
|
28442
|
-
pendingCount > 0 && !syncButtonDisabled && syncStatus !== "syncing" && /* @__PURE__ */ (0,
|
|
28443
|
-
|
|
28637
|
+
pendingCount > 0 && !syncButtonDisabled && syncStatus !== "syncing" && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28638
|
+
import_material48.Box,
|
|
28444
28639
|
{
|
|
28445
28640
|
sx: {
|
|
28446
28641
|
position: "absolute",
|
|
@@ -28465,8 +28660,8 @@ var init_chat_app_bar = __esm({
|
|
|
28465
28660
|
]
|
|
28466
28661
|
}
|
|
28467
28662
|
) }),
|
|
28468
|
-
!isMobile && /* @__PURE__ */ (0,
|
|
28469
|
-
|
|
28663
|
+
!isMobile && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Tooltip, { title: `${drawerOpen ? "Close" : "Open"} Conversations`, arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
28664
|
+
import_material48.IconButton,
|
|
28470
28665
|
{
|
|
28471
28666
|
onClick: () => setDrawerOpen(!drawerOpen),
|
|
28472
28667
|
sx: {
|
|
@@ -28479,9 +28674,9 @@ var init_chat_app_bar = __esm({
|
|
|
28479
28674
|
"aria-label": `${drawerOpen ? "Close" : "Open"} conversations drawer`,
|
|
28480
28675
|
"aria-pressed": drawerOpen,
|
|
28481
28676
|
children: [
|
|
28482
|
-
drawerOpen ? /* @__PURE__ */ (0,
|
|
28483
|
-
conversations.length > 0 && /* @__PURE__ */ (0,
|
|
28484
|
-
|
|
28677
|
+
drawerOpen ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(NotesIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(NotesIconOutlined, {}),
|
|
28678
|
+
conversations.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28679
|
+
import_material48.Box,
|
|
28485
28680
|
{
|
|
28486
28681
|
sx: {
|
|
28487
28682
|
position: "absolute",
|
|
@@ -28506,8 +28701,8 @@ var init_chat_app_bar = __esm({
|
|
|
28506
28701
|
]
|
|
28507
28702
|
}
|
|
28508
28703
|
) }),
|
|
28509
|
-
!isMobile && canShowNewConversationButton && /* @__PURE__ */ (0,
|
|
28510
|
-
|
|
28704
|
+
!isMobile && canShowNewConversationButton && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Tooltip, { title: "Start New Conversation", arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28705
|
+
import_material48.IconButton,
|
|
28511
28706
|
{
|
|
28512
28707
|
onClick: () => createNewConversation(),
|
|
28513
28708
|
sx: {
|
|
@@ -28520,14 +28715,14 @@ var init_chat_app_bar = __esm({
|
|
|
28520
28715
|
}
|
|
28521
28716
|
},
|
|
28522
28717
|
"aria-label": "Create new conversation",
|
|
28523
|
-
children: /* @__PURE__ */ (0,
|
|
28718
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AddIcon, {})
|
|
28524
28719
|
}
|
|
28525
28720
|
) })
|
|
28526
28721
|
]
|
|
28527
28722
|
}
|
|
28528
28723
|
),
|
|
28529
|
-
/* @__PURE__ */ (0,
|
|
28530
|
-
|
|
28724
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
28725
|
+
import_material48.Box,
|
|
28531
28726
|
{
|
|
28532
28727
|
sx: {
|
|
28533
28728
|
display: "flex",
|
|
@@ -28547,8 +28742,8 @@ var init_chat_app_bar = __esm({
|
|
|
28547
28742
|
}
|
|
28548
28743
|
},
|
|
28549
28744
|
children: [
|
|
28550
|
-
isMobile && /* @__PURE__ */ (0,
|
|
28551
|
-
|
|
28745
|
+
isMobile && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Tooltip, { title: `Conversations (${conversations.length})`, arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
28746
|
+
import_material48.IconButton,
|
|
28552
28747
|
{
|
|
28553
28748
|
onClick: () => setModalOpen(true),
|
|
28554
28749
|
sx: {
|
|
@@ -28557,9 +28752,9 @@ var init_chat_app_bar = __esm({
|
|
|
28557
28752
|
},
|
|
28558
28753
|
"aria-label": `Open conversations modal with ${conversations.length} conversations`,
|
|
28559
28754
|
children: [
|
|
28560
|
-
/* @__PURE__ */ (0,
|
|
28561
|
-
conversations.length > 0 && /* @__PURE__ */ (0,
|
|
28562
|
-
|
|
28755
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(NotesIcon, { fontSize: "small" }),
|
|
28756
|
+
conversations.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28757
|
+
import_material48.Box,
|
|
28563
28758
|
{
|
|
28564
28759
|
sx: {
|
|
28565
28760
|
position: "absolute",
|
|
@@ -28584,8 +28779,8 @@ var init_chat_app_bar = __esm({
|
|
|
28584
28779
|
]
|
|
28585
28780
|
}
|
|
28586
28781
|
) }),
|
|
28587
|
-
isMobile && canShowNewConversationButton && /* @__PURE__ */ (0,
|
|
28588
|
-
|
|
28782
|
+
isMobile && canShowNewConversationButton && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Tooltip, { title: "Start New Conversation", arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28783
|
+
import_material48.IconButton,
|
|
28589
28784
|
{
|
|
28590
28785
|
onClick: () => {
|
|
28591
28786
|
createNewConversation();
|
|
@@ -28601,11 +28796,11 @@ var init_chat_app_bar = __esm({
|
|
|
28601
28796
|
}
|
|
28602
28797
|
},
|
|
28603
28798
|
"aria-label": "Create new conversation",
|
|
28604
|
-
children: /* @__PURE__ */ (0,
|
|
28799
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AddIcon, { fontSize: "small" })
|
|
28605
28800
|
}
|
|
28606
28801
|
) }),
|
|
28607
|
-
/* @__PURE__ */ (0,
|
|
28608
|
-
|
|
28802
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Tooltip, { title: `Current AI: ${selectedModel.replace("Bandit-", "")}`, arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28803
|
+
import_material48.IconButton,
|
|
28609
28804
|
{
|
|
28610
28805
|
onClick: (e) => setModelAnchorEl(e.currentTarget),
|
|
28611
28806
|
sx: {
|
|
@@ -28619,8 +28814,8 @@ var init_chat_app_bar = __esm({
|
|
|
28619
28814
|
}
|
|
28620
28815
|
},
|
|
28621
28816
|
"aria-label": `Change AI personality. Currently using ${selectedModel}`,
|
|
28622
|
-
children: /* @__PURE__ */ (0,
|
|
28623
|
-
|
|
28817
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28818
|
+
import_material47.Avatar,
|
|
28624
28819
|
{
|
|
28625
28820
|
src: currentAvatar,
|
|
28626
28821
|
alt: selectedModel,
|
|
@@ -28636,17 +28831,17 @@ var init_chat_app_bar = __esm({
|
|
|
28636
28831
|
)
|
|
28637
28832
|
}
|
|
28638
28833
|
) }),
|
|
28639
|
-
/* @__PURE__ */ (0,
|
|
28640
|
-
|
|
28834
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Tooltip, { title: `Engine \xB7 ${engineDisplay}`, arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28835
|
+
import_material48.IconButton,
|
|
28641
28836
|
{
|
|
28642
28837
|
onClick: (e) => setEngineAnchorEl(e.currentTarget),
|
|
28643
28838
|
sx: pillButtonStyles,
|
|
28644
28839
|
"aria-label": `Change base model (engine). Currently ${engineDisplay}`,
|
|
28645
|
-
children: /* @__PURE__ */ (0,
|
|
28840
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AutoAwesomeIcon, { fontSize: "small" })
|
|
28646
28841
|
}
|
|
28647
28842
|
) }),
|
|
28648
|
-
/* @__PURE__ */ (0,
|
|
28649
|
-
|
|
28843
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
28844
|
+
import_material48.Menu,
|
|
28650
28845
|
{
|
|
28651
28846
|
anchorEl: engineAnchorEl,
|
|
28652
28847
|
open: Boolean(engineAnchorEl),
|
|
@@ -28654,8 +28849,8 @@ var init_chat_app_bar = __esm({
|
|
|
28654
28849
|
transformOrigin: { horizontal: "right", vertical: "top" },
|
|
28655
28850
|
anchorOrigin: { horizontal: "right", vertical: "bottom" },
|
|
28656
28851
|
children: [
|
|
28657
|
-
/* @__PURE__ */ (0,
|
|
28658
|
-
engines.length === 0 && /* @__PURE__ */ (0,
|
|
28852
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Typography, { variant: "overline", sx: { px: 2, color: theme.palette.text.secondary }, children: "Engine \xB7 base model" }),
|
|
28853
|
+
engines.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.MenuItem, { disabled: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Typography, { variant: "body2", children: "No engines available" }) }),
|
|
28659
28854
|
engines.map((engine) => {
|
|
28660
28855
|
const badges = [
|
|
28661
28856
|
engine.vision && "vision",
|
|
@@ -28664,8 +28859,8 @@ var init_chat_app_bar = __esm({
|
|
|
28664
28859
|
engine.cloud && "cloud"
|
|
28665
28860
|
].filter(Boolean);
|
|
28666
28861
|
const isGated = engine.cloud && !frontierEligible;
|
|
28667
|
-
return /* @__PURE__ */ (0,
|
|
28668
|
-
|
|
28862
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
28863
|
+
import_material48.MenuItem,
|
|
28669
28864
|
{
|
|
28670
28865
|
selected: engine.id === resolvedEngineId,
|
|
28671
28866
|
disabled: !engine.available || isGated,
|
|
@@ -28688,16 +28883,16 @@ var init_chat_app_bar = __esm({
|
|
|
28688
28883
|
...isGated ? { opacity: 1, "&.Mui-disabled": { opacity: 1 } } : {}
|
|
28689
28884
|
},
|
|
28690
28885
|
children: [
|
|
28691
|
-
/* @__PURE__ */ (0,
|
|
28692
|
-
isGated && /* @__PURE__ */ (0,
|
|
28886
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_material48.Box, { sx: { display: "flex", alignItems: "center", gap: 1, width: "100%" }, children: [
|
|
28887
|
+
isGated && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28693
28888
|
LockIcon,
|
|
28694
28889
|
{
|
|
28695
28890
|
fontSize: "small",
|
|
28696
28891
|
sx: { fontSize: "0.95rem", color: theme.palette.text.secondary }
|
|
28697
28892
|
}
|
|
28698
28893
|
),
|
|
28699
|
-
/* @__PURE__ */ (0,
|
|
28700
|
-
|
|
28894
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28895
|
+
import_material48.Typography,
|
|
28701
28896
|
{
|
|
28702
28897
|
variant: "body2",
|
|
28703
28898
|
sx: {
|
|
@@ -28708,15 +28903,15 @@ var init_chat_app_bar = __esm({
|
|
|
28708
28903
|
children: cleanEngineName(engine.displayName)
|
|
28709
28904
|
}
|
|
28710
28905
|
),
|
|
28711
|
-
engine.id === resolvedEngineId && !isGated && /* @__PURE__ */ (0,
|
|
28906
|
+
engine.id === resolvedEngineId && !isGated && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Box, { sx: { width: 8, height: 8, borderRadius: "50%", bgcolor: theme.palette.primary.main } })
|
|
28712
28907
|
] }),
|
|
28713
|
-
/* @__PURE__ */ (0,
|
|
28714
|
-
isGated && /* @__PURE__ */ (0,
|
|
28715
|
-
|
|
28908
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Typography, { variant: "caption", sx: { color: theme.palette.text.secondary }, children: isGated ? "Premium engine \u2014 available on a paid plan." : engine.available ? engine.description : engine.unavailableReason || "Unavailable" }),
|
|
28909
|
+
isGated && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28910
|
+
import_material48.Button,
|
|
28716
28911
|
{
|
|
28717
28912
|
size: "small",
|
|
28718
28913
|
variant: "text",
|
|
28719
|
-
startIcon: /* @__PURE__ */ (0,
|
|
28914
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(LockIcon, { sx: { fontSize: "0.85rem" } }),
|
|
28720
28915
|
onClick: (e) => {
|
|
28721
28916
|
e.stopPropagation();
|
|
28722
28917
|
setEngineAnchorEl(null);
|
|
@@ -28737,8 +28932,8 @@ var init_chat_app_bar = __esm({
|
|
|
28737
28932
|
children: "Upgrade to unlock"
|
|
28738
28933
|
}
|
|
28739
28934
|
),
|
|
28740
|
-
badges.length > 0 && /* @__PURE__ */ (0,
|
|
28741
|
-
|
|
28935
|
+
badges.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Box, { sx: { display: "flex", gap: 0.5, flexWrap: "wrap", mt: 0.25 }, children: badges.map((b) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28936
|
+
import_material48.Box,
|
|
28742
28937
|
{
|
|
28743
28938
|
sx: {
|
|
28744
28939
|
fontSize: "0.65rem",
|
|
@@ -28760,8 +28955,8 @@ var init_chat_app_bar = __esm({
|
|
|
28760
28955
|
]
|
|
28761
28956
|
}
|
|
28762
28957
|
),
|
|
28763
|
-
/* @__PURE__ */ (0,
|
|
28764
|
-
|
|
28958
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
28959
|
+
import_material48.Menu,
|
|
28765
28960
|
{
|
|
28766
28961
|
anchorEl: modelAnchorEl,
|
|
28767
28962
|
open: Boolean(modelAnchorEl),
|
|
@@ -28796,8 +28991,8 @@ var init_chat_app_bar = __esm({
|
|
|
28796
28991
|
}
|
|
28797
28992
|
}
|
|
28798
28993
|
},
|
|
28799
|
-
children: availableModels.map((model) => /* @__PURE__ */ (0,
|
|
28800
|
-
|
|
28994
|
+
children: availableModels.map((model) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
28995
|
+
import_material48.MenuItem,
|
|
28801
28996
|
{
|
|
28802
28997
|
selected: model.name === selectedModel,
|
|
28803
28998
|
onClick: () => {
|
|
@@ -28843,8 +29038,8 @@ var init_chat_app_bar = __esm({
|
|
|
28843
29038
|
px: 2
|
|
28844
29039
|
},
|
|
28845
29040
|
children: [
|
|
28846
|
-
/* @__PURE__ */ (0,
|
|
28847
|
-
|
|
29041
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
29042
|
+
import_material47.Avatar,
|
|
28848
29043
|
{
|
|
28849
29044
|
src: model.avatarBase64 || modelAvatars3[model.name] || banditHead4,
|
|
28850
29045
|
alt: model.name,
|
|
@@ -28856,12 +29051,12 @@ var init_chat_app_bar = __esm({
|
|
|
28856
29051
|
}
|
|
28857
29052
|
}
|
|
28858
29053
|
),
|
|
28859
|
-
/* @__PURE__ */ (0,
|
|
28860
|
-
/* @__PURE__ */ (0,
|
|
28861
|
-
/* @__PURE__ */ (0,
|
|
29054
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_material48.Box, { sx: { flex: 1 }, children: [
|
|
29055
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Typography, { variant: "body2", sx: { fontWeight: 500 }, children: model.name.replace("Bandit-", "") }),
|
|
29056
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Typography, { variant: "caption", sx: { color: theme.palette.text.secondary, display: "block" }, children: model.name === selectedModel ? "Currently active" : "Switch to this AI" })
|
|
28862
29057
|
] }),
|
|
28863
|
-
model.name === selectedModel && /* @__PURE__ */ (0,
|
|
28864
|
-
|
|
29058
|
+
model.name === selectedModel && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
29059
|
+
import_material48.Box,
|
|
28865
29060
|
{
|
|
28866
29061
|
sx: {
|
|
28867
29062
|
width: 8,
|
|
@@ -28877,9 +29072,9 @@ var init_chat_app_bar = __esm({
|
|
|
28877
29072
|
))
|
|
28878
29073
|
}
|
|
28879
29074
|
),
|
|
28880
|
-
isTTSAvailable && /* @__PURE__ */ (0,
|
|
28881
|
-
/* @__PURE__ */ (0,
|
|
28882
|
-
|
|
29075
|
+
isTTSAvailable && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
29076
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Tooltip, { title: `Voice: ${selectedVoice ? toTitleCase(selectedVoice.split("-")[1]) : "Default"}`, arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
29077
|
+
import_material48.IconButton,
|
|
28883
29078
|
{
|
|
28884
29079
|
onClick: (e) => setVoiceAnchorEl(e.currentTarget),
|
|
28885
29080
|
sx: {
|
|
@@ -28892,11 +29087,11 @@ var init_chat_app_bar = __esm({
|
|
|
28892
29087
|
}
|
|
28893
29088
|
},
|
|
28894
29089
|
"aria-label": `Change voice. Currently using ${selectedVoice ? toTitleCase(selectedVoice.split("-")[1]) : "default"}`,
|
|
28895
|
-
children: /* @__PURE__ */ (0,
|
|
29090
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(RecordVoiceOverIcon, { fontSize: "small" })
|
|
28896
29091
|
}
|
|
28897
29092
|
) }),
|
|
28898
|
-
/* @__PURE__ */ (0,
|
|
28899
|
-
|
|
29093
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
29094
|
+
import_material48.Menu,
|
|
28900
29095
|
{
|
|
28901
29096
|
anchorEl: voiceAnchorEl,
|
|
28902
29097
|
open: Boolean(voiceAnchorEl),
|
|
@@ -28932,22 +29127,22 @@ var init_chat_app_bar = __esm({
|
|
|
28932
29127
|
}
|
|
28933
29128
|
}
|
|
28934
29129
|
},
|
|
28935
|
-
children: availableVoices.length > 0 ? availableVoices.map((voice) => /* @__PURE__ */ (0,
|
|
28936
|
-
|
|
29130
|
+
children: availableVoices.length > 0 ? availableVoices.map((voice) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
29131
|
+
import_material48.MenuItem,
|
|
28937
29132
|
{
|
|
28938
29133
|
selected: voice === selectedVoice,
|
|
28939
29134
|
onClick: () => {
|
|
28940
29135
|
handleVoiceChange(voice);
|
|
28941
29136
|
setVoiceAnchorEl(null);
|
|
28942
29137
|
},
|
|
28943
|
-
children: /* @__PURE__ */ (0,
|
|
28944
|
-
/* @__PURE__ */ (0,
|
|
28945
|
-
/* @__PURE__ */ (0,
|
|
28946
|
-
/* @__PURE__ */ (0,
|
|
28947
|
-
/* @__PURE__ */ (0,
|
|
29138
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_material48.Box, { sx: { display: "flex", alignItems: "center", gap: 1, width: "100%" }, children: [
|
|
29139
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(RecordVoiceOverIcon, { fontSize: "small", sx: { color: theme.palette.text.secondary } }),
|
|
29140
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_material48.Box, { sx: { flex: 1 }, children: [
|
|
29141
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Typography, { variant: "body2", children: toTitleCase(voice.split("-")[1]) }),
|
|
29142
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Typography, { variant: "caption", sx: { color: theme.palette.text.secondary }, children: voice === selectedVoice ? "Currently active" : "Switch to this voice" })
|
|
28948
29143
|
] }),
|
|
28949
|
-
voice === selectedVoice && /* @__PURE__ */ (0,
|
|
28950
|
-
|
|
29144
|
+
voice === selectedVoice && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
29145
|
+
import_material48.Box,
|
|
28951
29146
|
{
|
|
28952
29147
|
sx: {
|
|
28953
29148
|
width: 8,
|
|
@@ -28960,7 +29155,7 @@ var init_chat_app_bar = __esm({
|
|
|
28960
29155
|
] })
|
|
28961
29156
|
},
|
|
28962
29157
|
voice
|
|
28963
|
-
)) : /* @__PURE__ */ (0,
|
|
29158
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.MenuItem, { disabled: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Typography, { variant: "body2", color: "text.secondary", children: "No voices available" }) })
|
|
28964
29159
|
}
|
|
28965
29160
|
)
|
|
28966
29161
|
] })
|
|
@@ -28970,34 +29165,34 @@ var init_chat_app_bar = __esm({
|
|
|
28970
29165
|
]
|
|
28971
29166
|
}
|
|
28972
29167
|
),
|
|
28973
|
-
/* @__PURE__ */ (0,
|
|
28974
|
-
/* @__PURE__ */ (0,
|
|
28975
|
-
/* @__PURE__ */ (0,
|
|
28976
|
-
|
|
29168
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(conversation_drawer_default, { open: drawerOpen, onClose: () => setDrawerOpen(false) }),
|
|
29169
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(enhanced_mobile_conversations_modal_default, { open: modalOpen, onClose: () => setModalOpen(false) }),
|
|
29170
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
29171
|
+
import_material48.Dialog,
|
|
28977
29172
|
{
|
|
28978
29173
|
open: confirmModelChangeOpen,
|
|
28979
29174
|
onClose: () => setConfirmModelChangeOpen(false),
|
|
28980
29175
|
children: [
|
|
28981
|
-
/* @__PURE__ */ (0,
|
|
28982
|
-
/* @__PURE__ */ (0,
|
|
28983
|
-
/* @__PURE__ */ (0,
|
|
28984
|
-
|
|
29176
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.DialogTitle, { children: "Change personality and start new conversation?" }),
|
|
29177
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.DialogContent, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_material48.Box, { display: "flex", alignItems: "center", gap: 2, mt: 1, justifyContent: "center", children: [
|
|
29178
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
29179
|
+
import_material47.Avatar,
|
|
28985
29180
|
{
|
|
28986
29181
|
src: pendingModelAvatar,
|
|
28987
29182
|
alt: pendingModel || "Personality Avatar",
|
|
28988
29183
|
sx: { width: 40, height: 40, filter: "brightness(1.7)" }
|
|
28989
29184
|
}
|
|
28990
29185
|
),
|
|
28991
|
-
/* @__PURE__ */ (0,
|
|
29186
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_material48.Typography, { variant: "body2", children: [
|
|
28992
29187
|
"Your current conversation will be saved, and a new one will begin with ",
|
|
28993
|
-
/* @__PURE__ */ (0,
|
|
29188
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("strong", { children: pendingModel }),
|
|
28994
29189
|
"."
|
|
28995
29190
|
] })
|
|
28996
29191
|
] }) }),
|
|
28997
|
-
/* @__PURE__ */ (0,
|
|
28998
|
-
/* @__PURE__ */ (0,
|
|
28999
|
-
/* @__PURE__ */ (0,
|
|
29000
|
-
|
|
29192
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_material48.DialogActions, { children: [
|
|
29193
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Button, { onClick: () => setConfirmModelChangeOpen(false), children: "Cancel" }),
|
|
29194
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
29195
|
+
import_material48.Button,
|
|
29001
29196
|
{
|
|
29002
29197
|
onClick: () => {
|
|
29003
29198
|
if (pendingModel) {
|
|
@@ -29111,12 +29306,12 @@ Respond with just the title and nothing else.
|
|
|
29111
29306
|
});
|
|
29112
29307
|
|
|
29113
29308
|
// src/chat/query-suggestion-picker.tsx
|
|
29114
|
-
var
|
|
29309
|
+
var import_react59, import_material49, import_styles30, import_react_markdown3, import_remark_gfm3, import_rehype_raw3, import_jsx_runtime48, markdownComponents, QuerySuggestionPicker;
|
|
29115
29310
|
var init_query_suggestion_picker = __esm({
|
|
29116
29311
|
"src/chat/query-suggestion-picker.tsx"() {
|
|
29117
29312
|
"use strict";
|
|
29118
|
-
|
|
29119
|
-
|
|
29313
|
+
import_react59 = require("react");
|
|
29314
|
+
import_material49 = require("@mui/material");
|
|
29120
29315
|
import_styles30 = require("@mui/material/styles");
|
|
29121
29316
|
import_react_markdown3 = __toESM(require("react-markdown"));
|
|
29122
29317
|
import_remark_gfm3 = __toESM(require("remark-gfm"));
|
|
@@ -29127,29 +29322,29 @@ var init_query_suggestion_picker = __esm({
|
|
|
29127
29322
|
init_preferencesStore();
|
|
29128
29323
|
init_knowledgeStore();
|
|
29129
29324
|
init_mcpToolsStore();
|
|
29130
|
-
|
|
29325
|
+
import_jsx_runtime48 = require("react/jsx-runtime");
|
|
29131
29326
|
markdownComponents = {
|
|
29132
|
-
p: ({ node, ...props }) => /* @__PURE__ */ (0,
|
|
29133
|
-
mark: ({ node, children, ...props }) => /* @__PURE__ */ (0,
|
|
29327
|
+
p: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { ...props }),
|
|
29328
|
+
mark: ({ node, children, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("mark", { ...props, children }),
|
|
29134
29329
|
code: ({ node, children, ...props }) => {
|
|
29135
29330
|
const { inline, ...rest } = props;
|
|
29136
|
-
return inline ? /* @__PURE__ */ (0,
|
|
29331
|
+
return inline ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("code", { ...rest, children }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("code", { ...rest, children });
|
|
29137
29332
|
}
|
|
29138
29333
|
};
|
|
29139
29334
|
QuerySuggestionPicker = ({
|
|
29140
29335
|
onSend,
|
|
29141
29336
|
inputHeight
|
|
29142
29337
|
}) => {
|
|
29143
|
-
const hasGenerated = (0,
|
|
29144
|
-
const [hasSentPrompt, setHasSentPrompt] = (0,
|
|
29145
|
-
const [examplePrompts, setExamplePrompts] = (0,
|
|
29146
|
-
const [visiblePrompts, setVisiblePrompts] = (0,
|
|
29147
|
-
const scrollRef = (0,
|
|
29338
|
+
const hasGenerated = (0, import_react59.useRef)(false);
|
|
29339
|
+
const [hasSentPrompt, setHasSentPrompt] = (0, import_react59.useState)(false);
|
|
29340
|
+
const [examplePrompts, setExamplePrompts] = (0, import_react59.useState)([]);
|
|
29341
|
+
const [visiblePrompts, setVisiblePrompts] = (0, import_react59.useState)([]);
|
|
29342
|
+
const scrollRef = (0, import_react59.useRef)(null);
|
|
29148
29343
|
const theme = (0, import_styles30.useTheme)();
|
|
29149
|
-
const isMobile = (0,
|
|
29344
|
+
const isMobile = (0, import_material49.useMediaQuery)((theme2) => theme2.breakpoints.down("sm"));
|
|
29150
29345
|
const { background, text, border, hoverBackground, hoverBorder } = theme.palette.chat.suggestion;
|
|
29151
29346
|
const { getCurrentModel, isLoading } = useModelStore();
|
|
29152
|
-
(0,
|
|
29347
|
+
(0, import_react59.useEffect)(() => {
|
|
29153
29348
|
if (hasGenerated.current || isLoading) return;
|
|
29154
29349
|
hasGenerated.current = true;
|
|
29155
29350
|
const currentModel = getCurrentModel();
|
|
@@ -29182,12 +29377,12 @@ var init_query_suggestion_picker = __esm({
|
|
|
29182
29377
|
hasGenerated.current = false;
|
|
29183
29378
|
});
|
|
29184
29379
|
}, [getCurrentModel, isLoading]);
|
|
29185
|
-
(0,
|
|
29380
|
+
(0, import_react59.useEffect)(() => {
|
|
29186
29381
|
if (!isLoading) {
|
|
29187
29382
|
hasGenerated.current = false;
|
|
29188
29383
|
}
|
|
29189
29384
|
}, [isLoading]);
|
|
29190
|
-
(0,
|
|
29385
|
+
(0, import_react59.useEffect)(() => {
|
|
29191
29386
|
if (hasSentPrompt || examplePrompts.length === 0) return;
|
|
29192
29387
|
const interval = setInterval(() => {
|
|
29193
29388
|
setExamplePrompts((prev) => {
|
|
@@ -29206,8 +29401,8 @@ var init_query_suggestion_picker = __esm({
|
|
|
29206
29401
|
return () => clearInterval(interval);
|
|
29207
29402
|
}, [hasSentPrompt, examplePrompts.length]);
|
|
29208
29403
|
const displayPrompts = isMobile ? visiblePrompts.slice(0, Math.min(visiblePrompts.length, 6)) : visiblePrompts;
|
|
29209
|
-
return displayPrompts.length > 0 && /* @__PURE__ */ (0,
|
|
29210
|
-
|
|
29404
|
+
return displayPrompts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_jsx_runtime48.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
29405
|
+
import_material49.Box,
|
|
29211
29406
|
{
|
|
29212
29407
|
ref: scrollRef,
|
|
29213
29408
|
sx: {
|
|
@@ -29223,8 +29418,8 @@ var init_query_suggestion_picker = __esm({
|
|
|
29223
29418
|
pb: isMobile ? 0.4 : 0,
|
|
29224
29419
|
"&::-webkit-scrollbar": { display: "none" }
|
|
29225
29420
|
},
|
|
29226
|
-
children: displayPrompts.map((prompt, i) => /* @__PURE__ */ (0,
|
|
29227
|
-
|
|
29421
|
+
children: displayPrompts.map((prompt, i) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
29422
|
+
import_material49.Box,
|
|
29228
29423
|
{
|
|
29229
29424
|
sx: {
|
|
29230
29425
|
px: isMobile ? 1.4 : 2,
|
|
@@ -29258,8 +29453,8 @@ var init_query_suggestion_picker = __esm({
|
|
|
29258
29453
|
onSend(prompt, []);
|
|
29259
29454
|
setHasSentPrompt(true);
|
|
29260
29455
|
},
|
|
29261
|
-
children: /* @__PURE__ */ (0,
|
|
29262
|
-
|
|
29456
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
29457
|
+
import_material49.Box,
|
|
29263
29458
|
{
|
|
29264
29459
|
sx: {
|
|
29265
29460
|
flex: 1,
|
|
@@ -29283,7 +29478,7 @@ var init_query_suggestion_picker = __esm({
|
|
|
29283
29478
|
padding: "0.1em 0.25em"
|
|
29284
29479
|
}
|
|
29285
29480
|
},
|
|
29286
|
-
children: /* @__PURE__ */ (0,
|
|
29481
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
29287
29482
|
import_react_markdown3.default,
|
|
29288
29483
|
{
|
|
29289
29484
|
remarkPlugins: [import_remark_gfm3.default],
|
|
@@ -29304,22 +29499,22 @@ var init_query_suggestion_picker = __esm({
|
|
|
29304
29499
|
});
|
|
29305
29500
|
|
|
29306
29501
|
// ../../src/pages/under-review.tsx
|
|
29307
|
-
var
|
|
29502
|
+
var import_material50, import_react_router_dom4, import_jsx_runtime49, UnderReview, under_review_default;
|
|
29308
29503
|
var init_under_review = __esm({
|
|
29309
29504
|
"../../src/pages/under-review.tsx"() {
|
|
29310
29505
|
"use strict";
|
|
29311
|
-
|
|
29312
|
-
|
|
29313
|
-
|
|
29506
|
+
import_material50 = require("@mui/material");
|
|
29507
|
+
import_react_router_dom4 = require("react-router-dom");
|
|
29508
|
+
import_jsx_runtime49 = require("react/jsx-runtime");
|
|
29314
29509
|
UnderReview = () => {
|
|
29315
|
-
const theme = (0,
|
|
29316
|
-
const navigate = (0,
|
|
29510
|
+
const theme = (0, import_material50.useTheme)();
|
|
29511
|
+
const navigate = (0, import_react_router_dom4.useNavigate)();
|
|
29317
29512
|
const handleSneakyLogout = () => {
|
|
29318
29513
|
localStorage.removeItem("authToken");
|
|
29319
29514
|
navigate("/login");
|
|
29320
29515
|
};
|
|
29321
|
-
return /* @__PURE__ */ (0,
|
|
29322
|
-
|
|
29516
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
29517
|
+
import_material50.Box,
|
|
29323
29518
|
{
|
|
29324
29519
|
sx: {
|
|
29325
29520
|
minHeight: "100vh",
|
|
@@ -29334,8 +29529,8 @@ var init_under_review = __esm({
|
|
|
29334
29529
|
position: "relative"
|
|
29335
29530
|
},
|
|
29336
29531
|
children: [
|
|
29337
|
-
/* @__PURE__ */ (0,
|
|
29338
|
-
|
|
29532
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
29533
|
+
import_material50.Box,
|
|
29339
29534
|
{
|
|
29340
29535
|
onClick: handleSneakyLogout,
|
|
29341
29536
|
sx: {
|
|
@@ -29360,13 +29555,13 @@ var init_under_review = __esm({
|
|
|
29360
29555
|
title: "Reset session"
|
|
29361
29556
|
}
|
|
29362
29557
|
),
|
|
29363
|
-
/* @__PURE__ */ (0,
|
|
29364
|
-
/* @__PURE__ */ (0,
|
|
29558
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_material50.Typography, { variant: "h4", sx: { mb: 2, fontWeight: 700, color: theme.palette.error.main }, children: "Under Review" }),
|
|
29559
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_material50.Typography, { variant: "body1", sx: { mb: 2, color: theme.palette.text.secondary }, children: [
|
|
29365
29560
|
"Your request to use our services is currently being reviewed.",
|
|
29366
|
-
/* @__PURE__ */ (0,
|
|
29561
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("br", {}),
|
|
29367
29562
|
"For more info, please contact ",
|
|
29368
29563
|
" ",
|
|
29369
|
-
/* @__PURE__ */ (0,
|
|
29564
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("a", { href: "mailto:team@banditai.ai", style: { color: theme.palette.primary.main, fontWeight: 600 }, children: "team@banditai.ai" })
|
|
29370
29565
|
] })
|
|
29371
29566
|
]
|
|
29372
29567
|
}
|
|
@@ -29377,19 +29572,19 @@ var init_under_review = __esm({
|
|
|
29377
29572
|
});
|
|
29378
29573
|
|
|
29379
29574
|
// src/components/ConnectionStatus.tsx
|
|
29380
|
-
var
|
|
29575
|
+
var import_material51, import_jsx_runtime50, ConnectionStatus;
|
|
29381
29576
|
var init_ConnectionStatus = __esm({
|
|
29382
29577
|
"src/components/ConnectionStatus.tsx"() {
|
|
29383
29578
|
"use strict";
|
|
29384
|
-
|
|
29579
|
+
import_material51 = require("@mui/material");
|
|
29385
29580
|
init_useNetworkStatus();
|
|
29386
29581
|
init_lucide_icons();
|
|
29387
|
-
|
|
29582
|
+
import_jsx_runtime50 = require("react/jsx-runtime");
|
|
29388
29583
|
ConnectionStatus = ({
|
|
29389
29584
|
showWhenGood = false,
|
|
29390
29585
|
position = "top"
|
|
29391
29586
|
}) => {
|
|
29392
|
-
const theme = (0,
|
|
29587
|
+
const theme = (0, import_material51.useTheme)();
|
|
29393
29588
|
const { isOnline, connectionQuality, isSlowConnection } = useNetworkStatus();
|
|
29394
29589
|
if (connectionQuality === "fast" && !showWhenGood) {
|
|
29395
29590
|
return null;
|
|
@@ -29398,28 +29593,28 @@ var init_ConnectionStatus = __esm({
|
|
|
29398
29593
|
switch (connectionQuality) {
|
|
29399
29594
|
case "offline":
|
|
29400
29595
|
return {
|
|
29401
|
-
icon: /* @__PURE__ */ (0,
|
|
29596
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(WifiOffIcon, { sx: { fontSize: 16 } }),
|
|
29402
29597
|
label: "Offline",
|
|
29403
29598
|
color: "error",
|
|
29404
29599
|
severity: "high"
|
|
29405
29600
|
};
|
|
29406
29601
|
case "slow":
|
|
29407
29602
|
return {
|
|
29408
|
-
icon: /* @__PURE__ */ (0,
|
|
29603
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SignalWifi2BarIcon, { sx: { fontSize: 16 } }),
|
|
29409
29604
|
label: "Slow connection",
|
|
29410
29605
|
color: "warning",
|
|
29411
29606
|
severity: "medium"
|
|
29412
29607
|
};
|
|
29413
29608
|
case "fast":
|
|
29414
29609
|
return {
|
|
29415
|
-
icon: /* @__PURE__ */ (0,
|
|
29610
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(WifiIcon, { sx: { fontSize: 16 } }),
|
|
29416
29611
|
label: "Connected",
|
|
29417
29612
|
color: "success",
|
|
29418
29613
|
severity: "low"
|
|
29419
29614
|
};
|
|
29420
29615
|
default:
|
|
29421
29616
|
return {
|
|
29422
|
-
icon: /* @__PURE__ */ (0,
|
|
29617
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(WifiIcon, { sx: { fontSize: 16 } }),
|
|
29423
29618
|
label: "Unknown",
|
|
29424
29619
|
color: "default",
|
|
29425
29620
|
severity: "low"
|
|
@@ -29427,8 +29622,8 @@ var init_ConnectionStatus = __esm({
|
|
|
29427
29622
|
}
|
|
29428
29623
|
};
|
|
29429
29624
|
const config = getStatusConfig();
|
|
29430
|
-
return /* @__PURE__ */ (0,
|
|
29431
|
-
|
|
29625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
29626
|
+
import_material51.Box,
|
|
29432
29627
|
{
|
|
29433
29628
|
sx: {
|
|
29434
29629
|
position: "fixed",
|
|
@@ -29443,8 +29638,8 @@ var init_ConnectionStatus = __esm({
|
|
|
29443
29638
|
"100%": { opacity: 1 }
|
|
29444
29639
|
}
|
|
29445
29640
|
},
|
|
29446
|
-
children: /* @__PURE__ */ (0,
|
|
29447
|
-
|
|
29641
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
29642
|
+
import_material51.Chip,
|
|
29448
29643
|
{
|
|
29449
29644
|
icon: config.icon,
|
|
29450
29645
|
label: config.label,
|
|
@@ -29469,11 +29664,11 @@ var init_ConnectionStatus = __esm({
|
|
|
29469
29664
|
});
|
|
29470
29665
|
|
|
29471
29666
|
// src/hooks/useVoiceMode.ts
|
|
29472
|
-
var
|
|
29667
|
+
var import_react60, RMS_BASELINE, RMS_NORMALIZER, computeRms, pickSupportedMimeType, useVoiceMode;
|
|
29473
29668
|
var init_useVoiceMode = __esm({
|
|
29474
29669
|
"src/hooks/useVoiceMode.ts"() {
|
|
29475
29670
|
"use strict";
|
|
29476
|
-
|
|
29671
|
+
import_react60 = require("react");
|
|
29477
29672
|
init_stt_client();
|
|
29478
29673
|
init_debugLogger();
|
|
29479
29674
|
init_voiceModeStore();
|
|
@@ -29506,11 +29701,11 @@ var init_useVoiceMode = __esm({
|
|
|
29506
29701
|
const setError = useVoiceModeStore((state) => state.setError);
|
|
29507
29702
|
const resetTransientState = useVoiceModeStore((state) => state.resetTransientState);
|
|
29508
29703
|
const setLastTranscript = useVoiceModeStore((state) => state.setLastTranscript);
|
|
29509
|
-
const configRef = (0,
|
|
29510
|
-
(0,
|
|
29704
|
+
const configRef = (0, import_react60.useRef)(config);
|
|
29705
|
+
(0, import_react60.useEffect)(() => {
|
|
29511
29706
|
configRef.current = config;
|
|
29512
29707
|
}, [config]);
|
|
29513
|
-
(0,
|
|
29708
|
+
(0, import_react60.useEffect)(() => {
|
|
29514
29709
|
if (!enabled) {
|
|
29515
29710
|
return () => void 0;
|
|
29516
29711
|
}
|
|
@@ -29771,25 +29966,26 @@ var chat_exports = {};
|
|
|
29771
29966
|
__export(chat_exports, {
|
|
29772
29967
|
default: () => chat_default
|
|
29773
29968
|
});
|
|
29774
|
-
var
|
|
29969
|
+
var import_react61, import_material52, import_styles31, import_react_router_dom5, import_jsx_runtime51, ChatContent, Chat, chat_default;
|
|
29775
29970
|
var init_chat2 = __esm({
|
|
29776
29971
|
"src/chat/chat.tsx"() {
|
|
29777
29972
|
"use strict";
|
|
29778
|
-
|
|
29973
|
+
import_react61 = require("react");
|
|
29779
29974
|
init_custom_logo();
|
|
29780
29975
|
init_indexedDBService();
|
|
29781
|
-
|
|
29976
|
+
import_material52 = require("@mui/material");
|
|
29782
29977
|
import_styles31 = require("@mui/material/styles");
|
|
29783
29978
|
init_aiQueryStore();
|
|
29784
29979
|
init_modelStore();
|
|
29785
29980
|
init_canvasStore();
|
|
29786
29981
|
init_canvas_panel();
|
|
29787
|
-
|
|
29982
|
+
import_react_router_dom5 = require("react-router-dom");
|
|
29788
29983
|
init_chat_scroll_to_bottom_button();
|
|
29789
29984
|
init_bandit_chat_logo();
|
|
29790
29985
|
init_chat_messages();
|
|
29791
29986
|
init_chat_input();
|
|
29792
29987
|
init_ask_user_card();
|
|
29988
|
+
init_rate_limit_prompt();
|
|
29793
29989
|
init_useAIProvider();
|
|
29794
29990
|
init_useAutoScroll();
|
|
29795
29991
|
init_useNetworkStatus();
|
|
@@ -29816,7 +30012,7 @@ var init_chat2 = __esm({
|
|
|
29816
30012
|
init_voiceModeStore();
|
|
29817
30013
|
init_ttsSanitizer();
|
|
29818
30014
|
init_FeatureFlagContext();
|
|
29819
|
-
|
|
30015
|
+
import_jsx_runtime51 = require("react/jsx-runtime");
|
|
29820
30016
|
ChatContent = () => {
|
|
29821
30017
|
const packageSettings = usePackageSettingsStore((state) => state.settings);
|
|
29822
30018
|
const featureFlag = useFeatureFlag();
|
|
@@ -29824,12 +30020,12 @@ var init_chat2 = __esm({
|
|
|
29824
30020
|
const ossMode = isOSSMode() || !packageSettings?.featureFlags?.subscriptionType;
|
|
29825
30021
|
const playgroundBypassAccess = packageSettings?.playgroundBypassAuth || typeof window !== "undefined" && window.location.pathname.includes("/playground");
|
|
29826
30022
|
const notificationService2 = useNotificationService();
|
|
29827
|
-
const [selectedTheme, setSelectedTheme] = (0,
|
|
29828
|
-
const [themeLoading, setThemeLoading] = (0,
|
|
30023
|
+
const [selectedTheme, setSelectedTheme] = (0, import_react61.useState)(null);
|
|
30024
|
+
const [themeLoading, setThemeLoading] = (0, import_react61.useState)(true);
|
|
29829
30025
|
const token = authenticationService.getToken();
|
|
29830
30026
|
const claims = token ? authenticationService.parseJwtClaims(token) : null;
|
|
29831
30027
|
const baseTheme = themeMap_default[selectedTheme ?? "bandit-dark"] || banditDarkTheme;
|
|
29832
|
-
const banditTheme = (0,
|
|
30028
|
+
const banditTheme = (0, import_react61.useMemo)(() => {
|
|
29833
30029
|
return (0, import_styles31.createTheme)(baseTheme, {
|
|
29834
30030
|
components: {
|
|
29835
30031
|
MuiInputBase: {
|
|
@@ -29877,12 +30073,12 @@ var init_chat2 = __esm({
|
|
|
29877
30073
|
} = useVoiceStore();
|
|
29878
30074
|
const isVoiceModeEnabled = useVoiceModeStore((state) => state.enabled);
|
|
29879
30075
|
const canvasOpen = useCanvasStore((state) => state.open);
|
|
29880
|
-
const previousVoiceModeEnabledRef = (0,
|
|
29881
|
-
const historyRef = (0,
|
|
29882
|
-
(0,
|
|
30076
|
+
const previousVoiceModeEnabledRef = (0, import_react61.useRef)(isVoiceModeEnabled);
|
|
30077
|
+
const historyRef = (0, import_react61.useRef)(history);
|
|
30078
|
+
(0, import_react61.useEffect)(() => {
|
|
29883
30079
|
historyRef.current = history;
|
|
29884
30080
|
}, [history]);
|
|
29885
|
-
(0,
|
|
30081
|
+
(0, import_react61.useEffect)(() => {
|
|
29886
30082
|
if (!hydrated) return;
|
|
29887
30083
|
const params = new URLSearchParams(window.location.search);
|
|
29888
30084
|
const title = params.get("title") || "";
|
|
@@ -29898,7 +30094,7 @@ var init_chat2 = __esm({
|
|
|
29898
30094
|
stop: ttsStop,
|
|
29899
30095
|
isAvailable: isTTSAvailable
|
|
29900
30096
|
} = useTTS();
|
|
29901
|
-
(0,
|
|
30097
|
+
(0, import_react61.useEffect)(() => {
|
|
29902
30098
|
const timer = setTimeout(() => {
|
|
29903
30099
|
const isAuthenticated = authenticationService.isAuthenticated();
|
|
29904
30100
|
if (!initialized || availableVoices.length === 0) {
|
|
@@ -29912,7 +30108,7 @@ var init_chat2 = __esm({
|
|
|
29912
30108
|
}, 500);
|
|
29913
30109
|
return () => clearTimeout(timer);
|
|
29914
30110
|
}, [initialized, availableVoices.length, loadVoicesFromAPI, token]);
|
|
29915
|
-
(0,
|
|
30111
|
+
(0, import_react61.useEffect)(() => {
|
|
29916
30112
|
const isAuthenticated = authenticationService.isAuthenticated();
|
|
29917
30113
|
if (packageSettings?.gatewayApiUrl && availableVoices.length === 0 && !initialized) {
|
|
29918
30114
|
if (token && isAuthenticated) {
|
|
@@ -29924,15 +30120,15 @@ var init_chat2 = __esm({
|
|
|
29924
30120
|
}
|
|
29925
30121
|
}, [packageSettings?.gatewayApiUrl, availableVoices.length, initialized, loadVoicesFromAPI, token]);
|
|
29926
30122
|
const provider = useAIProviderStore((state) => state.provider);
|
|
29927
|
-
const inputRef = (0,
|
|
29928
|
-
const [pastedImages, setPastedImages] = (0,
|
|
29929
|
-
const inputContainerRef = (0,
|
|
29930
|
-
const [inputHeight, setInputHeight] = (0,
|
|
29931
|
-
const [isSubmitting, setIsSubmitting] = (0,
|
|
29932
|
-
const [pendingMessage, setPendingMessage] = (0,
|
|
30123
|
+
const inputRef = (0, import_react61.useRef)(null);
|
|
30124
|
+
const [pastedImages, setPastedImages] = (0, import_react61.useState)([]);
|
|
30125
|
+
const inputContainerRef = (0, import_react61.useRef)(null);
|
|
30126
|
+
const [inputHeight, setInputHeight] = (0, import_react61.useState)(80);
|
|
30127
|
+
const [isSubmitting, setIsSubmitting] = (0, import_react61.useState)(false);
|
|
30128
|
+
const [pendingMessage, setPendingMessage] = (0, import_react61.useState)(null);
|
|
29933
30129
|
const { conversations, currentId, _hasHydrated, hydrate } = useConversationStore();
|
|
29934
|
-
const [isMobile, setIsMobile] = (0,
|
|
29935
|
-
const [drawerOpen, setDrawerOpen] = (0,
|
|
30130
|
+
const [isMobile, setIsMobile] = (0, import_react61.useState)(false);
|
|
30131
|
+
const [drawerOpen, setDrawerOpen] = (0, import_react61.useState)(false);
|
|
29936
30132
|
const { generateName } = useConversationNameGenerator();
|
|
29937
30133
|
const { preferences } = usePreferencesStore();
|
|
29938
30134
|
const { containerRef: chatContainerRef, targetRef: scrollTargetRef, scrollToBottom, getScrollState } = useAutoScroll({
|
|
@@ -29944,27 +30140,27 @@ var init_chat2 = __esm({
|
|
|
29944
30140
|
const chatContainerEl = chatContainerRef.current;
|
|
29945
30141
|
const scrollTargetEl = scrollTargetRef.current;
|
|
29946
30142
|
const { isSlowConnection, connectionQuality, trackRequestStart, trackRequestEnd } = useNetworkStatus();
|
|
29947
|
-
const [showScrollToBottom, setShowScrollToBottom] = (0,
|
|
29948
|
-
const [streamBuffer, setStreamBuffer] = (0,
|
|
29949
|
-
const [responseStarted, setResponseStarted] = (0,
|
|
29950
|
-
const [isStreaming, setIsStreaming] = (0,
|
|
29951
|
-
const [isThinking, setIsThinking] = (0,
|
|
30143
|
+
const [showScrollToBottom, setShowScrollToBottom] = (0, import_react61.useState)(false);
|
|
30144
|
+
const [streamBuffer, setStreamBuffer] = (0, import_react61.useState)("");
|
|
30145
|
+
const [responseStarted, setResponseStarted] = (0, import_react61.useState)(false);
|
|
30146
|
+
const [isStreaming, setIsStreaming] = (0, import_react61.useState)(false);
|
|
30147
|
+
const [isThinking, setIsThinking] = (0, import_react61.useState)(false);
|
|
29952
30148
|
const initialLogoState = history.length === 0;
|
|
29953
|
-
const [logoVisible, setLogoVisible] = (0,
|
|
29954
|
-
const [logoShouldRender, setLogoShouldRender] = (0,
|
|
29955
|
-
const streamingGraceUntilRef = (0,
|
|
30149
|
+
const [logoVisible, setLogoVisible] = (0, import_react61.useState)(initialLogoState);
|
|
30150
|
+
const [logoShouldRender, setLogoShouldRender] = (0, import_react61.useState)(initialLogoState);
|
|
30151
|
+
const streamingGraceUntilRef = (0, import_react61.useRef)(0);
|
|
29956
30152
|
const GRACE_MS = 450;
|
|
29957
30153
|
const GRACE_OFFSET_DESKTOP = 28;
|
|
29958
30154
|
const GRACE_OFFSET_MOBILE = 20;
|
|
29959
|
-
const followStreamRef = (0,
|
|
29960
|
-
const lastSpokenResponseRef = (0,
|
|
29961
|
-
const previousConversationIdRef = (0,
|
|
29962
|
-
const logoFadeTimeoutRef = (0,
|
|
29963
|
-
const [branding, setBranding] = (0,
|
|
29964
|
-
const [brandingLoading, setBrandingLoading] = (0,
|
|
29965
|
-
const isBrandingLoadInProgressRef = (0,
|
|
30155
|
+
const followStreamRef = (0, import_react61.useRef)(true);
|
|
30156
|
+
const lastSpokenResponseRef = (0, import_react61.useRef)(null);
|
|
30157
|
+
const previousConversationIdRef = (0, import_react61.useRef)(null);
|
|
30158
|
+
const logoFadeTimeoutRef = (0, import_react61.useRef)(null);
|
|
30159
|
+
const [branding, setBranding] = (0, import_react61.useState)(null);
|
|
30160
|
+
const [brandingLoading, setBrandingLoading] = (0, import_react61.useState)(true);
|
|
30161
|
+
const isBrandingLoadInProgressRef = (0, import_react61.useRef)(false);
|
|
29966
30162
|
const logoOnly = history.length === 0 && !brandingLoading;
|
|
29967
|
-
(0,
|
|
30163
|
+
(0, import_react61.useEffect)(() => {
|
|
29968
30164
|
const isEmptyConversation = (history?.length ?? 0) === 0;
|
|
29969
30165
|
const isSending = Boolean(pendingMessage);
|
|
29970
30166
|
const shouldShowLogo = isEmptyConversation && !isSending;
|
|
@@ -29994,7 +30190,7 @@ var init_chat2 = __esm({
|
|
|
29994
30190
|
}, 500);
|
|
29995
30191
|
}
|
|
29996
30192
|
}, [history, pendingMessage]);
|
|
29997
|
-
(0,
|
|
30193
|
+
(0, import_react61.useEffect)(() => {
|
|
29998
30194
|
if (!brandingLoading && !themeLoading) {
|
|
29999
30195
|
return;
|
|
30000
30196
|
}
|
|
@@ -30010,18 +30206,18 @@ var init_chat2 = __esm({
|
|
|
30010
30206
|
}, 2500);
|
|
30011
30207
|
return () => window.clearTimeout(timeoutId);
|
|
30012
30208
|
}, [brandingLoading, themeLoading, selectedTheme]);
|
|
30013
|
-
(0,
|
|
30209
|
+
(0, import_react61.useEffect)(() => () => {
|
|
30014
30210
|
if (logoFadeTimeoutRef.current) {
|
|
30015
30211
|
window.clearTimeout(logoFadeTimeoutRef.current);
|
|
30016
30212
|
logoFadeTimeoutRef.current = null;
|
|
30017
30213
|
}
|
|
30018
30214
|
}, []);
|
|
30019
|
-
(0,
|
|
30215
|
+
(0, import_react61.useEffect)(() => {
|
|
30020
30216
|
if (isStreaming && streamBuffer.trim() === "") {
|
|
30021
30217
|
streamingGraceUntilRef.current = Date.now() + GRACE_MS;
|
|
30022
30218
|
}
|
|
30023
30219
|
}, [isStreaming, streamBuffer]);
|
|
30024
|
-
(0,
|
|
30220
|
+
(0, import_react61.useEffect)(() => {
|
|
30025
30221
|
if (!isStreaming) return;
|
|
30026
30222
|
const container = chatContainerRef.current;
|
|
30027
30223
|
if (!container) return;
|
|
@@ -30032,13 +30228,13 @@ var init_chat2 = __esm({
|
|
|
30032
30228
|
container.scrollTo({ top: targetTop, behavior: "smooth" });
|
|
30033
30229
|
}
|
|
30034
30230
|
}, [streamBuffer, isStreaming, isMobile, chatContainerRef]);
|
|
30035
|
-
(0,
|
|
30231
|
+
(0, import_react61.useEffect)(() => {
|
|
30036
30232
|
if (!_hasHydrated) {
|
|
30037
30233
|
debugLogger.info("Chat component triggering conversation store hydration");
|
|
30038
30234
|
hydrate();
|
|
30039
30235
|
}
|
|
30040
30236
|
}, [_hasHydrated, hydrate]);
|
|
30041
|
-
(0,
|
|
30237
|
+
(0, import_react61.useEffect)(() => {
|
|
30042
30238
|
const loadBrandingAndTheme = async () => {
|
|
30043
30239
|
if (isBrandingLoadInProgressRef.current) {
|
|
30044
30240
|
debugLogger.warn("Branding loading already in progress, skipping");
|
|
@@ -30225,19 +30421,19 @@ var init_chat2 = __esm({
|
|
|
30225
30421
|
window.removeEventListener("bandit-theme-changed", handleThemeChange);
|
|
30226
30422
|
};
|
|
30227
30423
|
}, []);
|
|
30228
|
-
(0,
|
|
30424
|
+
(0, import_react61.useEffect)(() => {
|
|
30229
30425
|
if (!chatContainerEl) return;
|
|
30230
30426
|
const blurInputOnScroll = () => inputRef.current?.blur();
|
|
30231
30427
|
chatContainerEl.addEventListener("scroll", blurInputOnScroll);
|
|
30232
30428
|
return () => chatContainerEl.removeEventListener("scroll", blurInputOnScroll);
|
|
30233
30429
|
}, [chatContainerEl]);
|
|
30234
|
-
(0,
|
|
30430
|
+
(0, import_react61.useEffect)(() => {
|
|
30235
30431
|
const handleResize = () => setIsMobile(window.innerWidth <= 768);
|
|
30236
30432
|
handleResize();
|
|
30237
30433
|
window.addEventListener("resize", handleResize);
|
|
30238
30434
|
return () => window.removeEventListener("resize", handleResize);
|
|
30239
30435
|
}, []);
|
|
30240
|
-
(0,
|
|
30436
|
+
(0, import_react61.useEffect)(() => {
|
|
30241
30437
|
const setViewportHeight = () => {
|
|
30242
30438
|
document.documentElement.style.setProperty(
|
|
30243
30439
|
"--vh",
|
|
@@ -30248,7 +30444,7 @@ var init_chat2 = __esm({
|
|
|
30248
30444
|
window.addEventListener("resize", setViewportHeight);
|
|
30249
30445
|
return () => window.removeEventListener("resize", setViewportHeight);
|
|
30250
30446
|
}, []);
|
|
30251
|
-
(0,
|
|
30447
|
+
(0, import_react61.useEffect)(() => {
|
|
30252
30448
|
if (!chatContainerEl) return;
|
|
30253
30449
|
let rafId = null;
|
|
30254
30450
|
const update = () => {
|
|
@@ -30267,7 +30463,7 @@ var init_chat2 = __esm({
|
|
|
30267
30463
|
chatContainerEl.removeEventListener(SCROLL_STATE_CHANGED_EVENT, update);
|
|
30268
30464
|
};
|
|
30269
30465
|
}, [chatContainerEl, getScrollState]);
|
|
30270
|
-
(0,
|
|
30466
|
+
(0, import_react61.useEffect)(() => {
|
|
30271
30467
|
if (!chatContainerEl) return;
|
|
30272
30468
|
let observer = null;
|
|
30273
30469
|
let rafId = null;
|
|
@@ -30302,7 +30498,7 @@ var init_chat2 = __esm({
|
|
|
30302
30498
|
if (observer) observer.disconnect();
|
|
30303
30499
|
};
|
|
30304
30500
|
}, [chatContainerEl, scrollTargetEl, scrollTargetRef, getScrollState, inputHeight, history.length]);
|
|
30305
|
-
(0,
|
|
30501
|
+
(0, import_react61.useEffect)(() => {
|
|
30306
30502
|
const isTransitioning = isStreaming || streamBuffer.trim() === "";
|
|
30307
30503
|
const delay = isTransitioning ? 400 : 100;
|
|
30308
30504
|
const timer = setTimeout(() => {
|
|
@@ -30311,7 +30507,7 @@ var init_chat2 = __esm({
|
|
|
30311
30507
|
}, delay);
|
|
30312
30508
|
return () => clearTimeout(timer);
|
|
30313
30509
|
}, [history, streamBuffer, getScrollState, isStreaming]);
|
|
30314
|
-
(0,
|
|
30510
|
+
(0, import_react61.useLayoutEffect)(() => {
|
|
30315
30511
|
const scrollState = getScrollState();
|
|
30316
30512
|
const now = Date.now();
|
|
30317
30513
|
if (isStreaming && scrollState.shouldAutoScroll && followStreamRef.current) {
|
|
@@ -30345,7 +30541,7 @@ var init_chat2 = __esm({
|
|
|
30345
30541
|
return () => clearTimeout(scrollTimer);
|
|
30346
30542
|
}
|
|
30347
30543
|
}, [history, isStreaming, scrollToBottom, getScrollState, isMobile, chatContainerRef]);
|
|
30348
|
-
(0,
|
|
30544
|
+
(0, import_react61.useEffect)(() => {
|
|
30349
30545
|
const observer = new ResizeObserver(() => {
|
|
30350
30546
|
if (inputContainerRef.current)
|
|
30351
30547
|
setInputHeight(inputContainerRef.current.offsetHeight);
|
|
@@ -30356,7 +30552,7 @@ var init_chat2 = __esm({
|
|
|
30356
30552
|
}
|
|
30357
30553
|
return () => observer.disconnect();
|
|
30358
30554
|
}, []);
|
|
30359
|
-
(0,
|
|
30555
|
+
(0, import_react61.useEffect)(() => {
|
|
30360
30556
|
if (!hydrated || !_hasHydrated) return;
|
|
30361
30557
|
if (currentId === null) {
|
|
30362
30558
|
useAIQueryStore.setState({ history: [] });
|
|
@@ -30405,7 +30601,7 @@ var init_chat2 = __esm({
|
|
|
30405
30601
|
setResponse,
|
|
30406
30602
|
setComponentStatus
|
|
30407
30603
|
]);
|
|
30408
|
-
(0,
|
|
30604
|
+
(0, import_react61.useEffect)(() => {
|
|
30409
30605
|
debugLogger.info("Chat component conversation state", {
|
|
30410
30606
|
hasHydrated: _hasHydrated,
|
|
30411
30607
|
conversationCount: conversations.length,
|
|
@@ -30414,7 +30610,7 @@ var init_chat2 = __esm({
|
|
|
30414
30610
|
storeState: "main-chat"
|
|
30415
30611
|
});
|
|
30416
30612
|
}, [_hasHydrated, conversations, currentId]);
|
|
30417
|
-
(0,
|
|
30613
|
+
(0, import_react61.useEffect)(() => {
|
|
30418
30614
|
if (!_hasHydrated || !chatContainerEl) return;
|
|
30419
30615
|
let rafId = null;
|
|
30420
30616
|
const sync = () => {
|
|
@@ -30449,7 +30645,7 @@ var init_chat2 = __esm({
|
|
|
30449
30645
|
notificationService2?.handleHttpError(error);
|
|
30450
30646
|
}
|
|
30451
30647
|
});
|
|
30452
|
-
const handleStop = (0,
|
|
30648
|
+
const handleStop = (0, import_react61.useCallback)(() => {
|
|
30453
30649
|
try {
|
|
30454
30650
|
aiProvider.cancel();
|
|
30455
30651
|
} catch (error) {
|
|
@@ -30458,7 +30654,7 @@ var init_chat2 = __esm({
|
|
|
30458
30654
|
});
|
|
30459
30655
|
}
|
|
30460
30656
|
}, [aiProvider]);
|
|
30461
|
-
const handleVoiceInterrupt = (0,
|
|
30657
|
+
const handleVoiceInterrupt = (0, import_react61.useCallback)(() => {
|
|
30462
30658
|
try {
|
|
30463
30659
|
ttsStop();
|
|
30464
30660
|
} catch (error) {
|
|
@@ -30477,7 +30673,7 @@ var init_chat2 = __esm({
|
|
|
30477
30673
|
handleStop();
|
|
30478
30674
|
}
|
|
30479
30675
|
}, [ttsStop, isStreaming, handleStop]);
|
|
30480
|
-
const handleSend = (0,
|
|
30676
|
+
const handleSend = (0, import_react61.useCallback)(
|
|
30481
30677
|
(question, images, displayQuestion) => {
|
|
30482
30678
|
const requestStartTime = trackRequestStart();
|
|
30483
30679
|
const questionForDisplay = displayQuestion || question;
|
|
@@ -30587,7 +30783,7 @@ var init_chat2 = __esm({
|
|
|
30587
30783
|
trackRequestStart
|
|
30588
30784
|
]
|
|
30589
30785
|
);
|
|
30590
|
-
const handleVoiceTranscription = (0,
|
|
30786
|
+
const handleVoiceTranscription = (0, import_react61.useCallback)(
|
|
30591
30787
|
(text) => {
|
|
30592
30788
|
const cleaned = text.trim();
|
|
30593
30789
|
if (!cleaned) {
|
|
@@ -30604,7 +30800,7 @@ var init_chat2 = __esm({
|
|
|
30604
30800
|
onInterrupt: handleVoiceInterrupt,
|
|
30605
30801
|
onError: (message) => notificationService2?.showError?.(message)
|
|
30606
30802
|
});
|
|
30607
|
-
(0,
|
|
30803
|
+
(0, import_react61.useEffect)(() => {
|
|
30608
30804
|
const previouslyEnabled = previousVoiceModeEnabledRef.current;
|
|
30609
30805
|
previousVoiceModeEnabledRef.current = isVoiceModeEnabled;
|
|
30610
30806
|
if (!previouslyEnabled && isVoiceModeEnabled) {
|
|
@@ -30629,7 +30825,7 @@ var init_chat2 = __esm({
|
|
|
30629
30825
|
}
|
|
30630
30826
|
}
|
|
30631
30827
|
}, [isVoiceModeEnabled, ttsStop]);
|
|
30632
|
-
(0,
|
|
30828
|
+
(0, import_react61.useEffect)(() => {
|
|
30633
30829
|
if (!isVoiceModeEnabled || !isStreaming) {
|
|
30634
30830
|
return;
|
|
30635
30831
|
}
|
|
@@ -30649,7 +30845,7 @@ var init_chat2 = __esm({
|
|
|
30649
30845
|
}
|
|
30650
30846
|
lastSpokenResponseRef.current = null;
|
|
30651
30847
|
}, [isStreaming, isVoiceModeEnabled, ttsStop]);
|
|
30652
|
-
(0,
|
|
30848
|
+
(0, import_react61.useEffect)(() => {
|
|
30653
30849
|
if (!isVoiceModeEnabled) {
|
|
30654
30850
|
lastSpokenResponseRef.current = null;
|
|
30655
30851
|
return;
|
|
@@ -30690,13 +30886,13 @@ var init_chat2 = __esm({
|
|
|
30690
30886
|
cancelled = true;
|
|
30691
30887
|
};
|
|
30692
30888
|
}, [history, isStreaming, isVoiceModeEnabled, isTTSAvailable, ttsSpeak]);
|
|
30693
|
-
const handleModelChange = (0,
|
|
30889
|
+
const handleModelChange = (0, import_react61.useCallback)(
|
|
30694
30890
|
(modelId) => {
|
|
30695
30891
|
setSelectedModel(modelId);
|
|
30696
30892
|
},
|
|
30697
30893
|
[setSelectedModel]
|
|
30698
30894
|
);
|
|
30699
|
-
const handleVoiceChange = (0,
|
|
30895
|
+
const handleVoiceChange = (0, import_react61.useCallback)(async (voiceId) => {
|
|
30700
30896
|
ttsStop();
|
|
30701
30897
|
stopTTS();
|
|
30702
30898
|
setSelectedVoice(voiceId);
|
|
@@ -30729,10 +30925,10 @@ var init_chat2 = __esm({
|
|
|
30729
30925
|
}
|
|
30730
30926
|
};
|
|
30731
30927
|
if (!hydrated || brandingLoading || themeLoading) {
|
|
30732
|
-
return /* @__PURE__ */ (0,
|
|
30733
|
-
/* @__PURE__ */ (0,
|
|
30734
|
-
/* @__PURE__ */ (0,
|
|
30735
|
-
|
|
30928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_material52.ThemeProvider, { theme: banditTheme, children: [
|
|
30929
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_material52.CssBaseline, {}),
|
|
30930
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
30931
|
+
import_material52.Box,
|
|
30736
30932
|
{
|
|
30737
30933
|
sx: (theme) => ({
|
|
30738
30934
|
minHeight: "100dvh",
|
|
@@ -30745,8 +30941,8 @@ var init_chat2 = __esm({
|
|
|
30745
30941
|
color: theme.palette.text.primary
|
|
30746
30942
|
}),
|
|
30747
30943
|
children: [
|
|
30748
|
-
/* @__PURE__ */ (0,
|
|
30749
|
-
/* @__PURE__ */ (0,
|
|
30944
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_material52.CircularProgress, { size: 32, thickness: 4 }),
|
|
30945
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_material52.Typography, { variant: "body2", color: "text.secondary", children: "Preparing your workspace..." })
|
|
30750
30946
|
]
|
|
30751
30947
|
}
|
|
30752
30948
|
)
|
|
@@ -30754,15 +30950,15 @@ var init_chat2 = __esm({
|
|
|
30754
30950
|
}
|
|
30755
30951
|
const userHasAccess = playgroundBypassAccess || ossMode || claims?.roles?.includes("super-user") || claims?.roles?.includes("admin");
|
|
30756
30952
|
if (!userHasAccess) {
|
|
30757
|
-
return /* @__PURE__ */ (0,
|
|
30758
|
-
/* @__PURE__ */ (0,
|
|
30759
|
-
/* @__PURE__ */ (0,
|
|
30953
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_material52.ThemeProvider, { theme: banditTheme, children: [
|
|
30954
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_material52.CssBaseline, {}),
|
|
30955
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(under_review_default, {})
|
|
30760
30956
|
] });
|
|
30761
30957
|
}
|
|
30762
|
-
return /* @__PURE__ */ (0,
|
|
30763
|
-
/* @__PURE__ */ (0,
|
|
30764
|
-
/* @__PURE__ */ (0,
|
|
30765
|
-
|
|
30958
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_material52.ThemeProvider, { theme: banditTheme, children: [
|
|
30959
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_material52.CssBaseline, {}),
|
|
30960
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
30961
|
+
import_material52.Box,
|
|
30766
30962
|
{
|
|
30767
30963
|
sx: (theme) => ({
|
|
30768
30964
|
display: "flex",
|
|
@@ -30780,7 +30976,7 @@ var init_chat2 = __esm({
|
|
|
30780
30976
|
transition: "left 0.3s ease-in-out, width 0.3s ease-in-out"
|
|
30781
30977
|
}),
|
|
30782
30978
|
children: [
|
|
30783
|
-
/* @__PURE__ */ (0,
|
|
30979
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
30784
30980
|
chat_app_bar_default,
|
|
30785
30981
|
{
|
|
30786
30982
|
availableModels,
|
|
@@ -30792,8 +30988,8 @@ var init_chat2 = __esm({
|
|
|
30792
30988
|
setDrawerOpen
|
|
30793
30989
|
}
|
|
30794
30990
|
),
|
|
30795
|
-
/* @__PURE__ */ (0,
|
|
30796
|
-
|
|
30991
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
30992
|
+
import_material52.Box,
|
|
30797
30993
|
{
|
|
30798
30994
|
ref: chatContainerRef,
|
|
30799
30995
|
sx: {
|
|
@@ -30813,8 +31009,8 @@ var init_chat2 = __esm({
|
|
|
30813
31009
|
msOverflowStyle: "none",
|
|
30814
31010
|
"&::-webkit-scrollbar": { display: "none" }
|
|
30815
31011
|
},
|
|
30816
|
-
children: /* @__PURE__ */ (0,
|
|
30817
|
-
|
|
31012
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
31013
|
+
import_material52.Box,
|
|
30818
31014
|
{
|
|
30819
31015
|
sx: {
|
|
30820
31016
|
width: "100%",
|
|
@@ -30824,9 +31020,9 @@ var init_chat2 = __esm({
|
|
|
30824
31020
|
pt: 2
|
|
30825
31021
|
},
|
|
30826
31022
|
children: [
|
|
30827
|
-
logoShouldRender && !brandingLoading && (branding?.logoBase64 ? /* @__PURE__ */ (0,
|
|
30828
|
-
/* @__PURE__ */ (0,
|
|
30829
|
-
|
|
31023
|
+
logoShouldRender && !brandingLoading && (branding?.logoBase64 ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(custom_logo_default, { visible: logoVisible, atTop: true }) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(bandit_chat_logo_default, { visible: logoVisible, atTop: true })),
|
|
31024
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
31025
|
+
import_material52.Box,
|
|
30830
31026
|
{
|
|
30831
31027
|
sx: {
|
|
30832
31028
|
margin: "0 auto",
|
|
@@ -30835,7 +31031,7 @@ var init_chat2 = __esm({
|
|
|
30835
31031
|
flexShrink: 0,
|
|
30836
31032
|
px: isMobile ? 0 : 0
|
|
30837
31033
|
},
|
|
30838
|
-
children: /* @__PURE__ */ (0,
|
|
31034
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
30839
31035
|
chat_messages_default,
|
|
30840
31036
|
{
|
|
30841
31037
|
isStreaming,
|
|
@@ -30859,7 +31055,7 @@ var init_chat2 = __esm({
|
|
|
30859
31055
|
)
|
|
30860
31056
|
}
|
|
30861
31057
|
),
|
|
30862
|
-
showScrollToBottom && /* @__PURE__ */ (0,
|
|
31058
|
+
showScrollToBottom && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
30863
31059
|
chat_scroll_to_bottom_button_default,
|
|
30864
31060
|
{
|
|
30865
31061
|
inputHeight,
|
|
@@ -30868,8 +31064,8 @@ var init_chat2 = __esm({
|
|
|
30868
31064
|
onClick: handleScrollToBottomClick
|
|
30869
31065
|
}
|
|
30870
31066
|
),
|
|
30871
|
-
history.length === 0 && componentStatus !== "Loading" && !isMobile && /* @__PURE__ */ (0,
|
|
30872
|
-
|
|
31067
|
+
history.length === 0 && componentStatus !== "Loading" && !isMobile && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
31068
|
+
import_material52.Box,
|
|
30873
31069
|
{
|
|
30874
31070
|
sx: (theme) => ({
|
|
30875
31071
|
position: "absolute",
|
|
@@ -30887,8 +31083,8 @@ var init_chat2 = __esm({
|
|
|
30887
31083
|
})
|
|
30888
31084
|
}
|
|
30889
31085
|
),
|
|
30890
|
-
/* @__PURE__ */ (0,
|
|
30891
|
-
|
|
31086
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
31087
|
+
import_material52.Box,
|
|
30892
31088
|
{
|
|
30893
31089
|
sx: {
|
|
30894
31090
|
display: "flex",
|
|
@@ -30899,10 +31095,11 @@ var init_chat2 = __esm({
|
|
|
30899
31095
|
maxWidth: "768px"
|
|
30900
31096
|
},
|
|
30901
31097
|
children: [
|
|
30902
|
-
/* @__PURE__ */ (0,
|
|
30903
|
-
history.length === 0 && componentStatus !== "Loading" && !pendingMessage && preferences.chatSuggestionsEnabled && /* @__PURE__ */ (0,
|
|
30904
|
-
/* @__PURE__ */ (0,
|
|
30905
|
-
/* @__PURE__ */ (0,
|
|
31098
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_material52.Box, { sx: { flex: "1 1 auto" } }),
|
|
31099
|
+
history.length === 0 && componentStatus !== "Loading" && !pendingMessage && preferences.chatSuggestionsEnabled && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_material52.Box, { sx: { marginBottom: "20px" }, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(QuerySuggestionPicker, { onSend: handleSend, inputHeight }) }),
|
|
31100
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(rate_limit_prompt_default, {}),
|
|
31101
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ask_user_card_default, {}),
|
|
31102
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
30906
31103
|
chat_input_default,
|
|
30907
31104
|
{
|
|
30908
31105
|
inputValue,
|
|
@@ -30929,7 +31126,7 @@ var init_chat2 = __esm({
|
|
|
30929
31126
|
]
|
|
30930
31127
|
}
|
|
30931
31128
|
),
|
|
30932
|
-
preferences.feedbackEnabled && !isMobile && /* @__PURE__ */ (0,
|
|
31129
|
+
preferences.feedbackEnabled && !isMobile && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
30933
31130
|
FeedbackButton,
|
|
30934
31131
|
{
|
|
30935
31132
|
fullScreen: false,
|
|
@@ -30942,11 +31139,11 @@ var init_chat2 = __esm({
|
|
|
30942
31139
|
}
|
|
30943
31140
|
}
|
|
30944
31141
|
),
|
|
30945
|
-
/* @__PURE__ */ (0,
|
|
31142
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ConnectionStatus, { position: "top", showWhenGood: false })
|
|
30946
31143
|
]
|
|
30947
31144
|
}
|
|
30948
31145
|
),
|
|
30949
|
-
/* @__PURE__ */ (0,
|
|
31146
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(canvas_panel_default, { isMobile })
|
|
30950
31147
|
] });
|
|
30951
31148
|
};
|
|
30952
31149
|
Chat = () => {
|
|
@@ -30972,9 +31169,9 @@ var init_chat2 = __esm({
|
|
|
30972
31169
|
});
|
|
30973
31170
|
if (!allowUnauthenticated && !bypassAuth && !authenticationService.isAuthenticated()) {
|
|
30974
31171
|
debugLogger.debug("User is not authenticated, redirecting to login");
|
|
30975
|
-
return /* @__PURE__ */ (0,
|
|
31172
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react_router_dom5.Navigate, { to: "/login", replace: true });
|
|
30976
31173
|
}
|
|
30977
|
-
return /* @__PURE__ */ (0,
|
|
31174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ChatContent, {});
|
|
30978
31175
|
};
|
|
30979
31176
|
chat_default = Chat;
|
|
30980
31177
|
}
|
|
@@ -30986,13 +31183,13 @@ __export(management_exports, {
|
|
|
30986
31183
|
default: () => management_default
|
|
30987
31184
|
});
|
|
30988
31185
|
module.exports = __toCommonJS(management_exports);
|
|
30989
|
-
var
|
|
31186
|
+
var import_react62 = require("react");
|
|
30990
31187
|
var import_useMediaQuery2 = __toESM(require("@mui/material/useMediaQuery"));
|
|
30991
31188
|
var import_styles32 = require("@mui/material/styles");
|
|
30992
31189
|
init_useKnowledgeStore();
|
|
30993
31190
|
init_indexedDBService();
|
|
30994
|
-
var
|
|
30995
|
-
var
|
|
31191
|
+
var import_material53 = require("@mui/material");
|
|
31192
|
+
var import_react_router_dom6 = require("react-router-dom");
|
|
30996
31193
|
|
|
30997
31194
|
// src/modals/chat-modal/chat-modal.tsx
|
|
30998
31195
|
var import_react23 = require("react");
|
|
@@ -43484,7 +43681,7 @@ init_authenticationStore();
|
|
|
43484
43681
|
init_useNotificationService();
|
|
43485
43682
|
init_useFeatures();
|
|
43486
43683
|
init_lucide_icons();
|
|
43487
|
-
var
|
|
43684
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
43488
43685
|
var preloadChatPage = () => Promise.resolve().then(() => (init_chat2(), chat_exports));
|
|
43489
43686
|
var buildCapabilitiesUrl = (gatewayApiUrl) => {
|
|
43490
43687
|
const trimmed = gatewayApiUrl.replace(/\/$/, "");
|
|
@@ -43494,10 +43691,10 @@ var buildCapabilitiesUrl = (gatewayApiUrl) => {
|
|
|
43494
43691
|
return `${trimmed}/api/capabilities`;
|
|
43495
43692
|
};
|
|
43496
43693
|
var Management = () => {
|
|
43497
|
-
const navigate = (0,
|
|
43694
|
+
const navigate = (0, import_react_router_dom6.useNavigate)();
|
|
43498
43695
|
const notificationService2 = useNotificationService();
|
|
43499
43696
|
const isMobile = (0, import_useMediaQuery2.default)("(max-width:900px)");
|
|
43500
|
-
const [sidebarOpen, setSidebarOpen] = (0,
|
|
43697
|
+
const [sidebarOpen, setSidebarOpen] = (0, import_react62.useState)(false);
|
|
43501
43698
|
const getOptimalFabLogo = async () => {
|
|
43502
43699
|
const banditHead6 = "https://cdn.burtson.ai/images/bandit-head.png";
|
|
43503
43700
|
try {
|
|
@@ -43537,16 +43734,16 @@ var Management = () => {
|
|
|
43537
43734
|
hasTransparentLogo,
|
|
43538
43735
|
setHasTransparentLogo
|
|
43539
43736
|
} = useModelStore();
|
|
43540
|
-
const [modalOpen, setModalOpen] = (0,
|
|
43737
|
+
const [modalOpen, setModalOpen] = (0, import_react62.useState)(false);
|
|
43541
43738
|
const banditHead5 = "https://cdn.burtson.ai/images/bandit-head.png";
|
|
43542
|
-
const [fabLogo, setFabLogo] = (0,
|
|
43543
|
-
const [tabIndex, setTabIndex] = (0,
|
|
43544
|
-
const [logoFile, setLogoFile] = (0,
|
|
43545
|
-
const [logoBase64, setLogoBase64] = (0,
|
|
43546
|
-
const [brandingText, setBrandingText] = (0,
|
|
43547
|
-
const [theme, setTheme] = (0,
|
|
43548
|
-
const [customAvatarBase64, setCustomAvatarBase64] = (0,
|
|
43549
|
-
const [presetAvatar, setPresetAvatar] = (0,
|
|
43739
|
+
const [fabLogo, setFabLogo] = (0, import_react62.useState)(banditHead5);
|
|
43740
|
+
const [tabIndex, setTabIndex] = (0, import_react62.useState)(4);
|
|
43741
|
+
const [logoFile, setLogoFile] = (0, import_react62.useState)(null);
|
|
43742
|
+
const [logoBase64, setLogoBase64] = (0, import_react62.useState)(null);
|
|
43743
|
+
const [brandingText, setBrandingText] = (0, import_react62.useState)("");
|
|
43744
|
+
const [theme, setTheme] = (0, import_react62.useState)("bandit-dark");
|
|
43745
|
+
const [customAvatarBase64, setCustomAvatarBase64] = (0, import_react62.useState)(null);
|
|
43746
|
+
const [presetAvatar, setPresetAvatar] = (0, import_react62.useState)(null);
|
|
43550
43747
|
const showSnackbarMessage = (message, severity = "success") => {
|
|
43551
43748
|
if (severity === "success") {
|
|
43552
43749
|
notificationService2?.showSuccess(message);
|
|
@@ -43554,9 +43751,9 @@ var Management = () => {
|
|
|
43554
43751
|
notificationService2?.showError(message);
|
|
43555
43752
|
}
|
|
43556
43753
|
};
|
|
43557
|
-
const [restoreDialogOpen, setRestoreDialogOpen] = (0,
|
|
43558
|
-
const [brandingLoaded, setBrandingLoaded] = (0,
|
|
43559
|
-
const [isLoadingBranding, setIsLoadingBranding] = (0,
|
|
43754
|
+
const [restoreDialogOpen, setRestoreDialogOpen] = (0, import_react62.useState)(false);
|
|
43755
|
+
const [brandingLoaded, setBrandingLoaded] = (0, import_react62.useState)(false);
|
|
43756
|
+
const [isLoadingBranding, setIsLoadingBranding] = (0, import_react62.useState)(false);
|
|
43560
43757
|
const { initModels } = useModelStore();
|
|
43561
43758
|
const { settings: packageSettings } = usePackageSettingsStore();
|
|
43562
43759
|
const authToken = useAuthenticationStore((state) => state.token);
|
|
@@ -43564,8 +43761,8 @@ var Management = () => {
|
|
|
43564
43761
|
const { hasAdminDashboard, hasLimitedAdminDashboard, getCurrentTier, hasAdvancedSearch } = useFeatures();
|
|
43565
43762
|
const { showAdminPanel, showLimitedAdminPanel } = useFeatureVisibility();
|
|
43566
43763
|
const { provider: currentProvider, config: currentProviderConfig } = useAIProviderStore();
|
|
43567
|
-
const [seedPacksEnabled, setSeedPacksEnabled] = (0,
|
|
43568
|
-
const [localSelectedModel, setLocalSelectedModel] = (0,
|
|
43764
|
+
const [seedPacksEnabled, setSeedPacksEnabled] = (0, import_react62.useState)(false);
|
|
43765
|
+
const [localSelectedModel, setLocalSelectedModel] = (0, import_react62.useState)({
|
|
43569
43766
|
name: "",
|
|
43570
43767
|
tagline: "",
|
|
43571
43768
|
systemPrompt: "",
|
|
@@ -43578,7 +43775,7 @@ var Management = () => {
|
|
|
43578
43775
|
loadDocuments,
|
|
43579
43776
|
clearAllDocuments
|
|
43580
43777
|
} = useKnowledgeStore2();
|
|
43581
|
-
(0,
|
|
43778
|
+
(0, import_react62.useEffect)(() => {
|
|
43582
43779
|
if (selectedModel) {
|
|
43583
43780
|
const selected = availableModels.find((m) => m.name === selectedModel);
|
|
43584
43781
|
if (selected) {
|
|
@@ -43602,7 +43799,7 @@ var Management = () => {
|
|
|
43602
43799
|
}
|
|
43603
43800
|
}
|
|
43604
43801
|
}, [selectedModel, availableModels]);
|
|
43605
|
-
const loadBrandingConfig = (0,
|
|
43802
|
+
const loadBrandingConfig = (0, import_react62.useCallback)(async () => {
|
|
43606
43803
|
if (isLoadingBranding || brandingLoaded) {
|
|
43607
43804
|
debugLogger.warn("Branding loading already in progress or completed, skipping");
|
|
43608
43805
|
return;
|
|
@@ -43717,15 +43914,15 @@ var Management = () => {
|
|
|
43717
43914
|
setTagline,
|
|
43718
43915
|
setTheme
|
|
43719
43916
|
]);
|
|
43720
|
-
(0,
|
|
43917
|
+
(0, import_react62.useEffect)(() => {
|
|
43721
43918
|
void loadBrandingConfig();
|
|
43722
43919
|
}, [loadBrandingConfig]);
|
|
43723
43920
|
const handleOpenModal = () => setModalOpen(true);
|
|
43724
43921
|
const handleCloseModal = () => setModalOpen(false);
|
|
43725
|
-
(0,
|
|
43922
|
+
(0, import_react62.useEffect)(() => {
|
|
43726
43923
|
getOptimalFabLogo().then(setFabLogo);
|
|
43727
43924
|
}, []);
|
|
43728
|
-
(0,
|
|
43925
|
+
(0, import_react62.useEffect)(() => {
|
|
43729
43926
|
if (logoBase64) {
|
|
43730
43927
|
setFabLogo(logoBase64);
|
|
43731
43928
|
} else {
|
|
@@ -44172,7 +44369,7 @@ var Management = () => {
|
|
|
44172
44369
|
reader.readAsText(file);
|
|
44173
44370
|
}
|
|
44174
44371
|
};
|
|
44175
|
-
(0,
|
|
44372
|
+
(0, import_react62.useEffect)(() => {
|
|
44176
44373
|
if (localSelectedModel.selectedModel && !availableModels.some((m) => m.name === localSelectedModel.selectedModel)) {
|
|
44177
44374
|
setLocalSelectedModel((prev) => ({
|
|
44178
44375
|
...prev,
|
|
@@ -44180,10 +44377,10 @@ var Management = () => {
|
|
|
44180
44377
|
}));
|
|
44181
44378
|
}
|
|
44182
44379
|
}, [availableModels, localSelectedModel.selectedModel]);
|
|
44183
|
-
(0,
|
|
44380
|
+
(0, import_react62.useEffect)(() => {
|
|
44184
44381
|
loadDocuments();
|
|
44185
44382
|
}, [loadDocuments]);
|
|
44186
|
-
(0,
|
|
44383
|
+
(0, import_react62.useEffect)(() => {
|
|
44187
44384
|
const gatewayApiUrl = packageSettings?.gatewayApiUrl;
|
|
44188
44385
|
if (!gatewayApiUrl || gatewayApiUrl.toLowerCase().startsWith("playground://")) {
|
|
44189
44386
|
setSeedPacksEnabled(false);
|
|
@@ -44226,7 +44423,7 @@ var Management = () => {
|
|
|
44226
44423
|
isActive = false;
|
|
44227
44424
|
};
|
|
44228
44425
|
}, [packageSettings?.gatewayApiUrl, authToken]);
|
|
44229
|
-
const currentTheme = (0,
|
|
44426
|
+
const currentTheme = (0, import_react62.useMemo)(() => {
|
|
44230
44427
|
const baseTheme = predefinedThemes[theme] || banditDarkTheme;
|
|
44231
44428
|
return (0, import_styles32.createTheme)(baseTheme, {
|
|
44232
44429
|
// Management-scoped density: condenses every settings tab at once. This
|
|
@@ -44283,43 +44480,43 @@ var Management = () => {
|
|
|
44283
44480
|
const allNavTabs = [
|
|
44284
44481
|
{
|
|
44285
44482
|
label: "Personalities",
|
|
44286
|
-
icon: /* @__PURE__ */ (0,
|
|
44483
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(FaceRetouchingNaturalIcon, {}),
|
|
44287
44484
|
requiresFeature: "limitedAdminDashboard",
|
|
44288
44485
|
requiresAdmin: true
|
|
44289
44486
|
},
|
|
44290
44487
|
{
|
|
44291
44488
|
label: "Branding",
|
|
44292
|
-
icon: /* @__PURE__ */ (0,
|
|
44489
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(BrushIcon, {}),
|
|
44293
44490
|
requiresFeature: "limitedAdminDashboard",
|
|
44294
44491
|
requiresAdmin: true
|
|
44295
44492
|
},
|
|
44296
44493
|
{
|
|
44297
44494
|
label: "Knowledge",
|
|
44298
|
-
icon: /* @__PURE__ */ (0,
|
|
44495
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(MenuBookIcon, {}),
|
|
44299
44496
|
requiresFeature: "limitedAdminDashboard",
|
|
44300
44497
|
requiresAdmin: true
|
|
44301
44498
|
},
|
|
44302
44499
|
{
|
|
44303
44500
|
label: "Storage",
|
|
44304
|
-
icon: /* @__PURE__ */ (0,
|
|
44501
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(StorageIcon, {}),
|
|
44305
44502
|
requiresFeature: "limitedAdminDashboard",
|
|
44306
44503
|
requiresAdmin: true
|
|
44307
44504
|
},
|
|
44308
44505
|
{
|
|
44309
44506
|
label: "Preferences",
|
|
44310
|
-
icon: /* @__PURE__ */ (0,
|
|
44507
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(TuneIcon, {}),
|
|
44311
44508
|
requiresFeature: "limitedAdminDashboard",
|
|
44312
44509
|
requiresAdmin: false
|
|
44313
44510
|
},
|
|
44314
44511
|
{
|
|
44315
44512
|
label: "Provider",
|
|
44316
|
-
icon: /* @__PURE__ */ (0,
|
|
44513
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(CloudIcon, {}),
|
|
44317
44514
|
requiresFeature: "advancedSearch",
|
|
44318
44515
|
requiresAdmin: true
|
|
44319
44516
|
},
|
|
44320
44517
|
{
|
|
44321
44518
|
label: "Tools",
|
|
44322
|
-
icon: /* @__PURE__ */ (0,
|
|
44519
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(BuildIcon, {}),
|
|
44323
44520
|
requiresFeature: "advancedSearch",
|
|
44324
44521
|
requiresAdmin: true
|
|
44325
44522
|
}
|
|
@@ -44347,7 +44544,7 @@ var Management = () => {
|
|
|
44347
44544
|
});
|
|
44348
44545
|
const preferredDefaultTabIndex = navTabs.findIndex((tab) => tab.label === "Preferences");
|
|
44349
44546
|
const defaultTabIndex = preferredDefaultTabIndex >= 0 ? preferredDefaultTabIndex : 0;
|
|
44350
|
-
(0,
|
|
44547
|
+
(0, import_react62.useEffect)(() => {
|
|
44351
44548
|
setTabIndex((current) => {
|
|
44352
44549
|
if (current < 0 || current >= navTabs.length) {
|
|
44353
44550
|
return defaultTabIndex;
|
|
@@ -44357,8 +44554,8 @@ var Management = () => {
|
|
|
44357
44554
|
}, [navTabs.length, defaultTabIndex]);
|
|
44358
44555
|
const mobileQuickTabs = navTabs.slice(0, 5);
|
|
44359
44556
|
const hasMobileOverflowTabs = navTabs.length > mobileQuickTabs.length;
|
|
44360
|
-
const navigationContent = /* @__PURE__ */ (0,
|
|
44361
|
-
|
|
44557
|
+
const navigationContent = /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
44558
|
+
import_material53.Box,
|
|
44362
44559
|
{
|
|
44363
44560
|
sx: {
|
|
44364
44561
|
display: "flex",
|
|
@@ -44368,8 +44565,8 @@ var Management = () => {
|
|
|
44368
44565
|
bgcolor: "inherit"
|
|
44369
44566
|
},
|
|
44370
44567
|
children: [
|
|
44371
|
-
isMobile && /* @__PURE__ */ (0,
|
|
44372
|
-
|
|
44568
|
+
isMobile && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
44569
|
+
import_material53.Box,
|
|
44373
44570
|
{
|
|
44374
44571
|
sx: {
|
|
44375
44572
|
height: 6,
|
|
@@ -44382,15 +44579,15 @@ var Management = () => {
|
|
|
44382
44579
|
}
|
|
44383
44580
|
}
|
|
44384
44581
|
),
|
|
44385
|
-
/* @__PURE__ */ (0,
|
|
44386
|
-
|
|
44582
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_material53.Box, { sx: { p: isMobile ? 2.5 : 3, pb: isMobile ? 1.5 : 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
44583
|
+
import_material53.Button,
|
|
44387
44584
|
{
|
|
44388
44585
|
onClick: () => {
|
|
44389
44586
|
if (isMobile) setSidebarOpen(false);
|
|
44390
44587
|
navigate("/chat");
|
|
44391
44588
|
},
|
|
44392
44589
|
onMouseEnter: preloadChatPage,
|
|
44393
|
-
startIcon: /* @__PURE__ */ (0,
|
|
44590
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ChevronLeftIcon, { sx: { fontSize: 20 } }),
|
|
44394
44591
|
fullWidth: true,
|
|
44395
44592
|
variant: "outlined",
|
|
44396
44593
|
sx: {
|
|
@@ -44417,9 +44614,9 @@ var Management = () => {
|
|
|
44417
44614
|
children: "Back to Chat"
|
|
44418
44615
|
}
|
|
44419
44616
|
) }),
|
|
44420
|
-
/* @__PURE__ */ (0,
|
|
44421
|
-
/* @__PURE__ */ (0,
|
|
44422
|
-
|
|
44617
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_material53.Divider, { sx: { mx: isMobile ? 2 : 3, mb: 2, opacity: 0.6 } }),
|
|
44618
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_material53.Box, { sx: { flex: 1, px: isMobile ? 1.5 : 2, pb: 3, overflowY: "auto" }, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_material53.List, { sx: { px: 0, py: 0 }, children: navTabs.map((tab, idx) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
44619
|
+
import_material53.ListItemButton,
|
|
44423
44620
|
{
|
|
44424
44621
|
selected: tabIndex === idx,
|
|
44425
44622
|
onClick: () => {
|
|
@@ -44459,9 +44656,9 @@ var Management = () => {
|
|
|
44459
44656
|
"& .MuiListItemIcon-root svg": { width: 17, height: 17 }
|
|
44460
44657
|
},
|
|
44461
44658
|
children: [
|
|
44462
|
-
/* @__PURE__ */ (0,
|
|
44463
|
-
/* @__PURE__ */ (0,
|
|
44464
|
-
|
|
44659
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_material53.ListItemIcon, { children: tab.icon }),
|
|
44660
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
44661
|
+
import_material53.ListItemText,
|
|
44465
44662
|
{
|
|
44466
44663
|
primary: tab.label,
|
|
44467
44664
|
primaryTypographyProps: {
|
|
@@ -44478,10 +44675,10 @@ var Management = () => {
|
|
|
44478
44675
|
}
|
|
44479
44676
|
);
|
|
44480
44677
|
if (!brandingLoaded) return null;
|
|
44481
|
-
return /* @__PURE__ */ (0,
|
|
44482
|
-
/* @__PURE__ */ (0,
|
|
44483
|
-
/* @__PURE__ */ (0,
|
|
44484
|
-
|
|
44678
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_material53.ThemeProvider, { theme: currentTheme, children: [
|
|
44679
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_material53.CssBaseline, {}),
|
|
44680
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
44681
|
+
import_material53.Box,
|
|
44485
44682
|
{
|
|
44486
44683
|
display: "flex",
|
|
44487
44684
|
height: "100vh",
|
|
@@ -44493,8 +44690,8 @@ var Management = () => {
|
|
|
44493
44690
|
position: "relative"
|
|
44494
44691
|
},
|
|
44495
44692
|
children: [
|
|
44496
|
-
isMobile && /* @__PURE__ */ (0,
|
|
44497
|
-
|
|
44693
|
+
isMobile && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
44694
|
+
import_material53.Box,
|
|
44498
44695
|
{
|
|
44499
44696
|
sx: {
|
|
44500
44697
|
width: "100%",
|
|
@@ -44513,8 +44710,8 @@ var Management = () => {
|
|
|
44513
44710
|
boxShadow: "0 2px 8px rgba(0,0,0,0.1)"
|
|
44514
44711
|
},
|
|
44515
44712
|
children: [
|
|
44516
|
-
/* @__PURE__ */ (0,
|
|
44517
|
-
|
|
44713
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
44714
|
+
import_material53.Button,
|
|
44518
44715
|
{
|
|
44519
44716
|
onClick: () => setSidebarOpen((o) => !o),
|
|
44520
44717
|
sx: {
|
|
@@ -44535,7 +44732,7 @@ var Management = () => {
|
|
|
44535
44732
|
transform: sidebarOpen ? "rotate(90deg) scale(0.95)" : "scale(0.95)"
|
|
44536
44733
|
}
|
|
44537
44734
|
},
|
|
44538
|
-
children: /* @__PURE__ */ (0,
|
|
44735
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
44539
44736
|
"path",
|
|
44540
44737
|
{
|
|
44541
44738
|
d: sidebarOpen ? "M18 6L6 18M6 6L18 18" : "M3 12H21M3 6H21M3 18H21",
|
|
@@ -44547,8 +44744,8 @@ var Management = () => {
|
|
|
44547
44744
|
) })
|
|
44548
44745
|
}
|
|
44549
44746
|
),
|
|
44550
|
-
/* @__PURE__ */ (0,
|
|
44551
|
-
|
|
44747
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
44748
|
+
import_material53.Typography,
|
|
44552
44749
|
{
|
|
44553
44750
|
variant: "h6",
|
|
44554
44751
|
sx: {
|
|
@@ -44560,14 +44757,14 @@ var Management = () => {
|
|
|
44560
44757
|
children: "Management"
|
|
44561
44758
|
}
|
|
44562
44759
|
),
|
|
44563
|
-
/* @__PURE__ */ (0,
|
|
44760
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_material53.Box, { sx: {
|
|
44564
44761
|
px: 2,
|
|
44565
44762
|
py: 0.5,
|
|
44566
44763
|
borderRadius: 2,
|
|
44567
44764
|
bgcolor: (theme2) => theme2.palette.mode === "dark" ? "rgba(25,118,210,0.12)" : "rgba(25,118,210,0.08)",
|
|
44568
44765
|
border: (theme2) => `1px solid ${theme2.palette.primary.main}20`
|
|
44569
|
-
}, children: /* @__PURE__ */ (0,
|
|
44570
|
-
|
|
44766
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
44767
|
+
import_material53.Typography,
|
|
44571
44768
|
{
|
|
44572
44769
|
variant: "caption",
|
|
44573
44770
|
sx: {
|
|
@@ -44581,8 +44778,8 @@ var Management = () => {
|
|
|
44581
44778
|
]
|
|
44582
44779
|
}
|
|
44583
44780
|
),
|
|
44584
|
-
isMobile && /* @__PURE__ */ (0,
|
|
44585
|
-
|
|
44781
|
+
isMobile && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
44782
|
+
import_material53.Box,
|
|
44586
44783
|
{
|
|
44587
44784
|
sx: {
|
|
44588
44785
|
width: "100%",
|
|
@@ -44599,8 +44796,8 @@ var Management = () => {
|
|
|
44599
44796
|
mobileQuickTabs.map((tab) => {
|
|
44600
44797
|
const quickTabIndex = navTabs.findIndex((navTab) => navTab.label === tab.label);
|
|
44601
44798
|
const selected = tabIndex === quickTabIndex;
|
|
44602
|
-
return /* @__PURE__ */ (0,
|
|
44603
|
-
|
|
44799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
44800
|
+
import_material53.Button,
|
|
44604
44801
|
{
|
|
44605
44802
|
size: "small",
|
|
44606
44803
|
onClick: () => setTabIndex(quickTabIndex),
|
|
@@ -44625,8 +44822,8 @@ var Management = () => {
|
|
|
44625
44822
|
tab.label
|
|
44626
44823
|
);
|
|
44627
44824
|
}),
|
|
44628
|
-
hasMobileOverflowTabs && /* @__PURE__ */ (0,
|
|
44629
|
-
|
|
44825
|
+
hasMobileOverflowTabs && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
44826
|
+
import_material53.Button,
|
|
44630
44827
|
{
|
|
44631
44828
|
size: "small",
|
|
44632
44829
|
onClick: () => setSidebarOpen(true),
|
|
@@ -44648,8 +44845,8 @@ var Management = () => {
|
|
|
44648
44845
|
]
|
|
44649
44846
|
}
|
|
44650
44847
|
),
|
|
44651
|
-
isMobile ? /* @__PURE__ */ (0,
|
|
44652
|
-
|
|
44848
|
+
isMobile ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
44849
|
+
import_material53.SwipeableDrawer,
|
|
44653
44850
|
{
|
|
44654
44851
|
anchor: "bottom",
|
|
44655
44852
|
open: sidebarOpen,
|
|
@@ -44669,8 +44866,8 @@ var Management = () => {
|
|
|
44669
44866
|
},
|
|
44670
44867
|
children: navigationContent
|
|
44671
44868
|
}
|
|
44672
|
-
) : /* @__PURE__ */ (0,
|
|
44673
|
-
|
|
44869
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
44870
|
+
import_material53.Box,
|
|
44674
44871
|
{
|
|
44675
44872
|
sx: {
|
|
44676
44873
|
width: 240,
|
|
@@ -44693,8 +44890,8 @@ var Management = () => {
|
|
|
44693
44890
|
children: navigationContent
|
|
44694
44891
|
}
|
|
44695
44892
|
),
|
|
44696
|
-
/* @__PURE__ */ (0,
|
|
44697
|
-
|
|
44893
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
44894
|
+
import_material53.Box,
|
|
44698
44895
|
{
|
|
44699
44896
|
sx: {
|
|
44700
44897
|
flex: 1,
|
|
@@ -44713,7 +44910,7 @@ var Management = () => {
|
|
|
44713
44910
|
transition: "margin-left 0.2s"
|
|
44714
44911
|
},
|
|
44715
44912
|
children: [
|
|
44716
|
-
navTabs[tabIndex]?.label === "Personalities" && /* @__PURE__ */ (0,
|
|
44913
|
+
navTabs[tabIndex]?.label === "Personalities" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
44717
44914
|
PersonalitiesTab_default,
|
|
44718
44915
|
{
|
|
44719
44916
|
availableModels,
|
|
@@ -44732,7 +44929,7 @@ var Management = () => {
|
|
|
44732
44929
|
showSnackbar: showSnackbarMessage
|
|
44733
44930
|
}
|
|
44734
44931
|
),
|
|
44735
|
-
navTabs[tabIndex]?.label === "Branding" && /* @__PURE__ */ (0,
|
|
44932
|
+
navTabs[tabIndex]?.label === "Branding" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
44736
44933
|
BrandingTab_default,
|
|
44737
44934
|
{
|
|
44738
44935
|
logoFile,
|
|
@@ -44751,7 +44948,7 @@ var Management = () => {
|
|
|
44751
44948
|
setLogoBase64
|
|
44752
44949
|
}
|
|
44753
44950
|
),
|
|
44754
|
-
navTabs[tabIndex]?.label === "Knowledge" && /* @__PURE__ */ (0,
|
|
44951
|
+
navTabs[tabIndex]?.label === "Knowledge" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
44755
44952
|
KnowledgeHubTab_default,
|
|
44756
44953
|
{
|
|
44757
44954
|
documents,
|
|
@@ -44764,8 +44961,8 @@ var Management = () => {
|
|
|
44764
44961
|
seedPacksEnabled
|
|
44765
44962
|
}
|
|
44766
44963
|
),
|
|
44767
|
-
navTabs[tabIndex]?.label === "Storage" && /* @__PURE__ */ (0,
|
|
44768
|
-
navTabs[tabIndex]?.label === "Preferences" && /* @__PURE__ */ (0,
|
|
44964
|
+
navTabs[tabIndex]?.label === "Storage" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(StorageTab_default, { currentTheme }),
|
|
44965
|
+
navTabs[tabIndex]?.label === "Preferences" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
44769
44966
|
PreferencesTab_default,
|
|
44770
44967
|
{
|
|
44771
44968
|
preferences,
|
|
@@ -44775,13 +44972,13 @@ var Management = () => {
|
|
|
44775
44972
|
showSnackbar: showSnackbarMessage
|
|
44776
44973
|
}
|
|
44777
44974
|
),
|
|
44778
|
-
navTabs[tabIndex]?.label === "Provider" && /* @__PURE__ */ (0,
|
|
44779
|
-
navTabs[tabIndex]?.label === "Tools" && /* @__PURE__ */ (0,
|
|
44975
|
+
navTabs[tabIndex]?.label === "Provider" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ProviderTab, {}),
|
|
44976
|
+
navTabs[tabIndex]?.label === "Tools" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(MCPToolsTabV2_default, {})
|
|
44780
44977
|
]
|
|
44781
44978
|
}
|
|
44782
44979
|
),
|
|
44783
|
-
/* @__PURE__ */ (0,
|
|
44784
|
-
|
|
44980
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
44981
|
+
import_material53.Fab,
|
|
44785
44982
|
{
|
|
44786
44983
|
"aria-label": "AI",
|
|
44787
44984
|
onClick: handleOpenModal,
|
|
@@ -44802,7 +44999,7 @@ var Management = () => {
|
|
|
44802
44999
|
boxShadow: theme2.shadows[6],
|
|
44803
45000
|
zIndex: 2e3
|
|
44804
45001
|
}),
|
|
44805
|
-
children: /* @__PURE__ */ (0,
|
|
45002
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
44806
45003
|
"img",
|
|
44807
45004
|
{
|
|
44808
45005
|
src: fabLogo,
|
|
@@ -44816,7 +45013,7 @@ var Management = () => {
|
|
|
44816
45013
|
)
|
|
44817
45014
|
}
|
|
44818
45015
|
),
|
|
44819
|
-
/* @__PURE__ */ (0,
|
|
45016
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(chat_modal_default, { open: modalOpen, onClose: handleCloseModal })
|
|
44820
45017
|
]
|
|
44821
45018
|
}
|
|
44822
45019
|
)
|