@burtson-labs/bandit-engine 2.0.69 → 2.0.70
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-FLMR4EI6.mjs → chat-XW4JIAOE.mjs} +2 -2
- package/dist/{chunk-NL4BY4YL.mjs → chunk-5SA7PQK4.mjs} +2 -2
- package/dist/{chunk-6KU3NOZW.mjs → chunk-PUUL2R3T.mjs} +874 -683
- package/dist/chunk-PUUL2R3T.mjs.map +1 -0
- package/dist/index.js +3155 -2951
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/management/management.js +1110 -906
- package/dist/management/management.js.map +1 -1
- package/dist/management/management.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-6KU3NOZW.mjs.map +0 -1
- /package/dist/{chat-FLMR4EI6.mjs.map → chat-XW4JIAOE.mjs.map} +0 -0
- /package/dist/{chunk-NL4BY4YL.mjs.map → chunk-5SA7PQK4.mjs.map} +0 -0
|
@@ -84,7 +84,7 @@ import {
|
|
|
84
84
|
} from "./chunk-KCI46M23.mjs";
|
|
85
85
|
|
|
86
86
|
// src/chat/chat.tsx
|
|
87
|
-
import { useCallback as useCallback6, useEffect as
|
|
87
|
+
import { useCallback as useCallback6, useEffect as useEffect15, useLayoutEffect, useMemo as useMemo3, useRef as useRef13, useState as useState15 } from "react";
|
|
88
88
|
|
|
89
89
|
// src/chat/custom-logo.tsx
|
|
90
90
|
import React, { useEffect } from "react";
|
|
@@ -171,7 +171,7 @@ var Logo = ({ visible, atTop = false }) => {
|
|
|
171
171
|
var custom_logo_default = Logo;
|
|
172
172
|
|
|
173
173
|
// src/chat/chat.tsx
|
|
174
|
-
import { Box as
|
|
174
|
+
import { Box as Box15, ThemeProvider, CssBaseline, CircularProgress as CircularProgress4, Typography as Typography11 } from "@mui/material";
|
|
175
175
|
import { createTheme } from "@mui/material/styles";
|
|
176
176
|
import { Navigate } from "react-router-dom";
|
|
177
177
|
|
|
@@ -1387,6 +1387,173 @@ ${sanitize(
|
|
|
1387
1387
|
};
|
|
1388
1388
|
var chat_input_default = ChatInput;
|
|
1389
1389
|
|
|
1390
|
+
// src/chat/ask-user-card.tsx
|
|
1391
|
+
import { useEffect as useEffect4, useState as useState4 } from "react";
|
|
1392
|
+
import { Box as Box4, Paper, Typography as Typography2, Button, TextField as TextField2, Chip, Stack } from "@mui/material";
|
|
1393
|
+
import { useTheme as useTheme5, alpha as alpha2 } from "@mui/material/styles";
|
|
1394
|
+
|
|
1395
|
+
// src/store/askUserStore.ts
|
|
1396
|
+
import { create as create2 } from "zustand";
|
|
1397
|
+
var useAskUserStore = create2((set, get) => ({
|
|
1398
|
+
pending: null,
|
|
1399
|
+
resolver: null,
|
|
1400
|
+
ask: (questions) => new Promise((resolve) => {
|
|
1401
|
+
const prev = get().resolver;
|
|
1402
|
+
if (prev) prev(null);
|
|
1403
|
+
set({ pending: { questions }, resolver: resolve });
|
|
1404
|
+
}),
|
|
1405
|
+
submit: (answers) => {
|
|
1406
|
+
const r = get().resolver;
|
|
1407
|
+
set({ pending: null, resolver: null });
|
|
1408
|
+
if (r) r(answers);
|
|
1409
|
+
},
|
|
1410
|
+
cancel: () => {
|
|
1411
|
+
const r = get().resolver;
|
|
1412
|
+
set({ pending: null, resolver: null });
|
|
1413
|
+
if (r) r(null);
|
|
1414
|
+
}
|
|
1415
|
+
}));
|
|
1416
|
+
var parseAskUserQuestions = (rawJson) => {
|
|
1417
|
+
let parsed = rawJson;
|
|
1418
|
+
if (typeof rawJson === "string") {
|
|
1419
|
+
try {
|
|
1420
|
+
parsed = JSON.parse(rawJson);
|
|
1421
|
+
} catch {
|
|
1422
|
+
return [];
|
|
1423
|
+
}
|
|
1424
|
+
}
|
|
1425
|
+
const coerceOption = (raw) => {
|
|
1426
|
+
if (typeof raw === "string") return raw.trim() ? { label: raw.trim() } : null;
|
|
1427
|
+
if (raw && typeof raw === "object") {
|
|
1428
|
+
const o = raw;
|
|
1429
|
+
const label = typeof o.label === "string" ? o.label : typeof o.value === "string" ? o.value : typeof o.text === "string" ? o.text : "";
|
|
1430
|
+
if (!label.trim()) return null;
|
|
1431
|
+
return {
|
|
1432
|
+
label: label.trim(),
|
|
1433
|
+
description: typeof o.description === "string" ? o.description : void 0
|
|
1434
|
+
};
|
|
1435
|
+
}
|
|
1436
|
+
return null;
|
|
1437
|
+
};
|
|
1438
|
+
const list = Array.isArray(parsed) ? parsed : [parsed];
|
|
1439
|
+
const questions = [];
|
|
1440
|
+
list.forEach((raw, i) => {
|
|
1441
|
+
if (!raw || typeof raw !== "object") return;
|
|
1442
|
+
const r = raw;
|
|
1443
|
+
const text = typeof r.question === "string" ? r.question : typeof r.text === "string" ? r.text : typeof r.prompt === "string" ? r.prompt : "";
|
|
1444
|
+
if (!text.trim()) return;
|
|
1445
|
+
const options = (Array.isArray(r.options) ? r.options : []).map(coerceOption).filter((o) => o !== null);
|
|
1446
|
+
questions.push({
|
|
1447
|
+
id: typeof r.id === "string" && r.id.trim() ? r.id.trim() : `q${i + 1}`,
|
|
1448
|
+
question: text.trim(),
|
|
1449
|
+
header: typeof r.header === "string" && r.header.trim() ? r.header.trim() : void 0,
|
|
1450
|
+
options: options.length > 0 ? options : void 0,
|
|
1451
|
+
allowFreeform: r.allowFreeform === false ? false : true
|
|
1452
|
+
});
|
|
1453
|
+
});
|
|
1454
|
+
return questions;
|
|
1455
|
+
};
|
|
1456
|
+
|
|
1457
|
+
// src/chat/ask-user-card.tsx
|
|
1458
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1459
|
+
var AskUserCard = () => {
|
|
1460
|
+
const theme = useTheme5();
|
|
1461
|
+
const { pending, submit, cancel } = useAskUserStore();
|
|
1462
|
+
const [selected, setSelected] = useState4({});
|
|
1463
|
+
const [freeform, setFreeform] = useState4({});
|
|
1464
|
+
useEffect4(() => {
|
|
1465
|
+
if (!pending) return;
|
|
1466
|
+
const preselected = {};
|
|
1467
|
+
pending.questions.forEach((q) => {
|
|
1468
|
+
const rec = q.options?.find((o) => /\(recommended\)/i.test(o.label));
|
|
1469
|
+
if (rec) preselected[q.id] = rec.label;
|
|
1470
|
+
});
|
|
1471
|
+
setSelected(preselected);
|
|
1472
|
+
setFreeform({});
|
|
1473
|
+
}, [pending]);
|
|
1474
|
+
if (!pending) return null;
|
|
1475
|
+
const answerFor = (qid) => freeform[qid]?.trim() ? freeform[qid].trim() : selected[qid] ?? "";
|
|
1476
|
+
const allAnswered = pending.questions.every((q) => answerFor(q.id).length > 0);
|
|
1477
|
+
const handleSubmit = () => {
|
|
1478
|
+
const final = {};
|
|
1479
|
+
pending.questions.forEach((q) => {
|
|
1480
|
+
final[q.id] = answerFor(q.id);
|
|
1481
|
+
});
|
|
1482
|
+
submit(final);
|
|
1483
|
+
};
|
|
1484
|
+
return /* @__PURE__ */ jsx7(Box4, { sx: { width: "100%", display: "flex", justifyContent: "center", px: { xs: 1, sm: 2 }, mb: 1.5 }, children: /* @__PURE__ */ jsxs4(
|
|
1485
|
+
Paper,
|
|
1486
|
+
{
|
|
1487
|
+
elevation: 0,
|
|
1488
|
+
sx: {
|
|
1489
|
+
width: "100%",
|
|
1490
|
+
maxWidth: 760,
|
|
1491
|
+
p: { xs: 1.75, sm: 2.25 },
|
|
1492
|
+
borderRadius: 2,
|
|
1493
|
+
border: `1px solid ${alpha2(theme.palette.primary.main, 0.45)}`,
|
|
1494
|
+
bgcolor: alpha2(theme.palette.primary.main, 0.06)
|
|
1495
|
+
},
|
|
1496
|
+
children: [
|
|
1497
|
+
/* @__PURE__ */ jsx7(Typography2, { variant: "caption", sx: { color: theme.palette.primary.main, fontWeight: 700, letterSpacing: 0.4 }, children: "BANDIT NEEDS A QUICK DECISION" }),
|
|
1498
|
+
pending.questions.map((q) => /* @__PURE__ */ jsxs4(Box4, { sx: { mt: 1.5 }, children: [
|
|
1499
|
+
q.header && /* @__PURE__ */ jsx7(Chip, { label: q.header, size: "small", sx: { mb: 0.75, fontWeight: 600 }, color: "primary", variant: "outlined" }),
|
|
1500
|
+
/* @__PURE__ */ jsx7(Typography2, { sx: { fontWeight: 600, color: theme.palette.text.primary, mb: 1 }, children: q.question }),
|
|
1501
|
+
q.options && q.options.length > 0 && /* @__PURE__ */ jsx7(Stack, { spacing: 1, children: q.options.map((opt) => {
|
|
1502
|
+
const isSel = selected[q.id] === opt.label && !freeform[q.id]?.trim();
|
|
1503
|
+
return /* @__PURE__ */ jsx7(
|
|
1504
|
+
Button,
|
|
1505
|
+
{
|
|
1506
|
+
onClick: () => {
|
|
1507
|
+
setSelected((p) => ({ ...p, [q.id]: opt.label }));
|
|
1508
|
+
setFreeform((p) => ({ ...p, [q.id]: "" }));
|
|
1509
|
+
},
|
|
1510
|
+
variant: isSel ? "contained" : "outlined",
|
|
1511
|
+
color: "primary",
|
|
1512
|
+
sx: {
|
|
1513
|
+
justifyContent: "flex-start",
|
|
1514
|
+
textAlign: "left",
|
|
1515
|
+
textTransform: "none",
|
|
1516
|
+
py: 1,
|
|
1517
|
+
px: 1.5,
|
|
1518
|
+
borderColor: alpha2(theme.palette.primary.main, 0.4)
|
|
1519
|
+
},
|
|
1520
|
+
children: /* @__PURE__ */ jsxs4(Box4, { children: [
|
|
1521
|
+
/* @__PURE__ */ jsx7(Typography2, { sx: { fontWeight: 600, lineHeight: 1.3 }, children: opt.label }),
|
|
1522
|
+
opt.description && /* @__PURE__ */ jsx7(
|
|
1523
|
+
Typography2,
|
|
1524
|
+
{
|
|
1525
|
+
variant: "caption",
|
|
1526
|
+
sx: { color: isSel ? alpha2("#fff", 0.85) : theme.palette.text.secondary, display: "block" },
|
|
1527
|
+
children: opt.description
|
|
1528
|
+
}
|
|
1529
|
+
)
|
|
1530
|
+
] })
|
|
1531
|
+
},
|
|
1532
|
+
opt.label
|
|
1533
|
+
);
|
|
1534
|
+
}) }),
|
|
1535
|
+
q.allowFreeform !== false && /* @__PURE__ */ jsx7(
|
|
1536
|
+
TextField2,
|
|
1537
|
+
{
|
|
1538
|
+
fullWidth: true,
|
|
1539
|
+
size: "small",
|
|
1540
|
+
placeholder: q.options && q.options.length ? "Or type your own answer\u2026" : "Type your answer\u2026",
|
|
1541
|
+
value: freeform[q.id] ?? "",
|
|
1542
|
+
onChange: (e) => setFreeform((p) => ({ ...p, [q.id]: e.target.value })),
|
|
1543
|
+
sx: { mt: q.options && q.options.length ? 1.25 : 0 }
|
|
1544
|
+
}
|
|
1545
|
+
)
|
|
1546
|
+
] }, q.id)),
|
|
1547
|
+
/* @__PURE__ */ jsxs4(Box4, { sx: { display: "flex", justifyContent: "flex-end", gap: 1, mt: 2 }, children: [
|
|
1548
|
+
/* @__PURE__ */ jsx7(Button, { onClick: cancel, color: "inherit", sx: { textTransform: "none", color: theme.palette.text.secondary }, children: "Skip" }),
|
|
1549
|
+
/* @__PURE__ */ jsx7(Button, { onClick: handleSubmit, disabled: !allAnswered, variant: "contained", sx: { textTransform: "none" }, children: "Submit" })
|
|
1550
|
+
] })
|
|
1551
|
+
]
|
|
1552
|
+
}
|
|
1553
|
+
) });
|
|
1554
|
+
};
|
|
1555
|
+
var ask_user_card_default = AskUserCard;
|
|
1556
|
+
|
|
1390
1557
|
// src/chat/hooks/useAIProvider.tsx
|
|
1391
1558
|
import { useCallback, useRef as useRef3 } from "react";
|
|
1392
1559
|
|
|
@@ -1698,7 +1865,7 @@ function telemetryEndTurn(outcome) {
|
|
|
1698
1865
|
}
|
|
1699
1866
|
|
|
1700
1867
|
// src/store/engineStore.ts
|
|
1701
|
-
import { create as
|
|
1868
|
+
import { create as create3 } from "zustand";
|
|
1702
1869
|
var STORAGE_KEY = "bandit.selectedEngine";
|
|
1703
1870
|
var readStored = () => {
|
|
1704
1871
|
try {
|
|
@@ -1707,7 +1874,7 @@ var readStored = () => {
|
|
|
1707
1874
|
return null;
|
|
1708
1875
|
}
|
|
1709
1876
|
};
|
|
1710
|
-
var useEngineStore =
|
|
1877
|
+
var useEngineStore = create3((set, get) => ({
|
|
1711
1878
|
selectedEngine: readStored(),
|
|
1712
1879
|
engines: [],
|
|
1713
1880
|
loaded: false,
|
|
@@ -2271,9 +2438,9 @@ The user explicitly asked you to remember this. Respond with a short third-perso
|
|
|
2271
2438
|
};
|
|
2272
2439
|
|
|
2273
2440
|
// src/chat/hooks/useMoodEngine.tsx
|
|
2274
|
-
import { useState as
|
|
2441
|
+
import { useState as useState5 } from "react";
|
|
2275
2442
|
var useMoodEngine = () => {
|
|
2276
|
-
const [mood, setMood] =
|
|
2443
|
+
const [mood, setMood] = useState5("neutral");
|
|
2277
2444
|
const analyzeMood = async (message) => {
|
|
2278
2445
|
try {
|
|
2279
2446
|
const detected = await detectMessageMood(message);
|
|
@@ -3119,6 +3286,7 @@ TOOL USAGE PROTOCOL (conservative approach)
|
|
|
3119
3286
|
* web_search() - when asked about recent/current events, breaking news, live information (weather, prices, sports scores), or when you need to look up documentation, libraries, APIs, error messages, or verify a specific fact
|
|
3120
3287
|
* web_fetch() - to read the FULL contents of a specific URL you already have. Reach for this when the user wants to "tell me more", "go deeper", "read/open that article", or asks for details about a specific source, link, or article from an EARLIER answer: take that item's URL from the previous Sources list in this conversation and fetch it, then answer from the page's actual content (not just the prior summary)
|
|
3121
3288
|
* image_generation() - ONLY when explicitly asked to create or generate an image
|
|
3289
|
+
* ask_user({"questions": [{"question": "...", "header": "Format", "options": [{"label": "Inline (Recommended)"}, {"label": "Download a file"}]}]}) - when you are genuinely BLOCKED on a decision that is the USER's to make and cannot resolve from the request, context, or sensible defaults (e.g. show content inline vs. let them download it, which format/option they want). Renders clickable options the user answers in one step \u2014 better than asking in prose and ending your turn. Give 1-4 questions, each with 2-4 options; if one is clearly best, list it first and append " (Recommended)". The user may also type their own answer; act on it directly.
|
|
3122
3290
|
- For general questions about concepts, definitions, explanations, or how-to topics, use your built-in knowledge WITHOUT calling tools.
|
|
3123
3291
|
- Examples of what NOT to use tools for: "who are you?", "what is React?", "explain machine learning", "how does X work?", general programming questions.
|
|
3124
3292
|
- When a tool is truly needed, call exactly ONE tool that best matches the request.
|
|
@@ -3314,6 +3482,28 @@ ${fn}(${argStr})
|
|
|
3314
3482
|
functionName,
|
|
3315
3483
|
parameters: parsedParams
|
|
3316
3484
|
});
|
|
3485
|
+
if (functionName === "ask_user" || functionName === "ask-user") {
|
|
3486
|
+
enhancedMessage = enhancedMessage.replace(match, "");
|
|
3487
|
+
clearFlushTimer();
|
|
3488
|
+
const askPreamble = stripToolBlocks(fullMessage).trim();
|
|
3489
|
+
setStreamBuffer(askPreamble || "_Waiting for your answer\u2026_");
|
|
3490
|
+
const questions = parseAskUserQuestions(
|
|
3491
|
+
parsedParams.questions ?? parsedParams
|
|
3492
|
+
);
|
|
3493
|
+
if (questions.length === 0) {
|
|
3494
|
+
summarizableResults.push({
|
|
3495
|
+
name: functionName,
|
|
3496
|
+
output: "ask_user failed: `questions` must be a JSON array of {question, options} objects. Ask the user in plain text instead."
|
|
3497
|
+
});
|
|
3498
|
+
continue;
|
|
3499
|
+
}
|
|
3500
|
+
telemetryEvent("tool_loop:ask_user", { count: questions.length });
|
|
3501
|
+
const answers = await useAskUserStore.getState().ask(questions);
|
|
3502
|
+
const answerText = answers ? "The user answered:\n\n" + questions.map((q) => `Q: ${q.question}
|
|
3503
|
+
A: ${(answers[q.id] || "").trim() || "(no answer)"}`).join("\n\n") : "The user dismissed the question(s) without answering. Proceed with your best judgment; do not immediately re-ask.";
|
|
3504
|
+
summarizableResults.push({ name: functionName, output: answerText });
|
|
3505
|
+
continue;
|
|
3506
|
+
}
|
|
3317
3507
|
const placeholderToken = `<<TOOL_LOADING_${functionName}_${Math.random().toString(36).slice(2)}>>`;
|
|
3318
3508
|
enhancedMessage = enhancedMessage.replace(match, placeholderToken);
|
|
3319
3509
|
clearFlushTimer();
|
|
@@ -3629,7 +3819,7 @@ ${inlineImageBlocks.join("\n\n")}` : "");
|
|
|
3629
3819
|
};
|
|
3630
3820
|
|
|
3631
3821
|
// src/hooks/useAutoScroll.ts
|
|
3632
|
-
import { useRef as useRef4, useEffect as
|
|
3822
|
+
import { useRef as useRef4, useEffect as useEffect5, useCallback as useCallback2 } from "react";
|
|
3633
3823
|
var SCROLL_STATE_CHANGED_EVENT = "scrollStateChanged";
|
|
3634
3824
|
var useAutoScroll = (options = {}) => {
|
|
3635
3825
|
const {
|
|
@@ -3715,7 +3905,7 @@ var useAutoScroll = (options = {}) => {
|
|
|
3715
3905
|
}
|
|
3716
3906
|
}, [enabled, isNearBottom, scrollToBottom]);
|
|
3717
3907
|
const containerElement = containerRef.current;
|
|
3718
|
-
|
|
3908
|
+
useEffect5(() => {
|
|
3719
3909
|
if (!containerElement) return;
|
|
3720
3910
|
const handleScroll = () => {
|
|
3721
3911
|
const currentlyNearBottom = isNearBottom();
|
|
@@ -3725,7 +3915,7 @@ var useAutoScroll = (options = {}) => {
|
|
|
3725
3915
|
containerElement.addEventListener("scroll", handleScroll, { passive: true });
|
|
3726
3916
|
return () => containerElement.removeEventListener("scroll", handleScroll);
|
|
3727
3917
|
}, [containerElement, isNearBottom]);
|
|
3728
|
-
|
|
3918
|
+
useEffect5(() => {
|
|
3729
3919
|
autoScrollIfNeeded();
|
|
3730
3920
|
});
|
|
3731
3921
|
const getScrollState = useCallback2(() => {
|
|
@@ -3764,9 +3954,9 @@ var useAutoScroll = (options = {}) => {
|
|
|
3764
3954
|
};
|
|
3765
3955
|
|
|
3766
3956
|
// src/hooks/useNetworkStatus.ts
|
|
3767
|
-
import { useState as
|
|
3957
|
+
import { useState as useState6, useEffect as useEffect6, useCallback as useCallback3 } from "react";
|
|
3768
3958
|
var useNetworkStatus = () => {
|
|
3769
|
-
const [networkStatus, setNetworkStatus] =
|
|
3959
|
+
const [networkStatus, setNetworkStatus] = useState6({
|
|
3770
3960
|
isOnline: navigator.onLine,
|
|
3771
3961
|
isSlowConnection: false,
|
|
3772
3962
|
connectionQuality: "fast",
|
|
@@ -3786,7 +3976,7 @@ var useNetworkStatus = () => {
|
|
|
3786
3976
|
connectionQuality: !navigator.onLine ? "offline" : isSlowConnection ? "slow" : "fast"
|
|
3787
3977
|
}));
|
|
3788
3978
|
}, []);
|
|
3789
|
-
|
|
3979
|
+
useEffect6(() => {
|
|
3790
3980
|
const handleOnline = () => {
|
|
3791
3981
|
setNetworkStatus((prev) => ({
|
|
3792
3982
|
...prev,
|
|
@@ -3808,7 +3998,7 @@ var useNetworkStatus = () => {
|
|
|
3808
3998
|
window.removeEventListener("offline", handleOffline);
|
|
3809
3999
|
};
|
|
3810
4000
|
}, []);
|
|
3811
|
-
|
|
4001
|
+
useEffect6(() => {
|
|
3812
4002
|
const { connection } = navigator;
|
|
3813
4003
|
if (connection) {
|
|
3814
4004
|
const updateConnectionInfo = () => {
|
|
@@ -3845,33 +4035,33 @@ var useNetworkStatus = () => {
|
|
|
3845
4035
|
|
|
3846
4036
|
// src/chat/chat-app-bar.tsx
|
|
3847
4037
|
import { Avatar as Avatar8 } from "@mui/material";
|
|
3848
|
-
import { useEffect as
|
|
4038
|
+
import { useEffect as useEffect12, useRef as useRef10, useState as useState13 } from "react";
|
|
3849
4039
|
import {
|
|
3850
|
-
Box as
|
|
4040
|
+
Box as Box11,
|
|
3851
4041
|
IconButton as IconButton9,
|
|
3852
4042
|
Menu as Menu5,
|
|
3853
4043
|
MenuItem as MenuItem5,
|
|
3854
4044
|
Tooltip as Tooltip4,
|
|
3855
4045
|
useMediaQuery as useMediaQuery5,
|
|
3856
|
-
useTheme as
|
|
4046
|
+
useTheme as useTheme12,
|
|
3857
4047
|
Dialog as Dialog5,
|
|
3858
4048
|
DialogTitle as DialogTitle5,
|
|
3859
4049
|
DialogContent as DialogContent5,
|
|
3860
4050
|
DialogActions as DialogActions5,
|
|
3861
|
-
Typography as
|
|
3862
|
-
Button as
|
|
4051
|
+
Typography as Typography9,
|
|
4052
|
+
Button as Button7
|
|
3863
4053
|
} from "@mui/material";
|
|
3864
4054
|
import { useNavigate } from "react-router-dom";
|
|
3865
4055
|
|
|
3866
4056
|
// src/chat/conversation-drawer.tsx
|
|
3867
|
-
import { useState as
|
|
4057
|
+
import { useState as useState11, useMemo, useEffect as useEffect10, useRef as useRef8, useCallback as useCallback4 } from "react";
|
|
3868
4058
|
import {
|
|
3869
4059
|
Drawer,
|
|
3870
|
-
Box as
|
|
3871
|
-
Typography as
|
|
4060
|
+
Box as Box9,
|
|
4061
|
+
Typography as Typography7,
|
|
3872
4062
|
IconButton as IconButton7,
|
|
3873
4063
|
Tooltip as Tooltip3,
|
|
3874
|
-
TextField as
|
|
4064
|
+
TextField as TextField6,
|
|
3875
4065
|
InputAdornment,
|
|
3876
4066
|
useMediaQuery as useMediaQuery4,
|
|
3877
4067
|
Collapse as Collapse2,
|
|
@@ -3884,26 +4074,26 @@ import {
|
|
|
3884
4074
|
DialogTitle as DialogTitle3,
|
|
3885
4075
|
DialogContent as DialogContent3,
|
|
3886
4076
|
DialogActions as DialogActions3,
|
|
3887
|
-
Button as
|
|
4077
|
+
Button as Button5,
|
|
3888
4078
|
Avatar as Avatar6,
|
|
3889
|
-
alpha as
|
|
4079
|
+
alpha as alpha6
|
|
3890
4080
|
} from "@mui/material";
|
|
3891
4081
|
import { X as CloseIcon4, X as ClearIcon, Search as SearchIcon, Folder as FolderIcon4, MoreVertical as MoreVertIcon3, Trash2 as DeleteSweepIcon, Inbox as InboxIcon3, Plus as AddIcon4 } from "lucide-react";
|
|
3892
|
-
import { useTheme as
|
|
4082
|
+
import { useTheme as useTheme10 } from "@mui/material/styles";
|
|
3893
4083
|
|
|
3894
4084
|
// src/chat/project-management-modal.tsx
|
|
3895
|
-
import { useState as
|
|
4085
|
+
import { useState as useState7, useEffect as useEffect7, useRef as useRef5 } from "react";
|
|
3896
4086
|
import {
|
|
3897
4087
|
Modal,
|
|
3898
|
-
Button,
|
|
3899
|
-
TextField as
|
|
4088
|
+
Button as Button2,
|
|
4089
|
+
TextField as TextField3,
|
|
3900
4090
|
List,
|
|
3901
4091
|
ListItem,
|
|
3902
4092
|
IconButton as IconButton4,
|
|
3903
|
-
Box as
|
|
3904
|
-
Typography as
|
|
4093
|
+
Box as Box5,
|
|
4094
|
+
Typography as Typography3,
|
|
3905
4095
|
Avatar as Avatar3,
|
|
3906
|
-
Chip,
|
|
4096
|
+
Chip as Chip2,
|
|
3907
4097
|
Menu,
|
|
3908
4098
|
MenuItem,
|
|
3909
4099
|
Alert,
|
|
@@ -3912,8 +4102,8 @@ import {
|
|
|
3912
4102
|
useMediaQuery as useMediaQuery2
|
|
3913
4103
|
} from "@mui/material";
|
|
3914
4104
|
import { Plus as AddIcon2, Pencil as EditIcon, Trash2 as DeleteIcon, MoreVertical as MoreVertIcon, Folder as FolderIcon, X as CloseIcon2, ArrowLeft as ArrowBackIcon } from "lucide-react";
|
|
3915
|
-
import { useTheme as
|
|
3916
|
-
import { Fragment as Fragment4, jsx as
|
|
4105
|
+
import { useTheme as useTheme6, alpha as alpha3 } from "@mui/material/styles";
|
|
4106
|
+
import { Fragment as Fragment4, jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
3917
4107
|
var DEFAULT_COLORS = [
|
|
3918
4108
|
"#2196F3",
|
|
3919
4109
|
"#4CAF50",
|
|
@@ -3930,7 +4120,7 @@ var ProjectManagementModal = ({
|
|
|
3930
4120
|
open,
|
|
3931
4121
|
onClose
|
|
3932
4122
|
}) => {
|
|
3933
|
-
const theme =
|
|
4123
|
+
const theme = useTheme6();
|
|
3934
4124
|
const isMobile = useMediaQuery2(theme.breakpoints.down("sm"));
|
|
3935
4125
|
const {
|
|
3936
4126
|
projects,
|
|
@@ -3942,24 +4132,24 @@ var ProjectManagementModal = ({
|
|
|
3942
4132
|
hydrate
|
|
3943
4133
|
} = useProjectStore();
|
|
3944
4134
|
const { getConversationsByProject } = useConversationStore();
|
|
3945
|
-
const [showCreateForm, setShowCreateForm] =
|
|
3946
|
-
const [editingProject, setEditingProject] =
|
|
3947
|
-
const [formData, setFormData] =
|
|
4135
|
+
const [showCreateForm, setShowCreateForm] = useState7(false);
|
|
4136
|
+
const [editingProject, setEditingProject] = useState7(null);
|
|
4137
|
+
const [formData, setFormData] = useState7({
|
|
3948
4138
|
name: "",
|
|
3949
4139
|
description: "",
|
|
3950
4140
|
color: DEFAULT_COLORS[0]
|
|
3951
4141
|
});
|
|
3952
|
-
const [menuAnchor, setMenuAnchor] =
|
|
3953
|
-
const [selectedProject, setSelectedProject] =
|
|
3954
|
-
const [loading, setLoading] =
|
|
3955
|
-
const [error, setError] =
|
|
4142
|
+
const [menuAnchor, setMenuAnchor] = useState7(null);
|
|
4143
|
+
const [selectedProject, setSelectedProject] = useState7(null);
|
|
4144
|
+
const [loading, setLoading] = useState7(false);
|
|
4145
|
+
const [error, setError] = useState7(null);
|
|
3956
4146
|
const modalContainerRef = useRef5(null);
|
|
3957
|
-
|
|
4147
|
+
useEffect7(() => {
|
|
3958
4148
|
if (open && !_hasHydrated) {
|
|
3959
4149
|
hydrate();
|
|
3960
4150
|
}
|
|
3961
4151
|
}, [open, _hasHydrated, hydrate]);
|
|
3962
|
-
|
|
4152
|
+
useEffect7(() => {
|
|
3963
4153
|
if (!open) {
|
|
3964
4154
|
setMenuAnchor(null);
|
|
3965
4155
|
setSelectedProject(null);
|
|
@@ -4056,13 +4246,13 @@ var ProjectManagementModal = ({
|
|
|
4056
4246
|
const chatPalette = theme.palette.chat ?? {};
|
|
4057
4247
|
const overlayZIndex = (theme.zIndex?.modal ?? 1300) + 20;
|
|
4058
4248
|
const surfaceColor = isMobile ? theme.palette.background.paper : chatPalette.shell ?? theme.palette.background.paper;
|
|
4059
|
-
const borderColor = chatPalette.appBar?.border ??
|
|
4060
|
-
const subtleSurface = theme.palette.mode === "dark" ?
|
|
4061
|
-
const hoverSurface =
|
|
4249
|
+
const borderColor = chatPalette.appBar?.border ?? alpha3(theme.palette.divider, 0.12);
|
|
4250
|
+
const subtleSurface = theme.palette.mode === "dark" ? alpha3(theme.palette.common.white, 0.04) : alpha3(theme.palette.common.black, 0.03);
|
|
4251
|
+
const hoverSurface = alpha3(theme.palette.primary.main, theme.palette.mode === "dark" ? 0.22 : 0.08);
|
|
4062
4252
|
const headerTitle = showCreateForm ? editingProject ? "Edit Project" : "Create Project" : "Manage Projects";
|
|
4063
4253
|
const headerSubtitle = showCreateForm ? "Name, describe, and color-code your project." : "Organize conversations into cohesive projects.";
|
|
4064
|
-
const content = /* @__PURE__ */
|
|
4065
|
-
|
|
4254
|
+
const content = /* @__PURE__ */ jsxs5(
|
|
4255
|
+
Box5,
|
|
4066
4256
|
{
|
|
4067
4257
|
ref: modalContainerRef,
|
|
4068
4258
|
sx: {
|
|
@@ -4073,29 +4263,29 @@ var ProjectManagementModal = ({
|
|
|
4073
4263
|
bgcolor: surfaceColor,
|
|
4074
4264
|
borderRadius: isMobile ? "22px 22px 0 0" : 3,
|
|
4075
4265
|
overflow: "hidden",
|
|
4076
|
-
boxShadow: isMobile ? "none" : `0 20px 60px ${
|
|
4077
|
-
border: isMobile ? "none" : `1px solid ${
|
|
4266
|
+
boxShadow: isMobile ? "none" : `0 20px 60px ${alpha3(theme.palette.common.black, 0.32)}`,
|
|
4267
|
+
border: isMobile ? "none" : `1px solid ${alpha3(theme.palette.divider, 0.18)}`,
|
|
4078
4268
|
display: "flex",
|
|
4079
4269
|
flexDirection: "column",
|
|
4080
4270
|
position: "relative"
|
|
4081
4271
|
},
|
|
4082
4272
|
children: [
|
|
4083
|
-
isMobile && /* @__PURE__ */
|
|
4084
|
-
|
|
4273
|
+
isMobile && /* @__PURE__ */ jsx8(
|
|
4274
|
+
Box5,
|
|
4085
4275
|
{
|
|
4086
4276
|
sx: {
|
|
4087
4277
|
width: 56,
|
|
4088
4278
|
height: 6,
|
|
4089
4279
|
borderRadius: 999,
|
|
4090
|
-
bgcolor:
|
|
4280
|
+
bgcolor: alpha3(theme.palette.text.primary, 0.18),
|
|
4091
4281
|
alignSelf: "center",
|
|
4092
4282
|
mt: 1.25,
|
|
4093
4283
|
mb: 0.75
|
|
4094
4284
|
}
|
|
4095
4285
|
}
|
|
4096
4286
|
),
|
|
4097
|
-
/* @__PURE__ */
|
|
4098
|
-
|
|
4287
|
+
/* @__PURE__ */ jsxs5(
|
|
4288
|
+
Box5,
|
|
4099
4289
|
{
|
|
4100
4290
|
sx: {
|
|
4101
4291
|
px: isMobile ? 1.5 : 2.75,
|
|
@@ -4107,8 +4297,8 @@ var ProjectManagementModal = ({
|
|
|
4107
4297
|
gap: 1
|
|
4108
4298
|
},
|
|
4109
4299
|
children: [
|
|
4110
|
-
/* @__PURE__ */
|
|
4111
|
-
|
|
4300
|
+
/* @__PURE__ */ jsxs5(
|
|
4301
|
+
Box5,
|
|
4112
4302
|
{
|
|
4113
4303
|
sx: {
|
|
4114
4304
|
display: "flex",
|
|
@@ -4117,8 +4307,8 @@ var ProjectManagementModal = ({
|
|
|
4117
4307
|
gap: 1
|
|
4118
4308
|
},
|
|
4119
4309
|
children: [
|
|
4120
|
-
/* @__PURE__ */
|
|
4121
|
-
|
|
4310
|
+
/* @__PURE__ */ jsxs5(
|
|
4311
|
+
Box5,
|
|
4122
4312
|
{
|
|
4123
4313
|
sx: {
|
|
4124
4314
|
display: "flex",
|
|
@@ -4128,9 +4318,9 @@ var ProjectManagementModal = ({
|
|
|
4128
4318
|
flex: 1
|
|
4129
4319
|
},
|
|
4130
4320
|
children: [
|
|
4131
|
-
showCreateForm && /* @__PURE__ */
|
|
4132
|
-
/* @__PURE__ */
|
|
4133
|
-
|
|
4321
|
+
showCreateForm && /* @__PURE__ */ jsx8(IconButton4, { onClick: resetForm, size: "small", sx: { mr: 0.5 }, children: /* @__PURE__ */ jsx8(ArrowBackIcon, { size: 16 }) }),
|
|
4322
|
+
/* @__PURE__ */ jsx8(
|
|
4323
|
+
Typography3,
|
|
4134
4324
|
{
|
|
4135
4325
|
variant: "h6",
|
|
4136
4326
|
sx: {
|
|
@@ -4146,16 +4336,16 @@ var ProjectManagementModal = ({
|
|
|
4146
4336
|
]
|
|
4147
4337
|
}
|
|
4148
4338
|
),
|
|
4149
|
-
/* @__PURE__ */
|
|
4339
|
+
/* @__PURE__ */ jsx8(IconButton4, { onClick: handleClose, size: "small", children: /* @__PURE__ */ jsx8(CloseIcon2, {}) })
|
|
4150
4340
|
]
|
|
4151
4341
|
}
|
|
4152
4342
|
),
|
|
4153
|
-
/* @__PURE__ */
|
|
4343
|
+
/* @__PURE__ */ jsx8(Typography3, { variant: "body2", color: "text.secondary", children: headerSubtitle })
|
|
4154
4344
|
]
|
|
4155
4345
|
}
|
|
4156
4346
|
),
|
|
4157
|
-
/* @__PURE__ */
|
|
4158
|
-
|
|
4347
|
+
/* @__PURE__ */ jsxs5(
|
|
4348
|
+
Box5,
|
|
4159
4349
|
{
|
|
4160
4350
|
sx: {
|
|
4161
4351
|
flex: 1,
|
|
@@ -4167,10 +4357,10 @@ var ProjectManagementModal = ({
|
|
|
4167
4357
|
gap: 2.5
|
|
4168
4358
|
},
|
|
4169
4359
|
children: [
|
|
4170
|
-
error && /* @__PURE__ */
|
|
4171
|
-
showCreateForm ? /* @__PURE__ */
|
|
4172
|
-
/* @__PURE__ */
|
|
4173
|
-
|
|
4360
|
+
error && /* @__PURE__ */ jsx8(Alert, { severity: "error", onClose: () => setError(null), children: error }),
|
|
4361
|
+
showCreateForm ? /* @__PURE__ */ jsxs5(Box5, { sx: { display: "flex", flexDirection: "column", gap: 2 }, children: [
|
|
4362
|
+
/* @__PURE__ */ jsx8(
|
|
4363
|
+
TextField3,
|
|
4174
4364
|
{
|
|
4175
4365
|
label: "Project name",
|
|
4176
4366
|
value: formData.name,
|
|
@@ -4181,8 +4371,8 @@ var ProjectManagementModal = ({
|
|
|
4181
4371
|
autoFocus: true
|
|
4182
4372
|
}
|
|
4183
4373
|
),
|
|
4184
|
-
/* @__PURE__ */
|
|
4185
|
-
|
|
4374
|
+
/* @__PURE__ */ jsx8(
|
|
4375
|
+
TextField3,
|
|
4186
4376
|
{
|
|
4187
4377
|
label: "Description (optional)",
|
|
4188
4378
|
value: formData.description,
|
|
@@ -4193,10 +4383,10 @@ var ProjectManagementModal = ({
|
|
|
4193
4383
|
disabled: loading
|
|
4194
4384
|
}
|
|
4195
4385
|
),
|
|
4196
|
-
/* @__PURE__ */
|
|
4197
|
-
/* @__PURE__ */
|
|
4198
|
-
/* @__PURE__ */
|
|
4199
|
-
|
|
4386
|
+
/* @__PURE__ */ jsxs5(Box5, { children: [
|
|
4387
|
+
/* @__PURE__ */ jsx8(Typography3, { variant: "subtitle2", sx: { mb: 1 }, children: "Color" }),
|
|
4388
|
+
/* @__PURE__ */ jsx8(Box5, { sx: { display: "flex", flexWrap: "wrap", gap: 1 }, children: DEFAULT_COLORS.map((color) => /* @__PURE__ */ jsx8(
|
|
4389
|
+
Box5,
|
|
4200
4390
|
{
|
|
4201
4391
|
sx: {
|
|
4202
4392
|
width: 32,
|
|
@@ -4216,11 +4406,11 @@ var ProjectManagementModal = ({
|
|
|
4216
4406
|
color
|
|
4217
4407
|
)) })
|
|
4218
4408
|
] })
|
|
4219
|
-
] }) : /* @__PURE__ */
|
|
4220
|
-
/* @__PURE__ */
|
|
4221
|
-
|
|
4409
|
+
] }) : /* @__PURE__ */ jsxs5(Box5, { sx: { display: "flex", flexDirection: "column", gap: 2 }, children: [
|
|
4410
|
+
/* @__PURE__ */ jsx8(
|
|
4411
|
+
Button2,
|
|
4222
4412
|
{
|
|
4223
|
-
startIcon: /* @__PURE__ */
|
|
4413
|
+
startIcon: /* @__PURE__ */ jsx8(AddIcon2, {}),
|
|
4224
4414
|
onClick: () => setShowCreateForm(true),
|
|
4225
4415
|
variant: "contained",
|
|
4226
4416
|
sx: {
|
|
@@ -4232,8 +4422,8 @@ var ProjectManagementModal = ({
|
|
|
4232
4422
|
children: "Create project"
|
|
4233
4423
|
}
|
|
4234
4424
|
),
|
|
4235
|
-
projects.length === 0 ? /* @__PURE__ */
|
|
4236
|
-
|
|
4425
|
+
projects.length === 0 ? /* @__PURE__ */ jsxs5(
|
|
4426
|
+
Box5,
|
|
4237
4427
|
{
|
|
4238
4428
|
sx: {
|
|
4239
4429
|
textAlign: "center",
|
|
@@ -4241,19 +4431,19 @@ var ProjectManagementModal = ({
|
|
|
4241
4431
|
px: 2,
|
|
4242
4432
|
color: theme.palette.text.secondary,
|
|
4243
4433
|
borderRadius: 2,
|
|
4244
|
-
border: `1px dashed ${
|
|
4434
|
+
border: `1px dashed ${alpha3(theme.palette.divider, 0.4)}`,
|
|
4245
4435
|
backgroundColor: subtleSurface
|
|
4246
4436
|
},
|
|
4247
4437
|
children: [
|
|
4248
|
-
/* @__PURE__ */
|
|
4249
|
-
/* @__PURE__ */
|
|
4250
|
-
/* @__PURE__ */
|
|
4438
|
+
/* @__PURE__ */ jsx8(FolderIcon, { size: 48, style: { marginBottom: 8, opacity: 0.5 } }),
|
|
4439
|
+
/* @__PURE__ */ jsx8(Typography3, { variant: "body1", sx: { fontWeight: 600 }, children: "No projects yet" }),
|
|
4440
|
+
/* @__PURE__ */ jsx8(Typography3, { variant: "body2", children: "Create your first project to organize conversations." })
|
|
4251
4441
|
]
|
|
4252
4442
|
}
|
|
4253
|
-
) : /* @__PURE__ */
|
|
4443
|
+
) : /* @__PURE__ */ jsx8(List, { sx: { display: "flex", flexDirection: "column", gap: 1.25, py: 0 }, children: projects.map((project) => {
|
|
4254
4444
|
const conversationCount = getConversationsByProject(project.id).length;
|
|
4255
|
-
return /* @__PURE__ */
|
|
4256
|
-
|
|
4445
|
+
return /* @__PURE__ */ jsx8(ListItem, { disablePadding: true, children: /* @__PURE__ */ jsxs5(
|
|
4446
|
+
Box5,
|
|
4257
4447
|
{
|
|
4258
4448
|
sx: {
|
|
4259
4449
|
display: "flex",
|
|
@@ -4271,7 +4461,7 @@ var ProjectManagementModal = ({
|
|
|
4271
4461
|
}
|
|
4272
4462
|
},
|
|
4273
4463
|
children: [
|
|
4274
|
-
/* @__PURE__ */
|
|
4464
|
+
/* @__PURE__ */ jsx8(
|
|
4275
4465
|
Avatar3,
|
|
4276
4466
|
{
|
|
4277
4467
|
sx: {
|
|
@@ -4280,21 +4470,21 @@ var ProjectManagementModal = ({
|
|
|
4280
4470
|
height: 36,
|
|
4281
4471
|
fontSize: "1rem"
|
|
4282
4472
|
},
|
|
4283
|
-
children: /* @__PURE__ */
|
|
4473
|
+
children: /* @__PURE__ */ jsx8(FolderIcon, { size: 16 })
|
|
4284
4474
|
}
|
|
4285
4475
|
),
|
|
4286
|
-
/* @__PURE__ */
|
|
4287
|
-
/* @__PURE__ */
|
|
4288
|
-
/* @__PURE__ */
|
|
4289
|
-
|
|
4476
|
+
/* @__PURE__ */ jsxs5(Box5, { sx: { flex: 1, minWidth: 0 }, children: [
|
|
4477
|
+
/* @__PURE__ */ jsxs5(Box5, { sx: { display: "flex", alignItems: "center", gap: 1, flexWrap: "wrap" }, children: [
|
|
4478
|
+
/* @__PURE__ */ jsx8(
|
|
4479
|
+
Typography3,
|
|
4290
4480
|
{
|
|
4291
4481
|
variant: "subtitle1",
|
|
4292
4482
|
sx: { fontWeight: 600, overflow: "hidden", textOverflow: "ellipsis" },
|
|
4293
4483
|
children: project.name
|
|
4294
4484
|
}
|
|
4295
4485
|
),
|
|
4296
|
-
/* @__PURE__ */
|
|
4297
|
-
|
|
4486
|
+
/* @__PURE__ */ jsx8(
|
|
4487
|
+
Chip2,
|
|
4298
4488
|
{
|
|
4299
4489
|
label: `${conversationCount}`,
|
|
4300
4490
|
size: "small",
|
|
@@ -4302,14 +4492,14 @@ var ProjectManagementModal = ({
|
|
|
4302
4492
|
height: 22,
|
|
4303
4493
|
borderRadius: 999,
|
|
4304
4494
|
fontWeight: 600,
|
|
4305
|
-
bgcolor:
|
|
4495
|
+
bgcolor: alpha3(theme.palette.text.primary, 0.08),
|
|
4306
4496
|
color: theme.palette.text.primary
|
|
4307
4497
|
}
|
|
4308
4498
|
}
|
|
4309
4499
|
)
|
|
4310
4500
|
] }),
|
|
4311
|
-
project.description && /* @__PURE__ */
|
|
4312
|
-
|
|
4501
|
+
project.description && /* @__PURE__ */ jsx8(
|
|
4502
|
+
Typography3,
|
|
4313
4503
|
{
|
|
4314
4504
|
variant: "body2",
|
|
4315
4505
|
color: "text.secondary",
|
|
@@ -4318,7 +4508,7 @@ var ProjectManagementModal = ({
|
|
|
4318
4508
|
}
|
|
4319
4509
|
)
|
|
4320
4510
|
] }),
|
|
4321
|
-
/* @__PURE__ */
|
|
4511
|
+
/* @__PURE__ */ jsx8(
|
|
4322
4512
|
IconButton4,
|
|
4323
4513
|
{
|
|
4324
4514
|
onClick: (e) => {
|
|
@@ -4331,7 +4521,7 @@ var ProjectManagementModal = ({
|
|
|
4331
4521
|
mt: 0.25,
|
|
4332
4522
|
zIndex: 1
|
|
4333
4523
|
},
|
|
4334
|
-
children: /* @__PURE__ */
|
|
4524
|
+
children: /* @__PURE__ */ jsx8(MoreVertIcon, { size: 16 })
|
|
4335
4525
|
}
|
|
4336
4526
|
)
|
|
4337
4527
|
]
|
|
@@ -4342,8 +4532,8 @@ var ProjectManagementModal = ({
|
|
|
4342
4532
|
]
|
|
4343
4533
|
}
|
|
4344
4534
|
),
|
|
4345
|
-
/* @__PURE__ */
|
|
4346
|
-
|
|
4535
|
+
/* @__PURE__ */ jsx8(
|
|
4536
|
+
Box5,
|
|
4347
4537
|
{
|
|
4348
4538
|
sx: {
|
|
4349
4539
|
px: isMobile ? 1.5 : 2.75,
|
|
@@ -4353,9 +4543,9 @@ var ProjectManagementModal = ({
|
|
|
4353
4543
|
justifyContent: "flex-end",
|
|
4354
4544
|
gap: 1
|
|
4355
4545
|
},
|
|
4356
|
-
children: showCreateForm ? /* @__PURE__ */
|
|
4357
|
-
/* @__PURE__ */
|
|
4358
|
-
|
|
4546
|
+
children: showCreateForm ? /* @__PURE__ */ jsxs5(Fragment4, { children: [
|
|
4547
|
+
/* @__PURE__ */ jsx8(
|
|
4548
|
+
Button2,
|
|
4359
4549
|
{
|
|
4360
4550
|
onClick: resetForm,
|
|
4361
4551
|
disabled: loading,
|
|
@@ -4363,21 +4553,21 @@ var ProjectManagementModal = ({
|
|
|
4363
4553
|
children: "Cancel"
|
|
4364
4554
|
}
|
|
4365
4555
|
),
|
|
4366
|
-
/* @__PURE__ */
|
|
4367
|
-
|
|
4556
|
+
/* @__PURE__ */ jsx8(
|
|
4557
|
+
Button2,
|
|
4368
4558
|
{
|
|
4369
4559
|
onClick: editingProject ? handleEditProject : handleCreateProject,
|
|
4370
4560
|
variant: "contained",
|
|
4371
4561
|
disabled: loading,
|
|
4372
|
-
startIcon: loading ? /* @__PURE__ */
|
|
4562
|
+
startIcon: loading ? /* @__PURE__ */ jsx8(CircularProgress3, { size: 16 }) : void 0,
|
|
4373
4563
|
sx: { textTransform: "none", borderRadius: 2 },
|
|
4374
4564
|
children: editingProject ? "Update project" : "Create project"
|
|
4375
4565
|
}
|
|
4376
4566
|
)
|
|
4377
|
-
] }) : /* @__PURE__ */
|
|
4567
|
+
] }) : /* @__PURE__ */ jsx8(Button2, { onClick: handleClose, sx: { textTransform: "none", borderRadius: 2 }, children: "Close" })
|
|
4378
4568
|
}
|
|
4379
4569
|
),
|
|
4380
|
-
/* @__PURE__ */
|
|
4570
|
+
/* @__PURE__ */ jsxs5(
|
|
4381
4571
|
Menu,
|
|
4382
4572
|
{
|
|
4383
4573
|
anchorEl: menuAnchor,
|
|
@@ -4399,20 +4589,20 @@ var ProjectManagementModal = ({
|
|
|
4399
4589
|
}
|
|
4400
4590
|
},
|
|
4401
4591
|
children: [
|
|
4402
|
-
/* @__PURE__ */
|
|
4592
|
+
/* @__PURE__ */ jsx8(
|
|
4403
4593
|
MenuItem,
|
|
4404
4594
|
{
|
|
4405
4595
|
onClick: () => {
|
|
4406
4596
|
if (!selectedProject) return;
|
|
4407
4597
|
startEdit(selectedProject);
|
|
4408
4598
|
},
|
|
4409
|
-
children: /* @__PURE__ */
|
|
4410
|
-
/* @__PURE__ */
|
|
4411
|
-
/* @__PURE__ */
|
|
4599
|
+
children: /* @__PURE__ */ jsxs5(Box5, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
4600
|
+
/* @__PURE__ */ jsx8(EditIcon, { size: 16 }),
|
|
4601
|
+
/* @__PURE__ */ jsx8(Typography3, { variant: "body2", color: "inherit", children: "Edit" })
|
|
4412
4602
|
] })
|
|
4413
4603
|
}
|
|
4414
4604
|
),
|
|
4415
|
-
/* @__PURE__ */
|
|
4605
|
+
/* @__PURE__ */ jsx8(
|
|
4416
4606
|
MenuItem,
|
|
4417
4607
|
{
|
|
4418
4608
|
onClick: () => {
|
|
@@ -4420,9 +4610,9 @@ var ProjectManagementModal = ({
|
|
|
4420
4610
|
handleDeleteProject(selectedProject);
|
|
4421
4611
|
},
|
|
4422
4612
|
sx: { color: theme.palette.error.main },
|
|
4423
|
-
children: /* @__PURE__ */
|
|
4424
|
-
/* @__PURE__ */
|
|
4425
|
-
/* @__PURE__ */
|
|
4613
|
+
children: /* @__PURE__ */ jsxs5(Box5, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
4614
|
+
/* @__PURE__ */ jsx8(DeleteIcon, { size: 16 }),
|
|
4615
|
+
/* @__PURE__ */ jsx8(Typography3, { variant: "body2", color: "inherit", children: "Delete" })
|
|
4426
4616
|
] })
|
|
4427
4617
|
}
|
|
4428
4618
|
)
|
|
@@ -4432,7 +4622,7 @@ var ProjectManagementModal = ({
|
|
|
4432
4622
|
]
|
|
4433
4623
|
}
|
|
4434
4624
|
);
|
|
4435
|
-
return /* @__PURE__ */
|
|
4625
|
+
return /* @__PURE__ */ jsx8(Fragment4, { children: isMobile ? /* @__PURE__ */ jsx8(
|
|
4436
4626
|
SwipeableDrawer,
|
|
4437
4627
|
{
|
|
4438
4628
|
anchor: "bottom",
|
|
@@ -4452,7 +4642,7 @@ var ProjectManagementModal = ({
|
|
|
4452
4642
|
},
|
|
4453
4643
|
children: content
|
|
4454
4644
|
}
|
|
4455
|
-
) : /* @__PURE__ */
|
|
4645
|
+
) : /* @__PURE__ */ jsx8(
|
|
4456
4646
|
Modal,
|
|
4457
4647
|
{
|
|
4458
4648
|
open,
|
|
@@ -4471,45 +4661,45 @@ var ProjectManagementModal = ({
|
|
|
4471
4661
|
var project_management_modal_default = ProjectManagementModal;
|
|
4472
4662
|
|
|
4473
4663
|
// src/chat/move-conversation-modal.tsx
|
|
4474
|
-
import { useState as
|
|
4664
|
+
import { useState as useState8, useEffect as useEffect8 } from "react";
|
|
4475
4665
|
import {
|
|
4476
4666
|
Dialog,
|
|
4477
4667
|
DialogTitle,
|
|
4478
4668
|
DialogContent,
|
|
4479
4669
|
DialogActions,
|
|
4480
|
-
Button as
|
|
4670
|
+
Button as Button3,
|
|
4481
4671
|
List as List2,
|
|
4482
4672
|
ListItem as ListItem2,
|
|
4483
4673
|
ListItemButton,
|
|
4484
4674
|
ListItemText,
|
|
4485
4675
|
ListItemIcon,
|
|
4486
|
-
Typography as
|
|
4676
|
+
Typography as Typography4,
|
|
4487
4677
|
Avatar as Avatar4,
|
|
4488
4678
|
Radio,
|
|
4489
|
-
Box as
|
|
4679
|
+
Box as Box6,
|
|
4490
4680
|
Divider
|
|
4491
4681
|
} from "@mui/material";
|
|
4492
4682
|
import { Folder as FolderIcon2, Inbox as InboxIcon } from "lucide-react";
|
|
4493
|
-
import { useTheme as
|
|
4494
|
-
import { jsx as
|
|
4683
|
+
import { useTheme as useTheme7 } from "@mui/material/styles";
|
|
4684
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
4495
4685
|
var MoveConversationModal = ({
|
|
4496
4686
|
open,
|
|
4497
4687
|
onClose,
|
|
4498
4688
|
conversations,
|
|
4499
4689
|
currentProjectId = null
|
|
4500
4690
|
}) => {
|
|
4501
|
-
const theme =
|
|
4691
|
+
const theme = useTheme7();
|
|
4502
4692
|
const { projects, _hasHydrated, hydrate } = useProjectStore();
|
|
4503
4693
|
const { moveConversationToProject } = useConversationStore();
|
|
4504
|
-
const [selectedProjectId, setSelectedProjectId] =
|
|
4694
|
+
const [selectedProjectId, setSelectedProjectId] = useState8(
|
|
4505
4695
|
currentProjectId
|
|
4506
4696
|
);
|
|
4507
|
-
|
|
4697
|
+
useEffect8(() => {
|
|
4508
4698
|
if (open && !_hasHydrated) {
|
|
4509
4699
|
hydrate();
|
|
4510
4700
|
}
|
|
4511
4701
|
}, [open, _hasHydrated, hydrate]);
|
|
4512
|
-
|
|
4702
|
+
useEffect8(() => {
|
|
4513
4703
|
setSelectedProjectId(currentProjectId);
|
|
4514
4704
|
}, [currentProjectId, open]);
|
|
4515
4705
|
const handleMove = async () => {
|
|
@@ -4528,7 +4718,7 @@ var MoveConversationModal = ({
|
|
|
4528
4718
|
};
|
|
4529
4719
|
const conversationCount = conversations.length;
|
|
4530
4720
|
const isMultiple = conversationCount > 1;
|
|
4531
|
-
return /* @__PURE__ */
|
|
4721
|
+
return /* @__PURE__ */ jsxs6(
|
|
4532
4722
|
Dialog,
|
|
4533
4723
|
{
|
|
4534
4724
|
open,
|
|
@@ -4542,20 +4732,20 @@ var MoveConversationModal = ({
|
|
|
4542
4732
|
}
|
|
4543
4733
|
},
|
|
4544
4734
|
children: [
|
|
4545
|
-
/* @__PURE__ */
|
|
4735
|
+
/* @__PURE__ */ jsxs6(DialogTitle, { children: [
|
|
4546
4736
|
"Move ",
|
|
4547
4737
|
isMultiple ? `${conversationCount} Conversations` : "Conversation"
|
|
4548
4738
|
] }),
|
|
4549
|
-
/* @__PURE__ */
|
|
4550
|
-
/* @__PURE__ */
|
|
4551
|
-
/* @__PURE__ */
|
|
4552
|
-
/* @__PURE__ */
|
|
4739
|
+
/* @__PURE__ */ jsxs6(DialogContent, { sx: { px: 3 }, children: [
|
|
4740
|
+
/* @__PURE__ */ jsx9(Typography4, { 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:` }),
|
|
4741
|
+
/* @__PURE__ */ jsxs6(List2, { children: [
|
|
4742
|
+
/* @__PURE__ */ jsx9(ListItem2, { disablePadding: true, children: /* @__PURE__ */ jsxs6(
|
|
4553
4743
|
ListItemButton,
|
|
4554
4744
|
{
|
|
4555
4745
|
onClick: () => setSelectedProjectId(null),
|
|
4556
4746
|
selected: selectedProjectId === null,
|
|
4557
4747
|
children: [
|
|
4558
|
-
/* @__PURE__ */
|
|
4748
|
+
/* @__PURE__ */ jsx9(ListItemIcon, { children: /* @__PURE__ */ jsx9(
|
|
4559
4749
|
Radio,
|
|
4560
4750
|
{
|
|
4561
4751
|
checked: selectedProjectId === null,
|
|
@@ -4563,7 +4753,7 @@ var MoveConversationModal = ({
|
|
|
4563
4753
|
size: "small"
|
|
4564
4754
|
}
|
|
4565
4755
|
) }),
|
|
4566
|
-
/* @__PURE__ */
|
|
4756
|
+
/* @__PURE__ */ jsx9(ListItemIcon, { children: /* @__PURE__ */ jsx9(
|
|
4567
4757
|
Avatar4,
|
|
4568
4758
|
{
|
|
4569
4759
|
sx: {
|
|
@@ -4571,10 +4761,10 @@ var MoveConversationModal = ({
|
|
|
4571
4761
|
width: 32,
|
|
4572
4762
|
height: 32
|
|
4573
4763
|
},
|
|
4574
|
-
children: /* @__PURE__ */
|
|
4764
|
+
children: /* @__PURE__ */ jsx9(InboxIcon, {})
|
|
4575
4765
|
}
|
|
4576
4766
|
) }),
|
|
4577
|
-
/* @__PURE__ */
|
|
4767
|
+
/* @__PURE__ */ jsx9(
|
|
4578
4768
|
ListItemText,
|
|
4579
4769
|
{
|
|
4580
4770
|
primary: "No Project",
|
|
@@ -4584,14 +4774,14 @@ var MoveConversationModal = ({
|
|
|
4584
4774
|
]
|
|
4585
4775
|
}
|
|
4586
4776
|
) }),
|
|
4587
|
-
/* @__PURE__ */
|
|
4588
|
-
projects.map((project) => /* @__PURE__ */
|
|
4777
|
+
/* @__PURE__ */ jsx9(Divider, { sx: { my: 1 } }),
|
|
4778
|
+
projects.map((project) => /* @__PURE__ */ jsx9(ListItem2, { disablePadding: true, children: /* @__PURE__ */ jsxs6(
|
|
4589
4779
|
ListItemButton,
|
|
4590
4780
|
{
|
|
4591
4781
|
onClick: () => setSelectedProjectId(project.id),
|
|
4592
4782
|
selected: selectedProjectId === project.id,
|
|
4593
4783
|
children: [
|
|
4594
|
-
/* @__PURE__ */
|
|
4784
|
+
/* @__PURE__ */ jsx9(ListItemIcon, { children: /* @__PURE__ */ jsx9(
|
|
4595
4785
|
Radio,
|
|
4596
4786
|
{
|
|
4597
4787
|
checked: selectedProjectId === project.id,
|
|
@@ -4599,7 +4789,7 @@ var MoveConversationModal = ({
|
|
|
4599
4789
|
size: "small"
|
|
4600
4790
|
}
|
|
4601
4791
|
) }),
|
|
4602
|
-
/* @__PURE__ */
|
|
4792
|
+
/* @__PURE__ */ jsx9(ListItemIcon, { children: /* @__PURE__ */ jsx9(
|
|
4603
4793
|
Avatar4,
|
|
4604
4794
|
{
|
|
4605
4795
|
sx: {
|
|
@@ -4607,10 +4797,10 @@ var MoveConversationModal = ({
|
|
|
4607
4797
|
width: 32,
|
|
4608
4798
|
height: 32
|
|
4609
4799
|
},
|
|
4610
|
-
children: /* @__PURE__ */
|
|
4800
|
+
children: /* @__PURE__ */ jsx9(FolderIcon2, {})
|
|
4611
4801
|
}
|
|
4612
4802
|
) }),
|
|
4613
|
-
/* @__PURE__ */
|
|
4803
|
+
/* @__PURE__ */ jsx9(
|
|
4614
4804
|
ListItemText,
|
|
4615
4805
|
{
|
|
4616
4806
|
primary: project.name,
|
|
@@ -4620,17 +4810,17 @@ var MoveConversationModal = ({
|
|
|
4620
4810
|
]
|
|
4621
4811
|
}
|
|
4622
4812
|
) }, project.id)),
|
|
4623
|
-
projects.length === 0 && /* @__PURE__ */
|
|
4813
|
+
projects.length === 0 && /* @__PURE__ */ jsx9(Box6, { sx: {
|
|
4624
4814
|
textAlign: "center",
|
|
4625
4815
|
py: 2,
|
|
4626
4816
|
color: theme.palette.text.secondary
|
|
4627
|
-
}, children: /* @__PURE__ */
|
|
4817
|
+
}, children: /* @__PURE__ */ jsx9(Typography4, { variant: "body2", children: "No projects available. Create a project first to organize conversations." }) })
|
|
4628
4818
|
] })
|
|
4629
4819
|
] }),
|
|
4630
|
-
/* @__PURE__ */
|
|
4631
|
-
/* @__PURE__ */
|
|
4632
|
-
/* @__PURE__ */
|
|
4633
|
-
|
|
4820
|
+
/* @__PURE__ */ jsxs6(DialogActions, { sx: { px: 3, pb: 2 }, children: [
|
|
4821
|
+
/* @__PURE__ */ jsx9(Button3, { onClick: onClose, children: "Cancel" }),
|
|
4822
|
+
/* @__PURE__ */ jsxs6(
|
|
4823
|
+
Button3,
|
|
4634
4824
|
{
|
|
4635
4825
|
onClick: handleMove,
|
|
4636
4826
|
variant: "contained",
|
|
@@ -4649,26 +4839,26 @@ var MoveConversationModal = ({
|
|
|
4649
4839
|
var move_conversation_modal_default = MoveConversationModal;
|
|
4650
4840
|
|
|
4651
4841
|
// src/chat/simple-conversation-item.tsx
|
|
4652
|
-
import { useState as
|
|
4842
|
+
import { useState as useState9, useRef as useRef6, useEffect as useEffect9 } from "react";
|
|
4653
4843
|
import {
|
|
4654
|
-
Box as
|
|
4655
|
-
Typography as
|
|
4844
|
+
Box as Box7,
|
|
4845
|
+
Typography as Typography5,
|
|
4656
4846
|
IconButton as IconButton5,
|
|
4657
4847
|
Menu as Menu2,
|
|
4658
4848
|
MenuItem as MenuItem2,
|
|
4659
4849
|
ListItemIcon as ListItemIcon2,
|
|
4660
4850
|
ListItemText as ListItemText2,
|
|
4661
4851
|
useMediaQuery as useMediaQuery3,
|
|
4662
|
-
TextField as
|
|
4852
|
+
TextField as TextField4,
|
|
4663
4853
|
Dialog as Dialog2,
|
|
4664
4854
|
DialogTitle as DialogTitle2,
|
|
4665
4855
|
DialogContent as DialogContent2,
|
|
4666
4856
|
DialogActions as DialogActions2,
|
|
4667
|
-
Button as
|
|
4857
|
+
Button as Button4
|
|
4668
4858
|
} from "@mui/material";
|
|
4669
4859
|
import { MoreVertical as MoreVertIcon2, Pencil as EditIcon2, Trash2 as DeleteIcon2, GripVertical as DragIcon, MailOpen as MoveIcon } from "lucide-react";
|
|
4670
|
-
import { useTheme as
|
|
4671
|
-
import { Fragment as Fragment5, jsx as
|
|
4860
|
+
import { useTheme as useTheme8, alpha as alpha4 } from "@mui/material/styles";
|
|
4861
|
+
import { Fragment as Fragment5, jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
4672
4862
|
var SimpleConversationItem = ({
|
|
4673
4863
|
conversation,
|
|
4674
4864
|
isSelected,
|
|
@@ -4684,14 +4874,14 @@ var SimpleConversationItem = ({
|
|
|
4684
4874
|
onTouchDragEnd,
|
|
4685
4875
|
isTouchDragActive
|
|
4686
4876
|
}) => {
|
|
4687
|
-
const theme =
|
|
4877
|
+
const theme = useTheme8();
|
|
4688
4878
|
const isMobile = useMediaQuery3(theme.breakpoints.down("sm"));
|
|
4689
|
-
const [anchorEl, setAnchorEl] =
|
|
4690
|
-
const [isEditing, setIsEditing] =
|
|
4691
|
-
const [editName, setEditName] =
|
|
4692
|
-
const [isDragging, setIsDragging] =
|
|
4693
|
-
const [isTouchDragging, setIsTouchDragging] =
|
|
4694
|
-
const [showRenameDialog, setShowRenameDialog] =
|
|
4879
|
+
const [anchorEl, setAnchorEl] = useState9(null);
|
|
4880
|
+
const [isEditing, setIsEditing] = useState9(false);
|
|
4881
|
+
const [editName, setEditName] = useState9(conversation.name);
|
|
4882
|
+
const [isDragging, setIsDragging] = useState9(false);
|
|
4883
|
+
const [isTouchDragging, setIsTouchDragging] = useState9(false);
|
|
4884
|
+
const [showRenameDialog, setShowRenameDialog] = useState9(false);
|
|
4695
4885
|
const longPressTimeoutRef = useRef6(null);
|
|
4696
4886
|
const touchStartPointRef = useRef6(null);
|
|
4697
4887
|
const activeTouchIdRef = useRef6(null);
|
|
@@ -4703,12 +4893,12 @@ var SimpleConversationItem = ({
|
|
|
4703
4893
|
const regex = new RegExp(`(${query.trim()})`, "gi");
|
|
4704
4894
|
const parts = text.split(regex);
|
|
4705
4895
|
return parts.map(
|
|
4706
|
-
(part, index) => regex.test(part) ? /* @__PURE__ */
|
|
4707
|
-
|
|
4896
|
+
(part, index) => regex.test(part) ? /* @__PURE__ */ jsx10(
|
|
4897
|
+
Box7,
|
|
4708
4898
|
{
|
|
4709
4899
|
component: "span",
|
|
4710
4900
|
sx: {
|
|
4711
|
-
bgcolor:
|
|
4901
|
+
bgcolor: alpha4(theme.palette.warning.main, 0.3),
|
|
4712
4902
|
color: theme.palette.text.primary,
|
|
4713
4903
|
fontWeight: 600,
|
|
4714
4904
|
borderRadius: 0.5,
|
|
@@ -4834,14 +5024,14 @@ var SimpleConversationItem = ({
|
|
|
4834
5024
|
if (!isMobile) return;
|
|
4835
5025
|
finalizeTouchDrag();
|
|
4836
5026
|
};
|
|
4837
|
-
|
|
5027
|
+
useEffect9(() => {
|
|
4838
5028
|
if (!isTouchDragActive && isTouchDragging) {
|
|
4839
5029
|
setIsTouchDragging(false);
|
|
4840
5030
|
}
|
|
4841
5031
|
}, [isTouchDragActive, isTouchDragging]);
|
|
4842
|
-
return /* @__PURE__ */
|
|
4843
|
-
/* @__PURE__ */
|
|
4844
|
-
|
|
5032
|
+
return /* @__PURE__ */ jsxs7(Fragment5, { children: [
|
|
5033
|
+
/* @__PURE__ */ jsxs7(
|
|
5034
|
+
Box7,
|
|
4845
5035
|
{
|
|
4846
5036
|
"data-project-id": conversation.projectId ?? "__ungrouped",
|
|
4847
5037
|
draggable: !isMobile && !isEditing,
|
|
@@ -4868,17 +5058,17 @@ var SimpleConversationItem = ({
|
|
|
4868
5058
|
mx: 1,
|
|
4869
5059
|
borderRadius: 1,
|
|
4870
5060
|
cursor: isEditing || isTouchDragging ? "default" : "pointer",
|
|
4871
|
-
bgcolor: isSelected ?
|
|
4872
|
-
border: isSelected ? `1px solid ${
|
|
5061
|
+
bgcolor: isSelected ? alpha4(projectColor || theme.palette.primary.main, 0.15) : "transparent",
|
|
5062
|
+
border: isSelected ? `1px solid ${alpha4(projectColor || theme.palette.primary.main, 0.3)}` : "1px solid transparent",
|
|
4873
5063
|
opacity: isDragging || isTouchDragActive ? 0.55 : 1,
|
|
4874
5064
|
transition: "all 0.2s ease",
|
|
4875
5065
|
transform: isTouchDragActive ? "scale(0.98)" : "none",
|
|
4876
|
-
boxShadow: isTouchDragActive ? `0 12px 24px ${
|
|
5066
|
+
boxShadow: isTouchDragActive ? `0 12px 24px ${alpha4(theme.palette.common.black, 0.25)}` : void 0,
|
|
4877
5067
|
touchAction: isTouchDragActive ? "none" : void 0,
|
|
4878
5068
|
userSelect: isTouchDragging || isTouchDragActive ? "none" : void 0,
|
|
4879
5069
|
WebkitUserSelect: isTouchDragging || isTouchDragActive ? "none" : void 0,
|
|
4880
5070
|
"&:hover": !isEditing && !isTouchDragging ? {
|
|
4881
|
-
bgcolor:
|
|
5071
|
+
bgcolor: alpha4(theme.palette.text.primary, 0.04)
|
|
4882
5072
|
} : {},
|
|
4883
5073
|
// Better touch handling on mobile
|
|
4884
5074
|
...isMobile && {
|
|
@@ -4888,12 +5078,12 @@ var SimpleConversationItem = ({
|
|
|
4888
5078
|
WebkitUserSelect: "none",
|
|
4889
5079
|
WebkitTouchCallout: "none",
|
|
4890
5080
|
"&:active": {
|
|
4891
|
-
bgcolor:
|
|
5081
|
+
bgcolor: alpha4(theme.palette.text.primary, 0.08)
|
|
4892
5082
|
}
|
|
4893
5083
|
}
|
|
4894
5084
|
},
|
|
4895
5085
|
children: [
|
|
4896
|
-
!isMobile && !isEditing && /* @__PURE__ */
|
|
5086
|
+
!isMobile && !isEditing && /* @__PURE__ */ jsx10(
|
|
4897
5087
|
DragIcon,
|
|
4898
5088
|
{
|
|
4899
5089
|
size: 16,
|
|
@@ -4901,9 +5091,9 @@ var SimpleConversationItem = ({
|
|
|
4901
5091
|
style: { marginRight: 4, cursor: "grab" }
|
|
4902
5092
|
}
|
|
4903
5093
|
),
|
|
4904
|
-
/* @__PURE__ */
|
|
4905
|
-
isEditing ? /* @__PURE__ */
|
|
4906
|
-
|
|
5094
|
+
/* @__PURE__ */ jsxs7(Box7, { sx: { flex: 1, minWidth: 0 }, children: [
|
|
5095
|
+
isEditing ? /* @__PURE__ */ jsx10(
|
|
5096
|
+
TextField4,
|
|
4907
5097
|
{
|
|
4908
5098
|
value: editName,
|
|
4909
5099
|
onChange: (e) => setEditName(e.target.value),
|
|
@@ -4925,8 +5115,8 @@ var SimpleConversationItem = ({
|
|
|
4925
5115
|
}
|
|
4926
5116
|
}
|
|
4927
5117
|
}
|
|
4928
|
-
) : /* @__PURE__ */
|
|
4929
|
-
|
|
5118
|
+
) : /* @__PURE__ */ jsx10(
|
|
5119
|
+
Typography5,
|
|
4930
5120
|
{
|
|
4931
5121
|
variant: "body2",
|
|
4932
5122
|
sx: {
|
|
@@ -4940,8 +5130,8 @@ var SimpleConversationItem = ({
|
|
|
4940
5130
|
children: highlightText(conversation.name, searchQuery)
|
|
4941
5131
|
}
|
|
4942
5132
|
),
|
|
4943
|
-
!isEditing && snippet && /* @__PURE__ */
|
|
4944
|
-
|
|
5133
|
+
!isEditing && snippet && /* @__PURE__ */ jsx10(
|
|
5134
|
+
Typography5,
|
|
4945
5135
|
{
|
|
4946
5136
|
variant: "caption",
|
|
4947
5137
|
sx: {
|
|
@@ -4949,7 +5139,7 @@ var SimpleConversationItem = ({
|
|
|
4949
5139
|
WebkitLineClamp: 2,
|
|
4950
5140
|
WebkitBoxOrient: "vertical",
|
|
4951
5141
|
overflow: "hidden",
|
|
4952
|
-
color:
|
|
5142
|
+
color: alpha4(theme.palette.text.secondary, 0.9),
|
|
4953
5143
|
mt: 0.25,
|
|
4954
5144
|
lineHeight: 1.3,
|
|
4955
5145
|
fontSize: "0.72rem"
|
|
@@ -4959,7 +5149,7 @@ var SimpleConversationItem = ({
|
|
|
4959
5149
|
}
|
|
4960
5150
|
)
|
|
4961
5151
|
] }),
|
|
4962
|
-
!isEditing && /* @__PURE__ */
|
|
5152
|
+
!isEditing && /* @__PURE__ */ jsx10(
|
|
4963
5153
|
IconButton5,
|
|
4964
5154
|
{
|
|
4965
5155
|
onClick: handleMenuOpen,
|
|
@@ -4988,10 +5178,10 @@ var SimpleConversationItem = ({
|
|
|
4988
5178
|
}
|
|
4989
5179
|
}
|
|
4990
5180
|
},
|
|
4991
|
-
children: /* @__PURE__ */
|
|
5181
|
+
children: /* @__PURE__ */ jsx10(MoreVertIcon2, { size: 16 })
|
|
4992
5182
|
}
|
|
4993
5183
|
),
|
|
4994
|
-
/* @__PURE__ */
|
|
5184
|
+
/* @__PURE__ */ jsxs7(
|
|
4995
5185
|
Menu2,
|
|
4996
5186
|
{
|
|
4997
5187
|
anchorEl,
|
|
@@ -5018,17 +5208,17 @@ var SimpleConversationItem = ({
|
|
|
5018
5208
|
}
|
|
5019
5209
|
},
|
|
5020
5210
|
children: [
|
|
5021
|
-
onRename && /* @__PURE__ */
|
|
5022
|
-
/* @__PURE__ */
|
|
5023
|
-
/* @__PURE__ */
|
|
5211
|
+
onRename && /* @__PURE__ */ jsxs7(MenuItem2, { onClick: handleEdit, children: [
|
|
5212
|
+
/* @__PURE__ */ jsx10(ListItemIcon2, { children: /* @__PURE__ */ jsx10(EditIcon2, { size: 16 }) }),
|
|
5213
|
+
/* @__PURE__ */ jsx10(ListItemText2, { children: "Rename" })
|
|
5024
5214
|
] }),
|
|
5025
|
-
onMove && /* @__PURE__ */
|
|
5026
|
-
/* @__PURE__ */
|
|
5027
|
-
/* @__PURE__ */
|
|
5215
|
+
onMove && /* @__PURE__ */ jsxs7(MenuItem2, { onClick: handleMove, children: [
|
|
5216
|
+
/* @__PURE__ */ jsx10(ListItemIcon2, { children: /* @__PURE__ */ jsx10(MoveIcon, { size: 16 }) }),
|
|
5217
|
+
/* @__PURE__ */ jsx10(ListItemText2, { children: "Move to Project" })
|
|
5028
5218
|
] }),
|
|
5029
|
-
/* @__PURE__ */
|
|
5030
|
-
/* @__PURE__ */
|
|
5031
|
-
/* @__PURE__ */
|
|
5219
|
+
/* @__PURE__ */ jsxs7(MenuItem2, { onClick: handleDelete, children: [
|
|
5220
|
+
/* @__PURE__ */ jsx10(ListItemIcon2, { children: /* @__PURE__ */ jsx10(DeleteIcon2, { size: 16 }) }),
|
|
5221
|
+
/* @__PURE__ */ jsx10(ListItemText2, { children: "Delete" })
|
|
5032
5222
|
] })
|
|
5033
5223
|
]
|
|
5034
5224
|
}
|
|
@@ -5036,7 +5226,7 @@ var SimpleConversationItem = ({
|
|
|
5036
5226
|
]
|
|
5037
5227
|
}
|
|
5038
5228
|
),
|
|
5039
|
-
isMobile && /* @__PURE__ */
|
|
5229
|
+
isMobile && /* @__PURE__ */ jsxs7(
|
|
5040
5230
|
Dialog2,
|
|
5041
5231
|
{
|
|
5042
5232
|
open: showRenameDialog,
|
|
@@ -5052,9 +5242,9 @@ var SimpleConversationItem = ({
|
|
|
5052
5242
|
}
|
|
5053
5243
|
},
|
|
5054
5244
|
children: [
|
|
5055
|
-
/* @__PURE__ */
|
|
5056
|
-
/* @__PURE__ */
|
|
5057
|
-
|
|
5245
|
+
/* @__PURE__ */ jsx10(DialogTitle2, { sx: { pb: 1 }, children: "Rename Conversation" }),
|
|
5246
|
+
/* @__PURE__ */ jsx10(DialogContent2, { children: /* @__PURE__ */ jsx10(
|
|
5247
|
+
TextField4,
|
|
5058
5248
|
{
|
|
5059
5249
|
value: editName,
|
|
5060
5250
|
onChange: (e) => setEditName(e.target.value),
|
|
@@ -5066,9 +5256,9 @@ var SimpleConversationItem = ({
|
|
|
5066
5256
|
}
|
|
5067
5257
|
}
|
|
5068
5258
|
) }),
|
|
5069
|
-
/* @__PURE__ */
|
|
5070
|
-
/* @__PURE__ */
|
|
5071
|
-
|
|
5259
|
+
/* @__PURE__ */ jsxs7(DialogActions2, { sx: { px: 3, pb: 2 }, children: [
|
|
5260
|
+
/* @__PURE__ */ jsx10(
|
|
5261
|
+
Button4,
|
|
5072
5262
|
{
|
|
5073
5263
|
onClick: () => {
|
|
5074
5264
|
setShowRenameDialog(false);
|
|
@@ -5077,8 +5267,8 @@ var SimpleConversationItem = ({
|
|
|
5077
5267
|
children: "Cancel"
|
|
5078
5268
|
}
|
|
5079
5269
|
),
|
|
5080
|
-
/* @__PURE__ */
|
|
5081
|
-
|
|
5270
|
+
/* @__PURE__ */ jsx10(
|
|
5271
|
+
Button4,
|
|
5082
5272
|
{
|
|
5083
5273
|
onClick: () => {
|
|
5084
5274
|
commitRename();
|
|
@@ -5098,20 +5288,20 @@ var SimpleConversationItem = ({
|
|
|
5098
5288
|
var simple_conversation_item_default = SimpleConversationItem;
|
|
5099
5289
|
|
|
5100
5290
|
// src/chat/project-header.tsx
|
|
5101
|
-
import { useRef as useRef7, useState as
|
|
5291
|
+
import { useRef as useRef7, useState as useState10 } from "react";
|
|
5102
5292
|
import {
|
|
5103
|
-
Box as
|
|
5104
|
-
Typography as
|
|
5293
|
+
Box as Box8,
|
|
5294
|
+
Typography as Typography6,
|
|
5105
5295
|
IconButton as IconButton6,
|
|
5106
5296
|
Avatar as Avatar5,
|
|
5107
|
-
Chip as
|
|
5297
|
+
Chip as Chip3,
|
|
5108
5298
|
Tooltip as Tooltip2,
|
|
5109
|
-
TextField as
|
|
5110
|
-
alpha as
|
|
5299
|
+
TextField as TextField5,
|
|
5300
|
+
alpha as alpha5
|
|
5111
5301
|
} from "@mui/material";
|
|
5112
5302
|
import { ChevronDown as ExpandMoreIcon2, ChevronUp as ExpandLessIcon, Plus as AddIcon3, Folder as FolderIcon3, FolderOpen as FolderOpenIcon, Inbox as InboxIcon2, X as CloseIcon3, Check as CheckIcon2 } from "lucide-react";
|
|
5113
|
-
import { useTheme as
|
|
5114
|
-
import { jsx as
|
|
5303
|
+
import { useTheme as useTheme9 } from "@mui/material/styles";
|
|
5304
|
+
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
5115
5305
|
var ProjectHeader = ({
|
|
5116
5306
|
projectId,
|
|
5117
5307
|
projectName,
|
|
@@ -5125,12 +5315,12 @@ var ProjectHeader = ({
|
|
|
5125
5315
|
onRenameCancelDelete,
|
|
5126
5316
|
isTouchTarget
|
|
5127
5317
|
}) => {
|
|
5128
|
-
const theme =
|
|
5318
|
+
const theme = useTheme9();
|
|
5129
5319
|
const { createNewConversation } = useConversationStore();
|
|
5130
5320
|
const { renameProject } = useProjectStore();
|
|
5131
|
-
const [isHovered, setIsHovered] =
|
|
5132
|
-
const [isDragOver, setIsDragOver] =
|
|
5133
|
-
const [renameDraft, setRenameDraft] =
|
|
5321
|
+
const [isHovered, setIsHovered] = useState10(false);
|
|
5322
|
+
const [isDragOver, setIsDragOver] = useState10(false);
|
|
5323
|
+
const [renameDraft, setRenameDraft] = useState10(projectName);
|
|
5134
5324
|
const renameActionRef = useRef7("none");
|
|
5135
5325
|
const isUngrouped = projectId === null;
|
|
5136
5326
|
const Icon = isCollapsed ? FolderIcon3 : FolderOpenIcon;
|
|
@@ -5177,8 +5367,8 @@ var ProjectHeader = ({
|
|
|
5177
5367
|
setRenameDraft(projectName);
|
|
5178
5368
|
onRenameComplete?.();
|
|
5179
5369
|
};
|
|
5180
|
-
return /* @__PURE__ */
|
|
5181
|
-
|
|
5370
|
+
return /* @__PURE__ */ jsxs8(
|
|
5371
|
+
Box8,
|
|
5182
5372
|
{
|
|
5183
5373
|
"data-project-id": projectId ?? "__ungrouped",
|
|
5184
5374
|
onMouseEnter: () => setIsHovered(true),
|
|
@@ -5194,37 +5384,37 @@ var ProjectHeader = ({
|
|
|
5194
5384
|
py: 1.5,
|
|
5195
5385
|
cursor: isUngrouped ? "default" : "pointer",
|
|
5196
5386
|
// No pointer cursor for ungrouped
|
|
5197
|
-
bgcolor: isDragOver || isTouchTarget ?
|
|
5387
|
+
bgcolor: isDragOver || isTouchTarget ? alpha5(projectColor || theme.palette.primary.main, 0.1) : void 0,
|
|
5198
5388
|
border: isDragOver || isTouchTarget ? `2px dashed ${projectColor || theme.palette.primary.main}` : "2px solid transparent",
|
|
5199
5389
|
borderRadius: isDragOver || isTouchTarget ? 1 : 0,
|
|
5200
5390
|
transition: "all 0.2s ease",
|
|
5201
5391
|
"&:hover": !isUngrouped ? {
|
|
5202
5392
|
// Only show hover for projects, not ungrouped
|
|
5203
|
-
bgcolor:
|
|
5393
|
+
bgcolor: alpha5(theme.palette.text.primary, 0.04)
|
|
5204
5394
|
} : {}
|
|
5205
5395
|
},
|
|
5206
5396
|
children: [
|
|
5207
|
-
/* @__PURE__ */
|
|
5397
|
+
/* @__PURE__ */ jsx11(
|
|
5208
5398
|
Avatar5,
|
|
5209
5399
|
{
|
|
5210
5400
|
sx: {
|
|
5211
|
-
bgcolor: isUngrouped ?
|
|
5401
|
+
bgcolor: isUngrouped ? alpha5(theme.palette.text.disabled, 0.1) : projectColor || theme.palette.grey[400],
|
|
5212
5402
|
width: 28,
|
|
5213
5403
|
height: 28,
|
|
5214
5404
|
mr: 1.5
|
|
5215
5405
|
},
|
|
5216
|
-
children: isUngrouped ? /* @__PURE__ */
|
|
5406
|
+
children: isUngrouped ? /* @__PURE__ */ jsx11(
|
|
5217
5407
|
InboxIcon2,
|
|
5218
5408
|
{
|
|
5219
5409
|
size: 16,
|
|
5220
5410
|
color: theme.palette.text.disabled,
|
|
5221
5411
|
style: { opacity: 0.7 }
|
|
5222
5412
|
}
|
|
5223
|
-
) : /* @__PURE__ */
|
|
5413
|
+
) : /* @__PURE__ */ jsx11(Icon, { size: 16 })
|
|
5224
5414
|
}
|
|
5225
5415
|
),
|
|
5226
|
-
isRenaming && !isUngrouped ? /* @__PURE__ */
|
|
5227
|
-
|
|
5416
|
+
isRenaming && !isUngrouped ? /* @__PURE__ */ jsx11(
|
|
5417
|
+
TextField5,
|
|
5228
5418
|
{
|
|
5229
5419
|
value: renameDraft,
|
|
5230
5420
|
onChange: (e) => setRenameDraft(e.target.value),
|
|
@@ -5270,8 +5460,8 @@ var ProjectHeader = ({
|
|
|
5270
5460
|
}
|
|
5271
5461
|
}
|
|
5272
5462
|
}
|
|
5273
|
-
) : /* @__PURE__ */
|
|
5274
|
-
|
|
5463
|
+
) : /* @__PURE__ */ jsxs8(
|
|
5464
|
+
Typography6,
|
|
5275
5465
|
{
|
|
5276
5466
|
variant: "subtitle2",
|
|
5277
5467
|
sx: {
|
|
@@ -5283,8 +5473,8 @@ var ProjectHeader = ({
|
|
|
5283
5473
|
},
|
|
5284
5474
|
children: [
|
|
5285
5475
|
projectName,
|
|
5286
|
-
isDragOver && /* @__PURE__ */
|
|
5287
|
-
|
|
5476
|
+
isDragOver && /* @__PURE__ */ jsx11(
|
|
5477
|
+
Typography6,
|
|
5288
5478
|
{
|
|
5289
5479
|
component: "span",
|
|
5290
5480
|
variant: "caption",
|
|
@@ -5299,13 +5489,13 @@ var ProjectHeader = ({
|
|
|
5299
5489
|
]
|
|
5300
5490
|
}
|
|
5301
5491
|
),
|
|
5302
|
-
/* @__PURE__ */
|
|
5303
|
-
|
|
5492
|
+
/* @__PURE__ */ jsx11(
|
|
5493
|
+
Chip3,
|
|
5304
5494
|
{
|
|
5305
5495
|
label: conversationCount,
|
|
5306
5496
|
size: "small",
|
|
5307
5497
|
sx: {
|
|
5308
|
-
bgcolor: isUngrouped ?
|
|
5498
|
+
bgcolor: isUngrouped ? alpha5(theme.palette.text.disabled, 0.1) : alpha5(projectColor || theme.palette.primary.main, 0.15),
|
|
5309
5499
|
color: isUngrouped ? theme.palette.text.disabled : projectColor || theme.palette.primary.main,
|
|
5310
5500
|
minWidth: 28,
|
|
5311
5501
|
height: 22,
|
|
@@ -5319,8 +5509,8 @@ var ProjectHeader = ({
|
|
|
5319
5509
|
}
|
|
5320
5510
|
}
|
|
5321
5511
|
),
|
|
5322
|
-
isRenaming && !isUngrouped && /* @__PURE__ */
|
|
5323
|
-
/* @__PURE__ */
|
|
5512
|
+
isRenaming && !isUngrouped && /* @__PURE__ */ jsxs8(Box8, { sx: { display: "flex", alignItems: "center", gap: 0.5, ml: 1 }, children: [
|
|
5513
|
+
/* @__PURE__ */ jsx11(Tooltip2, { title: "Cancel and remove", children: /* @__PURE__ */ jsx11(
|
|
5324
5514
|
IconButton6,
|
|
5325
5515
|
{
|
|
5326
5516
|
size: "small",
|
|
@@ -5329,11 +5519,11 @@ var ProjectHeader = ({
|
|
|
5329
5519
|
renameActionRef.current = "delete";
|
|
5330
5520
|
onRenameCancelDelete ? onRenameCancelDelete() : cancelRename();
|
|
5331
5521
|
},
|
|
5332
|
-
sx: { color:
|
|
5333
|
-
children: /* @__PURE__ */
|
|
5522
|
+
sx: { color: alpha5(theme.palette.error.main, 0.9) },
|
|
5523
|
+
children: /* @__PURE__ */ jsx11(CloseIcon3, { size: 16 })
|
|
5334
5524
|
}
|
|
5335
5525
|
) }),
|
|
5336
|
-
/* @__PURE__ */
|
|
5526
|
+
/* @__PURE__ */ jsx11(Tooltip2, { title: "Save", children: /* @__PURE__ */ jsx11(
|
|
5337
5527
|
IconButton6,
|
|
5338
5528
|
{
|
|
5339
5529
|
size: "small",
|
|
@@ -5343,31 +5533,31 @@ var ProjectHeader = ({
|
|
|
5343
5533
|
commitRename();
|
|
5344
5534
|
},
|
|
5345
5535
|
sx: { color: theme.palette.success.main },
|
|
5346
|
-
children: /* @__PURE__ */
|
|
5536
|
+
children: /* @__PURE__ */ jsx11(CheckIcon2, { size: 16 })
|
|
5347
5537
|
}
|
|
5348
5538
|
) })
|
|
5349
5539
|
] }),
|
|
5350
|
-
isHovered && !isDragOver && !isUngrouped && !isRenaming && /* @__PURE__ */
|
|
5540
|
+
isHovered && !isDragOver && !isUngrouped && !isRenaming && /* @__PURE__ */ jsx11(Tooltip2, { title: `Add conversation to ${projectName.toLowerCase()}`, arrow: true, children: /* @__PURE__ */ jsx11(
|
|
5351
5541
|
IconButton6,
|
|
5352
5542
|
{
|
|
5353
5543
|
onClick: handleAddConversation,
|
|
5354
5544
|
size: "small",
|
|
5355
5545
|
sx: {
|
|
5356
5546
|
color: projectColor || theme.palette.primary.main,
|
|
5357
|
-
bgcolor:
|
|
5547
|
+
bgcolor: alpha5(projectColor || theme.palette.primary.main, 0.1),
|
|
5358
5548
|
width: 24,
|
|
5359
5549
|
height: 24,
|
|
5360
5550
|
mr: 0.5,
|
|
5361
5551
|
"&:hover": {
|
|
5362
|
-
bgcolor:
|
|
5552
|
+
bgcolor: alpha5(projectColor || theme.palette.primary.main, 0.2),
|
|
5363
5553
|
transform: "scale(1.1)"
|
|
5364
5554
|
},
|
|
5365
5555
|
transition: "all 0.2s ease"
|
|
5366
5556
|
},
|
|
5367
|
-
children: /* @__PURE__ */
|
|
5557
|
+
children: /* @__PURE__ */ jsx11(AddIcon3, { size: 16 })
|
|
5368
5558
|
}
|
|
5369
5559
|
) }),
|
|
5370
|
-
!isUngrouped && !isRenaming && /* @__PURE__ */
|
|
5560
|
+
!isUngrouped && !isRenaming && /* @__PURE__ */ jsx11(
|
|
5371
5561
|
IconButton6,
|
|
5372
5562
|
{
|
|
5373
5563
|
size: "small",
|
|
@@ -5375,7 +5565,7 @@ var ProjectHeader = ({
|
|
|
5375
5565
|
color: theme.palette.text.secondary,
|
|
5376
5566
|
transition: "transform 0.2s ease"
|
|
5377
5567
|
},
|
|
5378
|
-
children: isCollapsed ? /* @__PURE__ */
|
|
5568
|
+
children: isCollapsed ? /* @__PURE__ */ jsx11(ExpandMoreIcon2, { size: 16 }) : /* @__PURE__ */ jsx11(ExpandLessIcon, { size: 16 })
|
|
5379
5569
|
}
|
|
5380
5570
|
)
|
|
5381
5571
|
]
|
|
@@ -5397,7 +5587,7 @@ var TOOLTIP_COPY = {
|
|
|
5397
5587
|
var tooltip = (key) => TOOLTIP_COPY[key];
|
|
5398
5588
|
|
|
5399
5589
|
// src/chat/conversation-drawer.tsx
|
|
5400
|
-
import { Fragment as Fragment6, jsx as
|
|
5590
|
+
import { Fragment as Fragment6, jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
5401
5591
|
var BANDIT_AVATAR = "https://cdn.burtson.ai/images/bandit-head.png";
|
|
5402
5592
|
var coerceOptionalString = (value) => {
|
|
5403
5593
|
if (typeof value !== "string") return void 0;
|
|
@@ -5425,7 +5615,7 @@ var deriveInitials = (value) => {
|
|
|
5425
5615
|
return sanitized.slice(0, 2).toUpperCase();
|
|
5426
5616
|
};
|
|
5427
5617
|
var ConversationDrawer = ({ open, onClose }) => {
|
|
5428
|
-
const theme =
|
|
5618
|
+
const theme = useTheme10();
|
|
5429
5619
|
const isMobile = useMediaQuery4(theme.breakpoints.down("sm"));
|
|
5430
5620
|
const { user } = useAuthenticationStore();
|
|
5431
5621
|
const baseRadius = typeof theme.shape.borderRadius === "number" ? theme.shape.borderRadius : parseFloat(theme.shape.borderRadius) || 0;
|
|
@@ -5448,15 +5638,15 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5448
5638
|
createProject,
|
|
5449
5639
|
deleteProject
|
|
5450
5640
|
} = useProjectStore();
|
|
5451
|
-
const [projectManagementOpen, setProjectManagementOpen] =
|
|
5452
|
-
const [collapsedProjects, setCollapsedProjects] =
|
|
5641
|
+
const [projectManagementOpen, setProjectManagementOpen] = useState11(false);
|
|
5642
|
+
const [collapsedProjects, setCollapsedProjects] = useState11(/* @__PURE__ */ new Set());
|
|
5453
5643
|
const didInitCollapseRef = useRef8(false);
|
|
5454
|
-
const [searchQuery, setSearchQuery] =
|
|
5455
|
-
const [menuAnchorEl, setMenuAnchorEl] =
|
|
5456
|
-
const [clearConfirmOpen, setClearConfirmOpen] =
|
|
5457
|
-
const [moveModalOpen, setMoveModalOpen] =
|
|
5458
|
-
const [conversationToMove, setConversationToMove] =
|
|
5459
|
-
const [renameProjectId, setRenameProjectId] =
|
|
5644
|
+
const [searchQuery, setSearchQuery] = useState11("");
|
|
5645
|
+
const [menuAnchorEl, setMenuAnchorEl] = useState11(null);
|
|
5646
|
+
const [clearConfirmOpen, setClearConfirmOpen] = useState11(false);
|
|
5647
|
+
const [moveModalOpen, setMoveModalOpen] = useState11(false);
|
|
5648
|
+
const [conversationToMove, setConversationToMove] = useState11(null);
|
|
5649
|
+
const [renameProjectId, setRenameProjectId] = useState11(null);
|
|
5460
5650
|
const getCustomClaim = useCallback4((key) => {
|
|
5461
5651
|
if (!user) return void 0;
|
|
5462
5652
|
const record = user;
|
|
@@ -5489,8 +5679,8 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5489
5679
|
}
|
|
5490
5680
|
return void 0;
|
|
5491
5681
|
}, [user, userDisplayName]);
|
|
5492
|
-
const [avatarImage, setAvatarImage] =
|
|
5493
|
-
|
|
5682
|
+
const [avatarImage, setAvatarImage] = useState11(BANDIT_AVATAR);
|
|
5683
|
+
useEffect10(() => {
|
|
5494
5684
|
const fetchBranding = async () => {
|
|
5495
5685
|
try {
|
|
5496
5686
|
const branding = await brandingService_default.getBranding();
|
|
@@ -5506,12 +5696,12 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5506
5696
|
}, []);
|
|
5507
5697
|
const avatarLabel = userDisplayName || user?.email || "Bandit";
|
|
5508
5698
|
const avatarInitials = useMemo(() => deriveInitials(avatarLabel), [avatarLabel]);
|
|
5509
|
-
|
|
5699
|
+
useEffect10(() => {
|
|
5510
5700
|
if (!projectsHydrated) {
|
|
5511
5701
|
hydrateProjects();
|
|
5512
5702
|
}
|
|
5513
5703
|
}, [projectsHydrated, hydrateProjects]);
|
|
5514
|
-
|
|
5704
|
+
useEffect10(() => {
|
|
5515
5705
|
if (projectsHydrated && !didInitCollapseRef.current) {
|
|
5516
5706
|
didInitCollapseRef.current = true;
|
|
5517
5707
|
if (projects && projects.length > 0) {
|
|
@@ -5618,8 +5808,8 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5618
5808
|
setMoveModalOpen(false);
|
|
5619
5809
|
setConversationToMove(null);
|
|
5620
5810
|
};
|
|
5621
|
-
return /* @__PURE__ */
|
|
5622
|
-
/* @__PURE__ */
|
|
5811
|
+
return /* @__PURE__ */ jsxs9(Fragment6, { children: [
|
|
5812
|
+
/* @__PURE__ */ jsxs9(
|
|
5623
5813
|
Drawer,
|
|
5624
5814
|
{
|
|
5625
5815
|
anchor: "left",
|
|
@@ -5633,7 +5823,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5633
5823
|
width: isMobile ? `min(94vw, 360px)` : 340,
|
|
5634
5824
|
maxWidth: 360,
|
|
5635
5825
|
bgcolor: theme.palette.background.paper,
|
|
5636
|
-
borderRight: `1px solid ${isMobile ?
|
|
5826
|
+
borderRight: `1px solid ${isMobile ? alpha6(theme.palette.divider, 0.4) : theme.palette.divider}`,
|
|
5637
5827
|
display: "flex",
|
|
5638
5828
|
flexDirection: "column",
|
|
5639
5829
|
height: isMobile ? `calc(100dvh - ${theme.spacing(4)})` : "100dvh",
|
|
@@ -5641,7 +5831,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5641
5831
|
bottom: isMobile ? theme.spacing(2) : 0,
|
|
5642
5832
|
left: 0,
|
|
5643
5833
|
borderRadius: isMobile ? `0 ${drawerCornerRadius}px ${drawerCornerRadius}px 0` : 0,
|
|
5644
|
-
boxShadow: isMobile ? `0 18px 36px ${
|
|
5834
|
+
boxShadow: isMobile ? `0 18px 36px ${alpha6(theme.palette.common.black, 0.28)}` : "none",
|
|
5645
5835
|
overflow: "hidden"
|
|
5646
5836
|
}
|
|
5647
5837
|
},
|
|
@@ -5661,8 +5851,8 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5661
5851
|
}
|
|
5662
5852
|
},
|
|
5663
5853
|
children: [
|
|
5664
|
-
/* @__PURE__ */
|
|
5665
|
-
|
|
5854
|
+
/* @__PURE__ */ jsxs9(
|
|
5855
|
+
Box9,
|
|
5666
5856
|
{
|
|
5667
5857
|
sx: {
|
|
5668
5858
|
p: 2,
|
|
@@ -5673,7 +5863,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5673
5863
|
gap: 1
|
|
5674
5864
|
},
|
|
5675
5865
|
children: [
|
|
5676
|
-
/* @__PURE__ */
|
|
5866
|
+
/* @__PURE__ */ jsx12(Tooltip3, { title: tooltip("manageProjects"), arrow: true, children: /* @__PURE__ */ jsx12(
|
|
5677
5867
|
IconButton7,
|
|
5678
5868
|
{
|
|
5679
5869
|
onClick: () => setProjectManagementOpen(true),
|
|
@@ -5683,13 +5873,13 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5683
5873
|
color: theme.palette.text.secondary,
|
|
5684
5874
|
"&:hover": {
|
|
5685
5875
|
color: theme.palette.primary.main,
|
|
5686
|
-
bgcolor:
|
|
5876
|
+
bgcolor: alpha6(theme.palette.primary.main, 0.1)
|
|
5687
5877
|
}
|
|
5688
5878
|
},
|
|
5689
|
-
children: /* @__PURE__ */
|
|
5879
|
+
children: /* @__PURE__ */ jsx12(FolderIcon4, {})
|
|
5690
5880
|
}
|
|
5691
5881
|
) }),
|
|
5692
|
-
/* @__PURE__ */
|
|
5882
|
+
/* @__PURE__ */ jsx12(Tooltip3, { title: tooltip("conversationOptions"), arrow: true, children: /* @__PURE__ */ jsx12(
|
|
5693
5883
|
IconButton7,
|
|
5694
5884
|
{
|
|
5695
5885
|
onClick: handleMenuOpen,
|
|
@@ -5699,13 +5889,13 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5699
5889
|
color: theme.palette.text.secondary,
|
|
5700
5890
|
"&:hover": {
|
|
5701
5891
|
color: theme.palette.text.primary,
|
|
5702
|
-
bgcolor:
|
|
5892
|
+
bgcolor: alpha6(theme.palette.text.primary, 0.1)
|
|
5703
5893
|
}
|
|
5704
5894
|
},
|
|
5705
|
-
children: /* @__PURE__ */
|
|
5895
|
+
children: /* @__PURE__ */ jsx12(MoreVertIcon3, {})
|
|
5706
5896
|
}
|
|
5707
5897
|
) }),
|
|
5708
|
-
isMobile && /* @__PURE__ */
|
|
5898
|
+
isMobile && /* @__PURE__ */ jsx12(Tooltip3, { title: tooltip("closeConversationsPanel"), children: /* @__PURE__ */ jsx12(
|
|
5709
5899
|
IconButton7,
|
|
5710
5900
|
{
|
|
5711
5901
|
onClick: (e) => {
|
|
@@ -5719,17 +5909,17 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5719
5909
|
color: theme.palette.text.secondary,
|
|
5720
5910
|
"&:hover": {
|
|
5721
5911
|
color: theme.palette.error.main,
|
|
5722
|
-
bgcolor:
|
|
5912
|
+
bgcolor: alpha6(theme.palette.error.main, 0.1)
|
|
5723
5913
|
}
|
|
5724
5914
|
},
|
|
5725
|
-
children: /* @__PURE__ */
|
|
5915
|
+
children: /* @__PURE__ */ jsx12(CloseIcon4, {})
|
|
5726
5916
|
}
|
|
5727
5917
|
) })
|
|
5728
5918
|
]
|
|
5729
5919
|
}
|
|
5730
5920
|
),
|
|
5731
|
-
/* @__PURE__ */
|
|
5732
|
-
|
|
5921
|
+
/* @__PURE__ */ jsx12(Box9, { sx: { p: 2, pb: 1 }, children: /* @__PURE__ */ jsx12(
|
|
5922
|
+
TextField6,
|
|
5733
5923
|
{
|
|
5734
5924
|
fullWidth: true,
|
|
5735
5925
|
size: "small",
|
|
@@ -5738,8 +5928,8 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5738
5928
|
onChange: (e) => setSearchQuery(e.target.value),
|
|
5739
5929
|
variant: "outlined",
|
|
5740
5930
|
InputProps: {
|
|
5741
|
-
startAdornment: /* @__PURE__ */
|
|
5742
|
-
endAdornment: searchQuery && /* @__PURE__ */
|
|
5931
|
+
startAdornment: /* @__PURE__ */ jsx12(InputAdornment, { position: "start", children: /* @__PURE__ */ jsx12(SearchIcon, { size: 16, color: theme.palette.text.secondary }) }),
|
|
5932
|
+
endAdornment: searchQuery && /* @__PURE__ */ jsx12(InputAdornment, { position: "end", children: /* @__PURE__ */ jsx12(Tooltip3, { title: tooltip("clearSearch"), children: /* @__PURE__ */ jsx12(
|
|
5743
5933
|
IconButton7,
|
|
5744
5934
|
{
|
|
5745
5935
|
onClick: handleSearchClear,
|
|
@@ -5747,15 +5937,15 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5747
5937
|
edge: "end",
|
|
5748
5938
|
"aria-label": tooltip("clearSearch"),
|
|
5749
5939
|
sx: { color: theme.palette.text.secondary },
|
|
5750
|
-
children: /* @__PURE__ */
|
|
5940
|
+
children: /* @__PURE__ */ jsx12(ClearIcon, { size: 16 })
|
|
5751
5941
|
}
|
|
5752
5942
|
) }) })
|
|
5753
5943
|
},
|
|
5754
5944
|
sx: {
|
|
5755
5945
|
"& .MuiOutlinedInput-root": {
|
|
5756
|
-
bgcolor:
|
|
5946
|
+
bgcolor: alpha6(theme.palette.background.default, 0.5),
|
|
5757
5947
|
"&:hover": {
|
|
5758
|
-
bgcolor:
|
|
5948
|
+
bgcolor: alpha6(theme.palette.background.default, 0.8)
|
|
5759
5949
|
},
|
|
5760
5950
|
"&.Mui-focused": {
|
|
5761
5951
|
bgcolor: theme.palette.background.default
|
|
@@ -5764,9 +5954,9 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5764
5954
|
}
|
|
5765
5955
|
}
|
|
5766
5956
|
) }),
|
|
5767
|
-
/* @__PURE__ */
|
|
5768
|
-
/* @__PURE__ */
|
|
5769
|
-
|
|
5957
|
+
/* @__PURE__ */ jsxs9(Box9, { sx: { flex: 1, overflow: "auto", display: "flex", flexDirection: "column" }, children: [
|
|
5958
|
+
/* @__PURE__ */ jsxs9(
|
|
5959
|
+
Box9,
|
|
5770
5960
|
{
|
|
5771
5961
|
onClick: async () => {
|
|
5772
5962
|
const names = new Set(projects.map((p) => p.name));
|
|
@@ -5797,49 +5987,49 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5797
5987
|
alignItems: "center",
|
|
5798
5988
|
gap: 1.5,
|
|
5799
5989
|
cursor: "pointer",
|
|
5800
|
-
"&:hover": { bgcolor:
|
|
5990
|
+
"&:hover": { bgcolor: alpha6(theme.palette.text.primary, 0.04) }
|
|
5801
5991
|
},
|
|
5802
5992
|
children: [
|
|
5803
|
-
/* @__PURE__ */
|
|
5804
|
-
|
|
5993
|
+
/* @__PURE__ */ jsx12(
|
|
5994
|
+
Box9,
|
|
5805
5995
|
{
|
|
5806
5996
|
sx: {
|
|
5807
5997
|
width: 28,
|
|
5808
5998
|
height: 28,
|
|
5809
5999
|
borderRadius: "50%",
|
|
5810
|
-
bgcolor:
|
|
6000
|
+
bgcolor: alpha6(theme.palette.success.main, 0.15),
|
|
5811
6001
|
display: "flex",
|
|
5812
6002
|
alignItems: "center",
|
|
5813
6003
|
justifyContent: "center",
|
|
5814
6004
|
flexShrink: 0
|
|
5815
6005
|
},
|
|
5816
|
-
children: /* @__PURE__ */
|
|
6006
|
+
children: /* @__PURE__ */ jsx12(FolderIcon4, { size: 16, color: theme.palette.success.main })
|
|
5817
6007
|
}
|
|
5818
6008
|
),
|
|
5819
|
-
/* @__PURE__ */
|
|
5820
|
-
|
|
6009
|
+
/* @__PURE__ */ jsx12(
|
|
6010
|
+
Typography7,
|
|
5821
6011
|
{
|
|
5822
6012
|
variant: "subtitle2",
|
|
5823
6013
|
sx: { flex: 1, fontWeight: 600, fontSize: "0.875rem" },
|
|
5824
6014
|
children: "New Project"
|
|
5825
6015
|
}
|
|
5826
6016
|
),
|
|
5827
|
-
/* @__PURE__ */
|
|
6017
|
+
/* @__PURE__ */ jsx12(Tooltip3, { title: tooltip("addProject"), arrow: true, children: /* @__PURE__ */ jsx12(
|
|
5828
6018
|
IconButton7,
|
|
5829
6019
|
{
|
|
5830
6020
|
size: "small",
|
|
5831
6021
|
"aria-label": tooltip("addProject"),
|
|
5832
6022
|
sx: { color: theme.palette.success.main },
|
|
5833
|
-
children: /* @__PURE__ */
|
|
6023
|
+
children: /* @__PURE__ */ jsx12(AddIcon4, { size: 16 })
|
|
5834
6024
|
}
|
|
5835
6025
|
) })
|
|
5836
6026
|
]
|
|
5837
6027
|
}
|
|
5838
6028
|
),
|
|
5839
|
-
/* @__PURE__ */
|
|
5840
|
-
filteredProjectGroups.map((group, index) => /* @__PURE__ */
|
|
5841
|
-
group.id === null && filteredProjectGroups.length > 1 && /* @__PURE__ */
|
|
5842
|
-
|
|
6029
|
+
/* @__PURE__ */ jsx12(Divider2, { sx: { opacity: 0.3 } }),
|
|
6030
|
+
filteredProjectGroups.map((group, index) => /* @__PURE__ */ jsxs9(Box9, { children: [
|
|
6031
|
+
group.id === null && filteredProjectGroups.length > 1 && /* @__PURE__ */ jsxs9(
|
|
6032
|
+
Box9,
|
|
5843
6033
|
{
|
|
5844
6034
|
sx: {
|
|
5845
6035
|
py: 2,
|
|
@@ -5849,9 +6039,9 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5849
6039
|
gap: 2
|
|
5850
6040
|
},
|
|
5851
6041
|
children: [
|
|
5852
|
-
/* @__PURE__ */
|
|
5853
|
-
/* @__PURE__ */
|
|
5854
|
-
/* @__PURE__ */
|
|
6042
|
+
/* @__PURE__ */ jsx12(Divider2, { sx: { flex: 1, opacity: 0.6 } }),
|
|
6043
|
+
/* @__PURE__ */ jsxs9(Box9, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
6044
|
+
/* @__PURE__ */ jsx12(
|
|
5855
6045
|
InboxIcon3,
|
|
5856
6046
|
{
|
|
5857
6047
|
size: 14,
|
|
@@ -5859,8 +6049,8 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5859
6049
|
style: { opacity: 0.7 }
|
|
5860
6050
|
}
|
|
5861
6051
|
),
|
|
5862
|
-
/* @__PURE__ */
|
|
5863
|
-
|
|
6052
|
+
/* @__PURE__ */ jsx12(
|
|
6053
|
+
Typography7,
|
|
5864
6054
|
{
|
|
5865
6055
|
variant: "caption",
|
|
5866
6056
|
sx: {
|
|
@@ -5874,12 +6064,12 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5874
6064
|
}
|
|
5875
6065
|
)
|
|
5876
6066
|
] }),
|
|
5877
|
-
/* @__PURE__ */
|
|
6067
|
+
/* @__PURE__ */ jsx12(Divider2, { sx: { flex: 1, opacity: 0.6 } })
|
|
5878
6068
|
]
|
|
5879
6069
|
}
|
|
5880
6070
|
),
|
|
5881
|
-
group.id !== null ? /* @__PURE__ */
|
|
5882
|
-
/* @__PURE__ */
|
|
6071
|
+
group.id !== null ? /* @__PURE__ */ jsxs9(Fragment6, { children: [
|
|
6072
|
+
/* @__PURE__ */ jsx12(
|
|
5883
6073
|
project_header_default,
|
|
5884
6074
|
{
|
|
5885
6075
|
projectId: group.id,
|
|
@@ -5908,8 +6098,8 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5908
6098
|
}
|
|
5909
6099
|
}
|
|
5910
6100
|
),
|
|
5911
|
-
/* @__PURE__ */
|
|
5912
|
-
group.conversations.map((conversation) => /* @__PURE__ */
|
|
6101
|
+
/* @__PURE__ */ jsx12(Collapse2, { in: !group.collapsed, children: /* @__PURE__ */ jsxs9(Box9, { sx: { pb: 1 }, children: [
|
|
6102
|
+
group.conversations.map((conversation) => /* @__PURE__ */ jsx12(
|
|
5913
6103
|
simple_conversation_item_default,
|
|
5914
6104
|
{
|
|
5915
6105
|
conversation,
|
|
@@ -5929,8 +6119,8 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5929
6119
|
},
|
|
5930
6120
|
conversation.id
|
|
5931
6121
|
)),
|
|
5932
|
-
group.conversations.length === 0 && !group.collapsed && group.id !== null && /* @__PURE__ */
|
|
5933
|
-
|
|
6122
|
+
group.conversations.length === 0 && !group.collapsed && group.id !== null && /* @__PURE__ */ jsxs9(
|
|
6123
|
+
Box9,
|
|
5934
6124
|
{
|
|
5935
6125
|
sx: {
|
|
5936
6126
|
p: 3,
|
|
@@ -5938,17 +6128,17 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5938
6128
|
color: theme.palette.text.secondary
|
|
5939
6129
|
},
|
|
5940
6130
|
children: [
|
|
5941
|
-
/* @__PURE__ */
|
|
5942
|
-
/* @__PURE__ */
|
|
6131
|
+
/* @__PURE__ */ jsx12(Typography7, { variant: "body2", children: "No conversations in this project yet" }),
|
|
6132
|
+
/* @__PURE__ */ jsx12(Typography7, { variant: "caption", sx: { mt: 1, display: "block" }, children: "Drag conversations here or use the + button above" })
|
|
5943
6133
|
]
|
|
5944
6134
|
}
|
|
5945
6135
|
)
|
|
5946
6136
|
] }) }),
|
|
5947
|
-
/* @__PURE__ */
|
|
6137
|
+
/* @__PURE__ */ jsx12(Divider2, { sx: { opacity: 0.3 } })
|
|
5948
6138
|
] }) : (
|
|
5949
6139
|
// Special handling for ungrouped - no header, just conversations in scrollable area
|
|
5950
|
-
/* @__PURE__ */
|
|
5951
|
-
|
|
6140
|
+
/* @__PURE__ */ jsx12(
|
|
6141
|
+
Box9,
|
|
5952
6142
|
{
|
|
5953
6143
|
sx: {
|
|
5954
6144
|
minHeight: 0,
|
|
@@ -5956,12 +6146,12 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5956
6146
|
overflow: "auto",
|
|
5957
6147
|
px: 1,
|
|
5958
6148
|
py: 1,
|
|
5959
|
-
bgcolor:
|
|
6149
|
+
bgcolor: alpha6(theme.palette.background.default, 0.3),
|
|
5960
6150
|
borderRadius: "8px 8px 0 0",
|
|
5961
6151
|
mx: 1,
|
|
5962
6152
|
mb: 1
|
|
5963
6153
|
},
|
|
5964
|
-
children: group.conversations.map((conversation) => /* @__PURE__ */
|
|
6154
|
+
children: group.conversations.map((conversation) => /* @__PURE__ */ jsx12(
|
|
5965
6155
|
simple_conversation_item_default,
|
|
5966
6156
|
{
|
|
5967
6157
|
conversation,
|
|
@@ -5985,8 +6175,8 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5985
6175
|
)
|
|
5986
6176
|
)
|
|
5987
6177
|
] }, group.id || "ungrouped")),
|
|
5988
|
-
filteredProjectGroups.length === 0 && /* @__PURE__ */
|
|
5989
|
-
|
|
6178
|
+
filteredProjectGroups.length === 0 && /* @__PURE__ */ jsxs9(
|
|
6179
|
+
Box9,
|
|
5990
6180
|
{
|
|
5991
6181
|
sx: {
|
|
5992
6182
|
flex: 1,
|
|
@@ -5999,28 +6189,28 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5999
6189
|
color: theme.palette.text.secondary
|
|
6000
6190
|
},
|
|
6001
6191
|
children: [
|
|
6002
|
-
/* @__PURE__ */
|
|
6003
|
-
/* @__PURE__ */
|
|
6192
|
+
/* @__PURE__ */ jsx12(Typography7, { variant: "h6", sx: { mb: 1 }, children: searchQuery ? "No conversations found" : "No conversations yet" }),
|
|
6193
|
+
/* @__PURE__ */ jsx12(Typography7, { variant: "body2", sx: { mb: 3, maxWidth: 280 }, children: searchQuery ? `No conversations match "${searchQuery}"` : "Start your first conversation to begin organizing your chats into projects" })
|
|
6004
6194
|
]
|
|
6005
6195
|
}
|
|
6006
6196
|
)
|
|
6007
6197
|
] }),
|
|
6008
|
-
/* @__PURE__ */
|
|
6009
|
-
|
|
6198
|
+
/* @__PURE__ */ jsxs9(
|
|
6199
|
+
Box9,
|
|
6010
6200
|
{
|
|
6011
6201
|
sx: {
|
|
6012
6202
|
mt: "auto",
|
|
6013
6203
|
px: 2,
|
|
6014
6204
|
py: 1.75,
|
|
6015
|
-
borderTop: `1px solid ${
|
|
6205
|
+
borderTop: `1px solid ${alpha6(theme.palette.divider, 0.6)}`,
|
|
6016
6206
|
display: "flex",
|
|
6017
6207
|
alignItems: "center",
|
|
6018
6208
|
gap: 1.5,
|
|
6019
6209
|
justifyContent: "center",
|
|
6020
|
-
bgcolor:
|
|
6210
|
+
bgcolor: alpha6(theme.palette.background.default, isMobile ? 0.9 : 0.6)
|
|
6021
6211
|
},
|
|
6022
6212
|
children: [
|
|
6023
|
-
/* @__PURE__ */
|
|
6213
|
+
/* @__PURE__ */ jsx12(
|
|
6024
6214
|
Avatar6,
|
|
6025
6215
|
{
|
|
6026
6216
|
src: avatarImage,
|
|
@@ -6029,14 +6219,14 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6029
6219
|
width: 36,
|
|
6030
6220
|
height: 36,
|
|
6031
6221
|
fontSize: "0.95rem",
|
|
6032
|
-
bgcolor:
|
|
6222
|
+
bgcolor: alpha6(theme.palette.primary.main, 0.12),
|
|
6033
6223
|
color: theme.palette.primary.main
|
|
6034
6224
|
},
|
|
6035
6225
|
children: avatarInitials
|
|
6036
6226
|
}
|
|
6037
6227
|
),
|
|
6038
|
-
/* @__PURE__ */
|
|
6039
|
-
|
|
6228
|
+
/* @__PURE__ */ jsxs9(
|
|
6229
|
+
Box9,
|
|
6040
6230
|
{
|
|
6041
6231
|
sx: {
|
|
6042
6232
|
minWidth: 0,
|
|
@@ -6048,8 +6238,8 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6048
6238
|
gap: 0.25
|
|
6049
6239
|
},
|
|
6050
6240
|
children: [
|
|
6051
|
-
/* @__PURE__ */
|
|
6052
|
-
|
|
6241
|
+
/* @__PURE__ */ jsx12(
|
|
6242
|
+
Typography7,
|
|
6053
6243
|
{
|
|
6054
6244
|
variant: "subtitle2",
|
|
6055
6245
|
noWrap: true,
|
|
@@ -6057,8 +6247,8 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6057
6247
|
children: user ? userDisplayName : "Not signed in"
|
|
6058
6248
|
}
|
|
6059
6249
|
),
|
|
6060
|
-
!user && /* @__PURE__ */
|
|
6061
|
-
|
|
6250
|
+
!user && /* @__PURE__ */ jsx12(
|
|
6251
|
+
Typography7,
|
|
6062
6252
|
{
|
|
6063
6253
|
variant: "caption",
|
|
6064
6254
|
sx: { color: theme.palette.text.secondary },
|
|
@@ -6074,14 +6264,14 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6074
6264
|
]
|
|
6075
6265
|
}
|
|
6076
6266
|
),
|
|
6077
|
-
/* @__PURE__ */
|
|
6267
|
+
/* @__PURE__ */ jsx12(
|
|
6078
6268
|
project_management_modal_default,
|
|
6079
6269
|
{
|
|
6080
6270
|
open: projectManagementOpen,
|
|
6081
6271
|
onClose: () => setProjectManagementOpen(false)
|
|
6082
6272
|
}
|
|
6083
6273
|
),
|
|
6084
|
-
conversationToMove && /* @__PURE__ */
|
|
6274
|
+
conversationToMove && /* @__PURE__ */ jsx12(
|
|
6085
6275
|
move_conversation_modal_default,
|
|
6086
6276
|
{
|
|
6087
6277
|
open: moveModalOpen,
|
|
@@ -6090,7 +6280,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6090
6280
|
currentProjectId: conversationToMove.projectId
|
|
6091
6281
|
}
|
|
6092
6282
|
),
|
|
6093
|
-
/* @__PURE__ */
|
|
6283
|
+
/* @__PURE__ */ jsx12(
|
|
6094
6284
|
Menu3,
|
|
6095
6285
|
{
|
|
6096
6286
|
anchorEl: menuAnchorEl,
|
|
@@ -6104,7 +6294,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6104
6294
|
vertical: "bottom",
|
|
6105
6295
|
horizontal: "right"
|
|
6106
6296
|
},
|
|
6107
|
-
children: /* @__PURE__ */
|
|
6297
|
+
children: /* @__PURE__ */ jsxs9(
|
|
6108
6298
|
MenuItem3,
|
|
6109
6299
|
{
|
|
6110
6300
|
onClick: () => {
|
|
@@ -6113,14 +6303,14 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6113
6303
|
},
|
|
6114
6304
|
sx: { color: theme.palette.error.main },
|
|
6115
6305
|
children: [
|
|
6116
|
-
/* @__PURE__ */
|
|
6117
|
-
/* @__PURE__ */
|
|
6306
|
+
/* @__PURE__ */ jsx12(ListItemIcon3, { children: /* @__PURE__ */ jsx12(DeleteSweepIcon, { size: 16, color: theme.palette.error.main }) }),
|
|
6307
|
+
/* @__PURE__ */ jsx12(ListItemText3, { children: "Clear All Conversations" })
|
|
6118
6308
|
]
|
|
6119
6309
|
}
|
|
6120
6310
|
)
|
|
6121
6311
|
}
|
|
6122
6312
|
),
|
|
6123
|
-
/* @__PURE__ */
|
|
6313
|
+
/* @__PURE__ */ jsxs9(
|
|
6124
6314
|
Dialog3,
|
|
6125
6315
|
{
|
|
6126
6316
|
open: clearConfirmOpen,
|
|
@@ -6128,12 +6318,12 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6128
6318
|
maxWidth: "sm",
|
|
6129
6319
|
fullWidth: true,
|
|
6130
6320
|
children: [
|
|
6131
|
-
/* @__PURE__ */
|
|
6132
|
-
/* @__PURE__ */
|
|
6133
|
-
/* @__PURE__ */
|
|
6134
|
-
/* @__PURE__ */
|
|
6135
|
-
/* @__PURE__ */
|
|
6136
|
-
|
|
6321
|
+
/* @__PURE__ */ jsx12(DialogTitle3, { children: "Clear All Conversations?" }),
|
|
6322
|
+
/* @__PURE__ */ jsx12(DialogContent3, { children: /* @__PURE__ */ jsx12(Typography7, { children: "This will permanently delete all conversations and cannot be undone. Are you sure you want to continue?" }) }),
|
|
6323
|
+
/* @__PURE__ */ jsxs9(DialogActions3, { children: [
|
|
6324
|
+
/* @__PURE__ */ jsx12(Button5, { onClick: () => setClearConfirmOpen(false), children: "Cancel" }),
|
|
6325
|
+
/* @__PURE__ */ jsx12(
|
|
6326
|
+
Button5,
|
|
6137
6327
|
{
|
|
6138
6328
|
onClick: handleClearAllConfirm,
|
|
6139
6329
|
color: "error",
|
|
@@ -6150,13 +6340,13 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6150
6340
|
var conversation_drawer_default = ConversationDrawer;
|
|
6151
6341
|
|
|
6152
6342
|
// src/chat/enhanced-mobile-conversations-modal.tsx
|
|
6153
|
-
import { useState as
|
|
6343
|
+
import { useState as useState12, useMemo as useMemo2, useEffect as useEffect11, useRef as useRef9, useCallback as useCallback5 } from "react";
|
|
6154
6344
|
import {
|
|
6155
|
-
Box as
|
|
6345
|
+
Box as Box10,
|
|
6156
6346
|
IconButton as IconButton8,
|
|
6157
6347
|
Modal as Modal2,
|
|
6158
|
-
Typography as
|
|
6159
|
-
TextField as
|
|
6348
|
+
Typography as Typography8,
|
|
6349
|
+
TextField as TextField7,
|
|
6160
6350
|
InputAdornment as InputAdornment2,
|
|
6161
6351
|
Slide,
|
|
6162
6352
|
Collapse as Collapse3,
|
|
@@ -6169,15 +6359,15 @@ import {
|
|
|
6169
6359
|
DialogTitle as DialogTitle4,
|
|
6170
6360
|
DialogContent as DialogContent4,
|
|
6171
6361
|
DialogActions as DialogActions4,
|
|
6172
|
-
Button as
|
|
6362
|
+
Button as Button6,
|
|
6173
6363
|
AppBar,
|
|
6174
6364
|
Toolbar,
|
|
6175
6365
|
Avatar as Avatar7,
|
|
6176
|
-
Chip as
|
|
6366
|
+
Chip as Chip4
|
|
6177
6367
|
} from "@mui/material";
|
|
6178
6368
|
import { X as CloseIcon5, X as ClearIcon2, Search as SearchIcon2, Folder as FolderIcon5, MoreVertical as MoreVertIcon4, Trash2 as DeleteSweepIcon2, Inbox as InboxIcon4, Plus as AddIcon5 } from "lucide-react";
|
|
6179
|
-
import { useTheme as
|
|
6180
|
-
import { Fragment as Fragment7, jsx as
|
|
6369
|
+
import { useTheme as useTheme11, alpha as alpha7 } from "@mui/material/styles";
|
|
6370
|
+
import { Fragment as Fragment7, jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
6181
6371
|
var BANDIT_AVATAR2 = "https://cdn.burtson.ai/images/bandit-head.png";
|
|
6182
6372
|
var coerceOptionalString2 = (value) => {
|
|
6183
6373
|
if (typeof value !== "string") return void 0;
|
|
@@ -6208,7 +6398,7 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6208
6398
|
open,
|
|
6209
6399
|
onClose
|
|
6210
6400
|
}) => {
|
|
6211
|
-
const theme =
|
|
6401
|
+
const theme = useTheme11();
|
|
6212
6402
|
const { user } = useAuthenticationStore();
|
|
6213
6403
|
const {
|
|
6214
6404
|
conversations,
|
|
@@ -6228,18 +6418,18 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6228
6418
|
createProject,
|
|
6229
6419
|
deleteProject
|
|
6230
6420
|
} = useProjectStore();
|
|
6231
|
-
const [projectManagementOpen, setProjectManagementOpen] =
|
|
6232
|
-
const [collapsedProjects, setCollapsedProjects] =
|
|
6421
|
+
const [projectManagementOpen, setProjectManagementOpen] = useState12(false);
|
|
6422
|
+
const [collapsedProjects, setCollapsedProjects] = useState12(/* @__PURE__ */ new Set());
|
|
6233
6423
|
const didInitCollapseRef = useRef9(false);
|
|
6234
|
-
const [searchQuery, setSearchQuery] =
|
|
6235
|
-
const [menuAnchorEl, setMenuAnchorEl] =
|
|
6236
|
-
const [clearConfirmOpen, setClearConfirmOpen] =
|
|
6237
|
-
const [moveModalOpen, setMoveModalOpen] =
|
|
6238
|
-
const [conversationToMove, setConversationToMove] =
|
|
6239
|
-
const [renameProjectId, setRenameProjectId] =
|
|
6240
|
-
const [deletedConversationIds, setDeletedConversationIds] =
|
|
6241
|
-
const [touchDragState, setTouchDragState] =
|
|
6242
|
-
const [avatarImage, setAvatarImage] =
|
|
6424
|
+
const [searchQuery, setSearchQuery] = useState12("");
|
|
6425
|
+
const [menuAnchorEl, setMenuAnchorEl] = useState12(null);
|
|
6426
|
+
const [clearConfirmOpen, setClearConfirmOpen] = useState12(false);
|
|
6427
|
+
const [moveModalOpen, setMoveModalOpen] = useState12(false);
|
|
6428
|
+
const [conversationToMove, setConversationToMove] = useState12(null);
|
|
6429
|
+
const [renameProjectId, setRenameProjectId] = useState12(null);
|
|
6430
|
+
const [deletedConversationIds, setDeletedConversationIds] = useState12(/* @__PURE__ */ new Set());
|
|
6431
|
+
const [touchDragState, setTouchDragState] = useState12({ conversationId: null, originProjectId: null, hoverProjectId: null });
|
|
6432
|
+
const [avatarImage, setAvatarImage] = useState12(BANDIT_AVATAR2);
|
|
6243
6433
|
const getCustomClaim = useCallback5((key) => {
|
|
6244
6434
|
if (!user) return void 0;
|
|
6245
6435
|
const record = user;
|
|
@@ -6272,7 +6462,7 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6272
6462
|
}
|
|
6273
6463
|
return void 0;
|
|
6274
6464
|
}, [user, userDisplayName]);
|
|
6275
|
-
|
|
6465
|
+
useEffect11(() => {
|
|
6276
6466
|
const fetchBranding = async () => {
|
|
6277
6467
|
try {
|
|
6278
6468
|
const branding = await brandingService_default.getBranding();
|
|
@@ -6295,12 +6485,12 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6295
6485
|
const end = Math.min(text.length, idx + query.length + 60);
|
|
6296
6486
|
return text.slice(start, end).replace(/\s+/g, " ").trim();
|
|
6297
6487
|
};
|
|
6298
|
-
|
|
6488
|
+
useEffect11(() => {
|
|
6299
6489
|
if (open && !projectsHydrated) {
|
|
6300
6490
|
hydrateProjects();
|
|
6301
6491
|
}
|
|
6302
6492
|
}, [open, projectsHydrated, hydrateProjects]);
|
|
6303
|
-
|
|
6493
|
+
useEffect11(() => {
|
|
6304
6494
|
if (projectsHydrated && !didInitCollapseRef.current) {
|
|
6305
6495
|
didInitCollapseRef.current = true;
|
|
6306
6496
|
if (projects && projects.length > 0) {
|
|
@@ -6467,7 +6657,7 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6467
6657
|
setMoveModalOpen(false);
|
|
6468
6658
|
setConversationToMove(null);
|
|
6469
6659
|
};
|
|
6470
|
-
|
|
6660
|
+
useEffect11(() => {
|
|
6471
6661
|
setDeletedConversationIds((prev) => {
|
|
6472
6662
|
let changed = false;
|
|
6473
6663
|
const active2 = new Set(conversations.map((conv) => conv.id));
|
|
@@ -6482,8 +6672,8 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6482
6672
|
return changed ? next : prev;
|
|
6483
6673
|
});
|
|
6484
6674
|
}, [conversations]);
|
|
6485
|
-
return /* @__PURE__ */
|
|
6486
|
-
/* @__PURE__ */
|
|
6675
|
+
return /* @__PURE__ */ jsxs10(Fragment7, { children: [
|
|
6676
|
+
/* @__PURE__ */ jsx13(
|
|
6487
6677
|
Modal2,
|
|
6488
6678
|
{
|
|
6489
6679
|
open,
|
|
@@ -6492,8 +6682,8 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6492
6682
|
display: "flex",
|
|
6493
6683
|
alignItems: "flex-end"
|
|
6494
6684
|
},
|
|
6495
|
-
children: /* @__PURE__ */
|
|
6496
|
-
|
|
6685
|
+
children: /* @__PURE__ */ jsx13(Slide, { direction: "up", in: open, children: /* @__PURE__ */ jsxs10(
|
|
6686
|
+
Box10,
|
|
6497
6687
|
{
|
|
6498
6688
|
sx: {
|
|
6499
6689
|
width: "100%",
|
|
@@ -6506,7 +6696,7 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6506
6696
|
overflow: "hidden"
|
|
6507
6697
|
},
|
|
6508
6698
|
children: [
|
|
6509
|
-
/* @__PURE__ */
|
|
6699
|
+
/* @__PURE__ */ jsx13(
|
|
6510
6700
|
AppBar,
|
|
6511
6701
|
{
|
|
6512
6702
|
position: "static",
|
|
@@ -6516,10 +6706,10 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6516
6706
|
color: theme.palette.text.primary,
|
|
6517
6707
|
borderBottom: `1px solid ${theme.palette.divider}`
|
|
6518
6708
|
},
|
|
6519
|
-
children: /* @__PURE__ */
|
|
6520
|
-
/* @__PURE__ */
|
|
6521
|
-
visibleConversationCount > 0 && /* @__PURE__ */
|
|
6522
|
-
|
|
6709
|
+
children: /* @__PURE__ */ jsxs10(Toolbar, { children: [
|
|
6710
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "h6", sx: { flex: 1, fontWeight: 600 }, children: "Conversations" }),
|
|
6711
|
+
visibleConversationCount > 0 && /* @__PURE__ */ jsx13(
|
|
6712
|
+
Chip4,
|
|
6523
6713
|
{
|
|
6524
6714
|
label: visibleConversationCount,
|
|
6525
6715
|
size: "small",
|
|
@@ -6531,35 +6721,35 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6531
6721
|
}
|
|
6532
6722
|
}
|
|
6533
6723
|
),
|
|
6534
|
-
/* @__PURE__ */
|
|
6724
|
+
/* @__PURE__ */ jsx13(
|
|
6535
6725
|
IconButton8,
|
|
6536
6726
|
{
|
|
6537
6727
|
onClick: () => setProjectManagementOpen(true),
|
|
6538
6728
|
sx: { color: theme.palette.text.secondary },
|
|
6539
|
-
children: /* @__PURE__ */
|
|
6729
|
+
children: /* @__PURE__ */ jsx13(FolderIcon5, {})
|
|
6540
6730
|
}
|
|
6541
6731
|
),
|
|
6542
|
-
/* @__PURE__ */
|
|
6732
|
+
/* @__PURE__ */ jsx13(
|
|
6543
6733
|
IconButton8,
|
|
6544
6734
|
{
|
|
6545
6735
|
onClick: handleMenuOpen,
|
|
6546
6736
|
sx: { color: theme.palette.text.secondary },
|
|
6547
|
-
children: /* @__PURE__ */
|
|
6737
|
+
children: /* @__PURE__ */ jsx13(MoreVertIcon4, {})
|
|
6548
6738
|
}
|
|
6549
6739
|
),
|
|
6550
|
-
/* @__PURE__ */
|
|
6740
|
+
/* @__PURE__ */ jsx13(
|
|
6551
6741
|
IconButton8,
|
|
6552
6742
|
{
|
|
6553
6743
|
onClick: onClose,
|
|
6554
6744
|
sx: { color: theme.palette.text.secondary },
|
|
6555
|
-
children: /* @__PURE__ */
|
|
6745
|
+
children: /* @__PURE__ */ jsx13(CloseIcon5, {})
|
|
6556
6746
|
}
|
|
6557
6747
|
)
|
|
6558
6748
|
] })
|
|
6559
6749
|
}
|
|
6560
6750
|
),
|
|
6561
|
-
/* @__PURE__ */
|
|
6562
|
-
|
|
6751
|
+
/* @__PURE__ */ jsx13(Box10, { sx: { p: 2, pb: 1 }, children: /* @__PURE__ */ jsx13(
|
|
6752
|
+
TextField7,
|
|
6563
6753
|
{
|
|
6564
6754
|
fullWidth: true,
|
|
6565
6755
|
size: "small",
|
|
@@ -6568,22 +6758,22 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6568
6758
|
onChange: (e) => setSearchQuery(e.target.value),
|
|
6569
6759
|
variant: "outlined",
|
|
6570
6760
|
InputProps: {
|
|
6571
|
-
startAdornment: /* @__PURE__ */
|
|
6572
|
-
endAdornment: searchQuery && /* @__PURE__ */
|
|
6761
|
+
startAdornment: /* @__PURE__ */ jsx13(InputAdornment2, { position: "start", children: /* @__PURE__ */ jsx13(SearchIcon2, { size: 16, color: theme.palette.text.secondary }) }),
|
|
6762
|
+
endAdornment: searchQuery && /* @__PURE__ */ jsx13(InputAdornment2, { position: "end", children: /* @__PURE__ */ jsx13(
|
|
6573
6763
|
IconButton8,
|
|
6574
6764
|
{
|
|
6575
6765
|
onClick: handleSearchClear,
|
|
6576
6766
|
size: "small",
|
|
6577
6767
|
edge: "end",
|
|
6578
6768
|
sx: { color: theme.palette.text.secondary },
|
|
6579
|
-
children: /* @__PURE__ */
|
|
6769
|
+
children: /* @__PURE__ */ jsx13(ClearIcon2, { size: 16 })
|
|
6580
6770
|
}
|
|
6581
6771
|
) })
|
|
6582
6772
|
}
|
|
6583
6773
|
}
|
|
6584
6774
|
) }),
|
|
6585
|
-
/* @__PURE__ */
|
|
6586
|
-
|
|
6775
|
+
/* @__PURE__ */ jsxs10(
|
|
6776
|
+
Box10,
|
|
6587
6777
|
{
|
|
6588
6778
|
sx: {
|
|
6589
6779
|
flex: 1,
|
|
@@ -6594,8 +6784,8 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6594
6784
|
pb: 2
|
|
6595
6785
|
},
|
|
6596
6786
|
children: [
|
|
6597
|
-
touchDragActive && activeDragConversation && /* @__PURE__ */
|
|
6598
|
-
|
|
6787
|
+
touchDragActive && activeDragConversation && /* @__PURE__ */ jsxs10(
|
|
6788
|
+
Box10,
|
|
6599
6789
|
{
|
|
6600
6790
|
sx: {
|
|
6601
6791
|
position: "absolute",
|
|
@@ -6604,13 +6794,13 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6604
6794
|
transform: "translate(-50%, -100%)",
|
|
6605
6795
|
zIndex: theme.zIndex.modal + 10,
|
|
6606
6796
|
pointerEvents: "none",
|
|
6607
|
-
bgcolor: theme.palette.mode === "dark" ?
|
|
6797
|
+
bgcolor: theme.palette.mode === "dark" ? alpha7(theme.palette.common.black, 0.82) : alpha7(theme.palette.common.white, 0.95),
|
|
6608
6798
|
color: theme.palette.mode === "dark" ? theme.palette.common.white : theme.palette.text.primary,
|
|
6609
|
-
border: `1px solid ${theme.palette.mode === "dark" ?
|
|
6799
|
+
border: `1px solid ${theme.palette.mode === "dark" ? alpha7(theme.palette.common.white, 0.25) : alpha7(theme.palette.common.black, 0.2)}`,
|
|
6610
6800
|
borderRadius: 999,
|
|
6611
6801
|
px: 2,
|
|
6612
6802
|
py: 0.75,
|
|
6613
|
-
boxShadow: `0 16px 32px ${
|
|
6803
|
+
boxShadow: `0 16px 32px ${alpha7(theme.palette.common.black, 0.3)}`,
|
|
6614
6804
|
display: "flex",
|
|
6615
6805
|
alignItems: "center",
|
|
6616
6806
|
gap: 1,
|
|
@@ -6620,8 +6810,8 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6620
6810
|
overflow: "hidden"
|
|
6621
6811
|
},
|
|
6622
6812
|
children: [
|
|
6623
|
-
/* @__PURE__ */
|
|
6624
|
-
|
|
6813
|
+
/* @__PURE__ */ jsxs10(
|
|
6814
|
+
Typography8,
|
|
6625
6815
|
{
|
|
6626
6816
|
variant: "caption",
|
|
6627
6817
|
sx: {
|
|
@@ -6633,8 +6823,8 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6633
6823
|
},
|
|
6634
6824
|
children: [
|
|
6635
6825
|
"Move",
|
|
6636
|
-
/* @__PURE__ */
|
|
6637
|
-
|
|
6826
|
+
/* @__PURE__ */ jsxs10(
|
|
6827
|
+
Box10,
|
|
6638
6828
|
{
|
|
6639
6829
|
component: "span",
|
|
6640
6830
|
sx: {
|
|
@@ -6654,8 +6844,8 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6654
6844
|
]
|
|
6655
6845
|
}
|
|
6656
6846
|
),
|
|
6657
|
-
/* @__PURE__ */
|
|
6658
|
-
|
|
6847
|
+
/* @__PURE__ */ jsx13(
|
|
6848
|
+
Typography8,
|
|
6659
6849
|
{
|
|
6660
6850
|
variant: "caption",
|
|
6661
6851
|
color: "inherit",
|
|
@@ -6663,11 +6853,11 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6663
6853
|
fontWeight: 500,
|
|
6664
6854
|
whiteSpace: "nowrap"
|
|
6665
6855
|
},
|
|
6666
|
-
children: activeHoverLabel ? /* @__PURE__ */
|
|
6856
|
+
children: activeHoverLabel ? /* @__PURE__ */ jsxs10(Fragment7, { children: [
|
|
6667
6857
|
"to",
|
|
6668
6858
|
" ",
|
|
6669
|
-
/* @__PURE__ */
|
|
6670
|
-
|
|
6859
|
+
/* @__PURE__ */ jsx13(
|
|
6860
|
+
Box10,
|
|
6671
6861
|
{
|
|
6672
6862
|
component: "span",
|
|
6673
6863
|
sx: {
|
|
@@ -6683,8 +6873,8 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6683
6873
|
]
|
|
6684
6874
|
}
|
|
6685
6875
|
),
|
|
6686
|
-
/* @__PURE__ */
|
|
6687
|
-
|
|
6876
|
+
/* @__PURE__ */ jsxs10(
|
|
6877
|
+
Box10,
|
|
6688
6878
|
{
|
|
6689
6879
|
onClick: async () => {
|
|
6690
6880
|
const names = new Set(projects.map((p) => p.name));
|
|
@@ -6715,41 +6905,41 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6715
6905
|
alignItems: "center",
|
|
6716
6906
|
gap: 1.5,
|
|
6717
6907
|
cursor: "pointer",
|
|
6718
|
-
"&:hover": { bgcolor:
|
|
6908
|
+
"&:hover": { bgcolor: alpha7(theme.palette.text.primary, 0.04) }
|
|
6719
6909
|
},
|
|
6720
6910
|
children: [
|
|
6721
|
-
/* @__PURE__ */
|
|
6722
|
-
|
|
6911
|
+
/* @__PURE__ */ jsx13(
|
|
6912
|
+
Box10,
|
|
6723
6913
|
{
|
|
6724
6914
|
sx: {
|
|
6725
6915
|
width: 28,
|
|
6726
6916
|
height: 28,
|
|
6727
6917
|
borderRadius: "50%",
|
|
6728
|
-
bgcolor:
|
|
6918
|
+
bgcolor: alpha7(theme.palette.success.main, 0.15),
|
|
6729
6919
|
display: "flex",
|
|
6730
6920
|
alignItems: "center",
|
|
6731
6921
|
justifyContent: "center",
|
|
6732
6922
|
flexShrink: 0
|
|
6733
6923
|
},
|
|
6734
|
-
children: /* @__PURE__ */
|
|
6924
|
+
children: /* @__PURE__ */ jsx13(FolderIcon5, { size: 16, color: theme.palette.success.main })
|
|
6735
6925
|
}
|
|
6736
6926
|
),
|
|
6737
|
-
/* @__PURE__ */
|
|
6738
|
-
|
|
6927
|
+
/* @__PURE__ */ jsx13(
|
|
6928
|
+
Typography8,
|
|
6739
6929
|
{
|
|
6740
6930
|
variant: "subtitle2",
|
|
6741
6931
|
sx: { flex: 1, fontWeight: 600, fontSize: "0.875rem" },
|
|
6742
6932
|
children: "New Project"
|
|
6743
6933
|
}
|
|
6744
6934
|
),
|
|
6745
|
-
/* @__PURE__ */
|
|
6935
|
+
/* @__PURE__ */ jsx13(IconButton8, { size: "small", sx: { color: theme.palette.success.main }, children: /* @__PURE__ */ jsx13(AddIcon5, { size: 16 }) })
|
|
6746
6936
|
]
|
|
6747
6937
|
}
|
|
6748
6938
|
),
|
|
6749
|
-
/* @__PURE__ */
|
|
6750
|
-
filteredProjectGroups.map((group, index) => /* @__PURE__ */
|
|
6751
|
-
group.id === null && filteredProjectGroups.length > 1 && /* @__PURE__ */
|
|
6752
|
-
|
|
6939
|
+
/* @__PURE__ */ jsx13(Divider3, { sx: { opacity: 0.3 } }),
|
|
6940
|
+
filteredProjectGroups.map((group, index) => /* @__PURE__ */ jsxs10(Box10, { children: [
|
|
6941
|
+
group.id === null && filteredProjectGroups.length > 1 && /* @__PURE__ */ jsxs10(
|
|
6942
|
+
Box10,
|
|
6753
6943
|
{
|
|
6754
6944
|
sx: {
|
|
6755
6945
|
py: 2,
|
|
@@ -6759,9 +6949,9 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6759
6949
|
gap: 2
|
|
6760
6950
|
},
|
|
6761
6951
|
children: [
|
|
6762
|
-
/* @__PURE__ */
|
|
6763
|
-
/* @__PURE__ */
|
|
6764
|
-
/* @__PURE__ */
|
|
6952
|
+
/* @__PURE__ */ jsx13(Divider3, { sx: { flex: 1, opacity: 0.6 } }),
|
|
6953
|
+
/* @__PURE__ */ jsxs10(Box10, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
6954
|
+
/* @__PURE__ */ jsx13(
|
|
6765
6955
|
InboxIcon4,
|
|
6766
6956
|
{
|
|
6767
6957
|
size: 14,
|
|
@@ -6769,8 +6959,8 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6769
6959
|
style: { opacity: 0.7 }
|
|
6770
6960
|
}
|
|
6771
6961
|
),
|
|
6772
|
-
/* @__PURE__ */
|
|
6773
|
-
|
|
6962
|
+
/* @__PURE__ */ jsx13(
|
|
6963
|
+
Typography8,
|
|
6774
6964
|
{
|
|
6775
6965
|
variant: "caption",
|
|
6776
6966
|
sx: {
|
|
@@ -6784,12 +6974,12 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6784
6974
|
}
|
|
6785
6975
|
)
|
|
6786
6976
|
] }),
|
|
6787
|
-
/* @__PURE__ */
|
|
6977
|
+
/* @__PURE__ */ jsx13(Divider3, { sx: { flex: 1, opacity: 0.6 } })
|
|
6788
6978
|
]
|
|
6789
6979
|
}
|
|
6790
6980
|
),
|
|
6791
|
-
group.id !== null ? /* @__PURE__ */
|
|
6792
|
-
/* @__PURE__ */
|
|
6981
|
+
group.id !== null ? /* @__PURE__ */ jsxs10(Fragment7, { children: [
|
|
6982
|
+
/* @__PURE__ */ jsx13(
|
|
6793
6983
|
project_header_default,
|
|
6794
6984
|
{
|
|
6795
6985
|
projectId: group.id,
|
|
@@ -6819,8 +7009,8 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6819
7009
|
isTouchTarget: touchDragActive && touchDragState.hoverProjectId === group.id
|
|
6820
7010
|
}
|
|
6821
7011
|
),
|
|
6822
|
-
/* @__PURE__ */
|
|
6823
|
-
|
|
7012
|
+
/* @__PURE__ */ jsx13(Collapse3, { in: !group.collapsed, children: /* @__PURE__ */ jsx13(
|
|
7013
|
+
Box10,
|
|
6824
7014
|
{
|
|
6825
7015
|
"data-project-id": group.id ?? "__ungrouped",
|
|
6826
7016
|
sx: {
|
|
@@ -6828,9 +7018,9 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6828
7018
|
border: touchDragActive && touchDragState.hoverProjectId === group.id ? `2px dashed ${theme.palette.primary.main}` : "1px solid transparent",
|
|
6829
7019
|
borderRadius: touchDragActive && touchDragState.hoverProjectId === group.id ? 2 : 0,
|
|
6830
7020
|
transition: "border 0.2s ease, background-color 0.2s ease",
|
|
6831
|
-
backgroundColor: touchDragActive && touchDragState.hoverProjectId === group.id ?
|
|
7021
|
+
backgroundColor: touchDragActive && touchDragState.hoverProjectId === group.id ? alpha7(theme.palette.primary.main, 0.08) : "transparent"
|
|
6832
7022
|
},
|
|
6833
|
-
children: group.conversations.map((conversation) => /* @__PURE__ */
|
|
7023
|
+
children: group.conversations.map((conversation) => /* @__PURE__ */ jsx13(
|
|
6834
7024
|
simple_conversation_item_default,
|
|
6835
7025
|
{
|
|
6836
7026
|
conversation,
|
|
@@ -6864,24 +7054,24 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6864
7054
|
) })
|
|
6865
7055
|
] }) : (
|
|
6866
7056
|
// Special handling for ungrouped - no header, just conversations in scrollable area
|
|
6867
|
-
/* @__PURE__ */
|
|
6868
|
-
|
|
7057
|
+
/* @__PURE__ */ jsx13(
|
|
7058
|
+
Box10,
|
|
6869
7059
|
{
|
|
6870
7060
|
sx: {
|
|
6871
7061
|
minHeight: 0,
|
|
6872
7062
|
overflow: "auto",
|
|
6873
7063
|
px: 1,
|
|
6874
7064
|
py: 1,
|
|
6875
|
-
bgcolor:
|
|
7065
|
+
bgcolor: alpha7(theme.palette.background.default, 0.3),
|
|
6876
7066
|
borderRadius: "8px 8px 0 0",
|
|
6877
7067
|
mx: 1,
|
|
6878
7068
|
mb: 1,
|
|
6879
7069
|
border: touchDragActive && touchDragState.hoverProjectId === "__ungrouped" ? `2px dashed ${theme.palette.primary.main}` : "1px solid transparent",
|
|
6880
7070
|
transition: "border 0.2s ease, background-color 0.2s ease",
|
|
6881
|
-
backgroundColor: touchDragActive && touchDragState.hoverProjectId === "__ungrouped" ?
|
|
7071
|
+
backgroundColor: touchDragActive && touchDragState.hoverProjectId === "__ungrouped" ? alpha7(theme.palette.primary.main, 0.08) : alpha7(theme.palette.background.default, 0.3)
|
|
6882
7072
|
},
|
|
6883
7073
|
"data-project-id": "__ungrouped",
|
|
6884
|
-
children: group.conversations.map((conversation) => /* @__PURE__ */
|
|
7074
|
+
children: group.conversations.map((conversation) => /* @__PURE__ */ jsx13(
|
|
6885
7075
|
simple_conversation_item_default,
|
|
6886
7076
|
{
|
|
6887
7077
|
conversation,
|
|
@@ -6915,8 +7105,8 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6915
7105
|
)
|
|
6916
7106
|
)
|
|
6917
7107
|
] }, group.id || "ungrouped")),
|
|
6918
|
-
filteredProjectGroups.length === 0 && /* @__PURE__ */
|
|
6919
|
-
|
|
7108
|
+
filteredProjectGroups.length === 0 && /* @__PURE__ */ jsxs10(
|
|
7109
|
+
Box10,
|
|
6920
7110
|
{
|
|
6921
7111
|
sx: {
|
|
6922
7112
|
flex: 1,
|
|
@@ -6929,31 +7119,31 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6929
7119
|
color: theme.palette.text.secondary
|
|
6930
7120
|
},
|
|
6931
7121
|
children: [
|
|
6932
|
-
/* @__PURE__ */
|
|
6933
|
-
/* @__PURE__ */
|
|
7122
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "h6", sx: { mb: 1 }, children: searchQuery ? "No conversations found" : "No conversations yet" }),
|
|
7123
|
+
/* @__PURE__ */ jsx13(Typography8, { variant: "body2", sx: { mb: 3, maxWidth: 280 }, children: searchQuery ? `No conversations match "${searchQuery}"` : "Start your first conversation to begin organizing your chats into projects" })
|
|
6934
7124
|
]
|
|
6935
7125
|
}
|
|
6936
7126
|
)
|
|
6937
7127
|
]
|
|
6938
7128
|
}
|
|
6939
7129
|
),
|
|
6940
|
-
/* @__PURE__ */
|
|
6941
|
-
|
|
7130
|
+
/* @__PURE__ */ jsxs10(
|
|
7131
|
+
Box10,
|
|
6942
7132
|
{
|
|
6943
7133
|
sx: {
|
|
6944
7134
|
mt: "auto",
|
|
6945
7135
|
px: 2,
|
|
6946
7136
|
py: 1.75,
|
|
6947
|
-
borderTop: `1px solid ${
|
|
7137
|
+
borderTop: `1px solid ${alpha7(theme.palette.divider, 0.6)}`,
|
|
6948
7138
|
display: "flex",
|
|
6949
7139
|
alignItems: "center",
|
|
6950
7140
|
justifyContent: "center",
|
|
6951
7141
|
gap: 1.25,
|
|
6952
|
-
bgcolor:
|
|
7142
|
+
bgcolor: alpha7(theme.palette.background.default, 0.88),
|
|
6953
7143
|
flexWrap: "wrap"
|
|
6954
7144
|
},
|
|
6955
7145
|
children: [
|
|
6956
|
-
/* @__PURE__ */
|
|
7146
|
+
/* @__PURE__ */ jsx13(
|
|
6957
7147
|
Avatar7,
|
|
6958
7148
|
{
|
|
6959
7149
|
src: avatarImage,
|
|
@@ -6962,15 +7152,15 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6962
7152
|
width: 40,
|
|
6963
7153
|
height: 40,
|
|
6964
7154
|
fontSize: "1rem",
|
|
6965
|
-
bgcolor:
|
|
7155
|
+
bgcolor: alpha7(theme.palette.primary.main, 0.12),
|
|
6966
7156
|
color: theme.palette.primary.main
|
|
6967
7157
|
},
|
|
6968
7158
|
children: avatarInitials
|
|
6969
7159
|
}
|
|
6970
7160
|
),
|
|
6971
|
-
/* @__PURE__ */
|
|
6972
|
-
/* @__PURE__ */
|
|
6973
|
-
|
|
7161
|
+
/* @__PURE__ */ jsxs10(Box10, { sx: { display: "flex", flexDirection: "column", alignItems: "center", gap: 0.5, minWidth: 0 }, children: [
|
|
7162
|
+
/* @__PURE__ */ jsx13(
|
|
7163
|
+
Typography8,
|
|
6974
7164
|
{
|
|
6975
7165
|
variant: "subtitle2",
|
|
6976
7166
|
noWrap: true,
|
|
@@ -6978,8 +7168,8 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6978
7168
|
children: user ? userDisplayName : "Not signed in"
|
|
6979
7169
|
}
|
|
6980
7170
|
),
|
|
6981
|
-
!user && /* @__PURE__ */
|
|
6982
|
-
|
|
7171
|
+
!user && /* @__PURE__ */ jsx13(
|
|
7172
|
+
Typography8,
|
|
6983
7173
|
{
|
|
6984
7174
|
variant: "caption",
|
|
6985
7175
|
sx: { color: theme.palette.text.secondary },
|
|
@@ -6996,14 +7186,14 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6996
7186
|
) })
|
|
6997
7187
|
}
|
|
6998
7188
|
),
|
|
6999
|
-
/* @__PURE__ */
|
|
7189
|
+
/* @__PURE__ */ jsx13(
|
|
7000
7190
|
project_management_modal_default,
|
|
7001
7191
|
{
|
|
7002
7192
|
open: projectManagementOpen,
|
|
7003
7193
|
onClose: () => setProjectManagementOpen(false)
|
|
7004
7194
|
}
|
|
7005
7195
|
),
|
|
7006
|
-
conversationToMove && /* @__PURE__ */
|
|
7196
|
+
conversationToMove && /* @__PURE__ */ jsx13(
|
|
7007
7197
|
move_conversation_modal_default,
|
|
7008
7198
|
{
|
|
7009
7199
|
open: moveModalOpen,
|
|
@@ -7012,7 +7202,7 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7012
7202
|
currentProjectId: conversationToMove.projectId
|
|
7013
7203
|
}
|
|
7014
7204
|
),
|
|
7015
|
-
/* @__PURE__ */
|
|
7205
|
+
/* @__PURE__ */ jsx13(
|
|
7016
7206
|
Menu4,
|
|
7017
7207
|
{
|
|
7018
7208
|
anchorEl: menuAnchorEl,
|
|
@@ -7026,7 +7216,7 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7026
7216
|
vertical: "bottom",
|
|
7027
7217
|
horizontal: "right"
|
|
7028
7218
|
},
|
|
7029
|
-
children: /* @__PURE__ */
|
|
7219
|
+
children: /* @__PURE__ */ jsxs10(
|
|
7030
7220
|
MenuItem4,
|
|
7031
7221
|
{
|
|
7032
7222
|
onClick: () => {
|
|
@@ -7036,14 +7226,14 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7036
7226
|
disabled: visibleConversationCount === 0,
|
|
7037
7227
|
sx: { color: theme.palette.error.main },
|
|
7038
7228
|
children: [
|
|
7039
|
-
/* @__PURE__ */
|
|
7040
|
-
/* @__PURE__ */
|
|
7229
|
+
/* @__PURE__ */ jsx13(ListItemIcon4, { children: /* @__PURE__ */ jsx13(DeleteSweepIcon2, { size: 16, color: theme.palette.error.main }) }),
|
|
7230
|
+
/* @__PURE__ */ jsx13(ListItemText4, { children: "Clear All Conversations" })
|
|
7041
7231
|
]
|
|
7042
7232
|
}
|
|
7043
7233
|
)
|
|
7044
7234
|
}
|
|
7045
7235
|
),
|
|
7046
|
-
/* @__PURE__ */
|
|
7236
|
+
/* @__PURE__ */ jsxs10(
|
|
7047
7237
|
Dialog4,
|
|
7048
7238
|
{
|
|
7049
7239
|
open: clearConfirmOpen,
|
|
@@ -7051,12 +7241,12 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7051
7241
|
maxWidth: "sm",
|
|
7052
7242
|
fullWidth: true,
|
|
7053
7243
|
children: [
|
|
7054
|
-
/* @__PURE__ */
|
|
7055
|
-
/* @__PURE__ */
|
|
7056
|
-
/* @__PURE__ */
|
|
7057
|
-
/* @__PURE__ */
|
|
7058
|
-
/* @__PURE__ */
|
|
7059
|
-
|
|
7244
|
+
/* @__PURE__ */ jsx13(DialogTitle4, { children: "Clear All Conversations?" }),
|
|
7245
|
+
/* @__PURE__ */ jsx13(DialogContent4, { children: /* @__PURE__ */ jsx13(Typography8, { children: visibleConversationCount === 0 ? "No conversations available to clear." : `This will permanently delete ${visibleConversationCount} conversation${visibleConversationCount === 1 ? "" : "s"} and cannot be undone.` }) }),
|
|
7246
|
+
/* @__PURE__ */ jsxs10(DialogActions4, { children: [
|
|
7247
|
+
/* @__PURE__ */ jsx13(Button6, { onClick: () => setClearConfirmOpen(false), children: "Cancel" }),
|
|
7248
|
+
/* @__PURE__ */ jsx13(
|
|
7249
|
+
Button6,
|
|
7060
7250
|
{
|
|
7061
7251
|
onClick: handleClearAllConfirm,
|
|
7062
7252
|
color: "error",
|
|
@@ -7074,7 +7264,7 @@ var enhanced_mobile_conversations_modal_default = EnhancedMobileConversationsMod
|
|
|
7074
7264
|
|
|
7075
7265
|
// src/chat/chat-app-bar.tsx
|
|
7076
7266
|
import { shallow as shallow2 } from "zustand/shallow";
|
|
7077
|
-
import { Fragment as Fragment8, jsx as
|
|
7267
|
+
import { Fragment as Fragment8, jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
7078
7268
|
var CDN_BASE = "https://cdn.burtson.ai/";
|
|
7079
7269
|
var banditHead = `${CDN_BASE}/images/bandit-head.png`;
|
|
7080
7270
|
var modelAvatars = {
|
|
@@ -7093,7 +7283,7 @@ var ChatAppBar = ({
|
|
|
7093
7283
|
drawerOpen,
|
|
7094
7284
|
setDrawerOpen
|
|
7095
7285
|
}) => {
|
|
7096
|
-
const theme =
|
|
7286
|
+
const theme = useTheme12();
|
|
7097
7287
|
const isMobile = useMediaQuery5(theme.breakpoints.down("sm"));
|
|
7098
7288
|
const hasLoggedRouterWarningRef = useRef10(false);
|
|
7099
7289
|
let navigate = null;
|
|
@@ -7121,12 +7311,12 @@ var ChatAppBar = ({
|
|
|
7121
7311
|
menuBackground,
|
|
7122
7312
|
menuText
|
|
7123
7313
|
} = theme.palette.chat.appBar;
|
|
7124
|
-
const [modelAnchorEl, setModelAnchorEl] =
|
|
7125
|
-
const [engineAnchorEl, setEngineAnchorEl] =
|
|
7126
|
-
const [voiceAnchorEl, setVoiceAnchorEl] =
|
|
7127
|
-
const [modalOpen, setModalOpen] =
|
|
7128
|
-
const [confirmModelChangeOpen, setConfirmModelChangeOpen] =
|
|
7129
|
-
const [pendingModel, setPendingModel] =
|
|
7314
|
+
const [modelAnchorEl, setModelAnchorEl] = useState13(null);
|
|
7315
|
+
const [engineAnchorEl, setEngineAnchorEl] = useState13(null);
|
|
7316
|
+
const [voiceAnchorEl, setVoiceAnchorEl] = useState13(null);
|
|
7317
|
+
const [modalOpen, setModalOpen] = useState13(false);
|
|
7318
|
+
const [confirmModelChangeOpen, setConfirmModelChangeOpen] = useState13(false);
|
|
7319
|
+
const [pendingModel, setPendingModel] = useState13(null);
|
|
7130
7320
|
const { conversations, currentId, createNewConversation, _hasHydrated } = useConversationStore();
|
|
7131
7321
|
const { preferences } = usePreferencesStore();
|
|
7132
7322
|
const { settings: packageSettings } = usePackageSettingsStore();
|
|
@@ -7152,7 +7342,7 @@ var ChatAppBar = ({
|
|
|
7152
7342
|
triggerSync: state.runSync,
|
|
7153
7343
|
setSyncEnabled: state.setSyncEnabled
|
|
7154
7344
|
}), shallow2);
|
|
7155
|
-
|
|
7345
|
+
useEffect12(() => {
|
|
7156
7346
|
if (isPlaygroundMode2 && syncEnabled) {
|
|
7157
7347
|
void setSyncEnabled(false).catch((error) => {
|
|
7158
7348
|
debugLogger.warn("ChatAppBar: Failed to disable sync in playground", {
|
|
@@ -7170,16 +7360,16 @@ var ChatAppBar = ({
|
|
|
7170
7360
|
};
|
|
7171
7361
|
const syncIndicatorIcon = (() => {
|
|
7172
7362
|
if (isPlaygroundMode2 || !syncEnabled) {
|
|
7173
|
-
return /* @__PURE__ */
|
|
7363
|
+
return /* @__PURE__ */ jsx14(CloudOffIcon, { fontSize: "small", color: "disabled" });
|
|
7174
7364
|
}
|
|
7175
7365
|
switch (syncStatus) {
|
|
7176
7366
|
case "syncing":
|
|
7177
|
-
return /* @__PURE__ */
|
|
7367
|
+
return /* @__PURE__ */ jsx14(SyncIcon, { fontSize: "small", sx: syncSpinSx, color: "primary" });
|
|
7178
7368
|
case "error":
|
|
7179
|
-
return /* @__PURE__ */
|
|
7369
|
+
return /* @__PURE__ */ jsx14(ErrorOutlineIcon, { fontSize: "small", color: "error" });
|
|
7180
7370
|
case "idle":
|
|
7181
7371
|
default:
|
|
7182
|
-
return /* @__PURE__ */
|
|
7372
|
+
return /* @__PURE__ */ jsx14(CloudDoneIcon, { fontSize: "small", color: "success" });
|
|
7183
7373
|
}
|
|
7184
7374
|
})();
|
|
7185
7375
|
const syncTooltip = (() => {
|
|
@@ -7250,7 +7440,7 @@ var ChatAppBar = ({
|
|
|
7250
7440
|
const resolvedEngineId = currentEngine?.id ?? effectiveEngineId;
|
|
7251
7441
|
const cleanEngineName = (name) => (name || "").replace(/\s*\([^)]*\)\s*$/, "").trim();
|
|
7252
7442
|
const engineDisplay = cleanEngineName(currentEngine?.displayName) || "Engine";
|
|
7253
|
-
|
|
7443
|
+
useEffect12(() => {
|
|
7254
7444
|
useEngineStore.getState().fetchEngines();
|
|
7255
7445
|
}, []);
|
|
7256
7446
|
const pendingModelAvatar = useModelStore.getState().availableModels.find((m) => m.name === pendingModel)?.avatarBase64 || modelAvatars[pendingModel || ""] || banditHead;
|
|
@@ -7285,9 +7475,9 @@ var ChatAppBar = ({
|
|
|
7285
7475
|
}
|
|
7286
7476
|
safeNavigate("/");
|
|
7287
7477
|
}
|
|
7288
|
-
return /* @__PURE__ */
|
|
7289
|
-
/* @__PURE__ */
|
|
7290
|
-
|
|
7478
|
+
return /* @__PURE__ */ jsxs11(Fragment8, { children: [
|
|
7479
|
+
/* @__PURE__ */ jsxs11(
|
|
7480
|
+
Box11,
|
|
7291
7481
|
{
|
|
7292
7482
|
sx: {
|
|
7293
7483
|
position: "fixed",
|
|
@@ -7307,8 +7497,8 @@ var ChatAppBar = ({
|
|
|
7307
7497
|
}
|
|
7308
7498
|
},
|
|
7309
7499
|
children: [
|
|
7310
|
-
/* @__PURE__ */
|
|
7311
|
-
|
|
7500
|
+
/* @__PURE__ */ jsxs11(
|
|
7501
|
+
Box11,
|
|
7312
7502
|
{
|
|
7313
7503
|
sx: {
|
|
7314
7504
|
display: "flex",
|
|
@@ -7328,16 +7518,16 @@ var ChatAppBar = ({
|
|
|
7328
7518
|
}
|
|
7329
7519
|
},
|
|
7330
7520
|
children: [
|
|
7331
|
-
/* @__PURE__ */
|
|
7521
|
+
/* @__PURE__ */ jsx14(Tooltip4, { title: homeTooltip, arrow: true, children: /* @__PURE__ */ jsx14(
|
|
7332
7522
|
IconButton9,
|
|
7333
7523
|
{
|
|
7334
7524
|
onClick: goToHome,
|
|
7335
7525
|
sx: pillButtonStyles,
|
|
7336
7526
|
"aria-label": "Go to home page",
|
|
7337
|
-
children: /* @__PURE__ */
|
|
7527
|
+
children: /* @__PURE__ */ jsx14(HomeIcon, {})
|
|
7338
7528
|
}
|
|
7339
7529
|
) }),
|
|
7340
|
-
showLimitedAdminPanel() && /* @__PURE__ */
|
|
7530
|
+
showLimitedAdminPanel() && /* @__PURE__ */ jsx14(Tooltip4, { title: "Management & Settings", arrow: true, children: /* @__PURE__ */ jsx14(
|
|
7341
7531
|
IconButton9,
|
|
7342
7532
|
{
|
|
7343
7533
|
onClick: () => safeNavigate(managementPath),
|
|
@@ -7349,10 +7539,10 @@ var ChatAppBar = ({
|
|
|
7349
7539
|
}
|
|
7350
7540
|
},
|
|
7351
7541
|
"aria-label": "Open management settings",
|
|
7352
|
-
children: /* @__PURE__ */
|
|
7542
|
+
children: /* @__PURE__ */ jsx14(SettingsIcon, {})
|
|
7353
7543
|
}
|
|
7354
7544
|
) }),
|
|
7355
|
-
/* @__PURE__ */
|
|
7545
|
+
/* @__PURE__ */ jsx14(Tooltip4, { title: syncTooltip, arrow: true, children: /* @__PURE__ */ jsxs11(
|
|
7356
7546
|
IconButton9,
|
|
7357
7547
|
{
|
|
7358
7548
|
onClick: handleSyncBadgeClick,
|
|
@@ -7368,8 +7558,8 @@ var ChatAppBar = ({
|
|
|
7368
7558
|
"aria-label": "Conversation sync status",
|
|
7369
7559
|
children: [
|
|
7370
7560
|
syncIndicatorIcon,
|
|
7371
|
-
pendingCount > 0 && !syncButtonDisabled && syncStatus !== "syncing" && /* @__PURE__ */
|
|
7372
|
-
|
|
7561
|
+
pendingCount > 0 && !syncButtonDisabled && syncStatus !== "syncing" && /* @__PURE__ */ jsx14(
|
|
7562
|
+
Box11,
|
|
7373
7563
|
{
|
|
7374
7564
|
sx: {
|
|
7375
7565
|
position: "absolute",
|
|
@@ -7394,7 +7584,7 @@ var ChatAppBar = ({
|
|
|
7394
7584
|
]
|
|
7395
7585
|
}
|
|
7396
7586
|
) }),
|
|
7397
|
-
!isMobile && /* @__PURE__ */
|
|
7587
|
+
!isMobile && /* @__PURE__ */ jsx14(Tooltip4, { title: `${drawerOpen ? "Close" : "Open"} Conversations`, arrow: true, children: /* @__PURE__ */ jsxs11(
|
|
7398
7588
|
IconButton9,
|
|
7399
7589
|
{
|
|
7400
7590
|
onClick: () => setDrawerOpen(!drawerOpen),
|
|
@@ -7408,9 +7598,9 @@ var ChatAppBar = ({
|
|
|
7408
7598
|
"aria-label": `${drawerOpen ? "Close" : "Open"} conversations drawer`,
|
|
7409
7599
|
"aria-pressed": drawerOpen,
|
|
7410
7600
|
children: [
|
|
7411
|
-
drawerOpen ? /* @__PURE__ */
|
|
7412
|
-
conversations.length > 0 && /* @__PURE__ */
|
|
7413
|
-
|
|
7601
|
+
drawerOpen ? /* @__PURE__ */ jsx14(NotesIcon, {}) : /* @__PURE__ */ jsx14(NotesIconOutlined, {}),
|
|
7602
|
+
conversations.length > 0 && /* @__PURE__ */ jsx14(
|
|
7603
|
+
Box11,
|
|
7414
7604
|
{
|
|
7415
7605
|
sx: {
|
|
7416
7606
|
position: "absolute",
|
|
@@ -7435,7 +7625,7 @@ var ChatAppBar = ({
|
|
|
7435
7625
|
]
|
|
7436
7626
|
}
|
|
7437
7627
|
) }),
|
|
7438
|
-
!isMobile && canShowNewConversationButton && /* @__PURE__ */
|
|
7628
|
+
!isMobile && canShowNewConversationButton && /* @__PURE__ */ jsx14(Tooltip4, { title: "Start New Conversation", arrow: true, children: /* @__PURE__ */ jsx14(
|
|
7439
7629
|
IconButton9,
|
|
7440
7630
|
{
|
|
7441
7631
|
onClick: () => createNewConversation(),
|
|
@@ -7449,14 +7639,14 @@ var ChatAppBar = ({
|
|
|
7449
7639
|
}
|
|
7450
7640
|
},
|
|
7451
7641
|
"aria-label": "Create new conversation",
|
|
7452
|
-
children: /* @__PURE__ */
|
|
7642
|
+
children: /* @__PURE__ */ jsx14(AddIcon, {})
|
|
7453
7643
|
}
|
|
7454
7644
|
) })
|
|
7455
7645
|
]
|
|
7456
7646
|
}
|
|
7457
7647
|
),
|
|
7458
|
-
/* @__PURE__ */
|
|
7459
|
-
|
|
7648
|
+
/* @__PURE__ */ jsxs11(
|
|
7649
|
+
Box11,
|
|
7460
7650
|
{
|
|
7461
7651
|
sx: {
|
|
7462
7652
|
display: "flex",
|
|
@@ -7476,7 +7666,7 @@ var ChatAppBar = ({
|
|
|
7476
7666
|
}
|
|
7477
7667
|
},
|
|
7478
7668
|
children: [
|
|
7479
|
-
isMobile && /* @__PURE__ */
|
|
7669
|
+
isMobile && /* @__PURE__ */ jsx14(Tooltip4, { title: `Conversations (${conversations.length})`, arrow: true, children: /* @__PURE__ */ jsxs11(
|
|
7480
7670
|
IconButton9,
|
|
7481
7671
|
{
|
|
7482
7672
|
onClick: () => setModalOpen(true),
|
|
@@ -7486,9 +7676,9 @@ var ChatAppBar = ({
|
|
|
7486
7676
|
},
|
|
7487
7677
|
"aria-label": `Open conversations modal with ${conversations.length} conversations`,
|
|
7488
7678
|
children: [
|
|
7489
|
-
/* @__PURE__ */
|
|
7490
|
-
conversations.length > 0 && /* @__PURE__ */
|
|
7491
|
-
|
|
7679
|
+
/* @__PURE__ */ jsx14(NotesIcon, { fontSize: "small" }),
|
|
7680
|
+
conversations.length > 0 && /* @__PURE__ */ jsx14(
|
|
7681
|
+
Box11,
|
|
7492
7682
|
{
|
|
7493
7683
|
sx: {
|
|
7494
7684
|
position: "absolute",
|
|
@@ -7513,7 +7703,7 @@ var ChatAppBar = ({
|
|
|
7513
7703
|
]
|
|
7514
7704
|
}
|
|
7515
7705
|
) }),
|
|
7516
|
-
isMobile && canShowNewConversationButton && /* @__PURE__ */
|
|
7706
|
+
isMobile && canShowNewConversationButton && /* @__PURE__ */ jsx14(Tooltip4, { title: "Start New Conversation", arrow: true, children: /* @__PURE__ */ jsx14(
|
|
7517
7707
|
IconButton9,
|
|
7518
7708
|
{
|
|
7519
7709
|
onClick: () => {
|
|
@@ -7530,10 +7720,10 @@ var ChatAppBar = ({
|
|
|
7530
7720
|
}
|
|
7531
7721
|
},
|
|
7532
7722
|
"aria-label": "Create new conversation",
|
|
7533
|
-
children: /* @__PURE__ */
|
|
7723
|
+
children: /* @__PURE__ */ jsx14(AddIcon, { fontSize: "small" })
|
|
7534
7724
|
}
|
|
7535
7725
|
) }),
|
|
7536
|
-
/* @__PURE__ */
|
|
7726
|
+
/* @__PURE__ */ jsx14(Tooltip4, { title: `Current AI: ${selectedModel.replace("Bandit-", "")}`, arrow: true, children: /* @__PURE__ */ jsx14(
|
|
7537
7727
|
IconButton9,
|
|
7538
7728
|
{
|
|
7539
7729
|
onClick: (e) => setModelAnchorEl(e.currentTarget),
|
|
@@ -7548,7 +7738,7 @@ var ChatAppBar = ({
|
|
|
7548
7738
|
}
|
|
7549
7739
|
},
|
|
7550
7740
|
"aria-label": `Change AI personality. Currently using ${selectedModel}`,
|
|
7551
|
-
children: /* @__PURE__ */
|
|
7741
|
+
children: /* @__PURE__ */ jsx14(
|
|
7552
7742
|
Avatar8,
|
|
7553
7743
|
{
|
|
7554
7744
|
src: currentAvatar,
|
|
@@ -7565,16 +7755,16 @@ var ChatAppBar = ({
|
|
|
7565
7755
|
)
|
|
7566
7756
|
}
|
|
7567
7757
|
) }),
|
|
7568
|
-
/* @__PURE__ */
|
|
7758
|
+
/* @__PURE__ */ jsx14(Tooltip4, { title: `Engine \xB7 ${engineDisplay}`, arrow: true, children: /* @__PURE__ */ jsx14(
|
|
7569
7759
|
IconButton9,
|
|
7570
7760
|
{
|
|
7571
7761
|
onClick: (e) => setEngineAnchorEl(e.currentTarget),
|
|
7572
7762
|
sx: pillButtonStyles,
|
|
7573
7763
|
"aria-label": `Change base model (engine). Currently ${engineDisplay}`,
|
|
7574
|
-
children: /* @__PURE__ */
|
|
7764
|
+
children: /* @__PURE__ */ jsx14(AutoAwesomeIcon, { fontSize: "small" })
|
|
7575
7765
|
}
|
|
7576
7766
|
) }),
|
|
7577
|
-
/* @__PURE__ */
|
|
7767
|
+
/* @__PURE__ */ jsxs11(
|
|
7578
7768
|
Menu5,
|
|
7579
7769
|
{
|
|
7580
7770
|
anchorEl: engineAnchorEl,
|
|
@@ -7583,8 +7773,8 @@ var ChatAppBar = ({
|
|
|
7583
7773
|
transformOrigin: { horizontal: "right", vertical: "top" },
|
|
7584
7774
|
anchorOrigin: { horizontal: "right", vertical: "bottom" },
|
|
7585
7775
|
children: [
|
|
7586
|
-
/* @__PURE__ */
|
|
7587
|
-
engines.length === 0 && /* @__PURE__ */
|
|
7776
|
+
/* @__PURE__ */ jsx14(Typography9, { variant: "overline", sx: { px: 2, color: theme.palette.text.secondary }, children: "Engine \xB7 base model" }),
|
|
7777
|
+
engines.length === 0 && /* @__PURE__ */ jsx14(MenuItem5, { disabled: true, children: /* @__PURE__ */ jsx14(Typography9, { variant: "body2", children: "No engines available" }) }),
|
|
7588
7778
|
engines.map((engine) => {
|
|
7589
7779
|
const badges = [
|
|
7590
7780
|
engine.vision && "vision",
|
|
@@ -7592,7 +7782,7 @@ var ChatAppBar = ({
|
|
|
7592
7782
|
engine.thinking && "thinking",
|
|
7593
7783
|
engine.cloud && "cloud"
|
|
7594
7784
|
].filter(Boolean);
|
|
7595
|
-
return /* @__PURE__ */
|
|
7785
|
+
return /* @__PURE__ */ jsxs11(
|
|
7596
7786
|
MenuItem5,
|
|
7597
7787
|
{
|
|
7598
7788
|
selected: engine.id === resolvedEngineId,
|
|
@@ -7612,13 +7802,13 @@ var ChatAppBar = ({
|
|
|
7612
7802
|
whiteSpace: "normal"
|
|
7613
7803
|
},
|
|
7614
7804
|
children: [
|
|
7615
|
-
/* @__PURE__ */
|
|
7616
|
-
/* @__PURE__ */
|
|
7617
|
-
engine.id === resolvedEngineId && /* @__PURE__ */
|
|
7805
|
+
/* @__PURE__ */ jsxs11(Box11, { sx: { display: "flex", alignItems: "center", gap: 1, width: "100%" }, children: [
|
|
7806
|
+
/* @__PURE__ */ jsx14(Typography9, { variant: "body2", sx: { fontWeight: 600, flex: 1 }, children: cleanEngineName(engine.displayName) }),
|
|
7807
|
+
engine.id === resolvedEngineId && /* @__PURE__ */ jsx14(Box11, { sx: { width: 8, height: 8, borderRadius: "50%", bgcolor: theme.palette.primary.main } })
|
|
7618
7808
|
] }),
|
|
7619
|
-
/* @__PURE__ */
|
|
7620
|
-
badges.length > 0 && /* @__PURE__ */
|
|
7621
|
-
|
|
7809
|
+
/* @__PURE__ */ jsx14(Typography9, { variant: "caption", sx: { color: theme.palette.text.secondary }, children: engine.available ? engine.description : engine.unavailableReason || "Unavailable" }),
|
|
7810
|
+
badges.length > 0 && /* @__PURE__ */ jsx14(Box11, { sx: { display: "flex", gap: 0.5, flexWrap: "wrap", mt: 0.25 }, children: badges.map((b) => /* @__PURE__ */ jsx14(
|
|
7811
|
+
Box11,
|
|
7622
7812
|
{
|
|
7623
7813
|
sx: {
|
|
7624
7814
|
fontSize: "0.65rem",
|
|
@@ -7640,7 +7830,7 @@ var ChatAppBar = ({
|
|
|
7640
7830
|
]
|
|
7641
7831
|
}
|
|
7642
7832
|
),
|
|
7643
|
-
/* @__PURE__ */
|
|
7833
|
+
/* @__PURE__ */ jsx14(
|
|
7644
7834
|
Menu5,
|
|
7645
7835
|
{
|
|
7646
7836
|
anchorEl: modelAnchorEl,
|
|
@@ -7676,7 +7866,7 @@ var ChatAppBar = ({
|
|
|
7676
7866
|
}
|
|
7677
7867
|
}
|
|
7678
7868
|
},
|
|
7679
|
-
children: availableModels.map((model) => /* @__PURE__ */
|
|
7869
|
+
children: availableModels.map((model) => /* @__PURE__ */ jsxs11(
|
|
7680
7870
|
MenuItem5,
|
|
7681
7871
|
{
|
|
7682
7872
|
selected: model.name === selectedModel,
|
|
@@ -7723,7 +7913,7 @@ var ChatAppBar = ({
|
|
|
7723
7913
|
px: 2
|
|
7724
7914
|
},
|
|
7725
7915
|
children: [
|
|
7726
|
-
/* @__PURE__ */
|
|
7916
|
+
/* @__PURE__ */ jsx14(
|
|
7727
7917
|
Avatar8,
|
|
7728
7918
|
{
|
|
7729
7919
|
src: model.avatarBase64 || modelAvatars[model.name] || banditHead,
|
|
@@ -7736,12 +7926,12 @@ var ChatAppBar = ({
|
|
|
7736
7926
|
}
|
|
7737
7927
|
}
|
|
7738
7928
|
),
|
|
7739
|
-
/* @__PURE__ */
|
|
7740
|
-
/* @__PURE__ */
|
|
7741
|
-
/* @__PURE__ */
|
|
7929
|
+
/* @__PURE__ */ jsxs11(Box11, { sx: { flex: 1 }, children: [
|
|
7930
|
+
/* @__PURE__ */ jsx14(Typography9, { variant: "body2", sx: { fontWeight: 500 }, children: model.name.replace("Bandit-", "") }),
|
|
7931
|
+
/* @__PURE__ */ jsx14(Typography9, { variant: "caption", sx: { color: theme.palette.text.secondary, display: "block" }, children: model.name === selectedModel ? "Currently active" : "Switch to this AI" })
|
|
7742
7932
|
] }),
|
|
7743
|
-
model.name === selectedModel && /* @__PURE__ */
|
|
7744
|
-
|
|
7933
|
+
model.name === selectedModel && /* @__PURE__ */ jsx14(
|
|
7934
|
+
Box11,
|
|
7745
7935
|
{
|
|
7746
7936
|
sx: {
|
|
7747
7937
|
width: 8,
|
|
@@ -7757,8 +7947,8 @@ var ChatAppBar = ({
|
|
|
7757
7947
|
))
|
|
7758
7948
|
}
|
|
7759
7949
|
),
|
|
7760
|
-
isTTSAvailable && /* @__PURE__ */
|
|
7761
|
-
/* @__PURE__ */
|
|
7950
|
+
isTTSAvailable && /* @__PURE__ */ jsxs11(Fragment8, { children: [
|
|
7951
|
+
/* @__PURE__ */ jsx14(Tooltip4, { title: `Voice: ${selectedVoice ? toTitleCase(selectedVoice.split("-")[1]) : "Default"}`, arrow: true, children: /* @__PURE__ */ jsx14(
|
|
7762
7952
|
IconButton9,
|
|
7763
7953
|
{
|
|
7764
7954
|
onClick: (e) => setVoiceAnchorEl(e.currentTarget),
|
|
@@ -7772,10 +7962,10 @@ var ChatAppBar = ({
|
|
|
7772
7962
|
}
|
|
7773
7963
|
},
|
|
7774
7964
|
"aria-label": `Change voice. Currently using ${selectedVoice ? toTitleCase(selectedVoice.split("-")[1]) : "default"}`,
|
|
7775
|
-
children: /* @__PURE__ */
|
|
7965
|
+
children: /* @__PURE__ */ jsx14(RecordVoiceOverIcon, { fontSize: "small" })
|
|
7776
7966
|
}
|
|
7777
7967
|
) }),
|
|
7778
|
-
/* @__PURE__ */
|
|
7968
|
+
/* @__PURE__ */ jsx14(
|
|
7779
7969
|
Menu5,
|
|
7780
7970
|
{
|
|
7781
7971
|
anchorEl: voiceAnchorEl,
|
|
@@ -7812,7 +8002,7 @@ var ChatAppBar = ({
|
|
|
7812
8002
|
}
|
|
7813
8003
|
}
|
|
7814
8004
|
},
|
|
7815
|
-
children: availableVoices.length > 0 ? availableVoices.map((voice) => /* @__PURE__ */
|
|
8005
|
+
children: availableVoices.length > 0 ? availableVoices.map((voice) => /* @__PURE__ */ jsx14(
|
|
7816
8006
|
MenuItem5,
|
|
7817
8007
|
{
|
|
7818
8008
|
selected: voice === selectedVoice,
|
|
@@ -7820,14 +8010,14 @@ var ChatAppBar = ({
|
|
|
7820
8010
|
handleVoiceChange(voice);
|
|
7821
8011
|
setVoiceAnchorEl(null);
|
|
7822
8012
|
},
|
|
7823
|
-
children: /* @__PURE__ */
|
|
7824
|
-
/* @__PURE__ */
|
|
7825
|
-
/* @__PURE__ */
|
|
7826
|
-
/* @__PURE__ */
|
|
7827
|
-
/* @__PURE__ */
|
|
8013
|
+
children: /* @__PURE__ */ jsxs11(Box11, { sx: { display: "flex", alignItems: "center", gap: 1, width: "100%" }, children: [
|
|
8014
|
+
/* @__PURE__ */ jsx14(RecordVoiceOverIcon, { fontSize: "small", sx: { color: theme.palette.text.secondary } }),
|
|
8015
|
+
/* @__PURE__ */ jsxs11(Box11, { sx: { flex: 1 }, children: [
|
|
8016
|
+
/* @__PURE__ */ jsx14(Typography9, { variant: "body2", children: toTitleCase(voice.split("-")[1]) }),
|
|
8017
|
+
/* @__PURE__ */ jsx14(Typography9, { variant: "caption", sx: { color: theme.palette.text.secondary }, children: voice === selectedVoice ? "Currently active" : "Switch to this voice" })
|
|
7828
8018
|
] }),
|
|
7829
|
-
voice === selectedVoice && /* @__PURE__ */
|
|
7830
|
-
|
|
8019
|
+
voice === selectedVoice && /* @__PURE__ */ jsx14(
|
|
8020
|
+
Box11,
|
|
7831
8021
|
{
|
|
7832
8022
|
sx: {
|
|
7833
8023
|
width: 8,
|
|
@@ -7840,7 +8030,7 @@ var ChatAppBar = ({
|
|
|
7840
8030
|
] })
|
|
7841
8031
|
},
|
|
7842
8032
|
voice
|
|
7843
|
-
)) : /* @__PURE__ */
|
|
8033
|
+
)) : /* @__PURE__ */ jsx14(MenuItem5, { disabled: true, children: /* @__PURE__ */ jsx14(Typography9, { variant: "body2", color: "text.secondary", children: "No voices available" }) })
|
|
7844
8034
|
}
|
|
7845
8035
|
)
|
|
7846
8036
|
] })
|
|
@@ -7850,17 +8040,17 @@ var ChatAppBar = ({
|
|
|
7850
8040
|
]
|
|
7851
8041
|
}
|
|
7852
8042
|
),
|
|
7853
|
-
/* @__PURE__ */
|
|
7854
|
-
/* @__PURE__ */
|
|
7855
|
-
/* @__PURE__ */
|
|
8043
|
+
/* @__PURE__ */ jsx14(conversation_drawer_default, { open: drawerOpen, onClose: () => setDrawerOpen(false) }),
|
|
8044
|
+
/* @__PURE__ */ jsx14(enhanced_mobile_conversations_modal_default, { open: modalOpen, onClose: () => setModalOpen(false) }),
|
|
8045
|
+
/* @__PURE__ */ jsxs11(
|
|
7856
8046
|
Dialog5,
|
|
7857
8047
|
{
|
|
7858
8048
|
open: confirmModelChangeOpen,
|
|
7859
8049
|
onClose: () => setConfirmModelChangeOpen(false),
|
|
7860
8050
|
children: [
|
|
7861
|
-
/* @__PURE__ */
|
|
7862
|
-
/* @__PURE__ */
|
|
7863
|
-
/* @__PURE__ */
|
|
8051
|
+
/* @__PURE__ */ jsx14(DialogTitle5, { children: "Change personality and start new conversation?" }),
|
|
8052
|
+
/* @__PURE__ */ jsx14(DialogContent5, { children: /* @__PURE__ */ jsxs11(Box11, { display: "flex", alignItems: "center", gap: 2, mt: 1, justifyContent: "center", children: [
|
|
8053
|
+
/* @__PURE__ */ jsx14(
|
|
7864
8054
|
Avatar8,
|
|
7865
8055
|
{
|
|
7866
8056
|
src: pendingModelAvatar,
|
|
@@ -7868,16 +8058,16 @@ var ChatAppBar = ({
|
|
|
7868
8058
|
sx: { width: 40, height: 40, filter: "brightness(1.7)" }
|
|
7869
8059
|
}
|
|
7870
8060
|
),
|
|
7871
|
-
/* @__PURE__ */
|
|
8061
|
+
/* @__PURE__ */ jsxs11(Typography9, { variant: "body2", children: [
|
|
7872
8062
|
"Your current conversation will be saved, and a new one will begin with ",
|
|
7873
|
-
/* @__PURE__ */
|
|
8063
|
+
/* @__PURE__ */ jsx14("strong", { children: pendingModel }),
|
|
7874
8064
|
"."
|
|
7875
8065
|
] })
|
|
7876
8066
|
] }) }),
|
|
7877
|
-
/* @__PURE__ */
|
|
7878
|
-
/* @__PURE__ */
|
|
7879
|
-
/* @__PURE__ */
|
|
7880
|
-
|
|
8067
|
+
/* @__PURE__ */ jsxs11(DialogActions5, { children: [
|
|
8068
|
+
/* @__PURE__ */ jsx14(Button7, { onClick: () => setConfirmModelChangeOpen(false), children: "Cancel" }),
|
|
8069
|
+
/* @__PURE__ */ jsx14(
|
|
8070
|
+
Button7,
|
|
7881
8071
|
{
|
|
7882
8072
|
onClick: () => {
|
|
7883
8073
|
if (pendingModel) {
|
|
@@ -7979,19 +8169,19 @@ Respond with just the title and nothing else.
|
|
|
7979
8169
|
};
|
|
7980
8170
|
|
|
7981
8171
|
// src/chat/query-suggestion-picker.tsx
|
|
7982
|
-
import { useEffect as
|
|
7983
|
-
import { Box as
|
|
7984
|
-
import { useTheme as
|
|
8172
|
+
import { useEffect as useEffect13, useRef as useRef11, useState as useState14 } from "react";
|
|
8173
|
+
import { Box as Box12, useMediaQuery as useMediaQuery6 } from "@mui/material";
|
|
8174
|
+
import { useTheme as useTheme13, alpha as alpha8 } from "@mui/material/styles";
|
|
7985
8175
|
import ReactMarkdown from "react-markdown";
|
|
7986
8176
|
import remarkGfm from "remark-gfm";
|
|
7987
8177
|
import rehypeRaw from "rehype-raw";
|
|
7988
|
-
import { Fragment as Fragment9, jsx as
|
|
8178
|
+
import { Fragment as Fragment9, jsx as jsx15 } from "react/jsx-runtime";
|
|
7989
8179
|
var markdownComponents = {
|
|
7990
|
-
p: ({ node, ...props }) => /* @__PURE__ */
|
|
7991
|
-
mark: ({ node, children, ...props }) => /* @__PURE__ */
|
|
8180
|
+
p: ({ node, ...props }) => /* @__PURE__ */ jsx15("span", { ...props }),
|
|
8181
|
+
mark: ({ node, children, ...props }) => /* @__PURE__ */ jsx15("mark", { ...props, children }),
|
|
7992
8182
|
code: ({ node, children, ...props }) => {
|
|
7993
8183
|
const { inline, ...rest } = props;
|
|
7994
|
-
return inline ? /* @__PURE__ */
|
|
8184
|
+
return inline ? /* @__PURE__ */ jsx15("code", { ...rest, children }) : /* @__PURE__ */ jsx15("code", { ...rest, children });
|
|
7995
8185
|
}
|
|
7996
8186
|
};
|
|
7997
8187
|
var QuerySuggestionPicker = ({
|
|
@@ -7999,15 +8189,15 @@ var QuerySuggestionPicker = ({
|
|
|
7999
8189
|
inputHeight
|
|
8000
8190
|
}) => {
|
|
8001
8191
|
const hasGenerated = useRef11(false);
|
|
8002
|
-
const [hasSentPrompt, setHasSentPrompt] =
|
|
8003
|
-
const [examplePrompts, setExamplePrompts] =
|
|
8004
|
-
const [visiblePrompts, setVisiblePrompts] =
|
|
8192
|
+
const [hasSentPrompt, setHasSentPrompt] = useState14(false);
|
|
8193
|
+
const [examplePrompts, setExamplePrompts] = useState14([]);
|
|
8194
|
+
const [visiblePrompts, setVisiblePrompts] = useState14([]);
|
|
8005
8195
|
const scrollRef = useRef11(null);
|
|
8006
|
-
const theme =
|
|
8196
|
+
const theme = useTheme13();
|
|
8007
8197
|
const isMobile = useMediaQuery6((theme2) => theme2.breakpoints.down("sm"));
|
|
8008
8198
|
const { background, text, border, hoverBackground, hoverBorder } = theme.palette.chat.suggestion;
|
|
8009
8199
|
const { getCurrentModel, isLoading } = useModelStore();
|
|
8010
|
-
|
|
8200
|
+
useEffect13(() => {
|
|
8011
8201
|
if (hasGenerated.current || isLoading) return;
|
|
8012
8202
|
hasGenerated.current = true;
|
|
8013
8203
|
const currentModel = getCurrentModel();
|
|
@@ -8040,12 +8230,12 @@ var QuerySuggestionPicker = ({
|
|
|
8040
8230
|
hasGenerated.current = false;
|
|
8041
8231
|
});
|
|
8042
8232
|
}, [getCurrentModel, isLoading]);
|
|
8043
|
-
|
|
8233
|
+
useEffect13(() => {
|
|
8044
8234
|
if (!isLoading) {
|
|
8045
8235
|
hasGenerated.current = false;
|
|
8046
8236
|
}
|
|
8047
8237
|
}, [isLoading]);
|
|
8048
|
-
|
|
8238
|
+
useEffect13(() => {
|
|
8049
8239
|
if (hasSentPrompt || examplePrompts.length === 0) return;
|
|
8050
8240
|
const interval = setInterval(() => {
|
|
8051
8241
|
setExamplePrompts((prev) => {
|
|
@@ -8064,8 +8254,8 @@ var QuerySuggestionPicker = ({
|
|
|
8064
8254
|
return () => clearInterval(interval);
|
|
8065
8255
|
}, [hasSentPrompt, examplePrompts.length]);
|
|
8066
8256
|
const displayPrompts = isMobile ? visiblePrompts.slice(0, Math.min(visiblePrompts.length, 6)) : visiblePrompts;
|
|
8067
|
-
return displayPrompts.length > 0 && /* @__PURE__ */
|
|
8068
|
-
|
|
8257
|
+
return displayPrompts.length > 0 && /* @__PURE__ */ jsx15(Fragment9, { children: /* @__PURE__ */ jsx15(
|
|
8258
|
+
Box12,
|
|
8069
8259
|
{
|
|
8070
8260
|
ref: scrollRef,
|
|
8071
8261
|
sx: {
|
|
@@ -8081,8 +8271,8 @@ var QuerySuggestionPicker = ({
|
|
|
8081
8271
|
pb: isMobile ? 0.4 : 0,
|
|
8082
8272
|
"&::-webkit-scrollbar": { display: "none" }
|
|
8083
8273
|
},
|
|
8084
|
-
children: displayPrompts.map((prompt, i) => /* @__PURE__ */
|
|
8085
|
-
|
|
8274
|
+
children: displayPrompts.map((prompt, i) => /* @__PURE__ */ jsx15(
|
|
8275
|
+
Box12,
|
|
8086
8276
|
{
|
|
8087
8277
|
sx: {
|
|
8088
8278
|
px: isMobile ? 1.4 : 2,
|
|
@@ -8098,7 +8288,7 @@ var QuerySuggestionPicker = ({
|
|
|
8098
8288
|
color: text,
|
|
8099
8289
|
userSelect: "none",
|
|
8100
8290
|
cursor: "pointer",
|
|
8101
|
-
border: `1px solid ${border ||
|
|
8291
|
+
border: `1px solid ${border || alpha8(text, 0.12)}`,
|
|
8102
8292
|
boxShadow: theme.palette.mode === "dark" ? "0 4px 18px rgba(0,0,0,0.25)" : "0 6px 20px rgba(15,23,42,0.12)",
|
|
8103
8293
|
scrollSnapAlign: isMobile ? "start" : "none",
|
|
8104
8294
|
transition: "transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease",
|
|
@@ -8116,8 +8306,8 @@ var QuerySuggestionPicker = ({
|
|
|
8116
8306
|
onSend(prompt, []);
|
|
8117
8307
|
setHasSentPrompt(true);
|
|
8118
8308
|
},
|
|
8119
|
-
children: /* @__PURE__ */
|
|
8120
|
-
|
|
8309
|
+
children: /* @__PURE__ */ jsx15(
|
|
8310
|
+
Box12,
|
|
8121
8311
|
{
|
|
8122
8312
|
sx: {
|
|
8123
8313
|
flex: 1,
|
|
@@ -8129,19 +8319,19 @@ var QuerySuggestionPicker = ({
|
|
|
8129
8319
|
borderRadius: 4,
|
|
8130
8320
|
fontSize: "0.92em",
|
|
8131
8321
|
fontFamily: "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace",
|
|
8132
|
-
backgroundColor: theme.palette.mode === "dark" ?
|
|
8133
|
-
border: `1px solid ${
|
|
8322
|
+
backgroundColor: theme.palette.mode === "dark" ? alpha8(theme.palette.common.white, 0.06) : alpha8(theme.palette.text.primary, 0.06),
|
|
8323
|
+
border: `1px solid ${alpha8(theme.palette.text.primary, 0.15)}`,
|
|
8134
8324
|
padding: "0.15em 0.35em"
|
|
8135
8325
|
},
|
|
8136
8326
|
"& mark": {
|
|
8137
8327
|
display: "inline-block",
|
|
8138
|
-
backgroundColor: theme.palette.mode === "dark" ?
|
|
8328
|
+
backgroundColor: theme.palette.mode === "dark" ? alpha8(theme.palette.common.white, 0.06) : alpha8(theme.palette.text.primary, 0.12),
|
|
8139
8329
|
color: theme.palette.mode === "dark" ? theme.palette.common.white : theme.palette.text.primary,
|
|
8140
8330
|
borderRadius: 4,
|
|
8141
8331
|
padding: "0.1em 0.25em"
|
|
8142
8332
|
}
|
|
8143
8333
|
},
|
|
8144
|
-
children: /* @__PURE__ */
|
|
8334
|
+
children: /* @__PURE__ */ jsx15(
|
|
8145
8335
|
ReactMarkdown,
|
|
8146
8336
|
{
|
|
8147
8337
|
remarkPlugins: [remarkGfm],
|
|
@@ -8160,18 +8350,18 @@ var QuerySuggestionPicker = ({
|
|
|
8160
8350
|
};
|
|
8161
8351
|
|
|
8162
8352
|
// ../../src/pages/under-review.tsx
|
|
8163
|
-
import { Box as
|
|
8353
|
+
import { Box as Box13, Typography as Typography10, useTheme as useTheme14 } from "@mui/material";
|
|
8164
8354
|
import { useNavigate as useNavigate2 } from "react-router-dom";
|
|
8165
|
-
import { jsx as
|
|
8355
|
+
import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
8166
8356
|
var UnderReview = () => {
|
|
8167
|
-
const theme =
|
|
8357
|
+
const theme = useTheme14();
|
|
8168
8358
|
const navigate = useNavigate2();
|
|
8169
8359
|
const handleSneakyLogout = () => {
|
|
8170
8360
|
localStorage.removeItem("authToken");
|
|
8171
8361
|
navigate("/login");
|
|
8172
8362
|
};
|
|
8173
|
-
return /* @__PURE__ */
|
|
8174
|
-
|
|
8363
|
+
return /* @__PURE__ */ jsxs12(
|
|
8364
|
+
Box13,
|
|
8175
8365
|
{
|
|
8176
8366
|
sx: {
|
|
8177
8367
|
minHeight: "100vh",
|
|
@@ -8186,8 +8376,8 @@ var UnderReview = () => {
|
|
|
8186
8376
|
position: "relative"
|
|
8187
8377
|
},
|
|
8188
8378
|
children: [
|
|
8189
|
-
/* @__PURE__ */
|
|
8190
|
-
|
|
8379
|
+
/* @__PURE__ */ jsx16(
|
|
8380
|
+
Box13,
|
|
8191
8381
|
{
|
|
8192
8382
|
onClick: handleSneakyLogout,
|
|
8193
8383
|
sx: {
|
|
@@ -8212,13 +8402,13 @@ var UnderReview = () => {
|
|
|
8212
8402
|
title: "Reset session"
|
|
8213
8403
|
}
|
|
8214
8404
|
),
|
|
8215
|
-
/* @__PURE__ */
|
|
8216
|
-
/* @__PURE__ */
|
|
8405
|
+
/* @__PURE__ */ jsx16(Typography10, { variant: "h4", sx: { mb: 2, fontWeight: 700, color: theme.palette.error.main }, children: "Under Review" }),
|
|
8406
|
+
/* @__PURE__ */ jsxs12(Typography10, { variant: "body1", sx: { mb: 2, color: theme.palette.text.secondary }, children: [
|
|
8217
8407
|
"Your request to use our services is currently being reviewed.",
|
|
8218
|
-
/* @__PURE__ */
|
|
8408
|
+
/* @__PURE__ */ jsx16("br", {}),
|
|
8219
8409
|
"For more info, please contact ",
|
|
8220
8410
|
" ",
|
|
8221
|
-
/* @__PURE__ */
|
|
8411
|
+
/* @__PURE__ */ jsx16("a", { href: "mailto:team@banditai.ai", style: { color: theme.palette.primary.main, fontWeight: 600 }, children: "team@banditai.ai" })
|
|
8222
8412
|
] })
|
|
8223
8413
|
]
|
|
8224
8414
|
}
|
|
@@ -8227,13 +8417,13 @@ var UnderReview = () => {
|
|
|
8227
8417
|
var under_review_default = UnderReview;
|
|
8228
8418
|
|
|
8229
8419
|
// src/components/ConnectionStatus.tsx
|
|
8230
|
-
import { Box as
|
|
8231
|
-
import { jsx as
|
|
8420
|
+
import { Box as Box14, Chip as Chip5, useTheme as useTheme15 } from "@mui/material";
|
|
8421
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
8232
8422
|
var ConnectionStatus = ({
|
|
8233
8423
|
showWhenGood = false,
|
|
8234
8424
|
position = "top"
|
|
8235
8425
|
}) => {
|
|
8236
|
-
const theme =
|
|
8426
|
+
const theme = useTheme15();
|
|
8237
8427
|
const { isOnline, connectionQuality, isSlowConnection } = useNetworkStatus();
|
|
8238
8428
|
if (connectionQuality === "fast" && !showWhenGood) {
|
|
8239
8429
|
return null;
|
|
@@ -8242,28 +8432,28 @@ var ConnectionStatus = ({
|
|
|
8242
8432
|
switch (connectionQuality) {
|
|
8243
8433
|
case "offline":
|
|
8244
8434
|
return {
|
|
8245
|
-
icon: /* @__PURE__ */
|
|
8435
|
+
icon: /* @__PURE__ */ jsx17(WifiOffIcon, { sx: { fontSize: 16 } }),
|
|
8246
8436
|
label: "Offline",
|
|
8247
8437
|
color: "error",
|
|
8248
8438
|
severity: "high"
|
|
8249
8439
|
};
|
|
8250
8440
|
case "slow":
|
|
8251
8441
|
return {
|
|
8252
|
-
icon: /* @__PURE__ */
|
|
8442
|
+
icon: /* @__PURE__ */ jsx17(SignalWifi2BarIcon, { sx: { fontSize: 16 } }),
|
|
8253
8443
|
label: "Slow connection",
|
|
8254
8444
|
color: "warning",
|
|
8255
8445
|
severity: "medium"
|
|
8256
8446
|
};
|
|
8257
8447
|
case "fast":
|
|
8258
8448
|
return {
|
|
8259
|
-
icon: /* @__PURE__ */
|
|
8449
|
+
icon: /* @__PURE__ */ jsx17(WifiIcon, { sx: { fontSize: 16 } }),
|
|
8260
8450
|
label: "Connected",
|
|
8261
8451
|
color: "success",
|
|
8262
8452
|
severity: "low"
|
|
8263
8453
|
};
|
|
8264
8454
|
default:
|
|
8265
8455
|
return {
|
|
8266
|
-
icon: /* @__PURE__ */
|
|
8456
|
+
icon: /* @__PURE__ */ jsx17(WifiIcon, { sx: { fontSize: 16 } }),
|
|
8267
8457
|
label: "Unknown",
|
|
8268
8458
|
color: "default",
|
|
8269
8459
|
severity: "low"
|
|
@@ -8271,8 +8461,8 @@ var ConnectionStatus = ({
|
|
|
8271
8461
|
}
|
|
8272
8462
|
};
|
|
8273
8463
|
const config = getStatusConfig();
|
|
8274
|
-
return /* @__PURE__ */
|
|
8275
|
-
|
|
8464
|
+
return /* @__PURE__ */ jsx17(
|
|
8465
|
+
Box14,
|
|
8276
8466
|
{
|
|
8277
8467
|
sx: {
|
|
8278
8468
|
position: "fixed",
|
|
@@ -8287,8 +8477,8 @@ var ConnectionStatus = ({
|
|
|
8287
8477
|
"100%": { opacity: 1 }
|
|
8288
8478
|
}
|
|
8289
8479
|
},
|
|
8290
|
-
children: /* @__PURE__ */
|
|
8291
|
-
|
|
8480
|
+
children: /* @__PURE__ */ jsx17(
|
|
8481
|
+
Chip5,
|
|
8292
8482
|
{
|
|
8293
8483
|
icon: config.icon,
|
|
8294
8484
|
label: config.label,
|
|
@@ -8311,7 +8501,7 @@ var ConnectionStatus = ({
|
|
|
8311
8501
|
};
|
|
8312
8502
|
|
|
8313
8503
|
// src/hooks/useVoiceMode.ts
|
|
8314
|
-
import { useEffect as
|
|
8504
|
+
import { useEffect as useEffect14, useRef as useRef12 } from "react";
|
|
8315
8505
|
var RMS_BASELINE = 128;
|
|
8316
8506
|
var RMS_NORMALIZER = 128;
|
|
8317
8507
|
var computeRms = (data) => {
|
|
@@ -8342,10 +8532,10 @@ var useVoiceMode = (config) => {
|
|
|
8342
8532
|
const resetTransientState = useVoiceModeStore((state) => state.resetTransientState);
|
|
8343
8533
|
const setLastTranscript = useVoiceModeStore((state) => state.setLastTranscript);
|
|
8344
8534
|
const configRef = useRef12(config);
|
|
8345
|
-
|
|
8535
|
+
useEffect14(() => {
|
|
8346
8536
|
configRef.current = config;
|
|
8347
8537
|
}, [config]);
|
|
8348
|
-
|
|
8538
|
+
useEffect14(() => {
|
|
8349
8539
|
if (!enabled) {
|
|
8350
8540
|
return () => void 0;
|
|
8351
8541
|
}
|
|
@@ -8600,7 +8790,7 @@ var useVoiceMode = (config) => {
|
|
|
8600
8790
|
};
|
|
8601
8791
|
|
|
8602
8792
|
// src/chat/chat.tsx
|
|
8603
|
-
import { jsx as
|
|
8793
|
+
import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
8604
8794
|
var ChatContent = () => {
|
|
8605
8795
|
const packageSettings = usePackageSettingsStore((state) => state.settings);
|
|
8606
8796
|
const featureFlag = useFeatureFlag();
|
|
@@ -8608,8 +8798,8 @@ var ChatContent = () => {
|
|
|
8608
8798
|
const ossMode = isOSSMode() || !packageSettings?.featureFlags?.subscriptionType;
|
|
8609
8799
|
const playgroundBypassAccess = packageSettings?.playgroundBypassAuth || typeof window !== "undefined" && window.location.pathname.includes("/playground");
|
|
8610
8800
|
const notificationService = useNotificationService();
|
|
8611
|
-
const [selectedTheme, setSelectedTheme] =
|
|
8612
|
-
const [themeLoading, setThemeLoading] =
|
|
8801
|
+
const [selectedTheme, setSelectedTheme] = useState15(null);
|
|
8802
|
+
const [themeLoading, setThemeLoading] = useState15(true);
|
|
8613
8803
|
const token = authenticationService.getToken();
|
|
8614
8804
|
const claims = token ? authenticationService.parseJwtClaims(token) : null;
|
|
8615
8805
|
const baseTheme = themeMap_default[selectedTheme ?? "bandit-dark"] || banditDarkTheme;
|
|
@@ -8662,7 +8852,7 @@ var ChatContent = () => {
|
|
|
8662
8852
|
const isVoiceModeEnabled = useVoiceModeStore((state) => state.enabled);
|
|
8663
8853
|
const previousVoiceModeEnabledRef = useRef13(isVoiceModeEnabled);
|
|
8664
8854
|
const historyRef = useRef13(history);
|
|
8665
|
-
|
|
8855
|
+
useEffect15(() => {
|
|
8666
8856
|
historyRef.current = history;
|
|
8667
8857
|
}, [history]);
|
|
8668
8858
|
const {
|
|
@@ -8670,7 +8860,7 @@ var ChatContent = () => {
|
|
|
8670
8860
|
stop: ttsStop,
|
|
8671
8861
|
isAvailable: isTTSAvailable
|
|
8672
8862
|
} = useTTS();
|
|
8673
|
-
|
|
8863
|
+
useEffect15(() => {
|
|
8674
8864
|
const timer = setTimeout(() => {
|
|
8675
8865
|
const isAuthenticated = authenticationService.isAuthenticated();
|
|
8676
8866
|
if (!initialized || availableVoices.length === 0) {
|
|
@@ -8684,7 +8874,7 @@ var ChatContent = () => {
|
|
|
8684
8874
|
}, 500);
|
|
8685
8875
|
return () => clearTimeout(timer);
|
|
8686
8876
|
}, [initialized, availableVoices.length, loadVoicesFromAPI, token]);
|
|
8687
|
-
|
|
8877
|
+
useEffect15(() => {
|
|
8688
8878
|
const isAuthenticated = authenticationService.isAuthenticated();
|
|
8689
8879
|
if (packageSettings?.gatewayApiUrl && availableVoices.length === 0 && !initialized) {
|
|
8690
8880
|
if (token && isAuthenticated) {
|
|
@@ -8697,14 +8887,14 @@ var ChatContent = () => {
|
|
|
8697
8887
|
}, [packageSettings?.gatewayApiUrl, availableVoices.length, initialized, loadVoicesFromAPI, token]);
|
|
8698
8888
|
const provider = useAIProviderStore((state) => state.provider);
|
|
8699
8889
|
const inputRef = useRef13(null);
|
|
8700
|
-
const [pastedImages, setPastedImages] =
|
|
8890
|
+
const [pastedImages, setPastedImages] = useState15([]);
|
|
8701
8891
|
const inputContainerRef = useRef13(null);
|
|
8702
|
-
const [inputHeight, setInputHeight] =
|
|
8703
|
-
const [isSubmitting, setIsSubmitting] =
|
|
8704
|
-
const [pendingMessage, setPendingMessage] =
|
|
8892
|
+
const [inputHeight, setInputHeight] = useState15(80);
|
|
8893
|
+
const [isSubmitting, setIsSubmitting] = useState15(false);
|
|
8894
|
+
const [pendingMessage, setPendingMessage] = useState15(null);
|
|
8705
8895
|
const { conversations, currentId, _hasHydrated, hydrate } = useConversationStore();
|
|
8706
|
-
const [isMobile, setIsMobile] =
|
|
8707
|
-
const [drawerOpen, setDrawerOpen] =
|
|
8896
|
+
const [isMobile, setIsMobile] = useState15(false);
|
|
8897
|
+
const [drawerOpen, setDrawerOpen] = useState15(false);
|
|
8708
8898
|
const { generateName } = useConversationNameGenerator();
|
|
8709
8899
|
const { preferences } = usePreferencesStore();
|
|
8710
8900
|
const { containerRef: chatContainerRef, targetRef: scrollTargetRef, scrollToBottom, getScrollState } = useAutoScroll({
|
|
@@ -8716,14 +8906,14 @@ var ChatContent = () => {
|
|
|
8716
8906
|
const chatContainerEl = chatContainerRef.current;
|
|
8717
8907
|
const scrollTargetEl = scrollTargetRef.current;
|
|
8718
8908
|
const { isSlowConnection, connectionQuality, trackRequestStart, trackRequestEnd } = useNetworkStatus();
|
|
8719
|
-
const [showScrollToBottom, setShowScrollToBottom] =
|
|
8720
|
-
const [streamBuffer, setStreamBuffer] =
|
|
8721
|
-
const [responseStarted, setResponseStarted] =
|
|
8722
|
-
const [isStreaming, setIsStreaming] =
|
|
8723
|
-
const [isThinking, setIsThinking] =
|
|
8909
|
+
const [showScrollToBottom, setShowScrollToBottom] = useState15(false);
|
|
8910
|
+
const [streamBuffer, setStreamBuffer] = useState15("");
|
|
8911
|
+
const [responseStarted, setResponseStarted] = useState15(false);
|
|
8912
|
+
const [isStreaming, setIsStreaming] = useState15(false);
|
|
8913
|
+
const [isThinking, setIsThinking] = useState15(false);
|
|
8724
8914
|
const initialLogoState = history.length === 0;
|
|
8725
|
-
const [logoVisible, setLogoVisible] =
|
|
8726
|
-
const [logoShouldRender, setLogoShouldRender] =
|
|
8915
|
+
const [logoVisible, setLogoVisible] = useState15(initialLogoState);
|
|
8916
|
+
const [logoShouldRender, setLogoShouldRender] = useState15(initialLogoState);
|
|
8727
8917
|
const streamingGraceUntilRef = useRef13(0);
|
|
8728
8918
|
const GRACE_MS = 450;
|
|
8729
8919
|
const GRACE_OFFSET_DESKTOP = 28;
|
|
@@ -8732,11 +8922,11 @@ var ChatContent = () => {
|
|
|
8732
8922
|
const lastSpokenResponseRef = useRef13(null);
|
|
8733
8923
|
const previousConversationIdRef = useRef13(null);
|
|
8734
8924
|
const logoFadeTimeoutRef = useRef13(null);
|
|
8735
|
-
const [branding, setBranding] =
|
|
8736
|
-
const [brandingLoading, setBrandingLoading] =
|
|
8925
|
+
const [branding, setBranding] = useState15(null);
|
|
8926
|
+
const [brandingLoading, setBrandingLoading] = useState15(true);
|
|
8737
8927
|
const isBrandingLoadInProgressRef = useRef13(false);
|
|
8738
8928
|
const logoOnly = history.length === 0 && !brandingLoading;
|
|
8739
|
-
|
|
8929
|
+
useEffect15(() => {
|
|
8740
8930
|
const isEmptyConversation = (history?.length ?? 0) === 0;
|
|
8741
8931
|
const isSending = Boolean(pendingMessage);
|
|
8742
8932
|
const shouldShowLogo = isEmptyConversation && !isSending;
|
|
@@ -8766,7 +8956,7 @@ var ChatContent = () => {
|
|
|
8766
8956
|
}, 500);
|
|
8767
8957
|
}
|
|
8768
8958
|
}, [history, pendingMessage]);
|
|
8769
|
-
|
|
8959
|
+
useEffect15(() => {
|
|
8770
8960
|
if (!brandingLoading && !themeLoading) {
|
|
8771
8961
|
return;
|
|
8772
8962
|
}
|
|
@@ -8782,18 +8972,18 @@ var ChatContent = () => {
|
|
|
8782
8972
|
}, 2500);
|
|
8783
8973
|
return () => window.clearTimeout(timeoutId);
|
|
8784
8974
|
}, [brandingLoading, themeLoading, selectedTheme]);
|
|
8785
|
-
|
|
8975
|
+
useEffect15(() => () => {
|
|
8786
8976
|
if (logoFadeTimeoutRef.current) {
|
|
8787
8977
|
window.clearTimeout(logoFadeTimeoutRef.current);
|
|
8788
8978
|
logoFadeTimeoutRef.current = null;
|
|
8789
8979
|
}
|
|
8790
8980
|
}, []);
|
|
8791
|
-
|
|
8981
|
+
useEffect15(() => {
|
|
8792
8982
|
if (isStreaming && streamBuffer.trim() === "") {
|
|
8793
8983
|
streamingGraceUntilRef.current = Date.now() + GRACE_MS;
|
|
8794
8984
|
}
|
|
8795
8985
|
}, [isStreaming, streamBuffer]);
|
|
8796
|
-
|
|
8986
|
+
useEffect15(() => {
|
|
8797
8987
|
if (!isStreaming) return;
|
|
8798
8988
|
const container = chatContainerRef.current;
|
|
8799
8989
|
if (!container) return;
|
|
@@ -8804,13 +8994,13 @@ var ChatContent = () => {
|
|
|
8804
8994
|
container.scrollTo({ top: targetTop, behavior: "smooth" });
|
|
8805
8995
|
}
|
|
8806
8996
|
}, [streamBuffer, isStreaming, isMobile, chatContainerRef]);
|
|
8807
|
-
|
|
8997
|
+
useEffect15(() => {
|
|
8808
8998
|
if (!_hasHydrated) {
|
|
8809
8999
|
debugLogger.info("Chat component triggering conversation store hydration");
|
|
8810
9000
|
hydrate();
|
|
8811
9001
|
}
|
|
8812
9002
|
}, [_hasHydrated, hydrate]);
|
|
8813
|
-
|
|
9003
|
+
useEffect15(() => {
|
|
8814
9004
|
const loadBrandingAndTheme = async () => {
|
|
8815
9005
|
if (isBrandingLoadInProgressRef.current) {
|
|
8816
9006
|
debugLogger.warn("Branding loading already in progress, skipping");
|
|
@@ -8997,19 +9187,19 @@ var ChatContent = () => {
|
|
|
8997
9187
|
window.removeEventListener("bandit-theme-changed", handleThemeChange);
|
|
8998
9188
|
};
|
|
8999
9189
|
}, []);
|
|
9000
|
-
|
|
9190
|
+
useEffect15(() => {
|
|
9001
9191
|
if (!chatContainerEl) return;
|
|
9002
9192
|
const blurInputOnScroll = () => inputRef.current?.blur();
|
|
9003
9193
|
chatContainerEl.addEventListener("scroll", blurInputOnScroll);
|
|
9004
9194
|
return () => chatContainerEl.removeEventListener("scroll", blurInputOnScroll);
|
|
9005
9195
|
}, [chatContainerEl]);
|
|
9006
|
-
|
|
9196
|
+
useEffect15(() => {
|
|
9007
9197
|
const handleResize = () => setIsMobile(window.innerWidth <= 768);
|
|
9008
9198
|
handleResize();
|
|
9009
9199
|
window.addEventListener("resize", handleResize);
|
|
9010
9200
|
return () => window.removeEventListener("resize", handleResize);
|
|
9011
9201
|
}, []);
|
|
9012
|
-
|
|
9202
|
+
useEffect15(() => {
|
|
9013
9203
|
const setViewportHeight = () => {
|
|
9014
9204
|
document.documentElement.style.setProperty(
|
|
9015
9205
|
"--vh",
|
|
@@ -9020,7 +9210,7 @@ var ChatContent = () => {
|
|
|
9020
9210
|
window.addEventListener("resize", setViewportHeight);
|
|
9021
9211
|
return () => window.removeEventListener("resize", setViewportHeight);
|
|
9022
9212
|
}, []);
|
|
9023
|
-
|
|
9213
|
+
useEffect15(() => {
|
|
9024
9214
|
if (!chatContainerEl) return;
|
|
9025
9215
|
let rafId = null;
|
|
9026
9216
|
const update = () => {
|
|
@@ -9039,7 +9229,7 @@ var ChatContent = () => {
|
|
|
9039
9229
|
chatContainerEl.removeEventListener(SCROLL_STATE_CHANGED_EVENT, update);
|
|
9040
9230
|
};
|
|
9041
9231
|
}, [chatContainerEl, getScrollState]);
|
|
9042
|
-
|
|
9232
|
+
useEffect15(() => {
|
|
9043
9233
|
if (!chatContainerEl) return;
|
|
9044
9234
|
let observer = null;
|
|
9045
9235
|
let rafId = null;
|
|
@@ -9074,7 +9264,7 @@ var ChatContent = () => {
|
|
|
9074
9264
|
if (observer) observer.disconnect();
|
|
9075
9265
|
};
|
|
9076
9266
|
}, [chatContainerEl, scrollTargetEl, scrollTargetRef, getScrollState, inputHeight, history.length]);
|
|
9077
|
-
|
|
9267
|
+
useEffect15(() => {
|
|
9078
9268
|
const isTransitioning = isStreaming || streamBuffer.trim() === "";
|
|
9079
9269
|
const delay = isTransitioning ? 400 : 100;
|
|
9080
9270
|
const timer = setTimeout(() => {
|
|
@@ -9117,7 +9307,7 @@ var ChatContent = () => {
|
|
|
9117
9307
|
return () => clearTimeout(scrollTimer);
|
|
9118
9308
|
}
|
|
9119
9309
|
}, [history, isStreaming, scrollToBottom, getScrollState, isMobile, chatContainerRef]);
|
|
9120
|
-
|
|
9310
|
+
useEffect15(() => {
|
|
9121
9311
|
const observer = new ResizeObserver(() => {
|
|
9122
9312
|
if (inputContainerRef.current)
|
|
9123
9313
|
setInputHeight(inputContainerRef.current.offsetHeight);
|
|
@@ -9128,7 +9318,7 @@ var ChatContent = () => {
|
|
|
9128
9318
|
}
|
|
9129
9319
|
return () => observer.disconnect();
|
|
9130
9320
|
}, []);
|
|
9131
|
-
|
|
9321
|
+
useEffect15(() => {
|
|
9132
9322
|
if (!hydrated || !_hasHydrated) return;
|
|
9133
9323
|
if (currentId === null) {
|
|
9134
9324
|
useAIQueryStore.setState({ history: [] });
|
|
@@ -9177,7 +9367,7 @@ var ChatContent = () => {
|
|
|
9177
9367
|
setResponse,
|
|
9178
9368
|
setComponentStatus
|
|
9179
9369
|
]);
|
|
9180
|
-
|
|
9370
|
+
useEffect15(() => {
|
|
9181
9371
|
debugLogger.info("Chat component conversation state", {
|
|
9182
9372
|
hasHydrated: _hasHydrated,
|
|
9183
9373
|
conversationCount: conversations.length,
|
|
@@ -9186,7 +9376,7 @@ var ChatContent = () => {
|
|
|
9186
9376
|
storeState: "main-chat"
|
|
9187
9377
|
});
|
|
9188
9378
|
}, [_hasHydrated, conversations, currentId]);
|
|
9189
|
-
|
|
9379
|
+
useEffect15(() => {
|
|
9190
9380
|
if (!_hasHydrated || !chatContainerEl) return;
|
|
9191
9381
|
let rafId = null;
|
|
9192
9382
|
const sync = () => {
|
|
@@ -9376,7 +9566,7 @@ var ChatContent = () => {
|
|
|
9376
9566
|
onInterrupt: handleVoiceInterrupt,
|
|
9377
9567
|
onError: (message) => notificationService?.showError?.(message)
|
|
9378
9568
|
});
|
|
9379
|
-
|
|
9569
|
+
useEffect15(() => {
|
|
9380
9570
|
const previouslyEnabled = previousVoiceModeEnabledRef.current;
|
|
9381
9571
|
previousVoiceModeEnabledRef.current = isVoiceModeEnabled;
|
|
9382
9572
|
if (!previouslyEnabled && isVoiceModeEnabled) {
|
|
@@ -9401,7 +9591,7 @@ var ChatContent = () => {
|
|
|
9401
9591
|
}
|
|
9402
9592
|
}
|
|
9403
9593
|
}, [isVoiceModeEnabled, ttsStop]);
|
|
9404
|
-
|
|
9594
|
+
useEffect15(() => {
|
|
9405
9595
|
if (!isVoiceModeEnabled || !isStreaming) {
|
|
9406
9596
|
return;
|
|
9407
9597
|
}
|
|
@@ -9421,7 +9611,7 @@ var ChatContent = () => {
|
|
|
9421
9611
|
}
|
|
9422
9612
|
lastSpokenResponseRef.current = null;
|
|
9423
9613
|
}, [isStreaming, isVoiceModeEnabled, ttsStop]);
|
|
9424
|
-
|
|
9614
|
+
useEffect15(() => {
|
|
9425
9615
|
if (!isVoiceModeEnabled) {
|
|
9426
9616
|
lastSpokenResponseRef.current = null;
|
|
9427
9617
|
return;
|
|
@@ -9501,10 +9691,10 @@ var ChatContent = () => {
|
|
|
9501
9691
|
}
|
|
9502
9692
|
};
|
|
9503
9693
|
if (!hydrated || brandingLoading || themeLoading) {
|
|
9504
|
-
return /* @__PURE__ */
|
|
9505
|
-
/* @__PURE__ */
|
|
9506
|
-
/* @__PURE__ */
|
|
9507
|
-
|
|
9694
|
+
return /* @__PURE__ */ jsxs13(ThemeProvider, { theme: banditTheme, children: [
|
|
9695
|
+
/* @__PURE__ */ jsx18(CssBaseline, {}),
|
|
9696
|
+
/* @__PURE__ */ jsxs13(
|
|
9697
|
+
Box15,
|
|
9508
9698
|
{
|
|
9509
9699
|
sx: (theme) => ({
|
|
9510
9700
|
minHeight: "100dvh",
|
|
@@ -9517,8 +9707,8 @@ var ChatContent = () => {
|
|
|
9517
9707
|
color: theme.palette.text.primary
|
|
9518
9708
|
}),
|
|
9519
9709
|
children: [
|
|
9520
|
-
/* @__PURE__ */
|
|
9521
|
-
/* @__PURE__ */
|
|
9710
|
+
/* @__PURE__ */ jsx18(CircularProgress4, { size: 32, thickness: 4 }),
|
|
9711
|
+
/* @__PURE__ */ jsx18(Typography11, { variant: "body2", color: "text.secondary", children: "Preparing your workspace..." })
|
|
9522
9712
|
]
|
|
9523
9713
|
}
|
|
9524
9714
|
)
|
|
@@ -9526,15 +9716,15 @@ var ChatContent = () => {
|
|
|
9526
9716
|
}
|
|
9527
9717
|
const userHasAccess = playgroundBypassAccess || ossMode || claims?.roles?.includes("super-user") || claims?.roles?.includes("admin");
|
|
9528
9718
|
if (!userHasAccess) {
|
|
9529
|
-
return /* @__PURE__ */
|
|
9530
|
-
/* @__PURE__ */
|
|
9531
|
-
/* @__PURE__ */
|
|
9719
|
+
return /* @__PURE__ */ jsxs13(ThemeProvider, { theme: banditTheme, children: [
|
|
9720
|
+
/* @__PURE__ */ jsx18(CssBaseline, {}),
|
|
9721
|
+
/* @__PURE__ */ jsx18(under_review_default, {})
|
|
9532
9722
|
] });
|
|
9533
9723
|
}
|
|
9534
|
-
return /* @__PURE__ */
|
|
9535
|
-
/* @__PURE__ */
|
|
9536
|
-
/* @__PURE__ */
|
|
9537
|
-
|
|
9724
|
+
return /* @__PURE__ */ jsxs13(ThemeProvider, { theme: banditTheme, children: [
|
|
9725
|
+
/* @__PURE__ */ jsx18(CssBaseline, {}),
|
|
9726
|
+
/* @__PURE__ */ jsxs13(
|
|
9727
|
+
Box15,
|
|
9538
9728
|
{
|
|
9539
9729
|
sx: (theme) => ({
|
|
9540
9730
|
display: "flex",
|
|
@@ -9552,7 +9742,7 @@ var ChatContent = () => {
|
|
|
9552
9742
|
transition: "left 0.3s ease-in-out, width 0.3s ease-in-out"
|
|
9553
9743
|
}),
|
|
9554
9744
|
children: [
|
|
9555
|
-
/* @__PURE__ */
|
|
9745
|
+
/* @__PURE__ */ jsx18(
|
|
9556
9746
|
chat_app_bar_default,
|
|
9557
9747
|
{
|
|
9558
9748
|
availableModels,
|
|
@@ -9564,8 +9754,8 @@ var ChatContent = () => {
|
|
|
9564
9754
|
setDrawerOpen
|
|
9565
9755
|
}
|
|
9566
9756
|
),
|
|
9567
|
-
/* @__PURE__ */
|
|
9568
|
-
|
|
9757
|
+
/* @__PURE__ */ jsx18(
|
|
9758
|
+
Box15,
|
|
9569
9759
|
{
|
|
9570
9760
|
ref: chatContainerRef,
|
|
9571
9761
|
sx: {
|
|
@@ -9585,8 +9775,8 @@ var ChatContent = () => {
|
|
|
9585
9775
|
msOverflowStyle: "none",
|
|
9586
9776
|
"&::-webkit-scrollbar": { display: "none" }
|
|
9587
9777
|
},
|
|
9588
|
-
children: /* @__PURE__ */
|
|
9589
|
-
|
|
9778
|
+
children: /* @__PURE__ */ jsxs13(
|
|
9779
|
+
Box15,
|
|
9590
9780
|
{
|
|
9591
9781
|
sx: {
|
|
9592
9782
|
width: "100%",
|
|
@@ -9596,9 +9786,9 @@ var ChatContent = () => {
|
|
|
9596
9786
|
pt: 2
|
|
9597
9787
|
},
|
|
9598
9788
|
children: [
|
|
9599
|
-
logoShouldRender && !brandingLoading && (branding?.logoBase64 ? /* @__PURE__ */
|
|
9600
|
-
/* @__PURE__ */
|
|
9601
|
-
|
|
9789
|
+
logoShouldRender && !brandingLoading && (branding?.logoBase64 ? /* @__PURE__ */ jsx18(custom_logo_default, { visible: logoVisible, atTop: true }) : /* @__PURE__ */ jsx18(bandit_chat_logo_default, { visible: logoVisible, atTop: true })),
|
|
9790
|
+
/* @__PURE__ */ jsx18(
|
|
9791
|
+
Box15,
|
|
9602
9792
|
{
|
|
9603
9793
|
sx: {
|
|
9604
9794
|
margin: "0 auto",
|
|
@@ -9607,7 +9797,7 @@ var ChatContent = () => {
|
|
|
9607
9797
|
flexShrink: 0,
|
|
9608
9798
|
px: isMobile ? 0 : 0
|
|
9609
9799
|
},
|
|
9610
|
-
children: /* @__PURE__ */
|
|
9800
|
+
children: /* @__PURE__ */ jsx18(
|
|
9611
9801
|
chat_messages_default,
|
|
9612
9802
|
{
|
|
9613
9803
|
isStreaming,
|
|
@@ -9631,7 +9821,7 @@ var ChatContent = () => {
|
|
|
9631
9821
|
)
|
|
9632
9822
|
}
|
|
9633
9823
|
),
|
|
9634
|
-
showScrollToBottom && /* @__PURE__ */
|
|
9824
|
+
showScrollToBottom && /* @__PURE__ */ jsx18(
|
|
9635
9825
|
chat_scroll_to_bottom_button_default,
|
|
9636
9826
|
{
|
|
9637
9827
|
inputHeight,
|
|
@@ -9640,8 +9830,8 @@ var ChatContent = () => {
|
|
|
9640
9830
|
onClick: handleScrollToBottomClick
|
|
9641
9831
|
}
|
|
9642
9832
|
),
|
|
9643
|
-
history.length === 0 && componentStatus !== "Loading" && !isMobile && /* @__PURE__ */
|
|
9644
|
-
|
|
9833
|
+
history.length === 0 && componentStatus !== "Loading" && !isMobile && /* @__PURE__ */ jsx18(
|
|
9834
|
+
Box15,
|
|
9645
9835
|
{
|
|
9646
9836
|
sx: (theme) => ({
|
|
9647
9837
|
position: "absolute",
|
|
@@ -9659,8 +9849,8 @@ var ChatContent = () => {
|
|
|
9659
9849
|
})
|
|
9660
9850
|
}
|
|
9661
9851
|
),
|
|
9662
|
-
/* @__PURE__ */
|
|
9663
|
-
|
|
9852
|
+
/* @__PURE__ */ jsxs13(
|
|
9853
|
+
Box15,
|
|
9664
9854
|
{
|
|
9665
9855
|
sx: {
|
|
9666
9856
|
display: "flex",
|
|
@@ -9671,9 +9861,10 @@ var ChatContent = () => {
|
|
|
9671
9861
|
maxWidth: "768px"
|
|
9672
9862
|
},
|
|
9673
9863
|
children: [
|
|
9674
|
-
/* @__PURE__ */
|
|
9675
|
-
history.length === 0 && componentStatus !== "Loading" && !pendingMessage && preferences.chatSuggestionsEnabled && /* @__PURE__ */
|
|
9676
|
-
/* @__PURE__ */
|
|
9864
|
+
/* @__PURE__ */ jsx18(Box15, { sx: { flex: "1 1 auto" } }),
|
|
9865
|
+
history.length === 0 && componentStatus !== "Loading" && !pendingMessage && preferences.chatSuggestionsEnabled && /* @__PURE__ */ jsx18(Box15, { sx: { marginBottom: "20px" }, children: /* @__PURE__ */ jsx18(QuerySuggestionPicker, { onSend: handleSend, inputHeight }) }),
|
|
9866
|
+
/* @__PURE__ */ jsx18(ask_user_card_default, {}),
|
|
9867
|
+
/* @__PURE__ */ jsx18(
|
|
9677
9868
|
chat_input_default,
|
|
9678
9869
|
{
|
|
9679
9870
|
inputValue,
|
|
@@ -9700,7 +9891,7 @@ var ChatContent = () => {
|
|
|
9700
9891
|
]
|
|
9701
9892
|
}
|
|
9702
9893
|
),
|
|
9703
|
-
preferences.feedbackEnabled && !isMobile && /* @__PURE__ */
|
|
9894
|
+
preferences.feedbackEnabled && !isMobile && /* @__PURE__ */ jsx18(
|
|
9704
9895
|
FeedbackButton,
|
|
9705
9896
|
{
|
|
9706
9897
|
fullScreen: false,
|
|
@@ -9713,7 +9904,7 @@ var ChatContent = () => {
|
|
|
9713
9904
|
}
|
|
9714
9905
|
}
|
|
9715
9906
|
),
|
|
9716
|
-
/* @__PURE__ */
|
|
9907
|
+
/* @__PURE__ */ jsx18(ConnectionStatus, { position: "top", showWhenGood: false })
|
|
9717
9908
|
]
|
|
9718
9909
|
}
|
|
9719
9910
|
)
|
|
@@ -9742,13 +9933,13 @@ var Chat = () => {
|
|
|
9742
9933
|
});
|
|
9743
9934
|
if (!allowUnauthenticated && !bypassAuth && !authenticationService.isAuthenticated()) {
|
|
9744
9935
|
debugLogger.debug("User is not authenticated, redirecting to login");
|
|
9745
|
-
return /* @__PURE__ */
|
|
9936
|
+
return /* @__PURE__ */ jsx18(Navigate, { to: "/login", replace: true });
|
|
9746
9937
|
}
|
|
9747
|
-
return /* @__PURE__ */
|
|
9938
|
+
return /* @__PURE__ */ jsx18(ChatContent, {});
|
|
9748
9939
|
};
|
|
9749
9940
|
var chat_default = Chat;
|
|
9750
9941
|
|
|
9751
9942
|
export {
|
|
9752
9943
|
chat_default
|
|
9753
9944
|
};
|
|
9754
|
-
//# sourceMappingURL=chunk-
|
|
9945
|
+
//# sourceMappingURL=chunk-PUUL2R3T.mjs.map
|