@telia-ace/widget-conversation 1.1.2-rc.6 → 1.1.2-rc.8

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.
@@ -1,110 +1,120 @@
1
- import { jsx as n, jsxs as m, Fragment as z } from "react/jsx-runtime";
1
+ import { jsx as n, jsxs as u, Fragment as N } from "react/jsx-runtime";
2
2
  import a from "@emotion/styled";
3
- import { Input as ne, borderTabStyle as b, Button as L, SymbolBadge as x, useIsTabbing as re, useDispatch as _, useProperties as N, useScroll as oe, Typography as F, invertedHoverButton as pe, Html as Y, List as se, buttonCss as B, ItemList as O, itemList as K, Link as be, useComponent as $e, genericHtml as ve, headingElement as G, usePrevious as xe, list as we, WidgetOverlayOutlet as ae, useContainer as ke, ConversationContext as Ce } from "@telia-ace/widget-ui";
4
- import { appendClassNames as M, htmlParentContains as Se } from "@telia-ace/widget-utilities";
5
- import { css as p, keyframes as ze } from "@emotion/react";
6
- import Le, { useState as D, useEffect as J, forwardRef as Q, useContext as Ne, Suspense as Ie, useRef as ie, useMemo as Me, useCallback as le } from "react";
7
- import { FormComponent as Te } from "@telia-ace/widget-forms";
8
- import { ConversationMessageListItemType as k, ConversationMessageType as E } from "./index.mjs";
3
+ import { borderTabStyle as f, Input as se, Button as M, SymbolBadge as w, useIsTabbing as ae, useDispatch as Y, useContainer as ie, useProperties as I, useScroll as le, Typography as X, invertedHoverButton as xe, Html as G, List as ce, buttonCss as B, ItemList as K, itemList as D, Link as we, useComponent as ke, genericHtml as Ce, headingElement as J, usePrevious as Se, list as ze, WidgetOverlayOutlet as de, ConversationContext as Le } from "@telia-ace/widget-ui";
4
+ import { appendClassNames as T, htmlParentContains as Ne } from "@telia-ace/widget-utilities";
5
+ import { css as p, keyframes as Me } from "@emotion/react";
6
+ import Ie, { useState as P, useEffect as Q, forwardRef as Z, useContext as Te, Suspense as Ae, useRef as me, useMemo as He, useCallback as ue } from "react";
7
+ import { FormComponent as Oe } from "@telia-ace/widget-forms";
8
+ import { ConversationMessageListItemType as S, ConversationMessageType as W } from "./index.mjs";
9
9
  import "@telia-ace/widget-core";
10
10
  import "@telia-ace/widget-services";
11
11
  import "@telia-ace/widget-plugins";
