@appquality/unguess-design-system 3.1.91-beta-attachments → 3.1.91-highlight

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 (164) hide show
  1. package/CHANGELOG.md +481 -0
  2. package/build/index.d.ts +12 -10
  3. package/build/index.js +1980 -1022
  4. package/build/stories/accordions/index.stories.d.ts +5 -5
  5. package/build/stories/alerts/index.d.ts +9 -7
  6. package/build/stories/alerts/index.stories.d.ts +2 -2
  7. package/build/stories/avatar/InternalAvatar.d.ts +2 -0
  8. package/build/stories/avatar/index.stories.d.ts +4 -4
  9. package/build/stories/breadcrumbs/index.stories.d.ts +2 -2
  10. package/build/stories/buttons/anchor/index.stories.d.ts +4 -4
  11. package/build/stories/buttons/button/index.d.ts +11 -9
  12. package/build/stories/buttons/button/index.stories.d.ts +6 -6
  13. package/build/stories/buttons/button-group/index.stories.d.ts +4 -4
  14. package/build/stories/buttons/icon-button/index.stories.d.ts +5 -5
  15. package/build/stories/buttons/split-button/index.stories.d.ts +2 -2
  16. package/build/stories/buttons/utils.d.ts +96 -90
  17. package/build/stories/campaign-cards/index.stories.d.ts +3 -3
  18. package/build/stories/cards/container.stories.d.ts +2 -2
  19. package/build/stories/cards/index.stories.d.ts +3 -3
  20. package/build/stories/charts/bar/index.stories.d.ts +3 -3
  21. package/build/stories/charts/bullet/index.stories.d.ts +3 -3
  22. package/build/stories/charts/halfPie/index.stories.d.ts +2 -2
  23. package/build/stories/charts/pie/index.stories.d.ts +4 -4
  24. package/build/stories/charts/sentiment/index.stories.d.ts +3 -3
  25. package/build/stories/charts/sunburst/index.stories.d.ts +3 -3
  26. package/build/stories/charts/waffle/index.stories.d.ts +3 -3
  27. package/build/stories/chat/_types.d.ts +7 -4
  28. package/build/stories/chat/context/chatContext.d.ts +8 -6
  29. package/build/stories/chat/hooks/useMedia.d.ts +8 -0
  30. package/build/stories/chat/index.d.ts +6 -4
  31. package/build/stories/chat/index.stories.d.ts +9 -10
  32. package/build/stories/chat/parts/MediaLightbox.d.ts +14 -0
  33. package/build/stories/chat/parts/ThumbnailContainer/Thumbnail.d.ts +11 -0
  34. package/build/stories/chat/parts/ThumbnailContainer/index.d.ts +1 -8
  35. package/build/stories/chat/parts/comment.d.ts +2 -7
  36. package/build/stories/chat/parts/containers.d.ts +11 -7
  37. package/build/stories/chat/parts/header.d.ts +6 -4
  38. package/build/stories/color-swatch/index.stories.d.ts +3 -3
  39. package/build/stories/drawers/index.stories.d.ts +2 -2
  40. package/build/stories/dropdowns/autocomplete/index.stories.d.ts +3 -3
  41. package/build/stories/dropdowns/countermultiselect/index.stories.d.ts +2 -2
  42. package/build/stories/dropdowns/field/index.d.ts +8 -6
  43. package/build/stories/dropdowns/menu/index.stories.d.ts +3 -3
  44. package/build/stories/dropdowns/select/index.d.ts +6 -4
  45. package/build/stories/dropdowns/select/index.stories.d.ts +3 -3
  46. package/build/stories/editor/index.stories.d.ts +6 -6
  47. package/build/stories/editorWithHighlight/_data.d.ts +17 -0
  48. package/build/stories/editorWithHighlight/floatingMenu.d.ts +5 -0
  49. package/build/stories/editorWithHighlight/index.d.ts +32 -0
  50. package/build/stories/editorWithHighlight/index.stories.d.ts +7 -0
  51. package/build/stories/editorWithHighlight/nodes/active.d.ts +4 -0
  52. package/build/stories/editorWithHighlight/nodes/observation/Component.d.ts +6 -0
  53. package/build/stories/editorWithHighlight/nodes/observation/index.d.ts +2 -0
  54. package/build/stories/editorWithHighlight/nodes/paragraph/Component.d.ts +6 -0
  55. package/build/stories/editorWithHighlight/nodes/paragraph/index.d.ts +2 -0
  56. package/build/stories/editorWithHighlight/nodes/word.d.ts +2 -0
  57. package/build/stories/editorWithHighlight/search.d.ts +8 -0
  58. package/build/stories/editorWithHighlight/useEditor.d.ts +14 -0
  59. package/build/stories/forms/checkbox/cards/index.stories.d.ts +3 -3
  60. package/build/stories/forms/checkbox/index.stories.d.ts +2 -2
  61. package/build/stories/forms/input/index.d.ts +10 -8
  62. package/build/stories/forms/input/index.stories.d.ts +5 -5
  63. package/build/stories/forms/input-toggle/index.d.ts +6 -4
  64. package/build/stories/forms/input-toggle/index.stories.d.ts +6 -6
  65. package/build/stories/forms/mediaInput/index.stories.d.ts +5 -5
  66. package/build/stories/forms/radio/cards/index.stories.d.ts +3 -3
  67. package/build/stories/forms/radio/index.stories.d.ts +3 -3
  68. package/build/stories/forms/textarea/index.stories.d.ts +4 -4
  69. package/build/stories/forms/toggle/index.stories.d.ts +2 -2
  70. package/build/stories/grid/col/index.stories.d.ts +4 -4
  71. package/build/stories/grid/grid/index.stories.d.ts +4 -4
  72. package/build/stories/grid/row/index.stories.d.ts +2 -2
  73. package/build/stories/highlight/CreateObservationButton.d.ts +19 -0
  74. package/build/stories/highlight/_types.d.ts +39 -0
  75. package/build/stories/highlight/demo-parts/data.d.ts +55 -0
  76. package/build/stories/highlight/demo-parts/sentiment-tag.d.ts +7 -0
  77. package/build/stories/highlight/demo-parts/transcript-base.d.ts +5 -0
  78. package/build/stories/highlight/demo-parts/transcript-diarization.d.ts +5 -0
  79. package/build/stories/highlight/demo-parts/transcript-paragraph.d.ts +5 -0
  80. package/build/stories/highlight/demo-parts/transcript-sentiment.d.ts +5 -0
  81. package/build/stories/highlight/highlightContext.d.ts +10 -0
  82. package/build/stories/highlight/index.d.ts +10 -0
  83. package/build/stories/highlight/index.stories.d.ts +18 -0
  84. package/build/stories/highlight/searchable.d.ts +3 -0
  85. package/build/stories/icons/index.stories.d.ts +2 -2
  86. package/build/stories/info-cards/index.stories.d.ts +3 -3
  87. package/build/stories/label/index.d.ts +9 -7
  88. package/build/stories/label/index.stories.d.ts +3 -3
  89. package/build/stories/lightbox/index.stories.d.ts +2 -2
  90. package/build/stories/lightbox/parts/body.d.ts +18 -12
  91. package/build/stories/lightbox/parts/footer.d.ts +7 -5
  92. package/build/stories/loaders/dots/index.stories.d.ts +2 -2
  93. package/build/stories/loaders/progress/index.stories.d.ts +2 -2
  94. package/build/stories/loaders/skeleton/index.stories.d.ts +3 -3
  95. package/build/stories/loaders/spinner/index.stories.d.ts +2 -2
  96. package/build/stories/login-form/index.stories.d.ts +3 -3
  97. package/build/stories/logo/index.stories.d.ts +2 -2
  98. package/build/stories/modals/fullscreen/index.d.ts +40 -32
  99. package/build/stories/modals/fullscreen/index.stories.d.ts +2 -2
  100. package/build/stories/modals/index.d.ts +8 -6
  101. package/build/stories/modals/index.stories.d.ts +5 -5
  102. package/build/stories/multiselect/index.stories.d.ts +3 -3
  103. package/build/stories/navigation/app-header/index.stories.d.ts +3 -3
  104. package/build/stories/navigation/header/header-item/brandItem.d.ts +9 -7
  105. package/build/stories/navigation/nav/nav-item/accordionItem.d.ts +3 -1
  106. package/build/stories/navigation/page-header/index.d.ts +38 -26
  107. package/build/stories/navigation/page-header/index.stories.d.ts +5 -5
  108. package/build/stories/navigation/page-header/styled/main.d.ts +40 -28
  109. package/build/stories/notifications/index.stories.d.ts +3 -3
  110. package/build/stories/pagination/index.stories.d.ts +3 -3
  111. package/build/stories/player/_types.d.ts +38 -1
  112. package/build/stories/player/context/progressContext.d.ts +16 -0
  113. package/build/stories/player/hooks/usePictureInPicture.d.ts +4 -0
  114. package/build/stories/player/index.d.ts +7 -2
  115. package/build/stories/player/index.stories.d.ts +7 -5
  116. package/build/stories/player/parts/CutStart.d.ts +4 -0
  117. package/build/stories/player/parts/bookmark.d.ts +2 -0
  118. package/build/stories/player/parts/controlButton.d.ts +291 -0
  119. package/build/stories/player/parts/controls.d.ts +14 -6
  120. package/build/stories/player/parts/controlsCenterGroup.d.ts +2 -1
  121. package/build/stories/player/parts/cutterButton.d.ts +6 -0
  122. package/build/stories/player/parts/floatingControls.d.ts +1 -0
  123. package/build/stories/player/parts/progress.d.ts +11 -0
  124. package/build/stories/player/parts/timeLabel.d.ts +2 -2
  125. package/build/stories/product-cards/index.stories.d.ts +3 -3
  126. package/build/stories/profile-modal/components/menuItem.d.ts +6 -4
  127. package/build/stories/profile-modal/index.stories.d.ts +2 -2
  128. package/build/stories/service-cards/index.stories.d.ts +3 -3
  129. package/build/stories/slider/index.stories.d.ts +3 -3
  130. package/build/stories/slider/parts/container.d.ts +6 -4
  131. package/build/stories/special-cards/index.d.ts +42 -30
  132. package/build/stories/special-cards/index.stories.d.ts +2 -2
  133. package/build/stories/special-cards/styled/header.d.ts +33 -21
  134. package/build/stories/stepper/index.d.ts +27 -21
  135. package/build/stories/stepper/index.stories.d.ts +3 -3
  136. package/build/stories/table/index.stories.d.ts +11 -11
  137. package/build/stories/tabs/index.stories.d.ts +3 -3
  138. package/build/stories/tags/index.d.ts +24 -20
  139. package/build/stories/tags/index.stories.d.ts +6 -6
  140. package/build/stories/theme/palette.stories.d.ts +1 -1
  141. package/build/stories/tiles/index.stories.d.ts +4 -4
  142. package/build/stories/timeline/index.d.ts +11 -7
  143. package/build/stories/timeline/index.stories.d.ts +4 -4
  144. package/build/stories/title/index.stories.d.ts +2 -2
  145. package/build/stories/tooltip/_types.d.ts +1 -0
  146. package/build/stories/tooltip/index.d.ts +8 -5
  147. package/build/stories/tooltip/index.stories.d.ts +3 -2
  148. package/build/stories/tooltip-modal/index.stories.d.ts +2 -2
  149. package/build/stories/typography/block-quote/index.stories.d.ts +2 -2
  150. package/build/stories/typography/code/index.stories.d.ts +4 -4
  151. package/build/stories/typography/ellipsis/index.stories.d.ts +2 -2
  152. package/build/stories/typography/lists/ordered.stories.d.ts +2 -2
  153. package/build/stories/typography/lists/unordered.stories.d.ts +2 -2
  154. package/build/stories/typography/paragraph/index.stories.d.ts +2 -2
  155. package/build/stories/typography/span/index.stories.d.ts +2 -2
  156. package/build/stories/typography/typescale/anchortag/index.stories.d.ts +2 -2
  157. package/build/stories/typography/typescale/index.d.ts +26 -12
  158. package/build/stories/typography/typescale/index.stories.d.ts +2 -2
  159. package/package.json +20 -13
  160. package/yarn-error.log +13975 -0
  161. package/.vscode/settings.json +0 -3
  162. package/build/stories/chat/parts/ThumbnailContainer/ImageThumbnail.d.ts +0 -11
  163. package/build/stories/chat/parts/ThumbnailContainer/VideoThumbnail.d.ts +0 -11
  164. /package/build/stories/player/{parts/utils.d.ts → utils.d.ts} +0 -0
package/build/index.js CHANGED
@@ -21,12 +21,13 @@ var bullet = require('@nivo/bullet');
21
21
  var web = require('@react-spring/web');
22
22
  var tooltip = require('@nivo/tooltip');
23
23
  var pie = require('@nivo/pie');
24
+ var line = require('@nivo/line');
24
25
  var sunburst = require('@nivo/sunburst');
25
26
  var waffle = require('@nivo/waffle');
26
- var line = require('@nivo/line');
27
27
  var reactForms = require('@zendeskgarden/react-forms');
28
28
  var react = require('@tiptap/react');
29
29
  var reactTooltips = require('@zendeskgarden/react-tooltips');
30
+ var uuid = require('uuid');
30
31
  var Typography = require('@tiptap/extension-typography');
31
32
  var Link = require('@tiptap/extension-link');
32
33
  var StarterKit = require('@tiptap/starter-kit');
@@ -37,10 +38,10 @@ var Mention = require('@tiptap/extension-mention');
37
38
  var tippy = require('tippy.js');
38
39
  var Image$2 = require('@tiptap/extension-image');
39
40
  var Dropcursor = require('@tiptap/extension-dropcursor');
40
- var reactGrid = require('@zendeskgarden/react-grid');
41
41
  var reactModals = require('@zendeskgarden/react-modals');
42
42
  var SlickSlider = require('react-slick');
43
43
  var Video = require('@appquality/stream-player');
44
+ var reactGrid = require('@zendeskgarden/react-grid');
44
45
  var containerUtilities = require('@zendeskgarden/container-utilities');
45
46
  var reactColorpickers = require('@zendeskgarden/react-colorpickers');
46
47
  var reactDropdowns = require('@zendeskgarden/react-dropdowns');
@@ -48,6 +49,10 @@ var formik = require('formik');
48
49
  var reactChrome = require('@zendeskgarden/react-chrome');
49
50
  var reactPagination = require('@zendeskgarden/react-pagination');
50
51
  var reactTables = require('@zendeskgarden/react-tables');
52
+ var SearchAndReplace = require('@sereneinserenade/tiptap-search-and-replace');
53
+ var Document = require('@tiptap/extension-document');
54
+ var Text$2 = require('@tiptap/extension-text');
55
+ var model = require('@tiptap/pm/model');
51
56
 
52
57
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
53
58
 
@@ -84,6 +89,9 @@ var Image__default = /*#__PURE__*/_interopDefaultLegacy(Image$2);
84
89
  var Dropcursor__default = /*#__PURE__*/_interopDefaultLegacy(Dropcursor);
85
90
  var SlickSlider__default = /*#__PURE__*/_interopDefaultLegacy(SlickSlider);
86
91
  var Video__default = /*#__PURE__*/_interopDefaultLegacy(Video);
92
+ var SearchAndReplace__default = /*#__PURE__*/_interopDefaultLegacy(SearchAndReplace);
93
+ var Document__default = /*#__PURE__*/_interopDefaultLegacy(Document);
94
+ var Text__default = /*#__PURE__*/_interopDefaultLegacy(Text$2);
87
95
 
88
96
  /*
89
97
  * Design principles https://garden.zendesk.com/design/color (accessed 28 apr 2023)
@@ -290,7 +298,12 @@ function __awaiter(thisArg, _arguments, P, generator) {
290
298
  function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
291
299
  step((generator = generator.apply(thisArg, _arguments || [])).next());
292
300
  });
293
- }
301
+ }
302
+
303
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
304
+ var e = new Error(message);
305
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
306
+ };
294
307
 
295
308
  const fontWeights = Object.assign(Object.assign({}, reactTheming.DEFAULT_THEME.fontWeights), { semibold: 500 });
296
309
 
@@ -333,8 +346,8 @@ const UgContainerCard = styled__default["default"](reactNotifications.Well) `
333
346
  `;
334
347
  const ContainerCard = (props) => jsxRuntime.jsx(UgContainerCard, Object.assign({}, props));
335
348
 
336
- var _a, _b, _c, _d, _e, _f, _g$c, _h;
337
- const components = Object.assign(Object.assign(Object.assign(Object.assign({}, reactTheming.DEFAULT_THEME.components), { chrome: Object.assign(Object.assign({}, (_a = reactTheming.DEFAULT_THEME.components) === null || _a === void 0 ? void 0 : _a.chrome), { header: Object.assign(Object.assign({}, (_c = (_b = reactTheming.DEFAULT_THEME.components) === null || _b === void 0 ? void 0 : _b.chrome) === null || _c === void 0 ? void 0 : _c.header), { height: "64px" }), nav: Object.assign(Object.assign({}, (_e = (_d = reactTheming.DEFAULT_THEME.components) === null || _d === void 0 ? void 0 : _d.chrome) === null || _e === void 0 ? void 0 : _e.nav), { openWidth: 240, closedWidth: 36, workspaceDropdownWidth: 192 }) }), notification: Object.assign(Object.assign({}, (_f = reactTheming.DEFAULT_THEME.components) === null || _f === void 0 ? void 0 : _f.notification), { card: Object.assign(Object.assign({}, (_h = (_g$c = reactTheming.DEFAULT_THEME.components) === null || _g$c === void 0 ? void 0 : _g$c.notification) === null || _h === void 0 ? void 0 : _h.well), { padding: "16px" }) }) }), cardCmponentStyle), { "text.primary": () => ({
349
+ var _a, _b, _c, _d, _e, _f, _g$d, _h;
350
+ const components = Object.assign(Object.assign(Object.assign(Object.assign({}, reactTheming.DEFAULT_THEME.components), { chrome: Object.assign(Object.assign({}, (_a = reactTheming.DEFAULT_THEME.components) === null || _a === void 0 ? void 0 : _a.chrome), { header: Object.assign(Object.assign({}, (_c = (_b = reactTheming.DEFAULT_THEME.components) === null || _b === void 0 ? void 0 : _b.chrome) === null || _c === void 0 ? void 0 : _c.header), { height: "64px" }), nav: Object.assign(Object.assign({}, (_e = (_d = reactTheming.DEFAULT_THEME.components) === null || _d === void 0 ? void 0 : _d.chrome) === null || _e === void 0 ? void 0 : _e.nav), { openWidth: 240, closedWidth: 36, workspaceDropdownWidth: 192 }) }), notification: Object.assign(Object.assign({}, (_f = reactTheming.DEFAULT_THEME.components) === null || _f === void 0 ? void 0 : _f.notification), { card: Object.assign(Object.assign({}, (_h = (_g$d = reactTheming.DEFAULT_THEME.components) === null || _g$d === void 0 ? void 0 : _g$d.notification) === null || _h === void 0 ? void 0 : _h.well), { padding: "16px" }) }) }), cardCmponentStyle), { "text.primary": () => ({
338
351
  color: getColor(colors.primaryHue, 600),
339
352
  }), "text.success": () => ({
340
353
  color: getColor(colors.successHue, 700),
@@ -641,6 +654,15 @@ Alert.Close = reactNotifications.Close;
641
654
 
642
655
  var img$2 = "data:image/svg+xml,%3csvg width='26' height='26' viewBox='0 0 26 26' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M17.2597 12.9199V14.767H17.2367C17.075 17.4452 15.5974 18.969 13.127 18.969C10.4949 18.969 8.92496 17.4452 8.76335 14.767H8.74026V12.9199H5V14.767V14.7901C5.20779 19.4538 8.34777 22.4322 13.1039 22.4322C17.8139 22.4322 20.7922 19.5231 21 14.7901V12.9199H17.2597Z' fill='%23003A57'/%3e%3cpath d='M8.78629 3.5H5.02295V7.26335H8.78629V3.5Z' fill='%2370C38A'/%3e%3cpath d='M20.9768 3.5H17.1672V7.30952H20.9768V3.5Z' fill='%23003A57'/%3e%3c/svg%3e";
643
656
 
657
+ const StyledInternalAvatar = styled__default["default"].div `
658
+ display: flex;
659
+ align-items: center;
660
+ justify-content: center;
661
+ `;
662
+ const InternalAvatar = () => {
663
+ return (jsxRuntime.jsx(StyledInternalAvatar, { children: jsxRuntime.jsx("img", { alt: "avatar", src: img$2 }) }));
664
+ };
665
+
644
666
  const UgAvatar = styled__default["default"](reactAvatars.Avatar) `
645
667
  text-transform: uppercase;
646
668
 
@@ -672,7 +694,7 @@ const Avatar = (_a) => {
672
694
  if (type === "text")
673
695
  return jsxRuntime.jsx(Avatar.Text, { children: props.children });
674
696
  if (type === "system")
675
- return jsxRuntime.jsx("img", { alt: "avatar", src: img$2 });
697
+ return jsxRuntime.jsx(InternalAvatar, {});
676
698
  };
677
699
  return (jsxRuntime.jsx(UgAvatar, Object.assign({}, props, { badge: fixedBadge, isSystem: props.avatarType === "system" || isSystem, children: wrapChildren(props.avatarType || "text"), size: props.size || "small" })));
678
700
  };
@@ -841,48 +863,48 @@ Tag.Avatar = StyledAvatar;
841
863
  Tag.Close = StyledClose;
842
864
  Tag.SecondaryText = StyledSpan;
843
865
 
844
- var _path$E;
845
- function _extends$Q() { _extends$Q = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$Q.apply(this, arguments); }
846
- const SvgUgSquare = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$Q({
866
+ var _path$G;
867
+ function _extends$T() { return _extends$T = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$T.apply(null, arguments); }
868
+ const SvgUgSquare = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$T({
847
869
  width: 24,
848
870
  height: 24,
849
871
  viewBox: "0 0 24 24",
850
872
  fill: "none",
851
873
  xmlns: "http://www.w3.org/2000/svg"
852
- }, props), _path$E || (_path$E = /*#__PURE__*/React__namespace.createElement("path", {
874
+ }, props), _path$G || (_path$G = /*#__PURE__*/React__namespace.createElement("path", {
853
875
  d: "M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM18 19H6C5.45 19 5 18.55 5 18V6C5 5.45 5.45 5 6 5H18C18.55 5 19 5.45 19 6V18C19 18.55 18.55 19 18 19Z",
854
876
  fill: "#E80C7A"
855
877
  })));
856
878
 
857
- var _path$D;
858
- function _extends$P() { _extends$P = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$P.apply(this, arguments); }
859
- const SvgUgCircle = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$P({
879
+ var _path$F;
880
+ function _extends$S() { return _extends$S = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$S.apply(null, arguments); }
881
+ const SvgUgCircle = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$S({
860
882
  width: 24,
861
883
  height: 24,
862
884
  viewBox: "0 0 24 24",
863
885
  fill: "none",
864
886
  xmlns: "http://www.w3.org/2000/svg"
865
- }, props), _path$D || (_path$D = /*#__PURE__*/React__namespace.createElement("path", {
887
+ }, props), _path$F || (_path$F = /*#__PURE__*/React__namespace.createElement("path", {
866
888
  d: "M12 2C6.47 2 2 6.47 2 12C2 17.53 6.47 22 12 22C17.53 22 22 17.53 22 12C22 6.47 17.53 2 12 2ZM12 20C7.58 20 4 16.42 4 12C4 7.58 7.58 4 12 4C16.42 4 20 7.58 20 12C20 16.42 16.42 20 12 20Z",
867
889
  fill: "#FFCD1A"
868
890
  })));
869
891
 
870
- var _path$C;
871
- function _extends$O() { _extends$O = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$O.apply(this, arguments); }
872
- const SvgUgTriangle = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$O({
892
+ var _path$E;
893
+ function _extends$R() { return _extends$R = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$R.apply(null, arguments); }
894
+ const SvgUgTriangle = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$R({
873
895
  width: 24,
874
896
  height: 24,
875
897
  viewBox: "0 0 24 24",
876
898
  fill: "none",
877
899
  xmlns: "http://www.w3.org/2000/svg"
878
- }, props), _path$C || (_path$C = /*#__PURE__*/React__namespace.createElement("path", {
900
+ }, props), _path$E || (_path$E = /*#__PURE__*/React__namespace.createElement("path", {
879
901
  d: "M11.9993 7.32625L18.3893 17.5563H5.60929L11.9993 7.32625ZM11.1493 4.91625L2.94929 18.0262C2.53929 18.6962 3.01929 19.5563 3.79929 19.5563H20.1993C20.9893 19.5563 21.4593 18.6962 21.0493 18.0262L12.8493 4.91625C12.4593 4.28625 11.5393 4.28625 11.1493 4.91625Z",
880
902
  fill: "#7B0DFF"
881
903
  })));
882
904
 
883
- var _rect$4, _path$B, _path2$c, _path3$4;
884
- function _extends$N() { _extends$N = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$N.apply(this, arguments); }
885
- const SvgCampaignCompleted = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$N({
905
+ var _rect$4, _path$D, _path2$c, _path3$4;
906
+ function _extends$Q() { return _extends$Q = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$Q.apply(null, arguments); }
907
+ const SvgCampaignCompleted = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$Q({
886
908
  width: 24,
887
909
  height: 24,
888
910
  viewBox: "0 0 24 24",
@@ -893,7 +915,7 @@ const SvgCampaignCompleted = props => /*#__PURE__*/React__namespace.createElemen
893
915
  height: 24,
894
916
  rx: 12,
895
917
  fill: "#F6F6F8"
896
- })), _path$B || (_path$B = /*#__PURE__*/React__namespace.createElement("path", {
918
+ })), _path$D || (_path$D = /*#__PURE__*/React__namespace.createElement("path", {
897
919
  d: "M20.6953 5.73905C21.0148 5.41953 21.0148 4.90149 20.6953 4.58197C20.3758 4.26245 19.8577 4.26245 19.5382 4.58197L11.88 12.2402L10.0849 9.95981C9.80539 9.60476 9.29098 9.54352 8.93593 9.82303C8.58088 10.1025 8.51963 10.6169 8.79914 10.972L11.1642 13.9763C11.3089 14.16 11.5252 14.2731 11.7586 14.2869C11.9921 14.3008 12.2203 14.2141 12.3856 14.0487L20.6953 5.73905Z",
898
920
  fill: "#50BF95"
899
921
  })), _path2$c || (_path2$c = /*#__PURE__*/React__namespace.createElement("path", {
@@ -904,9 +926,9 @@ const SvgCampaignCompleted = props => /*#__PURE__*/React__namespace.createElemen
904
926
  fill: "#007345"
905
927
  })));
906
928
 
907
- var _rect$3, _path$A, _path2$b;
908
- function _extends$M() { _extends$M = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$M.apply(this, arguments); }
909
- const SvgCampaignLocked = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$M({
929
+ var _rect$3, _path$C, _path2$b;
930
+ function _extends$P() { return _extends$P = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$P.apply(null, arguments); }
931
+ const SvgCampaignLocked = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$P({
910
932
  width: 24,
911
933
  height: 24,
912
934
  viewBox: "0 0 24 24",
@@ -917,7 +939,7 @@ const SvgCampaignLocked = props => /*#__PURE__*/React__namespace.createElement("
917
939
  height: 24,
918
940
  rx: 12,
919
941
  fill: "#F6F6F8"
920
- })), _path$A || (_path$A = /*#__PURE__*/React__namespace.createElement("path", {
942
+ })), _path$C || (_path$C = /*#__PURE__*/React__namespace.createElement("path", {
921
943
  fillRule: "evenodd",
922
944
  clipRule: "evenodd",
923
945
  d: "M13.55 19.0875C14.25 19.7875 15.1063 20.1375 16.1188 20.1375C17.1313 20.1375 17.9875 19.7875 18.6875 19.0875C19.3875 18.3875 19.7375 17.5312 19.7375 16.5187C19.7375 15.5062 19.3875 14.65 18.6875 13.95C17.9875 13.25 17.1313 12.9 16.1188 12.9C15.1063 12.9 14.25 13.25 13.55 13.95C12.85 14.65 12.5 15.5062 12.5 16.5187C12.5 17.5312 12.85 18.3875 13.55 19.0875ZM17.5062 18.2812C17.4187 18.2812 17.3375 18.25 17.2625 18.1875L15.7438 16.7812C15.6813 16.6687 15.65 16.6 15.65 16.575V14.55C15.65 14.4375 15.6875 14.3437 15.7625 14.2687C15.8375 14.1937 15.9313 14.1562 16.0438 14.1562C16.1563 14.1562 16.25 14.1937 16.325 14.2687C16.4 14.3437 16.4375 14.4375 16.4375 14.55V16.4813L17.7313 17.6625C17.8063 17.725 17.8469 17.8062 17.8531 17.9062C17.8594 18.0063 17.825 18.0938 17.75 18.1688C17.675 18.2438 17.5937 18.2812 17.5062 18.2812Z",
@@ -929,9 +951,9 @@ const SvgCampaignLocked = props => /*#__PURE__*/React__namespace.createElement("
929
951
  fill: "#F4AC1A"
930
952
  })));
931
953
 
932
- var _rect$2, _path$z, _path2$a;
933
- function _extends$L() { _extends$L = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$L.apply(this, arguments); }
934
- const SvgCampaignIncoming = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$L({
954
+ var _rect$2, _path$B, _path2$a;
955
+ function _extends$O() { return _extends$O = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$O.apply(null, arguments); }
956
+ const SvgCampaignIncoming = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$O({
935
957
  width: 24,
936
958
  height: 24,
937
959
  viewBox: "0 0 24 24",
@@ -942,7 +964,7 @@ const SvgCampaignIncoming = props => /*#__PURE__*/React__namespace.createElement
942
964
  height: 24,
943
965
  rx: 12,
944
966
  fill: "#F6F6F8"
945
- })), _path$z || (_path$z = /*#__PURE__*/React__namespace.createElement("path", {
967
+ })), _path$B || (_path$B = /*#__PURE__*/React__namespace.createElement("path", {
946
968
  d: "M11.2266 13.0313H14.997M11.2266 9.26075V13.0313V9.26075ZM11.2266 13.0313L20.121 5.03906L11.2266 13.0313Z",
947
969
  stroke: "#024780",
948
970
  strokeWidth: 1.5,
@@ -956,9 +978,9 @@ const SvgCampaignIncoming = props => /*#__PURE__*/React__namespace.createElement
956
978
  strokeLinejoin: "round"
957
979
  })));
958
980
 
959
- var _rect$1, _path$y, _path2$9, _path3$3, _path4$1, _path5$1, _path6$1, _path7$1, _path8$1, _path9$1, _path10$1;
960
- function _extends$K() { _extends$K = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$K.apply(this, arguments); }
961
- const SvgCampaignProgress = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$K({
981
+ var _rect$1, _path$A, _path2$9, _path3$3, _path4$1, _path5$1, _path6$1, _path7$1, _path8$1, _path9$1, _path10$1;
982
+ function _extends$N() { return _extends$N = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$N.apply(null, arguments); }
983
+ const SvgCampaignProgress = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$N({
962
984
  width: 24,
963
985
  height: 24,
964
986
  viewBox: "0 0 24 24",
@@ -969,7 +991,7 @@ const SvgCampaignProgress = props => /*#__PURE__*/React__namespace.createElement
969
991
  height: 24,
970
992
  rx: 12,
971
993
  fill: "#F6F6F8"
972
- })), _path$y || (_path$y = /*#__PURE__*/React__namespace.createElement("path", {
994
+ })), _path$A || (_path$A = /*#__PURE__*/React__namespace.createElement("path", {
973
995
  d: "M13.059 16.7647C13.059 16.1799 12.585 15.7059 12.0002 15.7059C11.4154 15.7059 10.9414 16.1799 10.9414 16.7647V19.9412C10.9414 20.5259 11.4154 21 12.0002 21C12.585 21 13.059 20.5259 13.059 19.9412V16.7647Z",
974
996
  fill: "#D1820A"
975
997
  })), _path2$9 || (_path2$9 = /*#__PURE__*/React__namespace.createElement("path", {
@@ -1001,21 +1023,21 @@ const SvgCampaignProgress = props => /*#__PURE__*/React__namespace.createElement
1001
1023
  fill: "#FFB65A"
1002
1024
  })));
1003
1025
 
1004
- var _g$b, _path$x, _path2$8, _path3$2, _path4, _path5, _path6, _path7, _path8, _path9, _path10, _path11;
1005
- function _extends$J() { _extends$J = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$J.apply(this, arguments); }
1006
- const SvgCampaignExperiential = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$J({
1026
+ var _g$c, _path$z, _path2$8, _path3$2, _path4, _path5, _path6, _path7, _path8, _path9, _path10, _path11;
1027
+ function _extends$M() { return _extends$M = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$M.apply(null, arguments); }
1028
+ const SvgCampaignExperiential = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$M({
1007
1029
  width: 24,
1008
1030
  height: 24,
1009
1031
  viewBox: "0 0 24 24",
1010
1032
  fill: "none",
1011
1033
  xmlns: "http://www.w3.org/2000/svg"
1012
- }, props), _g$b || (_g$b = /*#__PURE__*/React__namespace.createElement("g", {
1034
+ }, props), _g$c || (_g$c = /*#__PURE__*/React__namespace.createElement("g", {
1013
1035
  opacity: 0.3
1014
1036
  }, /*#__PURE__*/React__namespace.createElement("path", {
1015
1037
  opacity: 0.3,
1016
1038
  d: "M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24Z",
1017
1039
  fill: "#50BF95"
1018
- }))), _path$x || (_path$x = /*#__PURE__*/React__namespace.createElement("path", {
1040
+ }))), _path$z || (_path$z = /*#__PURE__*/React__namespace.createElement("path", {
1019
1041
  d: "M12.487 3.19652C8.68003 3.19652 5.59895 6.27761 5.59895 10.0846C5.59895 10.2597 5.59895 10.4348 5.62438 10.5855C5.29857 11.1863 4.82307 12.013 4.24678 12.514C3.82117 12.8897 3.92096 13.2908 3.97085 13.4405C4.09609 13.7663 4.44635 14.0413 5.02265 14.2418C5.22322 14.3172 5.44825 14.3671 5.64883 14.417L5.67427 16.8464C5.67427 17.7984 6.47559 18.6251 7.45304 18.6251L8.93044 18.1496L9.08111 19.0263C9.18091 19.6026 9.68185 20.0282 10.2836 20.0282C10.3589 20.0282 10.4343 20.0282 10.5086 20.0028L15.1424 19.177C15.8185 19.0517 16.2441 18.4256 16.1443 17.7495L15.8185 16.1214C17.9974 14.9189 19.375 12.5892 19.375 10.0845C19.375 6.30279 16.2696 3.19641 12.4869 3.19641L12.487 3.19652Z",
1020
1042
  fill: "#2B8473",
1021
1043
  stroke: "#2B8473"
@@ -1071,21 +1093,21 @@ const SvgCampaignExperiential = props => /*#__PURE__*/React__namespace.createEle
1071
1093
  fill: "#ECF4F2"
1072
1094
  })));
1073
1095
 
1074
- var _g$a, _path$w;
1075
- function _extends$I() { _extends$I = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$I.apply(this, arguments); }
1076
- const SvgCampaignFunctional = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$I({
1096
+ var _g$b, _path$y;
1097
+ function _extends$L() { return _extends$L = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$L.apply(null, arguments); }
1098
+ const SvgCampaignFunctional = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$L({
1077
1099
  width: 24,
1078
1100
  height: 24,
1079
1101
  viewBox: "0 0 24 24",
1080
1102
  fill: "none",
1081
1103
  xmlns: "http://www.w3.org/2000/svg"
1082
- }, props), _g$a || (_g$a = /*#__PURE__*/React__namespace.createElement("g", {
1104
+ }, props), _g$b || (_g$b = /*#__PURE__*/React__namespace.createElement("g", {
1083
1105
  opacity: 0.3
1084
1106
  }, /*#__PURE__*/React__namespace.createElement("path", {
1085
1107
  opacity: 0.3,
1086
1108
  d: "M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24Z",
1087
1109
  fill: "#003A57"
1088
- }))), _path$w || (_path$w = /*#__PURE__*/React__namespace.createElement("path", {
1110
+ }))), _path$y || (_path$y = /*#__PURE__*/React__namespace.createElement("path", {
1089
1111
  d: "M17.9983 7.16705C17.5188 6.58566 17.1422 6.73039 17.1422 6.73039C17.1422 6.73039 16.406 7.02453 16.0401 7.16303C15.6742 7.30153 15.2408 7.17357 15.2408 7.17357L14.7579 6.8851C14.7579 6.8851 14.4296 6.56554 14.3656 6.18067C14.3123 5.78958 14.1888 5.00269 14.1888 5.00269C14.1888 5.00269 14.1356 4.61159 13.3938 4.47257C12.652 4.33356 12.4678 4.68715 12.4678 4.68715C12.4678 4.68715 12.0932 5.38344 11.9091 5.73703C11.7249 6.09062 11.3114 6.27118 11.3114 6.27118L10.7639 6.36908C10.7639 6.36908 10.3144 6.33771 10.0176 6.07271L9.12712 5.27769C9.12712 5.27769 8.8303 5.01268 8.18313 5.38632C7.53595 5.75997 7.61705 6.14953 7.61705 6.14953L7.86033 7.3182C7.94143 7.70776 7.74381 8.11275 7.74381 8.11275L7.38528 8.53794C7.38528 8.53794 7.02217 8.80577 6.62387 8.78845C6.22557 8.77114 5.43527 8.7474 5.43527 8.7474C5.43527 8.7474 5.03697 8.73009 4.78646 9.44201C4.53595 10.1539 4.84804 10.3956 4.84804 10.3956C4.84804 10.3956 5.46774 10.896 5.77983 11.1376C6.09192 11.3793 6.19373 11.8296 6.19373 11.8296L6.20207 12.3921C6.20207 12.3921 6.09618 12.8314 5.79331 13.079C5.49043 13.3266 4.86759 13.8171 4.86759 13.8171C4.86759 13.8171 4.56471 14.0647 4.81769 14.7769C5.08144 15.4828 5.46713 15.4783 5.46713 15.4783C5.46713 15.4783 6.26012 15.4569 6.64582 15.4524C7.03152 15.4479 7.40116 15.7145 7.40116 15.7145L7.76458 16.1447C7.76458 16.1447 7.96976 16.5499 7.89441 16.9425C7.81907 17.3351 7.66208 18.1094 7.66208 18.1094C7.66208 18.1094 7.58674 18.502 8.23785 18.8824C8.88895 19.2629 9.18553 19.0044 9.18553 19.0044C9.18553 19.0044 9.7724 18.4765 10.069 18.218C10.3655 17.9595 10.8115 17.9347 10.8115 17.9347L11.3609 18.0394C11.3609 18.0394 11.77 18.225 11.9608 18.5803C12.1516 18.9356 12.5268 19.6354 12.5268 19.6354C12.5268 19.6354 12.7176 19.9907 13.4583 19.8539C14.1946 19.7343 14.2529 19.337 14.2529 19.337C14.2529 19.337 14.3586 18.5487 14.4232 18.1623C14.4814 17.765 14.8086 17.4598 14.8086 17.4598L15.2939 17.1796C15.2939 17.1796 15.7281 17.0598 16.095 17.1971C16.4682 17.3453 17.1975 17.637 17.1975 17.637C17.1975 17.637 17.5707 17.7851 18.0424 17.2073C18.5142 16.6295 18.3189 16.2913 18.3189 16.2913C18.3189 16.2913 17.9006 15.6164 17.6882 15.2736C17.4759 14.9307 17.5197 14.4836 17.5197 14.4836L17.7038 13.9555C17.7038 13.9555 17.9482 13.5816 18.3203 13.454C18.6925 13.3264 19.4431 13.0822 19.4431 13.0822C19.4431 13.0822 19.8153 12.9546 19.8113 12.2005C19.8074 11.4464 19.4297 11.3153 19.4297 11.3153C19.4297 11.3153 18.6807 11.0641 18.303 10.9331C17.9253 10.802 17.677 10.4217 17.677 10.4217L17.4861 9.8919C17.4861 9.8919 17.4293 9.4447 17.6368 9.1067C17.8443 8.7687 18.2486 8.09891 18.2486 8.09891C18.2486 8.09891 18.4778 7.74844 17.9983 7.16707L17.9983 7.16705ZM9.33902 8.38466L10.6176 10.5992C10.0433 11.149 9.82793 11.9715 10.0567 12.7413L7.86713 14.0054C6.98868 12.0106 7.60355 9.66286 9.33905 8.38457L9.33902 8.38466ZM13.9748 16.414C11.9998 17.2778 9.65918 16.6363 8.37099 14.8783L10.5605 13.6141C11.1128 14.1971 11.9329 14.4219 12.6961 14.1994L13.9748 16.414ZM12.6552 13.132C12.1159 13.4434 11.4325 13.2561 11.1176 12.7107C10.8027 12.1652 10.9822 11.4797 11.5215 11.1684C12.0608 10.857 12.7441 11.0443 13.0591 11.5897C13.374 12.1352 13.1945 12.8207 12.6552 13.132ZM14.8376 15.9158L13.5591 13.7012C14.1333 13.1515 14.3487 12.3289 14.12 11.5591L16.3095 10.295C17.188 12.2898 16.5731 14.6376 14.8376 15.9159L14.8376 15.9158ZM13.6161 10.6863C13.0638 10.1034 12.2437 9.87862 11.4805 10.1011L10.2019 7.88652C12.1769 7.02266 14.5112 7.65314 15.8057 9.42223L13.6161 10.6863Z",
1090
1112
  fill: "#003A57"
1091
1113
  })));
@@ -1188,7 +1210,7 @@ const TextDescription = (_a) => {
1188
1210
  : jsxRuntime.jsx(MD, Object.assign({ color: theme.palette.grey[700] }, props)));
1189
1211
  };
1190
1212
 
1191
- const Label$2 = styled__default["default"](SM) `
1213
+ const Label$3 = styled__default["default"](SM) `
1192
1214
  color: ${({ theme }) => theme.palette.grey[500]};
1193
1215
  `;
1194
1216
  const Title$2 = styled__default["default"](LG) `
@@ -1212,7 +1234,7 @@ const Container$3 = styled__default["default"].div `
1212
1234
  `}
1213
1235
  `;
1214
1236
  const CardHeader = (props) => jsxRuntime.jsx(Container$3, Object.assign({}, props));
1215
- CardHeader.Label = Label$2;
1237
+ CardHeader.Label = Label$3;
1216
1238
  CardHeader.Title = Title$2;
1217
1239
  CardHeader.Text = Description$2;
1218
1240
 
@@ -1727,59 +1749,6 @@ const BulletChart = ({ width, height, ranges, values }) => {
1727
1749
  }, tooltip: CustomTooltip, rangeColors: theme.palette.grey[200], rangeBorderColor: "white", rangeBorderWidth: 2, margin: { top: 0, right: 5, bottom: -1, left: 0 } }) })) })));
1728
1750
  };
1729
1751
 
1730
- const CenteredItem = ({ centerX, centerY, theme, radius, label, value, fontSizeMultiplier, }) => {
1731
- const parameter = 6;
1732
- const fontSizeFactor = ((fontSizeMultiplier ? fontSizeMultiplier : 1) * radius) / (14 * parameter);
1733
- const spacing = ((fontSizeMultiplier ? fontSizeMultiplier : 1) * radius) /
1734
- (parameter * 0.9);
1735
- const shift = -radius / (parameter * 2.5);
1736
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [label && (jsxRuntime.jsx("g", Object.assign({ transform: `translate(${centerX},${centerY})` }, { children: jsxRuntime.jsx("text", Object.assign({ textAnchor: "middle", baselineShift: shift + (value ? spacing : spacing / 2), fill: theme.palette.grey[600], style: {
1737
- fontSize: parseInt(theme.fontSizes.md.replace("px", "")) * fontSizeFactor,
1738
- } }, { children: label })) }))), value && (jsxRuntime.jsx("g", Object.assign({ transform: `translate(${centerX},${centerY})` }, { children: jsxRuntime.jsx("text", Object.assign({ textAnchor: "middle", baselineShift: shift - (label ? spacing : spacing / 2), fill: theme.palette.blue[600], style: {
1739
- fontSize: parseInt(theme.fontSizes.xxl.replace("px", "")) *
1740
- fontSizeFactor,
1741
- fontWeight: theme.fontWeights.semibold,
1742
- } }, { children: value })) })))] }));
1743
- };
1744
-
1745
- const PieChart = ({ theme, colors, width, height, data, centerItem, margin, tooltip, legend, arcLinkLabelsSkipAngle, labelFormatter, }) => {
1746
- var _a;
1747
- const themeContext = React.useContext(styled.ThemeContext);
1748
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ChartContainer, Object.assign({ width: width, height: height }, { children: jsxRuntime.jsx(pie.ResponsivePie, { theme: Object.assign({}, Object.assign(Object.assign(Object.assign({}, DEFAULT_CHARTS_THEME), theme), { labels: Object.assign(Object.assign({}, theme === null || theme === void 0 ? void 0 : theme.labels), { text: Object.assign({ fontWeight: themeContext.fontWeights.semibold, fill: themeContext.palette.grey[800] }, (_a = theme === null || theme === void 0 ? void 0 : theme.labels) === null || _a === void 0 ? void 0 : _a.text) }) })), colors: colors !== null && colors !== void 0 ? colors : CHARTS_COLOR_SCHEME_CATEGORICAL, enableArcLabels: false, arcLinkLabelsColor: { from: "color" }, arcLinkLabelsSkipAngle: arcLinkLabelsSkipAngle !== null && arcLinkLabelsSkipAngle !== void 0 ? arcLinkLabelsSkipAngle : 10, arcLinkLabelsThickness: 2, arcLinkLabel: (d) => labelFormatter
1749
- ? labelFormatter({
1750
- label: d.label,
1751
- id: d.id,
1752
- value: d.value,
1753
- data: d.data,
1754
- labelPosition: "arclink",
1755
- })
1756
- : (d.label || d.id).toString(), arcLinkLabelsDiagonalLength: 8, arcLinkLabelsStraightLength: 12, arcLinkLabelsTextOffset: 4, padAngle: 2, data: data, margin: Object.assign({ top: 40, bottom: 40 }, margin), tooltip: tooltip
1757
- ? (node) => {
1758
- const data = node.datum.data;
1759
- const label = (data === null || data === void 0 ? void 0 : data.label) || data.id;
1760
- const value = data.value;
1761
- return jsxRuntime.jsx(jsxRuntime.Fragment, { children: tooltip({ label, value, data }) });
1762
- }
1763
- : undefined, cornerRadius: 2, innerRadius: 0.8, layers: [
1764
- "arcs",
1765
- "arcLabels",
1766
- "arcLinkLabels",
1767
- ...(centerItem
1768
- ? [
1769
- (props) => (jsxRuntime.jsx(CenteredItem, Object.assign({}, props, { theme: themeContext, label: centerItem.label, value: centerItem.value, fontSizeMultiplier: centerItem.fontSizeMultiplier }))),
1770
- ]
1771
- : []),
1772
- ], activeOuterRadiusOffset: 12 }) })), jsxRuntime.jsx(ChartContainer, Object.assign({ width: width, height: "auto" }, { children: legend ? (jsxRuntime.jsx(Legend, Object.assign({ colors: colors !== null && colors !== void 0 ? colors : CHARTS_COLOR_SCHEME_CATEGORICAL, data: data.map((d) => labelFormatter
1773
- ? labelFormatter({
1774
- label: d.label,
1775
- id: d.id,
1776
- value: d.value,
1777
- data: d,
1778
- labelPosition: "legend",
1779
- })
1780
- : d.id.toString()) }, (typeof legend === "object" && legend)))) : undefined }))] }));
1781
- };
1782
-
1783
1752
  const AbsoluteChartContainer = styled__default["default"](ChartContainer) `
1784
1753
  position: absolute;
1785
1754
  left: 0;
@@ -1823,138 +1792,68 @@ const HalfPieChart = ({ theme, colors, width, height, data, margin, showArcLinks
1823
1792
  }, mode: "back" })] })));
