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.cjs
CHANGED
|
@@ -76,12 +76,17 @@ __export(support_exports, {
|
|
|
76
76
|
});
|
|
77
77
|
module.exports = __toCommonJS(support_exports);
|
|
78
78
|
|
|
79
|
-
// ../../support/shared/src/lib/
|
|
79
|
+
// ../../support/shared/src/lib/widget/supportEmbedBridge.ts
|
|
80
80
|
var BRIDGE_SOURCE = "saasco-support";
|
|
81
81
|
var BRIDGE_PROTOCOL_VERSION = 1;
|
|
82
82
|
var BRIDGE_REQUEST_TIMEOUT_MS = 15e3;
|
|
83
83
|
|
|
84
|
-
// ../../
|
|
84
|
+
// ../../utils/shared/src/lib/isRecord.ts
|
|
85
|
+
function isRecord(value) {
|
|
86
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// ../../support/shared/src/lib/widget/supportEmbedBridgeParse.ts
|
|
85
90
|
function createEnvelope(message) {
|
|
86
91
|
return {
|
|
87
92
|
source: BRIDGE_SOURCE,
|
|
@@ -188,9 +193,6 @@ function matchesOriginPattern(origin, pattern) {
|
|
|
188
193
|
function isOriginAllowed(origin, patterns) {
|
|
189
194
|
return patterns.some((pattern) => matchesOriginPattern(origin, pattern));
|
|
190
195
|
}
|
|
191
|
-
function isRecord(value) {
|
|
192
|
-
return typeof value === "object" && value !== null;
|
|
193
|
-
}
|
|
194
196
|
function readEnvelope(data) {
|
|
195
197
|
if (!isRecord(data)) {
|
|
196
198
|
return null;
|
|
@@ -229,7 +231,12 @@ function parseIdentityBearingMessage(msg) {
|
|
|
229
231
|
if (msg.identity !== null && !isRecord(msg.identity)) {
|
|
230
232
|
return null;
|
|
231
233
|
}
|
|
232
|
-
|
|
234
|
+
const identity2 = sanitizeBridgeIdentity(msg.identity);
|
|
235
|
+
if (msg.type === "identify") {
|
|
236
|
+
return { ...msg, identity: identity2 };
|
|
237
|
+
}
|
|
238
|
+
const hostLauncher = msg.hostLauncher === true ? true : msg.hostLauncher === false ? false : void 0;
|
|
239
|
+
return { ...msg, hostLauncher, identity: identity2 };
|
|
233
240
|
}
|
|
234
241
|
function isValidPageContextMessage(msg) {
|
|
235
242
|
return typeof msg.requestId === "string" && isRecord(msg.context) && typeof msg.context.url === "string";
|
|
@@ -240,7 +247,10 @@ var stateSnapshot;
|
|
|
240
247
|
var identity = null;
|
|
241
248
|
var userJwt = null;
|
|
242
249
|
var hostViewport = null;
|
|
250
|
+
var hostOwnsLauncher = false;
|
|
251
|
+
var previewShell = null;
|
|
243
252
|
var openControls = null;
|
|
253
|
+
var pendingOpenCommand = null;
|
|
244
254
|
var subscribers = /* @__PURE__ */ new Set();
|
|
245
255
|
function notify() {
|
|
246
256
|
for (const cb of subscribers) {
|
|
@@ -281,6 +291,19 @@ function setHostViewport(next) {
|
|
|
281
291
|
function getHostViewport() {
|
|
282
292
|
return hostViewport;
|
|
283
293
|
}
|
|
294
|
+
function setHostOwnsLauncher(next) {
|
|
295
|
+
if (hostOwnsLauncher === next) {
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
hostOwnsLauncher = next;
|
|
299
|
+
notify();
|
|
300
|
+
}
|
|
301
|
+
function getHostOwnsLauncher() {
|
|
302
|
+
return hostOwnsLauncher;
|
|
303
|
+
}
|
|
304
|
+
function getPreviewShell() {
|
|
305
|
+
return previewShell;
|
|
306
|
+
}
|
|
284
307
|
function resetSession() {
|
|
285
308
|
identity = null;
|
|
286
309
|
userJwt = null;
|
|
@@ -298,12 +321,32 @@ function subscribeToRegistry(cb) {
|
|
|
298
321
|
}
|
|
299
322
|
function setOpenControls(controls) {
|
|
300
323
|
openControls = controls;
|
|
324
|
+
if (!controls || pendingOpenCommand === null) {
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
const shouldOpen = pendingOpenCommand;
|
|
328
|
+
pendingOpenCommand = null;
|
|
329
|
+
if (shouldOpen) {
|
|
330
|
+
controls.open();
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
controls.close();
|
|
301
334
|
}
|
|
302
335
|
function openWidget() {
|
|
303
|
-
openControls
|
|
336
|
+
if (openControls) {
|
|
337
|
+
pendingOpenCommand = null;
|
|
338
|
+
openControls.open();
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
pendingOpenCommand = true;
|
|
304
342
|
}
|
|
305
343
|
function closeWidget() {
|
|
306
|
-
openControls
|
|
344
|
+
if (openControls) {
|
|
345
|
+
pendingOpenCommand = null;
|
|
346
|
+
openControls.close();
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
pendingOpenCommand = false;
|
|
307
350
|
}
|
|
308
351
|
|
|
309
352
|
// src/lib/support/embedBridge.ts
|
|
@@ -324,7 +367,7 @@ function post(message) {
|
|
|
324
367
|
if (!parent || parent === window) {
|
|
325
368
|
return;
|
|
326
369
|
}
|
|
327
|
-
const targetOrigin = message.type === "resize" ? "*" : parentOrigin ?? "*";
|
|
370
|
+
const targetOrigin = message.type === "resize" || message.type === "openState" ? "*" : parentOrigin ?? "*";
|
|
328
371
|
parent.postMessage(createEnvelope(message), targetOrigin);
|
|
329
372
|
}
|
|
330
373
|
function handleHostMessage(message) {
|
|
@@ -336,6 +379,7 @@ function handleHostMessage(message) {
|
|
|
336
379
|
if (message.viewport) {
|
|
337
380
|
setHostViewport(message.viewport);
|
|
338
381
|
}
|
|
382
|
+
setHostOwnsLauncher(message.hostLauncher === true);
|
|
339
383
|
break;
|
|
340
384
|
}
|
|
341
385
|
case "shutdown": {
|
|
@@ -429,6 +473,9 @@ function initEmbedBridge(options) {
|
|
|
429
473
|
function postResize(width, height, fullscreen = false) {
|
|
430
474
|
post({ fullscreen, height, type: "resize", width });
|
|
431
475
|
}
|
|
476
|
+
function postOpenState(open, fullscreen = false) {
|
|
477
|
+
post({ fullscreen, open, type: "openState" });
|
|
478
|
+
}
|
|
432
479
|
function postLauncherState(scale2, hovered) {
|
|
433
480
|
post({ hovered, scale: scale2, type: "launcherState" });
|
|
434
481
|
}
|
|
@@ -483,10 +530,20 @@ function executeHostTool(name, args, request) {
|
|
|
483
530
|
}
|
|
484
531
|
|
|
485
532
|
// src/lib/support/Widget.tsx
|
|
486
|
-
var
|
|
533
|
+
var import_react42 = require("@ai-sdk/react");
|
|
487
534
|
|
|
488
535
|
// ../../chat/client/src/lib/core/chatSessionStorage.ts
|
|
489
536
|
var MAX_SESSION_HISTORY = 50;
|
|
537
|
+
function chatStorage() {
|
|
538
|
+
if (typeof window === "undefined") {
|
|
539
|
+
return null;
|
|
540
|
+
}
|
|
541
|
+
try {
|
|
542
|
+
return window.localStorage ?? null;
|
|
543
|
+
} catch {
|
|
544
|
+
return null;
|
|
545
|
+
}
|
|
546
|
+
}
|
|
490
547
|
function historyStorageKey(activeKey) {
|
|
491
548
|
return `${activeKey}-history`;
|
|
492
549
|
}
|
|
@@ -500,12 +557,13 @@ function isStoredChatSessionEntry(value) {
|
|
|
500
557
|
return isStoredChatSession(value) && "preview" in value && "updatedAt" in value && typeof value.preview === "string" && typeof value.updatedAt === "number";
|
|
501
558
|
}
|
|
502
559
|
function readStoredSession(storageKey) {
|
|
503
|
-
|
|
560
|
+
const storage = chatStorage();
|
|
561
|
+
if (!storage) {
|
|
504
562
|
return null;
|
|
505
563
|
}
|
|
506
564
|
try {
|
|
507
565
|
const parsed = JSON.parse(
|
|
508
|
-
|
|
566
|
+
storage.getItem(storageKey) ?? "null"
|
|
509
567
|
);
|
|
510
568
|
return parsed?.conversationId && parsed?.sessionToken ? parsed : null;
|
|
511
569
|
} catch {
|
|
@@ -513,12 +571,13 @@ function readStoredSession(storageKey) {
|
|
|
513
571
|
}
|
|
514
572
|
}
|
|
515
573
|
function readSessionHistory(storageKey) {
|
|
516
|
-
|
|
574
|
+
const storage = chatStorage();
|
|
575
|
+
if (!storage) {
|
|
517
576
|
return [];
|
|
518
577
|
}
|
|
519
578
|
try {
|
|
520
579
|
const parsed = JSON.parse(
|
|
521
|
-
|
|
580
|
+
storage.getItem(historyStorageKey(storageKey)) ?? "[]"
|
|
522
581
|
);
|
|
523
582
|
if (!Array.isArray(parsed)) {
|
|
524
583
|
return [];
|
|
@@ -529,12 +588,18 @@ function readSessionHistory(storageKey) {
|
|
|
529
588
|
}
|
|
530
589
|
}
|
|
531
590
|
function storeSession(storageKey, session) {
|
|
532
|
-
|
|
533
|
-
|
|
591
|
+
const storage = chatStorage();
|
|
592
|
+
if (!storage) {
|
|
593
|
+
return;
|
|
594
|
+
}
|
|
595
|
+
try {
|
|
596
|
+
storage.setItem(storageKey, JSON.stringify(session));
|
|
597
|
+
} catch {
|
|
534
598
|
}
|
|
535
599
|
}
|
|
536
600
|
function upsertSessionHistory(storageKey, session, patch) {
|
|
537
|
-
|
|
601
|
+
const storage = chatStorage();
|
|
602
|
+
if (!storage) {
|
|
538
603
|
return;
|
|
539
604
|
}
|
|
540
605
|
const now2 = Date.now();
|
|
@@ -556,10 +621,10 @@ function upsertSessionHistory(storageKey, session, patch) {
|
|
|
556
621
|
(entry) => entry.conversationId !== session.conversationId
|
|
557
622
|
)
|
|
558
623
|
].slice(0, MAX_SESSION_HISTORY);
|
|
559
|
-
|
|
560
|
-
historyStorageKey(storageKey),
|
|
561
|
-
|
|
562
|
-
|
|
624
|
+
try {
|
|
625
|
+
storage.setItem(historyStorageKey(storageKey), JSON.stringify(nextHistory));
|
|
626
|
+
} catch {
|
|
627
|
+
}
|
|
563
628
|
}
|
|
564
629
|
function ensureActiveSessionInHistory(storageKey, session) {
|
|
565
630
|
const history = readSessionHistory(storageKey);
|
|
@@ -569,31 +634,45 @@ function ensureActiveSessionInHistory(storageKey, session) {
|
|
|
569
634
|
upsertSessionHistory(storageKey, session);
|
|
570
635
|
}
|
|
571
636
|
function clearStoredSession(storageKey) {
|
|
572
|
-
|
|
573
|
-
|
|
637
|
+
const storage = chatStorage();
|
|
638
|
+
if (!storage) {
|
|
639
|
+
return;
|
|
640
|
+
}
|
|
641
|
+
try {
|
|
642
|
+
storage.removeItem(storageKey);
|
|
643
|
+
} catch {
|
|
574
644
|
}
|
|
575
645
|
}
|
|
576
646
|
function clearChatStorage(storageKey) {
|
|
577
|
-
|
|
647
|
+
const storage = chatStorage();
|
|
648
|
+
if (!storage) {
|
|
578
649
|
return;
|
|
579
650
|
}
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
651
|
+
try {
|
|
652
|
+
storage.removeItem(storageKey);
|
|
653
|
+
storage.removeItem(historyStorageKey(storageKey));
|
|
654
|
+
storage.removeItem(ownerStorageKey(storageKey));
|
|
655
|
+
} catch {
|
|
656
|
+
}
|
|
583
657
|
}
|
|
584
658
|
function reconcileSessionOwner(storageKey, ownerId) {
|
|
585
|
-
|
|
659
|
+
const storage = chatStorage();
|
|
660
|
+
if (!storage || !ownerId) {
|
|
586
661
|
return { cleared: false };
|
|
587
662
|
}
|
|
588
|
-
|
|
589
|
-
|
|
663
|
+
try {
|
|
664
|
+
const stored = storage.getItem(ownerStorageKey(storageKey));
|
|
665
|
+
if (stored === ownerId) {
|
|
666
|
+
return { cleared: false };
|
|
667
|
+
}
|
|
668
|
+
if (stored && stored !== ownerId) {
|
|
669
|
+
clearChatStorage(storageKey);
|
|
670
|
+
}
|
|
671
|
+
storage.setItem(ownerStorageKey(storageKey), ownerId);
|
|
672
|
+
return { cleared: Boolean(stored) && stored !== ownerId };
|
|
673
|
+
} catch {
|
|
590
674
|
return { cleared: false };
|
|
591
675
|
}
|
|
592
|
-
if (stored && stored !== ownerId) {
|
|
593
|
-
clearChatStorage(storageKey);
|
|
594
|
-
}
|
|
595
|
-
window.localStorage.setItem(ownerStorageKey(storageKey), ownerId);
|
|
596
|
-
return { cleared: Boolean(stored) && stored !== ownerId };
|
|
597
676
|
}
|
|
598
677
|
|
|
599
678
|
// ../../chat/client/src/lib/core/playMessageChime.ts
|
|
@@ -795,42 +874,7 @@ function useToolApprovals({
|
|
|
795
874
|
return { approve, clearPending, onToolCall, pending, reject };
|
|
796
875
|
}
|
|
797
876
|
|
|
798
|
-
// ../../support/shared/src/lib/
|
|
799
|
-
function buildMergedStateSnapshot(layers) {
|
|
800
|
-
const merged = {};
|
|
801
|
-
const ordered = [
|
|
802
|
-
layers.browserContext,
|
|
803
|
-
layers.identifyTraits,
|
|
804
|
-
layers.envelope,
|
|
805
|
-
toRecord(layers.hostSnapshot)
|
|
806
|
-
];
|
|
807
|
-
for (const layer of ordered) {
|
|
808
|
-
if (!layer) {
|
|
809
|
-
continue;
|
|
810
|
-
}
|
|
811
|
-
for (const [key, value] of Object.entries(layer)) {
|
|
812
|
-
const scalar = coerceScalar(value);
|
|
813
|
-
if (scalar !== void 0) {
|
|
814
|
-
merged[key] = scalar;
|
|
815
|
-
}
|
|
816
|
-
}
|
|
817
|
-
}
|
|
818
|
-
return merged;
|
|
819
|
-
}
|
|
820
|
-
function coerceScalar(value) {
|
|
821
|
-
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
822
|
-
return value;
|
|
823
|
-
}
|
|
824
|
-
return void 0;
|
|
825
|
-
}
|
|
826
|
-
function toRecord(value) {
|
|
827
|
-
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
828
|
-
return value;
|
|
829
|
-
}
|
|
830
|
-
return void 0;
|
|
831
|
-
}
|
|
832
|
-
|
|
833
|
-
// ../../support/shared/src/lib/types/kbCitations.ts
|
|
877
|
+
// ../../support/shared/src/lib/message/kbCitations.ts
|
|
834
878
|
var import_zod = require("zod");
|
|
835
879
|
var KB_CITATION_MARKER_PATTERN = /\[\[kb:([^\]]+)\]\]/gu;
|
|
836
880
|
var KbCitationSchema = import_zod.z.object({
|
|
@@ -838,8 +882,6 @@ var KbCitationSchema = import_zod.z.object({
|
|
|
838
882
|
title: import_zod.z.string(),
|
|
839
883
|
url: import_zod.z.string()
|
|
840
884
|
});
|
|
841
|
-
|
|
842
|
-
// ../../support/shared/src/lib/kbCitations.ts
|
|
843
885
|
function stripKbCitationMarkers(text) {
|
|
844
886
|
return text.replaceAll(KB_CITATION_MARKER_PATTERN, "");
|
|
845
887
|
}
|
|
@@ -868,8 +910,9 @@ function buildKbCitationNumberMap(text) {
|
|
|
868
910
|
return map;
|
|
869
911
|
}
|
|
870
912
|
|
|
871
|
-
// ../../support/shared/src/lib/normalizeToolName.ts
|
|
913
|
+
// ../../support/shared/src/lib/tools/normalizeToolName.ts
|
|
872
914
|
var CLOSE_CONVERSATION_TOOL_NAME = "close_conversation";
|
|
915
|
+
var REPORT_KNOWLEDGE_GAP_TOOL_NAME = "report_knowledge_gap";
|
|
873
916
|
var REQUEST_HUMAN_HANDOFF_TOOL_NAME = "request_human_handoff";
|
|
874
917
|
function normalizeToolName(displayName) {
|
|
875
918
|
return displayName.trim().toLowerCase().replaceAll(/[^a-z0-9]+/gu, "_").replaceAll(/_+/gu, "_").replaceAll(/^_+|_+$/gu, "").slice(0, 64);
|
|
@@ -886,8 +929,35 @@ function buildToolDisplayLabelMap(tools) {
|
|
|
886
929
|
return labels;
|
|
887
930
|
}
|
|
888
931
|
|
|
932
|
+
// ../../support/shared/src/lib/tools/toolContext.ts
|
|
933
|
+
function pickScalarRecord(value) {
|
|
934
|
+
if (!isRecord(value)) {
|
|
935
|
+
return {};
|
|
936
|
+
}
|
|
937
|
+
const scalars = {};
|
|
938
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
939
|
+
if (typeof entry === "string" || typeof entry === "number" || typeof entry === "boolean") {
|
|
940
|
+
scalars[key] = entry;
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
return scalars;
|
|
944
|
+
}
|
|
945
|
+
function buildToolContext({
|
|
946
|
+
identity: identity2,
|
|
947
|
+
stateSnapshot: stateSnapshot2
|
|
948
|
+
}) {
|
|
949
|
+
const context = pickScalarRecord(stateSnapshot2);
|
|
950
|
+
if (identity2?.distinctId) {
|
|
951
|
+
context.distinctId = identity2.distinctId;
|
|
952
|
+
}
|
|
953
|
+
if (identity2?.email) {
|
|
954
|
+
context.email = identity2.email;
|
|
955
|
+
}
|
|
956
|
+
return context;
|
|
957
|
+
}
|
|
958
|
+
|
|
889
959
|
// src/lib/support/Widget.tsx
|
|
890
|
-
var
|
|
960
|
+
var import_ai8 = require("ai");
|
|
891
961
|
|
|
892
962
|
// ../../../node_modules/.pnpm/framer-motion@12.34.3_@emotion+is-prop-valid@0.8.8_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs
|
|
893
963
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
@@ -9430,7 +9500,7 @@ function useReducedMotion() {
|
|
|
9430
9500
|
}
|
|
9431
9501
|
|
|
9432
9502
|
// src/lib/support/Widget.tsx
|
|
9433
|
-
var
|
|
9503
|
+
var import_react43 = require("react");
|
|
9434
9504
|
|
|
9435
9505
|
// src/lib/support/buildWidgetTypingLabel.ts
|
|
9436
9506
|
function buildWidgetTypingLabel(actors) {
|
|
@@ -9456,7 +9526,7 @@ function SaascoLogo() {
|
|
|
9456
9526
|
viewBox: "0 0 438 83",
|
|
9457
9527
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9458
9528
|
children: [
|
|
9459
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { height: "83", rx: "22", width: "83", x: "0.308594", fill: "#
|
|
9529
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { height: "83", rx: "22", width: "83", x: "0.308594", fill: "#0B0B0B" }),
|
|
9460
9530
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9461
9531
|
"path",
|
|
9462
9532
|
{
|
|
@@ -9491,42 +9561,42 @@ function SaascoLogo() {
|
|
|
9491
9561
|
"path",
|
|
9492
9562
|
{
|
|
9493
9563
|
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",
|
|
9494
|
-
fill: "#
|
|
9564
|
+
fill: "#0B0B0B"
|
|
9495
9565
|
}
|
|
9496
9566
|
),
|
|
9497
9567
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9498
9568
|
"path",
|
|
9499
9569
|
{
|
|
9500
9570
|
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",
|
|
9501
|
-
fill: "#
|
|
9571
|
+
fill: "#0B0B0B"
|
|
9502
9572
|
}
|
|
9503
9573
|
),
|
|
9504
9574
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9505
9575
|
"path",
|
|
9506
9576
|
{
|
|
9507
9577
|
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",
|
|
9508
|
-
fill: "#
|
|
9578
|
+
fill: "#0B0B0B"
|
|
9509
9579
|
}
|
|
9510
9580
|
),
|
|
9511
9581
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9512
9582
|
"path",
|
|
9513
9583
|
{
|
|
9514
9584
|
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",
|
|
9515
|
-
fill: "#
|
|
9585
|
+
fill: "#0B0B0B"
|
|
9516
9586
|
}
|
|
9517
9587
|
),
|
|
9518
9588
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9519
9589
|
"path",
|
|
9520
9590
|
{
|
|
9521
9591
|
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",
|
|
9522
|
-
fill: "#
|
|
9592
|
+
fill: "#0B0B0B"
|
|
9523
9593
|
}
|
|
9524
9594
|
),
|
|
9525
9595
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9526
9596
|
"path",
|
|
9527
9597
|
{
|
|
9528
9598
|
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",
|
|
9529
|
-
fill: "#
|
|
9599
|
+
fill: "#0B0B0B"
|
|
9530
9600
|
}
|
|
9531
9601
|
)
|
|
9532
9602
|
]
|
|
@@ -9708,23 +9778,6 @@ function MessagesIcon() {
|
|
|
9708
9778
|
}
|
|
9709
9779
|
);
|
|
9710
9780
|
}
|
|
9711
|
-
function ChevronIcon() {
|
|
9712
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9713
|
-
"svg",
|
|
9714
|
-
{
|
|
9715
|
-
"aria-hidden": "true",
|
|
9716
|
-
fill: "none",
|
|
9717
|
-
height: "12",
|
|
9718
|
-
stroke: "currentColor",
|
|
9719
|
-
strokeLinecap: "round",
|
|
9720
|
-
strokeLinejoin: "round",
|
|
9721
|
-
strokeWidth: "2",
|
|
9722
|
-
viewBox: "0 0 24 24",
|
|
9723
|
-
width: "12",
|
|
9724
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "m9 18 6-6-6-6" })
|
|
9725
|
-
}
|
|
9726
|
-
);
|
|
9727
|
-
}
|
|
9728
9781
|
function SparklesIcon() {
|
|
9729
9782
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
9730
9783
|
"svg",
|
|
@@ -9826,6 +9879,204 @@ function ImageIcon() {
|
|
|
9826
9879
|
);
|
|
9827
9880
|
}
|
|
9828
9881
|
|
|
9882
|
+
// src/lib/widget-scale.ts
|
|
9883
|
+
var WIDGET_MOBILE_BREAKPOINT_PX = 640;
|
|
9884
|
+
var LAUNCHER_BUTTON_BASE_PX = 60;
|
|
9885
|
+
var SCALE_BASELINE_PX = 360;
|
|
9886
|
+
var MAX_VIEWPORT_SCALE = 1.25;
|
|
9887
|
+
var MAX_ZOOM_SCALE = 3;
|
|
9888
|
+
var ZOOM_TOLERANCE = 1.05;
|
|
9889
|
+
function widgetScaleMetrics(viewport, device) {
|
|
9890
|
+
const width = Number.isFinite(viewport.width) ? viewport.width : 0;
|
|
9891
|
+
if (width <= 0) {
|
|
9892
|
+
return { effectiveWidth: 0, isMobile: false, scale: 1 };
|
|
9893
|
+
}
|
|
9894
|
+
const zoom = zoomOutFactor(viewport, device);
|
|
9895
|
+
const effectiveWidth = width / zoom;
|
|
9896
|
+
const isMobile = effectiveWidth <= WIDGET_MOBILE_BREAKPOINT_PX;
|
|
9897
|
+
const viewportScale = isMobile ? clamp2(effectiveWidth / SCALE_BASELINE_PX, 1, MAX_VIEWPORT_SCALE) : 1;
|
|
9898
|
+
return { effectiveWidth, isMobile, scale: viewportScale * zoom };
|
|
9899
|
+
}
|
|
9900
|
+
function readWidgetScaleMetrics(viewport) {
|
|
9901
|
+
if (typeof window === "undefined") {
|
|
9902
|
+
return { effectiveWidth: 0, isMobile: false, scale: 1 };
|
|
9903
|
+
}
|
|
9904
|
+
return widgetScaleMetrics(viewport ?? hostLayoutViewport(), readDevice());
|
|
9905
|
+
}
|
|
9906
|
+
function hostLayoutViewport() {
|
|
9907
|
+
const root = document.documentElement;
|
|
9908
|
+
return {
|
|
9909
|
+
height: root?.clientHeight || window.innerHeight,
|
|
9910
|
+
width: root?.clientWidth || window.innerWidth
|
|
9911
|
+
};
|
|
9912
|
+
}
|
|
9913
|
+
function scaledPx(basePx, scale2) {
|
|
9914
|
+
return Math.round(basePx * scale2);
|
|
9915
|
+
}
|
|
9916
|
+
function launcherButtonPx(scale2) {
|
|
9917
|
+
return scaledPx(LAUNCHER_BUTTON_BASE_PX, scale2);
|
|
9918
|
+
}
|
|
9919
|
+
function zoomOutFactor(viewport, device) {
|
|
9920
|
+
if (!device.touch) {
|
|
9921
|
+
return 1;
|
|
9922
|
+
}
|
|
9923
|
+
const deviceWidth = orientedDeviceWidth(viewport, device);
|
|
9924
|
+
if (deviceWidth <= 0 || viewport.width <= deviceWidth * ZOOM_TOLERANCE) {
|
|
9925
|
+
return 1;
|
|
9926
|
+
}
|
|
9927
|
+
return Math.min(viewport.width / deviceWidth, MAX_ZOOM_SCALE);
|
|
9928
|
+
}
|
|
9929
|
+
function orientedDeviceWidth(viewport, device) {
|
|
9930
|
+
const shortSide = Math.min(device.screenWidth, device.screenHeight);
|
|
9931
|
+
const longSide = Math.max(device.screenWidth, device.screenHeight);
|
|
9932
|
+
const portrait = viewport.height > 0 && viewport.height >= viewport.width;
|
|
9933
|
+
return portrait ? shortSide : longSide;
|
|
9934
|
+
}
|
|
9935
|
+
function readDevice() {
|
|
9936
|
+
return {
|
|
9937
|
+
screenHeight: window.screen?.height ?? 0,
|
|
9938
|
+
screenWidth: window.screen?.width ?? 0,
|
|
9939
|
+
touch: window.matchMedia?.("(pointer: coarse)").matches === true
|
|
9940
|
+
};
|
|
9941
|
+
}
|
|
9942
|
+
function clamp2(value, min, max) {
|
|
9943
|
+
return Math.min(Math.max(value, min), max);
|
|
9944
|
+
}
|
|
9945
|
+
|
|
9946
|
+
// src/lib/support/widget-constants.ts
|
|
9947
|
+
var MESSAGE_GROUP_THRESHOLD_MS = 2 * 60 * 1e3;
|
|
9948
|
+
var POLL_INTERVAL_MS = 5e3;
|
|
9949
|
+
var MAX_TEXTAREA_HEIGHT_PX = 120;
|
|
9950
|
+
var SCROLL_BOTTOM_THRESHOLD_PX = 56;
|
|
9951
|
+
var SCROLL_PREVIOUS_ITEM_PEEK_PX = 64;
|
|
9952
|
+
var OVERSCROLL_EDGE_SLACK_PX = 1;
|
|
9953
|
+
var BOUNCE_SETTLE_MS = 400;
|
|
9954
|
+
var MIN_SCROLLBAR_THUMB_PX = 28;
|
|
9955
|
+
var PANEL_WIDTH_PX = 384;
|
|
9956
|
+
var PANEL_MAX_HEIGHT_PX = 680;
|
|
9957
|
+
var PANEL_VERTICAL_RESERVE_PX = 110;
|
|
9958
|
+
var PANEL_HORIZONTAL_RESERVE_PX = 40;
|
|
9959
|
+
var ROOT_PADDING_PX = 16;
|
|
9960
|
+
var ROOT_HORIZONTAL_PADDING_PX = ROOT_PADDING_PX * 2;
|
|
9961
|
+
var ROOT_VERTICAL_PADDING_PX = ROOT_PADDING_PX * 2;
|
|
9962
|
+
function closedFrameSizePx(scale2) {
|
|
9963
|
+
return launcherButtonPx(scale2) + ROOT_HORIZONTAL_PADDING_PX;
|
|
9964
|
+
}
|
|
9965
|
+
var LAUNCHER_ICON_BASE_PX = 25;
|
|
9966
|
+
var ROOT_STACK_GAP_PX = 12;
|
|
9967
|
+
var EMAIL_PATTERN = /^[^\s@]+@[^\s@]+\.[^\s@]+$/u;
|
|
9968
|
+
var DEFAULT_BRANDING = {
|
|
9969
|
+
agentLabel: "AI Agent",
|
|
9970
|
+
greeting: "Ask us anything, or share your feedback.",
|
|
9971
|
+
replyTime: "a few hours",
|
|
9972
|
+
teamDescription: "The team can also help",
|
|
9973
|
+
workspaceName: "Support"
|
|
9974
|
+
};
|
|
9975
|
+
var DEFAULT_SUGGESTIONS = [];
|
|
9976
|
+
var FADE_TRANSITION = { duration: 0.12, ease: "easeOut" };
|
|
9977
|
+
var SLIDE_TRANSITION = {
|
|
9978
|
+
duration: 0.28,
|
|
9979
|
+
ease: [0.32, 0.72, 0, 1]
|
|
9980
|
+
};
|
|
9981
|
+
var NAV_TRANSITION = { duration: 0.2, ease: "easeOut" };
|
|
9982
|
+
var LAUNCHER_ICON_TRANSITION = {
|
|
9983
|
+
type: "spring",
|
|
9984
|
+
stiffness: 420,
|
|
9985
|
+
damping: 30,
|
|
9986
|
+
mass: 0.85
|
|
9987
|
+
};
|
|
9988
|
+
var LAUNCHER_ICON_ROTATE_DEG = 25;
|
|
9989
|
+
var LAUNCHER_BUTTON_TRANSITION = {
|
|
9990
|
+
type: "spring",
|
|
9991
|
+
stiffness: 520,
|
|
9992
|
+
damping: 28,
|
|
9993
|
+
mass: 0.7
|
|
9994
|
+
};
|
|
9995
|
+
var LAUNCHER_HOVER_SCALE = 1.08;
|
|
9996
|
+
var LAUNCHER_TAP_SCALE = 0.9;
|
|
9997
|
+
var PANEL_SPRING = {
|
|
9998
|
+
type: "spring",
|
|
9999
|
+
stiffness: 380,
|
|
10000
|
+
damping: 32,
|
|
10001
|
+
mass: 0.85,
|
|
10002
|
+
opacity: { duration: 0.22, ease: "easeOut" }
|
|
10003
|
+
};
|
|
10004
|
+
var SCROLL_BOTTOM_TRANSITION = {
|
|
10005
|
+
duration: 0.38,
|
|
10006
|
+
ease: [0.32, 0.72, 0, 1],
|
|
10007
|
+
opacity: { delay: 0.12, duration: 0.2, ease: "easeInOut" }
|
|
10008
|
+
};
|
|
10009
|
+
var FOOTER_SWAP_SHIFT_PX = 28;
|
|
10010
|
+
var PANEL_CLOSED_SCALE = 0.94;
|
|
10011
|
+
var viewVariants = {
|
|
10012
|
+
center: (t) => ({
|
|
10013
|
+
opacity: 1,
|
|
10014
|
+
transition: t.mode === "fade" ? FADE_TRANSITION : SLIDE_TRANSITION,
|
|
10015
|
+
x: 0
|
|
10016
|
+
}),
|
|
10017
|
+
enter: (t) => t.mode === "fade" ? { opacity: 0, x: 0 } : { opacity: 1, x: t.direction > 0 ? "100%" : "-100%" },
|
|
10018
|
+
exit: (t) => t.mode === "fade" ? { opacity: 0, transition: FADE_TRANSITION, x: 0 } : {
|
|
10019
|
+
opacity: 1,
|
|
10020
|
+
transition: SLIDE_TRANSITION,
|
|
10021
|
+
x: t.direction > 0 ? "-100%" : "100%"
|
|
10022
|
+
}
|
|
10023
|
+
};
|
|
10024
|
+
var COMPOSER_FADE_TRANSITION = {
|
|
10025
|
+
duration: 0.2,
|
|
10026
|
+
ease: "easeOut"
|
|
10027
|
+
};
|
|
10028
|
+
var COMPOSER_LOAD_FADE_TRANSITION = {
|
|
10029
|
+
duration: 0.22,
|
|
10030
|
+
ease: "easeOut"
|
|
10031
|
+
};
|
|
10032
|
+
var composerVariants = {
|
|
10033
|
+
center: (t) => ({
|
|
10034
|
+
opacity: 1,
|
|
10035
|
+
transition: t.mode === "fade" ? FADE_TRANSITION : { ...SLIDE_TRANSITION, opacity: COMPOSER_FADE_TRANSITION },
|
|
10036
|
+
x: 0
|
|
10037
|
+
}),
|
|
10038
|
+
enter: (t) => t.mode === "fade" ? { opacity: 0, x: 0 } : { opacity: 0, x: t.direction > 0 ? "-100%" : "100%" },
|
|
10039
|
+
exit: (t) => t.mode === "fade" ? { opacity: 0, transition: FADE_TRANSITION, x: 0 } : {
|
|
10040
|
+
opacity: 0,
|
|
10041
|
+
transition: {
|
|
10042
|
+
...SLIDE_TRANSITION,
|
|
10043
|
+
opacity: COMPOSER_FADE_TRANSITION
|
|
10044
|
+
},
|
|
10045
|
+
x: t.direction > 0 ? "100%" : "-100%"
|
|
10046
|
+
}
|
|
10047
|
+
};
|
|
10048
|
+
|
|
10049
|
+
// src/lib/support/resolveSubmitEmailGate.ts
|
|
10050
|
+
var EMAIL_GATE_ERROR = "Enter a valid email so we can reply to you.";
|
|
10051
|
+
function resolveEmailDraftError(emailDraft) {
|
|
10052
|
+
return EMAIL_PATTERN.test(emailDraft.trim()) ? null : EMAIL_GATE_ERROR;
|
|
10053
|
+
}
|
|
10054
|
+
function resolveSubmitEmailGate({
|
|
10055
|
+
emailDraft,
|
|
10056
|
+
isNewConversation,
|
|
10057
|
+
knownEmail
|
|
10058
|
+
}) {
|
|
10059
|
+
if (!isNewConversation || knownEmail) {
|
|
10060
|
+
return {
|
|
10061
|
+
emailForSend: knownEmail ?? void 0,
|
|
10062
|
+
ok: true,
|
|
10063
|
+
optimisticallyCapturedEmail: null
|
|
10064
|
+
};
|
|
10065
|
+
}
|
|
10066
|
+
const candidate = emailDraft.trim();
|
|
10067
|
+
if (!EMAIL_PATTERN.test(candidate)) {
|
|
10068
|
+
return {
|
|
10069
|
+
error: EMAIL_GATE_ERROR,
|
|
10070
|
+
ok: false
|
|
10071
|
+
};
|
|
10072
|
+
}
|
|
10073
|
+
return {
|
|
10074
|
+
emailForSend: candidate,
|
|
10075
|
+
ok: true,
|
|
10076
|
+
optimisticallyCapturedEmail: candidate
|
|
10077
|
+
};
|
|
10078
|
+
}
|
|
10079
|
+
|
|
9829
10080
|
// src/lib/support/types.ts
|
|
9830
10081
|
var MAX_MESSAGE_LENGTH = 5e3;
|
|
9831
10082
|
var MAX_CONVERSATION_IMAGE_ATTACHMENTS = 5;
|
|
@@ -13194,10 +13445,12 @@ var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
|
13194
13445
|
function Composer({
|
|
13195
13446
|
draft,
|
|
13196
13447
|
emailDraft,
|
|
13448
|
+
emailError,
|
|
13197
13449
|
imageInputRef,
|
|
13198
13450
|
isLoading,
|
|
13199
13451
|
needsEmail,
|
|
13200
13452
|
onDraftChange,
|
|
13453
|
+
onEmailBlur,
|
|
13201
13454
|
onEmailChange,
|
|
13202
13455
|
onImageSelection,
|
|
13203
13456
|
onRemovePendingImage,
|
|
@@ -13208,7 +13461,8 @@ function Composer({
|
|
|
13208
13461
|
sendError,
|
|
13209
13462
|
textareaRef
|
|
13210
13463
|
}) {
|
|
13211
|
-
const
|
|
13464
|
+
const emailReady = !needsEmail || resolveEmailDraftError(emailDraft) === null;
|
|
13465
|
+
const canSend = (draft.trim().length > 0 || pendingImages.length > 0) && emailReady;
|
|
13212
13466
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
13213
13467
|
"form",
|
|
13214
13468
|
{
|
|
@@ -13216,21 +13470,29 @@ function Composer({
|
|
|
13216
13470
|
onSubmit,
|
|
13217
13471
|
children: [
|
|
13218
13472
|
sendError && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "mb-2 text-xs text-red-600", children: sendError }),
|
|
13219
|
-
needsEmail && /* @__PURE__ */ (0, import_jsx_runtime9.
|
|
13220
|
-
|
|
13221
|
-
|
|
13222
|
-
|
|
13223
|
-
|
|
13224
|
-
|
|
13225
|
-
|
|
13226
|
-
|
|
13227
|
-
|
|
13228
|
-
|
|
13229
|
-
|
|
13473
|
+
needsEmail && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "mb-2", children: [
|
|
13474
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
13475
|
+
"input",
|
|
13476
|
+
{
|
|
13477
|
+
"aria-invalid": emailError ? true : void 0,
|
|
13478
|
+
"aria-label": "Your email",
|
|
13479
|
+
className: cn(
|
|
13480
|
+
"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",
|
|
13481
|
+
emailError ? "border-red-400 focus:border-red-500" : "border-border focus:border-[color:var(--scw-hairline-strong)]"
|
|
13482
|
+
),
|
|
13483
|
+
onBlur: onEmailBlur,
|
|
13484
|
+
onChange: (e) => onEmailChange(e.target.value),
|
|
13485
|
+
placeholder: "Your email address",
|
|
13486
|
+
type: "email",
|
|
13487
|
+
value: emailDraft
|
|
13488
|
+
}
|
|
13489
|
+
),
|
|
13490
|
+
emailError && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "mt-1.5 px-1 text-xs text-red-600", children: emailError })
|
|
13491
|
+
] }),
|
|
13230
13492
|
pendingImages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "mb-2 flex flex-wrap gap-2", children: pendingImages.map((file, index2) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
13231
13493
|
Attachment,
|
|
13232
13494
|
{
|
|
13233
|
-
className: "relative size-14 overflow-hidden rounded-[10px] border border-solid border-
|
|
13495
|
+
className: "relative size-14 overflow-hidden rounded-[10px] border border-solid border-border p-0",
|
|
13234
13496
|
orientation: "vertical",
|
|
13235
13497
|
state: "done",
|
|
13236
13498
|
children: [
|
|
@@ -13256,7 +13518,7 @@ function Composer({
|
|
|
13256
13518
|
},
|
|
13257
13519
|
`${file.name}-${index2}`
|
|
13258
13520
|
)) }),
|
|
13259
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col gap-2 rounded-[var(--scw-composer-radius,24px)] border border-solid border-
|
|
13521
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("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: [
|
|
13260
13522
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
13261
13523
|
"textarea",
|
|
13262
13524
|
{
|
|
@@ -13325,64 +13587,13 @@ function focusComposer(textareaRef) {
|
|
|
13325
13587
|
});
|
|
13326
13588
|
}
|
|
13327
13589
|
|
|
13328
|
-
// src/lib/support/handoff.ts
|
|
13329
|
-
var import_ai = require("ai");
|
|
13330
|
-
function readHandoffOffer(message) {
|
|
13331
|
-
for (const part of message.parts ?? []) {
|
|
13332
|
-
if (!(0, import_ai.isToolUIPart)(part) || (0, import_ai.getToolName)(part) !== REQUEST_HUMAN_HANDOFF_TOOL_NAME) {
|
|
13333
|
-
continue;
|
|
13334
|
-
}
|
|
13335
|
-
if (part.state !== "output-available") {
|
|
13336
|
-
continue;
|
|
13337
|
-
}
|
|
13338
|
-
const output = part.output;
|
|
13339
|
-
if (output?.offerHandoff && !output.declined) {
|
|
13340
|
-
return { reason: output.reason ?? null, toolCallId: part.toolCallId };
|
|
13341
|
-
}
|
|
13342
|
-
}
|
|
13343
|
-
return null;
|
|
13344
|
-
}
|
|
13345
|
-
function markHandoffDeclinedInMessages(messages, toolCallId) {
|
|
13346
|
-
let changed = false;
|
|
13347
|
-
const next = messages.map((message) => {
|
|
13348
|
-
if (message.role !== "assistant") {
|
|
13349
|
-
return message;
|
|
13350
|
-
}
|
|
13351
|
-
let messageChanged = false;
|
|
13352
|
-
const parts = (message.parts ?? []).map((part) => {
|
|
13353
|
-
if (!(0, import_ai.isToolUIPart)(part) || (0, import_ai.getToolName)(part) !== REQUEST_HUMAN_HANDOFF_TOOL_NAME) {
|
|
13354
|
-
return part;
|
|
13355
|
-
}
|
|
13356
|
-
if (part.toolCallId !== toolCallId || part.state !== "output-available") {
|
|
13357
|
-
return part;
|
|
13358
|
-
}
|
|
13359
|
-
const output = part.output;
|
|
13360
|
-
if (output?.declined) {
|
|
13361
|
-
return part;
|
|
13362
|
-
}
|
|
13363
|
-
messageChanged = true;
|
|
13364
|
-
changed = true;
|
|
13365
|
-
return {
|
|
13366
|
-
...part,
|
|
13367
|
-
output: {
|
|
13368
|
-
...output,
|
|
13369
|
-
declined: true,
|
|
13370
|
-
offerHandoff: false
|
|
13371
|
-
}
|
|
13372
|
-
};
|
|
13373
|
-
});
|
|
13374
|
-
return messageChanged ? { ...message, parts } : message;
|
|
13375
|
-
});
|
|
13376
|
-
return changed ? next : messages;
|
|
13377
|
-
}
|
|
13378
|
-
|
|
13379
13590
|
// ../../chat/client/src/lib/core/buildMessageBlocks.ts
|
|
13380
|
-
var
|
|
13591
|
+
var import_ai2 = require("ai");
|
|
13381
13592
|
|
|
13382
13593
|
// ../../chat/client/src/lib/core/toolParts.ts
|
|
13383
|
-
var
|
|
13594
|
+
var import_ai = require("ai");
|
|
13384
13595
|
function isLiveToolPart(part) {
|
|
13385
|
-
if (!(0,
|
|
13596
|
+
if (!(0, import_ai.isToolUIPart)(part)) {
|
|
13386
13597
|
return false;
|
|
13387
13598
|
}
|
|
13388
13599
|
return part.state !== "output-available" && part.state !== "output-error";
|
|
@@ -13394,13 +13605,13 @@ function messageHasLiveTools(message) {
|
|
|
13394
13605
|
return (message.parts ?? []).some(isLiveToolPart);
|
|
13395
13606
|
}
|
|
13396
13607
|
function toolPartToView(part) {
|
|
13397
|
-
if (!(0,
|
|
13608
|
+
if (!(0, import_ai.isToolUIPart)(part)) {
|
|
13398
13609
|
return null;
|
|
13399
13610
|
}
|
|
13400
13611
|
const view = {
|
|
13401
13612
|
state: part.state,
|
|
13402
13613
|
toolCallId: part.toolCallId,
|
|
13403
|
-
toolName: (0,
|
|
13614
|
+
toolName: (0, import_ai.getToolName)(part)
|
|
13404
13615
|
};
|
|
13405
13616
|
if (part.state === "approval-requested" && "approval" in part) {
|
|
13406
13617
|
view.approvalId = part.approval.id;
|
|
@@ -13408,9 +13619,6 @@ function toolPartToView(part) {
|
|
|
13408
13619
|
}
|
|
13409
13620
|
return view;
|
|
13410
13621
|
}
|
|
13411
|
-
function isToolPartComplete(state) {
|
|
13412
|
-
return state === "output-available" || state === "output-error";
|
|
13413
|
-
}
|
|
13414
13622
|
|
|
13415
13623
|
// ../../chat/client/src/lib/core/buildMessageBlocks.ts
|
|
13416
13624
|
function buildMessageBlocks(message) {
|
|
@@ -13427,7 +13635,7 @@ function buildMessageBlocks(message) {
|
|
|
13427
13635
|
textBuffer = "";
|
|
13428
13636
|
};
|
|
13429
13637
|
for (const part of message.parts) {
|
|
13430
|
-
if ((0,
|
|
13638
|
+
if ((0, import_ai2.isTextUIPart)(part)) {
|
|
13431
13639
|
textBuffer += part.text;
|
|
13432
13640
|
continue;
|
|
13433
13641
|
}
|
|
@@ -13447,110 +13655,7 @@ function buildMessageBlocks(message) {
|
|
|
13447
13655
|
}
|
|
13448
13656
|
|
|
13449
13657
|
// src/lib/support/message-utils.ts
|
|
13450
|
-
var
|
|
13451
|
-
|
|
13452
|
-
// src/lib/support/widget-constants.ts
|
|
13453
|
-
var MESSAGE_GROUP_THRESHOLD_MS = 2 * 60 * 1e3;
|
|
13454
|
-
var POLL_INTERVAL_MS = 5e3;
|
|
13455
|
-
var MAX_TEXTAREA_HEIGHT_PX = 120;
|
|
13456
|
-
var SCROLL_BOTTOM_THRESHOLD_PX = 56;
|
|
13457
|
-
var SCROLL_PREVIOUS_ITEM_PEEK_PX = 64;
|
|
13458
|
-
var OVERSCROLL_EDGE_SLACK_PX = 1;
|
|
13459
|
-
var BOUNCE_SETTLE_MS = 400;
|
|
13460
|
-
var MIN_SCROLLBAR_THUMB_PX = 28;
|
|
13461
|
-
var PANEL_WIDTH_PX = 384;
|
|
13462
|
-
var PANEL_MAX_HEIGHT_PX = 680;
|
|
13463
|
-
var PANEL_VERTICAL_RESERVE_PX = 110;
|
|
13464
|
-
var PANEL_HORIZONTAL_RESERVE_PX = 40;
|
|
13465
|
-
var MOBILE_BREAKPOINT_PX = 640;
|
|
13466
|
-
var ROOT_PADDING_PX = 16;
|
|
13467
|
-
var ROOT_HORIZONTAL_PADDING_PX = ROOT_PADDING_PX * 2;
|
|
13468
|
-
var ROOT_VERTICAL_PADDING_PX = ROOT_PADDING_PX * 2;
|
|
13469
|
-
var LAUNCHER_SIZE_PX = 60;
|
|
13470
|
-
var CLOSED_FRAME_SIZE_PX = LAUNCHER_SIZE_PX + ROOT_HORIZONTAL_PADDING_PX;
|
|
13471
|
-
var ROOT_STACK_GAP_PX = 12;
|
|
13472
|
-
var EMAIL_PATTERN = /^[^\s@]+@[^\s@]+\.[^\s@]+$/u;
|
|
13473
|
-
var DEFAULT_BRANDING = {
|
|
13474
|
-
agentLabel: "AI Agent",
|
|
13475
|
-
greeting: "Ask us anything, or share your feedback.",
|
|
13476
|
-
replyTime: "a few hours",
|
|
13477
|
-
teamDescription: "The team can also help",
|
|
13478
|
-
workspaceName: "Support"
|
|
13479
|
-
};
|
|
13480
|
-
var FADE_TRANSITION = { duration: 0.12, ease: "easeOut" };
|
|
13481
|
-
var SLIDE_TRANSITION = {
|
|
13482
|
-
duration: 0.28,
|
|
13483
|
-
ease: [0.32, 0.72, 0, 1]
|
|
13484
|
-
};
|
|
13485
|
-
var NAV_TRANSITION = { duration: 0.2, ease: "easeOut" };
|
|
13486
|
-
var LAUNCHER_ICON_TRANSITION = {
|
|
13487
|
-
type: "spring",
|
|
13488
|
-
stiffness: 420,
|
|
13489
|
-
damping: 30,
|
|
13490
|
-
mass: 0.85
|
|
13491
|
-
};
|
|
13492
|
-
var LAUNCHER_ICON_ROTATE_DEG = 25;
|
|
13493
|
-
var LAUNCHER_BUTTON_TRANSITION = {
|
|
13494
|
-
type: "spring",
|
|
13495
|
-
stiffness: 520,
|
|
13496
|
-
damping: 28,
|
|
13497
|
-
mass: 0.7
|
|
13498
|
-
};
|
|
13499
|
-
var LAUNCHER_HOVER_SCALE = 1.08;
|
|
13500
|
-
var LAUNCHER_TAP_SCALE = 0.9;
|
|
13501
|
-
var PANEL_SPRING = {
|
|
13502
|
-
type: "spring",
|
|
13503
|
-
stiffness: 380,
|
|
13504
|
-
damping: 32,
|
|
13505
|
-
mass: 0.85,
|
|
13506
|
-
opacity: { duration: 0.22, ease: "easeOut" }
|
|
13507
|
-
};
|
|
13508
|
-
var SCROLL_BOTTOM_TRANSITION = {
|
|
13509
|
-
duration: 0.38,
|
|
13510
|
-
ease: [0.32, 0.72, 0, 1],
|
|
13511
|
-
opacity: { delay: 0.12, duration: 0.2, ease: "easeInOut" }
|
|
13512
|
-
};
|
|
13513
|
-
var FOOTER_SWAP_SHIFT_PX = 28;
|
|
13514
|
-
var PANEL_CLOSED_SCALE = 0.94;
|
|
13515
|
-
var viewVariants = {
|
|
13516
|
-
center: (t) => ({
|
|
13517
|
-
opacity: 1,
|
|
13518
|
-
transition: t.mode === "fade" ? FADE_TRANSITION : SLIDE_TRANSITION,
|
|
13519
|
-
x: 0
|
|
13520
|
-
}),
|
|
13521
|
-
enter: (t) => t.mode === "fade" ? { opacity: 0, x: 0 } : { opacity: 1, x: t.direction > 0 ? "100%" : "-100%" },
|
|
13522
|
-
exit: (t) => t.mode === "fade" ? { opacity: 0, transition: FADE_TRANSITION, x: 0 } : {
|
|
13523
|
-
opacity: 1,
|
|
13524
|
-
transition: SLIDE_TRANSITION,
|
|
13525
|
-
x: t.direction > 0 ? "-100%" : "100%"
|
|
13526
|
-
}
|
|
13527
|
-
};
|
|
13528
|
-
var COMPOSER_FADE_TRANSITION = {
|
|
13529
|
-
duration: 0.2,
|
|
13530
|
-
ease: "easeOut"
|
|
13531
|
-
};
|
|
13532
|
-
var COMPOSER_LOAD_FADE_TRANSITION = {
|
|
13533
|
-
duration: 0.22,
|
|
13534
|
-
ease: "easeOut"
|
|
13535
|
-
};
|
|
13536
|
-
var composerVariants = {
|
|
13537
|
-
center: (t) => ({
|
|
13538
|
-
opacity: 1,
|
|
13539
|
-
transition: t.mode === "fade" ? FADE_TRANSITION : { ...SLIDE_TRANSITION, opacity: COMPOSER_FADE_TRANSITION },
|
|
13540
|
-
x: 0
|
|
13541
|
-
}),
|
|
13542
|
-
enter: (t) => t.mode === "fade" ? { opacity: 0, x: 0 } : { opacity: 0, x: t.direction > 0 ? "-100%" : "100%" },
|
|
13543
|
-
exit: (t) => t.mode === "fade" ? { opacity: 0, transition: FADE_TRANSITION, x: 0 } : {
|
|
13544
|
-
opacity: 0,
|
|
13545
|
-
transition: {
|
|
13546
|
-
...SLIDE_TRANSITION,
|
|
13547
|
-
opacity: COMPOSER_FADE_TRANSITION
|
|
13548
|
-
},
|
|
13549
|
-
x: t.direction > 0 ? "100%" : "-100%"
|
|
13550
|
-
}
|
|
13551
|
-
};
|
|
13552
|
-
|
|
13553
|
-
// src/lib/support/message-utils.ts
|
|
13658
|
+
var import_ai3 = require("ai");
|
|
13554
13659
|
function isAttachmentOnlyPlainBody(text) {
|
|
13555
13660
|
const trimmed = text.trim();
|
|
13556
13661
|
if (trimmed === "[Image]") {
|
|
@@ -13594,7 +13699,7 @@ function createLocalUserMessage({
|
|
|
13594
13699
|
}
|
|
13595
13700
|
function readMessageAttachmentUrls(message) {
|
|
13596
13701
|
const { metadata } = message;
|
|
13597
|
-
if (!
|
|
13702
|
+
if (!isRecord(metadata) || !("attachmentUrls" in metadata)) {
|
|
13598
13703
|
return [];
|
|
13599
13704
|
}
|
|
13600
13705
|
const value = metadata.attachmentUrls;
|
|
@@ -13603,9 +13708,6 @@ function readMessageAttachmentUrls(message) {
|
|
|
13603
13708
|
}
|
|
13604
13709
|
return value.filter((entry) => typeof entry === "string");
|
|
13605
13710
|
}
|
|
13606
|
-
function isRecord2(value) {
|
|
13607
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
13608
|
-
}
|
|
13609
13711
|
async function fileToBase64(file) {
|
|
13610
13712
|
const buffer = await file.arrayBuffer();
|
|
13611
13713
|
const bytes = new Uint8Array(buffer);
|
|
@@ -13629,7 +13731,7 @@ function isAssistantMessageReadyToChime(messages, message, isLoading) {
|
|
|
13629
13731
|
return false;
|
|
13630
13732
|
}
|
|
13631
13733
|
const isLastMessage = messages.at(-1)?.id === message.id;
|
|
13632
|
-
if (isLastMessage && (0,
|
|
13734
|
+
if (isLastMessage && (0, import_ai3.lastAssistantMessageIsCompleteWithToolCalls)({ messages })) {
|
|
13633
13735
|
return false;
|
|
13634
13736
|
}
|
|
13635
13737
|
return true;
|
|
@@ -13870,28 +13972,6 @@ function coerceToolArgs(args) {
|
|
|
13870
13972
|
}
|
|
13871
13973
|
return {};
|
|
13872
13974
|
}
|
|
13873
|
-
function buildToolContext({
|
|
13874
|
-
identity: identity2,
|
|
13875
|
-
stateSnapshot: stateSnapshot2
|
|
13876
|
-
}) {
|
|
13877
|
-
const context = {};
|
|
13878
|
-
if (stateSnapshot2 && typeof stateSnapshot2 === "object" && !Array.isArray(stateSnapshot2)) {
|
|
13879
|
-
for (const [key, value] of Object.entries(
|
|
13880
|
-
stateSnapshot2
|
|
13881
|
-
)) {
|
|
13882
|
-
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
13883
|
-
context[key] = value;
|
|
13884
|
-
}
|
|
13885
|
-
}
|
|
13886
|
-
}
|
|
13887
|
-
if (identity2?.distinctId) {
|
|
13888
|
-
context.distinctId = identity2.distinctId;
|
|
13889
|
-
}
|
|
13890
|
-
if (identity2?.email) {
|
|
13891
|
-
context.email = identity2.email;
|
|
13892
|
-
}
|
|
13893
|
-
return context;
|
|
13894
|
-
}
|
|
13895
13975
|
|
|
13896
13976
|
// src/lib/support/reconstructDashboardTool.ts
|
|
13897
13977
|
function reconstructDashboardTool(def) {
|
|
@@ -13945,7 +14025,7 @@ function reconstructDashboardTool(def) {
|
|
|
13945
14025
|
|
|
13946
14026
|
// src/lib/support/generated/widget-css.ts
|
|
13947
14027
|
var GENERATED_WIDGET_CSS = `/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
13948
|
-
@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}}`;
|
|
14028
|
+
@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}}`;
|
|
13949
14029
|
|
|
13950
14030
|
// src/lib/support/styles.ts
|
|
13951
14031
|
var STYLE_ATTRIBUTE = "data-saasco-chat";
|
|
@@ -14065,46 +14145,23 @@ function toPreparedFile(blob, originalName) {
|
|
|
14065
14145
|
});
|
|
14066
14146
|
}
|
|
14067
14147
|
|
|
14068
|
-
// src/lib/support/resolveSubmitEmailGate.ts
|
|
14069
|
-
function resolveSubmitEmailGate({
|
|
14070
|
-
emailDraft,
|
|
14071
|
-
isNewConversation,
|
|
14072
|
-
knownEmail
|
|
14073
|
-
}) {
|
|
14074
|
-
if (!isNewConversation || knownEmail) {
|
|
14075
|
-
return {
|
|
14076
|
-
emailForSend: knownEmail ?? void 0,
|
|
14077
|
-
ok: true,
|
|
14078
|
-
optimisticallyCapturedEmail: null
|
|
14079
|
-
};
|
|
14080
|
-
}
|
|
14081
|
-
const candidate = emailDraft.trim();
|
|
14082
|
-
if (!EMAIL_PATTERN.test(candidate)) {
|
|
14083
|
-
return {
|
|
14084
|
-
error: "Enter a valid email so we can reply to you.",
|
|
14085
|
-
ok: false
|
|
14086
|
-
};
|
|
14087
|
-
}
|
|
14088
|
-
return {
|
|
14089
|
-
emailForSend: candidate,
|
|
14090
|
-
ok: true,
|
|
14091
|
-
optimisticallyCapturedEmail: candidate
|
|
14092
|
-
};
|
|
14093
|
-
}
|
|
14094
|
-
|
|
14095
14148
|
// src/lib/support/transport.ts
|
|
14096
14149
|
async function getWidgetConfig({
|
|
14097
14150
|
baseUrl,
|
|
14098
14151
|
projectId
|
|
14099
14152
|
}) {
|
|
14100
|
-
const { branding, tools } = await postJson(
|
|
14153
|
+
const { branding, suggestions, tools } = await postJson(
|
|
14101
14154
|
`${normalizeBaseUrl(baseUrl)}/api/support/settings`,
|
|
14102
14155
|
{ projectId }
|
|
14103
14156
|
);
|
|
14104
14157
|
if (!Array.isArray(tools)) {
|
|
14105
14158
|
throw new TypeError("Support chat settings response is missing `tools`");
|
|
14106
14159
|
}
|
|
14107
|
-
return {
|
|
14160
|
+
return {
|
|
14161
|
+
branding,
|
|
14162
|
+
...Array.isArray(suggestions) ? { suggestions } : {},
|
|
14163
|
+
tools
|
|
14164
|
+
};
|
|
14108
14165
|
}
|
|
14109
14166
|
async function sendMessage({
|
|
14110
14167
|
baseUrl,
|
|
@@ -14163,16 +14220,32 @@ async function resumeSession({
|
|
|
14163
14220
|
body
|
|
14164
14221
|
);
|
|
14165
14222
|
}
|
|
14223
|
+
async function forgetVisitorSession({
|
|
14224
|
+
baseUrl,
|
|
14225
|
+
projectId
|
|
14226
|
+
}) {
|
|
14227
|
+
await postJson(
|
|
14228
|
+
`${normalizeBaseUrl(baseUrl)}/api/support/visitor/forget`,
|
|
14229
|
+
{ projectId }
|
|
14230
|
+
);
|
|
14231
|
+
}
|
|
14166
14232
|
async function requestHandoff({
|
|
14167
14233
|
baseUrl,
|
|
14234
|
+
keepalive,
|
|
14168
14235
|
...body
|
|
14169
14236
|
}) {
|
|
14170
|
-
return await postJson(`${normalizeBaseUrl(baseUrl)}/api/support/handoff`, body
|
|
14237
|
+
return await postJson(`${normalizeBaseUrl(baseUrl)}/api/support/handoff`, body, {
|
|
14238
|
+
keepalive,
|
|
14239
|
+
simple: keepalive === true
|
|
14240
|
+
});
|
|
14171
14241
|
}
|
|
14172
|
-
async function postJson(url, body) {
|
|
14242
|
+
async function postJson(url, body, options) {
|
|
14173
14243
|
const response = await fetch(url, {
|
|
14174
14244
|
body: JSON.stringify(body),
|
|
14175
|
-
headers: {
|
|
14245
|
+
headers: {
|
|
14246
|
+
"content-type": options?.simple ? "text/plain" : "application/json"
|
|
14247
|
+
},
|
|
14248
|
+
keepalive: options?.keepalive,
|
|
14176
14249
|
method: "POST"
|
|
14177
14250
|
});
|
|
14178
14251
|
if (!response.ok) {
|
|
@@ -14403,44 +14476,231 @@ function persistEmail(emailStorageKey, email) {
|
|
|
14403
14476
|
}
|
|
14404
14477
|
}
|
|
14405
14478
|
|
|
14406
|
-
// src/lib/support/
|
|
14479
|
+
// src/lib/support/useHandoffDecisions.ts
|
|
14407
14480
|
var import_react26 = require("react");
|
|
14408
|
-
|
|
14409
|
-
|
|
14410
|
-
|
|
14411
|
-
|
|
14412
|
-
const
|
|
14413
|
-
|
|
14414
|
-
|
|
14415
|
-
if (messages.length === 0) {
|
|
14416
|
-
inboundChimeSeededRef.current = false;
|
|
14417
|
-
chimedMessageIdsRef.current.clear();
|
|
14418
|
-
return;
|
|
14419
|
-
}
|
|
14420
|
-
const currentUserIds = new Set(
|
|
14421
|
-
messages.filter((message) => message.role === "user").map((message) => message.id)
|
|
14422
|
-
);
|
|
14423
|
-
const optimisticSendReplaced = [...chimedMessageIdsRef.current].some(
|
|
14424
|
-
(messageId) => messageId.startsWith("local-") && !currentUserIds.has(messageId)
|
|
14425
|
-
);
|
|
14426
|
-
const freshUserMessages = messages.filter(
|
|
14427
|
-
(message) => message.role === "user" && !chimedMessageIdsRef.current.has(message.id)
|
|
14428
|
-
);
|
|
14429
|
-
const freshBotReplies = messages.filter(
|
|
14430
|
-
(message) => isAssistantMessageReadyToChime(messages, message, isLoading) && !chimedMessageIdsRef.current.has(message.id)
|
|
14431
|
-
);
|
|
14432
|
-
for (const message of messages) {
|
|
14433
|
-
if (message.role === "user") {
|
|
14434
|
-
chimedMessageIdsRef.current.add(message.id);
|
|
14435
|
-
continue;
|
|
14436
|
-
}
|
|
14437
|
-
if (isAssistantMessageReadyToChime(messages, message, isLoading)) {
|
|
14438
|
-
chimedMessageIdsRef.current.add(message.id);
|
|
14439
|
-
}
|
|
14481
|
+
|
|
14482
|
+
// src/lib/support/handoff.ts
|
|
14483
|
+
var import_ai4 = require("ai");
|
|
14484
|
+
function readHandoffOffer(message) {
|
|
14485
|
+
for (const part of message.parts ?? []) {
|
|
14486
|
+
if (!(0, import_ai4.isToolUIPart)(part) || (0, import_ai4.getToolName)(part) !== REQUEST_HUMAN_HANDOFF_TOOL_NAME) {
|
|
14487
|
+
continue;
|
|
14440
14488
|
}
|
|
14441
|
-
if (
|
|
14442
|
-
|
|
14443
|
-
|
|
14489
|
+
if (part.state !== "output-available") {
|
|
14490
|
+
continue;
|
|
14491
|
+
}
|
|
14492
|
+
const output = part.output;
|
|
14493
|
+
if (output?.offerHandoff && !output.declined && !output.resolved) {
|
|
14494
|
+
return { reason: output.reason ?? null, toolCallId: part.toolCallId };
|
|
14495
|
+
}
|
|
14496
|
+
}
|
|
14497
|
+
return null;
|
|
14498
|
+
}
|
|
14499
|
+
function readOutstandingHandoffOffers(messages) {
|
|
14500
|
+
const offers = [];
|
|
14501
|
+
for (const message of messages) {
|
|
14502
|
+
const offer = readHandoffOffer(message);
|
|
14503
|
+
if (offer) {
|
|
14504
|
+
offers.push(offer);
|
|
14505
|
+
}
|
|
14506
|
+
}
|
|
14507
|
+
return offers;
|
|
14508
|
+
}
|
|
14509
|
+
function markHandoffOfferInMessages(messages, toolCallId, flag) {
|
|
14510
|
+
let changed = false;
|
|
14511
|
+
const next = messages.map((message) => {
|
|
14512
|
+
if (message.role !== "assistant") {
|
|
14513
|
+
return message;
|
|
14514
|
+
}
|
|
14515
|
+
let messageChanged = false;
|
|
14516
|
+
const parts = (message.parts ?? []).map((part) => {
|
|
14517
|
+
if (!(0, import_ai4.isToolUIPart)(part) || (0, import_ai4.getToolName)(part) !== REQUEST_HUMAN_HANDOFF_TOOL_NAME) {
|
|
14518
|
+
return part;
|
|
14519
|
+
}
|
|
14520
|
+
if (part.toolCallId !== toolCallId || part.state !== "output-available") {
|
|
14521
|
+
return part;
|
|
14522
|
+
}
|
|
14523
|
+
const output = part.output;
|
|
14524
|
+
if (output?.declined || output?.resolved) {
|
|
14525
|
+
return part;
|
|
14526
|
+
}
|
|
14527
|
+
messageChanged = true;
|
|
14528
|
+
changed = true;
|
|
14529
|
+
return {
|
|
14530
|
+
...part,
|
|
14531
|
+
output: {
|
|
14532
|
+
...output,
|
|
14533
|
+
...flag,
|
|
14534
|
+
offerHandoff: false
|
|
14535
|
+
}
|
|
14536
|
+
};
|
|
14537
|
+
});
|
|
14538
|
+
return messageChanged ? { ...message, parts } : message;
|
|
14539
|
+
});
|
|
14540
|
+
return changed ? next : messages;
|
|
14541
|
+
}
|
|
14542
|
+
|
|
14543
|
+
// src/lib/support/useHandoffDecisions.ts
|
|
14544
|
+
function useHandoffDecisions({
|
|
14545
|
+
baseUrl,
|
|
14546
|
+
mergedIdsRef,
|
|
14547
|
+
messagesRef,
|
|
14548
|
+
onAccepted,
|
|
14549
|
+
projectId,
|
|
14550
|
+
sessionRef,
|
|
14551
|
+
setMessages
|
|
14552
|
+
}) {
|
|
14553
|
+
const [dismissedHandoffs, setDismissedHandoffs] = (0, import_react26.useState)(
|
|
14554
|
+
() => /* @__PURE__ */ new Set()
|
|
14555
|
+
);
|
|
14556
|
+
const [handoffPending, setHandoffPending] = (0, import_react26.useState)(false);
|
|
14557
|
+
const handoffPendingRef = (0, import_react26.useRef)(false);
|
|
14558
|
+
const confirmHandoff = (0, import_react26.useCallback)(
|
|
14559
|
+
async (offer) => {
|
|
14560
|
+
const active = sessionRef.current;
|
|
14561
|
+
if (!active || handoffPendingRef.current) {
|
|
14562
|
+
return;
|
|
14563
|
+
}
|
|
14564
|
+
handoffPendingRef.current = true;
|
|
14565
|
+
setHandoffPending(true);
|
|
14566
|
+
try {
|
|
14567
|
+
const result = await requestHandoff({
|
|
14568
|
+
baseUrl,
|
|
14569
|
+
conversationId: active.conversationId,
|
|
14570
|
+
projectId,
|
|
14571
|
+
reason: offer.reason,
|
|
14572
|
+
sessionToken: active.sessionToken,
|
|
14573
|
+
toolCallId: offer.toolCallId
|
|
14574
|
+
});
|
|
14575
|
+
onAccepted();
|
|
14576
|
+
const next = markHandoffOfferInMessages(
|
|
14577
|
+
messagesRef.current,
|
|
14578
|
+
offer.toolCallId,
|
|
14579
|
+
{ resolved: true }
|
|
14580
|
+
);
|
|
14581
|
+
if (result.acknowledgment) {
|
|
14582
|
+
mergedIdsRef.current.add(result.acknowledgment.id);
|
|
14583
|
+
setMessages([...next, toUiMessage(result.acknowledgment)]);
|
|
14584
|
+
} else {
|
|
14585
|
+
setMessages(next);
|
|
14586
|
+
}
|
|
14587
|
+
} catch {
|
|
14588
|
+
} finally {
|
|
14589
|
+
handoffPendingRef.current = false;
|
|
14590
|
+
setHandoffPending(false);
|
|
14591
|
+
}
|
|
14592
|
+
},
|
|
14593
|
+
[
|
|
14594
|
+
baseUrl,
|
|
14595
|
+
mergedIdsRef,
|
|
14596
|
+
messagesRef,
|
|
14597
|
+
onAccepted,
|
|
14598
|
+
projectId,
|
|
14599
|
+
sessionRef,
|
|
14600
|
+
setMessages
|
|
14601
|
+
]
|
|
14602
|
+
);
|
|
14603
|
+
const dismissHandoff = (0, import_react26.useCallback)(
|
|
14604
|
+
(toolCallId) => {
|
|
14605
|
+
setDismissedHandoffs((prev) => {
|
|
14606
|
+
if (prev.has(toolCallId)) {
|
|
14607
|
+
return prev;
|
|
14608
|
+
}
|
|
14609
|
+
const next = new Set(prev);
|
|
14610
|
+
next.add(toolCallId);
|
|
14611
|
+
return next;
|
|
14612
|
+
});
|
|
14613
|
+
setMessages(
|
|
14614
|
+
markHandoffOfferInMessages(messagesRef.current, toolCallId, {
|
|
14615
|
+
declined: true
|
|
14616
|
+
})
|
|
14617
|
+
);
|
|
14618
|
+
const active = sessionRef.current;
|
|
14619
|
+
if (!active) {
|
|
14620
|
+
return;
|
|
14621
|
+
}
|
|
14622
|
+
void requestHandoff({
|
|
14623
|
+
baseUrl,
|
|
14624
|
+
conversationId: active.conversationId,
|
|
14625
|
+
decision: "declined",
|
|
14626
|
+
projectId,
|
|
14627
|
+
sessionToken: active.sessionToken,
|
|
14628
|
+
toolCallId
|
|
14629
|
+
}).catch(() => {
|
|
14630
|
+
});
|
|
14631
|
+
},
|
|
14632
|
+
[baseUrl, messagesRef, projectId, sessionRef, setMessages]
|
|
14633
|
+
);
|
|
14634
|
+
(0, import_react26.useEffect)(() => {
|
|
14635
|
+
function reportUnansweredHandoffs() {
|
|
14636
|
+
const active = sessionRef.current;
|
|
14637
|
+
if (!active || handoffPendingRef.current) {
|
|
14638
|
+
return;
|
|
14639
|
+
}
|
|
14640
|
+
for (const offer of readOutstandingHandoffOffers(messagesRef.current)) {
|
|
14641
|
+
void requestHandoff({
|
|
14642
|
+
baseUrl,
|
|
14643
|
+
conversationId: active.conversationId,
|
|
14644
|
+
decision: "unanswered",
|
|
14645
|
+
keepalive: true,
|
|
14646
|
+
projectId,
|
|
14647
|
+
sessionToken: active.sessionToken,
|
|
14648
|
+
toolCallId: offer.toolCallId
|
|
14649
|
+
}).catch(() => {
|
|
14650
|
+
});
|
|
14651
|
+
}
|
|
14652
|
+
}
|
|
14653
|
+
window.addEventListener("pagehide", reportUnansweredHandoffs);
|
|
14654
|
+
return () => {
|
|
14655
|
+
window.removeEventListener("pagehide", reportUnansweredHandoffs);
|
|
14656
|
+
};
|
|
14657
|
+
}, [baseUrl, messagesRef, projectId, sessionRef]);
|
|
14658
|
+
return {
|
|
14659
|
+
confirmHandoff,
|
|
14660
|
+
dismissedHandoffs,
|
|
14661
|
+
dismissHandoff,
|
|
14662
|
+
handoffPending
|
|
14663
|
+
};
|
|
14664
|
+
}
|
|
14665
|
+
|
|
14666
|
+
// src/lib/support/useInboundMessageChime.ts
|
|
14667
|
+
var import_react27 = require("react");
|
|
14668
|
+
function useInboundMessageChime({
|
|
14669
|
+
isLoading,
|
|
14670
|
+
messages
|
|
14671
|
+
}) {
|
|
14672
|
+
const chimedMessageIdsRef = (0, import_react27.useRef)(/* @__PURE__ */ new Set());
|
|
14673
|
+
const inboundChimeSeededRef = (0, import_react27.useRef)(false);
|
|
14674
|
+
(0, import_react27.useEffect)(() => {
|
|
14675
|
+
if (messages.length === 0) {
|
|
14676
|
+
inboundChimeSeededRef.current = false;
|
|
14677
|
+
chimedMessageIdsRef.current.clear();
|
|
14678
|
+
return;
|
|
14679
|
+
}
|
|
14680
|
+
const currentUserIds = new Set(
|
|
14681
|
+
messages.filter((message) => message.role === "user").map((message) => message.id)
|
|
14682
|
+
);
|
|
14683
|
+
const optimisticSendReplaced = [...chimedMessageIdsRef.current].some(
|
|
14684
|
+
(messageId) => messageId.startsWith("local-") && !currentUserIds.has(messageId)
|
|
14685
|
+
);
|
|
14686
|
+
const freshUserMessages = messages.filter(
|
|
14687
|
+
(message) => message.role === "user" && !chimedMessageIdsRef.current.has(message.id)
|
|
14688
|
+
);
|
|
14689
|
+
const freshBotReplies = messages.filter(
|
|
14690
|
+
(message) => isAssistantMessageReadyToChime(messages, message, isLoading) && !chimedMessageIdsRef.current.has(message.id)
|
|
14691
|
+
);
|
|
14692
|
+
for (const message of messages) {
|
|
14693
|
+
if (message.role === "user") {
|
|
14694
|
+
chimedMessageIdsRef.current.add(message.id);
|
|
14695
|
+
continue;
|
|
14696
|
+
}
|
|
14697
|
+
if (isAssistantMessageReadyToChime(messages, message, isLoading)) {
|
|
14698
|
+
chimedMessageIdsRef.current.add(message.id);
|
|
14699
|
+
}
|
|
14700
|
+
}
|
|
14701
|
+
if (!inboundChimeSeededRef.current) {
|
|
14702
|
+
inboundChimeSeededRef.current = true;
|
|
14703
|
+
return;
|
|
14444
14704
|
}
|
|
14445
14705
|
const hasFreshUserSend = freshUserMessages.length > 0 && !optimisticSendReplaced;
|
|
14446
14706
|
const hasFreshBotReply = freshBotReplies.length > 0;
|
|
@@ -14453,9 +14713,9 @@ function useInboundMessageChime({
|
|
|
14453
14713
|
}
|
|
14454
14714
|
|
|
14455
14715
|
// src/lib/support/useOverscrollBounce.ts
|
|
14456
|
-
var
|
|
14716
|
+
var import_react28 = require("react");
|
|
14457
14717
|
function useOverscrollBounce(ref, enabled, reduceMotion) {
|
|
14458
|
-
(0,
|
|
14718
|
+
(0, import_react28.useEffect)(() => {
|
|
14459
14719
|
const el = ref.current;
|
|
14460
14720
|
if (!el || !enabled || reduceMotion) {
|
|
14461
14721
|
return;
|
|
@@ -14511,13 +14771,13 @@ function useOverscrollBounce(ref, enabled, reduceMotion) {
|
|
|
14511
14771
|
}, [ref, enabled, reduceMotion]);
|
|
14512
14772
|
}
|
|
14513
14773
|
|
|
14514
|
-
// ../../support/shared/src/lib/supportPresenceConstants.ts
|
|
14774
|
+
// ../../support/shared/src/lib/presence/supportPresenceConstants.ts
|
|
14515
14775
|
var SUPPORT_TYPING_TTL_MS = 3e4;
|
|
14516
14776
|
var SUPPORT_TYPING_POLL_INTERVAL_MS = 4e3;
|
|
14517
14777
|
var SUPPORT_TYPING_REFRESH_MS = SUPPORT_TYPING_TTL_MS / 2;
|
|
14518
14778
|
var SUPPORT_TYPING_IDLE_MS = 8e3;
|
|
14519
14779
|
|
|
14520
|
-
// ../../support/shared/src/lib/createTypingPresenceController.ts
|
|
14780
|
+
// ../../support/shared/src/lib/presence/createTypingPresenceController.ts
|
|
14521
14781
|
function createTypingPresenceController({
|
|
14522
14782
|
ping,
|
|
14523
14783
|
isVisible = defaultIsVisible,
|
|
@@ -14636,16 +14896,16 @@ function defaultIsVisible() {
|
|
|
14636
14896
|
}
|
|
14637
14897
|
|
|
14638
14898
|
// src/lib/support/useSupportTypingPresence.ts
|
|
14639
|
-
var
|
|
14899
|
+
var import_react29 = require("react");
|
|
14640
14900
|
function useSupportTypingPresence({
|
|
14641
14901
|
baseUrl,
|
|
14642
14902
|
enabled,
|
|
14643
14903
|
projectId,
|
|
14644
14904
|
session
|
|
14645
14905
|
}) {
|
|
14646
|
-
const [typing, setTyping] = (0,
|
|
14647
|
-
const controllerRef = (0,
|
|
14648
|
-
(0,
|
|
14906
|
+
const [typing, setTyping] = (0, import_react29.useState)([]);
|
|
14907
|
+
const controllerRef = (0, import_react29.useRef)(null);
|
|
14908
|
+
(0, import_react29.useEffect)(() => {
|
|
14649
14909
|
if (!enabled || !session) {
|
|
14650
14910
|
setTyping([]);
|
|
14651
14911
|
controllerRef.current = null;
|
|
@@ -14679,14 +14939,192 @@ function useSupportTypingPresence({
|
|
|
14679
14939
|
};
|
|
14680
14940
|
}
|
|
14681
14941
|
|
|
14942
|
+
// src/lib/support/useVisitorConversationPersistence.ts
|
|
14943
|
+
var import_react30 = require("react");
|
|
14944
|
+
function useVisitorConversationPersistence({
|
|
14945
|
+
baseUrl,
|
|
14946
|
+
emailStorageKey,
|
|
14947
|
+
identity: identity2,
|
|
14948
|
+
onIdentityWipe,
|
|
14949
|
+
onResumed,
|
|
14950
|
+
projectId,
|
|
14951
|
+
sessionRef,
|
|
14952
|
+
storageKey,
|
|
14953
|
+
userJwt: userJwt2
|
|
14954
|
+
}) {
|
|
14955
|
+
const [session, setSessionState] = (0, import_react30.useState)(null);
|
|
14956
|
+
const [sessionHistory, setSessionHistory] = (0, import_react30.useState)([]);
|
|
14957
|
+
const [capturedEmail, setCapturedEmail] = (0, import_react30.useState)(null);
|
|
14958
|
+
const identityRef = (0, import_react30.useRef)(identity2);
|
|
14959
|
+
const userJwtRef = (0, import_react30.useRef)(userJwt2);
|
|
14960
|
+
const onIdentityWipeRef = (0, import_react30.useRef)(onIdentityWipe);
|
|
14961
|
+
const onResumedRef = (0, import_react30.useRef)(onResumed);
|
|
14962
|
+
const generationRef = (0, import_react30.useRef)(0);
|
|
14963
|
+
const pendingForgetRef = (0, import_react30.useRef)(Promise.resolve());
|
|
14964
|
+
const previousVisitorRef = (0, import_react30.useRef)(null);
|
|
14965
|
+
identityRef.current = identity2;
|
|
14966
|
+
userJwtRef.current = userJwt2;
|
|
14967
|
+
onIdentityWipeRef.current = onIdentityWipe;
|
|
14968
|
+
onResumedRef.current = onResumed;
|
|
14969
|
+
const visitorKey = `${userJwt2 ?? ""}\0${identity2?.distinctId ?? ""}\0${identity2?.email ?? ""}`;
|
|
14970
|
+
const setSession = (0, import_react30.useCallback)(
|
|
14971
|
+
(next) => {
|
|
14972
|
+
sessionRef.current = next;
|
|
14973
|
+
setSessionState(next);
|
|
14974
|
+
},
|
|
14975
|
+
[sessionRef]
|
|
14976
|
+
);
|
|
14977
|
+
const refreshSessionHistory = (0, import_react30.useCallback)(() => {
|
|
14978
|
+
const generation = generationRef.current;
|
|
14979
|
+
void (async () => {
|
|
14980
|
+
try {
|
|
14981
|
+
const rows = await listConversations({
|
|
14982
|
+
baseUrl,
|
|
14983
|
+
distinctId: identityRef.current?.distinctId,
|
|
14984
|
+
projectId,
|
|
14985
|
+
userJwt: userJwtRef.current ?? void 0
|
|
14986
|
+
});
|
|
14987
|
+
if (generation !== generationRef.current) {
|
|
14988
|
+
return;
|
|
14989
|
+
}
|
|
14990
|
+
setSessionHistory(toHistoryEntries(rows));
|
|
14991
|
+
} catch {
|
|
14992
|
+
if (generation !== generationRef.current) {
|
|
14993
|
+
return;
|
|
14994
|
+
}
|
|
14995
|
+
setSessionHistory(readSessionHistory(storageKey));
|
|
14996
|
+
}
|
|
14997
|
+
})();
|
|
14998
|
+
}, [baseUrl, projectId, storageKey]);
|
|
14999
|
+
(0, import_react30.useEffect)(() => {
|
|
15000
|
+
const stored = readStoredSession(storageKey);
|
|
15001
|
+
sessionRef.current = stored;
|
|
15002
|
+
setSessionState(stored);
|
|
15003
|
+
if (stored) {
|
|
15004
|
+
ensureActiveSessionInHistory(storageKey, stored);
|
|
15005
|
+
}
|
|
15006
|
+
try {
|
|
15007
|
+
const email = window.localStorage.getItem(emailStorageKey);
|
|
15008
|
+
if (email) {
|
|
15009
|
+
setCapturedEmail(email);
|
|
15010
|
+
}
|
|
15011
|
+
} catch {
|
|
15012
|
+
}
|
|
15013
|
+
}, [emailStorageKey, sessionRef, storageKey]);
|
|
15014
|
+
(0, import_react30.useEffect)(() => {
|
|
15015
|
+
const controller = new AbortController();
|
|
15016
|
+
generationRef.current += 1;
|
|
15017
|
+
const generation = generationRef.current;
|
|
15018
|
+
const ownerId = identityRef.current?.distinctId ?? identityRef.current?.email ?? null;
|
|
15019
|
+
const jwtPresent = Boolean(userJwtRef.current);
|
|
15020
|
+
const previous = previousVisitorRef.current;
|
|
15021
|
+
previousVisitorRef.current = { jwtPresent, ownerId };
|
|
15022
|
+
let wiped = false;
|
|
15023
|
+
if (ownerId) {
|
|
15024
|
+
wiped = reconcileSessionOwner(storageKey, ownerId).cleared;
|
|
15025
|
+
} else if (previous && (previous.ownerId || previous.jwtPresent) && !jwtPresent) {
|
|
15026
|
+
clearChatStorage(storageKey);
|
|
15027
|
+
wiped = true;
|
|
15028
|
+
}
|
|
15029
|
+
if (wiped) {
|
|
15030
|
+
sessionRef.current = null;
|
|
15031
|
+
setSessionState(null);
|
|
15032
|
+
setSessionHistory([]);
|
|
15033
|
+
try {
|
|
15034
|
+
window.localStorage.removeItem(emailStorageKey);
|
|
15035
|
+
} catch {
|
|
15036
|
+
}
|
|
15037
|
+
setCapturedEmail(null);
|
|
15038
|
+
onIdentityWipeRef.current();
|
|
15039
|
+
pendingForgetRef.current = (async () => {
|
|
15040
|
+
try {
|
|
15041
|
+
await forgetVisitorSession({ baseUrl, projectId });
|
|
15042
|
+
} catch {
|
|
15043
|
+
}
|
|
15044
|
+
})();
|
|
15045
|
+
}
|
|
15046
|
+
async function sync() {
|
|
15047
|
+
await pendingForgetRef.current;
|
|
15048
|
+
if (controller.signal.aborted) {
|
|
15049
|
+
return;
|
|
15050
|
+
}
|
|
15051
|
+
const distinctId = identityRef.current?.distinctId;
|
|
15052
|
+
const jwt = userJwtRef.current ?? void 0;
|
|
15053
|
+
const [listResult, resumeResult] = await Promise.allSettled([
|
|
15054
|
+
listConversations({
|
|
15055
|
+
baseUrl,
|
|
15056
|
+
distinctId,
|
|
15057
|
+
projectId,
|
|
15058
|
+
userJwt: jwt
|
|
15059
|
+
}),
|
|
15060
|
+
resumeSession({
|
|
15061
|
+
baseUrl,
|
|
15062
|
+
distinctId,
|
|
15063
|
+
projectId,
|
|
15064
|
+
userJwt: jwt
|
|
15065
|
+
})
|
|
15066
|
+
]);
|
|
15067
|
+
if (controller.signal.aborted || generation !== generationRef.current) {
|
|
15068
|
+
return;
|
|
15069
|
+
}
|
|
15070
|
+
if (listResult.status === "fulfilled") {
|
|
15071
|
+
setSessionHistory(toHistoryEntries(listResult.value));
|
|
15072
|
+
} else {
|
|
15073
|
+
setSessionHistory(readSessionHistory(storageKey));
|
|
15074
|
+
}
|
|
15075
|
+
if (resumeResult.status !== "fulfilled" || !resumeResult.value) {
|
|
15076
|
+
return;
|
|
15077
|
+
}
|
|
15078
|
+
const resumed = resumeResult.value;
|
|
15079
|
+
const next = {
|
|
15080
|
+
conversationId: resumed.conversationId,
|
|
15081
|
+
sessionToken: resumed.sessionToken
|
|
15082
|
+
};
|
|
15083
|
+
sessionRef.current = next;
|
|
15084
|
+
setSessionState(next);
|
|
15085
|
+
storeSession(storageKey, next);
|
|
15086
|
+
ensureActiveSessionInHistory(storageKey, next);
|
|
15087
|
+
onResumedRef.current(resumed.conversation);
|
|
15088
|
+
}
|
|
15089
|
+
void sync();
|
|
15090
|
+
return () => {
|
|
15091
|
+
controller.abort();
|
|
15092
|
+
};
|
|
15093
|
+
}, [baseUrl, emailStorageKey, projectId, sessionRef, storageKey, visitorKey]);
|
|
15094
|
+
return {
|
|
15095
|
+
capturedEmail,
|
|
15096
|
+
refreshSessionHistory,
|
|
15097
|
+
session,
|
|
15098
|
+
sessionHistory,
|
|
15099
|
+
setCapturedEmail,
|
|
15100
|
+
setSession
|
|
15101
|
+
};
|
|
15102
|
+
}
|
|
15103
|
+
function toHistoryEntries(rows) {
|
|
15104
|
+
return rows.map((row) => ({
|
|
15105
|
+
conversationId: row.conversationId,
|
|
15106
|
+
preview: row.preview,
|
|
15107
|
+
sessionToken: row.sessionToken,
|
|
15108
|
+
updatedAt: row.updatedAt
|
|
15109
|
+
}));
|
|
15110
|
+
}
|
|
15111
|
+
|
|
14682
15112
|
// src/lib/support/useWidgetFrameSizing.ts
|
|
14683
|
-
var
|
|
15113
|
+
var import_react31 = require("react");
|
|
14684
15114
|
|
|
14685
15115
|
// src/lib/support/widget-sizing.ts
|
|
14686
15116
|
var BRANDING_CACHE_PREFIX = "saasco-chat-branding:";
|
|
15117
|
+
var sizeToIframeViewport = false;
|
|
14687
15118
|
function brandingCacheKey(projectId) {
|
|
14688
15119
|
return `${BRANDING_CACHE_PREFIX}${projectId}`;
|
|
14689
15120
|
}
|
|
15121
|
+
function widgetSessionStorageKeys(projectId, preview) {
|
|
15122
|
+
const slot = preview ? `preview:${projectId}` : projectId;
|
|
15123
|
+
return {
|
|
15124
|
+
emailStorageKey: `saasco-chat-email:${slot}`,
|
|
15125
|
+
storageKey: `saasco-chat-session:${slot}`
|
|
15126
|
+
};
|
|
15127
|
+
}
|
|
14690
15128
|
function readBrandingCache(projectId) {
|
|
14691
15129
|
try {
|
|
14692
15130
|
const raw = window.sessionStorage.getItem(brandingCacheKey(projectId));
|
|
@@ -14718,6 +15156,9 @@ function resolveSizingViewport() {
|
|
|
14718
15156
|
if (host) {
|
|
14719
15157
|
return host;
|
|
14720
15158
|
}
|
|
15159
|
+
if (sizeToIframeViewport && typeof window !== "undefined") {
|
|
15160
|
+
return { height: window.innerHeight, width: window.innerWidth };
|
|
15161
|
+
}
|
|
14721
15162
|
if (isCrossOriginEmbed()) {
|
|
14722
15163
|
return {
|
|
14723
15164
|
height: PANEL_MAX_HEIGHT_PX + PANEL_VERTICAL_RESERVE_PX,
|
|
@@ -14726,20 +15167,29 @@ function resolveSizingViewport() {
|
|
|
14726
15167
|
}
|
|
14727
15168
|
return { height: window.innerHeight, width: window.innerWidth };
|
|
14728
15169
|
}
|
|
14729
|
-
function
|
|
15170
|
+
function widgetScale() {
|
|
15171
|
+
if (sizeToIframeViewport) {
|
|
15172
|
+
return { effectiveWidth: PANEL_WIDTH_PX, isMobile: false, scale: 1 };
|
|
15173
|
+
}
|
|
14730
15174
|
const host = getHostViewport();
|
|
14731
15175
|
if (host) {
|
|
14732
|
-
return host
|
|
15176
|
+
return readWidgetScaleMetrics(host);
|
|
14733
15177
|
}
|
|
14734
15178
|
if (isCrossOriginEmbed()) {
|
|
14735
|
-
return false;
|
|
15179
|
+
return { effectiveWidth: 0, isMobile: false, scale: 1 };
|
|
14736
15180
|
}
|
|
14737
|
-
return
|
|
15181
|
+
return readWidgetScaleMetrics();
|
|
15182
|
+
}
|
|
15183
|
+
function isDashboardPreview() {
|
|
15184
|
+
return sizeToIframeViewport;
|
|
14738
15185
|
}
|
|
14739
15186
|
function clampPanelDimensions(viewport, fullscreen) {
|
|
14740
15187
|
if (fullscreen) {
|
|
14741
15188
|
return { height: viewport.height, width: viewport.width };
|
|
14742
15189
|
}
|
|
15190
|
+
if (sizeToIframeViewport) {
|
|
15191
|
+
return { height: PANEL_MAX_HEIGHT_PX, width: PANEL_WIDTH_PX };
|
|
15192
|
+
}
|
|
14743
15193
|
return {
|
|
14744
15194
|
height: Math.min(
|
|
14745
15195
|
PANEL_MAX_HEIGHT_PX,
|
|
@@ -14752,21 +15202,30 @@ function clampPanelDimensions(viewport, fullscreen) {
|
|
|
14752
15202
|
};
|
|
14753
15203
|
}
|
|
14754
15204
|
function computeFrameDimensions(isOpen) {
|
|
15205
|
+
const { isMobile, scale: scale2 } = widgetScale();
|
|
15206
|
+
const hostOwnsLauncher2 = getHostOwnsLauncher();
|
|
14755
15207
|
if (!isOpen) {
|
|
14756
|
-
|
|
14757
|
-
fullscreen: false,
|
|
14758
|
-
|
|
14759
|
-
|
|
14760
|
-
};
|
|
15208
|
+
if (hostOwnsLauncher2) {
|
|
15209
|
+
return { fullscreen: false, height: 0, width: 0 };
|
|
15210
|
+
}
|
|
15211
|
+
const closed = closedFrameSizePx(scale2);
|
|
15212
|
+
return { fullscreen: false, height: closed, width: closed };
|
|
14761
15213
|
}
|
|
14762
|
-
const fullscreen =
|
|
15214
|
+
const fullscreen = isMobile;
|
|
14763
15215
|
const panel = clampPanelDimensions(resolveSizingViewport(), fullscreen);
|
|
14764
15216
|
if (fullscreen) {
|
|
14765
15217
|
return { fullscreen: true, height: panel.height, width: panel.width };
|
|
14766
15218
|
}
|
|
15219
|
+
if (hostOwnsLauncher2) {
|
|
15220
|
+
return {
|
|
15221
|
+
fullscreen: false,
|
|
15222
|
+
height: panel.height,
|
|
15223
|
+
width: panel.width
|
|
15224
|
+
};
|
|
15225
|
+
}
|
|
14767
15226
|
return {
|
|
14768
15227
|
fullscreen: false,
|
|
14769
|
-
height: ROOT_PADDING_PX + panel.height + ROOT_STACK_GAP_PX +
|
|
15228
|
+
height: ROOT_PADDING_PX + panel.height + ROOT_STACK_GAP_PX + launcherButtonPx(scale2) + ROOT_PADDING_PX,
|
|
14770
15229
|
width: panel.width + ROOT_HORIZONTAL_PADDING_PX
|
|
14771
15230
|
};
|
|
14772
15231
|
}
|
|
@@ -14776,18 +15235,18 @@ function useWidgetFrameSizing({
|
|
|
14776
15235
|
isOpen,
|
|
14777
15236
|
rootElRef
|
|
14778
15237
|
}) {
|
|
14779
|
-
const isOpenRef = (0,
|
|
15238
|
+
const isOpenRef = (0, import_react31.useRef)(isOpen);
|
|
14780
15239
|
isOpenRef.current = isOpen;
|
|
14781
|
-
const syncFrameRef = (0,
|
|
14782
|
-
const [isMobile, setIsMobile] = (0,
|
|
14783
|
-
(0,
|
|
15240
|
+
const syncFrameRef = (0, import_react31.useRef)(null);
|
|
15241
|
+
const [isMobile, setIsMobile] = (0, import_react31.useState)(false);
|
|
15242
|
+
(0, import_react31.useLayoutEffect)(() => {
|
|
14784
15243
|
const rootEl = rootElRef.current;
|
|
14785
15244
|
if (!rootEl) {
|
|
14786
15245
|
return;
|
|
14787
15246
|
}
|
|
14788
15247
|
const syncPanelVars = () => {
|
|
14789
15248
|
const sizingViewport = resolveSizingViewport();
|
|
14790
|
-
const mobile =
|
|
15249
|
+
const { isMobile: mobile, scale: scale2 } = widgetScale();
|
|
14791
15250
|
setIsMobile(mobile);
|
|
14792
15251
|
const panel = clampPanelDimensions(sizingViewport, mobile);
|
|
14793
15252
|
rootEl.style.setProperty("--scw-panel-width", `${panel.width}px`);
|
|
@@ -14796,8 +15255,19 @@ function useWidgetFrameSizing({
|
|
|
14796
15255
|
"--scw-host-viewport-width",
|
|
14797
15256
|
`${sizingViewport.width}px`
|
|
14798
15257
|
);
|
|
15258
|
+
rootEl.style.setProperty(
|
|
15259
|
+
"--scw-launcher-size",
|
|
15260
|
+
`${launcherButtonPx(scale2)}px`
|
|
15261
|
+
);
|
|
15262
|
+
rootEl.style.setProperty(
|
|
15263
|
+
"--scw-launcher-icon-size",
|
|
15264
|
+
`${scaledPx(LAUNCHER_ICON_BASE_PX, scale2)}px`
|
|
15265
|
+
);
|
|
14799
15266
|
};
|
|
14800
15267
|
const syncFrameSize = () => {
|
|
15268
|
+
if (isDashboardPreview()) {
|
|
15269
|
+
return;
|
|
15270
|
+
}
|
|
14801
15271
|
const computed = computeFrameDimensions(isOpenRef.current);
|
|
14802
15272
|
if (isCrossOriginEmbed()) {
|
|
14803
15273
|
postResize(
|
|
@@ -14805,6 +15275,7 @@ function useWidgetFrameSizing({
|
|
|
14805
15275
|
Math.ceil(computed.height),
|
|
14806
15276
|
computed.fullscreen
|
|
14807
15277
|
);
|
|
15278
|
+
postOpenState(isOpenRef.current, computed.fullscreen);
|
|
14808
15279
|
return;
|
|
14809
15280
|
}
|
|
14810
15281
|
const rect = rootEl.getBoundingClientRect();
|
|
@@ -14831,7 +15302,7 @@ function useWidgetFrameSizing({
|
|
|
14831
15302
|
unsubscribe();
|
|
14832
15303
|
};
|
|
14833
15304
|
}, [rootElRef]);
|
|
14834
|
-
(0,
|
|
15305
|
+
(0, import_react31.useLayoutEffect)(() => {
|
|
14835
15306
|
syncFrameRef.current?.();
|
|
14836
15307
|
}, [isOpen]);
|
|
14837
15308
|
return { isMobile, syncFrameRef };
|
|
@@ -14880,15 +15351,18 @@ function resumeConversationAction({
|
|
|
14880
15351
|
}
|
|
14881
15352
|
|
|
14882
15353
|
// src/lib/support/widgetConversationDerived.ts
|
|
15354
|
+
var import_ai5 = require("ai");
|
|
14883
15355
|
function deriveShowThinking({
|
|
14884
15356
|
isLoading,
|
|
14885
15357
|
messages,
|
|
14886
15358
|
pendingSize
|
|
14887
15359
|
}) {
|
|
14888
15360
|
const lastMessage = messages.at(-1);
|
|
14889
|
-
const lastMessageHasLiveTools = lastMessage ? messageHasLiveTools(lastMessage) : false;
|
|
14890
15361
|
const lastMessageIsAnswering = lastMessage ? isAssistantAnswering(lastMessage) : false;
|
|
14891
|
-
|
|
15362
|
+
const awaitingApproval = pendingSize > 0 || (lastMessage?.parts ?? []).some(
|
|
15363
|
+
(part) => (0, import_ai5.isToolUIPart)(part) && part.state === "approval-requested"
|
|
15364
|
+
);
|
|
15365
|
+
return isLoading && !lastMessageIsAnswering && !awaitingApproval;
|
|
14892
15366
|
}
|
|
14893
15367
|
function deriveIsLoadingMessages({
|
|
14894
15368
|
isChat,
|
|
@@ -14914,9 +15388,20 @@ function resolveActiveTransition(reduceMotion, viewTransition) {
|
|
|
14914
15388
|
}
|
|
14915
15389
|
return viewTransition;
|
|
14916
15390
|
}
|
|
15391
|
+
function shouldShowWaitingForTeammate({
|
|
15392
|
+
agentMuted,
|
|
15393
|
+
conversationState,
|
|
15394
|
+
isTyping,
|
|
15395
|
+
messages
|
|
15396
|
+
}) {
|
|
15397
|
+
if (!agentMuted || isTyping || conversationState === "closed") {
|
|
15398
|
+
return false;
|
|
15399
|
+
}
|
|
15400
|
+
return messages.at(-1)?.role === "user";
|
|
15401
|
+
}
|
|
14917
15402
|
|
|
14918
15403
|
// src/lib/support/WidgetLauncher.tsx
|
|
14919
|
-
var
|
|
15404
|
+
var import_react32 = require("react");
|
|
14920
15405
|
|
|
14921
15406
|
// src/lib/support/LauncherIcon.tsx
|
|
14922
15407
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
@@ -14927,7 +15412,7 @@ function LauncherIcon({
|
|
|
14927
15412
|
const transition = reduceMotion ? { duration: 0 } : LAUNCHER_ICON_TRANSITION;
|
|
14928
15413
|
const exitRotate = isOpen ? -LAUNCHER_ICON_ROTATE_DEG : LAUNCHER_ICON_ROTATE_DEG;
|
|
14929
15414
|
const enterRotate = isOpen ? LAUNCHER_ICON_ROTATE_DEG : -LAUNCHER_ICON_ROTATE_DEG;
|
|
14930
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "relative flex size-[25px] shrink-0 items-center justify-center overflow-visible [&_svg]:block [&_svg]:shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(AnimatePresence, { initial: false, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
15415
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("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__ */ (0, import_jsx_runtime10.jsx)(AnimatePresence, { initial: false, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
14931
15416
|
motion.span,
|
|
14932
15417
|
{
|
|
14933
15418
|
animate: { opacity: 1, rotate: 0, scale: 1 },
|
|
@@ -14950,13 +15435,14 @@ function WidgetLauncher({
|
|
|
14950
15435
|
onClose
|
|
14951
15436
|
}) {
|
|
14952
15437
|
const isEmbedded = isCrossOriginEmbed();
|
|
14953
|
-
const
|
|
15438
|
+
const hostOwnsLauncher2 = getHostOwnsLauncher();
|
|
15439
|
+
const launcherPointerRef = (0, import_react32.useRef)({ hovered: false, pressed: false });
|
|
14954
15440
|
const launcherButtonTransition = reduceMotion ? { duration: 0 } : LAUNCHER_BUTTON_TRANSITION;
|
|
14955
|
-
const syncLauncherState = (0,
|
|
15441
|
+
const syncLauncherState = (0, import_react32.useCallback)(
|
|
14956
15442
|
(next) => {
|
|
14957
15443
|
const state = { ...launcherPointerRef.current, ...next };
|
|
14958
15444
|
launcherPointerRef.current = state;
|
|
14959
|
-
if (!isEmbedded) {
|
|
15445
|
+
if (!isEmbedded || hostOwnsLauncher2) {
|
|
14960
15446
|
return;
|
|
14961
15447
|
}
|
|
14962
15448
|
postLauncherState(
|
|
@@ -14964,18 +15450,21 @@ function WidgetLauncher({
|
|
|
14964
15450
|
state.hovered
|
|
14965
15451
|
);
|
|
14966
15452
|
},
|
|
14967
|
-
[isEmbedded, reduceMotion]
|
|
15453
|
+
[hostOwnsLauncher2, isEmbedded, reduceMotion]
|
|
14968
15454
|
);
|
|
14969
15455
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
14970
15456
|
motion.button,
|
|
14971
15457
|
{
|
|
14972
15458
|
"aria-label": isOpen ? "Close chat" : "Open chat",
|
|
14973
15459
|
className: cn(
|
|
14974
|
-
|
|
14975
|
-
|
|
15460
|
+
// Sized from the host viewport (see useWidgetFrameSizing) so the bubble
|
|
15461
|
+
// keeps its footing on a wide phone — and stays exactly as tall as the
|
|
15462
|
+
// social-proof toast that anchors beside it.
|
|
15463
|
+
"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]",
|
|
15464
|
+
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)]",
|
|
14976
15465
|
"transition-[background-color,box-shadow] duration-[280ms] ease-[cubic-bezier(.32,.72,0,1)]",
|
|
14977
15466
|
!reduceMotion && "hover:bg-neutral-100",
|
|
14978
|
-
!reduceMotion && (isEmbedded ? "hover:shadow-[
|
|
15467
|
+
!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)]")
|
|
14979
15468
|
),
|
|
14980
15469
|
onClick: isOpen ? onClose : onOpen,
|
|
14981
15470
|
onHoverEnd: () => syncLauncherState({ hovered: false }),
|
|
@@ -15012,7 +15501,7 @@ function Avatar({
|
|
|
15012
15501
|
large
|
|
15013
15502
|
}) {
|
|
15014
15503
|
const base = cn(
|
|
15015
|
-
"inline-flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-full bg-neutral-900 text-sm font-semibold text-white shadow-[
|
|
15504
|
+
"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)]",
|
|
15016
15505
|
large && "size-12 text-lg",
|
|
15017
15506
|
"[&_img]:block [&_img]:size-full [&_img]:scale-[1.08] [&_img]:object-cover"
|
|
15018
15507
|
);
|
|
@@ -15034,9 +15523,124 @@ function Avatar({
|
|
|
15034
15523
|
}
|
|
15035
15524
|
|
|
15036
15525
|
// src/lib/support/CompactTime.tsx
|
|
15037
|
-
var
|
|
15526
|
+
var import_react34 = require("react");
|
|
15038
15527
|
|
|
15039
|
-
// ../../support/shared/src/lib/
|
|
15528
|
+
// ../../support/shared/src/lib/message/splitLightMarkdownBlocks.ts
|
|
15529
|
+
var DELIMITER_CELL_PATTERN = /^:?-+:?$/u;
|
|
15530
|
+
function splitLightMarkdownBlocks(text) {
|
|
15531
|
+
if (!text.includes("|")) {
|
|
15532
|
+
return text ? [{ type: "text", text }] : [];
|
|
15533
|
+
}
|
|
15534
|
+
const lines = text.split(/\r?\n/u);
|
|
15535
|
+
const blocks = [];
|
|
15536
|
+
const pending = [];
|
|
15537
|
+
let index2 = 0;
|
|
15538
|
+
while (index2 < lines.length) {
|
|
15539
|
+
const parsed = readTableAt(lines, index2);
|
|
15540
|
+
if (!parsed) {
|
|
15541
|
+
pending.push(lines[index2] ?? "");
|
|
15542
|
+
index2 += 1;
|
|
15543
|
+
continue;
|
|
15544
|
+
}
|
|
15545
|
+
flushPendingText(blocks, pending);
|
|
15546
|
+
blocks.push({ type: "table", table: parsed.table });
|
|
15547
|
+
index2 = parsed.end;
|
|
15548
|
+
}
|
|
15549
|
+
flushPendingText(blocks, pending);
|
|
15550
|
+
return blocks;
|
|
15551
|
+
}
|
|
15552
|
+
function flushPendingText(blocks, pending) {
|
|
15553
|
+
if (pending.length === 0) {
|
|
15554
|
+
return;
|
|
15555
|
+
}
|
|
15556
|
+
blocks.push({ type: "text", text: pending.join("\n") });
|
|
15557
|
+
pending.length = 0;
|
|
15558
|
+
}
|
|
15559
|
+
function readTableAt(lines, start) {
|
|
15560
|
+
const headers = splitTableCells(lines[start] ?? "");
|
|
15561
|
+
const delimiter = splitTableCells(lines[start + 1] ?? "");
|
|
15562
|
+
if (!headers || !delimiter || headers.length === 0 || delimiter.length !== headers.length || !delimiter.every(isDelimiterCell)) {
|
|
15563
|
+
return null;
|
|
15564
|
+
}
|
|
15565
|
+
const rows = [];
|
|
15566
|
+
let end = start + 2;
|
|
15567
|
+
while (end < lines.length) {
|
|
15568
|
+
const row = splitTableCells(lines[end] ?? "");
|
|
15569
|
+
if (!row) {
|
|
15570
|
+
break;
|
|
15571
|
+
}
|
|
15572
|
+
rows.push(fitRow(row, headers.length));
|
|
15573
|
+
end += 1;
|
|
15574
|
+
}
|
|
15575
|
+
return {
|
|
15576
|
+
end,
|
|
15577
|
+
table: {
|
|
15578
|
+
aligns: delimiter.map(alignFromDelimiterCell),
|
|
15579
|
+
headers: fitRow(headers, headers.length),
|
|
15580
|
+
rows
|
|
15581
|
+
}
|
|
15582
|
+
};
|
|
15583
|
+
}
|
|
15584
|
+
function splitTableCells(line) {
|
|
15585
|
+
if (!line.includes("|")) {
|
|
15586
|
+
return null;
|
|
15587
|
+
}
|
|
15588
|
+
const cells = [];
|
|
15589
|
+
let current = "";
|
|
15590
|
+
const trimmed = trimOuterPipes(line.trim());
|
|
15591
|
+
for (let index2 = 0; index2 < trimmed.length; index2 += 1) {
|
|
15592
|
+
const char = trimmed[index2];
|
|
15593
|
+
if (char === "\\" && trimmed[index2 + 1] === "|") {
|
|
15594
|
+
current += "|";
|
|
15595
|
+
index2 += 1;
|
|
15596
|
+
continue;
|
|
15597
|
+
}
|
|
15598
|
+
if (char === "|") {
|
|
15599
|
+
cells.push(current.trim());
|
|
15600
|
+
current = "";
|
|
15601
|
+
continue;
|
|
15602
|
+
}
|
|
15603
|
+
current += char;
|
|
15604
|
+
}
|
|
15605
|
+
cells.push(current.trim());
|
|
15606
|
+
return cells;
|
|
15607
|
+
}
|
|
15608
|
+
function trimOuterPipes(line) {
|
|
15609
|
+
let start = 0;
|
|
15610
|
+
let end = line.length;
|
|
15611
|
+
if (line.startsWith("|")) {
|
|
15612
|
+
start = 1;
|
|
15613
|
+
}
|
|
15614
|
+
if (line.endsWith("|") && !line.endsWith("\\|")) {
|
|
15615
|
+
end -= 1;
|
|
15616
|
+
}
|
|
15617
|
+
return line.slice(start, end);
|
|
15618
|
+
}
|
|
15619
|
+
function isDelimiterCell(cell) {
|
|
15620
|
+
const compact = cell.replaceAll(" ", "");
|
|
15621
|
+
return DELIMITER_CELL_PATTERN.test(compact) && compact.includes("-");
|
|
15622
|
+
}
|
|
15623
|
+
function alignFromDelimiterCell(cell) {
|
|
15624
|
+
const compact = cell.replaceAll(" ", "");
|
|
15625
|
+
const left = compact.startsWith(":");
|
|
15626
|
+
const right = compact.endsWith(":");
|
|
15627
|
+
if (left && right) {
|
|
15628
|
+
return "center";
|
|
15629
|
+
}
|
|
15630
|
+
if (right) {
|
|
15631
|
+
return "right";
|
|
15632
|
+
}
|
|
15633
|
+
return "left";
|
|
15634
|
+
}
|
|
15635
|
+
function fitRow(cells, columnCount) {
|
|
15636
|
+
const row = cells.slice(0, columnCount);
|
|
15637
|
+
while (row.length < columnCount) {
|
|
15638
|
+
row.push("");
|
|
15639
|
+
}
|
|
15640
|
+
return row;
|
|
15641
|
+
}
|
|
15642
|
+
|
|
15643
|
+
// ../../support/shared/src/lib/message/formatBotMessageContentForInbox.ts
|
|
15040
15644
|
var ATX_HEADING_PATTERN = /^#{1,6}[ \t]+(.+)$/gmu;
|
|
15041
15645
|
function normalizeMarkdownHeadings(text) {
|
|
15042
15646
|
return text.replace(ATX_HEADING_PATTERN, (_match, content) => {
|
|
@@ -15052,10 +15656,10 @@ function normalizeMarkdownHeadings(text) {
|
|
|
15052
15656
|
}
|
|
15053
15657
|
|
|
15054
15658
|
// src/lib/support/message-render.tsx
|
|
15055
|
-
var
|
|
15659
|
+
var import_ai6 = require("ai");
|
|
15056
15660
|
|
|
15057
15661
|
// src/lib/support/KbCitationBadge.tsx
|
|
15058
|
-
var
|
|
15662
|
+
var import_react33 = require("react");
|
|
15059
15663
|
|
|
15060
15664
|
// src/lib/support/hostname.ts
|
|
15061
15665
|
function readHostnameFromHref(href) {
|
|
@@ -15077,20 +15681,20 @@ function KbCitationBadge({
|
|
|
15077
15681
|
number: number2
|
|
15078
15682
|
}) {
|
|
15079
15683
|
const hostname = readHostnameFromHref(article.url);
|
|
15080
|
-
const [open, setOpen] = (0,
|
|
15081
|
-
const closeTimeoutRef = (0,
|
|
15082
|
-
const rootRef = (0,
|
|
15083
|
-
const popoverRef = (0,
|
|
15684
|
+
const [open, setOpen] = (0, import_react33.useState)(false);
|
|
15685
|
+
const closeTimeoutRef = (0, import_react33.useRef)(null);
|
|
15686
|
+
const rootRef = (0, import_react33.useRef)(null);
|
|
15687
|
+
const popoverRef = (0, import_react33.useRef)(null);
|
|
15084
15688
|
function clearCloseTimeout() {
|
|
15085
15689
|
if (closeTimeoutRef.current) {
|
|
15086
15690
|
clearTimeout(closeTimeoutRef.current);
|
|
15087
15691
|
closeTimeoutRef.current = null;
|
|
15088
15692
|
}
|
|
15089
15693
|
}
|
|
15090
|
-
const resetPopoverShift = (0,
|
|
15694
|
+
const resetPopoverShift = (0, import_react33.useCallback)(() => {
|
|
15091
15695
|
popoverRef.current?.style.removeProperty("--scw-citation-popover-shift");
|
|
15092
15696
|
}, []);
|
|
15093
|
-
const alignPopover = (0,
|
|
15697
|
+
const alignPopover = (0, import_react33.useCallback)(() => {
|
|
15094
15698
|
const root = rootRef.current;
|
|
15095
15699
|
const popover = popoverRef.current;
|
|
15096
15700
|
if (!root || !popover) {
|
|
@@ -15118,13 +15722,13 @@ function KbCitationBadge({
|
|
|
15118
15722
|
shift === 0 ? "0px" : `${shift}px`
|
|
15119
15723
|
);
|
|
15120
15724
|
}, [resetPopoverShift]);
|
|
15121
|
-
const attachPopoverListeners = (0,
|
|
15725
|
+
const attachPopoverListeners = (0, import_react33.useCallback)(() => {
|
|
15122
15726
|
alignPopover();
|
|
15123
15727
|
const scroller = rootRef.current?.closest(".scw-messages");
|
|
15124
15728
|
scroller?.addEventListener("scroll", alignPopover, { passive: true });
|
|
15125
15729
|
window.addEventListener("resize", alignPopover, { passive: true });
|
|
15126
15730
|
}, [alignPopover]);
|
|
15127
|
-
const detachPopoverListeners = (0,
|
|
15731
|
+
const detachPopoverListeners = (0, import_react33.useCallback)(() => {
|
|
15128
15732
|
const scroller = rootRef.current?.closest(".scw-messages");
|
|
15129
15733
|
scroller?.removeEventListener("scroll", alignPopover);
|
|
15130
15734
|
window.removeEventListener("resize", alignPopover);
|
|
@@ -15141,7 +15745,7 @@ function KbCitationBadge({
|
|
|
15141
15745
|
closeTimeoutRef.current = null;
|
|
15142
15746
|
}, 80);
|
|
15143
15747
|
}
|
|
15144
|
-
(0,
|
|
15748
|
+
(0, import_react33.useEffect)(() => {
|
|
15145
15749
|
if (!open) {
|
|
15146
15750
|
detachPopoverListeners();
|
|
15147
15751
|
return;
|
|
@@ -15149,7 +15753,7 @@ function KbCitationBadge({
|
|
|
15149
15753
|
attachPopoverListeners();
|
|
15150
15754
|
return detachPopoverListeners;
|
|
15151
15755
|
}, [open, attachPopoverListeners, detachPopoverListeners]);
|
|
15152
|
-
(0,
|
|
15756
|
+
(0, import_react33.useEffect)(
|
|
15153
15757
|
() => () => {
|
|
15154
15758
|
clearCloseTimeout();
|
|
15155
15759
|
detachPopoverListeners();
|
|
@@ -15342,17 +15946,86 @@ function renderMessageText(text, kbArticles, isStreaming = false) {
|
|
|
15342
15946
|
);
|
|
15343
15947
|
const { body, pendingLinkLabel } = isStreaming ? splitStreamingTail(normalizedText) : { body: normalizedText, pendingLinkLabel: null };
|
|
15344
15948
|
const citationNumbers = buildKbCitationNumberMap(body);
|
|
15949
|
+
const nodes = [];
|
|
15950
|
+
for (const [blockIndex, block] of splitLightMarkdownBlocks(body).entries()) {
|
|
15951
|
+
if (block.type === "table") {
|
|
15952
|
+
nodes.push(
|
|
15953
|
+
renderMessageTable(
|
|
15954
|
+
block.table,
|
|
15955
|
+
kbArticles,
|
|
15956
|
+
citationNumbers,
|
|
15957
|
+
`tbl-${blockIndex}`
|
|
15958
|
+
)
|
|
15959
|
+
);
|
|
15960
|
+
continue;
|
|
15961
|
+
}
|
|
15962
|
+
nodes.push(
|
|
15963
|
+
...renderInlineMessageText(
|
|
15964
|
+
block.text,
|
|
15965
|
+
kbArticles,
|
|
15966
|
+
citationNumbers,
|
|
15967
|
+
`b-${blockIndex}`
|
|
15968
|
+
)
|
|
15969
|
+
);
|
|
15970
|
+
}
|
|
15971
|
+
if (pendingLinkLabel) {
|
|
15972
|
+
nodes.push(
|
|
15973
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: LINK_CLASS_NAME, children: renderPlainTextWithBold(pendingLinkLabel, "lnk-pending") }, "lnk-pending")
|
|
15974
|
+
);
|
|
15975
|
+
}
|
|
15976
|
+
return nodes.length > 0 ? nodes : renderPlainTextWithBold(body, "full");
|
|
15977
|
+
}
|
|
15978
|
+
function renderMessageTable(table, kbArticles, citationNumbers, keyPrefix) {
|
|
15979
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
15980
|
+
"div",
|
|
15981
|
+
{
|
|
15982
|
+
className: "my-2 max-w-full overflow-x-auto whitespace-normal",
|
|
15983
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("table", { className: "w-full border-collapse text-[13px] leading-[1.35]", children: [
|
|
15984
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("tr", { children: table.headers.map((cell, index2) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
15985
|
+
"th",
|
|
15986
|
+
{
|
|
15987
|
+
className: "border border-border bg-neutral-50 px-2 py-1.5 font-semibold",
|
|
15988
|
+
style: { textAlign: table.aligns[index2] ?? "left" },
|
|
15989
|
+
children: renderInlineMessageText(
|
|
15990
|
+
cell,
|
|
15991
|
+
kbArticles,
|
|
15992
|
+
citationNumbers,
|
|
15993
|
+
`${keyPrefix}-h-${index2}`
|
|
15994
|
+
)
|
|
15995
|
+
},
|
|
15996
|
+
`${keyPrefix}-h-${index2}`
|
|
15997
|
+
)) }) }),
|
|
15998
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("tbody", { children: table.rows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("tr", { children: row.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
15999
|
+
"td",
|
|
16000
|
+
{
|
|
16001
|
+
className: "border border-border px-2 py-1.5 align-top",
|
|
16002
|
+
style: { textAlign: table.aligns[cellIndex] ?? "left" },
|
|
16003
|
+
children: renderInlineMessageText(
|
|
16004
|
+
cell,
|
|
16005
|
+
kbArticles,
|
|
16006
|
+
citationNumbers,
|
|
16007
|
+
`${keyPrefix}-r-${rowIndex}-c-${cellIndex}`
|
|
16008
|
+
)
|
|
16009
|
+
},
|
|
16010
|
+
`${keyPrefix}-r-${rowIndex}-c-${cellIndex}`
|
|
16011
|
+
)) }, `${keyPrefix}-r-${rowIndex}`)) })
|
|
16012
|
+
] })
|
|
16013
|
+
},
|
|
16014
|
+
keyPrefix
|
|
16015
|
+
);
|
|
16016
|
+
}
|
|
16017
|
+
function renderInlineMessageText(text, kbArticles, citationNumbers, keyPrefix) {
|
|
15345
16018
|
const nodes = [];
|
|
15346
16019
|
let lastIndex = 0;
|
|
15347
16020
|
let tokenIndex = 0;
|
|
15348
16021
|
MESSAGE_CONTENT_PATTERN.lastIndex = 0;
|
|
15349
|
-
let match = MESSAGE_CONTENT_PATTERN.exec(
|
|
16022
|
+
let match = MESSAGE_CONTENT_PATTERN.exec(text);
|
|
15350
16023
|
while (match !== null) {
|
|
15351
16024
|
if (match.index > lastIndex) {
|
|
15352
16025
|
nodes.push(
|
|
15353
16026
|
renderPlainTextWithBold(
|
|
15354
|
-
|
|
15355
|
-
|
|
16027
|
+
text.slice(lastIndex, match.index),
|
|
16028
|
+
`${keyPrefix}-t-${tokenIndex}`
|
|
15356
16029
|
)
|
|
15357
16030
|
);
|
|
15358
16031
|
}
|
|
@@ -15369,7 +16042,7 @@ function renderMessageText(text, kbArticles, isStreaming = false) {
|
|
|
15369
16042
|
article,
|
|
15370
16043
|
number: number2
|
|
15371
16044
|
},
|
|
15372
|
-
|
|
16045
|
+
`${keyPrefix}-cite-${tokenIndex}`
|
|
15373
16046
|
)
|
|
15374
16047
|
);
|
|
15375
16048
|
}
|
|
@@ -15395,7 +16068,7 @@ function renderMessageText(text, kbArticles, isStreaming = false) {
|
|
|
15395
16068
|
target: "_blank",
|
|
15396
16069
|
children: label
|
|
15397
16070
|
},
|
|
15398
|
-
|
|
16071
|
+
`${keyPrefix}-lnk-${tokenIndex}`
|
|
15399
16072
|
)
|
|
15400
16073
|
);
|
|
15401
16074
|
if (trailing) {
|
|
@@ -15404,22 +16077,20 @@ function renderMessageText(text, kbArticles, isStreaming = false) {
|
|
|
15404
16077
|
}
|
|
15405
16078
|
tokenIndex += 1;
|
|
15406
16079
|
lastIndex = match.index + full.length;
|
|
15407
|
-
match = MESSAGE_CONTENT_PATTERN.exec(
|
|
16080
|
+
match = MESSAGE_CONTENT_PATTERN.exec(text);
|
|
15408
16081
|
}
|
|
15409
|
-
if (lastIndex <
|
|
16082
|
+
if (lastIndex < text.length) {
|
|
15410
16083
|
nodes.push(
|
|
15411
|
-
renderPlainTextWithBold(
|
|
15412
|
-
|
|
15413
|
-
|
|
15414
|
-
|
|
15415
|
-
nodes.push(
|
|
15416
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: LINK_CLASS_NAME, children: renderPlainTextWithBold(pendingLinkLabel, "lnk-pending") }, "lnk-pending")
|
|
16084
|
+
renderPlainTextWithBold(
|
|
16085
|
+
text.slice(lastIndex),
|
|
16086
|
+
`${keyPrefix}-tail-${tokenIndex}`
|
|
16087
|
+
)
|
|
15417
16088
|
);
|
|
15418
16089
|
}
|
|
15419
|
-
return nodes
|
|
16090
|
+
return nodes;
|
|
15420
16091
|
}
|
|
15421
16092
|
function collectKbArticleFromToolEntry(entry, articles) {
|
|
15422
|
-
if (!
|
|
16093
|
+
if (!isRecord(entry)) {
|
|
15423
16094
|
return;
|
|
15424
16095
|
}
|
|
15425
16096
|
if (entry.type === "internal") {
|
|
@@ -15433,10 +16104,10 @@ function collectKbArticleFromToolEntry(entry, articles) {
|
|
|
15433
16104
|
}
|
|
15434
16105
|
}
|
|
15435
16106
|
function collectKbArticlesFromToolPart(part, articles) {
|
|
15436
|
-
if (!(0,
|
|
16107
|
+
if (!(0, import_ai6.isToolUIPart)(part) || part.state !== "output-available") {
|
|
15437
16108
|
return;
|
|
15438
16109
|
}
|
|
15439
|
-
const toolName = (0,
|
|
16110
|
+
const toolName = (0, import_ai6.getToolName)(part);
|
|
15440
16111
|
if (toolName !== UNDERSTAND_PRODUCT_TOOL_NAME) {
|
|
15441
16112
|
return;
|
|
15442
16113
|
}
|
|
@@ -15451,9 +16122,9 @@ function resolveKbArticlesFromMessages(messages) {
|
|
|
15451
16122
|
const articles = /* @__PURE__ */ new Map();
|
|
15452
16123
|
for (const message of messages) {
|
|
15453
16124
|
const { metadata } = message;
|
|
15454
|
-
if (
|
|
16125
|
+
if (isRecord(metadata) && Array.isArray(metadata.kbCitations)) {
|
|
15455
16126
|
for (const entry of metadata.kbCitations) {
|
|
15456
|
-
if (!
|
|
16127
|
+
if (!isRecord(entry)) {
|
|
15457
16128
|
continue;
|
|
15458
16129
|
}
|
|
15459
16130
|
const id3 = typeof entry.id === "string" ? entry.id : null;
|
|
@@ -15493,8 +16164,8 @@ function CompactTime({
|
|
|
15493
16164
|
timestamp
|
|
15494
16165
|
}) {
|
|
15495
16166
|
const createdAt = resolveStableCreatedAt(messageId, timestamp);
|
|
15496
|
-
const [now2, setNow] = (0,
|
|
15497
|
-
(0,
|
|
16167
|
+
const [now2, setNow] = (0, import_react34.useState)(() => Date.now());
|
|
16168
|
+
(0, import_react34.useEffect)(() => {
|
|
15498
16169
|
const tick = () => setNow(Date.now());
|
|
15499
16170
|
const interval = setInterval(tick, TICK_MS);
|
|
15500
16171
|
return () => clearInterval(interval);
|
|
@@ -15502,35 +16173,62 @@ function CompactTime({
|
|
|
15502
16173
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, { children: formatCompactTime(createdAt, now2) });
|
|
15503
16174
|
}
|
|
15504
16175
|
|
|
15505
|
-
// src/lib/support/
|
|
16176
|
+
// src/lib/support/Suggestions.tsx
|
|
15506
16177
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
16178
|
+
function Suggestions({
|
|
16179
|
+
onPick,
|
|
16180
|
+
suggestions
|
|
16181
|
+
}) {
|
|
16182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex w-full min-w-0 flex-col gap-2", children: suggestions.map((suggestion) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
16183
|
+
"button",
|
|
16184
|
+
{
|
|
16185
|
+
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",
|
|
16186
|
+
onClick: () => onPick(suggestion.prompt),
|
|
16187
|
+
type: "button",
|
|
16188
|
+
children: [
|
|
16189
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "scw-suggestion-icon shrink-0 rounded-lg bg-neutral-100 text-neutral-700", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SparklesIcon, {}) }),
|
|
16190
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "scw-suggestion-copy", children: [
|
|
16191
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "scw-suggestion-label text-sm leading-5 font-medium text-neutral-950", children: suggestion.label }),
|
|
16192
|
+
suggestion.description && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "scw-suggestion-label mt-0.5 line-clamp-2 overflow-hidden text-xs text-neutral-500", children: suggestion.description })
|
|
16193
|
+
] })
|
|
16194
|
+
]
|
|
16195
|
+
},
|
|
16196
|
+
suggestion.label
|
|
16197
|
+
)) });
|
|
16198
|
+
}
|
|
16199
|
+
|
|
16200
|
+
// src/lib/support/HomeView.tsx
|
|
16201
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
15507
16202
|
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";
|
|
15508
16203
|
function HomeView({
|
|
15509
16204
|
branding,
|
|
15510
16205
|
conversations,
|
|
16206
|
+
onPick,
|
|
15511
16207
|
onResume,
|
|
15512
|
-
onStartNew
|
|
16208
|
+
onStartNew,
|
|
16209
|
+
suggestions
|
|
15513
16210
|
}) {
|
|
15514
16211
|
const [recent] = conversations;
|
|
15515
|
-
return /* @__PURE__ */ (0,
|
|
15516
|
-
/* @__PURE__ */ (0,
|
|
15517
|
-
/* @__PURE__ */ (0,
|
|
15518
|
-
/* @__PURE__ */ (0,
|
|
15519
|
-
/* @__PURE__ */ (0,
|
|
16212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("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: [
|
|
16213
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex flex-col items-center gap-2 px-0 pt-2 pb-1 text-center", children: [
|
|
16214
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Avatar, { branding, large: true }),
|
|
16215
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "text-lg font-semibold text-neutral-950", children: branding.greeting }),
|
|
16216
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "text-[13px] text-neutral-500", children: branding.teamDescription })
|
|
15520
16217
|
] }),
|
|
15521
|
-
|
|
16218
|
+
suggestions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Suggestions, { onPick, suggestions }),
|
|
16219
|
+
recent && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
15522
16220
|
"button",
|
|
15523
16221
|
{
|
|
15524
|
-
className: "flex w-full cursor-pointer items-center gap-3 rounded-[14px] border border-solid border-
|
|
16222
|
+
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",
|
|
15525
16223
|
onClick: () => onResume(recent),
|
|
15526
16224
|
type: "button",
|
|
15527
16225
|
children: [
|
|
15528
|
-
/* @__PURE__ */ (0,
|
|
15529
|
-
/* @__PURE__ */ (0,
|
|
15530
|
-
/* @__PURE__ */ (0,
|
|
15531
|
-
/* @__PURE__ */ (0,
|
|
16226
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Avatar, { branding }),
|
|
16227
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
16228
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "text-sm font-semibold text-neutral-950", children: branding.workspaceName }),
|
|
16229
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "overflow-hidden text-[13px] text-ellipsis whitespace-nowrap text-neutral-500", children: renderPreviewText(recent.preview, recent.conversationId) })
|
|
15532
16230
|
] }),
|
|
15533
|
-
/* @__PURE__ */ (0,
|
|
16231
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "shrink-0 self-start text-xs text-neutral-400", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
15534
16232
|
CompactTime,
|
|
15535
16233
|
{
|
|
15536
16234
|
messageId: `home-${recent.conversationId}`,
|
|
@@ -15540,54 +16238,47 @@ function HomeView({
|
|
|
15540
16238
|
]
|
|
15541
16239
|
}
|
|
15542
16240
|
),
|
|
15543
|
-
/* @__PURE__ */ (0,
|
|
16241
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { className: SEND_PILL, onClick: onStartNew, type: "button", children: [
|
|
15544
16242
|
"Start a new conversation",
|
|
15545
|
-
/* @__PURE__ */ (0,
|
|
16243
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ArrowRightIcon, {})
|
|
15546
16244
|
] })
|
|
15547
16245
|
] });
|
|
15548
16246
|
}
|
|
15549
16247
|
|
|
15550
16248
|
// src/lib/support/MessagesView.tsx
|
|
15551
|
-
var
|
|
16249
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
15552
16250
|
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";
|
|
15553
16251
|
function MessagesView({
|
|
15554
|
-
activeConversationId,
|
|
15555
16252
|
branding,
|
|
15556
16253
|
conversations,
|
|
15557
16254
|
onResume,
|
|
15558
16255
|
onStartNew
|
|
15559
16256
|
}) {
|
|
15560
|
-
return /* @__PURE__ */ (0,
|
|
15561
|
-
/* @__PURE__ */ (0,
|
|
15562
|
-
|
|
15563
|
-
|
|
15564
|
-
"
|
|
15565
|
-
|
|
15566
|
-
|
|
15567
|
-
|
|
15568
|
-
|
|
15569
|
-
),
|
|
15570
|
-
|
|
15571
|
-
|
|
15572
|
-
|
|
15573
|
-
|
|
15574
|
-
|
|
15575
|
-
|
|
15576
|
-
|
|
15577
|
-
|
|
15578
|
-
|
|
15579
|
-
|
|
15580
|
-
|
|
15581
|
-
|
|
15582
|
-
|
|
15583
|
-
|
|
15584
|
-
|
|
15585
|
-
]
|
|
15586
|
-
},
|
|
15587
|
-
entry.conversationId
|
|
15588
|
-
);
|
|
15589
|
-
}) }) }),
|
|
15590
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
16257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "relative flex min-h-0 flex-1 flex-col overflow-hidden", children: [
|
|
16258
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("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__ */ (0, import_jsx_runtime18.jsx)("p", { className: "my-6 text-center text-sm text-neutral-500", children: "No conversations yet. Start one below." }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex flex-col", children: conversations.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
16259
|
+
"button",
|
|
16260
|
+
{
|
|
16261
|
+
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",
|
|
16262
|
+
onClick: () => onResume(entry),
|
|
16263
|
+
type: "button",
|
|
16264
|
+
children: [
|
|
16265
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Avatar, { branding }),
|
|
16266
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
16267
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "text-sm font-semibold text-neutral-950", children: branding.workspaceName }),
|
|
16268
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "overflow-hidden text-[13px] text-ellipsis whitespace-nowrap text-neutral-500", children: renderPreviewText(entry.preview, entry.conversationId) })
|
|
16269
|
+
] }),
|
|
16270
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "shrink-0 self-start text-xs text-neutral-400", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
16271
|
+
CompactTime,
|
|
16272
|
+
{
|
|
16273
|
+
messageId: `list-${entry.conversationId}`,
|
|
16274
|
+
timestamp: entry.updatedAt
|
|
16275
|
+
}
|
|
16276
|
+
) })
|
|
16277
|
+
]
|
|
16278
|
+
},
|
|
16279
|
+
entry.conversationId
|
|
16280
|
+
)) }) }),
|
|
16281
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
15591
16282
|
"button",
|
|
15592
16283
|
{
|
|
15593
16284
|
className: cn(
|
|
@@ -15598,7 +16289,7 @@ function MessagesView({
|
|
|
15598
16289
|
type: "button",
|
|
15599
16290
|
children: [
|
|
15600
16291
|
"Start a new conversation",
|
|
15601
|
-
/* @__PURE__ */ (0,
|
|
16292
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ArrowRightIcon, {})
|
|
15602
16293
|
]
|
|
15603
16294
|
}
|
|
15604
16295
|
)
|
|
@@ -15606,8 +16297,8 @@ function MessagesView({
|
|
|
15606
16297
|
}
|
|
15607
16298
|
|
|
15608
16299
|
// src/lib/support/PanelHeader.tsx
|
|
15609
|
-
var
|
|
15610
|
-
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-
|
|
16300
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
16301
|
+
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";
|
|
15611
16302
|
function PanelHeader({
|
|
15612
16303
|
agentMuted: _agentMuted,
|
|
15613
16304
|
branding,
|
|
@@ -15616,66 +16307,69 @@ function PanelHeader({
|
|
|
15616
16307
|
view
|
|
15617
16308
|
}) {
|
|
15618
16309
|
if (view === "chat") {
|
|
15619
|
-
return /* @__PURE__ */ (0,
|
|
15620
|
-
/* @__PURE__ */ (0,
|
|
15621
|
-
/* @__PURE__ */ (0,
|
|
16310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-start justify-between gap-2 border-b border-border p-[var(--scw-header-padding)]", children: [
|
|
16311
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
16312
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
15622
16313
|
"button",
|
|
15623
16314
|
{
|
|
15624
16315
|
"aria-label": "Back",
|
|
15625
16316
|
className: HEADER_BTN,
|
|
15626
16317
|
onClick: onBack,
|
|
15627
16318
|
type: "button",
|
|
15628
|
-
children: /* @__PURE__ */ (0,
|
|
16319
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ChevronLeftIcon, {})
|
|
15629
16320
|
}
|
|
15630
16321
|
),
|
|
15631
|
-
/* @__PURE__ */ (0,
|
|
15632
|
-
/* @__PURE__ */ (0,
|
|
16322
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Avatar, { branding }),
|
|
16323
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "min-w-0 leading-[1.3]", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "text-lg font-semibold text-neutral-950", children: branding.workspaceName }) })
|
|
15633
16324
|
] }),
|
|
15634
|
-
/* @__PURE__ */ (0,
|
|
15635
|
-
"button",
|
|
15636
|
-
{
|
|
15637
|
-
"aria-label": "Close chat",
|
|
15638
|
-
className: HEADER_BTN,
|
|
15639
|
-
onClick: onClose,
|
|
15640
|
-
type: "button",
|
|
15641
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CloseIcon, {})
|
|
15642
|
-
}
|
|
15643
|
-
)
|
|
16325
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CloseChatButton, { onClose })
|
|
15644
16326
|
] });
|
|
15645
16327
|
}
|
|
15646
|
-
return /* @__PURE__ */ (0,
|
|
16328
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
15647
16329
|
"div",
|
|
15648
16330
|
{
|
|
15649
16331
|
className: cn(
|
|
15650
|
-
"relative flex min-h-[calc(var(--scw-header-padding)*2+var(--scw-header-btn-size))] items-center justify-center gap-2 border-b border-
|
|
16332
|
+
"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)]"
|
|
15651
16333
|
),
|
|
15652
16334
|
children: [
|
|
15653
|
-
/* @__PURE__ */ (0,
|
|
15654
|
-
/* @__PURE__ */ (0,
|
|
15655
|
-
|
|
16335
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "text-lg font-semibold text-neutral-950", children: view === "messages" ? "Messages" : "" }),
|
|
16336
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
16337
|
+
CloseChatButton,
|
|
15656
16338
|
{
|
|
15657
|
-
|
|
15658
|
-
|
|
15659
|
-
HEADER_BTN,
|
|
15660
|
-
"absolute top-[var(--scw-header-padding)] right-[var(--scw-header-padding)]"
|
|
15661
|
-
),
|
|
15662
|
-
onClick: onClose,
|
|
15663
|
-
type: "button",
|
|
15664
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CloseIcon, {})
|
|
16339
|
+
className: "absolute top-[var(--scw-header-padding)] right-[var(--scw-header-padding)]",
|
|
16340
|
+
onClose
|
|
15665
16341
|
}
|
|
15666
16342
|
)
|
|
15667
16343
|
]
|
|
15668
16344
|
}
|
|
15669
16345
|
);
|
|
15670
16346
|
}
|
|
16347
|
+
function CloseChatButton({
|
|
16348
|
+
className,
|
|
16349
|
+
onClose
|
|
16350
|
+
}) {
|
|
16351
|
+
if (!onClose) {
|
|
16352
|
+
return null;
|
|
16353
|
+
}
|
|
16354
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
16355
|
+
"button",
|
|
16356
|
+
{
|
|
16357
|
+
"aria-label": "Close chat",
|
|
16358
|
+
className: cn(HEADER_BTN, className),
|
|
16359
|
+
onClick: onClose,
|
|
16360
|
+
type: "button",
|
|
16361
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CloseIcon, {})
|
|
16362
|
+
}
|
|
16363
|
+
);
|
|
16364
|
+
}
|
|
15671
16365
|
|
|
15672
16366
|
// src/lib/support/Spinner.tsx
|
|
15673
|
-
var
|
|
16367
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
15674
16368
|
function Spinner({
|
|
15675
16369
|
className,
|
|
15676
16370
|
small
|
|
15677
16371
|
}) {
|
|
15678
|
-
return /* @__PURE__ */ (0,
|
|
16372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
15679
16373
|
"span",
|
|
15680
16374
|
{
|
|
15681
16375
|
"aria-hidden": "true",
|
|
@@ -15689,33 +16383,33 @@ function Spinner({
|
|
|
15689
16383
|
}
|
|
15690
16384
|
|
|
15691
16385
|
// src/lib/support/WidgetConversationView.tsx
|
|
15692
|
-
var
|
|
16386
|
+
var import_react41 = require("react");
|
|
15693
16387
|
|
|
15694
16388
|
// src/lib/support/ComposerFooter.tsx
|
|
15695
|
-
var
|
|
16389
|
+
var import_react36 = require("react");
|
|
15696
16390
|
|
|
15697
16391
|
// src/lib/support/PoweredBy.tsx
|
|
15698
|
-
var
|
|
15699
|
-
var
|
|
16392
|
+
var import_react35 = require("react");
|
|
16393
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
15700
16394
|
function PoweredBy({
|
|
15701
16395
|
projectId
|
|
15702
16396
|
}) {
|
|
15703
|
-
const identity2 = (0,
|
|
16397
|
+
const identity2 = (0, import_react35.useSyncExternalStore)(
|
|
15704
16398
|
subscribeToRegistry,
|
|
15705
16399
|
getIdentity,
|
|
15706
16400
|
getIdentity
|
|
15707
16401
|
);
|
|
15708
16402
|
const hrefFromTraits = typeof identity2?.traits?.$href === "string" ? identity2.traits.$href : void 0;
|
|
15709
|
-
const [hostDomain, setHostDomain] = (0,
|
|
16403
|
+
const [hostDomain, setHostDomain] = (0, import_react35.useState)(
|
|
15710
16404
|
() => readHostnameFromHref(hrefFromTraits)
|
|
15711
16405
|
);
|
|
15712
|
-
(0,
|
|
16406
|
+
(0, import_react35.useEffect)(() => {
|
|
15713
16407
|
const fromTraits = readHostnameFromHref(hrefFromTraits);
|
|
15714
16408
|
if (fromTraits) {
|
|
15715
16409
|
setHostDomain(fromTraits);
|
|
15716
16410
|
}
|
|
15717
16411
|
}, [hrefFromTraits]);
|
|
15718
|
-
(0,
|
|
16412
|
+
(0, import_react35.useEffect)(() => {
|
|
15719
16413
|
if (hostDomain) {
|
|
15720
16414
|
return;
|
|
15721
16415
|
}
|
|
@@ -15737,17 +16431,17 @@ function PoweredBy({
|
|
|
15737
16431
|
cancelled = true;
|
|
15738
16432
|
};
|
|
15739
16433
|
}, [hostDomain]);
|
|
15740
|
-
return /* @__PURE__ */ (0,
|
|
16434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
15741
16435
|
"a",
|
|
15742
16436
|
{
|
|
15743
16437
|
"aria-label": "Powered by Saasco",
|
|
15744
|
-
className: "inline-flex items-center gap-[5px] rounded-full border border-solid border-
|
|
16438
|
+
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",
|
|
15745
16439
|
href: buildSaascoPoweredByHref(projectId, hostDomain),
|
|
15746
16440
|
rel: "noopener noreferrer",
|
|
15747
16441
|
target: "_blank",
|
|
15748
16442
|
children: [
|
|
15749
|
-
/* @__PURE__ */ (0,
|
|
15750
|
-
/* @__PURE__ */ (0,
|
|
16443
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-neutral-400", children: "Powered by" }),
|
|
16444
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SaascoLogo, {})
|
|
15751
16445
|
]
|
|
15752
16446
|
}
|
|
15753
16447
|
) });
|
|
@@ -15766,15 +16460,15 @@ function buildSaascoPoweredByHref(projectId, hostDomain) {
|
|
|
15766
16460
|
|
|
15767
16461
|
// src/lib/support/ui/message-scroller.tsx
|
|
15768
16462
|
var import_message_scroller = require("@shadcn/react/message-scroller");
|
|
15769
|
-
var
|
|
16463
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
15770
16464
|
function MessageScrollerProvider(props) {
|
|
15771
|
-
return /* @__PURE__ */ (0,
|
|
16465
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_message_scroller.MessageScroller.Provider, { ...props });
|
|
15772
16466
|
}
|
|
15773
16467
|
function MessageScroller({
|
|
15774
16468
|
className,
|
|
15775
16469
|
...props
|
|
15776
16470
|
}) {
|
|
15777
|
-
return /* @__PURE__ */ (0,
|
|
16471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15778
16472
|
import_message_scroller.MessageScroller.Root,
|
|
15779
16473
|
{
|
|
15780
16474
|
"data-slot": "message-scroller",
|
|
@@ -15790,7 +16484,7 @@ function MessageScrollerViewport({
|
|
|
15790
16484
|
className,
|
|
15791
16485
|
...props
|
|
15792
16486
|
}) {
|
|
15793
|
-
return /* @__PURE__ */ (0,
|
|
16487
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15794
16488
|
import_message_scroller.MessageScroller.Viewport,
|
|
15795
16489
|
{
|
|
15796
16490
|
"data-slot": "message-scroller-viewport",
|
|
@@ -15810,7 +16504,7 @@ function MessageScrollerContent({
|
|
|
15810
16504
|
className,
|
|
15811
16505
|
...props
|
|
15812
16506
|
}) {
|
|
15813
|
-
return /* @__PURE__ */ (0,
|
|
16507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15814
16508
|
import_message_scroller.MessageScroller.Content,
|
|
15815
16509
|
{
|
|
15816
16510
|
"data-slot": "message-scroller-content",
|
|
@@ -15830,7 +16524,7 @@ function MessageScrollerItem({
|
|
|
15830
16524
|
scrollAnchor = false,
|
|
15831
16525
|
...props
|
|
15832
16526
|
}) {
|
|
15833
|
-
return /* @__PURE__ */ (0,
|
|
16527
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15834
16528
|
import_message_scroller.MessageScroller.Item,
|
|
15835
16529
|
{
|
|
15836
16530
|
"data-slot": "message-scroller-item",
|
|
@@ -15847,7 +16541,7 @@ function MessageScrollerItem({
|
|
|
15847
16541
|
}
|
|
15848
16542
|
|
|
15849
16543
|
// src/lib/support/ComposerFooter.tsx
|
|
15850
|
-
var
|
|
16544
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
15851
16545
|
function ComposerFooter({
|
|
15852
16546
|
active,
|
|
15853
16547
|
projectId,
|
|
@@ -15858,8 +16552,8 @@ function ComposerFooter({
|
|
|
15858
16552
|
const { scrollToEnd } = (0, import_message_scroller.useMessageScroller)();
|
|
15859
16553
|
const showScrollToBottom = useAwayFromScrollBottom(scrollRef, active);
|
|
15860
16554
|
const transition = reduceMotion ? { duration: 0 } : SCROLL_BOTTOM_TRANSITION;
|
|
15861
|
-
return /* @__PURE__ */ (0,
|
|
15862
|
-
/* @__PURE__ */ (0,
|
|
16555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "pointer-events-none absolute inset-x-0 bottom-full mb-2.5", children: [
|
|
16556
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
15863
16557
|
motion.div,
|
|
15864
16558
|
{
|
|
15865
16559
|
animate: {
|
|
@@ -15871,10 +16565,10 @@ function ComposerFooter({
|
|
|
15871
16565
|
initial: false,
|
|
15872
16566
|
style: { pointerEvents: showScrollToBottom ? "none" : "auto" },
|
|
15873
16567
|
transition,
|
|
15874
|
-
children: /* @__PURE__ */ (0,
|
|
16568
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(PoweredBy, { projectId })
|
|
15875
16569
|
}
|
|
15876
16570
|
),
|
|
15877
|
-
/* @__PURE__ */ (0,
|
|
16571
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
15878
16572
|
motion.button,
|
|
15879
16573
|
{
|
|
15880
16574
|
animate: {
|
|
@@ -15884,7 +16578,7 @@ function ComposerFooter({
|
|
|
15884
16578
|
},
|
|
15885
16579
|
"aria-hidden": !showScrollToBottom,
|
|
15886
16580
|
"aria-label": "Scroll to latest messages",
|
|
15887
|
-
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-
|
|
16581
|
+
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",
|
|
15888
16582
|
initial: false,
|
|
15889
16583
|
onClick: () => {
|
|
15890
16584
|
scrollReleasedRef.current = true;
|
|
@@ -15894,14 +16588,14 @@ function ComposerFooter({
|
|
|
15894
16588
|
tabIndex: showScrollToBottom ? 0 : -1,
|
|
15895
16589
|
transition,
|
|
15896
16590
|
type: "button",
|
|
15897
|
-
children: /* @__PURE__ */ (0,
|
|
16591
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ScrollChevronDownIcon, {})
|
|
15898
16592
|
}
|
|
15899
16593
|
)
|
|
15900
16594
|
] });
|
|
15901
16595
|
}
|
|
15902
16596
|
function useAwayFromScrollBottom(scrollRef, active) {
|
|
15903
|
-
const [away, setAway] = (0,
|
|
15904
|
-
(0,
|
|
16597
|
+
const [away, setAway] = (0, import_react36.useState)(false);
|
|
16598
|
+
(0, import_react36.useEffect)(() => {
|
|
15905
16599
|
if (!active) {
|
|
15906
16600
|
setAway(false);
|
|
15907
16601
|
return;
|
|
@@ -15940,11 +16634,11 @@ function useAwayFromScrollBottom(scrollRef, active) {
|
|
|
15940
16634
|
}
|
|
15941
16635
|
|
|
15942
16636
|
// src/lib/support/MessageList.tsx
|
|
15943
|
-
var
|
|
16637
|
+
var import_react39 = require("react");
|
|
15944
16638
|
|
|
15945
16639
|
// src/lib/support/ui/marker.tsx
|
|
15946
16640
|
var import_react_slot3 = require("@radix-ui/react-slot");
|
|
15947
|
-
var
|
|
16641
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
15948
16642
|
var markerVariants = cva(
|
|
15949
16643
|
"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",
|
|
15950
16644
|
{
|
|
@@ -15964,7 +16658,7 @@ function Marker({
|
|
|
15964
16658
|
...props
|
|
15965
16659
|
}) {
|
|
15966
16660
|
const Comp = asChild ? import_react_slot3.Slot : "div";
|
|
15967
|
-
return /* @__PURE__ */ (0,
|
|
16661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
15968
16662
|
Comp,
|
|
15969
16663
|
{
|
|
15970
16664
|
"data-slot": "marker",
|
|
@@ -15975,7 +16669,7 @@ function Marker({
|
|
|
15975
16669
|
);
|
|
15976
16670
|
}
|
|
15977
16671
|
function MarkerIcon({ className, ...props }) {
|
|
15978
|
-
return /* @__PURE__ */ (0,
|
|
16672
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
15979
16673
|
"span",
|
|
15980
16674
|
{
|
|
15981
16675
|
"data-slot": "marker-icon",
|
|
@@ -15989,7 +16683,7 @@ function MarkerIcon({ className, ...props }) {
|
|
|
15989
16683
|
);
|
|
15990
16684
|
}
|
|
15991
16685
|
function MarkerContent({ className, ...props }) {
|
|
15992
|
-
return /* @__PURE__ */ (0,
|
|
16686
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
15993
16687
|
"span",
|
|
15994
16688
|
{
|
|
15995
16689
|
"data-slot": "marker-content",
|
|
@@ -16003,37 +16697,13 @@ function MarkerContent({ className, ...props }) {
|
|
|
16003
16697
|
}
|
|
16004
16698
|
|
|
16005
16699
|
// src/lib/support/JoinNotice.tsx
|
|
16006
|
-
var
|
|
16700
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
16007
16701
|
function JoinNotice({
|
|
16008
16702
|
message
|
|
16009
16703
|
}) {
|
|
16010
16704
|
const name = readAuthorName(message);
|
|
16011
16705
|
const label = name && name !== "Team" ? `${name} has joined the conversation` : "A teammate has joined the conversation";
|
|
16012
|
-
return /* @__PURE__ */ (0,
|
|
16013
|
-
}
|
|
16014
|
-
|
|
16015
|
-
// src/lib/support/Suggestions.tsx
|
|
16016
|
-
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
16017
|
-
function Suggestions({
|
|
16018
|
-
onPick,
|
|
16019
|
-
suggestions
|
|
16020
|
-
}) {
|
|
16021
|
-
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex flex-col gap-2", children: suggestions.map((suggestion) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
16022
|
-
"button",
|
|
16023
|
-
{
|
|
16024
|
-
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",
|
|
16025
|
-
onClick: () => onPick(suggestion.prompt),
|
|
16026
|
-
type: "button",
|
|
16027
|
-
children: [
|
|
16028
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-lg bg-neutral-100 text-neutral-700", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SparklesIcon, {}) }),
|
|
16029
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "flex min-w-0 flex-col", children: [
|
|
16030
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-sm font-medium text-neutral-950", children: suggestion.label }),
|
|
16031
|
-
suggestion.description && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "mt-0.5 line-clamp-2 overflow-hidden text-xs text-neutral-500", children: suggestion.description })
|
|
16032
|
-
] })
|
|
16033
|
-
]
|
|
16034
|
-
},
|
|
16035
|
-
suggestion.label
|
|
16036
|
-
)) });
|
|
16706
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Marker, { className: "scw-message-in justify-center py-2 text-center text-xs text-neutral-500", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(MarkerContent, { children: label }) });
|
|
16037
16707
|
}
|
|
16038
16708
|
|
|
16039
16709
|
// src/lib/support/HandoffCard.tsx
|
|
@@ -16047,7 +16717,7 @@ function HandoffCard({
|
|
|
16047
16717
|
pending,
|
|
16048
16718
|
reason
|
|
16049
16719
|
}) {
|
|
16050
|
-
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "w-full rounded-lg border border-solid border-
|
|
16720
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "w-full rounded-lg border border-solid border-border bg-white p-3", children: [
|
|
16051
16721
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "text-[10px] font-semibold tracking-[0.04em] text-neutral-500 uppercase", children: "Connect with the team" }),
|
|
16052
16722
|
reason ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "mt-1.5 text-[13px] text-neutral-900", children: reason }) : null,
|
|
16053
16723
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "mt-1 text-xs text-neutral-600", children: "A human teammate can take over from here and reply right in this chat." }),
|
|
@@ -16080,15 +16750,16 @@ function HandoffCard({
|
|
|
16080
16750
|
}
|
|
16081
16751
|
|
|
16082
16752
|
// src/lib/support/hiddenTools.ts
|
|
16083
|
-
var
|
|
16753
|
+
var import_ai7 = require("ai");
|
|
16084
16754
|
var HIDDEN_WIDGET_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
16085
16755
|
CLOSE_CONVERSATION_TOOL_NAME,
|
|
16756
|
+
REPORT_KNOWLEDGE_GAP_TOOL_NAME,
|
|
16086
16757
|
REQUEST_HUMAN_HANDOFF_TOOL_NAME
|
|
16087
16758
|
]);
|
|
16088
16759
|
function collectHiddenToolCallIds(message) {
|
|
16089
16760
|
const ids = /* @__PURE__ */ new Set();
|
|
16090
16761
|
for (const part of message.parts ?? []) {
|
|
16091
|
-
if ((0,
|
|
16762
|
+
if ((0, import_ai7.isToolUIPart)(part) && HIDDEN_WIDGET_TOOL_NAMES.has((0, import_ai7.getToolName)(part))) {
|
|
16092
16763
|
ids.add(part.toolCallId);
|
|
16093
16764
|
}
|
|
16094
16765
|
}
|
|
@@ -16123,9 +16794,6 @@ function humanizeToolName(toolName) {
|
|
|
16123
16794
|
).join(" ");
|
|
16124
16795
|
}
|
|
16125
16796
|
|
|
16126
|
-
// src/lib/support/ToolGroup.tsx
|
|
16127
|
-
var import_react35 = require("react");
|
|
16128
|
-
|
|
16129
16797
|
// src/lib/support/ApprovalCard.tsx
|
|
16130
16798
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
16131
16799
|
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";
|
|
@@ -16138,7 +16806,7 @@ function ApprovalCard({
|
|
|
16138
16806
|
toolName
|
|
16139
16807
|
}) {
|
|
16140
16808
|
const displayLabel = resolveToolLabel(toolName, label);
|
|
16141
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "w-full rounded-lg border border-solid border-
|
|
16809
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "w-full rounded-lg border border-solid border-border bg-white p-3 text-xs text-neutral-900", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-start gap-2.5", children: [
|
|
16142
16810
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
16143
16811
|
"div",
|
|
16144
16812
|
{
|
|
@@ -16197,17 +16865,15 @@ function ToolGroup({
|
|
|
16197
16865
|
toolLabels,
|
|
16198
16866
|
tools
|
|
16199
16867
|
}) {
|
|
16200
|
-
const [expanded, setExpanded] = (0, import_react35.useState)(false);
|
|
16201
16868
|
const hostAwaitingApproval = tools.filter(
|
|
16202
16869
|
(tool) => pending.has(tool.toolCallId)
|
|
16203
16870
|
);
|
|
16204
16871
|
const serverAwaitingApproval = tools.filter(
|
|
16205
16872
|
(tool) => tool.state === "approval-requested" && tool.approvalId
|
|
16206
16873
|
);
|
|
16207
|
-
|
|
16208
|
-
|
|
16209
|
-
|
|
16210
|
-
const activeLabel = active ? resolveToolDisplayLabel(active.toolName, toolLabels) : void 0;
|
|
16874
|
+
if (hostAwaitingApproval.length === 0 && serverAwaitingApproval.length === 0) {
|
|
16875
|
+
return null;
|
|
16876
|
+
}
|
|
16211
16877
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex w-full max-w-[88%] flex-col gap-1.5 self-start", children: [
|
|
16212
16878
|
hostAwaitingApproval.map((tool) => {
|
|
16213
16879
|
const approval = pending.get(tool.toolCallId);
|
|
@@ -16240,49 +16906,9 @@ function ToolGroup({
|
|
|
16240
16906
|
},
|
|
16241
16907
|
approvalId
|
|
16242
16908
|
);
|
|
16243
|
-
})
|
|
16244
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
16245
|
-
"button",
|
|
16246
|
-
{
|
|
16247
|
-
"aria-expanded": expanded,
|
|
16248
|
-
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",
|
|
16249
|
-
onClick: () => setExpanded((value) => !value),
|
|
16250
|
-
type: "button",
|
|
16251
|
-
children: [
|
|
16252
|
-
running ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Spinner, { small: true }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
16253
|
-
"span",
|
|
16254
|
-
{
|
|
16255
|
-
className: cn(
|
|
16256
|
-
"flex items-center text-neutral-400 transition-transform duration-150 ease-in-out",
|
|
16257
|
-
expanded && "rotate-90"
|
|
16258
|
-
),
|
|
16259
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ChevronIcon, {})
|
|
16260
|
-
}
|
|
16261
|
-
),
|
|
16262
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "font-medium", children: summary }),
|
|
16263
|
-
running && activeLabel && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "overflow-hidden text-ellipsis whitespace-nowrap text-neutral-400", children: [
|
|
16264
|
-
"\xB7 ",
|
|
16265
|
-
activeLabel
|
|
16266
|
-
] })
|
|
16267
|
-
]
|
|
16268
|
-
}
|
|
16269
|
-
),
|
|
16270
|
-
expanded && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex flex-col gap-1 border-l border-neutral-200 pl-2.5", children: tools.map((tool) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
16271
|
-
"div",
|
|
16272
|
-
{
|
|
16273
|
-
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",
|
|
16274
|
-
children: [
|
|
16275
|
-
isToolPartComplete(tool.state) ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "size-1 shrink-0 rounded-full bg-neutral-400" }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Spinner, { small: true }),
|
|
16276
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: resolveToolDisplayLabel(tool.toolName, toolLabels) })
|
|
16277
|
-
]
|
|
16278
|
-
},
|
|
16279
|
-
tool.toolCallId
|
|
16280
|
-
)) })
|
|
16909
|
+
})
|
|
16281
16910
|
] });
|
|
16282
16911
|
}
|
|
16283
|
-
function resolveToolDisplayLabel(toolName, toolLabels) {
|
|
16284
|
-
return toolLabels[toolName] ?? humanizeToolName(toolName);
|
|
16285
|
-
}
|
|
16286
16912
|
|
|
16287
16913
|
// src/lib/support/ui/bubble.tsx
|
|
16288
16914
|
var import_react_slot4 = require("@radix-ui/react-slot");
|
|
@@ -16430,6 +17056,10 @@ function SupportMessage({
|
|
|
16430
17056
|
const blocks = stripHiddenTools(
|
|
16431
17057
|
buildMessageBlocks(message),
|
|
16432
17058
|
collectHiddenToolCallIds(message)
|
|
17059
|
+
).filter(
|
|
17060
|
+
(block) => block.kind !== "tools" || block.tools.some(
|
|
17061
|
+
(tool) => pending.has(tool.toolCallId) || tool.state === "approval-requested" && !!tool.approvalId
|
|
17062
|
+
)
|
|
16433
17063
|
);
|
|
16434
17064
|
const attachmentUrls = readMessageAttachmentUrls(message);
|
|
16435
17065
|
if (blocks.length === 0 && !showHandoffCard && attachmentUrls.length === 0) {
|
|
@@ -16460,9 +17090,9 @@ function SupportMessage({
|
|
|
16460
17090
|
BubbleContent,
|
|
16461
17091
|
{
|
|
16462
17092
|
className: cn(
|
|
16463
|
-
"text-[14px] leading-[1.45] whitespace-pre-wrap [&_strong]:font-semibold",
|
|
17093
|
+
"text-[14px] leading-[1.45] whitespace-pre-wrap [&_strong]:font-semibold [&_table]:whitespace-normal",
|
|
16464
17094
|
isCustomer && "rounded-2xl rounded-br-[4px] bg-neutral-900 px-[13px] py-[9px] text-white",
|
|
16465
|
-
isTeam && "rounded-2xl rounded-bl-[4px] bg-
|
|
17095
|
+
isTeam && "rounded-2xl rounded-bl-[4px] bg-neutral-100 px-[13px] py-[9px] text-neutral-950",
|
|
16466
17096
|
!isCustomer && !isTeam && "max-w-full rounded-none bg-transparent px-0 py-1 text-neutral-950"
|
|
16467
17097
|
),
|
|
16468
17098
|
children: renderMessageText(block.text, kbArticles, isStreamingBlock)
|
|
@@ -16525,13 +17155,13 @@ function SupportMessage({
|
|
|
16525
17155
|
showHandoffCard && handoffOffer && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
16526
17156
|
HandoffCard,
|
|
16527
17157
|
{
|
|
16528
|
-
onConfirm: () => handoff.onConfirm(handoffOffer
|
|
17158
|
+
onConfirm: () => handoff.onConfirm(handoffOffer),
|
|
16529
17159
|
onDismiss: () => handoff.onDismiss(handoffOffer.toolCallId),
|
|
16530
17160
|
pending: handoff.pending,
|
|
16531
17161
|
reason: handoffOffer.reason
|
|
16532
17162
|
}
|
|
16533
17163
|
),
|
|
16534
|
-
(hasText || attachmentUrls.length > 0) && group.showTimestamp && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(MessageFooter, { className: "px-0 text-[11px] text-
|
|
17164
|
+
(hasText || attachmentUrls.length > 0) && group.showTimestamp && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(MessageFooter, { className: "px-0 text-[11px] text-neutral-500", children: isCustomer ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
16535
17165
|
CompactTime,
|
|
16536
17166
|
{
|
|
16537
17167
|
messageId: message.id,
|
|
@@ -16556,7 +17186,7 @@ function SupportMessage({
|
|
|
16556
17186
|
}
|
|
16557
17187
|
|
|
16558
17188
|
// src/lib/support/useFollowBottomAfterUserScroll.ts
|
|
16559
|
-
var
|
|
17189
|
+
var import_react37 = require("react");
|
|
16560
17190
|
var SPACER_SELECTOR = "[data-message-scroller-spacer]";
|
|
16561
17191
|
var ANCHOR_SELECTOR = '[data-scroll-anchor="true"]';
|
|
16562
17192
|
var SCROLL_KEYS = /* @__PURE__ */ new Set([
|
|
@@ -16570,7 +17200,7 @@ var SCROLL_KEYS = /* @__PURE__ */ new Set([
|
|
|
16570
17200
|
]);
|
|
16571
17201
|
function useFollowBottomAfterUserScroll(scrollRef, scrollReleasedRef) {
|
|
16572
17202
|
const { scrollToEnd } = (0, import_message_scroller.useMessageScroller)();
|
|
16573
|
-
(0,
|
|
17203
|
+
(0, import_react37.useEffect)(() => {
|
|
16574
17204
|
const viewport = scrollRef.current;
|
|
16575
17205
|
const spacer = viewport?.querySelector(SPACER_SELECTOR);
|
|
16576
17206
|
const content = spacer?.parentElement;
|
|
@@ -16647,10 +17277,10 @@ function useFollowBottomAfterUserScroll(scrollRef, scrollReleasedRef) {
|
|
|
16647
17277
|
}
|
|
16648
17278
|
|
|
16649
17279
|
// src/lib/support/useLiftSpacerClamp.ts
|
|
16650
|
-
var
|
|
17280
|
+
var import_react38 = require("react");
|
|
16651
17281
|
var SPACER_SELECTOR2 = "[data-message-scroller-spacer]";
|
|
16652
17282
|
function useLiftSpacerClamp(scrollRef) {
|
|
16653
|
-
(0,
|
|
17283
|
+
(0, import_react38.useEffect)(() => {
|
|
16654
17284
|
const viewport = scrollRef.current;
|
|
16655
17285
|
const spacer = viewport?.querySelector(SPACER_SELECTOR2);
|
|
16656
17286
|
const content = spacer?.parentElement;
|
|
@@ -16660,13 +17290,13 @@ function useLiftSpacerClamp(scrollRef) {
|
|
|
16660
17290
|
const frameWindow = viewport.ownerDocument.defaultView ?? window;
|
|
16661
17291
|
const ResizeObserverImpl = frameWindow.ResizeObserver ?? window.ResizeObserver;
|
|
16662
17292
|
let frame2 = 0;
|
|
16663
|
-
const
|
|
17293
|
+
const clamp3 = () => {
|
|
16664
17294
|
const ceiling = measureLiftCeiling(viewport, content, spacer);
|
|
16665
17295
|
spacer.style.maxHeight = `${ceiling}px`;
|
|
16666
17296
|
};
|
|
16667
17297
|
const observer2 = new ResizeObserverImpl(() => {
|
|
16668
17298
|
frameWindow.cancelAnimationFrame(frame2);
|
|
16669
|
-
frame2 = frameWindow.requestAnimationFrame(
|
|
17299
|
+
frame2 = frameWindow.requestAnimationFrame(clamp3);
|
|
16670
17300
|
});
|
|
16671
17301
|
observer2.observe(content);
|
|
16672
17302
|
observer2.observe(viewport);
|
|
@@ -16710,6 +17340,7 @@ var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
|
16710
17340
|
function MessageList({
|
|
16711
17341
|
agentMuted,
|
|
16712
17342
|
branding,
|
|
17343
|
+
conversationState,
|
|
16713
17344
|
dismissedHandoffs,
|
|
16714
17345
|
error,
|
|
16715
17346
|
handoffPending,
|
|
@@ -16735,11 +17366,11 @@ function MessageList({
|
|
|
16735
17366
|
useReportVisibleTeamMessagesSeen(messages, onTeamMessagesSeen);
|
|
16736
17367
|
useLiftSpacerClamp(scrollRef);
|
|
16737
17368
|
useFollowBottomAfterUserScroll(scrollRef, scrollReleasedRef);
|
|
16738
|
-
const kbArticles = (0,
|
|
17369
|
+
const kbArticles = (0, import_react39.useMemo)(
|
|
16739
17370
|
() => resolveKbArticlesFromMessages(messages),
|
|
16740
17371
|
[messages]
|
|
16741
17372
|
);
|
|
16742
|
-
const lastUserMessageId = (0,
|
|
17373
|
+
const lastUserMessageId = (0, import_react39.useMemo)(() => {
|
|
16743
17374
|
for (let index2 = messages.length - 1; index2 >= 0; index2 -= 1) {
|
|
16744
17375
|
const message = messages[index2];
|
|
16745
17376
|
if (message?.role === "user") {
|
|
@@ -16749,7 +17380,12 @@ function MessageList({
|
|
|
16749
17380
|
return null;
|
|
16750
17381
|
}, [messages]);
|
|
16751
17382
|
const showTyping = typingLabel !== null;
|
|
16752
|
-
const showWaiting =
|
|
17383
|
+
const showWaiting = shouldShowWaitingForTeammate({
|
|
17384
|
+
agentMuted,
|
|
17385
|
+
conversationState,
|
|
17386
|
+
isTyping: showTyping,
|
|
17387
|
+
messages
|
|
17388
|
+
});
|
|
16753
17389
|
const showError = !!error && !isTakeoverError;
|
|
16754
17390
|
const showSuggestions = messages.length === 0 && suggestions.length > 0;
|
|
16755
17391
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(MessageScroller, { className: "relative flex min-h-0 min-w-0 flex-1 flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
@@ -16772,7 +17408,10 @@ function MessageList({
|
|
|
16772
17408
|
ref: scrollRef,
|
|
16773
17409
|
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(MessageScrollerContent, { "aria-busy": isResponding, children: [
|
|
16774
17410
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(MessageScrollerItem, { className: "max-w-full min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex flex-col gap-2.5", children: [
|
|
16775
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.
|
|
17411
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-start gap-2 pt-1", children: [
|
|
17412
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Avatar, { branding }),
|
|
17413
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("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 })
|
|
17414
|
+
] }),
|
|
16776
17415
|
showSuggestions && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Suggestions, { onPick, suggestions })
|
|
16777
17416
|
] }) }, "intro"),
|
|
16778
17417
|
messages.map((message, index2) => {
|
|
@@ -16850,7 +17489,7 @@ function MessageList({
|
|
|
16850
17489
|
]
|
|
16851
17490
|
}
|
|
16852
17491
|
) }, "waiting"),
|
|
16853
|
-
showError && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(MessageScrollerItem, { className: "max-w-full min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "rounded-md border border-solid border-
|
|
17492
|
+
showError && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(MessageScrollerItem, { className: "max-w-full min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "rounded-md border border-solid border-border bg-neutral-100 px-3 py-2.5 text-xs text-neutral-700", children: [
|
|
16854
17493
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "font-medium text-neutral-900", children: "Something went wrong" }),
|
|
16855
17494
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { children: error?.message }),
|
|
16856
17495
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
@@ -16867,13 +17506,9 @@ function MessageList({
|
|
|
16867
17506
|
}
|
|
16868
17507
|
) });
|
|
16869
17508
|
}
|
|
16870
|
-
function lastMessageIsFromTeam(messages) {
|
|
16871
|
-
const lastMessage = messages.at(-1);
|
|
16872
|
-
return !!lastMessage && readSupportRole(lastMessage) === "team";
|
|
16873
|
-
}
|
|
16874
17509
|
function useReportVisibleTeamMessagesSeen(messages, onTeamMessagesSeen) {
|
|
16875
17510
|
const { visibleMessageIds } = (0, import_message_scroller.useMessageScrollerVisibility)();
|
|
16876
|
-
const teamMessageIds = (0,
|
|
17511
|
+
const teamMessageIds = (0, import_react39.useMemo)(() => {
|
|
16877
17512
|
const ids = /* @__PURE__ */ new Set();
|
|
16878
17513
|
for (const message of messages) {
|
|
16879
17514
|
if (readSupportRole(message) === "team") {
|
|
@@ -16883,7 +17518,7 @@ function useReportVisibleTeamMessagesSeen(messages, onTeamMessagesSeen) {
|
|
|
16883
17518
|
return ids;
|
|
16884
17519
|
}, [messages]);
|
|
16885
17520
|
const visibleTeamKey = visibleMessageIds.filter((id3) => teamMessageIds.has(id3)).join(",");
|
|
16886
|
-
(0,
|
|
17521
|
+
(0, import_react39.useEffect)(() => {
|
|
16887
17522
|
if (!visibleTeamKey) {
|
|
16888
17523
|
return;
|
|
16889
17524
|
}
|
|
@@ -16892,24 +17527,27 @@ function useReportVisibleTeamMessagesSeen(messages, onTeamMessagesSeen) {
|
|
|
16892
17527
|
}
|
|
16893
17528
|
|
|
16894
17529
|
// src/lib/support/MessageScrollbar.tsx
|
|
16895
|
-
var
|
|
17530
|
+
var import_react40 = require("react");
|
|
16896
17531
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
17532
|
+
var SCROLLBAR_HIDE_DELAY_MS = 700;
|
|
16897
17533
|
function MessageScrollbar({
|
|
16898
17534
|
recomputeKey,
|
|
16899
17535
|
scrollRef
|
|
16900
17536
|
}) {
|
|
16901
|
-
const trackRef = (0,
|
|
16902
|
-
const thumbRef = (0,
|
|
16903
|
-
const dragRef = (0,
|
|
17537
|
+
const trackRef = (0, import_react40.useRef)(null);
|
|
17538
|
+
const thumbRef = (0, import_react40.useRef)(null);
|
|
17539
|
+
const dragRef = (0, import_react40.useRef)(
|
|
16904
17540
|
null
|
|
16905
17541
|
);
|
|
16906
|
-
const
|
|
17542
|
+
const hideTimerRef = (0, import_react40.useRef)(null);
|
|
17543
|
+
const [moving, setMoving] = (0, import_react40.useState)(false);
|
|
17544
|
+
const [thumb, setThumb] = (0, import_react40.useState)({
|
|
16907
17545
|
height: 0,
|
|
16908
17546
|
top: 0,
|
|
16909
17547
|
valueNow: 0,
|
|
16910
17548
|
visible: false
|
|
16911
17549
|
});
|
|
16912
|
-
const recompute = (0,
|
|
17550
|
+
const recompute = (0, import_react40.useCallback)(() => {
|
|
16913
17551
|
const scroller = scrollRef.current;
|
|
16914
17552
|
const track = trackRef.current;
|
|
16915
17553
|
if (!(scroller && track)) {
|
|
@@ -16934,10 +17572,10 @@ function MessageScrollbar({
|
|
|
16934
17572
|
visible: true
|
|
16935
17573
|
});
|
|
16936
17574
|
}, [scrollRef]);
|
|
16937
|
-
(0,
|
|
17575
|
+
(0, import_react40.useLayoutEffect)(() => {
|
|
16938
17576
|
recompute();
|
|
16939
17577
|
}, [recompute, recomputeKey]);
|
|
16940
|
-
(0,
|
|
17578
|
+
(0, import_react40.useEffect)(() => {
|
|
16941
17579
|
const scroller = scrollRef.current;
|
|
16942
17580
|
const track = trackRef.current;
|
|
16943
17581
|
if (!(scroller && track)) {
|
|
@@ -16954,6 +17592,32 @@ function MessageScrollbar({
|
|
|
16954
17592
|
observer2.disconnect();
|
|
16955
17593
|
};
|
|
16956
17594
|
}, [recompute, scrollRef]);
|
|
17595
|
+
const revealWhileMoving = (0, import_react40.useCallback)(() => {
|
|
17596
|
+
setMoving(true);
|
|
17597
|
+
if (hideTimerRef.current) {
|
|
17598
|
+
clearTimeout(hideTimerRef.current);
|
|
17599
|
+
}
|
|
17600
|
+
hideTimerRef.current = setTimeout(() => {
|
|
17601
|
+
hideTimerRef.current = null;
|
|
17602
|
+
if (dragRef.current) {
|
|
17603
|
+
return;
|
|
17604
|
+
}
|
|
17605
|
+
setMoving(false);
|
|
17606
|
+
}, SCROLLBAR_HIDE_DELAY_MS);
|
|
17607
|
+
}, []);
|
|
17608
|
+
(0, import_react40.useEffect)(() => {
|
|
17609
|
+
const scroller = scrollRef.current;
|
|
17610
|
+
if (!scroller) {
|
|
17611
|
+
return;
|
|
17612
|
+
}
|
|
17613
|
+
scroller.addEventListener("scroll", revealWhileMoving, { passive: true });
|
|
17614
|
+
return () => {
|
|
17615
|
+
scroller.removeEventListener("scroll", revealWhileMoving);
|
|
17616
|
+
if (hideTimerRef.current) {
|
|
17617
|
+
clearTimeout(hideTimerRef.current);
|
|
17618
|
+
}
|
|
17619
|
+
};
|
|
17620
|
+
}, [revealWhileMoving, scrollRef]);
|
|
16957
17621
|
const onThumbPointerDown = (event) => {
|
|
16958
17622
|
const scroller = scrollRef.current;
|
|
16959
17623
|
if (!scroller) {
|
|
@@ -16988,11 +17652,15 @@ function MessageScrollbar({
|
|
|
16988
17652
|
const onThumbPointerUp = (event) => {
|
|
16989
17653
|
dragRef.current = null;
|
|
16990
17654
|
thumbRef.current?.releasePointerCapture(event.pointerId);
|
|
17655
|
+
revealWhileMoving();
|
|
16991
17656
|
};
|
|
16992
17657
|
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
16993
17658
|
"div",
|
|
16994
17659
|
{
|
|
16995
|
-
className: cn(
|
|
17660
|
+
className: cn(
|
|
17661
|
+
"scw-scrollbar",
|
|
17662
|
+
thumb.visible && moving && "scw-scrollbar-visible"
|
|
17663
|
+
),
|
|
16996
17664
|
ref: trackRef,
|
|
16997
17665
|
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
16998
17666
|
"div",
|
|
@@ -17025,9 +17693,11 @@ function WidgetConversationView({
|
|
|
17025
17693
|
activeTransition,
|
|
17026
17694
|
agentMuted,
|
|
17027
17695
|
branding,
|
|
17696
|
+
conversationState,
|
|
17028
17697
|
dismissedHandoffs,
|
|
17029
17698
|
draft,
|
|
17030
17699
|
emailDraft,
|
|
17700
|
+
emailError,
|
|
17031
17701
|
error,
|
|
17032
17702
|
handoffPending,
|
|
17033
17703
|
imageInputRef,
|
|
@@ -17042,6 +17712,7 @@ function WidgetConversationView({
|
|
|
17042
17712
|
onConfirmHandoff,
|
|
17043
17713
|
onDismissHandoff,
|
|
17044
17714
|
onDraftChange,
|
|
17715
|
+
onEmailBlur,
|
|
17045
17716
|
onEmailChange,
|
|
17046
17717
|
onImageSelection,
|
|
17047
17718
|
onPick,
|
|
@@ -17100,6 +17771,7 @@ function WidgetConversationView({
|
|
|
17100
17771
|
{
|
|
17101
17772
|
agentMuted,
|
|
17102
17773
|
branding,
|
|
17774
|
+
conversationState,
|
|
17103
17775
|
dismissedHandoffs,
|
|
17104
17776
|
error,
|
|
17105
17777
|
handoffPending,
|
|
@@ -17159,10 +17831,12 @@ function WidgetConversationView({
|
|
|
17159
17831
|
{
|
|
17160
17832
|
draft,
|
|
17161
17833
|
emailDraft,
|
|
17834
|
+
emailError,
|
|
17162
17835
|
imageInputRef,
|
|
17163
17836
|
isLoading,
|
|
17164
17837
|
needsEmail,
|
|
17165
17838
|
onDraftChange,
|
|
17839
|
+
onEmailBlur,
|
|
17166
17840
|
onEmailChange,
|
|
17167
17841
|
onImageSelection,
|
|
17168
17842
|
onRemovePendingImage,
|
|
@@ -17196,7 +17870,7 @@ function useComposerHeightSync({
|
|
|
17196
17870
|
session,
|
|
17197
17871
|
conversationLoaded
|
|
17198
17872
|
}) {
|
|
17199
|
-
(0,
|
|
17873
|
+
(0, import_react41.useLayoutEffect)(() => {
|
|
17200
17874
|
const wrap = composerWrapRef.current;
|
|
17201
17875
|
const messagesEl = scrollRef.current;
|
|
17202
17876
|
if (!wrap || !messagesEl) {
|
|
@@ -17234,7 +17908,7 @@ function WidgetNav({
|
|
|
17234
17908
|
onNavigate,
|
|
17235
17909
|
view
|
|
17236
17910
|
}) {
|
|
17237
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex border-t border-
|
|
17911
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex border-t border-border bg-white", children: [
|
|
17238
17912
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
17239
17913
|
NavTab,
|
|
17240
17914
|
{
|
|
@@ -17287,6 +17961,7 @@ function WidgetPanel(props) {
|
|
|
17287
17961
|
isChat,
|
|
17288
17962
|
isFullscreen,
|
|
17289
17963
|
isOpeningPanel,
|
|
17964
|
+
hostOwnsLauncher: hostOwnsLauncher2,
|
|
17290
17965
|
onBack,
|
|
17291
17966
|
onClose,
|
|
17292
17967
|
onNavigate,
|
|
@@ -17295,22 +17970,28 @@ function WidgetPanel(props) {
|
|
|
17295
17970
|
view
|
|
17296
17971
|
} = props;
|
|
17297
17972
|
const panelMotionTransition = reduceMotion ? { duration: 0 } : PANEL_SPRING;
|
|
17298
|
-
const panelInitial = { opacity: 0, scale: PANEL_CLOSED_SCALE, y: 10 };
|
|
17973
|
+
const panelInitial = hostOwnsLauncher2 ? { opacity: 0, scale: PANEL_CLOSED_SCALE, y: 0 } : { opacity: 0, scale: PANEL_CLOSED_SCALE, y: 10 };
|
|
17299
17974
|
const panelOpen = { opacity: 1, scale: 1, y: 0 };
|
|
17300
|
-
const panelExit = {
|
|
17975
|
+
const panelExit = hostOwnsLauncher2 ? {
|
|
17976
|
+
opacity: 0,
|
|
17977
|
+
scale: PANEL_CLOSED_SCALE,
|
|
17978
|
+
transition: { duration: 0 },
|
|
17979
|
+
y: 0
|
|
17980
|
+
} : {
|
|
17301
17981
|
opacity: 0,
|
|
17302
17982
|
scale: PANEL_CLOSED_SCALE,
|
|
17303
17983
|
transition: { duration: 0 },
|
|
17304
17984
|
y: 10
|
|
17305
17985
|
};
|
|
17306
17986
|
const isEmbedded = isCrossOriginEmbed();
|
|
17987
|
+
const paintPanelShadow = !isEmbedded || isDashboardPreview();
|
|
17307
17988
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
17308
17989
|
motion.div,
|
|
17309
17990
|
{
|
|
17310
17991
|
animate: panelOpen,
|
|
17311
17992
|
className: cn(
|
|
17312
|
-
"scw-panel relative flex h-[var(--scw-panel-height,
|
|
17313
|
-
|
|
17993
|
+
"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",
|
|
17994
|
+
paintPanelShadow && "shadow-[0_10px_15px_-3px_rgba(0,0,0,.1),0_4px_6px_-4px_rgba(0,0,0,.1)]",
|
|
17314
17995
|
isFullscreen && "border-none rounded-none shadow-none"
|
|
17315
17996
|
),
|
|
17316
17997
|
exit: panelExit,
|
|
@@ -17341,9 +18022,11 @@ function BrandedPanelBody({
|
|
|
17341
18022
|
agentMuted,
|
|
17342
18023
|
branding,
|
|
17343
18024
|
composerWrapRef,
|
|
18025
|
+
conversationState,
|
|
17344
18026
|
dismissedHandoffs,
|
|
17345
18027
|
draft,
|
|
17346
18028
|
emailDraft,
|
|
18029
|
+
emailError,
|
|
17347
18030
|
error,
|
|
17348
18031
|
handoffPending,
|
|
17349
18032
|
imageInputRef,
|
|
@@ -17360,6 +18043,7 @@ function BrandedPanelBody({
|
|
|
17360
18043
|
onConfirmHandoff,
|
|
17361
18044
|
onDismissHandoff,
|
|
17362
18045
|
onDraftChange,
|
|
18046
|
+
onEmailBlur,
|
|
17363
18047
|
onEmailChange,
|
|
17364
18048
|
onImageSelection,
|
|
17365
18049
|
onNavigate,
|
|
@@ -17417,14 +18101,15 @@ function BrandedPanelBody({
|
|
|
17417
18101
|
{
|
|
17418
18102
|
branding,
|
|
17419
18103
|
conversations: sortedHistory,
|
|
18104
|
+
onPick,
|
|
17420
18105
|
onResume,
|
|
17421
|
-
onStartNew
|
|
18106
|
+
onStartNew,
|
|
18107
|
+
suggestions
|
|
17422
18108
|
}
|
|
17423
18109
|
),
|
|
17424
18110
|
view === "messages" && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
17425
18111
|
MessagesView,
|
|
17426
18112
|
{
|
|
17427
|
-
activeConversationId: session?.conversationId,
|
|
17428
18113
|
branding,
|
|
17429
18114
|
conversations: sortedHistory,
|
|
17430
18115
|
onResume,
|
|
@@ -17438,9 +18123,11 @@ function BrandedPanelBody({
|
|
|
17438
18123
|
agentMuted,
|
|
17439
18124
|
branding,
|
|
17440
18125
|
composerWrapRef,
|
|
18126
|
+
conversationState,
|
|
17441
18127
|
dismissedHandoffs,
|
|
17442
18128
|
draft,
|
|
17443
18129
|
emailDraft,
|
|
18130
|
+
emailError,
|
|
17444
18131
|
error,
|
|
17445
18132
|
handoffPending,
|
|
17446
18133
|
imageInputRef,
|
|
@@ -17455,6 +18142,7 @@ function BrandedPanelBody({
|
|
|
17455
18142
|
onConfirmHandoff,
|
|
17456
18143
|
onDismissHandoff,
|
|
17457
18144
|
onDraftChange,
|
|
18145
|
+
onEmailBlur,
|
|
17458
18146
|
onEmailChange,
|
|
17459
18147
|
onImageSelection,
|
|
17460
18148
|
onPick,
|
|
@@ -17502,16 +18190,16 @@ function BrandedPanelBody({
|
|
|
17502
18190
|
}
|
|
17503
18191
|
function PanelLoadingShell({ onClose }) {
|
|
17504
18192
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
17505
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("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-
|
|
18193
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("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__ */ (0, import_jsx_runtime36.jsx)(
|
|
17506
18194
|
"button",
|
|
17507
18195
|
{
|
|
17508
18196
|
"aria-label": "Close chat",
|
|
17509
|
-
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-
|
|
18197
|
+
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",
|
|
17510
18198
|
onClick: onClose,
|
|
17511
18199
|
type: "button",
|
|
17512
18200
|
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CloseIcon, {})
|
|
17513
18201
|
}
|
|
17514
|
-
) }),
|
|
18202
|
+
) : null }),
|
|
17515
18203
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
17516
18204
|
"div",
|
|
17517
18205
|
{
|
|
@@ -17530,28 +18218,36 @@ function SupportWidgetInner({
|
|
|
17530
18218
|
getStateSnapshot,
|
|
17531
18219
|
placeholder = "Message...",
|
|
17532
18220
|
projectId,
|
|
18221
|
+
startOpen = false,
|
|
17533
18222
|
suggestions
|
|
17534
18223
|
}) {
|
|
17535
|
-
const
|
|
17536
|
-
const emailStorageKey =
|
|
17537
|
-
|
|
17538
|
-
|
|
18224
|
+
const dashboardPreview = isDashboardPreview();
|
|
18225
|
+
const { emailStorageKey, storageKey } = widgetSessionStorageKeys(
|
|
18226
|
+
projectId,
|
|
18227
|
+
dashboardPreview
|
|
18228
|
+
);
|
|
18229
|
+
const [isOpen, setIsOpen] = (0, import_react43.useState)(startOpen);
|
|
18230
|
+
const [isOpeningPanel, setIsOpeningPanel] = (0, import_react43.useState)(startOpen);
|
|
17539
18231
|
const reduceMotion = useReducedMotion();
|
|
17540
|
-
const [view, setView] = (0,
|
|
17541
|
-
const [returnView, setReturnView] = (0,
|
|
17542
|
-
const
|
|
17543
|
-
|
|
18232
|
+
const [view, setView] = (0, import_react43.useState)("home");
|
|
18233
|
+
const [returnView, setReturnView] = (0, import_react43.useState)("home");
|
|
18234
|
+
const previewShell2 = (0, import_react43.useSyncExternalStore)(
|
|
18235
|
+
subscribeToRegistry,
|
|
18236
|
+
getPreviewShell,
|
|
18237
|
+
getPreviewShell
|
|
18238
|
+
);
|
|
18239
|
+
const [branding, setBranding] = (0, import_react43.useState)(
|
|
18240
|
+
() => previewShell2?.branding ?? readBrandingCache(projectId)
|
|
17544
18241
|
);
|
|
17545
|
-
const [
|
|
17546
|
-
const [
|
|
17547
|
-
const [
|
|
17548
|
-
const [
|
|
17549
|
-
const
|
|
17550
|
-
const pendingImageUrls = (0, import_react42.useMemo)(
|
|
18242
|
+
const [resolvedSuggestions, setResolvedSuggestions] = (0, import_react43.useState)(previewShell2?.suggestions ?? suggestions ?? DEFAULT_SUGGESTIONS);
|
|
18243
|
+
const [dashboardTools, setDashboardTools] = (0, import_react43.useState)([]);
|
|
18244
|
+
const [draft, setDraft] = (0, import_react43.useState)("");
|
|
18245
|
+
const [pendingImages, setPendingImages] = (0, import_react43.useState)([]);
|
|
18246
|
+
const pendingImageUrls = (0, import_react43.useMemo)(
|
|
17551
18247
|
() => pendingImages.map((file) => URL.createObjectURL(file)),
|
|
17552
18248
|
[pendingImages]
|
|
17553
18249
|
);
|
|
17554
|
-
(0,
|
|
18250
|
+
(0, import_react43.useEffect)(
|
|
17555
18251
|
() => () => {
|
|
17556
18252
|
for (const url of pendingImageUrls) {
|
|
17557
18253
|
URL.revokeObjectURL(url);
|
|
@@ -17559,8 +18255,8 @@ function SupportWidgetInner({
|
|
|
17559
18255
|
},
|
|
17560
18256
|
[pendingImageUrls]
|
|
17561
18257
|
);
|
|
17562
|
-
const sentImageUrlsRef = (0,
|
|
17563
|
-
(0,
|
|
18258
|
+
const sentImageUrlsRef = (0, import_react43.useRef)([]);
|
|
18259
|
+
(0, import_react43.useEffect)(
|
|
17564
18260
|
() => () => {
|
|
17565
18261
|
for (const url of sentImageUrlsRef.current) {
|
|
17566
18262
|
URL.revokeObjectURL(url);
|
|
@@ -17568,30 +18264,25 @@ function SupportWidgetInner({
|
|
|
17568
18264
|
},
|
|
17569
18265
|
[]
|
|
17570
18266
|
);
|
|
17571
|
-
const [emailDraft, setEmailDraft] = (0,
|
|
17572
|
-
const [
|
|
17573
|
-
const [sendError, setSendError] = (0,
|
|
17574
|
-
const [agentMuted, setAgentMuted] = (0,
|
|
17575
|
-
const [conversation, setConversation] = (0,
|
|
18267
|
+
const [emailDraft, setEmailDraft] = (0, import_react43.useState)("");
|
|
18268
|
+
const [emailTouched, setEmailTouched] = (0, import_react43.useState)(false);
|
|
18269
|
+
const [sendError, setSendError] = (0, import_react43.useState)(null);
|
|
18270
|
+
const [agentMuted, setAgentMuted] = (0, import_react43.useState)(false);
|
|
18271
|
+
const [conversation, setConversation] = (0, import_react43.useState)(
|
|
17576
18272
|
null
|
|
17577
18273
|
);
|
|
17578
|
-
const [conversationLoaded, setConversationLoaded] = (0,
|
|
17579
|
-
const
|
|
17580
|
-
() => /* @__PURE__ */ new Set()
|
|
17581
|
-
);
|
|
17582
|
-
const [handoffPending, setHandoffPending] = (0, import_react42.useState)(false);
|
|
17583
|
-
const handoffPendingRef = (0, import_react42.useRef)(false);
|
|
17584
|
-
const scrollRef = (0, import_react42.useRef)(null);
|
|
18274
|
+
const [conversationLoaded, setConversationLoaded] = (0, import_react43.useState)(false);
|
|
18275
|
+
const scrollRef = (0, import_react43.useRef)(null);
|
|
17585
18276
|
useOverscrollBounce(scrollRef, view === "chat", !!reduceMotion);
|
|
17586
|
-
const scrollReleasedRef = (0,
|
|
17587
|
-
const composerWrapRef = (0,
|
|
17588
|
-
const rootElRef = (0,
|
|
17589
|
-
const textareaRef = (0,
|
|
17590
|
-
const imageInputRef = (0,
|
|
17591
|
-
(0,
|
|
18277
|
+
const scrollReleasedRef = (0, import_react43.useRef)(false);
|
|
18278
|
+
const composerWrapRef = (0, import_react43.useRef)(null);
|
|
18279
|
+
const rootElRef = (0, import_react43.useRef)(null);
|
|
18280
|
+
const textareaRef = (0, import_react43.useRef)(null);
|
|
18281
|
+
const imageInputRef = (0, import_react43.useRef)(null);
|
|
18282
|
+
(0, import_react43.useEffect)(() => {
|
|
17592
18283
|
injectStyles();
|
|
17593
18284
|
}, []);
|
|
17594
|
-
(0,
|
|
18285
|
+
(0, import_react43.useEffect)(() => {
|
|
17595
18286
|
const root = rootElRef.current;
|
|
17596
18287
|
if (!root) {
|
|
17597
18288
|
return;
|
|
@@ -17608,30 +18299,35 @@ function SupportWidgetInner({
|
|
|
17608
18299
|
isOpen,
|
|
17609
18300
|
rootElRef
|
|
17610
18301
|
});
|
|
17611
|
-
const identity2 = (0,
|
|
18302
|
+
const identity2 = (0, import_react43.useSyncExternalStore)(
|
|
17612
18303
|
subscribeToRegistry,
|
|
17613
18304
|
getIdentity,
|
|
17614
18305
|
getIdentity
|
|
17615
18306
|
);
|
|
17616
|
-
const userJwt2 = (0,
|
|
18307
|
+
const userJwt2 = (0, import_react43.useSyncExternalStore)(
|
|
17617
18308
|
subscribeToRegistry,
|
|
17618
18309
|
getUserJwt,
|
|
17619
18310
|
getUserJwt
|
|
17620
18311
|
);
|
|
17621
|
-
const
|
|
18312
|
+
const identityRef = (0, import_react43.useRef)(identity2);
|
|
18313
|
+
const userJwtRef = (0, import_react43.useRef)(userJwt2);
|
|
18314
|
+
const sessionRef = (0, import_react43.useRef)(null);
|
|
18315
|
+
identityRef.current = identity2;
|
|
18316
|
+
userJwtRef.current = userJwt2;
|
|
18317
|
+
const hostOwnsLauncher2 = (0, import_react43.useSyncExternalStore)(
|
|
18318
|
+
subscribeToRegistry,
|
|
18319
|
+
getHostOwnsLauncher,
|
|
18320
|
+
getHostOwnsLauncher
|
|
18321
|
+
);
|
|
18322
|
+
const toolLabels = (0, import_react43.useMemo)(
|
|
17622
18323
|
() => buildToolDisplayLabelMap(dashboardTools),
|
|
17623
18324
|
[dashboardTools]
|
|
17624
18325
|
);
|
|
17625
|
-
const
|
|
17626
|
-
const
|
|
17627
|
-
const snapshotRef = (0, import_react42.useRef)(getStateSnapshot);
|
|
17628
|
-
const identityRef = (0, import_react42.useRef)(identity2);
|
|
17629
|
-
const userJwtRef = (0, import_react42.useRef)(userJwt2);
|
|
18326
|
+
const toolsRef = (0, import_react43.useRef)(dashboardTools);
|
|
18327
|
+
const snapshotRef = (0, import_react43.useRef)(getStateSnapshot);
|
|
17630
18328
|
toolsRef.current = dashboardTools;
|
|
17631
18329
|
snapshotRef.current = getStateSnapshot;
|
|
17632
|
-
|
|
17633
|
-
userJwtRef.current = userJwt2;
|
|
17634
|
-
const openWidget2 = (0, import_react42.useCallback)(() => {
|
|
18330
|
+
const openWidget2 = (0, import_react43.useCallback)(() => {
|
|
17635
18331
|
primeMessageChime();
|
|
17636
18332
|
setIsOpeningPanel(true);
|
|
17637
18333
|
setIsOpen(true);
|
|
@@ -17642,22 +18338,28 @@ function SupportWidgetInner({
|
|
|
17642
18338
|
setView("home");
|
|
17643
18339
|
}
|
|
17644
18340
|
}, []);
|
|
17645
|
-
(0,
|
|
18341
|
+
const closePanel = (0, import_react43.useCallback)(() => {
|
|
18342
|
+
if (dashboardPreview) {
|
|
18343
|
+
return;
|
|
18344
|
+
}
|
|
18345
|
+
setIsOpen(false);
|
|
18346
|
+
}, [dashboardPreview]);
|
|
18347
|
+
(0, import_react43.useLayoutEffect)(() => {
|
|
17646
18348
|
setOpenControls({
|
|
17647
|
-
close:
|
|
18349
|
+
close: closePanel,
|
|
17648
18350
|
open: openWidget2
|
|
17649
18351
|
});
|
|
17650
18352
|
return () => {
|
|
17651
18353
|
setOpenControls(null);
|
|
17652
18354
|
};
|
|
17653
|
-
}, [openWidget2]);
|
|
17654
|
-
(0,
|
|
18355
|
+
}, [closePanel, openWidget2]);
|
|
18356
|
+
(0, import_react43.useEffect)(() => {
|
|
17655
18357
|
if (!isOpen) {
|
|
17656
18358
|
setIsOpeningPanel(false);
|
|
17657
18359
|
}
|
|
17658
18360
|
}, [isOpen]);
|
|
17659
|
-
(0,
|
|
17660
|
-
if (!isOpen) {
|
|
18361
|
+
(0, import_react43.useEffect)(() => {
|
|
18362
|
+
if (!isOpen || dashboardPreview) {
|
|
17661
18363
|
return;
|
|
17662
18364
|
}
|
|
17663
18365
|
function handleKeyDown(event) {
|
|
@@ -17665,143 +18367,20 @@ function SupportWidgetInner({
|
|
|
17665
18367
|
return;
|
|
17666
18368
|
}
|
|
17667
18369
|
event.preventDefault();
|
|
17668
|
-
|
|
18370
|
+
closePanel();
|
|
17669
18371
|
}
|
|
17670
18372
|
window.addEventListener("keydown", handleKeyDown);
|
|
17671
18373
|
return () => {
|
|
17672
18374
|
window.removeEventListener("keydown", handleKeyDown);
|
|
17673
18375
|
};
|
|
17674
|
-
}, [isOpen]);
|
|
17675
|
-
const
|
|
17676
|
-
const
|
|
17677
|
-
const
|
|
17678
|
-
const
|
|
17679
|
-
const
|
|
17680
|
-
const
|
|
17681
|
-
|
|
17682
|
-
const refreshSessionHistory = (0, import_react42.useCallback)(() => {
|
|
17683
|
-
const jwt = userJwtRef.current;
|
|
17684
|
-
if (jwt) {
|
|
17685
|
-
void (async () => {
|
|
17686
|
-
try {
|
|
17687
|
-
const rows = await listConversations({
|
|
17688
|
-
baseUrl,
|
|
17689
|
-
projectId,
|
|
17690
|
-
userJwt: jwt
|
|
17691
|
-
});
|
|
17692
|
-
setSessionHistory(
|
|
17693
|
-
rows.map((row) => ({
|
|
17694
|
-
conversationId: row.conversationId,
|
|
17695
|
-
preview: row.preview,
|
|
17696
|
-
sessionToken: row.sessionToken,
|
|
17697
|
-
updatedAt: row.updatedAt
|
|
17698
|
-
}))
|
|
17699
|
-
);
|
|
17700
|
-
} catch {
|
|
17701
|
-
setSessionHistory(readSessionHistory(storageKey));
|
|
17702
|
-
}
|
|
17703
|
-
})();
|
|
17704
|
-
return;
|
|
17705
|
-
}
|
|
17706
|
-
setSessionHistory(readSessionHistory(storageKey));
|
|
17707
|
-
}, [baseUrl, projectId, storageKey]);
|
|
17708
|
-
(0, import_react42.useEffect)(() => {
|
|
17709
|
-
const stored = readStoredSession(storageKey);
|
|
17710
|
-
sessionRef.current = stored;
|
|
17711
|
-
setSession(stored);
|
|
17712
|
-
if (stored) {
|
|
17713
|
-
ensureActiveSessionInHistory(storageKey, stored);
|
|
17714
|
-
}
|
|
17715
|
-
refreshSessionHistory();
|
|
17716
|
-
}, [refreshSessionHistory, storageKey]);
|
|
17717
|
-
const resumedJwtRef = (0, import_react42.useRef)(null);
|
|
17718
|
-
(0, import_react42.useEffect)(() => {
|
|
17719
|
-
if (!userJwt2 || resumedJwtRef.current === userJwt2) {
|
|
17720
|
-
return;
|
|
17721
|
-
}
|
|
17722
|
-
const jwt = userJwt2;
|
|
17723
|
-
resumedJwtRef.current = jwt;
|
|
17724
|
-
let cancelled = false;
|
|
17725
|
-
async function resume() {
|
|
17726
|
-
try {
|
|
17727
|
-
const resumed = await resumeSession({
|
|
17728
|
-
baseUrl,
|
|
17729
|
-
projectId,
|
|
17730
|
-
userJwt: jwt
|
|
17731
|
-
});
|
|
17732
|
-
if (cancelled || !resumed) {
|
|
17733
|
-
return;
|
|
17734
|
-
}
|
|
17735
|
-
const next = {
|
|
17736
|
-
conversationId: resumed.conversationId,
|
|
17737
|
-
sessionToken: resumed.sessionToken
|
|
17738
|
-
};
|
|
17739
|
-
sessionRef.current = next;
|
|
17740
|
-
setSession(next);
|
|
17741
|
-
storeSession(storageKey, next);
|
|
17742
|
-
ensureActiveSessionInHistory(storageKey, next);
|
|
17743
|
-
setConversation(resumed.conversation);
|
|
17744
|
-
setConversationLoaded(true);
|
|
17745
|
-
setAgentMuted(!resumed.conversation.agentEnabled);
|
|
17746
|
-
refreshSessionHistory();
|
|
17747
|
-
} catch {
|
|
17748
|
-
resumedJwtRef.current = null;
|
|
17749
|
-
}
|
|
17750
|
-
}
|
|
17751
|
-
void resume();
|
|
17752
|
-
return () => {
|
|
17753
|
-
cancelled = true;
|
|
17754
|
-
};
|
|
17755
|
-
}, [baseUrl, projectId, userJwt2, refreshSessionHistory, storageKey]);
|
|
17756
|
-
const prevOwnerRef = (0, import_react42.useRef)(void 0);
|
|
17757
|
-
const prevJwtPresentRef = (0, import_react42.useRef)(false);
|
|
17758
|
-
(0, import_react42.useEffect)(() => {
|
|
17759
|
-
const ownerId = identity2?.distinctId ?? identity2?.email ?? null;
|
|
17760
|
-
const jwtPresent = Boolean(userJwt2);
|
|
17761
|
-
const previousOwner = prevOwnerRef.current;
|
|
17762
|
-
const previousJwtPresent = prevJwtPresentRef.current;
|
|
17763
|
-
prevOwnerRef.current = ownerId;
|
|
17764
|
-
prevJwtPresentRef.current = jwtPresent;
|
|
17765
|
-
function wipeForIdentitySwitch() {
|
|
17766
|
-
resetChatState();
|
|
17767
|
-
sessionRef.current = null;
|
|
17768
|
-
setSession(null);
|
|
17769
|
-
resumedJwtRef.current = null;
|
|
17770
|
-
try {
|
|
17771
|
-
window.localStorage.removeItem(emailStorageKey);
|
|
17772
|
-
} catch {
|
|
17773
|
-
}
|
|
17774
|
-
setCapturedEmail(null);
|
|
17775
|
-
refreshSessionHistory();
|
|
17776
|
-
}
|
|
17777
|
-
if (ownerId) {
|
|
17778
|
-
const { cleared } = reconcileSessionOwner(storageKey, ownerId);
|
|
17779
|
-
if (cleared) {
|
|
17780
|
-
wipeForIdentitySwitch();
|
|
17781
|
-
} else {
|
|
17782
|
-
refreshSessionHistory();
|
|
17783
|
-
}
|
|
17784
|
-
return;
|
|
17785
|
-
}
|
|
17786
|
-
if ((previousOwner || previousJwtPresent) && !jwtPresent) {
|
|
17787
|
-
clearChatStorage(storageKey);
|
|
17788
|
-
wipeForIdentitySwitch();
|
|
17789
|
-
return;
|
|
17790
|
-
}
|
|
17791
|
-
if (jwtPresent) {
|
|
17792
|
-
refreshSessionHistory();
|
|
17793
|
-
}
|
|
17794
|
-
}, [identity2, userJwt2, storageKey, emailStorageKey, refreshSessionHistory]);
|
|
17795
|
-
(0, import_react42.useEffect)(() => {
|
|
17796
|
-
try {
|
|
17797
|
-
const stored = window.localStorage.getItem(emailStorageKey);
|
|
17798
|
-
if (stored) {
|
|
17799
|
-
setCapturedEmail(stored);
|
|
17800
|
-
}
|
|
17801
|
-
} catch {
|
|
17802
|
-
}
|
|
17803
|
-
}, [emailStorageKey]);
|
|
17804
|
-
(0, import_react42.useEffect)(() => {
|
|
18376
|
+
}, [closePanel, dashboardPreview, isOpen]);
|
|
18377
|
+
const mergedIdsRef = (0, import_react43.useRef)(/* @__PURE__ */ new Set());
|
|
18378
|
+
const reportedSeenMessageIdsRef = (0, import_react43.useRef)(/* @__PURE__ */ new Set());
|
|
18379
|
+
const seededRef = (0, import_react43.useRef)(false);
|
|
18380
|
+
const brandingFetchStartedRef = (0, import_react43.useRef)(false);
|
|
18381
|
+
const pendingPersistRef = (0, import_react43.useRef)(null);
|
|
18382
|
+
const sendInFlightRef = (0, import_react43.useRef)(false);
|
|
18383
|
+
(0, import_react43.useEffect)(() => {
|
|
17805
18384
|
if (brandingFetchStartedRef.current) {
|
|
17806
18385
|
return;
|
|
17807
18386
|
}
|
|
@@ -17811,8 +18390,15 @@ function SupportWidgetInner({
|
|
|
17811
18390
|
try {
|
|
17812
18391
|
const result = await getWidgetConfig({ baseUrl, projectId });
|
|
17813
18392
|
if (!cancelled) {
|
|
17814
|
-
|
|
17815
|
-
|
|
18393
|
+
if (!dashboardPreview) {
|
|
18394
|
+
writeBrandingCache(projectId, result.branding);
|
|
18395
|
+
}
|
|
18396
|
+
if (!getPreviewShell()) {
|
|
18397
|
+
setBranding(result.branding);
|
|
18398
|
+
if (Array.isArray(result.suggestions)) {
|
|
18399
|
+
setResolvedSuggestions(result.suggestions);
|
|
18400
|
+
}
|
|
18401
|
+
}
|
|
17816
18402
|
setDashboardTools(
|
|
17817
18403
|
result.tools.map((tool) => reconstructDashboardTool(tool))
|
|
17818
18404
|
);
|
|
@@ -17828,8 +18414,15 @@ function SupportWidgetInner({
|
|
|
17828
18414
|
return () => {
|
|
17829
18415
|
cancelled = true;
|
|
17830
18416
|
};
|
|
17831
|
-
}, [baseUrl, projectId]);
|
|
17832
|
-
|
|
18417
|
+
}, [baseUrl, dashboardPreview, projectId]);
|
|
18418
|
+
(0, import_react43.useEffect)(() => {
|
|
18419
|
+
if (!previewShell2) {
|
|
18420
|
+
return;
|
|
18421
|
+
}
|
|
18422
|
+
setBranding(previewShell2.branding);
|
|
18423
|
+
setResolvedSuggestions(previewShell2.suggestions);
|
|
18424
|
+
}, [previewShell2]);
|
|
18425
|
+
const runTool = (0, import_react43.useCallback)((toolCall) => {
|
|
17833
18426
|
const match = toolsRef.current.find(
|
|
17834
18427
|
(entry) => normalizeToolName(entry.name) === toolCall.toolName
|
|
17835
18428
|
);
|
|
@@ -17847,7 +18440,7 @@ function SupportWidgetInner({
|
|
|
17847
18440
|
}
|
|
17848
18441
|
return match.execute(toolCall.input ?? {});
|
|
17849
18442
|
}, []);
|
|
17850
|
-
const onToolCallRef = (0,
|
|
18443
|
+
const onToolCallRef = (0, import_react43.useRef)(() => {
|
|
17851
18444
|
});
|
|
17852
18445
|
const {
|
|
17853
18446
|
addToolApprovalResponse,
|
|
@@ -17859,10 +18452,10 @@ function SupportWidgetInner({
|
|
|
17859
18452
|
setMessages,
|
|
17860
18453
|
status,
|
|
17861
18454
|
stop
|
|
17862
|
-
} = (0,
|
|
18455
|
+
} = (0, import_react42.useChat)({
|
|
17863
18456
|
onToolCall: (event) => onToolCallRef.current(event),
|
|
17864
|
-
sendAutomaticallyWhen: (opts) => (0,
|
|
17865
|
-
transport: new
|
|
18457
|
+
sendAutomaticallyWhen: (opts) => (0, import_ai8.lastAssistantMessageIsCompleteWithToolCalls)(opts) || (0, import_ai8.lastAssistantMessageIsCompleteWithApprovalResponses)(opts),
|
|
18458
|
+
transport: new import_ai8.DefaultChatTransport({
|
|
17866
18459
|
api: agentUrl(baseUrl),
|
|
17867
18460
|
prepareSendMessagesRequest: async ({ messages: outgoing }) => {
|
|
17868
18461
|
if (pendingPersistRef.current) {
|
|
@@ -17877,9 +18470,9 @@ function SupportWidgetInner({
|
|
|
17877
18470
|
messages: outgoing,
|
|
17878
18471
|
projectId,
|
|
17879
18472
|
sessionToken: sessionRef.current?.sessionToken ?? "",
|
|
17880
|
-
stateSnapshot:
|
|
17881
|
-
|
|
17882
|
-
|
|
18473
|
+
stateSnapshot: pickScalarRecord({
|
|
18474
|
+
...identityRef.current?.traits,
|
|
18475
|
+
...isRecord(liveSnapshot) ? liveSnapshot : {}
|
|
17883
18476
|
}),
|
|
17884
18477
|
userJwt: userJwtRef.current ?? void 0
|
|
17885
18478
|
}
|
|
@@ -17903,70 +18496,68 @@ function SupportWidgetInner({
|
|
|
17903
18496
|
}
|
|
17904
18497
|
return onToolCall(event);
|
|
17905
18498
|
};
|
|
18499
|
+
function resetChatState() {
|
|
18500
|
+
stop();
|
|
18501
|
+
setMessages([]);
|
|
18502
|
+
clearPending();
|
|
18503
|
+
mergedIdsRef.current = /* @__PURE__ */ new Set();
|
|
18504
|
+
reportedSeenMessageIdsRef.current = /* @__PURE__ */ new Set();
|
|
18505
|
+
seededRef.current = false;
|
|
18506
|
+
setAgentMuted(false);
|
|
18507
|
+
setConversation(null);
|
|
18508
|
+
setConversationLoaded(false);
|
|
18509
|
+
setSendError(null);
|
|
18510
|
+
setDraft("");
|
|
18511
|
+
setPendingImages([]);
|
|
18512
|
+
}
|
|
18513
|
+
const {
|
|
18514
|
+
capturedEmail,
|
|
18515
|
+
refreshSessionHistory,
|
|
18516
|
+
session,
|
|
18517
|
+
sessionHistory,
|
|
18518
|
+
setCapturedEmail,
|
|
18519
|
+
setSession
|
|
18520
|
+
} = useVisitorConversationPersistence({
|
|
18521
|
+
baseUrl,
|
|
18522
|
+
emailStorageKey,
|
|
18523
|
+
identity: identity2,
|
|
18524
|
+
onIdentityWipe: resetChatState,
|
|
18525
|
+
onResumed: (resumedConversation) => {
|
|
18526
|
+
setConversation(resumedConversation);
|
|
18527
|
+
setConversationLoaded(true);
|
|
18528
|
+
setAgentMuted(!resumedConversation.agentEnabled);
|
|
18529
|
+
},
|
|
18530
|
+
projectId,
|
|
18531
|
+
sessionRef,
|
|
18532
|
+
storageKey,
|
|
18533
|
+
userJwt: userJwt2
|
|
18534
|
+
});
|
|
18535
|
+
const knownEmail = identity2?.email ?? capturedEmail;
|
|
17906
18536
|
const isLoading = status === "submitted" || status === "streaming";
|
|
17907
|
-
const messagesRef = (0,
|
|
18537
|
+
const messagesRef = (0, import_react43.useRef)(messages);
|
|
17908
18538
|
messagesRef.current = messages;
|
|
17909
|
-
const isLoadingRef = (0,
|
|
18539
|
+
const isLoadingRef = (0, import_react43.useRef)(isLoading);
|
|
17910
18540
|
isLoadingRef.current = isLoading;
|
|
17911
18541
|
const { chimedMessageIdsRef } = useInboundMessageChime({
|
|
17912
18542
|
isLoading,
|
|
17913
18543
|
messages
|
|
17914
18544
|
});
|
|
17915
18545
|
const isTakeoverError = !!error && error.message.includes("human_takeover");
|
|
17916
|
-
(0,
|
|
18546
|
+
(0, import_react43.useEffect)(() => {
|
|
17917
18547
|
if (isTakeoverError) {
|
|
17918
18548
|
setAgentMuted(true);
|
|
17919
18549
|
}
|
|
17920
18550
|
}, [isTakeoverError]);
|
|
17921
|
-
const confirmHandoff
|
|
17922
|
-
|
|
17923
|
-
|
|
17924
|
-
|
|
17925
|
-
|
|
17926
|
-
|
|
17927
|
-
|
|
17928
|
-
|
|
17929
|
-
|
|
17930
|
-
|
|
17931
|
-
baseUrl,
|
|
17932
|
-
conversationId: active.conversationId,
|
|
17933
|
-
projectId,
|
|
17934
|
-
reason,
|
|
17935
|
-
sessionToken: active.sessionToken
|
|
17936
|
-
});
|
|
17937
|
-
setAgentMuted(true);
|
|
17938
|
-
if (result.acknowledgment) {
|
|
17939
|
-
mergedIdsRef.current.add(result.acknowledgment.id);
|
|
17940
|
-
setMessages([
|
|
17941
|
-
...messagesRef.current,
|
|
17942
|
-
toUiMessage(result.acknowledgment)
|
|
17943
|
-
]);
|
|
17944
|
-
}
|
|
17945
|
-
} catch {
|
|
17946
|
-
} finally {
|
|
17947
|
-
handoffPendingRef.current = false;
|
|
17948
|
-
setHandoffPending(false);
|
|
17949
|
-
}
|
|
17950
|
-
},
|
|
17951
|
-
[baseUrl, projectId, setMessages]
|
|
17952
|
-
);
|
|
17953
|
-
const dismissHandoff = (0, import_react42.useCallback)(
|
|
17954
|
-
(toolCallId) => {
|
|
17955
|
-
setDismissedHandoffs((prev) => {
|
|
17956
|
-
if (prev.has(toolCallId)) {
|
|
17957
|
-
return prev;
|
|
17958
|
-
}
|
|
17959
|
-
const next = new Set(prev);
|
|
17960
|
-
next.add(toolCallId);
|
|
17961
|
-
return next;
|
|
17962
|
-
});
|
|
17963
|
-
setMessages(
|
|
17964
|
-
(current) => markHandoffDeclinedInMessages(current, toolCallId)
|
|
17965
|
-
);
|
|
17966
|
-
},
|
|
17967
|
-
[setMessages]
|
|
17968
|
-
);
|
|
17969
|
-
(0, import_react42.useEffect)(() => {
|
|
18551
|
+
const { confirmHandoff, dismissedHandoffs, dismissHandoff, handoffPending } = useHandoffDecisions({
|
|
18552
|
+
baseUrl,
|
|
18553
|
+
mergedIdsRef,
|
|
18554
|
+
messagesRef,
|
|
18555
|
+
onAccepted: () => setAgentMuted(true),
|
|
18556
|
+
projectId,
|
|
18557
|
+
sessionRef,
|
|
18558
|
+
setMessages
|
|
18559
|
+
});
|
|
18560
|
+
(0, import_react43.useEffect)(() => {
|
|
17970
18561
|
if (!isOpen || !session) {
|
|
17971
18562
|
return;
|
|
17972
18563
|
}
|
|
@@ -18015,7 +18606,7 @@ function SupportWidgetInner({
|
|
|
18015
18606
|
setDraft(value);
|
|
18016
18607
|
reportDraftActivity(value);
|
|
18017
18608
|
}
|
|
18018
|
-
const reportTeamMessagesSeen = (0,
|
|
18609
|
+
const reportTeamMessagesSeen = (0, import_react43.useCallback)(
|
|
18019
18610
|
(messageIds) => {
|
|
18020
18611
|
const activeSession = sessionRef.current;
|
|
18021
18612
|
const unseenMessageIds = messageIds.filter(
|
|
@@ -18042,7 +18633,7 @@ function SupportWidgetInner({
|
|
|
18042
18633
|
},
|
|
18043
18634
|
[baseUrl, projectId]
|
|
18044
18635
|
);
|
|
18045
|
-
(0,
|
|
18636
|
+
(0, import_react43.useEffect)(() => {
|
|
18046
18637
|
if (!conversation) {
|
|
18047
18638
|
return;
|
|
18048
18639
|
}
|
|
@@ -18080,7 +18671,7 @@ function SupportWidgetInner({
|
|
|
18080
18671
|
setMessages([...messagesRef.current, ...fresh.map(toUiMessage)]);
|
|
18081
18672
|
maybePlayIncomingChime("soft");
|
|
18082
18673
|
}, [conversation, setMessages, storageKey, refreshSessionHistory]);
|
|
18083
|
-
(0,
|
|
18674
|
+
(0, import_react43.useLayoutEffect)(() => {
|
|
18084
18675
|
const el = textareaRef.current;
|
|
18085
18676
|
if (!el) {
|
|
18086
18677
|
return;
|
|
@@ -18089,7 +18680,11 @@ function SupportWidgetInner({
|
|
|
18089
18680
|
el.style.height = `${Math.min(el.scrollHeight, MAX_TEXTAREA_HEIGHT_PX)}px`;
|
|
18090
18681
|
}, [draft]);
|
|
18091
18682
|
const needsEmail = !session && !knownEmail;
|
|
18683
|
+
const emailError = needsEmail && emailTouched ? resolveEmailDraftError(emailDraft) : null;
|
|
18092
18684
|
async function handleSubmit(event) {
|
|
18685
|
+
if (needsEmail) {
|
|
18686
|
+
setEmailTouched(true);
|
|
18687
|
+
}
|
|
18093
18688
|
stopTyping();
|
|
18094
18689
|
await submitWidgetMessage(event, {
|
|
18095
18690
|
agentMuted,
|
|
@@ -18128,20 +18723,6 @@ function SupportWidgetInner({
|
|
|
18128
18723
|
function removePendingImage(index2) {
|
|
18129
18724
|
setPendingImages((current) => current.filter((_, i) => i !== index2));
|
|
18130
18725
|
}
|
|
18131
|
-
function resetChatState() {
|
|
18132
|
-
stop();
|
|
18133
|
-
setMessages([]);
|
|
18134
|
-
clearPending();
|
|
18135
|
-
mergedIdsRef.current = /* @__PURE__ */ new Set();
|
|
18136
|
-
reportedSeenMessageIdsRef.current = /* @__PURE__ */ new Set();
|
|
18137
|
-
seededRef.current = false;
|
|
18138
|
-
setAgentMuted(false);
|
|
18139
|
-
setConversation(null);
|
|
18140
|
-
setConversationLoaded(false);
|
|
18141
|
-
setSendError(null);
|
|
18142
|
-
setDraft("");
|
|
18143
|
-
setPendingImages([]);
|
|
18144
|
-
}
|
|
18145
18726
|
function startNewConversation() {
|
|
18146
18727
|
startNewConversationAction({
|
|
18147
18728
|
resetChatState,
|
|
@@ -18167,6 +18748,9 @@ function SupportWidgetInner({
|
|
|
18167
18748
|
});
|
|
18168
18749
|
}
|
|
18169
18750
|
function pickSuggestion(prompt) {
|
|
18751
|
+
if (view !== "chat") {
|
|
18752
|
+
startNewConversation();
|
|
18753
|
+
}
|
|
18170
18754
|
handleDraftChange(prompt);
|
|
18171
18755
|
textareaRef.current?.focus();
|
|
18172
18756
|
}
|
|
@@ -18175,7 +18759,7 @@ function SupportWidgetInner({
|
|
|
18175
18759
|
messages,
|
|
18176
18760
|
pendingSize: pending.size
|
|
18177
18761
|
});
|
|
18178
|
-
const sortedHistory = (0,
|
|
18762
|
+
const sortedHistory = (0, import_react43.useMemo)(
|
|
18179
18763
|
() => [...sessionHistory].sort((a, b) => b.updatedAt - a.updatedAt),
|
|
18180
18764
|
[sessionHistory]
|
|
18181
18765
|
);
|
|
@@ -18187,15 +18771,15 @@ function SupportWidgetInner({
|
|
|
18187
18771
|
conversation,
|
|
18188
18772
|
conversationLoaded
|
|
18189
18773
|
});
|
|
18190
|
-
const prevViewRef = (0,
|
|
18191
|
-
const viewTransition = (0,
|
|
18774
|
+
const prevViewRef = (0, import_react43.useRef)(view);
|
|
18775
|
+
const viewTransition = (0, import_react43.useMemo)(
|
|
18192
18776
|
() => deriveViewTransition(view, prevViewRef.current),
|
|
18193
18777
|
[view]
|
|
18194
18778
|
);
|
|
18195
|
-
(0,
|
|
18779
|
+
(0, import_react43.useEffect)(() => {
|
|
18196
18780
|
prevViewRef.current = view;
|
|
18197
18781
|
}, [view]);
|
|
18198
|
-
(0,
|
|
18782
|
+
(0, import_react43.useEffect)(() => {
|
|
18199
18783
|
if (isOpen && view === "chat") {
|
|
18200
18784
|
focusComposer(textareaRef);
|
|
18201
18785
|
}
|
|
@@ -18209,8 +18793,9 @@ function SupportWidgetInner({
|
|
|
18209
18793
|
"div",
|
|
18210
18794
|
{
|
|
18211
18795
|
className: cn(
|
|
18212
|
-
"box-border flex
|
|
18796
|
+
"box-border flex flex-none flex-col text-sm leading-[1.45] text-neutral-900 [&_*]:box-border",
|
|
18213
18797
|
"[font-family:var(--scw-font)]",
|
|
18798
|
+
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",
|
|
18214
18799
|
isFullscreen && "h-full w-full p-0"
|
|
18215
18800
|
),
|
|
18216
18801
|
ref: rootElRef,
|
|
@@ -18225,6 +18810,7 @@ function SupportWidgetInner({
|
|
|
18225
18810
|
dismissedHandoffs,
|
|
18226
18811
|
draft,
|
|
18227
18812
|
emailDraft,
|
|
18813
|
+
emailError,
|
|
18228
18814
|
error,
|
|
18229
18815
|
handoffPending,
|
|
18230
18816
|
imageInputRef,
|
|
@@ -18233,15 +18819,17 @@ function SupportWidgetInner({
|
|
|
18233
18819
|
isLoading,
|
|
18234
18820
|
isLoadingMessages,
|
|
18235
18821
|
isOpeningPanel,
|
|
18822
|
+
hostOwnsLauncher: hostOwnsLauncher2,
|
|
18236
18823
|
isTakeoverError,
|
|
18237
18824
|
messages,
|
|
18238
18825
|
needsEmail,
|
|
18239
18826
|
onApprove: approve,
|
|
18240
18827
|
onBack: () => setView(returnView),
|
|
18241
|
-
onClose:
|
|
18828
|
+
onClose: dashboardPreview ? void 0 : closePanel,
|
|
18242
18829
|
onConfirmHandoff: confirmHandoff,
|
|
18243
18830
|
onDismissHandoff: dismissHandoff,
|
|
18244
18831
|
onDraftChange: handleDraftChange,
|
|
18832
|
+
onEmailBlur: () => setEmailTouched(true),
|
|
18245
18833
|
onEmailChange: setEmailDraft,
|
|
18246
18834
|
onImageSelection: handleImageSelection,
|
|
18247
18835
|
onNavigate: setView,
|
|
@@ -18272,19 +18860,20 @@ function SupportWidgetInner({
|
|
|
18272
18860
|
session,
|
|
18273
18861
|
showThinking,
|
|
18274
18862
|
sortedHistory,
|
|
18275
|
-
suggestions:
|
|
18863
|
+
suggestions: resolvedSuggestions,
|
|
18276
18864
|
textareaRef,
|
|
18277
18865
|
typingLabel,
|
|
18278
18866
|
conversationLoaded,
|
|
18867
|
+
conversationState: conversation?.state ?? null,
|
|
18279
18868
|
toolLabels,
|
|
18280
18869
|
view
|
|
18281
18870
|
}
|
|
18282
18871
|
) }),
|
|
18283
|
-
!isFullscreen && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
18872
|
+
!isFullscreen && !hostOwnsLauncher2 && !dashboardPreview && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
18284
18873
|
WidgetLauncher,
|
|
18285
18874
|
{
|
|
18286
18875
|
isOpen,
|
|
18287
|
-
onClose:
|
|
18876
|
+
onClose: closePanel,
|
|
18288
18877
|
onOpen: openWidget2,
|
|
18289
18878
|
reduceMotion
|
|
18290
18879
|
}
|