saasco-sdk 0.2.4 → 0.2.6
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/README.md +1005 -0
- package/dist/index.cjs +621 -421
- package/dist/index.d.cts +33 -50
- package/dist/index.d.ts +33 -50
- package/dist/index.js +621 -421
- package/dist/support.cjs +1546 -957
- package/dist/support.d.cts +20 -9
- package/dist/support.d.ts +20 -9
- package/dist/support.js +1528 -939
- package/package.json +21 -1
package/dist/support.js
CHANGED
|
@@ -56,12 +56,17 @@ var init_is_prop_valid_esm = __esm({
|
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
58
|
|
|
59
|
-
// ../../support/shared/src/lib/
|
|
59
|
+
// ../../support/shared/src/lib/widget/supportEmbedBridge.ts
|
|
60
60
|
var BRIDGE_SOURCE = "saasco-support";
|
|
61
61
|
var BRIDGE_PROTOCOL_VERSION = 1;
|
|
62
62
|
var BRIDGE_REQUEST_TIMEOUT_MS = 15e3;
|
|
63
63
|
|
|
64
|
-
// ../../
|
|
64
|
+
// ../../utils/shared/src/lib/isRecord.ts
|
|
65
|
+
function isRecord(value) {
|
|
66
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// ../../support/shared/src/lib/widget/supportEmbedBridgeParse.ts
|
|
65
70
|
function createEnvelope(message) {
|
|
66
71
|
return {
|
|
67
72
|
source: BRIDGE_SOURCE,
|
|
@@ -168,9 +173,6 @@ function matchesOriginPattern(origin, pattern) {
|
|
|
168
173
|
function isOriginAllowed(origin, patterns) {
|
|
169
174
|
return patterns.some((pattern) => matchesOriginPattern(origin, pattern));
|
|
170
175
|
}
|
|
171
|
-
function isRecord(value) {
|
|
172
|
-
return typeof value === "object" && value !== null;
|
|
173
|
-
}
|
|
174
176
|
function readEnvelope(data) {
|
|
175
177
|
if (!isRecord(data)) {
|
|
176
178
|
return null;
|
|
@@ -209,7 +211,12 @@ function parseIdentityBearingMessage(msg) {
|
|
|
209
211
|
if (msg.identity !== null && !isRecord(msg.identity)) {
|
|
210
212
|
return null;
|
|
211
213
|
}
|
|
212
|
-
|
|
214
|
+
const identity2 = sanitizeBridgeIdentity(msg.identity);
|
|
215
|
+
if (msg.type === "identify") {
|
|
216
|
+
return { ...msg, identity: identity2 };
|
|
217
|
+
}
|
|
218
|
+
const hostLauncher = msg.hostLauncher === true ? true : msg.hostLauncher === false ? false : void 0;
|
|
219
|
+
return { ...msg, hostLauncher, identity: identity2 };
|
|
213
220
|
}
|
|
214
221
|
function isValidPageContextMessage(msg) {
|
|
215
222
|
return typeof msg.requestId === "string" && isRecord(msg.context) && typeof msg.context.url === "string";
|
|
@@ -220,7 +227,10 @@ var stateSnapshot;
|
|
|
220
227
|
var identity = null;
|
|
221
228
|
var userJwt = null;
|
|
222
229
|
var hostViewport = null;
|
|
230
|
+
var hostOwnsLauncher = false;
|
|
231
|
+
var previewShell = null;
|
|
223
232
|
var openControls = null;
|
|
233
|
+
var pendingOpenCommand = null;
|
|
224
234
|
var subscribers = /* @__PURE__ */ new Set();
|
|
225
235
|
function notify() {
|
|
226
236
|
for (const cb of subscribers) {
|
|
@@ -261,6 +271,19 @@ function setHostViewport(next) {
|
|
|
261
271
|
function getHostViewport() {
|
|
262
272
|
return hostViewport;
|
|
263
273
|
}
|
|
274
|
+
function setHostOwnsLauncher(next) {
|
|
275
|
+
if (hostOwnsLauncher === next) {
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
hostOwnsLauncher = next;
|
|
279
|
+
notify();
|
|
280
|
+
}
|
|
281
|
+
function getHostOwnsLauncher() {
|
|
282
|
+
return hostOwnsLauncher;
|
|
283
|
+
}
|
|
284
|
+
function getPreviewShell() {
|
|
285
|
+
return previewShell;
|
|
286
|
+
}
|
|
264
287
|
function resetSession() {
|
|
265
288
|
identity = null;
|
|
266
289
|
userJwt = null;
|
|
@@ -278,12 +301,32 @@ function subscribeToRegistry(cb) {
|
|
|
278
301
|
}
|
|
279
302
|
function setOpenControls(controls) {
|
|
280
303
|
openControls = controls;
|
|
304
|
+
if (!controls || pendingOpenCommand === null) {
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
const shouldOpen = pendingOpenCommand;
|
|
308
|
+
pendingOpenCommand = null;
|
|
309
|
+
if (shouldOpen) {
|
|
310
|
+
controls.open();
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
controls.close();
|
|
281
314
|
}
|
|
282
315
|
function openWidget() {
|
|
283
|
-
openControls
|
|
316
|
+
if (openControls) {
|
|
317
|
+
pendingOpenCommand = null;
|
|
318
|
+
openControls.open();
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
pendingOpenCommand = true;
|
|
284
322
|
}
|
|
285
323
|
function closeWidget() {
|
|
286
|
-
openControls
|
|
324
|
+
if (openControls) {
|
|
325
|
+
pendingOpenCommand = null;
|
|
326
|
+
openControls.close();
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
pendingOpenCommand = false;
|
|
287
330
|
}
|
|
288
331
|
|
|
289
332
|
// src/lib/support/embedBridge.ts
|
|
@@ -304,7 +347,7 @@ function post(message) {
|
|
|
304
347
|
if (!parent || parent === window) {
|
|
305
348
|
return;
|
|
306
349
|
}
|
|
307
|
-
const targetOrigin = message.type === "resize" ? "*" : parentOrigin ?? "*";
|
|
350
|
+
const targetOrigin = message.type === "resize" || message.type === "openState" ? "*" : parentOrigin ?? "*";
|
|
308
351
|
parent.postMessage(createEnvelope(message), targetOrigin);
|
|
309
352
|
}
|
|
310
353
|
function handleHostMessage(message) {
|
|
@@ -316,6 +359,7 @@ function handleHostMessage(message) {
|
|
|
316
359
|
if (message.viewport) {
|
|
317
360
|
setHostViewport(message.viewport);
|
|
318
361
|
}
|
|
362
|
+
setHostOwnsLauncher(message.hostLauncher === true);
|
|
319
363
|
break;
|
|
320
364
|
}
|
|
321
365
|
case "shutdown": {
|
|
@@ -409,6 +453,9 @@ function initEmbedBridge(options) {
|
|
|
409
453
|
function postResize(width, height, fullscreen = false) {
|
|
410
454
|
post({ fullscreen, height, type: "resize", width });
|
|
411
455
|
}
|
|
456
|
+
function postOpenState(open, fullscreen = false) {
|
|
457
|
+
post({ fullscreen, open, type: "openState" });
|
|
458
|
+
}
|
|
412
459
|
function postLauncherState(scale2, hovered) {
|
|
413
460
|
post({ hovered, scale: scale2, type: "launcherState" });
|
|
414
461
|
}
|
|
@@ -467,6 +514,16 @@ import { useChat } from "@ai-sdk/react";
|
|
|
467
514
|
|
|
468
515
|
// ../../chat/client/src/lib/core/chatSessionStorage.ts
|
|
469
516
|
var MAX_SESSION_HISTORY = 50;
|
|
517
|
+
function chatStorage() {
|
|
518
|
+
if (typeof window === "undefined") {
|
|
519
|
+
return null;
|
|
520
|
+
}
|
|
521
|
+
try {
|
|
522
|
+
return window.localStorage ?? null;
|
|
523
|
+
} catch {
|
|
524
|
+
return null;
|
|
525
|
+
}
|
|
526
|
+
}
|
|
470
527
|
function historyStorageKey(activeKey) {
|
|
471
528
|
return `${activeKey}-history`;
|
|
472
529
|
}
|
|
@@ -480,12 +537,13 @@ function isStoredChatSessionEntry(value) {
|
|
|
480
537
|
return isStoredChatSession(value) && "preview" in value && "updatedAt" in value && typeof value.preview === "string" && typeof value.updatedAt === "number";
|
|
481
538
|
}
|
|
482
539
|
function readStoredSession(storageKey) {
|
|
483
|
-
|
|
540
|
+
const storage = chatStorage();
|
|
541
|
+
if (!storage) {
|
|
484
542
|
return null;
|
|
485
543
|
}
|
|
486
544
|
try {
|
|
487
545
|
const parsed = JSON.parse(
|
|
488
|
-
|
|
546
|
+
storage.getItem(storageKey) ?? "null"
|
|
489
547
|
);
|
|
490
548
|
return parsed?.conversationId && parsed?.sessionToken ? parsed : null;
|
|
491
549
|
} catch {
|
|
@@ -493,12 +551,13 @@ function readStoredSession(storageKey) {
|
|
|
493
551
|
}
|
|
494
552
|
}
|
|
495
553
|
function readSessionHistory(storageKey) {
|
|
496
|
-
|
|
554
|
+
const storage = chatStorage();
|
|
555
|
+
if (!storage) {
|
|
497
556
|
return [];
|
|
498
557
|
}
|
|
499
558
|
try {
|
|
500
559
|
const parsed = JSON.parse(
|
|
501
|
-
|
|
560
|
+
storage.getItem(historyStorageKey(storageKey)) ?? "[]"
|
|
502
561
|
);
|
|
503
562
|
if (!Array.isArray(parsed)) {
|
|
504
563
|
return [];
|
|
@@ -509,12 +568,18 @@ function readSessionHistory(storageKey) {
|
|
|
509
568
|
}
|
|
510
569
|
}
|
|
511
570
|
function storeSession(storageKey, session) {
|
|
512
|
-
|
|
513
|
-
|
|
571
|
+
const storage = chatStorage();
|
|
572
|
+
if (!storage) {
|
|
573
|
+
return;
|
|
574
|
+
}
|
|
575
|
+
try {
|
|
576
|
+
storage.setItem(storageKey, JSON.stringify(session));
|
|
577
|
+
} catch {
|
|
514
578
|
}
|
|
515
579
|
}
|
|
516
580
|
function upsertSessionHistory(storageKey, session, patch) {
|
|
517
|
-
|
|
581
|
+
const storage = chatStorage();
|
|
582
|
+
if (!storage) {
|
|
518
583
|
return;
|
|
519
584
|
}
|
|
520
585
|
const now2 = Date.now();
|
|
@@ -536,10 +601,10 @@ function upsertSessionHistory(storageKey, session, patch) {
|
|
|
536
601
|
(entry) => entry.conversationId !== session.conversationId
|
|
537
602
|
)
|
|
538
603
|
].slice(0, MAX_SESSION_HISTORY);
|
|
539
|
-
|
|
540
|
-
historyStorageKey(storageKey),
|
|
541
|
-
|
|
542
|
-
|
|
604
|
+
try {
|
|
605
|
+
storage.setItem(historyStorageKey(storageKey), JSON.stringify(nextHistory));
|
|
606
|
+
} catch {
|
|
607
|
+
}
|
|
543
608
|
}
|
|
544
609
|
function ensureActiveSessionInHistory(storageKey, session) {
|
|
545
610
|
const history = readSessionHistory(storageKey);
|
|
@@ -549,31 +614,45 @@ function ensureActiveSessionInHistory(storageKey, session) {
|
|
|
549
614
|
upsertSessionHistory(storageKey, session);
|
|
550
615
|
}
|
|
551
616
|
function clearStoredSession(storageKey) {
|
|
552
|
-
|
|
553
|
-
|
|
617
|
+
const storage = chatStorage();
|
|
618
|
+
if (!storage) {
|
|
619
|
+
return;
|
|
620
|
+
}
|
|
621
|
+
try {
|
|
622
|
+
storage.removeItem(storageKey);
|
|
623
|
+
} catch {
|
|
554
624
|
}
|
|
555
625
|
}
|
|
556
626
|
function clearChatStorage(storageKey) {
|
|
557
|
-
|
|
627
|
+
const storage = chatStorage();
|
|
628
|
+
if (!storage) {
|
|
558
629
|
return;
|
|
559
630
|
}
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
631
|
+
try {
|
|
632
|
+
storage.removeItem(storageKey);
|
|
633
|
+
storage.removeItem(historyStorageKey(storageKey));
|
|
634
|
+
storage.removeItem(ownerStorageKey(storageKey));
|
|
635
|
+
} catch {
|
|
636
|
+
}
|
|
563
637
|
}
|
|
564
638
|
function reconcileSessionOwner(storageKey, ownerId) {
|
|
565
|
-
|
|
639
|
+
const storage = chatStorage();
|
|
640
|
+
if (!storage || !ownerId) {
|
|
566
641
|
return { cleared: false };
|
|
567
642
|
}
|
|
568
|
-
|
|
569
|
-
|
|
643
|
+
try {
|
|
644
|
+
const stored = storage.getItem(ownerStorageKey(storageKey));
|
|
645
|
+
if (stored === ownerId) {
|
|
646
|
+
return { cleared: false };
|
|
647
|
+
}
|
|
648
|
+
if (stored && stored !== ownerId) {
|
|
649
|
+
clearChatStorage(storageKey);
|
|
650
|
+
}
|
|
651
|
+
storage.setItem(ownerStorageKey(storageKey), ownerId);
|
|
652
|
+
return { cleared: Boolean(stored) && stored !== ownerId };
|
|
653
|
+
} catch {
|
|
570
654
|
return { cleared: false };
|
|
571
655
|
}
|
|
572
|
-
if (stored && stored !== ownerId) {
|
|
573
|
-
clearChatStorage(storageKey);
|
|
574
|
-
}
|
|
575
|
-
window.localStorage.setItem(ownerStorageKey(storageKey), ownerId);
|
|
576
|
-
return { cleared: Boolean(stored) && stored !== ownerId };
|
|
577
656
|
}
|
|
578
657
|
|
|
579
658
|
// ../../chat/client/src/lib/core/playMessageChime.ts
|
|
@@ -775,42 +854,7 @@ function useToolApprovals({
|
|
|
775
854
|
return { approve, clearPending, onToolCall, pending, reject };
|
|
776
855
|
}
|
|
777
856
|
|
|
778
|
-
// ../../support/shared/src/lib/
|
|
779
|
-
function buildMergedStateSnapshot(layers) {
|
|
780
|
-
const merged = {};
|
|
781
|
-
const ordered = [
|
|
782
|
-
layers.browserContext,
|
|
783
|
-
layers.identifyTraits,
|
|
784
|
-
layers.envelope,
|
|
785
|
-
toRecord(layers.hostSnapshot)
|
|
786
|
-
];
|
|
787
|
-
for (const layer of ordered) {
|
|
788
|
-
if (!layer) {
|
|
789
|
-
continue;
|
|
790
|
-
}
|
|
791
|
-
for (const [key, value] of Object.entries(layer)) {
|
|
792
|
-
const scalar = coerceScalar(value);
|
|
793
|
-
if (scalar !== void 0) {
|
|
794
|
-
merged[key] = scalar;
|
|
795
|
-
}
|
|
796
|
-
}
|
|
797
|
-
}
|
|
798
|
-
return merged;
|
|
799
|
-
}
|
|
800
|
-
function coerceScalar(value) {
|
|
801
|
-
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
802
|
-
return value;
|
|
803
|
-
}
|
|
804
|
-
return void 0;
|
|
805
|
-
}
|
|
806
|
-
function toRecord(value) {
|
|
807
|
-
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
808
|
-
return value;
|
|
809
|
-
}
|
|
810
|
-
return void 0;
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
// ../../support/shared/src/lib/types/kbCitations.ts
|
|
857
|
+
// ../../support/shared/src/lib/message/kbCitations.ts
|
|
814
858
|
import { z } from "zod";
|
|
815
859
|
var KB_CITATION_MARKER_PATTERN = /\[\[kb:([^\]]+)\]\]/gu;
|
|
816
860
|
var KbCitationSchema = z.object({
|
|
@@ -818,8 +862,6 @@ var KbCitationSchema = z.object({
|
|
|
818
862
|
title: z.string(),
|
|
819
863
|
url: z.string()
|
|
820
864
|
});
|
|
821
|
-
|
|
822
|
-
// ../../support/shared/src/lib/kbCitations.ts
|
|
823
865
|
function stripKbCitationMarkers(text) {
|
|
824
866
|
return text.replaceAll(KB_CITATION_MARKER_PATTERN, "");
|
|
825
867
|
}
|
|
@@ -848,8 +890,9 @@ function buildKbCitationNumberMap(text) {
|
|
|
848
890
|
return map;
|
|
849
891
|
}
|
|
850
892
|
|
|
851
|
-
// ../../support/shared/src/lib/normalizeToolName.ts
|
|
893
|
+
// ../../support/shared/src/lib/tools/normalizeToolName.ts
|
|
852
894
|
var CLOSE_CONVERSATION_TOOL_NAME = "close_conversation";
|
|
895
|
+
var REPORT_KNOWLEDGE_GAP_TOOL_NAME = "report_knowledge_gap";
|
|
853
896
|
var REQUEST_HUMAN_HANDOFF_TOOL_NAME = "request_human_handoff";
|
|
854
897
|
function normalizeToolName(displayName) {
|
|
855
898
|
return displayName.trim().toLowerCase().replaceAll(/[^a-z0-9]+/gu, "_").replaceAll(/_+/gu, "_").replaceAll(/^_+|_+$/gu, "").slice(0, 64);
|
|
@@ -866,6 +909,33 @@ function buildToolDisplayLabelMap(tools) {
|
|
|
866
909
|
return labels;
|
|
867
910
|
}
|
|
868
911
|
|
|
912
|
+
// ../../support/shared/src/lib/tools/toolContext.ts
|
|
913
|
+
function pickScalarRecord(value) {
|
|
914
|
+
if (!isRecord(value)) {
|
|
915
|
+
return {};
|
|
916
|
+
}
|
|
917
|
+
const scalars = {};
|
|
918
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
919
|
+
if (typeof entry === "string" || typeof entry === "number" || typeof entry === "boolean") {
|
|
920
|
+
scalars[key] = entry;
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
return scalars;
|
|
924
|
+
}
|
|
925
|
+
function buildToolContext({
|
|
926
|
+
identity: identity2,
|
|
927
|
+
stateSnapshot: stateSnapshot2
|
|
928
|
+
}) {
|
|
929
|
+
const context = pickScalarRecord(stateSnapshot2);
|
|
930
|
+
if (identity2?.distinctId) {
|
|
931
|
+
context.distinctId = identity2.distinctId;
|
|
932
|
+
}
|
|
933
|
+
if (identity2?.email) {
|
|
934
|
+
context.email = identity2.email;
|
|
935
|
+
}
|
|
936
|
+
return context;
|
|
937
|
+
}
|
|
938
|
+
|
|
869
939
|
// src/lib/support/Widget.tsx
|
|
870
940
|
import {
|
|
871
941
|
DefaultChatTransport,
|
|
@@ -9415,12 +9485,12 @@ function useReducedMotion() {
|
|
|
9415
9485
|
|
|
9416
9486
|
// src/lib/support/Widget.tsx
|
|
9417
9487
|
import {
|
|
9418
|
-
useCallback as
|
|
9419
|
-
useEffect as
|
|
9488
|
+
useCallback as useCallback10,
|
|
9489
|
+
useEffect as useEffect18,
|
|
9420
9490
|
useLayoutEffect as useLayoutEffect5,
|
|
9421
9491
|
useMemo as useMemo8,
|
|
9422
|
-
useRef as
|
|
9423
|
-
useState as
|
|
9492
|
+
useRef as useRef15,
|
|
9493
|
+
useState as useState13,
|
|
9424
9494
|
useSyncExternalStore as useSyncExternalStore2
|
|
9425
9495
|
} from "react";
|
|
9426
9496
|
|
|
@@ -9448,7 +9518,7 @@ function SaascoLogo() {
|
|
|
9448
9518
|
viewBox: "0 0 438 83",
|
|
9449
9519
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9450
9520
|
children: [
|
|
9451
|
-
/* @__PURE__ */ jsx6("rect", { height: "83", rx: "22", width: "83", x: "0.308594", fill: "#
|
|
9521
|
+
/* @__PURE__ */ jsx6("rect", { height: "83", rx: "22", width: "83", x: "0.308594", fill: "#0B0B0B" }),
|
|
9452
9522
|
/* @__PURE__ */ jsx6(
|
|
9453
9523
|
"path",
|
|
9454
9524
|
{
|
|
@@ -9483,42 +9553,42 @@ function SaascoLogo() {
|
|
|
9483
9553
|
"path",
|
|
9484
9554
|
{
|
|
9485
9555
|
d: "M408.943 73.5C392.079 73.5 380.697 61.1648 380.697 41.5C380.697 21.7756 392.139 9.5 408.943 9.5C425.807 9.5 437.189 21.7756 437.189 41.5C437.189 61.1648 425.807 73.5 408.943 73.5ZM408.943 66.5279C421.1 66.5279 429.204 57.2318 429.204 41.5C429.204 25.7682 421.1 16.4721 408.943 16.4721C396.787 16.4721 388.742 25.7682 388.742 41.5C388.742 57.2318 396.787 66.5279 408.943 66.5279Z",
|
|
9486
|
-
fill: "#
|
|
9556
|
+
fill: "#0B0B0B"
|
|
9487
9557
|
}
|
|
9488
9558
|
),
|
|
9489
9559
|
/* @__PURE__ */ jsx6(
|
|
9490
9560
|
"path",
|
|
9491
9561
|
{
|
|
9492
9562
|
d: "M377.565 30.1182H369.818C368.15 22.4907 361.893 16.4721 352.12 16.4721C340.023 16.4721 332.097 26.1853 332.097 41.5C332.097 57.0531 340.083 66.5279 352.179 66.5279C361.535 66.5279 368.03 61.3436 369.818 53.2989H377.624C375.896 65.1574 365.826 73.5 352.12 73.5C335.196 73.5 324.053 61.3436 324.053 41.5C324.053 21.9544 335.196 9.5 352.06 9.5C366.66 9.5 376.016 19.0344 377.565 30.1182Z",
|
|
9493
|
-
fill: "#
|
|
9563
|
+
fill: "#0B0B0B"
|
|
9494
9564
|
}
|
|
9495
9565
|
),
|
|
9496
9566
|
/* @__PURE__ */ jsx6(
|
|
9497
9567
|
"path",
|
|
9498
9568
|
{
|
|
9499
9569
|
d: "M274.262 27.0791C274.262 16.8296 283.379 9.5 296.31 9.5C309.539 9.5 318.359 17.1872 319.074 28.4497H311.506C310.493 20.703 304.891 15.9953 296.31 15.9953C287.848 15.9953 282.068 20.4646 282.068 26.662C282.068 31.7272 285.584 34.8855 293.807 36.852L303.163 39.0568C315.558 42.0363 320.206 46.8035 320.206 55.5633C320.206 66.0512 310.374 73.5 296.847 73.5C282.843 73.5 273.547 66.0512 272.474 54.729H280.34C281.532 62.5354 287.55 67.0047 296.847 67.0047C306.143 67.0047 312.28 62.6546 312.28 56.1592C312.28 50.7961 309.241 47.8166 300.899 45.7905L291.603 43.5857C279.804 40.8445 274.262 35.6601 274.262 27.0791Z",
|
|
9500
|
-
fill: "#
|
|
9570
|
+
fill: "#0B0B0B"
|
|
9501
9571
|
}
|
|
9502
9572
|
),
|
|
9503
9573
|
/* @__PURE__ */ jsx6(
|
|
9504
9574
|
"path",
|
|
9505
9575
|
{
|
|
9506
9576
|
d: "M238.713 66.7067C249.558 66.7067 258.079 59.0196 258.079 49.1871V42.3343L239.726 43.5857C229.953 44.2412 224.53 48.4721 224.53 55.325C224.53 62.0587 230.31 66.7067 238.713 66.7067ZM237.104 73.5C224.888 73.5 216.545 66.1704 216.545 55.325C216.545 44.7179 224.47 38.2821 238.772 37.3287L258.079 36.1369V30.7737C258.079 21.8352 252.418 16.4721 242.765 16.4721C233.647 16.4721 227.807 20.9413 226.437 28.4497H218.809C219.703 17.3659 228.821 9.5 242.943 9.5C257.066 9.5 265.945 17.4255 265.945 30.0587V72.487H258.437V60.6881H258.258C254.802 68.3752 246.34 73.5 237.104 73.5Z",
|
|
9507
|
-
fill: "#
|
|
9577
|
+
fill: "#0B0B0B"
|
|
9508
9578
|
}
|
|
9509
9579
|
),
|
|
9510
9580
|
/* @__PURE__ */ jsx6(
|
|
9511
9581
|
"path",
|
|
9512
9582
|
{
|
|
9513
9583
|
d: "M181.949 66.7067C192.794 66.7067 201.316 59.0196 201.316 49.1871V42.3343L182.962 43.5857C173.189 44.2412 167.766 48.4721 167.766 55.325C167.766 62.0587 173.547 66.7067 181.949 66.7067ZM180.34 73.5C168.124 73.5 159.781 66.1704 159.781 55.325C159.781 44.7179 167.707 38.2821 182.008 37.3287L201.316 36.1369V30.7737C201.316 21.8352 195.655 16.4721 186.001 16.4721C176.884 16.4721 171.044 20.9413 169.673 28.4497H162.046C162.94 17.3659 172.057 9.5 186.18 9.5C200.303 9.5 209.182 17.4255 209.182 30.0587V72.487H201.673V60.6881H201.494C198.038 68.3752 189.576 73.5 180.34 73.5Z",
|
|
9514
|
-
fill: "#
|
|
9584
|
+
fill: "#0B0B0B"
|
|
9515
9585
|
}
|
|
9516
9586
|
),
|
|
9517
9587
|
/* @__PURE__ */ jsx6(
|
|
9518
9588
|
"path",
|
|
9519
9589
|
{
|
|
9520
9590
|
d: "M109.096 27.0791C109.096 16.8296 118.214 9.5 131.145 9.5C144.374 9.5 153.193 17.1872 153.908 28.4497H146.34C145.327 20.703 139.726 15.9953 131.145 15.9953C122.683 15.9953 116.903 20.4646 116.903 26.662C116.903 31.7272 120.418 34.8855 128.642 36.852L137.998 39.0568C150.392 42.0363 155.04 46.8035 155.04 55.5633C155.04 66.0512 145.208 73.5 131.681 73.5C117.677 73.5 108.381 66.0512 107.309 54.729H115.175C116.366 62.5354 122.385 67.0047 131.681 67.0047C140.977 67.0047 147.115 62.6546 147.115 56.1592C147.115 50.7961 144.076 47.8166 135.733 45.7905L126.437 43.5857C114.638 40.8445 109.096 35.6601 109.096 27.0791Z",
|
|
9521
|
-
fill: "#
|
|
9591
|
+
fill: "#0B0B0B"
|
|
9522
9592
|
}
|
|
9523
9593
|
)
|
|
9524
9594
|
]
|
|
@@ -9700,23 +9770,6 @@ function MessagesIcon() {
|
|
|
9700
9770
|
}
|
|
9701
9771
|
);
|
|
9702
9772
|
}
|
|
9703
|
-
function ChevronIcon() {
|
|
9704
|
-
return /* @__PURE__ */ jsx6(
|
|
9705
|
-
"svg",
|
|
9706
|
-
{
|
|
9707
|
-
"aria-hidden": "true",
|
|
9708
|
-
fill: "none",
|
|
9709
|
-
height: "12",
|
|
9710
|
-
stroke: "currentColor",
|
|
9711
|
-
strokeLinecap: "round",
|
|
9712
|
-
strokeLinejoin: "round",
|
|
9713
|
-
strokeWidth: "2",
|
|
9714
|
-
viewBox: "0 0 24 24",
|
|
9715
|
-
width: "12",
|
|
9716
|
-
children: /* @__PURE__ */ jsx6("path", { d: "m9 18 6-6-6-6" })
|
|
9717
|
-
}
|
|
9718
|
-
);
|
|
9719
|
-
}
|
|
9720
9773
|
function SparklesIcon() {
|
|
9721
9774
|
return /* @__PURE__ */ jsxs2(
|
|
9722
9775
|
"svg",
|
|
@@ -9818,6 +9871,204 @@ function ImageIcon() {
|
|
|
9818
9871
|
);
|
|
9819
9872
|
}
|
|
9820
9873
|
|
|
9874
|
+
// src/lib/widget-scale.ts
|
|
9875
|
+
var WIDGET_MOBILE_BREAKPOINT_PX = 640;
|
|
9876
|
+
var LAUNCHER_BUTTON_BASE_PX = 60;
|
|
9877
|
+
var SCALE_BASELINE_PX = 360;
|
|
9878
|
+
var MAX_VIEWPORT_SCALE = 1.25;
|
|
9879
|
+
var MAX_ZOOM_SCALE = 3;
|
|
9880
|
+
var ZOOM_TOLERANCE = 1.05;
|
|
9881
|
+
function widgetScaleMetrics(viewport, device) {
|
|
9882
|
+
const width = Number.isFinite(viewport.width) ? viewport.width : 0;
|
|
9883
|
+
if (width <= 0) {
|
|
9884
|
+
return { effectiveWidth: 0, isMobile: false, scale: 1 };
|
|
9885
|
+
}
|
|
9886
|
+
const zoom = zoomOutFactor(viewport, device);
|
|
9887
|
+
const effectiveWidth = width / zoom;
|
|
9888
|
+
const isMobile = effectiveWidth <= WIDGET_MOBILE_BREAKPOINT_PX;
|
|
9889
|
+
const viewportScale = isMobile ? clamp2(effectiveWidth / SCALE_BASELINE_PX, 1, MAX_VIEWPORT_SCALE) : 1;
|
|
9890
|
+
return { effectiveWidth, isMobile, scale: viewportScale * zoom };
|
|
9891
|
+
}
|
|
9892
|
+
function readWidgetScaleMetrics(viewport) {
|
|
9893
|
+
if (typeof window === "undefined") {
|
|
9894
|
+
return { effectiveWidth: 0, isMobile: false, scale: 1 };
|
|
9895
|
+
}
|
|
9896
|
+
return widgetScaleMetrics(viewport ?? hostLayoutViewport(), readDevice());
|
|
9897
|
+
}
|
|
9898
|
+
function hostLayoutViewport() {
|
|
9899
|
+
const root = document.documentElement;
|
|
9900
|
+
return {
|
|
9901
|
+
height: root?.clientHeight || window.innerHeight,
|
|
9902
|
+
width: root?.clientWidth || window.innerWidth
|
|
9903
|
+
};
|
|
9904
|
+
}
|
|
9905
|
+
function scaledPx(basePx, scale2) {
|
|
9906
|
+
return Math.round(basePx * scale2);
|
|
9907
|
+
}
|
|
9908
|
+
function launcherButtonPx(scale2) {
|
|
9909
|
+
return scaledPx(LAUNCHER_BUTTON_BASE_PX, scale2);
|
|
9910
|
+
}
|
|
9911
|
+
function zoomOutFactor(viewport, device) {
|
|
9912
|
+
if (!device.touch) {
|
|
9913
|
+
return 1;
|
|
9914
|
+
}
|
|
9915
|
+
const deviceWidth = orientedDeviceWidth(viewport, device);
|
|
9916
|
+
if (deviceWidth <= 0 || viewport.width <= deviceWidth * ZOOM_TOLERANCE) {
|
|
9917
|
+
return 1;
|
|
9918
|
+
}
|
|
9919
|
+
return Math.min(viewport.width / deviceWidth, MAX_ZOOM_SCALE);
|
|
9920
|
+
}
|
|
9921
|
+
function orientedDeviceWidth(viewport, device) {
|
|
9922
|
+
const shortSide = Math.min(device.screenWidth, device.screenHeight);
|
|
9923
|
+
const longSide = Math.max(device.screenWidth, device.screenHeight);
|
|
9924
|
+
const portrait = viewport.height > 0 && viewport.height >= viewport.width;
|
|
9925
|
+
return portrait ? shortSide : longSide;
|
|
9926
|
+
}
|
|
9927
|
+
function readDevice() {
|
|
9928
|
+
return {
|
|
9929
|
+
screenHeight: window.screen?.height ?? 0,
|
|
9930
|
+
screenWidth: window.screen?.width ?? 0,
|
|
9931
|
+
touch: window.matchMedia?.("(pointer: coarse)").matches === true
|
|
9932
|
+
};
|
|
9933
|
+
}
|
|
9934
|
+
function clamp2(value, min, max) {
|
|
9935
|
+
return Math.min(Math.max(value, min), max);
|
|
9936
|
+
}
|
|
9937
|
+
|
|
9938
|
+
// src/lib/support/widget-constants.ts
|
|
9939
|
+
var MESSAGE_GROUP_THRESHOLD_MS = 2 * 60 * 1e3;
|
|
9940
|
+
var POLL_INTERVAL_MS = 5e3;
|
|
9941
|
+
var MAX_TEXTAREA_HEIGHT_PX = 120;
|
|
9942
|
+
var SCROLL_BOTTOM_THRESHOLD_PX = 56;
|
|
9943
|
+
var SCROLL_PREVIOUS_ITEM_PEEK_PX = 64;
|
|
9944
|
+
var OVERSCROLL_EDGE_SLACK_PX = 1;
|
|
9945
|
+
var BOUNCE_SETTLE_MS = 400;
|
|
9946
|
+
var MIN_SCROLLBAR_THUMB_PX = 28;
|
|
9947
|
+
var PANEL_WIDTH_PX = 384;
|
|
9948
|
+
var PANEL_MAX_HEIGHT_PX = 680;
|
|
9949
|
+
var PANEL_VERTICAL_RESERVE_PX = 110;
|
|
9950
|
+
var PANEL_HORIZONTAL_RESERVE_PX = 40;
|
|
9951
|
+
var ROOT_PADDING_PX = 16;
|
|
9952
|
+
var ROOT_HORIZONTAL_PADDING_PX = ROOT_PADDING_PX * 2;
|
|
9953
|
+
var ROOT_VERTICAL_PADDING_PX = ROOT_PADDING_PX * 2;
|
|
9954
|
+
function closedFrameSizePx(scale2) {
|
|
9955
|
+
return launcherButtonPx(scale2) + ROOT_HORIZONTAL_PADDING_PX;
|
|
9956
|
+
}
|
|
9957
|
+
var LAUNCHER_ICON_BASE_PX = 25;
|
|
9958
|
+
var ROOT_STACK_GAP_PX = 12;
|
|
9959
|
+
var EMAIL_PATTERN = /^[^\s@]+@[^\s@]+\.[^\s@]+$/u;
|
|
9960
|
+
var DEFAULT_BRANDING = {
|
|
9961
|
+
agentLabel: "AI Agent",
|
|
9962
|
+
greeting: "Ask us anything, or share your feedback.",
|
|
9963
|
+
replyTime: "a few hours",
|
|
9964
|
+
teamDescription: "The team can also help",
|
|
9965
|
+
workspaceName: "Support"
|
|
9966
|
+
};
|
|
9967
|
+
var DEFAULT_SUGGESTIONS = [];
|
|
9968
|
+
var FADE_TRANSITION = { duration: 0.12, ease: "easeOut" };
|
|
9969
|
+
var SLIDE_TRANSITION = {
|
|
9970
|
+
duration: 0.28,
|
|
9971
|
+
ease: [0.32, 0.72, 0, 1]
|
|
9972
|
+
};
|
|
9973
|
+
var NAV_TRANSITION = { duration: 0.2, ease: "easeOut" };
|
|
9974
|
+
var LAUNCHER_ICON_TRANSITION = {
|
|
9975
|
+
type: "spring",
|
|
9976
|
+
stiffness: 420,
|
|
9977
|
+
damping: 30,
|
|
9978
|
+
mass: 0.85
|
|
9979
|
+
};
|
|
9980
|
+
var LAUNCHER_ICON_ROTATE_DEG = 25;
|
|
9981
|
+
var LAUNCHER_BUTTON_TRANSITION = {
|
|
9982
|
+
type: "spring",
|
|
9983
|
+
stiffness: 520,
|
|
9984
|
+
damping: 28,
|
|
9985
|
+
mass: 0.7
|
|
9986
|
+
};
|
|
9987
|
+
var LAUNCHER_HOVER_SCALE = 1.08;
|
|
9988
|
+
var LAUNCHER_TAP_SCALE = 0.9;
|
|
9989
|
+
var PANEL_SPRING = {
|
|
9990
|
+
type: "spring",
|
|
9991
|
+
stiffness: 380,
|
|
9992
|
+
damping: 32,
|
|
9993
|
+
mass: 0.85,
|
|
9994
|
+
opacity: { duration: 0.22, ease: "easeOut" }
|
|
9995
|
+
};
|
|
9996
|
+
var SCROLL_BOTTOM_TRANSITION = {
|
|
9997
|
+
duration: 0.38,
|
|
9998
|
+
ease: [0.32, 0.72, 0, 1],
|
|
9999
|
+
opacity: { delay: 0.12, duration: 0.2, ease: "easeInOut" }
|
|
10000
|
+
};
|
|
10001
|
+
var FOOTER_SWAP_SHIFT_PX = 28;
|
|
10002
|
+
var PANEL_CLOSED_SCALE = 0.94;
|
|
10003
|
+
var viewVariants = {
|
|
10004
|
+
center: (t) => ({
|
|
10005
|
+
opacity: 1,
|
|
10006
|
+
transition: t.mode === "fade" ? FADE_TRANSITION : SLIDE_TRANSITION,
|
|
10007
|
+
x: 0
|
|
10008
|
+
}),
|
|
10009
|
+
enter: (t) => t.mode === "fade" ? { opacity: 0, x: 0 } : { opacity: 1, x: t.direction > 0 ? "100%" : "-100%" },
|
|
10010
|
+
exit: (t) => t.mode === "fade" ? { opacity: 0, transition: FADE_TRANSITION, x: 0 } : {
|
|
10011
|
+
opacity: 1,
|
|
10012
|
+
transition: SLIDE_TRANSITION,
|
|
10013
|
+
x: t.direction > 0 ? "-100%" : "100%"
|
|
10014
|
+
}
|
|
10015
|
+
};
|
|
10016
|
+
var COMPOSER_FADE_TRANSITION = {
|
|
10017
|
+
duration: 0.2,
|
|
10018
|
+
ease: "easeOut"
|
|
10019
|
+
};
|
|
10020
|
+
var COMPOSER_LOAD_FADE_TRANSITION = {
|
|
10021
|
+
duration: 0.22,
|
|
10022
|
+
ease: "easeOut"
|
|
10023
|
+
};
|
|
10024
|
+
var composerVariants = {
|
|
10025
|
+
center: (t) => ({
|
|
10026
|
+
opacity: 1,
|
|
10027
|
+
transition: t.mode === "fade" ? FADE_TRANSITION : { ...SLIDE_TRANSITION, opacity: COMPOSER_FADE_TRANSITION },
|
|
10028
|
+
x: 0
|
|
10029
|
+
}),
|
|
10030
|
+
enter: (t) => t.mode === "fade" ? { opacity: 0, x: 0 } : { opacity: 0, x: t.direction > 0 ? "-100%" : "100%" },
|
|
10031
|
+
exit: (t) => t.mode === "fade" ? { opacity: 0, transition: FADE_TRANSITION, x: 0 } : {
|
|
10032
|
+
opacity: 0,
|
|
10033
|
+
transition: {
|
|
10034
|
+
...SLIDE_TRANSITION,
|
|
10035
|
+
opacity: COMPOSER_FADE_TRANSITION
|
|
10036
|
+
},
|
|
10037
|
+
x: t.direction > 0 ? "100%" : "-100%"
|
|
10038
|
+
}
|
|
10039
|
+
};
|
|
10040
|
+
|
|
10041
|
+
// src/lib/support/resolveSubmitEmailGate.ts
|
|
10042
|
+
var EMAIL_GATE_ERROR = "Enter a valid email so we can reply to you.";
|
|
10043
|
+
function resolveEmailDraftError(emailDraft) {
|
|
10044
|
+
return EMAIL_PATTERN.test(emailDraft.trim()) ? null : EMAIL_GATE_ERROR;
|
|
10045
|
+
}
|
|
10046
|
+
function resolveSubmitEmailGate({
|
|
10047
|
+
emailDraft,
|
|
10048
|
+
isNewConversation,
|
|
10049
|
+
knownEmail
|
|
10050
|
+
}) {
|
|
10051
|
+
if (!isNewConversation || knownEmail) {
|
|
10052
|
+
return {
|
|
10053
|
+
emailForSend: knownEmail ?? void 0,
|
|
10054
|
+
ok: true,
|
|
10055
|
+
optimisticallyCapturedEmail: null
|
|
10056
|
+
};
|
|
10057
|
+
}
|
|
10058
|
+
const candidate = emailDraft.trim();
|
|
10059
|
+
if (!EMAIL_PATTERN.test(candidate)) {
|
|
10060
|
+
return {
|
|
10061
|
+
error: EMAIL_GATE_ERROR,
|
|
10062
|
+
ok: false
|
|
10063
|
+
};
|
|
10064
|
+
}
|
|
10065
|
+
return {
|
|
10066
|
+
emailForSend: candidate,
|
|
10067
|
+
ok: true,
|
|
10068
|
+
optimisticallyCapturedEmail: candidate
|
|
10069
|
+
};
|
|
10070
|
+
}
|
|
10071
|
+
|
|
9821
10072
|
// src/lib/support/types.ts
|
|
9822
10073
|
var MAX_MESSAGE_LENGTH = 5e3;
|
|
9823
10074
|
var MAX_CONVERSATION_IMAGE_ATTACHMENTS = 5;
|
|
@@ -13186,10 +13437,12 @@ import { jsx as jsx9, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
|
13186
13437
|
function Composer({
|
|
13187
13438
|
draft,
|
|
13188
13439
|
emailDraft,
|
|
13440
|
+
emailError,
|
|
13189
13441
|
imageInputRef,
|
|
13190
13442
|
isLoading,
|
|
13191
13443
|
needsEmail,
|
|
13192
13444
|
onDraftChange,
|
|
13445
|
+
onEmailBlur,
|
|
13193
13446
|
onEmailChange,
|
|
13194
13447
|
onImageSelection,
|
|
13195
13448
|
onRemovePendingImage,
|
|
@@ -13200,7 +13453,8 @@ function Composer({
|
|
|
13200
13453
|
sendError,
|
|
13201
13454
|
textareaRef
|
|
13202
13455
|
}) {
|
|
13203
|
-
const
|
|
13456
|
+
const emailReady = !needsEmail || resolveEmailDraftError(emailDraft) === null;
|
|
13457
|
+
const canSend = (draft.trim().length > 0 || pendingImages.length > 0) && emailReady;
|
|
13204
13458
|
return /* @__PURE__ */ jsxs3(
|
|
13205
13459
|
"form",
|
|
13206
13460
|
{
|
|
@@ -13208,21 +13462,29 @@ function Composer({
|
|
|
13208
13462
|
onSubmit,
|
|
13209
13463
|
children: [
|
|
13210
13464
|
sendError && /* @__PURE__ */ jsx9("p", { className: "mb-2 text-xs text-red-600", children: sendError }),
|
|
13211
|
-
needsEmail && /* @__PURE__ */
|
|
13212
|
-
|
|
13213
|
-
|
|
13214
|
-
|
|
13215
|
-
|
|
13216
|
-
|
|
13217
|
-
|
|
13218
|
-
|
|
13219
|
-
|
|
13220
|
-
|
|
13221
|
-
|
|
13222
|
-
|
|
13465
|
+
needsEmail && /* @__PURE__ */ jsxs3("div", { className: "mb-2", children: [
|
|
13466
|
+
/* @__PURE__ */ jsx9(
|
|
13467
|
+
"input",
|
|
13468
|
+
{
|
|
13469
|
+
"aria-invalid": emailError ? true : void 0,
|
|
13470
|
+
"aria-label": "Your email",
|
|
13471
|
+
className: cn(
|
|
13472
|
+
"w-full rounded-[var(--scw-composer-radius,24px)] border border-solid bg-white px-[11px] py-[9px] font-[inherit] text-sm text-neutral-950 placeholder:text-neutral-400 focus:outline-none",
|
|
13473
|
+
emailError ? "border-red-400 focus:border-red-500" : "border-border focus:border-[color:var(--scw-hairline-strong)]"
|
|
13474
|
+
),
|
|
13475
|
+
onBlur: onEmailBlur,
|
|
13476
|
+
onChange: (e) => onEmailChange(e.target.value),
|
|
13477
|
+
placeholder: "Your email address",
|
|
13478
|
+
type: "email",
|
|
13479
|
+
value: emailDraft
|
|
13480
|
+
}
|
|
13481
|
+
),
|
|
13482
|
+
emailError && /* @__PURE__ */ jsx9("p", { className: "mt-1.5 px-1 text-xs text-red-600", children: emailError })
|
|
13483
|
+
] }),
|
|
13484
|
+
pendingImages.length > 0 && /* @__PURE__ */ jsx9("div", { className: "mb-2 flex flex-wrap gap-2", children: pendingImages.map((file, index2) => /* @__PURE__ */ jsxs3(
|
|
13223
13485
|
Attachment,
|
|
13224
13486
|
{
|
|
13225
|
-
className: "relative size-14 overflow-hidden rounded-[10px] border border-solid border-
|
|
13487
|
+
className: "relative size-14 overflow-hidden rounded-[10px] border border-solid border-border p-0",
|
|
13226
13488
|
orientation: "vertical",
|
|
13227
13489
|
state: "done",
|
|
13228
13490
|
children: [
|
|
@@ -13248,7 +13510,7 @@ function Composer({
|
|
|
13248
13510
|
},
|
|
13249
13511
|
`${file.name}-${index2}`
|
|
13250
13512
|
)) }),
|
|
13251
|
-
/* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-2 rounded-[var(--scw-composer-radius,24px)] border border-solid border-
|
|
13513
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-2 rounded-[var(--scw-composer-radius,24px)] border border-solid border-border bg-white px-3.5 py-3 transition-[border-color,box-shadow] duration-[250ms] ease-in-out focus-within:border-neutral-900 focus-within:shadow-[0_0_0_1px_var(--scw-ink)]", children: [
|
|
13252
13514
|
/* @__PURE__ */ jsx9(
|
|
13253
13515
|
"textarea",
|
|
13254
13516
|
{
|
|
@@ -13317,64 +13579,13 @@ function focusComposer(textareaRef) {
|
|
|
13317
13579
|
});
|
|
13318
13580
|
}
|
|
13319
13581
|
|
|
13320
|
-
// src/lib/support/handoff.ts
|
|
13321
|
-
import { getToolName, isToolUIPart } from "ai";
|
|
13322
|
-
function readHandoffOffer(message) {
|
|
13323
|
-
for (const part of message.parts ?? []) {
|
|
13324
|
-
if (!isToolUIPart(part) || getToolName(part) !== REQUEST_HUMAN_HANDOFF_TOOL_NAME) {
|
|
13325
|
-
continue;
|
|
13326
|
-
}
|
|
13327
|
-
if (part.state !== "output-available") {
|
|
13328
|
-
continue;
|
|
13329
|
-
}
|
|
13330
|
-
const output = part.output;
|
|
13331
|
-
if (output?.offerHandoff && !output.declined) {
|
|
13332
|
-
return { reason: output.reason ?? null, toolCallId: part.toolCallId };
|
|
13333
|
-
}
|
|
13334
|
-
}
|
|
13335
|
-
return null;
|
|
13336
|
-
}
|
|
13337
|
-
function markHandoffDeclinedInMessages(messages, toolCallId) {
|
|
13338
|
-
let changed = false;
|
|
13339
|
-
const next = messages.map((message) => {
|
|
13340
|
-
if (message.role !== "assistant") {
|
|
13341
|
-
return message;
|
|
13342
|
-
}
|
|
13343
|
-
let messageChanged = false;
|
|
13344
|
-
const parts = (message.parts ?? []).map((part) => {
|
|
13345
|
-
if (!isToolUIPart(part) || getToolName(part) !== REQUEST_HUMAN_HANDOFF_TOOL_NAME) {
|
|
13346
|
-
return part;
|
|
13347
|
-
}
|
|
13348
|
-
if (part.toolCallId !== toolCallId || part.state !== "output-available") {
|
|
13349
|
-
return part;
|
|
13350
|
-
}
|
|
13351
|
-
const output = part.output;
|
|
13352
|
-
if (output?.declined) {
|
|
13353
|
-
return part;
|
|
13354
|
-
}
|
|
13355
|
-
messageChanged = true;
|
|
13356
|
-
changed = true;
|
|
13357
|
-
return {
|
|
13358
|
-
...part,
|
|
13359
|
-
output: {
|
|
13360
|
-
...output,
|
|
13361
|
-
declined: true,
|
|
13362
|
-
offerHandoff: false
|
|
13363
|
-
}
|
|
13364
|
-
};
|
|
13365
|
-
});
|
|
13366
|
-
return messageChanged ? { ...message, parts } : message;
|
|
13367
|
-
});
|
|
13368
|
-
return changed ? next : messages;
|
|
13369
|
-
}
|
|
13370
|
-
|
|
13371
13582
|
// ../../chat/client/src/lib/core/buildMessageBlocks.ts
|
|
13372
13583
|
import { isTextUIPart } from "ai";
|
|
13373
13584
|
|
|
13374
13585
|
// ../../chat/client/src/lib/core/toolParts.ts
|
|
13375
|
-
import { getToolName
|
|
13586
|
+
import { getToolName, isToolUIPart } from "ai";
|
|
13376
13587
|
function isLiveToolPart(part) {
|
|
13377
|
-
if (!
|
|
13588
|
+
if (!isToolUIPart(part)) {
|
|
13378
13589
|
return false;
|
|
13379
13590
|
}
|
|
13380
13591
|
return part.state !== "output-available" && part.state !== "output-error";
|
|
@@ -13386,13 +13597,13 @@ function messageHasLiveTools(message) {
|
|
|
13386
13597
|
return (message.parts ?? []).some(isLiveToolPart);
|
|
13387
13598
|
}
|
|
13388
13599
|
function toolPartToView(part) {
|
|
13389
|
-
if (!
|
|
13600
|
+
if (!isToolUIPart(part)) {
|
|
13390
13601
|
return null;
|
|
13391
13602
|
}
|
|
13392
13603
|
const view = {
|
|
13393
13604
|
state: part.state,
|
|
13394
13605
|
toolCallId: part.toolCallId,
|
|
13395
|
-
toolName:
|
|
13606
|
+
toolName: getToolName(part)
|
|
13396
13607
|
};
|
|
13397
13608
|
if (part.state === "approval-requested" && "approval" in part) {
|
|
13398
13609
|
view.approvalId = part.approval.id;
|
|
@@ -13400,9 +13611,6 @@ function toolPartToView(part) {
|
|
|
13400
13611
|
}
|
|
13401
13612
|
return view;
|
|
13402
13613
|
}
|
|
13403
|
-
function isToolPartComplete(state) {
|
|
13404
|
-
return state === "output-available" || state === "output-error";
|
|
13405
|
-
}
|
|
13406
13614
|
|
|
13407
13615
|
// ../../chat/client/src/lib/core/buildMessageBlocks.ts
|
|
13408
13616
|
function buildMessageBlocks(message) {
|
|
@@ -13440,109 +13648,6 @@ function buildMessageBlocks(message) {
|
|
|
13440
13648
|
|
|
13441
13649
|
// src/lib/support/message-utils.ts
|
|
13442
13650
|
import { lastAssistantMessageIsCompleteWithToolCalls } from "ai";
|
|
13443
|
-
|
|
13444
|
-
// src/lib/support/widget-constants.ts
|
|
13445
|
-
var MESSAGE_GROUP_THRESHOLD_MS = 2 * 60 * 1e3;
|
|
13446
|
-
var POLL_INTERVAL_MS = 5e3;
|
|
13447
|
-
var MAX_TEXTAREA_HEIGHT_PX = 120;
|
|
13448
|
-
var SCROLL_BOTTOM_THRESHOLD_PX = 56;
|
|
13449
|
-
var SCROLL_PREVIOUS_ITEM_PEEK_PX = 64;
|
|
13450
|
-
var OVERSCROLL_EDGE_SLACK_PX = 1;
|
|
13451
|
-
var BOUNCE_SETTLE_MS = 400;
|
|
13452
|
-
var MIN_SCROLLBAR_THUMB_PX = 28;
|
|
13453
|
-
var PANEL_WIDTH_PX = 384;
|
|
13454
|
-
var PANEL_MAX_HEIGHT_PX = 680;
|
|
13455
|
-
var PANEL_VERTICAL_RESERVE_PX = 110;
|
|
13456
|
-
var PANEL_HORIZONTAL_RESERVE_PX = 40;
|
|
13457
|
-
var MOBILE_BREAKPOINT_PX = 640;
|
|
13458
|
-
var ROOT_PADDING_PX = 16;
|
|
13459
|
-
var ROOT_HORIZONTAL_PADDING_PX = ROOT_PADDING_PX * 2;
|
|
13460
|
-
var ROOT_VERTICAL_PADDING_PX = ROOT_PADDING_PX * 2;
|
|
13461
|
-
var LAUNCHER_SIZE_PX = 60;
|
|
13462
|
-
var CLOSED_FRAME_SIZE_PX = LAUNCHER_SIZE_PX + ROOT_HORIZONTAL_PADDING_PX;
|
|
13463
|
-
var ROOT_STACK_GAP_PX = 12;
|
|
13464
|
-
var EMAIL_PATTERN = /^[^\s@]+@[^\s@]+\.[^\s@]+$/u;
|
|
13465
|
-
var DEFAULT_BRANDING = {
|
|
13466
|
-
agentLabel: "AI Agent",
|
|
13467
|
-
greeting: "Ask us anything, or share your feedback.",
|
|
13468
|
-
replyTime: "a few hours",
|
|
13469
|
-
teamDescription: "The team can also help",
|
|
13470
|
-
workspaceName: "Support"
|
|
13471
|
-
};
|
|
13472
|
-
var FADE_TRANSITION = { duration: 0.12, ease: "easeOut" };
|
|
13473
|
-
var SLIDE_TRANSITION = {
|
|
13474
|
-
duration: 0.28,
|
|
13475
|
-
ease: [0.32, 0.72, 0, 1]
|
|
13476
|
-
};
|
|
13477
|
-
var NAV_TRANSITION = { duration: 0.2, ease: "easeOut" };
|
|
13478
|
-
var LAUNCHER_ICON_TRANSITION = {
|
|
13479
|
-
type: "spring",
|
|
13480
|
-
stiffness: 420,
|
|
13481
|
-
damping: 30,
|
|
13482
|
-
mass: 0.85
|
|
13483
|
-
};
|
|
13484
|
-
var LAUNCHER_ICON_ROTATE_DEG = 25;
|
|
13485
|
-
var LAUNCHER_BUTTON_TRANSITION = {
|
|
13486
|
-
type: "spring",
|
|
13487
|
-
stiffness: 520,
|
|
13488
|
-
damping: 28,
|
|
13489
|
-
mass: 0.7
|
|
13490
|
-
};
|
|
13491
|
-
var LAUNCHER_HOVER_SCALE = 1.08;
|
|
13492
|
-
var LAUNCHER_TAP_SCALE = 0.9;
|
|
13493
|
-
var PANEL_SPRING = {
|
|
13494
|
-
type: "spring",
|
|
13495
|
-
stiffness: 380,
|
|
13496
|
-
damping: 32,
|
|
13497
|
-
mass: 0.85,
|
|
13498
|
-
opacity: { duration: 0.22, ease: "easeOut" }
|
|
13499
|
-
};
|
|
13500
|
-
var SCROLL_BOTTOM_TRANSITION = {
|
|
13501
|
-
duration: 0.38,
|
|
13502
|
-
ease: [0.32, 0.72, 0, 1],
|
|
13503
|
-
opacity: { delay: 0.12, duration: 0.2, ease: "easeInOut" }
|
|
13504
|
-
};
|
|
13505
|
-
var FOOTER_SWAP_SHIFT_PX = 28;
|
|
13506
|
-
var PANEL_CLOSED_SCALE = 0.94;
|
|
13507
|
-
var viewVariants = {
|
|
13508
|
-
center: (t) => ({
|
|
13509
|
-
opacity: 1,
|
|
13510
|
-
transition: t.mode === "fade" ? FADE_TRANSITION : SLIDE_TRANSITION,
|
|
13511
|
-
x: 0
|
|
13512
|
-
}),
|
|
13513
|
-
enter: (t) => t.mode === "fade" ? { opacity: 0, x: 0 } : { opacity: 1, x: t.direction > 0 ? "100%" : "-100%" },
|
|
13514
|
-
exit: (t) => t.mode === "fade" ? { opacity: 0, transition: FADE_TRANSITION, x: 0 } : {
|
|
13515
|
-
opacity: 1,
|
|
13516
|
-
transition: SLIDE_TRANSITION,
|
|
13517
|
-
x: t.direction > 0 ? "-100%" : "100%"
|
|
13518
|
-
}
|
|
13519
|
-
};
|
|
13520
|
-
var COMPOSER_FADE_TRANSITION = {
|
|
13521
|
-
duration: 0.2,
|
|
13522
|
-
ease: "easeOut"
|
|
13523
|
-
};
|
|
13524
|
-
var COMPOSER_LOAD_FADE_TRANSITION = {
|
|
13525
|
-
duration: 0.22,
|
|
13526
|
-
ease: "easeOut"
|
|
13527
|
-
};
|
|
13528
|
-
var composerVariants = {
|
|
13529
|
-
center: (t) => ({
|
|
13530
|
-
opacity: 1,
|
|
13531
|
-
transition: t.mode === "fade" ? FADE_TRANSITION : { ...SLIDE_TRANSITION, opacity: COMPOSER_FADE_TRANSITION },
|
|
13532
|
-
x: 0
|
|
13533
|
-
}),
|
|
13534
|
-
enter: (t) => t.mode === "fade" ? { opacity: 0, x: 0 } : { opacity: 0, x: t.direction > 0 ? "-100%" : "100%" },
|
|
13535
|
-
exit: (t) => t.mode === "fade" ? { opacity: 0, transition: FADE_TRANSITION, x: 0 } : {
|
|
13536
|
-
opacity: 0,
|
|
13537
|
-
transition: {
|
|
13538
|
-
...SLIDE_TRANSITION,
|
|
13539
|
-
opacity: COMPOSER_FADE_TRANSITION
|
|
13540
|
-
},
|
|
13541
|
-
x: t.direction > 0 ? "100%" : "-100%"
|
|
13542
|
-
}
|
|
13543
|
-
};
|
|
13544
|
-
|
|
13545
|
-
// src/lib/support/message-utils.ts
|
|
13546
13651
|
function isAttachmentOnlyPlainBody(text) {
|
|
13547
13652
|
const trimmed = text.trim();
|
|
13548
13653
|
if (trimmed === "[Image]") {
|
|
@@ -13586,7 +13691,7 @@ function createLocalUserMessage({
|
|
|
13586
13691
|
}
|
|
13587
13692
|
function readMessageAttachmentUrls(message) {
|
|
13588
13693
|
const { metadata } = message;
|
|
13589
|
-
if (!
|
|
13694
|
+
if (!isRecord(metadata) || !("attachmentUrls" in metadata)) {
|
|
13590
13695
|
return [];
|
|
13591
13696
|
}
|
|
13592
13697
|
const value = metadata.attachmentUrls;
|
|
@@ -13595,9 +13700,6 @@ function readMessageAttachmentUrls(message) {
|
|
|
13595
13700
|
}
|
|
13596
13701
|
return value.filter((entry) => typeof entry === "string");
|
|
13597
13702
|
}
|
|
13598
|
-
function isRecord2(value) {
|
|
13599
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
13600
|
-
}
|
|
13601
13703
|
async function fileToBase64(file) {
|
|
13602
13704
|
const buffer = await file.arrayBuffer();
|
|
13603
13705
|
const bytes = new Uint8Array(buffer);
|
|
@@ -13862,28 +13964,6 @@ function coerceToolArgs(args) {
|
|
|
13862
13964
|
}
|
|
13863
13965
|
return {};
|
|
13864
13966
|
}
|
|
13865
|
-
function buildToolContext({
|
|
13866
|
-
identity: identity2,
|
|
13867
|
-
stateSnapshot: stateSnapshot2
|
|
13868
|
-
}) {
|
|
13869
|
-
const context = {};
|
|
13870
|
-
if (stateSnapshot2 && typeof stateSnapshot2 === "object" && !Array.isArray(stateSnapshot2)) {
|
|
13871
|
-
for (const [key, value] of Object.entries(
|
|
13872
|
-
stateSnapshot2
|
|
13873
|
-
)) {
|
|
13874
|
-
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
13875
|
-
context[key] = value;
|
|
13876
|
-
}
|
|
13877
|
-
}
|
|
13878
|
-
}
|
|
13879
|
-
if (identity2?.distinctId) {
|
|
13880
|
-
context.distinctId = identity2.distinctId;
|
|
13881
|
-
}
|
|
13882
|
-
if (identity2?.email) {
|
|
13883
|
-
context.email = identity2.email;
|
|
13884
|
-
}
|
|
13885
|
-
return context;
|
|
13886
|
-
}
|
|
13887
13967
|
|
|
13888
13968
|
// src/lib/support/reconstructDashboardTool.ts
|
|
13889
13969
|
function reconstructDashboardTool(def) {
|
|
@@ -13937,7 +14017,7 @@ function reconstructDashboardTool(def) {
|
|
|
13937
14017
|
|
|
13938
14018
|
// src/lib/support/generated/widget-css.ts
|
|
13939
14019
|
var GENERATED_WIDGET_CSS = `/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
13940
|
-
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){:root,:host{--shimmer-angle:20deg}*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-scroll-snap-strictness:proximity;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--scroll-fade-t:0px;--scroll-fade-b:0px;--scroll-fade-s:0px;--scroll-fade-e:0px;--scroll-fade-mask:initial;--shimmer-image:initial;--shimmer-text-fill:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-600:oklch(57.7% .245 27.325);--color-amber-500:oklch(76.9% .188 70.08);--color-blue-600:oklch(54.6% .245 262.881);--color-neutral-50:oklch(98.5% 0 0);--color-neutral-100:oklch(97% 0 0);--color-neutral-200:oklch(92.2% 0 0);--color-neutral-300:oklch(87% 0 0);--color-neutral-400:oklch(70.8% 0 0);--color-neutral-500:oklch(55.6% 0 0);--color-neutral-600:oklch(43.9% 0 0);--color-neutral-700:oklch(37.1% 0 0);--color-neutral-800:oklch(26.9% 0 0);--color-neutral-900:oklch(20.5% 0 0);--color-neutral-950:oklch(14.5% 0 0);--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--leading-tight:1.25;--leading-relaxed:1.625;--radius-md:calc(var(--radius) - 2px);--radius-2xl:1rem;--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:0}.inset-x-0{inset-inline:0}.inset-s-1{inset-inline-start:var(--spacing)}.inset-s-1\\/2{inset-inline-start:50%}.top-0{top:0}.top-0\\.5{top:calc(var(--spacing) * .5)}.top-1{top:var(--spacing)}.top-1\\/2{top:50%}.top-\\[calc\\(100\\%\\+8px\\)\\]{top:calc(100% + 8px)}.top-\\[var\\(--scw-header-padding\\)\\]{top:var(--scw-header-padding)}.right-0{right:0}.right-0\\.5{right:calc(var(--spacing) * .5)}.right-3{right:calc(var(--spacing) * 3)}.right-\\[var\\(--scw-header-padding\\)\\]{right:var(--scw-header-padding)}.bottom-0{bottom:0}.bottom-\\[calc\\(var\\(--scw-send-pill-gap\\)\\+var\\(--scw-nav-height\\)\\)\\]{bottom:calc(var(--scw-send-pill-gap) + var(--scw-nav-height))}.bottom-full{bottom:100%}.left-1{left:var(--spacing)}.left-1\\/2{left:50%}.left-3{left:calc(var(--spacing) * 3)}.z-10{z-index:10}.z-20{z-index:20}.z-\\[1\\]{z-index:1}.z-\\[2\\]{z-index:2}.z-\\[5\\]{z-index:5}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.m-0{margin:0}.mx-auto{margin-inline:auto}.my-6{margin-block:calc(var(--spacing) * 6)}.-mt-1{margin-top:calc(var(--spacing) * -1)}.-mt-1\\.5{margin-top:calc(var(--spacing) * -1.5)}.mt-0{margin-top:0}.mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-\\[-16px\\]{margin-top:-16px}.mb-0{margin-bottom:0}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-2\\.5{margin-bottom:calc(var(--spacing) * 2.5)}.ml-\\[0\\.25em\\]{margin-left:.25em}.box-border{box-sizing:border-box}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.aspect-auto{aspect-ratio:auto}.aspect-square{aspect-ratio:1}.size-1{width:var(--spacing);height:var(--spacing)}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-2\\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-12{width:calc(var(--spacing) * 12);height:calc(var(--spacing) * 12)}.size-14{width:calc(var(--spacing) * 14);height:calc(var(--spacing) * 14)}.size-\\[1\\.45em\\]{width:1.45em;height:1.45em}.size-\\[18px\\]{width:18px;height:18px}.size-\\[25px\\]{width:25px;height:25px}.size-\\[60px\\]{width:60px;height:60px}.size-\\[var\\(--scw-header-btn-size\\)\\]{width:var(--scw-header-btn-size);height:var(--scw-header-btn-size)}.size-full{width:100%;height:100%}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-\\[13px\\]{height:13px}.h-\\[var\\(--scw-panel-height\\,600px\\)\\]{height:var(--scw-panel-height,600px)}.h-auto{height:auto}.h-full{height:100%}.h-max{height:max-content}.max-h-\\[120px\\]{max-height:120px}.min-h-0{min-height:0}.min-h-4{min-height:calc(var(--spacing) * 4)}.min-h-\\[22px\\]{min-height:22px}.min-h-\\[200px\\]{min-height:200px}.min-h-\\[calc\\(var\\(--scw-header-padding\\)\\*2\\+var\\(--scw-header-btn-size\\)\\)\\]{min-height:calc(var(--scw-header-padding) * 2 + var(--scw-header-btn-size))}.min-h-full{min-height:100%}.w-10{width:calc(var(--spacing) * 10)}.w-24{width:calc(var(--spacing) * 24)}.w-\\[var\\(--scw-panel-width\\,384px\\)\\]{width:var(--scw-panel-width,384px)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-max{width:max-content}.max-w-\\[80\\%\\]{max-width:80%}.max-w-\\[82\\%\\]{max-width:82%}.max-w-\\[88\\%\\]{max-width:88%}.max-w-\\[220px\\]{max-width:220px}.max-w-\\[min\\(240px\\,var\\(--scw-host-viewport-width\\,100vw\\)\\)\\]{max-width:min(240px, var(--scw-host-viewport-width,100vw))}.max-w-full{max-width:100%}.min-w-0{min-width:0}.min-w-8{min-width:calc(var(--spacing) * 8)}.min-w-40{min-width:calc(var(--spacing) * 40)}.min-w-\\[1\\.45em\\]{min-width:1.45em}.flex-1{flex:1}.flex-none{flex:none}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.origin-bottom-right{transform-origin:100% 100%}.origin-center{transform-origin:50%}.-translate-x-1{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-3{--tw-translate-y:calc(var(--spacing) * -3);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-3\\/4{--tw-translate-y:calc(calc(3 / 4 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-3{--tw-translate-y:calc(var(--spacing) * 3);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-3\\/4{--tw-translate-y:calc(3 / 4 * 100%);translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-90{rotate:90deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.shimmer{--_spread:var(--shimmer-spread,calc(3ch + 40px));--_base:currentColor;--_highlight:var(--shimmer-color,oklch(from currentColor l c h / calc(alpha* .2)));background-image:var(--shimmer-image,linear-gradient(calc(90deg + var(--shimmer-angle)), var(--_base) calc(50% - var(--_spread)), var(--_highlight) calc(50% - var(--_spread) * .5), var(--_highlight) 50%, var(--_highlight) calc(50% + var(--_spread) * .5), var(--_base) calc(50% + var(--_spread))))}@supports (color:color-mix(in lab, red, red)){.shimmer{background-image:var(--shimmer-image,linear-gradient(calc(90deg + var(--shimmer-angle)), var(--_base) calc(50% - var(--_spread)), color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% - var(--_spread) * .5), var(--_highlight) 50%, color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% + var(--_spread) * .5), var(--_base) calc(50% + var(--_spread))))}}.shimmer{background-repeat:no-repeat;background-size:calc(200% + var(--_spread) * 2) 100%;-webkit-text-fill-color:var(--shimmer-text-fill,transparent);animation:tw-shimmer var(--shimmer-duration,2s) linear infinite;background-position:0 0;-webkit-background-clip:text;background-clip:text}@media (prefers-color-scheme:dark){.shimmer{--_highlight:var(--shimmer-color,oklch(from currentColor max(.8, calc(l + .4)) c h / calc(alpha + .4)))}}.shimmer:where([dir=rtl],[dir=rtl] *){animation-direction:reverse}.scroll-fade-x{--_scroll-fade-size-s:var(--scroll-fade-s-size,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))));--_scroll-fade-size-e:var(--scroll-fade-e-size,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))));--scroll-fade-inline:linear-gradient(to right, transparent 0, #000 var(--scroll-fade-s,0px), #000 calc(100% - var(--scroll-fade-e,0px)), transparent 100%)}.scroll-fade-x:where([dir=rtl],[dir=rtl] *){--scroll-fade-inline:linear-gradient(to left, transparent 0, #000 var(--scroll-fade-s,0px), #000 calc(100% - var(--scroll-fade-e,0px)), transparent 100%)}.scroll-fade-x{-webkit-mask-image:var(--scroll-fade-mask,var(--scroll-fade-inline));-webkit-mask-image:var(--scroll-fade-mask,var(--scroll-fade-inline));-webkit-mask-image:var(--scroll-fade-mask,var(--scroll-fade-inline));mask-image:var(--scroll-fade-mask,var(--scroll-fade-inline));-webkit-mask-composite:source-in;-webkit-mask-composite:source-in;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-composite:source-in;mask-composite:intersect}@supports (animation-timeline:scroll()){.scroll-fade-x{animation:1ms ease-in-out scroll-fade-reveal-s,1ms ease-in-out scroll-fade-reveal-e;animation-timeline:scroll(self inline),scroll(self inline);animation-range:0 var(--scroll-fade-reveal,calc(var(--spacing) * 24)), calc(100% - var(--scroll-fade-reveal,calc(var(--spacing) * 24))) 100%;animation-fill-mode:both}}@supports not (animation-timeline:scroll()){.scroll-fade-x{--scroll-fade-s:var(--_scroll-fade-size-s);--scroll-fade-e:var(--_scroll-fade-size-e)}}.scroll-fade{--_scroll-fade-size-t:var(--scroll-fade-t-size,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))));--_scroll-fade-size-b:var(--scroll-fade-b-size,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))));--scroll-fade-block:linear-gradient(to bottom, transparent 0, #000 var(--scroll-fade-t,0px), #000 calc(100% - var(--scroll-fade-b,0px)), transparent 100%);-webkit-mask-image:var(--scroll-fade-mask,var(--scroll-fade-block));-webkit-mask-image:var(--scroll-fade-mask,var(--scroll-fade-block));-webkit-mask-image:var(--scroll-fade-mask,var(--scroll-fade-block));mask-image:var(--scroll-fade-mask,var(--scroll-fade-block));-webkit-mask-composite:source-in;-webkit-mask-composite:source-in;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-composite:source-in;mask-composite:intersect}@supports (animation-timeline:scroll()){.scroll-fade{animation:1ms ease-in-out scroll-fade-reveal-t,1ms ease-in-out scroll-fade-reveal-b;animation-timeline:scroll(self y),scroll(self y);animation-range:0 var(--scroll-fade-reveal,calc(var(--spacing) * 24)), calc(100% - var(--scroll-fade-reveal,calc(var(--spacing) * 24))) 100%;animation-fill-mode:both}}@supports not (animation-timeline:scroll()){.scroll-fade{--scroll-fade-t:var(--_scroll-fade-size-t);--scroll-fade-b:var(--_scroll-fade-size-b)}}.scroll-fade-b{--_scroll-fade-size-b:var(--scroll-fade-b-size,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))));--scroll-fade-mask:linear-gradient(to bottom, #000 0, #000 calc(100% - var(--scroll-fade-b,0px)), transparent 100%);-webkit-mask-image:var(--scroll-fade-mask);-webkit-mask-image:var(--scroll-fade-mask);-webkit-mask-image:var(--scroll-fade-mask);mask-image:var(--scroll-fade-mask);-webkit-mask-composite:source-in;-webkit-mask-composite:source-in;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-composite:source-in;mask-composite:intersect}@supports (animation-timeline:scroll()){.scroll-fade-b{animation:1ms ease-in-out scroll-fade-reveal-b;animation-timeline:scroll(self y);animation-range:calc(100% - var(--scroll-fade-reveal,calc(var(--spacing) * 24))) 100%;animation-fill-mode:both}}@supports not (animation-timeline:scroll()){.scroll-fade-b{--scroll-fade-b:var(--_scroll-fade-size-b)}}.animate-\\[scw-spin_\\.7s_linear_infinite\\]{animation:.7s linear infinite scw-spin}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-pan-y{--tw-pan-y:pan-y;touch-action:var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)}.resize{resize:both}.resize-none{resize:none}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-mandatory{--tw-scroll-snap-strictness:mandatory}.scroll-px-1{scroll-padding-inline:var(--spacing)}.\\[scrollbar-width\\:none\\],.scrollbar-none{scrollbar-width:none}.scrollbar-thin{scrollbar-width:thin}.\\[scrollbar-gutter\\:auto\\]{scrollbar-gutter:auto}.scrollbar-gutter-stable{scrollbar-gutter:stable}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:0}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-\\[3px\\]{gap:3px}.gap-\\[5px\\]{gap:5px}.self-center{align-self:center}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.overscroll-contain{overscroll-behavior:contain}.overscroll-x-contain{overscroll-behavior-x:contain}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-\\[10px\\]{border-radius:10px}.rounded-\\[14px\\]{border-radius:14px}.rounded-\\[min\\(var\\(--radius-md\\)\\,10px\\)\\]{border-radius:min(var(--radius-md), 10px)}.rounded-\\[min\\(var\\(--radius-md\\)\\,12px\\)\\]{border-radius:min(var(--radius-md), 12px)}.rounded-\\[var\\(--scw-composer-radius\\,24px\\)\\]{border-radius:var(--scw-composer-radius,24px)}.rounded-\\[var\\(--scw-header-btn-concentric\\)\\]{border-radius:var(--scw-header-btn-concentric)}.rounded-\\[var\\(--scw-panel-radius\\)\\]{border-radius:var(--scw-panel-radius)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-br-\\[4px\\]{border-bottom-right-radius:4px}.rounded-bl-\\[4px\\]{border-bottom-left-radius:4px}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-\\[1\\.5px\\]{border-style:var(--tw-border-style);border-width:1.5px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-none{--tw-border-style:none;border-style:none}.border-solid{--tw-border-style:solid;border-style:solid}.border-\\[\\#ececec\\]{border-color:#ececec}.border-\\[\\#f0f0f0\\]{border-color:#f0f0f0}.border-border{border-color:var(--border)}.border-neutral-200{border-color:var(--color-neutral-200)}.border-neutral-300{border-color:var(--color-neutral-300)}.border-neutral-900{border-color:var(--color-neutral-900)}.border-transparent{border-color:#0000}.border-t-neutral-500{border-top-color:var(--color-neutral-500)}.bg-\\[\\#eff6ff\\]{background-color:#eff6ff}.bg-\\[\\#f1f1f3\\]{background-color:#f1f1f3}.bg-\\[rgba\\(10\\,10\\,10\\,\\.72\\)\\]{background-color:#0a0a0ab8}.bg-amber-500{background-color:var(--color-amber-500)}.bg-background{background-color:var(--background)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-card{background-color:var(--card)}.bg-destructive,.bg-destructive\\/10{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.bg-destructive\\/10{background-color:color-mix(in oklab, var(--destructive) 10%, transparent)}}.bg-muted{background-color:var(--muted)}.bg-neutral-100{background-color:var(--color-neutral-100)}.bg-neutral-200{background-color:var(--color-neutral-200)}.bg-neutral-400{background-color:var(--color-neutral-400)}.bg-neutral-900{background-color:var(--color-neutral-900)}.bg-primary{background-color:var(--primary)}.bg-secondary{background-color:var(--secondary)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-clip-padding{background-clip:padding-box}.p-0{padding:0}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-\\[var\\(--scw-header-padding\\)\\]{padding:var(--scw-header-padding)}.px-0{padding-inline:0}.px-1{padding-inline:var(--spacing)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-\\[11px\\]{padding-inline:11px}.px-\\[13px\\]{padding-inline:13px}.px-\\[18px\\]{padding-inline:18px}.px-\\[var\\(--scw-composer-inset\\)\\]{padding-inline:var(--scw-composer-inset)}.px-\\[var\\(--scw-message-inset-x\\,16px\\)\\]{padding-inline:var(--scw-message-inset-x,16px)}.py-0{padding-block:0}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-\\[9px\\]{padding-block:9px}.py-\\[11px\\]{padding-block:11px}.pt-1{padding-top:var(--spacing)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-2\\.5{padding-top:calc(var(--spacing) * 2.5)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pb-1{padding-bottom:var(--spacing)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-2\\.5{padding-bottom:calc(var(--spacing) * 2.5)}.pb-11{padding-bottom:calc(var(--spacing) * 11)}.pb-\\[calc\\(8px\\+var\\(--scw-nav-height\\)\\+var\\(--scw-send-pill-gap\\)\\+var\\(--scw-send-pill-height\\)\\)\\]{padding-bottom:calc(8px + var(--scw-nav-height) + var(--scw-send-pill-gap) + var(--scw-send-pill-height))}.pb-\\[calc\\(24px\\+var\\(--scw-nav-height\\)\\)\\]{padding-bottom:calc(24px + var(--scw-nav-height))}.pb-\\[var\\(--scw-composer-inset\\)\\]{padding-bottom:var(--scw-composer-inset)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-2\\.5{padding-left:calc(var(--spacing) * 2.5)}.text-center{text-align:center}.text-left{text-align:left}.align-baseline{vertical-align:baseline}.\\[font-family\\:var\\(--scw-font\\)\\]{font-family:var(--scw-font)}.font-\\[inherit\\]{font-family:inherit}.font-mono{font-family:var(--font-mono)}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[0\\.8rem\\]{font-size:.8rem}.text-\\[0\\.78em\\]{font-size:.78em}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[13px\\]{font-size:13px}.text-\\[14px\\]{font-size:14px}.leading-\\[1\\.3\\]{--tw-leading:1.3;line-height:1.3}.leading-\\[1\\.4\\]{--tw-leading:1.4;line-height:1.4}.leading-\\[1\\.35\\]{--tw-leading:1.35;line-height:1.35}.leading-\\[1\\.45\\]{--tw-leading:1.45;line-height:1.45}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\\[-0\\.01em\\]{--tw-tracking:-.01em;letter-spacing:-.01em}.tracking-\\[0\\.04em\\]{--tw-tracking:.04em;letter-spacing:.04em}.\\[overflow-wrap\\:anywhere\\]{overflow-wrap:anywhere}.break-words,.wrap-break-word{overflow-wrap:break-word}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\\[\\#a3a3a3\\]{color:#a3a3a3}.text-blue-600{color:var(--color-blue-600)}.text-card-foreground{color:var(--card-foreground)}.text-destructive{color:var(--destructive)}.text-foreground{color:var(--foreground)}.text-inherit{color:inherit}.text-muted-foreground{color:var(--muted-foreground)}.text-neutral-400{color:var(--color-neutral-400)}.text-neutral-500{color:var(--color-neutral-500)}.text-neutral-600{color:var(--color-neutral-600)}.text-neutral-700{color:var(--color-neutral-700)}.text-neutral-900{color:var(--color-neutral-900)}.text-neutral-950{color:var(--color-neutral-950)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-red-600{color:var(--color-red-600)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-white{color:var(--color-white)}.uppercase{text-transform:uppercase}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0}.opacity-60{opacity:.6}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_0_0_1px_\\#171717\\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#171717);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_0_0_1px_\\#e5e5e5\\,0_4px_12px_-2px_rgba\\(0\\,0\\,0\\,\\.12\\)\\,0_2px_4px_-2px_rgba\\(0\\,0\\,0\\,\\.08\\)\\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#e5e5e5), 0 4px 12px -2px var(--tw-shadow-color,#0000001f), 0 2px 4px -2px var(--tw-shadow-color,#00000014);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_0_0_1px_rgba\\(0\\,0\\,0\\,\\.08\\)\\,0_10px_15px_-3px_rgba\\(0\\,0\\,0\\,\\.1\\)\\,0_4px_6px_-4px_rgba\\(0\\,0\\,0\\,\\.1\\)\\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#00000014), 0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_2px_8px_rgba\\(0\\,0\\,0\\,\\.06\\)\\]{--tw-shadow:0 2px 8px var(--tw-shadow-color,#0000000f);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_6px_16px_rgba\\(0\\,0\\,0\\,\\.18\\)\\]{--tw-shadow:0 6px 16px var(--tw-shadow-color,#0000002e);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_10px_15px_-3px_rgba\\(0\\,0\\,0\\,\\.1\\)\\,0_4px_6px_-4px_rgba\\(0\\,0\\,0\\,\\.1\\)\\]{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[inset_0_0_0_1px_\\#e5e5e5\\]{--tw-shadow:inset 0 0 0 1px var(--tw-shadow-color,#e5e5e5);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-3{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-card{--tw-ring-color:var(--card)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[background-color\\,box-shadow\\]{transition-property:background-color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[border-color\\,box-shadow\\]{transition-property:border-color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[translate\\,scale\\,opacity\\]{transition-property:translate,scale,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-\\[120ms\\]{--tw-duration:.12s;transition-duration:.12s}.duration-\\[250ms\\]{--tw-duration:.25s;transition-duration:.25s}.duration-\\[280ms\\]{--tw-duration:.28s;transition-duration:.28s}.ease-\\[cubic-bezier\\(\\.32\\,\\.72\\,0\\,1\\)\\]{--tw-ease:cubic-bezier(.32,.72,0,1);transition-timing-function:cubic-bezier(.32,.72,0,1)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.contain-content{contain:content}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.\\[-webkit-tap-highlight-color\\:transparent\\]{-webkit-tap-highlight-color:transparent}.\\[overflow-anchor\\:none\\]{overflow-anchor:none}.backface-hidden{backface-visibility:hidden}.group-has-data-\\[slot\\=message-footer\\]\\/message\\:-translate-y-8:is(:where(.group\\/message):has([data-slot=message-footer]) *){--tw-translate-y:calc(var(--spacing) * -8);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-has-data-\\[variant\\=ghost\\]\\/message\\:px-0:is(:where(.group\\/message):has([data-variant=ghost]) *){padding-inline:0}.group-data-\\[align\\=end\\]\\/bubble\\:self-end:is(:where(.group\\/bubble)[data-align=end] *){align-self:flex-end}.group-data-\\[align\\=end\\]\\/message\\:justify-end:is(:where(.group\\/message)[data-align=end] *){justify-content:flex-end}.group-data-\\[align\\=end\\]\\/message\\:self-end:is(:where(.group\\/message)[data-align=end] *){align-self:flex-end}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:absolute:is(:where(.group\\/attachment)[data-orientation=vertical] *){position:absolute}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:top-3:is(:where(.group\\/attachment)[data-orientation=vertical] *){top:calc(var(--spacing) * 3)}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:right-3:is(:where(.group\\/attachment)[data-orientation=vertical] *){right:calc(var(--spacing) * 3)}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:w-full:is(:where(.group\\/attachment)[data-orientation=vertical] *){width:100%}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:gap-1:is(:where(.group\\/attachment)[data-orientation=vertical] *){gap:var(--spacing)}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:px-1:is(:where(.group\\/attachment)[data-orientation=vertical] *){padding-inline:var(--spacing)}.group-data-\\[size\\=sm\\]\\/attachment\\:w-8:is(:where(.group\\/attachment)[data-size=sm] *){width:calc(var(--spacing) * 8)}.group-data-\\[size\\=xs\\]\\/attachment\\:w-7:is(:where(.group\\/attachment)[data-size=xs] *){width:calc(var(--spacing) * 7)}.group-data-\\[size\\=xs\\]\\/attachment\\:rounded-md:is(:where(.group\\/attachment)[data-size=xs] *){border-radius:calc(var(--radius) - 2px)}.group-data-\\[state\\=done\\]\\/attachment\\:opacity-100:is(:where(.group\\/attachment)[data-state=done] *){opacity:1}.group-data-\\[state\\=error\\]\\/attachment\\:bg-destructive\\/10:is(:where(.group\\/attachment)[data-state=error] *){background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.group-data-\\[state\\=error\\]\\/attachment\\:bg-destructive\\/10:is(:where(.group\\/attachment)[data-state=error] *){background-color:color-mix(in oklab, var(--destructive) 10%, transparent)}}.group-data-\\[state\\=error\\]\\/attachment\\:text-destructive:is(:where(.group\\/attachment)[data-state=error] *),.group-data-\\[state\\=error\\]\\/attachment\\:text-destructive\\/80:is(:where(.group\\/attachment)[data-state=error] *){color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.group-data-\\[state\\=error\\]\\/attachment\\:text-destructive\\/80:is(:where(.group\\/attachment)[data-state=error] *){color:color-mix(in oklab, var(--destructive) 80%, transparent)}}.group-data-\\[state\\=idle\\]\\/attachment\\:opacity-100:is(:where(.group\\/attachment)[data-state=idle] *){opacity:1}.group-data-\\[state\\=processing\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=processing] *){--_spread:var(--shimmer-spread,calc(3ch + 40px));--_base:currentColor;--_highlight:var(--shimmer-color,oklch(from currentColor l c h / calc(alpha* .2)));background-image:var(--shimmer-image,linear-gradient(calc(90deg + var(--shimmer-angle)), var(--_base) calc(50% - var(--_spread)), var(--_highlight) calc(50% - var(--_spread) * .5), var(--_highlight) 50%, var(--_highlight) calc(50% + var(--_spread) * .5), var(--_base) calc(50% + var(--_spread))))}@supports (color:color-mix(in lab, red, red)){.group-data-\\[state\\=processing\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=processing] *){background-image:var(--shimmer-image,linear-gradient(calc(90deg + var(--shimmer-angle)), var(--_base) calc(50% - var(--_spread)), color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% - var(--_spread) * .5), var(--_highlight) 50%, color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% + var(--_spread) * .5), var(--_base) calc(50% + var(--_spread))))}}.group-data-\\[state\\=processing\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=processing] *){background-repeat:no-repeat;background-size:calc(200% + var(--_spread) * 2) 100%;-webkit-text-fill-color:var(--shimmer-text-fill,transparent);animation:tw-shimmer var(--shimmer-duration,2s) linear infinite;background-position:0 0;-webkit-background-clip:text;background-clip:text}@media (prefers-color-scheme:dark){.group-data-\\[state\\=processing\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=processing] *){--_highlight:var(--shimmer-color,oklch(from currentColor max(.8, calc(l + .4)) c h / calc(alpha + .4)))}}.group-data-\\[state\\=processing\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=processing] *):where([dir=rtl],[dir=rtl] *){animation-direction:reverse}.group-data-\\[state\\=uploading\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=uploading] *){--_spread:var(--shimmer-spread,calc(3ch + 40px));--_base:currentColor;--_highlight:var(--shimmer-color,oklch(from currentColor l c h / calc(alpha* .2)));background-image:var(--shimmer-image,linear-gradient(calc(90deg + var(--shimmer-angle)), var(--_base) calc(50% - var(--_spread)), var(--_highlight) calc(50% - var(--_spread) * .5), var(--_highlight) 50%, var(--_highlight) calc(50% + var(--_spread) * .5), var(--_base) calc(50% + var(--_spread))))}@supports (color:color-mix(in lab, red, red)){.group-data-\\[state\\=uploading\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=uploading] *){background-image:var(--shimmer-image,linear-gradient(calc(90deg + var(--shimmer-angle)), var(--_base) calc(50% - var(--_spread)), color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% - var(--_spread) * .5), var(--_highlight) 50%, color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% + var(--_spread) * .5), var(--_base) calc(50% + var(--_spread))))}}.group-data-\\[state\\=uploading\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=uploading] *){background-repeat:no-repeat;background-size:calc(200% + var(--_spread) * 2) 100%;-webkit-text-fill-color:var(--shimmer-text-fill,transparent);animation:tw-shimmer var(--shimmer-duration,2s) linear infinite;background-position:0 0;-webkit-background-clip:text;background-clip:text}@media (prefers-color-scheme:dark){.group-data-\\[state\\=uploading\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=uploading] *){--_highlight:var(--shimmer-color,oklch(from currentColor max(.8, calc(l + .4)) c h / calc(alpha + .4)))}}.group-data-\\[state\\=uploading\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=uploading] *):where([dir=rtl],[dir=rtl] *){animation-direction:reverse}.group-data-\\[variant\\=separator\\]\\/marker\\:flex-none:is(:where(.group\\/marker)[data-variant=separator] *){flex:none}.group-data-\\[variant\\=separator\\]\\/marker\\:text-center:is(:where(.group\\/marker)[data-variant=separator] *){text-align:center}.placeholder\\:text-neutral-400::placeholder{color:var(--color-neutral-400)}.before\\:mr-1:before{content:var(--tw-content);margin-right:var(--spacing)}.before\\:h-px:before{content:var(--tw-content);height:1px}.before\\:min-w-0:before{content:var(--tw-content);min-width:0}.before\\:flex-1:before{content:var(--tw-content);flex:1}.before\\:bg-border:before{content:var(--tw-content);background-color:var(--border)}.after\\:ml-1:after{content:var(--tw-content);margin-left:var(--spacing)}.after\\:h-px:after{content:var(--tw-content);height:1px}.after\\:min-w-0:after{content:var(--tw-content);min-width:0}.after\\:flex-1:after{content:var(--tw-content);flex:1}.after\\:bg-border:after{content:var(--tw-content);background-color:var(--border)}.focus-within\\:border-neutral-900:focus-within{border-color:var(--color-neutral-900)}.focus-within\\:shadow-\\[0_0_0_1px_\\#171717\\]:focus-within{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#171717);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-within\\:ring-1:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-within\\:ring-ring\\/50:focus-within{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.focus-within\\:ring-ring\\/50:focus-within{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}@media (hover:hover){.hover\\:bg-\\[\\#ebebeb\\]:hover{background-color:#ebebeb}.hover\\:bg-\\[\\#f7f7f7\\]:hover{background-color:#f7f7f7}.hover\\:bg-\\[color-mix\\(in_oklch\\,var\\(--secondary\\)\\,var\\(--foreground\\)_5\\%\\)\\]:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-\\[color-mix\\(in_oklch\\,var\\(--secondary\\)\\,var\\(--foreground\\)_5\\%\\)\\]:hover{background-color:color-mix(in oklch,var(--secondary),var(--foreground) 5%)}}.hover\\:bg-destructive\\/20:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-destructive\\/20:hover{background-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.hover\\:bg-muted:hover{background-color:var(--muted)}.hover\\:bg-neutral-50:hover{background-color:var(--color-neutral-50)}.hover\\:bg-neutral-100:hover{background-color:var(--color-neutral-100)}.hover\\:bg-neutral-800:hover{background-color:var(--color-neutral-800)}.hover\\:bg-primary\\/80:hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-primary\\/80:hover{background-color:color-mix(in oklab, var(--primary) 80%, transparent)}}.hover\\:text-foreground:hover{color:var(--foreground)}.hover\\:text-neutral-600:hover{color:var(--color-neutral-600)}.hover\\:text-neutral-700:hover{color:var(--color-neutral-700)}.hover\\:no-underline:hover{text-decoration-line:none}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:shadow-\\[0_0_0_1px_\\#d4d4d4\\,0_4px_12px_-2px_rgba\\(0\\,0\\,0\\,\\.14\\)\\,0_2px_4px_-2px_rgba\\(0\\,0\\,0\\,\\.1\\)\\]:hover{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#d4d4d4), 0 4px 12px -2px var(--tw-shadow-color,#00000024), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.hover\\:shadow-\\[inset_0_0_0_1px_\\#d4d4d4\\]:hover{--tw-shadow:inset 0 0 0 1px var(--tw-shadow-color,#d4d4d4);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}}.focus\\:border-neutral-400:focus{border-color:var(--color-neutral-400)}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:border-destructive\\/40:focus-visible{border-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.focus-visible\\:border-destructive\\/40:focus-visible{border-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.focus-visible\\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\\:ring-3:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.active\\:not-aria-\\[haspopup\\]\\:translate-y-px:active:not([aria-haspopup]){--tw-translate-y:1px;translate:var(--tw-translate-x) var(--tw-translate-y)}@media (hover:hover){.enabled\\:hover\\:bg-neutral-100:enabled:hover{background-color:var(--color-neutral-100)}.enabled\\:hover\\:text-neutral-700:enabled:hover{color:var(--color-neutral-700)}}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-default:disabled{cursor:default}.disabled\\:opacity-45:disabled{opacity:.45}.disabled\\:opacity-50:disabled{opacity:.5}.disabled\\:opacity-60:disabled{opacity:.6}:where([data-slot=button-group]) .in-data-\\[slot\\=button-group\\]\\:rounded-lg{border-radius:var(--radius)}.has-data-\\[icon\\=inline-end\\]\\:pr-1\\.5:has([data-icon=inline-end]){padding-right:calc(var(--spacing) * 1.5)}.has-data-\\[icon\\=inline-end\\]\\:pr-2:has([data-icon=inline-end]){padding-right:calc(var(--spacing) * 2)}.has-data-\\[icon\\=inline-start\\]\\:pl-1\\.5:has([data-icon=inline-start]){padding-left:calc(var(--spacing) * 1.5)}.has-data-\\[icon\\=inline-start\\]\\:pl-2:has([data-icon=inline-start]){padding-left:calc(var(--spacing) * 2)}.has-data-\\[slot\\=attachment-content\\]\\:w-30:has([data-slot=attachment-content]){width:calc(var(--spacing) * 30)}.has-data-\\[slot\\=attachment-content\\]\\:px-1\\.5:has([data-slot=attachment-content]){padding-inline:calc(var(--spacing) * 1.5)}.has-data-\\[slot\\=attachment-content\\]\\:px-2:has([data-slot=attachment-content]){padding-inline:calc(var(--spacing) * 2)}.has-data-\\[slot\\=attachment-content\\]\\:px-2\\.5:has([data-slot=attachment-content]){padding-inline:calc(var(--spacing) * 2.5)}.has-data-\\[slot\\=attachment-content\\]\\:py-1:has([data-slot=attachment-content]){padding-block:var(--spacing)}.has-data-\\[slot\\=attachment-content\\]\\:py-1\\.5:has([data-slot=attachment-content]){padding-block:calc(var(--spacing) * 1.5)}.has-data-\\[slot\\=attachment-content\\]\\:py-2:has([data-slot=attachment-content]){padding-block:calc(var(--spacing) * 2)}.has-data-\\[slot\\=attachment-media\\]\\:p-1:has([data-slot=attachment-media]){padding:var(--spacing)}.has-data-\\[slot\\=attachment-media\\]\\:p-1\\.5:has([data-slot=attachment-media]){padding:calc(var(--spacing) * 1.5)}.has-data-\\[slot\\=attachment-media\\]\\:p-2:has([data-slot=attachment-media]){padding:calc(var(--spacing) * 2)}.has-\\[button\\]\\:p-0:has(:is(button)){padding:0}@media (hover:hover){.has-\\[\\>a\\,\\>button\\]\\:hover\\:bg-muted\\/50:has(>a,>button):hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.has-\\[\\>a\\,\\>button\\]\\:hover\\:bg-muted\\/50:has(>a,>button):hover{background-color:color-mix(in oklab, var(--muted) 50%, transparent)}}}.aria-expanded\\:bg-muted[aria-expanded=true]{background-color:var(--muted)}.aria-expanded\\:bg-secondary[aria-expanded=true]{background-color:var(--secondary)}.aria-expanded\\:text-foreground[aria-expanded=true]{color:var(--foreground)}.aria-expanded\\:text-secondary-foreground[aria-expanded=true]{color:var(--secondary-foreground)}.aria-invalid\\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\\:ring-3[aria-invalid=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}:is(.group-data-\\[align\\=end\\]\\/message\\:\\*\\:data-slot\\:self-end:is(:where(.group\\/message)[data-align=end] *)>*)[data-slot]{align-self:flex-end}.data-\\[active\\=false\\]\\:pointer-events-none[data-active=false]{pointer-events:none}.data-\\[active\\=false\\]\\:scale-95[data-active=false]{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.data-\\[active\\=false\\]\\:opacity-0[data-active=false]{opacity:0}.data-\\[active\\=false\\]\\:duration-400[data-active=false]{--tw-duration:.4s;transition-duration:.4s}.data-\\[active\\=false\\]\\:ease-\\[cubic-bezier\\(0\\.7\\,0\\,0\\.84\\,0\\)\\][data-active=false]{--tw-ease:cubic-bezier(.7,0,.84,0);transition-timing-function:cubic-bezier(.7,0,.84,0)}.data-\\[active\\=true\\]\\:translate-y-0[data-active=true]{--tw-translate-y:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[active\\=true\\]\\:scale-100[data-active=true]{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.data-\\[active\\=true\\]\\:opacity-100[data-active=true]{opacity:1}.data-\\[active\\=true\\]\\:ease-\\[cubic-bezier\\(0\\.23\\,1\\,0\\.32\\,1\\)\\][data-active=true]{--tw-ease:cubic-bezier(.23,1,.32,1);transition-timing-function:cubic-bezier(.23,1,.32,1)}.data-\\[align\\=end\\]\\:flex-row-reverse[data-align=end]{flex-direction:row-reverse}.data-\\[align\\=end\\]\\:self-end[data-align=end]{align-self:flex-end}.data-\\[direction\\=end\\]\\:bottom-4[data-direction=end]{bottom:calc(var(--spacing) * 4)}.data-\\[direction\\=end\\]\\:data-\\[active\\=false\\]\\:translate-y-full[data-direction=end][data-active=false]{--tw-translate-y:100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[direction\\=start\\]\\:top-4[data-direction=start]{top:calc(var(--spacing) * 4)}.data-\\[direction\\=start\\]\\:data-\\[active\\=false\\]\\:-translate-y-full[data-direction=start][data-active=false]{--tw-translate-y:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}:is(.\\*\\:data-\\[slot\\=attachment\\]\\:flex-none>*)[data-slot=attachment]{flex:none}:is(.\\*\\:data-\\[slot\\=attachment\\]\\:snap-start>*)[data-slot=attachment]{scroll-snap-align:start}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:rounded-none>*)[data-slot=bubble-content]{border-radius:0}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:border-border>*)[data-slot=bubble-content]{border-color:var(--border)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-\\[oklch\\(from_var\\(--primary\\)_0\\.93_calc\\(c\\*0\\.4\\)_h\\)\\]>*)[data-slot=bubble-content]{background-color:oklch(from var(--primary) .93 calc(c * .4) h)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-background>*)[data-slot=bubble-content]{background-color:var(--background)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-destructive\\/10>*)[data-slot=bubble-content]{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-destructive\\/10>*)[data-slot=bubble-content]{background-color:color-mix(in oklab, var(--destructive) 10%, transparent)}}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-muted>*)[data-slot=bubble-content]{background-color:var(--muted)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-primary>*)[data-slot=bubble-content]{background-color:var(--primary)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-secondary>*)[data-slot=bubble-content]{background-color:var(--secondary)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-transparent>*)[data-slot=bubble-content]{background-color:#0000}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:p-0>*)[data-slot=bubble-content]{padding:0}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:text-destructive>*)[data-slot=bubble-content]{color:var(--destructive)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:text-foreground>*)[data-slot=bubble-content]{color:var(--foreground)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:text-primary-foreground>*)[data-slot=bubble-content]{color:var(--primary-foreground)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:text-secondary-foreground>*)[data-slot=bubble-content]{color:var(--secondary-foreground)}:is(.group-data-\\[orientation\\=vertical\\]\\/attachment\\:\\*\\:data-\\[slot\\=spinner\\]\\:size-6\\!:is(:where(.group\\/attachment)[data-orientation=vertical] *)>*)[data-slot=spinner]{width:calc(var(--spacing) * 6)!important;height:calc(var(--spacing) * 6)!important}.data-\\[state\\=error\\]\\:border-destructive\\/30[data-state=error]{border-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.data-\\[state\\=error\\]\\:border-destructive\\/30[data-state=error]{border-color:color-mix(in oklab, var(--destructive) 30%, transparent)}}.data-\\[state\\=idle\\]\\:border-dashed[data-state=idle]{--tw-border-style:dashed;border-style:dashed}.data-\\[variant\\=ghost\\]\\:max-w-full[data-variant=ghost]{max-width:100%}.rtl\\:translate-x-1\\/2:where(:dir(rtl),[dir=rtl],[dir=rtl] *){--tw-translate-x:calc(1 / 2 * 100%);translate:var(--tw-translate-x) var(--tw-translate-y)}@media (prefers-color-scheme:dark){.dark\\:border-input{border-color:var(--input)}.dark\\:bg-destructive\\/20{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-destructive\\/20{background-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.dark\\:bg-input\\/30{background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-input\\/30{background-color:color-mix(in oklab, var(--input) 30%, transparent)}}@media (hover:hover){.dark\\:hover\\:bg-destructive\\/30:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:hover\\:bg-destructive\\/30:hover{background-color:color-mix(in oklab, var(--destructive) 30%, transparent)}}.dark\\:hover\\:bg-input\\/50:hover{background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\\:hover\\:bg-input\\/50:hover{background-color:color-mix(in oklab, var(--input) 50%, transparent)}}.dark\\:hover\\:bg-muted\\/50:hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.dark\\:hover\\:bg-muted\\/50:hover{background-color:color-mix(in oklab, var(--muted) 50%, transparent)}}}.dark\\:focus-visible\\:ring-destructive\\/40:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:focus-visible\\:ring-destructive\\/40:focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\\:aria-invalid\\:border-destructive\\/50[aria-invalid=true]{border-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:aria-invalid\\:border-destructive\\/50[aria-invalid=true]{border-color:color-mix(in oklab, var(--destructive) 50%, transparent)}}.dark\\:aria-invalid\\:ring-destructive\\/40[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:aria-invalid\\:ring-destructive\\/40[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}:is(.dark\\:\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-\\[oklch\\(from_var\\(--primary\\)_0\\.3_calc\\(c\\*0\\.4\\)_h\\)\\]>*)[data-slot=bubble-content]{background-color:oklch(from var(--primary) .3 calc(c * .4) h)}:is(.dark\\:\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-destructive\\/20>*)[data-slot=bubble-content]{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){:is(.dark\\:\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-destructive\\/20>*)[data-slot=bubble-content]{background-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}}.\\[\\&_\\*\\]\\:box-border *{box-sizing:border-box}.\\[\\&_img\\]\\:block img{display:block}.\\[\\&_img\\]\\:size-full img{width:100%;height:100%}.\\[\\&_img\\]\\:scale-100 img{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.\\[\\&_img\\]\\:scale-\\[1\\.08\\] img{scale:1.08}.\\[\\&_img\\]\\:object-contain img{object-fit:contain}.\\[\\&_img\\]\\:object-cover img{object-fit:cover}.\\[\\&_strong\\]\\:font-semibold strong{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:block svg{display:block}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.data-\\[direction\\=start\\]\\:\\[\\&_svg\\]\\:rotate-180[data-direction=start] svg{rotate:180deg}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-3 svg:not([class*=size-]){width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-3\\.5 svg:not([class*=size-]){width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-6:is(:where(.group\\/attachment)[data-orientation=vertical] *) svg:not([class*=size-]){width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.group-data-\\[size\\=xs\\]\\/attachment\\:\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-3\\.5:is(:where(.group\\/attachment)[data-size=xs] *) svg:not([class*=size-]){width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.\\[\\&\\:\\:-webkit-scrollbar\\]\\:hidden::-webkit-scrollbar{display:none}.\\[a\\]\\:underline:is(a){text-decoration-line:underline}.\\[a\\]\\:underline-offset-3:is(a){text-underline-offset:3px}:is(.\\*\\:\\[a\\]\\:underline>*):is(a){text-decoration-line:underline}:is(.\\*\\:\\[a\\]\\:underline-offset-3>*):is(a){text-underline-offset:3px}@media (hover:hover){.\\[a\\]\\:hover\\:text-foreground:is(a):hover,:is(.\\*\\:\\[a\\]\\:hover\\:text-foreground>*):is(a):hover{color:var(--foreground)}}.\\[button\\]\\:text-left:is(button){text-align:left}.\\[button\\,a\\]\\:transition-colors:is(button,a){transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.\\[button\\,a\\]\\:outline-none:is(button,a){--tw-outline-style:none;outline-style:none}.\\[button\\,a\\]\\:focus-visible\\:border-ring:is(button,a):focus-visible{border-color:var(--ring)}.\\[button\\,a\\]\\:focus-visible\\:ring-3:is(button,a):focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.\\[button\\,a\\]\\:focus-visible\\:ring-ring\\/50:is(button,a):focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.\\[button\\,a\\]\\:focus-visible\\:ring-ring\\/50:is(button,a):focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}:is(.\\*\\:\\[img\\]\\:aspect-square>*):is(img){aspect-ratio:1}:is(.\\*\\:\\[img\\]\\:w-full>*):is(img){width:100%}:is(.\\*\\:\\[img\\]\\:object-cover>*):is(img){object-fit:cover}.\\[\\&\\>\\*\\]\\:pointer-events-auto>*{pointer-events:auto}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-\\[color-mix\\(in_oklch\\,var\\(--muted\\)\\,var\\(--foreground\\)_5\\%\\)\\]>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-\\[color-mix\\(in_oklch\\,var\\(--muted\\)\\,var\\(--foreground\\)_5\\%\\)\\]>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklch,var(--muted),var(--foreground) 5%)}}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-\\[color-mix\\(in_oklch\\,var\\(--secondary\\)\\,var\\(--foreground\\)_5\\%\\)\\]>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-\\[color-mix\\(in_oklch\\,var\\(--secondary\\)\\,var\\(--foreground\\)_5\\%\\)\\]>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklch,var(--secondary),var(--foreground) 5%)}}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-\\[oklch\\(from_var\\(--primary\\)_0\\.88_calc\\(c\\*0\\.5\\)_h\\)\\]>[data-slot=bubble-content]:is(button,a):hover{background-color:oklch(from var(--primary) .88 calc(c * .5) h)}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-destructive\\/20>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-destructive\\/20>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-muted>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--muted)}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-primary\\/80>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-primary\\/80>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklab, var(--primary) 80%, transparent)}}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:text-foreground>[data-slot=bubble-content]:is(button,a):hover{color:var(--foreground)}@media (prefers-color-scheme:dark){.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-\\[oklch\\(from_var\\(--primary\\)_0\\.35_calc\\(c\\*0\\.5\\)_h\\)\\]>[data-slot=bubble-content]:is(button,a):hover{background-color:oklch(from var(--primary) .35 calc(c * .5) h)}.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-destructive\\/30>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-destructive\\/30>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklab, var(--destructive) 30%, transparent)}}.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-input\\/30>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-input\\/30>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklab, var(--input) 30%, transparent)}}.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-muted\\/50>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-muted\\/50>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklab, var(--muted) 50%, transparent)}}}}@property --scroll-fade-t{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --scroll-fade-b{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --scroll-fade-s{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --scroll-fade-e{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --scroll-fade-mask{syntax:"*";inherits:false}@property --shimmer-angle{syntax:"<angle>";inherits:true;initial-value:20deg}@property --shimmer-image{syntax:"*";inherits:false}@property --shimmer-text-fill{syntax:"*";inherits:false}@media (prefers-reduced-motion:reduce){.shimmer{-webkit-text-fill-color:currentColor;background-image:none;animation:none}}:root{--radius:.625rem;--background:#fff;--foreground:#171717;--card:#fff;--card-foreground:#171717;--popover:#fff;--popover-foreground:#171717;--primary:#171717;--primary-foreground:#fafafa;--secondary:#f1f1f3;--secondary-foreground:#171717;--muted:#f5f5f5;--muted-foreground:#737373;--accent:#f5f5f5;--accent-foreground:#171717;--destructive:#dc2626;--border:#e5e5e5;--input:#e5e5e5;--ring:#a3a3a3}html,body{overscroll-behavior:none;background:0 0;width:100%;height:100%;margin:0;padding:0;overflow:hidden}body{--scw-font:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;flex-direction:column;justify-content:flex-end;align-items:flex-end;display:flex}.scw-panel{--scw-nav-height:52px;--scw-send-pill-gap:24px;--scw-send-pill-height:40px;--scw-composer-clearance:8px;--scw-composer-height:130px;--scw-composer-radius:24px;--scw-composer-inset:12px;--scw-panel-radius:calc(var(--scw-composer-radius) + var(--scw-composer-inset) + 1px);--scw-header-btn-size:36px;--scw-header-btn-concentric:calc(var(--scw-header-btn-size) / 2);--scw-header-padding:calc(var(--scw-panel-radius) - var(--scw-header-btn-concentric) - 1px)}.scw-form:before{content:"";left:var(--scw-composer-inset);right:var(--scw-composer-inset);border-top-left-radius:var(--scw-composer-radius,24px);border-top-right-radius:var(--scw-composer-radius,24px);z-index:-1;pointer-events:none;background:#fff;position:absolute;top:0;bottom:0}.scw-messages{--scw-message-inset-x:16px;scrollbar-width:none}.scw-messages::-webkit-scrollbar{width:0;height:0}@keyframes scw-bounce-top{0%{transform:translateY(0)}35%{transform:translateY(14px)}to{transform:translateY(0)}}@keyframes scw-bounce-bottom{0%{transform:translateY(0)}35%{transform:translateY(-14px)}to{transform:translateY(0)}}.scw-bounce-top{animation:.32s cubic-bezier(.32,.72,0,1) scw-bounce-top}.scw-bounce-bottom{animation:.32s cubic-bezier(.32,.72,0,1) scw-bounce-bottom}@keyframes scw-message-in{0%{opacity:0}to{opacity:1}}.scw-message-in{animation:.22s ease-out scw-message-in}@media (prefers-reduced-motion:reduce){.scw-message-in{animation:none}}@keyframes scw-spin{to{transform:rotate(360deg)}}.scw-citation+.scw-citation{margin-left:.3em}.scw-citation-popover{transform:translateX(calc(-50% + var(--scw-citation-popover-shift,0px)))}.scw-citation-popover:before{content:"";height:10px;position:absolute;top:-10px;left:0;right:0}@media (hover:hover) and (pointer:fine){.scw-citation:hover .scw-citation-badge{color:#fff;background:#2563eb}}.scw-scrollbar{top:10px;right:3px;bottom:calc(var(--scw-composer-height,130px) + 2px);z-index:3;pointer-events:none;width:6px;position:absolute}.scw-scrollbar-thumb{opacity:0;pointer-events:auto;cursor:default;touch-action:none;background-color:#d4d4d4;border-radius:9999px;transition:opacity .2s;position:absolute;top:0;left:0;right:0}.scw-scrollbar-visible .scw-scrollbar-thumb{opacity:1}.scw-scrollbar-thumb:hover{background-color:#b8b8b8}.scw-thin-scroll{scrollbar-width:thin;scrollbar-color:#d4d4d4 transparent}.scw-thin-scroll::-webkit-scrollbar{width:6px}.scw-thin-scroll::-webkit-scrollbar-track{background:0 0}.scw-thin-scroll::-webkit-scrollbar-thumb{background-color:#d4d4d4;border-radius:9999px}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-pan-x{syntax:"*";inherits:false}@property --tw-pan-y{syntax:"*";inherits:false}@property --tw-pinch-zoom{syntax:"*";inherits:false}@property --tw-scroll-snap-strictness{syntax:"*";inherits:false;initial-value:proximity}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@keyframes scroll-fade-reveal-t{0%{--scroll-fade-t:0px}to{--scroll-fade-t:var(--_scroll-fade-size-t,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))))}}@keyframes scroll-fade-reveal-b{0%{--scroll-fade-b:var(--_scroll-fade-size-b,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))))}to{--scroll-fade-b:0px}}@keyframes scroll-fade-reveal-s{0%{--scroll-fade-s:0px}to{--scroll-fade-s:var(--_scroll-fade-size-s,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))))}}@keyframes scroll-fade-reveal-e{0%{--scroll-fade-e:var(--_scroll-fade-size-e,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))))}to{--scroll-fade-e:0px}}@keyframes tw-shimmer{0%{background-position:100% 0}to{background-position:0 0}}`;
|
|
14020
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){:root,:host{--shimmer-angle:20deg}*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-scroll-snap-strictness:proximity;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--scroll-fade-t:0px;--scroll-fade-b:0px;--scroll-fade-s:0px;--scroll-fade-e:0px;--scroll-fade-mask:initial;--shimmer-image:initial;--shimmer-text-fill:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-amber-500:oklch(76.9% .188 70.08);--color-blue-600:oklch(54.6% .245 262.881);--color-neutral-50:var(--scw-hover);--color-neutral-100:var(--scw-hover);--color-neutral-200:var(--scw-gray-200);--color-neutral-300:var(--scw-gray-300);--color-neutral-400:var(--scw-gray-400);--color-neutral-500:var(--scw-muted);--color-neutral-600:var(--scw-muted);--color-neutral-700:var(--scw-ink-secondary);--color-neutral-800:var(--scw-ink-body);--color-neutral-900:var(--scw-ink);--color-neutral-950:var(--scw-ink);--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--leading-tight:1.25;--leading-relaxed:1.625;--radius-md:calc(var(--radius) - 2px);--radius-2xl:.875rem;--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:0}.inset-x-0{inset-inline:0}.inset-s-1{inset-inline-start:var(--spacing)}.inset-s-1\\/2{inset-inline-start:50%}.top-0{top:0}.top-0\\.5{top:calc(var(--spacing) * .5)}.top-1{top:var(--spacing)}.top-1\\/2{top:50%}.top-\\[calc\\(100\\%\\+8px\\)\\]{top:calc(100% + 8px)}.top-\\[var\\(--scw-header-padding\\)\\]{top:var(--scw-header-padding)}.right-0{right:0}.right-0\\.5{right:calc(var(--spacing) * .5)}.right-3{right:calc(var(--spacing) * 3)}.right-\\[var\\(--scw-header-padding\\)\\]{right:var(--scw-header-padding)}.bottom-0{bottom:0}.bottom-\\[calc\\(var\\(--scw-send-pill-gap\\)\\+var\\(--scw-nav-height\\)\\)\\]{bottom:calc(var(--scw-send-pill-gap) + var(--scw-nav-height))}.bottom-full{bottom:100%}.left-1{left:var(--spacing)}.left-1\\/2{left:50%}.left-3{left:calc(var(--spacing) * 3)}.z-10{z-index:10}.z-20{z-index:20}.z-\\[1\\]{z-index:1}.z-\\[2\\]{z-index:2}.z-\\[5\\]{z-index:5}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.m-0{margin:0}.mx-auto{margin-inline:auto}.my-2{margin-block:calc(var(--spacing) * 2)}.my-6{margin-block:calc(var(--spacing) * 6)}.-mt-1{margin-top:calc(var(--spacing) * -1)}.-mt-1\\.5{margin-top:calc(var(--spacing) * -1.5)}.mt-0{margin-top:0}.mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-\\[-16px\\]{margin-top:-16px}.mb-0{margin-bottom:0}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-2\\.5{margin-bottom:calc(var(--spacing) * 2.5)}.ml-\\[0\\.25em\\]{margin-left:.25em}.box-border{box-sizing:border-box}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.aspect-auto{aspect-ratio:auto}.aspect-square{aspect-ratio:1}.size-1{width:var(--spacing);height:var(--spacing)}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-2\\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-12{width:calc(var(--spacing) * 12);height:calc(var(--spacing) * 12)}.size-14{width:calc(var(--spacing) * 14);height:calc(var(--spacing) * 14)}.size-\\[1\\.45em\\]{width:1.45em;height:1.45em}.size-\\[18px\\]{width:18px;height:18px}.size-\\[var\\(--scw-header-btn-size\\)\\]{width:var(--scw-header-btn-size);height:var(--scw-header-btn-size)}.size-\\[var\\(--scw-launcher-icon-size\\,25px\\)\\]{width:var(--scw-launcher-icon-size,25px);height:var(--scw-launcher-icon-size,25px)}.size-\\[var\\(--scw-launcher-size\\,60px\\)\\]{width:var(--scw-launcher-size,60px);height:var(--scw-launcher-size,60px)}.size-full{width:100%;height:100%}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-\\[13px\\]{height:13px}.h-\\[var\\(--scw-panel-height\\,680px\\)\\]{height:var(--scw-panel-height,680px)}.h-auto{height:auto}.h-full{height:100%}.h-max{height:max-content}.max-h-\\[120px\\]{max-height:120px}.min-h-0{min-height:0}.min-h-4{min-height:calc(var(--spacing) * 4)}.min-h-\\[22px\\]{min-height:22px}.min-h-\\[200px\\]{min-height:200px}.min-h-\\[calc\\(var\\(--scw-header-padding\\)\\*2\\+var\\(--scw-header-btn-size\\)\\)\\]{min-height:calc(var(--scw-header-padding) * 2 + var(--scw-header-btn-size))}.min-h-full{min-height:100%}.w-10{width:calc(var(--spacing) * 10)}.w-24{width:calc(var(--spacing) * 24)}.w-\\[var\\(--scw-panel-width\\,384px\\)\\]{width:var(--scw-panel-width,384px)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-max{width:max-content}.max-w-\\[80\\%\\]{max-width:80%}.max-w-\\[82\\%\\]{max-width:82%}.max-w-\\[88\\%\\]{max-width:88%}.max-w-\\[220px\\]{max-width:220px}.max-w-\\[min\\(240px\\,var\\(--scw-host-viewport-width\\,100vw\\)\\)\\]{max-width:min(240px, var(--scw-host-viewport-width,100vw))}.max-w-full{max-width:100%}.min-w-0{min-width:0}.min-w-8{min-width:calc(var(--spacing) * 8)}.min-w-40{min-width:calc(var(--spacing) * 40)}.min-w-\\[1\\.45em\\]{min-width:1.45em}.flex-1{flex:1}.flex-none{flex:none}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.border-collapse{border-collapse:collapse}.origin-bottom-right{transform-origin:100% 100%}.origin-center{transform-origin:50%}.-translate-x-1{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-3{--tw-translate-y:calc(var(--spacing) * -3);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-3\\/4{--tw-translate-y:calc(calc(3 / 4 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-3{--tw-translate-y:calc(var(--spacing) * 3);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-3\\/4{--tw-translate-y:calc(3 / 4 * 100%);translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-90{rotate:90deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.shimmer{--_spread:var(--shimmer-spread,calc(3ch + 40px));--_base:currentColor;--_highlight:var(--shimmer-color,oklch(from currentColor l c h / calc(alpha* .2)));background-image:var(--shimmer-image,linear-gradient(calc(90deg + var(--shimmer-angle)), var(--_base) calc(50% - var(--_spread)), var(--_highlight) calc(50% - var(--_spread) * .5), var(--_highlight) 50%, var(--_highlight) calc(50% + var(--_spread) * .5), var(--_base) calc(50% + var(--_spread))))}@supports (color:color-mix(in lab, red, red)){.shimmer{background-image:var(--shimmer-image,linear-gradient(calc(90deg + var(--shimmer-angle)), var(--_base) calc(50% - var(--_spread)), color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% - var(--_spread) * .5), var(--_highlight) 50%, color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% + var(--_spread) * .5), var(--_base) calc(50% + var(--_spread))))}}.shimmer{background-repeat:no-repeat;background-size:calc(200% + var(--_spread) * 2) 100%;-webkit-text-fill-color:var(--shimmer-text-fill,transparent);animation:tw-shimmer var(--shimmer-duration,2s) linear infinite;background-position:0 0;-webkit-background-clip:text;background-clip:text}@media (prefers-color-scheme:dark){.shimmer{--_highlight:var(--shimmer-color,oklch(from currentColor max(.8, calc(l + .4)) c h / calc(alpha + .4)))}}.shimmer:where([dir=rtl],[dir=rtl] *){animation-direction:reverse}.scroll-fade-x{--_scroll-fade-size-s:var(--scroll-fade-s-size,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))));--_scroll-fade-size-e:var(--scroll-fade-e-size,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))));--scroll-fade-inline:linear-gradient(to right, transparent 0, #000 var(--scroll-fade-s,0px), #000 calc(100% - var(--scroll-fade-e,0px)), transparent 100%)}.scroll-fade-x:where([dir=rtl],[dir=rtl] *){--scroll-fade-inline:linear-gradient(to left, transparent 0, #000 var(--scroll-fade-s,0px), #000 calc(100% - var(--scroll-fade-e,0px)), transparent 100%)}.scroll-fade-x{-webkit-mask-image:var(--scroll-fade-mask,var(--scroll-fade-inline));-webkit-mask-image:var(--scroll-fade-mask,var(--scroll-fade-inline));-webkit-mask-image:var(--scroll-fade-mask,var(--scroll-fade-inline));mask-image:var(--scroll-fade-mask,var(--scroll-fade-inline));-webkit-mask-composite:source-in;-webkit-mask-composite:source-in;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-composite:source-in;mask-composite:intersect}@supports (animation-timeline:scroll()){.scroll-fade-x{animation:1ms ease-in-out scroll-fade-reveal-s,1ms ease-in-out scroll-fade-reveal-e;animation-timeline:scroll(self inline),scroll(self inline);animation-range:0 var(--scroll-fade-reveal,calc(var(--spacing) * 24)), calc(100% - var(--scroll-fade-reveal,calc(var(--spacing) * 24))) 100%;animation-fill-mode:both}}@supports not (animation-timeline:scroll()){.scroll-fade-x{--scroll-fade-s:var(--_scroll-fade-size-s);--scroll-fade-e:var(--_scroll-fade-size-e)}}.scroll-fade{--_scroll-fade-size-t:var(--scroll-fade-t-size,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))));--_scroll-fade-size-b:var(--scroll-fade-b-size,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))));--scroll-fade-block:linear-gradient(to bottom, transparent 0, #000 var(--scroll-fade-t,0px), #000 calc(100% - var(--scroll-fade-b,0px)), transparent 100%);-webkit-mask-image:var(--scroll-fade-mask,var(--scroll-fade-block));-webkit-mask-image:var(--scroll-fade-mask,var(--scroll-fade-block));-webkit-mask-image:var(--scroll-fade-mask,var(--scroll-fade-block));mask-image:var(--scroll-fade-mask,var(--scroll-fade-block));-webkit-mask-composite:source-in;-webkit-mask-composite:source-in;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-composite:source-in;mask-composite:intersect}@supports (animation-timeline:scroll()){.scroll-fade{animation:1ms ease-in-out scroll-fade-reveal-t,1ms ease-in-out scroll-fade-reveal-b;animation-timeline:scroll(self y),scroll(self y);animation-range:0 var(--scroll-fade-reveal,calc(var(--spacing) * 24)), calc(100% - var(--scroll-fade-reveal,calc(var(--spacing) * 24))) 100%;animation-fill-mode:both}}@supports not (animation-timeline:scroll()){.scroll-fade{--scroll-fade-t:var(--_scroll-fade-size-t);--scroll-fade-b:var(--_scroll-fade-size-b)}}.scroll-fade-b{--_scroll-fade-size-b:var(--scroll-fade-b-size,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))));--scroll-fade-mask:linear-gradient(to bottom, #000 0, #000 calc(100% - var(--scroll-fade-b,0px)), transparent 100%);-webkit-mask-image:var(--scroll-fade-mask);-webkit-mask-image:var(--scroll-fade-mask);-webkit-mask-image:var(--scroll-fade-mask);mask-image:var(--scroll-fade-mask);-webkit-mask-composite:source-in;-webkit-mask-composite:source-in;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-composite:source-in;mask-composite:intersect}@supports (animation-timeline:scroll()){.scroll-fade-b{animation:1ms ease-in-out scroll-fade-reveal-b;animation-timeline:scroll(self y);animation-range:calc(100% - var(--scroll-fade-reveal,calc(var(--spacing) * 24))) 100%;animation-fill-mode:both}}@supports not (animation-timeline:scroll()){.scroll-fade-b{--scroll-fade-b:var(--_scroll-fade-size-b)}}.animate-\\[scw-spin_\\.7s_linear_infinite\\]{animation:.7s linear infinite scw-spin}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-pan-y{--tw-pan-y:pan-y;touch-action:var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)}.resize{resize:both}.resize-none{resize:none}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-mandatory{--tw-scroll-snap-strictness:mandatory}.scroll-px-1{scroll-padding-inline:var(--spacing)}.\\[scrollbar-width\\:none\\],.scrollbar-none{scrollbar-width:none}.scrollbar-thin{scrollbar-width:thin}.\\[scrollbar-gutter\\:auto\\]{scrollbar-gutter:auto}.scrollbar-gutter-stable{scrollbar-gutter:stable}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:0}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-\\[3px\\]{gap:3px}.gap-\\[5px\\]{gap:5px}.self-center{align-self:center}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.overscroll-contain{overscroll-behavior:contain}.overscroll-x-contain{overscroll-behavior-x:contain}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:.875rem}.rounded-\\[10px\\]{border-radius:10px}.rounded-\\[14px\\]{border-radius:14px}.rounded-\\[min\\(var\\(--radius-md\\)\\,10px\\)\\]{border-radius:min(var(--radius-md), 10px)}.rounded-\\[min\\(var\\(--radius-md\\)\\,12px\\)\\]{border-radius:min(var(--radius-md), 12px)}.rounded-\\[var\\(--scw-composer-radius\\,24px\\)\\]{border-radius:var(--scw-composer-radius,24px)}.rounded-\\[var\\(--scw-header-btn-concentric\\)\\]{border-radius:var(--scw-header-btn-concentric)}.rounded-\\[var\\(--scw-panel-radius\\)\\]{border-radius:var(--scw-panel-radius)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-br-\\[4px\\]{border-bottom-right-radius:4px}.rounded-bl-\\[4px\\]{border-bottom-left-radius:4px}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-\\[1\\.5px\\]{border-style:var(--tw-border-style);border-width:1.5px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-none{--tw-border-style:none;border-style:none}.border-solid{--tw-border-style:solid;border-style:solid}.border-border{border-color:var(--border)}.border-neutral-200{border-color:var(--scw-gray-200)}.border-neutral-300{border-color:var(--scw-gray-300)}.border-neutral-900{border-color:var(--scw-ink)}.border-red-400{border-color:var(--color-red-400)}.border-transparent{border-color:#0000}.border-t-neutral-500{border-top-color:var(--scw-muted)}.bg-\\[\\#eff6ff\\]{background-color:#eff6ff}.bg-\\[rgba\\(10\\,10\\,10\\,\\.72\\)\\]{background-color:#0a0a0ab8}.bg-amber-500{background-color:var(--color-amber-500)}.bg-background{background-color:var(--background)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-card{background-color:var(--card)}.bg-destructive,.bg-destructive\\/10{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.bg-destructive\\/10{background-color:color-mix(in oklab, var(--destructive) 10%, transparent)}}.bg-muted{background-color:var(--muted)}.bg-neutral-50,.bg-neutral-100{background-color:var(--scw-hover)}.bg-neutral-200{background-color:var(--scw-gray-200)}.bg-neutral-400{background-color:var(--scw-gray-400)}.bg-neutral-900{background-color:var(--scw-ink)}.bg-primary{background-color:var(--primary)}.bg-secondary{background-color:var(--secondary)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-clip-padding{background-clip:padding-box}.p-0{padding:0}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-\\[var\\(--scw-header-padding\\)\\]{padding:var(--scw-header-padding)}.px-0{padding-inline:0}.px-1{padding-inline:var(--spacing)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-\\[11px\\]{padding-inline:11px}.px-\\[13px\\]{padding-inline:13px}.px-\\[18px\\]{padding-inline:18px}.px-\\[var\\(--scw-composer-inset\\)\\]{padding-inline:var(--scw-composer-inset)}.px-\\[var\\(--scw-message-inset-x\\,16px\\)\\]{padding-inline:var(--scw-message-inset-x,16px)}.py-0{padding-block:0}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-\\[9px\\]{padding-block:9px}.py-\\[11px\\]{padding-block:11px}.pt-1{padding-top:var(--spacing)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-2\\.5{padding-top:calc(var(--spacing) * 2.5)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pb-1{padding-bottom:var(--spacing)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-11{padding-bottom:calc(var(--spacing) * 11)}.pb-\\[calc\\(8px\\+var\\(--scw-nav-height\\)\\+var\\(--scw-send-pill-gap\\)\\+var\\(--scw-send-pill-height\\)\\)\\]{padding-bottom:calc(8px + var(--scw-nav-height) + var(--scw-send-pill-gap) + var(--scw-send-pill-height))}.pb-\\[calc\\(24px\\+var\\(--scw-nav-height\\)\\)\\]{padding-bottom:calc(24px + var(--scw-nav-height))}.pb-\\[var\\(--scw-composer-inset\\)\\]{padding-bottom:var(--scw-composer-inset)}.pl-2{padding-left:calc(var(--spacing) * 2)}.text-center{text-align:center}.text-left{text-align:left}.align-baseline{vertical-align:baseline}.align-top{vertical-align:top}.\\[font-family\\:var\\(--scw-font\\)\\]{font-family:var(--scw-font)}.font-\\[inherit\\]{font-family:inherit}.font-mono{font-family:var(--font-mono)}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[0\\.8rem\\]{font-size:.8rem}.text-\\[0\\.78em\\]{font-size:.78em}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[13px\\]{font-size:13px}.text-\\[14px\\]{font-size:14px}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-\\[1\\.3\\]{--tw-leading:1.3;line-height:1.3}.leading-\\[1\\.4\\]{--tw-leading:1.4;line-height:1.4}.leading-\\[1\\.35\\]{--tw-leading:1.35;line-height:1.35}.leading-\\[1\\.45\\]{--tw-leading:1.45;line-height:1.45}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\\[0\\.04em\\]{--tw-tracking:.04em;letter-spacing:.04em}.\\[overflow-wrap\\:anywhere\\]{overflow-wrap:anywhere}.break-words,.wrap-break-word{overflow-wrap:break-word}.text-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-blue-600{color:var(--color-blue-600)}.text-card-foreground{color:var(--card-foreground)}.text-destructive{color:var(--destructive)}.text-foreground{color:var(--foreground)}.text-inherit{color:inherit}.text-muted-foreground{color:var(--muted-foreground)}.text-neutral-400{color:var(--scw-gray-400)}.text-neutral-500,.text-neutral-600{color:var(--scw-muted)}.text-neutral-700{color:var(--scw-ink-secondary)}.text-neutral-900,.text-neutral-950{color:var(--scw-ink)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-red-600{color:var(--color-red-600)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-white{color:var(--color-white)}.uppercase{text-transform:uppercase}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0}.opacity-60{opacity:.6}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_0_0_1px_rgba\\(0\\,0\\,0\\,\\.08\\)\\,0_10px_15px_-3px_rgba\\(0\\,0\\,0\\,\\.1\\)\\,0_4px_6px_-4px_rgba\\(0\\,0\\,0\\,\\.1\\)\\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#00000014), 0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_0_0_1px_var\\(--scw-hairline\\)\\,0_4px_12px_-2px_rgba\\(0\\,0\\,0\\,\\.12\\)\\,0_2px_4px_-2px_rgba\\(0\\,0\\,0\\,\\.08\\)\\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,var(--scw-hairline)), 0 4px 12px -2px var(--tw-shadow-color,#0000001f), 0 2px 4px -2px var(--tw-shadow-color,#00000014);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_0_0_1px_var\\(--scw-ink\\)\\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,var(--scw-ink));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_2px_8px_rgba\\(0\\,0\\,0\\,\\.06\\)\\]{--tw-shadow:0 2px 8px var(--tw-shadow-color,#0000000f);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_6px_16px_rgba\\(0\\,0\\,0\\,\\.18\\)\\]{--tw-shadow:0 6px 16px var(--tw-shadow-color,#0000002e);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_10px_15px_-3px_rgba\\(0\\,0\\,0\\,\\.1\\)\\,0_4px_6px_-4px_rgba\\(0\\,0\\,0\\,\\.1\\)\\]{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[inset_0_0_0_1px_var\\(--scw-hairline\\)\\]{--tw-shadow:inset 0 0 0 1px var(--tw-shadow-color,var(--scw-hairline));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-3{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-card{--tw-ring-color:var(--card)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[background-color\\,box-shadow\\]{transition-property:background-color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[border-color\\,box-shadow\\]{transition-property:border-color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[translate\\,scale\\,opacity\\]{transition-property:translate,scale,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-\\[120ms\\]{--tw-duration:.12s;transition-duration:.12s}.duration-\\[250ms\\]{--tw-duration:.25s;transition-duration:.25s}.duration-\\[280ms\\]{--tw-duration:.28s;transition-duration:.28s}.ease-\\[cubic-bezier\\(\\.32\\,\\.72\\,0\\,1\\)\\]{--tw-ease:cubic-bezier(.32,.72,0,1);transition-timing-function:cubic-bezier(.32,.72,0,1)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.contain-content{contain:content}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.\\[-webkit-tap-highlight-color\\:transparent\\]{-webkit-tap-highlight-color:transparent}.\\[overflow-anchor\\:none\\]{overflow-anchor:none}.backface-hidden{backface-visibility:hidden}.group-has-data-\\[slot\\=message-footer\\]\\/message\\:-translate-y-8:is(:where(.group\\/message):has([data-slot=message-footer]) *){--tw-translate-y:calc(var(--spacing) * -8);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-has-data-\\[variant\\=ghost\\]\\/message\\:px-0:is(:where(.group\\/message):has([data-variant=ghost]) *){padding-inline:0}.group-data-\\[align\\=end\\]\\/bubble\\:self-end:is(:where(.group\\/bubble)[data-align=end] *){align-self:flex-end}.group-data-\\[align\\=end\\]\\/message\\:justify-end:is(:where(.group\\/message)[data-align=end] *){justify-content:flex-end}.group-data-\\[align\\=end\\]\\/message\\:self-end:is(:where(.group\\/message)[data-align=end] *){align-self:flex-end}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:absolute:is(:where(.group\\/attachment)[data-orientation=vertical] *){position:absolute}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:top-3:is(:where(.group\\/attachment)[data-orientation=vertical] *){top:calc(var(--spacing) * 3)}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:right-3:is(:where(.group\\/attachment)[data-orientation=vertical] *){right:calc(var(--spacing) * 3)}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:w-full:is(:where(.group\\/attachment)[data-orientation=vertical] *){width:100%}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:gap-1:is(:where(.group\\/attachment)[data-orientation=vertical] *){gap:var(--spacing)}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:px-1:is(:where(.group\\/attachment)[data-orientation=vertical] *){padding-inline:var(--spacing)}.group-data-\\[size\\=sm\\]\\/attachment\\:w-8:is(:where(.group\\/attachment)[data-size=sm] *){width:calc(var(--spacing) * 8)}.group-data-\\[size\\=xs\\]\\/attachment\\:w-7:is(:where(.group\\/attachment)[data-size=xs] *){width:calc(var(--spacing) * 7)}.group-data-\\[size\\=xs\\]\\/attachment\\:rounded-md:is(:where(.group\\/attachment)[data-size=xs] *){border-radius:calc(var(--radius) - 2px)}.group-data-\\[state\\=done\\]\\/attachment\\:opacity-100:is(:where(.group\\/attachment)[data-state=done] *){opacity:1}.group-data-\\[state\\=error\\]\\/attachment\\:bg-destructive\\/10:is(:where(.group\\/attachment)[data-state=error] *){background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.group-data-\\[state\\=error\\]\\/attachment\\:bg-destructive\\/10:is(:where(.group\\/attachment)[data-state=error] *){background-color:color-mix(in oklab, var(--destructive) 10%, transparent)}}.group-data-\\[state\\=error\\]\\/attachment\\:text-destructive:is(:where(.group\\/attachment)[data-state=error] *),.group-data-\\[state\\=error\\]\\/attachment\\:text-destructive\\/80:is(:where(.group\\/attachment)[data-state=error] *){color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.group-data-\\[state\\=error\\]\\/attachment\\:text-destructive\\/80:is(:where(.group\\/attachment)[data-state=error] *){color:color-mix(in oklab, var(--destructive) 80%, transparent)}}.group-data-\\[state\\=idle\\]\\/attachment\\:opacity-100:is(:where(.group\\/attachment)[data-state=idle] *){opacity:1}.group-data-\\[state\\=processing\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=processing] *){--_spread:var(--shimmer-spread,calc(3ch + 40px));--_base:currentColor;--_highlight:var(--shimmer-color,oklch(from currentColor l c h / calc(alpha* .2)));background-image:var(--shimmer-image,linear-gradient(calc(90deg + var(--shimmer-angle)), var(--_base) calc(50% - var(--_spread)), var(--_highlight) calc(50% - var(--_spread) * .5), var(--_highlight) 50%, var(--_highlight) calc(50% + var(--_spread) * .5), var(--_base) calc(50% + var(--_spread))))}@supports (color:color-mix(in lab, red, red)){.group-data-\\[state\\=processing\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=processing] *){background-image:var(--shimmer-image,linear-gradient(calc(90deg + var(--shimmer-angle)), var(--_base) calc(50% - var(--_spread)), color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% - var(--_spread) * .5), var(--_highlight) 50%, color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% + var(--_spread) * .5), var(--_base) calc(50% + var(--_spread))))}}.group-data-\\[state\\=processing\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=processing] *){background-repeat:no-repeat;background-size:calc(200% + var(--_spread) * 2) 100%;-webkit-text-fill-color:var(--shimmer-text-fill,transparent);animation:tw-shimmer var(--shimmer-duration,2s) linear infinite;background-position:0 0;-webkit-background-clip:text;background-clip:text}@media (prefers-color-scheme:dark){.group-data-\\[state\\=processing\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=processing] *){--_highlight:var(--shimmer-color,oklch(from currentColor max(.8, calc(l + .4)) c h / calc(alpha + .4)))}}.group-data-\\[state\\=processing\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=processing] *):where([dir=rtl],[dir=rtl] *){animation-direction:reverse}.group-data-\\[state\\=uploading\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=uploading] *){--_spread:var(--shimmer-spread,calc(3ch + 40px));--_base:currentColor;--_highlight:var(--shimmer-color,oklch(from currentColor l c h / calc(alpha* .2)));background-image:var(--shimmer-image,linear-gradient(calc(90deg + var(--shimmer-angle)), var(--_base) calc(50% - var(--_spread)), var(--_highlight) calc(50% - var(--_spread) * .5), var(--_highlight) 50%, var(--_highlight) calc(50% + var(--_spread) * .5), var(--_base) calc(50% + var(--_spread))))}@supports (color:color-mix(in lab, red, red)){.group-data-\\[state\\=uploading\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=uploading] *){background-image:var(--shimmer-image,linear-gradient(calc(90deg + var(--shimmer-angle)), var(--_base) calc(50% - var(--_spread)), color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% - var(--_spread) * .5), var(--_highlight) 50%, color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% + var(--_spread) * .5), var(--_base) calc(50% + var(--_spread))))}}.group-data-\\[state\\=uploading\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=uploading] *){background-repeat:no-repeat;background-size:calc(200% + var(--_spread) * 2) 100%;-webkit-text-fill-color:var(--shimmer-text-fill,transparent);animation:tw-shimmer var(--shimmer-duration,2s) linear infinite;background-position:0 0;-webkit-background-clip:text;background-clip:text}@media (prefers-color-scheme:dark){.group-data-\\[state\\=uploading\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=uploading] *){--_highlight:var(--shimmer-color,oklch(from currentColor max(.8, calc(l + .4)) c h / calc(alpha + .4)))}}.group-data-\\[state\\=uploading\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=uploading] *):where([dir=rtl],[dir=rtl] *){animation-direction:reverse}.group-data-\\[variant\\=separator\\]\\/marker\\:flex-none:is(:where(.group\\/marker)[data-variant=separator] *){flex:none}.group-data-\\[variant\\=separator\\]\\/marker\\:text-center:is(:where(.group\\/marker)[data-variant=separator] *){text-align:center}.placeholder\\:text-neutral-400::placeholder{color:var(--scw-gray-400)}.before\\:mr-1:before{content:var(--tw-content);margin-right:var(--spacing)}.before\\:h-px:before{content:var(--tw-content);height:1px}.before\\:min-w-0:before{content:var(--tw-content);min-width:0}.before\\:flex-1:before{content:var(--tw-content);flex:1}.before\\:bg-border:before{content:var(--tw-content);background-color:var(--border)}.after\\:ml-1:after{content:var(--tw-content);margin-left:var(--spacing)}.after\\:h-px:after{content:var(--tw-content);height:1px}.after\\:min-w-0:after{content:var(--tw-content);min-width:0}.after\\:flex-1:after{content:var(--tw-content);flex:1}.after\\:bg-border:after{content:var(--tw-content);background-color:var(--border)}.focus-within\\:border-neutral-900:focus-within{border-color:var(--scw-ink)}.focus-within\\:shadow-\\[0_0_0_1px_var\\(--scw-ink\\)\\]:focus-within{--tw-shadow:0 0 0 1px var(--tw-shadow-color,var(--scw-ink));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-within\\:ring-1:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-within\\:ring-ring\\/50:focus-within{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.focus-within\\:ring-ring\\/50:focus-within{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}@media (hover:hover){.hover\\:bg-\\[color-mix\\(in_oklch\\,var\\(--secondary\\)\\,var\\(--foreground\\)_5\\%\\)\\]:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-\\[color-mix\\(in_oklch\\,var\\(--secondary\\)\\,var\\(--foreground\\)_5\\%\\)\\]:hover{background-color:color-mix(in oklch,var(--secondary),var(--foreground) 5%)}}.hover\\:bg-destructive\\/20:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-destructive\\/20:hover{background-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.hover\\:bg-muted:hover{background-color:var(--muted)}.hover\\:bg-neutral-50:hover,.hover\\:bg-neutral-100:hover{background-color:var(--scw-hover)}.hover\\:bg-neutral-800:hover{background-color:var(--scw-ink-body)}.hover\\:bg-primary\\/80:hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-primary\\/80:hover{background-color:color-mix(in oklab, var(--primary) 80%, transparent)}}.hover\\:text-foreground:hover{color:var(--foreground)}.hover\\:text-neutral-600:hover{color:var(--scw-muted)}.hover\\:text-neutral-700:hover{color:var(--scw-ink-secondary)}.hover\\:no-underline:hover{text-decoration-line:none}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:shadow-\\[0_0_0_1px_var\\(--scw-hairline-strong\\)\\,0_4px_12px_-2px_rgba\\(0\\,0\\,0\\,\\.14\\)\\,0_2px_4px_-2px_rgba\\(0\\,0\\,0\\,\\.1\\)\\]:hover{--tw-shadow:0 0 0 1px var(--tw-shadow-color,var(--scw-hairline-strong)), 0 4px 12px -2px var(--tw-shadow-color,#00000024), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.hover\\:shadow-\\[inset_0_0_0_1px_var\\(--scw-hairline-strong\\)\\]:hover{--tw-shadow:inset 0 0 0 1px var(--tw-shadow-color,var(--scw-hairline-strong));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}}.focus\\:border-\\[color\\:var\\(--scw-hairline-strong\\)\\]:focus{border-color:var(--scw-hairline-strong)}.focus\\:border-red-500:focus{border-color:var(--color-red-500)}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:border-destructive\\/40:focus-visible{border-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.focus-visible\\:border-destructive\\/40:focus-visible{border-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.focus-visible\\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\\:ring-3:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.active\\:not-aria-\\[haspopup\\]\\:translate-y-px:active:not([aria-haspopup]){--tw-translate-y:1px;translate:var(--tw-translate-x) var(--tw-translate-y)}@media (hover:hover){.enabled\\:hover\\:bg-neutral-100:enabled:hover{background-color:var(--scw-hover)}.enabled\\:hover\\:text-neutral-700:enabled:hover{color:var(--scw-ink-secondary)}}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-default:disabled{cursor:default}.disabled\\:opacity-45:disabled{opacity:.45}.disabled\\:opacity-50:disabled{opacity:.5}.disabled\\:opacity-60:disabled{opacity:.6}:where([data-slot=button-group]) .in-data-\\[slot\\=button-group\\]\\:rounded-lg{border-radius:var(--radius)}.has-data-\\[icon\\=inline-end\\]\\:pr-1\\.5:has([data-icon=inline-end]){padding-right:calc(var(--spacing) * 1.5)}.has-data-\\[icon\\=inline-end\\]\\:pr-2:has([data-icon=inline-end]){padding-right:calc(var(--spacing) * 2)}.has-data-\\[icon\\=inline-start\\]\\:pl-1\\.5:has([data-icon=inline-start]){padding-left:calc(var(--spacing) * 1.5)}.has-data-\\[icon\\=inline-start\\]\\:pl-2:has([data-icon=inline-start]){padding-left:calc(var(--spacing) * 2)}.has-data-\\[slot\\=attachment-content\\]\\:w-30:has([data-slot=attachment-content]){width:calc(var(--spacing) * 30)}.has-data-\\[slot\\=attachment-content\\]\\:px-1\\.5:has([data-slot=attachment-content]){padding-inline:calc(var(--spacing) * 1.5)}.has-data-\\[slot\\=attachment-content\\]\\:px-2:has([data-slot=attachment-content]){padding-inline:calc(var(--spacing) * 2)}.has-data-\\[slot\\=attachment-content\\]\\:px-2\\.5:has([data-slot=attachment-content]){padding-inline:calc(var(--spacing) * 2.5)}.has-data-\\[slot\\=attachment-content\\]\\:py-1:has([data-slot=attachment-content]){padding-block:var(--spacing)}.has-data-\\[slot\\=attachment-content\\]\\:py-1\\.5:has([data-slot=attachment-content]){padding-block:calc(var(--spacing) * 1.5)}.has-data-\\[slot\\=attachment-content\\]\\:py-2:has([data-slot=attachment-content]){padding-block:calc(var(--spacing) * 2)}.has-data-\\[slot\\=attachment-media\\]\\:p-1:has([data-slot=attachment-media]){padding:var(--spacing)}.has-data-\\[slot\\=attachment-media\\]\\:p-1\\.5:has([data-slot=attachment-media]){padding:calc(var(--spacing) * 1.5)}.has-data-\\[slot\\=attachment-media\\]\\:p-2:has([data-slot=attachment-media]){padding:calc(var(--spacing) * 2)}.has-\\[button\\]\\:p-0:has(:is(button)){padding:0}@media (hover:hover){.has-\\[\\>a\\,\\>button\\]\\:hover\\:bg-muted\\/50:has(>a,>button):hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.has-\\[\\>a\\,\\>button\\]\\:hover\\:bg-muted\\/50:has(>a,>button):hover{background-color:color-mix(in oklab, var(--muted) 50%, transparent)}}}.aria-expanded\\:bg-muted[aria-expanded=true]{background-color:var(--muted)}.aria-expanded\\:bg-secondary[aria-expanded=true]{background-color:var(--secondary)}.aria-expanded\\:text-foreground[aria-expanded=true]{color:var(--foreground)}.aria-expanded\\:text-secondary-foreground[aria-expanded=true]{color:var(--secondary-foreground)}.aria-invalid\\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\\:ring-3[aria-invalid=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}:is(.group-data-\\[align\\=end\\]\\/message\\:\\*\\:data-slot\\:self-end:is(:where(.group\\/message)[data-align=end] *)>*)[data-slot]{align-self:flex-end}.data-\\[active\\=false\\]\\:pointer-events-none[data-active=false]{pointer-events:none}.data-\\[active\\=false\\]\\:scale-95[data-active=false]{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.data-\\[active\\=false\\]\\:opacity-0[data-active=false]{opacity:0}.data-\\[active\\=false\\]\\:duration-400[data-active=false]{--tw-duration:.4s;transition-duration:.4s}.data-\\[active\\=false\\]\\:ease-\\[cubic-bezier\\(0\\.7\\,0\\,0\\.84\\,0\\)\\][data-active=false]{--tw-ease:cubic-bezier(.7,0,.84,0);transition-timing-function:cubic-bezier(.7,0,.84,0)}.data-\\[active\\=true\\]\\:translate-y-0[data-active=true]{--tw-translate-y:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[active\\=true\\]\\:scale-100[data-active=true]{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.data-\\[active\\=true\\]\\:opacity-100[data-active=true]{opacity:1}.data-\\[active\\=true\\]\\:ease-\\[cubic-bezier\\(0\\.23\\,1\\,0\\.32\\,1\\)\\][data-active=true]{--tw-ease:cubic-bezier(.23,1,.32,1);transition-timing-function:cubic-bezier(.23,1,.32,1)}.data-\\[align\\=end\\]\\:flex-row-reverse[data-align=end]{flex-direction:row-reverse}.data-\\[align\\=end\\]\\:self-end[data-align=end]{align-self:flex-end}.data-\\[direction\\=end\\]\\:bottom-4[data-direction=end]{bottom:calc(var(--spacing) * 4)}.data-\\[direction\\=end\\]\\:data-\\[active\\=false\\]\\:translate-y-full[data-direction=end][data-active=false]{--tw-translate-y:100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[direction\\=start\\]\\:top-4[data-direction=start]{top:calc(var(--spacing) * 4)}.data-\\[direction\\=start\\]\\:data-\\[active\\=false\\]\\:-translate-y-full[data-direction=start][data-active=false]{--tw-translate-y:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}:is(.\\*\\:data-\\[slot\\=attachment\\]\\:flex-none>*)[data-slot=attachment]{flex:none}:is(.\\*\\:data-\\[slot\\=attachment\\]\\:snap-start>*)[data-slot=attachment]{scroll-snap-align:start}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:rounded-none>*)[data-slot=bubble-content]{border-radius:0}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:border-border>*)[data-slot=bubble-content]{border-color:var(--border)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-\\[oklch\\(from_var\\(--primary\\)_0\\.93_calc\\(c\\*0\\.4\\)_h\\)\\]>*)[data-slot=bubble-content]{background-color:oklch(from var(--primary) .93 calc(c * .4) h)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-background>*)[data-slot=bubble-content]{background-color:var(--background)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-destructive\\/10>*)[data-slot=bubble-content]{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-destructive\\/10>*)[data-slot=bubble-content]{background-color:color-mix(in oklab, var(--destructive) 10%, transparent)}}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-muted>*)[data-slot=bubble-content]{background-color:var(--muted)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-primary>*)[data-slot=bubble-content]{background-color:var(--primary)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-secondary>*)[data-slot=bubble-content]{background-color:var(--secondary)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-transparent>*)[data-slot=bubble-content]{background-color:#0000}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:p-0>*)[data-slot=bubble-content]{padding:0}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:text-destructive>*)[data-slot=bubble-content]{color:var(--destructive)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:text-foreground>*)[data-slot=bubble-content]{color:var(--foreground)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:text-primary-foreground>*)[data-slot=bubble-content]{color:var(--primary-foreground)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:text-secondary-foreground>*)[data-slot=bubble-content]{color:var(--secondary-foreground)}:is(.group-data-\\[orientation\\=vertical\\]\\/attachment\\:\\*\\:data-\\[slot\\=spinner\\]\\:size-6\\!:is(:where(.group\\/attachment)[data-orientation=vertical] *)>*)[data-slot=spinner]{width:calc(var(--spacing) * 6)!important;height:calc(var(--spacing) * 6)!important}.data-\\[state\\=error\\]\\:border-destructive\\/30[data-state=error]{border-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.data-\\[state\\=error\\]\\:border-destructive\\/30[data-state=error]{border-color:color-mix(in oklab, var(--destructive) 30%, transparent)}}.data-\\[state\\=idle\\]\\:border-dashed[data-state=idle]{--tw-border-style:dashed;border-style:dashed}.data-\\[variant\\=ghost\\]\\:max-w-full[data-variant=ghost]{max-width:100%}.rtl\\:translate-x-1\\/2:where(:dir(rtl),[dir=rtl],[dir=rtl] *){--tw-translate-x:calc(1 / 2 * 100%);translate:var(--tw-translate-x) var(--tw-translate-y)}@media (prefers-color-scheme:dark){.dark\\:border-input{border-color:var(--input)}.dark\\:bg-destructive\\/20{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-destructive\\/20{background-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.dark\\:bg-input\\/30{background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-input\\/30{background-color:color-mix(in oklab, var(--input) 30%, transparent)}}@media (hover:hover){.dark\\:hover\\:bg-destructive\\/30:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:hover\\:bg-destructive\\/30:hover{background-color:color-mix(in oklab, var(--destructive) 30%, transparent)}}.dark\\:hover\\:bg-input\\/50:hover{background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\\:hover\\:bg-input\\/50:hover{background-color:color-mix(in oklab, var(--input) 50%, transparent)}}.dark\\:hover\\:bg-muted\\/50:hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.dark\\:hover\\:bg-muted\\/50:hover{background-color:color-mix(in oklab, var(--muted) 50%, transparent)}}}.dark\\:focus-visible\\:ring-destructive\\/40:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:focus-visible\\:ring-destructive\\/40:focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\\:aria-invalid\\:border-destructive\\/50[aria-invalid=true]{border-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:aria-invalid\\:border-destructive\\/50[aria-invalid=true]{border-color:color-mix(in oklab, var(--destructive) 50%, transparent)}}.dark\\:aria-invalid\\:ring-destructive\\/40[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:aria-invalid\\:ring-destructive\\/40[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}:is(.dark\\:\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-\\[oklch\\(from_var\\(--primary\\)_0\\.3_calc\\(c\\*0\\.4\\)_h\\)\\]>*)[data-slot=bubble-content]{background-color:oklch(from var(--primary) .3 calc(c * .4) h)}:is(.dark\\:\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-destructive\\/20>*)[data-slot=bubble-content]{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){:is(.dark\\:\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-destructive\\/20>*)[data-slot=bubble-content]{background-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}}.\\[\\&_\\*\\]\\:box-border *{box-sizing:border-box}.\\[\\&_img\\]\\:block img{display:block}.\\[\\&_img\\]\\:size-full img{width:100%;height:100%}.\\[\\&_img\\]\\:scale-100 img{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.\\[\\&_img\\]\\:scale-\\[1\\.08\\] img{scale:1.08}.\\[\\&_img\\]\\:object-contain img{object-fit:contain}.\\[\\&_img\\]\\:object-cover img{object-fit:cover}.\\[\\&_strong\\]\\:font-semibold strong{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:block svg{display:block}.\\[\\&_svg\\]\\:size-full svg{width:100%;height:100%}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.data-\\[direction\\=start\\]\\:\\[\\&_svg\\]\\:rotate-180[data-direction=start] svg{rotate:180deg}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-3 svg:not([class*=size-]){width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-3\\.5 svg:not([class*=size-]){width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-6:is(:where(.group\\/attachment)[data-orientation=vertical] *) svg:not([class*=size-]){width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.group-data-\\[size\\=xs\\]\\/attachment\\:\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-3\\.5:is(:where(.group\\/attachment)[data-size=xs] *) svg:not([class*=size-]){width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.\\[\\&_table\\]\\:whitespace-normal table{white-space:normal}.\\[\\&\\:\\:-webkit-scrollbar\\]\\:hidden::-webkit-scrollbar{display:none}.\\[a\\]\\:underline:is(a){text-decoration-line:underline}.\\[a\\]\\:underline-offset-3:is(a){text-underline-offset:3px}:is(.\\*\\:\\[a\\]\\:underline>*):is(a){text-decoration-line:underline}:is(.\\*\\:\\[a\\]\\:underline-offset-3>*):is(a){text-underline-offset:3px}@media (hover:hover){.\\[a\\]\\:hover\\:text-foreground:is(a):hover,:is(.\\*\\:\\[a\\]\\:hover\\:text-foreground>*):is(a):hover{color:var(--foreground)}}.\\[button\\]\\:text-left:is(button){text-align:left}.\\[button\\,a\\]\\:transition-colors:is(button,a){transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.\\[button\\,a\\]\\:outline-none:is(button,a){--tw-outline-style:none;outline-style:none}.\\[button\\,a\\]\\:focus-visible\\:border-ring:is(button,a):focus-visible{border-color:var(--ring)}.\\[button\\,a\\]\\:focus-visible\\:ring-3:is(button,a):focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.\\[button\\,a\\]\\:focus-visible\\:ring-ring\\/50:is(button,a):focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.\\[button\\,a\\]\\:focus-visible\\:ring-ring\\/50:is(button,a):focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}:is(.\\*\\:\\[img\\]\\:aspect-square>*):is(img){aspect-ratio:1}:is(.\\*\\:\\[img\\]\\:w-full>*):is(img){width:100%}:is(.\\*\\:\\[img\\]\\:object-cover>*):is(img){object-fit:cover}.\\[\\&\\>\\*\\]\\:pointer-events-auto>*{pointer-events:auto}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-\\[color-mix\\(in_oklch\\,var\\(--muted\\)\\,var\\(--foreground\\)_5\\%\\)\\]>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-\\[color-mix\\(in_oklch\\,var\\(--muted\\)\\,var\\(--foreground\\)_5\\%\\)\\]>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklch,var(--muted),var(--foreground) 5%)}}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-\\[color-mix\\(in_oklch\\,var\\(--secondary\\)\\,var\\(--foreground\\)_5\\%\\)\\]>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-\\[color-mix\\(in_oklch\\,var\\(--secondary\\)\\,var\\(--foreground\\)_5\\%\\)\\]>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklch,var(--secondary),var(--foreground) 5%)}}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-\\[oklch\\(from_var\\(--primary\\)_0\\.88_calc\\(c\\*0\\.5\\)_h\\)\\]>[data-slot=bubble-content]:is(button,a):hover{background-color:oklch(from var(--primary) .88 calc(c * .5) h)}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-destructive\\/20>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-destructive\\/20>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-muted>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--muted)}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-primary\\/80>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-primary\\/80>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklab, var(--primary) 80%, transparent)}}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:text-foreground>[data-slot=bubble-content]:is(button,a):hover{color:var(--foreground)}@media (prefers-color-scheme:dark){.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-\\[oklch\\(from_var\\(--primary\\)_0\\.35_calc\\(c\\*0\\.5\\)_h\\)\\]>[data-slot=bubble-content]:is(button,a):hover{background-color:oklch(from var(--primary) .35 calc(c * .5) h)}.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-destructive\\/30>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-destructive\\/30>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklab, var(--destructive) 30%, transparent)}}.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-input\\/30>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-input\\/30>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklab, var(--input) 30%, transparent)}}.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-muted\\/50>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-muted\\/50>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklab, var(--muted) 50%, transparent)}}}}@property --scroll-fade-t{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --scroll-fade-b{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --scroll-fade-s{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --scroll-fade-e{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --scroll-fade-mask{syntax:"*";inherits:false}@property --shimmer-angle{syntax:"<angle>";inherits:true;initial-value:20deg}@property --shimmer-image{syntax:"*";inherits:false}@property --shimmer-text-fill{syntax:"*";inherits:false}@media (prefers-reduced-motion:reduce){.shimmer{-webkit-text-fill-color:currentColor;background-image:none;animation:none}}:root{--scw-canvas:#fff;--scw-ink:#0b0b0b;--scw-ink-body:#2c2c2a;--scw-ink-secondary:#52514e;--scw-muted:#898781;--scw-hover:#f0f0ef;--scw-selected:#edece8;--scw-gray-200:#e5e4e1;--scw-gray-300:#b8b5ae;--scw-gray-400:#9c9a94;--scw-hairline:#0b0b0b1a;--scw-hairline-strong:#0b0b0b33;--scw-ring:#2a78d6;--radius:.625rem;--background:var(--scw-canvas);--foreground:var(--scw-ink);--card:var(--scw-canvas);--card-foreground:var(--scw-ink);--popover:var(--scw-canvas);--popover-foreground:var(--scw-ink);--primary:var(--scw-ink);--primary-foreground:#fff;--secondary:var(--scw-hover);--secondary-foreground:var(--scw-ink);--muted:var(--scw-hover);--muted-foreground:var(--scw-muted);--accent:var(--scw-hover);--accent-foreground:var(--scw-ink);--destructive:#dc2626;--border:var(--scw-hairline);--input:var(--scw-hairline);--ring:var(--scw-ring)}html,body{overscroll-behavior:none;background:0 0;width:100%;height:100%;margin:0;padding:0;overflow:hidden}body{--scw-font:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;flex-direction:column;justify-content:flex-end;align-items:flex-end;display:flex}html:has(body.scw-preview-stage),body.scw-preview-stage{color-scheme:inherit;background:0 0}body.scw-preview-stage{justify-content:center;align-items:center;padding:0}.scw-panel{--scw-nav-height:52px;--scw-send-pill-gap:24px;--scw-send-pill-height:40px;--scw-composer-clearance:8px;--scw-composer-height:130px;--scw-composer-radius:24px;--scw-composer-inset:12px;--scw-panel-radius:calc(var(--scw-composer-radius) + var(--scw-composer-inset) + 1px);--scw-header-btn-size:36px;--scw-header-btn-concentric:calc(var(--scw-header-btn-size) / 2);--scw-header-padding:calc(var(--scw-panel-radius) - var(--scw-header-btn-concentric) - 1px)}.scw-form:before{content:"";left:var(--scw-composer-inset);right:var(--scw-composer-inset);background:var(--scw-canvas);border-top-left-radius:var(--scw-composer-radius,24px);border-top-right-radius:var(--scw-composer-radius,24px);z-index:-1;pointer-events:none;position:absolute;top:0;bottom:0}.scw-messages{--scw-message-inset-x:16px;scrollbar-width:none}.scw-messages::-webkit-scrollbar{width:0;height:0}@keyframes scw-bounce-top{0%{transform:translateY(0)}35%{transform:translateY(14px)}to{transform:translateY(0)}}@keyframes scw-bounce-bottom{0%{transform:translateY(0)}35%{transform:translateY(-14px)}to{transform:translateY(0)}}.scw-bounce-top{animation:.32s cubic-bezier(.32,.72,0,1) scw-bounce-top}.scw-bounce-bottom{animation:.32s cubic-bezier(.32,.72,0,1) scw-bounce-bottom}@keyframes scw-message-in{0%{opacity:0}to{opacity:1}}.scw-message-in{animation:.22s ease-out scw-message-in}@media (prefers-reduced-motion:reduce){.scw-message-in{animation:none}}@keyframes scw-spin{to{transform:rotate(360deg)}}.scw-citation+.scw-citation{margin-left:.3em}.scw-citation-popover{transform:translateX(calc(-50% + var(--scw-citation-popover-shift,0px)))}.scw-citation-popover:before{content:"";height:10px;position:absolute;top:-10px;left:0;right:0}@media (hover:hover) and (pointer:fine){.scw-citation:hover .scw-citation-badge{color:#fff;background:#2563eb}}.scw-scrollbar{top:10px;right:3px;bottom:calc(var(--scw-composer-height,130px) + 2px);z-index:3;pointer-events:none;width:6px;position:absolute}.scw-scrollbar-thumb{background-color:var(--scw-gray-300);opacity:0;pointer-events:none;cursor:default;touch-action:none;border-radius:9999px;transition:opacity .2s;position:absolute;top:0;left:0;right:0}.scw-scrollbar-visible .scw-scrollbar-thumb{opacity:1;pointer-events:auto}.scw-scrollbar-thumb:hover{background-color:var(--scw-gray-400)}.scw-thin-scroll{scrollbar-width:thin;scrollbar-color:var(--scw-gray-300) transparent}.scw-thin-scroll::-webkit-scrollbar{width:6px}.scw-thin-scroll::-webkit-scrollbar-track{background:0 0}.scw-thin-scroll::-webkit-scrollbar-thumb{background-color:var(--scw-gray-300);border-radius:9999px}.scw-suggestion{box-sizing:border-box;text-align:left;white-space:normal;grid-template-columns:auto minmax(0,1fr);align-items:center;column-gap:12px;width:100%;min-width:0;max-width:100%;display:grid;overflow:hidden}.scw-suggestion-icon{justify-content:center;align-self:center;align-items:center;width:28px;height:28px;display:flex}.scw-suggestion-copy{flex-direction:column;justify-content:center;min-width:0;max-width:100%;display:flex}.scw-suggestion-label{max-width:100%;display:block;overflow-wrap:anywhere!important;word-break:break-all!important;white-space:normal!important}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-pan-x{syntax:"*";inherits:false}@property --tw-pan-y{syntax:"*";inherits:false}@property --tw-pinch-zoom{syntax:"*";inherits:false}@property --tw-scroll-snap-strictness{syntax:"*";inherits:false;initial-value:proximity}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@keyframes scroll-fade-reveal-t{0%{--scroll-fade-t:0px}to{--scroll-fade-t:var(--_scroll-fade-size-t,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))))}}@keyframes scroll-fade-reveal-b{0%{--scroll-fade-b:var(--_scroll-fade-size-b,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))))}to{--scroll-fade-b:0px}}@keyframes scroll-fade-reveal-s{0%{--scroll-fade-s:0px}to{--scroll-fade-s:var(--_scroll-fade-size-s,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))))}}@keyframes scroll-fade-reveal-e{0%{--scroll-fade-e:var(--_scroll-fade-size-e,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))))}to{--scroll-fade-e:0px}}@keyframes tw-shimmer{0%{background-position:100% 0}to{background-position:0 0}}`;
|
|
13941
14021
|
|
|
13942
14022
|
// src/lib/support/styles.ts
|
|
13943
14023
|
var STYLE_ATTRIBUTE = "data-saasco-chat";
|
|
@@ -14057,46 +14137,23 @@ function toPreparedFile(blob, originalName) {
|
|
|
14057
14137
|
});
|
|
14058
14138
|
}
|
|
14059
14139
|
|
|
14060
|
-
// src/lib/support/resolveSubmitEmailGate.ts
|
|
14061
|
-
function resolveSubmitEmailGate({
|
|
14062
|
-
emailDraft,
|
|
14063
|
-
isNewConversation,
|
|
14064
|
-
knownEmail
|
|
14065
|
-
}) {
|
|
14066
|
-
if (!isNewConversation || knownEmail) {
|
|
14067
|
-
return {
|
|
14068
|
-
emailForSend: knownEmail ?? void 0,
|
|
14069
|
-
ok: true,
|
|
14070
|
-
optimisticallyCapturedEmail: null
|
|
14071
|
-
};
|
|
14072
|
-
}
|
|
14073
|
-
const candidate = emailDraft.trim();
|
|
14074
|
-
if (!EMAIL_PATTERN.test(candidate)) {
|
|
14075
|
-
return {
|
|
14076
|
-
error: "Enter a valid email so we can reply to you.",
|
|
14077
|
-
ok: false
|
|
14078
|
-
};
|
|
14079
|
-
}
|
|
14080
|
-
return {
|
|
14081
|
-
emailForSend: candidate,
|
|
14082
|
-
ok: true,
|
|
14083
|
-
optimisticallyCapturedEmail: candidate
|
|
14084
|
-
};
|
|
14085
|
-
}
|
|
14086
|
-
|
|
14087
14140
|
// src/lib/support/transport.ts
|
|
14088
14141
|
async function getWidgetConfig({
|
|
14089
14142
|
baseUrl,
|
|
14090
14143
|
projectId
|
|
14091
14144
|
}) {
|
|
14092
|
-
const { branding, tools } = await postJson(
|
|
14145
|
+
const { branding, suggestions, tools } = await postJson(
|
|
14093
14146
|
`${normalizeBaseUrl(baseUrl)}/api/support/settings`,
|
|
14094
14147
|
{ projectId }
|
|
14095
14148
|
);
|
|
14096
14149
|
if (!Array.isArray(tools)) {
|
|
14097
14150
|
throw new TypeError("Support chat settings response is missing `tools`");
|
|
14098
14151
|
}
|
|
14099
|
-
return {
|
|
14152
|
+
return {
|
|
14153
|
+
branding,
|
|
14154
|
+
...Array.isArray(suggestions) ? { suggestions } : {},
|
|
14155
|
+
tools
|
|
14156
|
+
};
|
|
14100
14157
|
}
|
|
14101
14158
|
async function sendMessage({
|
|
14102
14159
|
baseUrl,
|
|
@@ -14155,16 +14212,32 @@ async function resumeSession({
|
|
|
14155
14212
|
body
|
|
14156
14213
|
);
|
|
14157
14214
|
}
|
|
14215
|
+
async function forgetVisitorSession({
|
|
14216
|
+
baseUrl,
|
|
14217
|
+
projectId
|
|
14218
|
+
}) {
|
|
14219
|
+
await postJson(
|
|
14220
|
+
`${normalizeBaseUrl(baseUrl)}/api/support/visitor/forget`,
|
|
14221
|
+
{ projectId }
|
|
14222
|
+
);
|
|
14223
|
+
}
|
|
14158
14224
|
async function requestHandoff({
|
|
14159
14225
|
baseUrl,
|
|
14226
|
+
keepalive,
|
|
14160
14227
|
...body
|
|
14161
14228
|
}) {
|
|
14162
|
-
return await postJson(`${normalizeBaseUrl(baseUrl)}/api/support/handoff`, body
|
|
14229
|
+
return await postJson(`${normalizeBaseUrl(baseUrl)}/api/support/handoff`, body, {
|
|
14230
|
+
keepalive,
|
|
14231
|
+
simple: keepalive === true
|
|
14232
|
+
});
|
|
14163
14233
|
}
|
|
14164
|
-
async function postJson(url, body) {
|
|
14234
|
+
async function postJson(url, body, options) {
|
|
14165
14235
|
const response = await fetch(url, {
|
|
14166
14236
|
body: JSON.stringify(body),
|
|
14167
|
-
headers: {
|
|
14237
|
+
headers: {
|
|
14238
|
+
"content-type": options?.simple ? "text/plain" : "application/json"
|
|
14239
|
+
},
|
|
14240
|
+
keepalive: options?.keepalive,
|
|
14168
14241
|
method: "POST"
|
|
14169
14242
|
});
|
|
14170
14243
|
if (!response.ok) {
|
|
@@ -14395,15 +14468,202 @@ function persistEmail(emailStorageKey, email) {
|
|
|
14395
14468
|
}
|
|
14396
14469
|
}
|
|
14397
14470
|
|
|
14471
|
+
// src/lib/support/useHandoffDecisions.ts
|
|
14472
|
+
import { useCallback as useCallback5, useEffect as useEffect5, useRef as useRef7, useState as useState4 } from "react";
|
|
14473
|
+
|
|
14474
|
+
// src/lib/support/handoff.ts
|
|
14475
|
+
import { getToolName as getToolName2, isToolUIPart as isToolUIPart2 } from "ai";
|
|
14476
|
+
function readHandoffOffer(message) {
|
|
14477
|
+
for (const part of message.parts ?? []) {
|
|
14478
|
+
if (!isToolUIPart2(part) || getToolName2(part) !== REQUEST_HUMAN_HANDOFF_TOOL_NAME) {
|
|
14479
|
+
continue;
|
|
14480
|
+
}
|
|
14481
|
+
if (part.state !== "output-available") {
|
|
14482
|
+
continue;
|
|
14483
|
+
}
|
|
14484
|
+
const output = part.output;
|
|
14485
|
+
if (output?.offerHandoff && !output.declined && !output.resolved) {
|
|
14486
|
+
return { reason: output.reason ?? null, toolCallId: part.toolCallId };
|
|
14487
|
+
}
|
|
14488
|
+
}
|
|
14489
|
+
return null;
|
|
14490
|
+
}
|
|
14491
|
+
function readOutstandingHandoffOffers(messages) {
|
|
14492
|
+
const offers = [];
|
|
14493
|
+
for (const message of messages) {
|
|
14494
|
+
const offer = readHandoffOffer(message);
|
|
14495
|
+
if (offer) {
|
|
14496
|
+
offers.push(offer);
|
|
14497
|
+
}
|
|
14498
|
+
}
|
|
14499
|
+
return offers;
|
|
14500
|
+
}
|
|
14501
|
+
function markHandoffOfferInMessages(messages, toolCallId, flag) {
|
|
14502
|
+
let changed = false;
|
|
14503
|
+
const next = messages.map((message) => {
|
|
14504
|
+
if (message.role !== "assistant") {
|
|
14505
|
+
return message;
|
|
14506
|
+
}
|
|
14507
|
+
let messageChanged = false;
|
|
14508
|
+
const parts = (message.parts ?? []).map((part) => {
|
|
14509
|
+
if (!isToolUIPart2(part) || getToolName2(part) !== REQUEST_HUMAN_HANDOFF_TOOL_NAME) {
|
|
14510
|
+
return part;
|
|
14511
|
+
}
|
|
14512
|
+
if (part.toolCallId !== toolCallId || part.state !== "output-available") {
|
|
14513
|
+
return part;
|
|
14514
|
+
}
|
|
14515
|
+
const output = part.output;
|
|
14516
|
+
if (output?.declined || output?.resolved) {
|
|
14517
|
+
return part;
|
|
14518
|
+
}
|
|
14519
|
+
messageChanged = true;
|
|
14520
|
+
changed = true;
|
|
14521
|
+
return {
|
|
14522
|
+
...part,
|
|
14523
|
+
output: {
|
|
14524
|
+
...output,
|
|
14525
|
+
...flag,
|
|
14526
|
+
offerHandoff: false
|
|
14527
|
+
}
|
|
14528
|
+
};
|
|
14529
|
+
});
|
|
14530
|
+
return messageChanged ? { ...message, parts } : message;
|
|
14531
|
+
});
|
|
14532
|
+
return changed ? next : messages;
|
|
14533
|
+
}
|
|
14534
|
+
|
|
14535
|
+
// src/lib/support/useHandoffDecisions.ts
|
|
14536
|
+
function useHandoffDecisions({
|
|
14537
|
+
baseUrl,
|
|
14538
|
+
mergedIdsRef,
|
|
14539
|
+
messagesRef,
|
|
14540
|
+
onAccepted,
|
|
14541
|
+
projectId,
|
|
14542
|
+
sessionRef,
|
|
14543
|
+
setMessages
|
|
14544
|
+
}) {
|
|
14545
|
+
const [dismissedHandoffs, setDismissedHandoffs] = useState4(
|
|
14546
|
+
() => /* @__PURE__ */ new Set()
|
|
14547
|
+
);
|
|
14548
|
+
const [handoffPending, setHandoffPending] = useState4(false);
|
|
14549
|
+
const handoffPendingRef = useRef7(false);
|
|
14550
|
+
const confirmHandoff = useCallback5(
|
|
14551
|
+
async (offer) => {
|
|
14552
|
+
const active = sessionRef.current;
|
|
14553
|
+
if (!active || handoffPendingRef.current) {
|
|
14554
|
+
return;
|
|
14555
|
+
}
|
|
14556
|
+
handoffPendingRef.current = true;
|
|
14557
|
+
setHandoffPending(true);
|
|
14558
|
+
try {
|
|
14559
|
+
const result = await requestHandoff({
|
|
14560
|
+
baseUrl,
|
|
14561
|
+
conversationId: active.conversationId,
|
|
14562
|
+
projectId,
|
|
14563
|
+
reason: offer.reason,
|
|
14564
|
+
sessionToken: active.sessionToken,
|
|
14565
|
+
toolCallId: offer.toolCallId
|
|
14566
|
+
});
|
|
14567
|
+
onAccepted();
|
|
14568
|
+
const next = markHandoffOfferInMessages(
|
|
14569
|
+
messagesRef.current,
|
|
14570
|
+
offer.toolCallId,
|
|
14571
|
+
{ resolved: true }
|
|
14572
|
+
);
|
|
14573
|
+
if (result.acknowledgment) {
|
|
14574
|
+
mergedIdsRef.current.add(result.acknowledgment.id);
|
|
14575
|
+
setMessages([...next, toUiMessage(result.acknowledgment)]);
|
|
14576
|
+
} else {
|
|
14577
|
+
setMessages(next);
|
|
14578
|
+
}
|
|
14579
|
+
} catch {
|
|
14580
|
+
} finally {
|
|
14581
|
+
handoffPendingRef.current = false;
|
|
14582
|
+
setHandoffPending(false);
|
|
14583
|
+
}
|
|
14584
|
+
},
|
|
14585
|
+
[
|
|
14586
|
+
baseUrl,
|
|
14587
|
+
mergedIdsRef,
|
|
14588
|
+
messagesRef,
|
|
14589
|
+
onAccepted,
|
|
14590
|
+
projectId,
|
|
14591
|
+
sessionRef,
|
|
14592
|
+
setMessages
|
|
14593
|
+
]
|
|
14594
|
+
);
|
|
14595
|
+
const dismissHandoff = useCallback5(
|
|
14596
|
+
(toolCallId) => {
|
|
14597
|
+
setDismissedHandoffs((prev) => {
|
|
14598
|
+
if (prev.has(toolCallId)) {
|
|
14599
|
+
return prev;
|
|
14600
|
+
}
|
|
14601
|
+
const next = new Set(prev);
|
|
14602
|
+
next.add(toolCallId);
|
|
14603
|
+
return next;
|
|
14604
|
+
});
|
|
14605
|
+
setMessages(
|
|
14606
|
+
markHandoffOfferInMessages(messagesRef.current, toolCallId, {
|
|
14607
|
+
declined: true
|
|
14608
|
+
})
|
|
14609
|
+
);
|
|
14610
|
+
const active = sessionRef.current;
|
|
14611
|
+
if (!active) {
|
|
14612
|
+
return;
|
|
14613
|
+
}
|
|
14614
|
+
void requestHandoff({
|
|
14615
|
+
baseUrl,
|
|
14616
|
+
conversationId: active.conversationId,
|
|
14617
|
+
decision: "declined",
|
|
14618
|
+
projectId,
|
|
14619
|
+
sessionToken: active.sessionToken,
|
|
14620
|
+
toolCallId
|
|
14621
|
+
}).catch(() => {
|
|
14622
|
+
});
|
|
14623
|
+
},
|
|
14624
|
+
[baseUrl, messagesRef, projectId, sessionRef, setMessages]
|
|
14625
|
+
);
|
|
14626
|
+
useEffect5(() => {
|
|
14627
|
+
function reportUnansweredHandoffs() {
|
|
14628
|
+
const active = sessionRef.current;
|
|
14629
|
+
if (!active || handoffPendingRef.current) {
|
|
14630
|
+
return;
|
|
14631
|
+
}
|
|
14632
|
+
for (const offer of readOutstandingHandoffOffers(messagesRef.current)) {
|
|
14633
|
+
void requestHandoff({
|
|
14634
|
+
baseUrl,
|
|
14635
|
+
conversationId: active.conversationId,
|
|
14636
|
+
decision: "unanswered",
|
|
14637
|
+
keepalive: true,
|
|
14638
|
+
projectId,
|
|
14639
|
+
sessionToken: active.sessionToken,
|
|
14640
|
+
toolCallId: offer.toolCallId
|
|
14641
|
+
}).catch(() => {
|
|
14642
|
+
});
|
|
14643
|
+
}
|
|
14644
|
+
}
|
|
14645
|
+
window.addEventListener("pagehide", reportUnansweredHandoffs);
|
|
14646
|
+
return () => {
|
|
14647
|
+
window.removeEventListener("pagehide", reportUnansweredHandoffs);
|
|
14648
|
+
};
|
|
14649
|
+
}, [baseUrl, messagesRef, projectId, sessionRef]);
|
|
14650
|
+
return {
|
|
14651
|
+
confirmHandoff,
|
|
14652
|
+
dismissedHandoffs,
|
|
14653
|
+
dismissHandoff,
|
|
14654
|
+
handoffPending
|
|
14655
|
+
};
|
|
14656
|
+
}
|
|
14657
|
+
|
|
14398
14658
|
// src/lib/support/useInboundMessageChime.ts
|
|
14399
|
-
import { useEffect as
|
|
14659
|
+
import { useEffect as useEffect6, useRef as useRef8 } from "react";
|
|
14400
14660
|
function useInboundMessageChime({
|
|
14401
14661
|
isLoading,
|
|
14402
14662
|
messages
|
|
14403
14663
|
}) {
|
|
14404
|
-
const chimedMessageIdsRef =
|
|
14405
|
-
const inboundChimeSeededRef =
|
|
14406
|
-
|
|
14664
|
+
const chimedMessageIdsRef = useRef8(/* @__PURE__ */ new Set());
|
|
14665
|
+
const inboundChimeSeededRef = useRef8(false);
|
|
14666
|
+
useEffect6(() => {
|
|
14407
14667
|
if (messages.length === 0) {
|
|
14408
14668
|
inboundChimeSeededRef.current = false;
|
|
14409
14669
|
chimedMessageIdsRef.current.clear();
|
|
@@ -14445,9 +14705,9 @@ function useInboundMessageChime({
|
|
|
14445
14705
|
}
|
|
14446
14706
|
|
|
14447
14707
|
// src/lib/support/useOverscrollBounce.ts
|
|
14448
|
-
import { useEffect as
|
|
14708
|
+
import { useEffect as useEffect7 } from "react";
|
|
14449
14709
|
function useOverscrollBounce(ref, enabled, reduceMotion) {
|
|
14450
|
-
|
|
14710
|
+
useEffect7(() => {
|
|
14451
14711
|
const el = ref.current;
|
|
14452
14712
|
if (!el || !enabled || reduceMotion) {
|
|
14453
14713
|
return;
|
|
@@ -14503,13 +14763,13 @@ function useOverscrollBounce(ref, enabled, reduceMotion) {
|
|
|
14503
14763
|
}, [ref, enabled, reduceMotion]);
|
|
14504
14764
|
}
|
|
14505
14765
|
|
|
14506
|
-
// ../../support/shared/src/lib/supportPresenceConstants.ts
|
|
14766
|
+
// ../../support/shared/src/lib/presence/supportPresenceConstants.ts
|
|
14507
14767
|
var SUPPORT_TYPING_TTL_MS = 3e4;
|
|
14508
14768
|
var SUPPORT_TYPING_POLL_INTERVAL_MS = 4e3;
|
|
14509
14769
|
var SUPPORT_TYPING_REFRESH_MS = SUPPORT_TYPING_TTL_MS / 2;
|
|
14510
14770
|
var SUPPORT_TYPING_IDLE_MS = 8e3;
|
|
14511
14771
|
|
|
14512
|
-
// ../../support/shared/src/lib/createTypingPresenceController.ts
|
|
14772
|
+
// ../../support/shared/src/lib/presence/createTypingPresenceController.ts
|
|
14513
14773
|
function createTypingPresenceController({
|
|
14514
14774
|
ping,
|
|
14515
14775
|
isVisible = defaultIsVisible,
|
|
@@ -14628,16 +14888,16 @@ function defaultIsVisible() {
|
|
|
14628
14888
|
}
|
|
14629
14889
|
|
|
14630
14890
|
// src/lib/support/useSupportTypingPresence.ts
|
|
14631
|
-
import { useEffect as
|
|
14891
|
+
import { useEffect as useEffect8, useRef as useRef9, useState as useState5 } from "react";
|
|
14632
14892
|
function useSupportTypingPresence({
|
|
14633
14893
|
baseUrl,
|
|
14634
14894
|
enabled,
|
|
14635
14895
|
projectId,
|
|
14636
14896
|
session
|
|
14637
14897
|
}) {
|
|
14638
|
-
const [typing, setTyping] =
|
|
14639
|
-
const controllerRef =
|
|
14640
|
-
|
|
14898
|
+
const [typing, setTyping] = useState5([]);
|
|
14899
|
+
const controllerRef = useRef9(null);
|
|
14900
|
+
useEffect8(() => {
|
|
14641
14901
|
if (!enabled || !session) {
|
|
14642
14902
|
setTyping([]);
|
|
14643
14903
|
controllerRef.current = null;
|
|
@@ -14671,14 +14931,192 @@ function useSupportTypingPresence({
|
|
|
14671
14931
|
};
|
|
14672
14932
|
}
|
|
14673
14933
|
|
|
14934
|
+
// src/lib/support/useVisitorConversationPersistence.ts
|
|
14935
|
+
import { useCallback as useCallback6, useEffect as useEffect9, useRef as useRef10, useState as useState6 } from "react";
|
|
14936
|
+
function useVisitorConversationPersistence({
|
|
14937
|
+
baseUrl,
|
|
14938
|
+
emailStorageKey,
|
|
14939
|
+
identity: identity2,
|
|
14940
|
+
onIdentityWipe,
|
|
14941
|
+
onResumed,
|
|
14942
|
+
projectId,
|
|
14943
|
+
sessionRef,
|
|
14944
|
+
storageKey,
|
|
14945
|
+
userJwt: userJwt2
|
|
14946
|
+
}) {
|
|
14947
|
+
const [session, setSessionState] = useState6(null);
|
|
14948
|
+
const [sessionHistory, setSessionHistory] = useState6([]);
|
|
14949
|
+
const [capturedEmail, setCapturedEmail] = useState6(null);
|
|
14950
|
+
const identityRef = useRef10(identity2);
|
|
14951
|
+
const userJwtRef = useRef10(userJwt2);
|
|
14952
|
+
const onIdentityWipeRef = useRef10(onIdentityWipe);
|
|
14953
|
+
const onResumedRef = useRef10(onResumed);
|
|
14954
|
+
const generationRef = useRef10(0);
|
|
14955
|
+
const pendingForgetRef = useRef10(Promise.resolve());
|
|
14956
|
+
const previousVisitorRef = useRef10(null);
|
|
14957
|
+
identityRef.current = identity2;
|
|
14958
|
+
userJwtRef.current = userJwt2;
|
|
14959
|
+
onIdentityWipeRef.current = onIdentityWipe;
|
|
14960
|
+
onResumedRef.current = onResumed;
|
|
14961
|
+
const visitorKey = `${userJwt2 ?? ""}\0${identity2?.distinctId ?? ""}\0${identity2?.email ?? ""}`;
|
|
14962
|
+
const setSession = useCallback6(
|
|
14963
|
+
(next) => {
|
|
14964
|
+
sessionRef.current = next;
|
|
14965
|
+
setSessionState(next);
|
|
14966
|
+
},
|
|
14967
|
+
[sessionRef]
|
|
14968
|
+
);
|
|
14969
|
+
const refreshSessionHistory = useCallback6(() => {
|
|
14970
|
+
const generation = generationRef.current;
|
|
14971
|
+
void (async () => {
|
|
14972
|
+
try {
|
|
14973
|
+
const rows = await listConversations({
|
|
14974
|
+
baseUrl,
|
|
14975
|
+
distinctId: identityRef.current?.distinctId,
|
|
14976
|
+
projectId,
|
|
14977
|
+
userJwt: userJwtRef.current ?? void 0
|
|
14978
|
+
});
|
|
14979
|
+
if (generation !== generationRef.current) {
|
|
14980
|
+
return;
|
|
14981
|
+
}
|
|
14982
|
+
setSessionHistory(toHistoryEntries(rows));
|
|
14983
|
+
} catch {
|
|
14984
|
+
if (generation !== generationRef.current) {
|
|
14985
|
+
return;
|
|
14986
|
+
}
|
|
14987
|
+
setSessionHistory(readSessionHistory(storageKey));
|
|
14988
|
+
}
|
|
14989
|
+
})();
|
|
14990
|
+
}, [baseUrl, projectId, storageKey]);
|
|
14991
|
+
useEffect9(() => {
|
|
14992
|
+
const stored = readStoredSession(storageKey);
|
|
14993
|
+
sessionRef.current = stored;
|
|
14994
|
+
setSessionState(stored);
|
|
14995
|
+
if (stored) {
|
|
14996
|
+
ensureActiveSessionInHistory(storageKey, stored);
|
|
14997
|
+
}
|
|
14998
|
+
try {
|
|
14999
|
+
const email = window.localStorage.getItem(emailStorageKey);
|
|
15000
|
+
if (email) {
|
|
15001
|
+
setCapturedEmail(email);
|
|
15002
|
+
}
|
|
15003
|
+
} catch {
|
|
15004
|
+
}
|
|
15005
|
+
}, [emailStorageKey, sessionRef, storageKey]);
|
|
15006
|
+
useEffect9(() => {
|
|
15007
|
+
const controller = new AbortController();
|
|
15008
|
+
generationRef.current += 1;
|
|
15009
|
+
const generation = generationRef.current;
|
|
15010
|
+
const ownerId = identityRef.current?.distinctId ?? identityRef.current?.email ?? null;
|
|
15011
|
+
const jwtPresent = Boolean(userJwtRef.current);
|
|
15012
|
+
const previous = previousVisitorRef.current;
|
|
15013
|
+
previousVisitorRef.current = { jwtPresent, ownerId };
|
|
15014
|
+
let wiped = false;
|
|
15015
|
+
if (ownerId) {
|
|
15016
|
+
wiped = reconcileSessionOwner(storageKey, ownerId).cleared;
|
|
15017
|
+
} else if (previous && (previous.ownerId || previous.jwtPresent) && !jwtPresent) {
|
|
15018
|
+
clearChatStorage(storageKey);
|
|
15019
|
+
wiped = true;
|
|
15020
|
+
}
|
|
15021
|
+
if (wiped) {
|
|
15022
|
+
sessionRef.current = null;
|
|
15023
|
+
setSessionState(null);
|
|
15024
|
+
setSessionHistory([]);
|
|
15025
|
+
try {
|
|
15026
|
+
window.localStorage.removeItem(emailStorageKey);
|
|
15027
|
+
} catch {
|
|
15028
|
+
}
|
|
15029
|
+
setCapturedEmail(null);
|
|
15030
|
+
onIdentityWipeRef.current();
|
|
15031
|
+
pendingForgetRef.current = (async () => {
|
|
15032
|
+
try {
|
|
15033
|
+
await forgetVisitorSession({ baseUrl, projectId });
|
|
15034
|
+
} catch {
|
|
15035
|
+
}
|
|
15036
|
+
})();
|
|
15037
|
+
}
|
|
15038
|
+
async function sync() {
|
|
15039
|
+
await pendingForgetRef.current;
|
|
15040
|
+
if (controller.signal.aborted) {
|
|
15041
|
+
return;
|
|
15042
|
+
}
|
|
15043
|
+
const distinctId = identityRef.current?.distinctId;
|
|
15044
|
+
const jwt = userJwtRef.current ?? void 0;
|
|
15045
|
+
const [listResult, resumeResult] = await Promise.allSettled([
|
|
15046
|
+
listConversations({
|
|
15047
|
+
baseUrl,
|
|
15048
|
+
distinctId,
|
|
15049
|
+
projectId,
|
|
15050
|
+
userJwt: jwt
|
|
15051
|
+
}),
|
|
15052
|
+
resumeSession({
|
|
15053
|
+
baseUrl,
|
|
15054
|
+
distinctId,
|
|
15055
|
+
projectId,
|
|
15056
|
+
userJwt: jwt
|
|
15057
|
+
})
|
|
15058
|
+
]);
|
|
15059
|
+
if (controller.signal.aborted || generation !== generationRef.current) {
|
|
15060
|
+
return;
|
|
15061
|
+
}
|
|
15062
|
+
if (listResult.status === "fulfilled") {
|
|
15063
|
+
setSessionHistory(toHistoryEntries(listResult.value));
|
|
15064
|
+
} else {
|
|
15065
|
+
setSessionHistory(readSessionHistory(storageKey));
|
|
15066
|
+
}
|
|
15067
|
+
if (resumeResult.status !== "fulfilled" || !resumeResult.value) {
|
|
15068
|
+
return;
|
|
15069
|
+
}
|
|
15070
|
+
const resumed = resumeResult.value;
|
|
15071
|
+
const next = {
|
|
15072
|
+
conversationId: resumed.conversationId,
|
|
15073
|
+
sessionToken: resumed.sessionToken
|
|
15074
|
+
};
|
|
15075
|
+
sessionRef.current = next;
|
|
15076
|
+
setSessionState(next);
|
|
15077
|
+
storeSession(storageKey, next);
|
|
15078
|
+
ensureActiveSessionInHistory(storageKey, next);
|
|
15079
|
+
onResumedRef.current(resumed.conversation);
|
|
15080
|
+
}
|
|
15081
|
+
void sync();
|
|
15082
|
+
return () => {
|
|
15083
|
+
controller.abort();
|
|
15084
|
+
};
|
|
15085
|
+
}, [baseUrl, emailStorageKey, projectId, sessionRef, storageKey, visitorKey]);
|
|
15086
|
+
return {
|
|
15087
|
+
capturedEmail,
|
|
15088
|
+
refreshSessionHistory,
|
|
15089
|
+
session,
|
|
15090
|
+
sessionHistory,
|
|
15091
|
+
setCapturedEmail,
|
|
15092
|
+
setSession
|
|
15093
|
+
};
|
|
15094
|
+
}
|
|
15095
|
+
function toHistoryEntries(rows) {
|
|
15096
|
+
return rows.map((row) => ({
|
|
15097
|
+
conversationId: row.conversationId,
|
|
15098
|
+
preview: row.preview,
|
|
15099
|
+
sessionToken: row.sessionToken,
|
|
15100
|
+
updatedAt: row.updatedAt
|
|
15101
|
+
}));
|
|
15102
|
+
}
|
|
15103
|
+
|
|
14674
15104
|
// src/lib/support/useWidgetFrameSizing.ts
|
|
14675
|
-
import { useLayoutEffect as useLayoutEffect2, useRef as
|
|
15105
|
+
import { useLayoutEffect as useLayoutEffect2, useRef as useRef11, useState as useState7 } from "react";
|
|
14676
15106
|
|
|
14677
15107
|
// src/lib/support/widget-sizing.ts
|
|
14678
15108
|
var BRANDING_CACHE_PREFIX = "saasco-chat-branding:";
|
|
15109
|
+
var sizeToIframeViewport = false;
|
|
14679
15110
|
function brandingCacheKey(projectId) {
|
|
14680
15111
|
return `${BRANDING_CACHE_PREFIX}${projectId}`;
|
|
14681
15112
|
}
|
|
15113
|
+
function widgetSessionStorageKeys(projectId, preview) {
|
|
15114
|
+
const slot = preview ? `preview:${projectId}` : projectId;
|
|
15115
|
+
return {
|
|
15116
|
+
emailStorageKey: `saasco-chat-email:${slot}`,
|
|
15117
|
+
storageKey: `saasco-chat-session:${slot}`
|
|
15118
|
+
};
|
|
15119
|
+
}
|
|
14682
15120
|
function readBrandingCache(projectId) {
|
|
14683
15121
|
try {
|
|
14684
15122
|
const raw = window.sessionStorage.getItem(brandingCacheKey(projectId));
|
|
@@ -14710,6 +15148,9 @@ function resolveSizingViewport() {
|
|
|
14710
15148
|
if (host) {
|
|
14711
15149
|
return host;
|
|
14712
15150
|
}
|
|
15151
|
+
if (sizeToIframeViewport && typeof window !== "undefined") {
|
|
15152
|
+
return { height: window.innerHeight, width: window.innerWidth };
|
|
15153
|
+
}
|
|
14713
15154
|
if (isCrossOriginEmbed()) {
|
|
14714
15155
|
return {
|
|
14715
15156
|
height: PANEL_MAX_HEIGHT_PX + PANEL_VERTICAL_RESERVE_PX,
|
|
@@ -14718,20 +15159,29 @@ function resolveSizingViewport() {
|
|
|
14718
15159
|
}
|
|
14719
15160
|
return { height: window.innerHeight, width: window.innerWidth };
|
|
14720
15161
|
}
|
|
14721
|
-
function
|
|
15162
|
+
function widgetScale() {
|
|
15163
|
+
if (sizeToIframeViewport) {
|
|
15164
|
+
return { effectiveWidth: PANEL_WIDTH_PX, isMobile: false, scale: 1 };
|
|
15165
|
+
}
|
|
14722
15166
|
const host = getHostViewport();
|
|
14723
15167
|
if (host) {
|
|
14724
|
-
return host
|
|
15168
|
+
return readWidgetScaleMetrics(host);
|
|
14725
15169
|
}
|
|
14726
15170
|
if (isCrossOriginEmbed()) {
|
|
14727
|
-
return false;
|
|
15171
|
+
return { effectiveWidth: 0, isMobile: false, scale: 1 };
|
|
14728
15172
|
}
|
|
14729
|
-
return
|
|
15173
|
+
return readWidgetScaleMetrics();
|
|
15174
|
+
}
|
|
15175
|
+
function isDashboardPreview() {
|
|
15176
|
+
return sizeToIframeViewport;
|
|
14730
15177
|
}
|
|
14731
15178
|
function clampPanelDimensions(viewport, fullscreen) {
|
|
14732
15179
|
if (fullscreen) {
|
|
14733
15180
|
return { height: viewport.height, width: viewport.width };
|
|
14734
15181
|
}
|
|
15182
|
+
if (sizeToIframeViewport) {
|
|
15183
|
+
return { height: PANEL_MAX_HEIGHT_PX, width: PANEL_WIDTH_PX };
|
|
15184
|
+
}
|
|
14735
15185
|
return {
|
|
14736
15186
|
height: Math.min(
|
|
14737
15187
|
PANEL_MAX_HEIGHT_PX,
|
|
@@ -14744,21 +15194,30 @@ function clampPanelDimensions(viewport, fullscreen) {
|
|
|
14744
15194
|
};
|
|
14745
15195
|
}
|
|
14746
15196
|
function computeFrameDimensions(isOpen) {
|
|
15197
|
+
const { isMobile, scale: scale2 } = widgetScale();
|
|
15198
|
+
const hostOwnsLauncher2 = getHostOwnsLauncher();
|
|
14747
15199
|
if (!isOpen) {
|
|
14748
|
-
|
|
14749
|
-
fullscreen: false,
|
|
14750
|
-
|
|
14751
|
-
|
|
14752
|
-
};
|
|
15200
|
+
if (hostOwnsLauncher2) {
|
|
15201
|
+
return { fullscreen: false, height: 0, width: 0 };
|
|
15202
|
+
}
|
|
15203
|
+
const closed = closedFrameSizePx(scale2);
|
|
15204
|
+
return { fullscreen: false, height: closed, width: closed };
|
|
14753
15205
|
}
|
|
14754
|
-
const fullscreen =
|
|
15206
|
+
const fullscreen = isMobile;
|
|
14755
15207
|
const panel = clampPanelDimensions(resolveSizingViewport(), fullscreen);
|
|
14756
15208
|
if (fullscreen) {
|
|
14757
15209
|
return { fullscreen: true, height: panel.height, width: panel.width };
|
|
14758
15210
|
}
|
|
15211
|
+
if (hostOwnsLauncher2) {
|
|
15212
|
+
return {
|
|
15213
|
+
fullscreen: false,
|
|
15214
|
+
height: panel.height,
|
|
15215
|
+
width: panel.width
|
|
15216
|
+
};
|
|
15217
|
+
}
|
|
14759
15218
|
return {
|
|
14760
15219
|
fullscreen: false,
|
|
14761
|
-
height: ROOT_PADDING_PX + panel.height + ROOT_STACK_GAP_PX +
|
|
15220
|
+
height: ROOT_PADDING_PX + panel.height + ROOT_STACK_GAP_PX + launcherButtonPx(scale2) + ROOT_PADDING_PX,
|
|
14762
15221
|
width: panel.width + ROOT_HORIZONTAL_PADDING_PX
|
|
14763
15222
|
};
|
|
14764
15223
|
}
|
|
@@ -14768,10 +15227,10 @@ function useWidgetFrameSizing({
|
|
|
14768
15227
|
isOpen,
|
|
14769
15228
|
rootElRef
|
|
14770
15229
|
}) {
|
|
14771
|
-
const isOpenRef =
|
|
15230
|
+
const isOpenRef = useRef11(isOpen);
|
|
14772
15231
|
isOpenRef.current = isOpen;
|
|
14773
|
-
const syncFrameRef =
|
|
14774
|
-
const [isMobile, setIsMobile] =
|
|
15232
|
+
const syncFrameRef = useRef11(null);
|
|
15233
|
+
const [isMobile, setIsMobile] = useState7(false);
|
|
14775
15234
|
useLayoutEffect2(() => {
|
|
14776
15235
|
const rootEl = rootElRef.current;
|
|
14777
15236
|
if (!rootEl) {
|
|
@@ -14779,7 +15238,7 @@ function useWidgetFrameSizing({
|
|
|
14779
15238
|
}
|
|
14780
15239
|
const syncPanelVars = () => {
|
|
14781
15240
|
const sizingViewport = resolveSizingViewport();
|
|
14782
|
-
const mobile =
|
|
15241
|
+
const { isMobile: mobile, scale: scale2 } = widgetScale();
|
|
14783
15242
|
setIsMobile(mobile);
|
|
14784
15243
|
const panel = clampPanelDimensions(sizingViewport, mobile);
|
|
14785
15244
|
rootEl.style.setProperty("--scw-panel-width", `${panel.width}px`);
|
|
@@ -14788,8 +15247,19 @@ function useWidgetFrameSizing({
|
|
|
14788
15247
|
"--scw-host-viewport-width",
|
|
14789
15248
|
`${sizingViewport.width}px`
|
|
14790
15249
|
);
|
|
15250
|
+
rootEl.style.setProperty(
|
|
15251
|
+
"--scw-launcher-size",
|
|
15252
|
+
`${launcherButtonPx(scale2)}px`
|
|
15253
|
+
);
|
|
15254
|
+
rootEl.style.setProperty(
|
|
15255
|
+
"--scw-launcher-icon-size",
|
|
15256
|
+
`${scaledPx(LAUNCHER_ICON_BASE_PX, scale2)}px`
|
|
15257
|
+
);
|
|
14791
15258
|
};
|
|
14792
15259
|
const syncFrameSize = () => {
|
|
15260
|
+
if (isDashboardPreview()) {
|
|
15261
|
+
return;
|
|
15262
|
+
}
|
|
14793
15263
|
const computed = computeFrameDimensions(isOpenRef.current);
|
|
14794
15264
|
if (isCrossOriginEmbed()) {
|
|
14795
15265
|
postResize(
|
|
@@ -14797,6 +15267,7 @@ function useWidgetFrameSizing({
|
|
|
14797
15267
|
Math.ceil(computed.height),
|
|
14798
15268
|
computed.fullscreen
|
|
14799
15269
|
);
|
|
15270
|
+
postOpenState(isOpenRef.current, computed.fullscreen);
|
|
14800
15271
|
return;
|
|
14801
15272
|
}
|
|
14802
15273
|
const rect = rootEl.getBoundingClientRect();
|
|
@@ -14872,15 +15343,18 @@ function resumeConversationAction({
|
|
|
14872
15343
|
}
|
|
14873
15344
|
|
|
14874
15345
|
// src/lib/support/widgetConversationDerived.ts
|
|
15346
|
+
import { isToolUIPart as isToolUIPart3 } from "ai";
|
|
14875
15347
|
function deriveShowThinking({
|
|
14876
15348
|
isLoading,
|
|
14877
15349
|
messages,
|
|
14878
15350
|
pendingSize
|
|
14879
15351
|
}) {
|
|
14880
15352
|
const lastMessage = messages.at(-1);
|
|
14881
|
-
const lastMessageHasLiveTools = lastMessage ? messageHasLiveTools(lastMessage) : false;
|
|
14882
15353
|
const lastMessageIsAnswering = lastMessage ? isAssistantAnswering(lastMessage) : false;
|
|
14883
|
-
|
|
15354
|
+
const awaitingApproval = pendingSize > 0 || (lastMessage?.parts ?? []).some(
|
|
15355
|
+
(part) => isToolUIPart3(part) && part.state === "approval-requested"
|
|
15356
|
+
);
|
|
15357
|
+
return isLoading && !lastMessageIsAnswering && !awaitingApproval;
|
|
14884
15358
|
}
|
|
14885
15359
|
function deriveIsLoadingMessages({
|
|
14886
15360
|
isChat,
|
|
@@ -14906,9 +15380,20 @@ function resolveActiveTransition(reduceMotion, viewTransition) {
|
|
|
14906
15380
|
}
|
|
14907
15381
|
return viewTransition;
|
|
14908
15382
|
}
|
|
15383
|
+
function shouldShowWaitingForTeammate({
|
|
15384
|
+
agentMuted,
|
|
15385
|
+
conversationState,
|
|
15386
|
+
isTyping,
|
|
15387
|
+
messages
|
|
15388
|
+
}) {
|
|
15389
|
+
if (!agentMuted || isTyping || conversationState === "closed") {
|
|
15390
|
+
return false;
|
|
15391
|
+
}
|
|
15392
|
+
return messages.at(-1)?.role === "user";
|
|
15393
|
+
}
|
|
14909
15394
|
|
|
14910
15395
|
// src/lib/support/WidgetLauncher.tsx
|
|
14911
|
-
import { useCallback as
|
|
15396
|
+
import { useCallback as useCallback7, useRef as useRef12 } from "react";
|
|
14912
15397
|
|
|
14913
15398
|
// src/lib/support/LauncherIcon.tsx
|
|
14914
15399
|
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
@@ -14919,7 +15404,7 @@ function LauncherIcon({
|
|
|
14919
15404
|
const transition = reduceMotion ? { duration: 0 } : LAUNCHER_ICON_TRANSITION;
|
|
14920
15405
|
const exitRotate = isOpen ? -LAUNCHER_ICON_ROTATE_DEG : LAUNCHER_ICON_ROTATE_DEG;
|
|
14921
15406
|
const enterRotate = isOpen ? LAUNCHER_ICON_ROTATE_DEG : -LAUNCHER_ICON_ROTATE_DEG;
|
|
14922
|
-
return /* @__PURE__ */ jsx10("span", { className: "relative flex size-[25px] shrink-0 items-center justify-center overflow-visible [&_svg]:block [&_svg]:shrink-0", children: /* @__PURE__ */ jsx10(AnimatePresence, { initial: false, children: /* @__PURE__ */ jsx10(
|
|
15407
|
+
return /* @__PURE__ */ jsx10("span", { className: "relative flex size-[var(--scw-launcher-icon-size,25px)] shrink-0 items-center justify-center overflow-visible [&_svg]:block [&_svg]:size-full [&_svg]:shrink-0", children: /* @__PURE__ */ jsx10(AnimatePresence, { initial: false, children: /* @__PURE__ */ jsx10(
|
|
14923
15408
|
motion.span,
|
|
14924
15409
|
{
|
|
14925
15410
|
animate: { opacity: 1, rotate: 0, scale: 1 },
|
|
@@ -14942,13 +15427,14 @@ function WidgetLauncher({
|
|
|
14942
15427
|
onClose
|
|
14943
15428
|
}) {
|
|
14944
15429
|
const isEmbedded = isCrossOriginEmbed();
|
|
14945
|
-
const
|
|
15430
|
+
const hostOwnsLauncher2 = getHostOwnsLauncher();
|
|
15431
|
+
const launcherPointerRef = useRef12({ hovered: false, pressed: false });
|
|
14946
15432
|
const launcherButtonTransition = reduceMotion ? { duration: 0 } : LAUNCHER_BUTTON_TRANSITION;
|
|
14947
|
-
const syncLauncherState =
|
|
15433
|
+
const syncLauncherState = useCallback7(
|
|
14948
15434
|
(next) => {
|
|
14949
15435
|
const state = { ...launcherPointerRef.current, ...next };
|
|
14950
15436
|
launcherPointerRef.current = state;
|
|
14951
|
-
if (!isEmbedded) {
|
|
15437
|
+
if (!isEmbedded || hostOwnsLauncher2) {
|
|
14952
15438
|
return;
|
|
14953
15439
|
}
|
|
14954
15440
|
postLauncherState(
|
|
@@ -14956,18 +15442,21 @@ function WidgetLauncher({
|
|
|
14956
15442
|
state.hovered
|
|
14957
15443
|
);
|
|
14958
15444
|
},
|
|
14959
|
-
[isEmbedded, reduceMotion]
|
|
15445
|
+
[hostOwnsLauncher2, isEmbedded, reduceMotion]
|
|
14960
15446
|
);
|
|
14961
15447
|
return /* @__PURE__ */ jsx11(
|
|
14962
15448
|
motion.button,
|
|
14963
15449
|
{
|
|
14964
15450
|
"aria-label": isOpen ? "Close chat" : "Open chat",
|
|
14965
15451
|
className: cn(
|
|
14966
|
-
|
|
14967
|
-
|
|
15452
|
+
// Sized from the host viewport (see useWidgetFrameSizing) so the bubble
|
|
15453
|
+
// keeps its footing on a wide phone — and stays exactly as tall as the
|
|
15454
|
+
// social-proof toast that anchors beside it.
|
|
15455
|
+
"flex size-[var(--scw-launcher-size,60px)] shrink-0 origin-center cursor-pointer items-center justify-center rounded-full border-none bg-white text-neutral-900 outline-none [-webkit-tap-highlight-color:transparent]",
|
|
15456
|
+
isEmbedded ? "shadow-[inset_0_0_0_1px_var(--scw-hairline)]" : "shadow-[0_0_0_1px_var(--scw-hairline),0_4px_12px_-2px_rgba(0,0,0,.12),0_2px_4px_-2px_rgba(0,0,0,.08)]",
|
|
14968
15457
|
"transition-[background-color,box-shadow] duration-[280ms] ease-[cubic-bezier(.32,.72,0,1)]",
|
|
14969
15458
|
!reduceMotion && "hover:bg-neutral-100",
|
|
14970
|
-
!reduceMotion && (isEmbedded ? "hover:shadow-[
|
|
15459
|
+
!reduceMotion && (isEmbedded ? "hover:shadow-[inset_0_0_0_1px_var(--scw-hairline-strong)]" : "hover:shadow-[0_0_0_1px_var(--scw-hairline-strong),0_4px_12px_-2px_rgba(0,0,0,.14),0_2px_4px_-2px_rgba(0,0,0,.1)]")
|
|
14971
15460
|
),
|
|
14972
15461
|
onClick: isOpen ? onClose : onOpen,
|
|
14973
15462
|
onHoverEnd: () => syncLauncherState({ hovered: false }),
|
|
@@ -15004,7 +15493,7 @@ function Avatar({
|
|
|
15004
15493
|
large
|
|
15005
15494
|
}) {
|
|
15006
15495
|
const base = cn(
|
|
15007
|
-
"inline-flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-full bg-neutral-900 text-sm font-semibold text-white shadow-[
|
|
15496
|
+
"inline-flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-full bg-neutral-900 text-sm font-semibold text-white shadow-[0_0_0_1px_var(--scw-ink)]",
|
|
15008
15497
|
large && "size-12 text-lg",
|
|
15009
15498
|
"[&_img]:block [&_img]:size-full [&_img]:scale-[1.08] [&_img]:object-cover"
|
|
15010
15499
|
);
|
|
@@ -15026,9 +15515,124 @@ function Avatar({
|
|
|
15026
15515
|
}
|
|
15027
15516
|
|
|
15028
15517
|
// src/lib/support/CompactTime.tsx
|
|
15029
|
-
import { useEffect as
|
|
15518
|
+
import { useEffect as useEffect11, useState as useState9 } from "react";
|
|
15519
|
+
|
|
15520
|
+
// ../../support/shared/src/lib/message/splitLightMarkdownBlocks.ts
|
|
15521
|
+
var DELIMITER_CELL_PATTERN = /^:?-+:?$/u;
|
|
15522
|
+
function splitLightMarkdownBlocks(text) {
|
|
15523
|
+
if (!text.includes("|")) {
|
|
15524
|
+
return text ? [{ type: "text", text }] : [];
|
|
15525
|
+
}
|
|
15526
|
+
const lines = text.split(/\r?\n/u);
|
|
15527
|
+
const blocks = [];
|
|
15528
|
+
const pending = [];
|
|
15529
|
+
let index2 = 0;
|
|
15530
|
+
while (index2 < lines.length) {
|
|
15531
|
+
const parsed = readTableAt(lines, index2);
|
|
15532
|
+
if (!parsed) {
|
|
15533
|
+
pending.push(lines[index2] ?? "");
|
|
15534
|
+
index2 += 1;
|
|
15535
|
+
continue;
|
|
15536
|
+
}
|
|
15537
|
+
flushPendingText(blocks, pending);
|
|
15538
|
+
blocks.push({ type: "table", table: parsed.table });
|
|
15539
|
+
index2 = parsed.end;
|
|
15540
|
+
}
|
|
15541
|
+
flushPendingText(blocks, pending);
|
|
15542
|
+
return blocks;
|
|
15543
|
+
}
|
|
15544
|
+
function flushPendingText(blocks, pending) {
|
|
15545
|
+
if (pending.length === 0) {
|
|
15546
|
+
return;
|
|
15547
|
+
}
|
|
15548
|
+
blocks.push({ type: "text", text: pending.join("\n") });
|
|
15549
|
+
pending.length = 0;
|
|
15550
|
+
}
|
|
15551
|
+
function readTableAt(lines, start) {
|
|
15552
|
+
const headers = splitTableCells(lines[start] ?? "");
|
|
15553
|
+
const delimiter = splitTableCells(lines[start + 1] ?? "");
|
|
15554
|
+
if (!headers || !delimiter || headers.length === 0 || delimiter.length !== headers.length || !delimiter.every(isDelimiterCell)) {
|
|
15555
|
+
return null;
|
|
15556
|
+
}
|
|
15557
|
+
const rows = [];
|
|
15558
|
+
let end = start + 2;
|
|
15559
|
+
while (end < lines.length) {
|
|
15560
|
+
const row = splitTableCells(lines[end] ?? "");
|
|
15561
|
+
if (!row) {
|
|
15562
|
+
break;
|
|
15563
|
+
}
|
|
15564
|
+
rows.push(fitRow(row, headers.length));
|
|
15565
|
+
end += 1;
|
|
15566
|
+
}
|
|
15567
|
+
return {
|
|
15568
|
+
end,
|
|
15569
|
+
table: {
|
|
15570
|
+
aligns: delimiter.map(alignFromDelimiterCell),
|
|
15571
|
+
headers: fitRow(headers, headers.length),
|
|
15572
|
+
rows
|
|
15573
|
+
}
|
|
15574
|
+
};
|
|
15575
|
+
}
|
|
15576
|
+
function splitTableCells(line) {
|
|
15577
|
+
if (!line.includes("|")) {
|
|
15578
|
+
return null;
|
|
15579
|
+
}
|
|
15580
|
+
const cells = [];
|
|
15581
|
+
let current = "";
|
|
15582
|
+
const trimmed = trimOuterPipes(line.trim());
|
|
15583
|
+
for (let index2 = 0; index2 < trimmed.length; index2 += 1) {
|
|
15584
|
+
const char = trimmed[index2];
|
|
15585
|
+
if (char === "\\" && trimmed[index2 + 1] === "|") {
|
|
15586
|
+
current += "|";
|
|
15587
|
+
index2 += 1;
|
|
15588
|
+
continue;
|
|
15589
|
+
}
|
|
15590
|
+
if (char === "|") {
|
|
15591
|
+
cells.push(current.trim());
|
|
15592
|
+
current = "";
|
|
15593
|
+
continue;
|
|
15594
|
+
}
|
|
15595
|
+
current += char;
|
|
15596
|
+
}
|
|
15597
|
+
cells.push(current.trim());
|
|
15598
|
+
return cells;
|
|
15599
|
+
}
|
|
15600
|
+
function trimOuterPipes(line) {
|
|
15601
|
+
let start = 0;
|
|
15602
|
+
let end = line.length;
|
|
15603
|
+
if (line.startsWith("|")) {
|
|
15604
|
+
start = 1;
|
|
15605
|
+
}
|
|
15606
|
+
if (line.endsWith("|") && !line.endsWith("\\|")) {
|
|
15607
|
+
end -= 1;
|
|
15608
|
+
}
|
|
15609
|
+
return line.slice(start, end);
|
|
15610
|
+
}
|
|
15611
|
+
function isDelimiterCell(cell) {
|
|
15612
|
+
const compact = cell.replaceAll(" ", "");
|
|
15613
|
+
return DELIMITER_CELL_PATTERN.test(compact) && compact.includes("-");
|
|
15614
|
+
}
|
|
15615
|
+
function alignFromDelimiterCell(cell) {
|
|
15616
|
+
const compact = cell.replaceAll(" ", "");
|
|
15617
|
+
const left = compact.startsWith(":");
|
|
15618
|
+
const right = compact.endsWith(":");
|
|
15619
|
+
if (left && right) {
|
|
15620
|
+
return "center";
|
|
15621
|
+
}
|
|
15622
|
+
if (right) {
|
|
15623
|
+
return "right";
|
|
15624
|
+
}
|
|
15625
|
+
return "left";
|
|
15626
|
+
}
|
|
15627
|
+
function fitRow(cells, columnCount) {
|
|
15628
|
+
const row = cells.slice(0, columnCount);
|
|
15629
|
+
while (row.length < columnCount) {
|
|
15630
|
+
row.push("");
|
|
15631
|
+
}
|
|
15632
|
+
return row;
|
|
15633
|
+
}
|
|
15030
15634
|
|
|
15031
|
-
// ../../support/shared/src/lib/formatBotMessageContentForInbox.ts
|
|
15635
|
+
// ../../support/shared/src/lib/message/formatBotMessageContentForInbox.ts
|
|
15032
15636
|
var ATX_HEADING_PATTERN = /^#{1,6}[ \t]+(.+)$/gmu;
|
|
15033
15637
|
function normalizeMarkdownHeadings(text) {
|
|
15034
15638
|
return text.replace(ATX_HEADING_PATTERN, (_match, content) => {
|
|
@@ -15044,10 +15648,10 @@ function normalizeMarkdownHeadings(text) {
|
|
|
15044
15648
|
}
|
|
15045
15649
|
|
|
15046
15650
|
// src/lib/support/message-render.tsx
|
|
15047
|
-
import { getToolName as getToolName3, isToolUIPart as
|
|
15651
|
+
import { getToolName as getToolName3, isToolUIPart as isToolUIPart4 } from "ai";
|
|
15048
15652
|
|
|
15049
15653
|
// src/lib/support/KbCitationBadge.tsx
|
|
15050
|
-
import { useCallback as
|
|
15654
|
+
import { useCallback as useCallback8, useEffect as useEffect10, useRef as useRef13, useState as useState8 } from "react";
|
|
15051
15655
|
|
|
15052
15656
|
// src/lib/support/hostname.ts
|
|
15053
15657
|
function readHostnameFromHref(href) {
|
|
@@ -15069,20 +15673,20 @@ function KbCitationBadge({
|
|
|
15069
15673
|
number: number2
|
|
15070
15674
|
}) {
|
|
15071
15675
|
const hostname = readHostnameFromHref(article.url);
|
|
15072
|
-
const [open, setOpen] =
|
|
15073
|
-
const closeTimeoutRef =
|
|
15074
|
-
const rootRef =
|
|
15075
|
-
const popoverRef =
|
|
15676
|
+
const [open, setOpen] = useState8(false);
|
|
15677
|
+
const closeTimeoutRef = useRef13(null);
|
|
15678
|
+
const rootRef = useRef13(null);
|
|
15679
|
+
const popoverRef = useRef13(null);
|
|
15076
15680
|
function clearCloseTimeout() {
|
|
15077
15681
|
if (closeTimeoutRef.current) {
|
|
15078
15682
|
clearTimeout(closeTimeoutRef.current);
|
|
15079
15683
|
closeTimeoutRef.current = null;
|
|
15080
15684
|
}
|
|
15081
15685
|
}
|
|
15082
|
-
const resetPopoverShift =
|
|
15686
|
+
const resetPopoverShift = useCallback8(() => {
|
|
15083
15687
|
popoverRef.current?.style.removeProperty("--scw-citation-popover-shift");
|
|
15084
15688
|
}, []);
|
|
15085
|
-
const alignPopover =
|
|
15689
|
+
const alignPopover = useCallback8(() => {
|
|
15086
15690
|
const root = rootRef.current;
|
|
15087
15691
|
const popover = popoverRef.current;
|
|
15088
15692
|
if (!root || !popover) {
|
|
@@ -15110,13 +15714,13 @@ function KbCitationBadge({
|
|
|
15110
15714
|
shift === 0 ? "0px" : `${shift}px`
|
|
15111
15715
|
);
|
|
15112
15716
|
}, [resetPopoverShift]);
|
|
15113
|
-
const attachPopoverListeners =
|
|
15717
|
+
const attachPopoverListeners = useCallback8(() => {
|
|
15114
15718
|
alignPopover();
|
|
15115
15719
|
const scroller = rootRef.current?.closest(".scw-messages");
|
|
15116
15720
|
scroller?.addEventListener("scroll", alignPopover, { passive: true });
|
|
15117
15721
|
window.addEventListener("resize", alignPopover, { passive: true });
|
|
15118
15722
|
}, [alignPopover]);
|
|
15119
|
-
const detachPopoverListeners =
|
|
15723
|
+
const detachPopoverListeners = useCallback8(() => {
|
|
15120
15724
|
const scroller = rootRef.current?.closest(".scw-messages");
|
|
15121
15725
|
scroller?.removeEventListener("scroll", alignPopover);
|
|
15122
15726
|
window.removeEventListener("resize", alignPopover);
|
|
@@ -15133,7 +15737,7 @@ function KbCitationBadge({
|
|
|
15133
15737
|
closeTimeoutRef.current = null;
|
|
15134
15738
|
}, 80);
|
|
15135
15739
|
}
|
|
15136
|
-
|
|
15740
|
+
useEffect10(() => {
|
|
15137
15741
|
if (!open) {
|
|
15138
15742
|
detachPopoverListeners();
|
|
15139
15743
|
return;
|
|
@@ -15141,7 +15745,7 @@ function KbCitationBadge({
|
|
|
15141
15745
|
attachPopoverListeners();
|
|
15142
15746
|
return detachPopoverListeners;
|
|
15143
15747
|
}, [open, attachPopoverListeners, detachPopoverListeners]);
|
|
15144
|
-
|
|
15748
|
+
useEffect10(
|
|
15145
15749
|
() => () => {
|
|
15146
15750
|
clearCloseTimeout();
|
|
15147
15751
|
detachPopoverListeners();
|
|
@@ -15221,7 +15825,7 @@ function KbCitationBadge({
|
|
|
15221
15825
|
}
|
|
15222
15826
|
|
|
15223
15827
|
// src/lib/support/message-render.tsx
|
|
15224
|
-
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
15828
|
+
import { jsx as jsx14, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
15225
15829
|
function formatCompactTime(timestamp, now2 = Date.now()) {
|
|
15226
15830
|
const diffMs = Math.max(0, now2 - timestamp);
|
|
15227
15831
|
const minuteMs = 6e4;
|
|
@@ -15334,17 +15938,86 @@ function renderMessageText(text, kbArticles, isStreaming = false) {
|
|
|
15334
15938
|
);
|
|
15335
15939
|
const { body, pendingLinkLabel } = isStreaming ? splitStreamingTail(normalizedText) : { body: normalizedText, pendingLinkLabel: null };
|
|
15336
15940
|
const citationNumbers = buildKbCitationNumberMap(body);
|
|
15941
|
+
const nodes = [];
|
|
15942
|
+
for (const [blockIndex, block] of splitLightMarkdownBlocks(body).entries()) {
|
|
15943
|
+
if (block.type === "table") {
|
|
15944
|
+
nodes.push(
|
|
15945
|
+
renderMessageTable(
|
|
15946
|
+
block.table,
|
|
15947
|
+
kbArticles,
|
|
15948
|
+
citationNumbers,
|
|
15949
|
+
`tbl-${blockIndex}`
|
|
15950
|
+
)
|
|
15951
|
+
);
|
|
15952
|
+
continue;
|
|
15953
|
+
}
|
|
15954
|
+
nodes.push(
|
|
15955
|
+
...renderInlineMessageText(
|
|
15956
|
+
block.text,
|
|
15957
|
+
kbArticles,
|
|
15958
|
+
citationNumbers,
|
|
15959
|
+
`b-${blockIndex}`
|
|
15960
|
+
)
|
|
15961
|
+
);
|
|
15962
|
+
}
|
|
15963
|
+
if (pendingLinkLabel) {
|
|
15964
|
+
nodes.push(
|
|
15965
|
+
/* @__PURE__ */ jsx14("span", { className: LINK_CLASS_NAME, children: renderPlainTextWithBold(pendingLinkLabel, "lnk-pending") }, "lnk-pending")
|
|
15966
|
+
);
|
|
15967
|
+
}
|
|
15968
|
+
return nodes.length > 0 ? nodes : renderPlainTextWithBold(body, "full");
|
|
15969
|
+
}
|
|
15970
|
+
function renderMessageTable(table, kbArticles, citationNumbers, keyPrefix) {
|
|
15971
|
+
return /* @__PURE__ */ jsx14(
|
|
15972
|
+
"div",
|
|
15973
|
+
{
|
|
15974
|
+
className: "my-2 max-w-full overflow-x-auto whitespace-normal",
|
|
15975
|
+
children: /* @__PURE__ */ jsxs5("table", { className: "w-full border-collapse text-[13px] leading-[1.35]", children: [
|
|
15976
|
+
/* @__PURE__ */ jsx14("thead", { children: /* @__PURE__ */ jsx14("tr", { children: table.headers.map((cell, index2) => /* @__PURE__ */ jsx14(
|
|
15977
|
+
"th",
|
|
15978
|
+
{
|
|
15979
|
+
className: "border border-border bg-neutral-50 px-2 py-1.5 font-semibold",
|
|
15980
|
+
style: { textAlign: table.aligns[index2] ?? "left" },
|
|
15981
|
+
children: renderInlineMessageText(
|
|
15982
|
+
cell,
|
|
15983
|
+
kbArticles,
|
|
15984
|
+
citationNumbers,
|
|
15985
|
+
`${keyPrefix}-h-${index2}`
|
|
15986
|
+
)
|
|
15987
|
+
},
|
|
15988
|
+
`${keyPrefix}-h-${index2}`
|
|
15989
|
+
)) }) }),
|
|
15990
|
+
/* @__PURE__ */ jsx14("tbody", { children: table.rows.map((row, rowIndex) => /* @__PURE__ */ jsx14("tr", { children: row.map((cell, cellIndex) => /* @__PURE__ */ jsx14(
|
|
15991
|
+
"td",
|
|
15992
|
+
{
|
|
15993
|
+
className: "border border-border px-2 py-1.5 align-top",
|
|
15994
|
+
style: { textAlign: table.aligns[cellIndex] ?? "left" },
|
|
15995
|
+
children: renderInlineMessageText(
|
|
15996
|
+
cell,
|
|
15997
|
+
kbArticles,
|
|
15998
|
+
citationNumbers,
|
|
15999
|
+
`${keyPrefix}-r-${rowIndex}-c-${cellIndex}`
|
|
16000
|
+
)
|
|
16001
|
+
},
|
|
16002
|
+
`${keyPrefix}-r-${rowIndex}-c-${cellIndex}`
|
|
16003
|
+
)) }, `${keyPrefix}-r-${rowIndex}`)) })
|
|
16004
|
+
] })
|
|
16005
|
+
},
|
|
16006
|
+
keyPrefix
|
|
16007
|
+
);
|
|
16008
|
+
}
|
|
16009
|
+
function renderInlineMessageText(text, kbArticles, citationNumbers, keyPrefix) {
|
|
15337
16010
|
const nodes = [];
|
|
15338
16011
|
let lastIndex = 0;
|
|
15339
16012
|
let tokenIndex = 0;
|
|
15340
16013
|
MESSAGE_CONTENT_PATTERN.lastIndex = 0;
|
|
15341
|
-
let match = MESSAGE_CONTENT_PATTERN.exec(
|
|
16014
|
+
let match = MESSAGE_CONTENT_PATTERN.exec(text);
|
|
15342
16015
|
while (match !== null) {
|
|
15343
16016
|
if (match.index > lastIndex) {
|
|
15344
16017
|
nodes.push(
|
|
15345
16018
|
renderPlainTextWithBold(
|
|
15346
|
-
|
|
15347
|
-
|
|
16019
|
+
text.slice(lastIndex, match.index),
|
|
16020
|
+
`${keyPrefix}-t-${tokenIndex}`
|
|
15348
16021
|
)
|
|
15349
16022
|
);
|
|
15350
16023
|
}
|
|
@@ -15361,7 +16034,7 @@ function renderMessageText(text, kbArticles, isStreaming = false) {
|
|
|
15361
16034
|
article,
|
|
15362
16035
|
number: number2
|
|
15363
16036
|
},
|
|
15364
|
-
|
|
16037
|
+
`${keyPrefix}-cite-${tokenIndex}`
|
|
15365
16038
|
)
|
|
15366
16039
|
);
|
|
15367
16040
|
}
|
|
@@ -15387,7 +16060,7 @@ function renderMessageText(text, kbArticles, isStreaming = false) {
|
|
|
15387
16060
|
target: "_blank",
|
|
15388
16061
|
children: label
|
|
15389
16062
|
},
|
|
15390
|
-
|
|
16063
|
+
`${keyPrefix}-lnk-${tokenIndex}`
|
|
15391
16064
|
)
|
|
15392
16065
|
);
|
|
15393
16066
|
if (trailing) {
|
|
@@ -15396,22 +16069,20 @@ function renderMessageText(text, kbArticles, isStreaming = false) {
|
|
|
15396
16069
|
}
|
|
15397
16070
|
tokenIndex += 1;
|
|
15398
16071
|
lastIndex = match.index + full.length;
|
|
15399
|
-
match = MESSAGE_CONTENT_PATTERN.exec(
|
|
15400
|
-
}
|
|
15401
|
-
if (lastIndex < body.length) {
|
|
15402
|
-
nodes.push(
|
|
15403
|
-
renderPlainTextWithBold(body.slice(lastIndex), `tail-${tokenIndex}`)
|
|
15404
|
-
);
|
|
16072
|
+
match = MESSAGE_CONTENT_PATTERN.exec(text);
|
|
15405
16073
|
}
|
|
15406
|
-
if (
|
|
16074
|
+
if (lastIndex < text.length) {
|
|
15407
16075
|
nodes.push(
|
|
15408
|
-
|
|
16076
|
+
renderPlainTextWithBold(
|
|
16077
|
+
text.slice(lastIndex),
|
|
16078
|
+
`${keyPrefix}-tail-${tokenIndex}`
|
|
16079
|
+
)
|
|
15409
16080
|
);
|
|
15410
16081
|
}
|
|
15411
|
-
return nodes
|
|
16082
|
+
return nodes;
|
|
15412
16083
|
}
|
|
15413
16084
|
function collectKbArticleFromToolEntry(entry, articles) {
|
|
15414
|
-
if (!
|
|
16085
|
+
if (!isRecord(entry)) {
|
|
15415
16086
|
return;
|
|
15416
16087
|
}
|
|
15417
16088
|
if (entry.type === "internal") {
|
|
@@ -15425,7 +16096,7 @@ function collectKbArticleFromToolEntry(entry, articles) {
|
|
|
15425
16096
|
}
|
|
15426
16097
|
}
|
|
15427
16098
|
function collectKbArticlesFromToolPart(part, articles) {
|
|
15428
|
-
if (!
|
|
16099
|
+
if (!isToolUIPart4(part) || part.state !== "output-available") {
|
|
15429
16100
|
return;
|
|
15430
16101
|
}
|
|
15431
16102
|
const toolName = getToolName3(part);
|
|
@@ -15443,9 +16114,9 @@ function resolveKbArticlesFromMessages(messages) {
|
|
|
15443
16114
|
const articles = /* @__PURE__ */ new Map();
|
|
15444
16115
|
for (const message of messages) {
|
|
15445
16116
|
const { metadata } = message;
|
|
15446
|
-
if (
|
|
16117
|
+
if (isRecord(metadata) && Array.isArray(metadata.kbCitations)) {
|
|
15447
16118
|
for (const entry of metadata.kbCitations) {
|
|
15448
|
-
if (!
|
|
16119
|
+
if (!isRecord(entry)) {
|
|
15449
16120
|
continue;
|
|
15450
16121
|
}
|
|
15451
16122
|
const id3 = typeof entry.id === "string" ? entry.id : null;
|
|
@@ -15485,8 +16156,8 @@ function CompactTime({
|
|
|
15485
16156
|
timestamp
|
|
15486
16157
|
}) {
|
|
15487
16158
|
const createdAt = resolveStableCreatedAt(messageId, timestamp);
|
|
15488
|
-
const [now2, setNow] =
|
|
15489
|
-
|
|
16159
|
+
const [now2, setNow] = useState9(() => Date.now());
|
|
16160
|
+
useEffect11(() => {
|
|
15490
16161
|
const tick = () => setNow(Date.now());
|
|
15491
16162
|
const interval = setInterval(tick, TICK_MS);
|
|
15492
16163
|
return () => clearInterval(interval);
|
|
@@ -15494,35 +16165,62 @@ function CompactTime({
|
|
|
15494
16165
|
return /* @__PURE__ */ jsx15(Fragment4, { children: formatCompactTime(createdAt, now2) });
|
|
15495
16166
|
}
|
|
15496
16167
|
|
|
16168
|
+
// src/lib/support/Suggestions.tsx
|
|
16169
|
+
import { jsx as jsx16, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
16170
|
+
function Suggestions({
|
|
16171
|
+
onPick,
|
|
16172
|
+
suggestions
|
|
16173
|
+
}) {
|
|
16174
|
+
return /* @__PURE__ */ jsx16("div", { className: "flex w-full min-w-0 flex-col gap-2", children: suggestions.map((suggestion) => /* @__PURE__ */ jsxs6(
|
|
16175
|
+
"button",
|
|
16176
|
+
{
|
|
16177
|
+
className: "scw-suggestion w-full min-w-0 cursor-pointer overflow-hidden rounded-xl border border-solid border-border bg-white px-3 py-2.5 text-left font-[inherit] hover:bg-neutral-50",
|
|
16178
|
+
onClick: () => onPick(suggestion.prompt),
|
|
16179
|
+
type: "button",
|
|
16180
|
+
children: [
|
|
16181
|
+
/* @__PURE__ */ jsx16("span", { className: "scw-suggestion-icon shrink-0 rounded-lg bg-neutral-100 text-neutral-700", children: /* @__PURE__ */ jsx16(SparklesIcon, {}) }),
|
|
16182
|
+
/* @__PURE__ */ jsxs6("span", { className: "scw-suggestion-copy", children: [
|
|
16183
|
+
/* @__PURE__ */ jsx16("span", { className: "scw-suggestion-label text-sm leading-5 font-medium text-neutral-950", children: suggestion.label }),
|
|
16184
|
+
suggestion.description && /* @__PURE__ */ jsx16("span", { className: "scw-suggestion-label mt-0.5 line-clamp-2 overflow-hidden text-xs text-neutral-500", children: suggestion.description })
|
|
16185
|
+
] })
|
|
16186
|
+
]
|
|
16187
|
+
},
|
|
16188
|
+
suggestion.label
|
|
16189
|
+
)) });
|
|
16190
|
+
}
|
|
16191
|
+
|
|
15497
16192
|
// src/lib/support/HomeView.tsx
|
|
15498
|
-
import { jsx as
|
|
16193
|
+
import { jsx as jsx17, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
15499
16194
|
var SEND_PILL = "inline-flex items-center justify-center gap-2 self-center whitespace-nowrap rounded-[10px] border-none bg-neutral-900 px-[18px] py-[11px] text-sm font-semibold text-white shadow-[0_6px_16px_rgba(0,0,0,.18)] transition-colors duration-150 hover:bg-neutral-800";
|
|
15500
16195
|
function HomeView({
|
|
15501
16196
|
branding,
|
|
15502
16197
|
conversations,
|
|
16198
|
+
onPick,
|
|
15503
16199
|
onResume,
|
|
15504
|
-
onStartNew
|
|
16200
|
+
onStartNew,
|
|
16201
|
+
suggestions
|
|
15505
16202
|
}) {
|
|
15506
16203
|
const [recent] = conversations;
|
|
15507
|
-
return /* @__PURE__ */
|
|
15508
|
-
/* @__PURE__ */
|
|
15509
|
-
/* @__PURE__ */
|
|
15510
|
-
/* @__PURE__ */
|
|
15511
|
-
/* @__PURE__ */
|
|
16204
|
+
return /* @__PURE__ */ jsxs7("div", { className: "scw-thin-scroll flex min-w-0 max-w-full flex-1 flex-col gap-4 overflow-x-hidden overflow-y-auto overscroll-contain bg-white px-4 pt-6 pb-[calc(24px+var(--scw-nav-height))]", children: [
|
|
16205
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex flex-col items-center gap-2 px-0 pt-2 pb-1 text-center", children: [
|
|
16206
|
+
/* @__PURE__ */ jsx17(Avatar, { branding, large: true }),
|
|
16207
|
+
/* @__PURE__ */ jsx17("div", { className: "text-lg font-semibold text-neutral-950", children: branding.greeting }),
|
|
16208
|
+
/* @__PURE__ */ jsx17("div", { className: "text-[13px] text-neutral-500", children: branding.teamDescription })
|
|
15512
16209
|
] }),
|
|
15513
|
-
|
|
16210
|
+
suggestions.length > 0 && /* @__PURE__ */ jsx17(Suggestions, { onPick, suggestions }),
|
|
16211
|
+
recent && /* @__PURE__ */ jsxs7(
|
|
15514
16212
|
"button",
|
|
15515
16213
|
{
|
|
15516
|
-
className: "flex w-full cursor-pointer items-center gap-3 rounded-[14px] border border-solid border-
|
|
16214
|
+
className: "flex w-full cursor-pointer items-center gap-3 rounded-[14px] border border-solid border-border bg-white p-3 text-left font-[inherit] shadow-[0_2px_8px_rgba(0,0,0,.06)] transition-colors duration-150 hover:bg-neutral-50",
|
|
15517
16215
|
onClick: () => onResume(recent),
|
|
15518
16216
|
type: "button",
|
|
15519
16217
|
children: [
|
|
15520
|
-
/* @__PURE__ */
|
|
15521
|
-
/* @__PURE__ */
|
|
15522
|
-
/* @__PURE__ */
|
|
15523
|
-
/* @__PURE__ */
|
|
16218
|
+
/* @__PURE__ */ jsx17(Avatar, { branding }),
|
|
16219
|
+
/* @__PURE__ */ jsxs7("div", { className: "min-w-0 flex-1", children: [
|
|
16220
|
+
/* @__PURE__ */ jsx17("div", { className: "text-sm font-semibold text-neutral-950", children: branding.workspaceName }),
|
|
16221
|
+
/* @__PURE__ */ jsx17("div", { className: "overflow-hidden text-[13px] text-ellipsis whitespace-nowrap text-neutral-500", children: renderPreviewText(recent.preview, recent.conversationId) })
|
|
15524
16222
|
] }),
|
|
15525
|
-
/* @__PURE__ */
|
|
16223
|
+
/* @__PURE__ */ jsx17("div", { className: "shrink-0 self-start text-xs text-neutral-400", children: /* @__PURE__ */ jsx17(
|
|
15526
16224
|
CompactTime,
|
|
15527
16225
|
{
|
|
15528
16226
|
messageId: `home-${recent.conversationId}`,
|
|
@@ -15532,54 +16230,47 @@ function HomeView({
|
|
|
15532
16230
|
]
|
|
15533
16231
|
}
|
|
15534
16232
|
),
|
|
15535
|
-
/* @__PURE__ */
|
|
16233
|
+
/* @__PURE__ */ jsxs7("button", { className: SEND_PILL, onClick: onStartNew, type: "button", children: [
|
|
15536
16234
|
"Start a new conversation",
|
|
15537
|
-
/* @__PURE__ */
|
|
16235
|
+
/* @__PURE__ */ jsx17(ArrowRightIcon, {})
|
|
15538
16236
|
] })
|
|
15539
16237
|
] });
|
|
15540
16238
|
}
|
|
15541
16239
|
|
|
15542
16240
|
// src/lib/support/MessagesView.tsx
|
|
15543
|
-
import { jsx as
|
|
16241
|
+
import { jsx as jsx18, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
15544
16242
|
var SEND_PILL2 = "inline-flex items-center justify-center gap-2 self-center whitespace-nowrap rounded-[10px] border-none bg-neutral-900 px-[18px] py-[11px] text-sm font-semibold text-white shadow-[0_6px_16px_rgba(0,0,0,.18)] transition-colors duration-150 hover:bg-neutral-800";
|
|
15545
16243
|
function MessagesView({
|
|
15546
|
-
activeConversationId,
|
|
15547
16244
|
branding,
|
|
15548
16245
|
conversations,
|
|
15549
16246
|
onResume,
|
|
15550
16247
|
onStartNew
|
|
15551
16248
|
}) {
|
|
15552
|
-
return /* @__PURE__ */
|
|
15553
|
-
/* @__PURE__ */
|
|
15554
|
-
|
|
15555
|
-
|
|
15556
|
-
"
|
|
15557
|
-
|
|
15558
|
-
|
|
15559
|
-
|
|
15560
|
-
|
|
15561
|
-
|
|
15562
|
-
|
|
15563
|
-
|
|
15564
|
-
|
|
15565
|
-
|
|
15566
|
-
|
|
15567
|
-
|
|
15568
|
-
|
|
15569
|
-
|
|
15570
|
-
|
|
15571
|
-
|
|
15572
|
-
|
|
15573
|
-
|
|
15574
|
-
|
|
15575
|
-
|
|
15576
|
-
|
|
15577
|
-
]
|
|
15578
|
-
},
|
|
15579
|
-
entry.conversationId
|
|
15580
|
-
);
|
|
15581
|
-
}) }) }),
|
|
15582
|
-
/* @__PURE__ */ jsxs6(
|
|
16249
|
+
return /* @__PURE__ */ jsxs8("div", { className: "relative flex min-h-0 flex-1 flex-col overflow-hidden", children: [
|
|
16250
|
+
/* @__PURE__ */ jsx18("div", { className: "scw-thin-scroll min-w-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain px-2 pt-2 pb-[calc(8px+var(--scw-nav-height)+var(--scw-send-pill-gap)+var(--scw-send-pill-height))]", children: conversations.length === 0 ? /* @__PURE__ */ jsx18("p", { className: "my-6 text-center text-sm text-neutral-500", children: "No conversations yet. Start one below." }) : /* @__PURE__ */ jsx18("div", { className: "flex flex-col", children: conversations.map((entry) => /* @__PURE__ */ jsxs8(
|
|
16251
|
+
"button",
|
|
16252
|
+
{
|
|
16253
|
+
className: "flex w-full cursor-pointer items-center gap-3 rounded-xl border-none bg-white p-3 text-left font-[inherit] transition-colors duration-150 hover:bg-neutral-100",
|
|
16254
|
+
onClick: () => onResume(entry),
|
|
16255
|
+
type: "button",
|
|
16256
|
+
children: [
|
|
16257
|
+
/* @__PURE__ */ jsx18(Avatar, { branding }),
|
|
16258
|
+
/* @__PURE__ */ jsxs8("div", { className: "min-w-0 flex-1", children: [
|
|
16259
|
+
/* @__PURE__ */ jsx18("div", { className: "text-sm font-semibold text-neutral-950", children: branding.workspaceName }),
|
|
16260
|
+
/* @__PURE__ */ jsx18("div", { className: "overflow-hidden text-[13px] text-ellipsis whitespace-nowrap text-neutral-500", children: renderPreviewText(entry.preview, entry.conversationId) })
|
|
16261
|
+
] }),
|
|
16262
|
+
/* @__PURE__ */ jsx18("div", { className: "shrink-0 self-start text-xs text-neutral-400", children: /* @__PURE__ */ jsx18(
|
|
16263
|
+
CompactTime,
|
|
16264
|
+
{
|
|
16265
|
+
messageId: `list-${entry.conversationId}`,
|
|
16266
|
+
timestamp: entry.updatedAt
|
|
16267
|
+
}
|
|
16268
|
+
) })
|
|
16269
|
+
]
|
|
16270
|
+
},
|
|
16271
|
+
entry.conversationId
|
|
16272
|
+
)) }) }),
|
|
16273
|
+
/* @__PURE__ */ jsxs8(
|
|
15583
16274
|
"button",
|
|
15584
16275
|
{
|
|
15585
16276
|
className: cn(
|
|
@@ -15590,7 +16281,7 @@ function MessagesView({
|
|
|
15590
16281
|
type: "button",
|
|
15591
16282
|
children: [
|
|
15592
16283
|
"Start a new conversation",
|
|
15593
|
-
/* @__PURE__ */
|
|
16284
|
+
/* @__PURE__ */ jsx18(ArrowRightIcon, {})
|
|
15594
16285
|
]
|
|
15595
16286
|
}
|
|
15596
16287
|
)
|
|
@@ -15598,8 +16289,8 @@ function MessagesView({
|
|
|
15598
16289
|
}
|
|
15599
16290
|
|
|
15600
16291
|
// src/lib/support/PanelHeader.tsx
|
|
15601
|
-
import { jsx as
|
|
15602
|
-
var HEADER_BTN = "flex size-[var(--scw-header-btn-size)] shrink-0 items-center justify-center rounded-[var(--scw-header-btn-concentric)] border-none bg-transparent p-0 text-neutral-600 hover:bg-
|
|
16292
|
+
import { jsx as jsx19, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
16293
|
+
var HEADER_BTN = "flex size-[var(--scw-header-btn-size)] shrink-0 items-center justify-center rounded-[var(--scw-header-btn-concentric)] border-none bg-transparent p-0 text-neutral-600 hover:bg-neutral-100 hover:text-neutral-700";
|
|
15603
16294
|
function PanelHeader({
|
|
15604
16295
|
agentMuted: _agentMuted,
|
|
15605
16296
|
branding,
|
|
@@ -15608,66 +16299,69 @@ function PanelHeader({
|
|
|
15608
16299
|
view
|
|
15609
16300
|
}) {
|
|
15610
16301
|
if (view === "chat") {
|
|
15611
|
-
return /* @__PURE__ */
|
|
15612
|
-
/* @__PURE__ */
|
|
15613
|
-
/* @__PURE__ */
|
|
16302
|
+
return /* @__PURE__ */ jsxs9("div", { className: "flex items-start justify-between gap-2 border-b border-border p-[var(--scw-header-padding)]", children: [
|
|
16303
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
16304
|
+
/* @__PURE__ */ jsx19(
|
|
15614
16305
|
"button",
|
|
15615
16306
|
{
|
|
15616
16307
|
"aria-label": "Back",
|
|
15617
16308
|
className: HEADER_BTN,
|
|
15618
16309
|
onClick: onBack,
|
|
15619
16310
|
type: "button",
|
|
15620
|
-
children: /* @__PURE__ */
|
|
16311
|
+
children: /* @__PURE__ */ jsx19(ChevronLeftIcon, {})
|
|
15621
16312
|
}
|
|
15622
16313
|
),
|
|
15623
|
-
/* @__PURE__ */
|
|
15624
|
-
/* @__PURE__ */
|
|
16314
|
+
/* @__PURE__ */ jsx19(Avatar, { branding }),
|
|
16315
|
+
/* @__PURE__ */ jsx19("div", { className: "min-w-0 leading-[1.3]", children: /* @__PURE__ */ jsx19("div", { className: "text-lg font-semibold text-neutral-950", children: branding.workspaceName }) })
|
|
15625
16316
|
] }),
|
|
15626
|
-
/* @__PURE__ */
|
|
15627
|
-
"button",
|
|
15628
|
-
{
|
|
15629
|
-
"aria-label": "Close chat",
|
|
15630
|
-
className: HEADER_BTN,
|
|
15631
|
-
onClick: onClose,
|
|
15632
|
-
type: "button",
|
|
15633
|
-
children: /* @__PURE__ */ jsx18(CloseIcon, {})
|
|
15634
|
-
}
|
|
15635
|
-
)
|
|
16317
|
+
/* @__PURE__ */ jsx19(CloseChatButton, { onClose })
|
|
15636
16318
|
] });
|
|
15637
16319
|
}
|
|
15638
|
-
return /* @__PURE__ */
|
|
16320
|
+
return /* @__PURE__ */ jsxs9(
|
|
15639
16321
|
"div",
|
|
15640
16322
|
{
|
|
15641
16323
|
className: cn(
|
|
15642
|
-
"relative flex min-h-[calc(var(--scw-header-padding)*2+var(--scw-header-btn-size))] items-center justify-center gap-2 border-b border-
|
|
16324
|
+
"relative flex min-h-[calc(var(--scw-header-padding)*2+var(--scw-header-btn-size))] items-center justify-center gap-2 border-b border-border p-[var(--scw-header-padding)]"
|
|
15643
16325
|
),
|
|
15644
16326
|
children: [
|
|
15645
|
-
/* @__PURE__ */
|
|
15646
|
-
/* @__PURE__ */
|
|
15647
|
-
|
|
16327
|
+
/* @__PURE__ */ jsx19("div", { className: "text-lg font-semibold text-neutral-950", children: view === "messages" ? "Messages" : "" }),
|
|
16328
|
+
/* @__PURE__ */ jsx19(
|
|
16329
|
+
CloseChatButton,
|
|
15648
16330
|
{
|
|
15649
|
-
|
|
15650
|
-
|
|
15651
|
-
HEADER_BTN,
|
|
15652
|
-
"absolute top-[var(--scw-header-padding)] right-[var(--scw-header-padding)]"
|
|
15653
|
-
),
|
|
15654
|
-
onClick: onClose,
|
|
15655
|
-
type: "button",
|
|
15656
|
-
children: /* @__PURE__ */ jsx18(CloseIcon, {})
|
|
16331
|
+
className: "absolute top-[var(--scw-header-padding)] right-[var(--scw-header-padding)]",
|
|
16332
|
+
onClose
|
|
15657
16333
|
}
|
|
15658
16334
|
)
|
|
15659
16335
|
]
|
|
15660
16336
|
}
|
|
15661
16337
|
);
|
|
15662
16338
|
}
|
|
16339
|
+
function CloseChatButton({
|
|
16340
|
+
className,
|
|
16341
|
+
onClose
|
|
16342
|
+
}) {
|
|
16343
|
+
if (!onClose) {
|
|
16344
|
+
return null;
|
|
16345
|
+
}
|
|
16346
|
+
return /* @__PURE__ */ jsx19(
|
|
16347
|
+
"button",
|
|
16348
|
+
{
|
|
16349
|
+
"aria-label": "Close chat",
|
|
16350
|
+
className: cn(HEADER_BTN, className),
|
|
16351
|
+
onClick: onClose,
|
|
16352
|
+
type: "button",
|
|
16353
|
+
children: /* @__PURE__ */ jsx19(CloseIcon, {})
|
|
16354
|
+
}
|
|
16355
|
+
);
|
|
16356
|
+
}
|
|
15663
16357
|
|
|
15664
16358
|
// src/lib/support/Spinner.tsx
|
|
15665
|
-
import { jsx as
|
|
16359
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
15666
16360
|
function Spinner({
|
|
15667
16361
|
className,
|
|
15668
16362
|
small
|
|
15669
16363
|
}) {
|
|
15670
|
-
return /* @__PURE__ */
|
|
16364
|
+
return /* @__PURE__ */ jsx20(
|
|
15671
16365
|
"span",
|
|
15672
16366
|
{
|
|
15673
16367
|
"aria-hidden": "true",
|
|
@@ -15684,11 +16378,11 @@ function Spinner({
|
|
|
15684
16378
|
import { useLayoutEffect as useLayoutEffect4 } from "react";
|
|
15685
16379
|
|
|
15686
16380
|
// src/lib/support/ComposerFooter.tsx
|
|
15687
|
-
import { useEffect as
|
|
16381
|
+
import { useEffect as useEffect13, useState as useState11 } from "react";
|
|
15688
16382
|
|
|
15689
16383
|
// src/lib/support/PoweredBy.tsx
|
|
15690
|
-
import { useEffect as
|
|
15691
|
-
import { jsx as
|
|
16384
|
+
import { useEffect as useEffect12, useState as useState10, useSyncExternalStore } from "react";
|
|
16385
|
+
import { jsx as jsx21, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
15692
16386
|
function PoweredBy({
|
|
15693
16387
|
projectId
|
|
15694
16388
|
}) {
|
|
@@ -15698,16 +16392,16 @@ function PoweredBy({
|
|
|
15698
16392
|
getIdentity
|
|
15699
16393
|
);
|
|
15700
16394
|
const hrefFromTraits = typeof identity2?.traits?.$href === "string" ? identity2.traits.$href : void 0;
|
|
15701
|
-
const [hostDomain, setHostDomain] =
|
|
16395
|
+
const [hostDomain, setHostDomain] = useState10(
|
|
15702
16396
|
() => readHostnameFromHref(hrefFromTraits)
|
|
15703
16397
|
);
|
|
15704
|
-
|
|
16398
|
+
useEffect12(() => {
|
|
15705
16399
|
const fromTraits = readHostnameFromHref(hrefFromTraits);
|
|
15706
16400
|
if (fromTraits) {
|
|
15707
16401
|
setHostDomain(fromTraits);
|
|
15708
16402
|
}
|
|
15709
16403
|
}, [hrefFromTraits]);
|
|
15710
|
-
|
|
16404
|
+
useEffect12(() => {
|
|
15711
16405
|
if (hostDomain) {
|
|
15712
16406
|
return;
|
|
15713
16407
|
}
|
|
@@ -15729,17 +16423,17 @@ function PoweredBy({
|
|
|
15729
16423
|
cancelled = true;
|
|
15730
16424
|
};
|
|
15731
16425
|
}, [hostDomain]);
|
|
15732
|
-
return /* @__PURE__ */
|
|
16426
|
+
return /* @__PURE__ */ jsx21("div", { className: "flex justify-center", children: /* @__PURE__ */ jsxs10(
|
|
15733
16427
|
"a",
|
|
15734
16428
|
{
|
|
15735
16429
|
"aria-label": "Powered by Saasco",
|
|
15736
|
-
className: "inline-flex items-center gap-[5px] rounded-full border border-solid border-
|
|
16430
|
+
className: "inline-flex items-center gap-[5px] rounded-full border border-solid border-border bg-white px-3.5 py-1.5 text-[11px] leading-none text-neutral-400 no-underline transition-colors duration-150 hover:bg-neutral-50",
|
|
15737
16431
|
href: buildSaascoPoweredByHref(projectId, hostDomain),
|
|
15738
16432
|
rel: "noopener noreferrer",
|
|
15739
16433
|
target: "_blank",
|
|
15740
16434
|
children: [
|
|
15741
|
-
/* @__PURE__ */
|
|
15742
|
-
/* @__PURE__ */
|
|
16435
|
+
/* @__PURE__ */ jsx21("span", { className: "text-neutral-400", children: "Powered by" }),
|
|
16436
|
+
/* @__PURE__ */ jsx21(SaascoLogo, {})
|
|
15743
16437
|
]
|
|
15744
16438
|
}
|
|
15745
16439
|
) });
|
|
@@ -15763,15 +16457,15 @@ import {
|
|
|
15763
16457
|
useMessageScrollerScrollable,
|
|
15764
16458
|
useMessageScrollerVisibility
|
|
15765
16459
|
} from "@shadcn/react/message-scroller";
|
|
15766
|
-
import { Fragment as Fragment5, jsx as
|
|
16460
|
+
import { Fragment as Fragment5, jsx as jsx22, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
15767
16461
|
function MessageScrollerProvider(props) {
|
|
15768
|
-
return /* @__PURE__ */
|
|
16462
|
+
return /* @__PURE__ */ jsx22(MessageScrollerPrimitive.Provider, { ...props });
|
|
15769
16463
|
}
|
|
15770
16464
|
function MessageScroller({
|
|
15771
16465
|
className,
|
|
15772
16466
|
...props
|
|
15773
16467
|
}) {
|
|
15774
|
-
return /* @__PURE__ */
|
|
16468
|
+
return /* @__PURE__ */ jsx22(
|
|
15775
16469
|
MessageScrollerPrimitive.Root,
|
|
15776
16470
|
{
|
|
15777
16471
|
"data-slot": "message-scroller",
|
|
@@ -15787,7 +16481,7 @@ function MessageScrollerViewport({
|
|
|
15787
16481
|
className,
|
|
15788
16482
|
...props
|
|
15789
16483
|
}) {
|
|
15790
|
-
return /* @__PURE__ */
|
|
16484
|
+
return /* @__PURE__ */ jsx22(
|
|
15791
16485
|
MessageScrollerPrimitive.Viewport,
|
|
15792
16486
|
{
|
|
15793
16487
|
"data-slot": "message-scroller-viewport",
|
|
@@ -15807,7 +16501,7 @@ function MessageScrollerContent({
|
|
|
15807
16501
|
className,
|
|
15808
16502
|
...props
|
|
15809
16503
|
}) {
|
|
15810
|
-
return /* @__PURE__ */
|
|
16504
|
+
return /* @__PURE__ */ jsx22(
|
|
15811
16505
|
MessageScrollerPrimitive.Content,
|
|
15812
16506
|
{
|
|
15813
16507
|
"data-slot": "message-scroller-content",
|
|
@@ -15827,7 +16521,7 @@ function MessageScrollerItem({
|
|
|
15827
16521
|
scrollAnchor = false,
|
|
15828
16522
|
...props
|
|
15829
16523
|
}) {
|
|
15830
|
-
return /* @__PURE__ */
|
|
16524
|
+
return /* @__PURE__ */ jsx22(
|
|
15831
16525
|
MessageScrollerPrimitive.Item,
|
|
15832
16526
|
{
|
|
15833
16527
|
"data-slot": "message-scroller-item",
|
|
@@ -15844,7 +16538,7 @@ function MessageScrollerItem({
|
|
|
15844
16538
|
}
|
|
15845
16539
|
|
|
15846
16540
|
// src/lib/support/ComposerFooter.tsx
|
|
15847
|
-
import { jsx as
|
|
16541
|
+
import { jsx as jsx23, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
15848
16542
|
function ComposerFooter({
|
|
15849
16543
|
active,
|
|
15850
16544
|
projectId,
|
|
@@ -15855,8 +16549,8 @@ function ComposerFooter({
|
|
|
15855
16549
|
const { scrollToEnd } = useMessageScroller();
|
|
15856
16550
|
const showScrollToBottom = useAwayFromScrollBottom(scrollRef, active);
|
|
15857
16551
|
const transition = reduceMotion ? { duration: 0 } : SCROLL_BOTTOM_TRANSITION;
|
|
15858
|
-
return /* @__PURE__ */
|
|
15859
|
-
/* @__PURE__ */
|
|
16552
|
+
return /* @__PURE__ */ jsxs12("div", { className: "pointer-events-none absolute inset-x-0 bottom-full mb-2.5", children: [
|
|
16553
|
+
/* @__PURE__ */ jsx23(
|
|
15860
16554
|
motion.div,
|
|
15861
16555
|
{
|
|
15862
16556
|
animate: {
|
|
@@ -15868,10 +16562,10 @@ function ComposerFooter({
|
|
|
15868
16562
|
initial: false,
|
|
15869
16563
|
style: { pointerEvents: showScrollToBottom ? "none" : "auto" },
|
|
15870
16564
|
transition,
|
|
15871
|
-
children: /* @__PURE__ */
|
|
16565
|
+
children: /* @__PURE__ */ jsx23(PoweredBy, { projectId })
|
|
15872
16566
|
}
|
|
15873
16567
|
),
|
|
15874
|
-
/* @__PURE__ */
|
|
16568
|
+
/* @__PURE__ */ jsx23(
|
|
15875
16569
|
motion.button,
|
|
15876
16570
|
{
|
|
15877
16571
|
animate: {
|
|
@@ -15881,7 +16575,7 @@ function ComposerFooter({
|
|
|
15881
16575
|
},
|
|
15882
16576
|
"aria-hidden": !showScrollToBottom,
|
|
15883
16577
|
"aria-label": "Scroll to latest messages",
|
|
15884
|
-
className: "absolute top-1/2 left-1/2 mt-[-16px] flex size-8 cursor-pointer items-center justify-center rounded-full border border-solid border-
|
|
16578
|
+
className: "absolute top-1/2 left-1/2 mt-[-16px] flex size-8 cursor-pointer items-center justify-center rounded-full border border-solid border-border bg-white p-0 text-neutral-600 transition-colors duration-150 hover:bg-neutral-50",
|
|
15885
16579
|
initial: false,
|
|
15886
16580
|
onClick: () => {
|
|
15887
16581
|
scrollReleasedRef.current = true;
|
|
@@ -15891,14 +16585,14 @@ function ComposerFooter({
|
|
|
15891
16585
|
tabIndex: showScrollToBottom ? 0 : -1,
|
|
15892
16586
|
transition,
|
|
15893
16587
|
type: "button",
|
|
15894
|
-
children: /* @__PURE__ */
|
|
16588
|
+
children: /* @__PURE__ */ jsx23(ScrollChevronDownIcon, {})
|
|
15895
16589
|
}
|
|
15896
16590
|
)
|
|
15897
16591
|
] });
|
|
15898
16592
|
}
|
|
15899
16593
|
function useAwayFromScrollBottom(scrollRef, active) {
|
|
15900
|
-
const [away, setAway] =
|
|
15901
|
-
|
|
16594
|
+
const [away, setAway] = useState11(false);
|
|
16595
|
+
useEffect13(() => {
|
|
15902
16596
|
if (!active) {
|
|
15903
16597
|
setAway(false);
|
|
15904
16598
|
return;
|
|
@@ -15937,11 +16631,11 @@ function useAwayFromScrollBottom(scrollRef, active) {
|
|
|
15937
16631
|
}
|
|
15938
16632
|
|
|
15939
16633
|
// src/lib/support/MessageList.tsx
|
|
15940
|
-
import { useEffect as
|
|
16634
|
+
import { useEffect as useEffect16, useMemo as useMemo7 } from "react";
|
|
15941
16635
|
|
|
15942
16636
|
// src/lib/support/ui/marker.tsx
|
|
15943
16637
|
import { Slot as Slot3 } from "@radix-ui/react-slot";
|
|
15944
|
-
import { jsx as
|
|
16638
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
15945
16639
|
var markerVariants = cva(
|
|
15946
16640
|
"group/marker relative flex min-h-4 w-full items-center gap-2 text-left text-sm text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [a]:underline [a]:underline-offset-3 [a]:hover:text-foreground",
|
|
15947
16641
|
{
|
|
@@ -15961,7 +16655,7 @@ function Marker({
|
|
|
15961
16655
|
...props
|
|
15962
16656
|
}) {
|
|
15963
16657
|
const Comp = asChild ? Slot3 : "div";
|
|
15964
|
-
return /* @__PURE__ */
|
|
16658
|
+
return /* @__PURE__ */ jsx24(
|
|
15965
16659
|
Comp,
|
|
15966
16660
|
{
|
|
15967
16661
|
"data-slot": "marker",
|
|
@@ -15972,7 +16666,7 @@ function Marker({
|
|
|
15972
16666
|
);
|
|
15973
16667
|
}
|
|
15974
16668
|
function MarkerIcon({ className, ...props }) {
|
|
15975
|
-
return /* @__PURE__ */
|
|
16669
|
+
return /* @__PURE__ */ jsx24(
|
|
15976
16670
|
"span",
|
|
15977
16671
|
{
|
|
15978
16672
|
"data-slot": "marker-icon",
|
|
@@ -15986,7 +16680,7 @@ function MarkerIcon({ className, ...props }) {
|
|
|
15986
16680
|
);
|
|
15987
16681
|
}
|
|
15988
16682
|
function MarkerContent({ className, ...props }) {
|
|
15989
|
-
return /* @__PURE__ */
|
|
16683
|
+
return /* @__PURE__ */ jsx24(
|
|
15990
16684
|
"span",
|
|
15991
16685
|
{
|
|
15992
16686
|
"data-slot": "marker-content",
|
|
@@ -16000,41 +16694,17 @@ function MarkerContent({ className, ...props }) {
|
|
|
16000
16694
|
}
|
|
16001
16695
|
|
|
16002
16696
|
// src/lib/support/JoinNotice.tsx
|
|
16003
|
-
import { jsx as
|
|
16697
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
16004
16698
|
function JoinNotice({
|
|
16005
16699
|
message
|
|
16006
16700
|
}) {
|
|
16007
16701
|
const name = readAuthorName(message);
|
|
16008
16702
|
const label = name && name !== "Team" ? `${name} has joined the conversation` : "A teammate has joined the conversation";
|
|
16009
|
-
return /* @__PURE__ */
|
|
16010
|
-
}
|
|
16011
|
-
|
|
16012
|
-
// src/lib/support/Suggestions.tsx
|
|
16013
|
-
import { jsx as jsx25, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
16014
|
-
function Suggestions({
|
|
16015
|
-
onPick,
|
|
16016
|
-
suggestions
|
|
16017
|
-
}) {
|
|
16018
|
-
return /* @__PURE__ */ jsx25("div", { className: "flex flex-col gap-2", children: suggestions.map((suggestion) => /* @__PURE__ */ jsxs11(
|
|
16019
|
-
"button",
|
|
16020
|
-
{
|
|
16021
|
-
className: "flex cursor-pointer items-start gap-3 rounded-xl border border-solid border-neutral-200 bg-white px-3 py-2.5 text-left font-[inherit] hover:bg-neutral-50",
|
|
16022
|
-
onClick: () => onPick(suggestion.prompt),
|
|
16023
|
-
type: "button",
|
|
16024
|
-
children: [
|
|
16025
|
-
/* @__PURE__ */ jsx25("span", { className: "mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-lg bg-neutral-100 text-neutral-700", children: /* @__PURE__ */ jsx25(SparklesIcon, {}) }),
|
|
16026
|
-
/* @__PURE__ */ jsxs11("span", { className: "flex min-w-0 flex-col", children: [
|
|
16027
|
-
/* @__PURE__ */ jsx25("span", { className: "text-sm font-medium text-neutral-950", children: suggestion.label }),
|
|
16028
|
-
suggestion.description && /* @__PURE__ */ jsx25("span", { className: "mt-0.5 line-clamp-2 overflow-hidden text-xs text-neutral-500", children: suggestion.description })
|
|
16029
|
-
] })
|
|
16030
|
-
]
|
|
16031
|
-
},
|
|
16032
|
-
suggestion.label
|
|
16033
|
-
)) });
|
|
16703
|
+
return /* @__PURE__ */ jsx25(Marker, { className: "scw-message-in justify-center py-2 text-center text-xs text-neutral-500", children: /* @__PURE__ */ jsx25(MarkerContent, { children: label }) });
|
|
16034
16704
|
}
|
|
16035
16705
|
|
|
16036
16706
|
// src/lib/support/HandoffCard.tsx
|
|
16037
|
-
import { jsx as jsx26, jsxs as
|
|
16707
|
+
import { jsx as jsx26, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
16038
16708
|
var BTN = "inline-flex h-7 cursor-pointer items-center gap-1 rounded-md px-2.5 text-xs font-medium disabled:cursor-default disabled:opacity-60";
|
|
16039
16709
|
var BTN_PRIMARY = "border border-solid border-neutral-900 bg-neutral-900 text-white hover:bg-neutral-800";
|
|
16040
16710
|
var BTN_OUTLINE = "border border-solid border-neutral-300 bg-white text-neutral-900 hover:bg-neutral-100";
|
|
@@ -16044,12 +16714,12 @@ function HandoffCard({
|
|
|
16044
16714
|
pending,
|
|
16045
16715
|
reason
|
|
16046
16716
|
}) {
|
|
16047
|
-
return /* @__PURE__ */
|
|
16717
|
+
return /* @__PURE__ */ jsxs13("div", { className: "w-full rounded-lg border border-solid border-border bg-white p-3", children: [
|
|
16048
16718
|
/* @__PURE__ */ jsx26("div", { className: "text-[10px] font-semibold tracking-[0.04em] text-neutral-500 uppercase", children: "Connect with the team" }),
|
|
16049
16719
|
reason ? /* @__PURE__ */ jsx26("p", { className: "mt-1.5 text-[13px] text-neutral-900", children: reason }) : null,
|
|
16050
16720
|
/* @__PURE__ */ jsx26("p", { className: "mt-1 text-xs text-neutral-600", children: "A human teammate can take over from here and reply right in this chat." }),
|
|
16051
|
-
/* @__PURE__ */
|
|
16052
|
-
/* @__PURE__ */
|
|
16721
|
+
/* @__PURE__ */ jsxs13("div", { className: "mt-2.5 flex flex-wrap items-center gap-1.5", children: [
|
|
16722
|
+
/* @__PURE__ */ jsxs13(
|
|
16053
16723
|
"button",
|
|
16054
16724
|
{
|
|
16055
16725
|
className: `${BTN} ${BTN_PRIMARY}`,
|
|
@@ -16077,15 +16747,16 @@ function HandoffCard({
|
|
|
16077
16747
|
}
|
|
16078
16748
|
|
|
16079
16749
|
// src/lib/support/hiddenTools.ts
|
|
16080
|
-
import { getToolName as getToolName4, isToolUIPart as
|
|
16750
|
+
import { getToolName as getToolName4, isToolUIPart as isToolUIPart5 } from "ai";
|
|
16081
16751
|
var HIDDEN_WIDGET_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
16082
16752
|
CLOSE_CONVERSATION_TOOL_NAME,
|
|
16753
|
+
REPORT_KNOWLEDGE_GAP_TOOL_NAME,
|
|
16083
16754
|
REQUEST_HUMAN_HANDOFF_TOOL_NAME
|
|
16084
16755
|
]);
|
|
16085
16756
|
function collectHiddenToolCallIds(message) {
|
|
16086
16757
|
const ids = /* @__PURE__ */ new Set();
|
|
16087
16758
|
for (const part of message.parts ?? []) {
|
|
16088
|
-
if (
|
|
16759
|
+
if (isToolUIPart5(part) && HIDDEN_WIDGET_TOOL_NAMES.has(getToolName4(part))) {
|
|
16089
16760
|
ids.add(part.toolCallId);
|
|
16090
16761
|
}
|
|
16091
16762
|
}
|
|
@@ -16120,11 +16791,8 @@ function humanizeToolName(toolName) {
|
|
|
16120
16791
|
).join(" ");
|
|
16121
16792
|
}
|
|
16122
16793
|
|
|
16123
|
-
// src/lib/support/ToolGroup.tsx
|
|
16124
|
-
import { useState as useState10 } from "react";
|
|
16125
|
-
|
|
16126
16794
|
// src/lib/support/ApprovalCard.tsx
|
|
16127
|
-
import { jsx as jsx27, jsxs as
|
|
16795
|
+
import { jsx as jsx27, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
16128
16796
|
var BTN2 = "inline-flex h-7 cursor-pointer items-center gap-1 rounded-md px-2.5 text-xs font-medium disabled:cursor-default disabled:opacity-60";
|
|
16129
16797
|
var BTN_PRIMARY2 = "border border-solid border-neutral-900 bg-neutral-900 text-white hover:bg-neutral-800";
|
|
16130
16798
|
var BTN_OUTLINE2 = "border border-solid border-neutral-300 bg-white text-neutral-900 hover:bg-neutral-100";
|
|
@@ -16135,7 +16803,7 @@ function ApprovalCard({
|
|
|
16135
16803
|
toolName
|
|
16136
16804
|
}) {
|
|
16137
16805
|
const displayLabel = resolveToolLabel(toolName, label);
|
|
16138
|
-
return /* @__PURE__ */ jsx27("div", { className: "w-full rounded-lg border border-solid border-
|
|
16806
|
+
return /* @__PURE__ */ jsx27("div", { className: "w-full rounded-lg border border-solid border-border bg-white p-3 text-xs text-neutral-900", children: /* @__PURE__ */ jsxs14("div", { className: "flex items-start gap-2.5", children: [
|
|
16139
16807
|
/* @__PURE__ */ jsx27(
|
|
16140
16808
|
"div",
|
|
16141
16809
|
{
|
|
@@ -16144,12 +16812,12 @@ function ApprovalCard({
|
|
|
16144
16812
|
children: /* @__PURE__ */ jsx27(AlertTriangleIcon, {})
|
|
16145
16813
|
}
|
|
16146
16814
|
),
|
|
16147
|
-
/* @__PURE__ */
|
|
16815
|
+
/* @__PURE__ */ jsxs14("div", { className: "min-w-0 flex-1", children: [
|
|
16148
16816
|
/* @__PURE__ */ jsx27("div", { className: "text-[10px] font-semibold tracking-[0.04em] text-neutral-500 uppercase", children: "Approval required" }),
|
|
16149
16817
|
/* @__PURE__ */ jsx27("div", { className: "text-sm font-semibold text-neutral-900", children: displayLabel }),
|
|
16150
16818
|
/* @__PURE__ */ jsx27("p", { className: "mt-1 text-xs text-neutral-600", children: "Allow this action to continue?" }),
|
|
16151
|
-
/* @__PURE__ */
|
|
16152
|
-
/* @__PURE__ */
|
|
16819
|
+
/* @__PURE__ */ jsxs14("div", { className: "mt-3 flex items-center gap-1.5", children: [
|
|
16820
|
+
/* @__PURE__ */ jsxs14(
|
|
16153
16821
|
"button",
|
|
16154
16822
|
{
|
|
16155
16823
|
className: `${BTN2} ${BTN_PRIMARY2}`,
|
|
@@ -16161,7 +16829,7 @@ function ApprovalCard({
|
|
|
16161
16829
|
]
|
|
16162
16830
|
}
|
|
16163
16831
|
),
|
|
16164
|
-
/* @__PURE__ */
|
|
16832
|
+
/* @__PURE__ */ jsxs14(
|
|
16165
16833
|
"button",
|
|
16166
16834
|
{
|
|
16167
16835
|
className: `${BTN2} ${BTN_OUTLINE2}`,
|
|
@@ -16185,7 +16853,7 @@ function resolveToolLabel(toolName, label) {
|
|
|
16185
16853
|
}
|
|
16186
16854
|
|
|
16187
16855
|
// src/lib/support/ToolGroup.tsx
|
|
16188
|
-
import { jsx as jsx28, jsxs as
|
|
16856
|
+
import { jsx as jsx28, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
16189
16857
|
function ToolGroup({
|
|
16190
16858
|
onApprove,
|
|
16191
16859
|
onReject,
|
|
@@ -16194,18 +16862,16 @@ function ToolGroup({
|
|
|
16194
16862
|
toolLabels,
|
|
16195
16863
|
tools
|
|
16196
16864
|
}) {
|
|
16197
|
-
const [expanded, setExpanded] = useState10(false);
|
|
16198
16865
|
const hostAwaitingApproval = tools.filter(
|
|
16199
16866
|
(tool) => pending.has(tool.toolCallId)
|
|
16200
16867
|
);
|
|
16201
16868
|
const serverAwaitingApproval = tools.filter(
|
|
16202
16869
|
(tool) => tool.state === "approval-requested" && tool.approvalId
|
|
16203
16870
|
);
|
|
16204
|
-
|
|
16205
|
-
|
|
16206
|
-
|
|
16207
|
-
|
|
16208
|
-
return /* @__PURE__ */ jsxs14("div", { className: "flex w-full max-w-[88%] flex-col gap-1.5 self-start", children: [
|
|
16871
|
+
if (hostAwaitingApproval.length === 0 && serverAwaitingApproval.length === 0) {
|
|
16872
|
+
return null;
|
|
16873
|
+
}
|
|
16874
|
+
return /* @__PURE__ */ jsxs15("div", { className: "flex w-full max-w-[88%] flex-col gap-1.5 self-start", children: [
|
|
16209
16875
|
hostAwaitingApproval.map((tool) => {
|
|
16210
16876
|
const approval = pending.get(tool.toolCallId);
|
|
16211
16877
|
if (!approval) {
|
|
@@ -16237,49 +16903,9 @@ function ToolGroup({
|
|
|
16237
16903
|
},
|
|
16238
16904
|
approvalId
|
|
16239
16905
|
);
|
|
16240
|
-
})
|
|
16241
|
-
/* @__PURE__ */ jsxs14(
|
|
16242
|
-
"button",
|
|
16243
|
-
{
|
|
16244
|
-
"aria-expanded": expanded,
|
|
16245
|
-
className: "flex cursor-pointer items-center gap-1.5 self-start rounded-md border-none bg-transparent px-1 py-0.5 font-[inherit] text-xs text-neutral-500 hover:bg-neutral-100",
|
|
16246
|
-
onClick: () => setExpanded((value) => !value),
|
|
16247
|
-
type: "button",
|
|
16248
|
-
children: [
|
|
16249
|
-
running ? /* @__PURE__ */ jsx28(Spinner, { small: true }) : /* @__PURE__ */ jsx28(
|
|
16250
|
-
"span",
|
|
16251
|
-
{
|
|
16252
|
-
className: cn(
|
|
16253
|
-
"flex items-center text-neutral-400 transition-transform duration-150 ease-in-out",
|
|
16254
|
-
expanded && "rotate-90"
|
|
16255
|
-
),
|
|
16256
|
-
children: /* @__PURE__ */ jsx28(ChevronIcon, {})
|
|
16257
|
-
}
|
|
16258
|
-
),
|
|
16259
|
-
/* @__PURE__ */ jsx28("span", { className: "font-medium", children: summary }),
|
|
16260
|
-
running && activeLabel && /* @__PURE__ */ jsxs14("span", { className: "overflow-hidden text-ellipsis whitespace-nowrap text-neutral-400", children: [
|
|
16261
|
-
"\xB7 ",
|
|
16262
|
-
activeLabel
|
|
16263
|
-
] })
|
|
16264
|
-
]
|
|
16265
|
-
}
|
|
16266
|
-
),
|
|
16267
|
-
expanded && /* @__PURE__ */ jsx28("div", { className: "flex flex-col gap-1 border-l border-neutral-200 pl-2.5", children: tools.map((tool) => /* @__PURE__ */ jsxs14(
|
|
16268
|
-
"div",
|
|
16269
|
-
{
|
|
16270
|
-
className: "inline-flex items-center gap-1.5 self-start rounded border border-solid border-neutral-200 bg-white px-1.5 py-0.5 font-mono text-[11px] tracking-[-0.01em] text-neutral-600",
|
|
16271
|
-
children: [
|
|
16272
|
-
isToolPartComplete(tool.state) ? /* @__PURE__ */ jsx28("span", { className: "size-1 shrink-0 rounded-full bg-neutral-400" }) : /* @__PURE__ */ jsx28(Spinner, { small: true }),
|
|
16273
|
-
/* @__PURE__ */ jsx28("span", { children: resolveToolDisplayLabel(tool.toolName, toolLabels) })
|
|
16274
|
-
]
|
|
16275
|
-
},
|
|
16276
|
-
tool.toolCallId
|
|
16277
|
-
)) })
|
|
16906
|
+
})
|
|
16278
16907
|
] });
|
|
16279
16908
|
}
|
|
16280
|
-
function resolveToolDisplayLabel(toolName, toolLabels) {
|
|
16281
|
-
return toolLabels[toolName] ?? humanizeToolName(toolName);
|
|
16282
|
-
}
|
|
16283
16909
|
|
|
16284
16910
|
// src/lib/support/ui/bubble.tsx
|
|
16285
16911
|
import { Slot as Slot4 } from "@radix-ui/react-slot";
|
|
@@ -16406,7 +17032,7 @@ function MessageFooter({ className, ...props }) {
|
|
|
16406
17032
|
}
|
|
16407
17033
|
|
|
16408
17034
|
// src/lib/support/SupportMessage.tsx
|
|
16409
|
-
import { Fragment as Fragment6, jsx as jsx31, jsxs as
|
|
17035
|
+
import { Fragment as Fragment6, jsx as jsx31, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
16410
17036
|
function SupportMessage({
|
|
16411
17037
|
branding,
|
|
16412
17038
|
group,
|
|
@@ -16427,6 +17053,10 @@ function SupportMessage({
|
|
|
16427
17053
|
const blocks = stripHiddenTools(
|
|
16428
17054
|
buildMessageBlocks(message),
|
|
16429
17055
|
collectHiddenToolCallIds(message)
|
|
17056
|
+
).filter(
|
|
17057
|
+
(block) => block.kind !== "tools" || block.tools.some(
|
|
17058
|
+
(tool) => pending.has(tool.toolCallId) || tool.state === "approval-requested" && !!tool.approvalId
|
|
17059
|
+
)
|
|
16430
17060
|
);
|
|
16431
17061
|
const attachmentUrls = readMessageAttachmentUrls(message);
|
|
16432
17062
|
if (blocks.length === 0 && !showHandoffCard && attachmentUrls.length === 0) {
|
|
@@ -16440,7 +17070,7 @@ function SupportMessage({
|
|
|
16440
17070
|
align: isCustomer ? "end" : "start",
|
|
16441
17071
|
className: "scw-message-in",
|
|
16442
17072
|
"data-message-id": message.id,
|
|
16443
|
-
children: /* @__PURE__ */
|
|
17073
|
+
children: /* @__PURE__ */ jsxs16(MessageContent, { className: "gap-[3px]", children: [
|
|
16444
17074
|
blocks.map((block, index2) => {
|
|
16445
17075
|
if (block.kind === "text") {
|
|
16446
17076
|
const isStreamingBlock = isStreaming && index2 === blocks.length - 1;
|
|
@@ -16457,9 +17087,9 @@ function SupportMessage({
|
|
|
16457
17087
|
BubbleContent,
|
|
16458
17088
|
{
|
|
16459
17089
|
className: cn(
|
|
16460
|
-
"text-[14px] leading-[1.45] whitespace-pre-wrap [&_strong]:font-semibold",
|
|
17090
|
+
"text-[14px] leading-[1.45] whitespace-pre-wrap [&_strong]:font-semibold [&_table]:whitespace-normal",
|
|
16461
17091
|
isCustomer && "rounded-2xl rounded-br-[4px] bg-neutral-900 px-[13px] py-[9px] text-white",
|
|
16462
|
-
isTeam && "rounded-2xl rounded-bl-[4px] bg-
|
|
17092
|
+
isTeam && "rounded-2xl rounded-bl-[4px] bg-neutral-100 px-[13px] py-[9px] text-neutral-950",
|
|
16463
17093
|
!isCustomer && !isTeam && "max-w-full rounded-none bg-transparent px-0 py-1 text-neutral-950"
|
|
16464
17094
|
),
|
|
16465
17095
|
children: renderMessageText(block.text, kbArticles, isStreamingBlock)
|
|
@@ -16489,7 +17119,7 @@ function SupportMessage({
|
|
|
16489
17119
|
"flex max-w-[88%] flex-col gap-1.5",
|
|
16490
17120
|
isCustomer && "self-end"
|
|
16491
17121
|
),
|
|
16492
|
-
children: attachmentUrls.map((url) => /* @__PURE__ */
|
|
17122
|
+
children: attachmentUrls.map((url) => /* @__PURE__ */ jsxs16(
|
|
16493
17123
|
Attachment,
|
|
16494
17124
|
{
|
|
16495
17125
|
className: "overflow-hidden rounded-xl border-0 p-0",
|
|
@@ -16522,19 +17152,19 @@ function SupportMessage({
|
|
|
16522
17152
|
showHandoffCard && handoffOffer && /* @__PURE__ */ jsx31(
|
|
16523
17153
|
HandoffCard,
|
|
16524
17154
|
{
|
|
16525
|
-
onConfirm: () => handoff.onConfirm(handoffOffer
|
|
17155
|
+
onConfirm: () => handoff.onConfirm(handoffOffer),
|
|
16526
17156
|
onDismiss: () => handoff.onDismiss(handoffOffer.toolCallId),
|
|
16527
17157
|
pending: handoff.pending,
|
|
16528
17158
|
reason: handoffOffer.reason
|
|
16529
17159
|
}
|
|
16530
17160
|
),
|
|
16531
|
-
(hasText || attachmentUrls.length > 0) && group.showTimestamp && /* @__PURE__ */ jsx31(MessageFooter, { className: "px-0 text-[11px] text-
|
|
17161
|
+
(hasText || attachmentUrls.length > 0) && group.showTimestamp && /* @__PURE__ */ jsx31(MessageFooter, { className: "px-0 text-[11px] text-neutral-500", children: isCustomer ? /* @__PURE__ */ jsx31(
|
|
16532
17162
|
CompactTime,
|
|
16533
17163
|
{
|
|
16534
17164
|
messageId: message.id,
|
|
16535
17165
|
timestamp: readCreatedAt(message)
|
|
16536
17166
|
}
|
|
16537
|
-
) : /* @__PURE__ */
|
|
17167
|
+
) : /* @__PURE__ */ jsxs16(Fragment6, { children: [
|
|
16538
17168
|
isTeam ? `${readAuthorName(message) ?? "Team"} \xB7 Team` : branding.agentLabel,
|
|
16539
17169
|
" ",
|
|
16540
17170
|
"\xB7",
|
|
@@ -16553,7 +17183,7 @@ function SupportMessage({
|
|
|
16553
17183
|
}
|
|
16554
17184
|
|
|
16555
17185
|
// src/lib/support/useFollowBottomAfterUserScroll.ts
|
|
16556
|
-
import { useEffect as
|
|
17186
|
+
import { useEffect as useEffect14 } from "react";
|
|
16557
17187
|
var SPACER_SELECTOR = "[data-message-scroller-spacer]";
|
|
16558
17188
|
var ANCHOR_SELECTOR = '[data-scroll-anchor="true"]';
|
|
16559
17189
|
var SCROLL_KEYS = /* @__PURE__ */ new Set([
|
|
@@ -16567,7 +17197,7 @@ var SCROLL_KEYS = /* @__PURE__ */ new Set([
|
|
|
16567
17197
|
]);
|
|
16568
17198
|
function useFollowBottomAfterUserScroll(scrollRef, scrollReleasedRef) {
|
|
16569
17199
|
const { scrollToEnd } = useMessageScroller();
|
|
16570
|
-
|
|
17200
|
+
useEffect14(() => {
|
|
16571
17201
|
const viewport = scrollRef.current;
|
|
16572
17202
|
const spacer = viewport?.querySelector(SPACER_SELECTOR);
|
|
16573
17203
|
const content = spacer?.parentElement;
|
|
@@ -16644,10 +17274,10 @@ function useFollowBottomAfterUserScroll(scrollRef, scrollReleasedRef) {
|
|
|
16644
17274
|
}
|
|
16645
17275
|
|
|
16646
17276
|
// src/lib/support/useLiftSpacerClamp.ts
|
|
16647
|
-
import { useEffect as
|
|
17277
|
+
import { useEffect as useEffect15 } from "react";
|
|
16648
17278
|
var SPACER_SELECTOR2 = "[data-message-scroller-spacer]";
|
|
16649
17279
|
function useLiftSpacerClamp(scrollRef) {
|
|
16650
|
-
|
|
17280
|
+
useEffect15(() => {
|
|
16651
17281
|
const viewport = scrollRef.current;
|
|
16652
17282
|
const spacer = viewport?.querySelector(SPACER_SELECTOR2);
|
|
16653
17283
|
const content = spacer?.parentElement;
|
|
@@ -16657,13 +17287,13 @@ function useLiftSpacerClamp(scrollRef) {
|
|
|
16657
17287
|
const frameWindow = viewport.ownerDocument.defaultView ?? window;
|
|
16658
17288
|
const ResizeObserverImpl = frameWindow.ResizeObserver ?? window.ResizeObserver;
|
|
16659
17289
|
let frame2 = 0;
|
|
16660
|
-
const
|
|
17290
|
+
const clamp3 = () => {
|
|
16661
17291
|
const ceiling = measureLiftCeiling(viewport, content, spacer);
|
|
16662
17292
|
spacer.style.maxHeight = `${ceiling}px`;
|
|
16663
17293
|
};
|
|
16664
17294
|
const observer2 = new ResizeObserverImpl(() => {
|
|
16665
17295
|
frameWindow.cancelAnimationFrame(frame2);
|
|
16666
|
-
frame2 = frameWindow.requestAnimationFrame(
|
|
17296
|
+
frame2 = frameWindow.requestAnimationFrame(clamp3);
|
|
16667
17297
|
});
|
|
16668
17298
|
observer2.observe(content);
|
|
16669
17299
|
observer2.observe(viewport);
|
|
@@ -16703,10 +17333,11 @@ function measureLiftCeiling(viewport, content, spacer) {
|
|
|
16703
17333
|
}
|
|
16704
17334
|
|
|
16705
17335
|
// src/lib/support/MessageList.tsx
|
|
16706
|
-
import { jsx as jsx32, jsxs as
|
|
17336
|
+
import { jsx as jsx32, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
16707
17337
|
function MessageList({
|
|
16708
17338
|
agentMuted,
|
|
16709
17339
|
branding,
|
|
17340
|
+
conversationState,
|
|
16710
17341
|
dismissedHandoffs,
|
|
16711
17342
|
error,
|
|
16712
17343
|
handoffPending,
|
|
@@ -16746,7 +17377,12 @@ function MessageList({
|
|
|
16746
17377
|
return null;
|
|
16747
17378
|
}, [messages]);
|
|
16748
17379
|
const showTyping = typingLabel !== null;
|
|
16749
|
-
const showWaiting =
|
|
17380
|
+
const showWaiting = shouldShowWaitingForTeammate({
|
|
17381
|
+
agentMuted,
|
|
17382
|
+
conversationState,
|
|
17383
|
+
isTyping: showTyping,
|
|
17384
|
+
messages
|
|
17385
|
+
});
|
|
16750
17386
|
const showError = !!error && !isTakeoverError;
|
|
16751
17387
|
const showSuggestions = messages.length === 0 && suggestions.length > 0;
|
|
16752
17388
|
return /* @__PURE__ */ jsx32(MessageScroller, { className: "relative flex min-h-0 min-w-0 flex-1 flex-col", children: /* @__PURE__ */ jsx32(
|
|
@@ -16767,16 +17403,19 @@ function MessageList({
|
|
|
16767
17403
|
),
|
|
16768
17404
|
id: "scw-message-list",
|
|
16769
17405
|
ref: scrollRef,
|
|
16770
|
-
children: /* @__PURE__ */
|
|
16771
|
-
/* @__PURE__ */ jsx32(MessageScrollerItem, { className: "max-w-full min-w-0", children: /* @__PURE__ */
|
|
16772
|
-
/* @__PURE__ */
|
|
17406
|
+
children: /* @__PURE__ */ jsxs17(MessageScrollerContent, { "aria-busy": isResponding, children: [
|
|
17407
|
+
/* @__PURE__ */ jsx32(MessageScrollerItem, { className: "max-w-full min-w-0", children: /* @__PURE__ */ jsxs17("div", { className: "flex flex-col gap-2.5", children: [
|
|
17408
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex items-start gap-2 pt-1", children: [
|
|
17409
|
+
/* @__PURE__ */ jsx32(Avatar, { branding }),
|
|
17410
|
+
/* @__PURE__ */ jsx32("div", { className: "max-w-[82%] rounded-[14px] bg-neutral-100 px-3 py-2 text-sm leading-[1.45] text-neutral-950", children: branding.greeting })
|
|
17411
|
+
] }),
|
|
16773
17412
|
showSuggestions && /* @__PURE__ */ jsx32(Suggestions, { onPick, suggestions })
|
|
16774
17413
|
] }) }, "intro"),
|
|
16775
17414
|
messages.map((message, index2) => {
|
|
16776
17415
|
const group = getWidgetMessageGroupFlags(messages, index2);
|
|
16777
17416
|
const isStreamingMessage = isResponding && index2 === messages.length - 1;
|
|
16778
17417
|
const isFirstTeamMessage = readSupportRole(message) === "team" && !messages.slice(0, index2).some((entry) => readSupportRole(entry) === "team");
|
|
16779
|
-
return /* @__PURE__ */
|
|
17418
|
+
return /* @__PURE__ */ jsxs17(
|
|
16780
17419
|
MessageScrollerItem,
|
|
16781
17420
|
{
|
|
16782
17421
|
className: cn(
|
|
@@ -16814,7 +17453,7 @@ function MessageList({
|
|
|
16814
17453
|
message.id
|
|
16815
17454
|
);
|
|
16816
17455
|
}),
|
|
16817
|
-
showThinking && /* @__PURE__ */ jsx32(MessageScrollerItem, { className: "max-w-full min-w-0", children: /* @__PURE__ */
|
|
17456
|
+
showThinking && /* @__PURE__ */ jsx32(MessageScrollerItem, { className: "max-w-full min-w-0", children: /* @__PURE__ */ jsxs17(
|
|
16818
17457
|
Marker,
|
|
16819
17458
|
{
|
|
16820
17459
|
className: "gap-2 py-0 text-xs text-neutral-500",
|
|
@@ -16825,7 +17464,7 @@ function MessageList({
|
|
|
16825
17464
|
]
|
|
16826
17465
|
}
|
|
16827
17466
|
) }, "thinking"),
|
|
16828
|
-
showTyping && /* @__PURE__ */ jsx32(MessageScrollerItem, { className: "max-w-full min-w-0", children: /* @__PURE__ */
|
|
17467
|
+
showTyping && /* @__PURE__ */ jsx32(MessageScrollerItem, { className: "max-w-full min-w-0", children: /* @__PURE__ */ jsxs17(
|
|
16829
17468
|
Marker,
|
|
16830
17469
|
{
|
|
16831
17470
|
className: "gap-2 py-0.5 text-xs text-neutral-500",
|
|
@@ -16836,7 +17475,7 @@ function MessageList({
|
|
|
16836
17475
|
]
|
|
16837
17476
|
}
|
|
16838
17477
|
) }, "typing"),
|
|
16839
|
-
showWaiting && /* @__PURE__ */ jsx32(MessageScrollerItem, { className: "max-w-full min-w-0", children: /* @__PURE__ */
|
|
17478
|
+
showWaiting && /* @__PURE__ */ jsx32(MessageScrollerItem, { className: "max-w-full min-w-0", children: /* @__PURE__ */ jsxs17(
|
|
16840
17479
|
Marker,
|
|
16841
17480
|
{
|
|
16842
17481
|
className: "gap-2 py-0.5 text-xs text-neutral-500",
|
|
@@ -16847,7 +17486,7 @@ function MessageList({
|
|
|
16847
17486
|
]
|
|
16848
17487
|
}
|
|
16849
17488
|
) }, "waiting"),
|
|
16850
|
-
showError && /* @__PURE__ */ jsx32(MessageScrollerItem, { className: "max-w-full min-w-0", children: /* @__PURE__ */
|
|
17489
|
+
showError && /* @__PURE__ */ jsx32(MessageScrollerItem, { className: "max-w-full min-w-0", children: /* @__PURE__ */ jsxs17("div", { className: "rounded-md border border-solid border-border bg-neutral-100 px-3 py-2.5 text-xs text-neutral-700", children: [
|
|
16851
17490
|
/* @__PURE__ */ jsx32("div", { className: "font-medium text-neutral-900", children: "Something went wrong" }),
|
|
16852
17491
|
/* @__PURE__ */ jsx32("div", { children: error?.message }),
|
|
16853
17492
|
/* @__PURE__ */ jsx32(
|
|
@@ -16864,10 +17503,6 @@ function MessageList({
|
|
|
16864
17503
|
}
|
|
16865
17504
|
) });
|
|
16866
17505
|
}
|
|
16867
|
-
function lastMessageIsFromTeam(messages) {
|
|
16868
|
-
const lastMessage = messages.at(-1);
|
|
16869
|
-
return !!lastMessage && readSupportRole(lastMessage) === "team";
|
|
16870
|
-
}
|
|
16871
17506
|
function useReportVisibleTeamMessagesSeen(messages, onTeamMessagesSeen) {
|
|
16872
17507
|
const { visibleMessageIds } = useMessageScrollerVisibility();
|
|
16873
17508
|
const teamMessageIds = useMemo7(() => {
|
|
@@ -16880,7 +17515,7 @@ function useReportVisibleTeamMessagesSeen(messages, onTeamMessagesSeen) {
|
|
|
16880
17515
|
return ids;
|
|
16881
17516
|
}, [messages]);
|
|
16882
17517
|
const visibleTeamKey = visibleMessageIds.filter((id3) => teamMessageIds.has(id3)).join(",");
|
|
16883
|
-
|
|
17518
|
+
useEffect16(() => {
|
|
16884
17519
|
if (!visibleTeamKey) {
|
|
16885
17520
|
return;
|
|
16886
17521
|
}
|
|
@@ -16890,29 +17525,32 @@ function useReportVisibleTeamMessagesSeen(messages, onTeamMessagesSeen) {
|
|
|
16890
17525
|
|
|
16891
17526
|
// src/lib/support/MessageScrollbar.tsx
|
|
16892
17527
|
import {
|
|
16893
|
-
useCallback as
|
|
16894
|
-
useEffect as
|
|
17528
|
+
useCallback as useCallback9,
|
|
17529
|
+
useEffect as useEffect17,
|
|
16895
17530
|
useLayoutEffect as useLayoutEffect3,
|
|
16896
|
-
useRef as
|
|
16897
|
-
useState as
|
|
17531
|
+
useRef as useRef14,
|
|
17532
|
+
useState as useState12
|
|
16898
17533
|
} from "react";
|
|
16899
17534
|
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
17535
|
+
var SCROLLBAR_HIDE_DELAY_MS = 700;
|
|
16900
17536
|
function MessageScrollbar({
|
|
16901
17537
|
recomputeKey,
|
|
16902
17538
|
scrollRef
|
|
16903
17539
|
}) {
|
|
16904
|
-
const trackRef =
|
|
16905
|
-
const thumbRef =
|
|
16906
|
-
const dragRef =
|
|
17540
|
+
const trackRef = useRef14(null);
|
|
17541
|
+
const thumbRef = useRef14(null);
|
|
17542
|
+
const dragRef = useRef14(
|
|
16907
17543
|
null
|
|
16908
17544
|
);
|
|
16909
|
-
const
|
|
17545
|
+
const hideTimerRef = useRef14(null);
|
|
17546
|
+
const [moving, setMoving] = useState12(false);
|
|
17547
|
+
const [thumb, setThumb] = useState12({
|
|
16910
17548
|
height: 0,
|
|
16911
17549
|
top: 0,
|
|
16912
17550
|
valueNow: 0,
|
|
16913
17551
|
visible: false
|
|
16914
17552
|
});
|
|
16915
|
-
const recompute =
|
|
17553
|
+
const recompute = useCallback9(() => {
|
|
16916
17554
|
const scroller = scrollRef.current;
|
|
16917
17555
|
const track = trackRef.current;
|
|
16918
17556
|
if (!(scroller && track)) {
|
|
@@ -16940,7 +17578,7 @@ function MessageScrollbar({
|
|
|
16940
17578
|
useLayoutEffect3(() => {
|
|
16941
17579
|
recompute();
|
|
16942
17580
|
}, [recompute, recomputeKey]);
|
|
16943
|
-
|
|
17581
|
+
useEffect17(() => {
|
|
16944
17582
|
const scroller = scrollRef.current;
|
|
16945
17583
|
const track = trackRef.current;
|
|
16946
17584
|
if (!(scroller && track)) {
|
|
@@ -16957,6 +17595,32 @@ function MessageScrollbar({
|
|
|
16957
17595
|
observer2.disconnect();
|
|
16958
17596
|
};
|
|
16959
17597
|
}, [recompute, scrollRef]);
|
|
17598
|
+
const revealWhileMoving = useCallback9(() => {
|
|
17599
|
+
setMoving(true);
|
|
17600
|
+
if (hideTimerRef.current) {
|
|
17601
|
+
clearTimeout(hideTimerRef.current);
|
|
17602
|
+
}
|
|
17603
|
+
hideTimerRef.current = setTimeout(() => {
|
|
17604
|
+
hideTimerRef.current = null;
|
|
17605
|
+
if (dragRef.current) {
|
|
17606
|
+
return;
|
|
17607
|
+
}
|
|
17608
|
+
setMoving(false);
|
|
17609
|
+
}, SCROLLBAR_HIDE_DELAY_MS);
|
|
17610
|
+
}, []);
|
|
17611
|
+
useEffect17(() => {
|
|
17612
|
+
const scroller = scrollRef.current;
|
|
17613
|
+
if (!scroller) {
|
|
17614
|
+
return;
|
|
17615
|
+
}
|
|
17616
|
+
scroller.addEventListener("scroll", revealWhileMoving, { passive: true });
|
|
17617
|
+
return () => {
|
|
17618
|
+
scroller.removeEventListener("scroll", revealWhileMoving);
|
|
17619
|
+
if (hideTimerRef.current) {
|
|
17620
|
+
clearTimeout(hideTimerRef.current);
|
|
17621
|
+
}
|
|
17622
|
+
};
|
|
17623
|
+
}, [revealWhileMoving, scrollRef]);
|
|
16960
17624
|
const onThumbPointerDown = (event) => {
|
|
16961
17625
|
const scroller = scrollRef.current;
|
|
16962
17626
|
if (!scroller) {
|
|
@@ -16991,11 +17655,15 @@ function MessageScrollbar({
|
|
|
16991
17655
|
const onThumbPointerUp = (event) => {
|
|
16992
17656
|
dragRef.current = null;
|
|
16993
17657
|
thumbRef.current?.releasePointerCapture(event.pointerId);
|
|
17658
|
+
revealWhileMoving();
|
|
16994
17659
|
};
|
|
16995
17660
|
return /* @__PURE__ */ jsx33(
|
|
16996
17661
|
"div",
|
|
16997
17662
|
{
|
|
16998
|
-
className: cn(
|
|
17663
|
+
className: cn(
|
|
17664
|
+
"scw-scrollbar",
|
|
17665
|
+
thumb.visible && moving && "scw-scrollbar-visible"
|
|
17666
|
+
),
|
|
16999
17667
|
ref: trackRef,
|
|
17000
17668
|
children: /* @__PURE__ */ jsx33(
|
|
17001
17669
|
"div",
|
|
@@ -17023,14 +17691,16 @@ function MessageScrollbar({
|
|
|
17023
17691
|
}
|
|
17024
17692
|
|
|
17025
17693
|
// src/lib/support/WidgetConversationView.tsx
|
|
17026
|
-
import { jsx as jsx34, jsxs as
|
|
17694
|
+
import { jsx as jsx34, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
17027
17695
|
function WidgetConversationView({
|
|
17028
17696
|
activeTransition,
|
|
17029
17697
|
agentMuted,
|
|
17030
17698
|
branding,
|
|
17699
|
+
conversationState,
|
|
17031
17700
|
dismissedHandoffs,
|
|
17032
17701
|
draft,
|
|
17033
17702
|
emailDraft,
|
|
17703
|
+
emailError,
|
|
17034
17704
|
error,
|
|
17035
17705
|
handoffPending,
|
|
17036
17706
|
imageInputRef,
|
|
@@ -17045,6 +17715,7 @@ function WidgetConversationView({
|
|
|
17045
17715
|
onConfirmHandoff,
|
|
17046
17716
|
onDismissHandoff,
|
|
17047
17717
|
onDraftChange,
|
|
17718
|
+
onEmailBlur,
|
|
17048
17719
|
onEmailChange,
|
|
17049
17720
|
onImageSelection,
|
|
17050
17721
|
onPick,
|
|
@@ -17084,7 +17755,7 @@ function WidgetConversationView({
|
|
|
17084
17755
|
session,
|
|
17085
17756
|
conversationLoaded
|
|
17086
17757
|
});
|
|
17087
|
-
return /* @__PURE__ */
|
|
17758
|
+
return /* @__PURE__ */ jsxs18(
|
|
17088
17759
|
MessageScrollerProvider,
|
|
17089
17760
|
{
|
|
17090
17761
|
defaultScrollPosition: "last-anchor",
|
|
@@ -17103,6 +17774,7 @@ function WidgetConversationView({
|
|
|
17103
17774
|
{
|
|
17104
17775
|
agentMuted,
|
|
17105
17776
|
branding,
|
|
17777
|
+
conversationState,
|
|
17106
17778
|
dismissedHandoffs,
|
|
17107
17779
|
error,
|
|
17108
17780
|
handoffPending,
|
|
@@ -17136,7 +17808,7 @@ function WidgetConversationView({
|
|
|
17136
17808
|
initial: isOpeningPanel ? false : "enter",
|
|
17137
17809
|
ref: composerWrapRef,
|
|
17138
17810
|
variants: composerVariants,
|
|
17139
|
-
children: /* @__PURE__ */
|
|
17811
|
+
children: /* @__PURE__ */ jsxs18(
|
|
17140
17812
|
motion.div,
|
|
17141
17813
|
{
|
|
17142
17814
|
animate: { opacity: isLoadingMessages ? 0 : 1 },
|
|
@@ -17162,10 +17834,12 @@ function WidgetConversationView({
|
|
|
17162
17834
|
{
|
|
17163
17835
|
draft,
|
|
17164
17836
|
emailDraft,
|
|
17837
|
+
emailError,
|
|
17165
17838
|
imageInputRef,
|
|
17166
17839
|
isLoading,
|
|
17167
17840
|
needsEmail,
|
|
17168
17841
|
onDraftChange,
|
|
17842
|
+
onEmailBlur,
|
|
17169
17843
|
onEmailChange,
|
|
17170
17844
|
onImageSelection,
|
|
17171
17845
|
onRemovePendingImage,
|
|
@@ -17232,12 +17906,12 @@ function useComposerHeightSync({
|
|
|
17232
17906
|
}
|
|
17233
17907
|
|
|
17234
17908
|
// src/lib/support/WidgetNav.tsx
|
|
17235
|
-
import { jsx as jsx35, jsxs as
|
|
17909
|
+
import { jsx as jsx35, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
17236
17910
|
function WidgetNav({
|
|
17237
17911
|
onNavigate,
|
|
17238
17912
|
view
|
|
17239
17913
|
}) {
|
|
17240
|
-
return /* @__PURE__ */
|
|
17914
|
+
return /* @__PURE__ */ jsxs19("div", { className: "flex border-t border-border bg-white", children: [
|
|
17241
17915
|
/* @__PURE__ */ jsx35(
|
|
17242
17916
|
NavTab,
|
|
17243
17917
|
{
|
|
@@ -17264,7 +17938,7 @@ function NavTab({
|
|
|
17264
17938
|
label,
|
|
17265
17939
|
onClick
|
|
17266
17940
|
}) {
|
|
17267
|
-
return /* @__PURE__ */
|
|
17941
|
+
return /* @__PURE__ */ jsxs19(
|
|
17268
17942
|
"button",
|
|
17269
17943
|
{
|
|
17270
17944
|
className: cn(
|
|
@@ -17282,7 +17956,7 @@ function NavTab({
|
|
|
17282
17956
|
}
|
|
17283
17957
|
|
|
17284
17958
|
// src/lib/support/WidgetPanel.tsx
|
|
17285
|
-
import { Fragment as Fragment7, jsx as jsx36, jsxs as
|
|
17959
|
+
import { Fragment as Fragment7, jsx as jsx36, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
17286
17960
|
function WidgetPanel(props) {
|
|
17287
17961
|
const {
|
|
17288
17962
|
activeTransition,
|
|
@@ -17290,6 +17964,7 @@ function WidgetPanel(props) {
|
|
|
17290
17964
|
isChat,
|
|
17291
17965
|
isFullscreen,
|
|
17292
17966
|
isOpeningPanel,
|
|
17967
|
+
hostOwnsLauncher: hostOwnsLauncher2,
|
|
17293
17968
|
onBack,
|
|
17294
17969
|
onClose,
|
|
17295
17970
|
onNavigate,
|
|
@@ -17298,22 +17973,28 @@ function WidgetPanel(props) {
|
|
|
17298
17973
|
view
|
|
17299
17974
|
} = props;
|
|
17300
17975
|
const panelMotionTransition = reduceMotion ? { duration: 0 } : PANEL_SPRING;
|
|
17301
|
-
const panelInitial = { opacity: 0, scale: PANEL_CLOSED_SCALE, y: 10 };
|
|
17976
|
+
const panelInitial = hostOwnsLauncher2 ? { opacity: 0, scale: PANEL_CLOSED_SCALE, y: 0 } : { opacity: 0, scale: PANEL_CLOSED_SCALE, y: 10 };
|
|
17302
17977
|
const panelOpen = { opacity: 1, scale: 1, y: 0 };
|
|
17303
|
-
const panelExit = {
|
|
17978
|
+
const panelExit = hostOwnsLauncher2 ? {
|
|
17979
|
+
opacity: 0,
|
|
17980
|
+
scale: PANEL_CLOSED_SCALE,
|
|
17981
|
+
transition: { duration: 0 },
|
|
17982
|
+
y: 0
|
|
17983
|
+
} : {
|
|
17304
17984
|
opacity: 0,
|
|
17305
17985
|
scale: PANEL_CLOSED_SCALE,
|
|
17306
17986
|
transition: { duration: 0 },
|
|
17307
17987
|
y: 10
|
|
17308
17988
|
};
|
|
17309
17989
|
const isEmbedded = isCrossOriginEmbed();
|
|
17990
|
+
const paintPanelShadow = !isEmbedded || isDashboardPreview();
|
|
17310
17991
|
return /* @__PURE__ */ jsx36(
|
|
17311
17992
|
motion.div,
|
|
17312
17993
|
{
|
|
17313
17994
|
animate: panelOpen,
|
|
17314
17995
|
className: cn(
|
|
17315
|
-
"scw-panel relative flex h-[var(--scw-panel-height,
|
|
17316
|
-
|
|
17996
|
+
"scw-panel relative flex h-[var(--scw-panel-height,680px)] w-[var(--scw-panel-width,384px)] max-w-full origin-bottom-right flex-col overflow-hidden rounded-[var(--scw-panel-radius)] border border-solid border-border bg-white backface-hidden antialiased",
|
|
17997
|
+
paintPanelShadow && "shadow-[0_10px_15px_-3px_rgba(0,0,0,.1),0_4px_6px_-4px_rgba(0,0,0,.1)]",
|
|
17317
17998
|
isFullscreen && "border-none rounded-none shadow-none"
|
|
17318
17999
|
),
|
|
17319
18000
|
exit: panelExit,
|
|
@@ -17344,9 +18025,11 @@ function BrandedPanelBody({
|
|
|
17344
18025
|
agentMuted,
|
|
17345
18026
|
branding,
|
|
17346
18027
|
composerWrapRef,
|
|
18028
|
+
conversationState,
|
|
17347
18029
|
dismissedHandoffs,
|
|
17348
18030
|
draft,
|
|
17349
18031
|
emailDraft,
|
|
18032
|
+
emailError,
|
|
17350
18033
|
error,
|
|
17351
18034
|
handoffPending,
|
|
17352
18035
|
imageInputRef,
|
|
@@ -17363,6 +18046,7 @@ function BrandedPanelBody({
|
|
|
17363
18046
|
onConfirmHandoff,
|
|
17364
18047
|
onDismissHandoff,
|
|
17365
18048
|
onDraftChange,
|
|
18049
|
+
onEmailBlur,
|
|
17366
18050
|
onEmailChange,
|
|
17367
18051
|
onImageSelection,
|
|
17368
18052
|
onNavigate,
|
|
@@ -17394,7 +18078,7 @@ function BrandedPanelBody({
|
|
|
17394
18078
|
toolLabels,
|
|
17395
18079
|
view
|
|
17396
18080
|
}) {
|
|
17397
|
-
return /* @__PURE__ */
|
|
18081
|
+
return /* @__PURE__ */ jsxs20(Fragment7, { children: [
|
|
17398
18082
|
/* @__PURE__ */ jsx36(
|
|
17399
18083
|
PanelHeader,
|
|
17400
18084
|
{
|
|
@@ -17405,7 +18089,7 @@ function BrandedPanelBody({
|
|
|
17405
18089
|
view
|
|
17406
18090
|
}
|
|
17407
18091
|
),
|
|
17408
|
-
/* @__PURE__ */ jsx36("div", { className: "relative flex flex-1 overflow-hidden", children: /* @__PURE__ */ jsx36(AnimatePresence, { custom: activeTransition, initial: false, children: /* @__PURE__ */
|
|
18092
|
+
/* @__PURE__ */ jsx36("div", { className: "relative flex flex-1 overflow-hidden", children: /* @__PURE__ */ jsx36(AnimatePresence, { custom: activeTransition, initial: false, children: /* @__PURE__ */ jsxs20(
|
|
17409
18093
|
motion.div,
|
|
17410
18094
|
{
|
|
17411
18095
|
animate: "center",
|
|
@@ -17420,14 +18104,15 @@ function BrandedPanelBody({
|
|
|
17420
18104
|
{
|
|
17421
18105
|
branding,
|
|
17422
18106
|
conversations: sortedHistory,
|
|
18107
|
+
onPick,
|
|
17423
18108
|
onResume,
|
|
17424
|
-
onStartNew
|
|
18109
|
+
onStartNew,
|
|
18110
|
+
suggestions
|
|
17425
18111
|
}
|
|
17426
18112
|
),
|
|
17427
18113
|
view === "messages" && /* @__PURE__ */ jsx36(
|
|
17428
18114
|
MessagesView,
|
|
17429
18115
|
{
|
|
17430
|
-
activeConversationId: session?.conversationId,
|
|
17431
18116
|
branding,
|
|
17432
18117
|
conversations: sortedHistory,
|
|
17433
18118
|
onResume,
|
|
@@ -17441,9 +18126,11 @@ function BrandedPanelBody({
|
|
|
17441
18126
|
agentMuted,
|
|
17442
18127
|
branding,
|
|
17443
18128
|
composerWrapRef,
|
|
18129
|
+
conversationState,
|
|
17444
18130
|
dismissedHandoffs,
|
|
17445
18131
|
draft,
|
|
17446
18132
|
emailDraft,
|
|
18133
|
+
emailError,
|
|
17447
18134
|
error,
|
|
17448
18135
|
handoffPending,
|
|
17449
18136
|
imageInputRef,
|
|
@@ -17458,6 +18145,7 @@ function BrandedPanelBody({
|
|
|
17458
18145
|
onConfirmHandoff,
|
|
17459
18146
|
onDismissHandoff,
|
|
17460
18147
|
onDraftChange,
|
|
18148
|
+
onEmailBlur,
|
|
17461
18149
|
onEmailChange,
|
|
17462
18150
|
onImageSelection,
|
|
17463
18151
|
onPick,
|
|
@@ -17504,17 +18192,17 @@ function BrandedPanelBody({
|
|
|
17504
18192
|
] });
|
|
17505
18193
|
}
|
|
17506
18194
|
function PanelLoadingShell({ onClose }) {
|
|
17507
|
-
return /* @__PURE__ */
|
|
17508
|
-
/* @__PURE__ */ jsx36("div", { className: "relative flex min-h-[calc(var(--scw-header-padding)*2+var(--scw-header-btn-size))] items-center justify-center gap-2 border-b border-
|
|
18195
|
+
return /* @__PURE__ */ jsxs20(Fragment7, { children: [
|
|
18196
|
+
/* @__PURE__ */ jsx36("div", { className: "relative flex min-h-[calc(var(--scw-header-padding)*2+var(--scw-header-btn-size))] items-center justify-center gap-2 border-b border-border p-[var(--scw-header-padding)]", children: onClose ? /* @__PURE__ */ jsx36(
|
|
17509
18197
|
"button",
|
|
17510
18198
|
{
|
|
17511
18199
|
"aria-label": "Close chat",
|
|
17512
|
-
className: "absolute top-[var(--scw-header-padding)] right-[var(--scw-header-padding)] flex size-[var(--scw-header-btn-size)] shrink-0 items-center justify-center rounded-[var(--scw-header-btn-concentric)] border-none bg-transparent p-0 text-neutral-600 hover:bg-
|
|
18200
|
+
className: "absolute top-[var(--scw-header-padding)] right-[var(--scw-header-padding)] flex size-[var(--scw-header-btn-size)] shrink-0 items-center justify-center rounded-[var(--scw-header-btn-concentric)] border-none bg-transparent p-0 text-neutral-600 hover:bg-neutral-100 hover:text-neutral-700",
|
|
17513
18201
|
onClick: onClose,
|
|
17514
18202
|
type: "button",
|
|
17515
18203
|
children: /* @__PURE__ */ jsx36(CloseIcon, {})
|
|
17516
18204
|
}
|
|
17517
|
-
) }),
|
|
18205
|
+
) : null }),
|
|
17518
18206
|
/* @__PURE__ */ jsx36(
|
|
17519
18207
|
"div",
|
|
17520
18208
|
{
|
|
@@ -17527,34 +18215,42 @@ function PanelLoadingShell({ onClose }) {
|
|
|
17527
18215
|
}
|
|
17528
18216
|
|
|
17529
18217
|
// src/lib/support/Widget.tsx
|
|
17530
|
-
import { jsx as jsx37, jsxs as
|
|
18218
|
+
import { jsx as jsx37, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
17531
18219
|
function SupportWidgetInner({
|
|
17532
18220
|
baseUrl,
|
|
17533
18221
|
getStateSnapshot,
|
|
17534
18222
|
placeholder = "Message...",
|
|
17535
18223
|
projectId,
|
|
18224
|
+
startOpen = false,
|
|
17536
18225
|
suggestions
|
|
17537
18226
|
}) {
|
|
17538
|
-
const
|
|
17539
|
-
const emailStorageKey =
|
|
17540
|
-
|
|
17541
|
-
|
|
18227
|
+
const dashboardPreview = isDashboardPreview();
|
|
18228
|
+
const { emailStorageKey, storageKey } = widgetSessionStorageKeys(
|
|
18229
|
+
projectId,
|
|
18230
|
+
dashboardPreview
|
|
18231
|
+
);
|
|
18232
|
+
const [isOpen, setIsOpen] = useState13(startOpen);
|
|
18233
|
+
const [isOpeningPanel, setIsOpeningPanel] = useState13(startOpen);
|
|
17542
18234
|
const reduceMotion = useReducedMotion();
|
|
17543
|
-
const [view, setView] =
|
|
17544
|
-
const [returnView, setReturnView] =
|
|
17545
|
-
const
|
|
17546
|
-
|
|
18235
|
+
const [view, setView] = useState13("home");
|
|
18236
|
+
const [returnView, setReturnView] = useState13("home");
|
|
18237
|
+
const previewShell2 = useSyncExternalStore2(
|
|
18238
|
+
subscribeToRegistry,
|
|
18239
|
+
getPreviewShell,
|
|
18240
|
+
getPreviewShell
|
|
18241
|
+
);
|
|
18242
|
+
const [branding, setBranding] = useState13(
|
|
18243
|
+
() => previewShell2?.branding ?? readBrandingCache(projectId)
|
|
17547
18244
|
);
|
|
17548
|
-
const [
|
|
17549
|
-
const [
|
|
17550
|
-
const [
|
|
17551
|
-
const [
|
|
17552
|
-
const [pendingImages, setPendingImages] = useState12([]);
|
|
18245
|
+
const [resolvedSuggestions, setResolvedSuggestions] = useState13(previewShell2?.suggestions ?? suggestions ?? DEFAULT_SUGGESTIONS);
|
|
18246
|
+
const [dashboardTools, setDashboardTools] = useState13([]);
|
|
18247
|
+
const [draft, setDraft] = useState13("");
|
|
18248
|
+
const [pendingImages, setPendingImages] = useState13([]);
|
|
17553
18249
|
const pendingImageUrls = useMemo8(
|
|
17554
18250
|
() => pendingImages.map((file) => URL.createObjectURL(file)),
|
|
17555
18251
|
[pendingImages]
|
|
17556
18252
|
);
|
|
17557
|
-
|
|
18253
|
+
useEffect18(
|
|
17558
18254
|
() => () => {
|
|
17559
18255
|
for (const url of pendingImageUrls) {
|
|
17560
18256
|
URL.revokeObjectURL(url);
|
|
@@ -17562,8 +18258,8 @@ function SupportWidgetInner({
|
|
|
17562
18258
|
},
|
|
17563
18259
|
[pendingImageUrls]
|
|
17564
18260
|
);
|
|
17565
|
-
const sentImageUrlsRef =
|
|
17566
|
-
|
|
18261
|
+
const sentImageUrlsRef = useRef15([]);
|
|
18262
|
+
useEffect18(
|
|
17567
18263
|
() => () => {
|
|
17568
18264
|
for (const url of sentImageUrlsRef.current) {
|
|
17569
18265
|
URL.revokeObjectURL(url);
|
|
@@ -17571,30 +18267,25 @@ function SupportWidgetInner({
|
|
|
17571
18267
|
},
|
|
17572
18268
|
[]
|
|
17573
18269
|
);
|
|
17574
|
-
const [emailDraft, setEmailDraft] =
|
|
17575
|
-
const [
|
|
17576
|
-
const [sendError, setSendError] =
|
|
17577
|
-
const [agentMuted, setAgentMuted] =
|
|
17578
|
-
const [conversation, setConversation] =
|
|
18270
|
+
const [emailDraft, setEmailDraft] = useState13("");
|
|
18271
|
+
const [emailTouched, setEmailTouched] = useState13(false);
|
|
18272
|
+
const [sendError, setSendError] = useState13(null);
|
|
18273
|
+
const [agentMuted, setAgentMuted] = useState13(false);
|
|
18274
|
+
const [conversation, setConversation] = useState13(
|
|
17579
18275
|
null
|
|
17580
18276
|
);
|
|
17581
|
-
const [conversationLoaded, setConversationLoaded] =
|
|
17582
|
-
const
|
|
17583
|
-
() => /* @__PURE__ */ new Set()
|
|
17584
|
-
);
|
|
17585
|
-
const [handoffPending, setHandoffPending] = useState12(false);
|
|
17586
|
-
const handoffPendingRef = useRef13(false);
|
|
17587
|
-
const scrollRef = useRef13(null);
|
|
18277
|
+
const [conversationLoaded, setConversationLoaded] = useState13(false);
|
|
18278
|
+
const scrollRef = useRef15(null);
|
|
17588
18279
|
useOverscrollBounce(scrollRef, view === "chat", !!reduceMotion);
|
|
17589
|
-
const scrollReleasedRef =
|
|
17590
|
-
const composerWrapRef =
|
|
17591
|
-
const rootElRef =
|
|
17592
|
-
const textareaRef =
|
|
17593
|
-
const imageInputRef =
|
|
17594
|
-
|
|
18280
|
+
const scrollReleasedRef = useRef15(false);
|
|
18281
|
+
const composerWrapRef = useRef15(null);
|
|
18282
|
+
const rootElRef = useRef15(null);
|
|
18283
|
+
const textareaRef = useRef15(null);
|
|
18284
|
+
const imageInputRef = useRef15(null);
|
|
18285
|
+
useEffect18(() => {
|
|
17595
18286
|
injectStyles();
|
|
17596
18287
|
}, []);
|
|
17597
|
-
|
|
18288
|
+
useEffect18(() => {
|
|
17598
18289
|
const root = rootElRef.current;
|
|
17599
18290
|
if (!root) {
|
|
17600
18291
|
return;
|
|
@@ -17621,20 +18312,25 @@ function SupportWidgetInner({
|
|
|
17621
18312
|
getUserJwt,
|
|
17622
18313
|
getUserJwt
|
|
17623
18314
|
);
|
|
18315
|
+
const identityRef = useRef15(identity2);
|
|
18316
|
+
const userJwtRef = useRef15(userJwt2);
|
|
18317
|
+
const sessionRef = useRef15(null);
|
|
18318
|
+
identityRef.current = identity2;
|
|
18319
|
+
userJwtRef.current = userJwt2;
|
|
18320
|
+
const hostOwnsLauncher2 = useSyncExternalStore2(
|
|
18321
|
+
subscribeToRegistry,
|
|
18322
|
+
getHostOwnsLauncher,
|
|
18323
|
+
getHostOwnsLauncher
|
|
18324
|
+
);
|
|
17624
18325
|
const toolLabels = useMemo8(
|
|
17625
18326
|
() => buildToolDisplayLabelMap(dashboardTools),
|
|
17626
18327
|
[dashboardTools]
|
|
17627
18328
|
);
|
|
17628
|
-
const
|
|
17629
|
-
const
|
|
17630
|
-
const snapshotRef = useRef13(getStateSnapshot);
|
|
17631
|
-
const identityRef = useRef13(identity2);
|
|
17632
|
-
const userJwtRef = useRef13(userJwt2);
|
|
18329
|
+
const toolsRef = useRef15(dashboardTools);
|
|
18330
|
+
const snapshotRef = useRef15(getStateSnapshot);
|
|
17633
18331
|
toolsRef.current = dashboardTools;
|
|
17634
18332
|
snapshotRef.current = getStateSnapshot;
|
|
17635
|
-
|
|
17636
|
-
userJwtRef.current = userJwt2;
|
|
17637
|
-
const openWidget2 = useCallback8(() => {
|
|
18333
|
+
const openWidget2 = useCallback10(() => {
|
|
17638
18334
|
primeMessageChime();
|
|
17639
18335
|
setIsOpeningPanel(true);
|
|
17640
18336
|
setIsOpen(true);
|
|
@@ -17645,22 +18341,28 @@ function SupportWidgetInner({
|
|
|
17645
18341
|
setView("home");
|
|
17646
18342
|
}
|
|
17647
18343
|
}, []);
|
|
17648
|
-
|
|
18344
|
+
const closePanel = useCallback10(() => {
|
|
18345
|
+
if (dashboardPreview) {
|
|
18346
|
+
return;
|
|
18347
|
+
}
|
|
18348
|
+
setIsOpen(false);
|
|
18349
|
+
}, [dashboardPreview]);
|
|
18350
|
+
useLayoutEffect5(() => {
|
|
17649
18351
|
setOpenControls({
|
|
17650
|
-
close:
|
|
18352
|
+
close: closePanel,
|
|
17651
18353
|
open: openWidget2
|
|
17652
18354
|
});
|
|
17653
18355
|
return () => {
|
|
17654
18356
|
setOpenControls(null);
|
|
17655
18357
|
};
|
|
17656
|
-
}, [openWidget2]);
|
|
17657
|
-
|
|
18358
|
+
}, [closePanel, openWidget2]);
|
|
18359
|
+
useEffect18(() => {
|
|
17658
18360
|
if (!isOpen) {
|
|
17659
18361
|
setIsOpeningPanel(false);
|
|
17660
18362
|
}
|
|
17661
18363
|
}, [isOpen]);
|
|
17662
|
-
|
|
17663
|
-
if (!isOpen) {
|
|
18364
|
+
useEffect18(() => {
|
|
18365
|
+
if (!isOpen || dashboardPreview) {
|
|
17664
18366
|
return;
|
|
17665
18367
|
}
|
|
17666
18368
|
function handleKeyDown(event) {
|
|
@@ -17668,143 +18370,20 @@ function SupportWidgetInner({
|
|
|
17668
18370
|
return;
|
|
17669
18371
|
}
|
|
17670
18372
|
event.preventDefault();
|
|
17671
|
-
|
|
18373
|
+
closePanel();
|
|
17672
18374
|
}
|
|
17673
18375
|
window.addEventListener("keydown", handleKeyDown);
|
|
17674
18376
|
return () => {
|
|
17675
18377
|
window.removeEventListener("keydown", handleKeyDown);
|
|
17676
18378
|
};
|
|
17677
|
-
}, [isOpen]);
|
|
17678
|
-
const
|
|
17679
|
-
const
|
|
17680
|
-
const
|
|
17681
|
-
const
|
|
17682
|
-
const
|
|
17683
|
-
const
|
|
17684
|
-
|
|
17685
|
-
const refreshSessionHistory = useCallback8(() => {
|
|
17686
|
-
const jwt = userJwtRef.current;
|
|
17687
|
-
if (jwt) {
|
|
17688
|
-
void (async () => {
|
|
17689
|
-
try {
|
|
17690
|
-
const rows = await listConversations({
|
|
17691
|
-
baseUrl,
|
|
17692
|
-
projectId,
|
|
17693
|
-
userJwt: jwt
|
|
17694
|
-
});
|
|
17695
|
-
setSessionHistory(
|
|
17696
|
-
rows.map((row) => ({
|
|
17697
|
-
conversationId: row.conversationId,
|
|
17698
|
-
preview: row.preview,
|
|
17699
|
-
sessionToken: row.sessionToken,
|
|
17700
|
-
updatedAt: row.updatedAt
|
|
17701
|
-
}))
|
|
17702
|
-
);
|
|
17703
|
-
} catch {
|
|
17704
|
-
setSessionHistory(readSessionHistory(storageKey));
|
|
17705
|
-
}
|
|
17706
|
-
})();
|
|
17707
|
-
return;
|
|
17708
|
-
}
|
|
17709
|
-
setSessionHistory(readSessionHistory(storageKey));
|
|
17710
|
-
}, [baseUrl, projectId, storageKey]);
|
|
17711
|
-
useEffect16(() => {
|
|
17712
|
-
const stored = readStoredSession(storageKey);
|
|
17713
|
-
sessionRef.current = stored;
|
|
17714
|
-
setSession(stored);
|
|
17715
|
-
if (stored) {
|
|
17716
|
-
ensureActiveSessionInHistory(storageKey, stored);
|
|
17717
|
-
}
|
|
17718
|
-
refreshSessionHistory();
|
|
17719
|
-
}, [refreshSessionHistory, storageKey]);
|
|
17720
|
-
const resumedJwtRef = useRef13(null);
|
|
17721
|
-
useEffect16(() => {
|
|
17722
|
-
if (!userJwt2 || resumedJwtRef.current === userJwt2) {
|
|
17723
|
-
return;
|
|
17724
|
-
}
|
|
17725
|
-
const jwt = userJwt2;
|
|
17726
|
-
resumedJwtRef.current = jwt;
|
|
17727
|
-
let cancelled = false;
|
|
17728
|
-
async function resume() {
|
|
17729
|
-
try {
|
|
17730
|
-
const resumed = await resumeSession({
|
|
17731
|
-
baseUrl,
|
|
17732
|
-
projectId,
|
|
17733
|
-
userJwt: jwt
|
|
17734
|
-
});
|
|
17735
|
-
if (cancelled || !resumed) {
|
|
17736
|
-
return;
|
|
17737
|
-
}
|
|
17738
|
-
const next = {
|
|
17739
|
-
conversationId: resumed.conversationId,
|
|
17740
|
-
sessionToken: resumed.sessionToken
|
|
17741
|
-
};
|
|
17742
|
-
sessionRef.current = next;
|
|
17743
|
-
setSession(next);
|
|
17744
|
-
storeSession(storageKey, next);
|
|
17745
|
-
ensureActiveSessionInHistory(storageKey, next);
|
|
17746
|
-
setConversation(resumed.conversation);
|
|
17747
|
-
setConversationLoaded(true);
|
|
17748
|
-
setAgentMuted(!resumed.conversation.agentEnabled);
|
|
17749
|
-
refreshSessionHistory();
|
|
17750
|
-
} catch {
|
|
17751
|
-
resumedJwtRef.current = null;
|
|
17752
|
-
}
|
|
17753
|
-
}
|
|
17754
|
-
void resume();
|
|
17755
|
-
return () => {
|
|
17756
|
-
cancelled = true;
|
|
17757
|
-
};
|
|
17758
|
-
}, [baseUrl, projectId, userJwt2, refreshSessionHistory, storageKey]);
|
|
17759
|
-
const prevOwnerRef = useRef13(void 0);
|
|
17760
|
-
const prevJwtPresentRef = useRef13(false);
|
|
17761
|
-
useEffect16(() => {
|
|
17762
|
-
const ownerId = identity2?.distinctId ?? identity2?.email ?? null;
|
|
17763
|
-
const jwtPresent = Boolean(userJwt2);
|
|
17764
|
-
const previousOwner = prevOwnerRef.current;
|
|
17765
|
-
const previousJwtPresent = prevJwtPresentRef.current;
|
|
17766
|
-
prevOwnerRef.current = ownerId;
|
|
17767
|
-
prevJwtPresentRef.current = jwtPresent;
|
|
17768
|
-
function wipeForIdentitySwitch() {
|
|
17769
|
-
resetChatState();
|
|
17770
|
-
sessionRef.current = null;
|
|
17771
|
-
setSession(null);
|
|
17772
|
-
resumedJwtRef.current = null;
|
|
17773
|
-
try {
|
|
17774
|
-
window.localStorage.removeItem(emailStorageKey);
|
|
17775
|
-
} catch {
|
|
17776
|
-
}
|
|
17777
|
-
setCapturedEmail(null);
|
|
17778
|
-
refreshSessionHistory();
|
|
17779
|
-
}
|
|
17780
|
-
if (ownerId) {
|
|
17781
|
-
const { cleared } = reconcileSessionOwner(storageKey, ownerId);
|
|
17782
|
-
if (cleared) {
|
|
17783
|
-
wipeForIdentitySwitch();
|
|
17784
|
-
} else {
|
|
17785
|
-
refreshSessionHistory();
|
|
17786
|
-
}
|
|
17787
|
-
return;
|
|
17788
|
-
}
|
|
17789
|
-
if ((previousOwner || previousJwtPresent) && !jwtPresent) {
|
|
17790
|
-
clearChatStorage(storageKey);
|
|
17791
|
-
wipeForIdentitySwitch();
|
|
17792
|
-
return;
|
|
17793
|
-
}
|
|
17794
|
-
if (jwtPresent) {
|
|
17795
|
-
refreshSessionHistory();
|
|
17796
|
-
}
|
|
17797
|
-
}, [identity2, userJwt2, storageKey, emailStorageKey, refreshSessionHistory]);
|
|
17798
|
-
useEffect16(() => {
|
|
17799
|
-
try {
|
|
17800
|
-
const stored = window.localStorage.getItem(emailStorageKey);
|
|
17801
|
-
if (stored) {
|
|
17802
|
-
setCapturedEmail(stored);
|
|
17803
|
-
}
|
|
17804
|
-
} catch {
|
|
17805
|
-
}
|
|
17806
|
-
}, [emailStorageKey]);
|
|
17807
|
-
useEffect16(() => {
|
|
18379
|
+
}, [closePanel, dashboardPreview, isOpen]);
|
|
18380
|
+
const mergedIdsRef = useRef15(/* @__PURE__ */ new Set());
|
|
18381
|
+
const reportedSeenMessageIdsRef = useRef15(/* @__PURE__ */ new Set());
|
|
18382
|
+
const seededRef = useRef15(false);
|
|
18383
|
+
const brandingFetchStartedRef = useRef15(false);
|
|
18384
|
+
const pendingPersistRef = useRef15(null);
|
|
18385
|
+
const sendInFlightRef = useRef15(false);
|
|
18386
|
+
useEffect18(() => {
|
|
17808
18387
|
if (brandingFetchStartedRef.current) {
|
|
17809
18388
|
return;
|
|
17810
18389
|
}
|
|
@@ -17814,8 +18393,15 @@ function SupportWidgetInner({
|
|
|
17814
18393
|
try {
|
|
17815
18394
|
const result = await getWidgetConfig({ baseUrl, projectId });
|
|
17816
18395
|
if (!cancelled) {
|
|
17817
|
-
|
|
17818
|
-
|
|
18396
|
+
if (!dashboardPreview) {
|
|
18397
|
+
writeBrandingCache(projectId, result.branding);
|
|
18398
|
+
}
|
|
18399
|
+
if (!getPreviewShell()) {
|
|
18400
|
+
setBranding(result.branding);
|
|
18401
|
+
if (Array.isArray(result.suggestions)) {
|
|
18402
|
+
setResolvedSuggestions(result.suggestions);
|
|
18403
|
+
}
|
|
18404
|
+
}
|
|
17819
18405
|
setDashboardTools(
|
|
17820
18406
|
result.tools.map((tool) => reconstructDashboardTool(tool))
|
|
17821
18407
|
);
|
|
@@ -17831,8 +18417,15 @@ function SupportWidgetInner({
|
|
|
17831
18417
|
return () => {
|
|
17832
18418
|
cancelled = true;
|
|
17833
18419
|
};
|
|
17834
|
-
}, [baseUrl, projectId]);
|
|
17835
|
-
|
|
18420
|
+
}, [baseUrl, dashboardPreview, projectId]);
|
|
18421
|
+
useEffect18(() => {
|
|
18422
|
+
if (!previewShell2) {
|
|
18423
|
+
return;
|
|
18424
|
+
}
|
|
18425
|
+
setBranding(previewShell2.branding);
|
|
18426
|
+
setResolvedSuggestions(previewShell2.suggestions);
|
|
18427
|
+
}, [previewShell2]);
|
|
18428
|
+
const runTool = useCallback10((toolCall) => {
|
|
17836
18429
|
const match = toolsRef.current.find(
|
|
17837
18430
|
(entry) => normalizeToolName(entry.name) === toolCall.toolName
|
|
17838
18431
|
);
|
|
@@ -17850,7 +18443,7 @@ function SupportWidgetInner({
|
|
|
17850
18443
|
}
|
|
17851
18444
|
return match.execute(toolCall.input ?? {});
|
|
17852
18445
|
}, []);
|
|
17853
|
-
const onToolCallRef =
|
|
18446
|
+
const onToolCallRef = useRef15(() => {
|
|
17854
18447
|
});
|
|
17855
18448
|
const {
|
|
17856
18449
|
addToolApprovalResponse,
|
|
@@ -17880,9 +18473,9 @@ function SupportWidgetInner({
|
|
|
17880
18473
|
messages: outgoing,
|
|
17881
18474
|
projectId,
|
|
17882
18475
|
sessionToken: sessionRef.current?.sessionToken ?? "",
|
|
17883
|
-
stateSnapshot:
|
|
17884
|
-
|
|
17885
|
-
|
|
18476
|
+
stateSnapshot: pickScalarRecord({
|
|
18477
|
+
...identityRef.current?.traits,
|
|
18478
|
+
...isRecord(liveSnapshot) ? liveSnapshot : {}
|
|
17886
18479
|
}),
|
|
17887
18480
|
userJwt: userJwtRef.current ?? void 0
|
|
17888
18481
|
}
|
|
@@ -17906,70 +18499,68 @@ function SupportWidgetInner({
|
|
|
17906
18499
|
}
|
|
17907
18500
|
return onToolCall(event);
|
|
17908
18501
|
};
|
|
18502
|
+
function resetChatState() {
|
|
18503
|
+
stop();
|
|
18504
|
+
setMessages([]);
|
|
18505
|
+
clearPending();
|
|
18506
|
+
mergedIdsRef.current = /* @__PURE__ */ new Set();
|
|
18507
|
+
reportedSeenMessageIdsRef.current = /* @__PURE__ */ new Set();
|
|
18508
|
+
seededRef.current = false;
|
|
18509
|
+
setAgentMuted(false);
|
|
18510
|
+
setConversation(null);
|
|
18511
|
+
setConversationLoaded(false);
|
|
18512
|
+
setSendError(null);
|
|
18513
|
+
setDraft("");
|
|
18514
|
+
setPendingImages([]);
|
|
18515
|
+
}
|
|
18516
|
+
const {
|
|
18517
|
+
capturedEmail,
|
|
18518
|
+
refreshSessionHistory,
|
|
18519
|
+
session,
|
|
18520
|
+
sessionHistory,
|
|
18521
|
+
setCapturedEmail,
|
|
18522
|
+
setSession
|
|
18523
|
+
} = useVisitorConversationPersistence({
|
|
18524
|
+
baseUrl,
|
|
18525
|
+
emailStorageKey,
|
|
18526
|
+
identity: identity2,
|
|
18527
|
+
onIdentityWipe: resetChatState,
|
|
18528
|
+
onResumed: (resumedConversation) => {
|
|
18529
|
+
setConversation(resumedConversation);
|
|
18530
|
+
setConversationLoaded(true);
|
|
18531
|
+
setAgentMuted(!resumedConversation.agentEnabled);
|
|
18532
|
+
},
|
|
18533
|
+
projectId,
|
|
18534
|
+
sessionRef,
|
|
18535
|
+
storageKey,
|
|
18536
|
+
userJwt: userJwt2
|
|
18537
|
+
});
|
|
18538
|
+
const knownEmail = identity2?.email ?? capturedEmail;
|
|
17909
18539
|
const isLoading = status === "submitted" || status === "streaming";
|
|
17910
|
-
const messagesRef =
|
|
18540
|
+
const messagesRef = useRef15(messages);
|
|
17911
18541
|
messagesRef.current = messages;
|
|
17912
|
-
const isLoadingRef =
|
|
18542
|
+
const isLoadingRef = useRef15(isLoading);
|
|
17913
18543
|
isLoadingRef.current = isLoading;
|
|
17914
18544
|
const { chimedMessageIdsRef } = useInboundMessageChime({
|
|
17915
18545
|
isLoading,
|
|
17916
18546
|
messages
|
|
17917
18547
|
});
|
|
17918
18548
|
const isTakeoverError = !!error && error.message.includes("human_takeover");
|
|
17919
|
-
|
|
18549
|
+
useEffect18(() => {
|
|
17920
18550
|
if (isTakeoverError) {
|
|
17921
18551
|
setAgentMuted(true);
|
|
17922
18552
|
}
|
|
17923
18553
|
}, [isTakeoverError]);
|
|
17924
|
-
const confirmHandoff =
|
|
17925
|
-
|
|
17926
|
-
|
|
17927
|
-
|
|
17928
|
-
|
|
17929
|
-
|
|
17930
|
-
|
|
17931
|
-
|
|
17932
|
-
|
|
17933
|
-
|
|
17934
|
-
baseUrl,
|
|
17935
|
-
conversationId: active.conversationId,
|
|
17936
|
-
projectId,
|
|
17937
|
-
reason,
|
|
17938
|
-
sessionToken: active.sessionToken
|
|
17939
|
-
});
|
|
17940
|
-
setAgentMuted(true);
|
|
17941
|
-
if (result.acknowledgment) {
|
|
17942
|
-
mergedIdsRef.current.add(result.acknowledgment.id);
|
|
17943
|
-
setMessages([
|
|
17944
|
-
...messagesRef.current,
|
|
17945
|
-
toUiMessage(result.acknowledgment)
|
|
17946
|
-
]);
|
|
17947
|
-
}
|
|
17948
|
-
} catch {
|
|
17949
|
-
} finally {
|
|
17950
|
-
handoffPendingRef.current = false;
|
|
17951
|
-
setHandoffPending(false);
|
|
17952
|
-
}
|
|
17953
|
-
},
|
|
17954
|
-
[baseUrl, projectId, setMessages]
|
|
17955
|
-
);
|
|
17956
|
-
const dismissHandoff = useCallback8(
|
|
17957
|
-
(toolCallId) => {
|
|
17958
|
-
setDismissedHandoffs((prev) => {
|
|
17959
|
-
if (prev.has(toolCallId)) {
|
|
17960
|
-
return prev;
|
|
17961
|
-
}
|
|
17962
|
-
const next = new Set(prev);
|
|
17963
|
-
next.add(toolCallId);
|
|
17964
|
-
return next;
|
|
17965
|
-
});
|
|
17966
|
-
setMessages(
|
|
17967
|
-
(current) => markHandoffDeclinedInMessages(current, toolCallId)
|
|
17968
|
-
);
|
|
17969
|
-
},
|
|
17970
|
-
[setMessages]
|
|
17971
|
-
);
|
|
17972
|
-
useEffect16(() => {
|
|
18554
|
+
const { confirmHandoff, dismissedHandoffs, dismissHandoff, handoffPending } = useHandoffDecisions({
|
|
18555
|
+
baseUrl,
|
|
18556
|
+
mergedIdsRef,
|
|
18557
|
+
messagesRef,
|
|
18558
|
+
onAccepted: () => setAgentMuted(true),
|
|
18559
|
+
projectId,
|
|
18560
|
+
sessionRef,
|
|
18561
|
+
setMessages
|
|
18562
|
+
});
|
|
18563
|
+
useEffect18(() => {
|
|
17973
18564
|
if (!isOpen || !session) {
|
|
17974
18565
|
return;
|
|
17975
18566
|
}
|
|
@@ -18018,7 +18609,7 @@ function SupportWidgetInner({
|
|
|
18018
18609
|
setDraft(value);
|
|
18019
18610
|
reportDraftActivity(value);
|
|
18020
18611
|
}
|
|
18021
|
-
const reportTeamMessagesSeen =
|
|
18612
|
+
const reportTeamMessagesSeen = useCallback10(
|
|
18022
18613
|
(messageIds) => {
|
|
18023
18614
|
const activeSession = sessionRef.current;
|
|
18024
18615
|
const unseenMessageIds = messageIds.filter(
|
|
@@ -18045,7 +18636,7 @@ function SupportWidgetInner({
|
|
|
18045
18636
|
},
|
|
18046
18637
|
[baseUrl, projectId]
|
|
18047
18638
|
);
|
|
18048
|
-
|
|
18639
|
+
useEffect18(() => {
|
|
18049
18640
|
if (!conversation) {
|
|
18050
18641
|
return;
|
|
18051
18642
|
}
|
|
@@ -18092,7 +18683,11 @@ function SupportWidgetInner({
|
|
|
18092
18683
|
el.style.height = `${Math.min(el.scrollHeight, MAX_TEXTAREA_HEIGHT_PX)}px`;
|
|
18093
18684
|
}, [draft]);
|
|
18094
18685
|
const needsEmail = !session && !knownEmail;
|
|
18686
|
+
const emailError = needsEmail && emailTouched ? resolveEmailDraftError(emailDraft) : null;
|
|
18095
18687
|
async function handleSubmit(event) {
|
|
18688
|
+
if (needsEmail) {
|
|
18689
|
+
setEmailTouched(true);
|
|
18690
|
+
}
|
|
18096
18691
|
stopTyping();
|
|
18097
18692
|
await submitWidgetMessage(event, {
|
|
18098
18693
|
agentMuted,
|
|
@@ -18131,20 +18726,6 @@ function SupportWidgetInner({
|
|
|
18131
18726
|
function removePendingImage(index2) {
|
|
18132
18727
|
setPendingImages((current) => current.filter((_, i) => i !== index2));
|
|
18133
18728
|
}
|
|
18134
|
-
function resetChatState() {
|
|
18135
|
-
stop();
|
|
18136
|
-
setMessages([]);
|
|
18137
|
-
clearPending();
|
|
18138
|
-
mergedIdsRef.current = /* @__PURE__ */ new Set();
|
|
18139
|
-
reportedSeenMessageIdsRef.current = /* @__PURE__ */ new Set();
|
|
18140
|
-
seededRef.current = false;
|
|
18141
|
-
setAgentMuted(false);
|
|
18142
|
-
setConversation(null);
|
|
18143
|
-
setConversationLoaded(false);
|
|
18144
|
-
setSendError(null);
|
|
18145
|
-
setDraft("");
|
|
18146
|
-
setPendingImages([]);
|
|
18147
|
-
}
|
|
18148
18729
|
function startNewConversation() {
|
|
18149
18730
|
startNewConversationAction({
|
|
18150
18731
|
resetChatState,
|
|
@@ -18170,6 +18751,9 @@ function SupportWidgetInner({
|
|
|
18170
18751
|
});
|
|
18171
18752
|
}
|
|
18172
18753
|
function pickSuggestion(prompt) {
|
|
18754
|
+
if (view !== "chat") {
|
|
18755
|
+
startNewConversation();
|
|
18756
|
+
}
|
|
18173
18757
|
handleDraftChange(prompt);
|
|
18174
18758
|
textareaRef.current?.focus();
|
|
18175
18759
|
}
|
|
@@ -18190,15 +18774,15 @@ function SupportWidgetInner({
|
|
|
18190
18774
|
conversation,
|
|
18191
18775
|
conversationLoaded
|
|
18192
18776
|
});
|
|
18193
|
-
const prevViewRef =
|
|
18777
|
+
const prevViewRef = useRef15(view);
|
|
18194
18778
|
const viewTransition = useMemo8(
|
|
18195
18779
|
() => deriveViewTransition(view, prevViewRef.current),
|
|
18196
18780
|
[view]
|
|
18197
18781
|
);
|
|
18198
|
-
|
|
18782
|
+
useEffect18(() => {
|
|
18199
18783
|
prevViewRef.current = view;
|
|
18200
18784
|
}, [view]);
|
|
18201
|
-
|
|
18785
|
+
useEffect18(() => {
|
|
18202
18786
|
if (isOpen && view === "chat") {
|
|
18203
18787
|
focusComposer(textareaRef);
|
|
18204
18788
|
}
|
|
@@ -18208,12 +18792,13 @@ function SupportWidgetInner({
|
|
|
18208
18792
|
viewTransition
|
|
18209
18793
|
);
|
|
18210
18794
|
const isFullscreen = isOpen && isMobile;
|
|
18211
|
-
return /* @__PURE__ */
|
|
18795
|
+
return /* @__PURE__ */ jsxs21(
|
|
18212
18796
|
"div",
|
|
18213
18797
|
{
|
|
18214
18798
|
className: cn(
|
|
18215
|
-
"box-border flex
|
|
18799
|
+
"box-border flex flex-none flex-col text-sm leading-[1.45] text-neutral-900 [&_*]:box-border",
|
|
18216
18800
|
"[font-family:var(--scw-font)]",
|
|
18801
|
+
dashboardPreview ? "h-full w-full max-w-full items-center justify-center p-0" : hostOwnsLauncher2 ? "w-max items-end p-0" : "w-max items-end gap-3 p-4",
|
|
18217
18802
|
isFullscreen && "h-full w-full p-0"
|
|
18218
18803
|
),
|
|
18219
18804
|
ref: rootElRef,
|
|
@@ -18228,6 +18813,7 @@ function SupportWidgetInner({
|
|
|
18228
18813
|
dismissedHandoffs,
|
|
18229
18814
|
draft,
|
|
18230
18815
|
emailDraft,
|
|
18816
|
+
emailError,
|
|
18231
18817
|
error,
|
|
18232
18818
|
handoffPending,
|
|
18233
18819
|
imageInputRef,
|
|
@@ -18236,15 +18822,17 @@ function SupportWidgetInner({
|
|
|
18236
18822
|
isLoading,
|
|
18237
18823
|
isLoadingMessages,
|
|
18238
18824
|
isOpeningPanel,
|
|
18825
|
+
hostOwnsLauncher: hostOwnsLauncher2,
|
|
18239
18826
|
isTakeoverError,
|
|
18240
18827
|
messages,
|
|
18241
18828
|
needsEmail,
|
|
18242
18829
|
onApprove: approve,
|
|
18243
18830
|
onBack: () => setView(returnView),
|
|
18244
|
-
onClose:
|
|
18831
|
+
onClose: dashboardPreview ? void 0 : closePanel,
|
|
18245
18832
|
onConfirmHandoff: confirmHandoff,
|
|
18246
18833
|
onDismissHandoff: dismissHandoff,
|
|
18247
18834
|
onDraftChange: handleDraftChange,
|
|
18835
|
+
onEmailBlur: () => setEmailTouched(true),
|
|
18248
18836
|
onEmailChange: setEmailDraft,
|
|
18249
18837
|
onImageSelection: handleImageSelection,
|
|
18250
18838
|
onNavigate: setView,
|
|
@@ -18275,19 +18863,20 @@ function SupportWidgetInner({
|
|
|
18275
18863
|
session,
|
|
18276
18864
|
showThinking,
|
|
18277
18865
|
sortedHistory,
|
|
18278
|
-
suggestions:
|
|
18866
|
+
suggestions: resolvedSuggestions,
|
|
18279
18867
|
textareaRef,
|
|
18280
18868
|
typingLabel,
|
|
18281
18869
|
conversationLoaded,
|
|
18870
|
+
conversationState: conversation?.state ?? null,
|
|
18282
18871
|
toolLabels,
|
|
18283
18872
|
view
|
|
18284
18873
|
}
|
|
18285
18874
|
) }),
|
|
18286
|
-
!isFullscreen && /* @__PURE__ */ jsx37(
|
|
18875
|
+
!isFullscreen && !hostOwnsLauncher2 && !dashboardPreview && /* @__PURE__ */ jsx37(
|
|
18287
18876
|
WidgetLauncher,
|
|
18288
18877
|
{
|
|
18289
18878
|
isOpen,
|
|
18290
|
-
onClose:
|
|
18879
|
+
onClose: closePanel,
|
|
18291
18880
|
onOpen: openWidget2,
|
|
18292
18881
|
reduceMotion
|
|
18293
18882
|
}
|