@telia-ace/widget-conversation 1.0.15 → 1.0.16

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.
Files changed (41) hide show
  1. package/LICENSE.txt +5 -5
  2. package/README.md +307 -256
  3. package/dist/agent.d.ts +17 -17
  4. package/dist/conversation-controller.d.ts +88 -88
  5. package/dist/conversation-form-adapter.d.ts +7 -7
  6. package/dist/conversation-platform.d.ts +50 -50
  7. package/dist/conversation-provider.d.ts +22 -22
  8. package/dist/conversation.js +783 -5
  9. package/dist/conversation.js.map +1 -1
  10. package/dist/index.d.ts +9 -9
  11. package/dist/index.js +868 -9
  12. package/dist/index.js.map +1 -1
  13. package/dist/resolve-entity-value.d.ts +10 -10
  14. package/dist/return-button.js.map +1 -1
  15. package/dist/types.d.ts +95 -110
  16. package/dist/ui/conversation/conversation-component.d.ts +37 -37
  17. package/dist/ui/conversation/conversation-content.d.ts +11 -12
  18. package/dist/ui/conversation/conversation-input.d.ts +6 -6
  19. package/dist/ui/conversation/conversation-loader.d.ts +8 -8
  20. package/dist/ui/conversation/conversation-message.d.ts +7 -7
  21. package/dist/ui/conversation/conversation-styles.d.ts +11 -11
  22. package/dist/ui/conversation/conversation.d.ts +6 -6
  23. package/dist/ui/conversation/index.d.ts +2 -3
  24. package/dist/ui/conversation/message-types/agent.d.ts +11 -11
  25. package/dist/ui/conversation/message-types/custom-message-list-item.d.ts +9 -9
  26. package/dist/ui/conversation/message-types/custom.d.ts +9 -9
  27. package/dist/ui/conversation/message-types/index.d.ts +5 -5
  28. package/dist/ui/conversation/message-types/system.d.ts +12 -12
  29. package/dist/ui/conversation/message-types/timestamp.d.ts +8 -8
  30. package/dist/ui/conversation/message-types/user.d.ts +8 -8
  31. package/dist/ui/index.d.ts +2 -2
  32. package/dist/ui/return-button/index.d.ts +2 -2
  33. package/dist/ui/return-button/return-button-component.d.ts +19 -19
  34. package/dist/ui/return-button/return-button.d.ts +6 -6
  35. package/dist/user.d.ts +7 -7
  36. package/dist/utils/custom-message.d.ts +3 -3
  37. package/dist/utils/index.d.ts +1 -1
  38. package/dist/utils/open-chat-widget.d.ts +4 -4
  39. package/package.json +8 -8
  40. package/dist/index2.js +0 -1678
  41. package/dist/index2.js.map +0 -1
@@ -1,4 +1,6 @@
1
1
  var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
2
4
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
4
6
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
@@ -14,6 +16,7 @@ var __spreadValues = (a, b) => {
14
16
  }
15
17
  return a;
16
18
  };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
17
20
  var __objRest = (source, exclude) => {
18
21
  var target = {};
19
22
  for (var prop in source)
@@ -26,12 +29,12 @@ var __objRest = (source, exclude) => {
26
29
  }
27
30
  return target;
28
31
  };
29
- import { Input, Button, borderTabStyle, SymbolBadge, useDispatch, useProperties, useScroll, invertedHoverButton, Html, List, buttonCss, Lightbox, useTransitionEnd, headingElement } from "@telia-ace/widget-ui";
30
- import { appendClassNames } from "@telia-ace/widget-utilities";
31
- import React, { useState, useEffect, useRef, useCallback } from "react";
32
- import styled, { css } from "styled-components";
33
- import { C as ContentBundle, M as MessageContainer, a as MessageContent, L as Loader, b as ConversationMessageType, S as SystemMessage, c as ConversationContent, A as AgentMessage, U as UserMessage } from "./index2.js";
32
+ import { Input, Button, borderTabStyle, SymbolBadge, useDispatch, useProperties, useScroll, Typography, useComponent, invertedHoverButton, Html, List, buttonCss, Lightbox, useTransitionEnd, headingElement } from "@telia-ace/widget-ui";
33
+ import { appendClassNames, uuid } from "@telia-ace/widget-utilities";
34
+ import React, { useState, useEffect, Suspense, Fragment, useRef, useCallback } from "react";
35
+ import styled, { css, keyframes } from "styled-components";
34
36
  import { FormComponent } from "@telia-ace/widget-forms";