1824
1793
  };
1825
1794
 
1826
- const flatten = (data) => data.reduce((acc, item) => {
1827
- if (item.children) {
1828
- return [...acc, item, ...flatten(item.children)];
1829
- }
1830
- return [...acc, item];
1831
- }, []);
1832
- const findChildrenByName = (data, name) => {
1833
- if (!data.children)
1834
- return undefined;
1835
- return flatten(data.children).find((searchedName) => searchedName.name === name);
1836
- };
1837
-
1838
- const getChildrenValue = (data) => {
1839
- if (data.value) {
1840
- return data.value;
1841
- }
1842
- if (data.children) {
1843
- return data.children.reduce((acc, item) => {
1844
- return acc + getChildrenValue(item);
1845
- }, 0);
1846
- }
1847
- return 0;
1795
+ const CenteredItem = ({ centerX, centerY, theme, radius, label, value, fontSizeMultiplier, }) => {
1796
+ const parameter = 6;
1797
+ const fontSizeFactor = ((fontSizeMultiplier ? fontSizeMultiplier : 1) * radius) / (14 * parameter);
1798
+ const spacing = ((fontSizeMultiplier ? fontSizeMultiplier : 1) * radius) /
1799
+ (parameter * 0.9);
1800
+ const shift = -radius / (parameter * 2.5);
1801
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [label && (jsxRuntime.jsx("g", Object.assign({ transform: `translate(${centerX},${centerY})` }, { children: jsxRuntime.jsx("text", Object.assign({ textAnchor: "middle", baselineShift: shift + (value ? spacing : spacing / 2), fill: theme.palette.grey[600], style: {
1802
+ fontSize: parseInt(theme.fontSizes.md.replace("px", "")) * fontSizeFactor,
1803
+ } }, { children: label })) }))), value && (jsxRuntime.jsx("g", Object.assign({ transform: `translate(${centerX},${centerY})` }, { children: jsxRuntime.jsx("text", Object.assign({ textAnchor: "middle", baselineShift: shift - (label ? spacing : spacing / 2), fill: theme.palette.blue[600], style: {
1804
+ fontSize: parseInt(theme.fontSizes.xxl.replace("px", "")) *
1805
+ fontSizeFactor,
1806
+ fontWeight: theme.fontWeights.semibold,
1807
+ } }, { children: value })) })))] }));
1848
1808
  };
1849
1809
 
1850
- const ResetText = styled__default["default"].text `
1851
- font-size: ${({ radius, theme }) => (parseInt(theme.fontSizes.md.replace("px", "")) * radius) / 130}px;
1852
- cursor: pointer;
1853
-
1854
- fill: ${({ theme }) => theme.palette.blue[500]};
1855
- &:hover {
1856
- fill: ${({ theme }) => theme.palette.blue[700]};
1857
- }
1858
- `;
1859
- const ResetButton = ({ centerX, centerY, radius, theme, onClick, }) => (jsxRuntime.jsx("g", Object.assign({ transform: `translate(${centerX - radius},${centerY - radius})` }, { children: jsxRuntime.jsx(ResetText, Object.assign({ onClick: onClick, radius: radius }, { children: `< Reset` })) })));
1860
-
1861
- const SunburstChart = ({ colors, width, height, data, centerItem, margin, onChange, tooltip, legend, }) => {
1810
+ const PieChart = ({ theme, colors, width, height, data, centerItem, margin, tooltip, legend, arcLinkLabelsSkipAngle, labelFormatter, }) => {
1811
+ var _a;
1862
1812
  const themeContext = React.useContext(styled.ThemeContext);
1863
- const [currentData, setCurrentData] = React.useState(data);
1864
- const [currentColor, setCurrentColor] = React.useState();
1865
- const [isHovering, setIsHovering] = React.useState(false);
1866
- const changeDataSlice = ({ data, color, }) => {
1867
- setCurrentData(data);
1868
- setCurrentColor(color);
1869
- };
1870
- React.useEffect(() => {
1871
- if (onChange)
1872
- onChange(currentData);
1873
- }, [currentData]);
1874
- if (!data.children)
1875
- return jsxRuntime.jsx(jsxRuntime.Fragment, { children: "No data" });
1876
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ChartContainer, Object.assign({ width: width, height: height, style: isHovering ? { cursor: "pointer" } : undefined }, { children: jsxRuntime.jsx(sunburst.ResponsiveSunburst, { theme: tooltip
1877
- ? Object.assign(Object.assign({}, DEFAULT_CHARTS_THEME), { tooltip: Object.assign(Object.assign({}, DEFAULT_CHARTS_THEME.tooltip), { container: {
1878
- padding: 0,
1879
- } }) }) : DEFAULT_CHARTS_THEME, colors: currentColor
1880
- ? () => currentColor
1881
- : colors !== null && colors !== void 0 ? colors : CHARTS_COLOR_SCHEME_CATEGORICAL, borderWidth: 4, cornerRadius: 4, onMouseEnter: (node) => {
1882
- if (node.data.children) {
1883
- setIsHovering(true);
1884
- }
1885
- }, onMouseLeave: (node) => {
1886
- if (node.data.children) {
1887
- setIsHovering(false);
1813
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ChartContainer, Object.assign({ width: width, height: height }, { children: jsxRuntime.jsx(pie.ResponsivePie, { theme: Object.assign({}, Object.assign(Object.assign(Object.assign({}, DEFAULT_CHARTS_THEME), theme), { labels: Object.assign(Object.assign({}, theme === null || theme === void 0 ? void 0 : theme.labels), { text: Object.assign({ fontWeight: themeContext.fontWeights.semibold, fill: themeContext.palette.grey[800] }, (_a = theme === null || theme === void 0 ? void 0 : theme.labels) === null || _a === void 0 ? void 0 : _a.text) }) })), colors: colors !== null && colors !== void 0 ? colors : CHARTS_COLOR_SCHEME_CATEGORICAL, enableArcLabels: false, arcLinkLabelsColor: { from: "color" }, arcLinkLabelsSkipAngle: arcLinkLabelsSkipAngle !== null && arcLinkLabelsSkipAngle !== void 0 ? arcLinkLabelsSkipAngle : 10, arcLinkLabelsThickness: 2, arcLinkLabel: (d) => labelFormatter
1814
+ ? labelFormatter({
1815
+ label: d.label,
1816
+ id: d.id,
1817
+ value: d.value,
1818
+ data: d.data,
1819
+ labelPosition: "arclink",
1820
+ })
1821
+ : (d.label || d.id).toString(), arcLinkLabelsDiagonalLength: 8, arcLinkLabelsStraightLength: 12, arcLinkLabelsTextOffset: 4, padAngle: 2, data: data, margin: Object.assign({ top: 40, bottom: 40 }, margin), tooltip: tooltip
1822
+ ? (node) => {
1823
+ const data = node.datum.data;
1824
+ const label = (data === null || data === void 0 ? void 0 : data.label) || data.id;
1825
+ const value = data.value;
1826
+ return jsxRuntime.jsx(jsxRuntime.Fragment, { children: tooltip({ label, value, data }) });
1888
1827
  }
1889
- }, tooltip: tooltip
1890
- ? (node) => (jsxRuntime.jsx(jsxRuntime.Fragment, { children: tooltip({
1891
- label: node.data.label || node.data.name,
1892
- value: getChildrenValue(node.data),
1893
- data: Object.assign(Object.assign({}, node.data), { children: undefined }),
1894
- }) }))
1895
- : undefined, layers: [
1828
+ : undefined, cornerRadius: 2, innerRadius: 0.8, layers: [
1896
1829
  "arcs",
1830
+ "arcLabels",
1831
+ "arcLinkLabels",
1897
1832
  ...(centerItem
1898
1833
  ? [
1899
- (props) => (jsxRuntime.jsx(CenteredItem, Object.assign({}, props, { fontSizeMultiplier: centerItem.fontSizeMultiplier, theme: themeContext, label: centerItem.label, value: centerItem.value }))),
1900
- ]
1901
- : []),
1902
- ...(currentColor
1903
- ? [
1904
- (props) => (jsxRuntime.jsx(ResetButton, { centerX: props.centerX, centerY: props.centerY, radius: props.radius, theme: themeContext, onClick: () => {
1905
- changeDataSlice({
1906
- data,
1907
- });
1908
- } })),
1834
+ (props) => (jsxRuntime.jsx(CenteredItem, Object.assign({}, props, { theme: themeContext, label: centerItem.label, value: centerItem.value, fontSizeMultiplier: centerItem.fontSizeMultiplier }))),
1909
1835
  ]
1910
1836
  : []),
1911
- ], id: "name", value: "value", margin: Object.assign({ top: 40, bottom: 40 }, margin), data: currentData, childColor: { from: "color", modifiers: [["brighter", 0.6]] }, onClick: (clickedData) => {
1912
- const foundObject = findChildrenByName(currentData, clickedData.id.toString());
1913
- if (foundObject && foundObject.children) {
1914
- changeDataSlice({
1915
- data: foundObject,
1916
- color: clickedData.color,
1917
- });
1918
- }
1919
- } }) })), jsxRuntime.jsx(ChartContainer, Object.assign({ width: width, height: "auto" }, { children: legend ? (jsxRuntime.jsx(Legend, Object.assign({ colors: colors !== null && colors !== void 0 ? colors : CHARTS_COLOR_SCHEME_CATEGORICAL, data: data.children.map((d) => d.label || d.name) }, (typeof legend === "object" && legend)))) : undefined }))] }));
1920
- };
1921
-
1922
- const CustomCell = ({ position, size, x, y, color, fill, opacity, borderWidth, borderColor, data, onHover, onLeave, onClick, }) => (jsxRuntime.jsx("circle", { r: size / 2, cx: x + size / 2, cy: y + size / 2, fill: fill || color, strokeWidth: borderWidth, stroke: borderColor, opacity: opacity, onMouseEnter: onHover, onMouseMove: onHover, onMouseLeave: onLeave, onClick: event => {
1923
- onClick({ position, color, x, y, data }, event);
1924
- } }));
1925
-
1926
- const WaffleChart = ({ height, width, data, total, tooltip, }) => {
1927
- return (jsxRuntime.jsx(ChartContainer, Object.assign({ width: width, height: height }, { children: jsxRuntime.jsx(waffle.ResponsiveWaffle, { theme: tooltip
1928
- ? Object.assign(Object.assign({}, DEFAULT_CHARTS_THEME), { tooltip: Object.assign(Object.assign({}, DEFAULT_CHARTS_THEME.tooltip), { container: {
1929
- padding: 0,
1930
- } }) }) : DEFAULT_CHARTS_THEME, data: [
1931
- {
1932
- id: "green-circles",
1933
- label: data.label,
1934
- value: data.value,
1935
- },
1936
- {
1937
- id: "grey-circles",
1938
- label: total.label,
1939
- value: total.value,
1940
- },
1941
- ], tooltip: ({ value, label }) => tooltip ? tooltip({ label, value }) : jsxRuntime.jsx(jsxRuntime.Fragment, { children: `${label}: ${value}` }), fillDirection: "bottom", total: total.value, rows: 6, columns: 8, colors: CHARTS_COLOR_SCHEME_MONO,
1942
- // @ts-ignore property cellComponent does not exist, but it does
1943
- cellComponent: (_a) => {
1944
- var rest = __rest(_a, ["borderWidth", "borderColor"]);
1945
- return (jsxRuntime.jsx(CustomCell, Object.assign({ borderWidth: 2, borderColor: "white" }, rest)));
1946
- } }) })));
1837
+ ], activeOuterRadiusOffset: 12 }) })), jsxRuntime.jsx(ChartContainer, Object.assign({ width: width, height: "auto" }, { children: legend ? (jsxRuntime.jsx(Legend, Object.assign({ colors: colors !== null && colors !== void 0 ? colors : CHARTS_COLOR_SCHEME_CATEGORICAL, data: data.map((d) => labelFormatter
1838
+ ? labelFormatter({
1839
+ label: d.label,
1840
+ id: d.id,
1841
+ value: d.value,
1842
+ data: d,
1843
+ labelPosition: "legend",
1844
+ })
1845
+ : d.id.toString()) }, (typeof legend === "object" && legend)))) : undefined }))] }));
1947
1846
  };
1948
1847
 
