glitchgrab 1.34.0 → 1.35.0
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/index.js +1162 -290
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1206 -334
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -68,7 +68,7 @@ __export(index_exports, {
|
|
|
68
68
|
module.exports = __toCommonJS(index_exports);
|
|
69
69
|
|
|
70
70
|
// src/provider.tsx
|
|
71
|
-
var
|
|
71
|
+
var import_react5 = require("react");
|
|
72
72
|
|
|
73
73
|
// src/error-boundary.tsx
|
|
74
74
|
var React = __toESM(require("react"));
|
|
@@ -646,6 +646,43 @@ async function enhanceText(text, token, baseUrl, screenshot, context) {
|
|
|
646
646
|
return text;
|
|
647
647
|
}
|
|
648
648
|
}
|
|
649
|
+
async function assistTurn(params, token, baseUrl) {
|
|
650
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
651
|
+
const offline = {
|
|
652
|
+
conversationId: null,
|
|
653
|
+
question: null,
|
|
654
|
+
report: null,
|
|
655
|
+
degraded: "The assistant is unavailable \u2014 write your report below and send it as normal."
|
|
656
|
+
};
|
|
657
|
+
try {
|
|
658
|
+
const url = `${baseUrl != null ? baseUrl : DEFAULT_BASE_URL}/api/v1/ai/report-chat`;
|
|
659
|
+
const response = await fetch(url, {
|
|
660
|
+
method: "POST",
|
|
661
|
+
headers: {
|
|
662
|
+
"Content-Type": "application/json",
|
|
663
|
+
Authorization: `Bearer ${token}`
|
|
664
|
+
},
|
|
665
|
+
body: JSON.stringify(params)
|
|
666
|
+
});
|
|
667
|
+
const envelope = await response.json().catch(() => null);
|
|
668
|
+
if (!response.ok || !(envelope == null ? void 0 : envelope.success)) {
|
|
669
|
+
return {
|
|
670
|
+
conversationId: null,
|
|
671
|
+
question: null,
|
|
672
|
+
report: null,
|
|
673
|
+
degraded: (_a = envelope == null ? void 0 : envelope.error) != null ? _a : offline.degraded
|
|
674
|
+
};
|
|
675
|
+
}
|
|
676
|
+
return {
|
|
677
|
+
conversationId: (_c = (_b = envelope.data) == null ? void 0 : _b.conversationId) != null ? _c : null,
|
|
678
|
+
question: (_e = (_d = envelope.data) == null ? void 0 : _d.question) != null ? _e : null,
|
|
679
|
+
report: (_g = (_f = envelope.data) == null ? void 0 : _f.report) != null ? _g : null,
|
|
680
|
+
degraded: null
|
|
681
|
+
};
|
|
682
|
+
} catch (e) {
|
|
683
|
+
return offline;
|
|
684
|
+
}
|
|
685
|
+
}
|
|
649
686
|
async function transcribeAudio(blob, token, baseUrl) {
|
|
650
687
|
var _a;
|
|
651
688
|
try {
|
|
@@ -857,7 +894,10 @@ var import_react = require("react");
|
|
|
857
894
|
var import_react_dom = require("react-dom");
|
|
858
895
|
var import_react2 = require("react");
|
|
859
896
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
897
|
+
var import_react3 = require("react");
|
|
898
|
+
var import_react_dom2 = require("react-dom");
|
|
860
899
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
900
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
861
901
|
var MAX_SCREENSHOT_DATA_URL_LENGTH = 18e5;
|
|
862
902
|
var QUALITY_LADDER = [0.92, 0.85, 0.75];
|
|
863
903
|
var DOWNSCALE_FACTOR = 0.7;
|
|
@@ -1163,6 +1203,693 @@ function AnnotationCanvas({ imageSrc, onSave, onCancel }) {
|
|
|
1163
1203
|
}
|
|
1164
1204
|
);
|
|
1165
1205
|
}
|
|
1206
|
+
var STARTERS = [
|
|
1207
|
+
"Something on this page is broken",
|
|
1208
|
+
"It did the wrong thing",
|
|
1209
|
+
"I wish it could\u2026"
|
|
1210
|
+
];
|
|
1211
|
+
var NARROW_QUERY = "(max-width: 640px)";
|
|
1212
|
+
function useIsNarrow() {
|
|
1213
|
+
const [narrow, setNarrow] = (0, import_react3.useState)(false);
|
|
1214
|
+
(0, import_react3.useEffect)(() => {
|
|
1215
|
+
try {
|
|
1216
|
+
const mq = window.matchMedia(NARROW_QUERY);
|
|
1217
|
+
setNarrow(mq.matches);
|
|
1218
|
+
const onChange = (e) => setNarrow(e.matches);
|
|
1219
|
+
mq.addEventListener("change", onChange);
|
|
1220
|
+
return () => mq.removeEventListener("change", onChange);
|
|
1221
|
+
} catch (e) {
|
|
1222
|
+
}
|
|
1223
|
+
}, []);
|
|
1224
|
+
return narrow;
|
|
1225
|
+
}
|
|
1226
|
+
function Sparkle({ color, size = 14 }) {
|
|
1227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1228
|
+
"path",
|
|
1229
|
+
{
|
|
1230
|
+
d: "M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5L12 3zM19 15l.75 2.25L22 18l-2.25.75L19 21l-.75-2.25L16 18l2.25-.75L19 15z",
|
|
1231
|
+
stroke: color,
|
|
1232
|
+
strokeWidth: "1.5",
|
|
1233
|
+
strokeLinejoin: "round"
|
|
1234
|
+
}
|
|
1235
|
+
) });
|
|
1236
|
+
}
|
|
1237
|
+
function Avatar({
|
|
1238
|
+
who,
|
|
1239
|
+
theme: t2,
|
|
1240
|
+
initials
|
|
1241
|
+
}) {
|
|
1242
|
+
const isAi = who === "assistant";
|
|
1243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1244
|
+
"span",
|
|
1245
|
+
{
|
|
1246
|
+
"aria-hidden": "true",
|
|
1247
|
+
style: {
|
|
1248
|
+
flexShrink: 0,
|
|
1249
|
+
width: "24px",
|
|
1250
|
+
height: "24px",
|
|
1251
|
+
borderRadius: "50%",
|
|
1252
|
+
display: "inline-flex",
|
|
1253
|
+
alignItems: "center",
|
|
1254
|
+
justifyContent: "center",
|
|
1255
|
+
marginTop: "2px",
|
|
1256
|
+
backgroundColor: isAi ? `${t2.accent}22` : t2.bgSecondary,
|
|
1257
|
+
border: `1px solid ${isAi ? t2.accent : t2.inputBorder}`,
|
|
1258
|
+
color: isAi ? t2.accent : t2.textMuted,
|
|
1259
|
+
fontSize: "10px",
|
|
1260
|
+
fontWeight: 700
|
|
1261
|
+
},
|
|
1262
|
+
children: isAi ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Sparkle, { color: t2.accent, size: 12 }) : initials ? initials : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
|
|
1263
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("circle", { cx: "12", cy: "8", r: "3.4", stroke: "currentColor", strokeWidth: "1.8" }),
|
|
1264
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1265
|
+
"path",
|
|
1266
|
+
{
|
|
1267
|
+
d: "M5 20c0-3.6 3.1-5.6 7-5.6s7 2 7 5.6",
|
|
1268
|
+
stroke: "currentColor",
|
|
1269
|
+
strokeWidth: "1.8",
|
|
1270
|
+
strokeLinecap: "round"
|
|
1271
|
+
}
|
|
1272
|
+
)
|
|
1273
|
+
] })
|
|
1274
|
+
}
|
|
1275
|
+
);
|
|
1276
|
+
}
|
|
1277
|
+
function AssistSheet({
|
|
1278
|
+
assist,
|
|
1279
|
+
theme: t2,
|
|
1280
|
+
screenshot,
|
|
1281
|
+
attachmentCount,
|
|
1282
|
+
context,
|
|
1283
|
+
reportTypeLabel,
|
|
1284
|
+
projectSlot,
|
|
1285
|
+
reporterName,
|
|
1286
|
+
description,
|
|
1287
|
+
onDescriptionChange,
|
|
1288
|
+
severity,
|
|
1289
|
+
onSeverityChange,
|
|
1290
|
+
showSeverity,
|
|
1291
|
+
isSubmitting,
|
|
1292
|
+
submitted,
|
|
1293
|
+
onSend,
|
|
1294
|
+
onDegrade,
|
|
1295
|
+
onClose
|
|
1296
|
+
}) {
|
|
1297
|
+
const narrow = useIsNarrow();
|
|
1298
|
+
const [messages, setMessages] = (0, import_react3.useState)([]);
|
|
1299
|
+
const [input, setInput] = (0, import_react3.useState)("");
|
|
1300
|
+
const [busy, setBusy] = (0, import_react3.useState)(false);
|
|
1301
|
+
const [conversationId, setConversationId] = (0, import_react3.useState)(null);
|
|
1302
|
+
const [phase, setPhase] = (0, import_react3.useState)("chat");
|
|
1303
|
+
const scrollRef = (0, import_react3.useRef)(null);
|
|
1304
|
+
const inputRef = (0, import_react3.useRef)(null);
|
|
1305
|
+
const draftRef = (0, import_react3.useRef)(null);
|
|
1306
|
+
const seededRef = (0, import_react3.useRef)(false);
|
|
1307
|
+
(0, import_react3.useEffect)(() => {
|
|
1308
|
+
const el = scrollRef.current;
|
|
1309
|
+
if (el) el.scrollTop = el.scrollHeight;
|
|
1310
|
+
}, [messages, busy, phase]);
|
|
1311
|
+
(0, import_react3.useEffect)(() => {
|
|
1312
|
+
var _a;
|
|
1313
|
+
if (phase === "draft") (_a = draftRef.current) == null ? void 0 : _a.focus();
|
|
1314
|
+
}, [phase]);
|
|
1315
|
+
async function runTurn(history2) {
|
|
1316
|
+
setBusy(true);
|
|
1317
|
+
let result;
|
|
1318
|
+
try {
|
|
1319
|
+
result = await assist({ messages: history2, conversationId, screenshot, context });
|
|
1320
|
+
} catch (e) {
|
|
1321
|
+
onDegrade("The assistant is unavailable \u2014 write your report below and send it as normal.");
|
|
1322
|
+
return;
|
|
1323
|
+
} finally {
|
|
1324
|
+
setBusy(false);
|
|
1325
|
+
}
|
|
1326
|
+
if (result.degraded) {
|
|
1327
|
+
onDegrade(result.degraded);
|
|
1328
|
+
return;
|
|
1329
|
+
}
|
|
1330
|
+
if (result.conversationId) setConversationId(result.conversationId);
|
|
1331
|
+
if (result.report) {
|
|
1332
|
+
onDescriptionChange(result.report);
|
|
1333
|
+
setMessages([...history2, { role: "assistant", content: "Here's your report \u2014 have a read." }]);
|
|
1334
|
+
setPhase("draft");
|
|
1335
|
+
return;
|
|
1336
|
+
}
|
|
1337
|
+
if (result.question) {
|
|
1338
|
+
setMessages([...history2, { role: "assistant", content: result.question }]);
|
|
1339
|
+
return;
|
|
1340
|
+
}
|
|
1341
|
+
onDegrade("The assistant had nothing to add \u2014 write your report below and send it as normal.");
|
|
1342
|
+
}
|
|
1343
|
+
(0, import_react3.useEffect)(() => {
|
|
1344
|
+
if (seededRef.current) return;
|
|
1345
|
+
seededRef.current = true;
|
|
1346
|
+
const seed = description.trim();
|
|
1347
|
+
if (!seed) return;
|
|
1348
|
+
const history2 = [{ role: "user", content: seed }];
|
|
1349
|
+
setMessages(history2);
|
|
1350
|
+
void runTurn(history2);
|
|
1351
|
+
}, []);
|
|
1352
|
+
function send(text) {
|
|
1353
|
+
const value = text.trim();
|
|
1354
|
+
if (!value || busy) return;
|
|
1355
|
+
const history2 = [...messages, { role: "user", content: value }];
|
|
1356
|
+
setMessages(history2);
|
|
1357
|
+
setInput("");
|
|
1358
|
+
void runTurn(history2);
|
|
1359
|
+
}
|
|
1360
|
+
const empty = messages.length === 0 && !busy;
|
|
1361
|
+
const initials = (reporterName != null ? reporterName : "").split(/\s+/).filter(Boolean).slice(0, 2).map((w) => {
|
|
1362
|
+
var _a, _b;
|
|
1363
|
+
return (_b = (_a = w[0]) == null ? void 0 : _a.toUpperCase()) != null ? _b : "";
|
|
1364
|
+
}).join("");
|
|
1365
|
+
const panelStyle = narrow ? {
|
|
1366
|
+
width: "100%",
|
|
1367
|
+
maxHeight: "88dvh",
|
|
1368
|
+
borderTopLeftRadius: "16px",
|
|
1369
|
+
borderTopRightRadius: "16px",
|
|
1370
|
+
animation: "gg-sheet-up .22s cubic-bezier(.2,.8,.2,1)"
|
|
1371
|
+
} : {
|
|
1372
|
+
width: "440px",
|
|
1373
|
+
maxWidth: "100%",
|
|
1374
|
+
height: "100dvh",
|
|
1375
|
+
borderLeft: `1px solid ${t2.border}`,
|
|
1376
|
+
animation: "gg-sheet-in .22s cubic-bezier(.2,.8,.2,1)"
|
|
1377
|
+
};
|
|
1378
|
+
return (0, import_react_dom2.createPortal)(
|
|
1379
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
1380
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("style", { children: `
|
|
1381
|
+
@keyframes gg-sheet-in{from{transform:translateX(24px);opacity:0}to{transform:translateX(0);opacity:1}}
|
|
1382
|
+
@keyframes gg-sheet-up{from{transform:translateY(24px);opacity:0}to{transform:translateY(0);opacity:1}}
|
|
1383
|
+
@keyframes gg-sheet-fade{from{opacity:0}to{opacity:1}}
|
|
1384
|
+
@keyframes gg-dot{0%,80%,100%{transform:translateY(0);opacity:.4}40%{transform:translateY(-3px);opacity:1}}
|
|
1385
|
+
[data-gg-sheet-send]:focus-visible,[data-gg-chip]:focus-visible{outline:2px solid currentColor;outline-offset:2px}
|
|
1386
|
+
` }),
|
|
1387
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1388
|
+
"div",
|
|
1389
|
+
{
|
|
1390
|
+
"data-glitchgrab-layer": "",
|
|
1391
|
+
role: "dialog",
|
|
1392
|
+
"aria-modal": "true",
|
|
1393
|
+
"aria-label": "Describe your report with AI",
|
|
1394
|
+
style: {
|
|
1395
|
+
position: "fixed",
|
|
1396
|
+
inset: 0,
|
|
1397
|
+
zIndex: 2147483647,
|
|
1398
|
+
display: "flex",
|
|
1399
|
+
alignItems: narrow ? "flex-end" : "stretch",
|
|
1400
|
+
justifyContent: narrow ? "center" : "flex-end",
|
|
1401
|
+
backgroundColor: "rgba(0,0,0,0.5)",
|
|
1402
|
+
animation: "gg-sheet-fade .18s ease",
|
|
1403
|
+
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'
|
|
1404
|
+
},
|
|
1405
|
+
onClick: onClose,
|
|
1406
|
+
onPointerDown: (e) => e.stopPropagation(),
|
|
1407
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1408
|
+
"div",
|
|
1409
|
+
{
|
|
1410
|
+
onClick: (e) => e.stopPropagation(),
|
|
1411
|
+
style: {
|
|
1412
|
+
...panelStyle,
|
|
1413
|
+
display: "flex",
|
|
1414
|
+
flexDirection: "column",
|
|
1415
|
+
// A flex child defaults to min-width:auto, so a long chat bubble
|
|
1416
|
+
// grows the sheet past the viewport instead of wrapping inside it.
|
|
1417
|
+
// This is what keeps the bottom sheet on screen.
|
|
1418
|
+
minWidth: 0,
|
|
1419
|
+
maxWidth: "100%",
|
|
1420
|
+
boxSizing: "border-box",
|
|
1421
|
+
backgroundColor: t2.bg,
|
|
1422
|
+
color: t2.text,
|
|
1423
|
+
boxShadow: "0 20px 60px rgba(0,0,0,.35)",
|
|
1424
|
+
overflow: "hidden",
|
|
1425
|
+
isolation: "isolate"
|
|
1426
|
+
},
|
|
1427
|
+
children: [
|
|
1428
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1429
|
+
"div",
|
|
1430
|
+
{
|
|
1431
|
+
style: {
|
|
1432
|
+
flexShrink: 0,
|
|
1433
|
+
padding: "14px 16px",
|
|
1434
|
+
borderBottom: `1px solid ${t2.border}`,
|
|
1435
|
+
display: "flex",
|
|
1436
|
+
alignItems: "flex-start",
|
|
1437
|
+
justifyContent: "space-between",
|
|
1438
|
+
gap: "12px",
|
|
1439
|
+
minWidth: 0
|
|
1440
|
+
},
|
|
1441
|
+
children: [
|
|
1442
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { minWidth: 0, overflow: "hidden" }, children: [
|
|
1443
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1444
|
+
"div",
|
|
1445
|
+
{
|
|
1446
|
+
style: {
|
|
1447
|
+
display: "flex",
|
|
1448
|
+
alignItems: "center",
|
|
1449
|
+
gap: "7px",
|
|
1450
|
+
fontSize: "14px",
|
|
1451
|
+
fontWeight: 600
|
|
1452
|
+
},
|
|
1453
|
+
children: [
|
|
1454
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Sparkle, { color: t2.accent }),
|
|
1455
|
+
"Describe it with AI",
|
|
1456
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1457
|
+
"span",
|
|
1458
|
+
{
|
|
1459
|
+
style: {
|
|
1460
|
+
fontSize: "10px",
|
|
1461
|
+
fontWeight: 600,
|
|
1462
|
+
letterSpacing: ".04em",
|
|
1463
|
+
textTransform: "uppercase",
|
|
1464
|
+
color: t2.accent,
|
|
1465
|
+
border: `1px solid ${t2.accent}55`,
|
|
1466
|
+
borderRadius: "4px",
|
|
1467
|
+
padding: "1px 5px"
|
|
1468
|
+
},
|
|
1469
|
+
children: "Beta"
|
|
1470
|
+
}
|
|
1471
|
+
)
|
|
1472
|
+
]
|
|
1473
|
+
}
|
|
1474
|
+
),
|
|
1475
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { fontSize: "11.5px", color: t2.textMuted, marginTop: "3px" }, children: [
|
|
1476
|
+
reportTypeLabel,
|
|
1477
|
+
projectSlot ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { style: { marginLeft: "6px" }, children: projectSlot }) : null
|
|
1478
|
+
] })
|
|
1479
|
+
] }),
|
|
1480
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1481
|
+
"button",
|
|
1482
|
+
{
|
|
1483
|
+
type: "button",
|
|
1484
|
+
onClick: onClose,
|
|
1485
|
+
"aria-label": "Close and write it myself",
|
|
1486
|
+
style: {
|
|
1487
|
+
flexShrink: 0,
|
|
1488
|
+
border: "none",
|
|
1489
|
+
background: "transparent",
|
|
1490
|
+
color: t2.textMuted,
|
|
1491
|
+
cursor: "pointer",
|
|
1492
|
+
fontSize: narrow ? "18px" : "12px",
|
|
1493
|
+
lineHeight: 1,
|
|
1494
|
+
fontFamily: "inherit",
|
|
1495
|
+
padding: narrow ? "4px 6px" : "6px 4px"
|
|
1496
|
+
},
|
|
1497
|
+
children: narrow ? "\xD7" : "Write it myself"
|
|
1498
|
+
}
|
|
1499
|
+
)
|
|
1500
|
+
]
|
|
1501
|
+
}
|
|
1502
|
+
),
|
|
1503
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1504
|
+
"div",
|
|
1505
|
+
{
|
|
1506
|
+
ref: scrollRef,
|
|
1507
|
+
style: {
|
|
1508
|
+
flex: 1,
|
|
1509
|
+
minHeight: narrow ? "180px" : 0,
|
|
1510
|
+
overflowY: "auto",
|
|
1511
|
+
padding: "16px",
|
|
1512
|
+
display: "flex",
|
|
1513
|
+
flexDirection: "column"
|
|
1514
|
+
},
|
|
1515
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1516
|
+
"div",
|
|
1517
|
+
{
|
|
1518
|
+
style: {
|
|
1519
|
+
marginTop: "auto",
|
|
1520
|
+
display: "flex",
|
|
1521
|
+
flexDirection: "column",
|
|
1522
|
+
gap: "12px",
|
|
1523
|
+
minWidth: 0
|
|
1524
|
+
},
|
|
1525
|
+
children: [
|
|
1526
|
+
empty && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "12px" }, children: [
|
|
1527
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { display: "flex", gap: "8px" }, children: [
|
|
1528
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Avatar, { who: "assistant", theme: t2 }),
|
|
1529
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1530
|
+
"div",
|
|
1531
|
+
{
|
|
1532
|
+
style: {
|
|
1533
|
+
padding: "9px 12px",
|
|
1534
|
+
borderRadius: "12px 12px 12px 4px",
|
|
1535
|
+
backgroundColor: t2.bgSecondary,
|
|
1536
|
+
fontSize: "13px",
|
|
1537
|
+
lineHeight: 1.55,
|
|
1538
|
+
maxWidth: "88%"
|
|
1539
|
+
},
|
|
1540
|
+
children: [
|
|
1541
|
+
reporterName ? `Hi ${reporterName.split(" ")[0]} \u2014 t` : "T",
|
|
1542
|
+
"ell me what went wrong in your own words. I can already see your screenshot and what you clicked, so skip the boring parts."
|
|
1543
|
+
]
|
|
1544
|
+
}
|
|
1545
|
+
)
|
|
1546
|
+
] }),
|
|
1547
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1548
|
+
"div",
|
|
1549
|
+
{
|
|
1550
|
+
style: {
|
|
1551
|
+
display: "flex",
|
|
1552
|
+
flexWrap: "wrap",
|
|
1553
|
+
gap: "6px",
|
|
1554
|
+
paddingLeft: "32px"
|
|
1555
|
+
},
|
|
1556
|
+
children: STARTERS.map((s) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1557
|
+
"button",
|
|
1558
|
+
{
|
|
1559
|
+
type: "button",
|
|
1560
|
+
"data-gg-chip": "",
|
|
1561
|
+
onClick: () => send(s),
|
|
1562
|
+
style: {
|
|
1563
|
+
border: `1px solid ${t2.inputBorder}`,
|
|
1564
|
+
background: "transparent",
|
|
1565
|
+
color: t2.textMuted,
|
|
1566
|
+
borderRadius: "999px",
|
|
1567
|
+
padding: "6px 11px",
|
|
1568
|
+
fontSize: "12px",
|
|
1569
|
+
fontFamily: "inherit",
|
|
1570
|
+
cursor: "pointer"
|
|
1571
|
+
},
|
|
1572
|
+
children: s
|
|
1573
|
+
},
|
|
1574
|
+
s
|
|
1575
|
+
))
|
|
1576
|
+
}
|
|
1577
|
+
)
|
|
1578
|
+
] }),
|
|
1579
|
+
messages.map((m, i) => {
|
|
1580
|
+
const mine = m.role === "user";
|
|
1581
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1582
|
+
"div",
|
|
1583
|
+
{
|
|
1584
|
+
style: {
|
|
1585
|
+
display: "flex",
|
|
1586
|
+
gap: "8px",
|
|
1587
|
+
minWidth: 0,
|
|
1588
|
+
flexDirection: mine ? "row-reverse" : "row"
|
|
1589
|
+
},
|
|
1590
|
+
children: [
|
|
1591
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Avatar, { who: m.role, theme: t2, initials }),
|
|
1592
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1593
|
+
"div",
|
|
1594
|
+
{
|
|
1595
|
+
style: {
|
|
1596
|
+
maxWidth: "82%",
|
|
1597
|
+
padding: "9px 12px",
|
|
1598
|
+
borderRadius: mine ? "12px 12px 4px 12px" : "12px 12px 12px 4px",
|
|
1599
|
+
fontSize: "13px",
|
|
1600
|
+
lineHeight: 1.55,
|
|
1601
|
+
whiteSpace: "pre-wrap",
|
|
1602
|
+
wordBreak: "break-word",
|
|
1603
|
+
backgroundColor: mine ? t2.accent : t2.bgSecondary,
|
|
1604
|
+
color: mine ? t2.accentText : t2.text
|
|
1605
|
+
},
|
|
1606
|
+
children: m.content
|
|
1607
|
+
}
|
|
1608
|
+
)
|
|
1609
|
+
]
|
|
1610
|
+
},
|
|
1611
|
+
i
|
|
1612
|
+
);
|
|
1613
|
+
}),
|
|
1614
|
+
busy && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { display: "flex", gap: "8px" }, role: "status", "aria-label": "Thinking", children: [
|
|
1615
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Avatar, { who: "assistant", theme: t2 }),
|
|
1616
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1617
|
+
"span",
|
|
1618
|
+
{
|
|
1619
|
+
style: {
|
|
1620
|
+
display: "inline-flex",
|
|
1621
|
+
alignItems: "center",
|
|
1622
|
+
gap: "4px",
|
|
1623
|
+
padding: "12px",
|
|
1624
|
+
borderRadius: "12px 12px 12px 4px",
|
|
1625
|
+
backgroundColor: t2.bgSecondary
|
|
1626
|
+
},
|
|
1627
|
+
children: [0, 1, 2].map((i) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1628
|
+
"span",
|
|
1629
|
+
{
|
|
1630
|
+
style: {
|
|
1631
|
+
width: "5px",
|
|
1632
|
+
height: "5px",
|
|
1633
|
+
borderRadius: "50%",
|
|
1634
|
+
backgroundColor: t2.textMuted,
|
|
1635
|
+
animation: `gg-dot 1.1s ease-in-out ${i * 0.15}s infinite`
|
|
1636
|
+
}
|
|
1637
|
+
},
|
|
1638
|
+
i
|
|
1639
|
+
))
|
|
1640
|
+
}
|
|
1641
|
+
)
|
|
1642
|
+
] }),
|
|
1643
|
+
phase === "draft" && !submitted && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1644
|
+
"div",
|
|
1645
|
+
{
|
|
1646
|
+
style: {
|
|
1647
|
+
border: `1px solid ${t2.accent}`,
|
|
1648
|
+
borderRadius: "12px",
|
|
1649
|
+
backgroundColor: t2.bgSecondary,
|
|
1650
|
+
padding: "12px",
|
|
1651
|
+
display: "flex",
|
|
1652
|
+
flexDirection: "column",
|
|
1653
|
+
gap: "10px",
|
|
1654
|
+
minWidth: 0,
|
|
1655
|
+
boxSizing: "border-box"
|
|
1656
|
+
},
|
|
1657
|
+
children: [
|
|
1658
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1659
|
+
"span",
|
|
1660
|
+
{
|
|
1661
|
+
style: {
|
|
1662
|
+
fontSize: "10px",
|
|
1663
|
+
fontWeight: 700,
|
|
1664
|
+
letterSpacing: ".06em",
|
|
1665
|
+
textTransform: "uppercase",
|
|
1666
|
+
color: t2.accent
|
|
1667
|
+
},
|
|
1668
|
+
children: "Your report \xB7 edit anything"
|
|
1669
|
+
}
|
|
1670
|
+
),
|
|
1671
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1672
|
+
"textarea",
|
|
1673
|
+
{
|
|
1674
|
+
ref: draftRef,
|
|
1675
|
+
value: description,
|
|
1676
|
+
onChange: (e) => onDescriptionChange(e.target.value),
|
|
1677
|
+
rows: 6,
|
|
1678
|
+
style: {
|
|
1679
|
+
width: "100%",
|
|
1680
|
+
minHeight: "120px",
|
|
1681
|
+
padding: "10px",
|
|
1682
|
+
borderRadius: "8px",
|
|
1683
|
+
border: `1px solid ${t2.inputBorder}`,
|
|
1684
|
+
backgroundColor: t2.inputBg,
|
|
1685
|
+
color: t2.text,
|
|
1686
|
+
fontSize: "13px",
|
|
1687
|
+
lineHeight: 1.55,
|
|
1688
|
+
fontFamily: "inherit",
|
|
1689
|
+
resize: "vertical",
|
|
1690
|
+
outline: "none",
|
|
1691
|
+
boxSizing: "border-box"
|
|
1692
|
+
}
|
|
1693
|
+
}
|
|
1694
|
+
),
|
|
1695
|
+
showSeverity && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
|
|
1696
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1697
|
+
"span",
|
|
1698
|
+
{
|
|
1699
|
+
style: {
|
|
1700
|
+
fontSize: "11.5px",
|
|
1701
|
+
color: t2.textMuted,
|
|
1702
|
+
display: "block",
|
|
1703
|
+
marginBottom: "6px"
|
|
1704
|
+
},
|
|
1705
|
+
children: "How bad is it?"
|
|
1706
|
+
}
|
|
1707
|
+
),
|
|
1708
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: { display: "flex", gap: "6px" }, children: ["low", "medium", "high"].map((s) => {
|
|
1709
|
+
const on = severity === s;
|
|
1710
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1711
|
+
"button",
|
|
1712
|
+
{
|
|
1713
|
+
type: "button",
|
|
1714
|
+
onClick: () => onSeverityChange(s),
|
|
1715
|
+
"aria-pressed": on,
|
|
1716
|
+
style: {
|
|
1717
|
+
flex: 1,
|
|
1718
|
+
minWidth: 0,
|
|
1719
|
+
padding: "8px 0",
|
|
1720
|
+
borderRadius: "8px",
|
|
1721
|
+
border: `1px solid ${on ? t2.accent : t2.inputBorder}`,
|
|
1722
|
+
backgroundColor: on ? t2.accent : "transparent",
|
|
1723
|
+
color: on ? t2.accentText : t2.textMuted,
|
|
1724
|
+
fontSize: "12px",
|
|
1725
|
+
fontWeight: 600,
|
|
1726
|
+
fontFamily: "inherit",
|
|
1727
|
+
textTransform: "capitalize",
|
|
1728
|
+
cursor: "pointer"
|
|
1729
|
+
},
|
|
1730
|
+
children: s
|
|
1731
|
+
},
|
|
1732
|
+
s
|
|
1733
|
+
);
|
|
1734
|
+
}) })
|
|
1735
|
+
] }),
|
|
1736
|
+
attachmentCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { style: { fontSize: "11.5px", color: t2.textMuted }, children: [
|
|
1737
|
+
attachmentCount,
|
|
1738
|
+
" ",
|
|
1739
|
+
attachmentCount === 1 ? "attachment" : "attachments",
|
|
1740
|
+
" will be sent with this."
|
|
1741
|
+
] }),
|
|
1742
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1743
|
+
"button",
|
|
1744
|
+
{
|
|
1745
|
+
type: "button",
|
|
1746
|
+
onClick: () => setPhase("chat"),
|
|
1747
|
+
style: {
|
|
1748
|
+
alignSelf: "flex-start",
|
|
1749
|
+
border: "none",
|
|
1750
|
+
background: "transparent",
|
|
1751
|
+
color: t2.textMuted,
|
|
1752
|
+
fontSize: "12px",
|
|
1753
|
+
fontFamily: "inherit",
|
|
1754
|
+
padding: 0,
|
|
1755
|
+
cursor: "pointer",
|
|
1756
|
+
textDecoration: "underline"
|
|
1757
|
+
},
|
|
1758
|
+
children: "Not quite \u2014 keep chatting"
|
|
1759
|
+
}
|
|
1760
|
+
)
|
|
1761
|
+
]
|
|
1762
|
+
}
|
|
1763
|
+
),
|
|
1764
|
+
submitted && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1765
|
+
"div",
|
|
1766
|
+
{
|
|
1767
|
+
style: {
|
|
1768
|
+
textAlign: "center",
|
|
1769
|
+
padding: "24px 0",
|
|
1770
|
+
color: t2.accent,
|
|
1771
|
+
fontSize: "14px",
|
|
1772
|
+
fontWeight: 600
|
|
1773
|
+
},
|
|
1774
|
+
children: [
|
|
1775
|
+
reportTypeLabel,
|
|
1776
|
+
" sent. Thank you!"
|
|
1777
|
+
]
|
|
1778
|
+
}
|
|
1779
|
+
)
|
|
1780
|
+
]
|
|
1781
|
+
}
|
|
1782
|
+
)
|
|
1783
|
+
}
|
|
1784
|
+
),
|
|
1785
|
+
!submitted && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1786
|
+
"div",
|
|
1787
|
+
{
|
|
1788
|
+
style: {
|
|
1789
|
+
flexShrink: 0,
|
|
1790
|
+
borderTop: `1px solid ${t2.border}`,
|
|
1791
|
+
padding: "12px 16px",
|
|
1792
|
+
paddingBottom: narrow ? "max(12px, env(safe-area-inset-bottom))" : "12px",
|
|
1793
|
+
backgroundColor: t2.bg
|
|
1794
|
+
},
|
|
1795
|
+
children: phase === "draft" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1796
|
+
"button",
|
|
1797
|
+
{
|
|
1798
|
+
type: "button",
|
|
1799
|
+
"data-gg-sheet-send": "",
|
|
1800
|
+
onClick: onSend,
|
|
1801
|
+
disabled: isSubmitting || !description.trim(),
|
|
1802
|
+
style: {
|
|
1803
|
+
width: "100%",
|
|
1804
|
+
padding: "12px",
|
|
1805
|
+
borderRadius: "10px",
|
|
1806
|
+
border: "none",
|
|
1807
|
+
backgroundColor: isSubmitting || !description.trim() ? t2.bgSecondary : t2.accent,
|
|
1808
|
+
color: isSubmitting || !description.trim() ? t2.textMuted : t2.accentText,
|
|
1809
|
+
fontSize: "14px",
|
|
1810
|
+
fontWeight: 700,
|
|
1811
|
+
fontFamily: "inherit",
|
|
1812
|
+
cursor: isSubmitting || !description.trim() ? "default" : "pointer"
|
|
1813
|
+
},
|
|
1814
|
+
children: isSubmitting ? "Sending\u2026" : "Send Report"
|
|
1815
|
+
}
|
|
1816
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { display: "flex", gap: "8px", alignItems: "flex-end" }, children: [
|
|
1817
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1818
|
+
"textarea",
|
|
1819
|
+
{
|
|
1820
|
+
ref: inputRef,
|
|
1821
|
+
value: input,
|
|
1822
|
+
onChange: (e) => setInput(e.target.value),
|
|
1823
|
+
onKeyDown: (e) => {
|
|
1824
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
1825
|
+
e.preventDefault();
|
|
1826
|
+
send(input);
|
|
1827
|
+
}
|
|
1828
|
+
},
|
|
1829
|
+
placeholder: "Type your answer\u2026",
|
|
1830
|
+
rows: 1,
|
|
1831
|
+
disabled: busy,
|
|
1832
|
+
autoFocus: true,
|
|
1833
|
+
style: {
|
|
1834
|
+
flex: 1,
|
|
1835
|
+
minHeight: "42px",
|
|
1836
|
+
maxHeight: "120px",
|
|
1837
|
+
padding: "11px 12px",
|
|
1838
|
+
borderRadius: "10px",
|
|
1839
|
+
border: `1px solid ${t2.inputBorder}`,
|
|
1840
|
+
backgroundColor: t2.inputBg,
|
|
1841
|
+
color: t2.text,
|
|
1842
|
+
fontSize: "13px",
|
|
1843
|
+
lineHeight: 1.4,
|
|
1844
|
+
fontFamily: "inherit",
|
|
1845
|
+
resize: "none",
|
|
1846
|
+
outline: "none",
|
|
1847
|
+
boxSizing: "border-box"
|
|
1848
|
+
}
|
|
1849
|
+
}
|
|
1850
|
+
),
|
|
1851
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1852
|
+
"button",
|
|
1853
|
+
{
|
|
1854
|
+
type: "button",
|
|
1855
|
+
"data-gg-sheet-send": "",
|
|
1856
|
+
onClick: () => send(input),
|
|
1857
|
+
disabled: busy || !input.trim(),
|
|
1858
|
+
"aria-label": "Send message",
|
|
1859
|
+
style: {
|
|
1860
|
+
flexShrink: 0,
|
|
1861
|
+
width: "42px",
|
|
1862
|
+
height: "42px",
|
|
1863
|
+
borderRadius: "10px",
|
|
1864
|
+
border: "none",
|
|
1865
|
+
display: "inline-flex",
|
|
1866
|
+
alignItems: "center",
|
|
1867
|
+
justifyContent: "center",
|
|
1868
|
+
backgroundColor: busy || !input.trim() ? t2.bgSecondary : t2.accent,
|
|
1869
|
+
color: busy || !input.trim() ? t2.textMuted : t2.accentText,
|
|
1870
|
+
cursor: busy || !input.trim() ? "default" : "pointer"
|
|
1871
|
+
},
|
|
1872
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { width: "17", height: "17", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1873
|
+
"path",
|
|
1874
|
+
{
|
|
1875
|
+
d: "M3 20.5L21.5 12 3 3.5V10l12 2-12 2v6.5z",
|
|
1876
|
+
fill: "currentColor"
|
|
1877
|
+
}
|
|
1878
|
+
) })
|
|
1879
|
+
}
|
|
1880
|
+
)
|
|
1881
|
+
] })
|
|
1882
|
+
}
|
|
1883
|
+
)
|
|
1884
|
+
]
|
|
1885
|
+
}
|
|
1886
|
+
)
|
|
1887
|
+
}
|
|
1888
|
+
)
|
|
1889
|
+
] }),
|
|
1890
|
+
document.body
|
|
1891
|
+
);
|
|
1892
|
+
}
|
|
1166
1893
|
var GLITCHGRAB_SHORTCUT = "Ctrl+Shift+G";
|
|
1167
1894
|
var GLITCHGRAB_SHORTCUT_MAC = "\u2318\u21E7G";
|
|
1168
1895
|
function isMac() {
|
|
@@ -1342,13 +2069,13 @@ function ReporterChip({
|
|
|
1342
2069
|
const label = isAnonymous ? "Anonymous" : name;
|
|
1343
2070
|
const title = isAnonymous ? "No reporter identity was passed to Glitchgrab \u2014 this report won't be attributed to anyone" : [name, reporter == null ? void 0 : reporter.email, reporter == null ? void 0 : reporter.role].filter(Boolean).join(" \xB7 ");
|
|
1344
2071
|
const showAvatarImage = !!avatarUrl && !avatarFailed;
|
|
1345
|
-
return /* @__PURE__ */ (0,
|
|
2072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
1346
2073
|
"span",
|
|
1347
2074
|
{
|
|
1348
2075
|
title,
|
|
1349
2076
|
style: { display: "flex", alignItems: "center", gap: "6px", minWidth: 0 },
|
|
1350
2077
|
children: [
|
|
1351
|
-
/* @__PURE__ */ (0,
|
|
2078
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1352
2079
|
"span",
|
|
1353
2080
|
{
|
|
1354
2081
|
"aria-hidden": "true",
|
|
@@ -1368,7 +2095,7 @@ function ReporterChip({
|
|
|
1368
2095
|
color: isAnonymous ? t2.textMuted : t2.accentText,
|
|
1369
2096
|
border: `1px solid ${isAnonymous ? t2.inputBorder : "transparent"}`
|
|
1370
2097
|
},
|
|
1371
|
-
children: showAvatarImage ? /* @__PURE__ */ (0,
|
|
2098
|
+
children: showAvatarImage ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1372
2099
|
"img",
|
|
1373
2100
|
{
|
|
1374
2101
|
src: avatarUrl,
|
|
@@ -1378,9 +2105,9 @@ function ReporterChip({
|
|
|
1378
2105
|
onError: () => setAvatarFailed(true),
|
|
1379
2106
|
style: { width: "100%", height: "100%", objectFit: "cover" }
|
|
1380
2107
|
}
|
|
1381
|
-
) : initials ? initials : /* @__PURE__ */ (0,
|
|
1382
|
-
/* @__PURE__ */ (0,
|
|
1383
|
-
/* @__PURE__ */ (0,
|
|
2108
|
+
) : initials ? initials : /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("svg", { width: "10", height: "10", viewBox: "0 0 16 16", fill: "none", children: [
|
|
2109
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("circle", { cx: "8", cy: "5.5", r: "2.75", stroke: "currentColor", strokeWidth: "1.4" }),
|
|
2110
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1384
2111
|
"path",
|
|
1385
2112
|
{
|
|
1386
2113
|
d: "M2.75 13.5c0-2.35 2.35-3.75 5.25-3.75s5.25 1.4 5.25 3.75",
|
|
@@ -1392,7 +2119,7 @@ function ReporterChip({
|
|
|
1392
2119
|
] })
|
|
1393
2120
|
}
|
|
1394
2121
|
),
|
|
1395
|
-
/* @__PURE__ */ (0,
|
|
2122
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
1396
2123
|
"span",
|
|
1397
2124
|
{
|
|
1398
2125
|
style: {
|
|
@@ -1506,6 +2233,8 @@ function ReportDialog({
|
|
|
1506
2233
|
report,
|
|
1507
2234
|
sendFeedback: sendFeedback2,
|
|
1508
2235
|
enhanceText: enhanceText2,
|
|
2236
|
+
assist,
|
|
2237
|
+
assistContext = null,
|
|
1509
2238
|
transcribeAudio: transcribeAudio2,
|
|
1510
2239
|
types,
|
|
1511
2240
|
showSeverity = true,
|
|
@@ -1514,7 +2243,11 @@ function ReportDialog({
|
|
|
1514
2243
|
onClose,
|
|
1515
2244
|
headerSlot
|
|
1516
2245
|
}) {
|
|
2246
|
+
var _a, _b;
|
|
1517
2247
|
const [isEnhancing, setIsEnhancing] = (0, import_react.useState)(false);
|
|
2248
|
+
const [assistOpen, setAssistOpen] = (0, import_react.useState)(false);
|
|
2249
|
+
const [assistNotice, setAssistNotice] = (0, import_react.useState)(null);
|
|
2250
|
+
const [assistUsed, setAssistUsed] = (0, import_react.useState)(false);
|
|
1518
2251
|
const [isEnhanced, setIsEnhanced] = (0, import_react.useState)(false);
|
|
1519
2252
|
const [originalDescription, setOriginalDescription] = (0, import_react.useState)(
|
|
1520
2253
|
null
|
|
@@ -1640,11 +2373,11 @@ function ReportDialog({
|
|
|
1640
2373
|
return () => window.removeEventListener("keydown", onKey);
|
|
1641
2374
|
}, [isOpen, step, sendFeedback2, availableTypes.join(",")]);
|
|
1642
2375
|
const handleTileGridKeyDown = (e) => {
|
|
1643
|
-
var
|
|
2376
|
+
var _a2, _b2, _c;
|
|
1644
2377
|
const keys = ["ArrowRight", "ArrowLeft", "ArrowDown", "ArrowUp"];
|
|
1645
2378
|
if (!keys.includes(e.key)) return;
|
|
1646
2379
|
const tiles = Array.from(
|
|
1647
|
-
(
|
|
2380
|
+
(_b2 = (_a2 = tileGridRef.current) == null ? void 0 : _a2.querySelectorAll("button[data-gg-type]")) != null ? _b2 : []
|
|
1648
2381
|
);
|
|
1649
2382
|
if (tiles.length === 0) return;
|
|
1650
2383
|
e.preventDefault();
|
|
@@ -1722,8 +2455,8 @@ function ReportDialog({
|
|
|
1722
2455
|
(0, import_react.useEffect)(() => {
|
|
1723
2456
|
if (previewIndex === null || annotatingIndex !== null) return;
|
|
1724
2457
|
const handlePointerDown = (e) => {
|
|
1725
|
-
var
|
|
1726
|
-
if (!((
|
|
2458
|
+
var _a2;
|
|
2459
|
+
if (!((_a2 = previewImgRef.current) == null ? void 0 : _a2.contains(e.target))) {
|
|
1727
2460
|
closePreview();
|
|
1728
2461
|
}
|
|
1729
2462
|
};
|
|
@@ -1731,17 +2464,17 @@ function ReportDialog({
|
|
|
1731
2464
|
return () => document.removeEventListener("pointerdown", handlePointerDown, true);
|
|
1732
2465
|
}, [previewIndex, annotatingIndex]);
|
|
1733
2466
|
(0, import_react.useEffect)(() => {
|
|
1734
|
-
var
|
|
2467
|
+
var _a2;
|
|
1735
2468
|
const el = previewScrollRef.current;
|
|
1736
2469
|
if (!previewZoomed || !el) return;
|
|
1737
|
-
const anchor = (
|
|
2470
|
+
const anchor = (_a2 = zoomAnchorRef.current) != null ? _a2 : { fx: 0.5, fy: 0.5 };
|
|
1738
2471
|
el.scrollLeft = anchor.fx * el.scrollWidth - el.clientWidth / 2;
|
|
1739
2472
|
el.scrollTop = anchor.fy * el.scrollHeight - el.clientHeight / 2;
|
|
1740
2473
|
}, [previewZoomed]);
|
|
1741
2474
|
const togglePreviewZoom = (e) => {
|
|
1742
|
-
var
|
|
2475
|
+
var _a2;
|
|
1743
2476
|
e.stopPropagation();
|
|
1744
|
-
if ((
|
|
2477
|
+
if ((_a2 = panRef.current) == null ? void 0 : _a2.moved) return;
|
|
1745
2478
|
if (!previewZoomed && !canZoomPreview) return;
|
|
1746
2479
|
const img = previewImgElRef.current;
|
|
1747
2480
|
if (!previewZoomed && img) {
|
|
@@ -1776,9 +2509,9 @@ function ReportDialog({
|
|
|
1776
2509
|
el.scrollTop = start.top - dy;
|
|
1777
2510
|
};
|
|
1778
2511
|
const handlePanEnd = (e) => {
|
|
1779
|
-
var
|
|
2512
|
+
var _a2, _b2;
|
|
1780
2513
|
const el = previewScrollRef.current;
|
|
1781
|
-
const moved = (
|
|
2514
|
+
const moved = (_b2 = (_a2 = panRef.current) == null ? void 0 : _a2.moved) != null ? _b2 : false;
|
|
1782
2515
|
try {
|
|
1783
2516
|
el == null ? void 0 : el.releasePointerCapture(e.pointerId);
|
|
1784
2517
|
} catch (e2) {
|
|
@@ -1795,9 +2528,9 @@ function ReportDialog({
|
|
|
1795
2528
|
(0, import_react.useEffect)(() => {
|
|
1796
2529
|
if (!isOpen) return;
|
|
1797
2530
|
const handlePaste = (e) => {
|
|
1798
|
-
var
|
|
2531
|
+
var _a2;
|
|
1799
2532
|
try {
|
|
1800
|
-
const items = (
|
|
2533
|
+
const items = (_a2 = e.clipboardData) == null ? void 0 : _a2.items;
|
|
1801
2534
|
if (!items) return;
|
|
1802
2535
|
const pasted = [];
|
|
1803
2536
|
for (let i = 0; i < items.length; i++) {
|
|
@@ -1823,16 +2556,16 @@ function ReportDialog({
|
|
|
1823
2556
|
return () => clearInterval(id);
|
|
1824
2557
|
}, [isOpen, transcribeAudio2]);
|
|
1825
2558
|
const stopVoice = () => {
|
|
1826
|
-
var
|
|
2559
|
+
var _a2, _b2;
|
|
1827
2560
|
usingWebSpeechRef.current = false;
|
|
1828
|
-
(
|
|
2561
|
+
(_a2 = recognitionRef.current) == null ? void 0 : _a2.stop();
|
|
1829
2562
|
recognitionRef.current = null;
|
|
1830
2563
|
sarvamChunksRef.current = [];
|
|
1831
2564
|
const stream = streamRef.current;
|
|
1832
2565
|
streamRef.current = null;
|
|
1833
2566
|
stream == null ? void 0 : stream.getTracks().forEach((t22) => t22.stop());
|
|
1834
2567
|
try {
|
|
1835
|
-
(
|
|
2568
|
+
(_b2 = mediaRecorderRef.current) == null ? void 0 : _b2.stop();
|
|
1836
2569
|
} catch (e) {
|
|
1837
2570
|
}
|
|
1838
2571
|
mediaRecorderRef.current = null;
|
|
@@ -1840,16 +2573,28 @@ function ReportDialog({
|
|
|
1840
2573
|
setIsTranscribing(false);
|
|
1841
2574
|
};
|
|
1842
2575
|
const stopListeningAndTranscribe = () => {
|
|
1843
|
-
var
|
|
2576
|
+
var _a2, _b2;
|
|
1844
2577
|
usingWebSpeechRef.current = false;
|
|
1845
|
-
(
|
|
2578
|
+
(_a2 = recognitionRef.current) == null ? void 0 : _a2.stop();
|
|
1846
2579
|
recognitionRef.current = null;
|
|
1847
2580
|
setIsListening(false);
|
|
1848
2581
|
try {
|
|
1849
|
-
(
|
|
2582
|
+
(_b2 = mediaRecorderRef.current) == null ? void 0 : _b2.stop();
|
|
1850
2583
|
} catch (e) {
|
|
1851
2584
|
}
|
|
1852
2585
|
};
|
|
2586
|
+
const sheetUp = !!assist && assistOpen && !isRating;
|
|
2587
|
+
(0, import_react.useEffect)(() => {
|
|
2588
|
+
const el = modalRef.current;
|
|
2589
|
+
if (!el) return;
|
|
2590
|
+
if (sheetUp) {
|
|
2591
|
+
el.setAttribute("inert", "");
|
|
2592
|
+
el.setAttribute("aria-hidden", "true");
|
|
2593
|
+
} else {
|
|
2594
|
+
el.removeAttribute("inert");
|
|
2595
|
+
el.removeAttribute("aria-hidden");
|
|
2596
|
+
}
|
|
2597
|
+
}, [sheetUp, isOpen]);
|
|
1853
2598
|
const handleClose = () => {
|
|
1854
2599
|
stopVoice();
|
|
1855
2600
|
setIsOpen(false);
|
|
@@ -1865,6 +2610,9 @@ function ReportDialog({
|
|
|
1865
2610
|
setVoiceError(null);
|
|
1866
2611
|
setIsEnhanced(false);
|
|
1867
2612
|
setOriginalDescription(null);
|
|
2613
|
+
setAssistOpen(false);
|
|
2614
|
+
setAssistUsed(false);
|
|
2615
|
+
setAssistNotice(null);
|
|
1868
2616
|
};
|
|
1869
2617
|
const toggleVoice = async () => {
|
|
1870
2618
|
if (isListening) {
|
|
@@ -1967,7 +2715,7 @@ function ReportDialog({
|
|
|
1967
2715
|
}
|
|
1968
2716
|
};
|
|
1969
2717
|
const handleSpaceDown = (e) => {
|
|
1970
|
-
var
|
|
2718
|
+
var _a2;
|
|
1971
2719
|
if (e.code !== "Space") return;
|
|
1972
2720
|
if (isListening || isPushToTalkRef.current) {
|
|
1973
2721
|
e.preventDefault();
|
|
@@ -1975,7 +2723,7 @@ function ReportDialog({
|
|
|
1975
2723
|
}
|
|
1976
2724
|
if (e.repeat || !transcribeAudio2 || isTranscribing || spaceTimerRef.current)
|
|
1977
2725
|
return;
|
|
1978
|
-
const pos = (
|
|
2726
|
+
const pos = (_a2 = e.currentTarget.selectionStart) != null ? _a2 : description.length;
|
|
1979
2727
|
spaceTimerRef.current = setTimeout(() => {
|
|
1980
2728
|
spaceTimerRef.current = null;
|
|
1981
2729
|
isPushToTalkRef.current = true;
|
|
@@ -2064,9 +2812,9 @@ function ReportDialog({
|
|
|
2064
2812
|
}
|
|
2065
2813
|
};
|
|
2066
2814
|
if (!mounted) return null;
|
|
2067
|
-
return /* @__PURE__ */ (0,
|
|
2815
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
2068
2816
|
isOpen && (0, import_react_dom.createPortal)(
|
|
2069
|
-
/* @__PURE__ */ (0,
|
|
2817
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("style", { children: `
|
|
2070
2818
|
@keyframes gg-pulse{0%,100%{opacity:1}50%{opacity:0.35}}
|
|
2071
2819
|
@keyframes gg-b1{0%,100%{height:3px}40%{height:13px}}
|
|
2072
2820
|
@keyframes gg-b2{0%,100%{height:8px}50%{height:3px}}
|
|
@@ -2103,7 +2851,7 @@ function ReportDialog({
|
|
|
2103
2851
|
document.body
|
|
2104
2852
|
),
|
|
2105
2853
|
isOpen && (0, import_react_dom.createPortal)(
|
|
2106
|
-
/* @__PURE__ */ (0,
|
|
2854
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2107
2855
|
"div",
|
|
2108
2856
|
{
|
|
2109
2857
|
"data-glitchgrab-layer": "",
|
|
@@ -2112,7 +2860,10 @@ function ReportDialog({
|
|
|
2112
2860
|
inset: 0,
|
|
2113
2861
|
zIndex: 2147483647,
|
|
2114
2862
|
pointerEvents: "auto",
|
|
2115
|
-
|
|
2863
|
+
// Hidden, not unmounted, while the AI sheet is in charge — the
|
|
2864
|
+
// dialog's state IS the report, and unmounting would drop the
|
|
2865
|
+
// screenshots, attachments and step the reporter is on.
|
|
2866
|
+
display: sheetUp ? "none" : "flex",
|
|
2116
2867
|
alignItems: "center",
|
|
2117
2868
|
justifyContent: "center",
|
|
2118
2869
|
backgroundColor: "rgba(0,0,0,0.5)",
|
|
@@ -2123,7 +2874,7 @@ function ReportDialog({
|
|
|
2123
2874
|
},
|
|
2124
2875
|
onPointerDown: (e) => e.stopPropagation(),
|
|
2125
2876
|
onFocus: (e) => e.stopPropagation(),
|
|
2126
|
-
children: /* @__PURE__ */ (0,
|
|
2877
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
2127
2878
|
"div",
|
|
2128
2879
|
{
|
|
2129
2880
|
ref: modalRef,
|
|
@@ -2145,7 +2896,7 @@ function ReportDialog({
|
|
|
2145
2896
|
isolation: "isolate"
|
|
2146
2897
|
},
|
|
2147
2898
|
children: [
|
|
2148
|
-
/* @__PURE__ */ (0,
|
|
2899
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
2149
2900
|
"div",
|
|
2150
2901
|
{
|
|
2151
2902
|
style: {
|
|
@@ -2154,7 +2905,7 @@ function ReportDialog({
|
|
|
2154
2905
|
borderBottom: `1px solid ${t2.border}`
|
|
2155
2906
|
},
|
|
2156
2907
|
children: [
|
|
2157
|
-
/* @__PURE__ */ (0,
|
|
2908
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
2158
2909
|
"div",
|
|
2159
2910
|
{
|
|
2160
2911
|
style: {
|
|
@@ -2163,7 +2914,7 @@ function ReportDialog({
|
|
|
2163
2914
|
alignItems: "center"
|
|
2164
2915
|
},
|
|
2165
2916
|
children: [
|
|
2166
|
-
/* @__PURE__ */ (0,
|
|
2917
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
2167
2918
|
"div",
|
|
2168
2919
|
{
|
|
2169
2920
|
style: {
|
|
@@ -2172,7 +2923,7 @@ function ReportDialog({
|
|
|
2172
2923
|
gap: "8px"
|
|
2173
2924
|
},
|
|
2174
2925
|
children: [
|
|
2175
|
-
step > 1 && /* @__PURE__ */ (0,
|
|
2926
|
+
step > 1 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2176
2927
|
"button",
|
|
2177
2928
|
{
|
|
2178
2929
|
type: "button",
|
|
@@ -2186,14 +2937,14 @@ function ReportDialog({
|
|
|
2186
2937
|
alignItems: "center"
|
|
2187
2938
|
},
|
|
2188
2939
|
"aria-label": "Back",
|
|
2189
|
-
children: /* @__PURE__ */ (0,
|
|
2940
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2190
2941
|
"svg",
|
|
2191
2942
|
{
|
|
2192
2943
|
width: "16",
|
|
2193
2944
|
height: "16",
|
|
2194
2945
|
viewBox: "0 0 16 16",
|
|
2195
2946
|
fill: "none",
|
|
2196
|
-
children: /* @__PURE__ */ (0,
|
|
2947
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2197
2948
|
"path",
|
|
2198
2949
|
{
|
|
2199
2950
|
d: "M10 3L5 8L10 13",
|
|
@@ -2207,7 +2958,7 @@ function ReportDialog({
|
|
|
2207
2958
|
)
|
|
2208
2959
|
}
|
|
2209
2960
|
),
|
|
2210
|
-
/* @__PURE__ */ (0,
|
|
2961
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2211
2962
|
"span",
|
|
2212
2963
|
{
|
|
2213
2964
|
style: {
|
|
@@ -2221,7 +2972,7 @@ function ReportDialog({
|
|
|
2221
2972
|
]
|
|
2222
2973
|
}
|
|
2223
2974
|
),
|
|
2224
|
-
/* @__PURE__ */ (0,
|
|
2975
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
2225
2976
|
"div",
|
|
2226
2977
|
{
|
|
2227
2978
|
style: {
|
|
@@ -2230,7 +2981,7 @@ function ReportDialog({
|
|
|
2230
2981
|
gap: "8px"
|
|
2231
2982
|
},
|
|
2232
2983
|
children: [
|
|
2233
|
-
step === 1 && /* @__PURE__ */ (0,
|
|
2984
|
+
step === 1 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2234
2985
|
"span",
|
|
2235
2986
|
{
|
|
2236
2987
|
title: "Press this anywhere to open Glitchgrab",
|
|
@@ -2248,7 +2999,7 @@ function ReportDialog({
|
|
|
2248
2999
|
children: getShortcutLabel()
|
|
2249
3000
|
}
|
|
2250
3001
|
),
|
|
2251
|
-
/* @__PURE__ */ (0,
|
|
3002
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2252
3003
|
"button",
|
|
2253
3004
|
{
|
|
2254
3005
|
type: "button",
|
|
@@ -2263,7 +3014,7 @@ function ReportDialog({
|
|
|
2263
3014
|
justifyContent: "center"
|
|
2264
3015
|
},
|
|
2265
3016
|
"aria-label": "Close",
|
|
2266
|
-
children: /* @__PURE__ */ (0,
|
|
3017
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2267
3018
|
"svg",
|
|
2268
3019
|
{
|
|
2269
3020
|
width: "16",
|
|
@@ -2271,7 +3022,7 @@ function ReportDialog({
|
|
|
2271
3022
|
viewBox: "0 0 16 16",
|
|
2272
3023
|
fill: "none",
|
|
2273
3024
|
style: { display: "block" },
|
|
2274
|
-
children: /* @__PURE__ */ (0,
|
|
3025
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2275
3026
|
"path",
|
|
2276
3027
|
{
|
|
2277
3028
|
d: "M4 4L12 12M12 4L4 12",
|
|
@@ -2290,7 +3041,7 @@ function ReportDialog({
|
|
|
2290
3041
|
]
|
|
2291
3042
|
}
|
|
2292
3043
|
),
|
|
2293
|
-
/* @__PURE__ */ (0,
|
|
3044
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2294
3045
|
"div",
|
|
2295
3046
|
{
|
|
2296
3047
|
style: {
|
|
@@ -2300,12 +3051,12 @@ function ReportDialog({
|
|
|
2300
3051
|
gap: "0",
|
|
2301
3052
|
marginTop: "12px"
|
|
2302
3053
|
},
|
|
2303
|
-
children: [1, 2].map((s, i) => /* @__PURE__ */ (0,
|
|
3054
|
+
children: [1, 2].map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
2304
3055
|
"div",
|
|
2305
3056
|
{
|
|
2306
3057
|
style: { display: "flex", alignItems: "center" },
|
|
2307
3058
|
children: [
|
|
2308
|
-
/* @__PURE__ */ (0,
|
|
3059
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2309
3060
|
"div",
|
|
2310
3061
|
{
|
|
2311
3062
|
style: {
|
|
@@ -2317,7 +3068,7 @@ function ReportDialog({
|
|
|
2317
3068
|
}
|
|
2318
3069
|
}
|
|
2319
3070
|
),
|
|
2320
|
-
i < 1 && /* @__PURE__ */ (0,
|
|
3071
|
+
i < 1 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2321
3072
|
"div",
|
|
2322
3073
|
{
|
|
2323
3074
|
style: {
|
|
@@ -2337,7 +3088,7 @@ function ReportDialog({
|
|
|
2337
3088
|
]
|
|
2338
3089
|
}
|
|
2339
3090
|
),
|
|
2340
|
-
/* @__PURE__ */ (0,
|
|
3091
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2341
3092
|
"div",
|
|
2342
3093
|
{
|
|
2343
3094
|
style: {
|
|
@@ -2346,7 +3097,7 @@ function ReportDialog({
|
|
|
2346
3097
|
flex: "1 1 auto",
|
|
2347
3098
|
minHeight: 0
|
|
2348
3099
|
},
|
|
2349
|
-
children: submitted ? /* @__PURE__ */ (0,
|
|
3100
|
+
children: submitted ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
2350
3101
|
"div",
|
|
2351
3102
|
{
|
|
2352
3103
|
style: {
|
|
@@ -2361,9 +3112,9 @@ function ReportDialog({
|
|
|
2361
3112
|
" sent. Thank you!"
|
|
2362
3113
|
]
|
|
2363
3114
|
}
|
|
2364
|
-
) : /* @__PURE__ */ (0,
|
|
2365
|
-
step === 1 && headerSlot ? /* @__PURE__ */ (0,
|
|
2366
|
-
step === 1 && sendFeedback2 && /* @__PURE__ */ (0,
|
|
3115
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
3116
|
+
step === 1 && headerSlot ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { style: { marginBottom: "14px" }, children: headerSlot }) : null,
|
|
3117
|
+
step === 1 && sendFeedback2 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
2367
3118
|
"div",
|
|
2368
3119
|
{
|
|
2369
3120
|
style: {
|
|
@@ -2380,16 +3131,16 @@ function ReportDialog({
|
|
|
2380
3131
|
},
|
|
2381
3132
|
onMouseLeave: () => setHoveredStar(0),
|
|
2382
3133
|
children: [
|
|
2383
|
-
/* @__PURE__ */ (0,
|
|
3134
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2384
3135
|
"span",
|
|
2385
3136
|
{
|
|
2386
3137
|
style: { fontSize: "13px", fontWeight: 600, color: t2.text },
|
|
2387
3138
|
children: "How are we doing?"
|
|
2388
3139
|
}
|
|
2389
3140
|
),
|
|
2390
|
-
/* @__PURE__ */ (0,
|
|
3141
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { style: { display: "flex", gap: "4px" }, children: [1, 2, 3, 4, 5].map((star) => {
|
|
2391
3142
|
const filled = star <= (hoveredStar || rating);
|
|
2392
|
-
return /* @__PURE__ */ (0,
|
|
3143
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2393
3144
|
"button",
|
|
2394
3145
|
{
|
|
2395
3146
|
type: "button",
|
|
@@ -2409,7 +3160,7 @@ function ReportDialog({
|
|
|
2409
3160
|
cursor: "pointer",
|
|
2410
3161
|
lineHeight: 0
|
|
2411
3162
|
},
|
|
2412
|
-
children: /* @__PURE__ */ (0,
|
|
3163
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { width: "26", height: "26", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2413
3164
|
"path",
|
|
2414
3165
|
{
|
|
2415
3166
|
d: "M12 3l2.6 5.3 5.9.9-4.3 4.1 1 5.8L12 16.4 6.8 19.1l1-5.8L3.5 9.2l5.9-.9L12 3z",
|
|
@@ -2426,7 +3177,7 @@ function ReportDialog({
|
|
|
2426
3177
|
]
|
|
2427
3178
|
}
|
|
2428
3179
|
),
|
|
2429
|
-
step === 1 && sendFeedback2 && /* @__PURE__ */ (0,
|
|
3180
|
+
step === 1 && sendFeedback2 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
2430
3181
|
"div",
|
|
2431
3182
|
{
|
|
2432
3183
|
style: {
|
|
@@ -2436,13 +3187,13 @@ function ReportDialog({
|
|
|
2436
3187
|
marginBottom: "16px"
|
|
2437
3188
|
},
|
|
2438
3189
|
children: [
|
|
2439
|
-
/* @__PURE__ */ (0,
|
|
2440
|
-
/* @__PURE__ */ (0,
|
|
2441
|
-
/* @__PURE__ */ (0,
|
|
3190
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { style: { flex: 1, height: "1px", background: t2.border } }),
|
|
3191
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { style: { fontSize: "11px", color: t2.textMuted }, children: "or report something" }),
|
|
3192
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { style: { flex: 1, height: "1px", background: t2.border } })
|
|
2442
3193
|
]
|
|
2443
3194
|
}
|
|
2444
3195
|
),
|
|
2445
|
-
step === 1 && screenshots.length > 0 && /* @__PURE__ */ (0,
|
|
3196
|
+
step === 1 && screenshots.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
2446
3197
|
"div",
|
|
2447
3198
|
{
|
|
2448
3199
|
style: {
|
|
@@ -2456,7 +3207,7 @@ function ReportDialog({
|
|
|
2456
3207
|
background: t2.inputBg
|
|
2457
3208
|
},
|
|
2458
3209
|
children: [
|
|
2459
|
-
/* @__PURE__ */ (0,
|
|
3210
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2460
3211
|
"img",
|
|
2461
3212
|
{
|
|
2462
3213
|
src: screenshots[0],
|
|
@@ -2471,8 +3222,8 @@ function ReportDialog({
|
|
|
2471
3222
|
}
|
|
2472
3223
|
}
|
|
2473
3224
|
),
|
|
2474
|
-
/* @__PURE__ */ (0,
|
|
2475
|
-
/* @__PURE__ */ (0,
|
|
3225
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { style: { fontSize: "11px", color: t2.textMuted, flex: 1 }, children: "Screenshot attached" }),
|
|
3226
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2476
3227
|
"button",
|
|
2477
3228
|
{
|
|
2478
3229
|
type: "button",
|
|
@@ -2493,7 +3244,7 @@ function ReportDialog({
|
|
|
2493
3244
|
]
|
|
2494
3245
|
}
|
|
2495
3246
|
),
|
|
2496
|
-
step === 1 && /* @__PURE__ */ (0,
|
|
3247
|
+
step === 1 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2497
3248
|
"div",
|
|
2498
3249
|
{
|
|
2499
3250
|
ref: tileGridRef,
|
|
@@ -2503,7 +3254,7 @@ function ReportDialog({
|
|
|
2503
3254
|
gridTemplateColumns: "1fr 1fr 1fr",
|
|
2504
3255
|
gap: "10px"
|
|
2505
3256
|
},
|
|
2506
|
-
children: availableTypes.map((type) => /* @__PURE__ */ (0,
|
|
3257
|
+
children: availableTypes.map((type) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
2507
3258
|
"button",
|
|
2508
3259
|
{
|
|
2509
3260
|
type: "button",
|
|
@@ -2533,7 +3284,7 @@ function ReportDialog({
|
|
|
2533
3284
|
},
|
|
2534
3285
|
children: [
|
|
2535
3286
|
getTypeIcon(type, t2.accent, 22),
|
|
2536
|
-
/* @__PURE__ */ (0,
|
|
3287
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2537
3288
|
"span",
|
|
2538
3289
|
{
|
|
2539
3290
|
style: {
|
|
@@ -2551,8 +3302,8 @@ function ReportDialog({
|
|
|
2551
3302
|
))
|
|
2552
3303
|
}
|
|
2553
3304
|
),
|
|
2554
|
-
step === 2 && /* @__PURE__ */ (0,
|
|
2555
|
-
/* @__PURE__ */ (0,
|
|
3305
|
+
step === 2 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
3306
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
2556
3307
|
"button",
|
|
2557
3308
|
{
|
|
2558
3309
|
type: "button",
|
|
@@ -2575,11 +3326,11 @@ function ReportDialog({
|
|
|
2575
3326
|
children: [
|
|
2576
3327
|
getTypeIcon(reportType, isRating ? "#f59e0b" : t2.accent, 13),
|
|
2577
3328
|
getTypeLabel(reportType),
|
|
2578
|
-
/* @__PURE__ */ (0,
|
|
3329
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { style: { color: t2.textMuted, fontWeight: 400 }, children: "\xB7 change" })
|
|
2579
3330
|
]
|
|
2580
3331
|
}
|
|
2581
3332
|
),
|
|
2582
|
-
isRating && /* @__PURE__ */ (0,
|
|
3333
|
+
isRating && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2583
3334
|
"div",
|
|
2584
3335
|
{
|
|
2585
3336
|
style: {
|
|
@@ -2590,7 +3341,7 @@ function ReportDialog({
|
|
|
2590
3341
|
onMouseLeave: () => setHoveredStar(0),
|
|
2591
3342
|
children: [1, 2, 3, 4, 5].map((star) => {
|
|
2592
3343
|
const filled = star <= (hoveredStar || rating);
|
|
2593
|
-
return /* @__PURE__ */ (0,
|
|
3344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2594
3345
|
"button",
|
|
2595
3346
|
{
|
|
2596
3347
|
type: "button",
|
|
@@ -2607,7 +3358,7 @@ function ReportDialog({
|
|
|
2607
3358
|
cursor: "pointer",
|
|
2608
3359
|
lineHeight: 0
|
|
2609
3360
|
},
|
|
2610
|
-
children: /* @__PURE__ */ (0,
|
|
3361
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { width: "30", height: "30", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2611
3362
|
"path",
|
|
2612
3363
|
{
|
|
2613
3364
|
d: "M12 3l2.6 5.3 5.9.9-4.3 4.1 1 5.8L12 16.4 6.8 19.1l1-5.8L3.5 9.2l5.9-.9L12 3z",
|
|
@@ -2623,8 +3374,47 @@ function ReportDialog({
|
|
|
2623
3374
|
})
|
|
2624
3375
|
}
|
|
2625
3376
|
),
|
|
2626
|
-
/* @__PURE__ */ (0,
|
|
2627
|
-
|
|
3377
|
+
assist && !isRating && !assistUsed && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
3378
|
+
"button",
|
|
3379
|
+
{
|
|
3380
|
+
type: "button",
|
|
3381
|
+
onClick: () => {
|
|
3382
|
+
setAssistNotice(null);
|
|
3383
|
+
setAssistOpen(true);
|
|
3384
|
+
},
|
|
3385
|
+
style: {
|
|
3386
|
+
display: "inline-flex",
|
|
3387
|
+
alignItems: "center",
|
|
3388
|
+
gap: "6px",
|
|
3389
|
+
marginBottom: "10px",
|
|
3390
|
+
// 8px vertical keeps the tap target at ~32px.
|
|
3391
|
+
padding: "8px 10px",
|
|
3392
|
+
borderRadius: "6px",
|
|
3393
|
+
border: `1px solid ${t2.accent}`,
|
|
3394
|
+
background: "transparent",
|
|
3395
|
+
color: t2.accent,
|
|
3396
|
+
fontSize: "12px",
|
|
3397
|
+
fontWeight: 600,
|
|
3398
|
+
fontFamily: "inherit",
|
|
3399
|
+
cursor: "pointer"
|
|
3400
|
+
},
|
|
3401
|
+
title: "Answer a question or two and the assistant writes the report for you",
|
|
3402
|
+
children: [
|
|
3403
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3404
|
+
"path",
|
|
3405
|
+
{
|
|
3406
|
+
d: "M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5L12 3zM19 15l.75 2.25L22 18l-2.25.75L19 21l-.75-2.25L16 18l2.25-.75L19 15z",
|
|
3407
|
+
stroke: t2.accent,
|
|
3408
|
+
strokeWidth: "1.5",
|
|
3409
|
+
strokeLinejoin: "round"
|
|
3410
|
+
}
|
|
3411
|
+
) }),
|
|
3412
|
+
"Describe it with AI"
|
|
3413
|
+
]
|
|
3414
|
+
}
|
|
3415
|
+
),
|
|
3416
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { style: { position: "relative" }, children: [
|
|
3417
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2628
3418
|
"textarea",
|
|
2629
3419
|
{
|
|
2630
3420
|
ref: textareaRef,
|
|
@@ -2665,7 +3455,7 @@ function ReportDialog({
|
|
|
2665
3455
|
autoFocus: true
|
|
2666
3456
|
}
|
|
2667
3457
|
),
|
|
2668
|
-
(isListening || isTranscribing) && /* @__PURE__ */ (0,
|
|
3458
|
+
(isListening || isTranscribing) && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
2669
3459
|
"span",
|
|
2670
3460
|
{
|
|
2671
3461
|
style: {
|
|
@@ -2683,7 +3473,7 @@ function ReportDialog({
|
|
|
2683
3473
|
zIndex: 1
|
|
2684
3474
|
},
|
|
2685
3475
|
children: [
|
|
2686
|
-
/* @__PURE__ */ (0,
|
|
3476
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2687
3477
|
"span",
|
|
2688
3478
|
{
|
|
2689
3479
|
style: {
|
|
@@ -2698,7 +3488,7 @@ function ReportDialog({
|
|
|
2698
3488
|
}
|
|
2699
3489
|
),
|
|
2700
3490
|
isTranscribing ? "Transcribing\u2026" : "REC",
|
|
2701
|
-
isListening && !isTranscribing && /* @__PURE__ */ (0,
|
|
3491
|
+
isListening && !isTranscribing && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2702
3492
|
"span",
|
|
2703
3493
|
{
|
|
2704
3494
|
style: {
|
|
@@ -2725,7 +3515,7 @@ function ReportDialog({
|
|
|
2725
3515
|
dur: "0.55s",
|
|
2726
3516
|
delay: "0.15s"
|
|
2727
3517
|
}
|
|
2728
|
-
].map((b, i) => /* @__PURE__ */ (0,
|
|
3518
|
+
].map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2729
3519
|
"span",
|
|
2730
3520
|
{
|
|
2731
3521
|
style: {
|
|
@@ -2745,18 +3535,18 @@ function ReportDialog({
|
|
|
2745
3535
|
]
|
|
2746
3536
|
}
|
|
2747
3537
|
),
|
|
2748
|
-
enhanceText2 && /* @__PURE__ */ (0,
|
|
3538
|
+
enhanceText2 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
2749
3539
|
"button",
|
|
2750
3540
|
{
|
|
2751
3541
|
type: "button",
|
|
2752
3542
|
onClick: async () => {
|
|
2753
|
-
var
|
|
3543
|
+
var _a2;
|
|
2754
3544
|
if (!description.trim() || isEnhancing) return;
|
|
2755
3545
|
setIsEnhancing(true);
|
|
2756
3546
|
try {
|
|
2757
3547
|
const polished = await enhanceText2(
|
|
2758
3548
|
description,
|
|
2759
|
-
(
|
|
3549
|
+
(_a2 = screenshots[0]) != null ? _a2 : null
|
|
2760
3550
|
);
|
|
2761
3551
|
if (polished && polished !== description) {
|
|
2762
3552
|
setOriginalDescription(description);
|
|
@@ -2790,7 +3580,7 @@ function ReportDialog({
|
|
|
2790
3580
|
},
|
|
2791
3581
|
title: "Polish grammar \u2014 preserves your meaning",
|
|
2792
3582
|
children: [
|
|
2793
|
-
/* @__PURE__ */ (0,
|
|
3583
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2794
3584
|
"svg",
|
|
2795
3585
|
{
|
|
2796
3586
|
width: "11",
|
|
@@ -2798,7 +3588,7 @@ function ReportDialog({
|
|
|
2798
3588
|
viewBox: "0 0 24 24",
|
|
2799
3589
|
fill: "none",
|
|
2800
3590
|
"aria-hidden": "true",
|
|
2801
|
-
children: /* @__PURE__ */ (0,
|
|
3591
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2802
3592
|
"path",
|
|
2803
3593
|
{
|
|
2804
3594
|
d: "M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5L12 3zM19 15l.75 2.25L22 18l-2.25.75L19 21l-.75-2.25L16 18l2.25-.75L19 15z",
|
|
@@ -2813,7 +3603,7 @@ function ReportDialog({
|
|
|
2813
3603
|
]
|
|
2814
3604
|
}
|
|
2815
3605
|
),
|
|
2816
|
-
transcribeAudio2 && /* @__PURE__ */ (0,
|
|
3606
|
+
transcribeAudio2 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2817
3607
|
"button",
|
|
2818
3608
|
{
|
|
2819
3609
|
type: "button",
|
|
@@ -2839,7 +3629,7 @@ function ReportDialog({
|
|
|
2839
3629
|
padding: 0,
|
|
2840
3630
|
transition: "border-color 0.2s ease, color 0.2s ease"
|
|
2841
3631
|
},
|
|
2842
|
-
children: isListening ? /* @__PURE__ */ (0,
|
|
3632
|
+
children: isListening ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2843
3633
|
"svg",
|
|
2844
3634
|
{
|
|
2845
3635
|
width: "12",
|
|
@@ -2847,7 +3637,7 @@ function ReportDialog({
|
|
|
2847
3637
|
viewBox: "0 0 24 24",
|
|
2848
3638
|
fill: "currentColor",
|
|
2849
3639
|
"aria-hidden": "true",
|
|
2850
|
-
children: /* @__PURE__ */ (0,
|
|
3640
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2851
3641
|
"rect",
|
|
2852
3642
|
{
|
|
2853
3643
|
x: "6",
|
|
@@ -2858,7 +3648,7 @@ function ReportDialog({
|
|
|
2858
3648
|
}
|
|
2859
3649
|
)
|
|
2860
3650
|
}
|
|
2861
|
-
) : /* @__PURE__ */ (0,
|
|
3651
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
2862
3652
|
"svg",
|
|
2863
3653
|
{
|
|
2864
3654
|
width: "13",
|
|
@@ -2867,7 +3657,7 @@ function ReportDialog({
|
|
|
2867
3657
|
fill: "none",
|
|
2868
3658
|
"aria-hidden": "true",
|
|
2869
3659
|
children: [
|
|
2870
|
-
/* @__PURE__ */ (0,
|
|
3660
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2871
3661
|
"rect",
|
|
2872
3662
|
{
|
|
2873
3663
|
x: "9",
|
|
@@ -2879,7 +3669,7 @@ function ReportDialog({
|
|
|
2879
3669
|
strokeWidth: "1.8"
|
|
2880
3670
|
}
|
|
2881
3671
|
),
|
|
2882
|
-
/* @__PURE__ */ (0,
|
|
3672
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2883
3673
|
"path",
|
|
2884
3674
|
{
|
|
2885
3675
|
d: "M5 10a7 7 0 0014 0M12 19v3M9 22h6",
|
|
@@ -2894,7 +3684,7 @@ function ReportDialog({
|
|
|
2894
3684
|
}
|
|
2895
3685
|
)
|
|
2896
3686
|
] }),
|
|
2897
|
-
transcribeAudio2 && !isListening && !isTranscribing && /* @__PURE__ */ (0,
|
|
3687
|
+
transcribeAudio2 && !isListening && !isTranscribing && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
2898
3688
|
"div",
|
|
2899
3689
|
{
|
|
2900
3690
|
style: {
|
|
@@ -2908,16 +3698,16 @@ function ReportDialog({
|
|
|
2908
3698
|
userSelect: "none"
|
|
2909
3699
|
},
|
|
2910
3700
|
children: [
|
|
2911
|
-
/* @__PURE__ */ (0,
|
|
2912
|
-
/* @__PURE__ */ (0,
|
|
2913
|
-
/* @__PURE__ */ (0,
|
|
2914
|
-
/* @__PURE__ */ (0,
|
|
3701
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("svg", { width: "11", height: "11", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
3702
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z" }),
|
|
3703
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
|
|
3704
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("line", { x1: "12", x2: "12", y1: "19", y2: "22" })
|
|
2915
3705
|
] }),
|
|
2916
3706
|
"Hold Space to speak \u2014 we'll transcribe it"
|
|
2917
3707
|
]
|
|
2918
3708
|
}
|
|
2919
3709
|
),
|
|
2920
|
-
isEnhanced && originalDescription !== null && /* @__PURE__ */ (0,
|
|
3710
|
+
isEnhanced && originalDescription !== null && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
2921
3711
|
"div",
|
|
2922
3712
|
{
|
|
2923
3713
|
style: {
|
|
@@ -2931,7 +3721,7 @@ function ReportDialog({
|
|
|
2931
3721
|
border: `1px solid ${t2.accent}40`
|
|
2932
3722
|
},
|
|
2933
3723
|
children: [
|
|
2934
|
-
/* @__PURE__ */ (0,
|
|
3724
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2935
3725
|
"svg",
|
|
2936
3726
|
{
|
|
2937
3727
|
width: "12",
|
|
@@ -2939,7 +3729,7 @@ function ReportDialog({
|
|
|
2939
3729
|
viewBox: "0 0 24 24",
|
|
2940
3730
|
fill: "none",
|
|
2941
3731
|
style: { flexShrink: 0 },
|
|
2942
|
-
children: /* @__PURE__ */ (0,
|
|
3732
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2943
3733
|
"path",
|
|
2944
3734
|
{
|
|
2945
3735
|
d: "M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5L12 3z",
|
|
@@ -2950,7 +3740,7 @@ function ReportDialog({
|
|
|
2950
3740
|
)
|
|
2951
3741
|
}
|
|
2952
3742
|
),
|
|
2953
|
-
/* @__PURE__ */ (0,
|
|
3743
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2954
3744
|
"span",
|
|
2955
3745
|
{
|
|
2956
3746
|
style: {
|
|
@@ -2961,7 +3751,7 @@ function ReportDialog({
|
|
|
2961
3751
|
children: "AI enhanced"
|
|
2962
3752
|
}
|
|
2963
3753
|
),
|
|
2964
|
-
/* @__PURE__ */ (0,
|
|
3754
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2965
3755
|
"button",
|
|
2966
3756
|
{
|
|
2967
3757
|
type: "button",
|
|
@@ -2983,7 +3773,7 @@ function ReportDialog({
|
|
|
2983
3773
|
children: "Keep"
|
|
2984
3774
|
}
|
|
2985
3775
|
),
|
|
2986
|
-
/* @__PURE__ */ (0,
|
|
3776
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2987
3777
|
"button",
|
|
2988
3778
|
{
|
|
2989
3779
|
type: "button",
|
|
@@ -3009,7 +3799,7 @@ function ReportDialog({
|
|
|
3009
3799
|
]
|
|
3010
3800
|
}
|
|
3011
3801
|
),
|
|
3012
|
-
voiceError && /* @__PURE__ */ (0,
|
|
3802
|
+
voiceError && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3013
3803
|
"p",
|
|
3014
3804
|
{
|
|
3015
3805
|
style: {
|
|
@@ -3021,8 +3811,21 @@ function ReportDialog({
|
|
|
3021
3811
|
children: voiceError
|
|
3022
3812
|
}
|
|
3023
3813
|
),
|
|
3024
|
-
|
|
3025
|
-
|
|
3814
|
+
assistNotice && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3815
|
+
"p",
|
|
3816
|
+
{
|
|
3817
|
+
style: {
|
|
3818
|
+
color: t2.textMuted,
|
|
3819
|
+
fontSize: "12px",
|
|
3820
|
+
marginTop: "6px",
|
|
3821
|
+
marginBottom: 0,
|
|
3822
|
+
lineHeight: 1.5
|
|
3823
|
+
},
|
|
3824
|
+
children: assistNotice
|
|
3825
|
+
}
|
|
3826
|
+
),
|
|
3827
|
+
!isRating && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { style: { marginTop: "10px" }, children: [
|
|
3828
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
3026
3829
|
"span",
|
|
3027
3830
|
{
|
|
3028
3831
|
style: {
|
|
@@ -3038,7 +3841,7 @@ function ReportDialog({
|
|
|
3038
3841
|
]
|
|
3039
3842
|
}
|
|
3040
3843
|
),
|
|
3041
|
-
screenshots.length > 0 && /* @__PURE__ */ (0,
|
|
3844
|
+
screenshots.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3042
3845
|
"div",
|
|
3043
3846
|
{
|
|
3044
3847
|
style: {
|
|
@@ -3047,7 +3850,7 @@ function ReportDialog({
|
|
|
3047
3850
|
gap: "8px",
|
|
3048
3851
|
marginBottom: "8px"
|
|
3049
3852
|
},
|
|
3050
|
-
children: screenshots.map((src, i) => /* @__PURE__ */ (0,
|
|
3853
|
+
children: screenshots.map((src, i) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
3051
3854
|
"div",
|
|
3052
3855
|
{
|
|
3053
3856
|
style: {
|
|
@@ -3056,7 +3859,7 @@ function ReportDialog({
|
|
|
3056
3859
|
height: "56px"
|
|
3057
3860
|
},
|
|
3058
3861
|
children: [
|
|
3059
|
-
/* @__PURE__ */ (0,
|
|
3862
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3060
3863
|
"img",
|
|
3061
3864
|
{
|
|
3062
3865
|
src,
|
|
@@ -3074,7 +3877,7 @@ function ReportDialog({
|
|
|
3074
3877
|
}
|
|
3075
3878
|
}
|
|
3076
3879
|
),
|
|
3077
|
-
/* @__PURE__ */ (0,
|
|
3880
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3078
3881
|
"button",
|
|
3079
3882
|
{
|
|
3080
3883
|
type: "button",
|
|
@@ -3100,14 +3903,14 @@ function ReportDialog({
|
|
|
3100
3903
|
alignItems: "center",
|
|
3101
3904
|
justifyContent: "center"
|
|
3102
3905
|
},
|
|
3103
|
-
children: /* @__PURE__ */ (0,
|
|
3906
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3104
3907
|
"svg",
|
|
3105
3908
|
{
|
|
3106
3909
|
width: "8",
|
|
3107
3910
|
height: "8",
|
|
3108
3911
|
viewBox: "0 0 10 10",
|
|
3109
3912
|
fill: "none",
|
|
3110
|
-
children: /* @__PURE__ */ (0,
|
|
3913
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3111
3914
|
"path",
|
|
3112
3915
|
{
|
|
3113
3916
|
d: "M1 1L9 9M9 1L1 9",
|
|
@@ -3120,7 +3923,7 @@ function ReportDialog({
|
|
|
3120
3923
|
)
|
|
3121
3924
|
}
|
|
3122
3925
|
),
|
|
3123
|
-
/* @__PURE__ */ (0,
|
|
3926
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3124
3927
|
"button",
|
|
3125
3928
|
{
|
|
3126
3929
|
type: "button",
|
|
@@ -3145,14 +3948,14 @@ function ReportDialog({
|
|
|
3145
3948
|
justifyContent: "center",
|
|
3146
3949
|
boxShadow: "0 2px 8px rgba(0,0,0,0.45)"
|
|
3147
3950
|
},
|
|
3148
|
-
children: /* @__PURE__ */ (0,
|
|
3951
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3149
3952
|
"svg",
|
|
3150
3953
|
{
|
|
3151
3954
|
width: "12",
|
|
3152
3955
|
height: "12",
|
|
3153
3956
|
viewBox: "0 0 24 24",
|
|
3154
3957
|
fill: "none",
|
|
3155
|
-
children: /* @__PURE__ */ (0,
|
|
3958
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3156
3959
|
"path",
|
|
3157
3960
|
{
|
|
3158
3961
|
d: "M12 20h9M16.5 3.5a2.12 2.12 0 013 3L7 19l-4 1 1-4L16.5 3.5z",
|
|
@@ -3172,7 +3975,7 @@ function ReportDialog({
|
|
|
3172
3975
|
))
|
|
3173
3976
|
}
|
|
3174
3977
|
),
|
|
3175
|
-
attachments.length > 0 && /* @__PURE__ */ (0,
|
|
3978
|
+
attachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3176
3979
|
"div",
|
|
3177
3980
|
{
|
|
3178
3981
|
style: {
|
|
@@ -3181,7 +3984,7 @@ function ReportDialog({
|
|
|
3181
3984
|
gap: "6px",
|
|
3182
3985
|
marginBottom: "8px"
|
|
3183
3986
|
},
|
|
3184
|
-
children: attachments.map((a, i) => /* @__PURE__ */ (0,
|
|
3987
|
+
children: attachments.map((a, i) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
3185
3988
|
"div",
|
|
3186
3989
|
{
|
|
3187
3990
|
style: {
|
|
@@ -3193,7 +3996,7 @@ function ReportDialog({
|
|
|
3193
3996
|
border: `1px solid ${t2.border}`
|
|
3194
3997
|
},
|
|
3195
3998
|
children: [
|
|
3196
|
-
/* @__PURE__ */ (0,
|
|
3999
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
3197
4000
|
"svg",
|
|
3198
4001
|
{
|
|
3199
4002
|
width: "14",
|
|
@@ -3202,7 +4005,7 @@ function ReportDialog({
|
|
|
3202
4005
|
fill: "none",
|
|
3203
4006
|
style: { flexShrink: 0, opacity: 0.6 },
|
|
3204
4007
|
children: [
|
|
3205
|
-
/* @__PURE__ */ (0,
|
|
4008
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3206
4009
|
"path",
|
|
3207
4010
|
{
|
|
3208
4011
|
d: "M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z",
|
|
@@ -3212,7 +4015,7 @@ function ReportDialog({
|
|
|
3212
4015
|
strokeLinejoin: "round"
|
|
3213
4016
|
}
|
|
3214
4017
|
),
|
|
3215
|
-
/* @__PURE__ */ (0,
|
|
4018
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3216
4019
|
"path",
|
|
3217
4020
|
{
|
|
3218
4021
|
d: "M14 2v6h6",
|
|
@@ -3225,7 +4028,7 @@ function ReportDialog({
|
|
|
3225
4028
|
]
|
|
3226
4029
|
}
|
|
3227
4030
|
),
|
|
3228
|
-
/* @__PURE__ */ (0,
|
|
4031
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3229
4032
|
"span",
|
|
3230
4033
|
{
|
|
3231
4034
|
style: {
|
|
@@ -3239,7 +4042,7 @@ function ReportDialog({
|
|
|
3239
4042
|
children: a.name
|
|
3240
4043
|
}
|
|
3241
4044
|
),
|
|
3242
|
-
/* @__PURE__ */ (0,
|
|
4045
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
3243
4046
|
"span",
|
|
3244
4047
|
{
|
|
3245
4048
|
style: { fontSize: "10px", color: t2.textMuted },
|
|
@@ -3249,7 +4052,7 @@ function ReportDialog({
|
|
|
3249
4052
|
]
|
|
3250
4053
|
}
|
|
3251
4054
|
),
|
|
3252
|
-
/* @__PURE__ */ (0,
|
|
4055
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3253
4056
|
"button",
|
|
3254
4057
|
{
|
|
3255
4058
|
type: "button",
|
|
@@ -3273,14 +4076,14 @@ function ReportDialog({
|
|
|
3273
4076
|
justifyContent: "center",
|
|
3274
4077
|
flexShrink: 0
|
|
3275
4078
|
},
|
|
3276
|
-
children: /* @__PURE__ */ (0,
|
|
4079
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3277
4080
|
"svg",
|
|
3278
4081
|
{
|
|
3279
4082
|
width: "8",
|
|
3280
4083
|
height: "8",
|
|
3281
4084
|
viewBox: "0 0 10 10",
|
|
3282
4085
|
fill: "none",
|
|
3283
|
-
children: /* @__PURE__ */ (0,
|
|
4086
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3284
4087
|
"path",
|
|
3285
4088
|
{
|
|
3286
4089
|
d: "M1 1L9 9M9 1L1 9",
|
|
@@ -3299,12 +4102,12 @@ function ReportDialog({
|
|
|
3299
4102
|
))
|
|
3300
4103
|
}
|
|
3301
4104
|
),
|
|
3302
|
-
/* @__PURE__ */ (0,
|
|
4105
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3303
4106
|
"div",
|
|
3304
4107
|
{
|
|
3305
4108
|
onClick: () => {
|
|
3306
|
-
var
|
|
3307
|
-
return (
|
|
4109
|
+
var _a2;
|
|
4110
|
+
return (_a2 = fileInputRef.current) == null ? void 0 : _a2.click();
|
|
3308
4111
|
},
|
|
3309
4112
|
onDrop: (e) => {
|
|
3310
4113
|
e.preventDefault();
|
|
@@ -3325,7 +4128,7 @@ function ReportDialog({
|
|
|
3325
4128
|
background: screenshotDragOver ? isDark ? "rgba(34,211,238,0.06)" : "rgba(8,145,178,0.04)" : "transparent",
|
|
3326
4129
|
transition: "border-color 0.15s ease, background 0.15s ease"
|
|
3327
4130
|
},
|
|
3328
|
-
children: screenshots.length + attachments.length > 0 ? /* @__PURE__ */ (0,
|
|
4131
|
+
children: screenshots.length + attachments.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3329
4132
|
"p",
|
|
3330
4133
|
{
|
|
3331
4134
|
style: {
|
|
@@ -3336,8 +4139,8 @@ function ReportDialog({
|
|
|
3336
4139
|
},
|
|
3337
4140
|
children: screenshotDragOver ? "Drop to attach" : "+ Add more \xB7 Drag & drop \xB7 Paste"
|
|
3338
4141
|
}
|
|
3339
|
-
) : /* @__PURE__ */ (0,
|
|
3340
|
-
/* @__PURE__ */ (0,
|
|
4142
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
4143
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
3341
4144
|
"svg",
|
|
3342
4145
|
{
|
|
3343
4146
|
width: "22",
|
|
@@ -3350,7 +4153,7 @@ function ReportDialog({
|
|
|
3350
4153
|
opacity: 0.45
|
|
3351
4154
|
},
|
|
3352
4155
|
children: [
|
|
3353
|
-
/* @__PURE__ */ (0,
|
|
4156
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3354
4157
|
"rect",
|
|
3355
4158
|
{
|
|
3356
4159
|
x: "3",
|
|
@@ -3362,7 +4165,7 @@ function ReportDialog({
|
|
|
3362
4165
|
strokeWidth: "1.5"
|
|
3363
4166
|
}
|
|
3364
4167
|
),
|
|
3365
|
-
/* @__PURE__ */ (0,
|
|
4168
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3366
4169
|
"circle",
|
|
3367
4170
|
{
|
|
3368
4171
|
cx: "8.5",
|
|
@@ -3372,7 +4175,7 @@ function ReportDialog({
|
|
|
3372
4175
|
strokeWidth: "1.5"
|
|
3373
4176
|
}
|
|
3374
4177
|
),
|
|
3375
|
-
/* @__PURE__ */ (0,
|
|
4178
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3376
4179
|
"path",
|
|
3377
4180
|
{
|
|
3378
4181
|
d: "M21 15l-5-5L5 21",
|
|
@@ -3385,7 +4188,7 @@ function ReportDialog({
|
|
|
3385
4188
|
]
|
|
3386
4189
|
}
|
|
3387
4190
|
),
|
|
3388
|
-
/* @__PURE__ */ (0,
|
|
4191
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3389
4192
|
"p",
|
|
3390
4193
|
{
|
|
3391
4194
|
style: {
|
|
@@ -3397,7 +4200,7 @@ function ReportDialog({
|
|
|
3397
4200
|
children: screenshotDragOver ? "Drop to attach" : "Add screenshots or files"
|
|
3398
4201
|
}
|
|
3399
4202
|
),
|
|
3400
|
-
/* @__PURE__ */ (0,
|
|
4203
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3401
4204
|
"p",
|
|
3402
4205
|
{
|
|
3403
4206
|
style: {
|
|
@@ -3412,8 +4215,8 @@ function ReportDialog({
|
|
|
3412
4215
|
}
|
|
3413
4216
|
)
|
|
3414
4217
|
] }),
|
|
3415
|
-
showSeverity && reportType === "BUG" && /* @__PURE__ */ (0,
|
|
3416
|
-
/* @__PURE__ */ (0,
|
|
4218
|
+
showSeverity && reportType === "BUG" && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { style: { marginTop: "10px" }, children: [
|
|
4219
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3417
4220
|
"span",
|
|
3418
4221
|
{
|
|
3419
4222
|
style: {
|
|
@@ -3425,7 +4228,7 @@ function ReportDialog({
|
|
|
3425
4228
|
children: "Severity"
|
|
3426
4229
|
}
|
|
3427
4230
|
),
|
|
3428
|
-
/* @__PURE__ */ (0,
|
|
4231
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { style: { display: "flex", gap: "6px" }, children: ["low", "medium", "high"].map((s) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3429
4232
|
"button",
|
|
3430
4233
|
{
|
|
3431
4234
|
type: "button",
|
|
@@ -3449,7 +4252,7 @@ function ReportDialog({
|
|
|
3449
4252
|
s
|
|
3450
4253
|
)) })
|
|
3451
4254
|
] }),
|
|
3452
|
-
validationError && /* @__PURE__ */ (0,
|
|
4255
|
+
validationError && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3453
4256
|
"p",
|
|
3454
4257
|
{
|
|
3455
4258
|
style: {
|
|
@@ -3460,7 +4263,7 @@ function ReportDialog({
|
|
|
3460
4263
|
children: validationError
|
|
3461
4264
|
}
|
|
3462
4265
|
),
|
|
3463
|
-
/* @__PURE__ */ (0,
|
|
4266
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3464
4267
|
"button",
|
|
3465
4268
|
{
|
|
3466
4269
|
type: "button",
|
|
@@ -3487,7 +4290,7 @@ function ReportDialog({
|
|
|
3487
4290
|
] })
|
|
3488
4291
|
}
|
|
3489
4292
|
),
|
|
3490
|
-
/* @__PURE__ */ (0,
|
|
4293
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
3491
4294
|
"div",
|
|
3492
4295
|
{
|
|
3493
4296
|
style: {
|
|
@@ -3499,8 +4302,8 @@ function ReportDialog({
|
|
|
3499
4302
|
gap: "12px"
|
|
3500
4303
|
},
|
|
3501
4304
|
children: [
|
|
3502
|
-
/* @__PURE__ */ (0,
|
|
3503
|
-
/* @__PURE__ */ (0,
|
|
4305
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ReporterChip, { reporter, t: t2 }),
|
|
4306
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3504
4307
|
"span",
|
|
3505
4308
|
{
|
|
3506
4309
|
style: {
|
|
@@ -3522,7 +4325,7 @@ function ReportDialog({
|
|
|
3522
4325
|
),
|
|
3523
4326
|
document.body
|
|
3524
4327
|
),
|
|
3525
|
-
/* @__PURE__ */ (0,
|
|
4328
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3526
4329
|
"input",
|
|
3527
4330
|
{
|
|
3528
4331
|
ref: fileInputRef,
|
|
@@ -3534,7 +4337,7 @@ function ReportDialog({
|
|
|
3534
4337
|
}
|
|
3535
4338
|
),
|
|
3536
4339
|
isOpen && previewIndex !== null && screenshots[previewIndex] && (0, import_react_dom.createPortal)(
|
|
3537
|
-
/* @__PURE__ */ (0,
|
|
4340
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
3538
4341
|
"div",
|
|
3539
4342
|
{
|
|
3540
4343
|
"data-glitchgrab-layer": "",
|
|
@@ -3556,7 +4359,7 @@ function ReportDialog({
|
|
|
3556
4359
|
},
|
|
3557
4360
|
onMouseDown: (e) => e.stopPropagation(),
|
|
3558
4361
|
children: [
|
|
3559
|
-
/* @__PURE__ */ (0,
|
|
4362
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
3560
4363
|
"div",
|
|
3561
4364
|
{
|
|
3562
4365
|
ref: previewImgRef,
|
|
@@ -3568,7 +4371,7 @@ function ReportDialog({
|
|
|
3568
4371
|
},
|
|
3569
4372
|
onClick: (e) => e.stopPropagation(),
|
|
3570
4373
|
children: [
|
|
3571
|
-
/* @__PURE__ */ (0,
|
|
4374
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3572
4375
|
"div",
|
|
3573
4376
|
{
|
|
3574
4377
|
ref: previewScrollRef,
|
|
@@ -3587,7 +4390,7 @@ function ReportDialog({
|
|
|
3587
4390
|
touchAction: "none",
|
|
3588
4391
|
cursor: "grab"
|
|
3589
4392
|
} : { maxWidth: "100%", lineHeight: 0 },
|
|
3590
|
-
children: /* @__PURE__ */ (0,
|
|
4393
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3591
4394
|
"img",
|
|
3592
4395
|
{
|
|
3593
4396
|
ref: previewImgElRef,
|
|
@@ -3615,7 +4418,7 @@ function ReportDialog({
|
|
|
3615
4418
|
)
|
|
3616
4419
|
}
|
|
3617
4420
|
),
|
|
3618
|
-
/* @__PURE__ */ (0,
|
|
4421
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
3619
4422
|
"button",
|
|
3620
4423
|
{
|
|
3621
4424
|
type: "button",
|
|
@@ -3643,7 +4446,7 @@ function ReportDialog({
|
|
|
3643
4446
|
animation: "gg-pulse 2s ease-in-out infinite"
|
|
3644
4447
|
},
|
|
3645
4448
|
children: [
|
|
3646
|
-
/* @__PURE__ */ (0,
|
|
4449
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3647
4450
|
"path",
|
|
3648
4451
|
{
|
|
3649
4452
|
d: "M12 20h9M16.5 3.5a2.12 2.12 0 013 3L7 19l-4 1 1-4L16.5 3.5z",
|
|
@@ -3660,7 +4463,7 @@ function ReportDialog({
|
|
|
3660
4463
|
]
|
|
3661
4464
|
}
|
|
3662
4465
|
),
|
|
3663
|
-
/* @__PURE__ */ (0,
|
|
4466
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3664
4467
|
"div",
|
|
3665
4468
|
{
|
|
3666
4469
|
style: {
|
|
@@ -3669,7 +4472,7 @@ function ReportDialog({
|
|
|
3669
4472
|
alignItems: "center",
|
|
3670
4473
|
gap: "12px"
|
|
3671
4474
|
},
|
|
3672
|
-
children: /* @__PURE__ */ (0,
|
|
4475
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3673
4476
|
"span",
|
|
3674
4477
|
{
|
|
3675
4478
|
style: {
|
|
@@ -3691,7 +4494,7 @@ function ReportDialog({
|
|
|
3691
4494
|
document.body
|
|
3692
4495
|
),
|
|
3693
4496
|
isOpen && annotatingIndex !== null && screenshots[annotatingIndex] && (0, import_react_dom.createPortal)(
|
|
3694
|
-
/* @__PURE__ */ (0,
|
|
4497
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3695
4498
|
AnnotationCanvas,
|
|
3696
4499
|
{
|
|
3697
4500
|
imageSrc: screenshots[annotatingIndex],
|
|
@@ -3705,6 +4508,52 @@ function ReportDialog({
|
|
|
3705
4508
|
}
|
|
3706
4509
|
),
|
|
3707
4510
|
document.body
|
|
4511
|
+
),
|
|
4512
|
+
isOpen && sheetUp && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4513
|
+
AssistSheet,
|
|
4514
|
+
{
|
|
4515
|
+
assist,
|
|
4516
|
+
theme: {
|
|
4517
|
+
bg: t2.bg,
|
|
4518
|
+
bgSecondary: t2.bgSecondary,
|
|
4519
|
+
border: t2.border,
|
|
4520
|
+
text: t2.text,
|
|
4521
|
+
textMuted: t2.textMuted,
|
|
4522
|
+
inputBg: t2.inputBg,
|
|
4523
|
+
inputBorder: t2.inputBorder,
|
|
4524
|
+
accent: t2.accent,
|
|
4525
|
+
accentText: t2.accentText
|
|
4526
|
+
},
|
|
4527
|
+
screenshot: (_a = screenshots[0]) != null ? _a : null,
|
|
4528
|
+
attachmentCount: screenshots.length + attachments.length,
|
|
4529
|
+
context: { ...assistContext != null ? assistContext : {}, reportType },
|
|
4530
|
+
reportTypeLabel: getTypeLabel(reportType),
|
|
4531
|
+
projectSlot: headerSlot,
|
|
4532
|
+
reporterName: (_b = reporter == null ? void 0 : reporter.name) != null ? _b : null,
|
|
4533
|
+
description,
|
|
4534
|
+
onDescriptionChange: (value) => {
|
|
4535
|
+
setDescription(value);
|
|
4536
|
+
if (validationError) setValidationError(null);
|
|
4537
|
+
},
|
|
4538
|
+
severity,
|
|
4539
|
+
onSeverityChange: setSeverity,
|
|
4540
|
+
showSeverity,
|
|
4541
|
+
isSubmitting,
|
|
4542
|
+
submitted,
|
|
4543
|
+
onSend: () => void handleSubmit(),
|
|
4544
|
+
onDegrade: (message) => {
|
|
4545
|
+
setAssistOpen(false);
|
|
4546
|
+
setAssistUsed(true);
|
|
4547
|
+
setAssistNotice(message);
|
|
4548
|
+
},
|
|
4549
|
+
onClose: () => {
|
|
4550
|
+
setAssistOpen(false);
|
|
4551
|
+
requestAnimationFrame(() => {
|
|
4552
|
+
var _a2;
|
|
4553
|
+
return (_a2 = textareaRef.current) == null ? void 0 : _a2.focus();
|
|
4554
|
+
});
|
|
4555
|
+
}
|
|
4556
|
+
}
|
|
3708
4557
|
)
|
|
3709
4558
|
] });
|
|
3710
4559
|
}
|
|
@@ -3758,7 +4607,7 @@ function getTypeIcon(type, color, size = 24) {
|
|
|
3758
4607
|
};
|
|
3759
4608
|
switch (type) {
|
|
3760
4609
|
case "RATING":
|
|
3761
|
-
return /* @__PURE__ */ (0,
|
|
4610
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3762
4611
|
"path",
|
|
3763
4612
|
{
|
|
3764
4613
|
d: "M12 3l2.6 5.3 5.9.9-4.3 4.1 1 5.8L12 16.4 6.8 19.1l1-5.8L3.5 9.2l5.9-.9L12 3z",
|
|
@@ -3768,7 +4617,7 @@ function getTypeIcon(type, color, size = 24) {
|
|
|
3768
4617
|
}
|
|
3769
4618
|
) });
|
|
3770
4619
|
case "BUG":
|
|
3771
|
-
return /* @__PURE__ */ (0,
|
|
4620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3772
4621
|
"path",
|
|
3773
4622
|
{
|
|
3774
4623
|
d: "M8 2L6.5 3.5M16 2L17.5 3.5M3 9H7M17 9H21M12 2a5 5 0 015 5v4a5 5 0 01-10 0V7a5 5 0 015-5zM7 16l-2 3M17 16l2 3",
|
|
@@ -3778,7 +4627,7 @@ function getTypeIcon(type, color, size = 24) {
|
|
|
3778
4627
|
}
|
|
3779
4628
|
) });
|
|
3780
4629
|
case "FEATURE_REQUEST":
|
|
3781
|
-
return /* @__PURE__ */ (0,
|
|
4630
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3782
4631
|
"path",
|
|
3783
4632
|
{
|
|
3784
4633
|
d: "M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2z",
|
|
@@ -3788,8 +4637,8 @@ function getTypeIcon(type, color, size = 24) {
|
|
|
3788
4637
|
}
|
|
3789
4638
|
) });
|
|
3790
4639
|
case "UI_IMPROVEMENT":
|
|
3791
|
-
return /* @__PURE__ */ (0,
|
|
3792
|
-
/* @__PURE__ */ (0,
|
|
4640
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("svg", { ...props, children: [
|
|
4641
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3793
4642
|
"rect",
|
|
3794
4643
|
{
|
|
3795
4644
|
x: "3",
|
|
@@ -3801,7 +4650,7 @@ function getTypeIcon(type, color, size = 24) {
|
|
|
3801
4650
|
strokeWidth: "1.5"
|
|
3802
4651
|
}
|
|
3803
4652
|
),
|
|
3804
|
-
/* @__PURE__ */ (0,
|
|
4653
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3805
4654
|
"path",
|
|
3806
4655
|
{
|
|
3807
4656
|
d: "M3 9h18M9 21V9",
|
|
@@ -3812,7 +4661,7 @@ function getTypeIcon(type, color, size = 24) {
|
|
|
3812
4661
|
)
|
|
3813
4662
|
] });
|
|
3814
4663
|
case "PERFORMANCE":
|
|
3815
|
-
return /* @__PURE__ */ (0,
|
|
4664
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3816
4665
|
"path",
|
|
3817
4666
|
{
|
|
3818
4667
|
d: "M12 21a9 9 0 100-18 9 9 0 000 18zM12 12l4-4M12 7v.01",
|
|
@@ -3823,7 +4672,7 @@ function getTypeIcon(type, color, size = 24) {
|
|
|
3823
4672
|
}
|
|
3824
4673
|
) });
|
|
3825
4674
|
case "SECURITY":
|
|
3826
|
-
return /* @__PURE__ */ (0,
|
|
4675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3827
4676
|
"path",
|
|
3828
4677
|
{
|
|
3829
4678
|
d: "M12 3l7 3v5c0 4.5-3 8.5-7 10-4-1.5-7-5.5-7-10V6l7-3z",
|
|
@@ -3833,9 +4682,9 @@ function getTypeIcon(type, color, size = 24) {
|
|
|
3833
4682
|
}
|
|
3834
4683
|
) });
|
|
3835
4684
|
case "QUESTION":
|
|
3836
|
-
return /* @__PURE__ */ (0,
|
|
3837
|
-
/* @__PURE__ */ (0,
|
|
3838
|
-
/* @__PURE__ */ (0,
|
|
4685
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("svg", { ...props, children: [
|
|
4686
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("circle", { cx: "12", cy: "12", r: "10", stroke: color, strokeWidth: "1.5" }),
|
|
4687
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3839
4688
|
"path",
|
|
3840
4689
|
{
|
|
3841
4690
|
d: "M9.09 9a3 3 0 015.83 1c0 2-3 3-3 3M12 17h.01",
|
|
@@ -3847,7 +4696,7 @@ function getTypeIcon(type, color, size = 24) {
|
|
|
3847
4696
|
)
|
|
3848
4697
|
] });
|
|
3849
4698
|
case "OTHER":
|
|
3850
|
-
return /* @__PURE__ */ (0,
|
|
4699
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3851
4700
|
"path",
|
|
3852
4701
|
{
|
|
3853
4702
|
d: "M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2v10z",
|
|
@@ -3860,8 +4709,8 @@ function getTypeIcon(type, color, size = 24) {
|
|
|
3860
4709
|
}
|
|
3861
4710
|
|
|
3862
4711
|
// src/booking-dialog.tsx
|
|
3863
|
-
var
|
|
3864
|
-
var
|
|
4712
|
+
var import_react4 = require("react");
|
|
4713
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
3865
4714
|
var t = {
|
|
3866
4715
|
bg: "#141414",
|
|
3867
4716
|
surface: "#1c1c1c",
|
|
@@ -3898,28 +4747,28 @@ function BookingDialog({
|
|
|
3898
4747
|
onClose
|
|
3899
4748
|
}) {
|
|
3900
4749
|
var _a;
|
|
3901
|
-
const [step, setStep] = (0,
|
|
3902
|
-
const [slots, setSlots] = (0,
|
|
3903
|
-
const [heading, setHeading] = (0,
|
|
4750
|
+
const [step, setStep] = (0, import_react4.useState)("slots");
|
|
4751
|
+
const [slots, setSlots] = (0, import_react4.useState)(null);
|
|
4752
|
+
const [heading, setHeading] = (0, import_react4.useState)({
|
|
3904
4753
|
title: "Book a demo",
|
|
3905
4754
|
description: null
|
|
3906
4755
|
});
|
|
3907
|
-
const [whatsappUrl, setWhatsappUrl] = (0,
|
|
3908
|
-
const [selected, setSelected] = (0,
|
|
3909
|
-
const [name, setName] = (0,
|
|
3910
|
-
const [email, setEmail] = (0,
|
|
3911
|
-
const [phone, setPhone] = (0,
|
|
3912
|
-
const [note, setNote] = (0,
|
|
3913
|
-
const [code, setCode] = (0,
|
|
3914
|
-
const [bookingId, setBookingId] = (0,
|
|
3915
|
-
const [meetUrl, setMeetUrl] = (0,
|
|
3916
|
-
const [busy, setBusy] = (0,
|
|
3917
|
-
const [error, setError] = (0,
|
|
3918
|
-
const headers = (0,
|
|
4756
|
+
const [whatsappUrl, setWhatsappUrl] = (0, import_react4.useState)(null);
|
|
4757
|
+
const [selected, setSelected] = (0, import_react4.useState)(null);
|
|
4758
|
+
const [name, setName] = (0, import_react4.useState)("");
|
|
4759
|
+
const [email, setEmail] = (0, import_react4.useState)("");
|
|
4760
|
+
const [phone, setPhone] = (0, import_react4.useState)("");
|
|
4761
|
+
const [note, setNote] = (0, import_react4.useState)("");
|
|
4762
|
+
const [code, setCode] = (0, import_react4.useState)("");
|
|
4763
|
+
const [bookingId, setBookingId] = (0, import_react4.useState)(null);
|
|
4764
|
+
const [meetUrl, setMeetUrl] = (0, import_react4.useState)(null);
|
|
4765
|
+
const [busy, setBusy] = (0, import_react4.useState)(false);
|
|
4766
|
+
const [error, setError] = (0, import_react4.useState)(null);
|
|
4767
|
+
const headers = (0, import_react4.useMemo)(
|
|
3919
4768
|
() => ({ Authorization: `Bearer ${token}`, "Content-Type": "application/json" }),
|
|
3920
4769
|
[token]
|
|
3921
4770
|
);
|
|
3922
|
-
const loadSlots = (0,
|
|
4771
|
+
const loadSlots = (0, import_react4.useCallback)(async () => {
|
|
3923
4772
|
var _a2, _b, _c;
|
|
3924
4773
|
setError(null);
|
|
3925
4774
|
setSlots(null);
|
|
@@ -3944,7 +4793,7 @@ function BookingDialog({
|
|
|
3944
4793
|
setSlots([]);
|
|
3945
4794
|
}
|
|
3946
4795
|
}, [baseUrl, headers]);
|
|
3947
|
-
(0,
|
|
4796
|
+
(0, import_react4.useEffect)(() => {
|
|
3948
4797
|
if (!open) return;
|
|
3949
4798
|
setStep("slots");
|
|
3950
4799
|
setSelected(null);
|
|
@@ -3953,7 +4802,7 @@ function BookingDialog({
|
|
|
3953
4802
|
setError(null);
|
|
3954
4803
|
void loadSlots();
|
|
3955
4804
|
}, [open, loadSlots]);
|
|
3956
|
-
(0,
|
|
4805
|
+
(0, import_react4.useEffect)(() => {
|
|
3957
4806
|
if (!open) return;
|
|
3958
4807
|
const onKey = (e) => {
|
|
3959
4808
|
if (e.key === "Escape") onClose();
|
|
@@ -4023,7 +4872,7 @@ function BookingDialog({
|
|
|
4023
4872
|
}
|
|
4024
4873
|
}
|
|
4025
4874
|
const canSubmitDetails = name.trim() && email.includes("@") && phone.replace(/\D/g, "").length >= 8;
|
|
4026
|
-
return /* @__PURE__ */ (0,
|
|
4875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
4027
4876
|
"div",
|
|
4028
4877
|
{
|
|
4029
4878
|
onClick: (e) => {
|
|
@@ -4040,7 +4889,7 @@ function BookingDialog({
|
|
|
4040
4889
|
padding: 16,
|
|
4041
4890
|
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
4042
4891
|
},
|
|
4043
|
-
children: /* @__PURE__ */ (0,
|
|
4892
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
4044
4893
|
"div",
|
|
4045
4894
|
{
|
|
4046
4895
|
role: "dialog",
|
|
@@ -4058,7 +4907,7 @@ function BookingDialog({
|
|
|
4058
4907
|
overflow: "hidden"
|
|
4059
4908
|
},
|
|
4060
4909
|
children: [
|
|
4061
|
-
/* @__PURE__ */ (0,
|
|
4910
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
4062
4911
|
"div",
|
|
4063
4912
|
{
|
|
4064
4913
|
style: {
|
|
@@ -4070,11 +4919,11 @@ function BookingDialog({
|
|
|
4070
4919
|
gap: 12
|
|
4071
4920
|
},
|
|
4072
4921
|
children: [
|
|
4073
|
-
/* @__PURE__ */ (0,
|
|
4074
|
-
/* @__PURE__ */ (0,
|
|
4075
|
-
heading.description && /* @__PURE__ */ (0,
|
|
4922
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
|
|
4923
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { fontSize: 15, fontWeight: 600 }, children: heading.title }),
|
|
4924
|
+
heading.description && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { fontSize: 12, color: t.muted, marginTop: 2 }, children: heading.description })
|
|
4076
4925
|
] }),
|
|
4077
|
-
/* @__PURE__ */ (0,
|
|
4926
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
4078
4927
|
"button",
|
|
4079
4928
|
{
|
|
4080
4929
|
onClick: onClose,
|
|
@@ -4086,10 +4935,10 @@ function BookingDialog({
|
|
|
4086
4935
|
]
|
|
4087
4936
|
}
|
|
4088
4937
|
),
|
|
4089
|
-
/* @__PURE__ */ (0,
|
|
4090
|
-
error && /* @__PURE__ */ (0,
|
|
4091
|
-
step === "slots" && /* @__PURE__ */ (0,
|
|
4092
|
-
whatsappUrl && /* @__PURE__ */ (0,
|
|
4938
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { padding: 18, overflowY: "auto", flex: "1 1 auto" }, children: [
|
|
4939
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { color: t.danger, fontSize: 12, marginBottom: 12, lineHeight: 1.5 }, children: error }),
|
|
4940
|
+
step === "slots" && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
4941
|
+
whatsappUrl && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
4093
4942
|
"a",
|
|
4094
4943
|
{
|
|
4095
4944
|
href: whatsappUrl,
|
|
@@ -4108,15 +4957,15 @@ function BookingDialog({
|
|
|
4108
4957
|
},
|
|
4109
4958
|
children: [
|
|
4110
4959
|
"\u{1F4AC} Rather book on WhatsApp?",
|
|
4111
|
-
/* @__PURE__ */ (0,
|
|
4960
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { style: { display: "block", fontSize: 11, color: t.muted, marginTop: 2 }, children: "We'll ask the same questions in chat." })
|
|
4112
4961
|
]
|
|
4113
4962
|
}
|
|
4114
4963
|
),
|
|
4115
|
-
slots === null && /* @__PURE__ */ (0,
|
|
4116
|
-
(slots == null ? void 0 : slots.length) === 0 && !error && /* @__PURE__ */ (0,
|
|
4117
|
-
[...byDay.entries()].map(([day, daySlots]) => /* @__PURE__ */ (0,
|
|
4118
|
-
/* @__PURE__ */ (0,
|
|
4119
|
-
/* @__PURE__ */ (0,
|
|
4964
|
+
slots === null && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { color: t.muted, fontSize: 13 }, children: "Finding times\u2026" }),
|
|
4965
|
+
(slots == null ? void 0 : slots.length) === 0 && !error && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { color: t.muted, fontSize: 13 }, children: "No times available right now." }),
|
|
4966
|
+
[...byDay.entries()].map(([day, daySlots]) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { marginBottom: 18 }, children: [
|
|
4967
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { fontSize: 11, color: t.muted, marginBottom: 8, textTransform: "uppercase", letterSpacing: ".6px" }, children: formatDay(daySlots[0].startsAt) }),
|
|
4968
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { display: "flex", flexWrap: "wrap", gap: 8 }, children: daySlots.map((slot) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
4120
4969
|
"button",
|
|
4121
4970
|
{
|
|
4122
4971
|
onClick: () => {
|
|
@@ -4138,13 +4987,13 @@ function BookingDialog({
|
|
|
4138
4987
|
)) })
|
|
4139
4988
|
] }, day))
|
|
4140
4989
|
] }),
|
|
4141
|
-
step === "details" && selected && /* @__PURE__ */ (0,
|
|
4142
|
-
/* @__PURE__ */ (0,
|
|
4990
|
+
step === "details" && selected && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: [
|
|
4991
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { fontSize: 13, color: t.muted }, children: [
|
|
4143
4992
|
formatDay(selected.startsAt),
|
|
4144
4993
|
" \xB7 ",
|
|
4145
4994
|
formatTime(selected.startsAt),
|
|
4146
4995
|
" \xB7 ",
|
|
4147
|
-
/* @__PURE__ */ (0,
|
|
4996
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
4148
4997
|
"button",
|
|
4149
4998
|
{
|
|
4150
4999
|
onClick: () => setStep("slots"),
|
|
@@ -4153,9 +5002,9 @@ function BookingDialog({
|
|
|
4153
5002
|
}
|
|
4154
5003
|
)
|
|
4155
5004
|
] }),
|
|
4156
|
-
/* @__PURE__ */ (0,
|
|
4157
|
-
/* @__PURE__ */ (0,
|
|
4158
|
-
/* @__PURE__ */ (0,
|
|
5005
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Field, { label: "Your name", value: name, onChange: setName }),
|
|
5006
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Field, { label: "Email", value: email, onChange: setEmail, type: "email" }),
|
|
5007
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
4159
5008
|
Field,
|
|
4160
5009
|
{
|
|
4161
5010
|
label: "Mobile number",
|
|
@@ -4165,8 +5014,8 @@ function BookingDialog({
|
|
|
4165
5014
|
hint: "We send a code here to confirm, then a reminder before the call."
|
|
4166
5015
|
}
|
|
4167
5016
|
),
|
|
4168
|
-
/* @__PURE__ */ (0,
|
|
4169
|
-
/* @__PURE__ */ (0,
|
|
5017
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Field, { label: "Anything we should know? (optional)", value: note, onChange: setNote }),
|
|
5018
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
4170
5019
|
"button",
|
|
4171
5020
|
{
|
|
4172
5021
|
onClick: startBooking,
|
|
@@ -4176,10 +5025,10 @@ function BookingDialog({
|
|
|
4176
5025
|
}
|
|
4177
5026
|
)
|
|
4178
5027
|
] }),
|
|
4179
|
-
step === "code" && /* @__PURE__ */ (0,
|
|
4180
|
-
/* @__PURE__ */ (0,
|
|
4181
|
-
/* @__PURE__ */ (0,
|
|
4182
|
-
/* @__PURE__ */ (0,
|
|
5028
|
+
step === "code" && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: [
|
|
5029
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { fontSize: 13, color: t.muted, lineHeight: 1.5 }, children: "We sent a 4-digit code to your phone. Your slot is held for 10 minutes." }),
|
|
5030
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Field, { label: "Code", value: code, onChange: setCode }),
|
|
5031
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
4183
5032
|
"button",
|
|
4184
5033
|
{
|
|
4185
5034
|
onClick: confirmBooking,
|
|
@@ -4189,15 +5038,15 @@ function BookingDialog({
|
|
|
4189
5038
|
}
|
|
4190
5039
|
)
|
|
4191
5040
|
] }),
|
|
4192
|
-
step === "done" && /* @__PURE__ */ (0,
|
|
4193
|
-
/* @__PURE__ */ (0,
|
|
4194
|
-
/* @__PURE__ */ (0,
|
|
5041
|
+
step === "done" && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: [
|
|
5042
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { fontSize: 15, fontWeight: 600 }, children: "You're booked." }),
|
|
5043
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { fontSize: 13, color: t.muted, lineHeight: 1.6 }, children: [
|
|
4195
5044
|
selected && `${formatDay(selected.startsAt)} at ${formatTime(selected.startsAt)}. `,
|
|
4196
5045
|
"A calendar invite is on its way to ",
|
|
4197
5046
|
email,
|
|
4198
5047
|
", and we'll send a WhatsApp reminder before the call."
|
|
4199
5048
|
] }),
|
|
4200
|
-
meetUrl && /* @__PURE__ */ (0,
|
|
5049
|
+
meetUrl && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("a", { href: meetUrl, target: "_blank", rel: "noreferrer", style: { ...primaryStyle(false), textAlign: "center", textDecoration: "none" }, children: "Open the meeting link" })
|
|
4201
5050
|
] })
|
|
4202
5051
|
] })
|
|
4203
5052
|
]
|
|
@@ -4226,9 +5075,9 @@ function Field({
|
|
|
4226
5075
|
type = "text",
|
|
4227
5076
|
hint
|
|
4228
5077
|
}) {
|
|
4229
|
-
return /* @__PURE__ */ (0,
|
|
5078
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { style: { display: "block", fontSize: 11, color: t.muted }, children: [
|
|
4230
5079
|
label,
|
|
4231
|
-
/* @__PURE__ */ (0,
|
|
5080
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
4232
5081
|
"input",
|
|
4233
5082
|
{
|
|
4234
5083
|
type,
|
|
@@ -4249,7 +5098,7 @@ function Field({
|
|
|
4249
5098
|
}
|
|
4250
5099
|
}
|
|
4251
5100
|
),
|
|
4252
|
-
hint && /* @__PURE__ */ (0,
|
|
5101
|
+
hint && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { marginTop: 4, fontSize: 10, color: t.muted }, children: hint })
|
|
4253
5102
|
] });
|
|
4254
5103
|
}
|
|
4255
5104
|
|
|
@@ -4390,11 +5239,11 @@ function matchesShortcut(e) {
|
|
|
4390
5239
|
}
|
|
4391
5240
|
|
|
4392
5241
|
// src/provider.tsx
|
|
4393
|
-
var
|
|
5242
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
4394
5243
|
var DEFAULT_BASE_URL2 = "https://glitchgrab.dev";
|
|
4395
|
-
var GlitchgrabContext = (0,
|
|
5244
|
+
var GlitchgrabContext = (0, import_react5.createContext)(null);
|
|
4396
5245
|
function useGlitchgrab() {
|
|
4397
|
-
const ctx = (0,
|
|
5246
|
+
const ctx = (0, import_react5.useContext)(GlitchgrabContext);
|
|
4398
5247
|
if (!ctx) {
|
|
4399
5248
|
throw new Error("useGlitchgrab must be used within a GlitchgrabProvider");
|
|
4400
5249
|
}
|
|
@@ -4417,7 +5266,7 @@ function GlitchgrabProviderInner({
|
|
|
4417
5266
|
context: appContext2,
|
|
4418
5267
|
responseBodyOrigins: responseBodyOrigins2
|
|
4419
5268
|
}) {
|
|
4420
|
-
const visitedPagesRef = (0,
|
|
5269
|
+
const visitedPagesRef = (0, import_react5.useRef)([]);
|
|
4421
5270
|
setRelease(release2);
|
|
4422
5271
|
if (appContext2) setContexts(appContext2);
|
|
4423
5272
|
registerCaptureConfig({
|
|
@@ -4429,12 +5278,12 @@ function GlitchgrabProviderInner({
|
|
|
4429
5278
|
onError,
|
|
4430
5279
|
onReportSent
|
|
4431
5280
|
});
|
|
4432
|
-
(0,
|
|
5281
|
+
(0, import_react5.useEffect)(() => {
|
|
4433
5282
|
if (enableBreadcrumbs) {
|
|
4434
5283
|
initBreadcrumbs(maxBreadcrumbs2, { responseBodyOrigins: responseBodyOrigins2 });
|
|
4435
5284
|
}
|
|
4436
5285
|
}, [enableBreadcrumbs, maxBreadcrumbs2, responseBodyOrigins2 == null ? void 0 : responseBodyOrigins2.join(",")]);
|
|
4437
|
-
(0,
|
|
5286
|
+
(0, import_react5.useEffect)(() => {
|
|
4438
5287
|
try {
|
|
4439
5288
|
if (typeof window === "undefined") return;
|
|
4440
5289
|
const trackPage = () => {
|
|
@@ -4471,7 +5320,7 @@ function GlitchgrabProviderInner({
|
|
|
4471
5320
|
} catch (e) {
|
|
4472
5321
|
}
|
|
4473
5322
|
}, []);
|
|
4474
|
-
(0,
|
|
5323
|
+
(0, import_react5.useEffect)(() => {
|
|
4475
5324
|
try {
|
|
4476
5325
|
if (typeof window === "undefined") return;
|
|
4477
5326
|
if (process.env.NODE_ENV === "development") return;
|
|
@@ -4598,7 +5447,7 @@ function GlitchgrabProviderInner({
|
|
|
4598
5447
|
} catch (e) {
|
|
4599
5448
|
}
|
|
4600
5449
|
}, [token, baseUrl, onError, onReportSent, session, ignoreErrors]);
|
|
4601
|
-
const report = (0,
|
|
5450
|
+
const report = (0, import_react5.useCallback)(
|
|
4602
5451
|
async (type, description, metadata) => {
|
|
4603
5452
|
var _a;
|
|
4604
5453
|
try {
|
|
@@ -4632,11 +5481,11 @@ function GlitchgrabProviderInner({
|
|
|
4632
5481
|
},
|
|
4633
5482
|
[token, baseUrl, onReportSent, session]
|
|
4634
5483
|
);
|
|
4635
|
-
const reportBug = (0,
|
|
5484
|
+
const reportBug = (0, import_react5.useCallback)(
|
|
4636
5485
|
(description, metadata) => report("BUG", description, metadata),
|
|
4637
5486
|
[report]
|
|
4638
5487
|
);
|
|
4639
|
-
const feedback = (0,
|
|
5488
|
+
const feedback = (0, import_react5.useCallback)(
|
|
4640
5489
|
async (rating, message, metadata) => {
|
|
4641
5490
|
try {
|
|
4642
5491
|
const context = captureContext(visitedPagesRef.current);
|
|
@@ -4664,32 +5513,32 @@ function GlitchgrabProviderInner({
|
|
|
4664
5513
|
},
|
|
4665
5514
|
[token, baseUrl, session]
|
|
4666
5515
|
);
|
|
4667
|
-
const openFeedbackDialog = (0,
|
|
5516
|
+
const openFeedbackDialog = (0, import_react5.useCallback)(() => {
|
|
4668
5517
|
if (typeof window !== "undefined") {
|
|
4669
5518
|
window.dispatchEvent(
|
|
4670
5519
|
new CustomEvent("glitchgrab:open-report", { detail: { type: "RATING" } })
|
|
4671
5520
|
);
|
|
4672
5521
|
}
|
|
4673
5522
|
}, []);
|
|
4674
|
-
const captureError2 = (0,
|
|
5523
|
+
const captureError2 = (0, import_react5.useCallback)(
|
|
4675
5524
|
(error, options) => {
|
|
4676
5525
|
captureError(error, options);
|
|
4677
5526
|
},
|
|
4678
5527
|
[]
|
|
4679
5528
|
);
|
|
4680
|
-
const setContext2 = (0,
|
|
5529
|
+
const setContext2 = (0, import_react5.useCallback)((key, value) => {
|
|
4681
5530
|
setContext(key, value);
|
|
4682
5531
|
}, []);
|
|
4683
|
-
const setContexts2 = (0,
|
|
5532
|
+
const setContexts2 = (0, import_react5.useCallback)((values) => {
|
|
4684
5533
|
setContexts(values);
|
|
4685
5534
|
}, []);
|
|
4686
|
-
const addBreadcrumb2 = (0,
|
|
5535
|
+
const addBreadcrumb2 = (0, import_react5.useCallback)(
|
|
4687
5536
|
(message, data) => {
|
|
4688
5537
|
addBreadcrumb("custom", message, data);
|
|
4689
5538
|
},
|
|
4690
5539
|
[]
|
|
4691
5540
|
);
|
|
4692
|
-
const enhance = (0,
|
|
5541
|
+
const enhance = (0, import_react5.useCallback)(
|
|
4693
5542
|
async (text, screenshot) => {
|
|
4694
5543
|
try {
|
|
4695
5544
|
const ctx = captureContext(visitedPagesRef.current);
|
|
@@ -4705,7 +5554,27 @@ function GlitchgrabProviderInner({
|
|
|
4705
5554
|
},
|
|
4706
5555
|
[token, baseUrl]
|
|
4707
5556
|
);
|
|
4708
|
-
const
|
|
5557
|
+
const assist = (0, import_react5.useCallback)(
|
|
5558
|
+
async (params) => {
|
|
5559
|
+
var _a;
|
|
5560
|
+
const ctx = captureContext(visitedPagesRef.current);
|
|
5561
|
+
return assistTurn(
|
|
5562
|
+
{
|
|
5563
|
+
...params,
|
|
5564
|
+
context: {
|
|
5565
|
+
...(_a = params.context) != null ? _a : {},
|
|
5566
|
+
url: ctx.url,
|
|
5567
|
+
visitedPages: ctx.visitedPages.slice(-5),
|
|
5568
|
+
breadcrumbs: ctx.breadcrumbs.slice(-25).map((b) => ({ type: b.type, message: b.message }))
|
|
5569
|
+
}
|
|
5570
|
+
},
|
|
5571
|
+
token,
|
|
5572
|
+
baseUrl
|
|
5573
|
+
);
|
|
5574
|
+
},
|
|
5575
|
+
[token, baseUrl]
|
|
5576
|
+
);
|
|
5577
|
+
const transcribe = (0, import_react5.useCallback)(
|
|
4709
5578
|
async (blob) => {
|
|
4710
5579
|
try {
|
|
4711
5580
|
return await transcribeAudio(blob, token, baseUrl);
|
|
@@ -4715,12 +5584,12 @@ function GlitchgrabProviderInner({
|
|
|
4715
5584
|
},
|
|
4716
5585
|
[token, baseUrl]
|
|
4717
5586
|
);
|
|
4718
|
-
const openReportDialog = (0,
|
|
5587
|
+
const openReportDialog = (0, import_react5.useCallback)((options) => {
|
|
4719
5588
|
if (typeof window !== "undefined") {
|
|
4720
5589
|
window.dispatchEvent(new CustomEvent("glitchgrab:open-report", { detail: options }));
|
|
4721
5590
|
}
|
|
4722
5591
|
}, []);
|
|
4723
|
-
(0,
|
|
5592
|
+
(0, import_react5.useEffect)(() => {
|
|
4724
5593
|
try {
|
|
4725
5594
|
if (typeof document === "undefined") return;
|
|
4726
5595
|
document.documentElement.setAttribute("data-glitchgrab-sdk", "1");
|
|
@@ -4728,10 +5597,11 @@ function GlitchgrabProviderInner({
|
|
|
4728
5597
|
} catch (e) {
|
|
4729
5598
|
}
|
|
4730
5599
|
}, []);
|
|
4731
|
-
const [projectName, setProjectName] = (0,
|
|
4732
|
-
const [
|
|
4733
|
-
const
|
|
4734
|
-
(0,
|
|
5600
|
+
const [projectName, setProjectName] = (0, import_react5.useState)(null);
|
|
5601
|
+
const [aiAssist, setAiAssist] = (0, import_react5.useState)(false);
|
|
5602
|
+
const [bookingOpen, setBookingOpen] = (0, import_react5.useState)(false);
|
|
5603
|
+
const openBookingDialog = (0, import_react5.useCallback)(() => setBookingOpen(true), []);
|
|
5604
|
+
(0, import_react5.useEffect)(() => {
|
|
4735
5605
|
let cancelled = false;
|
|
4736
5606
|
fetch(`${baseUrl}/api/v1/sdk/project`, {
|
|
4737
5607
|
headers: { Authorization: `Bearer ${token}` }
|
|
@@ -4739,13 +5609,14 @@ function GlitchgrabProviderInner({
|
|
|
4739
5609
|
var _a;
|
|
4740
5610
|
if (cancelled || !(json == null ? void 0 : json.success) || !((_a = json.data) == null ? void 0 : _a.name)) return;
|
|
4741
5611
|
setProjectName(json.data.name);
|
|
5612
|
+
setAiAssist(json.data.aiAssist === true);
|
|
4742
5613
|
}).catch(() => {
|
|
4743
5614
|
});
|
|
4744
5615
|
return () => {
|
|
4745
5616
|
cancelled = true;
|
|
4746
5617
|
};
|
|
4747
5618
|
}, [baseUrl, token]);
|
|
4748
|
-
(0,
|
|
5619
|
+
(0, import_react5.useEffect)(() => {
|
|
4749
5620
|
try {
|
|
4750
5621
|
if (typeof window === "undefined") return;
|
|
4751
5622
|
const handleKeyDown = (e) => {
|
|
@@ -4759,7 +5630,7 @@ function GlitchgrabProviderInner({
|
|
|
4759
5630
|
} catch (e) {
|
|
4760
5631
|
}
|
|
4761
5632
|
}, [openReportDialog]);
|
|
4762
|
-
const reporter = (0,
|
|
5633
|
+
const reporter = (0, import_react5.useMemo)(() => {
|
|
4763
5634
|
var _a;
|
|
4764
5635
|
if (!session) return null;
|
|
4765
5636
|
const avatar = (_a = session.avatarUrl) != null ? _a : session.image;
|
|
@@ -4769,11 +5640,11 @@ function GlitchgrabProviderInner({
|
|
|
4769
5640
|
avatarUrl: typeof avatar === "string" ? avatar : null
|
|
4770
5641
|
};
|
|
4771
5642
|
}, [session]);
|
|
4772
|
-
const [shortcutLabel, setShortcutLabel] = (0,
|
|
4773
|
-
(0,
|
|
5643
|
+
const [shortcutLabel, setShortcutLabel] = (0, import_react5.useState)(GLITCHGRAB_SHORTCUT2);
|
|
5644
|
+
(0, import_react5.useEffect)(() => {
|
|
4774
5645
|
setShortcutLabel(getShortcutLabel2());
|
|
4775
5646
|
}, []);
|
|
4776
|
-
return /* @__PURE__ */ (0,
|
|
5647
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
4777
5648
|
GlitchgrabContext.Provider,
|
|
4778
5649
|
{
|
|
4779
5650
|
value: {
|
|
@@ -4793,7 +5664,7 @@ function GlitchgrabProviderInner({
|
|
|
4793
5664
|
shortcutLabel
|
|
4794
5665
|
},
|
|
4795
5666
|
children: [
|
|
4796
|
-
/* @__PURE__ */ (0,
|
|
5667
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
4797
5668
|
GlitchgrabErrorBoundary,
|
|
4798
5669
|
{
|
|
4799
5670
|
token,
|
|
@@ -4805,7 +5676,7 @@ function GlitchgrabProviderInner({
|
|
|
4805
5676
|
children
|
|
4806
5677
|
}
|
|
4807
5678
|
),
|
|
4808
|
-
/* @__PURE__ */ (0,
|
|
5679
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
4809
5680
|
BookingDialog,
|
|
4810
5681
|
{
|
|
4811
5682
|
token,
|
|
@@ -4814,19 +5685,20 @@ function GlitchgrabProviderInner({
|
|
|
4814
5685
|
onClose: () => setBookingOpen(false)
|
|
4815
5686
|
}
|
|
4816
5687
|
),
|
|
4817
|
-
/* @__PURE__ */ (0,
|
|
5688
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
4818
5689
|
ReportDialog,
|
|
4819
5690
|
{
|
|
4820
5691
|
report,
|
|
4821
5692
|
sendFeedback: feedback,
|
|
4822
5693
|
enhanceText: enhance,
|
|
5694
|
+
assist: aiAssist ? assist : void 0,
|
|
4823
5695
|
transcribeAudio: transcribe,
|
|
4824
5696
|
types,
|
|
4825
5697
|
showSeverity,
|
|
4826
5698
|
reporter,
|
|
4827
|
-
headerSlot: projectName ? /* @__PURE__ */ (0,
|
|
5699
|
+
headerSlot: projectName ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: { fontSize: 11, color: "#9aa0a6" }, children: [
|
|
4828
5700
|
"Reporting to ",
|
|
4829
|
-
/* @__PURE__ */ (0,
|
|
5701
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { style: { color: "#e5e5e5" }, children: projectName })
|
|
4830
5702
|
] }) : null
|
|
4831
5703
|
}
|
|
4832
5704
|
)
|
|
@@ -4835,21 +5707,21 @@ function GlitchgrabProviderInner({
|
|
|
4835
5707
|
);
|
|
4836
5708
|
}
|
|
4837
5709
|
function GlitchgrabProvider(props) {
|
|
4838
|
-
if (!props.token) return /* @__PURE__ */ (0,
|
|
5710
|
+
if (!props.token) return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children: props.children });
|
|
4839
5711
|
const resolvedProps = {
|
|
4840
5712
|
...props,
|
|
4841
5713
|
baseUrl: props.baseUrl || DEFAULT_BASE_URL2
|
|
4842
5714
|
};
|
|
4843
5715
|
try {
|
|
4844
|
-
return /* @__PURE__ */ (0,
|
|
5716
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(GlitchgrabProviderInner, { ...resolvedProps });
|
|
4845
5717
|
} catch (e) {
|
|
4846
|
-
return /* @__PURE__ */ (0,
|
|
5718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children: props.children });
|
|
4847
5719
|
}
|
|
4848
5720
|
}
|
|
4849
5721
|
|
|
4850
5722
|
// src/report-button.tsx
|
|
4851
|
-
var
|
|
4852
|
-
var
|
|
5723
|
+
var import_react6 = require("react");
|
|
5724
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
4853
5725
|
function useGlitchgrabSafe() {
|
|
4854
5726
|
try {
|
|
4855
5727
|
return useGlitchgrab();
|
|
@@ -4864,7 +5736,7 @@ function ReportButton({
|
|
|
4864
5736
|
children
|
|
4865
5737
|
}) {
|
|
4866
5738
|
var _a, _b;
|
|
4867
|
-
const [capturing, setCapturing] = (0,
|
|
5739
|
+
const [capturing, setCapturing] = (0, import_react6.useState)(false);
|
|
4868
5740
|
const glitchgrab = useGlitchgrabSafe();
|
|
4869
5741
|
if (!glitchgrab) return null;
|
|
4870
5742
|
const handleClick = async () => {
|
|
@@ -4873,7 +5745,7 @@ function ReportButton({
|
|
|
4873
5745
|
setCapturing(false);
|
|
4874
5746
|
};
|
|
4875
5747
|
if (children) {
|
|
4876
|
-
return /* @__PURE__ */ (0,
|
|
5748
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: children({ onClick: handleClick, capturing }) });
|
|
4877
5749
|
}
|
|
4878
5750
|
const isTop = (_a = position == null ? void 0 : position.startsWith("top")) != null ? _a : false;
|
|
4879
5751
|
const isLeft = (_b = position == null ? void 0 : position.endsWith("left")) != null ? _b : false;
|
|
@@ -4881,7 +5753,7 @@ function ReportButton({
|
|
|
4881
5753
|
...isLeft ? { left: "16px" } : { right: "16px" },
|
|
4882
5754
|
...isTop ? { top: "16px" } : { bottom: "16px" }
|
|
4883
5755
|
};
|
|
4884
|
-
return /* @__PURE__ */ (0,
|
|
5756
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
4885
5757
|
"button",
|
|
4886
5758
|
{
|
|
4887
5759
|
type: "button",
|
|
@@ -4916,7 +5788,7 @@ function ReportButton({
|
|
|
4916
5788
|
},
|
|
4917
5789
|
"aria-label": label,
|
|
4918
5790
|
children: [
|
|
4919
|
-
/* @__PURE__ */ (0,
|
|
5791
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4920
5792
|
"svg",
|
|
4921
5793
|
{
|
|
4922
5794
|
width: "16",
|
|
@@ -4924,7 +5796,7 @@ function ReportButton({
|
|
|
4924
5796
|
viewBox: "0 0 16 16",
|
|
4925
5797
|
fill: "none",
|
|
4926
5798
|
style: { flexShrink: 0 },
|
|
4927
|
-
children: /* @__PURE__ */ (0,
|
|
5799
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4928
5800
|
"path",
|
|
4929
5801
|
{
|
|
4930
5802
|
d: "M8 1C4.134 1 1 4.134 1 8s3.134 7 7 7 7-3.134 7-7-3.134-7-7-7zm0 12.5a.75.75 0 110-1.5.75.75 0 010 1.5zm.75-3.5a.75.75 0 01-1.5 0V5a.75.75 0 011.5 0v5z",
|
|
@@ -4940,15 +5812,15 @@ function ReportButton({
|
|
|
4940
5812
|
}
|
|
4941
5813
|
|
|
4942
5814
|
// src/book-demo-button.tsx
|
|
4943
|
-
var
|
|
5815
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
4944
5816
|
function BookDemoButton({
|
|
4945
5817
|
label = "Book a demo",
|
|
4946
5818
|
className,
|
|
4947
5819
|
children
|
|
4948
5820
|
}) {
|
|
4949
5821
|
const { openBookingDialog } = useGlitchgrab();
|
|
4950
|
-
if (children) return /* @__PURE__ */ (0,
|
|
4951
|
-
return /* @__PURE__ */ (0,
|
|
5822
|
+
if (children) return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: children({ onClick: openBookingDialog }) });
|
|
5823
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
4952
5824
|
"button",
|
|
4953
5825
|
{
|
|
4954
5826
|
type: "button",
|
|
@@ -4970,7 +5842,7 @@ function BookDemoButton({
|
|
|
4970
5842
|
}
|
|
4971
5843
|
|
|
4972
5844
|
// src/feedback-button.tsx
|
|
4973
|
-
var
|
|
5845
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
4974
5846
|
function useGlitchgrabSafe2() {
|
|
4975
5847
|
try {
|
|
4976
5848
|
return useGlitchgrab();
|
|
@@ -4989,7 +5861,7 @@ function FeedbackButton({
|
|
|
4989
5861
|
if (!glitchgrab) return null;
|
|
4990
5862
|
const handleClick = () => glitchgrab.openFeedbackDialog();
|
|
4991
5863
|
if (children) {
|
|
4992
|
-
return /* @__PURE__ */ (0,
|
|
5864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: children({ onClick: handleClick }) });
|
|
4993
5865
|
}
|
|
4994
5866
|
const isTop = (_a = position == null ? void 0 : position.startsWith("top")) != null ? _a : false;
|
|
4995
5867
|
const isLeft = (_b = position == null ? void 0 : position.endsWith("left")) != null ? _b : false;
|
|
@@ -4997,7 +5869,7 @@ function FeedbackButton({
|
|
|
4997
5869
|
...isLeft ? { left: "16px" } : { right: "16px" },
|
|
4998
5870
|
...isTop ? { top: "16px" } : { bottom: "16px" }
|
|
4999
5871
|
};
|
|
5000
|
-
return /* @__PURE__ */ (0,
|
|
5872
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
5001
5873
|
"button",
|
|
5002
5874
|
{
|
|
5003
5875
|
type: "button",
|
|
@@ -5030,7 +5902,7 @@ function FeedbackButton({
|
|
|
5030
5902
|
},
|
|
5031
5903
|
"aria-label": label,
|
|
5032
5904
|
children: [
|
|
5033
|
-
/* @__PURE__ */ (0,
|
|
5905
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
5034
5906
|
"svg",
|
|
5035
5907
|
{
|
|
5036
5908
|
width: "16",
|
|
@@ -5039,7 +5911,7 @@ function FeedbackButton({
|
|
|
5039
5911
|
fill: "none",
|
|
5040
5912
|
style: { flexShrink: 0 },
|
|
5041
5913
|
"aria-hidden": "true",
|
|
5042
|
-
children: /* @__PURE__ */ (0,
|
|
5914
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
5043
5915
|
"path",
|
|
5044
5916
|
{
|
|
5045
5917
|
d: "M12 2.5l2.9 5.9 6.5.9-4.7 4.6 1.1 6.5L12 17.4l-5.8 3 1.1-6.5L2.6 9.3l6.5-.9L12 2.5z",
|
|
@@ -5055,18 +5927,18 @@ function FeedbackButton({
|
|
|
5055
5927
|
}
|
|
5056
5928
|
|
|
5057
5929
|
// src/use-reports.ts
|
|
5058
|
-
var
|
|
5930
|
+
var import_react7 = require("react");
|
|
5059
5931
|
var BASE_URL = "https://glitchgrab.dev";
|
|
5060
5932
|
function useGlitchgrabReports({
|
|
5061
5933
|
token,
|
|
5062
5934
|
userId,
|
|
5063
5935
|
limit = 100
|
|
5064
5936
|
}) {
|
|
5065
|
-
const [reports, setReports] = (0,
|
|
5066
|
-
const [isLoading, setIsLoading] = (0,
|
|
5067
|
-
const [isFetching, setIsFetching] = (0,
|
|
5068
|
-
const [error, setError] = (0,
|
|
5069
|
-
const fetchReports = (0,
|
|
5937
|
+
const [reports, setReports] = (0, import_react7.useState)([]);
|
|
5938
|
+
const [isLoading, setIsLoading] = (0, import_react7.useState)(true);
|
|
5939
|
+
const [isFetching, setIsFetching] = (0, import_react7.useState)(false);
|
|
5940
|
+
const [error, setError] = (0, import_react7.useState)(null);
|
|
5941
|
+
const fetchReports = (0, import_react7.useCallback)(async () => {
|
|
5070
5942
|
var _a, _b;
|
|
5071
5943
|
if (!token || !userId) {
|
|
5072
5944
|
setIsLoading(false);
|
|
@@ -5092,7 +5964,7 @@ function useGlitchgrabReports({
|
|
|
5092
5964
|
setIsFetching(false);
|
|
5093
5965
|
}
|
|
5094
5966
|
}, [token, userId, limit]);
|
|
5095
|
-
(0,
|
|
5967
|
+
(0, import_react7.useEffect)(() => {
|
|
5096
5968
|
fetchReports();
|
|
5097
5969
|
}, [fetchReports]);
|
|
5098
5970
|
return { reports, isLoading, isFetching, error, refetch: fetchReports };
|
|
@@ -5129,9 +6001,9 @@ function useGlitchgrabActions({
|
|
|
5129
6001
|
onSuccess,
|
|
5130
6002
|
onError
|
|
5131
6003
|
}) {
|
|
5132
|
-
const [isPending, setIsPending] = (0,
|
|
5133
|
-
const [error, setError] = (0,
|
|
5134
|
-
const run = (0,
|
|
6004
|
+
const [isPending, setIsPending] = (0, import_react7.useState)(false);
|
|
6005
|
+
const [error, setError] = (0, import_react7.useState)(null);
|
|
6006
|
+
const run = (0, import_react7.useCallback)(
|
|
5135
6007
|
async (reportId, body) => {
|
|
5136
6008
|
setIsPending(true);
|
|
5137
6009
|
setError(null);
|
|
@@ -5161,7 +6033,7 @@ function useGlitchgrabActions({
|
|
|
5161
6033
|
}
|
|
5162
6034
|
|
|
5163
6035
|
// src/use-feedback.ts
|
|
5164
|
-
var
|
|
6036
|
+
var import_react8 = require("react");
|
|
5165
6037
|
var DEFAULT_BASE_URL3 = "https://glitchgrab.dev";
|
|
5166
6038
|
function buildUrl({
|
|
5167
6039
|
approvedOnly,
|
|
@@ -5187,11 +6059,11 @@ async function fetchGlitchgrabFeedback(query) {
|
|
|
5187
6059
|
}
|
|
5188
6060
|
function useGlitchgrabFeedback(query) {
|
|
5189
6061
|
const { token, approvedOnly, userId, minRating, limit, baseUrl } = query;
|
|
5190
|
-
const [feedback, setFeedback] = (0,
|
|
5191
|
-
const [isLoading, setIsLoading] = (0,
|
|
5192
|
-
const [isFetching, setIsFetching] = (0,
|
|
5193
|
-
const [error, setError] = (0,
|
|
5194
|
-
const load = (0,
|
|
6062
|
+
const [feedback, setFeedback] = (0, import_react8.useState)([]);
|
|
6063
|
+
const [isLoading, setIsLoading] = (0, import_react8.useState)(true);
|
|
6064
|
+
const [isFetching, setIsFetching] = (0, import_react8.useState)(false);
|
|
6065
|
+
const [error, setError] = (0, import_react8.useState)(null);
|
|
6066
|
+
const load = (0, import_react8.useCallback)(async () => {
|
|
5195
6067
|
if (!token) {
|
|
5196
6068
|
setIsLoading(false);
|
|
5197
6069
|
return;
|
|
@@ -5215,7 +6087,7 @@ function useGlitchgrabFeedback(query) {
|
|
|
5215
6087
|
setIsFetching(false);
|
|
5216
6088
|
}
|
|
5217
6089
|
}, [token, approvedOnly, userId, minRating, limit, baseUrl]);
|
|
5218
|
-
(0,
|
|
6090
|
+
(0, import_react8.useEffect)(() => {
|
|
5219
6091
|
load();
|
|
5220
6092
|
}, [load]);
|
|
5221
6093
|
return { feedback, isLoading, isFetching, error, refetch: load };
|