@seamly/web-ui 20.1.0-alpha.1 → 20.1.0

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 (160) hide show
  1. package/build/dist/lib/deprecated-view.css +1 -1
  2. package/build/dist/lib/index.debug.js +135 -135
  3. package/build/dist/lib/index.debug.min.js +1 -1
  4. package/build/dist/lib/index.js +582 -570
  5. package/build/dist/lib/index.min.js +1 -1
  6. package/build/dist/lib/standalone.js +607 -595
  7. package/build/dist/lib/standalone.min.js +1 -1
  8. package/build/dist/lib/style-guide.js +7294 -7289
  9. package/build/dist/lib/style-guide.min.js +1 -1
  10. package/build/dist/lib/styles-default-implementation.css +1 -1
  11. package/build/dist/lib/styles.css +1 -1
  12. package/package.json +1 -1
  13. package/src/javascripts/api/errors/seamly-base-error.js +1 -0
  14. package/src/javascripts/api/index.js +24 -19
  15. package/src/javascripts/api/producer.js +3 -3
  16. package/src/javascripts/domains/app/actions.js +7 -7
  17. package/src/javascripts/domains/app/hooks.js +1 -1
  18. package/src/javascripts/domains/app/utils.js +1 -1
  19. package/src/javascripts/domains/config/hooks.js +1 -1
  20. package/src/javascripts/domains/config/reducer.js +3 -3
  21. package/src/javascripts/domains/config/selectors.js +1 -1
  22. package/src/javascripts/domains/config/utils.js +1 -1
  23. package/src/javascripts/domains/errors/index.js +2 -2
  24. package/src/javascripts/domains/forms/hooks.js +1 -1
  25. package/src/javascripts/domains/forms/provider.js +5 -3
  26. package/src/javascripts/domains/forms/reducer.js +1 -1
  27. package/src/javascripts/domains/forms/selectors.js +1 -1
  28. package/src/javascripts/domains/forms/utils.js +1 -1
  29. package/src/javascripts/domains/i18n/actions.js +1 -1
  30. package/src/javascripts/domains/i18n/hooks.js +1 -1
  31. package/src/javascripts/domains/i18n/reducer.js +1 -1
  32. package/src/javascripts/domains/i18n/utils.js +1 -1
  33. package/src/javascripts/domains/interrupt/hooks.js +2 -2
  34. package/src/javascripts/domains/interrupt/middleware.js +6 -6
  35. package/src/javascripts/domains/interrupt/reducer.js +1 -1
  36. package/src/javascripts/domains/interrupt/utils.js +1 -1
  37. package/src/javascripts/domains/options/middleware.js +1 -1
  38. package/src/javascripts/domains/store/index.js +10 -10
  39. package/src/javascripts/domains/store/state-reducer.js +3 -3
  40. package/src/javascripts/domains/translations/components/chat-status.js +8 -5
  41. package/src/javascripts/domains/translations/components/options-button.js +6 -6
  42. package/src/javascripts/domains/translations/components/options-dialog/form.js +5 -5
  43. package/src/javascripts/domains/translations/components/options-dialog/index.js +10 -7
  44. package/src/javascripts/domains/translations/hooks.js +7 -3
  45. package/src/javascripts/domains/translations/middleware.js +5 -2
  46. package/src/javascripts/domains/translations/reducer.js +4 -4
  47. package/src/javascripts/domains/translations/selectors.js +1 -1
  48. package/src/javascripts/domains/translations/utils.js +1 -1
  49. package/src/javascripts/domains/visibility/actions.js +3 -3
  50. package/src/javascripts/domains/visibility/hooks.js +1 -1
  51. package/src/javascripts/domains/visibility/utils.js +1 -1
  52. package/src/javascripts/lib/css.js +1 -1
  53. package/src/javascripts/lib/engine/index.js +6 -5
  54. package/src/javascripts/lib/external-api/index.js +1 -1
  55. package/src/javascripts/lib/redux-helpers/index.js +1 -1
  56. package/src/javascripts/style-guide/components/app.js +1 -1
  57. package/src/javascripts/style-guide/components/links.js +1 -1
  58. package/src/javascripts/style-guide/components/static-core.js +8 -11
  59. package/src/javascripts/ui/components/app-options/index.js +4 -4
  60. package/src/javascripts/ui/components/chat-status/index.js +2 -2
  61. package/src/javascripts/ui/components/conversation/component-filter.js +1 -1
  62. package/src/javascripts/ui/components/conversation/conversation.js +6 -6
  63. package/src/javascripts/ui/components/conversation/event/card-component.js +4 -4
  64. package/src/javascripts/ui/components/conversation/event/card-message.js +3 -3
  65. package/src/javascripts/ui/components/conversation/event/carousel-component/components/controls.js +3 -3
  66. package/src/javascripts/ui/components/conversation/event/carousel-component/components/pagination.js +1 -1
  67. package/src/javascripts/ui/components/conversation/event/carousel-component/index.js +3 -3
  68. package/src/javascripts/ui/components/conversation/event/carousel-message/components/slide.js +3 -3
  69. package/src/javascripts/ui/components/conversation/event/carousel-message/index.js +3 -3
  70. package/src/javascripts/ui/components/conversation/event/choice-prompt.js +7 -7
  71. package/src/javascripts/ui/components/conversation/event/cta.js +6 -6
  72. package/src/javascripts/ui/components/conversation/event/divider/index.js +1 -1
  73. package/src/javascripts/ui/components/conversation/event/divider/variants/default.js +3 -3
  74. package/src/javascripts/ui/components/conversation/event/divider/variants/new-translation.js +4 -4
  75. package/src/javascripts/ui/components/conversation/event/divider/variants/time-indicator.js +5 -5
  76. package/src/javascripts/ui/components/conversation/event/event-participant.js +4 -4
  77. package/src/javascripts/ui/components/conversation/event/event.js +2 -2
  78. package/src/javascripts/ui/components/conversation/event/hooks/use-event-link-click-handler.js +2 -2
  79. package/src/javascripts/ui/components/conversation/event/hooks/use-formatted-date.js +3 -3
  80. package/src/javascripts/ui/components/conversation/event/image-lightbox.js +4 -4
  81. package/src/javascripts/ui/components/conversation/event/image.js +2 -2
  82. package/src/javascripts/ui/components/conversation/event/participant.js +4 -4
  83. package/src/javascripts/ui/components/conversation/event/text.js +3 -3
  84. package/src/javascripts/ui/components/conversation/event/translation.js +3 -3
  85. package/src/javascripts/ui/components/conversation/event/upload.js +5 -5
  86. package/src/javascripts/ui/components/conversation/event/video.js +4 -4
  87. package/src/javascripts/ui/components/conversation/event-divider.js +2 -2
  88. package/src/javascripts/ui/components/conversation/loader.js +2 -2
  89. package/src/javascripts/ui/components/conversation/message-container.js +4 -4
  90. package/src/javascripts/ui/components/core/seamly-activity-monitor.js +4 -4
  91. package/src/javascripts/ui/components/core/seamly-core.js +2 -2
  92. package/src/javascripts/ui/components/core/seamly-event-subscriber.js +8 -8
  93. package/src/javascripts/ui/components/core/seamly-file-upload.js +5 -5
  94. package/src/javascripts/ui/components/core/seamly-idle-detach-counter.js +2 -2
  95. package/src/javascripts/ui/components/core/seamly-initializer.js +2 -2
  96. package/src/javascripts/ui/components/core/seamly-instance-functions-loader.js +5 -5
  97. package/src/javascripts/ui/components/core/seamly-live-region.js +2 -2
  98. package/src/javascripts/ui/components/core/seamly-new-notifications.js +5 -5
  99. package/src/javascripts/ui/components/core/seamly-read-state.js +6 -6
  100. package/src/javascripts/ui/components/entry/deprecated-toggle-button.js +5 -5
  101. package/src/javascripts/ui/components/entry/entry-container.js +8 -8
  102. package/src/javascripts/ui/components/entry/text-entry/hooks.js +6 -9
  103. package/src/javascripts/ui/components/entry/text-entry/index.js +2 -2
  104. package/src/javascripts/ui/components/entry/text-entry/text-entry-form.js +8 -8
  105. package/src/javascripts/ui/components/entry/upload/file-upload-form.js +5 -5
  106. package/src/javascripts/ui/components/entry/upload/index.js +10 -10
  107. package/src/javascripts/ui/components/entry/upload-toggle.js +9 -9
  108. package/src/javascripts/ui/components/faq/faq.js +16 -16
  109. package/src/javascripts/ui/components/form-controls/error.js +2 -2
  110. package/src/javascripts/ui/components/form-controls/file-input.js +4 -4
  111. package/src/javascripts/ui/components/form-controls/form.js +2 -2
  112. package/src/javascripts/ui/components/form-controls/input.js +1 -1
  113. package/src/javascripts/ui/components/form-controls/select.js +1 -1
  114. package/src/javascripts/ui/components/form-controls/wrapper.js +1 -1
  115. package/src/javascripts/ui/components/layout/agent-info.js +7 -7
  116. package/src/javascripts/ui/components/layout/chat-frame.js +5 -5
  117. package/src/javascripts/ui/components/layout/deprecated-app-frame.js +7 -7
  118. package/src/javascripts/ui/components/layout/header.js +3 -3
  119. package/src/javascripts/ui/components/layout/icon.js +1 -1
  120. package/src/javascripts/ui/components/layout/interrupt.js +3 -3
  121. package/src/javascripts/ui/components/layout/privacy-disclaimer.js +3 -3
  122. package/src/javascripts/ui/components/options/options-button.js +8 -13
  123. package/src/javascripts/ui/components/options/options-frame.js +4 -4
  124. package/src/javascripts/ui/components/options/options.js +1 -1
  125. package/src/javascripts/ui/components/options/transcript/index.js +8 -8
  126. package/src/javascripts/ui/components/options/transcript/transcript-form.js +4 -4
  127. package/src/javascripts/ui/components/warnings/idle-detach-warning.js +6 -6
  128. package/src/javascripts/ui/components/warnings/prompt.js +2 -2
  129. package/src/javascripts/ui/components/warnings/resume-conversation-prompt.js +5 -5
  130. package/src/javascripts/ui/components/widgets/in-out-transition.js +3 -3
  131. package/src/javascripts/ui/components/widgets/lightbox.js +6 -6
  132. package/src/javascripts/ui/components/widgets/modal.js +2 -2
  133. package/src/javascripts/ui/components/widgets/upload-progress.js +4 -4
  134. package/src/javascripts/ui/hooks/component-helper-hooks.js +1 -1
  135. package/src/javascripts/ui/hooks/file-upload-hooks.js +2 -3
  136. package/src/javascripts/ui/hooks/focus-helper-hooks.js +3 -3
  137. package/src/javascripts/ui/hooks/live-region-hooks.js +2 -2
  138. package/src/javascripts/ui/hooks/seamly-api-hooks.js +1 -1
  139. package/src/javascripts/ui/hooks/seamly-entry-hooks.js +2 -2
  140. package/src/javascripts/ui/hooks/seamly-option-hooks.js +2 -2
  141. package/src/javascripts/ui/hooks/seamly-state-hooks.js +5 -5
  142. package/src/javascripts/ui/hooks/use-event-component-mapping.js +2 -2
  143. package/src/javascripts/ui/hooks/use-seamly-activity-event-handler.js +1 -1
  144. package/src/javascripts/ui/hooks/use-seamly-chat.js +3 -3
  145. package/src/javascripts/ui/hooks/use-seamly-commands.js +12 -12
  146. package/src/javascripts/ui/hooks/use-seamly-dispatch.js +1 -1
  147. package/src/javascripts/ui/hooks/use-seamly-idle-detach-countdown.js +9 -9
  148. package/src/javascripts/ui/hooks/use-seamly-resume-conversation-prompt.js +2 -2
  149. package/src/javascripts/ui/hooks/use-single-file-upload.js +2 -2
  150. package/src/javascripts/ui/hooks/utility-hooks.js +1 -1
  151. package/src/stylesheets/4-base/_formelements.scss +3 -3
  152. package/src/stylesheets/5-components/_buttons.scss +1 -1
  153. package/src/stylesheets/5-components/_input.scss +2 -2
  154. package/src/stylesheets/6-default-implementation/_hover.scss +5 -5
  155. package/src/stylesheets/7-deprecated/4-base/_formelements.scss +4 -4
  156. package/src/stylesheets/7-deprecated/5-components/_buttons.scss +1 -1
  157. package/src/stylesheets/7-deprecated/5-components/_input.scss +1 -1
  158. package/src/stylesheets/7-deprecated/5-components/_options.scss +2 -2
  159. package/webpack/config.common.js +5 -0
  160. package/webpack/config.package.js +3 -0