12
- const Ae = ({ className: t }) => {
13
- const [e, r] = D(""), [o, s] = D(0), [i, c] = D(0), d = re(), u = _(), {
14
- inputPlaceholder: f = "Type your message",
15
- inputHidden: w = !1,
16
- inputDisabled: l = !1,
17
- sendButtonLabel: h = "Send message",
18
- inputMultiline: $ = !0,
19
- secondaryAction: v
20
- } = N(), [T, y] = oe(!0);
21
- J(() => {
22
- if (y.current) {
23
- const { lineHeight: g, maxHeight: A } = getComputedStyle(y.current);
24
- if (g && g.indexOf("px") > -1) {
25
- const I = g.split("px"), fe = parseInt(I[0], 10);
26
- s(fe);
27
- const ye = A.split("px");
28
- c(parseInt(ye[0], 10));
12
+ const Re = ({ className: t }) => {
13
+ const [e, r] = P(""), [o, s] = P(0), [i, c] = P(0), m = ae(), h = Y(), y = ie(), {
14
+ inputPlaceholder: b = "Type your message",
15
+ inputHidden: l = !1,
16
+ inputDisabled: g = !1,
17
+ sendButtonLabel: k = "Send message",
18
+ inputMultiline: L = !0,
19
+ secondaryAction: $,
20
+ skipToLatestMessageLabel: A = "Skip to latest message"
21
+ } = I(), [H, v] = le(!0);
22
+ Q(() => {
23
+ if (v.current) {
24
+ const { lineHeight: d, maxHeight: C } = getComputedStyle(v.current);
25
+ if (d && d.indexOf("px") > -1) {
26
+ const x = d.split("px"), te = parseInt(x[0], 10);
27
+ s(te);
28
+ const ve = C.split("px");
29
+ c(parseInt(ve[0], 10));
29
30
  }
30
31
  }
31
- }, [y.current]);
32
- const S = (g) => {
33
- !g.shiftKey || !$ ? (g.preventDefault(), e && e.length > 0 && (u("user-submit", { text: e }), r(""), j(""))) : e.length < 1 && g.preventDefault();
34
- }, he = (g) => {
35
- v && (g.preventDefault(), u("action", {
36
- actionKey: v.action,
37
- ...v
32
+ }, [v.current]);
33
+ const E = (d) => {
34
+ !d.shiftKey || !L ? (d.preventDefault(), e && e.length > 0 && (h("user-submit", { text: e }), r(""), j(""))) : e.length < 1 && d.preventDefault();
35
+ }, pe = (d) => {
36
+ $ && (d.preventDefault(), h("action", {
37
+ actionKey: $.action,
38
+ ...$
38
39
  }));
39
- }, ge = (g) => {
40
- if ($ && y.current) {
41
- const A = y.current.scrollHeight;
42
- if (A > o) {
43
- y.current.style.height = "auto";
44
- let I = A;
45
- g.length < 1 && (I = o), y.current.style.height = `${I}px`, I >= i ? y.current.style.overflowY = "scroll" : y.current.style.overflowY = "hidden";
40
+ }, be = (d) => {
41
+ if (L && v.current) {
42
+ const C = v.current.scrollHeight;
43
+ if (C > o) {
44
+ v.current.style.height = "auto";
45
+ let x = C;
46
+ d.length < 1 && (x = o), v.current.style.height = `${x}px`, x >= i ? v.current.style.overflowY = "scroll" : v.current.style.overflowY = "hidden";
46
47
  }
47
48
  }
48
- }, j = (g) => {
49
- ge(g), r(g), g && g.length > 0 && u("user-typing", { textLength: g.length });
49
+ }, j = (d) => {
50
+ be(d), r(d), d && d.length > 0 && h("user-typing", { textLength: d.length });
51
+ }, $e = (d) => {
52
+ d.preventDefault();
53
+ const C = y.get("widgetDOMElement");
54
+ if (C) {
55
+ const x = C.querySelectorAll(
56
+ ".humany-conversation-entry"
57
+ );
58
+ x.length && x[x.length - 1].focus();
59
+ }
50
60
  };
51
- return w ? null : /* @__PURE__ */ m(
52
- Oe,
61
+ return l ? null : /* @__PURE__ */ u(
62
+ je,
53
63
  {
54
- grow: $,
55
- className: M("humany-conversation-input", t),
56
- scrollableCss: T,
57
- isTabbing: d,
64
+ grow: L,
65
+ className: T("humany-conversation-input", t),
66
+ scrollableCss: H,
67
+ isTabbing: m,
58
68
  children: [
59
- v && /* @__PURE__ */ n(
60
- Be,
69
+ $ && /* @__PURE__ */ n(
70
+ Ee,
61
71
  {
62
- disabled: l,
63
- onClick: he,
64
- title: v.label,
65
- "aria-label": v.label,
72
+ disabled: g,
73
+ onClick: pe,
74
+ title: $.label,
75
+ "aria-label": $.label,
66
76
  children: /* @__PURE__ */ n(
67
- x,
77
+ w,
68
78
  {
69
79
  size: 24,
70
- symbol: { type: "Svg", content: v.icon || "browse" }
80
+ symbol: { type: "Svg", content: $.icon || "browse" }
71
81
  }
72
82
  )
73
83
  }
74
84
  ),
75
- $ ? /* @__PURE__ */ n(
76
- He,
85
+ L ? /* @__PURE__ */ n(
86
+ Ke,
77
87
  {
78
88
  value: e,
79
89
  onChange: j,
80
- onEnter: S,
81
- disabled: l,
82
- "aria-label": f,
83
- placeholder: f,
90
+ onEnter: E,
91
+ disabled: g,
92
+ "aria-label": b,
93
+ placeholder: b,
84
94
  type: "textarea",
85
95
  rows: 1,
86
- ref: y
96
+ ref: v
87
97
  }
88
98
  ) : /* @__PURE__ */ n(
89
- Re,
99
+ De,
90
100
  {
91
101
  value: e,
92
102
  onChange: j,
93
- onEnter: S,
94
- disabled: l,
95
- "aria-label": f,
96
- placeholder: f
103
+ onEnter: E,
104
+ disabled: g,
105
+ "aria-label": b,
106
+ placeholder: b
97
107
  }
98
108
  ),
99
109
  /* @__PURE__ */ n(
100
- ce,
110
+ he,
101
111
  {
102
112
  disabled: !1,
103
- onClick: S,
104
- title: h,
105
- "aria-label": h,
113
+ onClick: E,
114
+ title: k,
115
+ "aria-label": k,
106
116
  children: /* @__PURE__ */ n(
107
- Ke,
117
+ Pe,
108
118
  {
109
119
  size: 22,
110
120
  symbol: { type: "Svg", content: "send" },
@@ -112,11 +122,38 @@ const Ae = ({ className: t }) => {
112
122
  }
113
123
  )
114
124
  }
125
+ ),
126
+ /* @__PURE__ */ n(
127
+ Be,
128
+ {
129
+ onKeyDown: (d) => {
130
+ (d.key === "Enter" || d.keyCode === 13) && $e(d);
131
+ },
132
+ children: /* @__PURE__ */ n("a", { href: "", className: "humany-skip-to-latest-message", children: A })
133
+ }
115
134
  )
116
135
  ]
117
136
  }
118
137
  );
119
- }, He = a(ne)`
138
+ }, Be = a.div`
139
+ position: absolute;
140
+ bottom: 112px;
141
+ width: 100%;
142
+ text-align: center;
143
+ a {
144
+ background-color: white;
145
+ padding: 6px;
146
+ text-decoration: none;
147
+ border-radius: 10px;
148
+ position: absolute;
149
+ left: -10000000px;
150
+ }
151
+ a:focus {
152
+ left: 50%;
153
+ transform: translateX(-50%);
154
+ ${f};
155
+ }
156
+ `, Ke = a(se)`
120
157
  resize: none;
121
158
  flex: 1;
122
159
  flex-shrink: 1;
@@ -137,10 +174,10 @@ const Ae = ({ className: t }) => {
137
174
  transition: height 200ms linear;
138
175
  outline: none;
139
176
  &:focus-visible {
140
- ${b};
177
+ ${f};
141
178
  outline-offset: 12px;
142
179
  }
143
- `, Re = a(ne)`
180
+ `, De = a(se)`
144
181
  flex: 1;
145
182
  border: none;
146
183
  background-color: transparent;
@@ -166,7 +203,7 @@ const Ae = ({ className: t }) => {
166
203
  }};
167
204
  font-style: italic;
168
205
  }
169
- `, ce = a(L)`
206
+ `, he = a(M)`
170
207
  flex: 0 0 50px;
171
208
  align-self: stretch;
172
209
  background-color: transparent;
@@ -176,15 +213,15 @@ const Ae = ({ className: t }) => {
176
213
  border: none;
177
214
  color: #a6a6a6;
178
215
  &:focus-visible {
179
- ${b};
216
+ ${f};
180
217
  }
181
- `, Be = a(ce)`
218
+ `, Ee = a(he)`
182
219
  border-right: ${(t) => t.theme.border};
183
220
  margin: ${(t) => {
184
221
  var e;
185
222
  return (e = t.theme.sizes) == null ? void 0 : e.normal;
186
223
  }} 0;
187
- `, Oe = a.div`
224
+ `, je = a.div`
188
225
  ${(t) => t.grow ? p`
189
226
  min-height: 50px;
190
227
  max-height: 150px;
@@ -199,15 +236,15 @@ const Ae = ({ className: t }) => {
199
236
  return (e = t.theme.colors) == null ? void 0 : e.accent;
200
237
  }};
201
238
  border-top: ${(t) => t.theme.inputBorder};
202
- ${(t) => t["data-has-focus"] && t.isTabbing && b}
239
+ ${(t) => t["data-has-focus"] && t.isTabbing && f}
203
240
  textarea {
204
241
  ${(t) => !!t.scrollableCss && t.scrollableCss}
205
242
  }
206
- `, Ke = a(
243
+ `, Pe = a(
207
244
  ({
208
245
  hasContent: t,
209
246
  ...e
210
- }) => /* @__PURE__ */ n(x, { ...e })
247
+ }) => /* @__PURE__ */ n(w, { ...e })
211
248
  )`
212
249
  line,
213
250
  path {
@@ -220,7 +257,7 @@ const Ae = ({ className: t }) => {
220
257
  return t.hasContent ? (e = t.theme.colors) == null ? void 0 : e.primary : "#a6a6a6";
221
258
  }};
222
259
  }
223
- `, je = a.div`
260
+ `, We = a.div`
224
261
  width: ${(t) => t.avatarSize || "32px"};
225
262
  height: ${(t) => t.avatarSize || "32px"};
226
263
  border-radius: 50%;
@@ -267,7 +304,7 @@ const Ae = ({ className: t }) => {
267
304
  }};
268
305
  }
269
306
  }
270
- `, De = ze`
307
+ `, qe = Me`
271
308
  0% {
272
309
  opacity: 0;
273
310
  }
@@ -277,7 +314,7 @@ const Ae = ({ className: t }) => {
277
314
  100% {
278
315
  opacity: 0;
279
316
  }
280
- `, Ee = a.div`
317
+ `, Ue = a.div`
281
318
  display: flex;
282
319
  justify-content: center;
283
320
  > div {
@@ -289,7 +326,7 @@ const Ae = ({ className: t }) => {
289
326
  var e;
290
327
  return (e = t.theme.colors) == null ? void 0 : e.text;
291
328
  }};
292
- animation: ${De} 1s infinite;
329
+ animation: ${qe} 1s infinite;
293
330
  }
294
331
  > div:nth-of-type(2) {
295
332
  animation-delay: 100ms;
@@ -297,29 +334,29 @@ const Ae = ({ className: t }) => {
297
334
  > div:nth-of-type(3) {
298
335
  animation-delay: 200ms;
299
336
  }
300
- `, U = a.div`
337
+ `, V = a.div`
301
338
  grid-area: content;
302
339
  max-width: 100%;
303
340
  overflow: hidden;
304
- `, Pe = a(F)`
341
+ `, Ve = a(X)`
305
342
  font-size: ${(t) => {
306
343
  var e;
307
344
  return (e = t.theme.fonts) == null ? void 0 : e.normal;
308
345
  }};
309
346
  font-weight: normal;
310
347
  margin: 0;
311
- `, V = a.div`
348
+ `, _ = a.div`
312
349
  display: flex;
313
350
  ${(t) => t.left && "justify-content: start;"};
314
351
  ${(t) => t.center && "justify-content: center;"};
315
352
  ${(t) => t.right && "justify-content: end;"};
316
- `, q = a.div`
353
+ `, F = a.div`
317
354
  ${(t) => {
318
355
  var e;
319
356
  return t.padded && `padding: ${(e = t.theme.sizes) == null ? void 0 : e.medium};`;
320
357
  }}
321
- ${(t) => !t.user && t.stacked && We(t.stacked, t.theme)}
322
- ${(t) => t.user && t.stacked && Ue(t.stacked, t.theme)}
358
+ ${(t) => !t.user && t.stacked && _e(t.stacked, t.theme)}
359
+ ${(t) => t.user && t.stacked && Fe(t.stacked, t.theme)}
323
360
 
324
361
  display: inline-block;
325
362
  margin-top: ${(t) => {
@@ -335,7 +372,7 @@ const Ae = ({ className: t }) => {
335
372
  }
336
373
  max-width: 100%;
337
374
  ${(t) => t.fullWidth && "width: 100%;"}
338
- `, We = (t, e) => {
375
+ `, _e = (t, e) => {
339
376
  var o, s;
340
377
  const r = p`
341
378
  background-color: ${(o = e.colors) == null ? void 0 : o.accent};
@@ -356,7 +393,7 @@ const Ae = ({ className: t }) => {
356
393
  border-bottom-left-radius: ${e.borderRadius};
357
394
  `}
358
395
  ` : r;
359
- }, Ue = (t, e) => {
396
+ }, Fe = (t, e) => {
360
397
  var o, s;
361
398
  const r = p`
362
399
  background-color: ${(o = e.colors) == null ? void 0 : o.primary};
@@ -376,7 +413,7 @@ const Ae = ({ className: t }) => {
376
413
  border-bottom-right-radius: ${e.borderRadius};
377
414
  `}
378
415
  ` : r;
379
- }, H = a.div`
416
+ }, O = a.div`
380
417
  margin-bottom: ${(t) => {
381
418
  var e;
382
419
  return (e = t.theme.sizes) == null ? void 0 : e.normal;
@@ -384,17 +421,17 @@ const Ae = ({ className: t }) => {
384
421
  &:last-child {
385
422
  margin-bottom: 0;
386
423
  }
387
- `, C = (t) => {
424
+ `, z = (t) => {
388
425
  var e, r;
389
426
  return p`
390
427
  margin: ${(e = t.theme.sizes) == null ? void 0 : e.medium} 0;
391
428
  padding: 0 ${(r = t.theme.sizes) == null ? void 0 : r.medium};
392
429
  `;
393
- }, Ve = a(Te)`
430
+ }, Ye = a(Oe)`
394
431
  & button.humany-form-component-button {
395
432
  ${(t) => {
396
433
  var e, r, o, s;
397
- return ((e = t.theme.colors) == null ? void 0 : e.primary) && ((r = t.theme.colors) == null ? void 0 : r.accent) && pe({
434
+ return ((e = t.theme.colors) == null ? void 0 : e.primary) && ((r = t.theme.colors) == null ? void 0 : r.accent) && xe({
398
435
  active: !1,
399
436
  primaryColor: (o = t.theme.colors) == null ? void 0 : o.primary,
400
437
  secondaryColor: (s = t.theme.colors) == null ? void 0 : s.accent,
@@ -418,18 +455,18 @@ const Ae = ({ className: t }) => {
418
455
  }};
419
456
  }
420
457
  }
421
- `, qe = a(Y)`
458
+ `, Xe = a(G)`
422
459
  white-space: pre-wrap;
423
460
  a {
424
461
  color: ${(t) => t.theme.colors.link};
425
462
  &:focus {
426
463
  ${(t) => {
427
464
  var e;
428
- return ((e = t.theme.accessibility) == null ? void 0 : e.isTabbing) && b;
465
+ return ((e = t.theme.accessibility) == null ? void 0 : e.isTabbing) && f;
429
466
  }};
430
467
  }
431
468
  }
432
- `, _e = a(se)`
469
+ `, Ge = a(ce)`
433
470
  padding: 0;
434
471
  list-style: none;
435
472
  margin: 0 -${(t) => {
@@ -442,7 +479,7 @@ const Ae = ({ className: t }) => {
442
479
  return (e = t.theme.sizes) == null ? void 0 : e.normal;
443
480
  }};
444
481
  }
445
- `, Fe = a.button`
482
+ `, Je = a.button`
446
483
  ${(t) => B(t)};
447
484
  display: block;
448
485
  background-color: ${(t) => {
@@ -452,23 +489,23 @@ const Ae = ({ className: t }) => {
452
489
  width: 100%;
453
490
  color: #fff;
454
491
  &:focus-visible {
455
- ${b}
492
+ ${f}
456
493
  background-color: transparent;
457
494
  }
458
- `, Z = Q(
459
- ({ boxed: t, className: e, agentData: r }, o) => /* @__PURE__ */ n(U, { ref: o, children: /* @__PURE__ */ n(V, { left: t, center: !t, children: /* @__PURE__ */ n(
460
- q,
495
+ `, ne = Z(
496
+ ({ boxed: t, className: e, agentData: r }, o) => /* @__PURE__ */ n(V, { ref: o, children: /* @__PURE__ */ n(_, { left: t, center: !t, children: /* @__PURE__ */ n(
497
+ F,
461
498
  {
462
499
  padded: !!t,
463
500
  stacked: t ? "first" : void 0,
464
- children: /* @__PURE__ */ m(Ee, { children: [
501
+ children: /* @__PURE__ */ u(Ue, { children: [
465
502
  /* @__PURE__ */ n("div", {}),
466
503
  /* @__PURE__ */ n("div", {}),
467
504
  /* @__PURE__ */ n("div", {})
468
505
  ] })
469
506
  }
470
507
  ) }) })
471
- ), de = Le.createContext(null), Ye = a.p`
508
+ ), ge = Ie.createContext(null), Qe = a.p`
472
509
  && {
473
510
  font-size: ${(t) => {
474
511
  var e;
@@ -483,41 +520,41 @@ const Ae = ({ className: t }) => {
483
520
  var e;
484
521
  return (e = t.theme.colors) == null ? void 0 : e.text;
485
522
  }};
486
- `, ee = (t, e) => new Date(t).toLocaleTimeString(e || [], {
523
+ `, re = (t, e) => new Date(t).toLocaleTimeString(e || [], {
487
524
  hour: "numeric",
488
525
  minute: "2-digit"
489
526
  }), R = ({ className: t, name: e, timestamp: r }) => {
490
- const o = Ne(de);
527
+ const o = Te(ge);
491
528
  if (!e && !r)
492
529
  return null;
493
530
  let s = "";
494
- return e ? r ? s = `${e}: ${ee(r, o)}` : s = e : r && (s = ee(r, o)), /* @__PURE__ */ n(Ye, { children: s });
495
- }, me = ({
531
+ return e ? r ? s = `${e}: ${re(r, o)}` : s = e : r && (s = re(r, o)), /* @__PURE__ */ n(Qe, { children: s });
532
+ }, fe = ({
496
533
  className: t,
497
534
  children: e,
498
535
  sender: r,
499
536
  timestamp: o
500
537
  }) => {
501
- const { avatar: s, name: i } = r, { avatarSize: c } = N();
502
- return /* @__PURE__ */ m(
503
- Ge,
538
+ const { avatar: s, name: i } = r, { avatarSize: c } = I();
539
+ return /* @__PURE__ */ u(
540
+ Ze,
504
541
  {
505
542
  hasAvatar: !!s,
506
- className: M(
543
+ className: T(
507
544
  t,
508
545
  "humany-conversation-agent-message"
509
546
  ),
510
547
  children: [
511
- s && /* @__PURE__ */ n(je, { avatarSize: c, children: typeof s == "string" ? (
548
+ s && /* @__PURE__ */ n(We, { avatarSize: c, children: typeof s == "string" ? (
512
549
  // eslint-disable-next-line jsx-a11y/alt-text
513
550
  /* @__PURE__ */ n("img", { src: s })
514
- ) : /* @__PURE__ */ n(x, { symbol: s }) }),
551
+ ) : /* @__PURE__ */ n(w, { symbol: s }) }),
515
552
  e,
516
553
  /* @__PURE__ */ n(R, { name: i, timestamp: o })
517
554
  ]
518
555
  }
519
556
  );
520
- }, Ge = a.div`
557
+ }, Ze = a.div`
521
558
  display: grid;
522
559
  margin-right: 10%;
523
560
  width: 90%;
@@ -534,33 +571,33 @@ const Ae = ({ className: t }) => {
534
571
  'content'
535
572
  'info';
536
573
  `};
537
- `, Je = Q(
574
+ `, et = Z(
538
575
  ({ className: t, children: e, timestamp: r, discrete: o, fullWidth: s }, i) => /* @__PURE__ */ n(
539
- Qe,
576
+ tt,
540
577
  {
541
578
  ref: i,
542
- className: M(
579
+ className: T(
543
580
  t,
544
581
  "humany-conversation-system-message"
545
582
  ),
546
583
  fullWidth: s,
547
- children: o ? /* @__PURE__ */ m(Xe, { className: "humany-conversation-discrete-message", children: [
584
+ children: o ? /* @__PURE__ */ u(nt, { className: "humany-conversation-discrete-message", children: [
548
585
  e,
549
586
  /* @__PURE__ */ n(R, { timestamp: r })
550
- ] }) : /* @__PURE__ */ m(z, { children: [
587
+ ] }) : /* @__PURE__ */ u(N, { children: [
551
588
  e,
552
589
  /* @__PURE__ */ n(R, { timestamp: r })
553
590
  ] })
554
591
  }
555
592
  )
556
- ), Qe = a.div`
593
+ ), tt = a.div`
557
594
  ${(t) => t.fullWidth && "width: 100%"};
558
595
  padding: 0 ${(t) => {
559
596
  var e;
560
597
  return (e = t.theme.sizes) == null ? void 0 : e.large;
561
598
  }};
562
599
  overflow: auto;
563
- `, Xe = a.div`
600
+ `, nt = a.div`
564
601
  text-align: center;
565
602
  word-wrap: break-word;
566
603
  font-size: ${(t) => {
@@ -574,12 +611,12 @@ const Ae = ({ className: t }) => {
574
611
  > p {
575
612
  margin: 0;
576
613
  }
577
- `, Ze = ({ className: t, children: e, timestamp: r }) => {
578
- const { userLabel: o = "" } = N();
579
- return /* @__PURE__ */ m(
580
- et,
614
+ `, rt = ({ className: t, children: e, timestamp: r }) => {
615
+ const { userLabel: o = "" } = I();
616
+ return /* @__PURE__ */ u(
617
+ ot,
581
618
  {
582
- className: M(
619
+ className: T(
583
620
  t,
584
621
  "humany-conversation-user-message"
585
622
  ),
@@ -589,26 +626,26 @@ const Ae = ({ className: t }) => {
589
626
  ]
590
627
  }
591
628
  );
592
- }, et = a.div`
629
+ }, ot = a.div`
593
630
  margin-left: 10%;
594
631
  width: 90%;
595
632
  display: flex;
596
633
  flex-direction: column;
597
634
  align-items: flex-end;
598
- `, X = (t) => Array.isArray(t) ? t : Object.keys(t).map((e) => ({
635
+ `, ee = (t) => Array.isArray(t) ? t : Object.keys(t).map((e) => ({
599
636
  label: t[e],
600
637
  actionKey: e
601
- })), tt = ({ header: t, actions: e, dispatch: r }) => /* @__PURE__ */ n(
602
- nt,
638
+ })), st = ({ header: t, actions: e, dispatch: r }) => /* @__PURE__ */ n(
639
+ at,
603
640
  {
604
641
  className: "humany-conversation-button-list",
605
642
  header: t,
606
- items: X(e),
643
+ items: ee(e),
607
644
  renderItem: (o) => {
608
645
  var i;
609
646
  const s = !!((i = o == null ? void 0 : o.data) != null && i.href);
610
- return /* @__PURE__ */ n("li", { children: s ? /* @__PURE__ */ m(
611
- rt,
647
+ return /* @__PURE__ */ n("li", { children: s ? /* @__PURE__ */ u(
648
+ it,
612
649
  {
613
650
  onClick: () => {
614
651
  r("action", o);
@@ -618,12 +655,12 @@ const Ae = ({ className: t }) => {
618
655
  "aria-label": o.label,
619
656
  title: o.label,
620
657
  children: [
621
- /* @__PURE__ */ n(x, { symbol: o.symbol }),
658
+ /* @__PURE__ */ n(w, { symbol: o.symbol }),
622
659
  o.label
623
660
  ]
624
661
  }
625
- ) : /* @__PURE__ */ m(
626
- ot,
662
+ ) : /* @__PURE__ */ u(
663
+ lt,
627
664
  {
628
665
  onClick: () => {
629
666
  r("action", o);
@@ -631,15 +668,15 @@ const Ae = ({ className: t }) => {
631
668
  "aria-label": o.label,
632
669
  title: o.label,
633
670
  children: [
634
- /* @__PURE__ */ n(x, { symbol: o.symbol }),
671
+ /* @__PURE__ */ n(w, { symbol: o.symbol }),
635
672
  o.label
636
673
  ]
637
674
  }
638
675
  ) }, o.actionKey);
639
676
  }
640
677
  }
641
- ), nt = a(O)`
642
- ${K}
678
+ ), at = a(K)`
679
+ ${D}
643
680
  > ul {
644
681
  display: flex;
645
682
  flex-wrap: wrap;
@@ -651,8 +688,8 @@ const Ae = ({ className: t }) => {
651
688
  margin: 0;
652
689
  }
653
690
  }
654
- ${C}
655
- `, rt = a(be)`
691
+ ${z}
692
+ `, it = a(we)`
656
693
  ${B};
657
694
 
658
695
  display: block;
@@ -669,7 +706,7 @@ const Ae = ({ className: t }) => {
669
706
  overflow: hidden;
670
707
  text-overflow: ellipsis;
671
708
  &:focus-visible {
672
- ${b}
709
+ ${f}
673
710
  background-color: transparent;
674
711
  }
675
712
 
@@ -680,7 +717,7 @@ const Ae = ({ className: t }) => {
680
717
  return (e = t.theme.sizes) == null ? void 0 : e.small;
681
718
  }};
682
719
  }
683
- `, ot = a(L)`
720
+ `, lt = a(M)`
684
721
  ${B};
685
722
 
686
723
  display: block;
@@ -697,7 +734,7 @@ const Ae = ({ className: t }) => {
697
734
  overflow: hidden;
698
735
  text-overflow: ellipsis;
699
736
  &:focus-visible {
700
- ${b}
737
+ ${f}
701
738
  background-color: transparent;
702
739
  }
703
740
 
@@ -708,31 +745,31 @@ const Ae = ({ className: t }) => {
708
745
  return (e = t.theme.sizes) == null ? void 0 : e.small;
709
746
  }};
710
747
  }
711
- `, st = ({ type: t, content: e = {} }) => {
712
- const r = $e(t);
713
- return !r || !t ? null : /* @__PURE__ */ n(Ie, { fallback: null, children: /* @__PURE__ */ n(r, { ...e }) });
714
- }, at = ({ body: t }) => /* @__PURE__ */ n(it, { html: t }), it = a(Y)`
715
- ${ve}
748
+ `, ct = ({ type: t, content: e = {} }) => {
749
+ const r = ke(t);
750
+ return !r || !t ? null : /* @__PURE__ */ n(Ae, { fallback: null, children: /* @__PURE__ */ n(r, { ...e }) });
751
+ }, dt = ({ body: t }) => /* @__PURE__ */ n(mt, { html: t }), mt = a(G)`
752
+ ${Ce}
716
753
  color: inherit;
717
754
  white-space: pre-wrap;
718
- ${C}
755
+ ${z}
719
756
  a {
720
757
  color: ${(t) => t.theme.colors.link};
721
758
  &:focus-visible {
722
- ${b};
759
+ ${f};
723
760
  }
724
761
  }
725
- `, lt = ({ header: t, actions: e, dispatch: r }) => /* @__PURE__ */ n(
726
- ct,
762
+ `, ut = ({ header: t, actions: e, dispatch: r }) => /* @__PURE__ */ n(
763
+ ht,
727
764
  {
728
765
  className: "humany-conversation-item-list",
729
766
  header: t,
730
- items: X(e),
767
+ items: ee(e),
731
768
  renderItem: (o) => {
732
769
  var s;
733
- return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ m(dt, { children: [
770
+ return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ u(gt, { children: [
734
771
  ((s = o.symbol) == null ? void 0 : s.content) && /* @__PURE__ */ n("div", { className: "item-icon", children: /* @__PURE__ */ n(
735
- x,
772
+ w,
736
773
  {
737
774
  size: 22,
738
775
  symbol: {
@@ -741,9 +778,9 @@ const Ae = ({ className: t }) => {
741
778
  }
742
779
  }
743
780
  ) }),
744
- /* @__PURE__ */ m("div", { className: "item-body", children: [
781
+ /* @__PURE__ */ u("div", { className: "item-body", children: [
745
782
  /* @__PURE__ */ n(
746
- L,
783
+ M,
747
784
  {
748
785
  onClick: () => {
749
786
  r("action", o);
@@ -758,11 +795,11 @@ const Ae = ({ className: t }) => {
758
795
  ] }) }, o.actionKey);
759
796
  }
760
797
  }
761
- ), ct = a(O)`
762
- ${K}
798
+ ), ht = a(K)`
799
+ ${D}
763
800
 
764
801
  > .humany-paragraph {
765
- ${C}
802
+ ${z}
766
803
  margin-bottom: 0;
767
804
 
768
805
  h1 {
@@ -770,7 +807,7 @@ const Ae = ({ className: t }) => {
770
807
  }
771
808
  }
772
809
 
773
- ${(t) => G(t)(
810
+ ${(t) => J(t)(
774
811
  "h1",
775
812
  p`
776
813
  white-space: normal;
@@ -796,13 +833,13 @@ const Ae = ({ className: t }) => {
796
833
  border-bottom: none;
797
834
  }
798
835
  }
799
- `, dt = a.div`
836
+ `, gt = a.div`
800
837
  display: flex;
801
838
  gap: ${(t) => {
802
839
  var e;
803
840
  return (e = t.theme.sizes) == null ? void 0 : e.medium;
804
841
  }};
805
- ${C}
842
+ ${z}
806
843
 
807
844
  .item-icon {
808
845
  }
@@ -835,7 +872,7 @@ const Ae = ({ className: t }) => {
835
872
  margin: 0;
836
873
 
837
874
  &:focus-visible {
838
- ${b}
875
+ ${f}
839
876
  span {
840
877
  color: ${(t) => {
841
878
  var e;
@@ -845,32 +882,32 @@ const Ae = ({ className: t }) => {
845
882
  }
846
883
  }
847
884
  }
848
- `, mt = ({ header: t, actions: e, dispatch: r }) => {
849
- const o = xe(e), s = ie(), i = re();
850
- return J(() => {
885
+ `, ft = ({ header: t, actions: e, dispatch: r }) => {
886
+ const o = Se(e), s = me(), i = ae();
887
+ return Q(() => {
851
888
  if (o && Array.isArray(e) && Array.isArray(o) && o.length < e.length && s.current) {
852
889
  const c = s.current.querySelectorAll(
853
890
  ".humany-conversation-link-list > ul > li"
854
- ), d = c[o.length];
891
+ ), m = c[o.length];
855
892
  if (c.length === e.length && o.length) {
856
- const u = c[o.length - 1];
857
- if (u) {
858
- const f = u.querySelector(
893
+ const h = c[o.length - 1];
894
+ if (h) {
895
+ const y = h.querySelector(
859
896
  ".humany-button"
860
897
  );
861
- f && f.focus();
898
+ y && y.focus();
862
899
  }
863
900
  } else
864
- d && new MutationObserver((f, w) => {
865
- f.forEach((l) => {
901
+ m && new MutationObserver((y, b) => {
902
+ y.forEach((l) => {
866
903
  if (l.addedNodes) {
867
- const h = Array.from(
904
+ const g = Array.from(
868
905
  l.addedNodes
869
- ).find(($) => $.tagName === "BUTTON");
870
- h && Se(s.current, document.activeElement) && (i && h.focus(), w.disconnect());
906
+ ).find((k) => k.tagName === "BUTTON");
907
+ g && Ne(s.current, document.activeElement) && (i && g.focus(), b.disconnect());
871
908
  }
872
909
  });
873
- }).observe(d, {
910
+ }).observe(m, {
874
911
  attributes: !1,
875
912
  characterData: !1,
876
913
  childList: !0,
@@ -880,14 +917,14 @@ const Ae = ({ className: t }) => {
880
917
  });
881
918
  }
882
919
  }), /* @__PURE__ */ n(
883
- ut,
920
+ yt,
884
921
  {
885
922
  ref: s,
886
923
  className: "humany-conversation-link-list",
887
924
  header: t,
888
- items: X(e),
889
- renderItem: (c) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ m(
890
- ht,
925
+ items: ee(e),
926
+ renderItem: (c) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ u(
927
+ pt,
891
928
  {
892
929
  help: c.actionKey === "help",
893
930
  onClick: () => {
@@ -898,7 +935,7 @@ const Ae = ({ className: t }) => {
898
935
  children: [
899
936
  c.label,
900
937
  c.actionKey === "help" && /* @__PURE__ */ n(
901
- x,
938
+ w,
902
939
  {
903
940
  size: 14,
904
941
  symbol: {
@@ -912,11 +949,11 @@ const Ae = ({ className: t }) => {
912
949
  ) }, c.actionKey)
913
950
  }
914
951
  );
915
- }, ut = a(O)`
916
- ${K}
917
- ${C}
952
+ }, yt = a(K)`
953
+ ${D}
954
+ ${z}
918
955
 
919
- ${(t) => G(t)(
956
+ ${(t) => J(t)(
920
957
  "h1",
921
958
  p`
922
959
  white-space: normal;
@@ -934,7 +971,7 @@ const Ae = ({ className: t }) => {
934
971
  margin: 0;
935
972
  }
936
973
  }
937
- `, ht = a(L)`
974
+ `, pt = a(M)`
938
975
  display: block;
939
976
  text-align: left;
940
977
  font-weight: 300;
@@ -960,7 +997,7 @@ const Ae = ({ className: t }) => {
960
997
  }}
961
998
 
962
999
  &:focus-visible {
963
- ${b}
1000
+ ${f}
964
1001
  span {
965
1002
  color: ${(t) => {
966
1003
  var e;
@@ -969,18 +1006,18 @@ const Ae = ({ className: t }) => {
969
1006
  text-decoration: underline;
970
1007
  }
971
1008
  }
972
- `, gt = () => /* @__PURE__ */ n(ft, { className: "humany-conversation-separator" }), ft = a.div`
1009
+ `, bt = () => /* @__PURE__ */ n($t, { className: "humany-conversation-separator" }), $t = a.div`
973
1010
  ${(t) => t.theme.border && `border-bottom: ${t.theme.border};`}
974
1011
  width: 100%;
975
- `, yt = ({ text: t }) => /* @__PURE__ */ n(pt, { className: "humany-conversation-text", variant: "span", children: t }), pt = a(F)`
976
- ${C}
977
- `, bt = ({
1012
+ `, vt = ({ text: t }) => /* @__PURE__ */ n(xt, { className: "humany-conversation-text", variant: "span", children: t }), xt = a(X)`
1013
+ ${z}
1014
+ `, wt = ({
978
1015
  header: t = "Video call",
979
1016
  acceptLabel: e = "Accept",
980
1017
  declineLabel: r = "Decline",
981
1018
  dispatch: o
982
1019
  }) => {
983
- const s = Me(() => [
1020
+ const s = He(() => [
984
1021
  {
985
1022
  label: e,
986
1023
  actionKey: "accept-video-call",
@@ -999,7 +1036,7 @@ const Ae = ({ className: t }) => {
999
1036
  }
1000
1037
  ], [e, r]);
1001
1038
  return /* @__PURE__ */ n(
1002
- $t,
1039
+ kt,
1003
1040
  {
1004
1041
  className: "humany-conversation-video-request",
1005
1042
  header: t,
@@ -1007,7 +1044,7 @@ const Ae = ({ className: t }) => {
1007
1044
  renderItem: (i) => {
1008
1045
  const c = i.actionKey === "accept-video-call" ? "#70c48e" : "#da5c85";
1009
1046
  return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
1010
- vt,
1047
+ Ct,
1011
1048
  {
1012
1049
  onClick: () => {
1013
1050
  o("action", i);
@@ -1015,14 +1052,14 @@ const Ae = ({ className: t }) => {
1015
1052
  "aria-label": i.label,
1016
1053
  title: i.label,
1017
1054
  bgColor: c,
1018
- children: /* @__PURE__ */ n(x, { symbol: i.symbol, size: 25 })
1055
+ children: /* @__PURE__ */ n(w, { symbol: i.symbol, size: 25 })
1019
1056
  }
1020
1057
  ) }, i.actionKey);
1021
1058
  }
1022
1059
  }
1023
1060
  );
1024
- }, $t = a(O)`
1025
- ${(t) => K(t)}
1061
+ }, kt = a(K)`
1062
+ ${(t) => D(t)}
1026
1063
  > ul {
1027
1064
  display: flex;
1028
1065
  flex-wrap: wrap;
@@ -1034,8 +1071,8 @@ const Ae = ({ className: t }) => {
1034
1071
  margin: 0;
1035
1072
  }
1036
1073
  }
1037
- ${(t) => C(t)}
1038
- `, vt = a(L)`
1074
+ ${(t) => z(t)}
1075
+ `, Ct = a(M)`
1039
1076
  ${B};
1040
1077
 
1041
1078
  background-color: ${(t) => t.bgColor};
@@ -1048,7 +1085,7 @@ const Ae = ({ className: t }) => {
1048
1085
  border-radius: 100%;
1049
1086
 
1050
1087
  &:focus-visible {
1051
- ${b}
1088
+ ${f}
1052
1089
  background-color: transparent;
1053
1090
 
1054
1091
  i,
@@ -1075,84 +1112,84 @@ const Ae = ({ className: t }) => {
1075
1112
  stroke: #fff;
1076
1113
  }
1077
1114
  }
1078
- `, xt = ([t, e]) => ({ type: t, content: e }), wt = ({ items: t, dispatch: e }) => /* @__PURE__ */ n(
1079
- kt,
1115
+ `, St = ([t, e]) => ({ type: t, content: e }), zt = ({ items: t, dispatch: e }) => /* @__PURE__ */ n(
1116
+ Lt,
1080
1117
  {
1081
1118
  role: "none",
1082
1119
  className: "humany-message-list",
1083
- items: t.map(xt),
1120
+ items: t.map(St),
1084
1121
  renderLi: !0,
1085
1122
  renderItem: (r) => {
1086
1123
  switch (r.type) {
1087
- case k.Text:
1088
- return /* @__PURE__ */ n(yt, { text: r.content });
1089
- case k.HTML:
1090
- return /* @__PURE__ */ n(at, { ...r.content });
1091
- case k.Separator:
1092
- return /* @__PURE__ */ n(gt, { ...r.content });
1093
- case k.ItemList:
1094
- return /* @__PURE__ */ n(lt, { ...r.content, dispatch: e });
1095
- case k.LinkList:
1096
- return /* @__PURE__ */ n(mt, { ...r.content, dispatch: e });
1097
- case k.ButtonList:
1098
- return /* @__PURE__ */ n(tt, { ...r.content, dispatch: e });
1099
- case k.VideoRequest:
1100
- return /* @__PURE__ */ n(bt, { ...r.content, dispatch: e });
1124
+ case S.Text:
1125
+ return /* @__PURE__ */ n(vt, { text: r.content });
1126
+ case S.HTML:
1127
+ return /* @__PURE__ */ n(dt, { ...r.content });
1128
+ case S.Separator:
1129
+ return /* @__PURE__ */ n(bt, { ...r.content });
1130
+ case S.ItemList:
1131
+ return /* @__PURE__ */ n(ut, { ...r.content, dispatch: e });
1132
+ case S.LinkList:
1133
+ return /* @__PURE__ */ n(ft, { ...r.content, dispatch: e });
1134
+ case S.ButtonList:
1135
+ return /* @__PURE__ */ n(st, { ...r.content, dispatch: e });
1136
+ case S.VideoRequest:
1137
+ return /* @__PURE__ */ n(wt, { ...r.content, dispatch: e });
1101
1138
  default:
1102
- return /* @__PURE__ */ n(st, { type: r.type, content: r.content });
1139
+ return /* @__PURE__ */ n(ct, { type: r.type, content: r.content });
1103
1140
  }
1104
1141
  }
1105
1142
  }
1106
- ), kt = a(se)`
1107
- ${we}
1143
+ ), Lt = a(ce)`
1144
+ ${ze}
1108
1145
 
1109
1146
  > li {
1110
1147
  margin: 0;
1111
1148
  }
1112
- `, Ct = Q(
1149
+ `, Nt = Z(
1113
1150
  ({ className: t, timestamp: e, sender: r, type: o, content: s }, i) => {
1114
- const c = le(
1151
+ const c = ue(
1115
1152
  (l) => {
1116
- let h = "first";
1117
- return s.length > 1 && (h = l === 0 ? "first" : l + 1 === s.length ? "last" : "middle"), h;
1153
+ let g = "first";
1154
+ return s.length > 1 && (g = l === 0 ? "first" : l + 1 === s.length ? "last" : "middle"), g;
1118
1155
  },
1119
1156
  [s]
1120
- ), { userLabel: d = "" } = N(), u = () => /* @__PURE__ */ n(z, { children: s.map((l) => {
1121
- const { key: h, body: $, title: v, form: T, actions: y } = l, S = !!$ && !v && !T && !y;
1157
+ ), { userLabel: m = "" } = I(), h = () => /* @__PURE__ */ n(N, { children: s.map((l) => {
1158
+ const { key: g, body: k, title: L, form: $, actions: A } = l, H = !!k && !L && !$ && !A;
1122
1159
  return /* @__PURE__ */ n(
1123
- Je,
1160
+ et,
1124
1161
  {
1125
1162
  className: t,
1126
- discrete: S,
1163
+ discrete: H,
1127
1164
  ref: i,
1128
1165
  timestamp: e,
1129
- fullWidth: !!T || !!y,
1130
- children: S && $ ? /* @__PURE__ */ n(Y, { html: $ }) : /* @__PURE__ */ n(P, { isSystem: !0, content: l })
1166
+ fullWidth: !!$ || !!A,
1167
+ children: H && k ? /* @__PURE__ */ n(G, { html: k }) : /* @__PURE__ */ n(q, { isSystem: !0, content: l })
1131
1168
  },
1132
- h
1169
+ g
1133
1170
  );
1134
- }) }), f = () => /* @__PURE__ */ m(z, { children: [
1135
- /* @__PURE__ */ m(te, { className: "humany-sr-only", children: [
1171
+ }) }), y = () => /* @__PURE__ */ u(N, { children: [
1172
+ /* @__PURE__ */ u(oe, { className: "humany-sr-only", children: [
1136
1173
  r == null ? void 0 : r.name,
1137
1174
  ":"
1138
1175
  ] }),
1139
1176
  /* @__PURE__ */ n(
1140
- me,
1177
+ fe,
1141
1178
  {
1142
1179
  sender: r,
1143
1180
  timestamp: e,
1144
1181
  className: t,
1145
- children: /* @__PURE__ */ n(U, { className: "humany-message-content-bundle", children: s.map((l, h) => /* @__PURE__ */ n(
1146
- V,
1182
+ children: /* @__PURE__ */ n(V, { className: "humany-message-content-bundle", children: s.map((l, g) => /* @__PURE__ */ n(
1183
+ _,
1147
1184
  {
1148
1185
  className: "humany-message-container",
1149
1186
  left: !0,
1150
1187
  ref: i,
1151
1188
  children: /* @__PURE__ */ n(
1152
- P,
1189
+ q,
1153
1190
  {
1154
1191
  content: l,
1155
- stacked: c(h)
1192
+ stacked: c(g)
1156
1193
  }
1157
1194
  )
1158
1195
  },
@@ -1160,23 +1197,23 @@ const Ae = ({ className: t }) => {
1160
1197
  )) })
1161
1198
  }
1162
1199
  )
1163
- ] }), w = () => /* @__PURE__ */ m(z, { children: [
1164
- /* @__PURE__ */ m(te, { className: "humany-sr-only", children: [
1165
- d,
1200
+ ] }), b = () => /* @__PURE__ */ u(N, { children: [
1201
+ /* @__PURE__ */ u(oe, { className: "humany-sr-only", children: [
1202
+ m,
1166
1203
  ":"
1167
1204
  ] }),
1168
- /* @__PURE__ */ n(Ze, { timestamp: e, className: t, children: /* @__PURE__ */ n(U, { className: "humany-message-content-bundle", children: s.map((l, h) => /* @__PURE__ */ n(
1169
- V,
1205
+ /* @__PURE__ */ n(rt, { timestamp: e, className: t, children: /* @__PURE__ */ n(V, { className: "humany-message-content-bundle", children: s.map((l, g) => /* @__PURE__ */ n(
1206
+ _,
1170
1207
  {
1171
1208
  className: "humany-message-container",
1172
1209
  right: !0,
1173
1210
  ref: i,
1174
1211
  children: /* @__PURE__ */ n(
1175
- P,
1212
+ q,
1176
1213
  {
1177
1214
  isUser: !0,
1178
1215
  content: l,
1179
- stacked: c(h)
1216
+ stacked: c(g)
1180
1217
  }
1181
1218
  )
1182
1219
  },
@@ -1184,61 +1221,61 @@ const Ae = ({ className: t }) => {
1184
1221
  )) }) })
1185
1222
  ] });
1186
1223
  switch (o) {
1187
- case E.System:
1188
- return u();
1189
- case E.Agent:
1190
- return f();
1191
- case E.User:
1192
- return w();
1224
+ case W.System:
1225
+ return h();
1226
+ case W.Agent:
1227
+ return y();
1228
+ case W.User:
1229
+ return b();
1193
1230
  default:
1194
1231
  return null;
1195
1232
  }
1196
1233
  }
1197
- ), P = ({
1234
+ ), q = ({
1198
1235
  content: t,
1199
1236
  isUser: e,
1200
1237
  isSystem: r,
1201
1238
  stacked: o
1202
1239
  }) => {
1203
- const s = _(), { title: i, body: c, actions: d, form: u, items: f } = t;
1204
- return f ? /* @__PURE__ */ n(
1205
- q,
1240
+ const s = Y(), { title: i, body: c, actions: m, form: h, items: y } = t;
1241
+ return y ? /* @__PURE__ */ n(
1242
+ F,
1206
1243
  {
1207
1244
  className: "humany-message-content",
1208
1245
  user: !!e,
1209
1246
  stacked: o,
1210
- children: /* @__PURE__ */ n(wt, { items: f, dispatch: s })
1247
+ children: /* @__PURE__ */ n(zt, { items: y, dispatch: s })
1211
1248
  }
1212
- ) : /* @__PURE__ */ m(
1213
- q,
1249
+ ) : /* @__PURE__ */ u(
1250
+ F,
1214
1251
  {
1215
1252
  className: "humany-message-content",
1216
1253
  padded: !r,
1217
1254
  user: !!e,
1218
1255
  stacked: o,
1219
- fullWidth: !!u || !!d,
1256
+ fullWidth: !!h || !!m,
1220
1257
  children: [
1221
- i && /* @__PURE__ */ n(H, { children: /* @__PURE__ */ n(Pe, { variant: "h2", children: i }) }),
1222
- c && /* @__PURE__ */ n(H, { children: /* @__PURE__ */ n(qe, { html: c }) }),
1223
- u && /* @__PURE__ */ n(H, { children: /* @__PURE__ */ n(
1224
- Ve,
1258
+ i && /* @__PURE__ */ n(O, { children: /* @__PURE__ */ n(Ve, { variant: "h2", children: i }) }),
1259
+ c && /* @__PURE__ */ n(O, { children: /* @__PURE__ */ n(Xe, { html: c }) }),
1260
+ h && /* @__PURE__ */ n(O, { children: /* @__PURE__ */ n(
1261
+ Ye,
1225
1262
  {
1226
- ...u,
1227
- onChange: (l, h) => {
1263
+ ...h,
1264
+ onChange: (l, g) => {
1228
1265
  s("form", {
1229
- data: h,
1230
- formKey: u.schema.id,
1266
+ data: g,
1267
+ formKey: h.schema.id,
1231
1268
  actionKey: l
1232
1269
  });
1233
1270
  }
1234
1271
  }
1235
1272
  ) }),
1236
- d && /* @__PURE__ */ n(H, { children: /* @__PURE__ */ n(
1237
- _e,
1273
+ m && /* @__PURE__ */ n(O, { children: /* @__PURE__ */ n(
1274
+ Ge,
1238
1275
  {
1239
- items: Object.keys(d).map((l) => ({ label: d[l], actionKey: l })),
1276
+ items: Object.keys(m).map((l) => ({ label: m[l], actionKey: l })),
1240
1277
  renderItem: (l) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
1241
- Fe,
1278
+ Je,
1242
1279
  {
1243
1280
  onClick: () => {
1244
1281
  s("action", l.actionKey);
@@ -1251,59 +1288,59 @@ const Ae = ({ className: t }) => {
1251
1288
  ]
1252
1289
  }
1253
1290
  );
1254
- }, te = a.div`
1291
+ }, oe = a.div`
1255
1292
  position: absolute;
1256
1293
  left: -10000px;
1257
1294
  top: auto;
1258
1295
  width: 1px;
1259
1296
  height: 1px;
1260
1297
  overflow: hidden;
1261
- `, ue = () => {
1262
- const t = le((d) => {
1263
- d && setTimeout(() => {
1264
- d.scrollIntoView({
1298
+ `, ye = () => {
1299
+ const t = ue((m) => {
1300
+ m && setTimeout(() => {
1301
+ m.scrollIntoView({
1265
1302
  block: "start",
1266
1303
  behavior: "smooth"
1267
1304
  });
1268
1305
  }, 250);
1269
- }, []), [e, r] = oe(!0), {
1306
+ }, []), [e, r] = le(!0), {
1270
1307
  messages: o,
1271
1308
  loading: s,
1272
1309
  typingActors: i = []
1273
- } = N(), c = () => i && i.length ? i.map((d, u) => /* @__PURE__ */ n(
1274
- W,
1310
+ } = I(), c = () => i && i.length ? i.map((m, h) => /* @__PURE__ */ n(
1311
+ U,
1275
1312
  {
1276
- id: `typing_${d.name}`,
1277
- children: /* @__PURE__ */ n(me, { timestamp: Date.now(), sender: d, children: /* @__PURE__ */ n(
1278
- Z,
1313
+ id: `typing_${m.name}`,
1314
+ children: /* @__PURE__ */ n(fe, { timestamp: Date.now(), sender: m, children: /* @__PURE__ */ n(
1315
+ ne,
1279
1316
  {
1280
1317
  boxed: !0,
1281
1318
  ref: t
1282
1319
  }
1283
1320
  ) })
1284
1321
  },
1285
- `typing_${d.name}`
1322
+ `typing_${m.name}`
1286
1323
  )) : null;
1287
- return /* @__PURE__ */ m(z, { children: [
1288
- /* @__PURE__ */ m(St, { tabIndex: 0, scrollableCss: e, ref: r, children: [
1289
- o && o.length ? o.map((d, u) => {
1290
- const { type: f, timestamp: w, sender: l, content: h } = d;
1324
+ return /* @__PURE__ */ u(N, { children: [
1325
+ /* @__PURE__ */ u(Mt, { tabIndex: 0, scrollableCss: e, ref: r, children: [
1326
+ o && o.length ? o.map((m, h) => {
1327
+ const { type: y, timestamp: b, sender: l, content: g } = m;
1291
1328
  return /* @__PURE__ */ n(
1292
- W,
1329
+ U,
1293
1330
  {
1294
1331
  className: "humany-conversation-entry",
1295
1332
  tabIndex: -1,
1296
- children: /* @__PURE__ */ n(Ct, { ...d, ref: t })
1333
+ children: /* @__PURE__ */ n(Nt, { ...m, ref: t })
1297
1334
  },
1298
- `${f}_${l == null ? void 0 : l.name}_${w}_${h[0].key}`
1335
+ `${y}_${l == null ? void 0 : l.name}_${b}_${g[0].key}`
1299
1336
  );
1300
1337
  }) : null,
1301
1338
  c(),
1302
- s && /* @__PURE__ */ n(W, { children: /* @__PURE__ */ n(Z, { ref: t }) })
1339
+ s && /* @__PURE__ */ n(U, { children: /* @__PURE__ */ n(ne, { ref: t }) })
1303
1340
  ] }),
1304
- /* @__PURE__ */ n(Ae, {})
1341
+ /* @__PURE__ */ n(Re, {})
1305
1342
  ] });
1306
- }, St = a.div`
1343
+ }, Mt = a.div`
1307
1344
  display: flex;
1308
1345
  flex-direction: column;
1309
1346
  align-items: stretch;
@@ -1314,9 +1351,9 @@ const Ae = ({ className: t }) => {
1314
1351
  }};
1315
1352
  ${(t) => !!t.scrollableCss && t.scrollableCss};
1316
1353
  &:focus-visible {
1317
- ${(t) => b(t)};
1354
+ ${(t) => f(t)};
1318
1355
  }
1319
- `, W = a.div`
1356
+ `, U = a.div`
1320
1357
  margin: 0;
1321
1358
  margin-bottom: ${(t) => {
1322
1359
  var e;
@@ -1348,44 +1385,44 @@ const Ae = ({ className: t }) => {
1348
1385
  h1 {
1349
1386
  font-weight: normal;
1350
1387
  }
1351
- ${(t) => G(t)(
1388
+ ${(t) => J(t)(
1352
1389
  "h1",
1353
1390
  p`
1354
1391
  font-weight: normal;
1355
1392
  `
1356
1393
  )}
1357
- `, zt = ({ dispatch: t }) => {
1358
- const e = ie(null);
1359
- return J(() => {
1394
+ `, It = ({ dispatch: t }) => {
1395
+ const e = me(null);
1396
+ return Q(() => {
1360
1397
  e.current && e.current.parentNode && t("overlay-mounted", e.current);
1361
1398
  }, [e]), /* @__PURE__ */ n(
1362
- ae,
1399
+ de,
1363
1400
  {
1364
1401
  portalId: "humany-conversation-overlay-portal",
1365
1402
  className: "humany-conversation-overlay-outlet",
1366
1403
  ref: e
1367
1404
  }
1368
1405
  );
1369
- }, Lt = ({
1406
+ }, Tt = ({
1370
1407
  dispatch: t,
1371
1408
  header: e,
1372
1409
  buttonLabel: r
1373
- }) => /* @__PURE__ */ m(
1374
- Nt,
1410
+ }) => /* @__PURE__ */ u(
1411
+ At,
1375
1412
  {
1376
1413
  portalId: "humany-conversation-portal",
1377
1414
  className: "humany-conversation-outlet",
1378
1415
  children: [
1379
- /* @__PURE__ */ m(It, { className: "humany-conversation-outlet-head", children: [
1416
+ /* @__PURE__ */ u(Ht, { className: "humany-conversation-outlet-head", children: [
1380
1417
  /* @__PURE__ */ n(
1381
- Tt,
1418
+ Rt,
1382
1419
  {
1383
1420
  className: "humany-conversation-outlet-head-button",
1384
1421
  "aria-label": r,
1385
1422
  title: r,
1386
1423
  onClick: () => t("hide-overlay-conversation"),
1387
1424
  children: /* @__PURE__ */ n(
1388
- x,
1425
+ w,
1389
1426
  {
1390
1427
  symbol: {
1391
1428
  type: "Svg",
@@ -1397,7 +1434,7 @@ const Ae = ({ className: t }) => {
1397
1434
  }
1398
1435
  ),
1399
1436
  e && /* @__PURE__ */ n(
1400
- Mt,
1437
+ Ot,
1401
1438
  {
1402
1439
  className: "humany-conversation-outlet-header",
1403
1440
  variant: "h1",
@@ -1405,10 +1442,10 @@ const Ae = ({ className: t }) => {
1405
1442
  }
1406
1443
  )
1407
1444
  ] }),
1408
- /* @__PURE__ */ n(ue, {})
1445
+ /* @__PURE__ */ n(ye, {})
1409
1446
  ]
1410
1447
  }
1411
- ), Nt = a(ae)`
1448
+ ), At = a(de)`
1412
1449
  z-index: 11;
1413
1450
  top: auto;
1414
1451
  height: 65%;
@@ -1423,7 +1460,7 @@ const Ae = ({ className: t }) => {
1423
1460
  var e;
1424
1461
  return (e = t.theme.sizes) == null ? void 0 : e.large;
1425
1462
  }};
1426
- `, It = a.div`
1463
+ `, Ht = a.div`
1427
1464
  display: flex;
1428
1465
  flex-direction: column;
1429
1466
  justify-content: center;
@@ -1437,7 +1474,7 @@ const Ae = ({ className: t }) => {
1437
1474
  return (e = t.theme.sizes) == null ? void 0 : e.normal;
1438
1475
  }};
1439
1476
  ${(t) => t.theme.border && `border-bottom: ${t.theme.border};`}
1440
- `, Mt = a(F)`
1477
+ `, Ot = a(X)`
1441
1478
  font-size: ${(t) => {
1442
1479
  var e;
1443
1480
  return (e = t.theme.fonts) == null ? void 0 : e.medium;
@@ -1447,7 +1484,7 @@ const Ae = ({ className: t }) => {
1447
1484
  return (e = t.theme.colors) == null ? void 0 : e.text;
1448
1485
  }};
1449
1486
  margin: 0;
1450
- `, Tt = a(L)`
1487
+ `, Rt = a(M)`
1451
1488
  display: flex;
1452
1489
  align-items: center;
1453
1490
  justify-content: center;
@@ -1461,7 +1498,7 @@ const Ae = ({ className: t }) => {
1461
1498
  ${(t) => t.theme.borderRadius && `border-radius: ${t.theme.borderRadius};`}
1462
1499
 
1463
1500
  &:focus-visible {
1464
- ${b};
1501
+ ${f};
1465
1502
  }
1466
1503
 
1467
1504
  svg line {
@@ -1470,34 +1507,34 @@ const Ae = ({ className: t }) => {
1470
1507
  return (e = t.theme.colors) == null ? void 0 : e.text;
1471
1508
  }};
1472
1509
  }
1473
- `, Vt = ({ className: t, ...e }) => {
1510
+ `, Yt = ({ className: t, ...e }) => {
1474
1511
  const {
1475
1512
  overlay: r,
1476
1513
  overlayConversationHeader: o,
1477
1514
  overlayConversationCloseLabel: s,
1478
1515
  conversationControllerId: i
1479
- } = N(), c = _(), u = ke().get("$settings");
1516
+ } = I(), c = Y(), h = ie().get("$settings");
1480
1517
  return /* @__PURE__ */ n(
1481
- Ce.Provider,
1518
+ Le.Provider,
1482
1519
  {
1483
1520
  value: i ? { id: i } : null,
1484
- children: /* @__PURE__ */ m(de.Provider, { value: u == null ? void 0 : u.language, children: [
1521
+ children: /* @__PURE__ */ u(ge.Provider, { value: h == null ? void 0 : h.language, children: [
1485
1522
  /* @__PURE__ */ n(
1486
- At,
1523
+ Bt,
1487
1524
  {
1488
1525
  "aria-live": "assertive",
1489
1526
  ...e,
1490
- className: M(
1527
+ className: T(
1491
1528
  t,
1492
1529
  "humany-conversation-component"
1493
1530
  ),
1494
- children: /* @__PURE__ */ n(ue, {})
1531
+ children: /* @__PURE__ */ n(ye, {})
1495
1532
  }
1496
1533
  ),
1497
- r && /* @__PURE__ */ m(z, { children: [
1498
- /* @__PURE__ */ n(zt, { dispatch: c }),
1534
+ r && /* @__PURE__ */ u(N, { children: [
1535
+ /* @__PURE__ */ n(It, { dispatch: c }),
1499
1536
  r.conversation && /* @__PURE__ */ n(
1500
- Lt,
1537
+ Tt,
1501
1538
  {
1502
1539
  dispatch: c,
1503
1540
  header: o,
@@ -1508,7 +1545,7 @@ const Ae = ({ className: t }) => {
1508
1545
  ] })
1509
1546
  }
1510
1547
  );
1511
- }, At = a.div`
1548
+ }, Bt = a.div`
1512
1549
  position: absolute;
1513
1550
  right: 0;
1514
1551
  left: 0;
@@ -1519,5 +1556,5 @@ const Ae = ({ className: t }) => {
1519
1556
  flex-direction: column;
1520
1557
  `;
1521
1558
  export {
1522
- Vt as default
1559
+ Yt as default
1523
1560
  };