1949
- var _g$9, _defs$4;
1950
- function _extends$H() { _extends$H = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$H.apply(this, arguments); }
1951
- const SvgSentiment1 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$H({
1848
+ var _g$a, _defs$4;
1849
+ function _extends$K() { return _extends$K = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$K.apply(null, arguments); }
1850
+ const SvgSentiment1 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$K({
1952
1851
  width: 27,
1953
1852
  height: 26,
1954
1853
  viewBox: "0 0 27 26",
1955
1854
  fill: "none",
1956
1855
  xmlns: "http://www.w3.org/2000/svg"
1957
- }, props), _g$9 || (_g$9 = /*#__PURE__*/React__namespace.createElement("g", {
1856
+ }, props), _g$a || (_g$a = /*#__PURE__*/React__namespace.createElement("g", {
1958
1857
  clipPath: "url(#clip0_21_19131)"
1959
1858
  }, /*#__PURE__*/React__namespace.createElement("path", {
1960
1859
  d: "M26.5525 13C26.5525 20.1796 20.6084 26 13.2762 26C5.94481 26 0 20.1796 0 13C0 5.82111 5.94481 0 13.2762 0C20.6084 0 26.5525 5.82111 26.5525 13Z",
@@ -1970,15 +1869,15 @@ const SvgSentiment1 = props => /*#__PURE__*/React__namespace.createElement("svg"
1970
1869
  fill: "white"
1971
1870
  })))));
1972
1871
 
1973
- var _g$8, _defs$3;
1974
- function _extends$G() { _extends$G = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$G.apply(this, arguments); }
1975
- const SvgSentiment2 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$G({
1872
+ var _g$9, _defs$3;
1873
+ function _extends$J() { return _extends$J = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$J.apply(null, arguments); }
1874
+ const SvgSentiment2 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$J({
1976
1875
  width: 27,
1977
1876
  height: 26,
1978
1877
  viewBox: "0 0 27 26",
1979
1878
  fill: "none",
1980
1879
  xmlns: "http://www.w3.org/2000/svg"
1981
- }, props), _g$8 || (_g$8 = /*#__PURE__*/React__namespace.createElement("g", {
1880
+ }, props), _g$9 || (_g$9 = /*#__PURE__*/React__namespace.createElement("g", {
1982
1881
  clipPath: "url(#clip0_21_19130)"
1983
1882
  }, /*#__PURE__*/React__namespace.createElement("path", {
1984
1883
  d: "M26.5525 13C26.5525 20.1796 20.6084 26 13.2762 26C5.94481 26 0 20.1796 0 13C0 5.82111 5.94481 0 13.2762 0C20.6084 0 26.5525 5.82111 26.5525 13Z",
@@ -1994,15 +1893,15 @@ const SvgSentiment2 = props => /*#__PURE__*/React__namespace.createElement("svg"
1994
1893
  fill: "white"
1995
1894
  })))));
1996
1895
 
1997
- var _g$7, _defs$2;
1998
- function _extends$F() { _extends$F = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$F.apply(this, arguments); }
1999
- const SvgSentiment3 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$F({
1896
+ var _g$8, _defs$2;
1897
+ function _extends$I() { return _extends$I = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$I.apply(null, arguments); }
1898
+ const SvgSentiment3 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$I({
2000
1899
  width: 27,
2001
1900
  height: 26,
2002
1901
  viewBox: "0 0 27 26",
2003
1902
  fill: "none",
2004
1903
  xmlns: "http://www.w3.org/2000/svg"
2005
- }, props), _g$7 || (_g$7 = /*#__PURE__*/React__namespace.createElement("g", {
1904
+ }, props), _g$8 || (_g$8 = /*#__PURE__*/React__namespace.createElement("g", {
2006
1905
  clipPath: "url(#clip0_21_19129)"
2007
1906
  }, /*#__PURE__*/React__namespace.createElement("path", {
2008
1907
  d: "M26.5525 13C26.5525 20.1796 20.6084 26 13.2762 26C5.94481 26 0 20.1796 0 13C0 5.82111 5.94481 0 13.2762 0C20.6084 0 26.5525 5.82111 26.5525 13Z",
@@ -2024,15 +1923,15 @@ const SvgSentiment3 = props => /*#__PURE__*/React__namespace.createElement("svg"
2024
1923
  fill: "white"
2025
1924
  })))));
2026
1925
 
2027
- var _g$6, _defs$1;
2028
- function _extends$E() { _extends$E = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$E.apply(this, arguments); }
2029
- const SvgSentiment4 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$E({
1926
+ var _g$7, _defs$1;
1927
+ function _extends$H() { return _extends$H = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$H.apply(null, arguments); }
1928
+ const SvgSentiment4 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$H({
2030
1929
  width: 27,
2031
1930
  height: 26,
2032
1931
  viewBox: "0 0 27 26",
2033
1932
  fill: "none",
2034
1933
  xmlns: "http://www.w3.org/2000/svg"
2035
- }, props), _g$6 || (_g$6 = /*#__PURE__*/React__namespace.createElement("g", {
1934
+ }, props), _g$7 || (_g$7 = /*#__PURE__*/React__namespace.createElement("g", {
2036
1935
  clipPath: "url(#clip0_21_19127)"
2037
1936
  }, /*#__PURE__*/React__namespace.createElement("path", {
2038
1937
  d: "M26.5525 13C26.5525 20.1796 20.6084 26 13.2762 26C5.94481 26 0 20.1796 0 13C0 5.82111 5.94481 0 13.2762 0C20.6084 0 26.5525 5.82111 26.5525 13Z",
@@ -2054,15 +1953,15 @@ const SvgSentiment4 = props => /*#__PURE__*/React__namespace.createElement("svg"
2054
1953
  fill: "white"
2055
1954
  })))));
2056
1955
 
2057
- var _g$5, _defs;
2058
- function _extends$D() { _extends$D = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$D.apply(this, arguments); }
2059
- const SvgSentiment5 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$D({
1956
+ var _g$6, _defs;
1957
+ function _extends$G() { return _extends$G = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$G.apply(null, arguments); }
1958
+ const SvgSentiment5 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$G({
2060
1959
  width: 26,
2061
1960
  height: 26,
2062
1961
  viewBox: "0 0 26 26",
2063
1962
  fill: "none",
2064
1963
  xmlns: "http://www.w3.org/2000/svg"
2065
- }, props), _g$5 || (_g$5 = /*#__PURE__*/React__namespace.createElement("g", {
1964
+ }, props), _g$6 || (_g$6 = /*#__PURE__*/React__namespace.createElement("g", {
2066
1965
  clipPath: "url(#clip0_21_19125)"
2067
1966
  }, /*#__PURE__*/React__namespace.createElement("path", {
2068
1967
  d: "M25.2051 13C25.2051 20.1796 19.5626 26 12.6025 26C5.64314 26 0 20.1796 0 13C0 5.82111 5.64314 0 12.6025 0C19.5626 0 25.2051 5.82111 25.2051 13Z",
@@ -2284,20 +2183,143 @@ const SentimentChart = ({ data, width, height, margin, tooltip, i18n, }) => {
2284
2183
  ], enableCrosshair: false, isInteractive: true, enableSlices: "x" }) })) }));
2285
2184
  };
2286
2185
 
2287
- const ShortcutContainer = styled__default["default"].div `
2288
- display: flex;
2289
- flex-direction: row;
2290
- padding: ${({ theme }) => `0 ${theme.space.base * 4}px`};
2291
- background-color: ${({ theme }) => theme.palette.grey[100]};
2292
- font-size: ${({ theme }) => theme.fontSizes.sm};
2293
- `;
2294
- const Text$1 = styled__default["default"](reactTypography.SM) `
2295
- line-height: 1.7;
2296
- `;
2297
- const SendShortcut = ({ saveText }) => {
2298
- return (jsxRuntime.jsxs(ShortcutContainer, { children: [jsxRuntime.jsxs(reactTags.Tag, { children: [isMac() ? "Cmd" : "Ctrl", "+enter"] }), "\u00A0", jsxRuntime.jsx(Text$1, { children: saveText || "to save" })] }));
2299
- };
2300
-
2186
+ const flatten = (data) => data.reduce((acc, item) => {
2187
+ if (item.children) {
2188
+ return [...acc, item, ...flatten(item.children)];
2189
+ }
2190
+ return [...acc, item];
2191
+ }, []);
2192
+ const findChildrenByName = (data, name) => {
2193
+ if (!data.children)
2194
+ return undefined;
2195
+ return flatten(data.children).find((searchedName) => searchedName.name === name);
2196
+ };
2197
+
2198
+ const getChildrenValue = (data) => {
2199
+ if (data.value) {
2200
+ return data.value;
2201
+ }
2202
+ if (data.children) {
2203
+ return data.children.reduce((acc, item) => {
2204
+ return acc + getChildrenValue(item);
2205
+ }, 0);
2206
+ }
2207
+ return 0;
2208
+ };
2209
+
2210
+ const ResetText = styled__default["default"].text `
2211
+ font-size: ${({ radius, theme }) => (parseInt(theme.fontSizes.md.replace("px", "")) * radius) / 130}px;
2212
+ cursor: pointer;
2213
+
2214
+ fill: ${({ theme }) => theme.palette.blue[500]};
2215
+ &:hover {
2216
+ fill: ${({ theme }) => theme.palette.blue[700]};
2217
+ }
2218
+ `;
2219
+ const ResetButton = ({ centerX, centerY, radius, theme, onClick, }) => (jsxRuntime.jsx("g", Object.assign({ transform: `translate(${centerX - radius},${centerY - radius})` }, { children: jsxRuntime.jsx(ResetText, Object.assign({ onClick: onClick, radius: radius }, { children: `< Reset` })) })));
2220
+
2221
+ const SunburstChart = ({ colors, width, height, data, centerItem, margin, onChange, tooltip, legend, }) => {
2222
+ const themeContext = React.useContext(styled.ThemeContext);
2223
+ const [currentData, setCurrentData] = React.useState(data);
2224
+ const [currentColor, setCurrentColor] = React.useState();
2225
+ const [isHovering, setIsHovering] = React.useState(false);
2226
+ const changeDataSlice = ({ data, color, }) => {
2227
+ setCurrentData(data);
2228
+ setCurrentColor(color);
2229
+ };
2230
+ React.useEffect(() => {
2231
+ if (onChange)
2232
+ onChange(currentData);
2233
+ }, [currentData]);
2234
+ if (!data.children)
2235
+ return jsxRuntime.jsx(jsxRuntime.Fragment, { children: "No data" });
2236
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ChartContainer, Object.assign({ width: width, height: height, style: isHovering ? { cursor: "pointer" } : undefined }, { children: jsxRuntime.jsx(sunburst.ResponsiveSunburst, { theme: tooltip
2237
+ ? Object.assign(Object.assign({}, DEFAULT_CHARTS_THEME), { tooltip: Object.assign(Object.assign({}, DEFAULT_CHARTS_THEME.tooltip), { container: {
2238
+ padding: 0,
2239
+ } }) }) : DEFAULT_CHARTS_THEME, colors: currentColor
2240
+ ? () => currentColor
2241
+ : colors !== null && colors !== void 0 ? colors : CHARTS_COLOR_SCHEME_CATEGORICAL, borderWidth: 4, cornerRadius: 4, onMouseEnter: (node) => {
2242
+ if (node.data.children) {
2243
+ setIsHovering(true);
2244
+ }
2245
+ }, onMouseLeave: (node) => {
2246
+ if (node.data.children) {
2247
+ setIsHovering(false);
2248
+ }
2249
+ }, tooltip: tooltip
2250
+ ? (node) => (jsxRuntime.jsx(jsxRuntime.Fragment, { children: tooltip({
2251
+ label: node.data.label || node.data.name,
2252
+ value: getChildrenValue(node.data),
2253
+ data: Object.assign(Object.assign({}, node.data), { children: undefined }),
2254
+ }) }))
2255
+ : undefined, layers: [
2256
+ "arcs",
2257
+ ...(centerItem
2258
+ ? [
2259
+ (props) => (jsxRuntime.jsx(CenteredItem, Object.assign({}, props, { fontSizeMultiplier: centerItem.fontSizeMultiplier, theme: themeContext, label: centerItem.label, value: centerItem.value }))),
2260
+ ]
2261
+ : []),
2262
+ ...(currentColor
2263
+ ? [
2264
+ (props) => (jsxRuntime.jsx(ResetButton, { centerX: props.centerX, centerY: props.centerY, radius: props.radius, theme: themeContext, onClick: () => {
2265
+ changeDataSlice({
2266
+ data,
2267
+ });
2268
+ } })),
2269
+ ]
2270
+ : []),
2271
+ ], id: "name", value: "value", margin: Object.assign({ top: 40, bottom: 40 }, margin), data: currentData, childColor: { from: "color", modifiers: [["brighter", 0.6]] }, onClick: (clickedData) => {
2272
+ const foundObject = findChildrenByName(currentData, clickedData.id.toString());
2273
+ if (foundObject && foundObject.children) {
2274
+ changeDataSlice({
2275
+ data: foundObject,
2276
+ color: clickedData.color,
2277
+ });
2278
+ }
2279
+ } }) })), jsxRuntime.jsx(ChartContainer, Object.assign({ width: width, height: "auto" }, { children: legend ? (jsxRuntime.jsx(Legend, Object.assign({ colors: colors !== null && colors !== void 0 ? colors : CHARTS_COLOR_SCHEME_CATEGORICAL, data: data.children.map((d) => d.label || d.name) }, (typeof legend === "object" && legend)))) : undefined }))] }));
2280
+ };
2281
+
2282
+ const CustomCell = ({ position, size, x, y, color, fill, opacity, borderWidth, borderColor, data, onHover, onLeave, onClick, }) => (jsxRuntime.jsx("circle", { r: size / 2, cx: x + size / 2, cy: y + size / 2, fill: fill || color, strokeWidth: borderWidth, stroke: borderColor, opacity: opacity, onMouseEnter: onHover, onMouseMove: onHover, onMouseLeave: onLeave, onClick: event => {
2283
+ onClick({ position, color, x, y, data }, event);
2284
+ } }));
2285
+
2286
+ const WaffleChart = ({ height, width, data, total, tooltip, }) => {
2287
+ return (jsxRuntime.jsx(ChartContainer, Object.assign({ width: width, height: height }, { children: jsxRuntime.jsx(waffle.ResponsiveWaffle, { theme: tooltip
2288
+ ? Object.assign(Object.assign({}, DEFAULT_CHARTS_THEME), { tooltip: Object.assign(Object.assign({}, DEFAULT_CHARTS_THEME.tooltip), { container: {
2289
+ padding: 0,
2290
+ } }) }) : DEFAULT_CHARTS_THEME, data: [
2291
+ {
2292
+ id: "green-circles",
2293
+ label: data.label,
2294
+ value: data.value,
2295
+ },
2296
+ {
2297
+ id: "grey-circles",
2298
+ label: total.label,
2299
+ value: total.value,
2300
+ },
2301
+ ], tooltip: ({ value, label }) => tooltip ? tooltip({ label, value }) : jsxRuntime.jsx(jsxRuntime.Fragment, { children: `${label}: ${value}` }), fillDirection: "bottom", total: total.value, rows: 6, columns: 8, colors: CHARTS_COLOR_SCHEME_MONO,
2302
+ // @ts-ignore property cellComponent does not exist, but it does
2303
+ cellComponent: (_a) => {
2304
+ var rest = __rest(_a, ["borderWidth", "borderColor"]);
2305
+ return (jsxRuntime.jsx(CustomCell, Object.assign({ borderWidth: 2, borderColor: "white" }, rest)));
2306
+ } }) })));
2307
+ };
2308
+
2309
+ const ShortcutContainer = styled__default["default"].div `
2310
+ display: flex;
2311
+ flex-direction: row;
2312
+ padding: ${({ theme }) => `0 ${theme.space.base * 4}px`};
2313
+ background-color: ${({ theme }) => theme.palette.grey[100]};
2314
+ font-size: ${({ theme }) => theme.fontSizes.sm};
2315
+ `;
2316
+ const Text$1 = styled__default["default"](reactTypography.SM) `
2317
+ line-height: 1.7;
2318
+ `;
2319
+ const SendShortcut = ({ saveText }) => {
2320
+ return (jsxRuntime.jsxs(ShortcutContainer, { children: [jsxRuntime.jsxs(reactTags.Tag, { children: [isMac() ? "Cmd" : "Ctrl", "+enter"] }), "\u00A0", jsxRuntime.jsx(Text$1, { children: saveText || "to save" })] }));
2321
+ };
2322
+
2301
2323
  const Footer$4 = styled__default["default"].div `
2302
2324
  display: flex;
2303
2325
  flex-direction: row;
@@ -2313,7 +2335,7 @@ const ChatFooter = ({ saveText, children, showShortcut, }) => {
2313
2335
  };
2314
2336
 
2315
2337
  const ChatContext = React.createContext(null);
2316
- const ChatContextProvider = ({ onSave, onFileUpload, setMentionableUsers, children, }) => {
2338
+ const ChatContextProvider = ({ onSave, onFileUpload, onDeleteThumbnail, setMentionableUsers, children, }) => {
2317
2339
  const [editor, setEditor] = React.useState();
2318
2340
  const [thumbnails, setThumbnails] = React.useState([]);
2319
2341
  const getMentions = (editor) => {
@@ -2335,53 +2357,45 @@ const ChatContextProvider = ({ onSave, onFileUpload, setMentionableUsers, childr
2335
2357
  editor,
2336
2358
  setEditor,
2337
2359
  thumbnails,
2338
- afterUploadCallback: (failed) => {
2339
- setThumbnails(thumbnails.map((file) => {
2340
- if (failed.includes(file.name)) {
2341
- file.isLoadingMedia = false;
2342
- //file.isError = true;
2343
- }
2344
- else {
2345
- file.isLoadingMedia = false;
2346
- //file.isError = false
2347
- }
2348
- return file;
2349
- }));
2350
- },
2351
- addThumbnails: ({ files }) => {
2352
- files.forEach((file) => (file.isLoadingMedia = true));
2360
+ setThumbnails,
2361
+ afterUploadCallback: (failed) => { },
2362
+ addThumbnails: ({ files }) => __awaiter(void 0, void 0, void 0, function* () {
2353
2363
  setThumbnails((prev) => [...prev, ...files]);
2354
- if (onFileUpload) {
2355
- onFileUpload(files).then((data) => {
2356
- var _a;
2357
- const failed = (_a = data.failed) === null || _a === void 0 ? void 0 : _a.map((f) => f.name);
2358
- setThumbnails((prev) => {
2359
- return prev.map((file) => {
2360
- file.isLoadingMedia = false;
2361
- if ((failed === null || failed === void 0 ? void 0 : failed.length) && failed.includes(file.name)) {
2362
- file.isError = true;
2363
- }
2364
- else {
2365
- file.isError = false;
2366
- }
2367
- return file;
2368
- });
2364
+ if (!onFileUpload)
2365
+ return;
2366
+ try {
2367
+ const data = yield onFileUpload(files);
2368
+ setThumbnails((prev) => {
2369
+ return prev.map(file => {
2370
+ var _a, _b;
2371
+ file.isLoadingMedia = false;
2372
+ file.error = (_b = (_a = data.failed) === null || _a === void 0 ? void 0 : _a.find(f => f.name === file.name)) === null || _b === void 0 ? void 0 : _b.errorCode;
2373
+ return file;
2369
2374
  });
2370
2375
  });
2371
2376
  }
2372
- },
2373
- clearThumbnails: () => {
2374
- if (editor)
2377
+ catch (e) {
2378
+ console.log("Error uploading files", e);
2379
+ }
2380
+ }),
2381
+ clearInput: () => {
2382
+ if (editor && !editor.isEmpty) {
2383
+ editor.commands.clearContent();
2384
+ }
2385
+ if (thumbnails.length > 0)
2375
2386
  setThumbnails([]);
2376
- console.log("thumbnails cleared", thumbnails);
2377
2387
  },
2378
- removeThumbnail: (index) => setThumbnails(thumbnails.filter((_, i) => i !== index)),
2388
+ onDeleteThumbnail: (id) => {
2389
+ onDeleteThumbnail(id);
2390
+ },
2391
+ removeThumbnail: (index) => {
2392
+ setThumbnails(thumbnails.filter((_, i) => i !== index));
2393
+ },
2379
2394
  triggerSave: () => {
2380
2395
  if (editor && onSave && !editor.isEmpty) {
2381
2396
  onSave(editor, getMentions(editor));
2382
2397
  editor.commands.clearContent();
2383
2398
  setThumbnails([]);
2384
- console.log("thumbnails cleared", thumbnails);
2385
2399
  }
2386
2400
  },
2387
2401
  mentionableUsers: setMentionableUsers,
@@ -2393,6 +2407,7 @@ const ChatContextProvider = ({ onSave, onFileUpload, setMentionableUsers, childr
2393
2407
  thumbnails,
2394
2408
  setThumbnails,
2395
2409
  onFileUpload,
2410
+ onDeleteThumbnail,
2396
2411
  ]);
2397
2412
  return (jsxRuntime.jsx(ChatContext.Provider, Object.assign({ value: chatContextValue }, { children: children })));
2398
2413
  };
@@ -2728,96 +2743,28 @@ const ChatTitle = styled__default["default"](Title$1) `
2728
2743
  padding: ${({ theme }) => `${theme.space.sm} ${theme.space.md}`};
2729
2744
  `;
2730
2745
 
2731
- const UgClose$1 = styled__default["default"](reactNotifications.Close) `
2732
- display: flex;
2733
- align-items: center;
2734
- justify-content: center;
2735
- width: ${({ theme }) => theme.space.xl};
2736
- height: ${({ theme }) => theme.space.xl};
2737
- `;
2738
- /**
2739
- * Title is a basic component used to display a title. Often used in card headers.
2740
- */
2741
- const Close = (props) => jsxRuntime.jsx(UgClose$1, Object.assign({}, props));
2742
-
2743
- const NOTIFICATION_COMPONENT_ID = "notifications.notification";
2744
- const CLOSE_COMPONENT_ID = "notifications.notification.close";
2745
- const CLOSE_ICON_COMPONENT_ID = "notifications.notification.close-icon";
2746
- const TITLE_COMPONENT_ID = "notifications.notification.title";
2747
- const UgClose = styled__default["default"](Close).attrs((props) => {
2748
- var _a;
2749
- return ({
2750
- "data-custom-id": (_a = props["data-custom-id"]) !== null && _a !== void 0 ? _a : CLOSE_ICON_COMPONENT_ID,
2751
- });
2752
- }) `
2753
- ${(props) => reactTheming.retrieveComponentStyles(CLOSE_ICON_COMPONENT_ID, props)};
2754
- `;
2755
- const UgAnchor = styled__default["default"](reactButtons.Anchor).attrs((props) => {
2756
- var _a;
2757
- return ({
2758
- "data-custom-id": (_a = props["data-custom-id"]) !== null && _a !== void 0 ? _a : CLOSE_COMPONENT_ID,
2759
- });
2760
- }) `
2761
- ${(props) => reactTheming.retrieveComponentStyles(CLOSE_COMPONENT_ID, props)};
2762
- `;
2763
- const UgTitle = styled__default["default"](Title$1).attrs((props) => {
2764
- var _a;
2765
- return ({
2766
- "data-custom-id": (_a = props["data-custom-id"]) !== null && _a !== void 0 ? _a : TITLE_COMPONENT_ID,
2767
- });
2768
- }) `
2769
- ${(props) => reactTheming.retrieveComponentStyles(TITLE_COMPONENT_ID, props)};
2770
- `;
2771
- const UgNotification = styled__default["default"](reactNotifications.Notification) `
2772
- display: flex;
2773
- align-items: center;
2774
- justify-content: space-between;
2775
- padding-right: ${({ theme }) => theme.space.md};
2776
- white-space: pre;
2777
-
2778
- ${UgAnchor} {
2779
- flex-shrink: 0;
2780
- margin-left: ${({ theme }) => theme.space.md};
2781
- }
2782
-
2783
- ${(props) => reactTheming.retrieveComponentStyles(NOTIFICATION_COMPONENT_ID, props)};
2784
- `;
2785
- /**
2786
- * A Notification is a passive status update that keeps users informed of system progress.
2787
- * <hr>
2788
- * Used for this:
2789
- - For a passive status update about user or system activity
2790
- */
2791
- const Notification = (_a) => {
2792
- var { closeText, message, onClose, type, isPrimary, isRegular } = _a, props = __rest(_a, ["closeText", "message", "onClose", "type", "isPrimary", "isRegular"]);
2793
- return (jsxRuntime.jsxs(UgNotification, Object.assign({ type: type, isPrimary: isPrimary }, props, { children: [jsxRuntime.jsx(UgTitle, Object.assign({ isRegular: isRegular, type: type, isPrimary: isPrimary }, { children: message })), jsxRuntime.jsx(UgAnchor, Object.assign({ type: type, isPrimary: isPrimary, onClick: onClose }, { children: closeText !== null && closeText !== void 0 ? closeText : jsxRuntime.jsx(UgClose, {}) }))] })));
2794
- };
2795
- // ToastProvider
2796
- const ToastProvider = (props) => (jsxRuntime.jsx(reactNotifications.ToastProvider, Object.assign({}, props)));
2797
- const useToast = reactNotifications.useToast;
2798
-
2799
- var _path$v;
2800
- function _extends$C() { _extends$C = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$C.apply(this, arguments); }
2801
- const SvgBoldFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$C({
2746
+ var _path$x;
2747
+ function _extends$F() { return _extends$F = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$F.apply(null, arguments); }
2748
+ const SvgBoldFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$F({
2802
2749
  xmlns: "http://www.w3.org/2000/svg",
2803
2750
  width: 16,
2804
2751
  height: 16,
2805
2752
  focusable: "false",
2806
2753
  viewBox: "0 0 16 16"
2807
- }, props), _path$v || (_path$v = /*#__PURE__*/React__namespace.createElement("path", {
2754
+ }, props), _path$x || (_path$x = /*#__PURE__*/React__namespace.createElement("path", {
2808
2755
  fill: "currentColor",
2809
2756
  d: "M7.5 0C9.952 0 12 2.048 12 4.5a4.483 4.483 0 01-1.27 3.108C12.078 8.39 13 9.855 13 11.5c0 2.452-2.048 4.5-4.5 4.5H4a1 1 0 01-1-1V1a1 1 0 011-1h3.5zM5 14h3.5c1.348 0 2.5-1.152 2.5-2.5S9.848 9 8.5 9H5v5zM7.5 2H5v5h2.5C8.848 7 10 5.848 10 4.5S8.848 2 7.5 2z"
2810
2757
  })));
2811
2758
 
2812
- var _path$u;
2813
- function _extends$B() { _extends$B = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$B.apply(this, arguments); }
2814
- const SvgItalicFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$B({
2759
+ var _path$w;
2760
+ function _extends$E() { return _extends$E = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$E.apply(null, arguments); }
2761
+ const SvgItalicFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$E({
2815
2762
  xmlns: "http://www.w3.org/2000/svg",
2816
2763
  width: 16,
2817
2764
  height: 16,
2818
2765
  focusable: "false",
2819
2766
  viewBox: "0 0 16 16"
2820
- }, props), _path$u || (_path$u = /*#__PURE__*/React__namespace.createElement("path", {
2767
+ }, props), _path$w || (_path$w = /*#__PURE__*/React__namespace.createElement("path", {
2821
2768
  fill: "none",
2822
2769
  stroke: "currentColor",
2823
2770
  strokeLinecap: "round",
@@ -2825,15 +2772,15 @@ const SvgItalicFill = props => /*#__PURE__*/React__namespace.createElement("svg"
2825
2772
  d: "M8 1h3M9.5 1l-3 14M5 15h3"
2826
2773
  })));
2827
2774
 
2828
- var _path$t, _path2$7;
2829
- function _extends$A() { _extends$A = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$A.apply(this, arguments); }
2830
- const SvgQuoteFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$A({
2775
+ var _path$v, _path2$7;
2776
+ function _extends$D() { return _extends$D = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$D.apply(null, arguments); }
2777
+ const SvgQuoteFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$D({
2831
2778
  xmlns: "http://www.w3.org/2000/svg",
2832
2779
  width: 16,
2833
2780
  height: 16,
2834
2781
  focusable: "false",
2835
2782
  viewBox: "0 0 16 16"
2836
- }, props), _path$t || (_path$t = /*#__PURE__*/React__namespace.createElement("path", {
2783
+ }, props), _path$v || (_path$v = /*#__PURE__*/React__namespace.createElement("path", {
2837
2784
  fill: "currentColor",
2838
2785
  d: "M7 8H4c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v3c0 .55-.45 1-1 1zm6 0h-3c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v3c0 .55-.45 1-1 1z"
2839
2786
  })), _path2$7 || (_path2$7 = /*#__PURE__*/React__namespace.createElement("path", {
@@ -2844,15 +2791,15 @@ const SvgQuoteFill = props => /*#__PURE__*/React__namespace.createElement("svg",
2844
2791
  d: "M5.5 12C6.5 11 7 9.5 7 8V6m4.5 6c1-1 1.5-2.5 1.5-4V6"
2845
2792
  })));
2846
2793
 
2847
- var _g$4;
2848
- function _extends$z() { _extends$z = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$z.apply(this, arguments); }
2849
- const SvgH1Fill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$z({
2794
+ var _g$5;
2795
+ function _extends$C() { return _extends$C = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$C.apply(null, arguments); }
2796
+ const SvgH1Fill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$C({
2850
2797
  xmlns: "http://www.w3.org/2000/svg",
2851
2798
  width: 16,
2852
2799
  height: 16,
2853
2800
  focusable: "false",
2854
2801
  viewBox: "0 0 16 16"
2855
- }, props), _g$4 || (_g$4 = /*#__PURE__*/React__namespace.createElement("g", {
2802
+ }, props), _g$5 || (_g$5 = /*#__PURE__*/React__namespace.createElement("g", {
2856
2803
  transform: "translate(-464 -332)"
2857
2804
  }, /*#__PURE__*/React__namespace.createElement("rect", {
2858
2805
  width: 16,
@@ -2872,15 +2819,15 @@ const SvgH1Fill = props => /*#__PURE__*/React__namespace.createElement("svg", _e
2872
2819
  transform: "translate(474.469 331)"
2873
2820
  }))));
2874
2821
 
2875
- var _g$3;
2876
- function _extends$y() { _extends$y = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$y.apply(this, arguments); }
2877
- const SvgH2Fill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$y({
2822
+ var _g$4;
2823
+ function _extends$B() { return _extends$B = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$B.apply(null, arguments); }
2824
+ const SvgH2Fill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$B({
2878
2825
  xmlns: "http://www.w3.org/2000/svg",
2879
2826
  width: 16,
2880
2827
  height: 16,
2881
2828
  focusable: "false",
2882
2829
  viewBox: "0 0 16 16"
2883
- }, props), _g$3 || (_g$3 = /*#__PURE__*/React__namespace.createElement("g", {
2830
+ }, props), _g$4 || (_g$4 = /*#__PURE__*/React__namespace.createElement("g", {
2884
2831
  transform: "translate(-464 -332)"
2885
2832
  }, /*#__PURE__*/React__namespace.createElement("rect", {
2886
2833
  width: 16,
@@ -2900,15 +2847,15 @@ const SvgH2Fill = props => /*#__PURE__*/React__namespace.createElement("svg", _e
2900
2847
  transform: "translate(469.359 331)"
2901
2848
  }))));
2902
2849
 
2903
- var _g$2;
2904
- function _extends$x() { _extends$x = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$x.apply(this, arguments); }
2905
- const SvgH3Fill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$x({
2850
+ var _g$3;
2851
+ function _extends$A() { return _extends$A = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$A.apply(null, arguments); }
2852
+ const SvgH3Fill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$A({
2906
2853
  xmlns: "http://www.w3.org/2000/svg",
2907
2854
  width: 16,
2908
2855
  height: 16,
2909
2856
  focusable: "false",
2910
2857
  viewBox: "0 0 16 16"
2911
- }, props), _g$2 || (_g$2 = /*#__PURE__*/React__namespace.createElement("g", {
2858
+ }, props), _g$3 || (_g$3 = /*#__PURE__*/React__namespace.createElement("g", {
2912
2859
  transform: "translate(-464 -332)"
2913
2860
  }, /*#__PURE__*/React__namespace.createElement("rect", {
2914
2861
  width: 16,
@@ -2929,7 +2876,7 @@ const SvgH3Fill = props => /*#__PURE__*/React__namespace.createElement("svg", _e
2929
2876
  }))));
2930
2877
 
2931
2878
  const StyledIconButton = styled__default["default"](IconButton) ``;
2932
- const MenuContainer$1 = styled__default["default"](Card) `
2879
+ const MenuContainer$2 = styled__default["default"](Card) `
2933
2880
  padding: ${({ theme }) => theme.space.xxs};
2934
2881
 
2935
2882
  ${StyledIconButton} {
@@ -2948,12 +2895,12 @@ const MenuContainer$1 = styled__default["default"](Card) `
2948
2895
  }
2949
2896
  }
2950
2897
  `;
2951
- const FloatingMenu = (props) => {
2898
+ const FloatingMenu$1 = (props) => {
2952
2899
  const { editor } = props;
2953
2900
  if (!editor) {
2954
2901
  return null;
2955
2902
  }
2956
- return (jsxRuntime.jsx(react.BubbleMenu, Object.assign({}, props, { editor: editor }, { children: jsxRuntime.jsxs(MenuContainer$1, Object.assign({ isFloating: true }, { children: [jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleHeading({ level: 1 }).run(), isBasic: !editor.isActive("heading", { level: 1 }), isPrimary: editor.isActive("heading", { level: 1 }), isPill: false }, { children: jsxRuntime.jsx(SvgH1Fill, {}, "ug-h1-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleHeading({ level: 2 }).run(), isBasic: !editor.isActive("heading", { level: 2 }), isPrimary: editor.isActive("heading", { level: 2 }), isPill: false }, { children: jsxRuntime.jsx(SvgH2Fill, {}, "ug-h2-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleHeading({ level: 3 }).run(), isBasic: !editor.isActive("heading", { level: 3 }), isPrimary: editor.isActive("heading", { level: 3 }), isPill: false }, { children: jsxRuntime.jsx(SvgH3Fill, {}, "ug-h3-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleBold().run(), isBasic: !editor.isActive("bold"), isPrimary: editor.isActive("bold"), isPill: false }, { children: jsxRuntime.jsx(SvgBoldFill, {}, "ug-bold-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleItalic().run(), isBasic: !editor.isActive("italic"), isPrimary: editor.isActive("italic"), isPill: false }, { children: jsxRuntime.jsx(SvgItalicFill, {}, "ug-italic-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleBlockquote().run(), isBasic: !editor.isActive("blockquote"), isPrimary: editor.isActive("blockquote"), isPill: false }, { children: jsxRuntime.jsx(SvgQuoteFill, {}, "ug-quote-button-bubble-menu") }))] })) })));
2903
+ return (jsxRuntime.jsx(react.BubbleMenu, Object.assign({}, props, { editor: editor }, { children: jsxRuntime.jsxs(MenuContainer$2, Object.assign({ isFloating: true }, { children: [jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleHeading({ level: 1 }).run(), isBasic: !editor.isActive("heading", { level: 1 }), isPrimary: editor.isActive("heading", { level: 1 }), isPill: false }, { children: jsxRuntime.jsx(SvgH1Fill, {}, "ug-h1-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleHeading({ level: 2 }).run(), isBasic: !editor.isActive("heading", { level: 2 }), isPrimary: editor.isActive("heading", { level: 2 }), isPill: false }, { children: jsxRuntime.jsx(SvgH2Fill, {}, "ug-h2-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleHeading({ level: 3 }).run(), isBasic: !editor.isActive("heading", { level: 3 }), isPrimary: editor.isActive("heading", { level: 3 }), isPill: false }, { children: jsxRuntime.jsx(SvgH3Fill, {}, "ug-h3-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleBold().run(), isBasic: !editor.isActive("bold"), isPrimary: editor.isActive("bold"), isPill: false }, { children: jsxRuntime.jsx(SvgBoldFill, {}, "ug-bold-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleItalic().run(), isBasic: !editor.isActive("italic"), isPrimary: editor.isActive("italic"), isPill: false }, { children: jsxRuntime.jsx(SvgItalicFill, {}, "ug-italic-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleBlockquote().run(), isBasic: !editor.isActive("blockquote"), isPrimary: editor.isActive("blockquote"), isPill: false }, { children: jsxRuntime.jsx(SvgQuoteFill, {}, "ug-quote-button-bubble-menu") }))] })) })));
2957
2904
  };
2958
2905
 
2959
2906
  /**
@@ -2969,73 +2916,172 @@ const FloatingMenu = (props) => {
2969
2916
  const TooltipComponent = (props) => {
2970
2917
  var _a;
2971
2918
  const theme = React.useContext(styled.ThemeContext);
2972
- return jsxRuntime.jsx(reactTooltips.Tooltip, Object.assign({}, props, { zIndex: (_a = props.zIndex) !== null && _a !== void 0 ? _a : theme.levels.front }));
2919
+ return (jsxRuntime.jsx(reactTooltips.Tooltip, Object.assign({}, props, { zIndex: (_a = props.zIndex) !== null && _a !== void 0 ? _a : theme.levels.front })));
2973
2920
  };
2974
2921
  const Tooltip = styled__default["default"](TooltipComponent) `
2975
2922
  box-shadow: ${({ theme }) => theme.shadows.lg(`${theme.space.base * 3}px`, `${theme.space.base * 5}px`, getColor("neutralHue", 600, theme, 0.15))};
2923
+
2924
+ ${({ isTransparent }) => isTransparent &&
2925
+ `
2926
+ box-shadow: none;
2927
+ background-color: transparent;
2928
+ border: none;
2929
+ `};
2976
2930
  `;
2977
2931
 
2978
- var _path$s;
2979
- function _extends$w() { _extends$w = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$w.apply(this, arguments); }
2980
- const SvgBoldStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$w({
2932
+ var _path$u;
2933
+ function _extends$z() { return _extends$z = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$z.apply(null, arguments); }
2934
+ const SvgBoldStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$z({
2981
2935
  xmlns: "http://www.w3.org/2000/svg",
2982
2936
  width: 16,
2983
2937
  height: 16,
2984
2938
  focusable: "false",
2985
2939
  viewBox: "0 0 16 16"
2986
- }, props), _path$s || (_path$s = /*#__PURE__*/React__namespace.createElement("path", {
2940
+ }, props), _path$u || (_path$u = /*#__PURE__*/React__namespace.createElement("path", {
2987
2941
  fill: "currentColor",
2988
2942
  d: "M7 1c2.176 0 4 1.824 4 4 0 1.315-.666 2.501-1.673 3.234C10.869 8.792 12 10.287 12 12c0 2.176-1.824 4-4 4H3.5a.5.5 0 01-.5-.5v-14a.5.5 0 01.5-.5H7zM4 15h4c1.624 0 3-1.376 3-3S9.624 9 8 9H4v6zM7 2H4v6h3c1.624 0 3-1.376 3-3S8.624 2 7 2z"
2989
2943
  })));
2990
2944
 
2991
- var _path$r;
2992
- function _extends$v() { _extends$v = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$v.apply(this, arguments); }
2993
- const SvgItalicStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$v({
2945
+ var _path$t;
2946
+ function _extends$y() { return _extends$y = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$y.apply(null, arguments); }
2947
+ const SvgItalicStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$y({
2994
2948
  xmlns: "http://www.w3.org/2000/svg",
2995
2949
  width: 16,
2996
2950
  height: 16,
2997
2951
  focusable: "false",
2998
2952
  viewBox: "0 0 16 16"
2999
- }, props), _path$r || (_path$r = /*#__PURE__*/React__namespace.createElement("path", {
2953
+ }, props), _path$t || (_path$t = /*#__PURE__*/React__namespace.createElement("path", {
3000
2954
  fill: "none",
3001
2955
  stroke: "currentColor",
3002
2956
  strokeLinecap: "round",
3003
2957
  d: "M7.5 1.5h3M9 1.5l-3 14m-1.5 0h3"
3004
2958
  })));
3005
2959
 
3006
- var _path$q;
3007
- function _extends$u() { _extends$u = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$u.apply(this, arguments); }
3008
- const SvgAtStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$u({
2960
+ var _path$s;
2961
+ function _extends$x() { return _extends$x = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$x.apply(null, arguments); }
2962
+ const SvgAtStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$x({
3009
2963
  xmlns: "http://www.w3.org/2000/svg",
3010
2964
  width: 16,
3011
2965
  height: 16,
3012
2966
  focusable: "false",
3013
2967
  role: "presentation"
3014
- }, props), _path$q || (_path$q = /*#__PURE__*/React__namespace.createElement("path", {
2968
+ }, props), _path$s || (_path$s = /*#__PURE__*/React__namespace.createElement("path", {
3015
2969
  fill: "none",
3016
2970
  stroke: "currentColor",
3017
2971
  strokeLinecap: "round",
3018
2972
  d: "M11.5 4.5V8h0A3.5 3.5 0 018 11.5h0A3.5 3.5 0 014.5 8h0A3.5 3.5 0 018 4.5h0A3.5 3.5 0 0111.5 8h0v1.5a2 2 0 002 2h0a2 2 0 002-2V8h0A7.5 7.5 0 008 .5h0A7.5 7.5 0 00.5 8h0A7.5 7.5 0 008 15.5h3.41"
3019
2973
  })));
3020
2974
 
3021
- var _path$p;
3022
- function _extends$t() { _extends$t = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$t.apply(this, arguments); }
3023
- const SvgClipboard = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
2975
+ var _path$r;
2976
+ function _extends$w() { return _extends$w = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$w.apply(null, arguments); }
2977
+ const SvgClipboard = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$w({
3024
2978
  xmlns: "http://www.w3.org/2000/svg",
3025
2979
  width: 16,
3026
2980
  height: 16,
3027
2981
  focusable: "false",
3028
2982
  role: "presentation"
3029
- }, props), _path$p || (_path$p = /*#__PURE__*/React__namespace.createElement("path", {
2983
+ }, props), _path$r || (_path$r = /*#__PURE__*/React__namespace.createElement("path", {
3030
2984
  fill: "none",
3031
2985
  stroke: "currentColor",
3032
2986
  strokeLinecap: "round",
3033
2987
  d: "M9.5 4v7.7c0 .8-.7 1.5-1.5 1.5s-1.5-.7-1.5-1.5V3C6.5 1.6 7.6.5 9 .5s2.5 1.1 2.5 2.5v9c0 1.9-1.6 3.5-3.5 3.5S4.5 13.9 4.5 12V4"
3034
2988
  })));
3035
2989
 
3036
- const MenuContainer = styled__default["default"].div `
3037
- padding: ${({ theme }) => theme.space.xs} 0;
3038
- display: flex;
2990
+ const UgClose$1 = styled__default["default"](reactNotifications.Close) `
2991
+ display: flex;
2992
+ align-items: center;
2993
+ justify-content: center;
2994
+ width: ${({ theme }) => theme.space.xl};
2995
+ height: ${({ theme }) => theme.space.xl};
2996
+ `;
2997
+ /**
2998
+ * Title is a basic component used to display a title. Often used in card headers.
2999
+ */
3000
+ const Close = (props) => jsxRuntime.jsx(UgClose$1, Object.assign({}, props));
3001
+
3002
+ const NOTIFICATION_COMPONENT_ID = "notifications.notification";
3003
+ const CLOSE_COMPONENT_ID = "notifications.notification.close";
3004
+ const CLOSE_ICON_COMPONENT_ID = "notifications.notification.close-icon";
3005
+ const TITLE_COMPONENT_ID = "notifications.notification.title";
3006
+ const UgClose = styled__default["default"](Close).attrs((props) => {
3007
+ var _a;
3008
+ return ({
3009
+ "data-custom-id": (_a = props["data-custom-id"]) !== null && _a !== void 0 ? _a : CLOSE_ICON_COMPONENT_ID,
3010
+ });
3011
+ }) `
3012
+ ${(props) => reactTheming.retrieveComponentStyles(CLOSE_ICON_COMPONENT_ID, props)};
3013
+ `;
3014
+ const UgAnchor = styled__default["default"](reactButtons.Anchor).attrs((props) => {
3015
+ var _a;
3016
+ return ({
3017
+ "data-custom-id": (_a = props["data-custom-id"]) !== null && _a !== void 0 ? _a : CLOSE_COMPONENT_ID,
3018
+ });
3019
+ }) `
3020
+ ${(props) => reactTheming.retrieveComponentStyles(CLOSE_COMPONENT_ID, props)};
3021
+ `;
3022
+ const UgTitle = styled__default["default"](Title$1).attrs((props) => {
3023
+ var _a;
3024
+ return ({
3025
+ "data-custom-id": (_a = props["data-custom-id"]) !== null && _a !== void 0 ? _a : TITLE_COMPONENT_ID,
3026
+ });
3027
+ }) `
3028
+ ${(props) => reactTheming.retrieveComponentStyles(TITLE_COMPONENT_ID, props)};
3029
+ `;
3030
+ const UgNotification = styled__default["default"](reactNotifications.Notification) `
3031
+ display: flex;
3032
+ align-items: center;
3033
+ justify-content: space-between;
3034
+ padding-right: ${({ theme }) => theme.space.md};
3035
+ white-space: pre;
3036
+
3037
+ ${UgAnchor} {
3038
+ flex-shrink: 0;
3039
+ margin-left: ${({ theme }) => theme.space.md};
3040
+ }
3041
+
3042
+ ${(props) => reactTheming.retrieveComponentStyles(NOTIFICATION_COMPONENT_ID, props)};
3043
+ `;
3044
+ /**
3045
+ * A Notification is a passive status update that keeps users informed of system progress.
3046
+ * <hr>
3047
+ * Used for this:
3048
+ - For a passive status update about user or system activity
3049
+ */
3050
+ const Notification = (_a) => {
3051
+ var { closeText, message, onClose, type, isPrimary, isRegular } = _a, props = __rest(_a, ["closeText", "message", "onClose", "type", "isPrimary", "isRegular"]);
3052
+ return (jsxRuntime.jsxs(UgNotification, Object.assign({ type: type, isPrimary: isPrimary }, props, { children: [jsxRuntime.jsx(UgTitle, Object.assign({ isRegular: isRegular, type: type, isPrimary: isPrimary }, { children: message })), jsxRuntime.jsx(UgAnchor, Object.assign({ type: type, isPrimary: isPrimary, onClick: onClose }, { children: closeText !== null && closeText !== void 0 ? closeText : jsxRuntime.jsx(UgClose, {}) }))] })));
3053
+ };
3054
+ // ToastProvider
3055
+ const ToastProvider = (props) => (jsxRuntime.jsx(reactNotifications.ToastProvider, Object.assign({}, props)));
3056
+ const useToast = reactNotifications.useToast;
3057
+
3058
+ const acceptedMediaTypes = /^(image|video)\//;
3059
+ function useMedia() {
3060
+ const { addToast } = useToast();
3061
+ function getValidMedia(data) {
3062
+ const wrongFiles = Array.from(data).filter((file) => !acceptedMediaTypes.test(file.type));
3063
+ if (wrongFiles.length) {
3064
+ addToast(({ close }) => (jsxRuntime.jsx(Notification, { onClose: close, type: "error", message: wrongFiles.length === 1
3065
+ ? `${wrongFiles[0].name} not supported, please upload video or image only`
3066
+ : "Some attachments are not supported, please upload video or image only", isPrimary: true })), { placement: "top" });
3067
+ }
3068
+ return Array.from(data).filter((file) => acceptedMediaTypes.test(file.type));
3069
+ }
3070
+ function getMedia(data) {
3071
+ return getValidMedia(data).map((file) => {
3072
+ return Object.assign(file, {
3073
+ url: URL.createObjectURL(file),
3074
+ isLoadingMedia: true,
3075
+ id: uuid.v4(),
3076
+ });
3077
+ });
3078
+ }
3079
+ return { getMedia };
3080
+ }
3081
+
3082
+ const MenuContainer$1 = styled__default["default"].div `
3083
+ padding: ${({ theme }) => theme.space.xs} 0;
3084
+ display: flex;
3039
3085
  flex-direction: row;
3040
3086
  justify-content: flex-start;
3041
3087
  align-items: center;
@@ -3050,56 +3096,33 @@ const VerticalDivider = styled__default["default"].div `
3050
3096
  const CommentBar = ({ editor, i18n, }) => {
3051
3097
  var _a, _b, _c, _d, _e, _f, _g, _h;
3052
3098
  const { addThumbnails } = useChatContext();
3099
+ const { getMedia } = useMedia();
3053
3100
  if (!editor)
3054
3101
  return null;
3055
- const getIcon = (type) => {
3056
- switch (type) {
3057
- case "bold":
3058
- return jsxRuntime.jsx(SvgBoldStroke, {});
3059
- case "italic":
3060
- return jsxRuntime.jsx(SvgItalicStroke, {});
3061
- case "mention":
3062
- return jsxRuntime.jsx(SvgAtStroke, {});
3063
- case "attachment":
3064
- return jsxRuntime.jsx(SvgClipboard, {});
3065
- default:
3066
- return null;
3067
- }
3102
+ const handleBoldClick = () => {
3103
+ editor.chain().focus().toggleBold().run();
3068
3104
  };
3069
- const handleClick = (type) => {
3070
- switch (type) {
3071
- case "bold":
3072
- return editor.chain().focus().toggleBold().run();
3073
- case "italic":
3074
- return editor.chain().focus().toggleItalic().run();
3075
- case "mention":
3076
- const { from } = editor.state.selection;
3077
- const char = from > 1 ? " @" : "@";
3078
- return editor.chain().focus().insertContent(char).run();
3079
- case "attachment":
3080
- //open a file browser to select one or more images
3081
- const fileInput = document.createElement("input");
3082
- fileInput.type = "file";
3083
- fileInput.accept = "image/*,video/*";
3084
- fileInput.multiple = true;
3085
- fileInput.click();
3086
- fileInput.onchange = () => {
3087
- const files = fileInput.files;
3088
- if (files) {
3089
- const mediaFiles = Array.from(files).map((file) => {
3090
- return Object.assign(file, { isLoadingMedia: false });
3091
- });
3092
- if (mediaFiles.length === 0)
3093
- return;
3094
- addThumbnails({ files: mediaFiles });
3095
- }
3096
- };
3097
- return;
3098
- default:
3099
- return;
3100
- }
3105
+ const handleItalicClick = () => {
3106
+ editor.chain().focus().toggleItalic().run();
3107
+ };
3108
+ const handleMentionClick = () => {
3109
+ const { from } = editor.state.selection;
3110
+ const char = from > 1 ? " @" : "@";
3111
+ editor.chain().focus().insertContent(char).run();
3112
+ };
3113
+ const handleAttachmentClick = () => {
3114
+ const fileInput = document.createElement("input");
3115
+ fileInput.type = "file";
3116
+ fileInput.accept = "image/*,video/*";
3117
+ fileInput.multiple = true;
3118
+ fileInput.click();
3119
+ fileInput.onchange = () => {
3120
+ if (fileInput.files) {
3121
+ addThumbnails({ files: getMedia(fileInput.files) });
3122
+ }
3123
+ };
3101
3124
  };
3102
- return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs(MenuContainer, Object.assign({ id: "menu-container" }, { children: [jsxRuntime.jsx(Tooltip, Object.assign({ content: `${(_b = (_a = i18n === null || i18n === void 0 ? void 0 : i18n.menu) === null || _a === void 0 ? void 0 : _a.bold) !== null && _b !== void 0 ? _b : "Bold text"} ${isMac() ? "Cmd" : "Ctrl"} + B`, placement: "top", type: "light", size: "small", hasArrow: false }, { children: jsxRuntime.jsx(IconButton, Object.assign({ size: "small", isBasic: !editor.isActive("bold"), isPrimary: editor.isActive("bold"), isPill: false, onClick: () => handleClick("bold") }, { children: getIcon("bold") })) })), jsxRuntime.jsx(Tooltip, Object.assign({ content: `${(_d = (_c = i18n === null || i18n === void 0 ? void 0 : i18n.menu) === null || _c === void 0 ? void 0 : _c.italic) !== null && _d !== void 0 ? _d : "Italic text"} ${isMac() ? "Cmd" : "Ctrl"} + I`, placement: "top", type: "light", size: "small", hasArrow: false }, { children: jsxRuntime.jsx(IconButton, Object.assign({ size: "small", isBasic: !editor.isActive("italic"), isPrimary: editor.isActive("italic"), isPill: false, onClick: () => handleClick("italic") }, { children: getIcon("italic") })) })), jsxRuntime.jsx(VerticalDivider, {}), jsxRuntime.jsx(Tooltip, Object.assign({ content: (_f = (_e = i18n === null || i18n === void 0 ? void 0 : i18n.menu) === null || _e === void 0 ? void 0 : _e.mention) !== null && _f !== void 0 ? _f : "Add a mention", placement: "top", type: "light", size: "small", hasArrow: false }, { children: jsxRuntime.jsx(IconButton, Object.assign({ size: "small", isBasic: !editor.isActive("mention"), isPrimary: editor.isActive("mention"), isPill: false, onClick: () => handleClick("mention") }, { children: getIcon("mention") })) })), jsxRuntime.jsx(Tooltip, Object.assign({ content: (_h = (_g = i18n === null || i18n === void 0 ? void 0 : i18n.menu) === null || _g === void 0 ? void 0 : _g.attachment) !== null && _h !== void 0 ? _h : "Upload images and video. Max size: 5GB", placement: "top", type: "light", size: "small", hasArrow: true }, { children: jsxRuntime.jsx(IconButton, Object.assign({ size: "small", isBasic: !editor.isActive("attachment"), isPrimary: editor.isActive("attachment"), isPill: false, onClick: () => handleClick("attachment") }, { children: getIcon("attachment") })) }))] })) }));
3125
+ return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs(MenuContainer$1, Object.assign({ id: "menu-container" }, { children: [jsxRuntime.jsx(Tooltip, Object.assign({ content: `${(_b = (_a = i18n === null || i18n === void 0 ? void 0 : i18n.menu) === null || _a === void 0 ? void 0 : _a.bold) !== null && _b !== void 0 ? _b : "Bold text"} ${isMac() ? "Cmd" : "Ctrl"} + B`, placement: "top", type: "light", size: "small", hasArrow: false }, { children: jsxRuntime.jsx(IconButton, Object.assign({ size: "small", isBasic: !editor.isActive("bold"), isPrimary: editor.isActive("bold"), isPill: false, onClick: handleBoldClick }, { children: jsxRuntime.jsx(SvgBoldStroke, {}) })) })), jsxRuntime.jsx(Tooltip, Object.assign({ content: `${(_d = (_c = i18n === null || i18n === void 0 ? void 0 : i18n.menu) === null || _c === void 0 ? void 0 : _c.italic) !== null && _d !== void 0 ? _d : "Italic text"} ${isMac() ? "Cmd" : "Ctrl"} + I`, placement: "top", type: "light", size: "small", hasArrow: false }, { children: jsxRuntime.jsx(IconButton, Object.assign({ size: "small", isBasic: !editor.isActive("italic"), isPrimary: editor.isActive("italic"), isPill: false, onClick: handleItalicClick }, { children: jsxRuntime.jsx(SvgItalicStroke, {}) })) })), jsxRuntime.jsx(VerticalDivider, {}), jsxRuntime.jsx(Tooltip, Object.assign({ content: (_f = (_e = i18n === null || i18n === void 0 ? void 0 : i18n.menu) === null || _e === void 0 ? void 0 : _e.mention) !== null && _f !== void 0 ? _f : "Add a mention", placement: "top", type: "light", size: "small", hasArrow: false }, { children: jsxRuntime.jsx(IconButton, Object.assign({ size: "small", isBasic: !editor.isActive("mention"), isPrimary: editor.isActive("mention"), isPill: false, onClick: handleMentionClick }, { children: jsxRuntime.jsx(SvgAtStroke, {}) })) })), jsxRuntime.jsx(Tooltip, Object.assign({ style: { textAlign: "center" }, content: (_h = (_g = i18n === null || i18n === void 0 ? void 0 : i18n.menu) === null || _g === void 0 ? void 0 : _g.attachment) !== null && _h !== void 0 ? _h : (jsxRuntime.jsxs("span", { children: ["Upload images and video.", " ", jsxRuntime.jsxs("span", Object.assign({ style: { color: theme.palette.grey[600] } }, { children: [" ", jsxRuntime.jsx("br", {}), " Max size: 5GB", " "] }))] })), placement: "top", type: "light", size: "small", hasArrow: true }, { children: jsxRuntime.jsx(IconButton, Object.assign({ size: "small", isBasic: !editor.isActive("attachment"), isPrimary: editor.isActive("attachment"), isPill: false, onClick: handleAttachmentClick }, { children: jsxRuntime.jsx(SvgClipboard, {}) })) }))] })) }));
3103
3126
  };