@@ -16977,43 +16977,6 @@ const {
16977
16977
 
16978
16978
  const selectUserHasResponded = createSelector(app_utils_selectState, state => state.userHasResponded);
16979
16979
 
16980
- ;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/utils.js
16981
-
16982
-
16983
- const {
16984
- createAction: visibility_utils_createAction,
16985
- createActions: utils_createActions,
16986
- createThunk: visibility_utils_createThunk,
16987
- createReducer: visibility_utils_createReducer,
16988
- selectState: visibility_utils_selectState
16989
- } = createDomain('visibility');
16990
- const calculateVisibility = ({
16991
- hasResponded,
16992
- previousVisibility,
16993
- requestedVisibility,
16994
- config
16995
- }) => {
16996
- const {
16997
- defaults,
16998
- layoutMode,
16999
- hideOnNoUserResponse
17000
- } = config;
17001
- const {
17002
- visible: defaultVisibility
17003
- } = defaults || {}; // Requesting open should override the responded check.
17004
-
17005
- if (layoutMode === 'window' && hideOnNoUserResponse && requestedVisibility !== visibilityStates.open) {
17006
- return hasResponded ? requestedVisibility || previousVisibility || visibilityStates.open : visibilityStates.hidden;
17007
- }
17008
-
17009
- const baseVisibility = visibilityStates.minimized;
17010
- return requestedVisibility || previousVisibility || defaultVisibility || baseVisibility;
17011
- };
17012
- ;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/selectors.js
17013
-
17014
-
17015
- const selectVisibility = createSelector(visibility_utils_selectState, state => state.visibility);
17016
-
17017
16980
  ;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/seamly-state-hooks.js
17018
16981
 
17019
16982
 
@@ -17136,6 +17099,43 @@ const useSeamlyLayoutMode = () => {
17136
17099
  isResolving: !layoutMode
17137
17100
  };
17138
17101
  };
17102
+ ;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/utils.js
17103
+
17104
+
17105
+ const {
17106
+ createAction: visibility_utils_createAction,
17107
+ createActions: utils_createActions,
17108
+ createThunk: visibility_utils_createThunk,
17109
+ createReducer: visibility_utils_createReducer,
17110
+ selectState: visibility_utils_selectState
17111
+ } = createDomain('visibility');
17112
+ const calculateVisibility = ({
17113
+ hasResponded,
17114
+ previousVisibility,
17115
+ requestedVisibility,
17116
+ config
17117
+ }) => {
17118
+ const {
17119
+ defaults,
17120
+ layoutMode,
17121
+ hideOnNoUserResponse
17122
+ } = config;
17123
+ const {
17124
+ visible: defaultVisibility
17125
+ } = defaults || {}; // Requesting open should override the responded check.
17126
+
17127
+ if (layoutMode === 'window' && hideOnNoUserResponse && requestedVisibility !== visibilityStates.open) {
17128
+ return hasResponded ? requestedVisibility || previousVisibility || visibilityStates.open : visibilityStates.hidden;
17129
+ }
17130
+
17131
+ const baseVisibility = visibilityStates.minimized;
17132
+ return requestedVisibility || previousVisibility || defaultVisibility || baseVisibility;
17133
+ };
17134
+ ;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/selectors.js
17135
+
17136
+
17137
+ const selectVisibility = createSelector(visibility_utils_selectState, state => state.visibility);
17138
+
17139
17139
  ;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/actions.js
17140
17140
 
17141
17141
 
