@seamly/web-ui 20.1.0 → 20.2.0-alpha.3

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 (67) hide show
  1. package/build/dist/lib/deprecated-view.css +1 -1
  2. package/build/dist/lib/index.debug.js +44 -44
  3. package/build/dist/lib/index.debug.min.js +1 -1
  4. package/build/dist/lib/index.js +593 -546
  5. package/build/dist/lib/index.min.js +1 -1
  6. package/build/dist/lib/standalone.js +620 -573
  7. package/build/dist/lib/standalone.min.js +1 -1
  8. package/build/dist/lib/style-guide.js +6931 -6911
  9. package/build/dist/lib/style-guide.min.js +1 -1
  10. package/build/dist/lib/styles.css +1 -1
  11. package/package.json +2 -2
  12. package/src/javascripts/api/index.js +5 -4
  13. package/src/javascripts/domains/app/actions.js +11 -2
  14. package/src/javascripts/domains/config/reducer.js +2 -2
  15. package/src/javascripts/domains/forms/reducer.js +1 -1
  16. package/src/javascripts/domains/i18n/reducer.js +1 -1
  17. package/src/javascripts/domains/interrupt/reducer.js +1 -1
  18. package/src/javascripts/domains/translations/components/chat-status.js +1 -4
  19. package/src/javascripts/domains/translations/components/options-dialog/index.js +2 -5
  20. package/src/javascripts/domains/translations/hooks.js +1 -5
  21. package/src/javascripts/domains/translations/middleware.js +2 -5
  22. package/src/javascripts/domains/translations/reducer.js +2 -2
  23. package/src/javascripts/domains/visibility/actions.js +1 -1
  24. package/src/javascripts/domains/visibility/utils.js +6 -0
  25. package/src/javascripts/lib/external-api/index.js +27 -1
  26. package/src/javascripts/style-guide/components/app.js +1 -1
  27. package/src/javascripts/style-guide/components/static-core.js +4 -1
  28. package/src/javascripts/ui/components/conversation/conversation.js +2 -2
  29. package/src/javascripts/ui/components/conversation/event/carousel-component/index.js +1 -1
  30. package/src/javascripts/ui/components/conversation/event/cta.js +1 -1
  31. package/src/javascripts/ui/components/conversation/event/image.js +1 -1
  32. package/src/javascripts/ui/components/conversation/event/participant.js +1 -1
  33. package/src/javascripts/ui/components/conversation/event/text.js +2 -2
  34. package/src/javascripts/ui/components/conversation/loader.js +1 -1
  35. package/src/javascripts/ui/components/conversation/message-container.js +1 -1
  36. package/src/javascripts/ui/components/core/seamly-activity-monitor.js +1 -1
  37. package/src/javascripts/ui/components/core/seamly-core.js +2 -2
  38. package/src/javascripts/ui/components/core/seamly-file-upload.js +1 -1
  39. package/src/javascripts/ui/components/core/seamly-instance-functions-loader.js +1 -1
  40. package/src/javascripts/ui/components/core/seamly-live-region.js +2 -2
  41. package/src/javascripts/ui/components/entry/entry-container.js +2 -2
  42. package/src/javascripts/ui/components/entry/text-entry/hooks.js +4 -1
  43. package/src/javascripts/ui/components/entry/text-entry/text-entry-form.js +1 -1
  44. package/src/javascripts/ui/components/form-controls/select.js +1 -1
  45. package/src/javascripts/ui/components/layout/agent-info.js +1 -1
  46. package/src/javascripts/ui/components/layout/header.js +1 -1
  47. package/src/javascripts/ui/components/options/options-button.js +1 -1
  48. package/src/javascripts/ui/components/options/options.js +1 -1
  49. package/src/javascripts/ui/components/options/transcript/index.js +1 -1
  50. package/src/javascripts/ui/components/warnings/resume-conversation-prompt.js +1 -1
  51. package/src/javascripts/ui/components/widgets/lightbox.js +1 -1
  52. package/src/javascripts/ui/hooks/file-upload-hooks.js +3 -2
  53. package/src/javascripts/ui/hooks/focus-helper-hooks.js +2 -2
  54. package/src/javascripts/ui/hooks/seamly-entry-hooks.js +1 -1
  55. package/src/javascripts/ui/hooks/seamly-option-hooks.js +1 -1
  56. package/src/javascripts/ui/hooks/use-seamly-chat.js +2 -2
  57. package/src/javascripts/ui/hooks/use-seamly-commands.js +7 -7
  58. package/src/javascripts/ui/hooks/use-seamly-idle-detach-countdown.js +4 -4
  59. package/src/javascripts/ui/hooks/use-seamly-resume-conversation-prompt.js +2 -2
  60. package/src/javascripts/ui/hooks/use-single-file-upload.js +1 -1
  61. package/src/stylesheets/5-components/_chat-status.scss +4 -0
  62. package/src/stylesheets/5-components/_message-translation-info.scss +4 -0
  63. package/src/stylesheets/7-deprecated/5-components/_message.scss +4 -0
  64. package/src/stylesheets/7-deprecated/5-components/_suggestions.scss +3 -0
  65. package/src/stylesheets/deprecated-view.scss +1 -0
  66. package/webpack/config.package.js +7 -0
  67. package/src/.DS_Store +0 -0
@@ -9225,6 +9225,29 @@ const setLocale = i18n_utils_createThunk('setLocale', async (locale, {
9225
9225
  return api.getTranslations(locale);
9226
9226
  });
9227
9227
  });
9228
+ ;// CONCATENATED MODULE: ./src/javascripts/domains/translations/utils.js
9229
+
9230
+ const {
9231
+ createActions: utils_createActions,
9232
+ createReducer: translations_utils_createReducer,
9233
+ selectState: translations_utils_selectState
9234
+ } = createDomain('translations');
9235
+ ;// CONCATENATED MODULE: ./src/javascripts/domains/translations/actions.js
9236
+
9237
+ const [enable, disable] = utils_createActions('translate', {
9238
+ enable: locale => ({
9239
+ locale
9240
+ }),
9241
+ disable: () => ({})
9242
+ });
9243
+ const [enableEvent, disableEvent] = utils_createActions('event', {
9244
+ enable: payloadId => ({
9245
+ payloadId
9246
+ }),
9247
+ disable: payloadId => ({
9248
+ payloadId
9249
+ })
9250
+ });
9228
9251
  ;// CONCATENATED MODULE: ./src/javascripts/domains/app/utils.js
9229
9252
 
