@webless/agent 0.9.3 → 0.10.1
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 +1 -1
- package/dist/{chunk-JIM5AOVC.js → chunk-ZYTNNMZS.js} +350 -226
- package/dist/chunk-ZYTNNMZS.js.map +1 -0
- package/dist/embed.cjs +353 -228
- package/dist/embed.cjs.map +1 -1
- package/dist/embed.css +403 -153
- package/dist/embed.css.map +1 -1
- package/dist/embed.d.cts +2 -2
- package/dist/embed.d.ts +2 -2
- package/dist/embed.js +2 -1
- package/dist/embed.js.map +1 -1
- package/dist/{panel-controller-D_XIQa1U.d.cts → panel-controller-rxR75tRa.d.cts} +5 -1
- package/dist/{panel-controller-D_XIQa1U.d.ts → panel-controller-rxR75tRa.d.ts} +5 -1
- package/dist/presentation.cjs.map +1 -1
- package/dist/presentation.js.map +1 -1
- package/dist/react.cjs +354 -230
- package/dist/react.cjs.map +1 -1
- package/dist/react.css +403 -153
- package/dist/react.css.map +1 -1
- package/dist/react.d.cts +3 -2
- package/dist/react.d.ts +3 -2
- package/dist/react.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-JIM5AOVC.js.map +0 -1
package/dist/react.cjs
CHANGED
|
@@ -46,7 +46,7 @@ __export(react_exports, {
|
|
|
46
46
|
module.exports = __toCommonJS(react_exports);
|
|
47
47
|
|
|
48
48
|
// src/react/components/AgentWidget/AgentWidget.tsx
|
|
49
|
-
var
|
|
49
|
+
var import_react16 = require("react");
|
|
50
50
|
|
|
51
51
|
// src/react/page-shift.ts
|
|
52
52
|
var import_react = require("react");
|
|
@@ -1653,6 +1653,24 @@ function formatAgentError(error) {
|
|
|
1653
1653
|
}
|
|
1654
1654
|
|
|
1655
1655
|
// src/react/lib/composer-form.ts
|
|
1656
|
+
var COMPOSER_FORM_SKIP_DISMISSAL = "I'd like to keep chatting without sharing the requested details for now. Please don't ask for them again unless I choose to proceed with something that needs them.";
|
|
1657
|
+
function visitorMessageDisplayText(message) {
|
|
1658
|
+
if (message.role !== "visitor") return message.text;
|
|
1659
|
+
const text2 = message.text.trim();
|
|
1660
|
+
if (!text2) return message.text;
|
|
1661
|
+
if (text2.startsWith(COMPOSER_FORM_SKIP_DISMISSAL)) {
|
|
1662
|
+
const afterDismissal = text2.slice(COMPOSER_FORM_SKIP_DISMISSAL.length).trim().replace(/^\n+/, "").trim();
|
|
1663
|
+
if (afterDismissal) return afterDismissal;
|
|
1664
|
+
}
|
|
1665
|
+
const runtime = message.runtimeText?.trim();
|
|
1666
|
+
if (runtime && text2 === runtime && runtime.includes(COMPOSER_FORM_SKIP_DISMISSAL)) {
|
|
1667
|
+
const afterDismissal = runtime.slice(
|
|
1668
|
+
runtime.indexOf(COMPOSER_FORM_SKIP_DISMISSAL) + COMPOSER_FORM_SKIP_DISMISSAL.length
|
|
1669
|
+
).trim().replace(/^\n+/, "").trim();
|
|
1670
|
+
if (afterDismissal) return afterDismissal;
|
|
1671
|
+
}
|
|
1672
|
+
return message.text;
|
|
1673
|
+
}
|
|
1656
1674
|
var EMAIL_PATTERN = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
1657
1675
|
var MIN_FORM_FIELDS = 2;
|
|
1658
1676
|
var MAX_FORM_FIELDS = 5;
|
|
@@ -2906,7 +2924,8 @@ function createInitialState(greeting = DEFAULT_GREETING) {
|
|
|
2906
2924
|
pendingOffer: null,
|
|
2907
2925
|
pendingInputs: [],
|
|
2908
2926
|
toolResults: [],
|
|
2909
|
-
error: null
|
|
2927
|
+
error: null,
|
|
2928
|
+
declinedComposerFormIds: []
|
|
2910
2929
|
};
|
|
2911
2930
|
}
|
|
2912
2931
|
function stateFromConversation(conversation, initialState) {
|
|
@@ -3326,6 +3345,7 @@ function useAgentChat({
|
|
|
3326
3345
|
const trimmed = visitorText.trim();
|
|
3327
3346
|
const outgoing = options?.runtimeText ?? visitorText;
|
|
3328
3347
|
if (!outgoing.trim()) return null;
|
|
3348
|
+
const declinedComposerFormId = options?.declinedComposerFormId?.trim();
|
|
3329
3349
|
const chatResponse = chatInputResponseForText(
|
|
3330
3350
|
state.pendingInputs ?? [],
|
|
3331
3351
|
outgoing.trim()
|
|
@@ -3359,7 +3379,15 @@ function useAgentChat({
|
|
|
3359
3379
|
state: "active"
|
|
3360
3380
|
}
|
|
3361
3381
|
],
|
|
3362
|
-
error: null
|
|
3382
|
+
error: null,
|
|
3383
|
+
...declinedComposerFormId ? {
|
|
3384
|
+
declinedComposerFormIds: [
|
|
3385
|
+
.../* @__PURE__ */ new Set([
|
|
3386
|
+
...prev.declinedComposerFormIds ?? [],
|
|
3387
|
+
declinedComposerFormId
|
|
3388
|
+
])
|
|
3389
|
+
]
|
|
3390
|
+
} : {}
|
|
3363
3391
|
}));
|
|
3364
3392
|
return await runTurn({
|
|
3365
3393
|
controller: controller2,
|
|
@@ -3381,9 +3409,9 @@ ${outgoing}` : outgoing;
|
|
|
3381
3409
|
const visitorMessage = {
|
|
3382
3410
|
id: `visitor-${Date.now()}`,
|
|
3383
3411
|
role: "visitor",
|
|
3384
|
-
text:
|
|
3412
|
+
text: trimmed,
|
|
3385
3413
|
createdAt: Date.now(),
|
|
3386
|
-
...runtimeText !==
|
|
3414
|
+
...runtimeText.trim() !== trimmed ? { runtimeText } : {}
|
|
3387
3415
|
};
|
|
3388
3416
|
setState((prev) => ({
|
|
3389
3417
|
...prev,
|
|
@@ -3403,7 +3431,15 @@ ${outgoing}` : outgoing;
|
|
|
3403
3431
|
pendingOffer: options?.preservePendingOffer ? prev.pendingOffer : null,
|
|
3404
3432
|
pendingInputs: [],
|
|
3405
3433
|
toolResults: [],
|
|
3406
|
-
error: null
|
|
3434
|
+
error: null,
|
|
3435
|
+
...declinedComposerFormId ? {
|
|
3436
|
+
declinedComposerFormIds: [
|
|
3437
|
+
.../* @__PURE__ */ new Set([
|
|
3438
|
+
...prev.declinedComposerFormIds ?? [],
|
|
3439
|
+
declinedComposerFormId
|
|
3440
|
+
])
|
|
3441
|
+
]
|
|
3442
|
+
} : {}
|
|
3407
3443
|
}));
|
|
3408
3444
|
return await runTurn({
|
|
3409
3445
|
controller,
|
|
@@ -3766,8 +3802,7 @@ function workSummary(steps, failed, brandLabel) {
|
|
|
3766
3802
|
)}`;
|
|
3767
3803
|
const active = [...steps].reverse().find((step) => step.state === "active");
|
|
3768
3804
|
if (active?.kind === "search") return "Searching this site";
|
|
3769
|
-
if (active)
|
|
3770
|
-
return brandLabel ? `${brandLabel} is choosing the best way to help` : "Choosing the best way to help";
|
|
3805
|
+
if (active) return "Reviewing your details to find the best approach";
|
|
3771
3806
|
if (failed) return "Couldn\u2019t complete this request";
|
|
3772
3807
|
const hasError = steps.some((step) => step.state === "error");
|
|
3773
3808
|
const specialists = steps.filter(
|
|
@@ -3876,7 +3911,7 @@ function AgentActivityBubble({
|
|
|
3876
3911
|
}
|
|
3877
3912
|
),
|
|
3878
3913
|
workSummary(steps, failed, brandLabel),
|
|
3879
|
-
active ? "
|
|
3914
|
+
active ? "..." : ""
|
|
3880
3915
|
] }),
|
|
3881
3916
|
!active ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "agent-activity-bubble__details", children: [
|
|
3882
3917
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -4030,6 +4065,7 @@ function AnswerReceiptDialog({
|
|
|
4030
4065
|
// src/react/components/Composer/Composer.tsx
|
|
4031
4066
|
var import_react8 = require("react");
|
|
4032
4067
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
4068
|
+
var FORM_SUBMITTED_MESSAGE = "Shared my details";
|
|
4033
4069
|
function SendIcon() {
|
|
4034
4070
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4035
4071
|
"path",
|
|
@@ -4042,6 +4078,30 @@ function SendIcon() {
|
|
|
4042
4078
|
}
|
|
4043
4079
|
) });
|
|
4044
4080
|
}
|
|
4081
|
+
function CheckIcon() {
|
|
4082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { viewBox: "0 0 12 12", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4083
|
+
"path",
|
|
4084
|
+
{
|
|
4085
|
+
d: "M2.5 6.2l2.3 2.3 4.7-5",
|
|
4086
|
+
stroke: "currentColor",
|
|
4087
|
+
strokeWidth: "1.6",
|
|
4088
|
+
strokeLinecap: "round",
|
|
4089
|
+
strokeLinejoin: "round"
|
|
4090
|
+
}
|
|
4091
|
+
) });
|
|
4092
|
+
}
|
|
4093
|
+
function CollapseIcon() {
|
|
4094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4095
|
+
"path",
|
|
4096
|
+
{
|
|
4097
|
+
d: "M4 10l4-4 4 4",
|
|
4098
|
+
stroke: "currentColor",
|
|
4099
|
+
strokeWidth: "1.6",
|
|
4100
|
+
strokeLinecap: "round",
|
|
4101
|
+
strokeLinejoin: "round"
|
|
4102
|
+
}
|
|
4103
|
+
) });
|
|
4104
|
+
}
|
|
4045
4105
|
function emptyValues(form) {
|
|
4046
4106
|
const values = {};
|
|
4047
4107
|
for (const field of form?.fields ?? []) values[field.id] = "";
|
|
@@ -4075,26 +4135,31 @@ function Composer({
|
|
|
4075
4135
|
const savedForm = allowFormResume && !draft.submitted ? draft.form : null;
|
|
4076
4136
|
const activeForm = !disabled && draft.expanded ? savedForm : null;
|
|
4077
4137
|
const hasDraft = Object.values(draft.values).some((value2) => value2.trim());
|
|
4138
|
+
const canSend = !disabled && Boolean(value.trim() || activeForm);
|
|
4078
4139
|
(0, import_react8.useEffect)(() => {
|
|
4079
4140
|
if (activeForm) firstFieldRef.current?.focus();
|
|
4080
4141
|
else if ((savedForm || draft.submitted) && !disabled)
|
|
4081
4142
|
inputRef.current?.focus();
|
|
4082
4143
|
}, [activeForm?.id, disabled, savedForm?.id, draft.submitted]);
|
|
4144
|
+
function collapseForm() {
|
|
4145
|
+
setDraft((current) => ({ ...current, expanded: false }));
|
|
4146
|
+
}
|
|
4083
4147
|
function submitChat() {
|
|
4084
4148
|
const trimmed = value.trim();
|
|
4085
4149
|
if (!trimmed || disabled) return;
|
|
4086
4150
|
const shareDismissal = savedForm && !draft.dismissalSent;
|
|
4087
4151
|
if (shareDismissal) {
|
|
4088
4152
|
onSubmit?.(trimmed, {
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
${trimmed}`
|
|
4153
|
+
declinedComposerFormId: savedForm.id
|
|
4092
4154
|
});
|
|
4093
4155
|
} else {
|
|
4094
4156
|
onSubmit?.(trimmed);
|
|
4095
4157
|
}
|
|
4096
|
-
|
|
4097
|
-
|
|
4158
|
+
setDraft((current) => ({
|
|
4159
|
+
...current,
|
|
4160
|
+
expanded: false,
|
|
4161
|
+
dismissalSent: shareDismissal ? true : current.dismissalSent
|
|
4162
|
+
}));
|
|
4098
4163
|
setValue("");
|
|
4099
4164
|
inputRef.current?.focus();
|
|
4100
4165
|
}
|
|
@@ -4109,7 +4174,7 @@ ${trimmed}`
|
|
|
4109
4174
|
if (control instanceof HTMLElement) control.focus();
|
|
4110
4175
|
return;
|
|
4111
4176
|
}
|
|
4112
|
-
onSubmit?.(
|
|
4177
|
+
onSubmit?.(FORM_SUBMITTED_MESSAGE, {
|
|
4113
4178
|
runtimeText: formatComposerFormMessage(activeForm, draft.values)
|
|
4114
4179
|
});
|
|
4115
4180
|
setDraft((current) => ({
|
|
@@ -4120,10 +4185,16 @@ ${trimmed}`
|
|
|
4120
4185
|
attempted: false
|
|
4121
4186
|
}));
|
|
4122
4187
|
}
|
|
4188
|
+
function handleSend() {
|
|
4189
|
+
if (value.trim()) {
|
|
4190
|
+
submitChat();
|
|
4191
|
+
return;
|
|
4192
|
+
}
|
|
4193
|
+
if (activeForm) submitForm();
|
|
4194
|
+
}
|
|
4123
4195
|
function handleSubmit(event) {
|
|
4124
4196
|
event.preventDefault();
|
|
4125
|
-
|
|
4126
|
-
else submitChat();
|
|
4197
|
+
handleSend();
|
|
4127
4198
|
}
|
|
4128
4199
|
function handleChatKeyDown(event) {
|
|
4129
4200
|
if (event.key === "Enter" && !event.shiftKey) {
|
|
@@ -4139,7 +4210,34 @@ ${trimmed}`
|
|
|
4139
4210
|
submitForm();
|
|
4140
4211
|
}
|
|
4141
4212
|
}
|
|
4142
|
-
|
|
4213
|
+
const chatField = /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
4214
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4215
|
+
"textarea",
|
|
4216
|
+
{
|
|
4217
|
+
ref: inputRef,
|
|
4218
|
+
className: "composer__input",
|
|
4219
|
+
rows: 1,
|
|
4220
|
+
value,
|
|
4221
|
+
placeholder,
|
|
4222
|
+
disabled,
|
|
4223
|
+
spellCheck: false,
|
|
4224
|
+
"aria-label": "Message",
|
|
4225
|
+
onChange: (event) => setValue(event.target.value),
|
|
4226
|
+
onKeyDown: handleChatKeyDown
|
|
4227
|
+
}
|
|
4228
|
+
),
|
|
4229
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4230
|
+
"button",
|
|
4231
|
+
{
|
|
4232
|
+
type: "submit",
|
|
4233
|
+
className: "composer__send",
|
|
4234
|
+
disabled: !canSend,
|
|
4235
|
+
"aria-label": "Send message",
|
|
4236
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SendIcon, {})
|
|
4237
|
+
}
|
|
4238
|
+
)
|
|
4239
|
+
] });
|
|
4240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
4143
4241
|
"form",
|
|
4144
4242
|
{
|
|
4145
4243
|
ref: formRef,
|
|
@@ -4150,107 +4248,10 @@ ${trimmed}`
|
|
|
4150
4248
|
activeForm ? "composer--form" : ""
|
|
4151
4249
|
].filter(Boolean).join(" "),
|
|
4152
4250
|
onSubmit: handleSubmit,
|
|
4153
|
-
children:
|
|
4154
|
-
"div",
|
|
4155
|
-
{
|
|
4156
|
-
className: "composer__sheet",
|
|
4157
|
-
role: "group",
|
|
4158
|
-
"aria-label": "Contact details",
|
|
4159
|
-
children: [
|
|
4160
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "composer__form-heading", children: [
|
|
4161
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("strong", { children: "Share your details" }),
|
|
4162
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "Optional" }),
|
|
4163
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: "You can also keep chatting." })
|
|
4164
|
-
] }),
|
|
4165
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "composer__fields", children: activeForm.fields.map((field, index) => {
|
|
4166
|
-
const fieldId = `${formId}-${field.id}`;
|
|
4167
|
-
const invalid = draft.attempted && !isValidComposerFieldValue(field, draft.values[field.id] ?? "");
|
|
4168
|
-
const controlProps = {
|
|
4169
|
-
id: fieldId,
|
|
4170
|
-
name: field.id,
|
|
4171
|
-
disabled,
|
|
4172
|
-
required: field.required,
|
|
4173
|
-
autoComplete: field.autocomplete,
|
|
4174
|
-
placeholder: field.placeholder,
|
|
4175
|
-
spellCheck: false,
|
|
4176
|
-
value: draft.values[field.id] ?? "",
|
|
4177
|
-
"aria-invalid": invalid || void 0,
|
|
4178
|
-
"aria-describedby": invalid ? `${fieldId}-error` : void 0,
|
|
4179
|
-
onChange: (event) => {
|
|
4180
|
-
const next = readComposerControlValue(event);
|
|
4181
|
-
setDraft((current) => ({
|
|
4182
|
-
...current,
|
|
4183
|
-
values: { ...current.values, [field.id]: next }
|
|
4184
|
-
}));
|
|
4185
|
-
},
|
|
4186
|
-
onKeyDown: handleFormKeyDown
|
|
4187
|
-
};
|
|
4188
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
4189
|
-
"div",
|
|
4190
|
-
{
|
|
4191
|
-
className: [
|
|
4192
|
-
"composer__row",
|
|
4193
|
-
field.kind === "textarea" ? "composer__row--grow" : ""
|
|
4194
|
-
].filter(Boolean).join(" "),
|
|
4195
|
-
children: [
|
|
4196
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "composer__label", htmlFor: fieldId, children: [
|
|
4197
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "composer__field-label", children: field.label }),
|
|
4198
|
-
field.kind === "textarea" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4199
|
-
"textarea",
|
|
4200
|
-
{
|
|
4201
|
-
...controlProps,
|
|
4202
|
-
ref: index === 0 ? (node) => {
|
|
4203
|
-
firstFieldRef.current = node;
|
|
4204
|
-
} : void 0,
|
|
4205
|
-
className: "composer__control composer__control--area",
|
|
4206
|
-
rows: 3
|
|
4207
|
-
}
|
|
4208
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4209
|
-
"input",
|
|
4210
|
-
{
|
|
4211
|
-
...controlProps,
|
|
4212
|
-
ref: index === 0 ? (node) => {
|
|
4213
|
-
firstFieldRef.current = node;
|
|
4214
|
-
} : void 0,
|
|
4215
|
-
className: "composer__control",
|
|
4216
|
-
type: field.kind,
|
|
4217
|
-
inputMode: field.kind === "tel" ? "tel" : void 0
|
|
4218
|
-
}
|
|
4219
|
-
)
|
|
4220
|
-
] }),
|
|
4221
|
-
invalid ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "composer__error", id: `${fieldId}-error`, children: field.kind === "email" ? "Enter a valid email to share your details." : `Add your ${field.label.toLowerCase()} to share your details.` }) : null
|
|
4222
|
-
]
|
|
4223
|
-
},
|
|
4224
|
-
field.id
|
|
4225
|
-
);
|
|
4226
|
-
}) }),
|
|
4227
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "composer__toolbar", children: [
|
|
4228
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4229
|
-
"button",
|
|
4230
|
-
{
|
|
4231
|
-
type: "submit",
|
|
4232
|
-
className: "composer__action composer__action--primary",
|
|
4233
|
-
disabled,
|
|
4234
|
-
children: "Share details"
|
|
4235
|
-
}
|
|
4236
|
-
),
|
|
4237
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4238
|
-
"button",
|
|
4239
|
-
{
|
|
4240
|
-
type: "button",
|
|
4241
|
-
className: "composer__action",
|
|
4242
|
-
disabled,
|
|
4243
|
-
onClick: () => setDraft((current) => ({ ...current, expanded: false })),
|
|
4244
|
-
children: "Keep chatting"
|
|
4245
|
-
}
|
|
4246
|
-
)
|
|
4247
|
-
] })
|
|
4248
|
-
]
|
|
4249
|
-
}
|
|
4250
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
4251
|
+
children: [
|
|
4251
4252
|
savedForm ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "composer__resume", children: [
|
|
4252
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: hasDraft ? "Your details aren\u2019t shared yet" : "
|
|
4253
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4253
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: hasDraft ? "Your details aren\u2019t shared yet" : "Share your details so we can follow up" }),
|
|
4254
|
+
!activeForm ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4254
4255
|
"button",
|
|
4255
4256
|
{
|
|
4256
4257
|
type: "button",
|
|
@@ -4258,36 +4259,100 @@ ${trimmed}`
|
|
|
4258
4259
|
onClick: () => setDraft((current) => ({ ...current, expanded: true })),
|
|
4259
4260
|
children: hasDraft ? "Resume details" : "Add details"
|
|
4260
4261
|
}
|
|
4261
|
-
)
|
|
4262
|
+
) : null
|
|
4262
4263
|
] }) : null,
|
|
4263
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
"
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4264
|
+
activeForm ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
4265
|
+
"div",
|
|
4266
|
+
{
|
|
4267
|
+
className: "composer__sheet",
|
|
4268
|
+
role: "group",
|
|
4269
|
+
"aria-label": "Contact details",
|
|
4270
|
+
children: [
|
|
4271
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "composer__form-heading", children: [
|
|
4272
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("strong", { children: "Share your details" }),
|
|
4273
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "Optional" }),
|
|
4274
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4275
|
+
"button",
|
|
4276
|
+
{
|
|
4277
|
+
type: "button",
|
|
4278
|
+
className: "composer__collapse",
|
|
4279
|
+
"aria-label": "Collapse form",
|
|
4280
|
+
disabled,
|
|
4281
|
+
onClick: collapseForm,
|
|
4282
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(CollapseIcon, {})
|
|
4283
|
+
}
|
|
4284
|
+
)
|
|
4285
|
+
] }),
|
|
4286
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "composer__fields", children: activeForm.fields.map((field, index) => {
|
|
4287
|
+
const fieldId = `${formId}-${field.id}`;
|
|
4288
|
+
const fieldValue = draft.values[field.id] ?? "";
|
|
4289
|
+
const invalid = draft.attempted && !isValidComposerFieldValue(field, fieldValue);
|
|
4290
|
+
const complete = fieldValue.trim().length > 0 && isValidComposerFieldValue(field, fieldValue);
|
|
4291
|
+
const controlProps = {
|
|
4292
|
+
id: fieldId,
|
|
4293
|
+
name: field.id,
|
|
4294
|
+
disabled,
|
|
4295
|
+
required: field.required,
|
|
4296
|
+
autoComplete: field.autocomplete,
|
|
4297
|
+
placeholder: field.placeholder,
|
|
4298
|
+
spellCheck: false,
|
|
4299
|
+
value: fieldValue,
|
|
4300
|
+
"aria-invalid": invalid || void 0,
|
|
4301
|
+
"aria-describedby": invalid ? `${fieldId}-error` : void 0,
|
|
4302
|
+
onChange: (event) => {
|
|
4303
|
+
const next = readComposerControlValue(event);
|
|
4304
|
+
setDraft((current) => ({
|
|
4305
|
+
...current,
|
|
4306
|
+
values: { ...current.values, [field.id]: next }
|
|
4307
|
+
}));
|
|
4308
|
+
},
|
|
4309
|
+
onKeyDown: handleFormKeyDown
|
|
4310
|
+
};
|
|
4311
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
4312
|
+
"div",
|
|
4313
|
+
{
|
|
4314
|
+
className: [
|
|
4315
|
+
"composer__row",
|
|
4316
|
+
field.kind === "textarea" ? "composer__row--area" : ""
|
|
4317
|
+
].filter(Boolean).join(" "),
|
|
4318
|
+
children: [
|
|
4319
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "composer__line", children: [
|
|
4320
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("label", { className: "composer__label", htmlFor: fieldId, children: field.label }),
|
|
4321
|
+
field.kind === "textarea" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4322
|
+
"textarea",
|
|
4323
|
+
{
|
|
4324
|
+
...controlProps,
|
|
4325
|
+
ref: index === 0 ? (node) => {
|
|
4326
|
+
firstFieldRef.current = node;
|
|
4327
|
+
} : void 0,
|
|
4328
|
+
className: "composer__control composer__control--area",
|
|
4329
|
+
rows: 2
|
|
4330
|
+
}
|
|
4331
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4332
|
+
"input",
|
|
4333
|
+
{
|
|
4334
|
+
...controlProps,
|
|
4335
|
+
ref: index === 0 ? (node) => {
|
|
4336
|
+
firstFieldRef.current = node;
|
|
4337
|
+
} : void 0,
|
|
4338
|
+
className: "composer__control",
|
|
4339
|
+
type: field.kind,
|
|
4340
|
+
inputMode: field.kind === "tel" ? "tel" : void 0
|
|
4341
|
+
}
|
|
4342
|
+
),
|
|
4343
|
+
complete && field.kind !== "textarea" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "composer__check", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(CheckIcon, {}) }) : null
|
|
4344
|
+
] }),
|
|
4345
|
+
invalid ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "composer__error", id: `${fieldId}-error`, children: field.kind === "email" ? "Enter a valid email to share your details." : `Add your ${field.label.toLowerCase()} to share your details.` }) : null
|
|
4346
|
+
]
|
|
4347
|
+
},
|
|
4348
|
+
field.id
|
|
4349
|
+
);
|
|
4350
|
+
}) }),
|
|
4351
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "composer__field composer__field--inset", children: chatField })
|
|
4352
|
+
]
|
|
4353
|
+
}
|
|
4354
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "composer__field", children: chatField })
|
|
4355
|
+
]
|
|
4291
4356
|
}
|
|
4292
4357
|
);
|
|
4293
4358
|
}
|
|
@@ -4872,8 +4937,9 @@ function MessageBubble({
|
|
|
4872
4937
|
offers.length > 0 ? sanitizeBookingOfferCopy(visibleText) : looksLikeBookingAvailabilityDump(visibleText) ? sanitizeBookingOfferCopy(visibleText) : visibleText || (isStreaming ? "" : message.text)
|
|
4873
4938
|
);
|
|
4874
4939
|
if (message.role === "visitor") {
|
|
4875
|
-
|
|
4876
|
-
|
|
4940
|
+
const visitorText = visitorMessageDisplayText(message).trim();
|
|
4941
|
+
if (!visitorText) return null;
|
|
4942
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("article", { className: "message-bubble message-bubble--visitor", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "message-bubble__text", children: visitorText }) });
|
|
4877
4943
|
}
|
|
4878
4944
|
const citations = message.citations ?? [];
|
|
4879
4945
|
const agentText = /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "message-bubble__text", children: [
|
|
@@ -5111,7 +5177,7 @@ function CopyIcon() {
|
|
|
5111
5177
|
)
|
|
5112
5178
|
] });
|
|
5113
5179
|
}
|
|
5114
|
-
function
|
|
5180
|
+
function CheckIcon2() {
|
|
5115
5181
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
5116
5182
|
"path",
|
|
5117
5183
|
{
|
|
@@ -5486,7 +5552,7 @@ function MessageActions({
|
|
|
5486
5552
|
title: copied ? "Copied" : "Copy answer",
|
|
5487
5553
|
disabled,
|
|
5488
5554
|
onClick: handleCopy,
|
|
5489
|
-
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
5555
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CheckIcon2, {}) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CopyIcon, {})
|
|
5490
5556
|
}
|
|
5491
5557
|
),
|
|
5492
5558
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
@@ -6440,13 +6506,17 @@ function AgentRail({
|
|
|
6440
6506
|
const hasPendingConfirmation = pendingInputRequests.some(
|
|
6441
6507
|
(request) => request.kind === "tool-approval" || request.kind === "question" && (request.options?.length ?? 0) > 0
|
|
6442
6508
|
);
|
|
6443
|
-
const
|
|
6509
|
+
const inferredComposerForm = resolveComposerForm({
|
|
6444
6510
|
agentText: lastAgentText,
|
|
6445
6511
|
cards: extractToolCards(lastAgentText),
|
|
6446
6512
|
hasBookingOffer: Boolean(state.pendingOffer) || waitingForBooking,
|
|
6447
6513
|
hasPendingConfirmation,
|
|
6448
6514
|
enabled: lastIsAgent && !isBusy
|
|
6449
6515
|
});
|
|
6516
|
+
const declinedComposerFormIds = state.declinedComposerFormIds ?? [];
|
|
6517
|
+
const composerForm = inferredComposerForm && lastMessage?.role === "agent" && declinedComposerFormIds.includes(
|
|
6518
|
+
`${lastMessage.id}:${inferredComposerForm.id}`
|
|
6519
|
+
) ? null : inferredComposerForm;
|
|
6450
6520
|
const latestResultId = [
|
|
6451
6521
|
...visibleMessages.flatMap(
|
|
6452
6522
|
(message) => message.role === "agent" ? message.toolResults ?? [] : []
|
|
@@ -6816,55 +6886,114 @@ function AgentRail({
|
|
|
6816
6886
|
}
|
|
6817
6887
|
|
|
6818
6888
|
// src/react/components/AssistEdgeTab/AssistEdgeTab.tsx
|
|
6889
|
+
var import_react15 = require("react");
|
|
6819
6890
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
6820
|
-
function
|
|
6891
|
+
function ChatSparkIcon() {
|
|
6821
6892
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
6822
6893
|
"svg",
|
|
6823
6894
|
{
|
|
6824
|
-
className: "assist-edge-
|
|
6825
|
-
viewBox: "0 0
|
|
6895
|
+
className: "assist-edge-tab__chat-spark",
|
|
6896
|
+
viewBox: "0 0 24 24",
|
|
6826
6897
|
fill: "none",
|
|
6827
6898
|
"aria-hidden": "true",
|
|
6828
6899
|
children: [
|
|
6829
6900
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
6830
6901
|
"path",
|
|
6831
6902
|
{
|
|
6832
|
-
|
|
6903
|
+
className: "assist-edge-tab__spark assist-edge-tab__spark--a",
|
|
6904
|
+
d: "M19.55 1.55l.78 1.82 1.82.78-1.82.78-.78 1.82-.78-1.82-1.82-.78 1.82-.78.78-1.82z",
|
|
6833
6905
|
fill: "currentColor"
|
|
6834
6906
|
}
|
|
6835
6907
|
),
|
|
6836
6908
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
6837
6909
|
"path",
|
|
6838
6910
|
{
|
|
6839
|
-
|
|
6911
|
+
className: "assist-edge-tab__spark assist-edge-tab__spark--b",
|
|
6912
|
+
d: "M4.15 17.35l.48 1.12 1.12.48-1.12.48-.48 1.12-.48-1.12-1.12-.48 1.12-.48.48-1.12z",
|
|
6840
6913
|
fill: "currentColor"
|
|
6841
6914
|
}
|
|
6842
6915
|
),
|
|
6843
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.
|
|
6844
|
-
|
|
6845
|
-
|
|
6846
|
-
|
|
6847
|
-
|
|
6848
|
-
|
|
6849
|
-
|
|
6916
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("g", { className: "assist-edge-tab__bot", children: [
|
|
6917
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
6918
|
+
"path",
|
|
6919
|
+
{
|
|
6920
|
+
d: "M11.15 5.2V3.05",
|
|
6921
|
+
stroke: "currentColor",
|
|
6922
|
+
strokeWidth: "1.9",
|
|
6923
|
+
strokeLinecap: "round"
|
|
6924
|
+
}
|
|
6925
|
+
),
|
|
6926
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("circle", { cx: "11.15", cy: "2.45", r: "0.85", fill: "currentColor" }),
|
|
6927
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
6928
|
+
"rect",
|
|
6929
|
+
{
|
|
6930
|
+
x: "3.55",
|
|
6931
|
+
y: "5.35",
|
|
6932
|
+
width: "15.2",
|
|
6933
|
+
height: "11.15",
|
|
6934
|
+
rx: "3.9",
|
|
6935
|
+
stroke: "currentColor",
|
|
6936
|
+
strokeWidth: "1.9"
|
|
6937
|
+
}
|
|
6938
|
+
),
|
|
6939
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
6940
|
+
"circle",
|
|
6941
|
+
{
|
|
6942
|
+
className: "assist-edge-tab__eye",
|
|
6943
|
+
cx: "8.7",
|
|
6944
|
+
cy: "10.85",
|
|
6945
|
+
r: "1.28",
|
|
6946
|
+
fill: "currentColor"
|
|
6947
|
+
}
|
|
6948
|
+
),
|
|
6949
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
6950
|
+
"circle",
|
|
6951
|
+
{
|
|
6952
|
+
className: "assist-edge-tab__eye assist-edge-tab__eye--r",
|
|
6953
|
+
cx: "14.35",
|
|
6954
|
+
cy: "10.85",
|
|
6955
|
+
r: "1.28",
|
|
6956
|
+
fill: "currentColor"
|
|
6957
|
+
}
|
|
6958
|
+
)
|
|
6959
|
+
] })
|
|
6850
6960
|
]
|
|
6851
6961
|
}
|
|
6852
6962
|
);
|
|
6853
6963
|
}
|
|
6854
|
-
function TabMarkIcon({
|
|
6855
|
-
|
|
6856
|
-
|
|
6964
|
+
function TabMarkIcon({
|
|
6965
|
+
customIconUrl,
|
|
6966
|
+
logoUrl
|
|
6967
|
+
}) {
|
|
6968
|
+
const custom = customIconUrl?.trim();
|
|
6969
|
+
const logo = logoUrl?.trim();
|
|
6970
|
+
const [customFailed, setCustomFailed] = (0, import_react15.useState)(false);
|
|
6971
|
+
const [logoFailed, setLogoFailed] = (0, import_react15.useState)(false);
|
|
6972
|
+
if (custom && !customFailed) {
|
|
6857
6973
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
6858
6974
|
"img",
|
|
6859
6975
|
{
|
|
6860
6976
|
alt: "",
|
|
6861
6977
|
"aria-hidden": true,
|
|
6862
6978
|
className: "assist-edge-tab__custom-icon",
|
|
6863
|
-
src:
|
|
6979
|
+
src: custom,
|
|
6980
|
+
onError: () => setCustomFailed(true)
|
|
6864
6981
|
}
|
|
6865
6982
|
);
|
|
6866
6983
|
}
|
|
6867
|
-
|
|
6984
|
+
if (logo && !logoFailed) {
|
|
6985
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
6986
|
+
"img",
|
|
6987
|
+
{
|
|
6988
|
+
alt: "",
|
|
6989
|
+
"aria-hidden": true,
|
|
6990
|
+
className: "assist-edge-tab__logo",
|
|
6991
|
+
src: logo,
|
|
6992
|
+
onError: () => setLogoFailed(true)
|
|
6993
|
+
}
|
|
6994
|
+
);
|
|
6995
|
+
}
|
|
6996
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ChatSparkIcon, {});
|
|
6868
6997
|
}
|
|
6869
6998
|
function ChevronLeftIcon() {
|
|
6870
6999
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
@@ -6905,6 +7034,7 @@ function AssistEdgeTab({
|
|
|
6905
7034
|
inset,
|
|
6906
7035
|
visible,
|
|
6907
7036
|
label,
|
|
7037
|
+
subLabel,
|
|
6908
7038
|
customIconUrl,
|
|
6909
7039
|
logoUrl,
|
|
6910
7040
|
brandColor,
|
|
@@ -6920,12 +7050,16 @@ function AssistEdgeTab({
|
|
|
6920
7050
|
const resolvedColorScheme = useAgentColorScheme(colorScheme);
|
|
6921
7051
|
const copy = VARIANT_COPY[variant];
|
|
6922
7052
|
const visibleLabel = label?.trim() || copy.label;
|
|
7053
|
+
const visibleSubLabel = subLabel?.trim() || "";
|
|
7054
|
+
const pill = mobile || side === "bottom";
|
|
7055
|
+
const chromeScheme = pill ? "light" : resolvedColorScheme;
|
|
7056
|
+
const ariaLabel = visibleSubLabel ? `Open ${visibleLabel} \u2014 ${visibleSubLabel}` : `Open ${visibleLabel}`;
|
|
6923
7057
|
const alignment = along < 50 ? "start" : along > 50 ? "end" : "center";
|
|
6924
|
-
const
|
|
6925
|
-
const
|
|
6926
|
-
const
|
|
6927
|
-
const
|
|
6928
|
-
const
|
|
7058
|
+
const resolvedBrandColor = brandColor ?? (chromeScheme === "dark" ? defaultDarkAgentRailTheme.brand : void 0);
|
|
7059
|
+
const resolvedBorderColor = chromeScheme === "dark" ? defaultDarkAgentRailTheme.border : borderColor;
|
|
7060
|
+
const resolvedSurfaceColor = chromeScheme === "dark" ? defaultDarkAgentRailTheme.surface : surfaceColor;
|
|
7061
|
+
const resolvedTextColor = chromeScheme === "dark" ? defaultDarkAgentRailTheme.text : textColor;
|
|
7062
|
+
const markSourceKey = `${customIconUrl?.trim() ?? ""}|${logoUrl?.trim() ?? ""}`;
|
|
6929
7063
|
const style = {
|
|
6930
7064
|
"--tab-along": `${along}%`,
|
|
6931
7065
|
"--tab-inset": `${inset}px`,
|
|
@@ -6933,83 +7067,72 @@ function AssistEdgeTab({
|
|
|
6933
7067
|
...brandForeground ? { "--as-visitor-text": brandForeground } : {},
|
|
6934
7068
|
...resolvedBorderColor ? { "--as-border": resolvedBorderColor } : {},
|
|
6935
7069
|
...fontFamily ? { "--as-font-display": fontFamily } : {},
|
|
6936
|
-
...resolvedSurfaceColor ? { "--as-surface": resolvedSurfaceColor } : {},
|
|
6937
|
-
|
|
6938
|
-
colorScheme:
|
|
7070
|
+
...pill ? { "--as-surface": "#ffffff", "--as-text": "#171717" } : resolvedSurfaceColor ? { "--as-surface": resolvedSurfaceColor } : {},
|
|
7071
|
+
...!pill && resolvedTextColor ? { "--as-text": resolvedTextColor } : {},
|
|
7072
|
+
colorScheme: chromeScheme
|
|
6939
7073
|
};
|
|
6940
7074
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
6941
7075
|
"button",
|
|
6942
7076
|
{
|
|
6943
7077
|
type: "button",
|
|
6944
7078
|
className: `assist-edge-tab assist-edge-tab--${variant} assist-edge-tab--${side} assist-edge-tab--align-${alignment}${mobile ? " assist-edge-tab--mobile" : ""}${visible ? " is-visible" : ""}`,
|
|
6945
|
-
"data-color-scheme":
|
|
7079
|
+
"data-color-scheme": chromeScheme,
|
|
6946
7080
|
style,
|
|
6947
|
-
"aria-label":
|
|
7081
|
+
"aria-label": ariaLabel,
|
|
6948
7082
|
"aria-hidden": !visible,
|
|
6949
7083
|
tabIndex: visible ? 0 : -1,
|
|
6950
7084
|
onClick: onOpen,
|
|
6951
7085
|
children: [
|
|
6952
|
-
|
|
7086
|
+
pill ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
6953
7087
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
6954
7088
|
"span",
|
|
6955
7089
|
{
|
|
6956
|
-
className:
|
|
7090
|
+
className: `assist-edge-tab__mark assist-edge-tab__mark--chip${mobile ? " assist-edge-tab__mark--mobile" : ""}`,
|
|
6957
7091
|
"aria-hidden": "true",
|
|
6958
7092
|
children: [
|
|
6959
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
6960
|
-
|
|
6961
|
-
|
|
7093
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "assist-edge-tab__wash assist-edge-tab__wash--light" }),
|
|
7094
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "assist-edge-tab__wash assist-edge-tab__wash--cool" }),
|
|
7095
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7096
|
+
TabMarkIcon,
|
|
6962
7097
|
{
|
|
6963
|
-
|
|
6964
|
-
|
|
6965
|
-
|
|
6966
|
-
|
|
6967
|
-
|
|
6968
|
-
}
|
|
6969
|
-
}
|
|
6970
|
-
) : null
|
|
7098
|
+
customIconUrl,
|
|
7099
|
+
logoUrl
|
|
7100
|
+
},
|
|
7101
|
+
markSourceKey
|
|
7102
|
+
)
|
|
6971
7103
|
]
|
|
6972
7104
|
}
|
|
6973
7105
|
),
|
|
6974
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.
|
|
7106
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "assist-edge-tab__text", children: [
|
|
7107
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "assist-edge-tab__label", children: visibleLabel }),
|
|
7108
|
+
visibleSubLabel ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "assist-edge-tab__sublabel", children: visibleSubLabel }) : null
|
|
7109
|
+
] })
|
|
6975
7110
|
] }) : variant === "outline" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
6976
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.
|
|
6977
|
-
|
|
6978
|
-
|
|
6979
|
-
|
|
6980
|
-
|
|
6981
|
-
|
|
6982
|
-
|
|
6983
|
-
|
|
6984
|
-
onError: (event) => {
|
|
6985
|
-
event.currentTarget.hidden = true;
|
|
6986
|
-
}
|
|
6987
|
-
}
|
|
6988
|
-
) : null
|
|
6989
|
-
] }),
|
|
7111
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "assist-edge-tab__mark", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7112
|
+
TabMarkIcon,
|
|
7113
|
+
{
|
|
7114
|
+
customIconUrl,
|
|
7115
|
+
logoUrl
|
|
7116
|
+
},
|
|
7117
|
+
markSourceKey
|
|
7118
|
+
) }),
|
|
6990
7119
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "assist-edge-tab__label", children: visibleLabel }),
|
|
6991
7120
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ChevronDownIcon2, {})
|
|
6992
7121
|
] }) : null,
|
|
6993
|
-
variant === "ask" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
7122
|
+
!pill && variant === "ask" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
6994
7123
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ChevronLeftIcon, {}),
|
|
6995
7124
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "assist-edge-tab__label", children: visibleLabel }),
|
|
6996
7125
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DragDots, {})
|
|
6997
7126
|
] }) : null,
|
|
6998
|
-
variant === "fill" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
6999
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.
|
|
7000
|
-
|
|
7001
|
-
|
|
7002
|
-
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
|
-
|
|
7006
|
-
|
|
7007
|
-
onError: (event) => {
|
|
7008
|
-
event.currentTarget.hidden = true;
|
|
7009
|
-
}
|
|
7010
|
-
}
|
|
7011
|
-
) : null
|
|
7012
|
-
] }),
|
|
7127
|
+
!pill && variant === "fill" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
7128
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "assist-edge-tab__mark", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7129
|
+
TabMarkIcon,
|
|
7130
|
+
{
|
|
7131
|
+
customIconUrl,
|
|
7132
|
+
logoUrl
|
|
7133
|
+
},
|
|
7134
|
+
markSourceKey
|
|
7135
|
+
) }),
|
|
7013
7136
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "assist-edge-tab__label", children: visibleLabel }),
|
|
7014
7137
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ChevronLeftIcon, {})
|
|
7015
7138
|
] }) : null
|
|
@@ -7094,9 +7217,9 @@ function AgentWidget({
|
|
|
7094
7217
|
}) {
|
|
7095
7218
|
const isMobile = useIsMobile();
|
|
7096
7219
|
const placement = normalizeAgentPlacement(placementInput);
|
|
7097
|
-
const railSlotRef = (0,
|
|
7098
|
-
const [railCollapsed, setRailCollapsed] = (0,
|
|
7099
|
-
const [railExpanded, setRailExpanded] = (0,
|
|
7220
|
+
const railSlotRef = (0, import_react16.useRef)(null);
|
|
7221
|
+
const [railCollapsed, setRailCollapsed] = (0, import_react16.useState)(defaultCollapsed);
|
|
7222
|
+
const [railExpanded, setRailExpanded] = (0, import_react16.useState)(false);
|
|
7100
7223
|
const pageShiftActive = shouldApplyPageShift({
|
|
7101
7224
|
pageShift,
|
|
7102
7225
|
isMobile,
|
|
@@ -7149,7 +7272,7 @@ function AgentWidget({
|
|
|
7149
7272
|
} : {},
|
|
7150
7273
|
...branding?.colors?.border ? { border: branding.colors.border } : {}
|
|
7151
7274
|
};
|
|
7152
|
-
(0,
|
|
7275
|
+
(0, import_react16.useEffect)(() => {
|
|
7153
7276
|
if (!registerPanelController) return;
|
|
7154
7277
|
registerAgentPanelController(customerId, {
|
|
7155
7278
|
open: () => setRailCollapsed(false),
|
|
@@ -7184,7 +7307,7 @@ function AgentWidget({
|
|
|
7184
7307
|
})
|
|
7185
7308
|
);
|
|
7186
7309
|
}
|
|
7187
|
-
(0,
|
|
7310
|
+
(0, import_react16.useEffect)(() => {
|
|
7188
7311
|
if (railCollapsed) return;
|
|
7189
7312
|
const handleKeyDown = (event) => {
|
|
7190
7313
|
if (event.key === "Tab" && (isMobile || railExpanded)) {
|
|
@@ -7276,6 +7399,7 @@ function AgentWidget({
|
|
|
7276
7399
|
inset: placement.inset,
|
|
7277
7400
|
visible: true,
|
|
7278
7401
|
label: tabLabel,
|
|
7402
|
+
subLabel: branding?.tabSubLabel,
|
|
7279
7403
|
customIconUrl: branding?.tabIconUrl,
|
|
7280
7404
|
logoUrl: branding?.logoUrl,
|
|
7281
7405
|
brandColor: branding?.colors?.primary,
|
|
@@ -7293,7 +7417,7 @@ function AgentWidget({
|
|
|
7293
7417
|
}
|
|
7294
7418
|
|
|
7295
7419
|
// src/react/components/AgentTranscript/AgentTranscript.tsx
|
|
7296
|
-
var
|
|
7420
|
+
var import_react17 = require("react");
|
|
7297
7421
|
|
|
7298
7422
|
// src/react/components/AgentTranscript/TranscriptActivity.tsx
|
|
7299
7423
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
@@ -7414,7 +7538,7 @@ function AgentTranscript({
|
|
|
7414
7538
|
const previous = entries[index - 1];
|
|
7415
7539
|
const validTimestamp = Number.isFinite(date.getTime());
|
|
7416
7540
|
const showTimestamp = validTimestamp && (previous ? entry.createdAt - previous.createdAt >= 5 * 60 * 1e3 || date.toISOString().slice(0, 10) !== new Date(previous.createdAt).toJSON()?.slice(0, 10) : showInitialTimestamp);
|
|
7417
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
7541
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react17.Fragment, { children: [
|
|
7418
7542
|
showTimestamp ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("li", { className: "agent-transcript__time-marker", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("time", { dateTime: date.toISOString(), children: formatTimestamp(entry.createdAt) }) }) : null,
|
|
7419
7543
|
entry.kind === "activity" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TranscriptActivity, { activity: entry }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
7420
7544
|
"li",
|