3104
3127
 
3105
3128
  const CustomMention = Mention__default["default"].extend({
@@ -3276,7 +3299,7 @@ const editorExtensions = ({ placeholderOptions, mentionableUsers, }) => {
3276
3299
  },
3277
3300
  }),
3278
3301
  Dropcursor__default["default"].configure({
3279
- color: "#ff0000",
3302
+ color: getColor(colors.accentHue, 700),
3280
3303
  width: 3,
3281
3304
  }),
3282
3305
  Placeholder__default["default"].configure(Object.assign({ placeholder: ({ node }) => {
@@ -3348,20 +3371,20 @@ const editorExtensions = ({ placeholderOptions, mentionableUsers, }) => {
3348
3371
  ];
3349
3372
  };
3350
3373
 
3351
- var _circle$2, _path$o, _path2$6;
3352
- function _extends$s() { _extends$s = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$s.apply(this, arguments); }
3353
- const SvgRemoveMediaIcon = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
3374
+ var _circle$3, _path$q, _path2$6;
3375
+ function _extends$v() { return _extends$v = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$v.apply(null, arguments); }
3376
+ const SvgRemoveMediaIcon = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$v({
3354
3377
  width: 56,
3355
3378
  height: 56,
3356
3379
  viewBox: "0 0 56 56",
3357
3380
  fill: "#68737d",
3358
3381
  xmlns: "http://www.w3.org/2000/svg"
3359
- }, props), _circle$2 || (_circle$2 = /*#__PURE__*/React__namespace.createElement("circle", {
3382
+ }, props), _circle$3 || (_circle$3 = /*#__PURE__*/React__namespace.createElement("circle", {
3360
3383
  cx: 28,
3361
3384
  cy: 28,
3362
3385
  r: 28,
3363
3386
  fill: "#edf7ff"
3364
- })), _path$o || (_path$o = /*#__PURE__*/React__namespace.createElement("path", {
3387
+ })), _path$q || (_path$q = /*#__PURE__*/React__namespace.createElement("path", {
3365
3388
  d: "M16.929 16.929L39.071 39.071",
3366
3389
  stroke: "currentColor",
3367
3390
  strokeWidth: 4
@@ -3380,176 +3403,149 @@ const StyledDeleteThumbnailX = styled__default["default"].div `
3380
3403
  width: 32px;
3381
3404
  height: 32px;
3382
3405
  opacity: 0;
3406
+ transition: opacity 0.2s;
3383
3407
  z-index: 2;
3408
+ color: ${({ theme }) => theme.palette.grey[800]};
3384
3409
  `;
3385
3410
  const DeleteThumbnailX = ({ deleteThumbnail }) => {
3386
3411
  return (jsxRuntime.jsx(StyledDeleteThumbnailX, Object.assign({ className: "deleteThumbnail" }, { children: jsxRuntime.jsx(SvgRemoveMediaIcon, { onClick: (e) => deleteThumbnail(e) }) })));
3387
3412
  };
3388
3413
 
3389
- const ImageCard = styled__default["default"](SpecialCard) `
3390
- padding: 0;
3391
- :hover .deleteThumbnail {
3392
- opacity: 1;
3393
- }
3394
- `;
3395
- const Preview$1 = styled__default["default"].div `
3396
- display: flex;
3397
- justify-content: center;
3398
- align-items: center;
3399
- height: 150px;
3400
- width: 100%;
3401
- background-image: url(${(props) => props.url});
3402
- background-color: ${({ theme }) => theme.palette.grey[100]};
3403
- background-size: contain;
3404
- background-position: center;
3405
- background-repeat: no-repeat;
3406
- `;
3407
- const ImageThumbnail = ({ src, index = 0, removeThumbnail, clickThumbnail, showX = true, isLoadingMedia = false, isError = false, }) => {
3408
- const handleCancel = (e) => {
3409
- e.stopPropagation();
3410
- if (removeThumbnail)
3411
- removeThumbnail(index);
3412
- };
3413
- return (jsxRuntime.jsxs(ImageCard, Object.assign({ onClick: clickThumbnail }, { children: [isLoadingMedia && (jsxRuntime.jsx(Preview$1, Object.assign({ url: "" }, { children: jsxRuntime.jsx(reactLoaders.Spinner, { style: {
3414
- display: "flex",
3415
- alignItems: "center",
3416
- justifyContent: "center",
3417
- }, size: "large" }) }))), isError && (
3418
- // todo: add error icon
3419
- jsxRuntime.jsx("span", { children: "error uploading media" })), !isLoadingMedia && (jsxRuntime.jsx(Preview$1, Object.assign({ url: src }, { children: showX && (jsxRuntime.jsx(DeleteThumbnailX, { deleteThumbnail: (e) => handleCancel(e) })) })))] })));
3420
- };
3421
-
3422
- var _circle$1, _path$n;
3423
- function _extends$r() { _extends$r = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$r.apply(this, arguments); }
3424
- const SvgVideoPlayIcon = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
3414
+ var _circle$2, _path$p;
3415
+ function _extends$u() { return _extends$u = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$u.apply(null, arguments); }
3416
+ const SvgVideoPlayIcon = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$u({
3425
3417
  width: 56,
3426
3418
  height: 56,
3427
3419
  viewBox: "0 0 56 56",
3428
3420
  fill: "none",
3429
3421
  xmlns: "http://www.w3.org/2000/svg"
3430
- }, props), _circle$1 || (_circle$1 = /*#__PURE__*/React__namespace.createElement("circle", {
3422
+ }, props), _circle$2 || (_circle$2 = /*#__PURE__*/React__namespace.createElement("circle", {
3431
3423
  cx: 28,
3432
3424
  cy: 28,
3433
3425
  r: 28,
3434
3426
  fill: "white"
3435
- })), _path$n || (_path$n = /*#__PURE__*/React__namespace.createElement("path", {
3427
+ })), _path$p || (_path$p = /*#__PURE__*/React__namespace.createElement("path", {
3436
3428
  d: "M47 28L18.5 44.4545L18.5 11.5455L47 28Z",
3437
3429
  fill: "currentColor"
3438
3430
  })));
3439
3431
 
3440
- const VideoCard = styled__default["default"](SpecialCard) `
3432
+ const ImageCard = styled__default["default"](SpecialCard) `
3441
3433
  padding: 0;
3442
3434
  position: relative;
3443
3435
  overflow: hidden;
3444
-
3445
- &:hover .deleteThumbnail {
3446
- opacity: 1;
3447
- z-index: 9999;
3448
- }
3436
+ width: 90px;
3449
3437
 
3450
3438
  &:before {
3451
3439
  content: "";
3440
+ font-size: ${({ theme }) => theme.fontSizes.xs};
3452
3441
  position: absolute;
3442
+ padding: ${({ theme }) => theme.space.xs};
3453
3443
  top: 0;
3454
3444
  left: 0;
3455
3445
  width: 100%;
3456
3446
  height: 100%;
3457
- background-color: ${({ theme }) => theme.palette.grey[800]};
3458
- opacity: 0.3;
3459
- z-index: 1;
3447
+ background-color: ${({ theme }) => theme.palette.grey[800]}00; // 0% opacity
3448
+ transition: opacity 0.2s;
3460
3449
  }
3461
3450
 
3462
- > svg {
3463
- position: absolute;
3464
- top: 50%;
3465
- left: 50%;
3466
- transform: translate(-50%, -50%);
3467
- width: 32px;
3468
- height: 32px;
3469
- z-index: 2;
3451
+ &:hover {
3452
+ .deleteThumbnail {
3453
+ opacity: 1;
3454
+ }
3455
+ &:before {
3456
+ background-color: ${({ theme }) => theme.palette.grey[800]}4d; // 30% opacity
3457
+ }
3458
+ }
3459
+ ${(p) => p.error &&
3460
+ `
3461
+ &:before{
3462
+ content: "Error: ${p.error}";
3463
+ color: ${p.theme.palette.white};
3464
+ background-color: ${p.theme.palette.grey[800]}b3; // 0.7 opacity
3465
+ }
3466
+ `}
3467
+ ${(p) => p.isLoading &&
3468
+ `
3469
+ &:before{
3470
+ background-color: ${p.theme.palette.grey[800]}b3; // 0.7 opacity
3471
+ }
3472
+ `}
3473
+ &.video {
3474
+ svg {
3475
+ color: ${({ theme }) => theme.palette.grey[800]};
3476
+ position: absolute;
3477
+ top: 50%;
3478
+ left: 50%;
3479
+ transform: translate(-50%, -50%);
3480
+ width: 32px;
3481
+ height: 32px;
3482
+ z-index: 2;
3483
+ }
3470
3484
  }
3471
3485
  `;
3472
3486
  const Preview = styled__default["default"].div `
3473
- padding: ${({ theme }) => theme.space.md};
3474
3487
  display: flex;
3475
3488
  justify-content: center;
3476
3489
  align-items: center;
3477
- height: 150px;
3490
+ height: 100px;
3478
3491
  width: 100%;
3492
+ color: ${({ theme }) => theme.palette.white};
3493
+
3494
+ ${p => p.url &&
3495
+ `
3496
+ background-image: url(${p.url});
3497
+ background-color: ${p.theme.palette.grey[100]};
3498
+ background-size: cover;
3499
+ background-position: center;
3500
+ background-repeat: no-repeat;
3501
+ `}
3479
3502
 
3480
3503
  > video {
3481
3504
  width: 100%;
3482
3505
  height: 100%;
3483
3506
  }
3484
3507
  `;
3485
- const VideoThumbnail = ({ src, index = 0, removeThumbnail, clickThumbnail, showX = true, isLoadingMedia = false, isError = false, }) => {
3508
+ const Thumbnail = ({ src, type, removeThumbnail, clickThumbnail, showX, isLoadingMedia, error = "", }) => {
3486
3509
  const handleCancel = (e) => {
3487
3510
  e.stopPropagation();
3488
3511
  if (removeThumbnail)
3489
- removeThumbnail(index);
3512
+ removeThumbnail();
3490
3513
  };
3491
- return (jsxRuntime.jsxs(VideoCard, Object.assign({ onClick: clickThumbnail }, { children: [isLoadingMedia && (jsxRuntime.jsx(Preview, { children: jsxRuntime.jsx(reactLoaders.Spinner, { style: {
3492
- display: "flex",
3493
- alignItems: "center",
3494
- justifyContent: "center",
3495
- }, size: "large" }) })), isError && (
3496
- // todo: add error icon
3497
- jsxRuntime.jsx("span", { children: "error uploading media" })), !isLoadingMedia && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [showX && (jsxRuntime.jsx(DeleteThumbnailX, { deleteThumbnail: (e) => handleCancel(e) })), jsxRuntime.jsx(Preview, { children: jsxRuntime.jsx("video", Object.assign({ src: src }, { children: jsxRuntime.jsx("track", { kind: "captions" }) })) }), jsxRuntime.jsx(SvgVideoPlayIcon, {})] }))] })));
3514
+ return (jsxRuntime.jsx(ImageCard, Object.assign({ onClick: clickThumbnail, className: type.includes("video") ? "video" : "image", error: error, isLoading: isLoadingMedia }, { children: isLoadingMedia ? (jsxRuntime.jsx(Preview, Object.assign({ url: src }, { children: jsxRuntime.jsx(reactLoaders.Spinner, { style: {
3515
+ display: "flex",
3516
+ position: "absolute",
3517
+ color: "white",
3518
+ alignItems: "center",
3519
+ justifyContent: "center",
3520
+ }, size: "large" }) }))) : (jsxRuntime.jsxs(Preview, Object.assign({ url: src }, { children: [showX && (jsxRuntime.jsx(DeleteThumbnailX, { deleteThumbnail: (e) => handleCancel(e) })), type.includes("video") && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("video", Object.assign({ src: src }, { children: jsxRuntime.jsx("track", { kind: "captions" }) })), jsxRuntime.jsx(SvgVideoPlayIcon, { opacity: error ? "0.3" : "1" })] }))] }))) })));
3498
3521
  };
3499
3522
 
3500
- const UgGrid = styled__default["default"](reactGrid.Grid) `
3501
- padding-left: 0;
3502
- padding-right: 0;
3503
- `;
3504
- /**
3505
- * The Grid component is a framework for building modular layouts.
3506
- * <hr>
3507
- * Used for this:
3508
- - To structure the layout of a page
3509
- */
3510
- const Grid = (props) => jsxRuntime.jsx(UgGrid, Object.assign({}, props));
3511
-
3512
- const Row$1 = (props) => jsxRuntime.jsx(reactGrid.Row, Object.assign({}, props));
3513
-
3514
- const StyledCol$1 = styled__default["default"](reactGrid.Col) `
3515
- margin-bottom: ${theme.space.lg};
3516
-
3517
- @media screen and (max-width: ${theme.breakpoints.sm}) {
3518
- margin-bottom: ${theme.space.md};
3519
- }
3523
+ const FlexContainer = styled.styled.div `
3524
+ display: flex;
3525
+ gap: ${({ theme }) => theme.space.xs};
3526
+ flex-wrap: wrap;
3520
3527
  `;
3521
- const Col = (props) => jsxRuntime.jsx(StyledCol$1, Object.assign({}, props));
3522
-
3523
3528
  const ThumbnailContainer = ({ openLightbox }) => {
3524
- const { thumbnails, removeThumbnail } = useChatContext();
3525
- if (!thumbnails || thumbnails.length === 0) {
3526
- return null;
3527
- }
3528
- const mediaFiles = [];
3529
- thumbnails.forEach((file) => {
3530
- mediaFiles.push({
3529
+ const { thumbnails, removeThumbnail, onDeleteThumbnail } = useChatContext();
3530
+ const mediaFiles = React.useMemo(() => {
3531
+ return thumbnails.map((file) => ({
3531
3532
  fileName: file.name,
3532
3533
  fileType: file.type,
3533
- status: file.isLoadingMedia ? "uploading" : "success",
3534
- previewUrl: URL.createObjectURL(file),
3535
- });
3536
- });
3537
- console.log("mediafiles", mediaFiles);
3534
+ previewUrl: file.url,
3535
+ id: file.id,
3536
+ isLoadingMedia: file.isLoadingMedia,
3537
+ error: file.error,
3538
+ }));
3539
+ }, [thumbnails]);
3538
3540
  if (!mediaFiles || mediaFiles.length === 0) {
3539
3541
  return null;
3540
3542
  }
3541
- return (jsxRuntime.jsx(Grid, { children: jsxRuntime.jsx(Row$1, Object.assign({ className: "responsive-container" }, { children: mediaFiles.map((file, index) => {
3542
- // Check if item is an image or a video
3543
- if (file.fileType.includes("image"))
3544
- return (jsxRuntime.jsx(Col, Object.assign({ xs: 12, sm: 3, xl: 3, lg: 3, className: "flex-3-sm" }, { children: jsxRuntime.jsx(ImageThumbnail, { src: file.previewUrl, index: index, showX: true, isLoadingMedia: file.status === "uploading", removeThumbnail: () => removeThumbnail(index), clickThumbnail: () => {
3545
- openLightbox(thumbnails[index], index);
3546
- } }, index) })));
3547
- if (file.fileType.includes("video"))
3548
- return (jsxRuntime.jsx(Col, Object.assign({ xs: 12, sm: 3, className: "flex-3-sm" }, { children: jsxRuntime.jsx(VideoThumbnail, { src: file.previewUrl, index: index, showX: true, isLoadingMedia: file.status === "uploading", removeThumbnail: () => removeThumbnail(index), clickThumbnail: () => {
3549
- openLightbox(thumbnails[index], index);
3550
- } }, index) })));
3551
- return null;
3552
- }) })) }));
3543
+ return (jsxRuntime.jsx(FlexContainer, { children: mediaFiles.map((file, index) => (jsxRuntime.jsx(Thumbnail, { src: file.previewUrl, showX: true, type: file.fileType, isLoadingMedia: file.isLoadingMedia, error: file.error, removeThumbnail: () => {
3544
+ removeThumbnail(index);
3545
+ onDeleteThumbnail(file.id);
3546
+ }, clickThumbnail: () => {
3547
+ openLightbox(index);
3548
+ } }, file.id))) }));
3553
3549
  };
3554
3550
 
3555
3551
  const UgModalBody = styled__default["default"](reactModals.Body) `
@@ -3618,28 +3614,28 @@ Lightbox.Body = ModalBody; // Includes Main and Details
3618
3614
  Lightbox.Footer = Footer$3;
3619
3615
  Lightbox.Close = reactModals.Close;
3620
3616
 
3621
- var _path$m;
3622
- function _extends$q() { _extends$q = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$q.apply(this, arguments); }
3623
- const SvgChevronLeftStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
3617
+ var _path$o;
3618
+ function _extends$t() { return _extends$t = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$t.apply(null, arguments); }
3619
+ const SvgChevronLeftStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
3624
3620
  xmlns: "http://www.w3.org/2000/svg",
3625
3621
  width: 16,
3626
3622
  height: 16,
3627
3623
  focusable: "false",
3628
3624
  viewBox: "0 0 16 16"
3629
- }, props), _path$m || (_path$m = /*#__PURE__*/React__namespace.createElement("path", {
3625
+ }, props), _path$o || (_path$o = /*#__PURE__*/React__namespace.createElement("path", {
3630
3626
  fill: "currentColor",
3631
3627
  d: "M10.39 12.688a.5.5 0 01-.718.69l-.062-.066-4-5a.5.5 0 01-.054-.542l.054-.082 4-5a.5.5 0 01.83.55l-.05.074L6.641 8l3.75 4.688z"
3632
3628
  })));
3633
3629
 
3634
- var _path$l;
3635
- function _extends$p() { _extends$p = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$p.apply(this, arguments); }
3636
- const SvgChevronRightStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
3630
+ var _path$n;
3631
+ function _extends$s() { return _extends$s = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$s.apply(null, arguments); }
3632
+ const SvgChevronRightStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
3637
3633
  xmlns: "http://www.w3.org/2000/svg",
3638
3634
  width: 16,
3639
3635
  height: 16,
3640
3636
  focusable: "false",
3641
3637
  viewBox: "0 0 16 16"
3642
- }, props), _path$l || (_path$l = /*#__PURE__*/React__namespace.createElement("path", {
3638
+ }, props), _path$n || (_path$n = /*#__PURE__*/React__namespace.createElement("path", {
3643
3639
  fill: "currentColor",
3644
3640
  d: "M5.61 3.312a.5.5 0 01.718-.69l.062.066 4 5a.5.5 0 01.054.542l-.054.082-4 5a.5.5 0 01-.83-.55l.05-.074L9.359 8l-3.75-4.688z"
3645
3641
  })));
@@ -3862,115 +3858,305 @@ Slider.Slide = Slide;
3862
3858
  Slider.PrevButton = PrevButton;
3863
3859
  Slider.NextButton = NextButton;
3864
3860
 
3865
- const UgProgress = styled__default["default"](reactLoaders.Progress) ``;
3866
- /**
3867
- * A Progress loader communicates progress when downloading or uploading content.
3868
- * <hr>
3869
- * Used for this:
3870
- * - To communicate the amount of time left when downloading or uploading content
3871
- *
3872
- Not for this:
3873
- - When the loading time is unknown, use a Spinner instead
3874
- - When loading page content, use a Skeleton loader instead
3875
- */
3876
- const Progress = React.forwardRef((props, ref) => (jsxRuntime.jsx(UgProgress, Object.assign({ ref: ref }, props))));
3877
-
3878
- const Wrapper$1 = styled__default["default"].div `
3879
- position: absolute;
3880
- bottom: ${({ theme }) => theme.space.sm};
3881
- z-index: 1;
3882
- `;
3883
- const Content$1 = styled__default["default"].div `
3884
- display: flex;
3885
- background-color: ${({ theme }) => theme.palette.grey[800]};
3886
- border-radius: 2px;
3887
- width: auto;
3888
- padding: 2px 4px;
3889
- display: inline-flex;
3890
- color: white;
3891
- align-items: center;
3892
- justify-content: center;
3893
- min-height: 16px;
3894
- `;
3895
- const PlayerTooltip = (_a) => {
3896
- var { children } = _a, props = __rest(_a, ["children"]);
3897
- return (jsxRuntime.jsx(Wrapper$1, Object.assign({}, props, { children: jsxRuntime.jsx(Content$1, { children: children }) })));
3898
- };
3899
-
3900
- var _path$k;
3901
- function _extends$o() { _extends$o = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$o.apply(this, arguments); }
3902
- const SvgPlayFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$o({
3861
+ var _path$m, _path2$5;
3862
+ function _extends$r() { return _extends$r = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$r.apply(null, arguments); }
3863
+ const SvgVolumeMutedFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
3903
3864
  xmlns: "http://www.w3.org/2000/svg",
3904
3865
  width: 16,
3905
3866
  height: 16,
3906
3867
  focusable: "false",
3907
3868
  viewBox: "0 0 16 16"
3908
- }, props), _path$k || (_path$k = /*#__PURE__*/React__namespace.createElement("path", {
3869
+ }, props), _path$m || (_path$m = /*#__PURE__*/React__namespace.createElement("path", {
3870
+ stroke: "currentColor",
3871
+ strokeLinecap: "round",
3872
+ d: "M11.5 10l4-4m-4 0l4 4"
3873
+ })), _path2$5 || (_path2$5 = /*#__PURE__*/React__namespace.createElement("path", {
3909
3874
  fill: "currentColor",
3910
- d: "M6 15.79c-.13 0-.26-.03-.38-.08a.977.977 0 01-.62-.92V1.21a1 1 0 01.62-.93C6 .12 6.42.21 6.71.5l6.44 6.44c.58.58.58 1.54 0 2.12L6.71 15.5c-.19.19-.45.29-.71.29z"
3875
+ d: "M9 15.29c-.26 0-.51-.1-.71-.29l-4-4H1c-.55 0-1-.45-1-1V6c0-.55.45-1 1-1h3.29l4-4a1.002 1.002 0 011.71.71V14.3a.986.986 0 01-1 .99z"
3911
3876
  })));
3912
3877
 
3913
- var _g$1;
3914
- function _extends$n() { _extends$n = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$n.apply(this, arguments); }
3915
- const SvgPauseFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$n({
3878
+ var _path$l, _path2$4;
3879
+ function _extends$q() { return _extends$q = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$q.apply(null, arguments); }
3880
+ const SvgVolumeUnmutedFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
3916
3881
  xmlns: "http://www.w3.org/2000/svg",
3917
3882
  width: 16,
3918
3883
  height: 16,
3919
3884
  focusable: "false",
3920
3885
  viewBox: "0 0 16 16"
3921
- }, props), _g$1 || (_g$1 = /*#__PURE__*/React__namespace.createElement("g", {
3922
- fill: "currentColor"
3923
- }, /*#__PURE__*/React__namespace.createElement("rect", {
3924
- width: 4,
3925
- height: 14,
3926
- x: 3,
3927
- y: 1,
3928
- rx: 1,
3929
- ry: 1
3930
- }), /*#__PURE__*/React__namespace.createElement("rect", {
3931
- width: 4,
3932
- height: 14,
3933
- x: 9,
3934
- y: 1,
3935
- rx: 1,
3936
- ry: 1
3937
- }))));
3938
-
3939
- var _path$j, _path2$5, _path3$1;
3940
- function _extends$m() { _extends$m = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$m.apply(this, arguments); }
3941
- const SvgForwardSecondsFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$m({
3942
- width: 16,
3943
- height: 16,
3944
- viewBox: "0 0 16 16",
3886
+ }, props), _path$l || (_path$l = /*#__PURE__*/React__namespace.createElement("path", {
3887
+ fill: "currentColor",
3888
+ d: "M9 15.29c-.26 0-.51-.1-.71-.29l-4-4H1c-.55 0-1-.45-1-1V6c0-.55.45-1 1-1h3.29l4-4a1.002 1.002 0 011.71.71V14.3a.986.986 0 01-1 .99z"
3889
+ })), _path2$4 || (_path2$4 = /*#__PURE__*/React__namespace.createElement("path", {
3945
3890
  fill: "none",
3946
- xmlns: "http://www.w3.org/2000/svg"
3947
- }, props), _path$j || (_path$j = /*#__PURE__*/React__namespace.createElement("path", {
3948
- fillRule: "evenodd",
3949
- clipRule: "evenodd",
3950
- d: "M11.659 3.5C10.7411 2.85974 9.65081 2.5 8.5 2.5C5.45228 2.5 3 4.95228 3 8C3 11.0477 5.45228 13.5 8.5 13.5C10.2023 13.5 11.7457 12.7171 12.8191 11.3753C13.1641 10.944 13.7934 10.8741 14.2247 11.2191C14.656 11.5641 14.7259 12.1934 14.3809 12.6247C12.9372 14.4292 10.8263 15.5 8.5 15.5C4.34772 15.5 1 12.1523 1 8C1 3.84772 4.34772 0.5 8.5 0.5C10.1564 0.5 11.7168 1.04496 13 2.00147V1C13 0.447715 13.4477 0 14 0C14.5523 0 15 0.447715 15 1V4C15 4.85228 14.3523 5.5 13.5 5.5H10.5C9.94771 5.5 9.5 5.05228 9.5 4.5C9.5 3.94772 9.94771 3.5 10.5 3.5H11.659Z",
3951
- fill: "currentColor"
3952
- })), _path2$5 || (_path2$5 = /*#__PURE__*/React__namespace.createElement("path", {
3953
- d: "M5.5 7.63073V7.07008H6.67566V11H6.02566V7.63073H5.5Z",
3954
- fill: "currentColor"
3955
- })), _path3$1 || (_path3$1 = /*#__PURE__*/React__namespace.createElement("path", {
3956
- d: "M7.56085 8.98383C7.56085 8.36208 7.67013 7.87691 7.88868 7.5283C8.111 7.1761 8.49158 7 9.03042 7C9.56927 7 9.94797 7.1761 10.1665 7.5283C10.3888 7.87691 10.5 8.36208 10.5 8.98383C10.5 9.61276 10.3888 10.1051 10.1665 10.4609C9.94797 10.8131 9.56927 10.9892 9.03042 10.9892C8.49158 10.9892 8.111 10.8131 7.88868 10.4609C7.67013 10.1051 7.56085 9.61276 7.56085 8.98383ZM9.86695 8.98383C9.86695 8.69272 9.84623 8.44654 9.80478 8.24528C9.7671 8.04403 9.68797 7.8805 9.56738 7.75472C9.4468 7.62534 9.26782 7.56065 9.03042 7.56065C8.79303 7.56065 8.61405 7.62534 8.49346 7.75472C8.37288 7.8805 8.29187 8.04403 8.25042 8.24528C8.21274 8.44654 8.1939 8.69272 8.1939 8.98383C8.1939 9.28571 8.21274 9.53908 8.25042 9.74394C8.2881 9.94879 8.36723 10.1141 8.48781 10.2399C8.61216 10.3657 8.79303 10.4286 9.03042 10.4286C9.26782 10.4286 9.4468 10.3657 9.56738 10.2399C9.69173 10.1141 9.77275 9.94879 9.81043 9.74394C9.84811 9.53908 9.86695 9.28571 9.86695 8.98383Z",
3957
- fill: "currentColor"
3891
+ stroke: "currentColor",
3892
+ strokeLinecap: "round",
3893
+ d: "M11.77 9.77c.45-.45.73-1.08.73-1.77s-.28-1.31-.73-1.77m2.17 5.6c.97-.99 1.56-2.34 1.56-3.83 0-1.52-.62-2.89-1.61-3.89"
3958
3894
  })));
3959
3895
 
3960
- var _path$i, _path2$4, _path3;
3961
- function _extends$l() { _extends$l = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$l.apply(this, arguments); }
3962
- const SvgBackSecondsFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$l({
3963
- width: 16,
3964
- height: 16,
3965
- viewBox: "0 0 16 16",
3966
- fill: "none",
3967
- xmlns: "http://www.w3.org/2000/svg"
3968
- }, props), _path$i || (_path$i = /*#__PURE__*/React__namespace.createElement("path", {
3896
+ const ControlButton = styled__default["default"](IconButton) `
3897
+ color: ${({ theme }) => theme.palette.grey[700]};
3898
+ `;
3899
+
3900
+ const AudioButton = () => {
3901
+ const [hasAudio, setHasAudio] = React.useState(false);
3902
+ const { isMuted, setMuted, context } = Video.useVideoContext();
3903
+ const { player } = context;
3904
+ const checkAudio = (video) => {
3905
+ if (!video) {
3906
+ return false;
3907
+ }
3908
+ const videohasAudio = video.mozHasAudio ||
3909
+ Boolean(video.webkitAudioDecodedByteCount) ||
3910
+ Boolean(video.audioTracks && video.audioTracks.length);
3911
+ setHasAudio(videohasAudio);
3912
+ };
3913
+ const hasVolume = (video) => {
3914
+ if (!video) {
3915
+ return false;
3916
+ }
3917
+ return video.volume > 0;
3918
+ };
3919
+ React.useEffect(() => {
3920
+ if (player && (player === null || player === void 0 ? void 0 : player.ref)) {
3921
+ setMuted(!hasVolume(player.ref.current));
3922
+ checkAudio(player.ref.current);
3923
+ }
3924
+ }, [context.isPlaying, isMuted, player, setMuted]);
3925
+ return (jsxRuntime.jsx(ControlButton, Object.assign({ disabled: !hasAudio, onClick: () => {
3926
+ if (player === null || player === void 0 ? void 0 : player.ref.current) {
3927
+ player.ref.current.volume = player.ref.current.volume > 0 ? 0 : 1;
3928
+ setMuted(!player.ref.current.volume);
3929
+ }
3930
+ } }, { children: isMuted || !hasAudio ? jsxRuntime.jsx(SvgVolumeMutedFill, {}) : jsxRuntime.jsx(SvgVolumeUnmutedFill, {}) })));
3931
+ };
3932
+
3933
+ const ProgressContext = React.createContext(null);
3934
+ const ProgressContextProvider = ({ children, }) => {
3935
+ const [isGrabbing, setIsGrabbing] = React.useState(false);
3936
+ const [fromEnd, setFromEnd] = React.useState(false);
3937
+ const [activeBookmark, setactiveBookmark] = React.useState(undefined);
3938
+ const progressContextValue = React.useMemo(() => ({
3939
+ isGrabbing,
3940
+ fromEnd,
3941
+ activeBookmark,
3942
+ setIsGrabbing,
3943
+ setFromEnd,
3944
+ setactiveBookmark,
3945
+ reset: () => {
3946
+ setIsGrabbing(false);
3947
+ setFromEnd(false);
3948
+ setactiveBookmark(undefined);
3949
+ },
3950
+ }), [isGrabbing, fromEnd, activeBookmark]);
3951
+ return (jsxRuntime.jsx(ProgressContext.Provider, Object.assign({ value: progressContextValue }, { children: children })));
3952
+ };
3953
+ const useProgressContext = () => {
3954
+ const context = React.useContext(ProgressContext);
3955
+ if (!context)
3956
+ throw new Error("Provider not found for ProgressContextProvider");
3957
+ return context; // Now we can use the context in the component, SAFELY.
3958
+ };
3959
+
3960
+ var _g$2;
3961
+ function _extends$p() { return _extends$p = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$p.apply(null, arguments); }
3962
+ const SvgGrip = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
3963
+ xmlns: "http://www.w3.org/2000/svg",
3964
+ width: 16,
3965
+ height: 16,
3966
+ focusable: "false",
3967
+ viewBox: "0 0 16 16"
3968
+ }, props), _g$2 || (_g$2 = /*#__PURE__*/React__namespace.createElement("g", {
3969
+ fill: "currentColor"
3970
+ }, /*#__PURE__*/React__namespace.createElement("rect", {
3971
+ width: 2,
3972
+ height: 2,
3973
+ x: 5,
3974
+ y: 1,
3975
+ rx: 0.5,
3976
+ ry: 0.5
3977
+ }), /*#__PURE__*/React__namespace.createElement("rect", {
3978
+ width: 2,
3979
+ height: 2,
3980
+ x: 9,
3981
+ y: 1,
3982
+ rx: 0.5,
3983
+ ry: 0.5
3984
+ }), /*#__PURE__*/React__namespace.createElement("rect", {
3985
+ width: 2,
3986
+ height: 2,
3987
+ x: 5,
3988
+ y: 5,
3989
+ rx: 0.5,
3990
+ ry: 0.5
3991
+ }), /*#__PURE__*/React__namespace.createElement("rect", {
3992
+ width: 2,
3993
+ height: 2,
3994
+ x: 9,
3995
+ y: 5,
3996
+ rx: 0.5,
3997
+ ry: 0.5
3998
+ }), /*#__PURE__*/React__namespace.createElement("rect", {
3999
+ width: 2,
4000
+ height: 2,
4001
+ x: 5,
4002
+ y: 9,
4003
+ rx: 0.5,
4004
+ ry: 0.5
4005
+ }), /*#__PURE__*/React__namespace.createElement("rect", {
4006
+ width: 2,
4007
+ height: 2,
4008
+ x: 9,
4009
+ y: 9,
4010
+ rx: 0.5,
4011
+ ry: 0.5
4012
+ }), /*#__PURE__*/React__namespace.createElement("rect", {
4013
+ width: 2,
4014
+ height: 2,
4015
+ x: 5,
4016
+ y: 13,
4017
+ rx: 0.5,
4018
+ ry: 0.5
4019
+ }), /*#__PURE__*/React__namespace.createElement("rect", {
4020
+ width: 2,
4021
+ height: 2,
4022
+ x: 9,
4023
+ y: 13,
4024
+ rx: 0.5,
4025
+ ry: 0.5
4026
+ }))));
4027
+
4028
+ const StyledGrabber = styled.styled.div `
4029
+ position: absolute;
4030
+ display: none;
4031
+ ${({ isEnd }) => isEnd
4032
+ ? `
4033
+ right: 0;
4034
+ border-top-right-radius: 2px;
4035
+ border-bottom-right-radius: 2px;
4036
+ `
4037
+ : `
4038
+ left: 0;
4039
+ border-top-left-radius: 2px;
4040
+ border-bottom-left-radius: 2px;
4041
+ `}
4042
+ height: 100%;
4043
+ width: 8px;
4044
+ background-color: white;
4045
+ z-index: 2;
4046
+ cursor: ew-resize;
4047
+
4048
+ div {
4049
+ display: flex;
4050
+ justify-content: center;
4051
+ align-items: center;
4052
+ height: 100%;
4053
+ width: 100%;
4054
+ color: ${({ theme }) => theme.palette.grey[500]};
4055
+ svg {
4056
+ width: auto;
4057
+ height: 50%;
4058
+ }
4059
+ }
4060
+ `;
4061
+ const activeBookMark = styled.css `
4062
+ height: 250%;
4063
+ transform: translateY(-30%);
4064
+ cursor: pointer;
4065
+ z-index: 2;
4066
+ border-radius: 4px;
4067
+
4068
+ ${StyledGrabber} {
4069
+ display: block;
4070
+ }
4071
+ `;
4072
+ const Rect = styled.styled.div `
4073
+ position: absolute;
4074
+ height: 110%;
4075
+ background-color: ${({ hue, theme }) => getColor(hue || theme.palette.grey[800], undefined, undefined, 0.8)};
4076
+ z-index: 1;
4077
+ border-radius: 2px;
4078
+ color: white;
4079
+ transition: width 0.1s ease;
4080
+
4081
+ &:hover {
4082
+ background-color: ${({ hue, theme }) => hue || theme.palette.grey[800]};
4083
+ ${activeBookMark}
4084
+ }
4085
+
4086
+ ${({ isActive }) => isActive && activeBookMark}
4087
+ ${({ isFocused }) => isFocused && activeBookMark}
4088
+ `;
4089
+ const StyledTooltip$1 = styled.styled(Tooltip) `
4090
+ margin-bottom: ${({ theme }) => theme.space.sm};
4091
+ color: ${({ tooltipColor }) => tooltipColor};
4092
+
4093
+ `;
4094
+ const Grabber = (props) => {
4095
+ const { observation } = props;
4096
+ const { setIsGrabbing, setactiveBookmark, setFromEnd } = useProgressContext();
4097
+ const handleDragStart = (e) => {
4098
+ setIsGrabbing(true);
4099
+ setactiveBookmark(observation);
4100
+ setFromEnd(!!props.isEnd);
4101
+ e.preventDefault();
4102
+ e.stopPropagation();
4103
+ };
4104
+ return (jsxRuntime.jsx(StyledGrabber, Object.assign({ isEnd: props.isEnd, onMouseDown: handleDragStart, onMouseMove: props.handleMouseMove }, { children: jsxRuntime.jsx("div", { children: jsxRuntime.jsx(SvgGrip, {}) }) })));
4105
+ };
4106
+ const Bookmark = (props) => {
4107
+ var _a, _b;
4108
+ const { start, end, hue, tooltipContent } = props;
4109
+ const { context } = Video.useVideoContext();
4110
+ const videoStart = context.part.start || 0;
4111
+ const videoEnd = context.part.end || ((_a = context.player) === null || _a === void 0 ? void 0 : _a.totalTime) || 0;
4112
+ const duration = videoEnd - videoStart || ((_b = context.player) === null || _b === void 0 ? void 0 : _b.totalTime) || 0; //relative
4113
+ const { activeBookmark } = useProgressContext();
4114
+ if (!context.player || !context.player.ref) {
4115
+ return null;
4116
+ }
4117
+ if (start > videoEnd || start < videoStart)
4118
+ return null;
4119
+ return (jsxRuntime.jsx(StyledTooltip$1, Object.assign({ content: tooltipContent, type: "light", size: "large", isTransparent: true }, { children: jsxRuntime.jsxs(Rect, Object.assign({ isActive: activeBookmark && activeBookmark.id === props.id, hue: hue, isFocused: props.isFocused, style: {
4120
+ left: `${((start - videoStart) / duration) * 100}%`,
4121
+ width: `${((end - start) / duration) * 100}%`,
4122
+ }, onClick: props.onClick }, { children: [jsxRuntime.jsx(Grabber, { observation: props }), jsxRuntime.jsx(Grabber, { isEnd: true, observation: props })] })) })));
4123
+ };
4124
+
4125
+ var _path$k, _path2$3, _path3$1;
4126
+ function _extends$o() { return _extends$o = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$o.apply(null, arguments); }
4127
+ const SvgBackSecondsFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$o({
4128
+ width: 16,
4129
+ height: 16,
4130
+ viewBox: "0 0 16 16",
4131
+ fill: "none",
4132
+ xmlns: "http://www.w3.org/2000/svg"
4133
+ }, props), _path$k || (_path$k = /*#__PURE__*/React__namespace.createElement("path", {
3969
4134
  fillRule: "evenodd",
3970
4135
  clipRule: "evenodd",
3971
4136
  d: "M4.34099 3.5C5.25886 2.85974 6.34919 2.5 7.5 2.5C10.5477 2.5 13 4.95228 13 8C13 11.0477 10.5477 13.5 7.5 13.5C5.79771 13.5 4.25432 12.7171 3.18087 11.3753C2.83586 10.944 2.20657 10.8741 1.7753 11.2191C1.34404 11.5641 1.27412 12.1934 1.61913 12.6247C3.06275 14.4292 5.17372 15.5 7.5 15.5C11.6523 15.5 15 12.1523 15 8C15 3.84772 11.6523 0.5 7.5 0.5C5.84359 0.5 4.28318 1.04496 3 2.00147V1C3 0.447715 2.55229 0 2 0C1.44771 0 1 0.447715 1 1V4C1 4.85228 1.64772 5.5 2.5 5.5H5.5C6.05229 5.5 6.5 5.05228 6.5 4.5C6.5 3.94772 6.05229 3.5 5.5 3.5H4.34099Z",
3972
4137
  fill: "currentColor"
3973
- })), _path2$4 || (_path2$4 = /*#__PURE__*/React__namespace.createElement("path", {
4138
+ })), _path2$3 || (_path2$3 = /*#__PURE__*/React__namespace.createElement("path", {
4139
+ d: "M5.5 7.63073V7.07008H6.67566V11H6.02566V7.63073H5.5Z",
4140
+ fill: "currentColor"
4141
+ })), _path3$1 || (_path3$1 = /*#__PURE__*/React__namespace.createElement("path", {
4142
+ d: "M7.56085 8.98383C7.56085 8.36208 7.67013 7.87691 7.88868 7.5283C8.111 7.1761 8.49158 7 9.03042 7C9.56927 7 9.94797 7.1761 10.1665 7.5283C10.3888 7.87691 10.5 8.36208 10.5 8.98383C10.5 9.61276 10.3888 10.1051 10.1665 10.4609C9.94797 10.8131 9.56927 10.9892 9.03042 10.9892C8.49158 10.9892 8.111 10.8131 7.88868 10.4609C7.67013 10.1051 7.56085 9.61276 7.56085 8.98383ZM9.86695 8.98383C9.86695 8.69272 9.84623 8.44654 9.80478 8.24528C9.7671 8.04403 9.68797 7.8805 9.56738 7.75472C9.4468 7.62534 9.26782 7.56065 9.03042 7.56065C8.79303 7.56065 8.61405 7.62534 8.49346 7.75472C8.37288 7.8805 8.29187 8.04403 8.25042 8.24528C8.21274 8.44654 8.1939 8.69272 8.1939 8.98383C8.1939 9.28571 8.21274 9.53908 8.25042 9.74394C8.2881 9.94879 8.36723 10.1141 8.48781 10.2399C8.61216 10.3657 8.79303 10.4286 9.03042 10.4286C9.26782 10.4286 9.4468 10.3657 9.56738 10.2399C9.69173 10.1141 9.77275 9.94879 9.81043 9.74394C9.84811 9.53908 9.86695 9.28571 9.86695 8.98383Z",
4143
+ fill: "currentColor"
4144
+ })));
4145
+
4146
+ var _path$j, _path2$2, _path3;
4147
+ function _extends$n() { return _extends$n = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$n.apply(null, arguments); }
4148
+ const SvgForwardSecondsFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$n({
4149
+ width: 16,
4150
+ height: 16,
4151
+ viewBox: "0 0 16 16",
4152
+ fill: "none",
4153
+ xmlns: "http://www.w3.org/2000/svg"
4154
+ }, props), _path$j || (_path$j = /*#__PURE__*/React__namespace.createElement("path", {
4155
+ fillRule: "evenodd",
4156
+ clipRule: "evenodd",
4157
+ d: "M11.659 3.5C10.7411 2.85974 9.65081 2.5 8.5 2.5C5.45228 2.5 3 4.95228 3 8C3 11.0477 5.45228 13.5 8.5 13.5C10.2023 13.5 11.7457 12.7171 12.8191 11.3753C13.1641 10.944 13.7934 10.8741 14.2247 11.2191C14.656 11.5641 14.7259 12.1934 14.3809 12.6247C12.9372 14.4292 10.8263 15.5 8.5 15.5C4.34772 15.5 1 12.1523 1 8C1 3.84772 4.34772 0.5 8.5 0.5C10.1564 0.5 11.7168 1.04496 13 2.00147V1C13 0.447715 13.4477 0 14 0C14.5523 0 15 0.447715 15 1V4C15 4.85228 14.3523 5.5 13.5 5.5H10.5C9.94771 5.5 9.5 5.05228 9.5 4.5C9.5 3.94772 9.94771 3.5 10.5 3.5H11.659Z",
4158
+ fill: "currentColor"
4159
+ })), _path2$2 || (_path2$2 = /*#__PURE__*/React__namespace.createElement("path", {
3974
4160
  d: "M5.5 7.63073V7.07008H6.67566V11H6.02566V7.63073H5.5Z",
3975
4161
  fill: "currentColor"
3976
4162
  })), _path3 || (_path3 = /*#__PURE__*/React__namespace.createElement("path", {
@@ -3978,8 +4164,47 @@ const SvgBackSecondsFill = props => /*#__PURE__*/React__namespace.createElement(
3978
4164
  fill: "currentColor"
3979
4165
  })));
3980
4166
 
3981
- var _path$h, _path2$3;
3982
- function _extends$k() { _extends$k = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$k.apply(this, arguments); }
4167
+ var _g$1;
4168
+ function _extends$m() { return _extends$m = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$m.apply(null, arguments); }
4169
+ const SvgPauseFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$m({
4170
+ xmlns: "http://www.w3.org/2000/svg",
4171
+ width: 16,
4172
+ height: 16,
4173
+ focusable: "false",
4174
+ viewBox: "0 0 16 16"
4175
+ }, props), _g$1 || (_g$1 = /*#__PURE__*/React__namespace.createElement("g", {
4176
+ fill: "currentColor"
4177
+ }, /*#__PURE__*/React__namespace.createElement("rect", {
4178
+ width: 4,
4179
+ height: 14,
4180
+ x: 3,
4181
+ y: 1,
4182
+ rx: 1,
4183
+ ry: 1
4184
+ }), /*#__PURE__*/React__namespace.createElement("rect", {
4185
+ width: 4,
4186
+ height: 14,
4187
+ x: 9,
4188
+ y: 1,
4189
+ rx: 1,
4190
+ ry: 1
4191
+ }))));
4192
+
4193
+ var _path$i;
4194
+ function _extends$l() { return _extends$l = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$l.apply(null, arguments); }
4195
+ const SvgPlayFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$l({
4196
+ xmlns: "http://www.w3.org/2000/svg",
4197
+ width: 16,
4198
+ height: 16,
4199
+ focusable: "false",
4200
+ viewBox: "0 0 16 16"
4201
+ }, props), _path$i || (_path$i = /*#__PURE__*/React__namespace.createElement("path", {
4202
+ fill: "currentColor",
4203
+ d: "M6 15.79c-.13 0-.26-.03-.38-.08a.977.977 0 01-.62-.92V1.21a1 1 0 01.62-.93C6 .12 6.42.21 6.71.5l6.44 6.44c.58.58.58 1.54 0 2.12L6.71 15.5c-.19.19-.45.29-.71.29z"
4204
+ })));
4205
+
4206
+ var _path$h, _path2$1;
4207
+ function _extends$k() { return _extends$k = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$k.apply(null, arguments); }
3983
4208
  const SvgPreviousFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$k({
3984
4209
  xmlns: "http://www.w3.org/2000/svg",
3985
4210
  width: 16,
@@ -3989,7 +4214,7 @@ const SvgPreviousFill = props => /*#__PURE__*/React__namespace.createElement("sv
3989
4214
  }, props), _path$h || (_path$h = /*#__PURE__*/React__namespace.createElement("path", {
3990
4215
  d: "M2.75 20C2.75 20.5523 3.19772 21 3.75 21C4.30228 21 4.75 20.5523 4.75 20L4.75 4C4.75 3.44772 4.30229 3 3.75 3C3.19772 3 2.75 3.44772 2.75 4V20Z",
3991
4216
  fill: "currentColor"
3992
- })), _path2$3 || (_path2$3 = /*#__PURE__*/React__namespace.createElement("path", {
4217
+ })), _path2$1 || (_path2$1 = /*#__PURE__*/React__namespace.createElement("path", {
3993
4218
  d: "M20.75 19.0526C20.75 20.4774 19.1383 21.305 17.9803 20.4748L7.51062 12.9682C6.50574 12.2477 6.54467 10.7407 7.5854 10.073L18.0551 3.35665C19.2198 2.60946 20.75 3.44583 20.75 4.82961L20.75 19.0526Z",
3994
4219
  fill: "currentColor"
3995
4220
  })));
@@ -4019,8 +4244,9 @@ const getNextPlaybackRate = (rate = 1) => {
4019
4244
  const StyledDiv$3 = styled__default["default"].div `
4020
4245
  display: flex;
4021
4246
  align-items: center;
4247
+ justify-content: center;
4022
4248
  `;
4023
- const ControlsGroupCenter = () => {
4249
+ const ControlsGroupCenter = (props) => {
4024
4250
  var _a;
4025
4251
  const [playBackRate, setPlayBackRate] = React.useState(1);
4026
4252
  const { context, togglePlay } = Video.useVideoContext();
@@ -4043,111 +4269,81 @@ const ControlsGroupCenter = () => {
4043
4269
  const nextTime = videoRef.currentTime + 10;
4044
4270
  videoRef.currentTime = nextTime;
4045
4271
  };
4046
- return (jsxRuntime.jsxs(StyledDiv$3, { children: [jsxRuntime.jsx(IconButton, Object.assign({ isBright: true, onClick: (e) => {
4272
+ return (jsxRuntime.jsxs(StyledDiv$3, Object.assign({}, props, { children: [jsxRuntime.jsx(ControlButton, Object.assign({ onClick: (e) => {
4047
4273
  if (videoRef) {
4048
4274
  videoRef.currentTime = 0;
4049
4275
  }
4050
4276
  e.stopPropagation();
4051
- } }, { children: jsxRuntime.jsx(SvgPreviousFill, {}) })), jsxRuntime.jsx(IconButton, Object.assign({ isBright: true, onClick: (e) => {
4277
+ } }, { children: jsxRuntime.jsx(SvgPreviousFill, {}) })), jsxRuntime.jsx(ControlButton, Object.assign({ onClick: (e) => {
4052
4278
  onRewind();
4053
4279
  e.stopPropagation();
4054
- } }, { children: jsxRuntime.jsx(SvgBackSecondsFill, {}) })), jsxRuntime.jsx(IconButton, Object.assign({ isBright: true, size: "large", onClick: togglePlay }, { children: isPlaying ? (jsxRuntime.jsx(SvgPauseFill, { style: { width: "24px", height: "24px" } })) : (jsxRuntime.jsx(SvgPlayFill, { style: { width: "24px", height: "24px" } })) })), jsxRuntime.jsx(IconButton, Object.assign({ isBright: true, onClick: (e) => {
4280
+ } }, { children: jsxRuntime.jsx(SvgBackSecondsFill, {}) })), jsxRuntime.jsx(ControlButton, Object.assign({ size: "large", onClick: togglePlay }, { children: isPlaying ? (jsxRuntime.jsx(SvgPauseFill, { style: { width: "24px", height: "24px" } })) : (jsxRuntime.jsx(SvgPlayFill, { style: { width: "24px", height: "24px" } })) })), jsxRuntime.jsx(ControlButton, Object.assign({ onClick: (e) => {
4055
4281
  onForward();
4056
4282
  e.stopPropagation();
4057
- } }, { children: jsxRuntime.jsx(SvgForwardSecondsFill, {}) })), jsxRuntime.jsx(IconButton, Object.assign({ isBright: true, isPill: true, onClick: (e) => {
4283
+ } }, { children: jsxRuntime.jsx(SvgForwardSecondsFill, {}) })), jsxRuntime.jsx(ControlButton, Object.assign({ isPill: true, onClick: (e) => {
4058
4284
  const newSpeed = getNextPlaybackRate(playBackRate);
4059
4285
  if (videoRef === null || videoRef === void 0 ? void 0 : videoRef.playbackRate) {
4060
4286
  setPlayBackRate(newSpeed);
4061
4287
  videoRef.playbackRate = newSpeed;
4062
4288
  }
4063
4289
  e.stopPropagation();
4064
- } }, { children: jsxRuntime.jsxs(SM, Object.assign({ isBold: true, style: { lineHeight: "16px" } }, { children: [playBackRate, "x"] })) }))] }));
4290
+ } }, { children: jsxRuntime.jsxs(SM, Object.assign({ isBold: true, style: { lineHeight: "16px" } }, { children: [playBackRate, "x"] })) }))] })));
4065
4291
  };
4066
4292
 
4067
- const StyledDiv$2 = styled__default["default"].div `
4068
- position: absolute;
4069
- bottom: ${({ theme }) => theme.space.sm};
4070
- right: 0;
4071
-
4072
- padding: 0 ${({ theme }) => theme.space.xs};
4073
-
4074
- span {
4075
- color: ${({ theme }) => theme.palette.grey[300]};
4076
- }
4077
- `;
4078
- const TimeLabel = ({ current, duration, }) => (jsxRuntime.jsx(StyledDiv$2, { children: jsxRuntime.jsxs(SM, Object.assign({ tag: "span" }, { children: [current, "/", duration] })) }));
4079
-
4080
- var _path$g, _path2$2;
4081
- function _extends$j() { _extends$j = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$j.apply(this, arguments); }
4082
- const SvgVolumeMutedFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$j({
4293
+ var _path$g, _circle$1;
4294
+ function _extends$j() { return _extends$j = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$j.apply(null, arguments); }
4295
+ const SvgTagStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$j({
4083
4296
  xmlns: "http://www.w3.org/2000/svg",
4084
4297
  width: 16,
4085
4298
  height: 16,
4086
4299
  focusable: "false",
4087
4300
  viewBox: "0 0 16 16"
4088
4301
  }, props), _path$g || (_path$g = /*#__PURE__*/React__namespace.createElement("path", {
4302
+ fill: "none",
4089
4303
  stroke: "currentColor",
4090
- strokeLinecap: "round",
4091
- d: "M11.5 10l4-4m-4 0l4 4"
4092
- })), _path2$2 || (_path2$2 = /*#__PURE__*/React__namespace.createElement("path", {
4093
- fill: "currentColor",
4094
- d: "M9 15.29c-.26 0-.51-.1-.71-.29l-4-4H1c-.55 0-1-.45-1-1V6c0-.55.45-1 1-1h3.29l4-4a1.002 1.002 0 011.71.71V14.3a.986.986 0 01-1 .99z"
4304
+ d: "M.5 1v5.3c0 .1.1.3.1.4l8.5 8.5c.2.2.5.2.7 0l5.3-5.3c.2-.2.2-.5 0-.7L6.6.6S6.4.5 6.3.5H1C.7.5.5.7.5 1z"
4305
+ })), _circle$1 || (_circle$1 = /*#__PURE__*/React__namespace.createElement("circle", {
4306
+ cx: 4,
4307
+ cy: 4,
4308
+ r: 1,
4309
+ fill: "currentColor"
4095
4310
  })));
4096
4311
 
4097
- var _path$f, _path2$1;
4098
- function _extends$i() { _extends$i = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$i.apply(this, arguments); }
4099
- const SvgVolumeUnmutedFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$i({
4100
- xmlns: "http://www.w3.org/2000/svg",
4101
- width: 16,
4102
- height: 16,
4103
- focusable: "false",
4104
- viewBox: "0 0 16 16"
4105
- }, props), _path$f || (_path$f = /*#__PURE__*/React__namespace.createElement("path", {
4106
- fill: "currentColor",
4107
- d: "M9 15.29c-.26 0-.51-.1-.71-.29l-4-4H1c-.55 0-1-.45-1-1V6c0-.55.45-1 1-1h3.29l4-4a1.002 1.002 0 011.71.71V14.3a.986.986 0 01-1 .99z"
4108
- })), _path2$1 || (_path2$1 = /*#__PURE__*/React__namespace.createElement("path", {
4312
+ var _path$f;
4313
+ function _extends$i() { return _extends$i = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$i.apply(null, arguments); }
4314
+ const SvgPlus$1 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$i({
4315
+ width: 12,
4316
+ height: 12,
4317
+ viewBox: "0 0 12 12",
4109
4318
  fill: "none",
4110
- stroke: "currentColor",
4111
- strokeLinecap: "round",
4112
- d: "M11.77 9.77c.45-.45.73-1.08.73-1.77s-.28-1.31-.73-1.77m2.17 5.6c.97-.99 1.56-2.34 1.56-3.83 0-1.52-.62-2.89-1.61-3.89"
4319
+ xmlns: "http://www.w3.org/2000/svg"
4320
+ }, props), _path$f || (_path$f = /*#__PURE__*/React__namespace.createElement("path", {
4321
+ fillRule: "evenodd",
4322
+ clipRule: "evenodd",
4323
+ d: "M6.5 1C6.19318 1 5.94444 1.24873 5.94444 1.55556V5.44444H2.05556C1.74873 5.44444 1.5 5.69318 1.5 6C1.5 6.30683 1.74873 6.55556 2.05556 6.55556H5.94444V10.4444C5.94444 10.7513 6.19318 11 6.5 11C6.80683 11 7.05556 10.7513 7.05556 10.4444V6.55556H10.9444C11.2513 6.55556 11.5 6.30683 11.5 6C11.5 5.69318 11.2513 5.44444 10.9444 5.44444H7.05556V1.55556C7.05556 1.24873 6.80683 1 6.5 1Z",
4324
+ fill: "currentColor"
4113
4325
  })));
4114
4326
 
4115
- const AudioButton = () => {
4116
- const [hasAudio, setHasAudio] = React.useState(false);
4117
- const { isMuted, setMuted, context } = Video.useVideoContext();
4118
- const { player } = context;
4119
- const checkAudio = (video) => {
4120
- if (!video) {
4121
- return false;
4122
- }
4123
- console.log("hasAudio?", video);
4124
- const videohasAudio = video.mozHasAudio ||
4125
- Boolean(video.webkitAudioDecodedByteCount) ||
4126
- Boolean(video.audioTracks && video.audioTracks.length);
4127
- setHasAudio(videohasAudio);
4128
- };
4129
- const hasVolume = (video) => {
4130
- if (!video) {
4131
- return false;
4132
- }
4133
- return video.volume > 0;
4134
- };
4135
- React.useEffect(() => {
4136
- if (player && (player === null || player === void 0 ? void 0 : player.ref)) {
4137
- setMuted(!hasVolume(player.ref.current));
4138
- checkAudio(player.ref.current);
4139
- }
4140
- }, [context.isPlaying, isMuted]);
4141
- return (jsxRuntime.jsx(IconButton, Object.assign({ isBright: true, disabled: !hasAudio, onClick: () => {
4142
- if (player === null || player === void 0 ? void 0 : player.ref.current) {
4143
- player.ref.current.volume = player.ref.current.volume > 0 ? 0 : 1;
4144
- setMuted(!player.ref.current.volume);
4327
+ // Prevent button from breaking on smaller screens
4328
+ const StyledButton$2 = styled.styled(Button) `
4329
+ overflow: visible;
4330
+ `;
4331
+ const Cutter = ({ onCutHandler, isCutting, i18n, }) => {
4332
+ var _a;
4333
+ const { context } = Video.useVideoContext();
4334
+ const videoRef = (_a = context.player) === null || _a === void 0 ? void 0 : _a.ref.current;
4335
+ if (!onCutHandler)
4336
+ return null;
4337
+ return (jsxRuntime.jsx(StyledButton$2, Object.assign({ isPrimary: true, isAccent: !isCutting, size: "small", onClick: (e) => {
4338
+ if (videoRef) {
4339
+ onCutHandler(videoRef.currentTime);
4145
4340
  }
4146
- } }, { children: isMuted || !hasAudio ? jsxRuntime.jsx(SvgVolumeMutedFill, {}) : jsxRuntime.jsx(SvgVolumeUnmutedFill, {}) })));
4341
+ e.stopPropagation();
4342
+ } }, { children: isCutting ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Button.StartIcon, { children: jsxRuntime.jsx(SvgTagStroke, {}) }), jsxRuntime.jsx(Span, { children: (i18n === null || i18n === void 0 ? void 0 : i18n.onHighlight) || "End observation" })] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Button.StartIcon, { children: jsxRuntime.jsx(SvgPlus$1, {}) }), jsxRuntime.jsx(Span, { children: (i18n === null || i18n === void 0 ? void 0 : i18n.beforeHighlight) || "Start observation" })] })) })));
4147
4343
  };
4148
4344
 
4149
4345
  var _path$e;
4150
- function _extends$h() { _extends$h = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$h.apply(this, arguments); }
4346
+ function _extends$h() { return _extends$h = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$h.apply(null, arguments); }
4151
4347
  const SvgMaximizeStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$h({
4152
4348
  xmlns: "http://www.w3.org/2000/svg",
4153
4349
  width: 16,
@@ -4162,7 +4358,7 @@ const SvgMaximizeStroke = props => /*#__PURE__*/React__namespace.createElement("
4162
4358
  })));
4163
4359
 
4164
4360
  var _path$d;
4165
- function _extends$g() { _extends$g = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$g.apply(this, arguments); }
4361
+ function _extends$g() { return _extends$g = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$g.apply(null, arguments); }
4166
4362
  const SvgMinimizeStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$g({
4167
4363
  xmlns: "http://www.w3.org/2000/svg",
4168
4364
  width: 16,
@@ -4212,7 +4408,7 @@ const FullScreenButton = ({ container, }) => {
4212
4408
  setFullScreen(false);
4213
4409
  }
4214
4410
  }
4215
- }), [ref, isFullScreen]);
4411
+ }), [ref, isFullScreen, setFullScreen]);
4216
4412
  const canGoFullScreen = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
4217
4413
  if (ref) {
4218
4414
  return (requestFullscreen ||
@@ -4237,31 +4433,116 @@ const FullScreenButton = ({ container, }) => {
4237
4433
  }
4238
4434
  };
4239
4435
  }, [ref]);
4240
- return (jsxRuntime.jsx(IconButton, Object.assign({ isBright: true, onClick: (e) => {
4436
+ return (jsxRuntime.jsx(ControlButton, Object.assign({ onClick: (e) => {
4241
4437
  handleFullScreen();
4242
4438
  e.stopPropagation();
4243
4439
  }, disabled: !canGoFullScreen() }, { children: document.fullscreenElement || isFullScreen ? (jsxRuntime.jsx(SvgMinimizeStroke, {})) : (jsxRuntime.jsx(SvgMaximizeStroke, {})) })));
4244
4440
  };
4245
4441
 
4246
- const ControlsWrapper = styled__default["default"].div `
4442
+ const UgProgress = styled__default["default"](reactLoaders.Progress) ``;
4443
+ /**
4444
+ * A Progress loader communicates progress when downloading or uploading content.
4445
+ * <hr>
4446
+ * Used for this:
4447
+ * - To communicate the amount of time left when downloading or uploading content
4448
+ *
4449
+ Not for this:
4450
+ - When the loading time is unknown, use a Spinner instead
4451
+ - When loading page content, use a Skeleton loader instead
4452
+ */
4453
+ const Progress = React.forwardRef((props, ref) => (jsxRuntime.jsx(UgProgress, Object.assign({ ref: ref }, props))));
4454
+
4455
+ const StyledProgress = styled.styled(Progress) `
4456
+ width: 100%;
4457
+ border-radius: 0;
4458
+ color: ${({ theme }) => theme.palette.grey[400]};
4459
+ cursor: pointer;
4460
+ > div {
4461
+ border-radius: 0;
4462
+ }
4463
+ `;
4464
+ const ProgressBar = React.forwardRef((props, ref) => {
4465
+ const { progress, handleSkipAhead } = props;
4466
+ return (jsxRuntime.jsx(StyledProgress, { className: "progress-bar-1", ref: ref, value: progress, onClick: (e) => handleSkipAhead(e.clientX) }));
4467
+ });
4468
+
4469
+ const StyledDiv$2 = styled__default["default"].div `
4470
+ display: flex;
4471
+ color: ${({ theme }) => theme.palette.grey[700]};
4472
+ `;
4473
+ const TimeLabel = ({ current, duration, }) => (jsxRuntime.jsx(StyledDiv$2, { children: jsxRuntime.jsxs(SM, Object.assign({ tag: "span" }, { children: [formatDuration(current), "/", formatDuration(duration)] })) }));
4474
+
4475
+ const Wrapper$1 = styled__default["default"].div `
4476
+ position: absolute;
4477
+ bottom: ${({ theme }) => theme.space.sm};
4478
+ z-index: 1;
4479
+ `;
4480
+ const Content$1 = styled__default["default"].div `
4481
+ display: flex;
4482
+ background-color: ${({ theme }) => theme.palette.grey[800]};
4483
+ border-radius: 2px;
4484
+ width: auto;
4485
+ padding: 2px 4px;
4486
+ display: inline-flex;
4487
+ color: white;
4488
+ font-size: ${({ theme }) => theme.fontSizes.sm};
4489
+ align-items: center;
4490
+ justify-content: center;
4491
+ min-height: 14px;
4492
+ `;
4493
+ const PlayerTooltip = (_a) => {
4494
+ var { children } = _a, props = __rest(_a, ["children"]);
4495
+ return (jsxRuntime.jsx(Wrapper$1, Object.assign({}, props, { children: jsxRuntime.jsx(Content$1, { children: children }) })));
4496
+ };
4497
+
4498
+ function useDebounce(value, delay) {
4499
+ const [debouncedValue, setDebouncedValue] = React.useState(value);
4500
+ React.useEffect(() => {
4501
+ const timer = setTimeout(() => setDebouncedValue(value), delay || 500);
4502
+ return () => {
4503
+ clearTimeout(timer);
4504
+ };
4505
+ }, [value, delay]);
4506
+ return debouncedValue;
4507
+ }
4508
+
4509
+ const Pin = styled.styled.div `
4510
+ width: 2px;
4511
+ bottom: 0;
4512
+ left: ${({ left }) => `${left}%`};
4247
4513
  position: absolute;
4514
+ height: 250%;
4515
+ z-index: 2;
4516
+ background-color: ${({ theme }) => theme.palette.grey[600]};
4517
+ margin-left: -2px; // To not override the current time marker
4518
+
4519
+ &:after {
4520
+ content: "";
4521
+ position: absolute;
4522
+ bottom: 100%;
4523
+ left: 50%;
4524
+ width: 10px;
4525
+ height: 10px;
4526
+ border-radius: 50%;
4527
+ transform: translate(-50%, 0);
4528
+ background-color: ${({ theme }) => theme.palette.grey[600]};
4529
+ }
4530
+ `;
4531
+ const CutStart = ({ left }) => {
4532
+ return jsxRuntime.jsx(Pin, { id: "obs-start-pin", left: left });
4533
+ };
4534
+
4535
+ const ControlsWrapper = styled__default["default"].div `
4536
+ ${({ showControls }) => showControls ? "position: relative;" : "position: absolute;"}
4248
4537
  bottom: 0;
4249
4538
  left: 0;
4250
4539
  right: 0;
4251
4540
  padding: ${({ theme }) => theme.space.xxs} 0;
4252
- background-color: ${({ theme }) => reactTheming.getColor(theme.palette.grey, 700, undefined, 0.8)};
4541
+ background-color: ${({ theme }) => theme.palette.grey[100]};
4542
+ height: 80px;
4253
4543
  ${({ isPlaying }) => isPlaying && "display: none;"}
4254
4544
  z-index: 2;
4255
4545
  `;
4256
- const StyledProgress = styled__default["default"](Progress) `
4257
- width: 100%;
4258
- border-radius: 0;
4259
- color: ${({ theme }) => theme.palette.kale[700]};
4260
- cursor: pointer;
4261
- > div {
4262
- border-radius: 0;
4263
- }
4264
- `;
4265
4546
  const StyledTooltip = styled__default["default"](PlayerTooltip) `
4266
4547
  display: none;
4267
4548
  `;
@@ -4280,18 +4561,35 @@ const StyledDiv$1 = styled__default["default"].div `
4280
4561
  display: flex;
4281
4562
  align-items: center;
4282
4563
  `;
4283
- const Controls = ({ container, }) => {
4564
+ const CurrentTimeMarker = styled__default["default"].div `
4565
+ width: 2px;
4566
+ top: 0;
4567
+ left: ${({ left }) => `${left}%`};
4568
+ position: absolute;
4569
+ height: 110%;
4570
+ z-index: 1;
4571
+ background-color: white;
4572
+ `;
4573
+ const Controls = ({ container, onCutHandler, bookmarks, isCutting, onBookMarkUpdated, i18n, showControls = false, }) => {
4284
4574
  var _a, _b, _c;
4285
4575
  const [progress, setProgress] = React.useState(0);
4286
4576
  const [tooltipMargin, setTooltipMargin] = React.useState(0);
4287
4577
  const [tooltipLabel, setTooltipLabel] = React.useState("00:00");
4578
+ const [marks, setMarks] = React.useState(bookmarks);
4579
+ const [updatedMark, setUpdatedMark] = React.useState();
4288
4580
  const progressRef = React.useRef(null);
4289
4581
  const { context, setCurrentTime } = Video.useVideoContext();
4582
+ const debouncedMark = useDebounce(updatedMark, 500);
4583
+ const [cutStart, setCutStart] = React.useState(0);
4584
+ const { reset, isGrabbing, activeBookmark, fromEnd } = useProgressContext();
4585
+ React.useEffect(() => {
4586
+ setMarks(bookmarks);
4587
+ }, [bookmarks]);
4290
4588
  const relCurrentTime = ((_a = context.player) === null || _a === void 0 ? void 0 : _a.currentTime)
4291
4589
  ? ((_b = context.player) === null || _b === void 0 ? void 0 : _b.currentTime) - context.part.start
4292
4590
  : 0;
4293
4591
  const duration = context.part.end - context.part.start || ((_c = context.player) === null || _c === void 0 ? void 0 : _c.totalTime) || 0; //relative
4294
- const getVideoPositionFromEvent = (clientX) => {
4592
+ const getVideoPositionFromEvent = React.useCallback((clientX) => {
4295
4593
  if (progressRef && progressRef.current && duration) {
4296
4594
  const bounds = progressRef.current.getBoundingClientRect();
4297
4595
  const x = clientX - bounds.left;
@@ -4299,12 +4597,18 @@ const Controls = ({ container, }) => {
4299
4597
  return videoPositionSecs;
4300
4598
  }
4301
4599
  return 0;
4302
- };
4600
+ }, [progressRef, duration]);
4601
+ const getProgress = React.useCallback((currentTime) => {
4602
+ const current = currentTime - (context.part.start || 0);
4603
+ if (duration === 0)
4604
+ return 0;
4605
+ return (current / duration) * 100;
4606
+ }, [context.part.start, duration]);
4303
4607
  const handleSkipAhead = React.useCallback((pageX) => {
4304
4608
  const time = getVideoPositionFromEvent(pageX) + (context.part.start || 0);
4305
4609
  setCurrentTime(time);
4306
4610
  setProgress(getProgress(time));
4307
- }, [context.player, context.part]);
4611
+ }, [getVideoPositionFromEvent, context.part.start, setCurrentTime, getProgress]);
4308
4612
  const onMouseEvent = (e) => {
4309
4613
  if (progressRef && progressRef.current) {
4310
4614
  const tooltipWidth = 40;
@@ -4315,24 +4619,55 @@ const Controls = ({ container, }) => {
4315
4619
  const videoTargetDuration = getVideoPositionFromEvent(e.clientX);
4316
4620
  setTooltipMargin(newTooltipMargin);
4317
4621
  setTooltipLabel(formatDuration(videoTargetDuration));
4622
+ if (isGrabbing) {
4623
+ handleBookmarkUpdate(marginX, progressRef.current.clientWidth);
4624
+ }
4318
4625
  }
4319
4626
  };
4627
+ const handleBookmarkUpdate = React.useCallback((newX, clientW) => {
4628
+ if (!activeBookmark || !marks)
4629
+ return;
4630
+ const currentObsIndex = marks.findIndex((mark) => mark.id === activeBookmark.id);
4631
+ const value = (newX / clientW) * duration + context.part.start;
4632
+ const updatedMark = Object.assign(Object.assign({}, marks[currentObsIndex]), (!!fromEnd ? { end: value } : { start: value }));
4633
+ const newMarks = [
4634
+ ...marks.slice(0, currentObsIndex),
4635
+ updatedMark,
4636
+ ...marks.slice(currentObsIndex + 1),
4637
+ ];
4638
+ setMarks(newMarks);
4639
+ setUpdatedMark(updatedMark);
4640
+ }, [activeBookmark, context.part.start, duration, fromEnd, marks]);
4320
4641
  React.useEffect(() => {
4321
4642
  var _a;
4322
4643
  const currentTime = ((_a = context.player) === null || _a === void 0 ? void 0 : _a.currentTime) || 0;
4323
4644
  setProgress(getProgress(currentTime));
4324
- }, [context.player]);
4325
- const getProgress = React.useCallback((currentTime) => {
4326
- const current = currentTime - (context.part.start || 0);
4327
- if (duration === 0)
4328
- return 0;
4329
- return (current / duration) * 100;
4330
- }, [context.player]);
4331
- return (jsxRuntime.jsxs(ControlsWrapper, Object.assign({ isPlaying: context.isPlaying }, { children: [jsxRuntime.jsxs(ProgressContainer, Object.assign({ onMouseEnter: onMouseEvent, onMouseMove: onMouseEvent, onMouseLeave: onMouseEvent }, { children: [jsxRuntime.jsx(StyledTooltip, Object.assign({ style: { marginLeft: `${tooltipMargin}px` } }, { children: tooltipLabel })), jsxRuntime.jsx(TimeLabel, { current: formatDuration(relCurrentTime), duration: formatDuration(duration) }), jsxRuntime.jsx(StyledProgress, { ref: progressRef, value: progress, onClick: (e) => handleSkipAhead(e.clientX) })] })), jsxRuntime.jsxs(ControlsBar, { children: [jsxRuntime.jsx(StyledDiv$1, { children: jsxRuntime.jsx(AudioButton, {}) }), jsxRuntime.jsx(ControlsGroupCenter, {}), jsxRuntime.jsx(StyledDiv$1, { children: jsxRuntime.jsx(FullScreenButton, { container: container }) })] })] })));
4645
+ }, [context.player, getProgress]);
4646
+ React.useEffect(() => {
4647
+ if (!marks)
4648
+ return;
4649
+ document.addEventListener("mouseup", reset);
4650
+ return () => {
4651
+ document.removeEventListener("mouseup", reset);
4652
+ };
4653
+ }, [reset, marks]);
4654
+ React.useEffect(() => {
4655
+ if (debouncedMark) {
4656
+ onBookMarkUpdated === null || onBookMarkUpdated === void 0 ? void 0 : onBookMarkUpdated(debouncedMark);
4657
+ }
4658
+ }, [debouncedMark, onBookMarkUpdated]);
4659
+ React.useEffect(() => {
4660
+ if (isCutting) {
4661
+ setCutStart(progress);
4662
+ }
4663
+ // eslint-disable-next-line react-hooks/exhaustive-deps
4664
+ }, [isCutting]);
4665
+ return (jsxRuntime.jsxs(ControlsWrapper, Object.assign({ showControls: showControls }, (!showControls && { isPlaying: context.isPlaying }), { children: [jsxRuntime.jsxs(ProgressContainer, Object.assign({ onMouseEnter: onMouseEvent, onMouseMove: onMouseEvent, onMouseLeave: onMouseEvent }, { children: [jsxRuntime.jsx(StyledTooltip, Object.assign({ style: { marginLeft: `${tooltipMargin}px` } }, { children: tooltipLabel })), !!duration &&
4666
+ (marks === null || marks === void 0 ? void 0 : marks.map((bookmark, index) => (jsxRuntime.jsx(Bookmark, Object.assign({}, bookmark), `${index}${bookmark.start}`)))), jsxRuntime.jsx(ProgressBar, { ref: progressRef, progress: progress, handleSkipAhead: handleSkipAhead, duration: duration }), isCutting && jsxRuntime.jsx(CutStart, { left: cutStart }), jsxRuntime.jsx(CurrentTimeMarker, { left: progress })] })), jsxRuntime.jsxs(ControlsBar, { children: [jsxRuntime.jsxs(StyledDiv$1, Object.assign({ style: { width: "20%", justifyContent: "start" } }, { children: [jsxRuntime.jsx(AudioButton, {}), jsxRuntime.jsx(TimeLabel, { current: relCurrentTime, duration: duration })] })), jsxRuntime.jsx(ControlsGroupCenter, { style: { width: "60%" } }), jsxRuntime.jsxs(StyledDiv$1, Object.assign({ style: { width: "20%", justifyContent: "end" } }, { children: [jsxRuntime.jsx(Cutter, { onCutHandler: onCutHandler, isCutting: isCutting, i18n: i18n }), jsxRuntime.jsx(FullScreenButton, { container: container })] }))] })] })));
4332
4667
  };
4333
4668
 
4334
4669
  var _path$c;
4335
- function _extends$f() { _extends$f = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$f.apply(this, arguments); }
4670
+ function _extends$f() { return _extends$f = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$f.apply(null, arguments); }
4336
4671
  const SvgPlayIcon = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$f({
4337
4672
  width: 70,
4338
4673
  height: 70,
@@ -4350,8 +4685,9 @@ const FloatingContainer = styled__default["default"].div `
4350
4685
  top: 0;
4351
4686
  left: 0;
4352
4687
  right: 0;
4353
- ${({ isPlaying }) => isPlaying && "display: none;"}
4354
4688
  z-index: 1;
4689
+ ${({ isPlaying }) => isPlaying && "display: none;"}
4690
+ ${({ showControls }) => showControls ? "height: 100%" : "height: calc(100% - 80px)"};
4355
4691
  `;
4356
4692
  const PlayIcon = styled__default["default"](SvgPlayIcon) ``;
4357
4693
  const BigButton = styled__default["default"](IconButton) `
@@ -4360,6 +4696,10 @@ const BigButton = styled__default["default"](IconButton) `
4360
4696
  min-width: ${({ theme }) => theme.space.base * 15}px;
4361
4697
  width: 80px;
4362
4698
  height: 80px;
4699
+
4700
+ box-shadow: ${({ theme }) => theme.shadows.boxShadow(theme)};
4701
+
4702
+
4363
4703
  ${PlayIcon} {
4364
4704
  width: 60%;
4365
4705
  height: 60%;
@@ -4372,8 +4712,8 @@ const ButtonsContainer = styled__default["default"].div `
4372
4712
  height: 100%;
4373
4713
  `;
4374
4714
  const FloatingControls = (props) => {
4375
- const { isPlaying, onClick } = props;
4376
- return (jsxRuntime.jsx(FloatingContainer, Object.assign({ isPlaying: isPlaying, onClick: onClick }, { children: jsxRuntime.jsx(ButtonsContainer, { children: !isPlaying && (jsxRuntime.jsx(BigButton, Object.assign({ isPrimary: true, size: "large" }, { children: jsxRuntime.jsx(PlayIcon, { color: "red" }) }))) }) })));
4715
+ const { isPlaying, showControls, onClick } = props;
4716
+ return (jsxRuntime.jsx(FloatingContainer, Object.assign({ isPlaying: isPlaying, showControls: showControls, onClick: onClick }, { children: jsxRuntime.jsx(ButtonsContainer, { children: !isPlaying && (jsxRuntime.jsx(BigButton, Object.assign({ isPrimary: true, size: "large" }, { children: jsxRuntime.jsx(PlayIcon, { color: "red" }) }))) }) })));
4377
4717
  };
4378
4718
 
4379
4719
  const VideoStyle = styled.css `
@@ -4399,9 +4739,13 @@ const VideoStyle = styled.css `
4399
4739
 
4400
4740
  const Container$1 = styled__default["default"].div `
4401
4741
  position: relative;
4402
- display: flex;
4403
- flex-direction: column;
4404
- justify-content: center;
4742
+ ${({ showControls }) => !showControls ? `
4743
+ display: flex;
4744
+ flex-direction: column;
4745
+ justify-content: center;
4746
+ ` : `
4747
+ margin-bottom: 80px;
4748
+ `}
4405
4749
  height: 100%;
4406
4750
  width: 100%;
4407
4751
  video {
@@ -4426,8 +4770,7 @@ const Container$1 = styled__default["default"].div `
4426
4770
  }
4427
4771
  }
4428
4772
  }
4429
-
4430
- background-color: ${({ theme }) => theme.palette.grey[700]};
4773
+ background: ${({ theme }) => theme.palette.grey[400]};
4431
4774
  `;
4432
4775
 
4433
4776
  const UgSpinner = styled__default["default"](reactLoaders.Spinner) ``;
@@ -4449,24 +4792,97 @@ const StyledDiv = styled__default["default"].div `
4449
4792
  `;
4450
4793
  const VideoSpinner = () => (jsxRuntime.jsx(StyledDiv, { children: jsxRuntime.jsx(Spinner, { size: "50", color: "white" }) }));
4451
4794
 
4795
+ const usePictureInPicture = (videoRef, pipMode, onPipChange) => {
4796
+ const getObserver = (videoRef, isVideoPlaying) => {
4797
+ return new IntersectionObserver((entries) => {
4798
+ entries.forEach((entry) => {
4799
+ if (!entry.isIntersecting && isVideoPlaying()) {
4800
+ videoRef.requestPictureInPicture();
4801
+ }
4802
+ if (document.pictureInPictureElement &&
4803
+ entry.isIntersecting &&
4804
+ !isVideoPlaying()) {
4805
+ document.exitPictureInPicture();
4806
+ }
4807
+ });
4808
+ }, { threshold: 0.5 });
4809
+ };
4810
+ const handleManualPipMode = (videoRef, pipMode) => {
4811
+ if (pipMode) {
4812
+ videoRef.requestPictureInPicture();
4813
+ }
4814
+ if (!pipMode && document.pictureInPictureElement) {
4815
+ document.exitPictureInPicture();
4816
+ }
4817
+ };
4818
+ React.useEffect(() => {
4819
+ // bail out if pipMode is not defined or videoRef is not defined or pip is not supported
4820
+ if (typeof pipMode === "undefined")
4821
+ return;
4822
+ if (!document.pictureInPictureEnabled) {
4823
+ console.warn("Picture-in-Picture is not supported in this browser");
4824
+ return;
4825
+ }
4826
+ if (!videoRef)
4827
+ return;
4828
+ // if pipMode is auto, we will enter picture in picture mode when the video is not in view
4829
+ if (pipMode === "auto") {
4830
+ const isVideoPlaying = () => videoRef.currentTime > 0 &&
4831
+ !videoRef.paused &&
4832
+ !videoRef.ended &&
4833
+ videoRef.readyState > 2;
4834
+ const observer = getObserver(videoRef, isVideoPlaying);
4835
+ observer.observe(videoRef);
4836
+ return () => {
4837
+ observer.disconnect();
4838
+ };
4839
+ }
4840
+ else if (typeof pipMode === "boolean") {
4841
+ handleManualPipMode(videoRef, pipMode);
4842
+ }
4843
+ else {
4844
+ handleManualPipMode(videoRef, pipMode());
4845
+ }
4846
+ }, [pipMode, videoRef]);
4847
+ React.useEffect(() => {
4848
+ if (!document.pictureInPictureEnabled) {
4849
+ return;
4850
+ }
4851
+ document.addEventListener("enterpictureinpicture", () => {
4852
+ onPipChange === null || onPipChange === void 0 ? void 0 : onPipChange(true);
4853
+ });
4854
+ document.addEventListener("leavepictureinpicture", () => {
4855
+ onPipChange === null || onPipChange === void 0 ? void 0 : onPipChange(false);
4856
+ });
4857
+ return () => {
4858
+ document.removeEventListener("enterpictureinpicture", () => {
4859
+ onPipChange === null || onPipChange === void 0 ? void 0 : onPipChange(true);
4860
+ });
4861
+ document.removeEventListener("leavepictureinpicture", () => {
4862
+ onPipChange === null || onPipChange === void 0 ? void 0 : onPipChange(false);
4863
+ });
4864
+ };
4865
+ }, [onPipChange]);
4866
+ };
4867
+
4452
4868
  /**
4453
4869
  * The Player is a styled media tag with custom controls
4454
4870
  * <hr>
4455
4871
  * Used for this:
4456
4872
  - To display a video
4457
4873
  */
4458
- const Player = React.forwardRef((props, forwardRef) => {
4459
- const videoRef = React.useRef(null);
4460
- React.useImperativeHandle(forwardRef, () => videoRef.current);
4461
- return (jsxRuntime.jsx(Video__default["default"], Object.assign({ src: props.url }, props, { children: jsxRuntime.jsx(PlayerCore, Object.assign({ ref: videoRef }, props)) })));
4462
- });
4874
+ const Player = React.forwardRef((props, forwardRef) => (jsxRuntime.jsx(Video__default["default"], Object.assign({ src: props.url }, props, { children: jsxRuntime.jsx(PlayerCore, Object.assign({ ref: forwardRef }, props)) }))));
4463
4875
  const PlayerCore = React.forwardRef((props, forwardRef) => {
4464
4876
  var _a;
4465
4877
  const { context, togglePlay, setIsPlaying } = Video.useVideoContext();
4878
+ const { onCutHandler, bookmarks, isCutting, pipMode, onPipChange } = props;
4466
4879
  const videoRef = (_a = context.player) === null || _a === void 0 ? void 0 : _a.ref.current;
4467
4880
  const isLoaded = !!videoRef;
4468
4881
  const containerRef = React.useRef(null);
4469
- React.useImperativeHandle(forwardRef, () => videoRef);
4882
+ React.useImperativeHandle(forwardRef, () => videoRef, [
4883
+ videoRef,
4884
+ ]);
4885
+ usePictureInPicture(videoRef, pipMode, onPipChange);
4470
4886
  React.useEffect(() => {
4471
4887
  if (videoRef) {
4472
4888
  videoRef.addEventListener("pause", () => {
@@ -4479,10 +4895,21 @@ const PlayerCore = React.forwardRef((props, forwardRef) => {
4479
4895
  setIsPlaying(false);
4480
4896
  });
4481
4897
  }
4482
- };
4483
- }, [videoRef]);
4484
- return (jsxRuntime.jsxs(Container$1, Object.assign({ isLoaded: isLoaded, isPlaying: context.isPlaying, ref: containerRef }, { children: [!isLoaded ? (jsxRuntime.jsx(VideoSpinner, {})) : (jsxRuntime.jsx(FloatingControls, { isPlaying: context.isPlaying, onClick: togglePlay })), jsxRuntime.jsx(Video__default["default"].Player, { className: "player-container" }), jsxRuntime.jsx(Controls, { container: containerRef.current })] })));
4485
- });
4898
+ };
4899
+ }, [setIsPlaying, videoRef]);
4900
+ return (jsxRuntime.jsxs(Container$1, Object.assign({ isLoaded: isLoaded, isPlaying: context.isPlaying, ref: containerRef }, { children: [!isLoaded ? (jsxRuntime.jsx(VideoSpinner, {})) : (jsxRuntime.jsx(FloatingControls, { isPlaying: context.isPlaying, onClick: togglePlay })), jsxRuntime.jsx(Video__default["default"].Player, { className: "player-container" }), jsxRuntime.jsx(ProgressContextProvider, { children: jsxRuntime.jsx(Controls, { container: containerRef.current, onCutHandler: onCutHandler, bookmarks: bookmarks, isCutting: isCutting, onBookMarkUpdated: props.handleBookmarkUpdate, i18n: props.i18n }) })] })));
4901
+ });
4902
+ const PlayerProvider = (props) => (jsxRuntime.jsx(Video__default["default"], Object.assign({ src: props.url }, props, { children: props.children })));
4903
+ PlayerProvider.Core = PlayerCore;
4904
+
4905
+ const MediaLightBox = ({ header, onClose, slideChange, selectedImageIndex, thumbnails, videoRefs, isOpen, details }) => {
4906
+ if (!isOpen) {
4907
+ return null;
4908
+ }
4909
+ return (jsxRuntime.jsxs(Lightbox, Object.assign({ onClose: onClose }, { children: [jsxRuntime.jsx(Lightbox.Header, { children: header }), jsxRuntime.jsxs(Lightbox.Body, { children: [jsxRuntime.jsx(Lightbox.Body.Main, Object.assign({ style: { flex: details ? 2 : 3 } }, { children: jsxRuntime.jsx(Slider, Object.assign({ prevArrow: jsxRuntime.jsx(Slider.PrevButton, { isBright: true }), nextArrow: jsxRuntime.jsx(Slider.NextButton, { isBright: true }), onSlideChange: slideChange, initialSlide: selectedImageIndex }, { children: thumbnails.map((item) => (jsxRuntime.jsxs(Slider.Slide, { children: [item.type.includes("image") && (jsxRuntime.jsx("img", { src: item.url, alt: `media ${item.name}`, style: { maxHeight: "100%", height: "auto" } })), item.type.includes("video") && item.url && (jsxRuntime.jsx(Player, { ref: (ref) => {
4910
+ videoRefs.current.push(ref);
4911
+ }, url: item.url }))] }, item.id))) })) })), details && (jsxRuntime.jsx(Lightbox.Body.Details, Object.assign({ style: { flex: 1 } }, { children: details })))] }), jsxRuntime.jsx(Lightbox.Close, { "aria-label": "Close modal" })] })));
4912
+ };
4486
4913
 
4487
4914
  const ChatBoxContainer = styled__default["default"].div `
4488
4915
  display: flex;
@@ -4503,14 +4930,19 @@ const ChatBoxContainer = styled__default["default"].div `
4503
4930
  - Simple text input, use textarea instead.
4504
4931
  */
4505
4932
  const CommentBox = (_a) => {
4933
+ var _b;
4506
4934
  var { placeholderOptions } = _a, props = __rest(_a, ["placeholderOptions"]);
4507
4935
  const { children, hasFloatingMenu, hasButtonsMenu, bubbleOptions, i18n } = props;
4508
4936
  const { editor, setEditor, mentionableUsers, triggerSave, thumbnails, addThumbnails, } = useChatContext();
4509
- const { addToast } = useToast();
4510
4937
  const [isOpen, setIsOpen] = React.useState(false);
4511
- const [selectedImage, setSelectedImage] = React.useState({});
4512
4938
  const [selectedImageIndex, setSelectedImageIndex] = React.useState(0);
4939
+ const { getMedia } = useMedia();
4513
4940
  const ext = editorExtensions({ placeholderOptions, mentionableUsers });
4941
+ function handleEvent(data) {
4942
+ if (!data || !data.files)
4943
+ return;
4944
+ addThumbnails({ files: getMedia(data.files) });
4945
+ }
4514
4946
  const closeLightbox = () => {
4515
4947
  setIsOpen(false);
4516
4948
  };
@@ -4523,10 +4955,7 @@ const CommentBox = (_a) => {
4523
4955
  }
4524
4956
  });
4525
4957
  }, [videoRefs]);
4526
- const handleOpenLightbox = (file, index) => {
4527
- if (!file)
4528
- throw Error("Error with the image");
4529
- setSelectedImage(file);
4958
+ const handleOpenLightbox = (index) => {
4530
4959
  setSelectedImageIndex(index);
4531
4960
  setIsOpen(true);
4532
4961
  };
@@ -4538,59 +4967,13 @@ const CommentBox = (_a) => {
4538
4967
  return false;
4539
4968
  },
4540
4969
  handleDrop: function (view, event, slice, moved) {
4541
- if (!event.dataTransfer || !event.dataTransfer.files)
4542
- return false;
4543
4970
  event.preventDefault();
4544
- const files = Array.from(event.dataTransfer.files).map((file) => {
4545
- return Object.assign(file, { isLoadingMedia: false });
4546
- });
4547
- const wronfFiles = files.filter((file) => !/^(image|video)\//.test(file.type));
4548
- if (wronfFiles.length > 0) {
4549
- for (const file of wronfFiles) {
4550
- addToast(({ close }) => (jsxRuntime.jsx(Notification, { onClose: close, type: "error", message: `${props.messageBadFileFormat} - ${file.name}`, isPrimary: true })), { placement: "top" });
4551
- }
4552
- }
4553
- const mediaFiles = files.filter((file) => /^(image|video)\//.test(file.type));
4554
- if (mediaFiles.length === 0)
4555
- return false;
4556
- addThumbnails({ files: mediaFiles });
4557
- return false;
4971
+ handleEvent(event.dataTransfer);
4972
+ },
4973
+ handlePaste: (view, event, slice) => {
4974
+ event.preventDefault();
4975
+ handleEvent(event.clipboardData);
4558
4976
  },
4559
- /*handlePaste: (view, event, slice) => {
4560
- if (!event.clipboardData || !event.clipboardData.items) return false;
4561
-
4562
- event.preventDefault();
4563
-
4564
- const items = Array.from(event.clipboardData.items);
4565
-
4566
- const imageItems = items.filter(
4567
- (item) => item.type && item.type.startsWith("image/")
4568
- );
4569
- const textItem = items.find((item) => item.type === "text/plain");
4570
-
4571
- if (imageItems.length > 0) {
4572
- imageItems.forEach((imageItem) => {
4573
- const file = imageItem.getAsFile();
4574
- if (file) {
4575
- const imageUrl = URL.createObjectURL(file);
4576
- const node = view.state.schema.nodes.image.create({
4577
- src: imageUrl,
4578
- });
4579
- const transaction = view.state.tr.replaceSelectionWith(node);
4580
- view.dispatch(transaction);
4581
- }
4582
- });
4583
- } else if (textItem) {
4584
- textItem.getAsString(async (text) => {
4585
- const node = view.state.schema.text(text);
4586
- const tr = view.state.tr;
4587
- tr.replaceSelectionWith(node);
4588
- view.dispatch(tr);
4589
- });
4590
- }
4591
-
4592
- return true;
4593
- },*/
4594
4977
  } }, props));
4595
4978
  const onKeyDown = (event) => {
4596
4979
  if ((event.ctrlKey || event.metaKey) && event.key === "Enter") {
@@ -4602,14 +4985,32 @@ const CommentBox = (_a) => {
4602
4985
  return null;
4603
4986
  ed.on("create", ({ editor }) => setEditor(editor));
4604
4987
  ed.on("update", ({ editor }) => setEditor(editor));
4605
- const mediaFiles = thumbnails.map((file) => {
4606
- return Object.assign(file, { isLoadingMedia: file.isLoadingMedia });
4607
- });
4608
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [isOpen && selectedImage && (jsxRuntime.jsxs(Lightbox, Object.assign({ onClose: closeLightbox }, { children: [jsxRuntime.jsx(Lightbox.Header, { children: selectedImage.name }), jsxRuntime.jsx(Lightbox.Body, { children: jsxRuntime.jsx(Lightbox.Body.Main, Object.assign({ style: { flex: 3 } }, { children: jsxRuntime.jsx(Slider, Object.assign({ prevArrow: jsxRuntime.jsx(Slider.PrevButton, { isBright: true }), nextArrow: jsxRuntime.jsx(Slider.NextButton, { isBright: true }), onSlideChange: slideChange, initialSlide: selectedImageIndex }, { children: mediaFiles.map((item, index) => (jsxRuntime.jsxs(Slider.Slide, { children: [item.type.includes("image") && (jsxRuntime.jsx("img", { src: URL.createObjectURL(item), alt: `media ${item.name}` })), item.type.includes("video") && (jsxRuntime.jsx(Player, { ref: (ref) => {
4609
- videoRefs.current.push(ref);
4610
- }, url: URL.createObjectURL(item) }))] }))) })) })) }), jsxRuntime.jsx(Lightbox.Close, { "aria-label": "Close modal" })] }))), jsxRuntime.jsx(ChatBoxContainer, { children: jsxRuntime.jsxs(EditorContainer$1, Object.assign({ editable: true, style: { marginLeft: 0, paddingBottom: 12 } }, { children: [hasFloatingMenu && (jsxRuntime.jsx(FloatingMenu, { editor: ed, tippyOptions: Object.assign({}, bubbleOptions) })), jsxRuntime.jsx(react.EditorContent, { editor: ed, onKeyDown: onKeyDown }), jsxRuntime.jsx(ThumbnailContainer, { openLightbox: handleOpenLightbox })] })) }), hasButtonsMenu && jsxRuntime.jsx(CommentBar, { editor: ed, i18n: i18n })] }));
4988
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(MediaLightBox, { isOpen: isOpen, header: (_b = thumbnails[selectedImageIndex]) === null || _b === void 0 ? void 0 : _b.name, onClose: closeLightbox, slideChange: slideChange, selectedImageIndex: selectedImageIndex, thumbnails: thumbnails, videoRefs: videoRefs }), jsxRuntime.jsx(ChatBoxContainer, { children: jsxRuntime.jsxs(EditorContainer$1, Object.assign({ editable: true, style: { marginLeft: 0, paddingBottom: 12 } }, { children: [hasFloatingMenu && (jsxRuntime.jsx(FloatingMenu$1, { editor: ed, tippyOptions: Object.assign({}, bubbleOptions) })), jsxRuntime.jsx(react.EditorContent, { editor: ed, onKeyDown: onKeyDown }), jsxRuntime.jsx(ThumbnailContainer, { openLightbox: handleOpenLightbox })] })) }), hasButtonsMenu && jsxRuntime.jsx(CommentBar, { editor: ed, i18n: i18n })] }));
4611
4989
  };
4612
4990
 
4991
+ const UgGrid = styled__default["default"](reactGrid.Grid) `
4992
+ padding-left: 0;
4993
+ padding-right: 0;
4994
+ `;
4995
+ /**
4996
+ * The Grid component is a framework for building modular layouts.
4997
+ * <hr>
4998
+ * Used for this:
4999
+ - To structure the layout of a page
5000
+ */
5001
+ const Grid = (props) => jsxRuntime.jsx(UgGrid, Object.assign({}, props));
5002
+
5003
+ const Row$1 = (props) => jsxRuntime.jsx(reactGrid.Row, Object.assign({}, props));
5004
+
5005
+ const StyledCol$1 = styled__default["default"](reactGrid.Col) `
5006
+ margin-bottom: ${theme.space.lg};
5007
+
5008
+ @media screen and (max-width: ${theme.breakpoints.sm}) {
5009
+ margin-bottom: ${theme.space.md};
5010
+ }
5011
+ `;
5012
+ const Col = (props) => jsxRuntime.jsx(StyledCol$1, Object.assign({}, props));
5013
+
4613
5014
  const CommentCard = styled.styled(Card) `
4614
5015
  padding: ${({ theme }) => `${theme.space.base * 3}px ${theme.space.sm}`};
4615
5016
  background-color: ${({ theme }) => theme.palette.grey[100]};
@@ -4653,13 +5054,9 @@ const Comment = ({ author, message, children, date, media = [], header, }) => {
4653
5054
  var _a, _b;
4654
5055
  const { mentionableUsers } = useChatContext();
4655
5056
  const [isOpen, setIsOpen] = React.useState(false);
4656
- const [selectedImage, setSelectedImage] = React.useState({});
4657
5057
  const [selectedImageIndex, setSelectedImageIndex] = React.useState(0);
4658
5058
  const ext = editorExtensions({ mentionableUsers });
4659
- const handleClickThumbnail = (file, index) => {
4660
- if (!file)
4661
- throw Error("Error with the image");
4662
- setSelectedImage(file);
5059
+ const handleClickThumbnail = (index) => {
4663
5060
  setSelectedImageIndex(index);
4664
5061
  setIsOpen(true);
4665
5062
  };
@@ -4668,7 +5065,6 @@ const Comment = ({ author, message, children, date, media = [], header, }) => {
4668
5065
  };
4669
5066
  const videoRefs = React.useRef([]);
4670
5067
  const slideChange = React.useCallback((index) => {
4671
- setSelectedImage(media[index]);
4672
5068
  setSelectedImageIndex(index);
4673
5069
  videoRefs.current.forEach((ref) => {
4674
5070
  if (ref) {
@@ -4685,23 +5081,13 @@ const Comment = ({ author, message, children, date, media = [], header, }) => {
4685
5081
  ed.setOptions({
4686
5082
  editable: false,
4687
5083
  });
4688
- return (jsxRuntime.jsxs(CommentCard, { children: [jsxRuntime.jsxs(AuthorContainer, { children: [jsxRuntime.jsx(Avatar, Object.assign({ avatarType: (_a = author.avatarType) !== null && _a !== void 0 ? _a : "text", style: { flexShrink: 0 } }, { children: author.avatar })), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsxs(CommentTitle, { children: [(_b = author.name) !== null && _b !== void 0 ? _b : "User", jsxRuntime.jsx(CommentDate, { children: date })] }), jsxRuntime.jsx(ReadOnly, { children: jsxRuntime.jsx(EditorContainer$1, Object.assign({ editable: false }, { children: jsxRuntime.jsx(react.EditorContent, { editor: ed }) })) })] })] }), jsxRuntime.jsx(Grid, { children: jsxRuntime.jsx(Row$1, Object.assign({ className: "responsive-container" }, { children: media.map((file, index) => {
4689
- // Check if item is an image or a video
4690
- if (file.type.includes('image'))
4691
- return (jsxRuntime.jsx(Col, Object.assign({ xs: 12, sm: 4, className: "flex-3-sm" }, { children: jsxRuntime.jsx(ImageThumbnail, { src: file.url, index: index, showX: true, isLoadingMedia: false, clickThumbnail: () => {
4692
- handleClickThumbnail(file, index);
4693
- } }, index) })));
4694
- if (file.type.includes('video'))
4695
- return (jsxRuntime.jsx(Col, Object.assign({ xs: 12, sm: 4, className: "flex-3-sm" }, { children: jsxRuntime.jsx(VideoThumbnail, { src: file.url, index: index, showX: true, isLoadingMedia: false, clickThumbnail: () => {
4696
- handleClickThumbnail(file, index);
4697
- } }, index) })));
4698
- return null;
4699
- }) })) }), isOpen && selectedImage && (jsxRuntime.jsxs(Lightbox, Object.assign({ onClose: closeLightbox }, { children: [jsxRuntime.jsx(Lightbox.Header, { children: jsxRuntime.jsxs(reactTypography.MD, Object.assign({ isBold: true }, { children: [jsxRuntime.jsx(Grey600Span, { children: header && header.title }), header && header.message && (jsxRuntime.jsxs(Grey800Span, { children: [" | ", header.message] }))] })) }), jsxRuntime.jsxs(Lightbox.Body, { children: [jsxRuntime.jsx(Lightbox.Body.Main, Object.assign({ style: { flex: 2 } }, { children: jsxRuntime.jsx(Slider, Object.assign({ prevArrow: jsxRuntime.jsx(Slider.PrevButton, { isBright: true }), nextArrow: jsxRuntime.jsx(Slider.NextButton, { isBright: true }), onSlideChange: slideChange, initialSlide: selectedImageIndex }, { children: media.map((item, index) => (jsxRuntime.jsxs(Slider.Slide, { children: [item.type === "image" && (jsxRuntime.jsx("img", { src: item.url, alt: `{{${item.url}}}` })), item.type === "video" && (jsxRuntime.jsx(Player, { ref: (ref) => {
4700
- videoRefs.current.push(ref);
4701
- }, url: item.url }))] }))) })) })), jsxRuntime.jsx(Lightbox.Body.Details, Object.assign({ style: { flex: 1 } }, { children: jsxRuntime.jsx(Comment, Object.assign({ header: header, author: {
4702
- avatar: author.avatar,
4703
- name: author.name,
4704
- }, date: date, message: message }, { children: jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx("br", {}) }) })) }))] }), jsxRuntime.jsx(Lightbox.Footer, {}), jsxRuntime.jsx(Lightbox.Close, { "aria-label": "Close modal" })] }))), jsxRuntime.jsx(Footer$2, { children: children })] }));
5084
+ return (jsxRuntime.jsxs(CommentCard, { children: [jsxRuntime.jsxs(AuthorContainer, { children: [jsxRuntime.jsx(Avatar, Object.assign({ avatarType: (_a = author.avatarType) !== null && _a !== void 0 ? _a : "text", style: { flexShrink: 0 } }, { children: author.avatar })), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsxs(CommentTitle, { children: [(_b = author.name) !== null && _b !== void 0 ? _b : "User", " ", jsxRuntime.jsx(CommentDate, { children: date })] }), jsxRuntime.jsx(ReadOnly, { children: jsxRuntime.jsx(EditorContainer$1, Object.assign({ editable: false }, { children: jsxRuntime.jsx(react.EditorContent, { editor: ed }) })) })] })] }), jsxRuntime.jsx(Grid, { children: jsxRuntime.jsx(Row$1, Object.assign({ className: "responsive-container" }, { children: media.map((file, index) => (jsxRuntime.jsx(Col, Object.assign({ xs: 12, sm: 4, className: "flex-3-sm" }, { children: jsxRuntime.jsx(Thumbnail, { src: file.url, type: file.type, showX: false, isLoadingMedia: false, clickThumbnail: () => {
5085
+ handleClickThumbnail(index);
5086
+ } }) }), index))) })) }), jsxRuntime.jsx(MediaLightBox, { isOpen: isOpen, header: jsxRuntime.jsxs(reactTypography.MD, Object.assign({ isBold: true }, { children: [jsxRuntime.jsx(Grey600Span, { children: header && header.title }), header && header.message && (jsxRuntime.jsxs(Grey800Span, { children: [" | ", header.message] }))] })), onClose: closeLightbox, slideChange: slideChange, selectedImageIndex: selectedImageIndex, thumbnails: media, videoRefs: videoRefs, details: jsxRuntime.jsx(Comment, Object.assign({ header: header, author: {
5087
+ avatar: author.avatar,
5088
+ avatarType: author.avatarType,
5089
+ name: author.name,
5090
+ }, date: date, message: message }, { children: jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx("br", {}) }) })) }), jsxRuntime.jsx(Footer$2, { children: children })] }));
4705
5091
  };
4706
5092
 
4707
5093
  /**
@@ -4723,7 +5109,7 @@ Chat.Input = CommentBox;
4723
5109
  Chat.Footer = ChatFooter;
4724
5110
 
4725
5111
  var _circle;
4726
- function _extends$e() { _extends$e = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$e.apply(this, arguments); }
5112
+ function _extends$e() { return _extends$e = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$e.apply(null, arguments); }
4727
5113
  const SvgCircleFullFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$e({
4728
5114
  xmlns: "http://www.w3.org/2000/svg",
4729
5115
  width: 16,
@@ -4806,77 +5192,19 @@ Drawer.Footer = reactModals.DrawerModal.Footer;
4806
5192
  Drawer.FooterItem = reactModals.DrawerModal.FooterItem;
4807
5193
  Drawer.Close = reactModals.DrawerModal.Close;
4808
5194
 
4809
- const Field$1 = styled__default["default"](reactDropdowns.Field) ``;
4810
-
4811
- var index$1 = /*#__PURE__*/Object.freeze({
4812
- __proto__: null,
4813
- Field: Field$1
4814
- });
4815
-
4816
- const UgItem = styled__default["default"](reactDropdowns.Item) `
4817
- display: flex;
4818
- flex-direction: row;
4819
- align-items: center;
4820
- justify-content: flex-start;
4821
-
4822
- > div {
4823
- height: 100%;
4824
- }
4825
-
4826
- &[disabled] * {
4827
- opacity: 0.85;
4828
- }
4829
-
4830
- &[disabled] svg {
4831
- opacity: 0.5;
4832
- }
4833
-
4834
- &[disabled]:hover {
4835
- background-color: transparent;
4836
- }
4837
- `;
4838
- const Item$1 = (props) => jsxRuntime.jsx(UgItem, Object.assign({}, props));
4839
-
4840
- const Container = styled__default["default"].div `
4841
- display: flex;
4842
- flex-direction: row;
4843
- align-items: center;
4844
- justify-content: flex-start;
4845
- width: 100%;
4846
- `;
4847
- const MetaContainer$1 = styled__default["default"].div `
4848
- display: flex;
4849
- flex-direction: column;
4850
- align-items: flex-start;
4851
- justify-content: center;
4852
- `;
4853
- const ThumbContainer = styled__default["default"].div `
4854
- display: flex;
4855
- flex-direction: row;
4856
- align-items: center;
4857
- justify-content: center;
4858
- margin-right: ${({ theme }) => theme.space.sm};
5195
+ const StyledAutocomplete$1 = styled__default["default"](reactDropdowns.Autocomplete) `
4859
5196
  width: 100%;
4860
- max-width: ${({ theme }) => theme.components.autocomplete.thumbSize};
4861
-
4862
- > div {
4863
- height: 100%;
4864
- }
4865
5197
  `;
4866
- const Label$1 = styled__default["default"](MD) `
4867
- font-weight: ${({ theme }) => theme.fontWeights.medium};
4868
- color: ${({ theme }) => theme.palette.grey[800]};
4869
- `;
4870
- const Description$1 = styled__default["default"](SM) `
4871
- color: ${({ theme }) => theme.palette.grey[600]};
4872
- `;
4873
- const Image$1 = React.memo(({ src }) => {
4874
- return jsxRuntime.jsx("img", { src: src });
4875
- });
4876
- const ItemContent = (props) => {
4877
- const { thumbSrc, description, label } = props;
4878
- return (jsxRuntime.jsxs(Container, { children: [thumbSrc && (jsxRuntime.jsx(ThumbContainer, { children: jsxRuntime.jsx(Image$1, { src: thumbSrc }) })), jsxRuntime.jsxs(MetaContainer$1, { children: [label && jsxRuntime.jsx(Label$1, Object.assign({ isBold: true }, { children: label })), description && jsxRuntime.jsx(Description$1, { children: description })] })] }));
4879
- };
5198
+ /**
5199
+ * Autocomplete is an input field that filters results as users type. This helps users find something quickly in a large list of options.
5200
+ * <hr>
5201
+ * Used for this:
5202
+ - To filter down a large list of options
5203
+ - To quickly find a known option
5204
+ * Not for this:
5205
+ - To make more than one selection, use Multiselect instead
5206
+ */
5207
+ const Autocomplete = (props) => (jsxRuntime.jsx(StyledAutocomplete$1, Object.assign({}, props)));
4880
5208
 
4881
5209
  const StyledMenu = styled__default["default"](reactDropdowns.Menu) `
4882
5210
  width: auto !important;
@@ -4894,26 +5222,12 @@ const MediaBody = (props) => (jsxRuntime.jsx(reactDropdowns.MediaBody, Object.as
4894
5222
  const MediaFigure = (props) => (jsxRuntime.jsx(reactDropdowns.MediaFigure, Object.assign({}, props)));
4895
5223
  const MediaItem = (props) => (jsxRuntime.jsx(reactDropdowns.MediaItem, Object.assign({}, props)));
4896
5224
 
4897
- const StyledAutocomplete$1 = styled__default["default"](reactDropdowns.Autocomplete) `
4898
- width: 100%;
4899
- `;
4900
- /**
4901
- * Autocomplete is an input field that filters results as users type. This helps users find something quickly in a large list of options.
4902
- * <hr>
4903
- * Used for this:
4904
- - To filter down a large list of options
4905
- - To quickly find a known option
4906
- * Not for this:
4907
- - To make more than one selection, use Multiselect instead
4908
- */
4909
- const Autocomplete = (props) => (jsxRuntime.jsx(StyledAutocomplete$1, Object.assign({}, props)));
4910
-
4911
5225
  const StyledLabel$2 = styled__default["default"](reactForms.Label) ``;
4912
5226
  /**
4913
5227
  * A Label is used to specify a title for an input.
4914
5228
  * <hr>
4915
5229
  **/
4916
- const Label = (props) => jsxRuntime.jsx(StyledLabel$2, Object.assign({}, props));
5230
+ const Label$2 = (props) => jsxRuntime.jsx(StyledLabel$2, Object.assign({}, props));
4917
5231
 
4918
5232
  const MenuHeaderItem = (props) => (jsxRuntime.jsx(reactDropdowns.HeaderItem, Object.assign({}, props)));
4919
5233
 
@@ -4951,6 +5265,37 @@ const Message = (props) => jsxRuntime.jsx(reactDropdowns.Message, Object.assign(
4951
5265
  Dropdown.HeaderItem = StyledMenuHeaderItem;
4952
5266
  Dropdown.Separator = Separator;
4953
5267
 
5268
+ const Field$1 = styled__default["default"](reactDropdowns.Field) ``;
5269
+
5270
+ var index$1 = /*#__PURE__*/Object.freeze({
5271
+ __proto__: null,
5272
+ Field: Field$1
5273
+ });
5274
+
5275
+ const UgItem = styled__default["default"](reactDropdowns.Item) `
5276
+ display: flex;
5277
+ flex-direction: row;
5278
+ align-items: center;
5279
+ justify-content: flex-start;
5280
+
5281
+ > div {
5282
+ height: 100%;
5283
+ }
5284
+
5285
+ &[disabled] * {
5286
+ opacity: 0.85;
5287
+ }
5288
+
5289
+ &[disabled] svg {
5290
+ opacity: 0.5;
5291
+ }
5292
+
5293
+ &[disabled]:hover {
5294
+ background-color: transparent;
5295
+ }
5296
+ `;
5297
+ const Item$1 = (props) => jsxRuntime.jsx(UgItem, Object.assign({}, props));
5298
+
4954
5299
  const StyledAutocomplete = styled__default["default"](Autocomplete) `
4955
5300
  ${(props) => props.hasSelectedItems &&
4956
5301
  `
@@ -4988,13 +5333,54 @@ const CounterMultiselect = ({ options, label, i18n, onChange, isCompact, }) => {
4988
5333
  }, onStateChange: (changes) => {
4989
5334
  if (changes.isOpen === false)
4990
5335
  setInputValue("");
4991
- }, onInputValueChange: (value) => setInputValue(value) }, { children: [jsxRuntime.jsxs(Field$1, { children: [label && jsxRuntime.jsx(Label, { children: label }), jsxRuntime.jsx(StyledAutocomplete, Object.assign({ isCompact: isCompact, hasSelectedItems: hasSelectedItems }, { children: hasSelectedItems
5336
+ }, onInputValueChange: (value) => setInputValue(value) }, { children: [jsxRuntime.jsxs(Field$1, { children: [label && jsxRuntime.jsx(Label$2, { children: label }), jsxRuntime.jsx(StyledAutocomplete, Object.assign({ isCompact: isCompact, hasSelectedItems: hasSelectedItems }, { children: hasSelectedItems
4992
5337
  ? (i18n === null || i18n === void 0 ? void 0 : i18n.counterText)
4993
5338
  ? i18n.counterText(selectedItems.length)
4994
5339
  : `Items (${selectedItems.length})`
4995
5340
  : (_a = i18n === null || i18n === void 0 ? void 0 : i18n.noItems) !== null && _a !== void 0 ? _a : "No items" }))] }), jsxRuntime.jsx(Menu, Object.assign({ isCompact: isCompact }, { children: matchingOptions.length === 0 ? (jsxRuntime.jsx(Item$1, Object.assign({ disabled: true }, { children: (_b = i18n === null || i18n === void 0 ? void 0 : i18n.noMatches) !== null && _b !== void 0 ? _b : "No matches found" }))) : (matchingOptions.map((option) => (jsxRuntime.jsx(Item$1, Object.assign({ value: option }, option, { children: jsxRuntime.jsx("span", { children: option.label }) }), option.itemId)))) }))] })) }));
4996
5341
  };
4997
5342
 
5343
+ const Container = styled__default["default"].div `
5344
+ display: flex;
5345
+ flex-direction: row;
5346
+ align-items: center;
5347
+ justify-content: flex-start;
5348
+ width: 100%;
5349
+ `;
5350
+ const MetaContainer$1 = styled__default["default"].div `
5351
+ display: flex;
5352
+ flex-direction: column;
5353
+ align-items: flex-start;
5354
+ justify-content: center;
5355
+ `;
5356
+ const ThumbContainer = styled__default["default"].div `
5357
+ display: flex;
5358
+ flex-direction: row;
5359
+ align-items: center;
5360
+ justify-content: center;
5361
+ margin-right: ${({ theme }) => theme.space.sm};
5362
+ width: 100%;
5363
+ max-width: ${({ theme }) => theme.components.autocomplete.thumbSize};
5364
+
5365
+ > div {
5366
+ height: 100%;
5367
+ }
5368
+ `;
5369
+ const Label$1 = styled__default["default"](MD) `
5370
+ font-weight: ${({ theme }) => theme.fontWeights.medium};
5371
+ color: ${({ theme }) => theme.palette.grey[800]};
5372
+ `;
5373
+ const Description$1 = styled__default["default"](SM) `
5374
+ color: ${({ theme }) => theme.palette.grey[600]};
5375
+ `;
5376
+ const Image$1 = React.memo(({ src }) => {
5377
+ return jsxRuntime.jsx("img", { src: src });
5378
+ });
5379
+ const ItemContent = (props) => {
5380
+ const { thumbSrc, description, label } = props;
5381
+ return (jsxRuntime.jsxs(Container, { children: [thumbSrc && (jsxRuntime.jsx(ThumbContainer, { children: jsxRuntime.jsx(Image$1, { src: thumbSrc }) })), jsxRuntime.jsxs(MetaContainer$1, { children: [label && jsxRuntime.jsx(Label$1, Object.assign({ isBold: true }, { children: label })), description && jsxRuntime.jsx(Description$1, { children: description })] })] }));
5382
+ };
5383
+
4998
5384
  const Header$1 = styled__default["default"].div `
4999
5385
  display: flex;
5000
5386
  flex-direction: column;
@@ -5098,7 +5484,7 @@ const Editor = (_a) => {
5098
5484
  }
5099
5485
  // Add here because we want to keep also the listener from the props.
5100
5486
  ed.on("update", ({ editor }) => setActiveEditor(editor));
5101
- return (jsxRuntime.jsxs(EditorContainer, Object.assign({ editable: isEditable, validation: props.validation }, { children: [isEditable && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(EditorHeader, { title: headerTitle, validation: props.validation }), hasInlineMenu && (jsxRuntime.jsx(FloatingMenu, { editor: ed, tippyOptions: Object.assign({}, bubbleOptions) }))] })), jsxRuntime.jsx(react.EditorContent, { editor: ed, onKeyDown: onKeyDown }), isEditable && jsxRuntime.jsx(EditorFooter, { saveText: footerSaveText })] })));
5487
+ return (jsxRuntime.jsxs(EditorContainer, Object.assign({ editable: isEditable, validation: props.validation }, { children: [isEditable && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(EditorHeader, { title: headerTitle, validation: props.validation }), hasInlineMenu && (jsxRuntime.jsx(FloatingMenu$1, { editor: ed, tippyOptions: Object.assign({}, bubbleOptions) }))] })), jsxRuntime.jsx(react.EditorContent, { editor: ed, onKeyDown: onKeyDown }), isEditable && jsxRuntime.jsx(EditorFooter, { saveText: footerSaveText })] })));
5102
5488
  };
5103
5489
 
5104
5490
  const UgCheckbox = styled__default["default"](reactForms.Checkbox) ``;
@@ -5114,7 +5500,7 @@ const UgCheckbox = styled__default["default"](reactForms.Checkbox) ``;
5114
5500
  **/
5115
5501
  const Checkbox = (props) => jsxRuntime.jsx(UgCheckbox, Object.assign({}, props));
5116
5502
 
5117
- const StyledLabel$1 = styled__default["default"](Label) `
5503
+ const StyledLabel$1 = styled__default["default"](Label$2) `
5118
5504
  margin: ${({ theme }) => theme.space.base}px auto;
5119
5505
  `;
5120
5506
  const CheckboxCard = (props) => {
@@ -5151,7 +5537,7 @@ const Hint = styled__default["default"](reactForms.Hint) ``;
5151
5537
  const Input = React.forwardRef((props, ref) => jsxRuntime.jsx(UgInput, Object.assign({ ref: ref }, props)));
5152
5538
 
5153
5539
  var _g;
5154
- function _extends$d() { _extends$d = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$d.apply(this, arguments); }
5540
+ function _extends$d() { return _extends$d = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$d.apply(null, arguments); }
5155
5541
  const SvgNotesStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$d({
5156
5542
  xmlns: "http://www.w3.org/2000/svg",
5157
5543
  width: 16,
@@ -5184,7 +5570,7 @@ const StyledInput = styled__default["default"](Input) `
5184
5570
  transition: border-color 0.2s ease-in-out 0.1s;
5185
5571
  }
5186
5572
  `;
5187
- const StyledLabel = styled__default["default"](Label) `
5573
+ const StyledLabel = styled__default["default"](Label$2) `
5188
5574
  padding: ${({ theme }) => `${theme.space.xxs} ${theme.space.xxs} 0`};
5189
5575
  transition: opacity 0.2s ease-in-out;
5190
5576
  `;
@@ -5271,7 +5657,7 @@ const UgRadio = styled__default["default"](reactForms.Radio) ``;
5271
5657
  const Radio = (props) => jsxRuntime.jsx(UgRadio, Object.assign({}, props));
5272
5658
 
5273
5659
  var _path$b;
5274
- function _extends$c() { _extends$c = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$c.apply(this, arguments); }
5660
+ function _extends$c() { return _extends$c = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$c.apply(null, arguments); }
5275
5661
  const SvgCheckLg = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$c({
5276
5662
  width: 16,
5277
5663
  height: 16,
@@ -5330,15 +5716,217 @@ const Textarea = (props) => jsxRuntime.jsx(UgTextarea, Object.assign({}, props))
5330
5716
 
5331
5717
  const UgToggle = styled__default["default"](reactForms.Toggle) ``;
5332
5718
  /**
5333
- * A Toggle lets users turn something on and off like a light switch. Unlike a Checkbox, which is used for selection, a Toggle is used for activation.
5334
- * <hr>
5335
- * Used for this:
5336
- * - To see or compare the results of a settings change
5337
- * - To activate a mode (such as "dark mode") which takes immediate effect
5338
- * Not for this:
5339
- * - To let users select from a list of settings, use Checkboxes instead
5340
- **/
5341
- const Toggle = (props) => jsxRuntime.jsx(UgToggle, Object.assign({}, props));
5719
+ * A Toggle lets users turn something on and off like a light switch. Unlike a Checkbox, which is used for selection, a Toggle is used for activation.
5720
+ * <hr>
5721
+ * Used for this:
5722
+ * - To see or compare the results of a settings change
5723
+ * - To activate a mode (such as "dark mode") which takes immediate effect
5724
+ * Not for this:
5725
+ * - To let users select from a list of settings, use Checkboxes instead
5726
+ **/
5727
+ const Toggle = (props) => jsxRuntime.jsx(UgToggle, Object.assign({}, props));
5728
+
5729
+ const HighlightContext = React.createContext(null);
5730
+ const HighlightContextProvider = ({ term, children, }) => {
5731
+ const [searchTerm, setsearchTerm] = React.useState(term !== null && term !== void 0 ? term : "");
5732
+ React.useEffect(() => {
5733
+ setsearchTerm(term !== null && term !== void 0 ? term : "");
5734
+ }, [term]);
5735
+ const HighlightContextValue = React.useMemo(() => ({
5736
+ searchTerm,
5737
+ }), [searchTerm]);
5738
+ return (jsxRuntime.jsx(HighlightContext.Provider, Object.assign({ value: HighlightContextValue }, { children: children })));
5739
+ };
5740
+ const useHighlightContext = () => {
5741
+ const context = React.useContext(HighlightContext);
5742
+ if (!context)
5743
+ throw new Error("Provider not found for HighlightContextProvider");
5744
+ return context; // Now we can use the context in the component, SAFELY.
5745
+ };
5746
+
5747
+ const StyledSearchWord = styled__default["default"].span `
5748
+ background-color: ${({ theme }) => theme.palette.product.talk};
5749
+ color: ${({ theme }) => theme.palette.grey[700]};
5750
+ `;
5751
+ const Searchable = ({ text, }) => {
5752
+ const { searchTerm } = useHighlightContext();
5753
+ if (searchTerm) {
5754
+ const parts = text.split(new RegExp(`(${searchTerm})`, "gi"));
5755
+ return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: parts.map((part, index) => part.toLowerCase() === searchTerm.toLowerCase() ? (jsxRuntime.jsx(StyledSearchWord, { children: part }, index)) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: part }))) }));
5756
+ }
5757
+ return jsxRuntime.jsx(jsxRuntime.Fragment, { children: text });
5758
+ };
5759
+
5760
+ const CreateObservationButton = styled.styled(Button) `
5761
+ user-select: none;
5762
+ position: absolute;
5763
+ left: ${({ position: { x } }) => x}px;
5764
+ top: ${({ position: { y } }) => y}px;
5765
+ transform: translate(-50%, 0);
5766
+ z-index: ${({ theme }) => theme.levels.front};
5767
+ `;
5768
+
5769
+ const getFocusedObs = (observations) => {
5770
+ return observations.find((obs) => obs.isFocused);
5771
+ };
5772
+ const StyledWord = styled__default["default"].div `
5773
+ display: inline-block;
5774
+ font-size: ${({ theme, size }) => theme.fontSizes[size !== null && size !== void 0 ? size : "md"]};
5775
+ padding: ${({ theme }) => theme.space.xxs} 0;
5776
+ position: relative;
5777
+ color: ${({ theme }) => theme.palette.grey[700]};
5778
+ white-space: pre;
5779
+
5780
+ ${({ observations, theme }) => {
5781
+ var _a;
5782
+ return observations &&
5783
+ observations.length > 0 &&
5784
+ `
5785
+ color: ${(_a = observations[observations.length - 1].color) !== null && _a !== void 0 ? _a : theme.palette.grey[600]};
5786
+ box-sizing: border-box;
5787
+ font-weight: ${getFocusedObs(observations)
5788
+ ? theme.fontWeights.extrabold
5789
+ : theme.fontWeights.semibold};
5790
+ font-style: ${getFocusedObs(observations) ? "italic" : "normal"};
5791
+ z-index: 1;
5792
+ &:focus {
5793
+ outline: none;
5794
+ }
5795
+ `;
5796
+ }}
5797
+ `;
5798
+ const ActiveWord = styled__default["default"].span `
5799
+ position: relative;
5800
+ z-index: 2;
5801
+ background-color: ${({ theme }) => getColor(theme.palette.fuschia, 400, undefined, 0.4)};
5802
+ `;
5803
+ const WordsContainer = styled__default["default"].div `
5804
+ box-sizing: border-box;
5805
+ ${StyledWord}, span {
5806
+ &::selection {
5807
+ background-color: ${({ theme }) => getColor(theme.palette.grey, 400, undefined, 0.5)};
5808
+ }
5809
+ }
5810
+ `;
5811
+ const Layer = styled__default["default"].div `
5812
+ position: absolute;
5813
+ top: 0;
5814
+ left: 0;
5815
+ width: 100%;
5816
+ height: 100%;
5817
+ z-index: 0;
5818
+ background-color: ${({ color }) => getColor(color, undefined, undefined, 0.2)};
5819
+ `;
5820
+ const textFromSelection = (selection) => {
5821
+ if (!selection || !selection.toString().length)
5822
+ return "";
5823
+ if (selection.anchorNode === null || selection.focusNode === null)
5824
+ return "";
5825
+ var range = selection.getRangeAt(0);
5826
+ var tempDiv = document.createElement("div");
5827
+ tempDiv.appendChild(range.cloneContents());
5828
+ var items = tempDiv.querySelectorAll("div");
5829
+ items.forEach(function (item) {
5830
+ if (item.getAttribute("data-unselectable")) {
5831
+ item.remove();
5832
+ }
5833
+ });
5834
+ var filteredText = tempDiv.textContent || tempDiv.innerText;
5835
+ return filteredText.length ? filteredText.trim() : selection.toString();
5836
+ };
5837
+ /**
5838
+ * Use Highlight to use highlight interation on any text element
5839
+ */
5840
+ const Highlight = (props) => {
5841
+ var _a;
5842
+ const { onSelectionButtonClick, search, i18n, children } = props;
5843
+ const ref = React.useRef(null);
5844
+ const [isSelecting, setIsSelecting] = React.useState(false);
5845
+ const [position, setPosition] = React.useState();
5846
+ const [selection, setSelection] = React.useState();
5847
+ const activeSelection = document.getSelection();
5848
+ const extractText = React.useMemo(() => textFromSelection(activeSelection), [activeSelection]);
5849
+ const handleSelectionChange = React.useCallback(() => {
5850
+ var _a, _b, _c, _d, _e, _f, _g, _h;
5851
+ if (activeSelection && activeSelection.toString().length > 0) {
5852
+ // Extract the text from the selection cleaning unselectable items
5853
+ const text = extractText;
5854
+ if (!text)
5855
+ return;
5856
+ const anchorNode = (_a = activeSelection === null || activeSelection === void 0 ? void 0 : activeSelection.anchorNode) === null || _a === void 0 ? void 0 : _a.parentElement;
5857
+ const focusNode = (_b = activeSelection === null || activeSelection === void 0 ? void 0 : activeSelection.focusNode) === null || _b === void 0 ? void 0 : _b.parentElement;
5858
+ if (anchorNode &&
5859
+ focusNode &&
5860
+ ((_c = ref.current) === null || _c === void 0 ? void 0 : _c.contains(anchorNode)) && // Selection starts inside the ref
5861
+ ((_d = ref.current) === null || _d === void 0 ? void 0 : _d.contains(focusNode)) // Selection ends inside the ref
5862
+ ) {
5863
+ if (onSelectionButtonClick) {
5864
+ setIsSelecting(true);
5865
+ const range = activeSelection.getRangeAt(0);
5866
+ const rects = range.getClientRects();
5867
+ const lastRect = rects[rects.length - 1];
5868
+ const containerRect = ref && ref.current ? ref.current.getBoundingClientRect() : null;
5869
+ if (!lastRect || !containerRect)
5870
+ return;
5871
+ const relativeY = lastRect.bottom - containerRect.top + ref.current.scrollTop;
5872
+ const relativeX = lastRect.right - containerRect.left + ref.current.scrollLeft;
5873
+ if (relativeY > 0 || relativeX > 0)
5874
+ // Fix to avoid the button to be placed sometimes at the top left corner of the screen (X: 0, Y: 0)
5875
+ setPosition({
5876
+ x: relativeX,
5877
+ y: relativeY + 15,
5878
+ });
5879
+ }
5880
+ else {
5881
+ setIsSelecting(false);
5882
+ }
5883
+ const selectionPart = {
5884
+ from: Math.min(Number.parseFloat((_e = anchorNode.getAttribute("data-start")) !== null && _e !== void 0 ? _e : "0"), Number.parseFloat((_f = focusNode.getAttribute("data-start")) !== null && _f !== void 0 ? _f : "0")),
5885
+ to: Math.max(Number.parseFloat((_g = anchorNode.getAttribute("data-end")) !== null && _g !== void 0 ? _g : "0"), Number.parseFloat((_h = focusNode.getAttribute("data-end")) !== null && _h !== void 0 ? _h : "0")),
5886
+ };
5887
+ setSelection(Object.assign(Object.assign({}, selectionPart), { text }));
5888
+ }
5889
+ else {
5890
+ setIsSelecting(false);
5891
+ }
5892
+ }
5893
+ else {
5894
+ setIsSelecting(false);
5895
+ }
5896
+ }, [activeSelection, extractText, onSelectionButtonClick]);
5897
+ React.useEffect(() => {
5898
+ if (ref.current === null)
5899
+ return;
5900
+ document.addEventListener("selectionchange", handleSelectionChange);
5901
+ return () => {
5902
+ document.removeEventListener("selectionchange", handleSelectionChange);
5903
+ };
5904
+ }, [ref, props, handleSelectionChange]);
5905
+ return (jsxRuntime.jsxs(HighlightContextProvider, Object.assign({ term: search }, { children: [jsxRuntime.jsx(WordsContainer, Object.assign({ ref: ref }, { children: children })), onSelectionButtonClick && isSelecting && selection && (jsxRuntime.jsxs(CreateObservationButton, Object.assign({ isAccent: true, isPrimary: true, position: position !== null && position !== void 0 ? position : {
5906
+ x: 0,
5907
+ y: 0,
5908
+ }, onClick: () => onSelectionButtonClick(selection) }, { children: [jsxRuntime.jsx(CreateObservationButton.StartIcon, { children: jsxRuntime.jsx(SvgTagStroke, {}) }), (_a = i18n === null || i18n === void 0 ? void 0 : i18n.selectionButtonLabel) !== null && _a !== void 0 ? _a : "Create observation"] })))] })));
5909
+ };
5910
+ const Word$1 = (props) => {
5911
+ const isActive = props.currentTime &&
5912
+ props.currentTime >= props.start &&
5913
+ props.currentTime < props.end;
5914
+ // Are there any observations containing this word?
5915
+ const foundObservations = React.useMemo(() => {
5916
+ var _a, _b;
5917
+ return (_b = (_a = props.observations) === null || _a === void 0 ? void 0 : _a.filter((obs) => props.start >= obs.start && props.end <= obs.end)) !== null && _b !== void 0 ? _b : [];
5918
+ }, [props.observations, props.start, props.end]);
5919
+ const ObsWord = React.useMemo(() => (jsxRuntime.jsxs(StyledWord, Object.assign({}, props, { "data-start": props.start, "data-end": props.end, className: foundObservations.length > 0 ? "highlighted" : "" }, (foundObservations && { observations: foundObservations }), { children: [foundObservations.length > 0 &&
5920
+ foundObservations.map((obs) => {
5921
+ var _a;
5922
+ return (jsxRuntime.jsx(Layer, { color: (_a = obs.hue) !== null && _a !== void 0 ? _a : theme.palette.grey[600] }, obs.id));
5923
+ }), isActive ? (jsxRuntime.jsx(ActiveWord, Object.assign({ "data-start": props.start, "data-end": props.end }, { children: jsxRuntime.jsx(Searchable, { text: props.text }) }))) : (jsxRuntime.jsx(Searchable, { text: props.text })), " "] }))), [props, foundObservations, isActive]);
5924
+ if (props.tooltipContent !== undefined && foundObservations.length > 0) {
5925
+ return (jsxRuntime.jsx(Tooltip, Object.assign({ content: props.tooltipContent(foundObservations), isTransparent: true }, { children: ObsWord })));
5926
+ }
5927
+ return jsxRuntime.jsx(jsxRuntime.Fragment, { children: ObsWord });
5928
+ };
5929
+ Highlight.Word = Word$1;
5342
5930
 
5343
5931
  /**
5344
5932
  * The Dots loader communicates ongoing activity after a user takes an action.
@@ -5413,7 +6001,7 @@ const Logo = (props) => {
5413
6001
  };
5414
6002
 
5415
6003
  var _path$a;
5416
- function _extends$b() { _extends$b = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$b.apply(this, arguments); }
6004
+ function _extends$b() { return _extends$b = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$b.apply(null, arguments); }
5417
6005
  const SvgPlus = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$b({
5418
6006
  width: 16,
5419
6007
  height: 16,
@@ -5461,7 +6049,7 @@ const MultiSelect = ({ options, onChange, creatable, i18n, maxItems, size, menuH
5461
6049
  setMatchingOptions(matchedOptions);
5462
6050
  }, [inputValue, options]);
5463
6051
  return (jsxRuntime.jsxs(Dropdown, Object.assign({ inputValue: inputValue, selectedItems: options.filter((option) => option.selected), onSelect: (items) => onChange &&
5464
- onChange(options.map((o) => (Object.assign(Object.assign({}, o), { selected: items.some((i) => i.id === o.id) })))), downshiftProps: { itemToString }, onInputValueChange: (value) => setInputValue(value) }, { children: [jsxRuntime.jsxs(Field$1, { children: [jsxRuntime.jsx(Label, Object.assign({ hidden: true }, { children: (_a = i18n === null || i18n === void 0 ? void 0 : i18n.label) !== null && _a !== void 0 ? _a : "Multiselect" })), jsxRuntime.jsx(reactDropdowns.Multiselect, { placeholder: (_b = i18n === null || i18n === void 0 ? void 0 : i18n.placeholder) !== null && _b !== void 0 ? _b : "Select Items", renderShowMore: i18n === null || i18n === void 0 ? void 0 : i18n.showMore, isCompact: size !== "medium", maxItems: maxItems, renderItem: ({ value }) => (jsxRuntime.jsxs(reactTags.Tag, Object.assign({ isPill: true }, { children: [jsxRuntime.jsx("span", { children: value.label }), jsxRuntime.jsx(reactTags.Tag.Close, { onClick: () => onChange &&
6052
+ onChange(options.map((o) => (Object.assign(Object.assign({}, o), { selected: items.some((i) => i.id === o.id) })))), downshiftProps: { itemToString }, onInputValueChange: (value) => setInputValue(value) }, { children: [jsxRuntime.jsxs(Field$1, { children: [jsxRuntime.jsx(Label$2, Object.assign({ hidden: true }, { children: (_a = i18n === null || i18n === void 0 ? void 0 : i18n.label) !== null && _a !== void 0 ? _a : "Multiselect" })), jsxRuntime.jsx(reactDropdowns.Multiselect, { placeholder: (_b = i18n === null || i18n === void 0 ? void 0 : i18n.placeholder) !== null && _b !== void 0 ? _b : "Select Items", renderShowMore: i18n === null || i18n === void 0 ? void 0 : i18n.showMore, isCompact: size !== "medium", maxItems: maxItems, renderItem: ({ value }) => (jsxRuntime.jsxs(reactTags.Tag, Object.assign({ isPill: true }, { children: [jsxRuntime.jsx("span", { children: value.label }), jsxRuntime.jsx(reactTags.Tag.Close, { onClick: () => onChange &&
5465
6053
  onChange(options.map((o) => (Object.assign(Object.assign({}, o), { selected: o.selected && o.id !== value.id })))) })] }))) })] }), jsxRuntime.jsxs(Menu, { children: [jsxRuntime.jsxs("div", Object.assign({ style: { maxHeight: menuHeight !== null && menuHeight !== void 0 ? menuHeight : "200px" } }, { children: [matchingOptions.map((option) => {
5466
6054
  const items = options
5467
6055
  .filter((o) => o.selected)
@@ -5522,18 +6110,18 @@ ModalFullScreen.Footer = StyledFooter$1;
5522
6110
  ModalFullScreen.Close = StyledModalClose;
5523
6111
  ModalFullScreen.FooterItem = FooterItem;
5524
6112
 
5525
- const UgBody = styled__default["default"](reactChrome.Body) `
5526
- background-color: ${({ theme }) => theme.palette.white};
5527
- `;
5528
- /**
5529
- * A Body defines the main content of an HTML document which displays on the browser
5530
- */
5531
- const Body$1 = (props) => jsxRuntime.jsx(UgBody, Object.assign({}, props));
5532
-
5533
- /**
5534
- * A Content defines the main content of an HTML document which displays on the browser
5535
- */
5536
- const Content = (props) => jsxRuntime.jsx(reactChrome.Content, Object.assign({}, props));
6113
+ var _path$9;
6114
+ function _extends$a() { return _extends$a = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$a.apply(null, arguments); }
6115
+ const SvgChevronDownStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$a({
6116
+ xmlns: "http://www.w3.org/2000/svg",
6117
+ width: 16,
6118
+ height: 16,
6119
+ focusable: "false",
6120
+ viewBox: "0 0 16 16"
6121
+ }, props), _path$9 || (_path$9 = /*#__PURE__*/React__namespace.createElement("path", {
6122
+ fill: "currentColor",
6123
+ d: "M12.688 5.61a.5.5 0 01.69.718l-.066.062-5 4a.5.5 0 01-.542.054l-.082-.054-5-4a.5.5 0 01.55-.83l.074.05L8 9.359l4.688-3.75z"
6124
+ })));
5537
6125
 
5538
6126
  const UgHeaderItem = styled__default["default"](reactChrome.HeaderItem) `
5539
6127
  ${(props) => props.hasLogo && `border-right: none`};
@@ -5551,15 +6139,15 @@ const HeaderItemText = (props) => jsxRuntime.jsx(UgHeaderItemText, Object.assign
5551
6139
 
5552
6140
  const HeaderItemIcon = (props) => (jsxRuntime.jsx(reactChrome.HeaderItemIcon, Object.assign({}, props)));
5553
6141
 
5554
- var _path$9;
5555
- function _extends$a() { _extends$a = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$a.apply(this, arguments); }
5556
- const SvgMenuStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$a({
6142
+ var _path$8;
6143
+ function _extends$9() { return _extends$9 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$9.apply(null, arguments); }
6144
+ const SvgMenuStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
5557
6145
  xmlns: "http://www.w3.org/2000/svg",
5558
6146
  width: 16,
5559
6147
  height: 16,
5560
6148
  focusable: "false",
5561
6149
  viewBox: "0 0 16 16"
5562
- }, props), _path$9 || (_path$9 = /*#__PURE__*/React__namespace.createElement("path", {
6150
+ }, props), _path$8 || (_path$8 = /*#__PURE__*/React__namespace.createElement("path", {
5563
6151
  fill: "none",
5564
6152
  stroke: "currentColor",
5565
6153
  strokeLinecap: "round",
@@ -5641,19 +6229,6 @@ Header.HeaderItem = HeaderItem;
5641
6229
  Header.HeaderItemText = HeaderItemText;
5642
6230
  Header.HeaderItemIcon = HeaderItemIcon;
5643
6231
 
5644
- var _path$8;
5645
- function _extends$9() { _extends$9 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$9.apply(this, arguments); }
5646
- const SvgChevronDownStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
5647
- xmlns: "http://www.w3.org/2000/svg",
5648
- width: 16,
5649
- height: 16,
5650
- focusable: "false",
5651
- viewBox: "0 0 16 16"
5652
- }, props), _path$8 || (_path$8 = /*#__PURE__*/React__namespace.createElement("path", {
5653
- fill: "currentColor",
5654
- d: "M12.688 5.61a.5.5 0 01.69.718l-.066.062-5 4a.5.5 0 01-.542.054l-.082-.054-5-4a.5.5 0 01.55-.83l.074.05L8 9.359l4.688-3.75z"
5655
- })));
5656
-
5657
6232
  const HeaderSkeleton = () => {
5658
6233
  return (jsxRuntime.jsxs(Header, Object.assign({ isStandalone: true }, { children: [jsxRuntime.jsx(LogoIconContainer, Object.assign({ hasLogo: true }, { children: jsxRuntime.jsx(HeaderItemIcon, { children: jsxRuntime.jsx(Logo, { type: "icon", size: 150 }) }) })), jsxRuntime.jsx(HeaderItem, Object.assign({ style: { marginRight: "auto", marginLeft: "-4px" } }, { children: window.matchMedia(`only screen and (min-width: 576px)`).matches ? (jsxRuntime.jsx(Skeleton, { width: "200px", height: theme.space.sm })) : (jsxRuntime.jsx(Skeleton, { width: "80px", height: theme.space.sm, style: { marginLeft: theme.space.sm } })) })), jsxRuntime.jsx(HeaderItem, Object.assign({ isRound: true }, { children: jsxRuntime.jsx(HeaderItemIcon, { children: jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(Skeleton, { width: "32px", height: "32px", style: { borderRadius: "100%" } }) }) }) }))] })));
5659
6234
  };
@@ -5672,6 +6247,27 @@ const AppHeader = (_a) => {
5672
6247
  return isLoading ? (jsxRuntime.jsx(HeaderSkeleton, {})) : (jsxRuntime.jsxs(Header, Object.assign({}, args, { style: Object.assign(Object.assign({}, style), { zIndex: (style === null || style === void 0 ? void 0 : style.zIndex) || theme.levels.front }) }, { children: [jsxRuntime.jsx(BrandItem, Object.assign({}, brand, { toggleMenu: args.onSidebarMenuToggle })), args.hasChangelog && args.changelogItem && (jsxRuntime.jsx(HeaderItem, Object.assign({ style: { marginRight: "-" + theme.space.xs } }, { children: jsxRuntime.jsx(HeaderItemIcon, { children: args.changelogItem }) }))), jsxRuntime.jsx(HeaderItem, Object.assign({ isRound: true, onClick: args.onProfileModalToggle }, { children: jsxRuntime.jsx(HeaderItemIcon, { children: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Avatar, Object.assign({}, avatar)), jsxRuntime.jsx(ChevronButton, Object.assign({ size: "small", isRotated: args.isProfileModalOpen }, { children: jsxRuntime.jsx(SvgChevronDownStroke, {}) }))] }) }) }))] })));
5673
6248
  };
5674
6249
 
6250
+ const UgBody = styled__default["default"](reactChrome.Body) `
6251
+ background-color: ${({ theme }) => theme.palette.white};
6252
+ `;
6253
+ /**
6254
+ * A Body defines the main content of an HTML document which displays on the browser
6255
+ */
6256
+ const Body$1 = (props) => jsxRuntime.jsx(UgBody, Object.assign({}, props));
6257
+
6258
+ /**
6259
+ * The Chrome component provides a high-level layout structure and sets a framework for navigating around Zendesk products.
6260
+ * <br>
6261
+ * Used for this:
6262
+ - To give a consistent dashboard and navigation experience
6263
+ */
6264
+ const Chrome = (props) => jsxRuntime.jsx(reactChrome.Chrome, Object.assign({}, props));
6265
+
6266
+ /**
6267
+ * A Content defines the main content of an HTML document which displays on the browser
6268
+ */
6269
+ const Content = (props) => jsxRuntime.jsx(reactChrome.Content, Object.assign({}, props));
6270
+
5675
6271
  const UgMain = styled__default["default"](reactChrome.Main) `
5676
6272
  @media (min-width: ${({ theme }) => theme.breakpoints.sm}) {
5677
6273
  margin: ${({ theme }) => theme.space.xxl}
@@ -5823,14 +6419,6 @@ NavAccordionItem.Panel = AccordionItemPanel;
5823
6419
  NavAccordionItem.Header = AccordionItemHeader;
5824
6420
  NavAccordionItem.Label = AccordionItemLabel;
5825
6421
 
5826
- /**
5827
- * The Chrome component provides a high-level layout structure and sets a framework for navigating around Zendesk products.
5828
- * <br>
5829
- * Used for this:
5830
- - To give a consistent dashboard and navigation experience
5831
- */
5832
- const Chrome = (props) => jsxRuntime.jsx(reactChrome.Chrome, Object.assign({}, props));
5833
-
5834
6422
  const UgPagination = styled__default["default"](reactPagination.Pagination) ``;
5835
6423
  /**
5836
6424
  * Pagination separates content into pages and allows users to navigate between those pages.
@@ -5957,7 +6545,7 @@ PageHeader.Meta = MainMeta;
5957
6545
  PageHeader.Footer = StyledFooter;
5958
6546
 
5959
6547
  var _path$7, _path2;
5960
- function _extends$8() { _extends$8 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$8.apply(this, arguments); }
6548
+ function _extends$8() { return _extends$8 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$8.apply(null, arguments); }
5961
6549
  const SvgExit = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$8({
5962
6550
  xmlns: "http://www.w3.org/2000/svg",
5963
6551
  width: 16,
@@ -5975,7 +6563,7 @@ const SvgExit = props => /*#__PURE__*/React__namespace.createElement("svg", _ext
5975
6563
  })));
5976
6564
 
5977
6565
  var _path$6;
5978
- function _extends$7() { _extends$7 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$7.apply(this, arguments); }
6566
+ function _extends$7() { return _extends$7 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$7.apply(null, arguments); }
5979
6567
  const SvgThumbsUp = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$7({
5980
6568
  width: 16,
5981
6569
  height: 16,
@@ -5990,7 +6578,7 @@ const SvgThumbsUp = props => /*#__PURE__*/React__namespace.createElement("svg",
5990
6578
  })));
5991
6579
 
5992
6580
  var _rect, _path$5;
5993
- function _extends$6() { _extends$6 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$6.apply(this, arguments); }
6581
+ function _extends$6() { return _extends$6 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$6.apply(null, arguments); }
5994
6582
  const SvgLockLockedFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$6({
5995
6583
  xmlns: "http://www.w3.org/2000/svg",
5996
6584
  width: 16,
@@ -6117,7 +6705,7 @@ const MenuItem = (_a) => {
6117
6705
  };
6118
6706
 
6119
6707
  var _path$4;
6120
- function _extends$5() { _extends$5 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$5.apply(this, arguments); }
6708
+ function _extends$5() { return _extends$5 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$5.apply(null, arguments); }
6121
6709
  const SvgQuestionMark = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$5({
6122
6710
  width: 16,
6123
6711
  height: 16,
@@ -6131,7 +6719,7 @@ const SvgQuestionMark = props => /*#__PURE__*/React__namespace.createElement("sv
6131
6719
  })));
6132
6720
 
6133
6721
  var _path$3;
6134
- function _extends$4() { _extends$4 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$4.apply(this, arguments); }
6722
+ function _extends$4() { return _extends$4 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$4.apply(null, arguments); }
6135
6723
  const SvgCopy = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$4({
6136
6724
  width: 12,
6137
6725
  height: 16,
@@ -6146,7 +6734,7 @@ const SvgCopy = props => /*#__PURE__*/React__namespace.createElement("svg", _ext
6146
6734
  })));
6147
6735
 
6148
6736
  var _path$2;
6149
- function _extends$3() { _extends$3 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3.apply(this, arguments); }
6737
+ function _extends$3() { return _extends$3 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$3.apply(null, arguments); }
6150
6738
  const SvgInfoFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$3({
6151
6739
  width: 16,
6152
6740
  height: 16,
@@ -6178,7 +6766,7 @@ const UgParagraph = styled__default["default"](reactTypography.Paragraph) `
6178
6766
  /**
6179
6767
  * Use Paragraph to render blocks of text with Garden styling.
6180
6768
  */
6181
- const Paragraph = (props) => jsxRuntime.jsx(UgParagraph, Object.assign({}, props));
6769
+ const Paragraph$1 = (props) => jsxRuntime.jsx(UgParagraph, Object.assign({}, props));
6182
6770
 
6183
6771
  const getInitials = (name) => {
6184
6772
  const names = name.split(" ");
@@ -6206,7 +6794,7 @@ const StyledBody$3 = styled__default["default"].div `
6206
6794
  margin: ${({ theme }) => theme.space.base * 6}px
6207
6795
  ${({ theme }) => theme.space.base * 4}px;
6208
6796
  `;
6209
- const StyledParagraph = styled__default["default"](Paragraph) `
6797
+ const StyledParagraph = styled__default["default"](Paragraph$1) `
6210
6798
  margin-top: ${({ theme }) => theme.space.base * 4}px;
6211
6799
  `;
6212
6800
  const Footer = styled__default["default"].div `
@@ -6234,15 +6822,15 @@ const HelpItem = (props) => {
6234
6822
  if (email.length > 24) {
6235
6823
  csmEmailCut = `${email.substring(0, 21)}...`;
6236
6824
  }
6237
- const content = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(PreviousButton, Object.assign({ onClick: () => props.setActive(""), isBasic: true }, { children: props.title })), jsxRuntime.jsx(Separator, {}), jsxRuntime.jsxs(StyledBody$3, { children: [jsxRuntime.jsx(Paragraph, Object.assign({ style: { color: theme.palette.grey[600] } }, { children: jsxRuntime.jsx(SM, { children: props.contactLabel }) })), jsxRuntime.jsx(StyledParagraph, { children: jsxRuntime.jsx(Avatar, { children: (_a = props.csm.picture) !== null && _a !== void 0 ? _a : getInitials(props.csm.name), avatarType: props.csm.picture ? "image" : "text", size: "large" }) }), jsxRuntime.jsxs(StyledParagraph, { children: [jsxRuntime.jsx(MD, Object.assign({ isBold: true }, { children: props.csm.name })), jsxRuntime.jsxs(Description, { children: [jsxRuntime.jsx(Anchor, Object.assign({ href: `mailto:${props.csm.email}`, style: { color: theme.palette.grey[600] } }, { children: csmEmailCut })), jsxRuntime.jsxs(StyledButton, Object.assign({ isBasic: true, onClick: () => {
6825
+ const content = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(PreviousButton, Object.assign({ onClick: () => props.setActive(""), isBasic: true }, { children: props.title })), jsxRuntime.jsx(Separator, {}), jsxRuntime.jsxs(StyledBody$3, { children: [jsxRuntime.jsx(Paragraph$1, Object.assign({ style: { color: theme.palette.grey[600] } }, { children: jsxRuntime.jsx(SM, { children: props.contactLabel }) })), jsxRuntime.jsx(StyledParagraph, { children: jsxRuntime.jsx(Avatar, { children: (_a = props.csm.picture) !== null && _a !== void 0 ? _a : getInitials(props.csm.name), avatarType: props.csm.picture ? "image" : "text", size: "large" }) }), jsxRuntime.jsxs(StyledParagraph, { children: [jsxRuntime.jsx(MD, Object.assign({ isBold: true }, { children: props.csm.name })), jsxRuntime.jsxs(Description, { children: [jsxRuntime.jsx(Anchor, Object.assign({ href: `mailto:${props.csm.email}`, style: { color: theme.palette.grey[600] } }, { children: csmEmailCut })), jsxRuntime.jsxs(StyledButton, Object.assign({ isBasic: true, onClick: () => {
6238
6826
  var _a;
6239
6827
  copyToClipBoard();
6240
6828
  (_a = props.onCopyEmail) === null || _a === void 0 ? void 0 : _a.call(props);
6241
- }, size: "small" }, { children: [jsxRuntime.jsx(StyledButton.StartIcon, { children: jsxRuntime.jsx(SvgCopy, {}) }), (_b = props.copyLabel) !== null && _b !== void 0 ? _b : "Copy"] }))] })] })] }), props.chatSupport && (jsxRuntime.jsxs(Footer, { children: [jsxRuntime.jsx(Separator, {}), jsxRuntime.jsxs(StyledFooterButton, Object.assign({ isStretched: true, isBasic: true, onClick: props.toggleChat, style: { paddingLeft: theme.space.xxs } }, { children: [jsxRuntime.jsx(StyledFooterButton.StartIcon, { children: jsxRuntime.jsx(SvgInfoFill, { color: theme.palette.blue[600] }) }), (_c = props.chatSupportLabel) !== null && _c !== void 0 ? _c : "Report a technical issue"] }))] }))] }));
6829
+ }, size: "small" }, { children: [jsxRuntime.jsx(StyledButton.StartIcon, { children: jsxRuntime.jsx(SvgCopy, {}) }), (_b = props.copyLabel) !== null && _b !== void 0 ? _b : "Copy"] }))] })] })] }), props.chatSupport && (jsxRuntime.jsxs(Footer, { children: [jsxRuntime.jsx(Separator, {}), jsxRuntime.jsxs(StyledFooterButton, Object.assign({ isStretched: true, isBasic: true, onClick: props.toggleChat, style: { paddingLeft: theme.space.xxs } }, { children: [jsxRuntime.jsx(Button.StartIcon, { children: jsxRuntime.jsx(SvgInfoFill, { color: theme.palette.blue[600] }) }), (_c = props.chatSupportLabel) !== null && _c !== void 0 ? _c : "Report a technical issue"] }))] }))] }));
6242
6830
  return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(MenuItem, Object.assign({ content: content, value: props.value, selectedItem: props.selectedItem, setActive: props.setActive, icon: jsxRuntime.jsx(SvgQuestionMark, { color: theme.palette.blue[600] }) }, { children: props.title })) }));
