@sevenfold/setto-client 0.44.0 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -97,6 +97,13 @@ export declare function insertMention(value: string, name: string, at: {
|
|
|
97
97
|
value: string;
|
|
98
98
|
caret: number;
|
|
99
99
|
};
|
|
100
|
+
/** The visitor's conversations: those still going first, then those that have ended. */
|
|
101
|
+
export declare function chatGroups<T extends {
|
|
102
|
+
status: 'bot' | 'human' | 'closed';
|
|
103
|
+
}>(chats: readonly T[]): Array<{
|
|
104
|
+
ended: boolean;
|
|
105
|
+
chats: T[];
|
|
106
|
+
}>;
|
|
100
107
|
/**
|
|
101
108
|
* «Translated from English · Show original» under a translated message, in
|
|
102
109
|
* the visitor's language. The toggle is a real button; the line is left out
|
package/dist/setto-client.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { useState, useRef, useEffect, useMemo, useId, useInsertionEffect, useLayoutEffect, Children, createContext, useContext, useCallback, useSyncExternalStore, forwardRef
|
|
3
|
+
import { useState, useRef, useEffect, useMemo, useId, Fragment as Fragment$1, useInsertionEffect, useLayoutEffect, Children, createContext, useContext, useCallback, useSyncExternalStore, forwardRef } from "react";
|
|
4
4
|
import { useTranslation } from "react-i18next";
|
|
5
5
|
import * as ReactDOM from "react-dom";
|
|
6
6
|
import { createPortal } from "react-dom";
|
|
@@ -35575,6 +35575,12 @@ function CloseIcon({ size = 22 }) {
|
|
|
35575
35575
|
}
|
|
35576
35576
|
) });
|
|
35577
35577
|
}
|
|
35578
|
+
function chatGroups(chats) {
|
|
35579
|
+
return [false, true].map((ended) => ({ ended, chats: chats.filter((chat) => chat.status === "closed" === ended) })).filter((group) => group.chats.length > 0);
|
|
35580
|
+
}
|
|
35581
|
+
function CheckIcon$1() {
|
|
35582
|
+
return /* @__PURE__ */ jsx("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M5 12.5l4.5 4.5L19 7.5" }) });
|
|
35583
|
+
}
|
|
35578
35584
|
function PlusIcon() {
|
|
35579
35585
|
return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "18", height: "18", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
|
|
35580
35586
|
"path",
|
|
@@ -36265,6 +36271,8 @@ function SettoChat() {
|
|
|
36265
36271
|
const [queued, setQueued] = useState(false);
|
|
36266
36272
|
const [loadingConversation, setLoadingConversation] = useState(false);
|
|
36267
36273
|
const [humanJoined, setHumanJoined] = useState(false);
|
|
36274
|
+
const [ended, setEnded] = useState(false);
|
|
36275
|
+
const [ending, setEnding] = useState(false);
|
|
36268
36276
|
const [originals, setOriginals] = useState(() => /* @__PURE__ */ new Set());
|
|
36269
36277
|
const [availability, setAvailability] = useState({
|
|
36270
36278
|
humanAvailable: false,
|
|
@@ -36364,7 +36372,10 @@ function SettoChat() {
|
|
|
36364
36372
|
failed: "Jeg får ikke svart akkurat nå. Kontakt gjerne teamet direkte.",
|
|
36365
36373
|
image: "Bilde",
|
|
36366
36374
|
seen: "Sett",
|
|
36367
|
-
emptyChats: "Nye samtaler du starter her vises i denne listen."
|
|
36375
|
+
emptyChats: "Nye samtaler du starter her vises i denne listen.",
|
|
36376
|
+
endChat: "Avslutt samtalen",
|
|
36377
|
+
endedChats: "Avsluttet",
|
|
36378
|
+
startNew: "Start en ny samtale"
|
|
36368
36379
|
} : {
|
|
36369
36380
|
open: siteName ? `Open chat with ${siteName}` : "Open chat",
|
|
36370
36381
|
close: "Close chat",
|
|
@@ -36389,7 +36400,10 @@ function SettoChat() {
|
|
|
36389
36400
|
failed: "I cannot reply right now. Please contact the team directly.",
|
|
36390
36401
|
image: "Image",
|
|
36391
36402
|
seen: "Seen",
|
|
36392
|
-
emptyChats: "New conversations you start here will appear in this list."
|
|
36403
|
+
emptyChats: "New conversations you start here will appear in this list.",
|
|
36404
|
+
endChat: "End this conversation",
|
|
36405
|
+
endedChats: "Ended",
|
|
36406
|
+
startNew: "Start a new conversation"
|
|
36393
36407
|
};
|
|
36394
36408
|
function ensureVisitor() {
|
|
36395
36409
|
return visitor.current ??= visitorId();
|
|
@@ -36445,6 +36459,7 @@ function SettoChat() {
|
|
|
36445
36459
|
rememberConversation(next.conversationId);
|
|
36446
36460
|
loadedConversationRef.current = next.conversationId;
|
|
36447
36461
|
setHumanJoined(next.humanJoined);
|
|
36462
|
+
setEnded(next.status === "closed");
|
|
36448
36463
|
setMessages(next.messages);
|
|
36449
36464
|
const supported = "realtimeTopic" in next || "teamReadAt" in next || "visitorReadAt" in next;
|
|
36450
36465
|
const serverTeamReadAt = typeof next.teamReadAt === "string" ? next.teamReadAt : null;
|
|
@@ -36527,6 +36542,31 @@ function SettoChat() {
|
|
|
36527
36542
|
useEffect(() => {
|
|
36528
36543
|
refreshRef.current = refreshConversation;
|
|
36529
36544
|
});
|
|
36545
|
+
async function endConversation() {
|
|
36546
|
+
const id = conversationId.current;
|
|
36547
|
+
const visitorIdValue = visitor.current;
|
|
36548
|
+
if (!id || !visitorIdValue || ending) return;
|
|
36549
|
+
setEnding(true);
|
|
36550
|
+
try {
|
|
36551
|
+
const response = await fetch(
|
|
36552
|
+
`${apiUrl}/sites/${encodeURIComponent(config.siteId)}/chat/conversations/${encodeURIComponent(id)}/public/close`,
|
|
36553
|
+
{
|
|
36554
|
+
method: "POST",
|
|
36555
|
+
headers: { Accept: "application/json", "Content-Type": "application/json" },
|
|
36556
|
+
body: JSON.stringify({ visitorId: visitorIdValue })
|
|
36557
|
+
}
|
|
36558
|
+
);
|
|
36559
|
+
if (!response.ok) return;
|
|
36560
|
+
typingSender().stop();
|
|
36561
|
+
setEnded(true);
|
|
36562
|
+
setDrawer(false);
|
|
36563
|
+
void refreshConversation();
|
|
36564
|
+
void loadChats();
|
|
36565
|
+
} catch {
|
|
36566
|
+
} finally {
|
|
36567
|
+
setEnding(false);
|
|
36568
|
+
}
|
|
36569
|
+
}
|
|
36530
36570
|
async function loadConversation(id) {
|
|
36531
36571
|
const visitorIdValue = ensureVisitor();
|
|
36532
36572
|
setLoadingConversation(true);
|
|
@@ -36719,6 +36759,7 @@ function SettoChat() {
|
|
|
36719
36759
|
setRealtime(null);
|
|
36720
36760
|
setTeamTypingUntil(null);
|
|
36721
36761
|
setHumanJoined(false);
|
|
36762
|
+
setEnded(false);
|
|
36722
36763
|
setMessages(welcomeMessages());
|
|
36723
36764
|
setDraft("");
|
|
36724
36765
|
setTapped(/* @__PURE__ */ new Set());
|
|
@@ -36902,22 +36943,40 @@ function SettoChat() {
|
|
|
36902
36943
|
/* @__PURE__ */ jsx(PlusIcon, {}),
|
|
36903
36944
|
labels.newChat
|
|
36904
36945
|
] }),
|
|
36905
|
-
|
|
36946
|
+
conversationId.current && !ended ? /* @__PURE__ */ jsxs(
|
|
36906
36947
|
"button",
|
|
36907
36948
|
{
|
|
36908
|
-
className:
|
|
36949
|
+
className: "setto-chat__new setto-chat__end",
|
|
36909
36950
|
type: "button",
|
|
36910
|
-
onClick: () => void
|
|
36951
|
+
onClick: () => void endConversation(),
|
|
36952
|
+
disabled: ending || sending,
|
|
36911
36953
|
children: [
|
|
36912
|
-
/* @__PURE__ */ jsx(
|
|
36913
|
-
|
|
36914
|
-
isNo ? "nb-NO" : "en-GB",
|
|
36915
|
-
{ day: "numeric", month: "short" }
|
|
36916
|
-
) })
|
|
36954
|
+
/* @__PURE__ */ jsx(CheckIcon$1, {}),
|
|
36955
|
+
labels.endChat
|
|
36917
36956
|
]
|
|
36918
|
-
}
|
|
36919
|
-
|
|
36920
|
-
|
|
36957
|
+
}
|
|
36958
|
+
) : null,
|
|
36959
|
+
/* @__PURE__ */ jsx("div", { className: "setto-chat__chat-list", children: conversations.length ? chatGroups(conversations).map(({ ended: closedGroup, chats: group }) => {
|
|
36960
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
36961
|
+
closedGroup ? /* @__PURE__ */ jsx("span", { className: "setto-chat__chat-group", children: labels.endedChats }) : null,
|
|
36962
|
+
group.map((chat) => /* @__PURE__ */ jsxs(
|
|
36963
|
+
"button",
|
|
36964
|
+
{
|
|
36965
|
+
className: `setto-chat__chat-row${conversationId.current === chat.id ? " is-active" : ""}${closedGroup ? " is-ended" : ""}`,
|
|
36966
|
+
type: "button",
|
|
36967
|
+
onClick: () => void loadConversation(chat.id),
|
|
36968
|
+
children: [
|
|
36969
|
+
/* @__PURE__ */ jsx("span", { children: chat.preview }),
|
|
36970
|
+
/* @__PURE__ */ jsx("time", { children: new Date(chat.lastActivityAt).toLocaleDateString(
|
|
36971
|
+
isNo ? "nb-NO" : "en-GB",
|
|
36972
|
+
{ day: "numeric", month: "short" }
|
|
36973
|
+
) })
|
|
36974
|
+
]
|
|
36975
|
+
},
|
|
36976
|
+
chat.id
|
|
36977
|
+
))
|
|
36978
|
+
] }, closedGroup ? "ended" : "open");
|
|
36979
|
+
}) : /* @__PURE__ */ jsx("p", { children: labels.emptyChats }) })
|
|
36921
36980
|
]
|
|
36922
36981
|
}
|
|
36923
36982
|
),
|
|
@@ -37027,7 +37086,11 @@ function SettoChat() {
|
|
|
37027
37086
|
}
|
|
37028
37087
|
),
|
|
37029
37088
|
/* @__PURE__ */ jsxs("div", { className: "setto-chat__composer-shell", ref: composerShellRef, children: [
|
|
37030
|
-
|
|
37089
|
+
ended ? /* @__PURE__ */ jsx("div", { className: "setto-chat__ended", children: /* @__PURE__ */ jsxs("button", { type: "button", onClick: startNew, children: [
|
|
37090
|
+
/* @__PURE__ */ jsx(PlusIcon, {}),
|
|
37091
|
+
labels.startNew
|
|
37092
|
+
] }) }) : null,
|
|
37093
|
+
!ended && nearby.length ? /* @__PURE__ */ jsxs("div", { className: "setto-chat__team", children: [
|
|
37031
37094
|
teamRowLabelled(nearby) ? /* @__PURE__ */ jsx("span", { className: "setto-chat__team-label", children: labels.teamRow }) : null,
|
|
37032
37095
|
nearby.map((human) => /* @__PURE__ */ jsxs(
|
|
37033
37096
|
"button",
|
|
@@ -37049,7 +37112,7 @@ function SettoChat() {
|
|
|
37049
37112
|
human.handle
|
|
37050
37113
|
))
|
|
37051
37114
|
] }) : null,
|
|
37052
|
-
/* @__PURE__ */ jsx(
|
|
37115
|
+
ended ? null : /* @__PURE__ */ jsx(
|
|
37053
37116
|
SiteChatComposer,
|
|
37054
37117
|
{
|
|
37055
37118
|
value: draft,
|
|
@@ -37141,7 +37204,7 @@ function useChatStyles() {
|
|
|
37141
37204
|
style.textContent = `
|
|
37142
37205
|
.setto-chat__markdown{display:block;min-width:0;white-space:normal}.setto-chat__markdown> :first-child{margin-top:0}.setto-chat__markdown> :last-child{margin-bottom:0}.setto-chat__markdown p{margin:0 0 .72em}.setto-chat__markdown h1,.setto-chat__markdown h2,.setto-chat__markdown h3{margin:.95em 0 .36em;font-size:1em;font-weight:680;line-height:1.28;letter-spacing:-.012em}.setto-chat__markdown h1{font-size:1.08em}.setto-chat__markdown ul,.setto-chat__markdown ol{margin:.12em 0 .72em;padding-left:1.25em}.setto-chat__markdown ul{list-style:disc}.setto-chat__markdown ol{list-style:decimal}.setto-chat__markdown li{margin:.2em 0;padding-left:.08em}.setto-chat__markdown li::marker{color:color-mix(in srgb,var(--setto-chat-accent) 78%,var(--setto-chat-ink))}.setto-chat__markdown strong{font-weight:700}.setto-chat__markdown a{color:inherit;text-decoration:underline;text-decoration-color:color-mix(in srgb,var(--setto-chat-accent) 70%,transparent);text-decoration-thickness:1px;text-underline-offset:.16em}.setto-chat__markdown blockquote{margin:.2em 0 .72em;padding:.08em 0 .08em .7em;border-left:2px solid color-mix(in srgb,var(--setto-chat-accent) 58%,transparent);color:color-mix(in srgb,var(--setto-chat-ink) 76%,transparent)}.setto-chat__markdown hr{height:1px;margin:.85em 0;border:0;background:color-mix(in srgb,var(--setto-chat-ink) 13%,transparent)}.setto-chat__markdown code{padding:.08em .28em;border-radius:.32em;background:color-mix(in srgb,var(--setto-chat-ink) 8%,transparent);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.88em}.setto-chat__markdown pre{max-width:100%;margin:.3em 0 .78em;padding:.7em;overflow-x:auto;overscroll-behavior:contain;border-radius:.7em;background:color-mix(in srgb,var(--setto-chat-ink) 8%,transparent);white-space:pre;-webkit-overflow-scrolling:touch}.setto-chat__markdown pre code{padding:0;background:transparent}.setto-chat__table-wrap{max-width:100%;margin:.25em 0 .75em;overflow-x:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}.setto-chat__markdown table{width:100%;border-collapse:collapse;font-size:.88em}.setto-chat__markdown th,.setto-chat__markdown td{padding:.38em .5em;border-bottom:1px solid color-mix(in srgb,var(--setto-chat-ink) 13%,transparent);text-align:left;vertical-align:top}.setto-chat__markdown th{font-weight:680}.setto-chat__markdown-image-label{font-style:italic;color:color-mix(in srgb,var(--setto-chat-ink) 62%,transparent)}.setto-chat__word{display:inline-block}.setto-chat__markdown.is-revealing .setto-chat__word{opacity:0;transform:translateY(.08em);filter:blur(.35px);animation:setto-chat-word-in 180ms cubic-bezier(.2,.8,.2,1) forwards;will-change:opacity,transform,filter}@keyframes setto-chat-word-in{to{opacity:1;transform:none;filter:none}}
|
|
37143
37206
|
.setto-chat{--setto-chat-edge:.75rem;position:fixed;right:max(18px,env(safe-area-inset-right));bottom:max(18px,env(safe-area-inset-bottom));z-index:2147483000;overscroll-behavior:contain;color:var(--setto-chat-ink);font-family:"Archivo Variable",Archivo,system-ui,sans-serif;-webkit-font-smoothing:antialiased}.setto-chat *,.setto-chat *::before,.setto-chat *::after{box-sizing:border-box}.setto-chat button,.setto-chat input,.setto-chat textarea{font:inherit}.setto-chat--mounted{top:0;right:auto;bottom:auto;left:0;width:100vw;height:var(--setto-chat-layout-height,100lvh);overflow:hidden;background:var(--setto-chat-canvas);opacity:0;transition:opacity ${CLOSE_MS}ms ease}.setto-chat--visible{opacity:1}.setto-chat__shell{position:absolute;top:var(--setto-chat-top,0);left:0;width:100%;height:var(--setto-chat-height,100svh);display:flex;overflow:hidden;overscroll-behavior:contain;background:var(--setto-chat-canvas);opacity:0;transform:translateY(12px) scale(.994);transform-origin:center bottom;transition:opacity ${CLOSE_MS}ms ease,transform ${CLOSE_MS}ms cubic-bezier(.16,1,.3,1)}.setto-chat--visible .setto-chat__shell{opacity:1;transform:none}
|
|
37144
|
-
.setto-chat__scrim{position:absolute;inset:0;z-index:45;border:0;background:rgba(33,23,17,.32);opacity:0;pointer-events:none;transition:opacity 220ms ease}.setto-chat__scrim.is-open{opacity:1;pointer-events:auto}.setto-chat__chats{position:relative;z-index:50;width:min(84vw,280px);height:100%;flex:0 0 280px;padding:1rem .85rem calc(1rem + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:.9rem;background:color-mix(in srgb,var(--setto-chat-crema) 32%,var(--setto-chat-canvas));border-right:1px solid color-mix(in srgb,var(--setto-chat-ink) 12%,transparent);overflow:hidden}.setto-chat__chats-heading{display:flex;align-items:center;justify-content:space-between;gap:.5rem;min-height:34px;font-size:.66rem;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:color-mix(in srgb,var(--setto-chat-ink) 58%,transparent)}.setto-chat__chats-heading button{width:34px;height:34px;padding:0;border:0;border-radius:8px;background:transparent;color:color-mix(in srgb,var(--setto-chat-ink) 58%,transparent);display:inline-flex;align-items:center;justify-content:center;cursor:pointer}.setto-chat__new{display:flex;align-items:center;gap:.55rem;width:100%;padding:.5rem .55rem;border:0;border-radius:8px;background:transparent;color:var(--setto-chat-ink);font-weight:600;font-size:.9rem;text-align:left;cursor:pointer;transition:background 140ms ease}.setto-chat__new:hover{background:color-mix(in srgb,var(--setto-chat-ink) 5%,transparent)}.setto-chat__chat-list{display:flex;flex-direction:column;gap:.1rem;flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;margin-right:-.85rem;padding-right:.3rem}.setto-chat__chat-list p{margin:.35rem .55rem;font-size:.85rem;line-height:1.5;color:color-mix(in srgb,var(--setto-chat-ink) 58%,transparent)}.setto-chat__chat-row{width:100%;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.4rem;padding:.55rem;border:0;border-radius:8px;background:transparent;color:var(--setto-chat-ink);text-align:left;cursor:pointer}.setto-chat__chat-row:hover,.setto-chat__chat-row.is-active{background:color-mix(in srgb,var(--setto-chat-ink) 7.5%,transparent)}.setto-chat__chat-row span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.9rem;font-weight:600}.setto-chat__chat-row time{font-size:.72rem;color:color-mix(in srgb,var(--setto-chat-ink) 55%,transparent)}
|
|
37207
|
+
.setto-chat__scrim{position:absolute;inset:0;z-index:45;border:0;background:rgba(33,23,17,.32);opacity:0;pointer-events:none;transition:opacity 220ms ease}.setto-chat__scrim.is-open{opacity:1;pointer-events:auto}.setto-chat__chats{position:relative;z-index:50;width:min(84vw,280px);height:100%;flex:0 0 280px;padding:1rem .85rem calc(1rem + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:.9rem;background:color-mix(in srgb,var(--setto-chat-crema) 32%,var(--setto-chat-canvas));border-right:1px solid color-mix(in srgb,var(--setto-chat-ink) 12%,transparent);overflow:hidden}.setto-chat__chats-heading{display:flex;align-items:center;justify-content:space-between;gap:.5rem;min-height:34px;font-size:.66rem;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:color-mix(in srgb,var(--setto-chat-ink) 58%,transparent)}.setto-chat__chats-heading button{width:34px;height:34px;padding:0;border:0;border-radius:8px;background:transparent;color:color-mix(in srgb,var(--setto-chat-ink) 58%,transparent);display:inline-flex;align-items:center;justify-content:center;cursor:pointer}.setto-chat__new{display:flex;align-items:center;gap:.55rem;width:100%;padding:.5rem .55rem;border:0;border-radius:8px;background:transparent;color:var(--setto-chat-ink);font-weight:600;font-size:.9rem;text-align:left;cursor:pointer;transition:background 140ms ease}.setto-chat__new:hover{background:color-mix(in srgb,var(--setto-chat-ink) 5%,transparent)}.setto-chat__chat-list{display:flex;flex-direction:column;gap:.1rem;flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;margin-right:-.85rem;padding-right:.3rem}.setto-chat__chat-list p{margin:.35rem .55rem;font-size:.85rem;line-height:1.5;color:color-mix(in srgb,var(--setto-chat-ink) 58%,transparent)}.setto-chat__chat-row{width:100%;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.4rem;padding:.55rem;border:0;border-radius:8px;background:transparent;color:var(--setto-chat-ink);text-align:left;cursor:pointer}.setto-chat__chat-row:hover,.setto-chat__chat-row.is-active{background:color-mix(in srgb,var(--setto-chat-ink) 7.5%,transparent)}.setto-chat__chat-row span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.9rem;font-weight:600}.setto-chat__chat-row time{font-size:.72rem;color:color-mix(in srgb,var(--setto-chat-ink) 55%,transparent)}.setto-chat__chat-row.is-ended span{font-weight:500;color:color-mix(in srgb,var(--setto-chat-ink) 72%,transparent)}.setto-chat__chat-group{display:block;margin:.75rem .55rem .2rem;font-size:.66rem;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:color-mix(in srgb,var(--setto-chat-ink) 58%,transparent)}.setto-chat__end{margin-top:-.6rem;font-weight:500;color:color-mix(in srgb,var(--setto-chat-ink) 72%,transparent)}.setto-chat__end:disabled{opacity:.5;cursor:default}.setto-chat__ended{position:relative;z-index:1;display:flex;justify-content:center;padding:.25rem 0 .35rem}.setto-chat__ended button{display:inline-flex;align-items:center;gap:.5rem;min-height:44px;padding:0 1.15rem;border:0;border-radius:999px;background:var(--setto-chat-accent);color:var(--setto-chat-on-accent);font:inherit;font-size:.95rem;font-weight:600;cursor:pointer;box-shadow:0 8px 24px -16px color-mix(in srgb,var(--setto-chat-ink) 45%,transparent);transition:transform 200ms ease}.setto-chat__ended button:hover{transform:translateY(-1px)}
|
|
37145
37208
|
.setto-chat__main{position:relative;z-index:1;display:flex;flex:1;min-width:0;max-width:820px;height:100%;margin:0 auto;flex-direction:column;background:var(--setto-chat-canvas)}.setto-chat__header{position:absolute;inset:0 0 auto;z-index:30;min-height:calc(46px + 2 * var(--setto-chat-edge));padding:var(--setto-chat-edge);display:flex;align-items:center;gap:.5rem;background:linear-gradient(to bottom,color-mix(in srgb,var(--setto-chat-crema) 88%,transparent),color-mix(in srgb,var(--setto-chat-crema) 72%,transparent));border-bottom:1px solid color-mix(in srgb,var(--setto-chat-ink) 12%,transparent);backdrop-filter:blur(20px) saturate(150%);-webkit-backdrop-filter:blur(20px) saturate(150%);isolation:isolate}.setto-chat__round-button{flex:none;width:46px;height:46px;padding:0;border:1px solid color-mix(in srgb,var(--setto-chat-ink) 12%,transparent);border-radius:50%;background:var(--setto-chat-raised);color:var(--setto-chat-ink);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:background 160ms ease,border-color 160ms ease,color 160ms ease}.setto-chat__round-button:hover{background:var(--setto-chat-crema);border-color:var(--setto-chat-accent);color:var(--setto-chat-accent)}.setto-chat__round-button:active{transform:scale(.96)}.setto-chat__brand{flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;line-height:1.15;text-align:center}.setto-chat__brand h2{margin:0;color:var(--setto-chat-ink);font-size:1.02rem;font-weight:600;line-height:1.15}.setto-chat__brand p{max-width:100%;margin:2px 0 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:color-mix(in srgb,var(--setto-chat-ink) 56%,transparent);font-size:.78rem;line-height:1.15}
|
|
37146
37209
|
.setto-chat__body{position:relative;display:flex;flex:1 1 auto;min-height:0;height:100%;flex-direction:column}.setto-chat__log{display:flex;flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;flex-direction:column;padding:calc(46px + 2 * var(--setto-chat-edge) + 1.3rem) .75rem var(--setto-chat-composer-space,8rem);scroll-padding-bottom:var(--setto-chat-composer-space,8rem);scroll-behavior:auto;-webkit-overflow-scrolling:touch}.setto-chat__message-list{display:flex;flex-direction:column}.setto-chat__message{--setto-chat-bubble:color-mix(in srgb,var(--setto-chat-ink) 7%,var(--setto-chat-canvas));display:flex;align-items:flex-end;gap:.55rem;width:100%;margin-bottom:1rem;color:color-mix(in srgb,var(--setto-chat-ink) 92%,transparent);font-size:16px;line-height:1.5;overflow-wrap:anywhere}.setto-chat__message-stack{display:flex;min-width:0;max-width:min(78%,36rem);flex-direction:column;align-items:flex-start}.setto-chat__message-bubble{position:relative;min-width:2.5rem;padding:.58rem .82rem;border-radius:19px 19px 19px 5px;background:var(--setto-chat-bubble);white-space:pre-wrap}.setto-chat__message--assistant .setto-chat__message-bubble::before,.setto-chat__message--human .setto-chat__message-bubble::before{content:"";position:absolute;z-index:0;left:-7px;bottom:0;width:16px;height:17px;border-bottom-right-radius:14px;background:var(--setto-chat-bubble)}.setto-chat__message--assistant .setto-chat__message-bubble::after,.setto-chat__message--human .setto-chat__message-bubble::after{content:"";position:absolute;z-index:1;left:-10px;bottom:0;width:10px;height:18px;border-bottom-right-radius:10px;background:var(--setto-chat-canvas)}.setto-chat__message-copy,.setto-chat__image{position:relative;z-index:2}.setto-chat__message--visitor{--setto-chat-bubble:var(--setto-chat-accent);justify-content:flex-end;color:var(--setto-chat-on-accent)}.setto-chat__message--visitor .setto-chat__message-stack{align-items:flex-end}.setto-chat__message--visitor .setto-chat__message-bubble{border-radius:19px 19px 5px 19px}.setto-chat__message--visitor .setto-chat__message-bubble::before{content:"";position:absolute;z-index:0;right:-7px;bottom:0;width:16px;height:17px;border-bottom-left-radius:14px;background:var(--setto-chat-bubble)}.setto-chat__message--visitor .setto-chat__message-bubble::after{content:"";position:absolute;z-index:1;right:-10px;bottom:0;width:10px;height:18px;border-bottom-left-radius:10px;background:var(--setto-chat-canvas)}.setto-chat__message--system{justify-content:center;color:color-mix(in srgb,var(--setto-chat-ink) 55%,transparent);font-size:.78rem;line-height:1.45;text-align:center}.setto-chat__message--system .setto-chat__message-stack{max-width:85%;align-items:center}.setto-chat__message--system .setto-chat__message-bubble{padding:.25rem .6rem;background:transparent}.setto-chat__avatar{position:relative;z-index:3;display:grid;place-items:center;flex:0 0 34px;width:34px;height:34px;margin-bottom:1px;overflow:hidden;border:2px solid var(--setto-chat-canvas);border-radius:50%;background:var(--setto-chat-crema);color:var(--setto-chat-ink);box-shadow:0 2px 8px color-mix(in srgb,var(--setto-chat-ink) 14%,transparent)}.setto-chat__avatar--assistant{background:var(--setto-chat-accent);color:var(--setto-chat-on-accent)}.setto-chat__avatar img{display:block;width:100%;height:100%;object-fit:cover}.setto-chat__speaker{display:block;margin:0 0 .2rem .4rem;color:color-mix(in srgb,var(--setto-chat-ink) 52%,transparent);font-size:.69rem;font-weight:500;line-height:1.2}.setto-chat__typing{display:inline-block;min-width:1.8rem;animation:setto-chat-pulse 1s ease-in-out infinite}.setto-chat__image{display:block;width:max-content;max-width:100%;margin-top:.65rem;overflow:hidden;border-radius:13px}.setto-chat__image img{display:block;width:min(280px,100%);max-height:260px;object-fit:cover}
|
|
37147
37210
|
.setto-chat__message--agent-joined{justify-content:flex-start;align-items:center;gap:.55rem;padding:.1rem 0;color:color-mix(in srgb,var(--setto-chat-ink) 62%,transparent);font-size:.8rem;line-height:1.4;text-align:left}.setto-chat__message--agent-joined .setto-chat__message-stack{max-width:calc(100% - 38px);align-items:flex-start}.setto-chat__message--agent-joined .setto-chat__message-bubble{min-width:0;padding:.2rem 0;background:transparent;white-space:normal}.setto-chat__avatar--joined{margin:0}button.setto-chat__avatar{padding:0;font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:transform 140ms ease}button.setto-chat__avatar:active{transform:scale(.94)}button.setto-chat__avatar:focus-visible{outline:2px solid var(--setto-chat-accent);outline-offset:2px}
|