@@ -17272,6 +17272,7 @@ class SeamlyBaseError extends Error {
17272
17272
  if (originalError !== null && originalError !== void 0 && originalError.payload) {
17273
17273
  this.originalEvent = originalError;
17274
17274
  this.originalError = originalError.payload.error;
17275
+ this.message = `Event of type ${originalError.payload.type} encountered`;
17275
17276
  }
17276
17277
 
17277
17278
  if (originalError !== null && originalError !== void 0 && originalError.error) {
@@ -18640,34 +18641,6 @@ const useFileUploads = () => {
18640
18641
  // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/trim.js
18641
18642
  var trim = __webpack_require__(5843);
18642
18643
  var trim_default = /*#__PURE__*/__webpack_require__.n(trim);
18643
- ;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/utility-hooks.js
18644
-
18645
-
18646
-
18647
- const useForceUpdate = () => {
18648
- // This is an escape hatch mentioned in the React docs:
18649
- // https://reactjs.org/docs/hooks-faq.html#is-there-something-like-forceupdate
18650
-
18651
- /* eslint-disable-next-line no-unused-vars */
18652
- const [ignored, forceUpdate] = hooks_module_p(x => x + 1, 0);
18653
- return hooks_module_A(() => {
18654
- set_timeout_default()(() => {
18655
- forceUpdate();
18656
- });
18657
- }, []);
18658
- };
18659
- const useGeneratedId = () => {
18660
- const [id] = l(() => randomId());
18661
- return id;
18662
- };
18663
- const useStableCallback = callback => {
18664
- const callbackRef = hooks_module_s();
18665
- callbackRef.current = callback;
18666
- const isFunction = typeof callback === 'function';
18667
- return hooks_module_d(() => {
18668
- return isFunction ? (...args) => callbackRef.current(...args) : undefined;
18669
- }, [isFunction]);
18670
- };
18671
18644
  ;// CONCATENATED MODULE: ./src/javascripts/domains/interrupt/selectors.js
18672
18645
 
18673
18646
 
@@ -18910,6 +18883,34 @@ const visibility_reducer_initialState = {
18910
18883
 
18911
18884
 
18912
18885
 
18886
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/utility-hooks.js
18887
+
18888
+
18889
+
18890
+ const useForceUpdate = () => {
18891
+ // This is an escape hatch mentioned in the React docs:
18892
+ // https://reactjs.org/docs/hooks-faq.html#is-there-something-like-forceupdate
18893
+
18894
+ /* eslint-disable-next-line no-unused-vars */
18895
+ const [ignored, forceUpdate] = hooks_module_p(x => x + 1, 0);
18896
+ return hooks_module_A(() => {
18897
+ set_timeout_default()(() => {
18898
+ forceUpdate();
18899
+ });
18900
+ }, []);
18901
+ };
18902
+ const useGeneratedId = () => {
18903
+ const [id] = l(() => randomId());
18904
+ return id;
18905
+ };
18906
+ const useStableCallback = callback => {
18907
+ const callbackRef = hooks_module_s();
18908
+ callbackRef.current = callback;
18909
+ const isFunction = typeof callback === 'function';
18910
+ return hooks_module_d(() => {
18911
+ return isFunction ? (...args) => callbackRef.current(...args) : undefined;
18912
+ }, [isFunction]);
18913
+ };
18913
18914
  ;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/use-seamly-commands.js
18914
18915
 
18915
18916
 
@@ -20577,10 +20578,14 @@ function FormProvider(_ref) {
20577
20578
  });
20578
20579
  }, [setExternalErrors]);
20579
20580
  const handleSubmit = hooks_module_A(e => {
20580
- e.preventDefault();
20581
- setIsSubmitted(true);
20581
+ var _e$submitter;
20582
+
20583
+ e.preventDefault(); // If the submitter is set to being aria-disabled, block the submit action
20582
20584
 
20583
- if (validationIsValid) {
20585
+ const ariaDisabled = ((_e$submitter = e.submitter) === null || _e$submitter === void 0 ? void 0 : _e$submitter.ariaDisabled) === 'true';
20586
+ setIsSubmitted(!ariaDisabled);
20587
+
20588
+ if (!ariaDisabled && validationIsValid) {
20584
20589
  onSubmit(values, {
20585
20590
  updateControlValue,
20586
20591
  setError
@@ -20749,9 +20754,7 @@ function updateFormControl(state, formId, name, controlState) {
20749
20754
 
20750
20755
 
20751
20756
 
20752
- ;// CONCATENATED MODULE: ./src/javascripts/ui/components/form-controls/form.js
20753
-
20754
-
20757
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/utils/form-utils.js
20755
20758
 
20756
20759
 
20757
20760
 
@@ -20760,58 +20763,255 @@ function updateFormControl(state, formId, name, controlState) {
20760
20763
 
20761
20764
 
20762
20765
 
20763
- const form_excluded = ["className", "disableValidationClasses"];
20764
20766
 
20765
- function form_ownKeys(object, enumerableOnly) { var keys = keys_default()(object); if ((get_own_property_symbols_default())) { var symbols = get_own_property_symbols_default()(object); if (enumerableOnly) { symbols = filter_default()(symbols).call(symbols, function (sym) { return get_own_property_descriptor_default()(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
20766
20767
 
20767
- function form_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; for_each_default()(_context = form_ownKeys(Object(source), true)).call(_context, function (key) { defineProperty_defineProperty(target, key, source[key]); }); } else if ((get_own_property_descriptors_default())) { define_properties_default()(target, get_own_property_descriptors_default()(source)); } else { var _context2; for_each_default()(_context2 = form_ownKeys(Object(source))).call(_context2, function (key) { define_property_default()(target, key, get_own_property_descriptor_default()(source, key)); }); } } return target; }
20768
20768
 
20769
20769
 
20770
20770
 
20771
+ function form_utils_ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) { symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
20771
20772
 
20773
+ function form_utils_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context4; _forEachInstanceProperty(_context4 = form_utils_ownKeys(Object(source), true)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { var _context5; _forEachInstanceProperty(_context5 = form_utils_ownKeys(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } } return target; }
20772
20774
 
20773
- function Form(_ref) {
20774
- let {
20775
- className: givenClassName,
20776
- disableValidationClasses
20777
- } = _ref,
20778
- props = _objectWithoutProperties(_ref, form_excluded);
20775
+ const formActions = {
20776
+ REGISTER_FORM: 'REGISTER_FORM',
20777
+ DE_REGISTER_FORM: 'DE_REGISTER_FORM',
20778
+ REGISTER: 'REGISTER',
20779
+ DE_REGISTER: 'DEREGISTER',
20780
+ SET_VALUE: 'SET_VALUE',
20781
+ SET_VALIDITY: 'SET_VALIDITY',
20782
+ SET_STATE: 'SET_STATE',
20783
+ SET_SUBMITTED: 'SET_SUBMITTED',
20784
+ SET_PERSIST_FORM_DATA: 'SET_PERSIST_FORM_DATA'
20785
+ };
20786
+ const {
20787
+ REGISTER_FORM,
20788
+ DE_REGISTER_FORM,
20789
+ REGISTER,
20790
+ DE_REGISTER,
20791
+ SET_VALUE,
20792
+ SET_VALIDITY,
20793
+ SET_STATE,
20794
+ SET_SUBMITTED,
20795
+ SET_PERSIST_FORM_DATA
20796
+ } = formActions;
20797
+ const getValidator = (fn, errorText, compareValue = null) => ({
20798
+ fn,
20799
+ errorText,
20800
+ compareValue
20801
+ });
20802
+ const formReducer = (state, action) => {
20803
+ var _context, _context2, _context3;
20779
20804
 
20780
20805
  const {
20781
- handleSubmit,
20782
- isValid,
20783
- isSubmitted
20784
- } = useForm();
20785
- const formClasses = ['form'];
20806
+ formId,
20807
+ name,
20808
+ controlId,
20809
+ value,
20810
+ data,
20811
+ validity,
20812
+ errorText,
20813
+ hasSubmitted,
20814
+ persistData
20815
+ } = action;
20786
20816
 
20787
- if (!disableValidationClasses && isSubmitted) {
20788
- formClasses.push('form--submitted');
20817
+ const setControls = controls => form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
20818
+ [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
20819
+ controls: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls), controls)
20820
+ })
20821
+ });
20789
20822
 
20790
- if (isValid) {
20791
- formClasses.push('form--valid');
20792
- } else {
20793
- formClasses.push('form--invalid');
20794
- }
20795
- }
20823
+ switch (action.type) {
20824
+ case REGISTER_FORM:
20825
+ return form_utils_objectSpread({
20826
+ [formId]: {
20827
+ controls: {},
20828
+ validity: true,
20829
+ hasSubmitted: false,
20830
+ persistData: false
20831
+ }
20832
+ }, state);
20796
20833
 
20797
- return jsxRuntime_module_e("form", form_objectSpread({
20798
- onSubmit: handleSubmit,
20799
- className: css_className([...formClasses, givenClassName])
20800
- }, props));
20801
- }
20834
+ case DE_REGISTER_FORM:
20835
+ const removedFormState = form_utils_objectSpread({}, state);
20802
20836
 
20803
- /* harmony default export */ var form_controls_form = (Form);
20804
- ;// CONCATENATED MODULE: ./src/javascripts/ui/components/form-controls/error.js
20837
+ delete removedFormState[formId];
20838
+ return removedFormState;
20805
20839
 
20840
+ case REGISTER:
20841
+ const {
20842
+ value: existingValue,
20843
+ validity: existingValidity,
20844
+ errorText: existingErrorText
20845
+ } = state[formId].controls[name] || {};
20846
+ return setControls({
20847
+ [name]: {
20848
+ controlId,
20849
+ value: existingValue || value,
20850
+ validity: existingValidity !== false,
20851
+ errorText: existingErrorText || ''
20852
+ }
20853
+ });
20806
20854
 
20855
+ case DE_REGISTER:
20856
+ const relatedForm = state[formId];
20807
20857
 
20858
+ if (!relatedForm) {
20859
+ return state;
20860
+ }
20808
20861
 
20862
+ const newControls = form_utils_objectSpread({}, relatedForm.controls);
20809
20863
 
20864
+ delete newControls[action.name];
20865
+ return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
20866
+ [formId]: form_utils_objectSpread(form_utils_objectSpread({}, relatedForm), {}, {
20867
+ controls: newControls
20868
+ })
20869
+ });
20810
20870
 
20811
- function error_Error({
20812
- id,
20813
- error
20814
- }) {
20871
+ case SET_VALUE:
20872
+ return setControls({
20873
+ [name]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[name]), {}, {
20874
+ value
20875
+ })
20876
+ });
20877
+
20878
+ case SET_VALIDITY:
20879
+ const newControlValidities = form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls), {}, {
20880
+ [name]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[name]), {}, {
20881
+ validity,
20882
+ errorText
20883
+ })
20884
+ });
20885
+
20886
+ return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
20887
+ [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
20888
+ controls: newControlValidities,
20889
+ validity: _everyInstanceProperty(_context = _mapInstanceProperty(_context2 = _Object$keys(newControlValidities)).call(_context2, key => newControlValidities[key].validity)).call(_context, v => v)
20890
+ })
20891
+ });
20892
+
20893
+ case SET_STATE:
20894
+ return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
20895
+ [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
20896
+ controls: _reduceInstanceProperty(_context3 = _Object$keys(data)).call(_context3, (acc, key) => {
20897
+ return form_utils_objectSpread(form_utils_objectSpread({}, acc), {}, {
20898
+ [key]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[key]), {}, {
20899
+ value: data[key],
20900
+ validity: true,
20901
+ errorText: ''
20902
+ })
20903
+ });
20904
+ }, form_utils_objectSpread({}, state.controls))
20905
+ })
20906
+ });
20907
+
20908
+ case SET_SUBMITTED:
20909
+ return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
20910
+ [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
20911
+ hasSubmitted
20912
+ })
20913
+ });
20914
+
20915
+ case SET_PERSIST_FORM_DATA:
20916
+ return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
20917
+ [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
20918
+ persistData
20919
+ })
20920
+ });
20921
+
20922
+ default:
20923
+ return state;
20924
+ }
20925
+ };
20926
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/utils/validations.js
20927
+
20928
+ const validateFileSize = (fileList, maxSize) => {
20929
+ let isValid = true;
20930
+
20931
+ for (let i = 0; i < fileList.length; i++) {
20932
+ if (fileList[i].size > maxSize) {
20933
+ isValid = false;
20934
+ }
20935
+ }
20936
+
20937
+ return isValid;
20938
+ };
20939
+ const fileListObjectIsNotEmpty = fileListObj => !!(fileListObj !== null && fileListObj !== void 0 && fileListObj.length) > 0;
20940
+ /* eslint-disable no-control-regex */
20941
+
20942
+ const isEmailString = val => {
20943
+ const regex = /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i;
20944
+
20945
+ const trimmedVal = val && trim_default()(val).call(val);
20946
+
20947
+ return !!(trimmedVal && trimmedVal.match(regex));
20948
+ };
20949
+ /* eslint-enable no-control-regex */
20950
+
20951
+ const isNotEmptyString = val => !!val;
20952
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/components/form-controls/form.js
20953
+
20954
+
20955
+
20956
+
20957
+
20958
+
20959
+
20960
+
20961
+
20962
+
20963
+ const form_excluded = ["className", "disableValidationClasses"];
20964
+
20965
+ function form_ownKeys(object, enumerableOnly) { var keys = keys_default()(object); if ((get_own_property_symbols_default())) { var symbols = get_own_property_symbols_default()(object); if (enumerableOnly) { symbols = filter_default()(symbols).call(symbols, function (sym) { return get_own_property_descriptor_default()(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
20966
+
20967
+ function form_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; for_each_default()(_context = form_ownKeys(Object(source), true)).call(_context, function (key) { defineProperty_defineProperty(target, key, source[key]); }); } else if ((get_own_property_descriptors_default())) { define_properties_default()(target, get_own_property_descriptors_default()(source)); } else { var _context2; for_each_default()(_context2 = form_ownKeys(Object(source))).call(_context2, function (key) { define_property_default()(target, key, get_own_property_descriptor_default()(source, key)); }); } } return target; }
20968
+
20969
+
20970
+
20971
+
20972
+
20973
+ function Form(_ref) {
20974
+ let {
20975
+ className: givenClassName,
20976
+ disableValidationClasses
20977
+ } = _ref,
20978
+ props = _objectWithoutProperties(_ref, form_excluded);
20979
+
20980
+ const {
20981
+ handleSubmit,
20982
+ isValid,
20983
+ isSubmitted
20984
+ } = useForm();
20985
+ const formClasses = ['form'];
20986
+
20987
+ if (!disableValidationClasses && isSubmitted) {
20988
+ formClasses.push('form--submitted');
20989
+
20990
+ if (isValid) {
20991
+ formClasses.push('form--valid');
20992
+ } else {
20993
+ formClasses.push('form--invalid');
20994
+ }
20995
+ }
20996
+
20997
+ return jsxRuntime_module_e("form", form_objectSpread({
20998
+ onSubmit: handleSubmit,
20999
+ className: css_className([...formClasses, givenClassName])
21000
+ }, props));
21001
+ }
21002
+
21003
+ /* harmony default export */ var form_controls_form = (Form);
21004
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/components/form-controls/error.js
21005
+
21006
+
21007
+
21008
+
21009
+
21010
+
21011
+ function error_Error({
21012
+ id,
21013
+ error
21014
+ }) {
20815
21015
  const [isAvailable, setIsAvailable] = l(false);
20816
21016
  hooks_module_y(() => {
20817
21017
  const timerId = set_timeout_default()(() => setIsAvailable(true), 300); // 300 = magic number, could be less or more
@@ -20957,267 +21157,72 @@ const Select = _ref => {
20957
21157
 
20958
21158
 
20959
21159
 
20960
- function TranslationsOptionsDialogForm({
20961
- controlName,
20962
- descriptionId
20963
- }) {
20964
- const {
20965
- t
20966
- } = useI18n();
20967
- const {
20968
- isActive,
20969
- languages,
20970
- currentLocale
20971
- } = useTranslations();
20972
- const {
20973
- locale: uiLocale
20974
- } = useI18n();
20975
- const languageName = hooks_module_d(() => {
20976
- var _languages$find;
20977
-
20978
- return languages === null || languages === void 0 ? void 0 : (_languages$find = find_default()(languages).call(languages, lang => lang.locale === currentLocale)) === null || _languages$find === void 0 ? void 0 : _languages$find.nativeName;
20979
- }, [languages, currentLocale]);
20980
- const options = hooks_module_d(() => {
20981
- var _context;
20982
-
20983
- return [{
20984
- value: '',
20985
- label: t('translations.settings.defaultOptionLabel')
20986
- }, ...map_default()(_context = filter_default()(languages).call(languages, language => language.locale.toLowerCase() !== String(uiLocale).toLowerCase())).call(_context, language => ({
20987
- value: language.locale,
20988
- label: language.nativeName
20989
- }))];
20990
- }, [t, languages, uiLocale]);
20991
- return jsxRuntime_module_e(form_controls_form, {
20992
- noValidate: "true",
20993
- className: css_className('options__form'),
20994
- children: [jsxRuntime_module_e("p", {
20995
- className: css_className('options__description'),
20996
- id: descriptionId,
20997
- children: t('translations.settings.description')
20998
- }), isActive ? jsxRuntime_module_e(d, {
20999
- children: [jsxRuntime_module_e("h3", {
21000
- children: t('translations.settings.currentTranslationLabel')
21001
- }), jsxRuntime_module_e("p", {
21002
- className: css_className('options__active-language'),
21003
- children: languageName
21004
- })]
21005
- }) : jsxRuntime_module_e(form_controls_select, {
21006
- name: controlName,
21007
- type: "text",
21008
- className: css_className('input__select'),
21009
- "aria-describedby": descriptionId,
21010
- labelClass: css_className('label'),
21011
- labelText: t('translations.settings.inputLabel'),
21012
- options: options,
21013
- defaultValue: currentLocale || ''
21014
- }), jsxRuntime_module_e("div", {
21015
- className: css_className('options__actions'),
21016
- children: jsxRuntime_module_e("button", {
21017
- type: "submit",
21018
- className: css_className('button', 'button--primary', 'options__submit'),
21019
- children: isActive ? t('translations.settings.endButtonText') : t('translations.settings.startButtonText')
21020
- })
21021
- })]
21022
- });
21023
- }
21024
-
21025
- /* harmony default export */ var options_dialog_form = (TranslationsOptionsDialogForm);
21026
- ;// CONCATENATED MODULE: ./src/javascripts/ui/utils/form-utils.js
21027
-
21028
-
21029
-
21030
-
21031
-
21032
-
21033
-
21034
-
21035
-
21036
-
21037
-
21038
-
21039
-
21040
- function form_utils_ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) { symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
21041
-
21042
- function form_utils_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context4; _forEachInstanceProperty(_context4 = form_utils_ownKeys(Object(source), true)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { var _context5; _forEachInstanceProperty(_context5 = form_utils_ownKeys(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } } return target; }
21043
-
21044
- const formActions = {
21045
- REGISTER_FORM: 'REGISTER_FORM',
21046
- DE_REGISTER_FORM: 'DE_REGISTER_FORM',
21047
- REGISTER: 'REGISTER',
21048
- DE_REGISTER: 'DEREGISTER',
21049
- SET_VALUE: 'SET_VALUE',
21050
- SET_VALIDITY: 'SET_VALIDITY',
21051
- SET_STATE: 'SET_STATE',
21052
- SET_SUBMITTED: 'SET_SUBMITTED',
21053
- SET_PERSIST_FORM_DATA: 'SET_PERSIST_FORM_DATA'
21054
- };
21055
- const {
21056
- REGISTER_FORM,
21057
- DE_REGISTER_FORM,
21058
- REGISTER,
21059
- DE_REGISTER,
21060
- SET_VALUE,
21061
- SET_VALIDITY,
21062
- SET_STATE,
21063
- SET_SUBMITTED,
21064
- SET_PERSIST_FORM_DATA
21065
- } = formActions;
21066
- const getValidator = (fn, errorText, compareValue = null) => ({
21067
- fn,
21068
- errorText,
21069
- compareValue
21070
- });
21071
- const formReducer = (state, action) => {
21072
- var _context, _context2, _context3;
21073
-
21074
- const {
21075
- formId,
21076
- name,
21077
- controlId,
21078
- value,
21079
- data,
21080
- validity,
21081
- errorText,
21082
- hasSubmitted,
21083
- persistData
21084
- } = action;
21085
-
21086
- const setControls = controls => form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
21087
- [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
21088
- controls: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls), controls)
21089
- })
21090
- });
21091
-
21092
- switch (action.type) {
21093
- case REGISTER_FORM:
21094
- return form_utils_objectSpread({
21095
- [formId]: {
21096
- controls: {},
21097
- validity: true,
21098
- hasSubmitted: false,
21099
- persistData: false
21100
- }
21101
- }, state);
21102
-
21103
- case DE_REGISTER_FORM:
21104
- const removedFormState = form_utils_objectSpread({}, state);
21105
-
21106
- delete removedFormState[formId];
21107
- return removedFormState;
21108
-
21109
- case REGISTER:
21110
- const {
21111
- value: existingValue,
21112
- validity: existingValidity,
21113
- errorText: existingErrorText
21114
- } = state[formId].controls[name] || {};
21115
- return setControls({
21116
- [name]: {
21117
- controlId,
21118
- value: existingValue || value,
21119
- validity: existingValidity !== false,
21120
- errorText: existingErrorText || ''
21121
- }
21122
- });
21123
-
21124
- case DE_REGISTER:
21125
- const relatedForm = state[formId];
21126
-
21127
- if (!relatedForm) {
21128
- return state;
21129
- }
21130
-
21131
- const newControls = form_utils_objectSpread({}, relatedForm.controls);
21132
-
21133
- delete newControls[action.name];
21134
- return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
21135
- [formId]: form_utils_objectSpread(form_utils_objectSpread({}, relatedForm), {}, {
21136
- controls: newControls
21137
- })
21138
- });
21139
-
21140
- case SET_VALUE:
21141
- return setControls({
21142
- [name]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[name]), {}, {
21143
- value
21144
- })
21145
- });
21146
-
21147
- case SET_VALIDITY:
21148
- const newControlValidities = form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls), {}, {
21149
- [name]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[name]), {}, {
21150
- validity,
21151
- errorText
21152
- })
21153
- });
21154
-
21155
- return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
21156
- [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
21157
- controls: newControlValidities,
21158
- validity: _everyInstanceProperty(_context = _mapInstanceProperty(_context2 = _Object$keys(newControlValidities)).call(_context2, key => newControlValidities[key].validity)).call(_context, v => v)
21159
- })
21160
- });
21161
-
21162
- case SET_STATE:
21163
- return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
21164
- [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
21165
- controls: _reduceInstanceProperty(_context3 = _Object$keys(data)).call(_context3, (acc, key) => {
21166
- return form_utils_objectSpread(form_utils_objectSpread({}, acc), {}, {
21167
- [key]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[key]), {}, {
21168
- value: data[key],
21169
- validity: true,
21170
- errorText: ''
21171
- })
21172
- });
21173
- }, form_utils_objectSpread({}, state.controls))
21174
- })
21175
- });
21176
-
21177
- case SET_SUBMITTED:
21178
- return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
21179
- [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
21180
- hasSubmitted
21181
- })
21182
- });
21183
-
21184
- case SET_PERSIST_FORM_DATA:
21185
- return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
21186
- [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
21187
- persistData
21188
- })
21189
- });
21190
-
21191
- default:
21192
- return state;
21193
- }
21194
- };
21195
- ;// CONCATENATED MODULE: ./src/javascripts/ui/utils/validations.js
21196
-
21197
- const validateFileSize = (fileList, maxSize) => {
21198
- let isValid = true;
21199
-
21200
- for (let i = 0; i < fileList.length; i++) {
21201
- if (fileList[i].size > maxSize) {
21202
- isValid = false;
21203
- }
21204
- }
21205
-
21206
- return isValid;
21207
- };
21208
- const fileListObjectIsNotEmpty = fileListObj => !!(fileListObj !== null && fileListObj !== void 0 && fileListObj.length) > 0;
21209
- /* eslint-disable no-control-regex */
21210
-
21211
- const isEmailString = val => {
21212
- const regex = /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i;
21213
-
21214
- const trimmedVal = val && trim_default()(val).call(val);
21160
+ function TranslationsOptionsDialogForm({
21161
+ controlName,
21162
+ descriptionId
21163
+ }) {
21164
+ const {
21165
+ t
21166
+ } = useI18n();
21167
+ const {
21168
+ isActive,
21169
+ languages,
21170
+ currentLocale
21171
+ } = useTranslations();
21172
+ const {
21173
+ locale: uiLocale
21174
+ } = useI18n();
21175
+ const languageName = hooks_module_d(() => {
21176
+ var _languages$find;
21215
21177
 
21216
- return !!(trimmedVal && trimmedVal.match(regex));
21217
- };
21218
- /* eslint-enable no-control-regex */
21178
+ return languages === null || languages === void 0 ? void 0 : (_languages$find = find_default()(languages).call(languages, lang => lang.locale === currentLocale)) === null || _languages$find === void 0 ? void 0 : _languages$find.nativeName;
21179
+ }, [languages, currentLocale]);
21180
+ const options = hooks_module_d(() => {
21181
+ var _context;
21219
21182
 
21220
- const isNotEmptyString = val => !!val;
21183
+ return [{
21184
+ value: '',
21185
+ label: t('translations.settings.defaultOptionLabel')
21186
+ }, ...map_default()(_context = filter_default()(languages).call(languages, language => language.locale.toLowerCase() !== String(uiLocale).toLowerCase())).call(_context, language => ({
21187
+ value: language.locale,
21188
+ label: language.nativeName
21189
+ }))];
21190
+ }, [t, languages, uiLocale]);
21191
+ return jsxRuntime_module_e(form_controls_form, {
21192
+ noValidate: "true",
21193
+ className: css_className('options__form'),
21194
+ children: [jsxRuntime_module_e("p", {
21195
+ className: css_className('options__description'),
21196
+ id: descriptionId,
21197
+ children: t('translations.settings.description')
21198
+ }), isActive ? jsxRuntime_module_e(d, {
21199
+ children: [jsxRuntime_module_e("h3", {
21200
+ children: t('translations.settings.currentTranslationLabel')
21201
+ }), jsxRuntime_module_e("p", {
21202
+ className: css_className('options__active-language'),
21203
+ children: languageName
21204
+ })]
21205
+ }) : jsxRuntime_module_e(form_controls_select, {
21206
+ name: controlName,
21207
+ type: "text",
21208
+ className: css_className('input__select'),
21209
+ "aria-describedby": descriptionId,
21210
+ labelClass: css_className('label'),
21211
+ labelText: t('translations.settings.inputLabel'),
21212
+ options: options,
21213
+ defaultValue: currentLocale || ''
21214
+ }), jsxRuntime_module_e("div", {
21215
+ className: css_className('options__actions'),
21216
+ children: jsxRuntime_module_e("button", {
21217
+ type: "submit",
21218
+ className: css_className('button', 'button--primary', 'options__submit'),
21219
+ children: isActive ? t('translations.settings.endButtonText') : t('translations.settings.startButtonText')
21220
+ })
21221
+ })]
21222
+ });
21223
+ }
21224
+
21225
+ /* harmony default export */ var options_dialog_form = (TranslationsOptionsDialogForm);
21221
21226
  ;// CONCATENATED MODULE: ./src/javascripts/domains/translations/components/options-dialog/index.js