9230
9253
  const {
@@ -9238,6 +9261,49 @@ const {
9238
9261
 
9239
9262
  const selectUserHasResponded = createSelector(app_utils_selectState, state => state.userHasResponded);
9240
9263
 
9264
+ ;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/utils.js
9265
+
9266
+
9267
+ const {
9268
+ createAction: visibility_utils_createAction,
9269
+ createActions: visibility_utils_createActions,
9270
+ createThunk: visibility_utils_createThunk,
9271
+ createReducer: visibility_utils_createReducer,
9272
+ selectState: visibility_utils_selectState
9273
+ } = createDomain('visibility');
9274
+ const calculateVisibility = ({
9275
+ hasResponded,
9276
+ previousVisibility,
9277
+ requestedVisibility,
9278
+ config
9279
+ }) => {
9280
+ const {
9281
+ defaults,
9282
+ layoutMode,
9283
+ hideOnNoUserResponse
9284
+ } = config;
9285
+ const {
9286
+ visible: defaultVisibility
9287
+ } = defaults || {}; // Requesting open should override the responded check.
9288
+
9289
+ if (layoutMode === 'window' && hideOnNoUserResponse && requestedVisibility !== visibilityStates.open) {
9290
+ return hasResponded ? requestedVisibility || previousVisibility || visibilityStates.open : visibilityStates.hidden;
9291
+ } // Allow users to continue a conversation (if they have responded and no visibility is requested)
9292
+ // when switching from the window layout to the inline layout
9293
+
9294
+
9295
+ if (layoutMode === 'inline' && hasResponded && !requestedVisibility) {
9296
+ return previousVisibility || visibilityStates.open;
9297
+ }
9298
+
9299
+ const baseVisibility = visibilityStates.minimized;
9300
+ return requestedVisibility || previousVisibility || defaultVisibility || baseVisibility;
9301
+ };
9302
+ ;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/selectors.js
9303
+
9304
+
9305
+ const selectVisibility = createSelector(visibility_utils_selectState, state => state.visibility);
9306
+
9241
9307
  ;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/seamly-state-hooks.js
9242
9308
  function seamly_state_hooks_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
9243
9309
 
@@ -9349,43 +9415,6 @@ const useSeamlyLayoutMode = () => {
9349
9415
  isResolving: !layoutMode
9350
9416
  };
9351
9417
  };
9352
- ;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/utils.js
9353
-
9354
-
9355
- const {
9356
- createAction: visibility_utils_createAction,
9357
- createActions: utils_createActions,
9358
- createThunk: visibility_utils_createThunk,
9359
- createReducer: visibility_utils_createReducer,
9360
- selectState: visibility_utils_selectState
9361
- } = createDomain('visibility');
9362
- const calculateVisibility = ({
9363
- hasResponded,
9364
- previousVisibility,
9365
- requestedVisibility,
9366
- config
9367
- }) => {
9368
- const {
9369
- defaults,
9370
- layoutMode,
9371
- hideOnNoUserResponse
9372
- } = config;
9373
- const {
9374
- visible: defaultVisibility
9375
- } = defaults || {}; // Requesting open should override the responded check.
9376
-
9377
- if (layoutMode === 'window' && hideOnNoUserResponse && requestedVisibility !== visibilityStates.open) {
9378
- return hasResponded ? requestedVisibility || previousVisibility || visibilityStates.open : visibilityStates.hidden;
9379
- }
9380
-
9381
- const baseVisibility = visibilityStates.minimized;
9382
- return requestedVisibility || previousVisibility || defaultVisibility || baseVisibility;
9383
- };
9384
- ;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/selectors.js
9385
-
9386
-
9387
- const selectVisibility = createSelector(visibility_utils_selectState, state => state.visibility);
9388
-
9389
9418
  ;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/actions.js
9390
9419
  function actions_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
9391
9420
 
@@ -9550,6 +9579,8 @@ const clear = interrupt_utils_createAction('clear');
9550
9579
 
9551
9580
 
9552
9581
 
9582
+
9583
+
9553
9584
  const setHasResponded = app_utils_createAction('setHasResponded', hasResponded => ({
9554
9585
  hasResponded
9555
9586
  }));
@@ -9592,7 +9623,7 @@ const app_actions_initialize = app_utils_createThunk('initialize', async (_, {
9592
9623
 
9593
9624
  if (agentParticipant !== null && agentParticipant !== void 0 && agentParticipant.name) {
9594
9625
  dispatch({
9595
- type: seamlyActions.SET_HEADER_TITLE,
9626
+ type: seamlyActions.SET_HEADER_SUB_TITLE,
9596
9627
  title: agentParticipant.name
9597
9628
  });
9598
9629
  }
@@ -9601,6 +9632,8 @@ const app_actions_initialize = app_utils_createThunk('initialize', async (_, {
9601
9632
  }
9602
9633
 
9603
9634
  try {
9635
+ var _config$context2;
9636
+
9604
9637
  if (api.hasConversation()) {
9605
9638
  var _initialState$transla;
9606
9639
 
@@ -9614,6 +9647,16 @@ const app_actions_initialize = app_utils_createThunk('initialize', async (_, {
9614
9647
  if ('userResponded' in initialState) {
9615
9648
  dispatch(setHasResponded(initialState.userResponded));
9616
9649
  }
9650
+ } else if (config !== null && config !== void 0 && (_config$context2 = config.context) !== null && _config$context2 !== void 0 && _config$context2.translationLocale) {
9651
+ locale = config.context.translationLocale;
9652
+ api.send('action', {
9653
+ type: actionTypes.setTranslation,
9654
+ body: {
9655
+ enabled: true,
9656
+ locale
9657
+ }
9658
+ });
9659
+ dispatch(enable(locale));
9617
9660
  }
9618
9661
  } catch (e) {
9619
9662
  if (e instanceof SeamlySessionExpiredError) {
@@ -10818,6 +10861,33 @@ const useFileUploads = () => {
10818
10861
  isComplete: currentUploads.every(file => file.complete)
10819
10862
  };
10820
10863
  };
10864
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/utility-hooks.js
10865
+
10866
+
10867
+ const useForceUpdate = () => {
10868
+ // This is an escape hatch mentioned in the React docs:
10869
+ // https://reactjs.org/docs/hooks-faq.html#is-there-something-like-forceupdate
10870
+
10871
+ /* eslint-disable-next-line no-unused-vars */
10872
+ const [ignored, forceUpdate] = (0,hooks_namespaceObject.useReducer)(x => x + 1, 0);
10873
+ return (0,hooks_namespaceObject.useCallback)(() => {
10874
+ setTimeout(() => {
10875
+ forceUpdate();
10876
+ });
10877
+ }, []);
10878
+ };
10879
+ const useGeneratedId = () => {
10880
+ const [id] = (0,hooks_namespaceObject.useState)(() => randomId());
10881
+ return id;
10882
+ };
10883
+ const useStableCallback = callback => {
10884
+ const callbackRef = (0,hooks_namespaceObject.useRef)();
10885
+ callbackRef.current = callback;
10886
+ const isFunction = typeof callback === 'function';
10887
+ return (0,hooks_namespaceObject.useMemo)(() => {
10888
+ return isFunction ? (...args) => callbackRef.current(...args) : undefined;
10889
+ }, [isFunction]);
10890
+ };
10821
10891
  ;// CONCATENATED MODULE: ./src/javascripts/domains/interrupt/selectors.js
10822
10892
 
10823
10893
 
@@ -11035,33 +11105,6 @@ const visibility_reducer_initialState = {
11035
11105
 
11036
11106
 
11037
11107
 
11038
- ;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/utility-hooks.js
11039
-
11040
-
11041
- const useForceUpdate = () => {
11042
- // This is an escape hatch mentioned in the React docs:
11043
- // https://reactjs.org/docs/hooks-faq.html#is-there-something-like-forceupdate
11044
-
11045
- /* eslint-disable-next-line no-unused-vars */
11046
- const [ignored, forceUpdate] = (0,hooks_namespaceObject.useReducer)(x => x + 1, 0);
11047
- return (0,hooks_namespaceObject.useCallback)(() => {
11048
- setTimeout(() => {
11049
- forceUpdate();
11050
- });
11051
- }, []);
11052
- };
11053
- const useGeneratedId = () => {
11054
- const [id] = (0,hooks_namespaceObject.useState)(() => randomId());
11055
- return id;
11056
- };
11057
- const useStableCallback = callback => {
11058
- const callbackRef = (0,hooks_namespaceObject.useRef)();
11059
- callbackRef.current = callback;
11060
- const isFunction = typeof callback === 'function';
11061
- return (0,hooks_namespaceObject.useMemo)(() => {
11062
- return isFunction ? (...args) => callbackRef.current(...args) : undefined;
11063
- }, [isFunction]);
11064
- };
11065
11108
  ;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/use-seamly-commands.js
11066
11109
  function use_seamly_commands_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
11067
11110
 
@@ -11849,29 +11892,6 @@ const app_reducer_initialState = {
11849
11892
 
11850
11893
 
11851
11894
 
11852
- ;// CONCATENATED MODULE: ./src/javascripts/domains/translations/utils.js
11853
-
11854
- const {
11855
- createActions: translations_utils_createActions,
11856
- createReducer: translations_utils_createReducer,
11857
- selectState: translations_utils_selectState
11858
- } = createDomain('translations');
11859
- ;// CONCATENATED MODULE: ./src/javascripts/domains/translations/actions.js
11860
-
11861
- const [enable, disable] = translations_utils_createActions('translate', {
11862
- enable: locale => ({
11863
- locale
11864
- }),
11865
- disable: () => ({})
11866
- });
11867
- const [enableEvent, disableEvent] = translations_utils_createActions('event', {
11868
- enable: payloadId => ({
11869
- payloadId
11870
- }),
11871
- disable: payloadId => ({
11872
- payloadId
11873
- })
11874
- });
11875
11895
  ;// CONCATENATED MODULE: ./src/javascripts/domains/redux/utils.js
11876
11896
  const arrayContentEquals = (a, b) => {
11877
11897
  if (a === b) {
@@ -12804,197 +12824,18 @@ function updateFormControl(state, formId, name, controlState) {
12804
12824
 
12805
12825
 
12806
12826
 
12807
- ;// CONCATENATED MODULE: ./src/javascripts/ui/utils/form-utils.js
12808
- function form_utils_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
12827
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/components/form-controls/form.js
12828
+ const form_excluded = ["className", "disableValidationClasses"];
12809
12829
 
12810
- function form_utils_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { form_utils_ownKeys(Object(source), true).forEach(function (key) { form_utils_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { form_utils_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
12830
+ function form_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
12811
12831
 
12812
- function form_utils_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12832
+ function form_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { form_ownKeys(Object(source), true).forEach(function (key) { form_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { form_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
12813
12833
 
12814
- const formActions = {
12815
- REGISTER_FORM: 'REGISTER_FORM',
12816
- DE_REGISTER_FORM: 'DE_REGISTER_FORM',
12817
- REGISTER: 'REGISTER',
12818
- DE_REGISTER: 'DEREGISTER',
12819
- SET_VALUE: 'SET_VALUE',
12820
- SET_VALIDITY: 'SET_VALIDITY',
12821
- SET_STATE: 'SET_STATE',
12822
- SET_SUBMITTED: 'SET_SUBMITTED',
12823
- SET_PERSIST_FORM_DATA: 'SET_PERSIST_FORM_DATA'
12824
- };
12825
- const {
12826
- REGISTER_FORM,
12827
- DE_REGISTER_FORM,
12828
- REGISTER,
12829
- DE_REGISTER,
12830
- SET_VALUE,
12831
- SET_VALIDITY,
12832
- SET_STATE,
12833
- SET_SUBMITTED,
12834
- SET_PERSIST_FORM_DATA
12835
- } = formActions;
12836
- const getValidator = (fn, errorText, compareValue = null) => ({
12837
- fn,
12838
- errorText,
12839
- compareValue
12840
- });
12841
- const formReducer = (state, action) => {
12842
- const {
12843
- formId,
12844
- name,
12845
- controlId,
12846
- value,
12847
- data,
12848
- validity,
12849
- errorText,
12850
- hasSubmitted,
12851
- persistData
12852
- } = action;
12834
+ function form_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12853
12835
 
12854
- const setControls = controls => form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
12855
- [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
12856
- controls: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls), controls)
12857
- })
12858
- });
12836
+ function form_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = form_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
12859
12837
 
12860
- switch (action.type) {
12861
- case REGISTER_FORM:
12862
- return form_utils_objectSpread({
12863
- [formId]: {
12864
- controls: {},
12865
- validity: true,
12866
- hasSubmitted: false,
12867
- persistData: false
12868
- }
12869
- }, state);
12870
-
12871
- case DE_REGISTER_FORM:
12872
- const removedFormState = form_utils_objectSpread({}, state);
12873
-
12874
- delete removedFormState[formId];
12875
- return removedFormState;
12876
-
12877
- case REGISTER:
12878
- const {
12879
- value: existingValue,
12880
- validity: existingValidity,
12881
- errorText: existingErrorText
12882
- } = state[formId].controls[name] || {};
12883
- return setControls({
12884
- [name]: {
12885
- controlId,
12886
- value: existingValue || value,
12887
- validity: existingValidity !== false,
12888
- errorText: existingErrorText || ''
12889
- }
12890
- });
12891
-
12892
- case DE_REGISTER:
12893
- const relatedForm = state[formId];
12894
-
12895
- if (!relatedForm) {
12896
- return state;
12897
- }
12898
-
12899
- const newControls = form_utils_objectSpread({}, relatedForm.controls);
12900
-
12901
- delete newControls[action.name];
12902
- return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
12903
- [formId]: form_utils_objectSpread(form_utils_objectSpread({}, relatedForm), {}, {
12904
- controls: newControls
12905
- })
12906
- });
12907
-
12908
- case SET_VALUE:
12909
- return setControls({
12910
- [name]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[name]), {}, {
12911
- value
12912
- })
12913
- });
12914
-
12915
- case SET_VALIDITY:
12916
- const newControlValidities = form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls), {}, {
12917
- [name]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[name]), {}, {
12918
- validity,
12919
- errorText
12920
- })
12921
- });
12922
-
12923
- return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
12924
- [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
12925
- controls: newControlValidities,
12926
- validity: Object.keys(newControlValidities).map(key => newControlValidities[key].validity).every(v => v)
12927
- })
12928
- });
12929
-
12930
- case SET_STATE:
12931
- return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
12932
- [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
12933
- controls: Object.keys(data).reduce((acc, key) => {
12934
- return form_utils_objectSpread(form_utils_objectSpread({}, acc), {}, {
12935
- [key]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[key]), {}, {
12936
- value: data[key],
12937
- validity: true,
12938
- errorText: ''
12939
- })
12940
- });
12941
- }, form_utils_objectSpread({}, state.controls))
12942
- })
12943
- });
12944
-
12945
- case SET_SUBMITTED:
12946
- return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
12947
- [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
12948
- hasSubmitted
12949
- })
12950
- });
12951
-
12952
- case SET_PERSIST_FORM_DATA:
12953
- return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
12954
- [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
12955
- persistData
12956
- })
12957
- });
12958
-
12959
- default:
12960
- return state;
12961
- }
12962
- };
12963
- ;// CONCATENATED MODULE: ./src/javascripts/ui/utils/validations.js
12964
- const validateFileSize = (fileList, maxSize) => {
12965
- let isValid = true;
12966
-
12967
- for (let i = 0; i < fileList.length; i++) {
12968
- if (fileList[i].size > maxSize) {
12969
- isValid = false;
12970
- }
12971
- }
12972
-
12973
- return isValid;
12974
- };
12975
- const fileListObjectIsNotEmpty = fileListObj => !!(fileListObj !== null && fileListObj !== void 0 && fileListObj.length) > 0;
12976
- /* eslint-disable no-control-regex */
12977
-
12978
- const isEmailString = val => {
12979
- 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;
12980
- const trimmedVal = val && val.trim();
12981
- return !!(trimmedVal && trimmedVal.match(regex));
12982
- };
12983
- /* eslint-enable no-control-regex */
12984
-
12985
- const isNotEmptyString = val => !!val;
12986
- ;// CONCATENATED MODULE: ./src/javascripts/ui/components/form-controls/form.js
12987
- const form_excluded = ["className", "disableValidationClasses"];
12988
-
12989
- function form_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
12990
-
12991
- function form_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { form_ownKeys(Object(source), true).forEach(function (key) { form_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { form_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
12992
-
12993
- function form_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12994
-
12995
- function form_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = form_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
12996
-
12997
- function form_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
12838
+ function form_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
12998
12839
 
12999
12840
 
13000
12841
 
@@ -13195,52 +13036,231 @@ function TranslationsOptionsDialogForm({
13195
13036
  const languageName = (0,hooks_namespaceObject.useMemo)(() => {
13196
13037
  var _languages$find;
13197
13038
 
13198
- return languages === null || languages === void 0 ? void 0 : (_languages$find = languages.find(lang => lang.locale === currentLocale)) === null || _languages$find === void 0 ? void 0 : _languages$find.nativeName;
13199
- }, [languages, currentLocale]);
13200
- const options = (0,hooks_namespaceObject.useMemo)(() => {
13201
- return [{
13202
- value: '',
13203
- label: t('translations.settings.defaultOptionLabel')
13204
- }, ...languages.filter(language => language.locale.toLowerCase() !== String(uiLocale).toLowerCase()).map(language => ({
13205
- value: language.locale,
13206
- label: language.nativeName
13207
- }))];
13208
- }, [t, languages, uiLocale]);
13209
- return (0,jsx_runtime_namespaceObject.jsxs)(form_controls_form, {
13210
- noValidate: "true",
13211
- className: css_className('options__form'),
13212
- children: [(0,jsx_runtime_namespaceObject.jsx)("p", {
13213
- className: css_className('options__description'),
13214
- id: descriptionId,
13215
- children: t('translations.settings.description')
13216
- }), isActive ? (0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
13217
- children: [(0,jsx_runtime_namespaceObject.jsx)("h3", {
13218
- children: t('translations.settings.currentTranslationLabel')
13219
- }), (0,jsx_runtime_namespaceObject.jsx)("p", {
13220
- className: css_className('options__active-language'),
13221
- children: languageName
13222
- })]
13223
- }) : (0,jsx_runtime_namespaceObject.jsx)(form_controls_select, {
13224
- name: controlName,
13225
- type: "text",
13226
- className: css_className('input__select'),
13227
- "aria-describedby": descriptionId,
13228
- labelClass: css_className('label'),
13229
- labelText: t('translations.settings.inputLabel'),
13230
- options: options,
13231
- defaultValue: currentLocale || ''
13232
- }), (0,jsx_runtime_namespaceObject.jsx)("div", {
13233
- className: css_className('options__actions'),
13234
- children: (0,jsx_runtime_namespaceObject.jsx)("button", {
13235
- type: "submit",
13236
- className: css_className('button', 'button--primary', 'options__submit'),
13237
- children: isActive ? t('translations.settings.endButtonText') : t('translations.settings.startButtonText')
13238
- })
13239
- })]
13240
- });
13241
- }
13039
+ return languages === null || languages === void 0 ? void 0 : (_languages$find = languages.find(lang => lang.locale === currentLocale)) === null || _languages$find === void 0 ? void 0 : _languages$find.nativeName;
13040
+ }, [languages, currentLocale]);
13041
+ const options = (0,hooks_namespaceObject.useMemo)(() => {
13042
+ return [{
13043
+ value: '',
13044
+ label: t('translations.settings.defaultOptionLabel')
13045
+ }, ...languages.filter(language => language.locale.toLowerCase() !== String(uiLocale).toLowerCase()).map(language => ({
13046
+ value: language.locale,
13047
+ label: language.nativeName
13048
+ }))];
13049
+ }, [t, languages, uiLocale]);
13050
+ return (0,jsx_runtime_namespaceObject.jsxs)(form_controls_form, {
13051
+ noValidate: "true",
13052
+ className: css_className('options__form'),
13053
+ children: [(0,jsx_runtime_namespaceObject.jsx)("p", {
13054
+ className: css_className('options__description'),
13055
+ id: descriptionId,
13056
+ children: t('translations.settings.description')
13057
+ }), isActive ? (0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
13058
+ children: [(0,jsx_runtime_namespaceObject.jsx)("h3", {
13059
+ children: t('translations.settings.currentTranslationLabel')
13060
+ }), (0,jsx_runtime_namespaceObject.jsx)("p", {
13061
+ className: css_className('options__active-language'),
13062
+ children: languageName
13063
+ })]
13064
+ }) : (0,jsx_runtime_namespaceObject.jsx)(form_controls_select, {
13065
+ name: controlName,
13066
+ type: "text",
13067
+ className: css_className('input__select'),
13068
+ "aria-describedby": descriptionId,
13069
+ labelClass: css_className('label'),
13070
+ labelText: t('translations.settings.inputLabel'),
13071
+ options: options,
13072
+ defaultValue: currentLocale || ''
13073
+ }), (0,jsx_runtime_namespaceObject.jsx)("div", {
13074
+ className: css_className('options__actions'),
13075
+ children: (0,jsx_runtime_namespaceObject.jsx)("button", {
13076
+ type: "submit",
13077
+ className: css_className('button', 'button--primary', 'options__submit'),
13078
+ children: isActive ? t('translations.settings.endButtonText') : t('translations.settings.startButtonText')
13079
+ })
13080
+ })]
13081
+ });
13082
+ }
13083
+
13084
+ /* harmony default export */ const options_dialog_form = (TranslationsOptionsDialogForm);
13085
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/utils/form-utils.js
13086
+ function form_utils_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
13087
+
13088
+ function form_utils_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { form_utils_ownKeys(Object(source), true).forEach(function (key) { form_utils_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { form_utils_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
13089
+
13090
+ function form_utils_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13091
+
13092
+ const formActions = {
13093
+ REGISTER_FORM: 'REGISTER_FORM',
13094
+ DE_REGISTER_FORM: 'DE_REGISTER_FORM',
13095
+ REGISTER: 'REGISTER',
13096
+ DE_REGISTER: 'DEREGISTER',
13097
+ SET_VALUE: 'SET_VALUE',
13098
+ SET_VALIDITY: 'SET_VALIDITY',
13099
+ SET_STATE: 'SET_STATE',
13100
+ SET_SUBMITTED: 'SET_SUBMITTED',
13101
+ SET_PERSIST_FORM_DATA: 'SET_PERSIST_FORM_DATA'
13102
+ };
13103
+ const {
13104
+ REGISTER_FORM,
13105
+ DE_REGISTER_FORM,
13106
+ REGISTER,
13107
+ DE_REGISTER,
13108
+ SET_VALUE,
13109
+ SET_VALIDITY,
13110
+ SET_STATE,
13111
+ SET_SUBMITTED,
13112
+ SET_PERSIST_FORM_DATA
13113
+ } = formActions;
13114
+ const getValidator = (fn, errorText, compareValue = null) => ({
13115
+ fn,
13116
+ errorText,
13117
+ compareValue
13118
+ });
13119
+ const formReducer = (state, action) => {
13120
+ const {
13121
+ formId,
13122
+ name,
13123
+ controlId,
13124
+ value,
13125
+ data,
13126
+ validity,
13127
+ errorText,
13128
+ hasSubmitted,
13129
+ persistData
13130
+ } = action;
13131
+
13132
+ const setControls = controls => form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
13133
+ [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
13134
+ controls: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls), controls)
13135
+ })
13136
+ });
13137
+
13138
+ switch (action.type) {
13139
+ case REGISTER_FORM:
13140
+ return form_utils_objectSpread({
13141
+ [formId]: {
13142
+ controls: {},
13143
+ validity: true,
13144
+ hasSubmitted: false,
13145
+ persistData: false
13146
+ }
13147
+ }, state);
13148
+
13149
+ case DE_REGISTER_FORM:
13150
+ const removedFormState = form_utils_objectSpread({}, state);
13151
+
13152
+ delete removedFormState[formId];
13153
+ return removedFormState;
13154
+
13155
+ case REGISTER:
13156
+ const {
13157
+ value: existingValue,
13158
+ validity: existingValidity,
13159
+ errorText: existingErrorText
13160
+ } = state[formId].controls[name] || {};
13161
+ return setControls({
13162
+ [name]: {
13163
+ controlId,
13164
+ value: existingValue || value,
13165
+ validity: existingValidity !== false,
13166
+ errorText: existingErrorText || ''
13167
+ }
13168
+ });
13169
+
13170
+ case DE_REGISTER:
13171
+ const relatedForm = state[formId];
13172
+
13173
+ if (!relatedForm) {
13174
+ return state;
13175
+ }
13176
+
13177
+ const newControls = form_utils_objectSpread({}, relatedForm.controls);
13178
+
13179
+ delete newControls[action.name];
13180
+ return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
13181
+ [formId]: form_utils_objectSpread(form_utils_objectSpread({}, relatedForm), {}, {
13182
+ controls: newControls
13183
+ })
13184
+ });
13185
+
13186
+ case SET_VALUE:
13187
+ return setControls({
13188
+ [name]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[name]), {}, {
13189
+ value
13190
+ })
13191
+ });
13192
+
13193
+ case SET_VALIDITY:
13194
+ const newControlValidities = form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls), {}, {
13195
+ [name]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[name]), {}, {
13196
+ validity,
13197
+ errorText
13198
+ })
13199
+ });
13200
+
13201
+ return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
13202
+ [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
13203
+ controls: newControlValidities,
13204
+ validity: Object.keys(newControlValidities).map(key => newControlValidities[key].validity).every(v => v)
13205
+ })
13206
+ });
13207
+
13208
+ case SET_STATE:
13209
+ return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
13210
+ [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
13211
+ controls: Object.keys(data).reduce((acc, key) => {
13212
+ return form_utils_objectSpread(form_utils_objectSpread({}, acc), {}, {
13213
+ [key]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[key]), {}, {
13214
+ value: data[key],
13215
+ validity: true,
13216
+ errorText: ''
13217
+ })
13218
+ });
13219
+ }, form_utils_objectSpread({}, state.controls))
13220
+ })
13221
+ });
13222
+
13223
+ case SET_SUBMITTED:
13224
+ return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
13225
+ [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
13226
+ hasSubmitted
13227
+ })
13228
+ });
13229
+
13230
+ case SET_PERSIST_FORM_DATA:
13231
+ return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
13232
+ [formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
13233
+ persistData
13234
+ })
13235
+ });
13236
+
13237
+ default:
13238
+ return state;
13239
+ }
13240
+ };
13241
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/utils/validations.js
13242
+ const validateFileSize = (fileList, maxSize) => {
13243
+ let isValid = true;
13244
+
13245
+ for (let i = 0; i < fileList.length; i++) {
13246
+ if (fileList[i].size > maxSize) {
13247
+ isValid = false;
13248
+ }
13249
+ }
13250
+
13251
+ return isValid;
13252
+ };
13253
+ const fileListObjectIsNotEmpty = fileListObj => !!(fileListObj !== null && fileListObj !== void 0 && fileListObj.length) > 0;
13254
+ /* eslint-disable no-control-regex */
13242
13255
 