6243
6831
  };
6244
6832
 
6245
- function _extends$2() { _extends$2 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); }
6833
+ function _extends$2() { return _extends$2 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$2.apply(null, arguments); }
6246
6834
  const SvgEmpty = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
6247
6835
  width: 16,
6248
6836
  height: 16,
@@ -6252,7 +6840,7 @@ const SvgEmpty = props => /*#__PURE__*/React__namespace.createElement("svg", _ex
6252
6840
  }, props));
6253
6841
 
6254
6842
  var _path$1;
6255
- function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
6843
+ function _extends$1() { return _extends$1 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$1.apply(null, arguments); }
6256
6844
  const SvgTranslationExists = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
6257
6845
  width: 16,
6258
6846
  height: 16,
@@ -6303,7 +6891,7 @@ const UserContainer = (props) => {
6303
6891
  };
6304
6892
 
6305
6893
  var _path;
6306
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
6894
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
6307
6895
  const SvgGearFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends({
6308
6896
  width: 16,
6309
6897
  height: 16,
@@ -6340,7 +6928,7 @@ const SettingsItem = (props) => {
6340
6928
  setValue(value);
6341
6929
  props.onSetSettings && props.onSetSettings(value);
6342
6930
  };
6343
- const content = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(PreviousButton, Object.assign({ onClick: () => props.setActive(""), isBasic: true }, { children: (_a = props.i18n) === null || _a === void 0 ? void 0 : _a.settingsTitle })), jsxRuntime.jsx(Separator, {}), jsxRuntime.jsxs(StyledBody$1, { children: [props.i18n && props.i18n.settingsIntroText && (jsxRuntime.jsx(SettingsIntroText, { children: jsxRuntime.jsx(SM, { children: props.i18n.settingsIntroText }) })), jsxRuntime.jsxs(Field, { children: [jsxRuntime.jsx(TriggerTitle, Object.assign({ isBold: true }, { children: (_c = (_b = props.i18n) === null || _b === void 0 ? void 0 : _b.settingsToggle) === null || _c === void 0 ? void 0 : _c.title })), jsxRuntime.jsx(Toggle, Object.assign({ checked: value === 1, onChange: () => onToggleSettings(value === 1 ? 0 : 1) }, { children: jsxRuntime.jsx(Label, { children: value === 1
6931
+ const content = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(PreviousButton, Object.assign({ onClick: () => props.setActive(""), isBasic: true }, { children: (_a = props.i18n) === null || _a === void 0 ? void 0 : _a.settingsTitle })), jsxRuntime.jsx(Separator, {}), jsxRuntime.jsxs(StyledBody$1, { children: [props.i18n && props.i18n.settingsIntroText && (jsxRuntime.jsx(SettingsIntroText, { children: jsxRuntime.jsx(SM, { children: props.i18n.settingsIntroText }) })), jsxRuntime.jsxs(Field, { children: [jsxRuntime.jsx(TriggerTitle, Object.assign({ isBold: true }, { children: (_c = (_b = props.i18n) === null || _b === void 0 ? void 0 : _b.settingsToggle) === null || _c === void 0 ? void 0 : _c.title })), jsxRuntime.jsx(Toggle, Object.assign({ checked: value === 1, onChange: () => onToggleSettings(value === 1 ? 0 : 1) }, { children: jsxRuntime.jsx(Label$2, { children: value === 1
6344
6932
  ? (_e = (_d = props.i18n) === null || _d === void 0 ? void 0 : _d.settingsToggle) === null || _e === void 0 ? void 0 : _e.on
6345
6933
  : (_g = (_f = props.i18n) === null || _f === void 0 ? void 0 : _f.settingsToggle) === null || _g === void 0 ? void 0 : _g.off }) }))] }), props.i18n && props.i18n.settingsOutroText && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(SettingsOutroText, { children: [jsxRuntime.jsx(SM, { children: props.i18n.settingsOutroText.paragraph_1 }), jsxRuntime.jsx(SM, { children: props.i18n.settingsOutroText.paragraph_2 })] }), jsxRuntime.jsx(SettingsOutroText, { children: jsxRuntime.jsx(SM, { children: props.i18n.settingsOutroText.paragraph_3 }) })] }))] })] }));
6346
6934
  return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(MenuItem, Object.assign({ content: content, value: props.value, selectedItem: props.selectedItem, setActive: props.setActive, icon: jsxRuntime.jsx(SvgGearFill, { color: theme.palette.blue[600] }) }, { children: (_h = props.i18n) === null || _h === void 0 ? void 0 : _h.settingsTitle })) }));
@@ -6554,7 +7142,7 @@ const UgGroupRow = styled__default["default"](reactTables.GroupRow) `
6554
7142
  const GroupRow = (props) => jsxRuntime.jsx(UgGroupRow, Object.assign({}, props));
6555
7143
  const GroupRowComponent = (props) => {
6556
7144
  return (jsxRuntime.jsx(GroupRow, Object.assign({}, (props && props.group.items.length === 0 && { className: "empty" }), (props &&
6557
- props.group.items.length > 0 && { onClick: props.handleToggle }), props, { children: jsxRuntime.jsxs(Cell, Object.assign({ colSpan: props.colSpan, className: props.open ? "open" : "closed" }, { children: [props.group.groupIcon && (jsxRuntime.jsx(StyledUgIcon, { size: 12, type: props.group.groupIcon })), jsxRuntime.jsxs(Label, Object.assign({ isRegular: true, className: "title" }, { children: [props.group.groupName, " ", jsxRuntime.jsxs("b", { children: ["(", props.group.items.length, ")"] })] })), jsxRuntime.jsx(StyledAnimatedToggle, Object.assign({ style: { transform: props.open ? "rotate(180deg)" : "none" } }, { children: jsxRuntime.jsx(SvgChevronDownStroke, {}) }))] })) })));
7145
+ props.group.items.length > 0 && { onClick: props.handleToggle }), props, { children: jsxRuntime.jsxs(Cell, Object.assign({ colSpan: props.colSpan, className: props.open ? "open" : "closed" }, { children: [props.group.groupIcon && (jsxRuntime.jsx(StyledUgIcon, { size: 12, type: props.group.groupIcon })), jsxRuntime.jsxs(Label$2, Object.assign({ isRegular: true, className: "title" }, { children: [props.group.groupName, " ", jsxRuntime.jsxs("b", { children: ["(", props.group.items.length, ")"] })] })), jsxRuntime.jsx(StyledAnimatedToggle, Object.assign({ style: { transform: props.open ? "rotate(180deg)" : "none" } }, { children: jsxRuntime.jsx(SvgChevronDownStroke, {}) }))] })) })));
6558
7146
  };
6559
7147
  const AnimatedRow = styled__default["default"](Row) `
6560
7148
  &.render {
@@ -6758,10 +7346,377 @@ OrderedList.Item = UgOrderedList.Item;
6758
7346
  const UnorderedList = (props) => jsxRuntime.jsx(UgUnorderedList, Object.assign({}, props));
6759
7347
  UnorderedList.Item = UgUnorderedList.Item;
6760
7348
 
7349
+ const MenuContainer = styled__default["default"].div `
7350
+ box-shadow: ${({ theme }) => theme.shadows.boxShadow(theme)};
7351
+ display: flex;
7352
+ `;
7353
+ const FloatingMenu = (props) => {
7354
+ const { editor, onClick } = props;
7355
+ const shouldShow = (props) => {
7356
+ // At least a word selected?", props.from !== props.to);
7357
+ return props.from !== props.to;
7358
+ };
7359
+ if (!editor) {
7360
+ return null;
7361
+ }
7362
+ return (jsxRuntime.jsx(react.BubbleMenu, Object.assign({ editor: editor, shouldShow: shouldShow }, { children: jsxRuntime.jsx(MenuContainer, Object.assign({ className: "bubble-menu" }, { children: jsxRuntime.jsxs(Button, Object.assign({ isAccent: true, isPrimary: true, onClick: () => onClick(editor) }, { children: [jsxRuntime.jsx(Button.StartIcon, { children: jsxRuntime.jsx(SvgTagStroke, {}) }), "Create Observation"] })) })) })));
7363
+ };
7364
+
7365
+ const Search = ({ editor }) => {
7366
+ const [search, setSearch] = React.useState("");
7367
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("input", { type: "text", onChange: (e) => {
7368
+ setSearch(e.target.value);
7369
+ } }), jsxRuntime.jsx("button", Object.assign({ onClick: () => {
7370
+ editor.commands.setSearchTerm(search);
7371
+ } }, { children: "Search" }))] }));
7372
+ };
7373
+ const SearchStyle = styled.css `
7374
+ .search-result {
7375
+ background-color: rgba(255, 217, 0, 0.5);
7376
+
7377
+ &-current {
7378
+ background-color: rgba(13, 255, 0, 0.5);
7379
+ }
7380
+ }
7381
+ `;
7382
+ Search.Style = SearchStyle;
7383
+
7384
+ const Active = ({ onSetCurrentTime, }) => core.Node.create({
7385
+ name: "Active",
7386
+ content: "inline*",
7387
+ inline: true,
7388
+ parseHTML() {
7389
+ return [
7390
+ {
7391
+ tag: "span",
7392
+ },
7393
+ ];
7394
+ },
7395
+ renderHTML({ node }) {
7396
+ return [
7397
+ "active",
7398
+ {
7399
+ style: "background-color: #ff0000;",
7400
+ },
7401
+ 0,
7402
+ ];
7403
+ },
7404
+ addCommands() {
7405
+ return {
7406
+ setCurrentTime: (start) => () => {
7407
+ if (onSetCurrentTime)
7408
+ onSetCurrentTime(start);
7409
+ return true;
7410
+ },
7411
+ updateCurrentActive: ({ currentWord }) => ({ state, view }) => {
7412
+ const { tr } = state;
7413
+ // trova il nodo "active"
7414
+ state.doc.descendants((node, pos) => {
7415
+ if (node.type.name === "Word") {
7416
+ // check if the node has an "active" descendant
7417
+ let hasActiveDescendant = false;
7418
+ node.descendants((child) => {
7419
+ hasActiveDescendant =
7420
+ hasActiveDescendant || child.type.name === "Active";
7421
+ });
7422
+ if (hasActiveDescendant) {
7423
+ // remove the "active" descendant
7424
+ function removeActiveDescendant(n) {
7425
+ var _a;
7426
+ if (((_a = n.firstChild) === null || _a === void 0 ? void 0 : _a.type.name) === "Active") {
7427
+ const textContent = n.textContent;
7428
+ const textNode = state.schema.text(textContent);
7429
+ return n.copy(model.Fragment.from(textNode));
7430
+ }
7431
+ let updatedContent = model.Fragment.empty;
7432
+ n.content.forEach((child) => {
7433
+ updatedContent = updatedContent.addToEnd(removeActiveDescendant(child));
7434
+ });
7435
+ return n.copy(updatedContent);
7436
+ }
7437
+ tr.replaceWith(tr.mapping.map(pos), tr.mapping.map(pos + node.nodeSize), removeActiveDescendant(node));
7438
+ }
7439
+ }
7440
+ if (node.type.name === "Word" &&
7441
+ node.attrs["data-start"] === currentWord.start &&
7442
+ node.attrs["data-end"] === currentWord.end) {
7443
+ function getUpdatedNode(n) {
7444
+ var _a;
7445
+ if (((_a = n.firstChild) === null || _a === void 0 ? void 0 : _a.type.name) === "text" &&
7446
+ n.type.name !== "Active") {
7447
+ return n.copy(model.Fragment.from(state.schema.nodes.Active.create({}, n.content.firstChild)));
7448
+ }
7449
+ let updatedContent = model.Fragment.empty;
7450
+ n.content.forEach((child, index) => {
7451
+ updatedContent = updatedContent.addToEnd(getUpdatedNode(child));
7452
+ });
7453
+ return n.copy(updatedContent);
7454
+ }
7455
+ tr.replaceWith(tr.mapping.map(pos), tr.mapping.map(pos + node.nodeSize), getUpdatedNode(node));
7456
+ }
7457
+ });
7458
+ view.updateState(view.state.apply(view.state.tr));
7459
+ return true;
7460
+ },
7461
+ };
7462
+ },
7463
+ });
7464
+
7465
+ const useTypeSpec = (type) => {
7466
+ switch (type) {
7467
+ default:
7468
+ return {
7469
+ background: "rgba(144,144,144,0.3)",
7470
+ };
7471
+ }
7472
+ };
7473
+ const Component$1 = ({ node, editor, }) => {
7474
+ const { background } = useTypeSpec(node.attrs["type"]);
7475
+ return (jsxRuntime.jsx(react.NodeViewWrapper, Object.assign({ as: "span", className: "react-component" }, { children: jsxRuntime.jsx("span", Object.assign({ style: { background } }, { children: jsxRuntime.jsx(Tooltip, Object.assign({ content: node.attrs["title"] || "" }, { children: jsxRuntime.jsx("span", { children: jsxRuntime.jsx(react.NodeViewContent, { as: "span", className: "content is-editable" }) }) })) })) })));
7476
+ };
7477
+
7478
+ const Observation = core.Node.create({
7479
+ name: "Observation",
7480
+ content: "inline*",
7481
+ inline: true,
7482
+ addAttributes() {
7483
+ return {
7484
+ type: {
7485
+ default: "",
7486
+ },
7487
+ title: {
7488
+ default: "",
7489
+ },
7490
+ };
7491
+ },
7492
+ parseHTML() {
7493
+ return [
7494
+ {
7495
+ tag: "observation",
7496
+ },
7497
+ ];
7498
+ },
7499
+ addCommands() {
7500
+ return {
7501
+ addObservation: (type, title) => ({ tr, state, view }) => {
7502
+ const { from, to } = state.selection;
7503
+ state.doc.nodesBetween(from, to, (node, pos) => {
7504
+ // Controlla se il nodo è del tipo che vuoi sostituire (ad esempio "word")
7505
+ if (node.type.name === "Word") {
7506
+ // Crea il nodo "active"
7507
+ const annotationNode = state.schema.nodes.Observation.create({
7508
+ title: "Ciao",
7509
+ }, node.content);
7510
+ // Crea il nodo "word" aggiornato con "active" come figlio
7511
+ const updatedNode = node.copy(model.Fragment.from(annotationNode));
7512
+ // Sostituisci il nodo originale con quello aggiornato
7513
+ tr.replaceWith(tr.mapping.map(pos), tr.mapping.map(pos + node.nodeSize), updatedNode);
7514
+ }
7515
+ });
7516
+ view.updateState(view.state.apply(view.state.tr));
7517
+ return true;
7518
+ },
7519
+ };
7520
+ },
7521
+ renderHTML({ HTMLAttributes }) {
7522
+ return ["observation", react.mergeAttributes(HTMLAttributes), 0];
7523
+ },
7524
+ addNodeView() {
7525
+ return react.ReactNodeViewRenderer(Component$1);
7526
+ },
7527
+ });
7528
+
7529
+ const Label = styled__default["default"].p `
7530
+ user-select: none;
7531
+ margin: 24px 0 12px;
7532
+ `;
7533
+ const formatTime = (seconds) => {
7534
+ const date = new Date(0);
7535
+ date.setSeconds(seconds);
7536
+ if (seconds < 3600)
7537
+ return date.toISOString().substring(14, 19);
7538
+ return date.toISOString().substring(11, 19);
7539
+ };
7540
+ const Component = ({ node, editor, }) => {
7541
+ return (jsxRuntime.jsxs(react.NodeViewWrapper, Object.assign({ className: "react-component" }, { children: [jsxRuntime.jsxs(Label, Object.assign({ onClick: () => {
7542
+ let currentWord = null;
7543
+ node.descendants((child) => {
7544
+ if (currentWord !== null)
7545
+ return false;
7546
+ if (child.type.name === "Word") {
7547
+ currentWord = child;
7548
+ }
7549
+ });
7550
+ if (!currentWord)
7551
+ return;
7552
+ const word = currentWord;
7553
+ editor.commands.setCurrentTime(word.attrs["data-start"]);
7554
+ }, contentEditable: false }, { children: [node.attrs.speakername, " (", formatTime(node.attrs.start), " -", " ", formatTime(node.attrs.end), ")"] })), jsxRuntime.jsx(react.NodeViewContent, { className: "content is-editable" })] })));
7555
+ };
7556
+
7557
+ const Paragraph = core.Node.create({
7558
+ name: "Paragraph",
7559
+ group: "block",
7560
+ atom: false,
7561
+ content: "inline*",
7562
+ addAttributes() {
7563
+ return {
7564
+ speakername: {
7565
+ default: "Speaker",
7566
+ },
7567
+ start: {
7568
+ default: 0,
7569
+ },
7570
+ end: {
7571
+ default: 0,
7572
+ },
7573
+ };
7574
+ },
7575
+ parseHTML() {
7576
+ return [
7577
+ {
7578
+ tag: "speaker-paragraph",
7579
+ },
7580
+ ];
7581
+ },
7582
+ renderHTML({ HTMLAttributes }) {
7583
+ return ["speaker-paragraph", core.mergeAttributes(HTMLAttributes), 0];
7584
+ },
7585
+ addNodeView() {
7586
+ return react.ReactNodeViewRenderer(Component);
7587
+ },
7588
+ });
7589
+
7590
+ const Word = core.Node.create({
7591
+ name: "Word",
7592
+ group: "inline",
7593
+ content: "inline*",
7594
+ inline: true,
7595
+ addAttributes() {
7596
+ return {
7597
+ "data-start": {
7598
+ default: null,
7599
+ },
7600
+ "data-end": {
7601
+ default: null,
7602
+ },
7603
+ };
7604
+ },
7605
+ parseHTML() {
7606
+ return [
7607
+ {
7608
+ tag: "span[data-start][data-end]",
7609
+ },
7610
+ ];
7611
+ },
7612
+ renderHTML({ node }) {
7613
+ return [
7614
+ "span",
7615
+ {
7616
+ "data-start": node.attrs["data-start"],
7617
+ "data-end": node.attrs["data-end"],
7618
+ style: "",
7619
+ },
7620
+ 0,
7621
+ ];
7622
+ },
7623
+ });
7624
+
7625
+ const useEditor = ({ content, currentTime, onSetCurrentTime, }, deps) => {
7626
+ const ed = react.useEditor({
7627
+ extensions: [
7628
+ Document__default["default"],
7629
+ Paragraph,
7630
+ Text__default["default"],
7631
+ Word,
7632
+ SearchAndReplace__default["default"].configure(),
7633
+ Active({
7634
+ onSetCurrentTime,
7635
+ }),
7636
+ Observation,
7637
+ ],
7638
+ editorProps: {
7639
+ handlePaste: () => true,
7640
+ },
7641
+ content: {
7642
+ type: "doc",
7643
+ content: content
7644
+ ? content.map((paragraph) => ({
7645
+ type: "Paragraph",
7646
+ attrs: {
7647
+ speakername: `Speaker ${paragraph.speaker}`,
7648
+ start: paragraph.start,
7649
+ end: paragraph.end,
7650
+ },
7651
+ content: paragraph.words.map((word) => ({
7652
+ type: "Word",
7653
+ attrs: {
7654
+ "data-start": word.start,
7655
+ "data-end": word.end,
7656
+ },
7657
+ content: [
7658
+ {
7659
+ type: "text",
7660
+ text: `${word.word} `,
7661
+ },
7662
+ ],
7663
+ })),
7664
+ }))
7665
+ : undefined,
7666
+ },
7667
+ }, deps);
7668
+ React.useEffect(() => {
7669
+ if (!currentTime)
7670
+ return;
7671
+ if (!ed)
7672
+ return;
7673
+ const currentParagraph = content === null || content === void 0 ? void 0 : content.find((paragraph) => paragraph.words.some((word) => word.start * 1000 <= currentTime && word.end * 1000 >= currentTime));
7674
+ if (!currentParagraph)
7675
+ return;
7676
+ const currentWord = currentParagraph.words.find((word) => word.start * 1000 <= currentTime && word.end * 1000 >= currentTime);
7677
+ if (!currentWord)
7678
+ return;
7679
+ ed.commands.updateCurrentActive({ currentWord });
7680
+ }, [currentTime, content, ed]);
7681
+ return ed;
7682
+ };
7683
+
7684
+ const EditorWrapper = styled__default["default"].div `
7685
+ ${Search.Style}
7686
+ `;
7687
+ const EditorWithHighlight = ({ editor }) => {
7688
+ const ref = React.useRef(null);
7689
+ const handleDragStart = React.useCallback((event) => {
7690
+ const selection = window.getSelection();
7691
+ if (selection && selection.toString()) {
7692
+ event.preventDefault();
7693
+ }
7694
+ }, []);
7695
+ React.useEffect(() => {
7696
+ const currentRef = ref.current;
7697
+ if (!currentRef)
7698
+ return;
7699
+ currentRef.addEventListener("dragstart", handleDragStart);
7700
+ return () => {
7701
+ currentRef.removeEventListener("dragstart", handleDragStart);
7702
+ };
7703
+ }, [handleDragStart]);
7704
+ if (!editor)
7705
+ return null;
7706
+ return (jsxRuntime.jsx(EditorWrapper, { children: jsxRuntime.jsx(react.EditorContent, { ref: ref, editor: editor }) }));
7707
+ };
7708
+ EditorWithHighlight.useEditor = useEditor;
7709
+ EditorWithHighlight.Search = Search;
7710
+ EditorWithHighlight.FloatingMenu = FloatingMenu;
7711
+
6761
7712
  Object.defineProperty(exports, 'ModalClose', {
6762
7713
  enumerable: true,
6763
7714
  get: function () { return reactModals.Close; }
6764
7715
  });
