@seamly/web-ui 20.3.0 → 20.3.1

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.
@@ -7332,7 +7332,7 @@ function createAction(type, identityReducer = payload => ({
7332
7332
 
7333
7333
  action.toString = () => String(type);
7334
7334
 
7335
- action.match = obj => (obj === null || obj === void 0 ? void 0 : obj.type) === String(type);
7335
+ action.match = obj => obj?.type === String(type);
7336
7336
 
7337
7337
  return action;
7338
7338
  }
@@ -7422,7 +7422,7 @@ function createThunk(type, payloadCreator) {
7422
7422
  }
7423
7423
  function createReducer(domain, handlers = {}, defaultState) {
7424
7424
  const reducer = (state = defaultState, action) => {
7425
- const typeReducer = handlers === null || handlers === void 0 ? void 0 : handlers[action === null || action === void 0 ? void 0 : action.type];
7425
+ const typeReducer = handlers?.[action?.type];
7426
7426
  return typeReducer ? typeReducer(state, action) : state;
7427
7427
  };
7428
7428
 
@@ -7757,7 +7757,7 @@ function selectors_defineProperty(obj, key, value) { if (key in obj) { Object.de
7757
7757
 
7758
7758
  const selectConfig = createSelector(selectState, config => {
7759
7759
  let newConfig = selectors_objectSpread({
7760
- visible: (config === null || config === void 0 ? void 0 : config.layoutMode) === 'inline' ? visibilityStates.open : visibilityStates.minimized,
7760
+ visible: config?.layoutMode === 'inline' ? visibilityStates.open : visibilityStates.minimized,
7761
7761
  appContainerClassNames: config.appContainerClassNames || []
7762
7762
  }, config);
7763
7763
 
@@ -8594,8 +8594,6 @@ function hooks_useSelector(selector, deps = []) {
8594
8594
  (0,hooks_namespaceObject.useLayoutEffect)(() => {
8595
8595
  // we subscribe to the store changes
8596
8596
  return store.subscribe(() => {
8597
- var _selectorRef$current;
8598
-
8599
8597
  const newState = store.getState(); // prevent recalculating if the state hasn't changed
8600
8598
  // if the selector changed, it was already handled synchronously
8601
8599
 
@@ -8604,7 +8602,7 @@ function hooks_useSelector(selector, deps = []) {
8604
8602
  } // calculate the new value based on selector+state
8605
8603
 
8606
8604
 
8607
- const newValue = (_selectorRef$current = selectorRef.current) === null || _selectorRef$current === void 0 ? void 0 : _selectorRef$current.call(selectorRef, store.getState()); // only if the value changed we update. this saves heaps of re-rendering
8605
+ const newValue = selectorRef.current?.(store.getState()); // only if the value changed we update. this saves heaps of re-rendering
8608
8606
 
8609
8607
  if (newValue !== valueRef.current) {
8610
8608
  valueRef.current = newValue;
@@ -9743,9 +9741,7 @@ const selectEventsWithSuggestion = createSelector(seamly_state_hooks_selectState
9743
9741
  events,
9744
9742
  serviceData
9745
9743
  }, config, userHasResponded) => {
9746
- var _serviceData$suggesti;
9747
-
9748
- if (userHasResponded || config.layoutMode === 'inline' || !serviceData.suggestion || !((_serviceData$suggesti = serviceData.suggestion) !== null && _serviceData$suggesti !== void 0 && _serviceData$suggesti.body.length)) {
9744
+ if (userHasResponded || config.layoutMode === 'inline' || !serviceData.suggestion || !serviceData.suggestion?.body.length) {
9749
9745
  return events;
9750
9746
  }
9751
9747
 
@@ -9756,12 +9752,10 @@ const selectEventsWithSuggestion = createSelector(seamly_state_hooks_selectState
9756
9752
  return [...events, suggestionsEvent];
9757
9753
  });
9758
9754
  const selectEvents = createSelector(selectEventsWithSuggestion, selectConfig, (events, config) => {
9759
- var _config$messages;
9760
-
9761
9755
  const {
9762
9756
  enabled,
9763
9757
  threshold
9764
- } = (config === null || config === void 0 ? void 0 : (_config$messages = config.messages) === null || _config$messages === void 0 ? void 0 : _config$messages.timeIndicator) ?? {};
9758
+ } = config?.messages?.timeIndicator ?? {};
9765
9759
 
9766
9760
  if (!enabled) {
9767
9761
  return events;
@@ -9794,10 +9788,8 @@ const useSkiplink = () => useSeamlyStateContext().skiplinkTargetId;
9794
9788
  const useSeamlyParticipant = participantId => useSeamlyStateContext().participantInfo.participants[participantId];
9795
9789
  const useSeamlyServiceInfo = () => useSeamlyStateContext().serviceInfo;
9796
9790
  const selectLastMessageEventId = createSelector(selectEvents, events => {
9797
- var _filteredEvents;
9798
-
9799
9791
  const filteredEvents = events.filter(event => event.type === 'message');
9800
- return (_filteredEvents = filteredEvents[filteredEvents.length - 1]) === null || _filteredEvents === void 0 ? void 0 : _filteredEvents.payload.id;
9792
+ return filteredEvents[filteredEvents.length - 1]?.payload.id;
9801
9793
  });
9802
9794
  const useLastMessageEventId = () => hooks_useSelector(selectLastMessageEventId);
9803
9795
  const useSeamlyIsHistoryLoaded = () => useSeamlyStateContext().historyLoaded;
@@ -9954,13 +9946,11 @@ const actions_initialize = visibility_utils_createThunk('initialize', async (loc
9954
9946
  api
9955
9947
  }
9956
9948
  }) => {
9957
- var _api$store$get;
9958
-
9959
9949
  // initialize stored visibility
9960
9950
  const {
9961
9951
  layoutMode
9962
9952
  } = selectConfig(getState());
9963
- const storedVisibility = (_api$store$get = api.store.get(StoreKey)) === null || _api$store$get === void 0 ? void 0 : _api$store$get[layoutMode];
9953
+ const storedVisibility = api.store.get(StoreKey)?.[layoutMode];
9964
9954
 
9965
9955
  if (storedVisibility) {
9966
9956
  dispatch(setFromStorage(storedVisibility));
@@ -9998,13 +9988,13 @@ class SeamlyBaseError extends Error {
9998
9988
 
9999
9989
  this.originalError = originalError;
10000
9990
 
10001
- if (originalError !== null && originalError !== void 0 && originalError.payload) {
9991
+ if (originalError?.payload) {
10002
9992
  this.originalEvent = originalError;
10003
9993
  this.originalError = originalError.payload.error;
10004
9994
  this.message = `Event of type ${originalError.payload.type} encountered`;
10005
9995
  }
10006
9996
 
10007
- if (originalError !== null && originalError !== void 0 && originalError.error) {
9997
+ if (originalError?.error) {
10008
9998
  this.originalError = originalError.error;
10009
9999
  }
10010
10000
  }
@@ -10053,10 +10043,8 @@ const app_actions_initialize = app_utils_createThunk('initialize', async (_, {
10053
10043
  config
10054
10044
  }
10055
10045
  }) => {
10056
- var _config$context;
10057
-
10058
10046
  dispatch(initialize(config));
10059
- let locale = config === null || config === void 0 ? void 0 : (_config$context = config.context) === null || _config$context === void 0 ? void 0 : _config$context.locale;
10047
+ let locale = config?.context?.locale;
10060
10048
 
10061
10049
  try {
10062
10050
  const {
@@ -10083,7 +10071,7 @@ const app_actions_initialize = app_utils_createThunk('initialize', async (_, {
10083
10071
  startChatIcon
10084
10072
  }));
10085
10073
 
10086
- if (agentParticipant !== null && agentParticipant !== void 0 && agentParticipant.name) {
10074
+ if (agentParticipant?.name) {
10087
10075
  dispatch({
10088
10076
  type: seamlyActions.SET_HEADER_SUB_TITLE,
10089
10077
  title: agentParticipant.name
@@ -10095,22 +10083,18 @@ const app_actions_initialize = app_utils_createThunk('initialize', async (_, {
10095
10083
 
10096
10084
  try {
10097
10085
  if (api.hasConversation()) {
10098
- var _initialState$transla;
10099
-
10100
10086
  const initialState = await api.getConversationIntitialState();
10101
10087
  dispatch({
10102
10088
  type: seamlyActions.SET_INITIAL_STATE,
10103
10089
  initialState
10104
10090
  });
10105
- locale = ((_initialState$transla = initialState.translation) === null || _initialState$transla === void 0 ? void 0 : _initialState$transla.locale) || locale;
10091
+ locale = initialState.translation?.locale || locale;
10106
10092
 
10107
10093
  if ('userResponded' in initialState) {
10108
10094
  dispatch(setHasResponded(initialState.userResponded));
10109
10095
  }
10110
10096
  } else {
10111
- var _config$context2, _config$context3;
10112
-
10113
- if (config !== null && config !== void 0 && (_config$context2 = config.context) !== null && _config$context2 !== void 0 && _config$context2.topic) {
10097
+ if (config?.context?.topic) {
10114
10098
  api.send('action', {
10115
10099
  type: actionTypes.setTopic,
10116
10100
  body: {
@@ -10122,7 +10106,7 @@ const app_actions_initialize = app_utils_createThunk('initialize', async (_, {
10122
10106
  });
10123
10107
  }
10124
10108
 
10125
- if (config !== null && config !== void 0 && (_config$context3 = config.context) !== null && _config$context3 !== void 0 && _config$context3.translationLocale) {
10109
+ if (config?.context?.translationLocale) {
10126
10110
  locale = config.context.translationLocale;
10127
10111
  api.send('action', {
10128
10112
  type: actionTypes.setTranslation,
@@ -12425,21 +12409,19 @@ function useTranslations() {
12425
12409
  function useTranslatedEventData({
12426
12410
  payload
12427
12411
  } = {}) {
12428
- var _translatedBody, _translatedBody2, _translatedBody3;
12429
-
12430
- const payloadId = payload === null || payload === void 0 ? void 0 : payload.id;
12412
+ const payloadId = payload?.id;
12431
12413
  let body;
12432
12414
  let translatedBody;
12433
12415
 
12434
- switch (payload === null || payload === void 0 ? void 0 : payload.type) {
12416
+ switch (payload?.type) {
12435
12417
  case 'participant':
12436
12418
  body = payload.participant.introduction;
12437
12419
  translatedBody = payload.participant.translatedIntroduction;
12438
12420
  break;
12439
12421
 
12440
12422
  default:
12441
- body = payload === null || payload === void 0 ? void 0 : payload.body;
12442
- translatedBody = payload === null || payload === void 0 ? void 0 : payload.translatedBody;
12423
+ body = payload?.body;
12424
+ translatedBody = payload?.translatedBody;
12443
12425
  }
12444
12426
 
12445
12427
  const hasTranslation = !!translatedBody;
@@ -12454,12 +12436,12 @@ function useTranslatedEventData({
12454
12436
  dispatch(enableEvent(payloadId));
12455
12437
  }
12456
12438
  }, [isTranslated, payloadId, dispatch]);
12457
- return [hasTranslation && isTranslated ? (_translatedBody = translatedBody) === null || _translatedBody === void 0 ? void 0 : _translatedBody.data : body, {
12439
+ return [hasTranslation && isTranslated ? translatedBody?.data : body, {
12458
12440
  hasTranslation,
12459
12441
  isTranslated: isTranslated && hasTranslation,
12460
12442
  toggleTranslation,
12461
- translatedBy: (_translatedBody2 = translatedBody) === null || _translatedBody2 === void 0 ? void 0 : _translatedBody2.translatedBy,
12462
- locale: (_translatedBody3 = translatedBody) === null || _translatedBody3 === void 0 ? void 0 : _translatedBody3.locale
12443
+ translatedBy: translatedBody?.translatedBy,
12444
+ locale: translatedBody?.locale
12463
12445
  }];
12464
12446
  }
12465
12447
  function useTranslationsContainer() {
@@ -12474,11 +12456,7 @@ function useLocaleNativeName(locale) {
12474
12456
  const {
12475
12457
  languages
12476
12458
  } = useTranslations();
12477
- return (0,hooks_namespaceObject.useMemo)(() => {
12478
- var _languages$find;
12479
-
12480
- return languages === null || languages === void 0 ? void 0 : (_languages$find = languages.find(lang => lang.locale === locale)) === null || _languages$find === void 0 ? void 0 : _languages$find.nativeName;
12481
- }, [locale, languages]);
12459
+ return (0,hooks_namespaceObject.useMemo)(() => languages?.find(lang => lang.locale === locale)?.nativeName, [locale, languages]);
12482
12460
  }
12483
12461
  ;// CONCATENATED MODULE: ./src/javascripts/domains/translations/middleware.js
12484
12462
 
@@ -12489,20 +12467,18 @@ function middleware_createMiddleware() {
12489
12467
  dispatch,
12490
12468
  getState
12491
12469
  }) => next => action => {
12492
- var _action$history, _action$history$trans, _action$initialState, _action$initialState$, _action$event, _action$event$payload, _action$event$payload2;
12493
-
12494
12470
  const result = next(action);
12495
12471
 
12496
12472
  switch (action.type) {
12497
12473
  case String(seamlyActions.SET_HISTORY):
12498
- if ((_action$history = action.history) !== null && _action$history !== void 0 && (_action$history$trans = _action$history.translation) !== null && _action$history$trans !== void 0 && _action$history$trans.enabled) {
12474
+ if (action.history?.translation?.enabled) {
12499
12475
  dispatch(enable(action.history.translation.locale));
12500
12476
  }
12501
12477
 
12502
12478
  break;
12503
12479
 
12504
12480
  case String(seamlyActions.SET_INITIAL_STATE):
12505
- if ((_action$initialState = action.initialState) !== null && _action$initialState !== void 0 && (_action$initialState$ = _action$initialState.translation) !== null && _action$initialState$ !== void 0 && _action$initialState$.enabled) {
12481
+ if (action.initialState?.translation?.enabled) {
12506
12482
  dispatch(enable(action.initialState.translation.locale));
12507
12483
  dispatch(setLocale(action.locale));
12508
12484
  }
@@ -12510,7 +12486,7 @@ function middleware_createMiddleware() {
12510
12486
  break;
12511
12487
 
12512
12488
  case String(seamlyActions.ADD_EVENT):
12513
- if (action.event.type === 'info' && ((_action$event = action.event) === null || _action$event === void 0 ? void 0 : (_action$event$payload = _action$event.payload) === null || _action$event$payload === void 0 ? void 0 : (_action$event$payload2 = _action$event$payload.body) === null || _action$event$payload2 === void 0 ? void 0 : _action$event$payload2.subtype) === 'new_translation' && action.event.payload.body.translationEnabled) {
12489
+ if (action.event.type === 'info' && action.event?.payload?.body?.subtype === 'new_translation' && action.event.payload.body.translationEnabled) {
12514
12490
  dispatch(setLocale(action.event.payload.body.translationLocale));
12515
12491
  }
12516
12492
 
@@ -12547,9 +12523,7 @@ const translations_reducer_initialState = {
12547
12523
  };
12548
12524
  /* harmony default export */ const translations_reducer = (translations_utils_createReducer({
12549
12525
  [seamlyActions.SET_FEATURES]: (state, action) => {
12550
- var _action$features;
12551
-
12552
- const feature = action === null || action === void 0 ? void 0 : (_action$features = action.features) === null || _action$features === void 0 ? void 0 : _action$features.translation;
12526
+ const feature = action?.features?.translation;
12553
12527
 
12554
12528
  if (!feature) {
12555
12529
  return state;
@@ -12902,9 +12876,7 @@ function validate(values, schema = {}) {
12902
12876
  validations = [validations];
12903
12877
  }
12904
12878
 
12905
- for (let i = 0; i < ((_validations = validations) === null || _validations === void 0 ? void 0 : _validations.length) ?? 0; i++) {
12906
- var _validations;
12907
-
12879
+ for (let i = 0; i < validations?.length ?? 0; i++) {
12908
12880
  if (!validations[i].fn(values[key], validations[i].compareValue)) {
12909
12881
  errors[key] = validations[i].errorText;
12910
12882
  break;
@@ -12951,7 +12923,7 @@ const [registerControl, deregisterControl, actions_updateControlValue, actions_u
12951
12923
 
12952
12924
  const selectors_getState = forms_utils_selectState;
12953
12925
  const getFormById = createSelector(selectors_getState, getPropSelector('formId'), (forms, formId) => forms[formId]);
12954
- const getFormControlsByFormId = createSelector(getFormById, form => (form === null || form === void 0 ? void 0 : form.controls) || {});
12926
+ const getFormControlsByFormId = createSelector(getFormById, form => form?.controls || {});
12955
12927
  const getFormValuesByFormId = createSelector(getFormControlsByFormId, controls => {
12956
12928
  const valuesObj = {};
12957
12929
  Object.entries(controls).forEach(([key, {
@@ -12961,16 +12933,8 @@ const getFormValuesByFormId = createSelector(getFormControlsByFormId, controls =
12961
12933
  });
12962
12934
  return valuesObj;
12963
12935
  });
12964
- const getControlValueByName = createSelector(getFormControlsByFormId, getPropSelector('name'), (controls, name) => {
12965
- var _controls$name;
12966
-
12967
- return (_controls$name = controls[name]) === null || _controls$name === void 0 ? void 0 : _controls$name.value;
12968
- });
12969
- const getControlTouchedByName = createSelector(getFormControlsByFormId, getPropSelector('name'), (controls, name) => {
12970
- var _controls$name2;
12971
-
12972
- return (_controls$name2 = controls[name]) === null || _controls$name2 === void 0 ? void 0 : _controls$name2.touched;
12973
- });
12936
+ const getControlValueByName = createSelector(getFormControlsByFormId, getPropSelector('name'), (controls, name) => controls[name]?.value);
12937
+ const getControlTouchedByName = createSelector(getFormControlsByFormId, getPropSelector('name'), (controls, name) => controls[name]?.touched);
12974
12938
  ;// CONCATENATED MODULE: ./src/javascripts/domains/forms/context.js
12975
12939
 
12976
12940
  const FormContext = (0,external_preact_namespaceObject.createContext)({});
@@ -13030,7 +12994,7 @@ function useFormControl(name) {
13030
12994
  formId,
13031
12995
  name
13032
12996
  }, [formId, name]);
13033
- const error = errors === null || errors === void 0 ? void 0 : errors[name];
12997
+ const error = errors?.[name];
13034
12998
  const isValid = !error;
13035
12999
  (0,hooks_namespaceObject.useEffect)(() => {
13036
13000
  // Make sure the form is registered
@@ -13131,11 +13095,9 @@ function FormProvider(_ref) {
13131
13095
  });
13132
13096
  }, [setExternalErrors]);
13133
13097
  const handleSubmit = (0,hooks_namespaceObject.useCallback)(e => {
13134
- var _e$submitter;
13135
-
13136
13098
  e.preventDefault(); // If the submitter is set to being aria-disabled, block the submit action
13137
13099
 
13138
- const ariaDisabled = ((_e$submitter = e.submitter) === null || _e$submitter === void 0 ? void 0 : _e$submitter.ariaDisabled) === 'true';
13100
+ const ariaDisabled = e.submitter?.ariaDisabled === 'true';
13139
13101
  setIsSubmitted(!ariaDisabled);
13140
13102
 
13141
13103
  if (!ariaDisabled && validationIsValid) {
@@ -13202,9 +13164,7 @@ const initialControlState = {
13202
13164
  };
13203
13165
 
13204
13166
  function updateFormControl(state, formId, name, controlState) {
13205
- var _state$formId;
13206
-
13207
- const currentControlState = ((_state$formId = state[formId]) === null || _state$formId === void 0 ? void 0 : _state$formId.controls[name]) || initialControlState;
13167
+ const currentControlState = state[formId]?.controls[name] || initialControlState;
13208
13168
  return forms_reducer_objectSpread(forms_reducer_objectSpread({}, state), {}, {
13209
13169
  [formId]: forms_reducer_objectSpread(forms_reducer_objectSpread({}, state[formId]), {}, {
13210
13170
  controls: forms_reducer_objectSpread(forms_reducer_objectSpread({}, state[formId].controls), {}, {
@@ -13232,11 +13192,9 @@ function updateFormControl(state, formId, name, controlState) {
13232
13192
  [deregisterForm]: (state, {
13233
13193
  formId
13234
13194
  }) => {
13235
- var _newState$formId;
13236
-
13237
13195
  const newState = forms_reducer_objectSpread({}, state);
13238
13196
 
13239
- if (!((_newState$formId = newState[formId]) !== null && _newState$formId !== void 0 && _newState$formId.persistData)) {
13197
+ if (!newState[formId]?.persistData) {
13240
13198
  delete newState[formId];
13241
13199
  }
13242
13200
 
@@ -13467,7 +13425,7 @@ const validateFileSize = (fileList, maxSize) => {
13467
13425
 
13468
13426
  return isValid;
13469
13427
  };
13470
- const fileListObjectIsNotEmpty = fileListObj => !!(fileListObj !== null && fileListObj !== void 0 && fileListObj.length) > 0;
13428
+ const fileListObjectIsNotEmpty = fileListObj => !!fileListObj?.length > 0;
13471
13429
  /* eslint-disable no-control-regex */
13472
13430
 
13473
13431
  const isEmailString = val => {
@@ -14466,13 +14424,11 @@ const timeFormatOptions = {
14466
14424
  minute: 'numeric'
14467
14425
  };
14468
14426
  const useFormattedDate = date => {
14469
- var _config$context;
14470
-
14471
14427
  const {
14472
14428
  t
14473
14429
  } = useI18n();
14474
14430
  const config = useConfig();
14475
- const locale = (config === null || config === void 0 ? void 0 : (_config$context = config.context) === null || _config$context === void 0 ? void 0 : _config$context.locale) ?? [];
14431
+ const locale = config?.context?.locale ?? [];
14476
14432
  const eventDate = new Date(date);
14477
14433
  const currentDate = new Date();
14478
14434
  const midnight = new Date(currentDate);
@@ -14844,11 +14800,9 @@ const useChoicePrompt = event => {
14844
14800
  service
14845
14801
  } = payload;
14846
14802
  const subEvent = (0,hooks_namespaceObject.useMemo)(() => {
14847
- var _event$payload$body;
14848
-
14849
14803
  return choice_prompt_objectSpread(choice_prompt_objectSpread({}, event), {}, {
14850
14804
  payload: choice_prompt_objectSpread(choice_prompt_objectSpread({}, event.payload), {}, {
14851
- body: (_event$payload$body = event.payload.body) === null || _event$payload$body === void 0 ? void 0 : _event$payload$body.prompt,
14805
+ body: event.payload.body?.prompt,
14852
14806
  translatedBody: event.payload.translatedBody && choice_prompt_objectSpread(choice_prompt_objectSpread({}, event.payload.translatedBody), {}, {
14853
14807
  data: event.payload.translatedBody.data.prompt
14854
14808
  })
@@ -22470,11 +22424,7 @@ const OptionsButton = () => {
22470
22424
  const prevMenuIsOpen = (0,hooks_namespaceObject.useRef)(false);
22471
22425
  const multiMenu = optionsLength > 1;
22472
22426
  const firstOption = menuOptions[0];
22473
- const firstOptionName = (0,hooks_namespaceObject.useMemo)(() => {
22474
- var _firstOption$name;
22475
-
22476
- return firstOption === null || firstOption === void 0 ? void 0 : (_firstOption$name = firstOption.name) === null || _firstOption$name === void 0 ? void 0 : _firstOption$name.trim().replace(/\s+/g, '');
22477
- }, [firstOption]);
22427
+ const firstOptionName = (0,hooks_namespaceObject.useMemo)(() => firstOption?.name?.trim().replace(/\s+/g, ''), [firstOption]);
22478
22428
  (0,hooks_namespaceObject.useEffect)(() => {
22479
22429
  return () => {
22480
22430
  clearTimeout(focusOutDelayTimeoutID.current);
@@ -23051,7 +23001,9 @@ const ViewComponentsMap = {
23051
23001
  window: window_view
23052
23002
  };
23053
23003
 
23054
- const View = () => {
23004
+ const View = ({
23005
+ children
23006
+ }) => {
23055
23007
  const [, setSeamlyContainerElement] = useSeamlyContainerElement();
23056
23008
  const {
23057
23009
  namespace,
@@ -23108,7 +23060,7 @@ const View = () => {
23108
23060
  zIndex
23109
23061
  },
23110
23062
  ref: containerElementRef,
23111
- children: (0,jsx_runtime_namespaceObject.jsx)(ViewComponent, {})
23063
+ children: children || (0,jsx_runtime_namespaceObject.jsx)(ViewComponent, {})
23112
23064
  });
23113
23065
  };
23114
23066
 
@@ -23135,7 +23087,7 @@ function errors_createMiddleware({
23135
23087
  api,
23136
23088
  layoutMode
23137
23089
  } = selectConfig(getState());
23138
- errorCallback === null || errorCallback === void 0 ? void 0 : errorCallback(action.error, {
23090
+ errorCallback?.(action.error, {
23139
23091
  namespace,
23140
23092
  api,
23141
23093
  layoutMode,
@@ -23179,11 +23131,7 @@ function useSeamlyInstanceFunction(functionName, fn, deps = []) {
23179
23131
  return undefined;
23180
23132
  }
23181
23133
 
23182
- const callback = (...args) => {
23183
- var _callbackRef$current;
23184
-
23185
- return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
23186
- };
23134
+ const callback = (...args) => callbackRef.current?.(...args);
23187
23135
 
23188
23136
  eventBus.emit('function.register', functionName, callback);
23189
23137
  return () => eventBus.emit('function.unregister', functionName, callback); // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -23228,12 +23176,12 @@ const SeamlyInstanceFunctionsLoader = () => {
23228
23176
  sendMessage({
23229
23177
  body: text
23230
23178
  });
23231
- }, [api === null || api === void 0 ? void 0 : api.send]);
23179
+ }, [api?.send]);
23232
23180
  useSeamlyInstanceFunction('setVariables', variables => {
23233
23181
  sendContext({
23234
23182
  variables
23235
23183
  });
23236
- }, [api === null || api === void 0 ? void 0 : api.send]);
23184
+ }, [api?.send]);
23237
23185
  useSeamlyInstanceFunction('getVisibility', callback => {
23238
23186
  if (callback) {
23239
23187
  callback(currentVisibility.current);
@@ -23249,7 +23197,7 @@ const SeamlyInstanceFunctionsLoader = () => {
23249
23197
 
23250
23198
  onActivityHandler();
23251
23199
  setVisibility(visibilityState);
23252
- }, [config === null || config === void 0 ? void 0 : config.api]);
23200
+ }, [config?.api]);
23253
23201
  useSeamlyInstanceFunction('sendCustomAction', (actionType, body) => {
23254
23202
  sendAction({
23255
23203
  type: 'custom',
@@ -26204,7 +26152,7 @@ class API {
26204
26152
  return {
26205
26153
  clientName: "@seamly/web-ui",
26206
26154
  clientVariant: this.layoutMode,
26207
- clientVersion: "20.3.0",
26155
+ clientVersion: "20.3.1",
26208
26156
  currentUrl: window.location.toString(),
26209
26157
  screenResolution: `${window.screen.width}x${window.screen.height}`,
26210
26158
  timezone: getTimeZone(),
@@ -26712,9 +26660,7 @@ class ExternalApi {
26712
26660
  }
26713
26661
 
26714
26662
  getMergedVariables(userConfig) {
26715
- var _this$appConfig$conte, _userConfig$context;
26716
-
26717
- return external_api_objectSpread(external_api_objectSpread(external_api_objectSpread({}, ((_this$appConfig$conte = this.appConfig.context) === null || _this$appConfig$conte === void 0 ? void 0 : _this$appConfig$conte.variables) || {}), ((_userConfig$context = userConfig.context) === null || _userConfig$context === void 0 ? void 0 : _userConfig$context.variables) || {}), this.context.variables || {});
26663
+ return external_api_objectSpread(external_api_objectSpread(external_api_objectSpread({}, this.appConfig.context?.variables || {}), userConfig.context?.variables || {}), this.context.variables || {});
26718
26664
  }
26719
26665
 
26720
26666
  }
@@ -26762,7 +26708,7 @@ const AgentInfo = () => {
26762
26708
  hasInterrupt
26763
26709
  } = useInterrupt();
26764
26710
  const startChatIcon = useStartChatIcon();
26765
- const src = (currentAgent === null || currentAgent === void 0 ? void 0 : currentAgent.avatar) ?? startChatIcon;
26711
+ const src = currentAgent?.avatar ?? startChatIcon;
26766
26712
  const displaySubtitle = hasInterrupt ? '' : subTitle;
26767
26713
  const classNames = ['message-count'];
26768
26714
 
@@ -26779,7 +26725,7 @@ const AgentInfo = () => {
26779
26725
  children: [(0,jsx_runtime_namespaceObject.jsxs)("div", {
26780
26726
  className: css_className('agent-info__graphic'),
26781
26727
  children: [src ? (0,jsx_runtime_namespaceObject.jsx)("img", {
26782
- className: css_className(currentAgent !== null && currentAgent !== void 0 && currentAgent.avatar ? 'avatar' : 'icon'),
26728
+ className: css_className(currentAgent?.avatar ? 'avatar' : 'icon'),
26783
26729
  src: src,
26784
26730
  alt: ""
26785
26731
  }) : (0,jsx_runtime_namespaceObject.jsx)(icon, {
@@ -27319,6 +27265,7 @@ const DeprecatedView = () => {
27319
27265
  // Used by: Client
27320
27266
 
27321
27267
  // Used by: StyleGuide
27268
+ // Used by: Client (with custom view)
27322
27269
 
27323
27270
  // Used by: Client
27324
27271