@telia-ace/widget-conversation 1.0.38-next.0 → 1.0.38-next.2
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 +45 -7
- package/dist/components/conversation/ui/message-list-items/item-list.d.ts +8 -0
- package/dist/{conversation.f80bcb4a.js → conversation.be64b43a.js} +331 -213
- package/dist/conversation.be64b43a.js.map +1 -0
- package/dist/index.js +140 -140
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +13 -1
- package/package.json +9 -9
- package/dist/conversation.f80bcb4a.js.map +0 -1
|
@@ -1,130 +1,130 @@
|
|
|
1
1
|
var ve = Object.defineProperty, Ee = Object.defineProperties;
|
|
2
2
|
var xe = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var A = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var ne = Object.prototype.hasOwnProperty, re = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var te = (e, t, r) => t in e ? ve(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, g = (e, t) => {
|
|
6
6
|
for (var r in t || (t = {}))
|
|
7
|
-
|
|
7
|
+
ne.call(t, r) && te(e, r, t[r]);
|
|
8
8
|
if (A)
|
|
9
9
|
for (var r of A(t))
|
|
10
|
-
|
|
10
|
+
re.call(t, r) && te(e, r, t[r]);
|
|
11
11
|
return e;
|
|
12
|
-
},
|
|
13
|
-
var
|
|
12
|
+
}, E = (e, t) => Ee(e, xe(t));
|
|
13
|
+
var F = (e, t) => {
|
|
14
14
|
var r = {};
|
|
15
15
|
for (var o in e)
|
|
16
|
-
|
|
16
|
+
ne.call(e, o) && t.indexOf(o) < 0 && (r[o] = e[o]);
|
|
17
17
|
if (e != null && A)
|
|
18
18
|
for (var o of A(e))
|
|
19
|
-
t.indexOf(o) < 0 &&
|
|
19
|
+
t.indexOf(o) < 0 && re.call(e, o) && (r[o] = e[o]);
|
|
20
20
|
return r;
|
|
21
21
|
};
|
|
22
22
|
import a from "@emotion/styled";
|
|
23
|
-
import { useIsTabbing as we, useDispatch as
|
|
23
|
+
import { useIsTabbing as we, useDispatch as Y, useProperties as I, useScroll as le, SymbolBadge as x, Input as se, Button as z, borderTabStyle as f, Typography as G, invertedHoverButton as ke, Html as J, List as ie, buttonCss as Q, ItemList as K, itemList as O, useComponent as Ce, genericHtml as Se, headingElement as X, list as ze, WidgetOverlayOutlet as ce, ConversationContext as Le } from "@telia-ace/widget-ui";
|
|
24
24
|
import { appendClassNames as H } from "@telia-ace/widget-utilities";
|
|
25
|
-
import n, { useState as R, useEffect as
|
|
26
|
-
import { css as
|
|
25
|
+
import n, { useState as R, useEffect as me, forwardRef as Z, Suspense as Me, useMemo as Ie, useCallback as de, useRef as He } from "react";
|
|
26
|
+
import { css as p, keyframes as Te } from "@emotion/react";
|
|
27
27
|
import { FormComponent as Ae } from "@telia-ace/widget-forms";
|
|
28
|
-
import { ConversationMessageListItemType as
|
|
28
|
+
import { ConversationMessageListItemType as k, ConversationMessageType as W } from "./index.js";
|
|
29
29
|
import "@telia-ace/widget-core";
|
|
30
30
|
import "@telia-ace/widget-services";
|
|
31
31
|
import "@telia-ace/widget-plugins";
|
|
32
32
|
const Re = ({ className: e }) => {
|
|
33
|
-
const [t, r] = R(""), [o, l] = R(!1), [s, u] = R(0), [c, h] = R(0), v = we(), m =
|
|
33
|
+
const [t, r] = R(""), [o, l] = R(!1), [s, u] = R(0), [c, h] = R(0), v = we(), m = Y(), {
|
|
34
34
|
inputPlaceholder: i = "Type your message",
|
|
35
35
|
inputHidden: $ = !1,
|
|
36
|
-
inputDisabled:
|
|
37
|
-
sendButtonLabel:
|
|
38
|
-
inputMultiline:
|
|
39
|
-
secondaryAction:
|
|
40
|
-
} =
|
|
41
|
-
|
|
42
|
-
if (
|
|
43
|
-
const { lineHeight: d, maxHeight:
|
|
36
|
+
inputDisabled: S = !1,
|
|
37
|
+
sendButtonLabel: L = "Send message",
|
|
38
|
+
inputMultiline: w = !0,
|
|
39
|
+
secondaryAction: y
|
|
40
|
+
} = I(), [pe, b] = le(!0);
|
|
41
|
+
me(() => {
|
|
42
|
+
if (b.current) {
|
|
43
|
+
const { lineHeight: d, maxHeight: T } = getComputedStyle(b.current);
|
|
44
44
|
if (d && d.indexOf("px") > -1) {
|
|
45
|
-
const
|
|
45
|
+
const M = d.split("px"), be = parseInt(M[0], 10);
|
|
46
46
|
u(be);
|
|
47
|
-
const $e =
|
|
47
|
+
const $e = T.split("px");
|
|
48
48
|
h(parseInt($e[0], 10));
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
}, [
|
|
52
|
-
const
|
|
53
|
-
!d.shiftKey || !
|
|
54
|
-
},
|
|
55
|
-
!
|
|
56
|
-
actionKey:
|
|
57
|
-
},
|
|
51
|
+
}, [b.current]);
|
|
52
|
+
const j = (d) => {
|
|
53
|
+
!d.shiftKey || !w ? (d.preventDefault(), t && t.length > 0 && (m("user-submit", { text: t }), r(""), D(""))) : t.length < 1 && d.preventDefault();
|
|
54
|
+
}, fe = (d) => {
|
|
55
|
+
!y || (d.preventDefault(), m("action", g({
|
|
56
|
+
actionKey: y.action
|
|
57
|
+
}, y)));
|
|
58
58
|
}, ye = (d) => {
|
|
59
|
-
if (
|
|
60
|
-
const
|
|
61
|
-
if (
|
|
62
|
-
|
|
63
|
-
let
|
|
64
|
-
d.length < 1 && (
|
|
59
|
+
if (w && b.current) {
|
|
60
|
+
const T = b.current.scrollHeight;
|
|
61
|
+
if (T > s) {
|
|
62
|
+
b.current.style.height = "auto";
|
|
63
|
+
let M = T;
|
|
64
|
+
d.length < 1 && (M = s), b.current.style.height = `${M}px`, M >= c ? b.current.style.overflowY = "scroll" : b.current.style.overflowY = "hidden";
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
},
|
|
67
|
+
}, D = (d) => {
|
|
68
68
|
ye(d), r(d), d && d.length > 0 && m("user-typing", { textLength: d.length });
|
|
69
69
|
};
|
|
70
70
|
return $ ? null : /* @__PURE__ */ n.createElement(
|
|
71
71
|
Oe,
|
|
72
72
|
{
|
|
73
|
-
grow:
|
|
73
|
+
grow: w,
|
|
74
74
|
className: H("humany-conversation-input", e),
|
|
75
75
|
"data-has-focus": o,
|
|
76
|
-
scrollableCss:
|
|
76
|
+
scrollableCss: pe,
|
|
77
77
|
isTabbing: v
|
|
78
78
|
},
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
y && /* @__PURE__ */ n.createElement(
|
|
80
|
+
Ke,
|
|
81
81
|
{
|
|
82
|
-
disabled:
|
|
83
|
-
onClick:
|
|
84
|
-
title:
|
|
85
|
-
"aria-label":
|
|
82
|
+
disabled: S,
|
|
83
|
+
onClick: fe,
|
|
84
|
+
title: y.label,
|
|
85
|
+
"aria-label": y.label
|
|
86
86
|
},
|
|
87
87
|
/* @__PURE__ */ n.createElement(
|
|
88
|
-
|
|
88
|
+
x,
|
|
89
89
|
{
|
|
90
90
|
size: 24,
|
|
91
|
-
symbol: { type: "Svg", content:
|
|
91
|
+
symbol: { type: "Svg", content: y.icon || "browse" }
|
|
92
92
|
}
|
|
93
93
|
)
|
|
94
94
|
),
|
|
95
|
-
|
|
95
|
+
w ? /* @__PURE__ */ n.createElement(
|
|
96
96
|
Be,
|
|
97
97
|
{
|
|
98
98
|
value: t,
|
|
99
|
-
onChange:
|
|
100
|
-
onEnter:
|
|
101
|
-
disabled:
|
|
99
|
+
onChange: D,
|
|
100
|
+
onEnter: j,
|
|
101
|
+
disabled: S,
|
|
102
102
|
"aria-label": i,
|
|
103
103
|
placeholder: i,
|
|
104
104
|
onFocusChange: l,
|
|
105
105
|
type: "textarea",
|
|
106
106
|
rows: 1,
|
|
107
|
-
ref:
|
|
107
|
+
ref: b
|
|
108
108
|
}
|
|
109
109
|
) : /* @__PURE__ */ n.createElement(
|
|
110
|
-
|
|
110
|
+
Ne,
|
|
111
111
|
{
|
|
112
112
|
value: t,
|
|
113
|
-
onChange:
|
|
114
|
-
onEnter:
|
|
115
|
-
disabled:
|
|
113
|
+
onChange: D,
|
|
114
|
+
onEnter: j,
|
|
115
|
+
disabled: S,
|
|
116
116
|
"aria-label": i,
|
|
117
117
|
placeholder: i,
|
|
118
118
|
onFocusChange: l
|
|
119
119
|
}
|
|
120
120
|
),
|
|
121
121
|
/* @__PURE__ */ n.createElement(
|
|
122
|
-
|
|
122
|
+
ue,
|
|
123
123
|
{
|
|
124
|
-
disabled:
|
|
125
|
-
onClick:
|
|
126
|
-
title:
|
|
127
|
-
"aria-label":
|
|
124
|
+
disabled: S,
|
|
125
|
+
onClick: j,
|
|
126
|
+
title: L,
|
|
127
|
+
"aria-label": L
|
|
128
128
|
},
|
|
129
129
|
/* @__PURE__ */ n.createElement(
|
|
130
130
|
je,
|
|
@@ -136,7 +136,7 @@ const Re = ({ className: e }) => {
|
|
|
136
136
|
)
|
|
137
137
|
)
|
|
138
138
|
);
|
|
139
|
-
}, Be = a(
|
|
139
|
+
}, Be = a(se)`
|
|
140
140
|
resize: none;
|
|
141
141
|
flex: 1;
|
|
142
142
|
flex-shrink: 1;
|
|
@@ -156,7 +156,7 @@ const Re = ({ className: e }) => {
|
|
|
156
156
|
border: none;
|
|
157
157
|
transition: height 200ms linear;
|
|
158
158
|
outline: none;
|
|
159
|
-
`,
|
|
159
|
+
`, Ne = a(se)`
|
|
160
160
|
flex: 1;
|
|
161
161
|
border: none;
|
|
162
162
|
background-color: transparent;
|
|
@@ -182,7 +182,7 @@ const Re = ({ className: e }) => {
|
|
|
182
182
|
}};
|
|
183
183
|
font-style: italic;
|
|
184
184
|
}
|
|
185
|
-
`,
|
|
185
|
+
`, ue = a(z)`
|
|
186
186
|
flex: 0 0 50px;
|
|
187
187
|
align-self: stretch;
|
|
188
188
|
background-color: transparent;
|
|
@@ -192,19 +192,19 @@ const Re = ({ className: e }) => {
|
|
|
192
192
|
border: none;
|
|
193
193
|
color: #a6a6a6;
|
|
194
194
|
&:focus-visible {
|
|
195
|
-
${
|
|
195
|
+
${f};
|
|
196
196
|
}
|
|
197
|
-
`,
|
|
197
|
+
`, Ke = a(ue)`
|
|
198
198
|
border-right: ${(e) => e.theme.border};
|
|
199
199
|
margin: ${(e) => {
|
|
200
200
|
var t;
|
|
201
201
|
return (t = e.theme.sizes) == null ? void 0 : t.normal;
|
|
202
202
|
}} 0;
|
|
203
203
|
`, Oe = a.div`
|
|
204
|
-
${(e) => e.grow ?
|
|
204
|
+
${(e) => e.grow ? p`
|
|
205
205
|
min-height: 50px;
|
|
206
206
|
max-height: 150px;
|
|
207
|
-
` :
|
|
207
|
+
` : p`
|
|
208
208
|
height: 50px;
|
|
209
209
|
`}
|
|
210
210
|
flex: 0 0 auto;
|
|
@@ -215,7 +215,7 @@ const Re = ({ className: e }) => {
|
|
|
215
215
|
return (t = e.theme.colors) == null ? void 0 : t.accent;
|
|
216
216
|
}};
|
|
217
217
|
border-top: ${(e) => e.theme.inputBorder};
|
|
218
|
-
${(e) => e["data-has-focus"] && e.isTabbing &&
|
|
218
|
+
${(e) => e["data-has-focus"] && e.isTabbing && f}
|
|
219
219
|
textarea {
|
|
220
220
|
${(e) => !!e.scrollableCss && e.scrollableCss}
|
|
221
221
|
}
|
|
@@ -223,10 +223,10 @@ const Re = ({ className: e }) => {
|
|
|
223
223
|
(r) => {
|
|
224
224
|
var o = r, {
|
|
225
225
|
hasContent: e
|
|
226
|
-
} = o, t =
|
|
226
|
+
} = o, t = F(o, [
|
|
227
227
|
"hasContent"
|
|
228
228
|
]);
|
|
229
|
-
return /* @__PURE__ */ n.createElement(
|
|
229
|
+
return /* @__PURE__ */ n.createElement(x, g({}, t));
|
|
230
230
|
}
|
|
231
231
|
)`
|
|
232
232
|
line,
|
|
@@ -287,7 +287,7 @@ const Re = ({ className: e }) => {
|
|
|
287
287
|
}};
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
|
-
`, We =
|
|
290
|
+
`, We = Te`
|
|
291
291
|
0% {
|
|
292
292
|
opacity: 0;
|
|
293
293
|
}
|
|
@@ -311,29 +311,29 @@ const Re = ({ className: e }) => {
|
|
|
311
311
|
}};
|
|
312
312
|
animation: ${We} 1s infinite;
|
|
313
313
|
}
|
|
314
|
-
> div:nth-
|
|
314
|
+
> div:nth-of-type(2) {
|
|
315
315
|
animation-delay: 100ms;
|
|
316
316
|
}
|
|
317
|
-
> div:nth-
|
|
317
|
+
> div:nth-of-type(3) {
|
|
318
318
|
animation-delay: 200ms;
|
|
319
319
|
}
|
|
320
|
-
`,
|
|
320
|
+
`, _ = a.div`
|
|
321
321
|
grid-area: content;
|
|
322
322
|
max-width: 100%;
|
|
323
323
|
overflow: hidden;
|
|
324
|
-
`, Ue = a(
|
|
324
|
+
`, Ue = a(G)`
|
|
325
325
|
font-size: ${(e) => {
|
|
326
326
|
var t;
|
|
327
327
|
return (t = e.theme.fonts) == null ? void 0 : t.normal;
|
|
328
328
|
}};
|
|
329
329
|
font-weight: normal;
|
|
330
330
|
margin: 0;
|
|
331
|
-
`,
|
|
331
|
+
`, V = a.div`
|
|
332
332
|
display: flex;
|
|
333
333
|
${(e) => e.left && "justify-content: start;"};
|
|
334
334
|
${(e) => e.center && "justify-content: center;"};
|
|
335
335
|
${(e) => e.right && "justify-content: end;"};
|
|
336
|
-
`,
|
|
336
|
+
`, q = a.div`
|
|
337
337
|
${(e) => {
|
|
338
338
|
var t;
|
|
339
339
|
return e.padded && `padding: ${(t = e.theme.sizes) == null ? void 0 : t.medium};`;
|
|
@@ -357,12 +357,12 @@ const Re = ({ className: e }) => {
|
|
|
357
357
|
${(e) => e.fullWidth && "width: 100%;"}
|
|
358
358
|
`, _e = (e, t) => {
|
|
359
359
|
var o, l;
|
|
360
|
-
const r =
|
|
360
|
+
const r = p`
|
|
361
361
|
background-color: ${(o = t.colors) == null ? void 0 : o.accent};
|
|
362
362
|
color: ${(l = t.colors) == null ? void 0 : l.text};
|
|
363
363
|
${t.border && `border: ${t.border};`};
|
|
364
364
|
`;
|
|
365
|
-
return t.borderRadius ?
|
|
365
|
+
return t.borderRadius ? p`
|
|
366
366
|
${r}
|
|
367
367
|
|
|
368
368
|
border-top-right-radius: ${t.borderRadius};
|
|
@@ -378,11 +378,11 @@ const Re = ({ className: e }) => {
|
|
|
378
378
|
` : r;
|
|
379
379
|
}, Ve = (e, t) => {
|
|
380
380
|
var o, l;
|
|
381
|
-
const r =
|
|
381
|
+
const r = p`
|
|
382
382
|
background-color: ${(o = t.colors) == null ? void 0 : o.primary};
|
|
383
383
|
color: ${(l = t.colors) == null ? void 0 : l.accent};
|
|
384
384
|
`;
|
|
385
|
-
return t.borderRadius ?
|
|
385
|
+
return t.borderRadius ? p`
|
|
386
386
|
${r}
|
|
387
387
|
|
|
388
388
|
border-top-left-radius: ${t.borderRadius};
|
|
@@ -404,9 +404,9 @@ const Re = ({ className: e }) => {
|
|
|
404
404
|
&:last-child {
|
|
405
405
|
margin-bottom: 0;
|
|
406
406
|
}
|
|
407
|
-
`,
|
|
407
|
+
`, C = (e) => {
|
|
408
408
|
var t, r;
|
|
409
|
-
return
|
|
409
|
+
return p`
|
|
410
410
|
margin: ${(t = e.theme.sizes) == null ? void 0 : t.medium} 0;
|
|
411
411
|
padding: 0 ${(r = e.theme.sizes) == null ? void 0 : r.medium};
|
|
412
412
|
`;
|
|
@@ -438,18 +438,18 @@ const Re = ({ className: e }) => {
|
|
|
438
438
|
}};
|
|
439
439
|
}
|
|
440
440
|
}
|
|
441
|
-
`, Ye = a(
|
|
441
|
+
`, Ye = a(J)`
|
|
442
442
|
white-space: pre-wrap;
|
|
443
443
|
a {
|
|
444
444
|
color: ${(e) => e.theme.colors.link};
|
|
445
445
|
&:focus {
|
|
446
446
|
${(e) => {
|
|
447
447
|
var t;
|
|
448
|
-
return ((t = e.theme.accessibility) == null ? void 0 : t.isTabbing) &&
|
|
448
|
+
return ((t = e.theme.accessibility) == null ? void 0 : t.isTabbing) && f;
|
|
449
449
|
}};
|
|
450
450
|
}
|
|
451
451
|
}
|
|
452
|
-
`, Ge = a(
|
|
452
|
+
`, Ge = a(ie)`
|
|
453
453
|
padding: 0;
|
|
454
454
|
list-style: none;
|
|
455
455
|
margin: 0 -${(e) => {
|
|
@@ -463,7 +463,7 @@ const Re = ({ className: e }) => {
|
|
|
463
463
|
}};
|
|
464
464
|
}
|
|
465
465
|
`, Je = a.button`
|
|
466
|
-
${(e) =>
|
|
466
|
+
${(e) => Q(e)};
|
|
467
467
|
display: block;
|
|
468
468
|
background-color: ${(e) => {
|
|
469
469
|
var t;
|
|
@@ -472,12 +472,12 @@ const Re = ({ className: e }) => {
|
|
|
472
472
|
width: 100%;
|
|
473
473
|
color: #fff;
|
|
474
474
|
&:focus-visible {
|
|
475
|
-
${
|
|
475
|
+
${f}
|
|
476
476
|
background-color: transparent;
|
|
477
477
|
}
|
|
478
|
-
`, Qe =
|
|
479
|
-
({ boxed: e, className: t, agentData: r }, o) => /* @__PURE__ */ n.createElement(
|
|
480
|
-
),
|
|
478
|
+
`, Qe = Z(
|
|
479
|
+
({ boxed: e, className: t, agentData: r }, o) => /* @__PURE__ */ n.createElement(_, { ref: o }, /* @__PURE__ */ n.createElement(V, { left: e, center: !e }, /* @__PURE__ */ n.createElement(q, { padded: !!e, stacked: e ? "first" : void 0 }, /* @__PURE__ */ n.createElement(Pe, null, /* @__PURE__ */ n.createElement("div", null), /* @__PURE__ */ n.createElement("div", null), /* @__PURE__ */ n.createElement("div", null)))))
|
|
480
|
+
), oe = Qe, Xe = a.p`
|
|
481
481
|
&& {
|
|
482
482
|
font-size: ${(e) => {
|
|
483
483
|
var t;
|
|
@@ -492,41 +492,41 @@ const Re = ({ className: e }) => {
|
|
|
492
492
|
var t;
|
|
493
493
|
return (t = e.theme.colors) == null ? void 0 : t.text;
|
|
494
494
|
}};
|
|
495
|
-
`,
|
|
495
|
+
`, ae = (e) => new Date(e).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }), Ze = ({ className: e, name: t, timestamp: r }) => {
|
|
496
496
|
if (!t && !r)
|
|
497
497
|
return null;
|
|
498
498
|
let o = "";
|
|
499
|
-
return t ? r ? o = `${t}: ${
|
|
500
|
-
},
|
|
501
|
-
const { avatar: l, name: s } = r, { avatarSize: u } =
|
|
499
|
+
return t ? r ? o = `${t}: ${ae(r)}` : o = t : r && (o = ae(r)), /* @__PURE__ */ n.createElement(Xe, null, o);
|
|
500
|
+
}, N = Ze, et = ({ className: e, children: t, sender: r, timestamp: o }) => {
|
|
501
|
+
const { avatar: l, name: s } = r, { avatarSize: u } = I();
|
|
502
502
|
return /* @__PURE__ */ n.createElement(
|
|
503
503
|
tt,
|
|
504
504
|
{
|
|
505
505
|
hasAvatar: !!l,
|
|
506
506
|
className: H(e, "humany-conversation-agent-message")
|
|
507
507
|
},
|
|
508
|
-
l && /* @__PURE__ */ n.createElement(Fe, { avatarSize: u }, typeof l == "string" ? /* @__PURE__ */ n.createElement("img", { src: l }) : /* @__PURE__ */ n.createElement(
|
|
508
|
+
l && /* @__PURE__ */ n.createElement(Fe, { avatarSize: u }, typeof l == "string" ? /* @__PURE__ */ n.createElement("img", { src: l }) : /* @__PURE__ */ n.createElement(x, { symbol: l })),
|
|
509
509
|
t,
|
|
510
|
-
/* @__PURE__ */ n.createElement(
|
|
510
|
+
/* @__PURE__ */ n.createElement(N, { name: s, timestamp: o })
|
|
511
511
|
);
|
|
512
512
|
}, tt = a.div`
|
|
513
513
|
display: grid;
|
|
514
514
|
margin-right: 10%;
|
|
515
515
|
width: 90%;
|
|
516
|
-
${(e) => e.hasAvatar ?
|
|
516
|
+
${(e) => e.hasAvatar ? p`
|
|
517
517
|
grid-template-columns: auto 1fr;
|
|
518
518
|
grid-template-rows: 1fr auto;
|
|
519
519
|
grid-template-areas:
|
|
520
520
|
'avatar content'
|
|
521
521
|
'. info';
|
|
522
|
-
` :
|
|
522
|
+
` : p`
|
|
523
523
|
grid-template-columns: 1fr;
|
|
524
524
|
grid-template-rows: 1fr auto;
|
|
525
525
|
grid-template-areas:
|
|
526
526
|
'content'
|
|
527
527
|
'info';
|
|
528
528
|
`};
|
|
529
|
-
`,
|
|
529
|
+
`, he = et, nt = Z(
|
|
530
530
|
({ className: e, children: t, timestamp: r, discrete: o, fullWidth: l }, s) => /* @__PURE__ */ n.createElement(
|
|
531
531
|
rt,
|
|
532
532
|
{
|
|
@@ -534,7 +534,7 @@ const Re = ({ className: e }) => {
|
|
|
534
534
|
className: H(e, "humany-conversation-system-message"),
|
|
535
535
|
fullWidth: l
|
|
536
536
|
},
|
|
537
|
-
o ? /* @__PURE__ */ n.createElement(ot, { className: "humany-conversation-discrete-message" }, t, /* @__PURE__ */ n.createElement(
|
|
537
|
+
o ? /* @__PURE__ */ n.createElement(ot, { className: "humany-conversation-discrete-message" }, t, /* @__PURE__ */ n.createElement(N, { timestamp: r })) : /* @__PURE__ */ n.createElement(n.Fragment, null, t, /* @__PURE__ */ n.createElement(N, { timestamp: r }))
|
|
538
538
|
)
|
|
539
539
|
), rt = a.div`
|
|
540
540
|
${(e) => e.fullWidth && "width: 100%"};
|
|
@@ -558,14 +558,14 @@ const Re = ({ className: e }) => {
|
|
|
558
558
|
margin: 0;
|
|
559
559
|
}
|
|
560
560
|
`, at = nt, lt = ({ className: e, children: t, timestamp: r }) => {
|
|
561
|
-
const { userLabel: o = "" } =
|
|
561
|
+
const { userLabel: o = "" } = I();
|
|
562
562
|
return /* @__PURE__ */ n.createElement(
|
|
563
563
|
st,
|
|
564
564
|
{
|
|
565
565
|
className: H(e, "humany-conversation-user-message")
|
|
566
566
|
},
|
|
567
567
|
t,
|
|
568
|
-
/* @__PURE__ */ n.createElement(
|
|
568
|
+
/* @__PURE__ */ n.createElement(N, { name: o, timestamp: r })
|
|
569
569
|
);
|
|
570
570
|
}, st = a.div`
|
|
571
571
|
margin-left: 10%;
|
|
@@ -573,14 +573,14 @@ const Re = ({ className: e }) => {
|
|
|
573
573
|
display: flex;
|
|
574
574
|
flex-direction: column;
|
|
575
575
|
align-items: flex-end;
|
|
576
|
-
`, it = lt,
|
|
576
|
+
`, it = lt, ee = (e) => Array.isArray(e) ? e : Object.keys(e).map((t) => ({
|
|
577
577
|
label: e[t],
|
|
578
578
|
actionKey: t
|
|
579
579
|
})), ct = ({ header: e, actions: t, dispatch: r }) => /* @__PURE__ */ n.createElement(
|
|
580
580
|
mt,
|
|
581
581
|
{
|
|
582
582
|
header: e,
|
|
583
|
-
items:
|
|
583
|
+
items: ee(t),
|
|
584
584
|
renderItem: (o) => /* @__PURE__ */ n.createElement("li", { key: o.actionKey }, /* @__PURE__ */ n.createElement(
|
|
585
585
|
dt,
|
|
586
586
|
{
|
|
@@ -590,12 +590,12 @@ const Re = ({ className: e }) => {
|
|
|
590
590
|
"aria-label": o.label,
|
|
591
591
|
title: o.label
|
|
592
592
|
},
|
|
593
|
-
/* @__PURE__ */ n.createElement(
|
|
593
|
+
/* @__PURE__ */ n.createElement(x, { symbol: o.symbol }),
|
|
594
594
|
o.label
|
|
595
595
|
))
|
|
596
596
|
}
|
|
597
|
-
), mt = a(
|
|
598
|
-
${
|
|
597
|
+
), mt = a(K)`
|
|
598
|
+
${O}
|
|
599
599
|
> ul {
|
|
600
600
|
display: flex;
|
|
601
601
|
flex-wrap: wrap;
|
|
@@ -607,9 +607,9 @@ const Re = ({ className: e }) => {
|
|
|
607
607
|
margin: 0;
|
|
608
608
|
}
|
|
609
609
|
}
|
|
610
|
-
${
|
|
611
|
-
`, dt = a(
|
|
612
|
-
${
|
|
610
|
+
${C}
|
|
611
|
+
`, dt = a(z)`
|
|
612
|
+
${Q};
|
|
613
613
|
|
|
614
614
|
display: block;
|
|
615
615
|
padding: ${(e) => {
|
|
@@ -625,7 +625,7 @@ const Re = ({ className: e }) => {
|
|
|
625
625
|
overflow: hidden;
|
|
626
626
|
text-overflow: ellipsis;
|
|
627
627
|
&:focus-visible {
|
|
628
|
-
${
|
|
628
|
+
${f}
|
|
629
629
|
background-color: transparent;
|
|
630
630
|
}
|
|
631
631
|
|
|
@@ -639,24 +639,140 @@ const Re = ({ className: e }) => {
|
|
|
639
639
|
`, ut = ({ type: e, content: t = {} }) => {
|
|
640
640
|
const r = Ce(e);
|
|
641
641
|
return !r || !e ? null : /* @__PURE__ */ n.createElement(Me, { fallback: null }, /* @__PURE__ */ n.createElement(r, g({}, t)));
|
|
642
|
-
}, ht = ({ body: e }) => /* @__PURE__ */ n.createElement(gt, { html: e }), gt = a(
|
|
642
|
+
}, ht = ({ body: e }) => /* @__PURE__ */ n.createElement(gt, { html: e }), gt = a(J)`
|
|
643
643
|
${Se}
|
|
644
644
|
color: inherit;
|
|
645
645
|
white-space: pre-wrap;
|
|
646
|
-
${
|
|
646
|
+
${C}
|
|
647
647
|
a {
|
|
648
648
|
color: ${(e) => e.theme.colors.link};
|
|
649
649
|
&:focus-visible {
|
|
650
|
-
${
|
|
650
|
+
${f};
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
|
-
`,
|
|
654
|
-
|
|
653
|
+
`, pt = ({ header: e, actions: t, dispatch: r }) => /* @__PURE__ */ n.createElement(
|
|
654
|
+
ft,
|
|
655
655
|
{
|
|
656
656
|
header: e,
|
|
657
|
-
items:
|
|
657
|
+
items: ee(t),
|
|
658
|
+
renderItem: (o) => {
|
|
659
|
+
var l;
|
|
660
|
+
return /* @__PURE__ */ n.createElement("li", { key: o.actionKey }, /* @__PURE__ */ n.createElement(yt, null, ((l = o.symbol) == null ? void 0 : l.content) && /* @__PURE__ */ n.createElement("div", { className: "item-icon" }, /* @__PURE__ */ n.createElement(
|
|
661
|
+
x,
|
|
662
|
+
{
|
|
663
|
+
size: 22,
|
|
664
|
+
symbol: {
|
|
665
|
+
type: o.symbol.type,
|
|
666
|
+
content: o.symbol.content
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
)), /* @__PURE__ */ n.createElement("div", { className: "item-body" }, /* @__PURE__ */ n.createElement(
|
|
670
|
+
z,
|
|
671
|
+
{
|
|
672
|
+
onClick: () => {
|
|
673
|
+
r("action", o);
|
|
674
|
+
},
|
|
675
|
+
"aria-label": o.label,
|
|
676
|
+
title: o.label
|
|
677
|
+
},
|
|
678
|
+
o.label
|
|
679
|
+
), o.description && /* @__PURE__ */ n.createElement("p", null, o.description))));
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
), ft = a(K)`
|
|
683
|
+
${O}
|
|
684
|
+
|
|
685
|
+
> .humany-paragraph {
|
|
686
|
+
${C}
|
|
687
|
+
margin-bottom: 0;
|
|
688
|
+
|
|
689
|
+
h1 {
|
|
690
|
+
margin: 0;
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
${(e) => X(e)(
|
|
695
|
+
"h1",
|
|
696
|
+
p`
|
|
697
|
+
white-space: normal;
|
|
698
|
+
`
|
|
699
|
+
)}
|
|
700
|
+
|
|
701
|
+
> ul {
|
|
702
|
+
display: flex;
|
|
703
|
+
flex-direction: column;
|
|
704
|
+
gap: ${(e) => {
|
|
705
|
+
var t;
|
|
706
|
+
return (t = e.theme.sizes) == null ? void 0 : t.normal;
|
|
707
|
+
}};
|
|
708
|
+
> li {
|
|
709
|
+
margin: 0;
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
li {
|
|
714
|
+
border-bottom: ${(e) => e.theme.border};
|
|
715
|
+
|
|
716
|
+
&:last-of-type {
|
|
717
|
+
border-bottom: none;
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
`, yt = a.div`
|
|
721
|
+
display: flex;
|
|
722
|
+
gap: ${(e) => {
|
|
723
|
+
var t;
|
|
724
|
+
return (t = e.theme.sizes) == null ? void 0 : t.medium;
|
|
725
|
+
}};
|
|
726
|
+
${C}
|
|
727
|
+
|
|
728
|
+
.item-icon {
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
.item-body {
|
|
732
|
+
display: flex;
|
|
733
|
+
flex-direction: column;
|
|
734
|
+
align-items: flex-start;
|
|
735
|
+
gap: ${(e) => {
|
|
736
|
+
var t;
|
|
737
|
+
return (t = e.theme.sizes) == null ? void 0 : t.normal;
|
|
738
|
+
}};
|
|
739
|
+
|
|
740
|
+
p {
|
|
741
|
+
margin: 0;
|
|
742
|
+
white-space: normal;
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
button {
|
|
747
|
+
background: transparent;
|
|
748
|
+
border: none;
|
|
749
|
+
font-family: inherit;
|
|
750
|
+
font-size: ${(e) => {
|
|
751
|
+
var t;
|
|
752
|
+
return (t = e.theme.fonts) == null ? void 0 : t.normal;
|
|
753
|
+
}};
|
|
754
|
+
cursor: pointer;
|
|
755
|
+
padding: 0;
|
|
756
|
+
margin: 0;
|
|
757
|
+
|
|
758
|
+
&:focus-visible {
|
|
759
|
+
${f}
|
|
760
|
+
span {
|
|
761
|
+
color: ${(e) => {
|
|
762
|
+
var t;
|
|
763
|
+
return (t = e.theme.colors) == null ? void 0 : t.primary;
|
|
764
|
+
}};
|
|
765
|
+
text-decoration: underline;
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
`, bt = ({ header: e, actions: t, dispatch: r }) => /* @__PURE__ */ n.createElement(
|
|
770
|
+
$t,
|
|
771
|
+
{
|
|
772
|
+
header: e,
|
|
773
|
+
items: ee(t),
|
|
658
774
|
renderItem: (o) => /* @__PURE__ */ n.createElement("li", { key: o.actionKey }, /* @__PURE__ */ n.createElement(
|
|
659
|
-
|
|
775
|
+
vt,
|
|
660
776
|
{
|
|
661
777
|
help: o.actionKey === "help",
|
|
662
778
|
onClick: () => {
|
|
@@ -667,7 +783,7 @@ const Re = ({ className: e }) => {
|
|
|
667
783
|
},
|
|
668
784
|
o.label,
|
|
669
785
|
o.actionKey === "help" && /* @__PURE__ */ n.createElement(
|
|
670
|
-
|
|
786
|
+
x,
|
|
671
787
|
{
|
|
672
788
|
size: 14,
|
|
673
789
|
symbol: {
|
|
@@ -678,13 +794,13 @@ const Re = ({ className: e }) => {
|
|
|
678
794
|
)
|
|
679
795
|
))
|
|
680
796
|
}
|
|
681
|
-
),
|
|
682
|
-
${
|
|
683
|
-
${
|
|
797
|
+
), $t = a(K)`
|
|
798
|
+
${O}
|
|
799
|
+
${C}
|
|
684
800
|
|
|
685
|
-
${(e) =>
|
|
801
|
+
${(e) => X(e)(
|
|
686
802
|
"h1",
|
|
687
|
-
|
|
803
|
+
p`
|
|
688
804
|
white-space: normal;
|
|
689
805
|
`
|
|
690
806
|
)}
|
|
@@ -700,7 +816,7 @@ const Re = ({ className: e }) => {
|
|
|
700
816
|
margin: 0;
|
|
701
817
|
}
|
|
702
818
|
}
|
|
703
|
-
`,
|
|
819
|
+
`, vt = a(z)`
|
|
704
820
|
display: block;
|
|
705
821
|
text-align: left;
|
|
706
822
|
font-weight: 300;
|
|
@@ -714,7 +830,7 @@ const Re = ({ className: e }) => {
|
|
|
714
830
|
|
|
715
831
|
${(e) => {
|
|
716
832
|
var t, r;
|
|
717
|
-
return e.help &&
|
|
833
|
+
return e.help && p`
|
|
718
834
|
color: ${(t = e.theme.colors) == null ? void 0 : t.text};
|
|
719
835
|
text-decoration: underline;
|
|
720
836
|
|
|
@@ -726,7 +842,7 @@ const Re = ({ className: e }) => {
|
|
|
726
842
|
}}
|
|
727
843
|
|
|
728
844
|
&:focus-visible {
|
|
729
|
-
${
|
|
845
|
+
${f}
|
|
730
846
|
span {
|
|
731
847
|
color: ${(e) => {
|
|
732
848
|
var t;
|
|
@@ -735,18 +851,18 @@ const Re = ({ className: e }) => {
|
|
|
735
851
|
text-decoration: underline;
|
|
736
852
|
}
|
|
737
853
|
}
|
|
738
|
-
`,
|
|
854
|
+
`, Et = () => /* @__PURE__ */ n.createElement(xt, null), xt = a.div`
|
|
739
855
|
${(e) => e.theme.border && `border-bottom: ${e.theme.border};`}
|
|
740
856
|
width: 100%;
|
|
741
|
-
`,
|
|
742
|
-
${
|
|
743
|
-
`,
|
|
857
|
+
`, wt = ({ text: e }) => /* @__PURE__ */ n.createElement(kt, { variant: "span" }, e), kt = a(G)`
|
|
858
|
+
${C}
|
|
859
|
+
`, Ct = ({
|
|
744
860
|
header: e = "Video call",
|
|
745
861
|
acceptLabel: t = "Accept",
|
|
746
862
|
declineLabel: r = "Decline",
|
|
747
863
|
dispatch: o
|
|
748
864
|
}) => {
|
|
749
|
-
const l =
|
|
865
|
+
const l = Ie(() => [
|
|
750
866
|
{
|
|
751
867
|
label: t,
|
|
752
868
|
actionKey: "accept-video-call",
|
|
@@ -765,14 +881,14 @@ const Re = ({ className: e }) => {
|
|
|
765
881
|
}
|
|
766
882
|
], [t, r]);
|
|
767
883
|
return /* @__PURE__ */ n.createElement(
|
|
768
|
-
|
|
884
|
+
St,
|
|
769
885
|
{
|
|
770
886
|
header: e,
|
|
771
887
|
items: l,
|
|
772
888
|
renderItem: (s) => {
|
|
773
889
|
const u = s.actionKey === "accept-video-call" ? "#70c48e" : "#da5c85";
|
|
774
890
|
return /* @__PURE__ */ n.createElement("li", { key: s.actionKey }, /* @__PURE__ */ n.createElement(
|
|
775
|
-
|
|
891
|
+
zt,
|
|
776
892
|
{
|
|
777
893
|
onClick: () => {
|
|
778
894
|
o("action", s);
|
|
@@ -781,13 +897,13 @@ const Re = ({ className: e }) => {
|
|
|
781
897
|
title: s.label,
|
|
782
898
|
bgColor: u
|
|
783
899
|
},
|
|
784
|
-
/* @__PURE__ */ n.createElement(
|
|
900
|
+
/* @__PURE__ */ n.createElement(x, { symbol: s.symbol, size: 25 })
|
|
785
901
|
));
|
|
786
902
|
}
|
|
787
903
|
}
|
|
788
904
|
);
|
|
789
|
-
},
|
|
790
|
-
${(e) =>
|
|
905
|
+
}, St = a(K)`
|
|
906
|
+
${(e) => O(e)}
|
|
791
907
|
> ul {
|
|
792
908
|
display: flex;
|
|
793
909
|
flex-wrap: wrap;
|
|
@@ -799,9 +915,9 @@ const Re = ({ className: e }) => {
|
|
|
799
915
|
margin: 0;
|
|
800
916
|
}
|
|
801
917
|
}
|
|
802
|
-
${(e) =>
|
|
803
|
-
`,
|
|
804
|
-
${
|
|
918
|
+
${(e) => C(e)}
|
|
919
|
+
`, zt = a(z)`
|
|
920
|
+
${Q};
|
|
805
921
|
|
|
806
922
|
background-color: ${(e) => e.bgColor};
|
|
807
923
|
display: flex;
|
|
@@ -813,7 +929,7 @@ const Re = ({ className: e }) => {
|
|
|
813
929
|
border-radius: 100%;
|
|
814
930
|
|
|
815
931
|
&:focus-visible {
|
|
816
|
-
${
|
|
932
|
+
${f}
|
|
817
933
|
background-color: transparent;
|
|
818
934
|
|
|
819
935
|
i,
|
|
@@ -840,66 +956,68 @@ const Re = ({ className: e }) => {
|
|
|
840
956
|
stroke: #fff;
|
|
841
957
|
}
|
|
842
958
|
}
|
|
843
|
-
`,
|
|
844
|
-
|
|
959
|
+
`, Lt = ([e, t]) => ({ type: e, content: t }), Mt = ({ items: e, dispatch: t }) => /* @__PURE__ */ n.createElement(
|
|
960
|
+
It,
|
|
845
961
|
{
|
|
846
|
-
items: e.map(
|
|
962
|
+
items: e.map(Lt),
|
|
847
963
|
renderLi: !0,
|
|
848
964
|
renderItem: (r) => {
|
|
849
965
|
switch (r.type) {
|
|
850
|
-
case
|
|
851
|
-
return /* @__PURE__ */ n.createElement(
|
|
852
|
-
case
|
|
966
|
+
case k.Text:
|
|
967
|
+
return /* @__PURE__ */ n.createElement(wt, { text: r.content });
|
|
968
|
+
case k.HTML:
|
|
853
969
|
return /* @__PURE__ */ n.createElement(ht, g({}, r.content));
|
|
854
|
-
case
|
|
855
|
-
return /* @__PURE__ */ n.createElement(
|
|
856
|
-
case
|
|
857
|
-
return /* @__PURE__ */ n.createElement(
|
|
858
|
-
case
|
|
859
|
-
return /* @__PURE__ */ n.createElement(
|
|
860
|
-
case
|
|
861
|
-
return /* @__PURE__ */ n.createElement(
|
|
970
|
+
case k.Separator:
|
|
971
|
+
return /* @__PURE__ */ n.createElement(Et, g({}, r.content));
|
|
972
|
+
case k.ItemList:
|
|
973
|
+
return /* @__PURE__ */ n.createElement(pt, E(g({}, r.content), { dispatch: t }));
|
|
974
|
+
case k.LinkList:
|
|
975
|
+
return /* @__PURE__ */ n.createElement(bt, E(g({}, r.content), { dispatch: t }));
|
|
976
|
+
case k.ButtonList:
|
|
977
|
+
return /* @__PURE__ */ n.createElement(ct, E(g({}, r.content), { dispatch: t }));
|
|
978
|
+
case k.VideoRequest:
|
|
979
|
+
return /* @__PURE__ */ n.createElement(Ct, E(g({}, r.content), { dispatch: t }));
|
|
862
980
|
default:
|
|
863
981
|
return /* @__PURE__ */ n.createElement(ut, { type: r.type, content: r.content });
|
|
864
982
|
}
|
|
865
983
|
}
|
|
866
984
|
}
|
|
867
|
-
),
|
|
985
|
+
), It = a(ie)`
|
|
868
986
|
${ze}
|
|
869
987
|
|
|
870
988
|
> li {
|
|
871
989
|
margin: 0;
|
|
872
990
|
}
|
|
873
|
-
`,
|
|
991
|
+
`, Ht = Z(
|
|
874
992
|
({ className: e, timestamp: t, sender: r, type: o, content: l }, s) => {
|
|
875
|
-
const u =
|
|
993
|
+
const u = de(
|
|
876
994
|
(m) => {
|
|
877
995
|
let i = "first";
|
|
878
996
|
return l.length > 1 && (i = m === 0 ? "first" : m + 1 === l.length ? "last" : "middle"), i;
|
|
879
997
|
},
|
|
880
998
|
[l]
|
|
881
999
|
), c = () => /* @__PURE__ */ n.createElement(n.Fragment, null, l.map((m) => {
|
|
882
|
-
const { key: i, body: $, title:
|
|
1000
|
+
const { key: i, body: $, title: S, form: L, actions: w } = m, y = !!$ && !S && !L && !w;
|
|
883
1001
|
return /* @__PURE__ */ n.createElement(
|
|
884
1002
|
at,
|
|
885
1003
|
{
|
|
886
1004
|
className: e,
|
|
887
1005
|
key: i,
|
|
888
|
-
discrete:
|
|
1006
|
+
discrete: y,
|
|
889
1007
|
ref: s,
|
|
890
1008
|
timestamp: t,
|
|
891
|
-
fullWidth: !!
|
|
1009
|
+
fullWidth: !!L || !!w
|
|
892
1010
|
},
|
|
893
|
-
|
|
1011
|
+
y && $ ? /* @__PURE__ */ n.createElement(J, { html: $ }) : /* @__PURE__ */ n.createElement(P, { isSystem: !0, content: m })
|
|
894
1012
|
);
|
|
895
|
-
})), h = () => /* @__PURE__ */ n.createElement(
|
|
896
|
-
|
|
1013
|
+
})), h = () => /* @__PURE__ */ n.createElement(he, { sender: r, timestamp: t, className: e }, /* @__PURE__ */ n.createElement(_, null, l.map((m, i) => /* @__PURE__ */ n.createElement(V, { left: !0, key: m.key, ref: s }, /* @__PURE__ */ n.createElement(
|
|
1014
|
+
P,
|
|
897
1015
|
{
|
|
898
1016
|
content: m,
|
|
899
1017
|
stacked: u(i)
|
|
900
1018
|
}
|
|
901
|
-
))))), v = () => /* @__PURE__ */ n.createElement(it, { timestamp: t, className: e }, /* @__PURE__ */ n.createElement(
|
|
902
|
-
|
|
1019
|
+
))))), v = () => /* @__PURE__ */ n.createElement(it, { timestamp: t, className: e }, /* @__PURE__ */ n.createElement(_, null, l.map((m, i) => /* @__PURE__ */ n.createElement(V, { right: !0, key: m.key, ref: s }, /* @__PURE__ */ n.createElement(
|
|
1020
|
+
P,
|
|
903
1021
|
{
|
|
904
1022
|
isUser: !0,
|
|
905
1023
|
content: m,
|
|
@@ -907,20 +1025,20 @@ const Re = ({ className: e }) => {
|
|
|
907
1025
|
}
|
|
908
1026
|
)))));
|
|
909
1027
|
switch (o) {
|
|
910
|
-
case
|
|
1028
|
+
case W.System:
|
|
911
1029
|
return c();
|
|
912
|
-
case
|
|
1030
|
+
case W.Agent:
|
|
913
1031
|
return h();
|
|
914
|
-
case
|
|
1032
|
+
case W.User:
|
|
915
1033
|
return v();
|
|
916
1034
|
default:
|
|
917
1035
|
return null;
|
|
918
1036
|
}
|
|
919
1037
|
}
|
|
920
|
-
),
|
|
921
|
-
const l =
|
|
922
|
-
return v ? /* @__PURE__ */ n.createElement(
|
|
923
|
-
|
|
1038
|
+
), P = ({ content: e, isUser: t, isSystem: r, stacked: o }) => {
|
|
1039
|
+
const l = Y(), { title: s, body: u, actions: c, form: h, items: v } = e;
|
|
1040
|
+
return v ? /* @__PURE__ */ n.createElement(q, { user: !!t, stacked: o }, /* @__PURE__ */ n.createElement(Mt, { items: v, dispatch: l })) : /* @__PURE__ */ n.createElement(
|
|
1041
|
+
q,
|
|
924
1042
|
{
|
|
925
1043
|
padded: !r,
|
|
926
1044
|
user: !!t,
|
|
@@ -931,7 +1049,7 @@ const Re = ({ className: e }) => {
|
|
|
931
1049
|
u && /* @__PURE__ */ n.createElement(B, null, /* @__PURE__ */ n.createElement(Ye, { html: u })),
|
|
932
1050
|
h && /* @__PURE__ */ n.createElement(B, null, /* @__PURE__ */ n.createElement(
|
|
933
1051
|
qe,
|
|
934
|
-
|
|
1052
|
+
E(g({}, h), {
|
|
935
1053
|
onChange: (i, $) => {
|
|
936
1054
|
l("form", {
|
|
937
1055
|
data: $,
|
|
@@ -958,31 +1076,31 @@ const Re = ({ className: e }) => {
|
|
|
958
1076
|
))
|
|
959
1077
|
);
|
|
960
1078
|
}, ge = () => {
|
|
961
|
-
const e =
|
|
1079
|
+
const e = de((c) => {
|
|
962
1080
|
c && setTimeout(() => {
|
|
963
1081
|
c.scrollIntoView({
|
|
964
1082
|
block: "start",
|
|
965
1083
|
behavior: "smooth"
|
|
966
1084
|
});
|
|
967
1085
|
}, 250);
|
|
968
|
-
}, []), [t, r] =
|
|
1086
|
+
}, []), [t, r] = le(!0), {
|
|
969
1087
|
messages: o,
|
|
970
1088
|
loading: l,
|
|
971
1089
|
typingActors: s = []
|
|
972
|
-
} =
|
|
973
|
-
return /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(
|
|
1090
|
+
} = I(), u = () => s && s.length ? s.map((c, h) => /* @__PURE__ */ n.createElement(U, { id: `typing_${c.name}`, key: `typing_${c.name}` }, /* @__PURE__ */ n.createElement(he, { timestamp: Date.now(), sender: c }, /* @__PURE__ */ n.createElement(oe, { boxed: !0, ref: e })))) : null;
|
|
1091
|
+
return /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(Tt, { tabIndex: 0, scrollableCss: t, ref: r }, o && o.length ? o.map((c, h) => {
|
|
974
1092
|
const { type: v, timestamp: m, sender: i, content: $ } = c;
|
|
975
1093
|
return /* @__PURE__ */ n.createElement(
|
|
976
|
-
|
|
1094
|
+
U,
|
|
977
1095
|
{
|
|
978
1096
|
className: "humany-conversation-entry",
|
|
979
1097
|
tabIndex: -1,
|
|
980
1098
|
key: `${v}_${i == null ? void 0 : i.name}_${m}_${$[0].key}`
|
|
981
1099
|
},
|
|
982
|
-
/* @__PURE__ */ n.createElement(
|
|
1100
|
+
/* @__PURE__ */ n.createElement(Ht, E(g({}, c), { ref: e }))
|
|
983
1101
|
);
|
|
984
|
-
}) : null, u(), l && /* @__PURE__ */ n.createElement(
|
|
985
|
-
},
|
|
1102
|
+
}) : null, u(), l && /* @__PURE__ */ n.createElement(U, null, /* @__PURE__ */ n.createElement(oe, { ref: e }))), /* @__PURE__ */ n.createElement(De, null));
|
|
1103
|
+
}, Tt = a.div`
|
|
986
1104
|
display: flex;
|
|
987
1105
|
flex-direction: column;
|
|
988
1106
|
align-items: stretch;
|
|
@@ -993,9 +1111,9 @@ const Re = ({ className: e }) => {
|
|
|
993
1111
|
}};
|
|
994
1112
|
${(e) => !!e.scrollableCss && e.scrollableCss};
|
|
995
1113
|
&:focus-visible {
|
|
996
|
-
${(e) =>
|
|
1114
|
+
${(e) => f(e)};
|
|
997
1115
|
}
|
|
998
|
-
`,
|
|
1116
|
+
`, U = a.div`
|
|
999
1117
|
margin: 0;
|
|
1000
1118
|
margin-bottom: ${(e) => {
|
|
1001
1119
|
var t;
|
|
@@ -1027,36 +1145,36 @@ const Re = ({ className: e }) => {
|
|
|
1027
1145
|
h1 {
|
|
1028
1146
|
font-weight: normal;
|
|
1029
1147
|
}
|
|
1030
|
-
${(e) =>
|
|
1148
|
+
${(e) => X(e)(
|
|
1031
1149
|
"h1",
|
|
1032
|
-
|
|
1150
|
+
p`
|
|
1033
1151
|
font-weight: normal;
|
|
1034
1152
|
`
|
|
1035
1153
|
)}
|
|
1036
|
-
`,
|
|
1037
|
-
const t =
|
|
1038
|
-
return
|
|
1154
|
+
`, At = ({ dispatch: e }) => {
|
|
1155
|
+
const t = He(null);
|
|
1156
|
+
return me(() => {
|
|
1039
1157
|
t.current && t.current.parentNode && e("overlay-mounted", t.current);
|
|
1040
1158
|
}, [t]), /* @__PURE__ */ n.createElement(
|
|
1041
|
-
|
|
1159
|
+
ce,
|
|
1042
1160
|
{
|
|
1043
1161
|
portalId: "humany-conversation-overlay-portal",
|
|
1044
1162
|
className: "humany-conversation-overlay-outlet",
|
|
1045
1163
|
ref: t
|
|
1046
1164
|
}
|
|
1047
1165
|
);
|
|
1048
|
-
},
|
|
1166
|
+
}, Rt = ({
|
|
1049
1167
|
dispatch: e,
|
|
1050
1168
|
header: t,
|
|
1051
1169
|
buttonLabel: r
|
|
1052
1170
|
}) => /* @__PURE__ */ n.createElement(
|
|
1053
|
-
|
|
1171
|
+
Bt,
|
|
1054
1172
|
{
|
|
1055
1173
|
portalId: "humany-conversation-portal",
|
|
1056
1174
|
className: "humany-conversation-outlet"
|
|
1057
1175
|
},
|
|
1058
|
-
/* @__PURE__ */ n.createElement(
|
|
1059
|
-
|
|
1176
|
+
/* @__PURE__ */ n.createElement(Nt, { className: "humany-conversation-outlet-head" }, /* @__PURE__ */ n.createElement(
|
|
1177
|
+
Ot,
|
|
1060
1178
|
{
|
|
1061
1179
|
className: "humany-conversation-outlet-head-button",
|
|
1062
1180
|
"aria-label": r,
|
|
@@ -1064,7 +1182,7 @@ const Re = ({ className: e }) => {
|
|
|
1064
1182
|
onClick: () => e("hide-overlay-conversation")
|
|
1065
1183
|
},
|
|
1066
1184
|
/* @__PURE__ */ n.createElement(
|
|
1067
|
-
|
|
1185
|
+
x,
|
|
1068
1186
|
{
|
|
1069
1187
|
symbol: {
|
|
1070
1188
|
type: "Svg",
|
|
@@ -1074,7 +1192,7 @@ const Re = ({ className: e }) => {
|
|
|
1074
1192
|
}
|
|
1075
1193
|
)
|
|
1076
1194
|
), t && /* @__PURE__ */ n.createElement(
|
|
1077
|
-
|
|
1195
|
+
Kt,
|
|
1078
1196
|
{
|
|
1079
1197
|
className: "humany-conversation-outlet-header",
|
|
1080
1198
|
variant: "h1"
|
|
@@ -1082,7 +1200,7 @@ const Re = ({ className: e }) => {
|
|
|
1082
1200
|
t
|
|
1083
1201
|
)),
|
|
1084
1202
|
/* @__PURE__ */ n.createElement(ge, null)
|
|
1085
|
-
),
|
|
1203
|
+
), Bt = a(ce)`
|
|
1086
1204
|
z-index: 11;
|
|
1087
1205
|
top: auto;
|
|
1088
1206
|
height: 65%;
|
|
@@ -1097,7 +1215,7 @@ const Re = ({ className: e }) => {
|
|
|
1097
1215
|
var t;
|
|
1098
1216
|
return (t = e.theme.sizes) == null ? void 0 : t.large;
|
|
1099
1217
|
}};
|
|
1100
|
-
`,
|
|
1218
|
+
`, Nt = a.div`
|
|
1101
1219
|
display: flex;
|
|
1102
1220
|
flex-direction: column;
|
|
1103
1221
|
justify-content: center;
|
|
@@ -1111,7 +1229,7 @@ const Re = ({ className: e }) => {
|
|
|
1111
1229
|
return (t = e.theme.sizes) == null ? void 0 : t.normal;
|
|
1112
1230
|
}};
|
|
1113
1231
|
${(e) => e.theme.border && `border-bottom: ${e.theme.border};`}
|
|
1114
|
-
`,
|
|
1232
|
+
`, Kt = a(G)`
|
|
1115
1233
|
font-size: ${(e) => {
|
|
1116
1234
|
var t;
|
|
1117
1235
|
return (t = e.theme.fonts) == null ? void 0 : t.medium;
|
|
@@ -1121,7 +1239,7 @@ const Re = ({ className: e }) => {
|
|
|
1121
1239
|
return (t = e.theme.colors) == null ? void 0 : t.text;
|
|
1122
1240
|
}};
|
|
1123
1241
|
margin: 0;
|
|
1124
|
-
`,
|
|
1242
|
+
`, Ot = a(z)`
|
|
1125
1243
|
display: flex;
|
|
1126
1244
|
align-items: center;
|
|
1127
1245
|
justify-content: center;
|
|
@@ -1135,7 +1253,7 @@ const Re = ({ className: e }) => {
|
|
|
1135
1253
|
${(e) => e.theme.borderRadius && `border-radius: ${e.theme.borderRadius};`}
|
|
1136
1254
|
|
|
1137
1255
|
&:focus-visible {
|
|
1138
|
-
${
|
|
1256
|
+
${f};
|
|
1139
1257
|
}
|
|
1140
1258
|
|
|
1141
1259
|
svg line {
|
|
@@ -1144,28 +1262,28 @@ const Re = ({ className: e }) => {
|
|
|
1144
1262
|
return (t = e.theme.colors) == null ? void 0 : t.text;
|
|
1145
1263
|
}};
|
|
1146
1264
|
}
|
|
1147
|
-
`,
|
|
1148
|
-
var o = r, { className: e } = o, t =
|
|
1265
|
+
`, Qt = (r) => {
|
|
1266
|
+
var o = r, { className: e } = o, t = F(o, ["className"]);
|
|
1149
1267
|
const {
|
|
1150
1268
|
overlay: l,
|
|
1151
1269
|
overlayConversationHeader: s,
|
|
1152
1270
|
overlayConversationCloseLabel: u,
|
|
1153
1271
|
conversationControllerId: c
|
|
1154
|
-
} =
|
|
1272
|
+
} = I(), h = Y();
|
|
1155
1273
|
return /* @__PURE__ */ n.createElement(
|
|
1156
1274
|
Le.Provider,
|
|
1157
1275
|
{
|
|
1158
1276
|
value: c ? { id: c } : null
|
|
1159
1277
|
},
|
|
1160
1278
|
/* @__PURE__ */ n.createElement(
|
|
1161
|
-
|
|
1162
|
-
|
|
1279
|
+
jt,
|
|
1280
|
+
E(g({}, t), {
|
|
1163
1281
|
className: H(e, "humany-conversation-component")
|
|
1164
1282
|
}),
|
|
1165
1283
|
/* @__PURE__ */ n.createElement(ge, null)
|
|
1166
1284
|
),
|
|
1167
|
-
l && /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(
|
|
1168
|
-
|
|
1285
|
+
l && /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(At, { dispatch: h }), l.conversation && /* @__PURE__ */ n.createElement(
|
|
1286
|
+
Rt,
|
|
1169
1287
|
{
|
|
1170
1288
|
dispatch: h,
|
|
1171
1289
|
header: s,
|
|
@@ -1173,7 +1291,7 @@ const Re = ({ className: e }) => {
|
|
|
1173
1291
|
}
|
|
1174
1292
|
))
|
|
1175
1293
|
);
|
|
1176
|
-
},
|
|
1294
|
+
}, jt = a.div`
|
|
1177
1295
|
position: absolute;
|
|
1178
1296
|
right: 0;
|
|
1179
1297
|
left: 0;
|
|
@@ -1184,6 +1302,6 @@ const Re = ({ className: e }) => {
|
|
|
1184
1302
|
flex-direction: column;
|
|
1185
1303
|
`;
|
|
1186
1304
|
export {
|
|
1187
|
-
|
|
1305
|
+
Qt as default
|
|
1188
1306
|
};
|
|
1189
|
-
//# sourceMappingURL=conversation.
|
|
1307
|
+
//# sourceMappingURL=conversation.be64b43a.js.map
|