13243
- /* harmony default export */ const options_dialog_form = (TranslationsOptionsDialogForm);
13256
+ const isEmailString = val => {
13257
+ 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;
13258
+ const trimmedVal = val && val.trim();
13259
+ return !!(trimmedVal && trimmedVal.match(regex));
13260
+ };
13261
+ /* eslint-enable no-control-regex */
13262
+
13263
+ const isNotEmptyString = val => !!val;
13244
13264
  ;// CONCATENATED MODULE: ./src/javascripts/domains/translations/components/options-dialog/index.js
13245
13265
 
13246
13266
 
@@ -13858,36 +13878,6 @@ const Interrupt = ({
13858
13878
  };
13859
13879
 
13860
13880
  /* harmony default export */ const interrupt = (Interrupt);
13861
- ;// CONCATENATED MODULE: ./src/javascripts/ui/components/layout/privacy-disclaimer.js
13862
-
13863
-
13864
-
13865
-
13866
-
13867
-
13868
- const PrivacyDisclaimer = () => {
13869
- const {
13870
- t
13871
- } = useI18n();
13872
- const {
13873
- showDisclaimer
13874
- } = useConfig();
13875
- return showDisclaimer && (0,jsx_runtime_namespaceObject.jsxs)("div", {
13876
- className: css_className('disclaimer'),
13877
- tabIndex: "0",
13878
- children: [(0,jsx_runtime_namespaceObject.jsx)("h2", {
13879
- className: css_className('disclaimer__title'),
13880
- children: t('disclaimer.title')
13881
- }), (0,jsx_runtime_namespaceObject.jsx)("div", {
13882
- className: css_className('disclaimer__message'),
13883
- dangerouslySetInnerHTML: {
13884
- __html: t('disclaimer.content')
13885
- }
13886
- })]
13887
- });
13888
- };
13889
-
13890
- /* harmony default export */ const privacy_disclaimer = (PrivacyDisclaimer);
13891
13881
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/component-context.js
13892
13882
 
13893
13883
  const ComponentContext = (0,external_preact_namespaceObject.createContext)({});
@@ -19527,7 +19517,7 @@ const Participant = ({
19527
19517
  const avatar = participant.avatar || (agent === null || agent === void 0 ? void 0 : agent.avatar);
19528
19518
  return (0,jsx_runtime_namespaceObject.jsx)(EventDivider, {
19529
19519
  graphicSrc: avatar,
19530
- graphicType: participant.avatar ? 'avatar' : undefined,
19520
+ graphicType: avatar ? 'avatar' : undefined,
19531
19521
  iconName: !avatar ? 'balloon' : undefined,
19532
19522
  childrenHTML: intro,
19533
19523
  dividerType: "participant"
@@ -19713,6 +19703,94 @@ const Cta = ({
19713
19703
  };
19714
19704
 
19715
19705
  /* harmony default export */ const cta = (Cta);
19706
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/components/pagination.js
19707
+
19708
+
19709
+
19710
+ function CarouselPagination({
19711
+ items,
19712
+ currentIndex,
19713
+ onChange,
19714
+ getItemKey,
19715
+ getItemLabel
19716
+ }) {
19717
+ const itemCount = items.length;
19718
+ const handlePaginate = (0,hooks_namespaceObject.useCallback)(event => {
19719
+ const slideIndex = Number(event.target.dataset.item || '0');
19720
+ const nextIndex = Math.min(itemCount - 1, Math.max(0, slideIndex));
19721
+
19722
+ if (nextIndex !== currentIndex) {
19723
+ onChange(nextIndex);
19724
+ }
19725
+ }, [itemCount, currentIndex, onChange]);
19726
+ return (0,jsx_runtime_namespaceObject.jsx)("div", {
19727
+ className: css_className('carousel-pagination__wrapper'),
19728
+ role: "group",
19729
+ children: (0,jsx_runtime_namespaceObject.jsx)("ul", {
19730
+ className: css_className('carousel-pagination'),
19731
+ children: items.map((item, idx) => {
19732
+ const isActive = currentIndex === idx;
19733
+ return (0,jsx_runtime_namespaceObject.jsx)("li", {
19734
+ className: css_className('carousel-pagination__item', isActive ? 'is-active' : undefined),
19735
+ children: (0,jsx_runtime_namespaceObject.jsx)("button", {
19736
+ className: css_className('carousel-pagination__button'),
19737
+ type: "button",
19738
+ onClick: handlePaginate,
19739
+ "data-item": idx,
19740
+ "aria-disabled": isActive ? 'true' : undefined,
19741
+ "aria-label": getItemLabel(item, idx)
19742
+ })
19743
+ }, getItemKey(item, idx, 'pagination-item-'));
19744
+ })
19745
+ })
19746
+ });
19747
+ }
19748
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/components/controls.js
19749
+
19750
+
19751
+
19752
+
19753
+
19754
+ function CarouselControls({
19755
+ items,
19756
+ currentIndex,
19757
+ onChange,
19758
+ children
19759
+ }) {
19760
+ const {
19761
+ t
19762
+ } = useI18n();
19763
+ const itemCount = items.length;
19764
+
19765
+ const handlePrevious = () => {
19766
+ onChange((currentIndex - 1 + itemCount) % itemCount);
19767
+ };
19768
+
19769
+ const handleNext = () => {
19770
+ onChange((currentIndex + 1) % itemCount);
19771
+ };
19772
+
19773
+ return (0,jsx_runtime_namespaceObject.jsxs)("div", {
19774
+ className: css_className('carousel-controls'),
19775
+ children: [(0,jsx_runtime_namespaceObject.jsx)("button", {
19776
+ className: css_className('button', 'button--previous'),
19777
+ "aria-label": t('carousel.controls.previous'),
19778
+ onClick: handlePrevious,
19779
+ children: (0,jsx_runtime_namespaceObject.jsx)(icon, {
19780
+ name: "arrowLeft",
19781
+ size: "16"
19782
+ })
19783
+ }), children, (0,jsx_runtime_namespaceObject.jsx)("button", {
19784
+ className: css_className('button', 'button--next'),
19785
+ "aria-label": t('carousel.controls.next'),
19786
+ onClick: handleNext,
19787
+ children: (0,jsx_runtime_namespaceObject.jsx)(icon, {
19788
+ name: "arrowRight",
19789
+ size: "16"
19790
+ })
19791
+ })]
19792
+ });
19793
+ }
19716
19794
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/card-component.js
19717
19795
  function card_component_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
19718
19796
 
@@ -19819,133 +19897,45 @@ const CardComponent = ({
19819
19897
  className: css_className('button', 'button--primary'),
19820
19898
  "aria-describedby": descriptionId
19821
19899
  }, actionProps), {}, {
19822
- children: buttonText
19823
- }))]
19824
- })]
19825
- });
19826
- };
19827
-
19828
- /* harmony default export */ const card_component = (CardComponent);
19829
- ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-message/components/slide.js
19830
- function slide_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
19831
-
19832
- function slide_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { slide_ownKeys(Object(source), true).forEach(function (key) { slide_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { slide_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
19833
-
19834
- function slide_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19835
-
19836
-
19837
-
19838
-
19839
-
19840
- function CarouselMessageSlide({
19841
- item: slide,
19842
- items,
19843
- index,
19844
- isActive
19845
- }) {
19846
- const {
19847
- t
19848
- } = useI18n();
19849
- return (0,jsx_runtime_namespaceObject.jsx)("div", {
19850
- className: css_className('carousel-item', `carousel-item--${slide.type}`),
19851
- role: "group",
19852
- "aria-roledescription": "slide",
19853
- "aria-label": t('carousel.slide.label', {
19854
- index: index + 1,
19855
- total: items.length
19856
- }),
19857
- children: (0,jsx_runtime_namespaceObject.jsx)(card_component, slide_objectSpread(slide_objectSpread({}, slide), {}, {
19858
- isCarouselItem: true,
19859
- hasFocus: isActive
19860
- }))
19861
- });
19862
- }
19863
- ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/components/pagination.js
19864
-
19865
-
19866
-
19867
- function CarouselPagination({
19868
- items,
19869
- currentIndex,
19870
- onChange,
19871
- getItemKey,
19872
- getItemLabel
19873
- }) {
19874
- const itemCount = items.length;
19875
- const handlePaginate = (0,hooks_namespaceObject.useCallback)(event => {
19876
- const slideIndex = Number(event.target.dataset.item || '0');
19877
- const nextIndex = Math.min(itemCount - 1, Math.max(0, slideIndex));
19878
-
19879
- if (nextIndex !== currentIndex) {
19880
- onChange(nextIndex);
19881
- }
19882
- }, [itemCount, currentIndex, onChange]);
19883
- return (0,jsx_runtime_namespaceObject.jsx)("div", {
19884
- className: css_className('carousel-pagination__wrapper'),
19885
- role: "group",
19886
- children: (0,jsx_runtime_namespaceObject.jsx)("ul", {
19887
- className: css_className('carousel-pagination'),
19888
- children: items.map((item, idx) => {
19889
- const isActive = currentIndex === idx;
19890
- return (0,jsx_runtime_namespaceObject.jsx)("li", {
19891
- className: css_className('carousel-pagination__item', isActive ? 'is-active' : undefined),
19892
- children: (0,jsx_runtime_namespaceObject.jsx)("button", {
19893
- className: css_className('carousel-pagination__button'),
19894
- type: "button",
19895
- onClick: handlePaginate,
19896
- "data-item": idx,
19897
- "aria-disabled": isActive ? 'true' : undefined,
19898
- "aria-label": getItemLabel(item, idx)
19899
- })
19900
- }, getItemKey(item, idx, 'pagination-item-'));
19901
- })
19902
- })
19900
+ children: buttonText
19901
+ }))]
19902
+ })]
19903
19903
  });