37
+ import { ConversationMessageListItemType, ConversationMessageType } from "./index.js";
35
38
  import "@telia-ace/widget-core";
36
39
  import "@telia-ace/widget-services";
37
40
  import "@telia-ace/widget-plugins";
@@ -260,9 +263,784 @@ const SendSymbol = styled((_a) => {
260
263
  }};
261
264
  }
262
265
  `;
266
+ const Avatar = styled.div`
267
+ width: ${(p) => p.avatarSize || "32px"};
268
+ height: ${(p) => p.avatarSize || "32px"};
269
+ border-radius: 50%;
270
+ background-color: ${(p) => {
271
+ var _a;
272
+ return (_a = p.theme.colors) == null ? void 0 : _a.accent;
273
+ }};
274
+ border: ${(p) => p.theme.border};
275
+ grid-area: avatar;
276
+ align-self: flex-end;
277
+ justify-self: center;
278
+ overflow: hidden;
279
+ margin-right: ${(p) => {
280
+ var _a;
281
+ return (_a = p.theme.sizes) == null ? void 0 : _a.normal;
282
+ }};
283
+ display: flex;
284
+ justify-content: center;
285
+ align-items: center;
286
+ color: ${(p) => {
287
+ var _a;
288
+ return (_a = p.theme.colors) == null ? void 0 : _a.text;
289
+ }};
290
+
291
+ > img {
292
+ height: 100%;
293
+ width: 100%;
294
+ object-fit: cover;
295
+ }
296
+
297
+ > svg {
298
+ width: 90%;
299
+ height: 90%;
300
+ padding: 10%;
301
+ color: ${(p) => {
302
+ var _a;
303
+ return (_a = p.theme.colors) == null ? void 0 : _a.text;
304
+ }};
305
+
306
+ line,
307
+ path,
308
+ circle,
309
+ fill {
310
+ stroke: ${(p) => {
311
+ var _a;
312
+ return (_a = p.theme.colors) == null ? void 0 : _a.text;
313
+ }};
314
+ }
315
+ }
316
+ `;
317
+ const LoaderAnimation = keyframes`
318
+ 0% {
319
+ opacity: 0;
320
+ }
321
+ 75% {
322
+ opacity: 1;
323
+ }
324
+ 100% {
325
+ opacity: 0;
326
+ }
327
+ `;
328
+ const Loader = styled.div`
329
+ display: flex;
330
+ justify-content: center;
331
+ > div {
332
+ height: 10px;
333
+ width: 10px;
334
+ border-radius: 50%;
335
+ margin: 5px;
336
+ background-color: ${(p) => {
337
+ var _a;
338
+ return (_a = p.theme.colors) == null ? void 0 : _a.text;
339
+ }};
340
+ animation: ${LoaderAnimation} 1s infinite;
341
+ }
342
+ > div:nth-child(2) {
343
+ animation-delay: 100ms;
344
+ }
345
+ > div:nth-child(3) {
346
+ animation-delay: 200ms;
347
+ }
348
+ `;
349
+ const ContentBundle = styled.div`
350
+ grid-area: content;
351
+ max-width: 100%;
352
+ overflow: hidden;
353
+ `;
354
+ const MessageTitle = styled(Typography)`
355
+ font-size: ${(p) => {
356
+ var _a;
357
+ return (_a = p.theme.fonts) == null ? void 0 : _a.normal;
358
+ }};
359
+ font-weight: normal;
360
+ margin: 0;
361
+ `;
362
+ const MessageContainer = styled.div`
363
+ display: flex;
364
+ `;
365
+ const MessageContent = styled.div`
366
+ background-color: ${(p) => {
367
+ var _a, _b;
368
+ return p.user ? (_a = p.theme.colors) == null ? void 0 : _a.primary : (_b = p.theme.colors) == null ? void 0 : _b.accent;
369
+ }};
370
+ color: ${(p) => {
371
+ var _a, _b;
372
+ return p.user ? (_a = p.theme.colors) == null ? void 0 : _a.accent : (_b = p.theme.colors) == null ? void 0 : _b.text;
373
+ }};
374
+ border-radius: 5px; // TODO: prop?
375
+ border: 1px solid rgb(231, 231, 231);
376
+ padding-top: calc(${(p) => {
377
+ var _a;
378
+ return (_a = p.theme.sizes) == null ? void 0 : _a.medium;
379
+ }} - ${(p) => {
380
+ var _a;
381
+ return (_a = p.theme.sizes) == null ? void 0 : _a.normal;
382
+ }});
383
+ padding-bottom: calc(${(p) => {
384
+ var _a;
385
+ return (_a = p.theme.sizes) == null ? void 0 : _a.medium;
386
+ }} - ${(p) => {
387
+ var _a;
388
+ return (_a = p.theme.sizes) == null ? void 0 : _a.normal;
389
+ }});
390
+ margin-top: ${(p) => {
391
+ var _a;
392
+ return (_a = p.theme.sizes) == null ? void 0 : _a.normal;
393
+ }};
394
+ display: inline-block;
395
+ && > * {
396
+ overflow-wrap: break-word;
397
+ word-wrap: break-word;
398
+ word-break: break-all;
399
+ word-break: break-word;
400
+ hyphens: auto;
401
+ }
402
+ max-width: 100%;
403
+ ${(p) => p.fullWidth && "width: 100%;"}
404
+
405
+ ${(p) => !p.user && css`
406
+ border: ${p.theme.border};
407
+ `}
408
+ ${(p) => p.user && "margin-left: auto"};
409
+
410
+ ${(p) => p.stacked === "first" && p.user && css`
411
+ border-bottom-right-radius: 1px; // TODO: Prop?
412
+ `}
413
+ ${(p) => p.stacked === "middle" && p.user && css`
414
+ border-bottom-right-radius: 1px;
415
+ border-top-right-radius: 1px;
416
+ `}
417
+ ${(p) => p.stacked === "last" && p.user && css`
418
+ border-top-right-radius: 1px;
419
+ `}
420
+ ${(p) => p.stacked === "first" && !p.user && css`
421
+ border-bottom-left-radius: 1px;
422
+ `}
423
+ ${(p) => p.stacked === "middle" && !p.user && css`
424
+ border-bottom-left-radius: 1px;
425
+ border-top-left-radius: 1px;
426
+ `}
427
+ ${(p) => p.stacked === "last" && !p.user && css`
428
+ border-top-left-radius: 1px;
429
+ `};
430
+
431
+ ${(p) => !p.stacked && css`
432
+ ${p.user ? "border-bottom-right-radius: 1px;" : "border-bottom-left-radius: 1px;"}
433
+ `};
434
+
435
+ transition: border-radius 500ms linear;
436
+ `;
437
+ const MessageContentPart = styled.div`
438
+ padding: ${(p) => {
439
+ var _a;
440
+ return (_a = p.theme.sizes) == null ? void 0 : _a.normal;
441
+ }} ${(p) => {
442
+ var _a;
443
+ return (_a = p.theme.sizes) == null ? void 0 : _a.medium;
444
+ }};
445
+
446
+ ${(p) => p.noPadding && css`
447
+ padding: 0;
448
+ `}
449
+
450
+ margin-bottom: ${(p) => {
451
+ var _a;
452
+ return (_a = p.theme.sizes) == null ? void 0 : _a.normal;
453
+ }};
454
+ &:last-child {
455
+ margin-bottom: 0;
456
+ }
457
+ `;
263
458
  const ConversationLoader = ({ className, agentData }) => {
264
459
  return /* @__PURE__ */ React.createElement(ContentBundle, null, /* @__PURE__ */ React.createElement(MessageContainer, null, /* @__PURE__ */ React.createElement(MessageContent, null, /* @__PURE__ */ React.createElement(Loader, null, /* @__PURE__ */ React.createElement("div", null), /* @__PURE__ */ React.createElement("div", null), /* @__PURE__ */ React.createElement("div", null)))));
265
460
  };
461
+ const StyledTimestamp = styled.p`
462
+ && {
463
+ font-size: ${(p) => {
464
+ var _a;
465
+ return (_a = p.theme.fonts) == null ? void 0 : _a.small;
466
+ }};
467
+ font-weight: 300;
468
+ }
469
+ padding-top: ${(p) => {
470
+ var _a;
471
+ return (_a = p.theme.sizes) == null ? void 0 : _a.small;
472
+ }};
473
+ margin: 0;
474
+ line-height: 1.5em;
475
+ grid-area: info;
476
+ color: ${(p) => {
477
+ var _a;
478
+ return (_a = p.theme.colors) == null ? void 0 : _a.text;
479
+ }};
480
+ `;
481
+ const getTimestamp = (raw) => {
482
+ return new Date(raw).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
483
+ };
484
+ const Timestamp = ({ className, name, timestamp }) => {
485
+ if (!name && !timestamp) {
486
+ return null;
487
+ }
488
+ let output = "";
489
+ if (name) {
490
+ if (timestamp) {
491
+ output = `${name}: ${getTimestamp(timestamp)}`;
492
+ } else {
493
+ output = name;
494
+ }
495
+ } else if (timestamp) {
496
+ output = getTimestamp(timestamp);
497
+ }
498
+ return /* @__PURE__ */ React.createElement(StyledTimestamp, null, output);
499
+ };
500
+ const AgentMessage = ({ className, children, sender, timestamp }) => {
501
+ const { avatar, name } = sender;
502
+ const { avatarSize } = useProperties();
503
+ return /* @__PURE__ */ React.createElement(StyledAgentMessage, {
504
+ hasAvatar: !!avatar,
505
+ className: appendClassNames(className, "humany-conversation-agent-message")
506
+ }, avatar && /* @__PURE__ */ React.createElement(Avatar, {
507
+ avatarSize
508
+ }, typeof avatar === "string" ? /* @__PURE__ */ React.createElement("img", {
509
+ src: avatar
510
+ }) : /* @__PURE__ */ React.createElement(SymbolBadge, {
511
+ symbol: avatar
512
+ })), children, /* @__PURE__ */ React.createElement(Timestamp, {
513
+ name,
514
+ timestamp
515
+ }));
516
+ };
517
+ const StyledAgentMessage = styled.div`
518
+ display: grid;
519
+ margin-right: 10%;
520
+ width: 90%;
521
+ ${(p) => p.hasAvatar ? css`
522
+ grid-template-columns: auto 1fr;
523
+ grid-template-rows: 1fr auto;
524
+ grid-template-areas:
525
+ 'avatar content'
526
+ '. info';
527
+ ` : css`
528
+ grid-template-columns: 1fr;
529
+ grid-template-rows: 1fr auto;
530
+ grid-template-areas:
531
+ 'content'
532
+ 'info';
533
+ `};
534
+ `;
535
+ const CustomMessage = (props) => {
536
+ const CustomComponent = useComponent(props.type);
537
+ if (!CustomComponent) {
538
+ return null;
539
+ }
540
+ return /* @__PURE__ */ React.createElement(Suspense, {
541
+ fallback: null
542
+ }, /* @__PURE__ */ React.createElement(MessageContent, {
543
+ user: props.isUser,
544
+ stacked: !!props.stacked && props.stacked,
545
+ fullWidth: !!props.content.form || !!props.content.actions
546
+ }, /* @__PURE__ */ React.createElement(MessageContentPart, {
547
+ noPadding: !!props.content.noPadding && props.content.noPadding
548
+ }, /* @__PURE__ */ React.createElement(CustomComponent, __spreadValues({}, props.content)))));
549
+ };
550
+ const SystemMessage = ({
551
+ className,
552
+ children,
553
+ timestamp,
554
+ discrete,
555
+ fullWidth
556
+ }) => {
557
+ return /* @__PURE__ */ React.createElement(StyledSystemMessage, {
558
+ className: appendClassNames(className, "humany-conversation-system-message"),
559
+ fullWidth
560
+ }, discrete ? /* @__PURE__ */ React.createElement(Discrete, {
561
+ className: "humany-conversation-discrete-message"
562
+ }, children, /* @__PURE__ */ React.createElement(Timestamp, {
563
+ timestamp
564
+ })) : /* @__PURE__ */ React.createElement(React.Fragment, null, children, /* @__PURE__ */ React.createElement(Timestamp, {
565
+ timestamp
566
+ })));
567
+ };
568
+ const StyledSystemMessage = styled.div`
569
+ ${(p) => p.fullWidth && "width: 100%"};
570
+ padding: 0 ${(p) => {
571
+ var _a;
572
+ return (_a = p.theme.sizes) == null ? void 0 : _a.large;
573
+ }};
574
+ overflow: auto;
575
+ `;
576
+ const Discrete = styled.div`
577
+ text-align: center;
578
+ word-wrap: break-word;
579
+ font-size: ${(p) => {
580
+ var _a;
581
+ return (_a = p.theme.fonts) == null ? void 0 : _a.normal;
582
+ }};
583
+ color: ${(p) => {
584
+ var _a;
585
+ return (_a = p.theme.colors) == null ? void 0 : _a.text;
586
+ }};
587
+ > p {
588
+ margin: 0;
589
+ }
590
+ `;
591
+ const UserMessage = ({ className, children, timestamp }) => {
592
+ const { userLabel = "" } = useProperties();
593
+ return /* @__PURE__ */ React.createElement(StyledUserMessage, {
594
+ className: appendClassNames(className, "humany-conversation-user-message")
595
+ }, children, /* @__PURE__ */ React.createElement(Timestamp, {
596
+ name: userLabel,
597
+ timestamp
598
+ }));
599
+ };
600
+ const StyledUserMessage = styled.div`
601
+ margin-left: 10%;
602
+ width: 90%;
603
+ display: flex;
604
+ flex-direction: column;
605
+ align-items: flex-end;
606
+ `;
607
+ const CustomMessageListItem = ({ type, content = {} }) => {
608
+ const Component = useComponent(type);
609
+ if (!Component || !type) {
610
+ return null;
611
+ }
612
+ return /* @__PURE__ */ React.createElement(Component, __spreadValues({}, content));
613
+ };
614
+ const imageLightboxRenderer$1 = (attrs) => /* @__PURE__ */ React.createElement(Lightbox, {
615
+ attrs
616
+ });
617
+ const htmlParseInstructions$1 = {
618
+ transform: {
619
+ img: imageLightboxRenderer$1
620
+ }
621
+ };
622
+ const ConversationContent = ({ content, isUser, stacked }) => {
623
+ const dispatch = useDispatch();
624
+ const { title, body, actions, form, type, items } = content;
625
+ if (type)
626
+ return /* @__PURE__ */ React.createElement(CustomMessage, {
627
+ type,
628
+ content,
629
+ isUser,
630
+ stacked
631
+ });
632
+ return /* @__PURE__ */ React.createElement(MessageContent, {
633
+ noPadding: true,
634
+ user: isUser,
635
+ stacked: !!stacked && stacked,
636
+ fullWidth: !!form || !!actions
637
+ }, title && /* @__PURE__ */ React.createElement(MessageContentPart, null, /* @__PURE__ */ React.createElement(MessageTitle, {
638
+ variant: "h2"
639
+ }, title)), body && /* @__PURE__ */ React.createElement(MessageContentPart, null, /* @__PURE__ */ React.createElement(StyledHtml, {
640
+ html: body,
641
+ htmlParseInstruction: htmlParseInstructions$1
642
+ })), form && /* @__PURE__ */ React.createElement(MessageContentPart, null, /* @__PURE__ */ React.createElement(StyledForm, __spreadProps(__spreadValues({}, form), {
643
+ onChange: (key, data) => {
644
+ dispatch("form", {
645
+ data,
646
+ formKey: form.schema.id,
647
+ actionKey: key
648
+ });
649
+ }
650
+ }))), actions && /* @__PURE__ */ React.createElement(MessageContentPart, null, /* @__PURE__ */ React.createElement(StyledActionList, {
651
+ items: Object.keys(actions).map((i) => {
652
+ return { label: actions[i], actionKey: i };
653
+ }),
654
+ renderItem: (item) => {
655
+ return /* @__PURE__ */ React.createElement("li", {
656
+ key: item.actionKey
657
+ }, /* @__PURE__ */ React.createElement(StyledActionButton, {
658
+ onClick: () => {
659
+ dispatch("action", item.actionKey);
660
+ }
661
+ }, item.label));
662
+ }
663
+ })), items && /* @__PURE__ */ React.createElement(Fragment, null, /* @__PURE__ */ React.createElement(MessageContentPart, {
664
+ key: uuid(),
665
+ noPadding: true
666
+ }, /* @__PURE__ */ React.createElement(StyledActionList, {
667
+ items: items.map(([type2, content2]) => {
668
+ return { type: type2, content: content2 };
669
+ }),
670
+ renderItem: (item) => {
671
+ const itemKey = uuid();
672
+ switch (item.type) {
673
+ case ConversationMessageListItemType.Header: {
674
+ return /* @__PURE__ */ React.createElement(ConversationListItem, {
675
+ key: itemKey
676
+ }, /* @__PURE__ */ React.createElement(HeaderText, null, item.content));
677
+ }
678
+ case ConversationMessageListItemType.Text: {
679
+ return /* @__PURE__ */ React.createElement(ConversationListItem, {
680
+ key: itemKey
681
+ }, /* @__PURE__ */ React.createElement("span", null, item.content));
682
+ }
683
+ case ConversationMessageListItemType.HTML: {
684
+ return /* @__PURE__ */ React.createElement(ConversationListItem, {
685
+ key: itemKey
686
+ }, /* @__PURE__ */ React.createElement(StyledHtml, {
687
+ html: item.content.body,
688
+ htmlParseInstruction: htmlParseInstructions$1
689
+ }));
690
+ }
691
+ case ConversationMessageListItemType.Separator: {
692
+ return /* @__PURE__ */ React.createElement(ConversationListItem, {
693
+ key: itemKey,
694
+ noPadding: true
695
+ }, /* @__PURE__ */ React.createElement(SeparatorPadding, null, /* @__PURE__ */ React.createElement(Separator, null)));
696
+ }
697
+ case ConversationMessageListItemType.LinkList: {
698
+ const items2 = Array.isArray(item.content.actions) ? item.content.actions : Object.keys(item.content.actions).map((i) => {
699
+ return {
700
+ label: item.content.actions[i],
701
+ actionKey: i
702
+ };
703
+ });
704
+ return /* @__PURE__ */ React.createElement(ConversationListItem, {
705
+ key: itemKey
706
+ }, /* @__PURE__ */ React.createElement(StyledLinkList, {
707
+ items: items2,
708
+ renderItem: (item2) => {
709
+ return /* @__PURE__ */ React.createElement("li", {
710
+ key: item2.actionKey
711
+ }, /* @__PURE__ */ React.createElement(StyledLinkButton, {
712
+ help: item2.actionKey === "help",
713
+ onClick: () => {
714
+ dispatch("action", item2.actionKey);
715
+ }
716
+ }, item2.label, item2.actionKey === "help" && /* @__PURE__ */ React.createElement(SymbolBadge, {
717
+ size: 14,
718
+ symbol: {
719
+ type: "Svg",
720
+ content: "caret-down"
721
+ }
722
+ })));
723
+ }
724
+ }));
725
+ }
726
+ case ConversationMessageListItemType.ButtonList: {
727
+ const items2 = Array.isArray(item.content.actions) ? item.content.actions : Object.keys(item.content.actions).map((i) => {
728
+ return {
729
+ label: item.content.actions[i],
730
+ actionKey: i
731
+ };
732
+ });
733
+ return /* @__PURE__ */ React.createElement(ConversationListItem, {
734
+ key: itemKey
735
+ }, /* @__PURE__ */ React.createElement(StyledButtonList, {
736
+ items: items2,
737
+ renderItem: (item2) => {
738
+ return /* @__PURE__ */ React.createElement("li", {
739
+ key: item2.actionKey
740
+ }, /* @__PURE__ */ React.createElement(StyledButtonListButton, {
741
+ onClick: () => {
742
+ dispatch("action", item2.actionKey);
743
+ }
744
+ }, /* @__PURE__ */ React.createElement(SymbolBadge, {
745
+ symbol: item2.symbol
746
+ }), item2.label));
747
+ }
748
+ }));
749
+ }
750
+ default: {
751
+ return /* @__PURE__ */ React.createElement(ConversationListItem, {
752
+ key: itemKey,
753
+ noPadding: true
754
+ }, /* @__PURE__ */ React.createElement(CustomMessageListItem, {
755
+ type: item.type,
756
+ content: item.content
757
+ }));
758
+ }
759
+ }
760
+ }
761
+ }))));
762
+ };
763
+ const StyledForm = styled(FormComponent)`
764
+ & button.humany-form-component-button {
765
+ ${(p) => {
766
+ var _a, _b;
767
+ return invertedHoverButton({
768
+ active: false,
769
+ primaryColor: (_a = p.theme.colors) == null ? void 0 : _a.primary,
770
+ secondaryColor: (_b = p.theme.colors) == null ? void 0 : _b.accent
771
+ });
772
+ }};
773
+ display: block;
774
+ width: 100%;
775
+ margin-bottom: ${(p) => {
776
+ var _a;
777
+ return (_a = p.theme.sizes) == null ? void 0 : _a.normal;
778
+ }};
779
+ }
780
+ & button.humany-form-component-submit {
781
+ width: 100%;
782
+ margin: 0;
783
+ :not(:last-child) {
784
+ margin-bottom: ${(p) => {
785
+ var _a;
786
+ return (_a = p.theme.sizes) == null ? void 0 : _a.normal;
787
+ }};
788
+ }
789
+ }
790
+ `;
791
+ const StyledHtml = styled(Html)`
792
+ white-space: pre-wrap;
793
+ a {
794
+ color: ${(p) => p.theme.colors.link};
795
+ &:focus {
796
+ ${(p) => {
797
+ var _a;
798
+ return ((_a = p.theme.accessibility) == null ? void 0 : _a.isTabbing) && borderTabStyle;
799
+ }};
800
+ }
801
+ }
802
+ `;
803
+ const StyledActionList = styled(List)`
804
+ padding: 0;
805
+ list-style: none;
806
+ margin: 0 -${(p) => {
807
+ var _a;
808
+ return (_a = p.theme.sizes) == null ? void 0 : _a.normal;
809
+ }};
810
+ > li {
811
+ margin: ${(p) => {
812
+ var _a;
813
+ return (_a = p.theme.sizes) == null ? void 0 : _a.normal;
814
+ }};
815
+ }
816
+ `;
817
+ const StyledButtonList = styled(List)`
818
+ padding: 0;
819
+ list-style: none;
820
+ > li {
821
+ margin: ${(p) => {
822
+ var _a;
823
+ return (_a = p.theme.sizes) == null ? void 0 : _a.small;
824
+ }} ${(p) => {
825
+ var _a;
826
+ return (_a = p.theme.sizes) == null ? void 0 : _a.normal;
827
+ }};
828
+ margin-left: 0;
829
+ display: inline-block;
830
+ }
831
+ `;
832
+ const StyledButtonListButton = styled.button`
833
+ ${buttonCss};
834
+ display: block;
835
+ text-align: left;
836
+ background-color: ${(p) => {
837
+ var _a;
838
+ return (_a = p.theme.colors) == null ? void 0 : _a.primary;
839
+ }};
840
+ width: 100%;
841
+ color: #fff;
842
+ &:focus {
843
+ ${(p) => {
844
+ var _a;
845
+ return ((_a = p.theme.accessibility) == null ? void 0 : _a.isTabbing) && css`
846
+ ${borderTabStyle}
847
+ background-color: transparent;
848
+ `;
849
+ }}
850
+ }
851
+
852
+ i,
853
+ svg {
854
+ margin-right: ${(p) => {
855
+ var _a;
856
+ return (_a = p.theme.sizes) == null ? void 0 : _a.small;
857
+ }};
858
+ }
859
+ `;
860
+ const StyledLinkList = styled(List)`
861
+ padding: 0;
862
+ list-style: none;
863
+ > li {
864
+ margin-bottom: ${(p) => {
865
+ var _a;
866
+ return (_a = p.theme.sizes) == null ? void 0 : _a.normal;
867
+ }};
868
+
869
+ &:last-child {
870
+ margin-bottom: 0;
871
+ }
872
+ }
873
+ `;
874
+ const HeaderText = styled.strong`
875
+ font-size: ${(p) => {
876
+ var _a;
877
+ return (_a = p.theme.fonts) == null ? void 0 : _a.huge;
878
+ }};
879
+ `;
880
+ const StyledLinkButton = styled.button`
881
+ display: block;
882
+ background-color: transparent;
883
+ text-align: left;
884
+ border: none;
885
+ padding: 0;
886
+ font-weight: 300;
887
+ font-family: inherit;
888
+ cursor: pointer;
889
+ color: ${(p) => {
890
+ var _a;
891
+ return (_a = p.theme.colors) == null ? void 0 : _a.primary;
892
+ }};
893
+
894
+ ${(p) => {
895
+ var _a, _b;
896
+ return p.help && css`
897
+ color: ${(_a = p.theme.colors) == null ? void 0 : _a.text};
898
+ text-decoration: underline;
899
+
900
+ i,
901
+ svg {
902
+ margin-left: ${(_b = p.theme.sizes) == null ? void 0 : _b.small};
903
+ }
904
+ `;
905
+ }}
906
+ `;
907
+ styled(SymbolBadge)`
908
+ font-size: ${(p) => {
909
+ var _a;
910
+ return (_a = p.theme.fonts) == null ? void 0 : _a.large;
911
+ }} !important;
912
+ margin-right: ${(p) => {
913
+ var _a;
914
+ return (_a = p.theme.sizes) == null ? void 0 : _a.normal;
915
+ }};
916
+ `;
917
+ const StyledActionButton = styled.button`
918
+ ${buttonCss};
919
+ display: block;
920
+ background-color: ${(p) => {
921
+ var _a;
922
+ return (_a = p.theme.colors) == null ? void 0 : _a.primary;
923
+ }};
924
+ width: 100%;
925
+ color: #fff;
926
+ font-family: Lato;
927
+ font-size: ${(p) => {
928
+ var _a;
929
+ return (_a = p.theme.fonts) == null ? void 0 : _a.huge;
930
+ }};
931
+ font-weight: 300;
932
+ &:focus {
933
+ ${(p) => {
934
+ var _a;
935
+ return ((_a = p.theme.accessibility) == null ? void 0 : _a.isTabbing) && css`
936
+ ${borderTabStyle}
937
+ background-color: transparent;
938
+ `;
939
+ }}
940
+ }
941
+ `;
942
+ const SeparatorPadding = styled.div`
943
+ padding-top: calc(${(p) => {
944
+ var _a;
945
+ return (_a = p.theme.sizes) == null ? void 0 : _a.medium;
946
+ }} - ${(p) => {
947
+ var _a;
948
+ return (_a = p.theme.sizes) == null ? void 0 : _a.normal;
949
+ }});
950
+ padding-bottom: calc(${(p) => {
951
+ var _a;
952
+ return (_a = p.theme.sizes) == null ? void 0 : _a.medium;
953
+ }} - ${(p) => {
954
+ var _a;
955
+ return (_a = p.theme.sizes) == null ? void 0 : _a.normal;
956
+ }});
957
+ `;
958
+ const Separator = styled.div`
959
+ background-color: #efefef;
960
+ height: 1px;
961
+ width: 100%;
962
+ `;
963
+ styled.div`
964
+ display: flex;
965
+ align-items: center;
966
+ justify-content: center;
967
+ cursor: pointer;
968
+
969
+ > i,
970
+ svg {
971
+ margin-right: ${(p) => {
972
+ var _a;
973
+ return (_a = p.theme.sizes) == null ? void 0 : _a.small;
974
+ }};
975
+ }
976
+ `;
977
+ const ConversationListItem = styled.li`
978
+ padding-left: ${(p) => {
979
+ var _a;
980
+ return p.noPadding ? 0 : (_a = p.theme.sizes) == null ? void 0 : _a.medium;
981
+ }};
982
+ padding-right: ${(p) => {
983
+ var _a;
984
+ return p.noPadding ? 0 : (_a = p.theme.sizes) == null ? void 0 : _a.medium;
985
+ }};
986
+ `;
987
+ styled.li`
988
+ @media (min-width: 768px) {
989
+ display: list-item !important;
990
+ margin-right: 0 !important;
991
+ margin-top: ${(p) => {
992
+ var _a;
993
+ return (_a = p.theme.sizes) == null ? void 0 : _a.normal;
994
+ }} !important;
995
+ }
996
+ `;
997
+ styled.button`
998
+ @media (min-width: 768px) {
999
+ min-width: 100%;
1000
+ margin-right: 0;
1001
+ }
1002
+ display: inline-block;
1003
+ font-size: ${(p) => {
1004
+ var _a;
1005
+ return (_a = p.theme.fonts) == null ? void 0 : _a.normal;
1006
+ }};
1007
+ border-color: ${(p) => {
1008
+ var _a;
1009
+ return (_a = p.theme.colors) == null ? void 0 : _a.primary;
1010
+ }} !important;
1011
+ font-weight: 300;
1012
+ && {
1013
+ margin-right: ${(p) => {
1014
+ var _a;
1015
+ return (_a = p.theme.sizes) == null ? void 0 : _a.small;
1016
+ }};
1017
+ }
1018
+ ${(p) => {
1019
+ var _a, _b;
1020
+ return p["data-direction"] === "horizontal" && css`
1021
+ width: 225px;
1022
+ max-width: calc(50% - ${(_a = p.theme.sizes) == null ? void 0 : _a.large} - ${(_b = p.theme.sizes) == null ? void 0 : _b.small});
1023
+ `;
1024
+ }}
1025
+ ${(p) => p["data-direction"] === "vertical" && css`
1026
+ min-width: 150px;
1027
+ `}
1028
+ ${(p) => {
1029
+ var _a;
1030
+ return invertedHoverButton({
1031
+ primaryColor: `${(_a = p.theme.colors) == null ? void 0 : _a.primary}`,
1032
+ secondaryColor: "#FFFFFF"
1033
+ });
1034
+ }}
1035
+ i {
1036
+ margin: 0 ${(p) => {
1037
+ var _a;
1038
+ return (_a = p.theme.sizes) == null ? void 0 : _a.small;
1039
+ }} 0 0;
1040
+ }
1041
+ span {
1042
+ }
1043
+ `;
266
1044
  const imageLightboxRenderer = (attrs) => /* @__PURE__ */ React.createElement(Lightbox, {
267
1045
  attrs
268
1046
  });