saasco-sdk 0.2.4 → 0.2.5
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 +974 -0
- package/dist/index.cjs +168 -117
- package/dist/index.d.cts +21 -42
- package/dist/index.d.ts +21 -42
- package/dist/index.js +168 -117
- package/dist/support.cjs +1411 -829
- package/dist/support.d.cts +20 -9
- package/dist/support.d.ts +20 -9
- package/dist/support.js +1439 -857
- package/package.json +21 -1
package/dist/support.js
CHANGED
|
@@ -56,12 +56,17 @@ var init_is_prop_valid_esm = __esm({
|
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
58
|
|
|
59
|
-
// ../../support/shared/src/lib/
|
|
59
|
+
// ../../support/shared/src/lib/widget/supportEmbedBridge.ts
|
|
60
60
|
var BRIDGE_SOURCE = "saasco-support";
|
|
61
61
|
var BRIDGE_PROTOCOL_VERSION = 1;
|
|
62
62
|
var BRIDGE_REQUEST_TIMEOUT_MS = 15e3;
|
|
63
63
|
|
|
64
|
-
// ../../
|
|
64
|
+
// ../../utils/shared/src/lib/isRecord.ts
|
|
65
|
+
function isRecord(value) {
|
|
66
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// ../../support/shared/src/lib/widget/supportEmbedBridgeParse.ts
|
|
65
70
|
function createEnvelope(message) {
|
|
66
71
|
return {
|
|
67
72
|
source: BRIDGE_SOURCE,
|
|
@@ -168,9 +173,6 @@ function matchesOriginPattern(origin, pattern) {
|
|
|
168
173
|
function isOriginAllowed(origin, patterns) {
|
|
169
174
|
return patterns.some((pattern) => matchesOriginPattern(origin, pattern));
|
|
170
175
|
}
|
|
171
|
-
function isRecord(value) {
|
|
172
|
-
return typeof value === "object" && value !== null;
|
|
173
|
-
}
|
|
174
176
|
function readEnvelope(data) {
|
|
175
177
|
if (!isRecord(data)) {
|
|
176
178
|
return null;
|
|
@@ -209,7 +211,12 @@ function parseIdentityBearingMessage(msg) {
|
|
|
209
211
|
if (msg.identity !== null && !isRecord(msg.identity)) {
|
|
210
212
|
return null;
|
|
211
213
|
}
|
|
212
|
-
|
|
214
|
+
const identity2 = sanitizeBridgeIdentity(msg.identity);
|
|
215
|
+
if (msg.type === "identify") {
|
|
216
|
+
return { ...msg, identity: identity2 };
|
|
217
|
+
}
|
|
218
|
+
const hostLauncher = msg.hostLauncher === true ? true : msg.hostLauncher === false ? false : void 0;
|
|
219
|
+
return { ...msg, hostLauncher, identity: identity2 };
|
|
213
220
|
}
|
|
214
221
|
function isValidPageContextMessage(msg) {
|
|
215
222
|
return typeof msg.requestId === "string" && isRecord(msg.context) && typeof msg.context.url === "string";
|
|
@@ -220,7 +227,10 @@ var stateSnapshot;
|
|
|
220
227
|
var identity = null;
|
|
221
228
|
var userJwt = null;
|
|
222
229
|
var hostViewport = null;
|
|
230
|
+
var hostOwnsLauncher = false;
|
|
231
|
+
var previewShell = null;
|
|
223
232
|
var openControls = null;
|
|
233
|
+
var pendingOpenCommand = null;
|
|
224
234
|
var subscribers = /* @__PURE__ */ new Set();
|
|
225
235
|
function notify() {
|
|
226
236
|
for (const cb of subscribers) {
|
|
@@ -261,6 +271,19 @@ function setHostViewport(next) {
|
|
|
261
271
|
function getHostViewport() {
|
|
262
272
|
return hostViewport;
|
|
263
273
|
}
|
|
274
|
+
function setHostOwnsLauncher(next) {
|
|
275
|
+
if (hostOwnsLauncher === next) {
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
hostOwnsLauncher = next;
|
|
279
|
+
notify();
|
|
280
|
+
}
|
|
281
|
+
function getHostOwnsLauncher() {
|
|
282
|
+
return hostOwnsLauncher;
|
|
283
|
+
}
|
|
284
|
+
function getPreviewShell() {
|
|
285
|
+
return previewShell;
|
|
286
|
+
}
|
|
264
287
|
function resetSession() {
|
|
265
288
|
identity = null;
|
|
266
289
|
userJwt = null;
|
|
@@ -278,12 +301,32 @@ function subscribeToRegistry(cb) {
|
|
|
278
301
|
}
|
|
279
302
|
function setOpenControls(controls) {
|
|
280
303
|
openControls = controls;
|
|
304
|
+
if (!controls || pendingOpenCommand === null) {
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
const shouldOpen = pendingOpenCommand;
|
|
308
|
+
pendingOpenCommand = null;
|
|
309
|
+
if (shouldOpen) {
|
|
310
|
+
controls.open();
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
controls.close();
|
|
281
314
|
}
|
|
282
315
|
function openWidget() {
|
|
283
|
-
openControls
|
|
316
|
+
if (openControls) {
|
|
317
|
+
pendingOpenCommand = null;
|
|
318
|
+
openControls.open();
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
pendingOpenCommand = true;
|
|
284
322
|
}
|
|
285
323
|
function closeWidget() {
|
|
286
|
-
openControls
|
|
324
|
+
if (openControls) {
|
|
325
|
+
pendingOpenCommand = null;
|
|
326
|
+
openControls.close();
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
pendingOpenCommand = false;
|
|
287
330
|
}
|
|
288
331
|
|
|
289
332
|
// src/lib/support/embedBridge.ts
|
|
@@ -304,7 +347,7 @@ function post(message) {
|
|
|
304
347
|
if (!parent || parent === window) {
|
|
305
348
|
return;
|
|
306
349
|
}
|
|
307
|
-
const targetOrigin = message.type === "resize" ? "*" : parentOrigin ?? "*";
|
|
350
|
+
const targetOrigin = message.type === "resize" || message.type === "openState" ? "*" : parentOrigin ?? "*";
|
|
308
351
|
parent.postMessage(createEnvelope(message), targetOrigin);
|
|
309
352
|
}
|
|
310
353
|
function handleHostMessage(message) {
|
|
@@ -316,6 +359,7 @@ function handleHostMessage(message) {
|
|
|
316
359
|
if (message.viewport) {
|
|
317
360
|
setHostViewport(message.viewport);
|
|
318
361
|
}
|
|
362
|
+
setHostOwnsLauncher(message.hostLauncher === true);
|
|
319
363
|
break;
|
|
320
364
|
}
|
|
321
365
|
case "shutdown": {
|
|
@@ -409,6 +453,9 @@ function initEmbedBridge(options) {
|
|
|
409
453
|
function postResize(width, height, fullscreen = false) {
|
|
410
454
|
post({ fullscreen, height, type: "resize", width });
|
|
411
455
|
}
|
|
456
|
+
function postOpenState(open, fullscreen = false) {
|
|
457
|
+
post({ fullscreen, open, type: "openState" });
|
|
458
|
+
}
|
|
412
459
|
function postLauncherState(scale2, hovered) {
|
|
413
460
|
post({ hovered, scale: scale2, type: "launcherState" });
|
|
414
461
|
}
|
|
@@ -775,42 +822,7 @@ function useToolApprovals({
|
|
|
775
822
|
return { approve, clearPending, onToolCall, pending, reject };
|
|
776
823
|
}
|
|
777
824
|
|
|
778
|
-
// ../../support/shared/src/lib/
|
|
779
|
-
function buildMergedStateSnapshot(layers) {
|
|
780
|
-
const merged = {};
|
|
781
|
-
const ordered = [
|
|
782
|
-
layers.browserContext,
|
|
783
|
-
layers.identifyTraits,
|
|
784
|
-
layers.envelope,
|
|
785
|
-
toRecord(layers.hostSnapshot)
|
|
786
|
-
];
|
|
787
|
-
for (const layer of ordered) {
|
|
788
|
-
if (!layer) {
|
|
789
|
-
continue;
|
|
790
|
-
}
|
|
791
|
-
for (const [key, value] of Object.entries(layer)) {
|
|
792
|
-
const scalar = coerceScalar(value);
|
|
793
|
-
if (scalar !== void 0) {
|
|
794
|
-
merged[key] = scalar;
|
|
795
|
-
}
|
|
796
|
-
}
|
|
797
|
-
}
|
|
798
|
-
return merged;
|
|
799
|
-
}
|
|
800
|
-
function coerceScalar(value) {
|
|
801
|
-
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
802
|
-
return value;
|
|
803
|
-
}
|
|
804
|
-
return void 0;
|
|
805
|
-
}
|
|
806
|
-
function toRecord(value) {
|
|
807
|
-
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
808
|
-
return value;
|
|
809
|
-
}
|
|
810
|
-
return void 0;
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
// ../../support/shared/src/lib/types/kbCitations.ts
|
|
825
|
+
// ../../support/shared/src/lib/message/kbCitations.ts
|
|
814
826
|
import { z } from "zod";
|
|
815
827
|
var KB_CITATION_MARKER_PATTERN = /\[\[kb:([^\]]+)\]\]/gu;
|
|
816
828
|
var KbCitationSchema = z.object({
|
|
@@ -818,8 +830,6 @@ var KbCitationSchema = z.object({
|
|
|
818
830
|
title: z.string(),
|
|
819
831
|
url: z.string()
|
|
820
832
|
});
|
|
821
|
-
|
|
822
|
-
// ../../support/shared/src/lib/kbCitations.ts
|
|
823
833
|
function stripKbCitationMarkers(text) {
|
|
824
834
|
return text.replaceAll(KB_CITATION_MARKER_PATTERN, "");
|
|
825
835
|
}
|
|
@@ -848,8 +858,9 @@ function buildKbCitationNumberMap(text) {
|
|
|
848
858
|
return map;
|
|
849
859
|
}
|
|
850
860
|
|
|
851
|
-
// ../../support/shared/src/lib/normalizeToolName.ts
|
|
861
|
+
// ../../support/shared/src/lib/tools/normalizeToolName.ts
|
|
852
862
|
var CLOSE_CONVERSATION_TOOL_NAME = "close_conversation";
|
|
863
|
+
var REPORT_KNOWLEDGE_GAP_TOOL_NAME = "report_knowledge_gap";
|
|
853
864
|
var REQUEST_HUMAN_HANDOFF_TOOL_NAME = "request_human_handoff";
|
|
854
865
|
function normalizeToolName(displayName) {
|
|
855
866
|
return displayName.trim().toLowerCase().replaceAll(/[^a-z0-9]+/gu, "_").replaceAll(/_+/gu, "_").replaceAll(/^_+|_+$/gu, "").slice(0, 64);
|
|
@@ -866,6 +877,33 @@ function buildToolDisplayLabelMap(tools) {
|
|
|
866
877
|
return labels;
|
|
867
878
|
}
|
|
868
879
|
|
|
880
|
+
// ../../support/shared/src/lib/tools/toolContext.ts
|
|
881
|
+
function pickScalarRecord(value) {
|
|
882
|
+
if (!isRecord(value)) {
|
|
883
|
+
return {};
|
|
884
|
+
}
|
|
885
|
+
const scalars = {};
|
|
886
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
887
|
+
if (typeof entry === "string" || typeof entry === "number" || typeof entry === "boolean") {
|
|
888
|
+
scalars[key] = entry;
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
return scalars;
|
|
892
|
+
}
|
|
893
|
+
function buildToolContext({
|
|
894
|
+
identity: identity2,
|
|
895
|
+
stateSnapshot: stateSnapshot2
|
|
896
|
+
}) {
|
|
897
|
+
const context = pickScalarRecord(stateSnapshot2);
|
|
898
|
+
if (identity2?.distinctId) {
|
|
899
|
+
context.distinctId = identity2.distinctId;
|
|
900
|
+
}
|
|
901
|
+
if (identity2?.email) {
|
|
902
|
+
context.email = identity2.email;
|
|
903
|
+
}
|
|
904
|
+
return context;
|
|
905
|
+
}
|
|
906
|
+
|
|
869
907
|
// src/lib/support/Widget.tsx
|
|
870
908
|
import {
|
|
871
909
|
DefaultChatTransport,
|
|
@@ -9415,12 +9453,12 @@ function useReducedMotion() {
|
|
|
9415
9453
|
|
|
9416
9454
|
// src/lib/support/Widget.tsx
|
|
9417
9455
|
import {
|
|
9418
|
-
useCallback as
|
|
9419
|
-
useEffect as
|
|
9456
|
+
useCallback as useCallback10,
|
|
9457
|
+
useEffect as useEffect18,
|
|
9420
9458
|
useLayoutEffect as useLayoutEffect5,
|
|
9421
9459
|
useMemo as useMemo8,
|
|
9422
|
-
useRef as
|
|
9423
|
-
useState as
|
|
9460
|
+
useRef as useRef15,
|
|
9461
|
+
useState as useState14,
|
|
9424
9462
|
useSyncExternalStore as useSyncExternalStore2
|
|
9425
9463
|
} from "react";
|
|
9426
9464
|
|
|
@@ -9448,7 +9486,7 @@ function SaascoLogo() {
|
|
|
9448
9486
|
viewBox: "0 0 438 83",
|
|
9449
9487
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9450
9488
|
children: [
|
|
9451
|
-
/* @__PURE__ */ jsx6("rect", { height: "83", rx: "22", width: "83", x: "0.308594", fill: "#
|
|
9489
|
+
/* @__PURE__ */ jsx6("rect", { height: "83", rx: "22", width: "83", x: "0.308594", fill: "#0B0B0B" }),
|
|
9452
9490
|
/* @__PURE__ */ jsx6(
|
|
9453
9491
|
"path",
|
|
9454
9492
|
{
|
|
@@ -9483,42 +9521,42 @@ function SaascoLogo() {
|
|
|
9483
9521
|
"path",
|
|
9484
9522
|
{
|
|
9485
9523
|
d: "M408.943 73.5C392.079 73.5 380.697 61.1648 380.697 41.5C380.697 21.7756 392.139 9.5 408.943 9.5C425.807 9.5 437.189 21.7756 437.189 41.5C437.189 61.1648 425.807 73.5 408.943 73.5ZM408.943 66.5279C421.1 66.5279 429.204 57.2318 429.204 41.5C429.204 25.7682 421.1 16.4721 408.943 16.4721C396.787 16.4721 388.742 25.7682 388.742 41.5C388.742 57.2318 396.787 66.5279 408.943 66.5279Z",
|
|
9486
|
-
fill: "#
|
|
9524
|
+
fill: "#0B0B0B"
|
|
9487
9525
|
}
|
|
9488
9526
|
),
|
|
9489
9527
|
/* @__PURE__ */ jsx6(
|
|
9490
9528
|
"path",
|
|
9491
9529
|
{
|
|
9492
9530
|
d: "M377.565 30.1182H369.818C368.15 22.4907 361.893 16.4721 352.12 16.4721C340.023 16.4721 332.097 26.1853 332.097 41.5C332.097 57.0531 340.083 66.5279 352.179 66.5279C361.535 66.5279 368.03 61.3436 369.818 53.2989H377.624C375.896 65.1574 365.826 73.5 352.12 73.5C335.196 73.5 324.053 61.3436 324.053 41.5C324.053 21.9544 335.196 9.5 352.06 9.5C366.66 9.5 376.016 19.0344 377.565 30.1182Z",
|
|
9493
|
-
fill: "#
|
|
9531
|
+
fill: "#0B0B0B"
|
|
9494
9532
|
}
|
|
9495
9533
|
),
|
|
9496
9534
|
/* @__PURE__ */ jsx6(
|
|
9497
9535
|
"path",
|
|
9498
9536
|
{
|
|
9499
9537
|
d: "M274.262 27.0791C274.262 16.8296 283.379 9.5 296.31 9.5C309.539 9.5 318.359 17.1872 319.074 28.4497H311.506C310.493 20.703 304.891 15.9953 296.31 15.9953C287.848 15.9953 282.068 20.4646 282.068 26.662C282.068 31.7272 285.584 34.8855 293.807 36.852L303.163 39.0568C315.558 42.0363 320.206 46.8035 320.206 55.5633C320.206 66.0512 310.374 73.5 296.847 73.5C282.843 73.5 273.547 66.0512 272.474 54.729H280.34C281.532 62.5354 287.55 67.0047 296.847 67.0047C306.143 67.0047 312.28 62.6546 312.28 56.1592C312.28 50.7961 309.241 47.8166 300.899 45.7905L291.603 43.5857C279.804 40.8445 274.262 35.6601 274.262 27.0791Z",
|
|
9500
|
-
fill: "#
|
|
9538
|
+
fill: "#0B0B0B"
|
|
9501
9539
|
}
|
|
9502
9540
|
),
|
|
9503
9541
|
/* @__PURE__ */ jsx6(
|
|
9504
9542
|
"path",
|
|
9505
9543
|
{
|
|
9506
9544
|
d: "M238.713 66.7067C249.558 66.7067 258.079 59.0196 258.079 49.1871V42.3343L239.726 43.5857C229.953 44.2412 224.53 48.4721 224.53 55.325C224.53 62.0587 230.31 66.7067 238.713 66.7067ZM237.104 73.5C224.888 73.5 216.545 66.1704 216.545 55.325C216.545 44.7179 224.47 38.2821 238.772 37.3287L258.079 36.1369V30.7737C258.079 21.8352 252.418 16.4721 242.765 16.4721C233.647 16.4721 227.807 20.9413 226.437 28.4497H218.809C219.703 17.3659 228.821 9.5 242.943 9.5C257.066 9.5 265.945 17.4255 265.945 30.0587V72.487H258.437V60.6881H258.258C254.802 68.3752 246.34 73.5 237.104 73.5Z",
|
|
9507
|
-
fill: "#
|
|
9545
|
+
fill: "#0B0B0B"
|
|
9508
9546
|
}
|
|
9509
9547
|
),
|
|
9510
9548
|
/* @__PURE__ */ jsx6(
|
|
9511
9549
|
"path",
|
|
9512
9550
|
{
|
|
9513
9551
|
d: "M181.949 66.7067C192.794 66.7067 201.316 59.0196 201.316 49.1871V42.3343L182.962 43.5857C173.189 44.2412 167.766 48.4721 167.766 55.325C167.766 62.0587 173.547 66.7067 181.949 66.7067ZM180.34 73.5C168.124 73.5 159.781 66.1704 159.781 55.325C159.781 44.7179 167.707 38.2821 182.008 37.3287L201.316 36.1369V30.7737C201.316 21.8352 195.655 16.4721 186.001 16.4721C176.884 16.4721 171.044 20.9413 169.673 28.4497H162.046C162.94 17.3659 172.057 9.5 186.18 9.5C200.303 9.5 209.182 17.4255 209.182 30.0587V72.487H201.673V60.6881H201.494C198.038 68.3752 189.576 73.5 180.34 73.5Z",
|
|
9514
|
-
fill: "#
|
|
9552
|
+
fill: "#0B0B0B"
|
|
9515
9553
|
}
|
|
9516
9554
|
),
|
|
9517
9555
|
/* @__PURE__ */ jsx6(
|
|
9518
9556
|
"path",
|
|
9519
9557
|
{
|
|
9520
9558
|
d: "M109.096 27.0791C109.096 16.8296 118.214 9.5 131.145 9.5C144.374 9.5 153.193 17.1872 153.908 28.4497H146.34C145.327 20.703 139.726 15.9953 131.145 15.9953C122.683 15.9953 116.903 20.4646 116.903 26.662C116.903 31.7272 120.418 34.8855 128.642 36.852L137.998 39.0568C150.392 42.0363 155.04 46.8035 155.04 55.5633C155.04 66.0512 145.208 73.5 131.681 73.5C117.677 73.5 108.381 66.0512 107.309 54.729H115.175C116.366 62.5354 122.385 67.0047 131.681 67.0047C140.977 67.0047 147.115 62.6546 147.115 56.1592C147.115 50.7961 144.076 47.8166 135.733 45.7905L126.437 43.5857C114.638 40.8445 109.096 35.6601 109.096 27.0791Z",
|
|
9521
|
-
fill: "#
|
|
9559
|
+
fill: "#0B0B0B"
|
|
9522
9560
|
}
|
|
9523
9561
|
)
|
|
9524
9562
|
]
|
|
@@ -9818,6 +9856,204 @@ function ImageIcon() {
|
|
|
9818
9856
|
);
|
|
9819
9857
|
}
|
|
9820
9858
|
|
|
9859
|
+
// src/lib/widget-scale.ts
|
|
9860
|
+
var WIDGET_MOBILE_BREAKPOINT_PX = 640;
|
|
9861
|
+
var LAUNCHER_BUTTON_BASE_PX = 60;
|
|
9862
|
+
var SCALE_BASELINE_PX = 360;
|
|
9863
|
+
var MAX_VIEWPORT_SCALE = 1.25;
|
|
9864
|
+
var MAX_ZOOM_SCALE = 3;
|
|
9865
|
+
var ZOOM_TOLERANCE = 1.05;
|
|
9866
|
+
function widgetScaleMetrics(viewport, device) {
|
|
9867
|
+
const width = Number.isFinite(viewport.width) ? viewport.width : 0;
|
|
9868
|
+
if (width <= 0) {
|
|
9869
|
+
return { effectiveWidth: 0, isMobile: false, scale: 1 };
|
|
9870
|
+
}
|
|
9871
|
+
const zoom = zoomOutFactor(viewport, device);
|
|
9872
|
+
const effectiveWidth = width / zoom;
|
|
9873
|
+
const isMobile = effectiveWidth <= WIDGET_MOBILE_BREAKPOINT_PX;
|
|
9874
|
+
const viewportScale = isMobile ? clamp2(effectiveWidth / SCALE_BASELINE_PX, 1, MAX_VIEWPORT_SCALE) : 1;
|
|
9875
|
+
return { effectiveWidth, isMobile, scale: viewportScale * zoom };
|
|
9876
|
+
}
|
|
9877
|
+
function readWidgetScaleMetrics(viewport) {
|
|
9878
|
+
if (typeof window === "undefined") {
|
|
9879
|
+
return { effectiveWidth: 0, isMobile: false, scale: 1 };
|
|
9880
|
+
}
|
|
9881
|
+
return widgetScaleMetrics(viewport ?? hostLayoutViewport(), readDevice());
|
|
9882
|
+
}
|
|
9883
|
+
function hostLayoutViewport() {
|
|
9884
|
+
const root = document.documentElement;
|
|
9885
|
+
return {
|
|
9886
|
+
height: root?.clientHeight || window.innerHeight,
|
|
9887
|
+
width: root?.clientWidth || window.innerWidth
|
|
9888
|
+
};
|
|
9889
|
+
}
|
|
9890
|
+
function scaledPx(basePx, scale2) {
|
|
9891
|
+
return Math.round(basePx * scale2);
|
|
9892
|
+
}
|
|
9893
|
+
function launcherButtonPx(scale2) {
|
|
9894
|
+
return scaledPx(LAUNCHER_BUTTON_BASE_PX, scale2);
|
|
9895
|
+
}
|
|
9896
|
+
function zoomOutFactor(viewport, device) {
|
|
9897
|
+
if (!device.touch) {
|
|
9898
|
+
return 1;
|
|
9899
|
+
}
|
|
9900
|
+
const deviceWidth = orientedDeviceWidth(viewport, device);
|
|
9901
|
+
if (deviceWidth <= 0 || viewport.width <= deviceWidth * ZOOM_TOLERANCE) {
|
|
9902
|
+
return 1;
|
|
9903
|
+
}
|
|
9904
|
+
return Math.min(viewport.width / deviceWidth, MAX_ZOOM_SCALE);
|
|
9905
|
+
}
|
|
9906
|
+
function orientedDeviceWidth(viewport, device) {
|
|
9907
|
+
const shortSide = Math.min(device.screenWidth, device.screenHeight);
|
|
9908
|
+
const longSide = Math.max(device.screenWidth, device.screenHeight);
|
|
9909
|
+
const portrait = viewport.height > 0 && viewport.height >= viewport.width;
|
|
9910
|
+
return portrait ? shortSide : longSide;
|
|
9911
|
+
}
|
|
9912
|
+
function readDevice() {
|
|
9913
|
+
return {
|
|
9914
|
+
screenHeight: window.screen?.height ?? 0,
|
|
9915
|
+
screenWidth: window.screen?.width ?? 0,
|
|
9916
|
+
touch: window.matchMedia?.("(pointer: coarse)").matches === true
|
|
9917
|
+
};
|
|
9918
|
+
}
|
|
9919
|
+
function clamp2(value, min, max) {
|
|
9920
|
+
return Math.min(Math.max(value, min), max);
|
|
9921
|
+
}
|
|
9922
|
+
|
|
9923
|
+
// src/lib/support/widget-constants.ts
|
|
9924
|
+
var MESSAGE_GROUP_THRESHOLD_MS = 2 * 60 * 1e3;
|
|
9925
|
+
var POLL_INTERVAL_MS = 5e3;
|
|
9926
|
+
var MAX_TEXTAREA_HEIGHT_PX = 120;
|
|
9927
|
+
var SCROLL_BOTTOM_THRESHOLD_PX = 56;
|
|
9928
|
+
var SCROLL_PREVIOUS_ITEM_PEEK_PX = 64;
|
|
9929
|
+
var OVERSCROLL_EDGE_SLACK_PX = 1;
|
|
9930
|
+
var BOUNCE_SETTLE_MS = 400;
|
|
9931
|
+
var MIN_SCROLLBAR_THUMB_PX = 28;
|
|
9932
|
+
var PANEL_WIDTH_PX = 384;
|
|
9933
|
+
var PANEL_MAX_HEIGHT_PX = 680;
|
|
9934
|
+
var PANEL_VERTICAL_RESERVE_PX = 110;
|
|
9935
|
+
var PANEL_HORIZONTAL_RESERVE_PX = 40;
|
|
9936
|
+
var ROOT_PADDING_PX = 16;
|
|
9937
|
+
var ROOT_HORIZONTAL_PADDING_PX = ROOT_PADDING_PX * 2;
|
|
9938
|
+
var ROOT_VERTICAL_PADDING_PX = ROOT_PADDING_PX * 2;
|
|
9939
|
+
function closedFrameSizePx(scale2) {
|
|
9940
|
+
return launcherButtonPx(scale2) + ROOT_HORIZONTAL_PADDING_PX;
|
|
9941
|
+
}
|
|
9942
|
+
var LAUNCHER_ICON_BASE_PX = 25;
|
|
9943
|
+
var ROOT_STACK_GAP_PX = 12;
|
|
9944
|
+
var EMAIL_PATTERN = /^[^\s@]+@[^\s@]+\.[^\s@]+$/u;
|
|
9945
|
+
var DEFAULT_BRANDING = {
|
|
9946
|
+
agentLabel: "AI Agent",
|
|
9947
|
+
greeting: "Ask us anything, or share your feedback.",
|
|
9948
|
+
replyTime: "a few hours",
|
|
9949
|
+
teamDescription: "The team can also help",
|
|
9950
|
+
workspaceName: "Support"
|
|
9951
|
+
};
|
|
9952
|
+
var DEFAULT_SUGGESTIONS = [];
|
|
9953
|
+
var FADE_TRANSITION = { duration: 0.12, ease: "easeOut" };
|
|
9954
|
+
var SLIDE_TRANSITION = {
|
|
9955
|
+
duration: 0.28,
|
|
9956
|
+
ease: [0.32, 0.72, 0, 1]
|
|
9957
|
+
};
|
|
9958
|
+
var NAV_TRANSITION = { duration: 0.2, ease: "easeOut" };
|
|
9959
|
+
var LAUNCHER_ICON_TRANSITION = {
|
|
9960
|
+
type: "spring",
|
|
9961
|
+
stiffness: 420,
|
|
9962
|
+
damping: 30,
|
|
9963
|
+
mass: 0.85
|
|
9964
|
+
};
|
|
9965
|
+
var LAUNCHER_ICON_ROTATE_DEG = 25;
|
|
9966
|
+
var LAUNCHER_BUTTON_TRANSITION = {
|
|
9967
|
+
type: "spring",
|
|
9968
|
+
stiffness: 520,
|
|
9969
|
+
damping: 28,
|
|
9970
|
+
mass: 0.7
|
|
9971
|
+
};
|
|
9972
|
+
var LAUNCHER_HOVER_SCALE = 1.08;
|
|
9973
|
+
var LAUNCHER_TAP_SCALE = 0.9;
|
|
9974
|
+
var PANEL_SPRING = {
|
|
9975
|
+
type: "spring",
|
|
9976
|
+
stiffness: 380,
|
|
9977
|
+
damping: 32,
|
|
9978
|
+
mass: 0.85,
|
|
9979
|
+
opacity: { duration: 0.22, ease: "easeOut" }
|
|
9980
|
+
};
|
|
9981
|
+
var SCROLL_BOTTOM_TRANSITION = {
|
|
9982
|
+
duration: 0.38,
|
|
9983
|
+
ease: [0.32, 0.72, 0, 1],
|
|
9984
|
+
opacity: { delay: 0.12, duration: 0.2, ease: "easeInOut" }
|
|
9985
|
+
};
|
|
9986
|
+
var FOOTER_SWAP_SHIFT_PX = 28;
|
|
9987
|
+
var PANEL_CLOSED_SCALE = 0.94;
|
|
9988
|
+
var viewVariants = {
|
|
9989
|
+
center: (t) => ({
|
|
9990
|
+
opacity: 1,
|
|
9991
|
+
transition: t.mode === "fade" ? FADE_TRANSITION : SLIDE_TRANSITION,
|
|
9992
|
+
x: 0
|
|
9993
|
+
}),
|
|
9994
|
+
enter: (t) => t.mode === "fade" ? { opacity: 0, x: 0 } : { opacity: 1, x: t.direction > 0 ? "100%" : "-100%" },
|
|
9995
|
+
exit: (t) => t.mode === "fade" ? { opacity: 0, transition: FADE_TRANSITION, x: 0 } : {
|
|
9996
|
+
opacity: 1,
|
|
9997
|
+
transition: SLIDE_TRANSITION,
|
|
9998
|
+
x: t.direction > 0 ? "-100%" : "100%"
|
|
9999
|
+
}
|
|
10000
|
+
};
|
|
10001
|
+
var COMPOSER_FADE_TRANSITION = {
|
|
10002
|
+
duration: 0.2,
|
|
10003
|
+
ease: "easeOut"
|
|
10004
|
+
};
|
|
10005
|
+
var COMPOSER_LOAD_FADE_TRANSITION = {
|
|
10006
|
+
duration: 0.22,
|
|
10007
|
+
ease: "easeOut"
|
|
10008
|
+
};
|
|
10009
|
+
var composerVariants = {
|
|
10010
|
+
center: (t) => ({
|
|
10011
|
+
opacity: 1,
|
|
10012
|
+
transition: t.mode === "fade" ? FADE_TRANSITION : { ...SLIDE_TRANSITION, opacity: COMPOSER_FADE_TRANSITION },
|
|
10013
|
+
x: 0
|
|
10014
|
+
}),
|
|
10015
|
+
enter: (t) => t.mode === "fade" ? { opacity: 0, x: 0 } : { opacity: 0, x: t.direction > 0 ? "-100%" : "100%" },
|
|
10016
|
+
exit: (t) => t.mode === "fade" ? { opacity: 0, transition: FADE_TRANSITION, x: 0 } : {
|
|
10017
|
+
opacity: 0,
|
|
10018
|
+
transition: {
|
|
10019
|
+
...SLIDE_TRANSITION,
|
|
10020
|
+
opacity: COMPOSER_FADE_TRANSITION
|
|
10021
|
+
},
|
|
10022
|
+
x: t.direction > 0 ? "100%" : "-100%"
|
|
10023
|
+
}
|
|
10024
|
+
};
|
|
10025
|
+
|
|
10026
|
+
// src/lib/support/resolveSubmitEmailGate.ts
|
|
10027
|
+
var EMAIL_GATE_ERROR = "Enter a valid email so we can reply to you.";
|
|
10028
|
+
function resolveEmailDraftError(emailDraft) {
|
|
10029
|
+
return EMAIL_PATTERN.test(emailDraft.trim()) ? null : EMAIL_GATE_ERROR;
|
|
10030
|
+
}
|
|
10031
|
+
function resolveSubmitEmailGate({
|
|
10032
|
+
emailDraft,
|
|
10033
|
+
isNewConversation,
|
|
10034
|
+
knownEmail
|
|
10035
|
+
}) {
|
|
10036
|
+
if (!isNewConversation || knownEmail) {
|
|
10037
|
+
return {
|
|
10038
|
+
emailForSend: knownEmail ?? void 0,
|
|
10039
|
+
ok: true,
|
|
10040
|
+
optimisticallyCapturedEmail: null
|
|
10041
|
+
};
|
|
10042
|
+
}
|
|
10043
|
+
const candidate = emailDraft.trim();
|
|
10044
|
+
if (!EMAIL_PATTERN.test(candidate)) {
|
|
10045
|
+
return {
|
|
10046
|
+
error: EMAIL_GATE_ERROR,
|
|
10047
|
+
ok: false
|
|
10048
|
+
};
|
|
10049
|
+
}
|
|
10050
|
+
return {
|
|
10051
|
+
emailForSend: candidate,
|
|
10052
|
+
ok: true,
|
|
10053
|
+
optimisticallyCapturedEmail: candidate
|
|
10054
|
+
};
|
|
10055
|
+
}
|
|
10056
|
+
|
|
9821
10057
|
// src/lib/support/types.ts
|
|
9822
10058
|
var MAX_MESSAGE_LENGTH = 5e3;
|
|
9823
10059
|
var MAX_CONVERSATION_IMAGE_ATTACHMENTS = 5;
|
|
@@ -13186,10 +13422,12 @@ import { jsx as jsx9, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
|
13186
13422
|
function Composer({
|
|
13187
13423
|
draft,
|
|
13188
13424
|
emailDraft,
|
|
13425
|
+
emailError,
|
|
13189
13426
|
imageInputRef,
|
|
13190
13427
|
isLoading,
|
|
13191
13428
|
needsEmail,
|
|
13192
13429
|
onDraftChange,
|
|
13430
|
+
onEmailBlur,
|
|
13193
13431
|
onEmailChange,
|
|
13194
13432
|
onImageSelection,
|
|
13195
13433
|
onRemovePendingImage,
|
|
@@ -13200,7 +13438,8 @@ function Composer({
|
|
|
13200
13438
|
sendError,
|
|
13201
13439
|
textareaRef
|
|
13202
13440
|
}) {
|
|
13203
|
-
const
|
|
13441
|
+
const emailReady = !needsEmail || resolveEmailDraftError(emailDraft) === null;
|
|
13442
|
+
const canSend = (draft.trim().length > 0 || pendingImages.length > 0) && emailReady;
|
|
13204
13443
|
return /* @__PURE__ */ jsxs3(
|
|
13205
13444
|
"form",
|
|
13206
13445
|
{
|
|
@@ -13208,21 +13447,29 @@ function Composer({
|
|
|
13208
13447
|
onSubmit,
|
|
13209
13448
|
children: [
|
|
13210
13449
|
sendError && /* @__PURE__ */ jsx9("p", { className: "mb-2 text-xs text-red-600", children: sendError }),
|
|
13211
|
-
needsEmail && /* @__PURE__ */
|
|
13212
|
-
|
|
13213
|
-
|
|
13214
|
-
|
|
13215
|
-
|
|
13216
|
-
|
|
13217
|
-
|
|
13218
|
-
|
|
13219
|
-
|
|
13220
|
-
|
|
13221
|
-
|
|
13450
|
+
needsEmail && /* @__PURE__ */ jsxs3("div", { className: "mb-2", children: [
|
|
13451
|
+
/* @__PURE__ */ jsx9(
|
|
13452
|
+
"input",
|
|
13453
|
+
{
|
|
13454
|
+
"aria-invalid": emailError ? true : void 0,
|
|
13455
|
+
"aria-label": "Your email",
|
|
13456
|
+
className: cn(
|
|
13457
|
+
"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",
|
|
13458
|
+
emailError ? "border-red-400 focus:border-red-500" : "border-border focus:border-[color:var(--scw-hairline-strong)]"
|
|
13459
|
+
),
|
|
13460
|
+
onBlur: onEmailBlur,
|
|
13461
|
+
onChange: (e) => onEmailChange(e.target.value),
|
|
13462
|
+
placeholder: "Your email address",
|
|
13463
|
+
type: "email",
|
|
13464
|
+
value: emailDraft
|
|
13465
|
+
}
|
|
13466
|
+
),
|
|
13467
|
+
emailError && /* @__PURE__ */ jsx9("p", { className: "mt-1.5 px-1 text-xs text-red-600", children: emailError })
|
|
13468
|
+
] }),
|
|
13222
13469
|
pendingImages.length > 0 && /* @__PURE__ */ jsx9("div", { className: "mb-2 flex flex-wrap gap-2", children: pendingImages.map((file, index2) => /* @__PURE__ */ jsxs3(
|
|
13223
13470
|
Attachment,
|
|
13224
13471
|
{
|
|
13225
|
-
className: "relative size-14 overflow-hidden rounded-[10px] border border-solid border-
|
|
13472
|
+
className: "relative size-14 overflow-hidden rounded-[10px] border border-solid border-border p-0",
|
|
13226
13473
|
orientation: "vertical",
|
|
13227
13474
|
state: "done",
|
|
13228
13475
|
children: [
|
|
@@ -13248,7 +13495,7 @@ function Composer({
|
|
|
13248
13495
|
},
|
|
13249
13496
|
`${file.name}-${index2}`
|
|
13250
13497
|
)) }),
|
|
13251
|
-
/* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-2 rounded-[var(--scw-composer-radius,24px)] border border-solid border-
|
|
13498
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-2 rounded-[var(--scw-composer-radius,24px)] border border-solid border-border bg-white px-3.5 py-3 transition-[border-color,box-shadow] duration-[250ms] ease-in-out focus-within:border-neutral-900 focus-within:shadow-[0_0_0_1px_var(--scw-ink)]", children: [
|
|
13252
13499
|
/* @__PURE__ */ jsx9(
|
|
13253
13500
|
"textarea",
|
|
13254
13501
|
{
|
|
@@ -13317,67 +13564,16 @@ function focusComposer(textareaRef) {
|
|
|
13317
13564
|
});
|
|
13318
13565
|
}
|
|
13319
13566
|
|
|
13320
|
-
// src/lib/
|
|
13567
|
+
// ../../chat/client/src/lib/core/buildMessageBlocks.ts
|
|
13568
|
+
import { isTextUIPart } from "ai";
|
|
13569
|
+
|
|
13570
|
+
// ../../chat/client/src/lib/core/toolParts.ts
|
|
13321
13571
|
import { getToolName, isToolUIPart } from "ai";
|
|
13322
|
-
function
|
|
13323
|
-
|
|
13324
|
-
|
|
13325
|
-
continue;
|
|
13326
|
-
}
|
|
13327
|
-
if (part.state !== "output-available") {
|
|
13328
|
-
continue;
|
|
13329
|
-
}
|
|
13330
|
-
const output = part.output;
|
|
13331
|
-
if (output?.offerHandoff && !output.declined) {
|
|
13332
|
-
return { reason: output.reason ?? null, toolCallId: part.toolCallId };
|
|
13333
|
-
}
|
|
13572
|
+
function isLiveToolPart(part) {
|
|
13573
|
+
if (!isToolUIPart(part)) {
|
|
13574
|
+
return false;
|
|
13334
13575
|
}
|
|
13335
|
-
return
|
|
13336
|
-
}
|
|
13337
|
-
function markHandoffDeclinedInMessages(messages, toolCallId) {
|
|
13338
|
-
let changed = false;
|
|
13339
|
-
const next = messages.map((message) => {
|
|
13340
|
-
if (message.role !== "assistant") {
|
|
13341
|
-
return message;
|
|
13342
|
-
}
|
|
13343
|
-
let messageChanged = false;
|
|
13344
|
-
const parts = (message.parts ?? []).map((part) => {
|
|
13345
|
-
if (!isToolUIPart(part) || getToolName(part) !== REQUEST_HUMAN_HANDOFF_TOOL_NAME) {
|
|
13346
|
-
return part;
|
|
13347
|
-
}
|
|
13348
|
-
if (part.toolCallId !== toolCallId || part.state !== "output-available") {
|
|
13349
|
-
return part;
|
|
13350
|
-
}
|
|
13351
|
-
const output = part.output;
|
|
13352
|
-
if (output?.declined) {
|
|
13353
|
-
return part;
|
|
13354
|
-
}
|
|
13355
|
-
messageChanged = true;
|
|
13356
|
-
changed = true;
|
|
13357
|
-
return {
|
|
13358
|
-
...part,
|
|
13359
|
-
output: {
|
|
13360
|
-
...output,
|
|
13361
|
-
declined: true,
|
|
13362
|
-
offerHandoff: false
|
|
13363
|
-
}
|
|
13364
|
-
};
|
|
13365
|
-
});
|
|
13366
|
-
return messageChanged ? { ...message, parts } : message;
|
|
13367
|
-
});
|
|
13368
|
-
return changed ? next : messages;
|
|
13369
|
-
}
|
|
13370
|
-
|
|
13371
|
-
// ../../chat/client/src/lib/core/buildMessageBlocks.ts
|
|
13372
|
-
import { isTextUIPart } from "ai";
|
|
13373
|
-
|
|
13374
|
-
// ../../chat/client/src/lib/core/toolParts.ts
|
|
13375
|
-
import { getToolName as getToolName2, isToolUIPart as isToolUIPart2 } from "ai";
|
|
13376
|
-
function isLiveToolPart(part) {
|
|
13377
|
-
if (!isToolUIPart2(part)) {
|
|
13378
|
-
return false;
|
|
13379
|
-
}
|
|
13380
|
-
return part.state !== "output-available" && part.state !== "output-error";
|
|
13576
|
+
return part.state !== "output-available" && part.state !== "output-error";
|
|
13381
13577
|
}
|
|
13382
13578
|
function messageHasLiveTools(message) {
|
|
13383
13579
|
if (message.role !== "assistant") {
|
|
@@ -13386,13 +13582,13 @@ function messageHasLiveTools(message) {
|
|
|
13386
13582
|
return (message.parts ?? []).some(isLiveToolPart);
|
|
13387
13583
|
}
|
|
13388
13584
|
function toolPartToView(part) {
|
|
13389
|
-
if (!
|
|
13585
|
+
if (!isToolUIPart(part)) {
|
|
13390
13586
|
return null;
|
|
13391
13587
|
}
|
|
13392
13588
|
const view = {
|
|
13393
13589
|
state: part.state,
|
|
13394
13590
|
toolCallId: part.toolCallId,
|
|
13395
|
-
toolName:
|
|
13591
|
+
toolName: getToolName(part)
|
|
13396
13592
|
};
|
|
13397
13593
|
if (part.state === "approval-requested" && "approval" in part) {
|
|
13398
13594
|
view.approvalId = part.approval.id;
|
|
@@ -13440,109 +13636,6 @@ function buildMessageBlocks(message) {
|
|
|
13440
13636
|
|
|
13441
13637
|
// src/lib/support/message-utils.ts
|
|
13442
13638
|
import { lastAssistantMessageIsCompleteWithToolCalls } from "ai";
|
|
13443
|
-
|
|
13444
|
-
// src/lib/support/widget-constants.ts
|
|
13445
|
-
var MESSAGE_GROUP_THRESHOLD_MS = 2 * 60 * 1e3;
|
|
13446
|
-
var POLL_INTERVAL_MS = 5e3;
|
|
13447
|
-
var MAX_TEXTAREA_HEIGHT_PX = 120;
|
|
13448
|
-
var SCROLL_BOTTOM_THRESHOLD_PX = 56;
|
|
13449
|
-
var SCROLL_PREVIOUS_ITEM_PEEK_PX = 64;
|
|
13450
|
-
var OVERSCROLL_EDGE_SLACK_PX = 1;
|
|
13451
|
-
var BOUNCE_SETTLE_MS = 400;
|
|
13452
|
-
var MIN_SCROLLBAR_THUMB_PX = 28;
|
|
13453
|
-
var PANEL_WIDTH_PX = 384;
|
|
13454
|
-
var PANEL_MAX_HEIGHT_PX = 680;
|
|
13455
|
-
var PANEL_VERTICAL_RESERVE_PX = 110;
|
|
13456
|
-
var PANEL_HORIZONTAL_RESERVE_PX = 40;
|
|
13457
|
-
var MOBILE_BREAKPOINT_PX = 640;
|
|
13458
|
-
var ROOT_PADDING_PX = 16;
|
|
13459
|
-
var ROOT_HORIZONTAL_PADDING_PX = ROOT_PADDING_PX * 2;
|
|
13460
|
-
var ROOT_VERTICAL_PADDING_PX = ROOT_PADDING_PX * 2;
|
|
13461
|
-
var LAUNCHER_SIZE_PX = 60;
|
|
13462
|
-
var CLOSED_FRAME_SIZE_PX = LAUNCHER_SIZE_PX + ROOT_HORIZONTAL_PADDING_PX;
|
|
13463
|
-
var ROOT_STACK_GAP_PX = 12;
|
|
13464
|
-
var EMAIL_PATTERN = /^[^\s@]+@[^\s@]+\.[^\s@]+$/u;
|
|
13465
|
-
var DEFAULT_BRANDING = {
|
|
13466
|
-
agentLabel: "AI Agent",
|
|
13467
|
-
greeting: "Ask us anything, or share your feedback.",
|
|
13468
|
-
replyTime: "a few hours",
|
|
13469
|
-
teamDescription: "The team can also help",
|
|
13470
|
-
workspaceName: "Support"
|
|
13471
|
-
};
|
|
13472
|
-
var FADE_TRANSITION = { duration: 0.12, ease: "easeOut" };
|
|
13473
|
-
var SLIDE_TRANSITION = {
|
|
13474
|
-
duration: 0.28,
|
|
13475
|
-
ease: [0.32, 0.72, 0, 1]
|
|
13476
|
-
};
|
|
13477
|
-
var NAV_TRANSITION = { duration: 0.2, ease: "easeOut" };
|
|
13478
|
-
var LAUNCHER_ICON_TRANSITION = {
|
|
13479
|
-
type: "spring",
|
|
13480
|
-
stiffness: 420,
|
|
13481
|
-
damping: 30,
|
|
13482
|
-
mass: 0.85
|
|
13483
|
-
};
|
|
13484
|
-
var LAUNCHER_ICON_ROTATE_DEG = 25;
|
|
13485
|
-
var LAUNCHER_BUTTON_TRANSITION = {
|
|
13486
|
-
type: "spring",
|
|
13487
|
-
stiffness: 520,
|
|
13488
|
-
damping: 28,
|
|
13489
|
-
mass: 0.7
|
|
13490
|
-
};
|
|
13491
|
-
var LAUNCHER_HOVER_SCALE = 1.08;
|
|
13492
|
-
var LAUNCHER_TAP_SCALE = 0.9;
|
|
13493
|
-
var PANEL_SPRING = {
|
|
13494
|
-
type: "spring",
|
|
13495
|
-
stiffness: 380,
|
|
13496
|
-
damping: 32,
|
|
13497
|
-
mass: 0.85,
|
|
13498
|
-
opacity: { duration: 0.22, ease: "easeOut" }
|
|
13499
|
-
};
|
|
13500
|
-
var SCROLL_BOTTOM_TRANSITION = {
|
|
13501
|
-
duration: 0.38,
|
|
13502
|
-
ease: [0.32, 0.72, 0, 1],
|
|
13503
|
-
opacity: { delay: 0.12, duration: 0.2, ease: "easeInOut" }
|
|
13504
|
-
};
|
|
13505
|
-
var FOOTER_SWAP_SHIFT_PX = 28;
|
|
13506
|
-
var PANEL_CLOSED_SCALE = 0.94;
|
|
13507
|
-
var viewVariants = {
|
|
13508
|
-
center: (t) => ({
|
|
13509
|
-
opacity: 1,
|
|
13510
|
-
transition: t.mode === "fade" ? FADE_TRANSITION : SLIDE_TRANSITION,
|
|
13511
|
-
x: 0
|
|
13512
|
-
}),
|
|
13513
|
-
enter: (t) => t.mode === "fade" ? { opacity: 0, x: 0 } : { opacity: 1, x: t.direction > 0 ? "100%" : "-100%" },
|
|
13514
|
-
exit: (t) => t.mode === "fade" ? { opacity: 0, transition: FADE_TRANSITION, x: 0 } : {
|
|
13515
|
-
opacity: 1,
|
|
13516
|
-
transition: SLIDE_TRANSITION,
|
|
13517
|
-
x: t.direction > 0 ? "-100%" : "100%"
|
|
13518
|
-
}
|
|
13519
|
-
};
|
|
13520
|
-
var COMPOSER_FADE_TRANSITION = {
|
|
13521
|
-
duration: 0.2,
|
|
13522
|
-
ease: "easeOut"
|
|
13523
|
-
};
|
|
13524
|
-
var COMPOSER_LOAD_FADE_TRANSITION = {
|
|
13525
|
-
duration: 0.22,
|
|
13526
|
-
ease: "easeOut"
|
|
13527
|
-
};
|
|
13528
|
-
var composerVariants = {
|
|
13529
|
-
center: (t) => ({
|
|
13530
|
-
opacity: 1,
|
|
13531
|
-
transition: t.mode === "fade" ? FADE_TRANSITION : { ...SLIDE_TRANSITION, opacity: COMPOSER_FADE_TRANSITION },
|
|
13532
|
-
x: 0
|
|
13533
|
-
}),
|
|
13534
|
-
enter: (t) => t.mode === "fade" ? { opacity: 0, x: 0 } : { opacity: 0, x: t.direction > 0 ? "-100%" : "100%" },
|
|
13535
|
-
exit: (t) => t.mode === "fade" ? { opacity: 0, transition: FADE_TRANSITION, x: 0 } : {
|
|
13536
|
-
opacity: 0,
|
|
13537
|
-
transition: {
|
|
13538
|
-
...SLIDE_TRANSITION,
|
|
13539
|
-
opacity: COMPOSER_FADE_TRANSITION
|
|
13540
|
-
},
|
|
13541
|
-
x: t.direction > 0 ? "100%" : "-100%"
|
|
13542
|
-
}
|
|
13543
|
-
};
|
|
13544
|
-
|
|
13545
|
-
// src/lib/support/message-utils.ts
|
|
13546
13639
|
function isAttachmentOnlyPlainBody(text) {
|
|
13547
13640
|
const trimmed = text.trim();
|
|
13548
13641
|
if (trimmed === "[Image]") {
|
|
@@ -13586,7 +13679,7 @@ function createLocalUserMessage({
|
|
|
13586
13679
|
}
|
|
13587
13680
|
function readMessageAttachmentUrls(message) {
|
|
13588
13681
|
const { metadata } = message;
|
|
13589
|
-
if (!
|
|
13682
|
+
if (!isRecord(metadata) || !("attachmentUrls" in metadata)) {
|
|
13590
13683
|
return [];
|
|
13591
13684
|
}
|
|
13592
13685
|
const value = metadata.attachmentUrls;
|
|
@@ -13595,9 +13688,6 @@ function readMessageAttachmentUrls(message) {
|
|
|
13595
13688
|
}
|
|
13596
13689
|
return value.filter((entry) => typeof entry === "string");
|
|
13597
13690
|
}
|
|
13598
|
-
function isRecord2(value) {
|
|
13599
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
13600
|
-
}
|
|
13601
13691
|
async function fileToBase64(file) {
|
|
13602
13692
|
const buffer = await file.arrayBuffer();
|
|
13603
13693
|
const bytes = new Uint8Array(buffer);
|
|
@@ -13862,28 +13952,6 @@ function coerceToolArgs(args) {
|
|
|
13862
13952
|
}
|
|
13863
13953
|
return {};
|
|
13864
13954
|
}
|
|
13865
|
-
function buildToolContext({
|
|
13866
|
-
identity: identity2,
|
|
13867
|
-
stateSnapshot: stateSnapshot2
|
|
13868
|
-
}) {
|
|
13869
|
-
const context = {};
|
|
13870
|
-
if (stateSnapshot2 && typeof stateSnapshot2 === "object" && !Array.isArray(stateSnapshot2)) {
|
|
13871
|
-
for (const [key, value] of Object.entries(
|
|
13872
|
-
stateSnapshot2
|
|
13873
|
-
)) {
|
|
13874
|
-
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
13875
|
-
context[key] = value;
|
|
13876
|
-
}
|
|
13877
|
-
}
|
|
13878
|
-
}
|
|
13879
|
-
if (identity2?.distinctId) {
|
|
13880
|
-
context.distinctId = identity2.distinctId;
|
|
13881
|
-
}
|
|
13882
|
-
if (identity2?.email) {
|
|
13883
|
-
context.email = identity2.email;
|
|
13884
|
-
}
|
|
13885
|
-
return context;
|
|
13886
|
-
}
|
|
13887
13955
|
|
|
13888
13956
|
// src/lib/support/reconstructDashboardTool.ts
|
|
13889
13957
|
function reconstructDashboardTool(def) {
|
|
@@ -13937,7 +14005,7 @@ function reconstructDashboardTool(def) {
|
|
|
13937
14005
|
|
|
13938
14006
|
// src/lib/support/generated/widget-css.ts
|
|
13939
14007
|
var GENERATED_WIDGET_CSS = `/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
13940
|
-
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){:root,:host{--shimmer-angle:20deg}*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-scroll-snap-strictness:proximity;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--scroll-fade-t:0px;--scroll-fade-b:0px;--scroll-fade-s:0px;--scroll-fade-e:0px;--scroll-fade-mask:initial;--shimmer-image:initial;--shimmer-text-fill:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-600:oklch(57.7% .245 27.325);--color-amber-500:oklch(76.9% .188 70.08);--color-blue-600:oklch(54.6% .245 262.881);--color-neutral-50:oklch(98.5% 0 0);--color-neutral-100:oklch(97% 0 0);--color-neutral-200:oklch(92.2% 0 0);--color-neutral-300:oklch(87% 0 0);--color-neutral-400:oklch(70.8% 0 0);--color-neutral-500:oklch(55.6% 0 0);--color-neutral-600:oklch(43.9% 0 0);--color-neutral-700:oklch(37.1% 0 0);--color-neutral-800:oklch(26.9% 0 0);--color-neutral-900:oklch(20.5% 0 0);--color-neutral-950:oklch(14.5% 0 0);--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--leading-tight:1.25;--leading-relaxed:1.625;--radius-md:calc(var(--radius) - 2px);--radius-2xl:1rem;--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:0}.inset-x-0{inset-inline:0}.inset-s-1{inset-inline-start:var(--spacing)}.inset-s-1\\/2{inset-inline-start:50%}.top-0{top:0}.top-0\\.5{top:calc(var(--spacing) * .5)}.top-1{top:var(--spacing)}.top-1\\/2{top:50%}.top-\\[calc\\(100\\%\\+8px\\)\\]{top:calc(100% + 8px)}.top-\\[var\\(--scw-header-padding\\)\\]{top:var(--scw-header-padding)}.right-0{right:0}.right-0\\.5{right:calc(var(--spacing) * .5)}.right-3{right:calc(var(--spacing) * 3)}.right-\\[var\\(--scw-header-padding\\)\\]{right:var(--scw-header-padding)}.bottom-0{bottom:0}.bottom-\\[calc\\(var\\(--scw-send-pill-gap\\)\\+var\\(--scw-nav-height\\)\\)\\]{bottom:calc(var(--scw-send-pill-gap) + var(--scw-nav-height))}.bottom-full{bottom:100%}.left-1{left:var(--spacing)}.left-1\\/2{left:50%}.left-3{left:calc(var(--spacing) * 3)}.z-10{z-index:10}.z-20{z-index:20}.z-\\[1\\]{z-index:1}.z-\\[2\\]{z-index:2}.z-\\[5\\]{z-index:5}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.m-0{margin:0}.mx-auto{margin-inline:auto}.my-6{margin-block:calc(var(--spacing) * 6)}.-mt-1{margin-top:calc(var(--spacing) * -1)}.-mt-1\\.5{margin-top:calc(var(--spacing) * -1.5)}.mt-0{margin-top:0}.mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-\\[-16px\\]{margin-top:-16px}.mb-0{margin-bottom:0}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-2\\.5{margin-bottom:calc(var(--spacing) * 2.5)}.ml-\\[0\\.25em\\]{margin-left:.25em}.box-border{box-sizing:border-box}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.aspect-auto{aspect-ratio:auto}.aspect-square{aspect-ratio:1}.size-1{width:var(--spacing);height:var(--spacing)}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-2\\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-12{width:calc(var(--spacing) * 12);height:calc(var(--spacing) * 12)}.size-14{width:calc(var(--spacing) * 14);height:calc(var(--spacing) * 14)}.size-\\[1\\.45em\\]{width:1.45em;height:1.45em}.size-\\[18px\\]{width:18px;height:18px}.size-\\[25px\\]{width:25px;height:25px}.size-\\[60px\\]{width:60px;height:60px}.size-\\[var\\(--scw-header-btn-size\\)\\]{width:var(--scw-header-btn-size);height:var(--scw-header-btn-size)}.size-full{width:100%;height:100%}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-\\[13px\\]{height:13px}.h-\\[var\\(--scw-panel-height\\,600px\\)\\]{height:var(--scw-panel-height,600px)}.h-auto{height:auto}.h-full{height:100%}.h-max{height:max-content}.max-h-\\[120px\\]{max-height:120px}.min-h-0{min-height:0}.min-h-4{min-height:calc(var(--spacing) * 4)}.min-h-\\[22px\\]{min-height:22px}.min-h-\\[200px\\]{min-height:200px}.min-h-\\[calc\\(var\\(--scw-header-padding\\)\\*2\\+var\\(--scw-header-btn-size\\)\\)\\]{min-height:calc(var(--scw-header-padding) * 2 + var(--scw-header-btn-size))}.min-h-full{min-height:100%}.w-10{width:calc(var(--spacing) * 10)}.w-24{width:calc(var(--spacing) * 24)}.w-\\[var\\(--scw-panel-width\\,384px\\)\\]{width:var(--scw-panel-width,384px)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-max{width:max-content}.max-w-\\[80\\%\\]{max-width:80%}.max-w-\\[82\\%\\]{max-width:82%}.max-w-\\[88\\%\\]{max-width:88%}.max-w-\\[220px\\]{max-width:220px}.max-w-\\[min\\(240px\\,var\\(--scw-host-viewport-width\\,100vw\\)\\)\\]{max-width:min(240px, var(--scw-host-viewport-width,100vw))}.max-w-full{max-width:100%}.min-w-0{min-width:0}.min-w-8{min-width:calc(var(--spacing) * 8)}.min-w-40{min-width:calc(var(--spacing) * 40)}.min-w-\\[1\\.45em\\]{min-width:1.45em}.flex-1{flex:1}.flex-none{flex:none}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.origin-bottom-right{transform-origin:100% 100%}.origin-center{transform-origin:50%}.-translate-x-1{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-3{--tw-translate-y:calc(var(--spacing) * -3);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-3\\/4{--tw-translate-y:calc(calc(3 / 4 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-3{--tw-translate-y:calc(var(--spacing) * 3);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-3\\/4{--tw-translate-y:calc(3 / 4 * 100%);translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-90{rotate:90deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.shimmer{--_spread:var(--shimmer-spread,calc(3ch + 40px));--_base:currentColor;--_highlight:var(--shimmer-color,oklch(from currentColor l c h / calc(alpha* .2)));background-image:var(--shimmer-image,linear-gradient(calc(90deg + var(--shimmer-angle)), var(--_base) calc(50% - var(--_spread)), var(--_highlight) calc(50% - var(--_spread) * .5), var(--_highlight) 50%, var(--_highlight) calc(50% + var(--_spread) * .5), var(--_base) calc(50% + var(--_spread))))}@supports (color:color-mix(in lab, red, red)){.shimmer{background-image:var(--shimmer-image,linear-gradient(calc(90deg + var(--shimmer-angle)), var(--_base) calc(50% - var(--_spread)), color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% - var(--_spread) * .5), var(--_highlight) 50%, color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% + var(--_spread) * .5), var(--_base) calc(50% + var(--_spread))))}}.shimmer{background-repeat:no-repeat;background-size:calc(200% + var(--_spread) * 2) 100%;-webkit-text-fill-color:var(--shimmer-text-fill,transparent);animation:tw-shimmer var(--shimmer-duration,2s) linear infinite;background-position:0 0;-webkit-background-clip:text;background-clip:text}@media (prefers-color-scheme:dark){.shimmer{--_highlight:var(--shimmer-color,oklch(from currentColor max(.8, calc(l + .4)) c h / calc(alpha + .4)))}}.shimmer:where([dir=rtl],[dir=rtl] *){animation-direction:reverse}.scroll-fade-x{--_scroll-fade-size-s:var(--scroll-fade-s-size,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))));--_scroll-fade-size-e:var(--scroll-fade-e-size,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))));--scroll-fade-inline:linear-gradient(to right, transparent 0, #000 var(--scroll-fade-s,0px), #000 calc(100% - var(--scroll-fade-e,0px)), transparent 100%)}.scroll-fade-x:where([dir=rtl],[dir=rtl] *){--scroll-fade-inline:linear-gradient(to left, transparent 0, #000 var(--scroll-fade-s,0px), #000 calc(100% - var(--scroll-fade-e,0px)), transparent 100%)}.scroll-fade-x{-webkit-mask-image:var(--scroll-fade-mask,var(--scroll-fade-inline));-webkit-mask-image:var(--scroll-fade-mask,var(--scroll-fade-inline));-webkit-mask-image:var(--scroll-fade-mask,var(--scroll-fade-inline));mask-image:var(--scroll-fade-mask,var(--scroll-fade-inline));-webkit-mask-composite:source-in;-webkit-mask-composite:source-in;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-composite:source-in;mask-composite:intersect}@supports (animation-timeline:scroll()){.scroll-fade-x{animation:1ms ease-in-out scroll-fade-reveal-s,1ms ease-in-out scroll-fade-reveal-e;animation-timeline:scroll(self inline),scroll(self inline);animation-range:0 var(--scroll-fade-reveal,calc(var(--spacing) * 24)), calc(100% - var(--scroll-fade-reveal,calc(var(--spacing) * 24))) 100%;animation-fill-mode:both}}@supports not (animation-timeline:scroll()){.scroll-fade-x{--scroll-fade-s:var(--_scroll-fade-size-s);--scroll-fade-e:var(--_scroll-fade-size-e)}}.scroll-fade{--_scroll-fade-size-t:var(--scroll-fade-t-size,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))));--_scroll-fade-size-b:var(--scroll-fade-b-size,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))));--scroll-fade-block:linear-gradient(to bottom, transparent 0, #000 var(--scroll-fade-t,0px), #000 calc(100% - var(--scroll-fade-b,0px)), transparent 100%);-webkit-mask-image:var(--scroll-fade-mask,var(--scroll-fade-block));-webkit-mask-image:var(--scroll-fade-mask,var(--scroll-fade-block));-webkit-mask-image:var(--scroll-fade-mask,var(--scroll-fade-block));mask-image:var(--scroll-fade-mask,var(--scroll-fade-block));-webkit-mask-composite:source-in;-webkit-mask-composite:source-in;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-composite:source-in;mask-composite:intersect}@supports (animation-timeline:scroll()){.scroll-fade{animation:1ms ease-in-out scroll-fade-reveal-t,1ms ease-in-out scroll-fade-reveal-b;animation-timeline:scroll(self y),scroll(self y);animation-range:0 var(--scroll-fade-reveal,calc(var(--spacing) * 24)), calc(100% - var(--scroll-fade-reveal,calc(var(--spacing) * 24))) 100%;animation-fill-mode:both}}@supports not (animation-timeline:scroll()){.scroll-fade{--scroll-fade-t:var(--_scroll-fade-size-t);--scroll-fade-b:var(--_scroll-fade-size-b)}}.scroll-fade-b{--_scroll-fade-size-b:var(--scroll-fade-b-size,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))));--scroll-fade-mask:linear-gradient(to bottom, #000 0, #000 calc(100% - var(--scroll-fade-b,0px)), transparent 100%);-webkit-mask-image:var(--scroll-fade-mask);-webkit-mask-image:var(--scroll-fade-mask);-webkit-mask-image:var(--scroll-fade-mask);mask-image:var(--scroll-fade-mask);-webkit-mask-composite:source-in;-webkit-mask-composite:source-in;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-composite:source-in;mask-composite:intersect}@supports (animation-timeline:scroll()){.scroll-fade-b{animation:1ms ease-in-out scroll-fade-reveal-b;animation-timeline:scroll(self y);animation-range:calc(100% - var(--scroll-fade-reveal,calc(var(--spacing) * 24))) 100%;animation-fill-mode:both}}@supports not (animation-timeline:scroll()){.scroll-fade-b{--scroll-fade-b:var(--_scroll-fade-size-b)}}.animate-\\[scw-spin_\\.7s_linear_infinite\\]{animation:.7s linear infinite scw-spin}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-pan-y{--tw-pan-y:pan-y;touch-action:var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)}.resize{resize:both}.resize-none{resize:none}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-mandatory{--tw-scroll-snap-strictness:mandatory}.scroll-px-1{scroll-padding-inline:var(--spacing)}.\\[scrollbar-width\\:none\\],.scrollbar-none{scrollbar-width:none}.scrollbar-thin{scrollbar-width:thin}.\\[scrollbar-gutter\\:auto\\]{scrollbar-gutter:auto}.scrollbar-gutter-stable{scrollbar-gutter:stable}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:0}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-\\[3px\\]{gap:3px}.gap-\\[5px\\]{gap:5px}.self-center{align-self:center}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.overscroll-contain{overscroll-behavior:contain}.overscroll-x-contain{overscroll-behavior-x:contain}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-\\[10px\\]{border-radius:10px}.rounded-\\[14px\\]{border-radius:14px}.rounded-\\[min\\(var\\(--radius-md\\)\\,10px\\)\\]{border-radius:min(var(--radius-md), 10px)}.rounded-\\[min\\(var\\(--radius-md\\)\\,12px\\)\\]{border-radius:min(var(--radius-md), 12px)}.rounded-\\[var\\(--scw-composer-radius\\,24px\\)\\]{border-radius:var(--scw-composer-radius,24px)}.rounded-\\[var\\(--scw-header-btn-concentric\\)\\]{border-radius:var(--scw-header-btn-concentric)}.rounded-\\[var\\(--scw-panel-radius\\)\\]{border-radius:var(--scw-panel-radius)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-br-\\[4px\\]{border-bottom-right-radius:4px}.rounded-bl-\\[4px\\]{border-bottom-left-radius:4px}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-\\[1\\.5px\\]{border-style:var(--tw-border-style);border-width:1.5px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-none{--tw-border-style:none;border-style:none}.border-solid{--tw-border-style:solid;border-style:solid}.border-\\[\\#ececec\\]{border-color:#ececec}.border-\\[\\#f0f0f0\\]{border-color:#f0f0f0}.border-border{border-color:var(--border)}.border-neutral-200{border-color:var(--color-neutral-200)}.border-neutral-300{border-color:var(--color-neutral-300)}.border-neutral-900{border-color:var(--color-neutral-900)}.border-transparent{border-color:#0000}.border-t-neutral-500{border-top-color:var(--color-neutral-500)}.bg-\\[\\#eff6ff\\]{background-color:#eff6ff}.bg-\\[\\#f1f1f3\\]{background-color:#f1f1f3}.bg-\\[rgba\\(10\\,10\\,10\\,\\.72\\)\\]{background-color:#0a0a0ab8}.bg-amber-500{background-color:var(--color-amber-500)}.bg-background{background-color:var(--background)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-card{background-color:var(--card)}.bg-destructive,.bg-destructive\\/10{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.bg-destructive\\/10{background-color:color-mix(in oklab, var(--destructive) 10%, transparent)}}.bg-muted{background-color:var(--muted)}.bg-neutral-100{background-color:var(--color-neutral-100)}.bg-neutral-200{background-color:var(--color-neutral-200)}.bg-neutral-400{background-color:var(--color-neutral-400)}.bg-neutral-900{background-color:var(--color-neutral-900)}.bg-primary{background-color:var(--primary)}.bg-secondary{background-color:var(--secondary)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-clip-padding{background-clip:padding-box}.p-0{padding:0}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-\\[var\\(--scw-header-padding\\)\\]{padding:var(--scw-header-padding)}.px-0{padding-inline:0}.px-1{padding-inline:var(--spacing)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-\\[11px\\]{padding-inline:11px}.px-\\[13px\\]{padding-inline:13px}.px-\\[18px\\]{padding-inline:18px}.px-\\[var\\(--scw-composer-inset\\)\\]{padding-inline:var(--scw-composer-inset)}.px-\\[var\\(--scw-message-inset-x\\,16px\\)\\]{padding-inline:var(--scw-message-inset-x,16px)}.py-0{padding-block:0}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-\\[9px\\]{padding-block:9px}.py-\\[11px\\]{padding-block:11px}.pt-1{padding-top:var(--spacing)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-2\\.5{padding-top:calc(var(--spacing) * 2.5)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pb-1{padding-bottom:var(--spacing)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-2\\.5{padding-bottom:calc(var(--spacing) * 2.5)}.pb-11{padding-bottom:calc(var(--spacing) * 11)}.pb-\\[calc\\(8px\\+var\\(--scw-nav-height\\)\\+var\\(--scw-send-pill-gap\\)\\+var\\(--scw-send-pill-height\\)\\)\\]{padding-bottom:calc(8px + var(--scw-nav-height) + var(--scw-send-pill-gap) + var(--scw-send-pill-height))}.pb-\\[calc\\(24px\\+var\\(--scw-nav-height\\)\\)\\]{padding-bottom:calc(24px + var(--scw-nav-height))}.pb-\\[var\\(--scw-composer-inset\\)\\]{padding-bottom:var(--scw-composer-inset)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-2\\.5{padding-left:calc(var(--spacing) * 2.5)}.text-center{text-align:center}.text-left{text-align:left}.align-baseline{vertical-align:baseline}.\\[font-family\\:var\\(--scw-font\\)\\]{font-family:var(--scw-font)}.font-\\[inherit\\]{font-family:inherit}.font-mono{font-family:var(--font-mono)}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[0\\.8rem\\]{font-size:.8rem}.text-\\[0\\.78em\\]{font-size:.78em}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[13px\\]{font-size:13px}.text-\\[14px\\]{font-size:14px}.leading-\\[1\\.3\\]{--tw-leading:1.3;line-height:1.3}.leading-\\[1\\.4\\]{--tw-leading:1.4;line-height:1.4}.leading-\\[1\\.35\\]{--tw-leading:1.35;line-height:1.35}.leading-\\[1\\.45\\]{--tw-leading:1.45;line-height:1.45}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\\[-0\\.01em\\]{--tw-tracking:-.01em;letter-spacing:-.01em}.tracking-\\[0\\.04em\\]{--tw-tracking:.04em;letter-spacing:.04em}.\\[overflow-wrap\\:anywhere\\]{overflow-wrap:anywhere}.break-words,.wrap-break-word{overflow-wrap:break-word}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\\[\\#a3a3a3\\]{color:#a3a3a3}.text-blue-600{color:var(--color-blue-600)}.text-card-foreground{color:var(--card-foreground)}.text-destructive{color:var(--destructive)}.text-foreground{color:var(--foreground)}.text-inherit{color:inherit}.text-muted-foreground{color:var(--muted-foreground)}.text-neutral-400{color:var(--color-neutral-400)}.text-neutral-500{color:var(--color-neutral-500)}.text-neutral-600{color:var(--color-neutral-600)}.text-neutral-700{color:var(--color-neutral-700)}.text-neutral-900{color:var(--color-neutral-900)}.text-neutral-950{color:var(--color-neutral-950)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-red-600{color:var(--color-red-600)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-white{color:var(--color-white)}.uppercase{text-transform:uppercase}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0}.opacity-60{opacity:.6}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_0_0_1px_\\#171717\\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#171717);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_0_0_1px_\\#e5e5e5\\,0_4px_12px_-2px_rgba\\(0\\,0\\,0\\,\\.12\\)\\,0_2px_4px_-2px_rgba\\(0\\,0\\,0\\,\\.08\\)\\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#e5e5e5), 0 4px 12px -2px var(--tw-shadow-color,#0000001f), 0 2px 4px -2px var(--tw-shadow-color,#00000014);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_0_0_1px_rgba\\(0\\,0\\,0\\,\\.08\\)\\,0_10px_15px_-3px_rgba\\(0\\,0\\,0\\,\\.1\\)\\,0_4px_6px_-4px_rgba\\(0\\,0\\,0\\,\\.1\\)\\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#00000014), 0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_2px_8px_rgba\\(0\\,0\\,0\\,\\.06\\)\\]{--tw-shadow:0 2px 8px var(--tw-shadow-color,#0000000f);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_6px_16px_rgba\\(0\\,0\\,0\\,\\.18\\)\\]{--tw-shadow:0 6px 16px var(--tw-shadow-color,#0000002e);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_10px_15px_-3px_rgba\\(0\\,0\\,0\\,\\.1\\)\\,0_4px_6px_-4px_rgba\\(0\\,0\\,0\\,\\.1\\)\\]{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[inset_0_0_0_1px_\\#e5e5e5\\]{--tw-shadow:inset 0 0 0 1px var(--tw-shadow-color,#e5e5e5);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-3{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-card{--tw-ring-color:var(--card)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[background-color\\,box-shadow\\]{transition-property:background-color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[border-color\\,box-shadow\\]{transition-property:border-color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[translate\\,scale\\,opacity\\]{transition-property:translate,scale,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-\\[120ms\\]{--tw-duration:.12s;transition-duration:.12s}.duration-\\[250ms\\]{--tw-duration:.25s;transition-duration:.25s}.duration-\\[280ms\\]{--tw-duration:.28s;transition-duration:.28s}.ease-\\[cubic-bezier\\(\\.32\\,\\.72\\,0\\,1\\)\\]{--tw-ease:cubic-bezier(.32,.72,0,1);transition-timing-function:cubic-bezier(.32,.72,0,1)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.contain-content{contain:content}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.\\[-webkit-tap-highlight-color\\:transparent\\]{-webkit-tap-highlight-color:transparent}.\\[overflow-anchor\\:none\\]{overflow-anchor:none}.backface-hidden{backface-visibility:hidden}.group-has-data-\\[slot\\=message-footer\\]\\/message\\:-translate-y-8:is(:where(.group\\/message):has([data-slot=message-footer]) *){--tw-translate-y:calc(var(--spacing) * -8);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-has-data-\\[variant\\=ghost\\]\\/message\\:px-0:is(:where(.group\\/message):has([data-variant=ghost]) *){padding-inline:0}.group-data-\\[align\\=end\\]\\/bubble\\:self-end:is(:where(.group\\/bubble)[data-align=end] *){align-self:flex-end}.group-data-\\[align\\=end\\]\\/message\\:justify-end:is(:where(.group\\/message)[data-align=end] *){justify-content:flex-end}.group-data-\\[align\\=end\\]\\/message\\:self-end:is(:where(.group\\/message)[data-align=end] *){align-self:flex-end}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:absolute:is(:where(.group\\/attachment)[data-orientation=vertical] *){position:absolute}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:top-3:is(:where(.group\\/attachment)[data-orientation=vertical] *){top:calc(var(--spacing) * 3)}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:right-3:is(:where(.group\\/attachment)[data-orientation=vertical] *){right:calc(var(--spacing) * 3)}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:w-full:is(:where(.group\\/attachment)[data-orientation=vertical] *){width:100%}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:gap-1:is(:where(.group\\/attachment)[data-orientation=vertical] *){gap:var(--spacing)}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:px-1:is(:where(.group\\/attachment)[data-orientation=vertical] *){padding-inline:var(--spacing)}.group-data-\\[size\\=sm\\]\\/attachment\\:w-8:is(:where(.group\\/attachment)[data-size=sm] *){width:calc(var(--spacing) * 8)}.group-data-\\[size\\=xs\\]\\/attachment\\:w-7:is(:where(.group\\/attachment)[data-size=xs] *){width:calc(var(--spacing) * 7)}.group-data-\\[size\\=xs\\]\\/attachment\\:rounded-md:is(:where(.group\\/attachment)[data-size=xs] *){border-radius:calc(var(--radius) - 2px)}.group-data-\\[state\\=done\\]\\/attachment\\:opacity-100:is(:where(.group\\/attachment)[data-state=done] *){opacity:1}.group-data-\\[state\\=error\\]\\/attachment\\:bg-destructive\\/10:is(:where(.group\\/attachment)[data-state=error] *){background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.group-data-\\[state\\=error\\]\\/attachment\\:bg-destructive\\/10:is(:where(.group\\/attachment)[data-state=error] *){background-color:color-mix(in oklab, var(--destructive) 10%, transparent)}}.group-data-\\[state\\=error\\]\\/attachment\\:text-destructive:is(:where(.group\\/attachment)[data-state=error] *),.group-data-\\[state\\=error\\]\\/attachment\\:text-destructive\\/80:is(:where(.group\\/attachment)[data-state=error] *){color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.group-data-\\[state\\=error\\]\\/attachment\\:text-destructive\\/80:is(:where(.group\\/attachment)[data-state=error] *){color:color-mix(in oklab, var(--destructive) 80%, transparent)}}.group-data-\\[state\\=idle\\]\\/attachment\\:opacity-100:is(:where(.group\\/attachment)[data-state=idle] *){opacity:1}.group-data-\\[state\\=processing\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=processing] *){--_spread:var(--shimmer-spread,calc(3ch + 40px));--_base:currentColor;--_highlight:var(--shimmer-color,oklch(from currentColor l c h / calc(alpha* .2)));background-image:var(--shimmer-image,linear-gradient(calc(90deg + var(--shimmer-angle)), var(--_base) calc(50% - var(--_spread)), var(--_highlight) calc(50% - var(--_spread) * .5), var(--_highlight) 50%, var(--_highlight) calc(50% + var(--_spread) * .5), var(--_base) calc(50% + var(--_spread))))}@supports (color:color-mix(in lab, red, red)){.group-data-\\[state\\=processing\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=processing] *){background-image:var(--shimmer-image,linear-gradient(calc(90deg + var(--shimmer-angle)), var(--_base) calc(50% - var(--_spread)), color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% - var(--_spread) * .5), var(--_highlight) 50%, color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% + var(--_spread) * .5), var(--_base) calc(50% + var(--_spread))))}}.group-data-\\[state\\=processing\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=processing] *){background-repeat:no-repeat;background-size:calc(200% + var(--_spread) * 2) 100%;-webkit-text-fill-color:var(--shimmer-text-fill,transparent);animation:tw-shimmer var(--shimmer-duration,2s) linear infinite;background-position:0 0;-webkit-background-clip:text;background-clip:text}@media (prefers-color-scheme:dark){.group-data-\\[state\\=processing\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=processing] *){--_highlight:var(--shimmer-color,oklch(from currentColor max(.8, calc(l + .4)) c h / calc(alpha + .4)))}}.group-data-\\[state\\=processing\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=processing] *):where([dir=rtl],[dir=rtl] *){animation-direction:reverse}.group-data-\\[state\\=uploading\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=uploading] *){--_spread:var(--shimmer-spread,calc(3ch + 40px));--_base:currentColor;--_highlight:var(--shimmer-color,oklch(from currentColor l c h / calc(alpha* .2)));background-image:var(--shimmer-image,linear-gradient(calc(90deg + var(--shimmer-angle)), var(--_base) calc(50% - var(--_spread)), var(--_highlight) calc(50% - var(--_spread) * .5), var(--_highlight) 50%, var(--_highlight) calc(50% + var(--_spread) * .5), var(--_base) calc(50% + var(--_spread))))}@supports (color:color-mix(in lab, red, red)){.group-data-\\[state\\=uploading\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=uploading] *){background-image:var(--shimmer-image,linear-gradient(calc(90deg + var(--shimmer-angle)), var(--_base) calc(50% - var(--_spread)), color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% - var(--_spread) * .5), var(--_highlight) 50%, color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% + var(--_spread) * .5), var(--_base) calc(50% + var(--_spread))))}}.group-data-\\[state\\=uploading\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=uploading] *){background-repeat:no-repeat;background-size:calc(200% + var(--_spread) * 2) 100%;-webkit-text-fill-color:var(--shimmer-text-fill,transparent);animation:tw-shimmer var(--shimmer-duration,2s) linear infinite;background-position:0 0;-webkit-background-clip:text;background-clip:text}@media (prefers-color-scheme:dark){.group-data-\\[state\\=uploading\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=uploading] *){--_highlight:var(--shimmer-color,oklch(from currentColor max(.8, calc(l + .4)) c h / calc(alpha + .4)))}}.group-data-\\[state\\=uploading\\]\\/attachment\\:shimmer:is(:where(.group\\/attachment)[data-state=uploading] *):where([dir=rtl],[dir=rtl] *){animation-direction:reverse}.group-data-\\[variant\\=separator\\]\\/marker\\:flex-none:is(:where(.group\\/marker)[data-variant=separator] *){flex:none}.group-data-\\[variant\\=separator\\]\\/marker\\:text-center:is(:where(.group\\/marker)[data-variant=separator] *){text-align:center}.placeholder\\:text-neutral-400::placeholder{color:var(--color-neutral-400)}.before\\:mr-1:before{content:var(--tw-content);margin-right:var(--spacing)}.before\\:h-px:before{content:var(--tw-content);height:1px}.before\\:min-w-0:before{content:var(--tw-content);min-width:0}.before\\:flex-1:before{content:var(--tw-content);flex:1}.before\\:bg-border:before{content:var(--tw-content);background-color:var(--border)}.after\\:ml-1:after{content:var(--tw-content);margin-left:var(--spacing)}.after\\:h-px:after{content:var(--tw-content);height:1px}.after\\:min-w-0:after{content:var(--tw-content);min-width:0}.after\\:flex-1:after{content:var(--tw-content);flex:1}.after\\:bg-border:after{content:var(--tw-content);background-color:var(--border)}.focus-within\\:border-neutral-900:focus-within{border-color:var(--color-neutral-900)}.focus-within\\:shadow-\\[0_0_0_1px_\\#171717\\]:focus-within{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#171717);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-within\\:ring-1:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-within\\:ring-ring\\/50:focus-within{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.focus-within\\:ring-ring\\/50:focus-within{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}@media (hover:hover){.hover\\:bg-\\[\\#ebebeb\\]:hover{background-color:#ebebeb}.hover\\:bg-\\[\\#f7f7f7\\]:hover{background-color:#f7f7f7}.hover\\:bg-\\[color-mix\\(in_oklch\\,var\\(--secondary\\)\\,var\\(--foreground\\)_5\\%\\)\\]:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-\\[color-mix\\(in_oklch\\,var\\(--secondary\\)\\,var\\(--foreground\\)_5\\%\\)\\]:hover{background-color:color-mix(in oklch,var(--secondary),var(--foreground) 5%)}}.hover\\:bg-destructive\\/20:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-destructive\\/20:hover{background-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.hover\\:bg-muted:hover{background-color:var(--muted)}.hover\\:bg-neutral-50:hover{background-color:var(--color-neutral-50)}.hover\\:bg-neutral-100:hover{background-color:var(--color-neutral-100)}.hover\\:bg-neutral-800:hover{background-color:var(--color-neutral-800)}.hover\\:bg-primary\\/80:hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-primary\\/80:hover{background-color:color-mix(in oklab, var(--primary) 80%, transparent)}}.hover\\:text-foreground:hover{color:var(--foreground)}.hover\\:text-neutral-600:hover{color:var(--color-neutral-600)}.hover\\:text-neutral-700:hover{color:var(--color-neutral-700)}.hover\\:no-underline:hover{text-decoration-line:none}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:shadow-\\[0_0_0_1px_\\#d4d4d4\\,0_4px_12px_-2px_rgba\\(0\\,0\\,0\\,\\.14\\)\\,0_2px_4px_-2px_rgba\\(0\\,0\\,0\\,\\.1\\)\\]:hover{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#d4d4d4), 0 4px 12px -2px var(--tw-shadow-color,#00000024), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.hover\\:shadow-\\[inset_0_0_0_1px_\\#d4d4d4\\]:hover{--tw-shadow:inset 0 0 0 1px var(--tw-shadow-color,#d4d4d4);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}}.focus\\:border-neutral-400:focus{border-color:var(--color-neutral-400)}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:border-destructive\\/40:focus-visible{border-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.focus-visible\\:border-destructive\\/40:focus-visible{border-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.focus-visible\\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\\:ring-3:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.active\\:not-aria-\\[haspopup\\]\\:translate-y-px:active:not([aria-haspopup]){--tw-translate-y:1px;translate:var(--tw-translate-x) var(--tw-translate-y)}@media (hover:hover){.enabled\\:hover\\:bg-neutral-100:enabled:hover{background-color:var(--color-neutral-100)}.enabled\\:hover\\:text-neutral-700:enabled:hover{color:var(--color-neutral-700)}}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-default:disabled{cursor:default}.disabled\\:opacity-45:disabled{opacity:.45}.disabled\\:opacity-50:disabled{opacity:.5}.disabled\\:opacity-60:disabled{opacity:.6}:where([data-slot=button-group]) .in-data-\\[slot\\=button-group\\]\\:rounded-lg{border-radius:var(--radius)}.has-data-\\[icon\\=inline-end\\]\\:pr-1\\.5:has([data-icon=inline-end]){padding-right:calc(var(--spacing) * 1.5)}.has-data-\\[icon\\=inline-end\\]\\:pr-2:has([data-icon=inline-end]){padding-right:calc(var(--spacing) * 2)}.has-data-\\[icon\\=inline-start\\]\\:pl-1\\.5:has([data-icon=inline-start]){padding-left:calc(var(--spacing) * 1.5)}.has-data-\\[icon\\=inline-start\\]\\:pl-2:has([data-icon=inline-start]){padding-left:calc(var(--spacing) * 2)}.has-data-\\[slot\\=attachment-content\\]\\:w-30:has([data-slot=attachment-content]){width:calc(var(--spacing) * 30)}.has-data-\\[slot\\=attachment-content\\]\\:px-1\\.5:has([data-slot=attachment-content]){padding-inline:calc(var(--spacing) * 1.5)}.has-data-\\[slot\\=attachment-content\\]\\:px-2:has([data-slot=attachment-content]){padding-inline:calc(var(--spacing) * 2)}.has-data-\\[slot\\=attachment-content\\]\\:px-2\\.5:has([data-slot=attachment-content]){padding-inline:calc(var(--spacing) * 2.5)}.has-data-\\[slot\\=attachment-content\\]\\:py-1:has([data-slot=attachment-content]){padding-block:var(--spacing)}.has-data-\\[slot\\=attachment-content\\]\\:py-1\\.5:has([data-slot=attachment-content]){padding-block:calc(var(--spacing) * 1.5)}.has-data-\\[slot\\=attachment-content\\]\\:py-2:has([data-slot=attachment-content]){padding-block:calc(var(--spacing) * 2)}.has-data-\\[slot\\=attachment-media\\]\\:p-1:has([data-slot=attachment-media]){padding:var(--spacing)}.has-data-\\[slot\\=attachment-media\\]\\:p-1\\.5:has([data-slot=attachment-media]){padding:calc(var(--spacing) * 1.5)}.has-data-\\[slot\\=attachment-media\\]\\:p-2:has([data-slot=attachment-media]){padding:calc(var(--spacing) * 2)}.has-\\[button\\]\\:p-0:has(:is(button)){padding:0}@media (hover:hover){.has-\\[\\>a\\,\\>button\\]\\:hover\\:bg-muted\\/50:has(>a,>button):hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.has-\\[\\>a\\,\\>button\\]\\:hover\\:bg-muted\\/50:has(>a,>button):hover{background-color:color-mix(in oklab, var(--muted) 50%, transparent)}}}.aria-expanded\\:bg-muted[aria-expanded=true]{background-color:var(--muted)}.aria-expanded\\:bg-secondary[aria-expanded=true]{background-color:var(--secondary)}.aria-expanded\\:text-foreground[aria-expanded=true]{color:var(--foreground)}.aria-expanded\\:text-secondary-foreground[aria-expanded=true]{color:var(--secondary-foreground)}.aria-invalid\\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\\:ring-3[aria-invalid=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}:is(.group-data-\\[align\\=end\\]\\/message\\:\\*\\:data-slot\\:self-end:is(:where(.group\\/message)[data-align=end] *)>*)[data-slot]{align-self:flex-end}.data-\\[active\\=false\\]\\:pointer-events-none[data-active=false]{pointer-events:none}.data-\\[active\\=false\\]\\:scale-95[data-active=false]{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.data-\\[active\\=false\\]\\:opacity-0[data-active=false]{opacity:0}.data-\\[active\\=false\\]\\:duration-400[data-active=false]{--tw-duration:.4s;transition-duration:.4s}.data-\\[active\\=false\\]\\:ease-\\[cubic-bezier\\(0\\.7\\,0\\,0\\.84\\,0\\)\\][data-active=false]{--tw-ease:cubic-bezier(.7,0,.84,0);transition-timing-function:cubic-bezier(.7,0,.84,0)}.data-\\[active\\=true\\]\\:translate-y-0[data-active=true]{--tw-translate-y:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[active\\=true\\]\\:scale-100[data-active=true]{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.data-\\[active\\=true\\]\\:opacity-100[data-active=true]{opacity:1}.data-\\[active\\=true\\]\\:ease-\\[cubic-bezier\\(0\\.23\\,1\\,0\\.32\\,1\\)\\][data-active=true]{--tw-ease:cubic-bezier(.23,1,.32,1);transition-timing-function:cubic-bezier(.23,1,.32,1)}.data-\\[align\\=end\\]\\:flex-row-reverse[data-align=end]{flex-direction:row-reverse}.data-\\[align\\=end\\]\\:self-end[data-align=end]{align-self:flex-end}.data-\\[direction\\=end\\]\\:bottom-4[data-direction=end]{bottom:calc(var(--spacing) * 4)}.data-\\[direction\\=end\\]\\:data-\\[active\\=false\\]\\:translate-y-full[data-direction=end][data-active=false]{--tw-translate-y:100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[direction\\=start\\]\\:top-4[data-direction=start]{top:calc(var(--spacing) * 4)}.data-\\[direction\\=start\\]\\:data-\\[active\\=false\\]\\:-translate-y-full[data-direction=start][data-active=false]{--tw-translate-y:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}:is(.\\*\\:data-\\[slot\\=attachment\\]\\:flex-none>*)[data-slot=attachment]{flex:none}:is(.\\*\\:data-\\[slot\\=attachment\\]\\:snap-start>*)[data-slot=attachment]{scroll-snap-align:start}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:rounded-none>*)[data-slot=bubble-content]{border-radius:0}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:border-border>*)[data-slot=bubble-content]{border-color:var(--border)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-\\[oklch\\(from_var\\(--primary\\)_0\\.93_calc\\(c\\*0\\.4\\)_h\\)\\]>*)[data-slot=bubble-content]{background-color:oklch(from var(--primary) .93 calc(c * .4) h)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-background>*)[data-slot=bubble-content]{background-color:var(--background)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-destructive\\/10>*)[data-slot=bubble-content]{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-destructive\\/10>*)[data-slot=bubble-content]{background-color:color-mix(in oklab, var(--destructive) 10%, transparent)}}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-muted>*)[data-slot=bubble-content]{background-color:var(--muted)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-primary>*)[data-slot=bubble-content]{background-color:var(--primary)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-secondary>*)[data-slot=bubble-content]{background-color:var(--secondary)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-transparent>*)[data-slot=bubble-content]{background-color:#0000}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:p-0>*)[data-slot=bubble-content]{padding:0}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:text-destructive>*)[data-slot=bubble-content]{color:var(--destructive)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:text-foreground>*)[data-slot=bubble-content]{color:var(--foreground)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:text-primary-foreground>*)[data-slot=bubble-content]{color:var(--primary-foreground)}:is(.\\*\\:data-\\[slot\\=bubble-content\\]\\:text-secondary-foreground>*)[data-slot=bubble-content]{color:var(--secondary-foreground)}:is(.group-data-\\[orientation\\=vertical\\]\\/attachment\\:\\*\\:data-\\[slot\\=spinner\\]\\:size-6\\!:is(:where(.group\\/attachment)[data-orientation=vertical] *)>*)[data-slot=spinner]{width:calc(var(--spacing) * 6)!important;height:calc(var(--spacing) * 6)!important}.data-\\[state\\=error\\]\\:border-destructive\\/30[data-state=error]{border-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.data-\\[state\\=error\\]\\:border-destructive\\/30[data-state=error]{border-color:color-mix(in oklab, var(--destructive) 30%, transparent)}}.data-\\[state\\=idle\\]\\:border-dashed[data-state=idle]{--tw-border-style:dashed;border-style:dashed}.data-\\[variant\\=ghost\\]\\:max-w-full[data-variant=ghost]{max-width:100%}.rtl\\:translate-x-1\\/2:where(:dir(rtl),[dir=rtl],[dir=rtl] *){--tw-translate-x:calc(1 / 2 * 100%);translate:var(--tw-translate-x) var(--tw-translate-y)}@media (prefers-color-scheme:dark){.dark\\:border-input{border-color:var(--input)}.dark\\:bg-destructive\\/20{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-destructive\\/20{background-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.dark\\:bg-input\\/30{background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-input\\/30{background-color:color-mix(in oklab, var(--input) 30%, transparent)}}@media (hover:hover){.dark\\:hover\\:bg-destructive\\/30:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:hover\\:bg-destructive\\/30:hover{background-color:color-mix(in oklab, var(--destructive) 30%, transparent)}}.dark\\:hover\\:bg-input\\/50:hover{background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\\:hover\\:bg-input\\/50:hover{background-color:color-mix(in oklab, var(--input) 50%, transparent)}}.dark\\:hover\\:bg-muted\\/50:hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.dark\\:hover\\:bg-muted\\/50:hover{background-color:color-mix(in oklab, var(--muted) 50%, transparent)}}}.dark\\:focus-visible\\:ring-destructive\\/40:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:focus-visible\\:ring-destructive\\/40:focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\\:aria-invalid\\:border-destructive\\/50[aria-invalid=true]{border-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:aria-invalid\\:border-destructive\\/50[aria-invalid=true]{border-color:color-mix(in oklab, var(--destructive) 50%, transparent)}}.dark\\:aria-invalid\\:ring-destructive\\/40[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:aria-invalid\\:ring-destructive\\/40[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}:is(.dark\\:\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-\\[oklch\\(from_var\\(--primary\\)_0\\.3_calc\\(c\\*0\\.4\\)_h\\)\\]>*)[data-slot=bubble-content]{background-color:oklch(from var(--primary) .3 calc(c * .4) h)}:is(.dark\\:\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-destructive\\/20>*)[data-slot=bubble-content]{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){:is(.dark\\:\\*\\:data-\\[slot\\=bubble-content\\]\\:bg-destructive\\/20>*)[data-slot=bubble-content]{background-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}}.\\[\\&_\\*\\]\\:box-border *{box-sizing:border-box}.\\[\\&_img\\]\\:block img{display:block}.\\[\\&_img\\]\\:size-full img{width:100%;height:100%}.\\[\\&_img\\]\\:scale-100 img{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.\\[\\&_img\\]\\:scale-\\[1\\.08\\] img{scale:1.08}.\\[\\&_img\\]\\:object-contain img{object-fit:contain}.\\[\\&_img\\]\\:object-cover img{object-fit:cover}.\\[\\&_strong\\]\\:font-semibold strong{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:block svg{display:block}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.data-\\[direction\\=start\\]\\:\\[\\&_svg\\]\\:rotate-180[data-direction=start] svg{rotate:180deg}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-3 svg:not([class*=size-]){width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-3\\.5 svg:not([class*=size-]){width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.group-data-\\[orientation\\=vertical\\]\\/attachment\\:\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-6:is(:where(.group\\/attachment)[data-orientation=vertical] *) svg:not([class*=size-]){width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.group-data-\\[size\\=xs\\]\\/attachment\\:\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-3\\.5:is(:where(.group\\/attachment)[data-size=xs] *) svg:not([class*=size-]){width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.\\[\\&\\:\\:-webkit-scrollbar\\]\\:hidden::-webkit-scrollbar{display:none}.\\[a\\]\\:underline:is(a){text-decoration-line:underline}.\\[a\\]\\:underline-offset-3:is(a){text-underline-offset:3px}:is(.\\*\\:\\[a\\]\\:underline>*):is(a){text-decoration-line:underline}:is(.\\*\\:\\[a\\]\\:underline-offset-3>*):is(a){text-underline-offset:3px}@media (hover:hover){.\\[a\\]\\:hover\\:text-foreground:is(a):hover,:is(.\\*\\:\\[a\\]\\:hover\\:text-foreground>*):is(a):hover{color:var(--foreground)}}.\\[button\\]\\:text-left:is(button){text-align:left}.\\[button\\,a\\]\\:transition-colors:is(button,a){transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.\\[button\\,a\\]\\:outline-none:is(button,a){--tw-outline-style:none;outline-style:none}.\\[button\\,a\\]\\:focus-visible\\:border-ring:is(button,a):focus-visible{border-color:var(--ring)}.\\[button\\,a\\]\\:focus-visible\\:ring-3:is(button,a):focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.\\[button\\,a\\]\\:focus-visible\\:ring-ring\\/50:is(button,a):focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.\\[button\\,a\\]\\:focus-visible\\:ring-ring\\/50:is(button,a):focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}:is(.\\*\\:\\[img\\]\\:aspect-square>*):is(img){aspect-ratio:1}:is(.\\*\\:\\[img\\]\\:w-full>*):is(img){width:100%}:is(.\\*\\:\\[img\\]\\:object-cover>*):is(img){object-fit:cover}.\\[\\&\\>\\*\\]\\:pointer-events-auto>*{pointer-events:auto}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-\\[color-mix\\(in_oklch\\,var\\(--muted\\)\\,var\\(--foreground\\)_5\\%\\)\\]>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-\\[color-mix\\(in_oklch\\,var\\(--muted\\)\\,var\\(--foreground\\)_5\\%\\)\\]>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklch,var(--muted),var(--foreground) 5%)}}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-\\[color-mix\\(in_oklch\\,var\\(--secondary\\)\\,var\\(--foreground\\)_5\\%\\)\\]>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-\\[color-mix\\(in_oklch\\,var\\(--secondary\\)\\,var\\(--foreground\\)_5\\%\\)\\]>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklch,var(--secondary),var(--foreground) 5%)}}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-\\[oklch\\(from_var\\(--primary\\)_0\\.88_calc\\(c\\*0\\.5\\)_h\\)\\]>[data-slot=bubble-content]:is(button,a):hover{background-color:oklch(from var(--primary) .88 calc(c * .5) h)}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-destructive\\/20>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-destructive\\/20>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-muted>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--muted)}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-primary\\/80>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-primary\\/80>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklab, var(--primary) 80%, transparent)}}.\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:text-foreground>[data-slot=bubble-content]:is(button,a):hover{color:var(--foreground)}@media (prefers-color-scheme:dark){.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-\\[oklch\\(from_var\\(--primary\\)_0\\.35_calc\\(c\\*0\\.5\\)_h\\)\\]>[data-slot=bubble-content]:is(button,a):hover{background-color:oklch(from var(--primary) .35 calc(c * .5) h)}.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-destructive\\/30>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-destructive\\/30>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklab, var(--destructive) 30%, transparent)}}.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-input\\/30>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-input\\/30>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklab, var(--input) 30%, transparent)}}.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-muted\\/50>[data-slot=bubble-content]:is(button,a):hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.dark\\:\\[\\&\\>\\[data-slot\\=bubble-content\\]\\:is\\(button\\,a\\)\\:hover\\]\\:bg-muted\\/50>[data-slot=bubble-content]:is(button,a):hover{background-color:color-mix(in oklab, var(--muted) 50%, transparent)}}}}@property --scroll-fade-t{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --scroll-fade-b{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --scroll-fade-s{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --scroll-fade-e{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --scroll-fade-mask{syntax:"*";inherits:false}@property --shimmer-angle{syntax:"<angle>";inherits:true;initial-value:20deg}@property --shimmer-image{syntax:"*";inherits:false}@property --shimmer-text-fill{syntax:"*";inherits:false}@media (prefers-reduced-motion:reduce){.shimmer{-webkit-text-fill-color:currentColor;background-image:none;animation:none}}:root{--radius:.625rem;--background:#fff;--foreground:#171717;--card:#fff;--card-foreground:#171717;--popover:#fff;--popover-foreground:#171717;--primary:#171717;--primary-foreground:#fafafa;--secondary:#f1f1f3;--secondary-foreground:#171717;--muted:#f5f5f5;--muted-foreground:#737373;--accent:#f5f5f5;--accent-foreground:#171717;--destructive:#dc2626;--border:#e5e5e5;--input:#e5e5e5;--ring:#a3a3a3}html,body{overscroll-behavior:none;background:0 0;width:100%;height:100%;margin:0;padding:0;overflow:hidden}body{--scw-font:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;flex-direction:column;justify-content:flex-end;align-items:flex-end;display:flex}.scw-panel{--scw-nav-height:52px;--scw-send-pill-gap:24px;--scw-send-pill-height:40px;--scw-composer-clearance:8px;--scw-composer-height:130px;--scw-composer-radius:24px;--scw-composer-inset:12px;--scw-panel-radius:calc(var(--scw-composer-radius) + var(--scw-composer-inset) + 1px);--scw-header-btn-size:36px;--scw-header-btn-concentric:calc(var(--scw-header-btn-size) / 2);--scw-header-padding:calc(var(--scw-panel-radius) - var(--scw-header-btn-concentric) - 1px)}.scw-form:before{content:"";left:var(--scw-composer-inset);right:var(--scw-composer-inset);border-top-left-radius:var(--scw-composer-radius,24px);border-top-right-radius:var(--scw-composer-radius,24px);z-index:-1;pointer-events:none;background:#fff;position:absolute;top:0;bottom:0}.scw-messages{--scw-message-inset-x:16px;scrollbar-width:none}.scw-messages::-webkit-scrollbar{width:0;height:0}@keyframes scw-bounce-top{0%{transform:translateY(0)}35%{transform:translateY(14px)}to{transform:translateY(0)}}@keyframes scw-bounce-bottom{0%{transform:translateY(0)}35%{transform:translateY(-14px)}to{transform:translateY(0)}}.scw-bounce-top{animation:.32s cubic-bezier(.32,.72,0,1) scw-bounce-top}.scw-bounce-bottom{animation:.32s cubic-bezier(.32,.72,0,1) scw-bounce-bottom}@keyframes scw-message-in{0%{opacity:0}to{opacity:1}}.scw-message-in{animation:.22s ease-out scw-message-in}@media (prefers-reduced-motion:reduce){.scw-message-in{animation:none}}@keyframes scw-spin{to{transform:rotate(360deg)}}.scw-citation+.scw-citation{margin-left:.3em}.scw-citation-popover{transform:translateX(calc(-50% + var(--scw-citation-popover-shift,0px)))}.scw-citation-popover:before{content:"";height:10px;position:absolute;top:-10px;left:0;right:0}@media (hover:hover) and (pointer:fine){.scw-citation:hover .scw-citation-badge{color:#fff;background:#2563eb}}.scw-scrollbar{top:10px;right:3px;bottom:calc(var(--scw-composer-height,130px) + 2px);z-index:3;pointer-events:none;width:6px;position:absolute}.scw-scrollbar-thumb{opacity:0;pointer-events:auto;cursor:default;touch-action:none;background-color:#d4d4d4;border-radius:9999px;transition:opacity .2s;position:absolute;top:0;left:0;right:0}.scw-scrollbar-visible .scw-scrollbar-thumb{opacity:1}.scw-scrollbar-thumb:hover{background-color:#b8b8b8}.scw-thin-scroll{scrollbar-width:thin;scrollbar-color:#d4d4d4 transparent}.scw-thin-scroll::-webkit-scrollbar{width:6px}.scw-thin-scroll::-webkit-scrollbar-track{background:0 0}.scw-thin-scroll::-webkit-scrollbar-thumb{background-color:#d4d4d4;border-radius:9999px}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-pan-x{syntax:"*";inherits:false}@property --tw-pan-y{syntax:"*";inherits:false}@property --tw-pinch-zoom{syntax:"*";inherits:false}@property --tw-scroll-snap-strictness{syntax:"*";inherits:false;initial-value:proximity}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@keyframes scroll-fade-reveal-t{0%{--scroll-fade-t:0px}to{--scroll-fade-t:var(--_scroll-fade-size-t,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))))}}@keyframes scroll-fade-reveal-b{0%{--scroll-fade-b:var(--_scroll-fade-size-b,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))))}to{--scroll-fade-b:0px}}@keyframes scroll-fade-reveal-s{0%{--scroll-fade-s:0px}to{--scroll-fade-s:var(--_scroll-fade-size-s,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))))}}@keyframes scroll-fade-reveal-e{0%{--scroll-fade-e:var(--_scroll-fade-size-e,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))))}to{--scroll-fade-e:0px}}@keyframes tw-shimmer{0%{background-position:100% 0}to{background-position:0 0}}`;
|
|
14008
|
+
@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: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-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: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-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)}.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}.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\\.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-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:auto;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}.scw-scrollbar-thumb:hover{background-color:var(--scw-gray-400)}.scw-thin-scroll{scrollbar-width:thin;scrollbar-color:var(--scw-gray-300) transparent}.scw-thin-scroll::-webkit-scrollbar{width:6px}.scw-thin-scroll::-webkit-scrollbar-track{background:0 0}.scw-thin-scroll::-webkit-scrollbar-thumb{background-color:var(--scw-gray-300);border-radius:9999px}.scw-suggestion{box-sizing:border-box;text-align:left;white-space:normal;grid-template-columns:auto minmax(0,1fr);align-items:center;column-gap:12px;width:100%;min-width:0;max-width:100%;display:grid;overflow:hidden}.scw-suggestion-icon{justify-content:center;align-self:center;align-items:center;width:28px;height:28px;display:flex}.scw-suggestion-copy{flex-direction:column;justify-content:center;min-width:0;max-width:100%;display:flex}.scw-suggestion-label{max-width:100%;display:block;overflow-wrap:anywhere!important;word-break:break-all!important;white-space:normal!important}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-pan-x{syntax:"*";inherits:false}@property --tw-pan-y{syntax:"*";inherits:false}@property --tw-pinch-zoom{syntax:"*";inherits:false}@property --tw-scroll-snap-strictness{syntax:"*";inherits:false;initial-value:proximity}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@keyframes scroll-fade-reveal-t{0%{--scroll-fade-t:0px}to{--scroll-fade-t:var(--_scroll-fade-size-t,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))))}}@keyframes scroll-fade-reveal-b{0%{--scroll-fade-b:var(--_scroll-fade-size-b,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))))}to{--scroll-fade-b:0px}}@keyframes scroll-fade-reveal-s{0%{--scroll-fade-s:0px}to{--scroll-fade-s:var(--_scroll-fade-size-s,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))))}}@keyframes scroll-fade-reveal-e{0%{--scroll-fade-e:var(--_scroll-fade-size-e,var(--scroll-fade-size,min(12%, calc(var(--spacing) * 10))))}to{--scroll-fade-e:0px}}@keyframes tw-shimmer{0%{background-position:100% 0}to{background-position:0 0}}`;
|
|
13941
14009
|
|
|
13942
14010
|
// src/lib/support/styles.ts
|
|
13943
14011
|
var STYLE_ATTRIBUTE = "data-saasco-chat";
|
|
@@ -14057,46 +14125,23 @@ function toPreparedFile(blob, originalName) {
|
|
|
14057
14125
|
});
|
|
14058
14126
|
}
|
|
14059
14127
|
|
|
14060
|
-
// src/lib/support/resolveSubmitEmailGate.ts
|
|
14061
|
-
function resolveSubmitEmailGate({
|
|
14062
|
-
emailDraft,
|
|
14063
|
-
isNewConversation,
|
|
14064
|
-
knownEmail
|
|
14065
|
-
}) {
|
|
14066
|
-
if (!isNewConversation || knownEmail) {
|
|
14067
|
-
return {
|
|
14068
|
-
emailForSend: knownEmail ?? void 0,
|
|
14069
|
-
ok: true,
|
|
14070
|
-
optimisticallyCapturedEmail: null
|
|
14071
|
-
};
|
|
14072
|
-
}
|
|
14073
|
-
const candidate = emailDraft.trim();
|
|
14074
|
-
if (!EMAIL_PATTERN.test(candidate)) {
|
|
14075
|
-
return {
|
|
14076
|
-
error: "Enter a valid email so we can reply to you.",
|
|
14077
|
-
ok: false
|
|
14078
|
-
};
|
|
14079
|
-
}
|
|
14080
|
-
return {
|
|
14081
|
-
emailForSend: candidate,
|
|
14082
|
-
ok: true,
|
|
14083
|
-
optimisticallyCapturedEmail: candidate
|
|
14084
|
-
};
|
|
14085
|
-
}
|
|
14086
|
-
|
|
14087
14128
|
// src/lib/support/transport.ts
|
|
14088
14129
|
async function getWidgetConfig({
|
|
14089
14130
|
baseUrl,
|
|
14090
14131
|
projectId
|
|
14091
14132
|
}) {
|
|
14092
|
-
const { branding, tools } = await postJson(
|
|
14133
|
+
const { branding, suggestions, tools } = await postJson(
|
|
14093
14134
|
`${normalizeBaseUrl(baseUrl)}/api/support/settings`,
|
|
14094
14135
|
{ projectId }
|
|
14095
14136
|
);
|
|
14096
14137
|
if (!Array.isArray(tools)) {
|
|
14097
14138
|
throw new TypeError("Support chat settings response is missing `tools`");
|
|
14098
14139
|
}
|
|
14099
|
-
return {
|
|
14140
|
+
return {
|
|
14141
|
+
branding,
|
|
14142
|
+
...Array.isArray(suggestions) ? { suggestions } : {},
|
|
14143
|
+
tools
|
|
14144
|
+
};
|
|
14100
14145
|
}
|
|
14101
14146
|
async function sendMessage({
|
|
14102
14147
|
baseUrl,
|
|
@@ -14155,16 +14200,32 @@ async function resumeSession({
|
|
|
14155
14200
|
body
|
|
14156
14201
|
);
|
|
14157
14202
|
}
|
|
14203
|
+
async function forgetVisitorSession({
|
|
14204
|
+
baseUrl,
|
|
14205
|
+
projectId
|
|
14206
|
+
}) {
|
|
14207
|
+
await postJson(
|
|
14208
|
+
`${normalizeBaseUrl(baseUrl)}/api/support/visitor/forget`,
|
|
14209
|
+
{ projectId }
|
|
14210
|
+
);
|
|
14211
|
+
}
|
|
14158
14212
|
async function requestHandoff({
|
|
14159
14213
|
baseUrl,
|
|
14214
|
+
keepalive,
|
|
14160
14215
|
...body
|
|
14161
14216
|
}) {
|
|
14162
|
-
return await postJson(`${normalizeBaseUrl(baseUrl)}/api/support/handoff`, body
|
|
14217
|
+
return await postJson(`${normalizeBaseUrl(baseUrl)}/api/support/handoff`, body, {
|
|
14218
|
+
keepalive,
|
|
14219
|
+
simple: keepalive === true
|
|
14220
|
+
});
|
|
14163
14221
|
}
|
|
14164
|
-
async function postJson(url, body) {
|
|
14222
|
+
async function postJson(url, body, options) {
|
|
14165
14223
|
const response = await fetch(url, {
|
|
14166
14224
|
body: JSON.stringify(body),
|
|
14167
|
-
headers: {
|
|
14225
|
+
headers: {
|
|
14226
|
+
"content-type": options?.simple ? "text/plain" : "application/json"
|
|
14227
|
+
},
|
|
14228
|
+
keepalive: options?.keepalive,
|
|
14168
14229
|
method: "POST"
|
|
14169
14230
|
});
|
|
14170
14231
|
if (!response.ok) {
|
|
@@ -14386,24 +14447,211 @@ function selectPendingImages(event, setPendingImages, setSendError) {
|
|
|
14386
14447
|
setPendingImages(
|
|
14387
14448
|
(current) => [...current, ...selected].slice(0, MAX_CONVERSATION_IMAGE_ATTACHMENTS)
|
|
14388
14449
|
);
|
|
14389
|
-
event.target.value = "";
|
|
14390
|
-
}
|
|
14391
|
-
function persistEmail(emailStorageKey, email) {
|
|
14392
|
-
try {
|
|
14393
|
-
window.localStorage.setItem(emailStorageKey, email);
|
|
14394
|
-
} catch {
|
|
14395
|
-
}
|
|
14450
|
+
event.target.value = "";
|
|
14451
|
+
}
|
|
14452
|
+
function persistEmail(emailStorageKey, email) {
|
|
14453
|
+
try {
|
|
14454
|
+
window.localStorage.setItem(emailStorageKey, email);
|
|
14455
|
+
} catch {
|
|
14456
|
+
}
|
|
14457
|
+
}
|
|
14458
|
+
|
|
14459
|
+
// src/lib/support/useHandoffDecisions.ts
|
|
14460
|
+
import { useCallback as useCallback5, useEffect as useEffect5, useRef as useRef7, useState as useState4 } from "react";
|
|
14461
|
+
|
|
14462
|
+
// src/lib/support/handoff.ts
|
|
14463
|
+
import { getToolName as getToolName2, isToolUIPart as isToolUIPart2 } from "ai";
|
|
14464
|
+
function readHandoffOffer(message) {
|
|
14465
|
+
for (const part of message.parts ?? []) {
|
|
14466
|
+
if (!isToolUIPart2(part) || getToolName2(part) !== REQUEST_HUMAN_HANDOFF_TOOL_NAME) {
|
|
14467
|
+
continue;
|
|
14468
|
+
}
|
|
14469
|
+
if (part.state !== "output-available") {
|
|
14470
|
+
continue;
|
|
14471
|
+
}
|
|
14472
|
+
const output = part.output;
|
|
14473
|
+
if (output?.offerHandoff && !output.declined && !output.resolved) {
|
|
14474
|
+
return { reason: output.reason ?? null, toolCallId: part.toolCallId };
|
|
14475
|
+
}
|
|
14476
|
+
}
|
|
14477
|
+
return null;
|
|
14478
|
+
}
|
|
14479
|
+
function readOutstandingHandoffOffers(messages) {
|
|
14480
|
+
const offers = [];
|
|
14481
|
+
for (const message of messages) {
|
|
14482
|
+
const offer = readHandoffOffer(message);
|
|
14483
|
+
if (offer) {
|
|
14484
|
+
offers.push(offer);
|
|
14485
|
+
}
|
|
14486
|
+
}
|
|
14487
|
+
return offers;
|
|
14488
|
+
}
|
|
14489
|
+
function markHandoffOfferInMessages(messages, toolCallId, flag) {
|
|
14490
|
+
let changed = false;
|
|
14491
|
+
const next = messages.map((message) => {
|
|
14492
|
+
if (message.role !== "assistant") {
|
|
14493
|
+
return message;
|
|
14494
|
+
}
|
|
14495
|
+
let messageChanged = false;
|
|
14496
|
+
const parts = (message.parts ?? []).map((part) => {
|
|
14497
|
+
if (!isToolUIPart2(part) || getToolName2(part) !== REQUEST_HUMAN_HANDOFF_TOOL_NAME) {
|
|
14498
|
+
return part;
|
|
14499
|
+
}
|
|
14500
|
+
if (part.toolCallId !== toolCallId || part.state !== "output-available") {
|
|
14501
|
+
return part;
|
|
14502
|
+
}
|
|
14503
|
+
const output = part.output;
|
|
14504
|
+
if (output?.declined || output?.resolved) {
|
|
14505
|
+
return part;
|
|
14506
|
+
}
|
|
14507
|
+
messageChanged = true;
|
|
14508
|
+
changed = true;
|
|
14509
|
+
return {
|
|
14510
|
+
...part,
|
|
14511
|
+
output: {
|
|
14512
|
+
...output,
|
|
14513
|
+
...flag,
|
|
14514
|
+
offerHandoff: false
|
|
14515
|
+
}
|
|
14516
|
+
};
|
|
14517
|
+
});
|
|
14518
|
+
return messageChanged ? { ...message, parts } : message;
|
|
14519
|
+
});
|
|
14520
|
+
return changed ? next : messages;
|
|
14521
|
+
}
|
|
14522
|
+
|
|
14523
|
+
// src/lib/support/useHandoffDecisions.ts
|
|
14524
|
+
function useHandoffDecisions({
|
|
14525
|
+
baseUrl,
|
|
14526
|
+
mergedIdsRef,
|
|
14527
|
+
messagesRef,
|
|
14528
|
+
onAccepted,
|
|
14529
|
+
projectId,
|
|
14530
|
+
sessionRef,
|
|
14531
|
+
setMessages
|
|
14532
|
+
}) {
|
|
14533
|
+
const [dismissedHandoffs, setDismissedHandoffs] = useState4(
|
|
14534
|
+
() => /* @__PURE__ */ new Set()
|
|
14535
|
+
);
|
|
14536
|
+
const [handoffPending, setHandoffPending] = useState4(false);
|
|
14537
|
+
const handoffPendingRef = useRef7(false);
|
|
14538
|
+
const confirmHandoff = useCallback5(
|
|
14539
|
+
async (offer) => {
|
|
14540
|
+
const active = sessionRef.current;
|
|
14541
|
+
if (!active || handoffPendingRef.current) {
|
|
14542
|
+
return;
|
|
14543
|
+
}
|
|
14544
|
+
handoffPendingRef.current = true;
|
|
14545
|
+
setHandoffPending(true);
|
|
14546
|
+
try {
|
|
14547
|
+
const result = await requestHandoff({
|
|
14548
|
+
baseUrl,
|
|
14549
|
+
conversationId: active.conversationId,
|
|
14550
|
+
projectId,
|
|
14551
|
+
reason: offer.reason,
|
|
14552
|
+
sessionToken: active.sessionToken,
|
|
14553
|
+
toolCallId: offer.toolCallId
|
|
14554
|
+
});
|
|
14555
|
+
onAccepted();
|
|
14556
|
+
const next = markHandoffOfferInMessages(
|
|
14557
|
+
messagesRef.current,
|
|
14558
|
+
offer.toolCallId,
|
|
14559
|
+
{ resolved: true }
|
|
14560
|
+
);
|
|
14561
|
+
if (result.acknowledgment) {
|
|
14562
|
+
mergedIdsRef.current.add(result.acknowledgment.id);
|
|
14563
|
+
setMessages([...next, toUiMessage(result.acknowledgment)]);
|
|
14564
|
+
} else {
|
|
14565
|
+
setMessages(next);
|
|
14566
|
+
}
|
|
14567
|
+
} catch {
|
|
14568
|
+
} finally {
|
|
14569
|
+
handoffPendingRef.current = false;
|
|
14570
|
+
setHandoffPending(false);
|
|
14571
|
+
}
|
|
14572
|
+
},
|
|
14573
|
+
[
|
|
14574
|
+
baseUrl,
|
|
14575
|
+
mergedIdsRef,
|
|
14576
|
+
messagesRef,
|
|
14577
|
+
onAccepted,
|
|
14578
|
+
projectId,
|
|
14579
|
+
sessionRef,
|
|
14580
|
+
setMessages
|
|
14581
|
+
]
|
|
14582
|
+
);
|
|
14583
|
+
const dismissHandoff = useCallback5(
|
|
14584
|
+
(toolCallId) => {
|
|
14585
|
+
setDismissedHandoffs((prev) => {
|
|
14586
|
+
if (prev.has(toolCallId)) {
|
|
14587
|
+
return prev;
|
|
14588
|
+
}
|
|
14589
|
+
const next = new Set(prev);
|
|
14590
|
+
next.add(toolCallId);
|
|
14591
|
+
return next;
|
|
14592
|
+
});
|
|
14593
|
+
setMessages(
|
|
14594
|
+
markHandoffOfferInMessages(messagesRef.current, toolCallId, {
|
|
14595
|
+
declined: true
|
|
14596
|
+
})
|
|
14597
|
+
);
|
|
14598
|
+
const active = sessionRef.current;
|
|
14599
|
+
if (!active) {
|
|
14600
|
+
return;
|
|
14601
|
+
}
|
|
14602
|
+
void requestHandoff({
|
|
14603
|
+
baseUrl,
|
|
14604
|
+
conversationId: active.conversationId,
|
|
14605
|
+
decision: "declined",
|
|
14606
|
+
projectId,
|
|
14607
|
+
sessionToken: active.sessionToken,
|
|
14608
|
+
toolCallId
|
|
14609
|
+
}).catch(() => {
|
|
14610
|
+
});
|
|
14611
|
+
},
|
|
14612
|
+
[baseUrl, messagesRef, projectId, sessionRef, setMessages]
|
|
14613
|
+
);
|
|
14614
|
+
useEffect5(() => {
|
|
14615
|
+
function reportUnansweredHandoffs() {
|
|
14616
|
+
const active = sessionRef.current;
|
|
14617
|
+
if (!active || handoffPendingRef.current) {
|
|
14618
|
+
return;
|
|
14619
|
+
}
|
|
14620
|
+
for (const offer of readOutstandingHandoffOffers(messagesRef.current)) {
|
|
14621
|
+
void requestHandoff({
|
|
14622
|
+
baseUrl,
|
|
14623
|
+
conversationId: active.conversationId,
|
|
14624
|
+
decision: "unanswered",
|
|
14625
|
+
keepalive: true,
|
|
14626
|
+
projectId,
|
|
14627
|
+
sessionToken: active.sessionToken,
|
|
14628
|
+
toolCallId: offer.toolCallId
|
|
14629
|
+
}).catch(() => {
|
|
14630
|
+
});
|
|
14631
|
+
}
|
|
14632
|
+
}
|
|
14633
|
+
window.addEventListener("pagehide", reportUnansweredHandoffs);
|
|
14634
|
+
return () => {
|
|
14635
|
+
window.removeEventListener("pagehide", reportUnansweredHandoffs);
|
|
14636
|
+
};
|
|
14637
|
+
}, [baseUrl, messagesRef, projectId, sessionRef]);
|
|
14638
|
+
return {
|
|
14639
|
+
confirmHandoff,
|
|
14640
|
+
dismissedHandoffs,
|
|
14641
|
+
dismissHandoff,
|
|
14642
|
+
handoffPending
|
|
14643
|
+
};
|
|
14396
14644
|
}
|
|
14397
14645
|
|
|
14398
14646
|
// src/lib/support/useInboundMessageChime.ts
|
|
14399
|
-
import { useEffect as
|
|
14647
|
+
import { useEffect as useEffect6, useRef as useRef8 } from "react";
|
|
14400
14648
|
function useInboundMessageChime({
|
|
14401
14649
|
isLoading,
|
|
14402
14650
|
messages
|
|
14403
14651
|
}) {
|
|
14404
|
-
const chimedMessageIdsRef =
|
|
14405
|
-
const inboundChimeSeededRef =
|
|
14406
|
-
|
|
14652
|
+
const chimedMessageIdsRef = useRef8(/* @__PURE__ */ new Set());
|
|
14653
|
+
const inboundChimeSeededRef = useRef8(false);
|
|
14654
|
+
useEffect6(() => {
|
|
14407
14655
|
if (messages.length === 0) {
|
|
14408
14656
|
inboundChimeSeededRef.current = false;
|
|
14409
14657
|
chimedMessageIdsRef.current.clear();
|
|
@@ -14445,9 +14693,9 @@ function useInboundMessageChime({
|
|
|
14445
14693
|
}
|
|
14446
14694
|
|
|
14447
14695
|
// src/lib/support/useOverscrollBounce.ts
|
|
14448
|
-
import { useEffect as
|
|
14696
|
+
import { useEffect as useEffect7 } from "react";
|
|
14449
14697
|
function useOverscrollBounce(ref, enabled, reduceMotion) {
|
|
14450
|
-
|
|
14698
|
+
useEffect7(() => {
|
|
14451
14699
|
const el = ref.current;
|
|
14452
14700
|
if (!el || !enabled || reduceMotion) {
|
|
14453
14701
|
return;
|
|
@@ -14503,13 +14751,13 @@ function useOverscrollBounce(ref, enabled, reduceMotion) {
|
|
|
14503
14751
|
}, [ref, enabled, reduceMotion]);
|
|
14504
14752
|
}
|
|
14505
14753
|
|
|
14506
|
-
// ../../support/shared/src/lib/supportPresenceConstants.ts
|
|
14754
|
+
// ../../support/shared/src/lib/presence/supportPresenceConstants.ts
|
|
14507
14755
|
var SUPPORT_TYPING_TTL_MS = 3e4;
|
|
14508
14756
|
var SUPPORT_TYPING_POLL_INTERVAL_MS = 4e3;
|
|
14509
14757
|
var SUPPORT_TYPING_REFRESH_MS = SUPPORT_TYPING_TTL_MS / 2;
|
|
14510
14758
|
var SUPPORT_TYPING_IDLE_MS = 8e3;
|
|
14511
14759
|
|
|
14512
|
-
// ../../support/shared/src/lib/createTypingPresenceController.ts
|
|
14760
|
+
// ../../support/shared/src/lib/presence/createTypingPresenceController.ts
|
|
14513
14761
|
function createTypingPresenceController({
|
|
14514
14762
|
ping,
|
|
14515
14763
|
isVisible = defaultIsVisible,
|
|
@@ -14628,16 +14876,16 @@ function defaultIsVisible() {
|
|
|
14628
14876
|
}
|
|
14629
14877
|
|
|
14630
14878
|
// src/lib/support/useSupportTypingPresence.ts
|
|
14631
|
-
import { useEffect as
|
|
14879
|
+
import { useEffect as useEffect8, useRef as useRef9, useState as useState5 } from "react";
|
|
14632
14880
|
function useSupportTypingPresence({
|
|
14633
14881
|
baseUrl,
|
|
14634
14882
|
enabled,
|
|
14635
14883
|
projectId,
|
|
14636
14884
|
session
|
|
14637
14885
|
}) {
|
|
14638
|
-
const [typing, setTyping] =
|
|
14639
|
-
const controllerRef =
|
|
14640
|
-
|
|
14886
|
+
const [typing, setTyping] = useState5([]);
|
|
14887
|
+
const controllerRef = useRef9(null);
|
|
14888
|
+
useEffect8(() => {
|
|
14641
14889
|
if (!enabled || !session) {
|
|
14642
14890
|
setTyping([]);
|
|
14643
14891
|
controllerRef.current = null;
|
|
@@ -14671,14 +14919,192 @@ function useSupportTypingPresence({
|
|
|
14671
14919
|
};
|
|
14672
14920
|
}
|
|
14673
14921
|
|
|
14922
|
+
// src/lib/support/useVisitorConversationPersistence.ts
|
|
14923
|
+
import { useCallback as useCallback6, useEffect as useEffect9, useRef as useRef10, useState as useState6 } from "react";
|
|
14924
|
+
function useVisitorConversationPersistence({
|
|
14925
|
+
baseUrl,
|
|
14926
|
+
emailStorageKey,
|
|
14927
|
+
identity: identity2,
|
|
14928
|
+
onIdentityWipe,
|
|
14929
|
+
onResumed,
|
|
14930
|
+
projectId,
|
|
14931
|
+
sessionRef,
|
|
14932
|
+
storageKey,
|
|
14933
|
+
userJwt: userJwt2
|
|
14934
|
+
}) {
|
|
14935
|
+
const [session, setSessionState] = useState6(null);
|
|
14936
|
+
const [sessionHistory, setSessionHistory] = useState6([]);
|
|
14937
|
+
const [capturedEmail, setCapturedEmail] = useState6(null);
|
|
14938
|
+
const identityRef = useRef10(identity2);
|
|
14939
|
+
const userJwtRef = useRef10(userJwt2);
|
|
14940
|
+
const onIdentityWipeRef = useRef10(onIdentityWipe);
|
|
14941
|
+
const onResumedRef = useRef10(onResumed);
|
|
14942
|
+
const generationRef = useRef10(0);
|
|
14943
|
+
const pendingForgetRef = useRef10(Promise.resolve());
|
|
14944
|
+
const previousVisitorRef = useRef10(null);
|
|
14945
|
+
identityRef.current = identity2;
|
|
14946
|
+
userJwtRef.current = userJwt2;
|
|
14947
|
+
onIdentityWipeRef.current = onIdentityWipe;
|
|
14948
|
+
onResumedRef.current = onResumed;
|
|
14949
|
+
const visitorKey = `${userJwt2 ?? ""}\0${identity2?.distinctId ?? ""}\0${identity2?.email ?? ""}`;
|
|
14950
|
+
const setSession = useCallback6(
|
|
14951
|
+
(next) => {
|
|
14952
|
+
sessionRef.current = next;
|
|
14953
|
+
setSessionState(next);
|
|
14954
|
+
},
|
|
14955
|
+
[sessionRef]
|
|
14956
|
+
);
|
|
14957
|
+
const refreshSessionHistory = useCallback6(() => {
|
|
14958
|
+
const generation = generationRef.current;
|
|
14959
|
+
void (async () => {
|
|
14960
|
+
try {
|
|
14961
|
+
const rows = await listConversations({
|
|
14962
|
+
baseUrl,
|
|
14963
|
+
distinctId: identityRef.current?.distinctId,
|
|
14964
|
+
projectId,
|
|
14965
|
+
userJwt: userJwtRef.current ?? void 0
|
|
14966
|
+
});
|
|
14967
|
+
if (generation !== generationRef.current) {
|
|
14968
|
+
return;
|
|
14969
|
+
}
|
|
14970
|
+
setSessionHistory(toHistoryEntries(rows));
|
|
14971
|
+
} catch {
|
|
14972
|
+
if (generation !== generationRef.current) {
|
|
14973
|
+
return;
|
|
14974
|
+
}
|
|
14975
|
+
setSessionHistory(readSessionHistory(storageKey));
|
|
14976
|
+
}
|
|
14977
|
+
})();
|
|
14978
|
+
}, [baseUrl, projectId, storageKey]);
|
|
14979
|
+
useEffect9(() => {
|
|
14980
|
+
const stored = readStoredSession(storageKey);
|
|
14981
|
+
sessionRef.current = stored;
|
|
14982
|
+
setSessionState(stored);
|
|
14983
|
+
if (stored) {
|
|
14984
|
+
ensureActiveSessionInHistory(storageKey, stored);
|
|
14985
|
+
}
|
|
14986
|
+
try {
|
|
14987
|
+
const email = window.localStorage.getItem(emailStorageKey);
|
|
14988
|
+
if (email) {
|
|
14989
|
+
setCapturedEmail(email);
|
|
14990
|
+
}
|
|
14991
|
+
} catch {
|
|
14992
|
+
}
|
|
14993
|
+
}, [emailStorageKey, sessionRef, storageKey]);
|
|
14994
|
+
useEffect9(() => {
|
|
14995
|
+
const controller = new AbortController();
|
|
14996
|
+
generationRef.current += 1;
|
|
14997
|
+
const generation = generationRef.current;
|
|
14998
|
+
const ownerId = identityRef.current?.distinctId ?? identityRef.current?.email ?? null;
|
|
14999
|
+
const jwtPresent = Boolean(userJwtRef.current);
|
|
15000
|
+
const previous = previousVisitorRef.current;
|
|
15001
|
+
previousVisitorRef.current = { jwtPresent, ownerId };
|
|
15002
|
+
let wiped = false;
|
|
15003
|
+
if (ownerId) {
|
|
15004
|
+
wiped = reconcileSessionOwner(storageKey, ownerId).cleared;
|
|
15005
|
+
} else if (previous && (previous.ownerId || previous.jwtPresent) && !jwtPresent) {
|
|
15006
|
+
clearChatStorage(storageKey);
|
|
15007
|
+
wiped = true;
|
|
15008
|
+
}
|
|
15009
|
+
if (wiped) {
|
|
15010
|
+
sessionRef.current = null;
|
|
15011
|
+
setSessionState(null);
|
|
15012
|
+
setSessionHistory([]);
|
|
15013
|
+
try {
|
|
15014
|
+
window.localStorage.removeItem(emailStorageKey);
|
|
15015
|
+
} catch {
|
|
15016
|
+
}
|
|
15017
|
+
setCapturedEmail(null);
|
|
15018
|
+
onIdentityWipeRef.current();
|
|
15019
|
+
pendingForgetRef.current = (async () => {
|
|
15020
|
+
try {
|
|
15021
|
+
await forgetVisitorSession({ baseUrl, projectId });
|
|
15022
|
+
} catch {
|
|
15023
|
+
}
|
|
15024
|
+
})();
|
|
15025
|
+
}
|
|
15026
|
+
async function sync() {
|
|
15027
|
+
await pendingForgetRef.current;
|
|
15028
|
+
if (controller.signal.aborted) {
|
|
15029
|
+
return;
|
|
15030
|
+
}
|
|
15031
|
+
const distinctId = identityRef.current?.distinctId;
|
|
15032
|
+
const jwt = userJwtRef.current ?? void 0;
|
|
15033
|
+
const [listResult, resumeResult] = await Promise.allSettled([
|
|
15034
|
+
listConversations({
|
|
15035
|
+
baseUrl,
|
|
15036
|
+
distinctId,
|
|
15037
|
+
projectId,
|
|
15038
|
+
userJwt: jwt
|
|
15039
|
+
}),
|
|
15040
|
+
resumeSession({
|
|
15041
|
+
baseUrl,
|
|
15042
|
+
distinctId,
|
|
15043
|
+
projectId,
|
|
15044
|
+
userJwt: jwt
|
|
15045
|
+
})
|
|
15046
|
+
]);
|
|
15047
|
+
if (controller.signal.aborted || generation !== generationRef.current) {
|
|
15048
|
+
return;
|
|
15049
|
+
}
|
|
15050
|
+
if (listResult.status === "fulfilled") {
|
|
15051
|
+
setSessionHistory(toHistoryEntries(listResult.value));
|
|
15052
|
+
} else {
|
|
15053
|
+
setSessionHistory(readSessionHistory(storageKey));
|
|
15054
|
+
}
|
|
15055
|
+
if (resumeResult.status !== "fulfilled" || !resumeResult.value) {
|
|
15056
|
+
return;
|
|
15057
|
+
}
|
|
15058
|
+
const resumed = resumeResult.value;
|
|
15059
|
+
const next = {
|
|
15060
|
+
conversationId: resumed.conversationId,
|
|
15061
|
+
sessionToken: resumed.sessionToken
|
|
15062
|
+
};
|
|
15063
|
+
sessionRef.current = next;
|
|
15064
|
+
setSessionState(next);
|
|
15065
|
+
storeSession(storageKey, next);
|
|
15066
|
+
ensureActiveSessionInHistory(storageKey, next);
|
|
15067
|
+
onResumedRef.current(resumed.conversation);
|
|
15068
|
+
}
|
|
15069
|
+
void sync();
|
|
15070
|
+
return () => {
|
|
15071
|
+
controller.abort();
|
|
15072
|
+
};
|
|
15073
|
+
}, [baseUrl, emailStorageKey, projectId, sessionRef, storageKey, visitorKey]);
|
|
15074
|
+
return {
|
|
15075
|
+
capturedEmail,
|
|
15076
|
+
refreshSessionHistory,
|
|
15077
|
+
session,
|
|
15078
|
+
sessionHistory,
|
|
15079
|
+
setCapturedEmail,
|
|
15080
|
+
setSession
|
|
15081
|
+
};
|
|
15082
|
+
}
|
|
15083
|
+
function toHistoryEntries(rows) {
|
|
15084
|
+
return rows.map((row) => ({
|
|
15085
|
+
conversationId: row.conversationId,
|
|
15086
|
+
preview: row.preview,
|
|
15087
|
+
sessionToken: row.sessionToken,
|
|
15088
|
+
updatedAt: row.updatedAt
|
|
15089
|
+
}));
|
|
15090
|
+
}
|
|
15091
|
+
|
|
14674
15092
|
// src/lib/support/useWidgetFrameSizing.ts
|
|
14675
|
-
import { useLayoutEffect as useLayoutEffect2, useRef as
|
|
15093
|
+
import { useLayoutEffect as useLayoutEffect2, useRef as useRef11, useState as useState7 } from "react";
|
|
14676
15094
|
|
|
14677
15095
|
// src/lib/support/widget-sizing.ts
|
|
14678
15096
|
var BRANDING_CACHE_PREFIX = "saasco-chat-branding:";
|
|
15097
|
+
var sizeToIframeViewport = false;
|
|
14679
15098
|
function brandingCacheKey(projectId) {
|
|
14680
15099
|
return `${BRANDING_CACHE_PREFIX}${projectId}`;
|
|
14681
15100
|
}
|
|
15101
|
+
function widgetSessionStorageKeys(projectId, preview) {
|
|
15102
|
+
const slot = preview ? `preview:${projectId}` : projectId;
|
|
15103
|
+
return {
|
|
15104
|
+
emailStorageKey: `saasco-chat-email:${slot}`,
|
|
15105
|
+
storageKey: `saasco-chat-session:${slot}`
|
|
15106
|
+
};
|
|
15107
|
+
}
|
|
14682
15108
|
function readBrandingCache(projectId) {
|
|
14683
15109
|
try {
|
|
14684
15110
|
const raw = window.sessionStorage.getItem(brandingCacheKey(projectId));
|
|
@@ -14710,6 +15136,9 @@ function resolveSizingViewport() {
|
|
|
14710
15136
|
if (host) {
|
|
14711
15137
|
return host;
|
|
14712
15138
|
}
|
|
15139
|
+
if (sizeToIframeViewport && typeof window !== "undefined") {
|
|
15140
|
+
return { height: window.innerHeight, width: window.innerWidth };
|
|
15141
|
+
}
|
|
14713
15142
|
if (isCrossOriginEmbed()) {
|
|
14714
15143
|
return {
|
|
14715
15144
|
height: PANEL_MAX_HEIGHT_PX + PANEL_VERTICAL_RESERVE_PX,
|
|
@@ -14718,20 +15147,29 @@ function resolveSizingViewport() {
|
|
|
14718
15147
|
}
|
|
14719
15148
|
return { height: window.innerHeight, width: window.innerWidth };
|
|
14720
15149
|
}
|
|
14721
|
-
function
|
|
15150
|
+
function widgetScale() {
|
|
15151
|
+
if (sizeToIframeViewport) {
|
|
15152
|
+
return { effectiveWidth: PANEL_WIDTH_PX, isMobile: false, scale: 1 };
|
|
15153
|
+
}
|
|
14722
15154
|
const host = getHostViewport();
|
|
14723
15155
|
if (host) {
|
|
14724
|
-
return host
|
|
15156
|
+
return readWidgetScaleMetrics(host);
|
|
14725
15157
|
}
|
|
14726
15158
|
if (isCrossOriginEmbed()) {
|
|
14727
|
-
return false;
|
|
15159
|
+
return { effectiveWidth: 0, isMobile: false, scale: 1 };
|
|
14728
15160
|
}
|
|
14729
|
-
return
|
|
15161
|
+
return readWidgetScaleMetrics();
|
|
15162
|
+
}
|
|
15163
|
+
function isDashboardPreview() {
|
|
15164
|
+
return sizeToIframeViewport;
|
|
14730
15165
|
}
|
|
14731
15166
|
function clampPanelDimensions(viewport, fullscreen) {
|
|
14732
15167
|
if (fullscreen) {
|
|
14733
15168
|
return { height: viewport.height, width: viewport.width };
|
|
14734
15169
|
}
|
|
15170
|
+
if (sizeToIframeViewport) {
|
|
15171
|
+
return { height: PANEL_MAX_HEIGHT_PX, width: PANEL_WIDTH_PX };
|
|
15172
|
+
}
|
|
14735
15173
|
return {
|
|
14736
15174
|
height: Math.min(
|
|
14737
15175
|
PANEL_MAX_HEIGHT_PX,
|
|
@@ -14744,21 +15182,30 @@ function clampPanelDimensions(viewport, fullscreen) {
|
|
|
14744
15182
|
};
|
|
14745
15183
|
}
|
|
14746
15184
|
function computeFrameDimensions(isOpen) {
|
|
15185
|
+
const { isMobile, scale: scale2 } = widgetScale();
|
|
15186
|
+
const hostOwnsLauncher2 = getHostOwnsLauncher();
|
|
14747
15187
|
if (!isOpen) {
|
|
14748
|
-
|
|
14749
|
-
fullscreen: false,
|
|
14750
|
-
|
|
14751
|
-
|
|
14752
|
-
};
|
|
15188
|
+
if (hostOwnsLauncher2) {
|
|
15189
|
+
return { fullscreen: false, height: 0, width: 0 };
|
|
15190
|
+
}
|
|
15191
|
+
const closed = closedFrameSizePx(scale2);
|
|
15192
|
+
return { fullscreen: false, height: closed, width: closed };
|
|
14753
15193
|
}
|
|
14754
|
-
const fullscreen =
|
|
15194
|
+
const fullscreen = isMobile;
|
|
14755
15195
|
const panel = clampPanelDimensions(resolveSizingViewport(), fullscreen);
|
|
14756
15196
|
if (fullscreen) {
|
|
14757
15197
|
return { fullscreen: true, height: panel.height, width: panel.width };
|
|
14758
15198
|
}
|
|
15199
|
+
if (hostOwnsLauncher2) {
|
|
15200
|
+
return {
|
|
15201
|
+
fullscreen: false,
|
|
15202
|
+
height: panel.height,
|
|
15203
|
+
width: panel.width
|
|
15204
|
+
};
|
|
15205
|
+
}
|
|
14759
15206
|
return {
|
|
14760
15207
|
fullscreen: false,
|
|
14761
|
-
height: ROOT_PADDING_PX + panel.height + ROOT_STACK_GAP_PX +
|
|
15208
|
+
height: ROOT_PADDING_PX + panel.height + ROOT_STACK_GAP_PX + launcherButtonPx(scale2) + ROOT_PADDING_PX,
|
|
14762
15209
|
width: panel.width + ROOT_HORIZONTAL_PADDING_PX
|
|
14763
15210
|
};
|
|
14764
15211
|
}
|
|
@@ -14768,10 +15215,10 @@ function useWidgetFrameSizing({
|
|
|
14768
15215
|
isOpen,
|
|
14769
15216
|
rootElRef
|
|
14770
15217
|
}) {
|
|
14771
|
-
const isOpenRef =
|
|
15218
|
+
const isOpenRef = useRef11(isOpen);
|
|
14772
15219
|
isOpenRef.current = isOpen;
|
|
14773
|
-
const syncFrameRef =
|
|
14774
|
-
const [isMobile, setIsMobile] =
|
|
15220
|
+
const syncFrameRef = useRef11(null);
|
|
15221
|
+
const [isMobile, setIsMobile] = useState7(false);
|
|
14775
15222
|
useLayoutEffect2(() => {
|
|
14776
15223
|
const rootEl = rootElRef.current;
|
|
14777
15224
|
if (!rootEl) {
|
|
@@ -14779,7 +15226,7 @@ function useWidgetFrameSizing({
|
|
|
14779
15226
|
}
|
|
14780
15227
|
const syncPanelVars = () => {
|
|
14781
15228
|
const sizingViewport = resolveSizingViewport();
|
|
14782
|
-
const mobile =
|
|
15229
|
+
const { isMobile: mobile, scale: scale2 } = widgetScale();
|
|
14783
15230
|
setIsMobile(mobile);
|
|
14784
15231
|
const panel = clampPanelDimensions(sizingViewport, mobile);
|
|
14785
15232
|
rootEl.style.setProperty("--scw-panel-width", `${panel.width}px`);
|
|
@@ -14788,8 +15235,19 @@ function useWidgetFrameSizing({
|
|
|
14788
15235
|
"--scw-host-viewport-width",
|
|
14789
15236
|
`${sizingViewport.width}px`
|
|
14790
15237
|
);
|
|
15238
|
+
rootEl.style.setProperty(
|
|
15239
|
+
"--scw-launcher-size",
|
|
15240
|
+
`${launcherButtonPx(scale2)}px`
|
|
15241
|
+
);
|
|
15242
|
+
rootEl.style.setProperty(
|
|
15243
|
+
"--scw-launcher-icon-size",
|
|
15244
|
+
`${scaledPx(LAUNCHER_ICON_BASE_PX, scale2)}px`
|
|
15245
|
+
);
|
|
14791
15246
|
};
|
|
14792
15247
|
const syncFrameSize = () => {
|
|
15248
|
+
if (isDashboardPreview()) {
|
|
15249
|
+
return;
|
|
15250
|
+
}
|
|
14793
15251
|
const computed = computeFrameDimensions(isOpenRef.current);
|
|
14794
15252
|
if (isCrossOriginEmbed()) {
|
|
14795
15253
|
postResize(
|
|
@@ -14797,6 +15255,7 @@ function useWidgetFrameSizing({
|
|
|
14797
15255
|
Math.ceil(computed.height),
|
|
14798
15256
|
computed.fullscreen
|
|
14799
15257
|
);
|
|
15258
|
+
postOpenState(isOpenRef.current, computed.fullscreen);
|
|
14800
15259
|
return;
|
|
14801
15260
|
}
|
|
14802
15261
|
const rect = rootEl.getBoundingClientRect();
|
|
@@ -14906,9 +15365,20 @@ function resolveActiveTransition(reduceMotion, viewTransition) {
|
|
|
14906
15365
|
}
|
|
14907
15366
|
return viewTransition;
|
|
14908
15367
|
}
|
|
15368
|
+
function shouldShowWaitingForTeammate({
|
|
15369
|
+
agentMuted,
|
|
15370
|
+
conversationState,
|
|
15371
|
+
isTyping,
|
|
15372
|
+
messages
|
|
15373
|
+
}) {
|
|
15374
|
+
if (!agentMuted || isTyping || conversationState === "closed") {
|
|
15375
|
+
return false;
|
|
15376
|
+
}
|
|
15377
|
+
return messages.at(-1)?.role === "user";
|
|
15378
|
+
}
|
|
14909
15379
|
|
|
14910
15380
|
// src/lib/support/WidgetLauncher.tsx
|
|
14911
|
-
import { useCallback as
|
|
15381
|
+
import { useCallback as useCallback7, useRef as useRef12 } from "react";
|
|
14912
15382
|
|
|
14913
15383
|
// src/lib/support/LauncherIcon.tsx
|
|
14914
15384
|
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
@@ -14919,7 +15389,7 @@ function LauncherIcon({
|
|
|
14919
15389
|
const transition = reduceMotion ? { duration: 0 } : LAUNCHER_ICON_TRANSITION;
|
|
14920
15390
|
const exitRotate = isOpen ? -LAUNCHER_ICON_ROTATE_DEG : LAUNCHER_ICON_ROTATE_DEG;
|
|
14921
15391
|
const enterRotate = isOpen ? LAUNCHER_ICON_ROTATE_DEG : -LAUNCHER_ICON_ROTATE_DEG;
|
|
14922
|
-
return /* @__PURE__ */ jsx10("span", { className: "relative flex size-[25px] shrink-0 items-center justify-center overflow-visible [&_svg]:block [&_svg]:shrink-0", children: /* @__PURE__ */ jsx10(AnimatePresence, { initial: false, children: /* @__PURE__ */ jsx10(
|
|
15392
|
+
return /* @__PURE__ */ jsx10("span", { className: "relative flex size-[var(--scw-launcher-icon-size,25px)] shrink-0 items-center justify-center overflow-visible [&_svg]:block [&_svg]:size-full [&_svg]:shrink-0", children: /* @__PURE__ */ jsx10(AnimatePresence, { initial: false, children: /* @__PURE__ */ jsx10(
|
|
14923
15393
|
motion.span,
|
|
14924
15394
|
{
|
|
14925
15395
|
animate: { opacity: 1, rotate: 0, scale: 1 },
|
|
@@ -14942,13 +15412,14 @@ function WidgetLauncher({
|
|
|
14942
15412
|
onClose
|
|
14943
15413
|
}) {
|
|
14944
15414
|
const isEmbedded = isCrossOriginEmbed();
|
|
14945
|
-
const
|
|
15415
|
+
const hostOwnsLauncher2 = getHostOwnsLauncher();
|
|
15416
|
+
const launcherPointerRef = useRef12({ hovered: false, pressed: false });
|
|
14946
15417
|
const launcherButtonTransition = reduceMotion ? { duration: 0 } : LAUNCHER_BUTTON_TRANSITION;
|
|
14947
|
-
const syncLauncherState =
|
|
15418
|
+
const syncLauncherState = useCallback7(
|
|
14948
15419
|
(next) => {
|
|
14949
15420
|
const state = { ...launcherPointerRef.current, ...next };
|
|
14950
15421
|
launcherPointerRef.current = state;
|
|
14951
|
-
if (!isEmbedded) {
|
|
15422
|
+
if (!isEmbedded || hostOwnsLauncher2) {
|
|
14952
15423
|
return;
|
|
14953
15424
|
}
|
|
14954
15425
|
postLauncherState(
|
|
@@ -14956,18 +15427,21 @@ function WidgetLauncher({
|
|
|
14956
15427
|
state.hovered
|
|
14957
15428
|
);
|
|
14958
15429
|
},
|
|
14959
|
-
[isEmbedded, reduceMotion]
|
|
15430
|
+
[hostOwnsLauncher2, isEmbedded, reduceMotion]
|
|
14960
15431
|
);
|
|
14961
15432
|
return /* @__PURE__ */ jsx11(
|
|
14962
15433
|
motion.button,
|
|
14963
15434
|
{
|
|
14964
15435
|
"aria-label": isOpen ? "Close chat" : "Open chat",
|
|
14965
15436
|
className: cn(
|
|
14966
|
-
|
|
14967
|
-
|
|
15437
|
+
// Sized from the host viewport (see useWidgetFrameSizing) so the bubble
|
|
15438
|
+
// keeps its footing on a wide phone — and stays exactly as tall as the
|
|
15439
|
+
// social-proof toast that anchors beside it.
|
|
15440
|
+
"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]",
|
|
15441
|
+
isEmbedded ? "shadow-[inset_0_0_0_1px_var(--scw-hairline)]" : "shadow-[0_0_0_1px_var(--scw-hairline),0_4px_12px_-2px_rgba(0,0,0,.12),0_2px_4px_-2px_rgba(0,0,0,.08)]",
|
|
14968
15442
|
"transition-[background-color,box-shadow] duration-[280ms] ease-[cubic-bezier(.32,.72,0,1)]",
|
|
14969
15443
|
!reduceMotion && "hover:bg-neutral-100",
|
|
14970
|
-
!reduceMotion && (isEmbedded ? "hover:shadow-[
|
|
15444
|
+
!reduceMotion && (isEmbedded ? "hover:shadow-[inset_0_0_0_1px_var(--scw-hairline-strong)]" : "hover:shadow-[0_0_0_1px_var(--scw-hairline-strong),0_4px_12px_-2px_rgba(0,0,0,.14),0_2px_4px_-2px_rgba(0,0,0,.1)]")
|
|
14971
15445
|
),
|
|
14972
15446
|
onClick: isOpen ? onClose : onOpen,
|
|
14973
15447
|
onHoverEnd: () => syncLauncherState({ hovered: false }),
|
|
@@ -15004,7 +15478,7 @@ function Avatar({
|
|
|
15004
15478
|
large
|
|
15005
15479
|
}) {
|
|
15006
15480
|
const base = cn(
|
|
15007
|
-
"inline-flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-full bg-neutral-900 text-sm font-semibold text-white shadow-[
|
|
15481
|
+
"inline-flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-full bg-neutral-900 text-sm font-semibold text-white shadow-[0_0_0_1px_var(--scw-ink)]",
|
|
15008
15482
|
large && "size-12 text-lg",
|
|
15009
15483
|
"[&_img]:block [&_img]:size-full [&_img]:scale-[1.08] [&_img]:object-cover"
|
|
15010
15484
|
);
|
|
@@ -15026,9 +15500,124 @@ function Avatar({
|
|
|
15026
15500
|
}
|
|
15027
15501
|
|
|
15028
15502
|
// src/lib/support/CompactTime.tsx
|
|
15029
|
-
import { useEffect as
|
|
15503
|
+
import { useEffect as useEffect11, useState as useState9 } from "react";
|
|
15504
|
+
|
|
15505
|
+
// ../../support/shared/src/lib/message/splitLightMarkdownBlocks.ts
|
|
15506
|
+
var DELIMITER_CELL_PATTERN = /^:?-+:?$/u;
|
|
15507
|
+
function splitLightMarkdownBlocks(text) {
|
|
15508
|
+
if (!text.includes("|")) {
|
|
15509
|
+
return text ? [{ type: "text", text }] : [];
|
|
15510
|
+
}
|
|
15511
|
+
const lines = text.split(/\r?\n/u);
|
|
15512
|
+
const blocks = [];
|
|
15513
|
+
const pending = [];
|
|
15514
|
+
let index2 = 0;
|
|
15515
|
+
while (index2 < lines.length) {
|
|
15516
|
+
const parsed = readTableAt(lines, index2);
|
|
15517
|
+
if (!parsed) {
|
|
15518
|
+
pending.push(lines[index2] ?? "");
|
|
15519
|
+
index2 += 1;
|
|
15520
|
+
continue;
|
|
15521
|
+
}
|
|
15522
|
+
flushPendingText(blocks, pending);
|
|
15523
|
+
blocks.push({ type: "table", table: parsed.table });
|
|
15524
|
+
index2 = parsed.end;
|
|
15525
|
+
}
|
|
15526
|
+
flushPendingText(blocks, pending);
|
|
15527
|
+
return blocks;
|
|
15528
|
+
}
|
|
15529
|
+
function flushPendingText(blocks, pending) {
|
|
15530
|
+
if (pending.length === 0) {
|
|
15531
|
+
return;
|
|
15532
|
+
}
|
|
15533
|
+
blocks.push({ type: "text", text: pending.join("\n") });
|
|
15534
|
+
pending.length = 0;
|
|
15535
|
+
}
|
|
15536
|
+
function readTableAt(lines, start) {
|
|
15537
|
+
const headers = splitTableCells(lines[start] ?? "");
|
|
15538
|
+
const delimiter = splitTableCells(lines[start + 1] ?? "");
|
|
15539
|
+
if (!headers || !delimiter || headers.length === 0 || delimiter.length !== headers.length || !delimiter.every(isDelimiterCell)) {
|
|
15540
|
+
return null;
|
|
15541
|
+
}
|
|
15542
|
+
const rows = [];
|
|
15543
|
+
let end = start + 2;
|
|
15544
|
+
while (end < lines.length) {
|
|
15545
|
+
const row = splitTableCells(lines[end] ?? "");
|
|
15546
|
+
if (!row) {
|
|
15547
|
+
break;
|
|
15548
|
+
}
|
|
15549
|
+
rows.push(fitRow(row, headers.length));
|
|
15550
|
+
end += 1;
|
|
15551
|
+
}
|
|
15552
|
+
return {
|
|
15553
|
+
end,
|
|
15554
|
+
table: {
|
|
15555
|
+
aligns: delimiter.map(alignFromDelimiterCell),
|
|
15556
|
+
headers: fitRow(headers, headers.length),
|
|
15557
|
+
rows
|
|
15558
|
+
}
|
|
15559
|
+
};
|
|
15560
|
+
}
|
|
15561
|
+
function splitTableCells(line) {
|
|
15562
|
+
if (!line.includes("|")) {
|
|
15563
|
+
return null;
|
|
15564
|
+
}
|
|
15565
|
+
const cells = [];
|
|
15566
|
+
let current = "";
|
|
15567
|
+
const trimmed = trimOuterPipes(line.trim());
|
|
15568
|
+
for (let index2 = 0; index2 < trimmed.length; index2 += 1) {
|
|
15569
|
+
const char = trimmed[index2];
|
|
15570
|
+
if (char === "\\" && trimmed[index2 + 1] === "|") {
|
|
15571
|
+
current += "|";
|
|
15572
|
+
index2 += 1;
|
|
15573
|
+
continue;
|
|
15574
|
+
}
|
|
15575
|
+
if (char === "|") {
|
|
15576
|
+
cells.push(current.trim());
|
|
15577
|
+
current = "";
|
|
15578
|
+
continue;
|
|
15579
|
+
}
|
|
15580
|
+
current += char;
|
|
15581
|
+
}
|
|
15582
|
+
cells.push(current.trim());
|
|
15583
|
+
return cells;
|
|
15584
|
+
}
|
|
15585
|
+
function trimOuterPipes(line) {
|
|
15586
|
+
let start = 0;
|
|
15587
|
+
let end = line.length;
|
|
15588
|
+
if (line.startsWith("|")) {
|
|
15589
|
+
start = 1;
|
|
15590
|
+
}
|
|
15591
|
+
if (line.endsWith("|") && !line.endsWith("\\|")) {
|
|
15592
|
+
end -= 1;
|
|
15593
|
+
}
|
|
15594
|
+
return line.slice(start, end);
|
|
15595
|
+
}
|
|
15596
|
+
function isDelimiterCell(cell) {
|
|
15597
|
+
const compact = cell.replaceAll(" ", "");
|
|
15598
|
+
return DELIMITER_CELL_PATTERN.test(compact) && compact.includes("-");
|
|
15599
|
+
}
|
|
15600
|
+
function alignFromDelimiterCell(cell) {
|
|
15601
|
+
const compact = cell.replaceAll(" ", "");
|
|
15602
|
+
const left = compact.startsWith(":");
|
|
15603
|
+
const right = compact.endsWith(":");
|
|
15604
|
+
if (left && right) {
|
|
15605
|
+
return "center";
|
|
15606
|
+
}
|
|
15607
|
+
if (right) {
|
|
15608
|
+
return "right";
|
|
15609
|
+
}
|
|
15610
|
+
return "left";
|
|
15611
|
+
}
|
|
15612
|
+
function fitRow(cells, columnCount) {
|
|
15613
|
+
const row = cells.slice(0, columnCount);
|
|
15614
|
+
while (row.length < columnCount) {
|
|
15615
|
+
row.push("");
|
|
15616
|
+
}
|
|
15617
|
+
return row;
|
|
15618
|
+
}
|
|
15030
15619
|
|
|
15031
|
-
// ../../support/shared/src/lib/formatBotMessageContentForInbox.ts
|
|
15620
|
+
// ../../support/shared/src/lib/message/formatBotMessageContentForInbox.ts
|
|
15032
15621
|
var ATX_HEADING_PATTERN = /^#{1,6}[ \t]+(.+)$/gmu;
|
|
15033
15622
|
function normalizeMarkdownHeadings(text) {
|
|
15034
15623
|
return text.replace(ATX_HEADING_PATTERN, (_match, content) => {
|
|
@@ -15047,7 +15636,7 @@ function normalizeMarkdownHeadings(text) {
|
|
|
15047
15636
|
import { getToolName as getToolName3, isToolUIPart as isToolUIPart3 } from "ai";
|
|
15048
15637
|
|
|
15049
15638
|
// src/lib/support/KbCitationBadge.tsx
|
|
15050
|
-
import { useCallback as
|
|
15639
|
+
import { useCallback as useCallback8, useEffect as useEffect10, useRef as useRef13, useState as useState8 } from "react";
|
|
15051
15640
|
|
|
15052
15641
|
// src/lib/support/hostname.ts
|
|
15053
15642
|
function readHostnameFromHref(href) {
|
|
@@ -15069,20 +15658,20 @@ function KbCitationBadge({
|
|
|
15069
15658
|
number: number2
|
|
15070
15659
|
}) {
|
|
15071
15660
|
const hostname = readHostnameFromHref(article.url);
|
|
15072
|
-
const [open, setOpen] =
|
|
15073
|
-
const closeTimeoutRef =
|
|
15074
|
-
const rootRef =
|
|
15075
|
-
const popoverRef =
|
|
15661
|
+
const [open, setOpen] = useState8(false);
|
|
15662
|
+
const closeTimeoutRef = useRef13(null);
|
|
15663
|
+
const rootRef = useRef13(null);
|
|
15664
|
+
const popoverRef = useRef13(null);
|
|
15076
15665
|
function clearCloseTimeout() {
|
|
15077
15666
|
if (closeTimeoutRef.current) {
|
|
15078
15667
|
clearTimeout(closeTimeoutRef.current);
|
|
15079
15668
|
closeTimeoutRef.current = null;
|
|
15080
15669
|
}
|
|
15081
15670
|
}
|
|
15082
|
-
const resetPopoverShift =
|
|
15671
|
+
const resetPopoverShift = useCallback8(() => {
|
|
15083
15672
|
popoverRef.current?.style.removeProperty("--scw-citation-popover-shift");
|
|
15084
15673
|
}, []);
|
|
15085
|
-
const alignPopover =
|
|
15674
|
+
const alignPopover = useCallback8(() => {
|
|
15086
15675
|
const root = rootRef.current;
|
|
15087
15676
|
const popover = popoverRef.current;
|
|
15088
15677
|
if (!root || !popover) {
|
|
@@ -15110,13 +15699,13 @@ function KbCitationBadge({
|
|
|
15110
15699
|
shift === 0 ? "0px" : `${shift}px`
|
|
15111
15700
|
);
|
|
15112
15701
|
}, [resetPopoverShift]);
|
|
15113
|
-
const attachPopoverListeners =
|
|
15702
|
+
const attachPopoverListeners = useCallback8(() => {
|
|
15114
15703
|
alignPopover();
|
|
15115
15704
|
const scroller = rootRef.current?.closest(".scw-messages");
|
|
15116
15705
|
scroller?.addEventListener("scroll", alignPopover, { passive: true });
|
|
15117
15706
|
window.addEventListener("resize", alignPopover, { passive: true });
|
|
15118
15707
|
}, [alignPopover]);
|
|
15119
|
-
const detachPopoverListeners =
|
|
15708
|
+
const detachPopoverListeners = useCallback8(() => {
|
|
15120
15709
|
const scroller = rootRef.current?.closest(".scw-messages");
|
|
15121
15710
|
scroller?.removeEventListener("scroll", alignPopover);
|
|
15122
15711
|
window.removeEventListener("resize", alignPopover);
|
|
@@ -15133,7 +15722,7 @@ function KbCitationBadge({
|
|
|
15133
15722
|
closeTimeoutRef.current = null;
|
|
15134
15723
|
}, 80);
|
|
15135
15724
|
}
|
|
15136
|
-
|
|
15725
|
+
useEffect10(() => {
|
|
15137
15726
|
if (!open) {
|
|
15138
15727
|
detachPopoverListeners();
|
|
15139
15728
|
return;
|
|
@@ -15141,7 +15730,7 @@ function KbCitationBadge({
|
|
|
15141
15730
|
attachPopoverListeners();
|
|
15142
15731
|
return detachPopoverListeners;
|
|
15143
15732
|
}, [open, attachPopoverListeners, detachPopoverListeners]);
|
|
15144
|
-
|
|
15733
|
+
useEffect10(
|
|
15145
15734
|
() => () => {
|
|
15146
15735
|
clearCloseTimeout();
|
|
15147
15736
|
detachPopoverListeners();
|
|
@@ -15221,7 +15810,7 @@ function KbCitationBadge({
|
|
|
15221
15810
|
}
|
|
15222
15811
|
|
|
15223
15812
|
// src/lib/support/message-render.tsx
|
|
15224
|
-
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
15813
|
+
import { jsx as jsx14, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
15225
15814
|
function formatCompactTime(timestamp, now2 = Date.now()) {
|
|
15226
15815
|
const diffMs = Math.max(0, now2 - timestamp);
|
|
15227
15816
|
const minuteMs = 6e4;
|
|
@@ -15334,17 +15923,86 @@ function renderMessageText(text, kbArticles, isStreaming = false) {
|
|
|
15334
15923
|
);
|
|
15335
15924
|
const { body, pendingLinkLabel } = isStreaming ? splitStreamingTail(normalizedText) : { body: normalizedText, pendingLinkLabel: null };
|
|
15336
15925
|
const citationNumbers = buildKbCitationNumberMap(body);
|
|
15926
|
+
const nodes = [];
|
|
15927
|
+
for (const [blockIndex, block] of splitLightMarkdownBlocks(body).entries()) {
|
|
15928
|
+
if (block.type === "table") {
|
|
15929
|
+
nodes.push(
|
|
15930
|
+
renderMessageTable(
|
|
15931
|
+
block.table,
|
|
15932
|
+
kbArticles,
|
|
15933
|
+
citationNumbers,
|
|
15934
|
+
`tbl-${blockIndex}`
|
|
15935
|
+
)
|
|
15936
|
+
);
|
|
15937
|
+
continue;
|
|
15938
|
+
}
|
|
15939
|
+
nodes.push(
|
|
15940
|
+
...renderInlineMessageText(
|
|
15941
|
+
block.text,
|
|
15942
|
+
kbArticles,
|
|
15943
|
+
citationNumbers,
|
|
15944
|
+
`b-${blockIndex}`
|
|
15945
|
+
)
|
|
15946
|
+
);
|
|
15947
|
+
}
|
|
15948
|
+
if (pendingLinkLabel) {
|
|
15949
|
+
nodes.push(
|
|
15950
|
+
/* @__PURE__ */ jsx14("span", { className: LINK_CLASS_NAME, children: renderPlainTextWithBold(pendingLinkLabel, "lnk-pending") }, "lnk-pending")
|
|
15951
|
+
);
|
|
15952
|
+
}
|
|
15953
|
+
return nodes.length > 0 ? nodes : renderPlainTextWithBold(body, "full");
|
|
15954
|
+
}
|
|
15955
|
+
function renderMessageTable(table, kbArticles, citationNumbers, keyPrefix) {
|
|
15956
|
+
return /* @__PURE__ */ jsx14(
|
|
15957
|
+
"div",
|
|
15958
|
+
{
|
|
15959
|
+
className: "my-2 max-w-full overflow-x-auto whitespace-normal",
|
|
15960
|
+
children: /* @__PURE__ */ jsxs5("table", { className: "w-full border-collapse text-[13px] leading-[1.35]", children: [
|
|
15961
|
+
/* @__PURE__ */ jsx14("thead", { children: /* @__PURE__ */ jsx14("tr", { children: table.headers.map((cell, index2) => /* @__PURE__ */ jsx14(
|
|
15962
|
+
"th",
|
|
15963
|
+
{
|
|
15964
|
+
className: "border border-border bg-neutral-50 px-2 py-1.5 font-semibold",
|
|
15965
|
+
style: { textAlign: table.aligns[index2] ?? "left" },
|
|
15966
|
+
children: renderInlineMessageText(
|
|
15967
|
+
cell,
|
|
15968
|
+
kbArticles,
|
|
15969
|
+
citationNumbers,
|
|
15970
|
+
`${keyPrefix}-h-${index2}`
|
|
15971
|
+
)
|
|
15972
|
+
},
|
|
15973
|
+
`${keyPrefix}-h-${index2}`
|
|
15974
|
+
)) }) }),
|
|
15975
|
+
/* @__PURE__ */ jsx14("tbody", { children: table.rows.map((row, rowIndex) => /* @__PURE__ */ jsx14("tr", { children: row.map((cell, cellIndex) => /* @__PURE__ */ jsx14(
|
|
15976
|
+
"td",
|
|
15977
|
+
{
|
|
15978
|
+
className: "border border-border px-2 py-1.5 align-top",
|
|
15979
|
+
style: { textAlign: table.aligns[cellIndex] ?? "left" },
|
|
15980
|
+
children: renderInlineMessageText(
|
|
15981
|
+
cell,
|
|
15982
|
+
kbArticles,
|
|
15983
|
+
citationNumbers,
|
|
15984
|
+
`${keyPrefix}-r-${rowIndex}-c-${cellIndex}`
|
|
15985
|
+
)
|
|
15986
|
+
},
|
|
15987
|
+
`${keyPrefix}-r-${rowIndex}-c-${cellIndex}`
|
|
15988
|
+
)) }, `${keyPrefix}-r-${rowIndex}`)) })
|
|
15989
|
+
] })
|
|
15990
|
+
},
|
|
15991
|
+
keyPrefix
|
|
15992
|
+
);
|
|
15993
|
+
}
|
|
15994
|
+
function renderInlineMessageText(text, kbArticles, citationNumbers, keyPrefix) {
|
|
15337
15995
|
const nodes = [];
|
|
15338
15996
|
let lastIndex = 0;
|
|
15339
15997
|
let tokenIndex = 0;
|
|
15340
15998
|
MESSAGE_CONTENT_PATTERN.lastIndex = 0;
|
|
15341
|
-
let match = MESSAGE_CONTENT_PATTERN.exec(
|
|
15999
|
+
let match = MESSAGE_CONTENT_PATTERN.exec(text);
|
|
15342
16000
|
while (match !== null) {
|
|
15343
16001
|
if (match.index > lastIndex) {
|
|
15344
16002
|
nodes.push(
|
|
15345
16003
|
renderPlainTextWithBold(
|
|
15346
|
-
|
|
15347
|
-
|
|
16004
|
+
text.slice(lastIndex, match.index),
|
|
16005
|
+
`${keyPrefix}-t-${tokenIndex}`
|
|
15348
16006
|
)
|
|
15349
16007
|
);
|
|
15350
16008
|
}
|
|
@@ -15361,7 +16019,7 @@ function renderMessageText(text, kbArticles, isStreaming = false) {
|
|
|
15361
16019
|
article,
|
|
15362
16020
|
number: number2
|
|
15363
16021
|
},
|
|
15364
|
-
|
|
16022
|
+
`${keyPrefix}-cite-${tokenIndex}`
|
|
15365
16023
|
)
|
|
15366
16024
|
);
|
|
15367
16025
|
}
|
|
@@ -15387,7 +16045,7 @@ function renderMessageText(text, kbArticles, isStreaming = false) {
|
|
|
15387
16045
|
target: "_blank",
|
|
15388
16046
|
children: label
|
|
15389
16047
|
},
|
|
15390
|
-
|
|
16048
|
+
`${keyPrefix}-lnk-${tokenIndex}`
|
|
15391
16049
|
)
|
|
15392
16050
|
);
|
|
15393
16051
|
if (trailing) {
|
|
@@ -15396,22 +16054,20 @@ function renderMessageText(text, kbArticles, isStreaming = false) {
|
|
|
15396
16054
|
}
|
|
15397
16055
|
tokenIndex += 1;
|
|
15398
16056
|
lastIndex = match.index + full.length;
|
|
15399
|
-
match = MESSAGE_CONTENT_PATTERN.exec(
|
|
15400
|
-
}
|
|
15401
|
-
if (lastIndex < body.length) {
|
|
15402
|
-
nodes.push(
|
|
15403
|
-
renderPlainTextWithBold(body.slice(lastIndex), `tail-${tokenIndex}`)
|
|
15404
|
-
);
|
|
16057
|
+
match = MESSAGE_CONTENT_PATTERN.exec(text);
|
|
15405
16058
|
}
|
|
15406
|
-
if (
|
|
16059
|
+
if (lastIndex < text.length) {
|
|
15407
16060
|
nodes.push(
|
|
15408
|
-
|
|
16061
|
+
renderPlainTextWithBold(
|
|
16062
|
+
text.slice(lastIndex),
|
|
16063
|
+
`${keyPrefix}-tail-${tokenIndex}`
|
|
16064
|
+
)
|
|
15409
16065
|
);
|
|
15410
16066
|
}
|
|
15411
|
-
return nodes
|
|
16067
|
+
return nodes;
|
|
15412
16068
|
}
|
|
15413
16069
|
function collectKbArticleFromToolEntry(entry, articles) {
|
|
15414
|
-
if (!
|
|
16070
|
+
if (!isRecord(entry)) {
|
|
15415
16071
|
return;
|
|
15416
16072
|
}
|
|
15417
16073
|
if (entry.type === "internal") {
|
|
@@ -15443,9 +16099,9 @@ function resolveKbArticlesFromMessages(messages) {
|
|
|
15443
16099
|
const articles = /* @__PURE__ */ new Map();
|
|
15444
16100
|
for (const message of messages) {
|
|
15445
16101
|
const { metadata } = message;
|
|
15446
|
-
if (
|
|
16102
|
+
if (isRecord(metadata) && Array.isArray(metadata.kbCitations)) {
|
|
15447
16103
|
for (const entry of metadata.kbCitations) {
|
|
15448
|
-
if (!
|
|
16104
|
+
if (!isRecord(entry)) {
|
|
15449
16105
|
continue;
|
|
15450
16106
|
}
|
|
15451
16107
|
const id3 = typeof entry.id === "string" ? entry.id : null;
|
|
@@ -15485,8 +16141,8 @@ function CompactTime({
|
|
|
15485
16141
|
timestamp
|
|
15486
16142
|
}) {
|
|
15487
16143
|
const createdAt = resolveStableCreatedAt(messageId, timestamp);
|
|
15488
|
-
const [now2, setNow] =
|
|
15489
|
-
|
|
16144
|
+
const [now2, setNow] = useState9(() => Date.now());
|
|
16145
|
+
useEffect11(() => {
|
|
15490
16146
|
const tick = () => setNow(Date.now());
|
|
15491
16147
|
const interval = setInterval(tick, TICK_MS);
|
|
15492
16148
|
return () => clearInterval(interval);
|
|
@@ -15494,35 +16150,62 @@ function CompactTime({
|
|
|
15494
16150
|
return /* @__PURE__ */ jsx15(Fragment4, { children: formatCompactTime(createdAt, now2) });
|
|
15495
16151
|
}
|
|
15496
16152
|
|
|
16153
|
+
// src/lib/support/Suggestions.tsx
|
|
16154
|
+
import { jsx as jsx16, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
16155
|
+
function Suggestions({
|
|
16156
|
+
onPick,
|
|
16157
|
+
suggestions
|
|
16158
|
+
}) {
|
|
16159
|
+
return /* @__PURE__ */ jsx16("div", { className: "flex w-full min-w-0 flex-col gap-2", children: suggestions.map((suggestion) => /* @__PURE__ */ jsxs6(
|
|
16160
|
+
"button",
|
|
16161
|
+
{
|
|
16162
|
+
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",
|
|
16163
|
+
onClick: () => onPick(suggestion.prompt),
|
|
16164
|
+
type: "button",
|
|
16165
|
+
children: [
|
|
16166
|
+
/* @__PURE__ */ jsx16("span", { className: "scw-suggestion-icon shrink-0 rounded-lg bg-neutral-100 text-neutral-700", children: /* @__PURE__ */ jsx16(SparklesIcon, {}) }),
|
|
16167
|
+
/* @__PURE__ */ jsxs6("span", { className: "scw-suggestion-copy", children: [
|
|
16168
|
+
/* @__PURE__ */ jsx16("span", { className: "scw-suggestion-label text-sm leading-5 font-medium text-neutral-950", children: suggestion.label }),
|
|
16169
|
+
suggestion.description && /* @__PURE__ */ jsx16("span", { className: "scw-suggestion-label mt-0.5 line-clamp-2 overflow-hidden text-xs text-neutral-500", children: suggestion.description })
|
|
16170
|
+
] })
|
|
16171
|
+
]
|
|
16172
|
+
},
|
|
16173
|
+
suggestion.label
|
|
16174
|
+
)) });
|
|
16175
|
+
}
|
|
16176
|
+
|
|
15497
16177
|
// src/lib/support/HomeView.tsx
|
|
15498
|
-
import { jsx as
|
|
16178
|
+
import { jsx as jsx17, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
15499
16179
|
var SEND_PILL = "inline-flex items-center justify-center gap-2 self-center whitespace-nowrap rounded-[10px] border-none bg-neutral-900 px-[18px] py-[11px] text-sm font-semibold text-white shadow-[0_6px_16px_rgba(0,0,0,.18)] transition-colors duration-150 hover:bg-neutral-800";
|
|
15500
16180
|
function HomeView({
|
|
15501
16181
|
branding,
|
|
15502
16182
|
conversations,
|
|
16183
|
+
onPick,
|
|
15503
16184
|
onResume,
|
|
15504
|
-
onStartNew
|
|
16185
|
+
onStartNew,
|
|
16186
|
+
suggestions
|
|
15505
16187
|
}) {
|
|
15506
16188
|
const [recent] = conversations;
|
|
15507
|
-
return /* @__PURE__ */
|
|
15508
|
-
/* @__PURE__ */
|
|
15509
|
-
/* @__PURE__ */
|
|
15510
|
-
/* @__PURE__ */
|
|
15511
|
-
/* @__PURE__ */
|
|
16189
|
+
return /* @__PURE__ */ jsxs7("div", { className: "scw-thin-scroll flex min-w-0 max-w-full flex-1 flex-col gap-4 overflow-x-hidden overflow-y-auto overscroll-contain bg-white px-4 pt-6 pb-[calc(24px+var(--scw-nav-height))]", children: [
|
|
16190
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex flex-col items-center gap-2 px-0 pt-2 pb-1 text-center", children: [
|
|
16191
|
+
/* @__PURE__ */ jsx17(Avatar, { branding, large: true }),
|
|
16192
|
+
/* @__PURE__ */ jsx17("div", { className: "text-lg font-semibold text-neutral-950", children: branding.greeting }),
|
|
16193
|
+
/* @__PURE__ */ jsx17("div", { className: "text-[13px] text-neutral-500", children: branding.teamDescription })
|
|
15512
16194
|
] }),
|
|
15513
|
-
|
|
16195
|
+
suggestions.length > 0 && /* @__PURE__ */ jsx17(Suggestions, { onPick, suggestions }),
|
|
16196
|
+
recent && /* @__PURE__ */ jsxs7(
|
|
15514
16197
|
"button",
|
|
15515
16198
|
{
|
|
15516
|
-
className: "flex w-full cursor-pointer items-center gap-3 rounded-[14px] border border-solid border-
|
|
16199
|
+
className: "flex w-full cursor-pointer items-center gap-3 rounded-[14px] border border-solid border-border bg-white p-3 text-left font-[inherit] shadow-[0_2px_8px_rgba(0,0,0,.06)] transition-colors duration-150 hover:bg-neutral-50",
|
|
15517
16200
|
onClick: () => onResume(recent),
|
|
15518
16201
|
type: "button",
|
|
15519
16202
|
children: [
|
|
15520
|
-
/* @__PURE__ */
|
|
15521
|
-
/* @__PURE__ */
|
|
15522
|
-
/* @__PURE__ */
|
|
15523
|
-
/* @__PURE__ */
|
|
16203
|
+
/* @__PURE__ */ jsx17(Avatar, { branding }),
|
|
16204
|
+
/* @__PURE__ */ jsxs7("div", { className: "min-w-0 flex-1", children: [
|
|
16205
|
+
/* @__PURE__ */ jsx17("div", { className: "text-sm font-semibold text-neutral-950", children: branding.workspaceName }),
|
|
16206
|
+
/* @__PURE__ */ jsx17("div", { className: "overflow-hidden text-[13px] text-ellipsis whitespace-nowrap text-neutral-500", children: renderPreviewText(recent.preview, recent.conversationId) })
|
|
15524
16207
|
] }),
|
|
15525
|
-
/* @__PURE__ */
|
|
16208
|
+
/* @__PURE__ */ jsx17("div", { className: "shrink-0 self-start text-xs text-neutral-400", children: /* @__PURE__ */ jsx17(
|
|
15526
16209
|
CompactTime,
|
|
15527
16210
|
{
|
|
15528
16211
|
messageId: `home-${recent.conversationId}`,
|
|
@@ -15532,54 +16215,47 @@ function HomeView({
|
|
|
15532
16215
|
]
|
|
15533
16216
|
}
|
|
15534
16217
|
),
|
|
15535
|
-
/* @__PURE__ */
|
|
16218
|
+
/* @__PURE__ */ jsxs7("button", { className: SEND_PILL, onClick: onStartNew, type: "button", children: [
|
|
15536
16219
|
"Start a new conversation",
|
|
15537
|
-
/* @__PURE__ */
|
|
16220
|
+
/* @__PURE__ */ jsx17(ArrowRightIcon, {})
|
|
15538
16221
|
] })
|
|
15539
16222
|
] });
|
|
15540
16223
|
}
|
|
15541
16224
|
|
|
15542
16225
|
// src/lib/support/MessagesView.tsx
|
|
15543
|
-
import { jsx as
|
|
16226
|
+
import { jsx as jsx18, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
15544
16227
|
var SEND_PILL2 = "inline-flex items-center justify-center gap-2 self-center whitespace-nowrap rounded-[10px] border-none bg-neutral-900 px-[18px] py-[11px] text-sm font-semibold text-white shadow-[0_6px_16px_rgba(0,0,0,.18)] transition-colors duration-150 hover:bg-neutral-800";
|
|
15545
16228
|
function MessagesView({
|
|
15546
|
-
activeConversationId,
|
|
15547
16229
|
branding,
|
|
15548
16230
|
conversations,
|
|
15549
16231
|
onResume,
|
|
15550
16232
|
onStartNew
|
|
15551
|
-
}) {
|
|
15552
|
-
return /* @__PURE__ */
|
|
15553
|
-
/* @__PURE__ */
|
|
15554
|
-
|
|
15555
|
-
|
|
15556
|
-
"
|
|
15557
|
-
|
|
15558
|
-
|
|
15559
|
-
|
|
15560
|
-
|
|
15561
|
-
|
|
15562
|
-
|
|
15563
|
-
|
|
15564
|
-
|
|
15565
|
-
|
|
15566
|
-
|
|
15567
|
-
|
|
15568
|
-
|
|
15569
|
-
|
|
15570
|
-
|
|
15571
|
-
|
|
15572
|
-
|
|
15573
|
-
|
|
15574
|
-
|
|
15575
|
-
|
|
15576
|
-
|
|
15577
|
-
]
|
|
15578
|
-
},
|
|
15579
|
-
entry.conversationId
|
|
15580
|
-
);
|
|
15581
|
-
}) }) }),
|
|
15582
|
-
/* @__PURE__ */ jsxs6(
|
|
16233
|
+
}) {
|
|
16234
|
+
return /* @__PURE__ */ jsxs8("div", { className: "relative flex min-h-0 flex-1 flex-col overflow-hidden", children: [
|
|
16235
|
+
/* @__PURE__ */ jsx18("div", { className: "scw-thin-scroll min-w-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain px-2 pt-2 pb-[calc(8px+var(--scw-nav-height)+var(--scw-send-pill-gap)+var(--scw-send-pill-height))]", children: conversations.length === 0 ? /* @__PURE__ */ jsx18("p", { className: "my-6 text-center text-sm text-neutral-500", children: "No conversations yet. Start one below." }) : /* @__PURE__ */ jsx18("div", { className: "flex flex-col", children: conversations.map((entry) => /* @__PURE__ */ jsxs8(
|
|
16236
|
+
"button",
|
|
16237
|
+
{
|
|
16238
|
+
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",
|
|
16239
|
+
onClick: () => onResume(entry),
|
|
16240
|
+
type: "button",
|
|
16241
|
+
children: [
|
|
16242
|
+
/* @__PURE__ */ jsx18(Avatar, { branding }),
|
|
16243
|
+
/* @__PURE__ */ jsxs8("div", { className: "min-w-0 flex-1", children: [
|
|
16244
|
+
/* @__PURE__ */ jsx18("div", { className: "text-sm font-semibold text-neutral-950", children: branding.workspaceName }),
|
|
16245
|
+
/* @__PURE__ */ jsx18("div", { className: "overflow-hidden text-[13px] text-ellipsis whitespace-nowrap text-neutral-500", children: renderPreviewText(entry.preview, entry.conversationId) })
|
|
16246
|
+
] }),
|
|
16247
|
+
/* @__PURE__ */ jsx18("div", { className: "shrink-0 self-start text-xs text-neutral-400", children: /* @__PURE__ */ jsx18(
|
|
16248
|
+
CompactTime,
|
|
16249
|
+
{
|
|
16250
|
+
messageId: `list-${entry.conversationId}`,
|
|
16251
|
+
timestamp: entry.updatedAt
|
|
16252
|
+
}
|
|
16253
|
+
) })
|
|
16254
|
+
]
|
|
16255
|
+
},
|
|
16256
|
+
entry.conversationId
|
|
16257
|
+
)) }) }),
|
|
16258
|
+
/* @__PURE__ */ jsxs8(
|
|
15583
16259
|
"button",
|
|
15584
16260
|
{
|
|
15585
16261
|
className: cn(
|
|
@@ -15590,7 +16266,7 @@ function MessagesView({
|
|
|
15590
16266
|
type: "button",
|
|
15591
16267
|
children: [
|
|
15592
16268
|
"Start a new conversation",
|
|
15593
|
-
/* @__PURE__ */
|
|
16269
|
+
/* @__PURE__ */ jsx18(ArrowRightIcon, {})
|
|
15594
16270
|
]
|
|
15595
16271
|
}
|
|
15596
16272
|
)
|
|
@@ -15598,8 +16274,8 @@ function MessagesView({
|
|
|
15598
16274
|
}
|
|
15599
16275
|
|
|
15600
16276
|
// src/lib/support/PanelHeader.tsx
|
|
15601
|
-
import { jsx as
|
|
15602
|
-
var HEADER_BTN = "flex size-[var(--scw-header-btn-size)] shrink-0 items-center justify-center rounded-[var(--scw-header-btn-concentric)] border-none bg-transparent p-0 text-neutral-600 hover:bg-
|
|
16277
|
+
import { jsx as jsx19, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
16278
|
+
var HEADER_BTN = "flex size-[var(--scw-header-btn-size)] shrink-0 items-center justify-center rounded-[var(--scw-header-btn-concentric)] border-none bg-transparent p-0 text-neutral-600 hover:bg-neutral-100 hover:text-neutral-700";
|
|
15603
16279
|
function PanelHeader({
|
|
15604
16280
|
agentMuted: _agentMuted,
|
|
15605
16281
|
branding,
|
|
@@ -15608,66 +16284,69 @@ function PanelHeader({
|
|
|
15608
16284
|
view
|
|
15609
16285
|
}) {
|
|
15610
16286
|
if (view === "chat") {
|
|
15611
|
-
return /* @__PURE__ */
|
|
15612
|
-
/* @__PURE__ */
|
|
15613
|
-
/* @__PURE__ */
|
|
16287
|
+
return /* @__PURE__ */ jsxs9("div", { className: "flex items-start justify-between gap-2 border-b border-border p-[var(--scw-header-padding)]", children: [
|
|
16288
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
16289
|
+
/* @__PURE__ */ jsx19(
|
|
15614
16290
|
"button",
|
|
15615
16291
|
{
|
|
15616
16292
|
"aria-label": "Back",
|
|
15617
16293
|
className: HEADER_BTN,
|
|
15618
16294
|
onClick: onBack,
|
|
15619
16295
|
type: "button",
|
|
15620
|
-
children: /* @__PURE__ */
|
|
16296
|
+
children: /* @__PURE__ */ jsx19(ChevronLeftIcon, {})
|
|
15621
16297
|
}
|
|
15622
16298
|
),
|
|
15623
|
-
/* @__PURE__ */
|
|
15624
|
-
/* @__PURE__ */
|
|
16299
|
+
/* @__PURE__ */ jsx19(Avatar, { branding }),
|
|
16300
|
+
/* @__PURE__ */ jsx19("div", { className: "min-w-0 leading-[1.3]", children: /* @__PURE__ */ jsx19("div", { className: "text-lg font-semibold text-neutral-950", children: branding.workspaceName }) })
|
|
15625
16301
|
] }),
|
|
15626
|
-
/* @__PURE__ */
|
|
15627
|
-
"button",
|
|
15628
|
-
{
|
|
15629
|
-
"aria-label": "Close chat",
|
|
15630
|
-
className: HEADER_BTN,
|
|
15631
|
-
onClick: onClose,
|
|
15632
|
-
type: "button",
|
|
15633
|
-
children: /* @__PURE__ */ jsx18(CloseIcon, {})
|
|
15634
|
-
}
|
|
15635
|
-
)
|
|
16302
|
+
/* @__PURE__ */ jsx19(CloseChatButton, { onClose })
|
|
15636
16303
|
] });
|
|
15637
16304
|
}
|
|
15638
|
-
return /* @__PURE__ */
|
|
16305
|
+
return /* @__PURE__ */ jsxs9(
|
|
15639
16306
|
"div",
|
|
15640
16307
|
{
|
|
15641
16308
|
className: cn(
|
|
15642
|
-
"relative flex min-h-[calc(var(--scw-header-padding)*2+var(--scw-header-btn-size))] items-center justify-center gap-2 border-b border-
|
|
16309
|
+
"relative flex min-h-[calc(var(--scw-header-padding)*2+var(--scw-header-btn-size))] items-center justify-center gap-2 border-b border-border p-[var(--scw-header-padding)]"
|
|
15643
16310
|
),
|
|
15644
16311
|
children: [
|
|
15645
|
-
/* @__PURE__ */
|
|
15646
|
-
/* @__PURE__ */
|
|
15647
|
-
|
|
16312
|
+
/* @__PURE__ */ jsx19("div", { className: "text-lg font-semibold text-neutral-950", children: view === "messages" ? "Messages" : "" }),
|
|
16313
|
+
/* @__PURE__ */ jsx19(
|
|
16314
|
+
CloseChatButton,
|
|
15648
16315
|
{
|
|
15649
|
-
|
|
15650
|
-
|
|
15651
|
-
HEADER_BTN,
|
|
15652
|
-
"absolute top-[var(--scw-header-padding)] right-[var(--scw-header-padding)]"
|
|
15653
|
-
),
|
|
15654
|
-
onClick: onClose,
|
|
15655
|
-
type: "button",
|
|
15656
|
-
children: /* @__PURE__ */ jsx18(CloseIcon, {})
|
|
16316
|
+
className: "absolute top-[var(--scw-header-padding)] right-[var(--scw-header-padding)]",
|
|
16317
|
+
onClose
|
|
15657
16318
|
}
|
|
15658
16319
|
)
|
|
15659
16320
|
]
|
|
15660
16321
|
}
|
|
15661
16322
|
);
|
|
15662
16323
|
}
|
|
16324
|
+
function CloseChatButton({
|
|
16325
|
+
className,
|
|
16326
|
+
onClose
|
|
16327
|
+
}) {
|
|
16328
|
+
if (!onClose) {
|
|
16329
|
+
return null;
|
|
16330
|
+
}
|
|
16331
|
+
return /* @__PURE__ */ jsx19(
|
|
16332
|
+
"button",
|
|
16333
|
+
{
|
|
16334
|
+
"aria-label": "Close chat",
|
|
16335
|
+
className: cn(HEADER_BTN, className),
|
|
16336
|
+
onClick: onClose,
|
|
16337
|
+
type: "button",
|
|
16338
|
+
children: /* @__PURE__ */ jsx19(CloseIcon, {})
|
|
16339
|
+
}
|
|
16340
|
+
);
|
|
16341
|
+
}
|
|
15663
16342
|
|
|
15664
16343
|
// src/lib/support/Spinner.tsx
|
|
15665
|
-
import { jsx as
|
|
16344
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
15666
16345
|
function Spinner({
|
|
15667
16346
|
className,
|
|
15668
16347
|
small
|
|
15669
16348
|
}) {
|
|
15670
|
-
return /* @__PURE__ */
|
|
16349
|
+
return /* @__PURE__ */ jsx20(
|
|
15671
16350
|
"span",
|
|
15672
16351
|
{
|
|
15673
16352
|
"aria-hidden": "true",
|
|
@@ -15684,11 +16363,11 @@ function Spinner({
|
|
|
15684
16363
|
import { useLayoutEffect as useLayoutEffect4 } from "react";
|
|
15685
16364
|
|
|
15686
16365
|
// src/lib/support/ComposerFooter.tsx
|
|
15687
|
-
import { useEffect as
|
|
16366
|
+
import { useEffect as useEffect13, useState as useState11 } from "react";
|
|
15688
16367
|
|
|
15689
16368
|
// src/lib/support/PoweredBy.tsx
|
|
15690
|
-
import { useEffect as
|
|
15691
|
-
import { jsx as
|
|
16369
|
+
import { useEffect as useEffect12, useState as useState10, useSyncExternalStore } from "react";
|
|
16370
|
+
import { jsx as jsx21, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
15692
16371
|
function PoweredBy({
|
|
15693
16372
|
projectId
|
|
15694
16373
|
}) {
|
|
@@ -15698,16 +16377,16 @@ function PoweredBy({
|
|
|
15698
16377
|
getIdentity
|
|
15699
16378
|
);
|
|
15700
16379
|
const hrefFromTraits = typeof identity2?.traits?.$href === "string" ? identity2.traits.$href : void 0;
|
|
15701
|
-
const [hostDomain, setHostDomain] =
|
|
16380
|
+
const [hostDomain, setHostDomain] = useState10(
|
|
15702
16381
|
() => readHostnameFromHref(hrefFromTraits)
|
|
15703
16382
|
);
|
|
15704
|
-
|
|
16383
|
+
useEffect12(() => {
|
|
15705
16384
|
const fromTraits = readHostnameFromHref(hrefFromTraits);
|
|
15706
16385
|
if (fromTraits) {
|
|
15707
16386
|
setHostDomain(fromTraits);
|
|
15708
16387
|
}
|
|
15709
16388
|
}, [hrefFromTraits]);
|
|
15710
|
-
|
|
16389
|
+
useEffect12(() => {
|
|
15711
16390
|
if (hostDomain) {
|
|
15712
16391
|
return;
|
|
15713
16392
|
}
|
|
@@ -15729,17 +16408,17 @@ function PoweredBy({
|
|
|
15729
16408
|
cancelled = true;
|
|
15730
16409
|
};
|
|
15731
16410
|
}, [hostDomain]);
|
|
15732
|
-
return /* @__PURE__ */
|
|
16411
|
+
return /* @__PURE__ */ jsx21("div", { className: "flex justify-center", children: /* @__PURE__ */ jsxs10(
|
|
15733
16412
|
"a",
|
|
15734
16413
|
{
|
|
15735
16414
|
"aria-label": "Powered by Saasco",
|
|
15736
|
-
className: "inline-flex items-center gap-[5px] rounded-full border border-solid border-
|
|
16415
|
+
className: "inline-flex items-center gap-[5px] rounded-full border border-solid border-border bg-white px-3.5 py-1.5 text-[11px] leading-none text-neutral-400 no-underline transition-colors duration-150 hover:bg-neutral-50",
|
|
15737
16416
|
href: buildSaascoPoweredByHref(projectId, hostDomain),
|
|
15738
16417
|
rel: "noopener noreferrer",
|
|
15739
16418
|
target: "_blank",
|
|
15740
16419
|
children: [
|
|
15741
|
-
/* @__PURE__ */
|
|
15742
|
-
/* @__PURE__ */
|
|
16420
|
+
/* @__PURE__ */ jsx21("span", { className: "text-neutral-400", children: "Powered by" }),
|
|
16421
|
+
/* @__PURE__ */ jsx21(SaascoLogo, {})
|
|
15743
16422
|
]
|
|
15744
16423
|
}
|
|
15745
16424
|
) });
|
|
@@ -15763,15 +16442,15 @@ import {
|
|
|
15763
16442
|
useMessageScrollerScrollable,
|
|
15764
16443
|
useMessageScrollerVisibility
|
|
15765
16444
|
} from "@shadcn/react/message-scroller";
|
|
15766
|
-
import { Fragment as Fragment5, jsx as
|
|
16445
|
+
import { Fragment as Fragment5, jsx as jsx22, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
15767
16446
|
function MessageScrollerProvider(props) {
|
|
15768
|
-
return /* @__PURE__ */
|
|
16447
|
+
return /* @__PURE__ */ jsx22(MessageScrollerPrimitive.Provider, { ...props });
|
|
15769
16448
|
}
|
|
15770
16449
|
function MessageScroller({
|
|
15771
16450
|
className,
|
|
15772
16451
|
...props
|
|
15773
16452
|
}) {
|
|
15774
|
-
return /* @__PURE__ */
|
|
16453
|
+
return /* @__PURE__ */ jsx22(
|
|
15775
16454
|
MessageScrollerPrimitive.Root,
|
|
15776
16455
|
{
|
|
15777
16456
|
"data-slot": "message-scroller",
|
|
@@ -15787,7 +16466,7 @@ function MessageScrollerViewport({
|
|
|
15787
16466
|
className,
|
|
15788
16467
|
...props
|
|
15789
16468
|
}) {
|
|
15790
|
-
return /* @__PURE__ */
|
|
16469
|
+
return /* @__PURE__ */ jsx22(
|
|
15791
16470
|
MessageScrollerPrimitive.Viewport,
|
|
15792
16471
|
{
|
|
15793
16472
|
"data-slot": "message-scroller-viewport",
|
|
@@ -15807,7 +16486,7 @@ function MessageScrollerContent({
|
|
|
15807
16486
|
className,
|
|
15808
16487
|
...props
|
|
15809
16488
|
}) {
|
|
15810
|
-
return /* @__PURE__ */
|
|
16489
|
+
return /* @__PURE__ */ jsx22(
|
|
15811
16490
|
MessageScrollerPrimitive.Content,
|
|
15812
16491
|
{
|
|
15813
16492
|
"data-slot": "message-scroller-content",
|
|
@@ -15827,7 +16506,7 @@ function MessageScrollerItem({
|
|
|
15827
16506
|
scrollAnchor = false,
|
|
15828
16507
|
...props
|
|
15829
16508
|
}) {
|
|
15830
|
-
return /* @__PURE__ */
|
|
16509
|
+
return /* @__PURE__ */ jsx22(
|
|
15831
16510
|
MessageScrollerPrimitive.Item,
|
|
15832
16511
|
{
|
|
15833
16512
|
"data-slot": "message-scroller-item",
|
|
@@ -15844,7 +16523,7 @@ function MessageScrollerItem({
|
|
|
15844
16523
|
}
|
|
15845
16524
|
|
|
15846
16525
|
// src/lib/support/ComposerFooter.tsx
|
|
15847
|
-
import { jsx as
|
|
16526
|
+
import { jsx as jsx23, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
15848
16527
|
function ComposerFooter({
|
|
15849
16528
|
active,
|
|
15850
16529
|
projectId,
|
|
@@ -15855,8 +16534,8 @@ function ComposerFooter({
|
|
|
15855
16534
|
const { scrollToEnd } = useMessageScroller();
|
|
15856
16535
|
const showScrollToBottom = useAwayFromScrollBottom(scrollRef, active);
|
|
15857
16536
|
const transition = reduceMotion ? { duration: 0 } : SCROLL_BOTTOM_TRANSITION;
|
|
15858
|
-
return /* @__PURE__ */
|
|
15859
|
-
/* @__PURE__ */
|
|
16537
|
+
return /* @__PURE__ */ jsxs12("div", { className: "pointer-events-none absolute inset-x-0 bottom-full mb-2.5", children: [
|
|
16538
|
+
/* @__PURE__ */ jsx23(
|
|
15860
16539
|
motion.div,
|
|
15861
16540
|
{
|
|
15862
16541
|
animate: {
|
|
@@ -15868,10 +16547,10 @@ function ComposerFooter({
|
|
|
15868
16547
|
initial: false,
|
|
15869
16548
|
style: { pointerEvents: showScrollToBottom ? "none" : "auto" },
|
|
15870
16549
|
transition,
|
|
15871
|
-
children: /* @__PURE__ */
|
|
16550
|
+
children: /* @__PURE__ */ jsx23(PoweredBy, { projectId })
|
|
15872
16551
|
}
|
|
15873
16552
|
),
|
|
15874
|
-
/* @__PURE__ */
|
|
16553
|
+
/* @__PURE__ */ jsx23(
|
|
15875
16554
|
motion.button,
|
|
15876
16555
|
{
|
|
15877
16556
|
animate: {
|
|
@@ -15881,7 +16560,7 @@ function ComposerFooter({
|
|
|
15881
16560
|
},
|
|
15882
16561
|
"aria-hidden": !showScrollToBottom,
|
|
15883
16562
|
"aria-label": "Scroll to latest messages",
|
|
15884
|
-
className: "absolute top-1/2 left-1/2 mt-[-16px] flex size-8 cursor-pointer items-center justify-center rounded-full border border-solid border-
|
|
16563
|
+
className: "absolute top-1/2 left-1/2 mt-[-16px] flex size-8 cursor-pointer items-center justify-center rounded-full border border-solid border-border bg-white p-0 text-neutral-600 transition-colors duration-150 hover:bg-neutral-50",
|
|
15885
16564
|
initial: false,
|
|
15886
16565
|
onClick: () => {
|
|
15887
16566
|
scrollReleasedRef.current = true;
|
|
@@ -15891,14 +16570,14 @@ function ComposerFooter({
|
|
|
15891
16570
|
tabIndex: showScrollToBottom ? 0 : -1,
|
|
15892
16571
|
transition,
|
|
15893
16572
|
type: "button",
|
|
15894
|
-
children: /* @__PURE__ */
|
|
16573
|
+
children: /* @__PURE__ */ jsx23(ScrollChevronDownIcon, {})
|
|
15895
16574
|
}
|
|
15896
16575
|
)
|
|
15897
16576
|
] });
|
|
15898
16577
|
}
|
|
15899
16578
|
function useAwayFromScrollBottom(scrollRef, active) {
|
|
15900
|
-
const [away, setAway] =
|
|
15901
|
-
|
|
16579
|
+
const [away, setAway] = useState11(false);
|
|
16580
|
+
useEffect13(() => {
|
|
15902
16581
|
if (!active) {
|
|
15903
16582
|
setAway(false);
|
|
15904
16583
|
return;
|
|
@@ -15937,11 +16616,11 @@ function useAwayFromScrollBottom(scrollRef, active) {
|
|
|
15937
16616
|
}
|
|
15938
16617
|
|
|
15939
16618
|
// src/lib/support/MessageList.tsx
|
|
15940
|
-
import { useEffect as
|
|
16619
|
+
import { useEffect as useEffect16, useMemo as useMemo7 } from "react";
|
|
15941
16620
|
|
|
15942
16621
|
// src/lib/support/ui/marker.tsx
|
|
15943
16622
|
import { Slot as Slot3 } from "@radix-ui/react-slot";
|
|
15944
|
-
import { jsx as
|
|
16623
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
15945
16624
|
var markerVariants = cva(
|
|
15946
16625
|
"group/marker relative flex min-h-4 w-full items-center gap-2 text-left text-sm text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [a]:underline [a]:underline-offset-3 [a]:hover:text-foreground",
|
|
15947
16626
|
{
|
|
@@ -15961,7 +16640,7 @@ function Marker({
|
|
|
15961
16640
|
...props
|
|
15962
16641
|
}) {
|
|
15963
16642
|
const Comp = asChild ? Slot3 : "div";
|
|
15964
|
-
return /* @__PURE__ */
|
|
16643
|
+
return /* @__PURE__ */ jsx24(
|
|
15965
16644
|
Comp,
|
|
15966
16645
|
{
|
|
15967
16646
|
"data-slot": "marker",
|
|
@@ -15972,7 +16651,7 @@ function Marker({
|
|
|
15972
16651
|
);
|
|
15973
16652
|
}
|
|
15974
16653
|
function MarkerIcon({ className, ...props }) {
|
|
15975
|
-
return /* @__PURE__ */
|
|
16654
|
+
return /* @__PURE__ */ jsx24(
|
|
15976
16655
|
"span",
|
|
15977
16656
|
{
|
|
15978
16657
|
"data-slot": "marker-icon",
|
|
@@ -15986,7 +16665,7 @@ function MarkerIcon({ className, ...props }) {
|
|
|
15986
16665
|
);
|
|
15987
16666
|
}
|
|
15988
16667
|
function MarkerContent({ className, ...props }) {
|
|
15989
|
-
return /* @__PURE__ */
|
|
16668
|
+
return /* @__PURE__ */ jsx24(
|
|
15990
16669
|
"span",
|
|
15991
16670
|
{
|
|
15992
16671
|
"data-slot": "marker-content",
|
|
@@ -16000,41 +16679,17 @@ function MarkerContent({ className, ...props }) {
|
|
|
16000
16679
|
}
|
|
16001
16680
|
|
|
16002
16681
|
// src/lib/support/JoinNotice.tsx
|
|
16003
|
-
import { jsx as
|
|
16682
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
16004
16683
|
function JoinNotice({
|
|
16005
16684
|
message
|
|
16006
16685
|
}) {
|
|
16007
16686
|
const name = readAuthorName(message);
|
|
16008
16687
|
const label = name && name !== "Team" ? `${name} has joined the conversation` : "A teammate has joined the conversation";
|
|
16009
|
-
return /* @__PURE__ */
|
|
16010
|
-
}
|
|
16011
|
-
|
|
16012
|
-
// src/lib/support/Suggestions.tsx
|
|
16013
|
-
import { jsx as jsx25, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
16014
|
-
function Suggestions({
|
|
16015
|
-
onPick,
|
|
16016
|
-
suggestions
|
|
16017
|
-
}) {
|
|
16018
|
-
return /* @__PURE__ */ jsx25("div", { className: "flex flex-col gap-2", children: suggestions.map((suggestion) => /* @__PURE__ */ jsxs11(
|
|
16019
|
-
"button",
|
|
16020
|
-
{
|
|
16021
|
-
className: "flex cursor-pointer items-start gap-3 rounded-xl border border-solid border-neutral-200 bg-white px-3 py-2.5 text-left font-[inherit] hover:bg-neutral-50",
|
|
16022
|
-
onClick: () => onPick(suggestion.prompt),
|
|
16023
|
-
type: "button",
|
|
16024
|
-
children: [
|
|
16025
|
-
/* @__PURE__ */ jsx25("span", { className: "mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-lg bg-neutral-100 text-neutral-700", children: /* @__PURE__ */ jsx25(SparklesIcon, {}) }),
|
|
16026
|
-
/* @__PURE__ */ jsxs11("span", { className: "flex min-w-0 flex-col", children: [
|
|
16027
|
-
/* @__PURE__ */ jsx25("span", { className: "text-sm font-medium text-neutral-950", children: suggestion.label }),
|
|
16028
|
-
suggestion.description && /* @__PURE__ */ jsx25("span", { className: "mt-0.5 line-clamp-2 overflow-hidden text-xs text-neutral-500", children: suggestion.description })
|
|
16029
|
-
] })
|
|
16030
|
-
]
|
|
16031
|
-
},
|
|
16032
|
-
suggestion.label
|
|
16033
|
-
)) });
|
|
16688
|
+
return /* @__PURE__ */ jsx25(Marker, { className: "scw-message-in justify-center py-2 text-center text-xs text-neutral-500", children: /* @__PURE__ */ jsx25(MarkerContent, { children: label }) });
|
|
16034
16689
|
}
|
|
16035
16690
|
|
|
16036
16691
|
// src/lib/support/HandoffCard.tsx
|
|
16037
|
-
import { jsx as jsx26, jsxs as
|
|
16692
|
+
import { jsx as jsx26, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
16038
16693
|
var BTN = "inline-flex h-7 cursor-pointer items-center gap-1 rounded-md px-2.5 text-xs font-medium disabled:cursor-default disabled:opacity-60";
|
|
16039
16694
|
var BTN_PRIMARY = "border border-solid border-neutral-900 bg-neutral-900 text-white hover:bg-neutral-800";
|
|
16040
16695
|
var BTN_OUTLINE = "border border-solid border-neutral-300 bg-white text-neutral-900 hover:bg-neutral-100";
|
|
@@ -16044,12 +16699,12 @@ function HandoffCard({
|
|
|
16044
16699
|
pending,
|
|
16045
16700
|
reason
|
|
16046
16701
|
}) {
|
|
16047
|
-
return /* @__PURE__ */
|
|
16702
|
+
return /* @__PURE__ */ jsxs13("div", { className: "w-full rounded-lg border border-solid border-border bg-white p-3", children: [
|
|
16048
16703
|
/* @__PURE__ */ jsx26("div", { className: "text-[10px] font-semibold tracking-[0.04em] text-neutral-500 uppercase", children: "Connect with the team" }),
|
|
16049
16704
|
reason ? /* @__PURE__ */ jsx26("p", { className: "mt-1.5 text-[13px] text-neutral-900", children: reason }) : null,
|
|
16050
16705
|
/* @__PURE__ */ jsx26("p", { className: "mt-1 text-xs text-neutral-600", children: "A human teammate can take over from here and reply right in this chat." }),
|
|
16051
|
-
/* @__PURE__ */
|
|
16052
|
-
/* @__PURE__ */
|
|
16706
|
+
/* @__PURE__ */ jsxs13("div", { className: "mt-2.5 flex flex-wrap items-center gap-1.5", children: [
|
|
16707
|
+
/* @__PURE__ */ jsxs13(
|
|
16053
16708
|
"button",
|
|
16054
16709
|
{
|
|
16055
16710
|
className: `${BTN} ${BTN_PRIMARY}`,
|
|
@@ -16080,6 +16735,7 @@ function HandoffCard({
|
|
|
16080
16735
|
import { getToolName as getToolName4, isToolUIPart as isToolUIPart4 } from "ai";
|
|
16081
16736
|
var HIDDEN_WIDGET_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
16082
16737
|
CLOSE_CONVERSATION_TOOL_NAME,
|
|
16738
|
+
REPORT_KNOWLEDGE_GAP_TOOL_NAME,
|
|
16083
16739
|
REQUEST_HUMAN_HANDOFF_TOOL_NAME
|
|
16084
16740
|
]);
|
|
16085
16741
|
function collectHiddenToolCallIds(message) {
|
|
@@ -16121,10 +16777,10 @@ function humanizeToolName(toolName) {
|
|
|
16121
16777
|
}
|
|
16122
16778
|
|
|
16123
16779
|
// src/lib/support/ToolGroup.tsx
|
|
16124
|
-
import { useState as
|
|
16780
|
+
import { useState as useState12 } from "react";
|
|
16125
16781
|
|
|
16126
16782
|
// src/lib/support/ApprovalCard.tsx
|
|
16127
|
-
import { jsx as jsx27, jsxs as
|
|
16783
|
+
import { jsx as jsx27, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
16128
16784
|
var BTN2 = "inline-flex h-7 cursor-pointer items-center gap-1 rounded-md px-2.5 text-xs font-medium disabled:cursor-default disabled:opacity-60";
|
|
16129
16785
|
var BTN_PRIMARY2 = "border border-solid border-neutral-900 bg-neutral-900 text-white hover:bg-neutral-800";
|
|
16130
16786
|
var BTN_OUTLINE2 = "border border-solid border-neutral-300 bg-white text-neutral-900 hover:bg-neutral-100";
|
|
@@ -16135,7 +16791,7 @@ function ApprovalCard({
|
|
|
16135
16791
|
toolName
|
|
16136
16792
|
}) {
|
|
16137
16793
|
const displayLabel = resolveToolLabel(toolName, label);
|
|
16138
|
-
return /* @__PURE__ */ jsx27("div", { className: "w-full rounded-lg border border-solid border-
|
|
16794
|
+
return /* @__PURE__ */ jsx27("div", { className: "w-full rounded-lg border border-solid border-border bg-white p-3 text-xs text-neutral-900", children: /* @__PURE__ */ jsxs14("div", { className: "flex items-start gap-2.5", children: [
|
|
16139
16795
|
/* @__PURE__ */ jsx27(
|
|
16140
16796
|
"div",
|
|
16141
16797
|
{
|
|
@@ -16144,12 +16800,12 @@ function ApprovalCard({
|
|
|
16144
16800
|
children: /* @__PURE__ */ jsx27(AlertTriangleIcon, {})
|
|
16145
16801
|
}
|
|
16146
16802
|
),
|
|
16147
|
-
/* @__PURE__ */
|
|
16803
|
+
/* @__PURE__ */ jsxs14("div", { className: "min-w-0 flex-1", children: [
|
|
16148
16804
|
/* @__PURE__ */ jsx27("div", { className: "text-[10px] font-semibold tracking-[0.04em] text-neutral-500 uppercase", children: "Approval required" }),
|
|
16149
16805
|
/* @__PURE__ */ jsx27("div", { className: "text-sm font-semibold text-neutral-900", children: displayLabel }),
|
|
16150
16806
|
/* @__PURE__ */ jsx27("p", { className: "mt-1 text-xs text-neutral-600", children: "Allow this action to continue?" }),
|
|
16151
|
-
/* @__PURE__ */
|
|
16152
|
-
/* @__PURE__ */
|
|
16807
|
+
/* @__PURE__ */ jsxs14("div", { className: "mt-3 flex items-center gap-1.5", children: [
|
|
16808
|
+
/* @__PURE__ */ jsxs14(
|
|
16153
16809
|
"button",
|
|
16154
16810
|
{
|
|
16155
16811
|
className: `${BTN2} ${BTN_PRIMARY2}`,
|
|
@@ -16161,7 +16817,7 @@ function ApprovalCard({
|
|
|
16161
16817
|
]
|
|
16162
16818
|
}
|
|
16163
16819
|
),
|
|
16164
|
-
/* @__PURE__ */
|
|
16820
|
+
/* @__PURE__ */ jsxs14(
|
|
16165
16821
|
"button",
|
|
16166
16822
|
{
|
|
16167
16823
|
className: `${BTN2} ${BTN_OUTLINE2}`,
|
|
@@ -16185,7 +16841,7 @@ function resolveToolLabel(toolName, label) {
|
|
|
16185
16841
|
}
|
|
16186
16842
|
|
|
16187
16843
|
// src/lib/support/ToolGroup.tsx
|
|
16188
|
-
import { jsx as jsx28, jsxs as
|
|
16844
|
+
import { jsx as jsx28, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
16189
16845
|
function ToolGroup({
|
|
16190
16846
|
onApprove,
|
|
16191
16847
|
onReject,
|
|
@@ -16194,7 +16850,7 @@ function ToolGroup({
|
|
|
16194
16850
|
toolLabels,
|
|
16195
16851
|
tools
|
|
16196
16852
|
}) {
|
|
16197
|
-
const [expanded, setExpanded] =
|
|
16853
|
+
const [expanded, setExpanded] = useState12(false);
|
|
16198
16854
|
const hostAwaitingApproval = tools.filter(
|
|
16199
16855
|
(tool) => pending.has(tool.toolCallId)
|
|
16200
16856
|
);
|
|
@@ -16205,7 +16861,7 @@ function ToolGroup({
|
|
|
16205
16861
|
const active = running ? tools.toReversed().find((tool) => !isToolPartComplete(tool.state)) : void 0;
|
|
16206
16862
|
const summary = running ? "Working" : `${tools.length} ${tools.length === 1 ? "step" : "steps"}`;
|
|
16207
16863
|
const activeLabel = active ? resolveToolDisplayLabel(active.toolName, toolLabels) : void 0;
|
|
16208
|
-
return /* @__PURE__ */
|
|
16864
|
+
return /* @__PURE__ */ jsxs15("div", { className: "flex w-full max-w-[88%] flex-col gap-1.5 self-start", children: [
|
|
16209
16865
|
hostAwaitingApproval.map((tool) => {
|
|
16210
16866
|
const approval = pending.get(tool.toolCallId);
|
|
16211
16867
|
if (!approval) {
|
|
@@ -16238,7 +16894,7 @@ function ToolGroup({
|
|
|
16238
16894
|
approvalId
|
|
16239
16895
|
);
|
|
16240
16896
|
}),
|
|
16241
|
-
/* @__PURE__ */
|
|
16897
|
+
/* @__PURE__ */ jsxs15(
|
|
16242
16898
|
"button",
|
|
16243
16899
|
{
|
|
16244
16900
|
"aria-expanded": expanded,
|
|
@@ -16257,17 +16913,17 @@ function ToolGroup({
|
|
|
16257
16913
|
}
|
|
16258
16914
|
),
|
|
16259
16915
|
/* @__PURE__ */ jsx28("span", { className: "font-medium", children: summary }),
|
|
16260
|
-
running && activeLabel && /* @__PURE__ */
|
|
16916
|
+
running && activeLabel && /* @__PURE__ */ jsxs15("span", { className: "overflow-hidden text-ellipsis whitespace-nowrap text-neutral-400", children: [
|
|
16261
16917
|
"\xB7 ",
|
|
16262
16918
|
activeLabel
|
|
16263
16919
|
] })
|
|
16264
16920
|
]
|
|
16265
16921
|
}
|
|
16266
16922
|
),
|
|
16267
|
-
expanded && /* @__PURE__ */ jsx28("div", { className: "flex flex-col gap-1 border-l border-
|
|
16923
|
+
expanded && /* @__PURE__ */ jsx28("div", { className: "flex flex-col gap-1 border-l border-border pl-2.5", children: tools.map((tool) => /* @__PURE__ */ jsxs15(
|
|
16268
16924
|
"div",
|
|
16269
16925
|
{
|
|
16270
|
-
className: "inline-flex items-center gap-1.5 self-start rounded border border-solid border-
|
|
16926
|
+
className: "inline-flex items-center gap-1.5 self-start rounded border border-solid border-border bg-white px-1.5 py-0.5 font-mono text-[11px] tracking-[-0.01em] text-neutral-600",
|
|
16271
16927
|
children: [
|
|
16272
16928
|
isToolPartComplete(tool.state) ? /* @__PURE__ */ jsx28("span", { className: "size-1 shrink-0 rounded-full bg-neutral-400" }) : /* @__PURE__ */ jsx28(Spinner, { small: true }),
|
|
16273
16929
|
/* @__PURE__ */ jsx28("span", { children: resolveToolDisplayLabel(tool.toolName, toolLabels) })
|
|
@@ -16406,7 +17062,7 @@ function MessageFooter({ className, ...props }) {
|
|
|
16406
17062
|
}
|
|
16407
17063
|
|
|
16408
17064
|
// src/lib/support/SupportMessage.tsx
|
|
16409
|
-
import { Fragment as Fragment6, jsx as jsx31, jsxs as
|
|
17065
|
+
import { Fragment as Fragment6, jsx as jsx31, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
16410
17066
|
function SupportMessage({
|
|
16411
17067
|
branding,
|
|
16412
17068
|
group,
|
|
@@ -16440,7 +17096,7 @@ function SupportMessage({
|
|
|
16440
17096
|
align: isCustomer ? "end" : "start",
|
|
16441
17097
|
className: "scw-message-in",
|
|
16442
17098
|
"data-message-id": message.id,
|
|
16443
|
-
children: /* @__PURE__ */
|
|
17099
|
+
children: /* @__PURE__ */ jsxs16(MessageContent, { className: "gap-[3px]", children: [
|
|
16444
17100
|
blocks.map((block, index2) => {
|
|
16445
17101
|
if (block.kind === "text") {
|
|
16446
17102
|
const isStreamingBlock = isStreaming && index2 === blocks.length - 1;
|
|
@@ -16457,9 +17113,9 @@ function SupportMessage({
|
|
|
16457
17113
|
BubbleContent,
|
|
16458
17114
|
{
|
|
16459
17115
|
className: cn(
|
|
16460
|
-
"text-[14px] leading-[1.45] whitespace-pre-wrap [&_strong]:font-semibold",
|
|
17116
|
+
"text-[14px] leading-[1.45] whitespace-pre-wrap [&_strong]:font-semibold [&_table]:whitespace-normal",
|
|
16461
17117
|
isCustomer && "rounded-2xl rounded-br-[4px] bg-neutral-900 px-[13px] py-[9px] text-white",
|
|
16462
|
-
isTeam && "rounded-2xl rounded-bl-[4px] bg-
|
|
17118
|
+
isTeam && "rounded-2xl rounded-bl-[4px] bg-neutral-100 px-[13px] py-[9px] text-neutral-950",
|
|
16463
17119
|
!isCustomer && !isTeam && "max-w-full rounded-none bg-transparent px-0 py-1 text-neutral-950"
|
|
16464
17120
|
),
|
|
16465
17121
|
children: renderMessageText(block.text, kbArticles, isStreamingBlock)
|
|
@@ -16489,7 +17145,7 @@ function SupportMessage({
|
|
|
16489
17145
|
"flex max-w-[88%] flex-col gap-1.5",
|
|
16490
17146
|
isCustomer && "self-end"
|
|
16491
17147
|
),
|
|
16492
|
-
children: attachmentUrls.map((url) => /* @__PURE__ */
|
|
17148
|
+
children: attachmentUrls.map((url) => /* @__PURE__ */ jsxs16(
|
|
16493
17149
|
Attachment,
|
|
16494
17150
|
{
|
|
16495
17151
|
className: "overflow-hidden rounded-xl border-0 p-0",
|
|
@@ -16522,19 +17178,19 @@ function SupportMessage({
|
|
|
16522
17178
|
showHandoffCard && handoffOffer && /* @__PURE__ */ jsx31(
|
|
16523
17179
|
HandoffCard,
|
|
16524
17180
|
{
|
|
16525
|
-
onConfirm: () => handoff.onConfirm(handoffOffer
|
|
17181
|
+
onConfirm: () => handoff.onConfirm(handoffOffer),
|
|
16526
17182
|
onDismiss: () => handoff.onDismiss(handoffOffer.toolCallId),
|
|
16527
17183
|
pending: handoff.pending,
|
|
16528
17184
|
reason: handoffOffer.reason
|
|
16529
17185
|
}
|
|
16530
17186
|
),
|
|
16531
|
-
(hasText || attachmentUrls.length > 0) && group.showTimestamp && /* @__PURE__ */ jsx31(MessageFooter, { className: "px-0 text-[11px] text-
|
|
17187
|
+
(hasText || attachmentUrls.length > 0) && group.showTimestamp && /* @__PURE__ */ jsx31(MessageFooter, { className: "px-0 text-[11px] text-neutral-500", children: isCustomer ? /* @__PURE__ */ jsx31(
|
|
16532
17188
|
CompactTime,
|
|
16533
17189
|
{
|
|
16534
17190
|
messageId: message.id,
|
|
16535
17191
|
timestamp: readCreatedAt(message)
|
|
16536
17192
|
}
|
|
16537
|
-
) : /* @__PURE__ */
|
|
17193
|
+
) : /* @__PURE__ */ jsxs16(Fragment6, { children: [
|
|
16538
17194
|
isTeam ? `${readAuthorName(message) ?? "Team"} \xB7 Team` : branding.agentLabel,
|
|
16539
17195
|
" ",
|
|
16540
17196
|
"\xB7",
|
|
@@ -16553,7 +17209,7 @@ function SupportMessage({
|
|
|
16553
17209
|
}
|
|
16554
17210
|
|
|
16555
17211
|
// src/lib/support/useFollowBottomAfterUserScroll.ts
|
|
16556
|
-
import { useEffect as
|
|
17212
|
+
import { useEffect as useEffect14 } from "react";
|
|
16557
17213
|
var SPACER_SELECTOR = "[data-message-scroller-spacer]";
|
|
16558
17214
|
var ANCHOR_SELECTOR = '[data-scroll-anchor="true"]';
|
|
16559
17215
|
var SCROLL_KEYS = /* @__PURE__ */ new Set([
|
|
@@ -16567,7 +17223,7 @@ var SCROLL_KEYS = /* @__PURE__ */ new Set([
|
|
|
16567
17223
|
]);
|
|
16568
17224
|
function useFollowBottomAfterUserScroll(scrollRef, scrollReleasedRef) {
|
|
16569
17225
|
const { scrollToEnd } = useMessageScroller();
|
|
16570
|
-
|
|
17226
|
+
useEffect14(() => {
|
|
16571
17227
|
const viewport = scrollRef.current;
|
|
16572
17228
|
const spacer = viewport?.querySelector(SPACER_SELECTOR);
|
|
16573
17229
|
const content = spacer?.parentElement;
|
|
@@ -16644,10 +17300,10 @@ function useFollowBottomAfterUserScroll(scrollRef, scrollReleasedRef) {
|
|
|
16644
17300
|
}
|
|
16645
17301
|
|
|
16646
17302
|
// src/lib/support/useLiftSpacerClamp.ts
|
|
16647
|
-
import { useEffect as
|
|
17303
|
+
import { useEffect as useEffect15 } from "react";
|
|
16648
17304
|
var SPACER_SELECTOR2 = "[data-message-scroller-spacer]";
|
|
16649
17305
|
function useLiftSpacerClamp(scrollRef) {
|
|
16650
|
-
|
|
17306
|
+
useEffect15(() => {
|
|
16651
17307
|
const viewport = scrollRef.current;
|
|
16652
17308
|
const spacer = viewport?.querySelector(SPACER_SELECTOR2);
|
|
16653
17309
|
const content = spacer?.parentElement;
|
|
@@ -16657,13 +17313,13 @@ function useLiftSpacerClamp(scrollRef) {
|
|
|
16657
17313
|
const frameWindow = viewport.ownerDocument.defaultView ?? window;
|
|
16658
17314
|
const ResizeObserverImpl = frameWindow.ResizeObserver ?? window.ResizeObserver;
|
|
16659
17315
|
let frame2 = 0;
|
|
16660
|
-
const
|
|
17316
|
+
const clamp3 = () => {
|
|
16661
17317
|
const ceiling = measureLiftCeiling(viewport, content, spacer);
|
|
16662
17318
|
spacer.style.maxHeight = `${ceiling}px`;
|
|
16663
17319
|
};
|
|
16664
17320
|
const observer2 = new ResizeObserverImpl(() => {
|
|
16665
17321
|
frameWindow.cancelAnimationFrame(frame2);
|
|
16666
|
-
frame2 = frameWindow.requestAnimationFrame(
|
|
17322
|
+
frame2 = frameWindow.requestAnimationFrame(clamp3);
|
|
16667
17323
|
});
|
|
16668
17324
|
observer2.observe(content);
|
|
16669
17325
|
observer2.observe(viewport);
|
|
@@ -16703,10 +17359,11 @@ function measureLiftCeiling(viewport, content, spacer) {
|
|
|
16703
17359
|
}
|
|
16704
17360
|
|
|
16705
17361
|
// src/lib/support/MessageList.tsx
|
|
16706
|
-
import { jsx as jsx32, jsxs as
|
|
17362
|
+
import { jsx as jsx32, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
16707
17363
|
function MessageList({
|
|
16708
17364
|
agentMuted,
|
|
16709
17365
|
branding,
|
|
17366
|
+
conversationState,
|
|
16710
17367
|
dismissedHandoffs,
|
|
16711
17368
|
error,
|
|
16712
17369
|
handoffPending,
|
|
@@ -16746,7 +17403,12 @@ function MessageList({
|
|
|
16746
17403
|
return null;
|
|
16747
17404
|
}, [messages]);
|
|
16748
17405
|
const showTyping = typingLabel !== null;
|
|
16749
|
-
const showWaiting =
|
|
17406
|
+
const showWaiting = shouldShowWaitingForTeammate({
|
|
17407
|
+
agentMuted,
|
|
17408
|
+
conversationState,
|
|
17409
|
+
isTyping: showTyping,
|
|
17410
|
+
messages
|
|
17411
|
+
});
|
|
16750
17412
|
const showError = !!error && !isTakeoverError;
|
|
16751
17413
|
const showSuggestions = messages.length === 0 && suggestions.length > 0;
|
|
16752
17414
|
return /* @__PURE__ */ jsx32(MessageScroller, { className: "relative flex min-h-0 min-w-0 flex-1 flex-col", children: /* @__PURE__ */ jsx32(
|
|
@@ -16767,16 +17429,19 @@ function MessageList({
|
|
|
16767
17429
|
),
|
|
16768
17430
|
id: "scw-message-list",
|
|
16769
17431
|
ref: scrollRef,
|
|
16770
|
-
children: /* @__PURE__ */
|
|
16771
|
-
/* @__PURE__ */ jsx32(MessageScrollerItem, { className: "max-w-full min-w-0", children: /* @__PURE__ */
|
|
16772
|
-
/* @__PURE__ */
|
|
17432
|
+
children: /* @__PURE__ */ jsxs17(MessageScrollerContent, { "aria-busy": isResponding, children: [
|
|
17433
|
+
/* @__PURE__ */ jsx32(MessageScrollerItem, { className: "max-w-full min-w-0", children: /* @__PURE__ */ jsxs17("div", { className: "flex flex-col gap-2.5", children: [
|
|
17434
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex items-start gap-2 pt-1", children: [
|
|
17435
|
+
/* @__PURE__ */ jsx32(Avatar, { branding }),
|
|
17436
|
+
/* @__PURE__ */ jsx32("div", { className: "max-w-[82%] rounded-[14px] bg-neutral-100 px-3 py-2 text-sm leading-[1.45] text-neutral-950", children: branding.greeting })
|
|
17437
|
+
] }),
|
|
16773
17438
|
showSuggestions && /* @__PURE__ */ jsx32(Suggestions, { onPick, suggestions })
|
|
16774
17439
|
] }) }, "intro"),
|
|
16775
17440
|
messages.map((message, index2) => {
|
|
16776
17441
|
const group = getWidgetMessageGroupFlags(messages, index2);
|
|
16777
17442
|
const isStreamingMessage = isResponding && index2 === messages.length - 1;
|
|
16778
17443
|
const isFirstTeamMessage = readSupportRole(message) === "team" && !messages.slice(0, index2).some((entry) => readSupportRole(entry) === "team");
|
|
16779
|
-
return /* @__PURE__ */
|
|
17444
|
+
return /* @__PURE__ */ jsxs17(
|
|
16780
17445
|
MessageScrollerItem,
|
|
16781
17446
|
{
|
|
16782
17447
|
className: cn(
|
|
@@ -16814,7 +17479,7 @@ function MessageList({
|
|
|
16814
17479
|
message.id
|
|
16815
17480
|
);
|
|
16816
17481
|
}),
|
|
16817
|
-
showThinking && /* @__PURE__ */ jsx32(MessageScrollerItem, { className: "max-w-full min-w-0", children: /* @__PURE__ */
|
|
17482
|
+
showThinking && /* @__PURE__ */ jsx32(MessageScrollerItem, { className: "max-w-full min-w-0", children: /* @__PURE__ */ jsxs17(
|
|
16818
17483
|
Marker,
|
|
16819
17484
|
{
|
|
16820
17485
|
className: "gap-2 py-0 text-xs text-neutral-500",
|
|
@@ -16825,7 +17490,7 @@ function MessageList({
|
|
|
16825
17490
|
]
|
|
16826
17491
|
}
|
|
16827
17492
|
) }, "thinking"),
|
|
16828
|
-
showTyping && /* @__PURE__ */ jsx32(MessageScrollerItem, { className: "max-w-full min-w-0", children: /* @__PURE__ */
|
|
17493
|
+
showTyping && /* @__PURE__ */ jsx32(MessageScrollerItem, { className: "max-w-full min-w-0", children: /* @__PURE__ */ jsxs17(
|
|
16829
17494
|
Marker,
|
|
16830
17495
|
{
|
|
16831
17496
|
className: "gap-2 py-0.5 text-xs text-neutral-500",
|
|
@@ -16836,7 +17501,7 @@ function MessageList({
|
|
|
16836
17501
|
]
|
|
16837
17502
|
}
|
|
16838
17503
|
) }, "typing"),
|
|
16839
|
-
showWaiting && /* @__PURE__ */ jsx32(MessageScrollerItem, { className: "max-w-full min-w-0", children: /* @__PURE__ */
|
|
17504
|
+
showWaiting && /* @__PURE__ */ jsx32(MessageScrollerItem, { className: "max-w-full min-w-0", children: /* @__PURE__ */ jsxs17(
|
|
16840
17505
|
Marker,
|
|
16841
17506
|
{
|
|
16842
17507
|
className: "gap-2 py-0.5 text-xs text-neutral-500",
|
|
@@ -16847,7 +17512,7 @@ function MessageList({
|
|
|
16847
17512
|
]
|
|
16848
17513
|
}
|
|
16849
17514
|
) }, "waiting"),
|
|
16850
|
-
showError && /* @__PURE__ */ jsx32(MessageScrollerItem, { className: "max-w-full min-w-0", children: /* @__PURE__ */
|
|
17515
|
+
showError && /* @__PURE__ */ jsx32(MessageScrollerItem, { className: "max-w-full min-w-0", children: /* @__PURE__ */ jsxs17("div", { className: "rounded-md border border-solid border-border bg-neutral-100 px-3 py-2.5 text-xs text-neutral-700", children: [
|
|
16851
17516
|
/* @__PURE__ */ jsx32("div", { className: "font-medium text-neutral-900", children: "Something went wrong" }),
|
|
16852
17517
|
/* @__PURE__ */ jsx32("div", { children: error?.message }),
|
|
16853
17518
|
/* @__PURE__ */ jsx32(
|
|
@@ -16864,10 +17529,6 @@ function MessageList({
|
|
|
16864
17529
|
}
|
|
16865
17530
|
) });
|
|
16866
17531
|
}
|
|
16867
|
-
function lastMessageIsFromTeam(messages) {
|
|
16868
|
-
const lastMessage = messages.at(-1);
|
|
16869
|
-
return !!lastMessage && readSupportRole(lastMessage) === "team";
|
|
16870
|
-
}
|
|
16871
17532
|
function useReportVisibleTeamMessagesSeen(messages, onTeamMessagesSeen) {
|
|
16872
17533
|
const { visibleMessageIds } = useMessageScrollerVisibility();
|
|
16873
17534
|
const teamMessageIds = useMemo7(() => {
|
|
@@ -16880,7 +17541,7 @@ function useReportVisibleTeamMessagesSeen(messages, onTeamMessagesSeen) {
|
|
|
16880
17541
|
return ids;
|
|
16881
17542
|
}, [messages]);
|
|
16882
17543
|
const visibleTeamKey = visibleMessageIds.filter((id3) => teamMessageIds.has(id3)).join(",");
|
|
16883
|
-
|
|
17544
|
+
useEffect16(() => {
|
|
16884
17545
|
if (!visibleTeamKey) {
|
|
16885
17546
|
return;
|
|
16886
17547
|
}
|
|
@@ -16890,29 +17551,29 @@ function useReportVisibleTeamMessagesSeen(messages, onTeamMessagesSeen) {
|
|
|
16890
17551
|
|
|
16891
17552
|
// src/lib/support/MessageScrollbar.tsx
|
|
16892
17553
|
import {
|
|
16893
|
-
useCallback as
|
|
16894
|
-
useEffect as
|
|
17554
|
+
useCallback as useCallback9,
|
|
17555
|
+
useEffect as useEffect17,
|
|
16895
17556
|
useLayoutEffect as useLayoutEffect3,
|
|
16896
|
-
useRef as
|
|
16897
|
-
useState as
|
|
17557
|
+
useRef as useRef14,
|
|
17558
|
+
useState as useState13
|
|
16898
17559
|
} from "react";
|
|
16899
17560
|
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
16900
17561
|
function MessageScrollbar({
|
|
16901
17562
|
recomputeKey,
|
|
16902
17563
|
scrollRef
|
|
16903
17564
|
}) {
|
|
16904
|
-
const trackRef =
|
|
16905
|
-
const thumbRef =
|
|
16906
|
-
const dragRef =
|
|
17565
|
+
const trackRef = useRef14(null);
|
|
17566
|
+
const thumbRef = useRef14(null);
|
|
17567
|
+
const dragRef = useRef14(
|
|
16907
17568
|
null
|
|
16908
17569
|
);
|
|
16909
|
-
const [thumb, setThumb] =
|
|
17570
|
+
const [thumb, setThumb] = useState13({
|
|
16910
17571
|
height: 0,
|
|
16911
17572
|
top: 0,
|
|
16912
17573
|
valueNow: 0,
|
|
16913
17574
|
visible: false
|
|
16914
17575
|
});
|
|
16915
|
-
const recompute =
|
|
17576
|
+
const recompute = useCallback9(() => {
|
|
16916
17577
|
const scroller = scrollRef.current;
|
|
16917
17578
|
const track = trackRef.current;
|
|
16918
17579
|
if (!(scroller && track)) {
|
|
@@ -16940,7 +17601,7 @@ function MessageScrollbar({
|
|
|
16940
17601
|
useLayoutEffect3(() => {
|
|
16941
17602
|
recompute();
|
|
16942
17603
|
}, [recompute, recomputeKey]);
|
|
16943
|
-
|
|
17604
|
+
useEffect17(() => {
|
|
16944
17605
|
const scroller = scrollRef.current;
|
|
16945
17606
|
const track = trackRef.current;
|
|
16946
17607
|
if (!(scroller && track)) {
|
|
@@ -17023,14 +17684,16 @@ function MessageScrollbar({
|
|
|
17023
17684
|
}
|
|
17024
17685
|
|
|
17025
17686
|
// src/lib/support/WidgetConversationView.tsx
|
|
17026
|
-
import { jsx as jsx34, jsxs as
|
|
17687
|
+
import { jsx as jsx34, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
17027
17688
|
function WidgetConversationView({
|
|
17028
17689
|
activeTransition,
|
|
17029
17690
|
agentMuted,
|
|
17030
17691
|
branding,
|
|
17692
|
+
conversationState,
|
|
17031
17693
|
dismissedHandoffs,
|
|
17032
17694
|
draft,
|
|
17033
17695
|
emailDraft,
|
|
17696
|
+
emailError,
|
|
17034
17697
|
error,
|
|
17035
17698
|
handoffPending,
|
|
17036
17699
|
imageInputRef,
|
|
@@ -17045,6 +17708,7 @@ function WidgetConversationView({
|
|
|
17045
17708
|
onConfirmHandoff,
|
|
17046
17709
|
onDismissHandoff,
|
|
17047
17710
|
onDraftChange,
|
|
17711
|
+
onEmailBlur,
|
|
17048
17712
|
onEmailChange,
|
|
17049
17713
|
onImageSelection,
|
|
17050
17714
|
onPick,
|
|
@@ -17084,7 +17748,7 @@ function WidgetConversationView({
|
|
|
17084
17748
|
session,
|
|
17085
17749
|
conversationLoaded
|
|
17086
17750
|
});
|
|
17087
|
-
return /* @__PURE__ */
|
|
17751
|
+
return /* @__PURE__ */ jsxs18(
|
|
17088
17752
|
MessageScrollerProvider,
|
|
17089
17753
|
{
|
|
17090
17754
|
defaultScrollPosition: "last-anchor",
|
|
@@ -17103,6 +17767,7 @@ function WidgetConversationView({
|
|
|
17103
17767
|
{
|
|
17104
17768
|
agentMuted,
|
|
17105
17769
|
branding,
|
|
17770
|
+
conversationState,
|
|
17106
17771
|
dismissedHandoffs,
|
|
17107
17772
|
error,
|
|
17108
17773
|
handoffPending,
|
|
@@ -17136,7 +17801,7 @@ function WidgetConversationView({
|
|
|
17136
17801
|
initial: isOpeningPanel ? false : "enter",
|
|
17137
17802
|
ref: composerWrapRef,
|
|
17138
17803
|
variants: composerVariants,
|
|
17139
|
-
children: /* @__PURE__ */
|
|
17804
|
+
children: /* @__PURE__ */ jsxs18(
|
|
17140
17805
|
motion.div,
|
|
17141
17806
|
{
|
|
17142
17807
|
animate: { opacity: isLoadingMessages ? 0 : 1 },
|
|
@@ -17162,10 +17827,12 @@ function WidgetConversationView({
|
|
|
17162
17827
|
{
|
|
17163
17828
|
draft,
|
|
17164
17829
|
emailDraft,
|
|
17830
|
+
emailError,
|
|
17165
17831
|
imageInputRef,
|
|
17166
17832
|
isLoading,
|
|
17167
17833
|
needsEmail,
|
|
17168
17834
|
onDraftChange,
|
|
17835
|
+
onEmailBlur,
|
|
17169
17836
|
onEmailChange,
|
|
17170
17837
|
onImageSelection,
|
|
17171
17838
|
onRemovePendingImage,
|
|
@@ -17232,12 +17899,12 @@ function useComposerHeightSync({
|
|
|
17232
17899
|
}
|
|
17233
17900
|
|
|
17234
17901
|
// src/lib/support/WidgetNav.tsx
|
|
17235
|
-
import { jsx as jsx35, jsxs as
|
|
17902
|
+
import { jsx as jsx35, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
17236
17903
|
function WidgetNav({
|
|
17237
17904
|
onNavigate,
|
|
17238
17905
|
view
|
|
17239
17906
|
}) {
|
|
17240
|
-
return /* @__PURE__ */
|
|
17907
|
+
return /* @__PURE__ */ jsxs19("div", { className: "flex border-t border-border bg-white", children: [
|
|
17241
17908
|
/* @__PURE__ */ jsx35(
|
|
17242
17909
|
NavTab,
|
|
17243
17910
|
{
|
|
@@ -17264,7 +17931,7 @@ function NavTab({
|
|
|
17264
17931
|
label,
|
|
17265
17932
|
onClick
|
|
17266
17933
|
}) {
|
|
17267
|
-
return /* @__PURE__ */
|
|
17934
|
+
return /* @__PURE__ */ jsxs19(
|
|
17268
17935
|
"button",
|
|
17269
17936
|
{
|
|
17270
17937
|
className: cn(
|
|
@@ -17282,7 +17949,7 @@ function NavTab({
|
|
|
17282
17949
|
}
|
|
17283
17950
|
|
|
17284
17951
|
// src/lib/support/WidgetPanel.tsx
|
|
17285
|
-
import { Fragment as Fragment7, jsx as jsx36, jsxs as
|
|
17952
|
+
import { Fragment as Fragment7, jsx as jsx36, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
17286
17953
|
function WidgetPanel(props) {
|
|
17287
17954
|
const {
|
|
17288
17955
|
activeTransition,
|
|
@@ -17290,6 +17957,7 @@ function WidgetPanel(props) {
|
|
|
17290
17957
|
isChat,
|
|
17291
17958
|
isFullscreen,
|
|
17292
17959
|
isOpeningPanel,
|
|
17960
|
+
hostOwnsLauncher: hostOwnsLauncher2,
|
|
17293
17961
|
onBack,
|
|
17294
17962
|
onClose,
|
|
17295
17963
|
onNavigate,
|
|
@@ -17298,22 +17966,28 @@ function WidgetPanel(props) {
|
|
|
17298
17966
|
view
|
|
17299
17967
|
} = props;
|
|
17300
17968
|
const panelMotionTransition = reduceMotion ? { duration: 0 } : PANEL_SPRING;
|
|
17301
|
-
const panelInitial = { opacity: 0, scale: PANEL_CLOSED_SCALE, y: 10 };
|
|
17969
|
+
const panelInitial = hostOwnsLauncher2 ? { opacity: 0, scale: PANEL_CLOSED_SCALE, y: 0 } : { opacity: 0, scale: PANEL_CLOSED_SCALE, y: 10 };
|
|
17302
17970
|
const panelOpen = { opacity: 1, scale: 1, y: 0 };
|
|
17303
|
-
const panelExit = {
|
|
17971
|
+
const panelExit = hostOwnsLauncher2 ? {
|
|
17972
|
+
opacity: 0,
|
|
17973
|
+
scale: PANEL_CLOSED_SCALE,
|
|
17974
|
+
transition: { duration: 0 },
|
|
17975
|
+
y: 0
|
|
17976
|
+
} : {
|
|
17304
17977
|
opacity: 0,
|
|
17305
17978
|
scale: PANEL_CLOSED_SCALE,
|
|
17306
17979
|
transition: { duration: 0 },
|
|
17307
17980
|
y: 10
|
|
17308
17981
|
};
|
|
17309
17982
|
const isEmbedded = isCrossOriginEmbed();
|
|
17983
|
+
const paintPanelShadow = !isEmbedded || isDashboardPreview();
|
|
17310
17984
|
return /* @__PURE__ */ jsx36(
|
|
17311
17985
|
motion.div,
|
|
17312
17986
|
{
|
|
17313
17987
|
animate: panelOpen,
|
|
17314
17988
|
className: cn(
|
|
17315
|
-
"scw-panel relative flex h-[var(--scw-panel-height,
|
|
17316
|
-
|
|
17989
|
+
"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",
|
|
17990
|
+
paintPanelShadow && "shadow-[0_10px_15px_-3px_rgba(0,0,0,.1),0_4px_6px_-4px_rgba(0,0,0,.1)]",
|
|
17317
17991
|
isFullscreen && "border-none rounded-none shadow-none"
|
|
17318
17992
|
),
|
|
17319
17993
|
exit: panelExit,
|
|
@@ -17344,9 +18018,11 @@ function BrandedPanelBody({
|
|
|
17344
18018
|
agentMuted,
|
|
17345
18019
|
branding,
|
|
17346
18020
|
composerWrapRef,
|
|
18021
|
+
conversationState,
|
|
17347
18022
|
dismissedHandoffs,
|
|
17348
18023
|
draft,
|
|
17349
18024
|
emailDraft,
|
|
18025
|
+
emailError,
|
|
17350
18026
|
error,
|
|
17351
18027
|
handoffPending,
|
|
17352
18028
|
imageInputRef,
|
|
@@ -17363,6 +18039,7 @@ function BrandedPanelBody({
|
|
|
17363
18039
|
onConfirmHandoff,
|
|
17364
18040
|
onDismissHandoff,
|
|
17365
18041
|
onDraftChange,
|
|
18042
|
+
onEmailBlur,
|
|
17366
18043
|
onEmailChange,
|
|
17367
18044
|
onImageSelection,
|
|
17368
18045
|
onNavigate,
|
|
@@ -17394,7 +18071,7 @@ function BrandedPanelBody({
|
|
|
17394
18071
|
toolLabels,
|
|
17395
18072
|
view
|
|
17396
18073
|
}) {
|
|
17397
|
-
return /* @__PURE__ */
|
|
18074
|
+
return /* @__PURE__ */ jsxs20(Fragment7, { children: [
|
|
17398
18075
|
/* @__PURE__ */ jsx36(
|
|
17399
18076
|
PanelHeader,
|
|
17400
18077
|
{
|
|
@@ -17405,7 +18082,7 @@ function BrandedPanelBody({
|
|
|
17405
18082
|
view
|
|
17406
18083
|
}
|
|
17407
18084
|
),
|
|
17408
|
-
/* @__PURE__ */ jsx36("div", { className: "relative flex flex-1 overflow-hidden", children: /* @__PURE__ */ jsx36(AnimatePresence, { custom: activeTransition, initial: false, children: /* @__PURE__ */
|
|
18085
|
+
/* @__PURE__ */ jsx36("div", { className: "relative flex flex-1 overflow-hidden", children: /* @__PURE__ */ jsx36(AnimatePresence, { custom: activeTransition, initial: false, children: /* @__PURE__ */ jsxs20(
|
|
17409
18086
|
motion.div,
|
|
17410
18087
|
{
|
|
17411
18088
|
animate: "center",
|
|
@@ -17420,14 +18097,15 @@ function BrandedPanelBody({
|
|
|
17420
18097
|
{
|
|
17421
18098
|
branding,
|
|
17422
18099
|
conversations: sortedHistory,
|
|
18100
|
+
onPick,
|
|
17423
18101
|
onResume,
|
|
17424
|
-
onStartNew
|
|
18102
|
+
onStartNew,
|
|
18103
|
+
suggestions
|
|
17425
18104
|
}
|
|
17426
18105
|
),
|
|
17427
18106
|
view === "messages" && /* @__PURE__ */ jsx36(
|
|
17428
18107
|
MessagesView,
|
|
17429
18108
|
{
|
|
17430
|
-
activeConversationId: session?.conversationId,
|
|
17431
18109
|
branding,
|
|
17432
18110
|
conversations: sortedHistory,
|
|
17433
18111
|
onResume,
|
|
@@ -17441,9 +18119,11 @@ function BrandedPanelBody({
|
|
|
17441
18119
|
agentMuted,
|
|
17442
18120
|
branding,
|
|
17443
18121
|
composerWrapRef,
|
|
18122
|
+
conversationState,
|
|
17444
18123
|
dismissedHandoffs,
|
|
17445
18124
|
draft,
|
|
17446
18125
|
emailDraft,
|
|
18126
|
+
emailError,
|
|
17447
18127
|
error,
|
|
17448
18128
|
handoffPending,
|
|
17449
18129
|
imageInputRef,
|
|
@@ -17458,6 +18138,7 @@ function BrandedPanelBody({
|
|
|
17458
18138
|
onConfirmHandoff,
|
|
17459
18139
|
onDismissHandoff,
|
|
17460
18140
|
onDraftChange,
|
|
18141
|
+
onEmailBlur,
|
|
17461
18142
|
onEmailChange,
|
|
17462
18143
|
onImageSelection,
|
|
17463
18144
|
onPick,
|
|
@@ -17504,17 +18185,17 @@ function BrandedPanelBody({
|
|
|
17504
18185
|
] });
|
|
17505
18186
|
}
|
|
17506
18187
|
function PanelLoadingShell({ onClose }) {
|
|
17507
|
-
return /* @__PURE__ */
|
|
17508
|
-
/* @__PURE__ */ jsx36("div", { className: "relative flex min-h-[calc(var(--scw-header-padding)*2+var(--scw-header-btn-size))] items-center justify-center gap-2 border-b border-
|
|
18188
|
+
return /* @__PURE__ */ jsxs20(Fragment7, { children: [
|
|
18189
|
+
/* @__PURE__ */ jsx36("div", { className: "relative flex min-h-[calc(var(--scw-header-padding)*2+var(--scw-header-btn-size))] items-center justify-center gap-2 border-b border-border p-[var(--scw-header-padding)]", children: onClose ? /* @__PURE__ */ jsx36(
|
|
17509
18190
|
"button",
|
|
17510
18191
|
{
|
|
17511
18192
|
"aria-label": "Close chat",
|
|
17512
|
-
className: "absolute top-[var(--scw-header-padding)] right-[var(--scw-header-padding)] flex size-[var(--scw-header-btn-size)] shrink-0 items-center justify-center rounded-[var(--scw-header-btn-concentric)] border-none bg-transparent p-0 text-neutral-600 hover:bg-
|
|
18193
|
+
className: "absolute top-[var(--scw-header-padding)] right-[var(--scw-header-padding)] flex size-[var(--scw-header-btn-size)] shrink-0 items-center justify-center rounded-[var(--scw-header-btn-concentric)] border-none bg-transparent p-0 text-neutral-600 hover:bg-neutral-100 hover:text-neutral-700",
|
|
17513
18194
|
onClick: onClose,
|
|
17514
18195
|
type: "button",
|
|
17515
18196
|
children: /* @__PURE__ */ jsx36(CloseIcon, {})
|
|
17516
18197
|
}
|
|
17517
|
-
) }),
|
|
18198
|
+
) : null }),
|
|
17518
18199
|
/* @__PURE__ */ jsx36(
|
|
17519
18200
|
"div",
|
|
17520
18201
|
{
|
|
@@ -17527,34 +18208,42 @@ function PanelLoadingShell({ onClose }) {
|
|
|
17527
18208
|
}
|
|
17528
18209
|
|
|
17529
18210
|
// src/lib/support/Widget.tsx
|
|
17530
|
-
import { jsx as jsx37, jsxs as
|
|
18211
|
+
import { jsx as jsx37, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
17531
18212
|
function SupportWidgetInner({
|
|
17532
18213
|
baseUrl,
|
|
17533
18214
|
getStateSnapshot,
|
|
17534
18215
|
placeholder = "Message...",
|
|
17535
18216
|
projectId,
|
|
18217
|
+
startOpen = false,
|
|
17536
18218
|
suggestions
|
|
17537
18219
|
}) {
|
|
17538
|
-
const
|
|
17539
|
-
const emailStorageKey =
|
|
17540
|
-
|
|
17541
|
-
|
|
18220
|
+
const dashboardPreview = isDashboardPreview();
|
|
18221
|
+
const { emailStorageKey, storageKey } = widgetSessionStorageKeys(
|
|
18222
|
+
projectId,
|
|
18223
|
+
dashboardPreview
|
|
18224
|
+
);
|
|
18225
|
+
const [isOpen, setIsOpen] = useState14(startOpen);
|
|
18226
|
+
const [isOpeningPanel, setIsOpeningPanel] = useState14(startOpen);
|
|
17542
18227
|
const reduceMotion = useReducedMotion();
|
|
17543
|
-
const [view, setView] =
|
|
17544
|
-
const [returnView, setReturnView] =
|
|
17545
|
-
const
|
|
17546
|
-
|
|
18228
|
+
const [view, setView] = useState14("home");
|
|
18229
|
+
const [returnView, setReturnView] = useState14("home");
|
|
18230
|
+
const previewShell2 = useSyncExternalStore2(
|
|
18231
|
+
subscribeToRegistry,
|
|
18232
|
+
getPreviewShell,
|
|
18233
|
+
getPreviewShell
|
|
18234
|
+
);
|
|
18235
|
+
const [branding, setBranding] = useState14(
|
|
18236
|
+
() => previewShell2?.branding ?? readBrandingCache(projectId)
|
|
17547
18237
|
);
|
|
17548
|
-
const [
|
|
17549
|
-
const [
|
|
17550
|
-
const [
|
|
17551
|
-
const [
|
|
17552
|
-
const [pendingImages, setPendingImages] = useState12([]);
|
|
18238
|
+
const [resolvedSuggestions, setResolvedSuggestions] = useState14(previewShell2?.suggestions ?? suggestions ?? DEFAULT_SUGGESTIONS);
|
|
18239
|
+
const [dashboardTools, setDashboardTools] = useState14([]);
|
|
18240
|
+
const [draft, setDraft] = useState14("");
|
|
18241
|
+
const [pendingImages, setPendingImages] = useState14([]);
|
|
17553
18242
|
const pendingImageUrls = useMemo8(
|
|
17554
18243
|
() => pendingImages.map((file) => URL.createObjectURL(file)),
|
|
17555
18244
|
[pendingImages]
|
|
17556
18245
|
);
|
|
17557
|
-
|
|
18246
|
+
useEffect18(
|
|
17558
18247
|
() => () => {
|
|
17559
18248
|
for (const url of pendingImageUrls) {
|
|
17560
18249
|
URL.revokeObjectURL(url);
|
|
@@ -17562,8 +18251,8 @@ function SupportWidgetInner({
|
|
|
17562
18251
|
},
|
|
17563
18252
|
[pendingImageUrls]
|
|
17564
18253
|
);
|
|
17565
|
-
const sentImageUrlsRef =
|
|
17566
|
-
|
|
18254
|
+
const sentImageUrlsRef = useRef15([]);
|
|
18255
|
+
useEffect18(
|
|
17567
18256
|
() => () => {
|
|
17568
18257
|
for (const url of sentImageUrlsRef.current) {
|
|
17569
18258
|
URL.revokeObjectURL(url);
|
|
@@ -17571,30 +18260,25 @@ function SupportWidgetInner({
|
|
|
17571
18260
|
},
|
|
17572
18261
|
[]
|
|
17573
18262
|
);
|
|
17574
|
-
const [emailDraft, setEmailDraft] =
|
|
17575
|
-
const [
|
|
17576
|
-
const [sendError, setSendError] =
|
|
17577
|
-
const [agentMuted, setAgentMuted] =
|
|
17578
|
-
const [conversation, setConversation] =
|
|
18263
|
+
const [emailDraft, setEmailDraft] = useState14("");
|
|
18264
|
+
const [emailTouched, setEmailTouched] = useState14(false);
|
|
18265
|
+
const [sendError, setSendError] = useState14(null);
|
|
18266
|
+
const [agentMuted, setAgentMuted] = useState14(false);
|
|
18267
|
+
const [conversation, setConversation] = useState14(
|
|
17579
18268
|
null
|
|
17580
18269
|
);
|
|
17581
|
-
const [conversationLoaded, setConversationLoaded] =
|
|
17582
|
-
const
|
|
17583
|
-
() => /* @__PURE__ */ new Set()
|
|
17584
|
-
);
|
|
17585
|
-
const [handoffPending, setHandoffPending] = useState12(false);
|
|
17586
|
-
const handoffPendingRef = useRef13(false);
|
|
17587
|
-
const scrollRef = useRef13(null);
|
|
18270
|
+
const [conversationLoaded, setConversationLoaded] = useState14(false);
|
|
18271
|
+
const scrollRef = useRef15(null);
|
|
17588
18272
|
useOverscrollBounce(scrollRef, view === "chat", !!reduceMotion);
|
|
17589
|
-
const scrollReleasedRef =
|
|
17590
|
-
const composerWrapRef =
|
|
17591
|
-
const rootElRef =
|
|
17592
|
-
const textareaRef =
|
|
17593
|
-
const imageInputRef =
|
|
17594
|
-
|
|
18273
|
+
const scrollReleasedRef = useRef15(false);
|
|
18274
|
+
const composerWrapRef = useRef15(null);
|
|
18275
|
+
const rootElRef = useRef15(null);
|
|
18276
|
+
const textareaRef = useRef15(null);
|
|
18277
|
+
const imageInputRef = useRef15(null);
|
|
18278
|
+
useEffect18(() => {
|
|
17595
18279
|
injectStyles();
|
|
17596
18280
|
}, []);
|
|
17597
|
-
|
|
18281
|
+
useEffect18(() => {
|
|
17598
18282
|
const root = rootElRef.current;
|
|
17599
18283
|
if (!root) {
|
|
17600
18284
|
return;
|
|
@@ -17621,20 +18305,25 @@ function SupportWidgetInner({
|
|
|
17621
18305
|
getUserJwt,
|
|
17622
18306
|
getUserJwt
|
|
17623
18307
|
);
|
|
18308
|
+
const identityRef = useRef15(identity2);
|
|
18309
|
+
const userJwtRef = useRef15(userJwt2);
|
|
18310
|
+
const sessionRef = useRef15(null);
|
|
18311
|
+
identityRef.current = identity2;
|
|
18312
|
+
userJwtRef.current = userJwt2;
|
|
18313
|
+
const hostOwnsLauncher2 = useSyncExternalStore2(
|
|
18314
|
+
subscribeToRegistry,
|
|
18315
|
+
getHostOwnsLauncher,
|
|
18316
|
+
getHostOwnsLauncher
|
|
18317
|
+
);
|
|
17624
18318
|
const toolLabels = useMemo8(
|
|
17625
18319
|
() => buildToolDisplayLabelMap(dashboardTools),
|
|
17626
18320
|
[dashboardTools]
|
|
17627
18321
|
);
|
|
17628
|
-
const
|
|
17629
|
-
const
|
|
17630
|
-
const snapshotRef = useRef13(getStateSnapshot);
|
|
17631
|
-
const identityRef = useRef13(identity2);
|
|
17632
|
-
const userJwtRef = useRef13(userJwt2);
|
|
18322
|
+
const toolsRef = useRef15(dashboardTools);
|
|
18323
|
+
const snapshotRef = useRef15(getStateSnapshot);
|
|
17633
18324
|
toolsRef.current = dashboardTools;
|
|
17634
18325
|
snapshotRef.current = getStateSnapshot;
|
|
17635
|
-
|
|
17636
|
-
userJwtRef.current = userJwt2;
|
|
17637
|
-
const openWidget2 = useCallback8(() => {
|
|
18326
|
+
const openWidget2 = useCallback10(() => {
|
|
17638
18327
|
primeMessageChime();
|
|
17639
18328
|
setIsOpeningPanel(true);
|
|
17640
18329
|
setIsOpen(true);
|
|
@@ -17645,22 +18334,28 @@ function SupportWidgetInner({
|
|
|
17645
18334
|
setView("home");
|
|
17646
18335
|
}
|
|
17647
18336
|
}, []);
|
|
17648
|
-
|
|
18337
|
+
const closePanel = useCallback10(() => {
|
|
18338
|
+
if (dashboardPreview) {
|
|
18339
|
+
return;
|
|
18340
|
+
}
|
|
18341
|
+
setIsOpen(false);
|
|
18342
|
+
}, [dashboardPreview]);
|
|
18343
|
+
useLayoutEffect5(() => {
|
|
17649
18344
|
setOpenControls({
|
|
17650
|
-
close:
|
|
18345
|
+
close: closePanel,
|
|
17651
18346
|
open: openWidget2
|
|
17652
18347
|
});
|
|
17653
18348
|
return () => {
|
|
17654
18349
|
setOpenControls(null);
|
|
17655
18350
|
};
|
|
17656
|
-
}, [openWidget2]);
|
|
17657
|
-
|
|
18351
|
+
}, [closePanel, openWidget2]);
|
|
18352
|
+
useEffect18(() => {
|
|
17658
18353
|
if (!isOpen) {
|
|
17659
18354
|
setIsOpeningPanel(false);
|
|
17660
18355
|
}
|
|
17661
18356
|
}, [isOpen]);
|
|
17662
|
-
|
|
17663
|
-
if (!isOpen) {
|
|
18357
|
+
useEffect18(() => {
|
|
18358
|
+
if (!isOpen || dashboardPreview) {
|
|
17664
18359
|
return;
|
|
17665
18360
|
}
|
|
17666
18361
|
function handleKeyDown(event) {
|
|
@@ -17668,143 +18363,20 @@ function SupportWidgetInner({
|
|
|
17668
18363
|
return;
|
|
17669
18364
|
}
|
|
17670
18365
|
event.preventDefault();
|
|
17671
|
-
|
|
18366
|
+
closePanel();
|
|
17672
18367
|
}
|
|
17673
18368
|
window.addEventListener("keydown", handleKeyDown);
|
|
17674
18369
|
return () => {
|
|
17675
18370
|
window.removeEventListener("keydown", handleKeyDown);
|
|
17676
18371
|
};
|
|
17677
|
-
}, [isOpen]);
|
|
17678
|
-
const
|
|
17679
|
-
const
|
|
17680
|
-
const
|
|
17681
|
-
const
|
|
17682
|
-
const
|
|
17683
|
-
const
|
|
17684
|
-
|
|
17685
|
-
const refreshSessionHistory = useCallback8(() => {
|
|
17686
|
-
const jwt = userJwtRef.current;
|
|
17687
|
-
if (jwt) {
|
|
17688
|
-
void (async () => {
|
|
17689
|
-
try {
|
|
17690
|
-
const rows = await listConversations({
|
|
17691
|
-
baseUrl,
|
|
17692
|
-
projectId,
|
|
17693
|
-
userJwt: jwt
|
|
17694
|
-
});
|
|
17695
|
-
setSessionHistory(
|
|
17696
|
-
rows.map((row) => ({
|
|
17697
|
-
conversationId: row.conversationId,
|
|
17698
|
-
preview: row.preview,
|
|
17699
|
-
sessionToken: row.sessionToken,
|
|
17700
|
-
updatedAt: row.updatedAt
|
|
17701
|
-
}))
|
|
17702
|
-
);
|
|
17703
|
-
} catch {
|
|
17704
|
-
setSessionHistory(readSessionHistory(storageKey));
|
|
17705
|
-
}
|
|
17706
|
-
})();
|
|
17707
|
-
return;
|
|
17708
|
-
}
|
|
17709
|
-
setSessionHistory(readSessionHistory(storageKey));
|
|
17710
|
-
}, [baseUrl, projectId, storageKey]);
|
|
17711
|
-
useEffect16(() => {
|
|
17712
|
-
const stored = readStoredSession(storageKey);
|
|
17713
|
-
sessionRef.current = stored;
|
|
17714
|
-
setSession(stored);
|
|
17715
|
-
if (stored) {
|
|
17716
|
-
ensureActiveSessionInHistory(storageKey, stored);
|
|
17717
|
-
}
|
|
17718
|
-
refreshSessionHistory();
|
|
17719
|
-
}, [refreshSessionHistory, storageKey]);
|
|
17720
|
-
const resumedJwtRef = useRef13(null);
|
|
17721
|
-
useEffect16(() => {
|
|
17722
|
-
if (!userJwt2 || resumedJwtRef.current === userJwt2) {
|
|
17723
|
-
return;
|
|
17724
|
-
}
|
|
17725
|
-
const jwt = userJwt2;
|
|
17726
|
-
resumedJwtRef.current = jwt;
|
|
17727
|
-
let cancelled = false;
|
|
17728
|
-
async function resume() {
|
|
17729
|
-
try {
|
|
17730
|
-
const resumed = await resumeSession({
|
|
17731
|
-
baseUrl,
|
|
17732
|
-
projectId,
|
|
17733
|
-
userJwt: jwt
|
|
17734
|
-
});
|
|
17735
|
-
if (cancelled || !resumed) {
|
|
17736
|
-
return;
|
|
17737
|
-
}
|
|
17738
|
-
const next = {
|
|
17739
|
-
conversationId: resumed.conversationId,
|
|
17740
|
-
sessionToken: resumed.sessionToken
|
|
17741
|
-
};
|
|
17742
|
-
sessionRef.current = next;
|
|
17743
|
-
setSession(next);
|
|
17744
|
-
storeSession(storageKey, next);
|
|
17745
|
-
ensureActiveSessionInHistory(storageKey, next);
|
|
17746
|
-
setConversation(resumed.conversation);
|
|
17747
|
-
setConversationLoaded(true);
|
|
17748
|
-
setAgentMuted(!resumed.conversation.agentEnabled);
|
|
17749
|
-
refreshSessionHistory();
|
|
17750
|
-
} catch {
|
|
17751
|
-
resumedJwtRef.current = null;
|
|
17752
|
-
}
|
|
17753
|
-
}
|
|
17754
|
-
void resume();
|
|
17755
|
-
return () => {
|
|
17756
|
-
cancelled = true;
|
|
17757
|
-
};
|
|
17758
|
-
}, [baseUrl, projectId, userJwt2, refreshSessionHistory, storageKey]);
|
|
17759
|
-
const prevOwnerRef = useRef13(void 0);
|
|
17760
|
-
const prevJwtPresentRef = useRef13(false);
|
|
17761
|
-
useEffect16(() => {
|
|
17762
|
-
const ownerId = identity2?.distinctId ?? identity2?.email ?? null;
|
|
17763
|
-
const jwtPresent = Boolean(userJwt2);
|
|
17764
|
-
const previousOwner = prevOwnerRef.current;
|
|
17765
|
-
const previousJwtPresent = prevJwtPresentRef.current;
|
|
17766
|
-
prevOwnerRef.current = ownerId;
|
|
17767
|
-
prevJwtPresentRef.current = jwtPresent;
|
|
17768
|
-
function wipeForIdentitySwitch() {
|
|
17769
|
-
resetChatState();
|
|
17770
|
-
sessionRef.current = null;
|
|
17771
|
-
setSession(null);
|
|
17772
|
-
resumedJwtRef.current = null;
|
|
17773
|
-
try {
|
|
17774
|
-
window.localStorage.removeItem(emailStorageKey);
|
|
17775
|
-
} catch {
|
|
17776
|
-
}
|
|
17777
|
-
setCapturedEmail(null);
|
|
17778
|
-
refreshSessionHistory();
|
|
17779
|
-
}
|
|
17780
|
-
if (ownerId) {
|
|
17781
|
-
const { cleared } = reconcileSessionOwner(storageKey, ownerId);
|
|
17782
|
-
if (cleared) {
|
|
17783
|
-
wipeForIdentitySwitch();
|
|
17784
|
-
} else {
|
|
17785
|
-
refreshSessionHistory();
|
|
17786
|
-
}
|
|
17787
|
-
return;
|
|
17788
|
-
}
|
|
17789
|
-
if ((previousOwner || previousJwtPresent) && !jwtPresent) {
|
|
17790
|
-
clearChatStorage(storageKey);
|
|
17791
|
-
wipeForIdentitySwitch();
|
|
17792
|
-
return;
|
|
17793
|
-
}
|
|
17794
|
-
if (jwtPresent) {
|
|
17795
|
-
refreshSessionHistory();
|
|
17796
|
-
}
|
|
17797
|
-
}, [identity2, userJwt2, storageKey, emailStorageKey, refreshSessionHistory]);
|
|
17798
|
-
useEffect16(() => {
|
|
17799
|
-
try {
|
|
17800
|
-
const stored = window.localStorage.getItem(emailStorageKey);
|
|
17801
|
-
if (stored) {
|
|
17802
|
-
setCapturedEmail(stored);
|
|
17803
|
-
}
|
|
17804
|
-
} catch {
|
|
17805
|
-
}
|
|
17806
|
-
}, [emailStorageKey]);
|
|
17807
|
-
useEffect16(() => {
|
|
18372
|
+
}, [closePanel, dashboardPreview, isOpen]);
|
|
18373
|
+
const mergedIdsRef = useRef15(/* @__PURE__ */ new Set());
|
|
18374
|
+
const reportedSeenMessageIdsRef = useRef15(/* @__PURE__ */ new Set());
|
|
18375
|
+
const seededRef = useRef15(false);
|
|
18376
|
+
const brandingFetchStartedRef = useRef15(false);
|
|
18377
|
+
const pendingPersistRef = useRef15(null);
|
|
18378
|
+
const sendInFlightRef = useRef15(false);
|
|
18379
|
+
useEffect18(() => {
|
|
17808
18380
|
if (brandingFetchStartedRef.current) {
|
|
17809
18381
|
return;
|
|
17810
18382
|
}
|
|
@@ -17814,8 +18386,15 @@ function SupportWidgetInner({
|
|
|
17814
18386
|
try {
|
|
17815
18387
|
const result = await getWidgetConfig({ baseUrl, projectId });
|
|
17816
18388
|
if (!cancelled) {
|
|
17817
|
-
|
|
17818
|
-
|
|
18389
|
+
if (!dashboardPreview) {
|
|
18390
|
+
writeBrandingCache(projectId, result.branding);
|
|
18391
|
+
}
|
|
18392
|
+
if (!getPreviewShell()) {
|
|
18393
|
+
setBranding(result.branding);
|
|
18394
|
+
if (Array.isArray(result.suggestions)) {
|
|
18395
|
+
setResolvedSuggestions(result.suggestions);
|
|
18396
|
+
}
|
|
18397
|
+
}
|
|
17819
18398
|
setDashboardTools(
|
|
17820
18399
|
result.tools.map((tool) => reconstructDashboardTool(tool))
|
|
17821
18400
|
);
|
|
@@ -17831,8 +18410,15 @@ function SupportWidgetInner({
|
|
|
17831
18410
|
return () => {
|
|
17832
18411
|
cancelled = true;
|
|
17833
18412
|
};
|
|
17834
|
-
}, [baseUrl, projectId]);
|
|
17835
|
-
|
|
18413
|
+
}, [baseUrl, dashboardPreview, projectId]);
|
|
18414
|
+
useEffect18(() => {
|
|
18415
|
+
if (!previewShell2) {
|
|
18416
|
+
return;
|
|
18417
|
+
}
|
|
18418
|
+
setBranding(previewShell2.branding);
|
|
18419
|
+
setResolvedSuggestions(previewShell2.suggestions);
|
|
18420
|
+
}, [previewShell2]);
|
|
18421
|
+
const runTool = useCallback10((toolCall) => {
|
|
17836
18422
|
const match = toolsRef.current.find(
|
|
17837
18423
|
(entry) => normalizeToolName(entry.name) === toolCall.toolName
|
|
17838
18424
|
);
|
|
@@ -17850,7 +18436,7 @@ function SupportWidgetInner({
|
|
|
17850
18436
|
}
|
|
17851
18437
|
return match.execute(toolCall.input ?? {});
|
|
17852
18438
|
}, []);
|
|
17853
|
-
const onToolCallRef =
|
|
18439
|
+
const onToolCallRef = useRef15(() => {
|
|
17854
18440
|
});
|
|
17855
18441
|
const {
|
|
17856
18442
|
addToolApprovalResponse,
|
|
@@ -17880,9 +18466,9 @@ function SupportWidgetInner({
|
|
|
17880
18466
|
messages: outgoing,
|
|
17881
18467
|
projectId,
|
|
17882
18468
|
sessionToken: sessionRef.current?.sessionToken ?? "",
|
|
17883
|
-
stateSnapshot:
|
|
17884
|
-
|
|
17885
|
-
|
|
18469
|
+
stateSnapshot: pickScalarRecord({
|
|
18470
|
+
...identityRef.current?.traits,
|
|
18471
|
+
...isRecord(liveSnapshot) ? liveSnapshot : {}
|
|
17886
18472
|
}),
|
|
17887
18473
|
userJwt: userJwtRef.current ?? void 0
|
|
17888
18474
|
}
|
|
@@ -17906,70 +18492,68 @@ function SupportWidgetInner({
|
|
|
17906
18492
|
}
|
|
17907
18493
|
return onToolCall(event);
|
|
17908
18494
|
};
|
|
18495
|
+
function resetChatState() {
|
|
18496
|
+
stop();
|
|
18497
|
+
setMessages([]);
|
|
18498
|
+
clearPending();
|
|
18499
|
+
mergedIdsRef.current = /* @__PURE__ */ new Set();
|
|
18500
|
+
reportedSeenMessageIdsRef.current = /* @__PURE__ */ new Set();
|
|
18501
|
+
seededRef.current = false;
|
|
18502
|
+
setAgentMuted(false);
|
|
18503
|
+
setConversation(null);
|
|
18504
|
+
setConversationLoaded(false);
|
|
18505
|
+
setSendError(null);
|
|
18506
|
+
setDraft("");
|
|
18507
|
+
setPendingImages([]);
|
|
18508
|
+
}
|
|
18509
|
+
const {
|
|
18510
|
+
capturedEmail,
|
|
18511
|
+
refreshSessionHistory,
|
|
18512
|
+
session,
|
|
18513
|
+
sessionHistory,
|
|
18514
|
+
setCapturedEmail,
|
|
18515
|
+
setSession
|
|
18516
|
+
} = useVisitorConversationPersistence({
|
|
18517
|
+
baseUrl,
|
|
18518
|
+
emailStorageKey,
|
|
18519
|
+
identity: identity2,
|
|
18520
|
+
onIdentityWipe: resetChatState,
|
|
18521
|
+
onResumed: (resumedConversation) => {
|
|
18522
|
+
setConversation(resumedConversation);
|
|
18523
|
+
setConversationLoaded(true);
|
|
18524
|
+
setAgentMuted(!resumedConversation.agentEnabled);
|
|
18525
|
+
},
|
|
18526
|
+
projectId,
|
|
18527
|
+
sessionRef,
|
|
18528
|
+
storageKey,
|
|
18529
|
+
userJwt: userJwt2
|
|
18530
|
+
});
|
|
18531
|
+
const knownEmail = identity2?.email ?? capturedEmail;
|
|
17909
18532
|
const isLoading = status === "submitted" || status === "streaming";
|
|
17910
|
-
const messagesRef =
|
|
18533
|
+
const messagesRef = useRef15(messages);
|
|
17911
18534
|
messagesRef.current = messages;
|
|
17912
|
-
const isLoadingRef =
|
|
18535
|
+
const isLoadingRef = useRef15(isLoading);
|
|
17913
18536
|
isLoadingRef.current = isLoading;
|
|
17914
18537
|
const { chimedMessageIdsRef } = useInboundMessageChime({
|
|
17915
18538
|
isLoading,
|
|
17916
18539
|
messages
|
|
17917
18540
|
});
|
|
17918
18541
|
const isTakeoverError = !!error && error.message.includes("human_takeover");
|
|
17919
|
-
|
|
18542
|
+
useEffect18(() => {
|
|
17920
18543
|
if (isTakeoverError) {
|
|
17921
18544
|
setAgentMuted(true);
|
|
17922
18545
|
}
|
|
17923
18546
|
}, [isTakeoverError]);
|
|
17924
|
-
const confirmHandoff =
|
|
17925
|
-
|
|
17926
|
-
|
|
17927
|
-
|
|
17928
|
-
|
|
17929
|
-
|
|
17930
|
-
|
|
17931
|
-
|
|
17932
|
-
|
|
17933
|
-
|
|
17934
|
-
baseUrl,
|
|
17935
|
-
conversationId: active.conversationId,
|
|
17936
|
-
projectId,
|
|
17937
|
-
reason,
|
|
17938
|
-
sessionToken: active.sessionToken
|
|
17939
|
-
});
|
|
17940
|
-
setAgentMuted(true);
|
|
17941
|
-
if (result.acknowledgment) {
|
|
17942
|
-
mergedIdsRef.current.add(result.acknowledgment.id);
|
|
17943
|
-
setMessages([
|
|
17944
|
-
...messagesRef.current,
|
|
17945
|
-
toUiMessage(result.acknowledgment)
|
|
17946
|
-
]);
|
|
17947
|
-
}
|
|
17948
|
-
} catch {
|
|
17949
|
-
} finally {
|
|
17950
|
-
handoffPendingRef.current = false;
|
|
17951
|
-
setHandoffPending(false);
|
|
17952
|
-
}
|
|
17953
|
-
},
|
|
17954
|
-
[baseUrl, projectId, setMessages]
|
|
17955
|
-
);
|
|
17956
|
-
const dismissHandoff = useCallback8(
|
|
17957
|
-
(toolCallId) => {
|
|
17958
|
-
setDismissedHandoffs((prev) => {
|
|
17959
|
-
if (prev.has(toolCallId)) {
|
|
17960
|
-
return prev;
|
|
17961
|
-
}
|
|
17962
|
-
const next = new Set(prev);
|
|
17963
|
-
next.add(toolCallId);
|
|
17964
|
-
return next;
|
|
17965
|
-
});
|
|
17966
|
-
setMessages(
|
|
17967
|
-
(current) => markHandoffDeclinedInMessages(current, toolCallId)
|
|
17968
|
-
);
|
|
17969
|
-
},
|
|
17970
|
-
[setMessages]
|
|
17971
|
-
);
|
|
17972
|
-
useEffect16(() => {
|
|
18547
|
+
const { confirmHandoff, dismissedHandoffs, dismissHandoff, handoffPending } = useHandoffDecisions({
|
|
18548
|
+
baseUrl,
|
|
18549
|
+
mergedIdsRef,
|
|
18550
|
+
messagesRef,
|
|
18551
|
+
onAccepted: () => setAgentMuted(true),
|
|
18552
|
+
projectId,
|
|
18553
|
+
sessionRef,
|
|
18554
|
+
setMessages
|
|
18555
|
+
});
|
|
18556
|
+
useEffect18(() => {
|
|
17973
18557
|
if (!isOpen || !session) {
|
|
17974
18558
|
return;
|
|
17975
18559
|
}
|
|
@@ -18018,7 +18602,7 @@ function SupportWidgetInner({
|
|
|
18018
18602
|
setDraft(value);
|
|
18019
18603
|
reportDraftActivity(value);
|
|
18020
18604
|
}
|
|
18021
|
-
const reportTeamMessagesSeen =
|
|
18605
|
+
const reportTeamMessagesSeen = useCallback10(
|
|
18022
18606
|
(messageIds) => {
|
|
18023
18607
|
const activeSession = sessionRef.current;
|
|
18024
18608
|
const unseenMessageIds = messageIds.filter(
|
|
@@ -18045,7 +18629,7 @@ function SupportWidgetInner({
|
|
|
18045
18629
|
},
|
|
18046
18630
|
[baseUrl, projectId]
|
|
18047
18631
|
);
|
|
18048
|
-
|
|
18632
|
+
useEffect18(() => {
|
|
18049
18633
|
if (!conversation) {
|
|
18050
18634
|
return;
|
|
18051
18635
|
}
|
|
@@ -18092,7 +18676,11 @@ function SupportWidgetInner({
|
|
|
18092
18676
|
el.style.height = `${Math.min(el.scrollHeight, MAX_TEXTAREA_HEIGHT_PX)}px`;
|
|
18093
18677
|
}, [draft]);
|
|
18094
18678
|
const needsEmail = !session && !knownEmail;
|
|
18679
|
+
const emailError = needsEmail && emailTouched ? resolveEmailDraftError(emailDraft) : null;
|
|
18095
18680
|
async function handleSubmit(event) {
|
|
18681
|
+
if (needsEmail) {
|
|
18682
|
+
setEmailTouched(true);
|
|
18683
|
+
}
|
|
18096
18684
|
stopTyping();
|
|
18097
18685
|
await submitWidgetMessage(event, {
|
|
18098
18686
|
agentMuted,
|
|
@@ -18131,20 +18719,6 @@ function SupportWidgetInner({
|
|
|
18131
18719
|
function removePendingImage(index2) {
|
|
18132
18720
|
setPendingImages((current) => current.filter((_, i) => i !== index2));
|
|
18133
18721
|
}
|
|
18134
|
-
function resetChatState() {
|
|
18135
|
-
stop();
|
|
18136
|
-
setMessages([]);
|
|
18137
|
-
clearPending();
|
|
18138
|
-
mergedIdsRef.current = /* @__PURE__ */ new Set();
|
|
18139
|
-
reportedSeenMessageIdsRef.current = /* @__PURE__ */ new Set();
|
|
18140
|
-
seededRef.current = false;
|
|
18141
|
-
setAgentMuted(false);
|
|
18142
|
-
setConversation(null);
|
|
18143
|
-
setConversationLoaded(false);
|
|
18144
|
-
setSendError(null);
|
|
18145
|
-
setDraft("");
|
|
18146
|
-
setPendingImages([]);
|
|
18147
|
-
}
|
|
18148
18722
|
function startNewConversation() {
|
|
18149
18723
|
startNewConversationAction({
|
|
18150
18724
|
resetChatState,
|
|
@@ -18170,6 +18744,9 @@ function SupportWidgetInner({
|
|
|
18170
18744
|
});
|
|
18171
18745
|
}
|
|
18172
18746
|
function pickSuggestion(prompt) {
|
|
18747
|
+
if (view !== "chat") {
|
|
18748
|
+
startNewConversation();
|
|
18749
|
+
}
|
|
18173
18750
|
handleDraftChange(prompt);
|
|
18174
18751
|
textareaRef.current?.focus();
|
|
18175
18752
|
}
|
|
@@ -18190,15 +18767,15 @@ function SupportWidgetInner({
|
|
|
18190
18767
|
conversation,
|
|
18191
18768
|
conversationLoaded
|
|
18192
18769
|
});
|
|
18193
|
-
const prevViewRef =
|
|
18770
|
+
const prevViewRef = useRef15(view);
|
|
18194
18771
|
const viewTransition = useMemo8(
|
|
18195
18772
|
() => deriveViewTransition(view, prevViewRef.current),
|
|
18196
18773
|
[view]
|
|
18197
18774
|
);
|
|
18198
|
-
|
|
18775
|
+
useEffect18(() => {
|
|
18199
18776
|
prevViewRef.current = view;
|
|
18200
18777
|
}, [view]);
|
|
18201
|
-
|
|
18778
|
+
useEffect18(() => {
|
|
18202
18779
|
if (isOpen && view === "chat") {
|
|
18203
18780
|
focusComposer(textareaRef);
|
|
18204
18781
|
}
|
|
@@ -18208,12 +18785,13 @@ function SupportWidgetInner({
|
|
|
18208
18785
|
viewTransition
|
|
18209
18786
|
);
|
|
18210
18787
|
const isFullscreen = isOpen && isMobile;
|
|
18211
|
-
return /* @__PURE__ */
|
|
18788
|
+
return /* @__PURE__ */ jsxs21(
|
|
18212
18789
|
"div",
|
|
18213
18790
|
{
|
|
18214
18791
|
className: cn(
|
|
18215
|
-
"box-border flex
|
|
18792
|
+
"box-border flex flex-none flex-col text-sm leading-[1.45] text-neutral-900 [&_*]:box-border",
|
|
18216
18793
|
"[font-family:var(--scw-font)]",
|
|
18794
|
+
dashboardPreview ? "h-full w-full max-w-full items-center justify-center p-0" : hostOwnsLauncher2 ? "w-max items-end p-0" : "w-max items-end gap-3 p-4",
|
|
18217
18795
|
isFullscreen && "h-full w-full p-0"
|
|
18218
18796
|
),
|
|
18219
18797
|
ref: rootElRef,
|
|
@@ -18228,6 +18806,7 @@ function SupportWidgetInner({
|
|
|
18228
18806
|
dismissedHandoffs,
|
|
18229
18807
|
draft,
|
|
18230
18808
|
emailDraft,
|
|
18809
|
+
emailError,
|
|
18231
18810
|
error,
|
|
18232
18811
|
handoffPending,
|
|
18233
18812
|
imageInputRef,
|
|
@@ -18236,15 +18815,17 @@ function SupportWidgetInner({
|
|
|
18236
18815
|
isLoading,
|
|
18237
18816
|
isLoadingMessages,
|
|
18238
18817
|
isOpeningPanel,
|
|
18818
|
+
hostOwnsLauncher: hostOwnsLauncher2,
|
|
18239
18819
|
isTakeoverError,
|
|
18240
18820
|
messages,
|
|
18241
18821
|
needsEmail,
|
|
18242
18822
|
onApprove: approve,
|
|
18243
18823
|
onBack: () => setView(returnView),
|
|
18244
|
-
onClose:
|
|
18824
|
+
onClose: dashboardPreview ? void 0 : closePanel,
|
|
18245
18825
|
onConfirmHandoff: confirmHandoff,
|
|
18246
18826
|
onDismissHandoff: dismissHandoff,
|
|
18247
18827
|
onDraftChange: handleDraftChange,
|
|
18828
|
+
onEmailBlur: () => setEmailTouched(true),
|
|
18248
18829
|
onEmailChange: setEmailDraft,
|
|
18249
18830
|
onImageSelection: handleImageSelection,
|
|
18250
18831
|
onNavigate: setView,
|
|
@@ -18275,19 +18856,20 @@ function SupportWidgetInner({
|
|
|
18275
18856
|
session,
|
|
18276
18857
|
showThinking,
|
|
18277
18858
|
sortedHistory,
|
|
18278
|
-
suggestions:
|
|
18859
|
+
suggestions: resolvedSuggestions,
|
|
18279
18860
|
textareaRef,
|
|
18280
18861
|
typingLabel,
|
|
18281
18862
|
conversationLoaded,
|
|
18863
|
+
conversationState: conversation?.state ?? null,
|
|
18282
18864
|
toolLabels,
|
|
18283
18865
|
view
|
|
18284
18866
|
}
|
|
18285
18867
|
) }),
|
|
18286
|
-
!isFullscreen && /* @__PURE__ */ jsx37(
|
|
18868
|
+
!isFullscreen && !hostOwnsLauncher2 && !dashboardPreview && /* @__PURE__ */ jsx37(
|
|
18287
18869
|
WidgetLauncher,
|
|
18288
18870
|
{
|
|
18289
18871
|
isOpen,
|
|
18290
|
-
onClose:
|
|
18872
|
+
onClose: closePanel,
|
|
18291
18873
|
onOpen: openWidget2,
|
|
18292
18874
|
reduceMotion
|
|
18293
18875
|
}
|