19904
- }
19905
- ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/components/controls.js
19904
+ };
19905
+
19906
+ /* harmony default export */ const card_component = (CardComponent);
19907
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-message/components/slide.js
19908
+ function slide_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
19909
+
19910
+ function slide_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { slide_ownKeys(Object(source), true).forEach(function (key) { slide_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { slide_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
19906
19911
 
19912
+ function slide_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19907
19913
 
19908
19914
 
19909
19915
 
19910
19916
 
19911
- function CarouselControls({
19917
+
19918
+ function CarouselMessageSlide({
19919
+ item: slide,
19912
19920
  items,
19913
- currentIndex,
19914
- onChange,
19915
- children
19921
+ index,
19922
+ isActive
19916
19923
  }) {
19917
19924
  const {
19918
19925
  t
19919
19926
  } = useI18n();
19920
- const itemCount = items.length;
19921
-
19922
- const handlePrevious = () => {
19923
- onChange((currentIndex - 1 + itemCount) % itemCount);
19924
- };
19925
-
19926
- const handleNext = () => {
19927
- onChange((currentIndex + 1) % itemCount);
19928
- };
19929
-
19930
- return (0,jsx_runtime_namespaceObject.jsxs)("div", {
19931
- className: css_className('carousel-controls'),
19932
- children: [(0,jsx_runtime_namespaceObject.jsx)("button", {
19933
- className: css_className('button', 'button--previous'),
19934
- "aria-label": t('carousel.controls.previous'),
19935
- onClick: handlePrevious,
19936
- children: (0,jsx_runtime_namespaceObject.jsx)(icon, {
19937
- name: "arrowLeft",
19938
- size: "16"
19939
- })
19940
- }), children, (0,jsx_runtime_namespaceObject.jsx)("button", {
19941
- className: css_className('button', 'button--next'),
19942
- "aria-label": t('carousel.controls.next'),
19943
- onClick: handleNext,
19944
- children: (0,jsx_runtime_namespaceObject.jsx)(icon, {
19945
- name: "arrowRight",
19946
- size: "16"
19947
- })
19948
- })]
19927
+ return (0,jsx_runtime_namespaceObject.jsx)("div", {
19928
+ className: css_className('carousel-item', `carousel-item--${slide.type}`),
19929
+ role: "group",
19930
+ "aria-roledescription": "slide",
19931
+ "aria-label": t('carousel.slide.label', {
19932
+ index: index + 1,
19933
+ total: items.length
19934
+ }),
19935
+ children: (0,jsx_runtime_namespaceObject.jsx)(card_component, slide_objectSpread(slide_objectSpread({}, slide), {}, {
19936
+ isCarouselItem: true,
19937
+ hasFocus: isActive
19938
+ }))
19949
19939
  });
19950
19940
  }
19951
19941
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/index.js
@@ -20289,6 +20279,36 @@ const ComponentFilter = ({
20289
20279
  };
20290
20280
 
20291
20281
  /* harmony default export */ const component_filter = (ComponentFilter);
20282
+ ;// CONCATENATED MODULE: ./src/javascripts/ui/components/layout/privacy-disclaimer.js
20283
+
20284
+
20285
+
20286
+
20287
+
20288
+
20289
+ const PrivacyDisclaimer = () => {
20290
+ const {
20291
+ t
20292
+ } = useI18n();
20293
+ const {
20294
+ showDisclaimer
20295
+ } = useConfig();
20296
+ return showDisclaimer && (0,jsx_runtime_namespaceObject.jsxs)("div", {
20297
+ className: css_className('disclaimer'),
20298
+ tabIndex: "0",
20299
+ children: [(0,jsx_runtime_namespaceObject.jsx)("h2", {
20300
+ className: css_className('disclaimer__title'),
20301
+ children: t('disclaimer.title')
20302
+ }), (0,jsx_runtime_namespaceObject.jsx)("div", {
20303
+ className: css_className('disclaimer__message'),
20304
+ dangerouslySetInnerHTML: {
20305
+ __html: t('disclaimer.content')
20306
+ }
20307
+ })]
20308
+ });
20309
+ };
20310
+
20311
+ /* harmony default export */ const privacy_disclaimer = (PrivacyDisclaimer);
20292
20312
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/conversation.js
20293
20313
 
20294
20314
 
@@ -22217,53 +22237,6 @@ const View = () => {
22217
22237
  };
22218
22238
 
22219
22239
  /* harmony default export */ const view = (View);
22220
- ;// CONCATENATED MODULE: ./src/javascripts/domains/errors/index.js
22221
-
22222
-
22223
- const {
22224
- createAction: errors_createAction
22225
- } = createDomain('errors');
22226
- const catchError = errors_createAction('catch-error', error => ({
22227
- error
22228
- }));
22229
- function errors_createMiddleware({
22230
- api: seamlyApi
22231
- }) {
22232
- return ({
22233
- getState
22234
- }) => {
22235
- const handleError = action => {
22236
- const {
22237
- errorCallback,
22238
- namespace,
22239
- api,
22240
- layoutMode
22241
- } = selectConfig(getState());
22242
- errorCallback === null || errorCallback === void 0 ? void 0 : errorCallback(action.error, {
22243
- namespace,
22244
- api,
22245
- layoutMode,
22246
- conversationUrl: seamlyApi.getConversationUrl(),
22247
- action: action.type ? action : undefined
22248
- });
22249
- };
22250
-
22251
- return next => action => {
22252
- try {
22253
- if (action.error) {
22254
- handleError(action);
22255
- }
22256
-
22257
- return next(action);
22258
- } catch (error) {
22259
- handleError({
22260
- error
22261
- });
22262
- throw error;
22263
- }
22264
- };
22265
- };
22266
- }
22267
22240
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/core/seamly-instance-functions-loader.js
22268
22241
 
22269
22242
 
@@ -23138,6 +23111,53 @@ const SeamlyFileUpload = ({
23138
23111
  };
23139
23112
 
23140
23113
  /* harmony default export */ const seamly_file_upload = (SeamlyFileUpload);
23114
+ ;// CONCATENATED MODULE: ./src/javascripts/domains/errors/index.js
23115
+
23116
+
23117
+ const {
23118
+ createAction: errors_createAction
23119
+ } = createDomain('errors');
23120
+ const catchError = errors_createAction('catch-error', error => ({
23121
+ error
23122
+ }));
23123
+ function errors_createMiddleware({
23124
+ api: seamlyApi
23125
+ }) {
23126
+ return ({
23127
+ getState
23128
+ }) => {
23129
+ const handleError = action => {
23130
+ const {
23131
+ errorCallback,
23132
+ namespace,
23133
+ api,
23134
+ layoutMode
23135
+ } = selectConfig(getState());
23136
+ errorCallback === null || errorCallback === void 0 ? void 0 : errorCallback(action.error, {
23137
+ namespace,
23138
+ api,
23139
+ layoutMode,
23140
+ conversationUrl: seamlyApi.getConversationUrl(),
23141
+ action: action.type ? action : undefined
23142
+ });
23143
+ };
23144
+
23145
+ return next => action => {
23146
+ try {
23147
+ if (action.error) {
23148
+ handleError(action);
23149
+ }
23150
+
23151
+ return next(action);
23152
+ } catch (error) {
23153
+ handleError({
23154
+ error
23155
+ });
23156
+ throw error;
23157
+ }
23158
+ };
23159
+ };
23160
+ }
23141
23161
  ;// CONCATENATED MODULE: ./src/javascripts/ui/components/core/seamly-core.js
23142
23162
 
23143
23163
 
@@ -23242,34 +23262,6 @@ function objectStore(key, storageProvider) {
23242
23262
 
23243
23263
  };
23244
23264
  }
23245
- ;// CONCATENATED MODULE: ./src/javascripts/lib/store/providers/session-storage.js
23246
- function store(key) {
23247
- const KEY = 'cvco.' + key;
23248
- return {
23249
- get() {
23250
- const candidates = [KEY, KEY.split('.').slice(0, -1).join('.')];
23251
- let val;
23252
-
23253
- do {
23254
- val = sessionStorage.getItem(candidates[0]);
23255
- } while (candidates.shift() && !val);
23256
-
23257
- return JSON.parse(val);
23258
- },
23259
-
23260
- set(value) {
23261
- if (!value) {
23262
- return;
23263
- }
23264
-
23265
- sessionStorage.setItem(KEY, JSON.stringify(value));
23266
- }
23267
-
23268
- };
23269
- }
23270
- // EXTERNAL MODULE: ./src/javascripts/lib/debug.js
23271
- var debug = __webpack_require__(905);
23272
- var debug_default = /*#__PURE__*/__webpack_require__.n(debug);
23273
23265
  ;// CONCATENATED MODULE: ./node_modules/phoenix/priv/static/phoenix.esm.js
23274
23266
  // js/phoenix/utils.js
23275
23267
  var closure = value => {
@@ -24664,6 +24656,9 @@ const splitUrlParams = url => {
24664
24656
  };
24665
24657
 
24666
24658
  /* harmony default export */ const split_url_params = (splitUrlParams);
24659
+ // EXTERNAL MODULE: ./src/javascripts/lib/debug.js
24660
+ var debug = __webpack_require__(905);
24661
+ var debug_default = /*#__PURE__*/__webpack_require__.n(debug);
24667
24662
  ;// CONCATENATED MODULE: ./src/javascripts/api/producer.js
24668
24663
  function producer_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
24669
24664
 
@@ -24826,6 +24821,31 @@ class ConversationProducer {
24826
24821
  }
24827
24822
 
24828
24823
  }
24824
+ ;// CONCATENATED MODULE: ./src/javascripts/lib/store/providers/session-storage.js
24825
+ function store(key) {
24826
+ const KEY = 'cvco.' + key;
24827
+ return {
24828
+ get() {
24829
+ const candidates = [KEY, KEY.split('.').slice(0, -1).join('.')];
24830
+ let val;
24831
+
24832
+ do {
24833
+ val = sessionStorage.getItem(candidates[0]);
24834
+ } while (candidates.shift() && !val);
24835
+
24836
+ return JSON.parse(val);
24837
+ },
24838
+
24839
+ set(value) {
24840
+ if (!value) {
24841
+ return;
24842
+ }
24843
+
24844
+ sessionStorage.setItem(KEY, JSON.stringify(value));
24845
+ }
24846
+
24847
+ };
24848
+ }
24829
24849
  ;// CONCATENATED MODULE: ./src/javascripts/api/event-producer.js
24830
24850
  class EventProducer {
24831
24851
  constructor(name) {
@@ -24936,10 +24956,11 @@ class API {
24936
24956
  * @param {boolean} config.sendEnvironment
24937
24957
  * @param {string} layoutMode
24938
24958
  * @param {string} namespace
24939
- * @param {Object} [context={ channelName: undefined, variables: undefined, locale: undefined }]
24959
+ * @param {Object} [context={ channelName: undefined, variables: undefined, locale: undefined, translationLocale: undefined }]
24940
24960
  * @param {string} context.channelName
24941
24961
  * @param {object} context.variables
24942
24962
  * @param {string} context.locale
24963
+ * @param {string} context.translationLocale
24943
24964
  * @memberof API
24944
24965
  */
24945
24966
  constructor({
@@ -25303,9 +25324,9 @@ class API {
25303
25324
 
25304
25325
  getEnvironment() {
25305
25326
  return {
25306
- clientName: PACKAGE_NAME,
25327
+ clientName: "@seamly/web-ui",
25307
25328
  clientVariant: this.layoutMode,
25308
- clientVersion: PACKAGE_VERSION,
25329
+ clientVersion: "20.2.0-alpha.3",
25309
25330
  currentUrl: window.location.toString(),
25310
25331
  screenResolution: `${window.screen.width}x${window.screen.height}`,
25311
25332
  timezone: getTimeZone(),
@@ -25622,6 +25643,7 @@ class ExternalApi {
25622
25643
  this._waitingActions = [];
25623
25644
  this._instances = {};
25624
25645
  this.appConfig = appConfig;
25646
+ this.context = {};
25625
25647
  }
25626
25648
 
25627
25649
  push(...actionObjects) {
@@ -25649,7 +25671,8 @@ class ExternalApi {
25649
25671
  break;
25650
25672
 
25651
25673
  default:
25652
- if (!this.handleAction(actionObj)) {
25674
+ if (!this.handleAction(actionObj) && // Store context properties for the next instance that will be created
25675
+ !this.setContext(actionObj.action, ...actionObj.args)) {
25653
25676
  this._waitingActions.push(actionObj);
25654
25677
  }
25655
25678
 
@@ -25658,6 +25681,25 @@ class ExternalApi {
25658
25681
  });
25659
25682
  }
25660
25683
 
25684
+ setContext(action, args) {
25685
+ switch (action) {
25686
+ case 'setTranslation':
25687
+ const {
25688
+ enabled,
25689
+ locale
25690
+ } = args;
25691
+
25692
+ if (!!enabled && locale) {
25693
+ this.context.translationLocale = locale;
25694
+ }
25695
+
25696
+ return true;
25697
+
25698
+ default:
25699
+ return false;
25700
+ }
25701
+ }
25702
+
25661
25703
  handleInit(actionObj) {
25662
25704
  const userConfig = this.getUserConfig(...actionObj.args);
25663
25705
  const config = this.getCombinedConfig(userConfig); // if this.appConfig is a function, it might return an invalid configuration (false, null, undefined)
@@ -25679,7 +25721,9 @@ class ExternalApi {
25679
25721
 
25680
25722
  if (config) {
25681
25723
  const instance = this.createInstance(config);
25682
- this._instances[config.namespace] = instance;
25724
+ this._instances[config.namespace] = instance; // Clear the context after creating the instance, so we do not reuse it for the next
25725
+
25726
+ this.context = {};
25683
25727
  instance.render();
25684
25728
  }
25685
25729
  }
@@ -25743,10 +25787,13 @@ class ExternalApi {
25743
25787
  return this.appConfig(userConfig);
25744
25788
  }
25745
25789
 
25790
+ const context = external_api_objectSpread(external_api_objectSpread({}, userConfig.context || this.appConfig.context), this.context);
25791
+
25746
25792
  const defaults = external_api_objectSpread(external_api_objectSpread({}, this.appConfig.defaults), userConfig.defaults);
25747
25793
 
25748
25794
  return external_api_objectSpread(external_api_objectSpread(external_api_objectSpread({}, this.appConfig), userConfig), {}, {
25749
25795
  api: external_api_objectSpread(external_api_objectSpread({}, this.appConfig.api), userConfig.api),
25796
+ context: Object.keys(context).length ? context : undefined,
25750
25797
  defaults: Object.keys(defaults).length ? defaults : undefined
25751
25798
  });
25752
25799
  }