7716
+ Object.defineProperty(exports, 'useVideoContext', {
7717
+ enumerable: true,
7718
+ get: function () { return Video.useVideoContext; }
7719
+ });
6765
7720
  exports.Accordion = Accordion;
6766
7721
  exports.Alert = Alert;
6767
7722
  exports.Anchor = Anchor;
@@ -6802,6 +7757,7 @@ exports.Drawer = Drawer;
6802
7757
  exports.Dropdown = Dropdown;
6803
7758
  exports.DropdownField = index$1;
6804
7759
  exports.Editor = Editor;
7760
+ exports.EditorWithHighlight = EditorWithHighlight;
6805
7761
  exports.Ellipsis = Ellipsis;
6806
7762
  exports.FooterItem = FooterItem;
6807
7763
  exports.FormField = index;
@@ -6816,6 +7772,7 @@ exports.HeaderItem = HeaderItem;
6816
7772
  exports.HeaderItemIcon = HeaderItemIcon;
6817
7773
  exports.HeaderItemText = HeaderItemText;
6818
7774
  exports.HeaderRow = HeaderRow;
7775
+ exports.Highlight = Highlight;
6819
7776
  exports.Hint = Hint;
6820
7777
  exports.Icon = Icon;
6821
7778
  exports.IconButton = IconButton;
@@ -6826,7 +7783,7 @@ exports.Item = Item$1;
6826
7783
  exports.ItemContent = ItemContent;
6827
7784
  exports.ItemMeta = ItemMeta;
6828
7785
  exports.LG = LG;
6829
- exports.Label = Label;
7786
+ exports.Label = Label$2;
6830
7787
  exports.Lightbox = Lightbox;
6831
7788
  exports.LoginForm = LoginForm;
6832
7789
  exports.Logo = Logo;
@@ -6855,9 +7812,10 @@ exports.Notification = Notification;
6855
7812
  exports.OrderedList = OrderedList;
6856
7813
  exports.PageHeader = PageHeader;
6857
7814
  exports.Pagination = Pagination;
6858
- exports.Paragraph = Paragraph;
7815
+ exports.Paragraph = Paragraph$1;
6859
7816
  exports.PieChart = PieChart;
6860
7817
  exports.Player = Player;
7818
+ exports.PlayerProvider = PlayerProvider;
6861
7819
  exports.PreviousItem = PreviousItem;
6862
7820
  exports.ProductCard = ProductCard;
6863
7821
  exports.ProfileModal = ProfileModal;