21222
21227
 
21223
21228
 
@@ -21849,6 +21854,36 @@ const Interrupt = ({
21849
21854
  };
21850
21855
 
21851
21856
  /* harmony default export */ var interrupt = (Interrupt);
21857
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/components/layout/privacy-disclaimer.js
21858
+
21859
+
21860
+
21861
+
21862
+
21863
+
21864
+ const PrivacyDisclaimer = () => {
21865
+ const {
21866
+ t
21867
+ } = useI18n();
21868
+ const {
21869
+ showDisclaimer
21870
+ } = useConfig();
21871
+ return showDisclaimer && jsxRuntime_module_e("div", {
21872
+ className: css_className('disclaimer'),
21873
+ tabIndex: "0",
21874
+ children: [jsxRuntime_module_e("h2", {
21875
+ className: css_className('disclaimer__title'),
21876
+ children: t('disclaimer.title')
21877
+ }), jsxRuntime_module_e("div", {
21878
+ className: css_className('disclaimer__message'),
21879
+ dangerouslySetInnerHTML: {
21880
+ __html: t('disclaimer.content')
21881
+ }
21882
+ })]
21883
+ });
21884
+ };
21885
+
21886
+ /* harmony default export */ var privacy_disclaimer = (PrivacyDisclaimer);
21852
21887
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/component-context.js
21853
21888
 
21854
21889
  const ComponentContext = D({});
@@ -27746,95 +27781,6 @@ const Cta = ({
27746
27781
  // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/fill.js
27747
27782
  var fill = __webpack_require__(4494);
27748
27783
  var fill_default = /*#__PURE__*/__webpack_require__.n(fill);
27749
- ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/components/pagination.js
27750
-
27751
-
27752
-
27753
-
27754
- function CarouselPagination({
27755
- items,
27756
- currentIndex,
27757
- onChange,
27758
- getItemKey,
27759
- getItemLabel
27760
- }) {
27761
- const itemCount = items.length;
27762
- const handlePaginate = hooks_module_A(event => {
27763
- const slideIndex = Number(event.target.dataset.item || '0');
27764
- const nextIndex = Math.min(itemCount - 1, Math.max(0, slideIndex));
27765
-
27766
- if (nextIndex !== currentIndex) {
27767
- onChange(nextIndex);
27768
- }
27769
- }, [itemCount, currentIndex, onChange]);
27770
- return jsxRuntime_module_e("div", {
27771
- className: css_className('carousel-pagination__wrapper'),
27772
- role: "group",
27773
- children: jsxRuntime_module_e("ul", {
27774
- className: css_className('carousel-pagination'),
27775
- children: map_default()(items).call(items, (item, idx) => {
27776
- const isActive = currentIndex === idx;
27777
- return jsxRuntime_module_e("li", {
27778
- className: css_className('carousel-pagination__item', isActive ? 'is-active' : undefined),
27779
- children: jsxRuntime_module_e("button", {
27780
- className: css_className('carousel-pagination__button'),
27781
- type: "button",
27782
- onClick: handlePaginate,
27783
- "data-item": idx,
27784
- "aria-disabled": isActive ? 'true' : undefined,
27785
- "aria-label": getItemLabel(item, idx)
27786
- })
27787
- }, getItemKey(item, idx, 'pagination-item-'));
27788
- })
27789
- })
27790
- });
27791
- }
27792
- ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/components/controls.js
27793
-
27794
-
27795
-
27796
-
27797
-
27798
- function CarouselControls({
27799
- items,
27800
- currentIndex,
27801
- onChange,
27802
- children
27803
- }) {
27804
- const {
27805
- t
27806
- } = useI18n();
27807
- const itemCount = items.length;
27808
-
27809
- const handlePrevious = () => {
27810
- onChange((currentIndex - 1 + itemCount) % itemCount);
27811
- };
27812
-
27813
- const handleNext = () => {
27814
- onChange((currentIndex + 1) % itemCount);
27815
- };
27816
-
27817
- return jsxRuntime_module_e("div", {
27818
- className: css_className('carousel-controls'),
27819
- children: [jsxRuntime_module_e("button", {
27820
- className: css_className('button', 'button--previous'),
27821
- "aria-label": t('carousel.controls.previous'),
27822
- onClick: handlePrevious,
27823
- children: jsxRuntime_module_e(icon, {
27824
- name: "arrowLeft",
27825
- size: "16"
27826
- })
27827
- }), children, jsxRuntime_module_e("button", {
27828
- className: css_className('button', 'button--next'),
27829
- "aria-label": t('carousel.controls.next'),
27830
- onClick: handleNext,
27831
- children: jsxRuntime_module_e(icon, {
27832
- name: "arrowRight",
27833
- size: "16"
27834
- })
27835
- })]
27836
- });
27837
- }
27838
27784
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/card-component.js
27839
27785
 
27840
27786
 
@@ -27975,27 +27921,116 @@ function slide_objectSpread(target) { for (var i = 1; i < arguments.length; i++)
27975
27921
 
27976
27922
 
27977
27923
 
27978
- function CarouselMessageSlide({
27979
- item: slide,
27924
+ function CarouselMessageSlide({
27925
+ item: slide,
27926
+ items,
27927
+ index,
27928
+ isActive
27929
+ }) {
27930
+ const {
27931
+ t
27932
+ } = useI18n();
27933
+ return jsxRuntime_module_e("div", {
27934
+ className: css_className('carousel-item', `carousel-item--${slide.type}`),
27935
+ role: "group",
27936
+ "aria-roledescription": "slide",
27937
+ "aria-label": t('carousel.slide.label', {
27938
+ index: index + 1,
27939
+ total: items.length
27940
+ }),
27941
+ children: jsxRuntime_module_e(card_component, slide_objectSpread(slide_objectSpread({}, slide), {}, {
27942
+ isCarouselItem: true,
27943
+ hasFocus: isActive
27944
+ }))
27945
+ });
27946
+ }
27947
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/components/pagination.js
27948
+
27949
+
27950
+
27951
+
27952
+ function CarouselPagination({
27953
+ items,
27954
+ currentIndex,
27955
+ onChange,
27956
+ getItemKey,
27957
+ getItemLabel
27958
+ }) {
27959
+ const itemCount = items.length;
27960
+ const handlePaginate = hooks_module_A(event => {
27961
+ const slideIndex = Number(event.target.dataset.item || '0');
27962
+ const nextIndex = Math.min(itemCount - 1, Math.max(0, slideIndex));
27963
+
27964
+ if (nextIndex !== currentIndex) {
27965
+ onChange(nextIndex);
27966
+ }
27967
+ }, [itemCount, currentIndex, onChange]);
27968
+ return jsxRuntime_module_e("div", {
27969
+ className: css_className('carousel-pagination__wrapper'),
27970
+ role: "group",
27971
+ children: jsxRuntime_module_e("ul", {
27972
+ className: css_className('carousel-pagination'),
27973
+ children: map_default()(items).call(items, (item, idx) => {
27974
+ const isActive = currentIndex === idx;
27975
+ return jsxRuntime_module_e("li", {
27976
+ className: css_className('carousel-pagination__item', isActive ? 'is-active' : undefined),
27977
+ children: jsxRuntime_module_e("button", {
27978
+ className: css_className('carousel-pagination__button'),
27979
+ type: "button",
27980
+ onClick: handlePaginate,
27981
+ "data-item": idx,
27982
+ "aria-disabled": isActive ? 'true' : undefined,
27983
+ "aria-label": getItemLabel(item, idx)
27984
+ })
27985
+ }, getItemKey(item, idx, 'pagination-item-'));
27986
+ })
27987
+ })
27988
+ });
27989
+ }
27990
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/components/controls.js
27991
+
27992
+
27993
+
27994
+
27995
+
27996
+ function CarouselControls({
27980
27997
  items,
27981
- index,
27982
- isActive
27998
+ currentIndex,
27999
+ onChange,
28000
+ children
27983
28001
  }) {
27984
28002
  const {
27985
28003
  t
27986
28004
  } = useI18n();
28005
+ const itemCount = items.length;
28006
+
28007
+ const handlePrevious = () => {
28008
+ onChange((currentIndex - 1 + itemCount) % itemCount);
28009
+ };
28010
+
28011
+ const handleNext = () => {
28012
+ onChange((currentIndex + 1) % itemCount);
28013
+ };
28014
+
27987
28015
  return jsxRuntime_module_e("div", {
27988
- className: css_className('carousel-item', `carousel-item--${slide.type}`),
27989
- role: "group",
27990
- "aria-roledescription": "slide",
27991
- "aria-label": t('carousel.slide.label', {
27992
- index: index + 1,
27993
- total: items.length
27994
- }),
27995
- children: jsxRuntime_module_e(card_component, slide_objectSpread(slide_objectSpread({}, slide), {}, {
27996
- isCarouselItem: true,
27997
- hasFocus: isActive
27998
- }))
28016
+ className: css_className('carousel-controls'),
28017
+ children: [jsxRuntime_module_e("button", {
28018
+ className: css_className('button', 'button--previous'),
28019
+ "aria-label": t('carousel.controls.previous'),
28020
+ onClick: handlePrevious,
28021
+ children: jsxRuntime_module_e(icon, {
28022
+ name: "arrowLeft",
28023
+ size: "16"
28024
+ })
28025
+ }), children, jsxRuntime_module_e("button", {
28026
+ className: css_className('button', 'button--next'),
28027
+ "aria-label": t('carousel.controls.next'),
28028
+ onClick: handleNext,
28029
+ children: jsxRuntime_module_e(icon, {
28030
+ name: "arrowRight",
28031
+ size: "16"
28032
+ })
28033
+ })]
27999
28034
  });
28000
28035
  }
28001
28036
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/index.js
@@ -28366,36 +28401,6 @@ const ComponentFilter = ({
28366
28401
  };
28367
28402
 
28368
28403
  /* harmony default export */ var component_filter = (ComponentFilter);
28369
- ;// CONCATENATED MODULE: ./src/javascripts/ui/components/layout/privacy-disclaimer.js
28370
-
28371
-
28372
-
28373
-
28374
-
28375
-
28376
- const PrivacyDisclaimer = () => {
28377
- const {
28378
- t
28379
- } = useI18n();
28380
- const {
28381
- showDisclaimer
28382
- } = useConfig();
28383
- return showDisclaimer && jsxRuntime_module_e("div", {
28384
- className: css_className('disclaimer'),
28385
- tabIndex: "0",
28386
- children: [jsxRuntime_module_e("h2", {
28387
- className: css_className('disclaimer__title'),
28388
- children: t('disclaimer.title')
28389
- }), jsxRuntime_module_e("div", {
28390
- className: css_className('disclaimer__message'),
28391
- dangerouslySetInnerHTML: {
28392
- __html: t('disclaimer.content')
28393
- }
28394
- })]
28395
- });
28396
- };
28397
-
28398
- /* harmony default export */ var privacy_disclaimer = (PrivacyDisclaimer);
28399
28404
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/conversation.js
28400
28405
 
28401
28406
 
@@ -28878,7 +28883,7 @@ function TextEntryForm({
28878
28883
  }), jsxRuntime_module_e("button", {
28879
28884
  className: css_className('button', 'input__submit'),
28880
28885
  type: "submit",
28881
- disabled: !hasValue || reachedCharacterLimit,
28886
+ "aria-disabled": !hasValue || reachedCharacterLimit ? 'true' : null,
28882
28887
  children: jsxRuntime_module_e(icon, {
28883
28888
  name: "send",
28884
28889
  size: "32",
@@ -29019,9 +29024,9 @@ const UploadToggle = () => {
29019
29024
  children: jsxRuntime_module_e("button", {
29020
29025
  className: css_className(['button', 'button--secondary', 'upload-toggle']),
29021
29026
  ref: uploadButton,
29022
- disabled: !showUploadButton ? 'true' : null,
29027
+ "aria-disabled": !showUploadButton ? 'true' : null,
29023
29028
  type: "button",
29024
- onClick: onClickHandler,
29029
+ onClick: showUploadButton ? onClickHandler : null,
29025
29030
  children: jsxRuntime_module_e(icon, {
29026
29031
  name: "file",
29027
29032
  size: "32",
@@ -29896,7 +29901,7 @@ const OptionsButton = () => {
29896
29901
  ref: item => {
29897
29902
  menuItemButtons.current[i] = item;
29898
29903
  },
29899
- className: css_className(['button', 'button--secondary', ...(available ? [] : ['button--disabled'])]),
29904
+ className: css_className(['button', 'button--secondary']),
29900
29905
  onKeyDown: e => onMenuItemKeyDownHandler(e, i),
29901
29906
  onKeyPress: e => onKeyPressHandler(e, i),
29902
29907
  onClick: () => onMenuItemClickHandler(name, available),
@@ -29913,7 +29918,7 @@ const OptionsButton = () => {
29913
29918
  })
29914
29919
  }), jsxRuntime_module_e("button", {
29915
29920
  type: "button",
29916
- className: css_className(['button', 'button--secondary', 'chat__options__button', ...(!multiMenu && firstOptionName ? [`chat__options__button--${firstOptionName}`] : []), ...(!multiMenu && !firstOption.available ? ['button--disabled'] : [])]),
29921
+ className: css_className(['button', 'button--secondary', 'chat__options__button', ...(!multiMenu && firstOptionName ? [`chat__options__button--${firstOptionName}`] : [])]),
29917
29922
  id: id,
29918
29923
  onClick: onClickHandler,
29919
29924
  onKeyDown: multiMenu ? onButtonKeyDownHandler : null,
@@ -30402,6 +30407,53 @@ const View = () => {
30402
30407
  };
30403
30408
 
30404
30409
  /* harmony default export */ var view = (View);
30410
+ ;// CONCATENATED MODULE: ./src/javascripts/domains/errors/index.js
30411
+
30412
+
30413
+ const {
30414
+ createAction: errors_createAction
30415
+ } = createDomain('errors');
30416
+ const catchError = errors_createAction('catch-error', error => ({
30417
+ error
30418
+ }));
30419
+ function errors_createMiddleware({
30420
+ api: seamlyApi
30421
+ }) {
30422
+ return ({
30423
+ getState
30424
+ }) => {
30425
+ const handleError = action => {
30426
+ const {
30427
+ errorCallback,
30428
+ namespace,
30429
+ api,
30430
+ layoutMode
30431
+ } = selectConfig(getState());
30432
+ errorCallback === null || errorCallback === void 0 ? void 0 : errorCallback(action.error, {
30433
+ namespace,
30434
+ api,
30435
+ layoutMode,
30436
+ conversationUrl: seamlyApi.getConversationUrl(),
30437
+ action: action.type ? action : undefined
30438
+ });
30439
+ };
30440
+
30441
+ return next => action => {
30442
+ try {
30443
+ if (action.error) {
30444
+ handleError(action);
30445
+ }
30446
+
30447
+ return next(action);
30448
+ } catch (error) {
30449
+ handleError({
30450
+ error
30451
+ });
30452
+ throw error;
30453
+ }
30454
+ };
30455
+ };
30456
+ }
30405
30457
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/core/seamly-instance-functions-loader.js
30406
30458
 
30407
30459
 
@@ -31293,53 +31345,6 @@ const SeamlyFileUpload = ({
31293
31345
  };
31294
31346
 
31295
31347
  /* harmony default export */ var seamly_file_upload = (SeamlyFileUpload);
31296
- ;// CONCATENATED MODULE: ./src/javascripts/domains/errors/index.js
31297
-
31298
-
31299
- const {
31300
- createAction: errors_createAction
31301
- } = createDomain('errors');
31302
- const catchError = errors_createAction('catch-error', error => ({
31303
- error
31304
- }));
31305
- function errors_createMiddleware({
31306
- api: seamlyApi
31307
- }) {
31308
- return ({
31309
- getState
31310
- }) => {
31311
- const handleError = action => {
31312
- const {
31313
- errorCallback,
31314
- namespace,
31315
- api,
31316
- layoutMode
31317
- } = selectConfig(getState());
31318
- errorCallback === null || errorCallback === void 0 ? void 0 : errorCallback(action.error, {
31319
- namespace,
31320
- api,
31321
- layoutMode,
31322
- conversationUrl: seamlyApi.getConversationUrl(),
31323
- action: action.type ? action : undefined
31324
- });
31325
- };
31326
-
31327
- return next => action => {
31328
- try {
31329
- if (action.error) {
31330
- handleError(action);
31331
- }
31332
-
31333
- return next(action);
31334
- } catch (error) {
31335
- handleError({
31336
- error
31337
- });
31338
- throw error;
31339
- }
31340
- };
31341
- };
31342
- }
31343
31348
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/core/seamly-core.js
31344
31349
 
31345
31350
 
@@ -31452,11 +31457,43 @@ function objectStore(key, storageProvider) {
31452
31457
 
31453
31458
  };
31454
31459
  }
31455
- // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/object/get-own-property-names.js
31456
- var get_own_property_names = __webpack_require__(8604);
31457
31460
  // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/json/stringify.js
31458
31461
  var stringify = __webpack_require__(9340);
31459
31462
  var stringify_default = /*#__PURE__*/__webpack_require__.n(stringify);
31463
+ ;// CONCATENATED MODULE: ./src/javascripts/lib/store/providers/session-storage.js
31464
+
31465
+
31466
+ function store(key) {
31467
+ const KEY = 'cvco.' + key;
31468
+ return {
31469
+ get() {
31470
+ var _context;
31471
+
31472
+ const candidates = [KEY, slice_default()(_context = KEY.split('.')).call(_context, 0, -1).join('.')];
31473
+ let val;
31474
+
31475
+ do {
31476
+ val = sessionStorage.getItem(candidates[0]);
31477
+ } while (candidates.shift() && !val);
31478
+
31479
+ return JSON.parse(val);
31480
+ },
31481
+
31482
+ set(value) {
31483
+ if (!value) {
31484
+ return;
31485
+ }
31486
+
31487
+ sessionStorage.setItem(KEY, stringify_default()(value));
31488
+ }
31489
+
31490
+ };
31491
+ }
31492
+ // EXTERNAL MODULE: ./src/javascripts/lib/debug.js
31493
+ var debug = __webpack_require__(1905);
31494
+ var debug_default = /*#__PURE__*/__webpack_require__.n(debug);
31495
+ // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/object/get-own-property-names.js
31496
+ var get_own_property_names = __webpack_require__(8604);
31460
31497
  ;// CONCATENATED MODULE: ./node_modules/phoenix/priv/static/phoenix.esm.js
31461
31498
 
31462
31499
 
@@ -32958,9 +32995,6 @@ const splitUrlParams = url => {
32958
32995
  };
32959
32996
 
32960
32997
  /* harmony default export */ var split_url_params = (splitUrlParams);
32961
- // EXTERNAL MODULE: ./src/javascripts/lib/debug.js
32962
- var debug = __webpack_require__(1905);
32963
- var debug_default = /*#__PURE__*/__webpack_require__.n(debug);
32964
32998
  ;// CONCATENATED MODULE: ./src/javascripts/api/producer.js
32965
32999
 
32966
33000
 
@@ -33132,35 +33166,6 @@ class ConversationProducer {
33132
33166
  }
33133
33167
 
33134
33168
  }
33135
- ;// CONCATENATED MODULE: ./src/javascripts/lib/store/providers/session-storage.js
33136
-
33137
-
33138
- function store(key) {
33139
- const KEY = 'cvco.' + key;
33140
- return {
33141
- get() {
33142
- var _context;
33143
-
33144
- const candidates = [KEY, slice_default()(_context = KEY.split('.')).call(_context, 0, -1).join('.')];
33145
- let val;
33146
-
33147
- do {
33148
- val = sessionStorage.getItem(candidates[0]);
33149
- } while (candidates.shift() && !val);
33150
-
33151
- return JSON.parse(val);
33152
- },
33153
-
33154
- set(value) {
33155
- if (!value) {
33156
- return;
33157
- }
33158
-
33159
- sessionStorage.setItem(KEY, stringify_default()(value));
33160
- }
33161
-
33162
- };
33163
- }
33164
33169
  ;// CONCATENATED MODULE: ./src/javascripts/api/event-producer.js
33165
33170
  class EventProducer {
33166
33171
  constructor(name) {
@@ -33272,15 +33277,6 @@ function getTimeZone() {
33272
33277
  }
33273
33278
  }
33274
33279
 
33275
- function getEnvironment() {
33276
- return {
33277
- screenResolution: `${window.screen.width}x${window.screen.height}`,
33278
- userAgent: navigator.userAgent,
33279
- currentUrl: window.location.toString(),
33280
- timezone: getTimeZone()
33281
- };
33282
- }
33283
-
33284
33280
  class API {
33285
33281
  /**
33286
33282
  * Creates an instance of API.
@@ -33290,6 +33286,7 @@ class API {
33290
33286
  * @param {string} config.secure Connect securely
33291
33287
  * @param {string} config.externalId Unique visitor identifier (optional)
33292
33288
  * @param {boolean} config.sendEnvironment
33289
+ * @param {string} layoutMode
33293
33290
  * @param {string} namespace
33294
33291
  * @param {Object} [context={ channelName: undefined, variables: undefined, locale: undefined }]
33295
33292
  * @param {string} context.channelName
@@ -33298,6 +33295,7 @@ class API {
33298
33295
  * @memberof API
33299
33296
  */
33300
33297
  constructor({
33298
+ layoutMode,
33301
33299
  namespace,
33302
33300
  config = {},
33303
33301
  context = {}
@@ -33319,6 +33317,7 @@ class API {
33319
33317
  this.connected = false;
33320
33318
  this.configReady = false;
33321
33319
  this.externalId = config.externalId;
33320
+ this.layoutMode = layoutMode;
33322
33321
  this.internalProducer = new EventProducer('API');
33323
33322
  this.internal$ = xstream_default().create(this.internalProducer).flatten();
33324
33323
  this.connection$ = filter_default()(_context = this.internal$).call(_context, event => event.type === 'connection');
@@ -33445,7 +33444,7 @@ class API {
33445
33444
  v: apiVersion
33446
33445
  }).send({
33447
33446
  context: api_objectSpread(api_objectSpread({}, this.config.context), {}, {
33448
- environment: this.config.sendEnvironment === true ? getEnvironment() : this.config.sendEnvironment
33447
+ environment: this.config.sendEnvironment === true ? this.getEnvironment() : this.config.sendEnvironment
33449
33448
  })
33450
33449
  }).then(({
33451
33450
  body
@@ -33459,7 +33458,7 @@ class API {
33459
33458
  }
33460
33459
 
33461
33460
  if (error.status >= 500) {
33462
- throw new SeamlyGeneralError();
33461
+ throw new SeamlyGeneralError(error);
33463
33462
  }
33464
33463
 
33465
33464
  throw error;
@@ -33533,7 +33532,7 @@ class API {
33533
33532
 
33534
33533
  if (this.config.sendEnvironment) {
33535
33534
  this.send('context', {
33536
- environment: this.config.sendEnvironment === true ? getEnvironment() : this.config.sendEnvironment
33535
+ environment: this.config.sendEnvironment === true ? this.getEnvironment() : this.config.sendEnvironment
33537
33536
  }, false);
33538
33537
  }
33539
33538
 
@@ -33663,6 +33662,18 @@ class API {
33663
33662
  return filter_default()(_context5 = this.internal$).call(_context5, event => event.type !== 'connection');
33664
33663
  }
33665
33664
 
33665
+ getEnvironment() {
33666
+ return {
33667
+ clientName: PACKAGE_NAME,
33668
+ clientVariant: this.layoutMode,
33669
+ clientVersion: PACKAGE_VERSION,
33670
+ currentUrl: window.location.toString(),
33671
+ screenResolution: `${window.screen.width}x${window.screen.height}`,
33672
+ timezone: getTimeZone(),
33673
+ userAgent: navigator.userAgent
33674
+ };
33675
+ }
33676
+
33666
33677
  }
33667
33678
  ;// CONCATENATED MODULE: ./node_modules/redux-thunk/es/index.js
33668
33679
  function createThunkMiddleware(extraArgument) {
@@ -33869,6 +33880,7 @@ class Engine {
33869
33880
  this.parentElement = parentElement;
33870
33881
  this.externalApi = externalApi;
33871
33882
  this.api = new API({
33883
+ layoutMode: config.layoutMode,
33872
33884
  namespace: config.namespace,
33873
33885
  config: config.api,
33874
33886
  context: config.context