@seamly/web-ui 20.0.0-beta.6 → 20.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/dist/lib/deprecated-view.css +1 -1
- package/build/dist/lib/index.debug.js +138 -149
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.debug.min.js.LICENSE.txt +0 -4
- package/build/dist/lib/index.js +669 -655
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/standalone.js +702 -688
- package/build/dist/lib/standalone.min.js +1 -1
- package/build/dist/lib/style-guide.js +7288 -7266
- package/build/dist/lib/style-guide.min.js +1 -1
- package/build/dist/lib/styles-default-implementation.css +1 -1
- package/build/dist/lib/styles.css +1 -1
- package/package.json +1 -2
- package/src/javascripts/api/errors/seamly-base-error.js +1 -0
- package/src/javascripts/api/index.js +24 -19
- package/src/javascripts/api/producer.js +3 -3
- package/src/javascripts/domains/app/actions.js +30 -8
- package/src/javascripts/domains/app/hooks.js +1 -1
- package/src/javascripts/domains/app/utils.js +1 -1
- package/src/javascripts/domains/config/hooks.js +18 -1
- package/src/javascripts/domains/config/index.js +0 -1
- package/src/javascripts/domains/config/reducer.js +7 -3
- package/src/javascripts/domains/config/selectors.js +1 -1
- package/src/javascripts/domains/config/utils.js +1 -1
- package/src/javascripts/domains/errors/index.js +2 -2
- package/src/javascripts/domains/forms/hooks.js +1 -1
- package/src/javascripts/domains/forms/provider.js +5 -3
- package/src/javascripts/domains/forms/reducer.js +1 -1
- package/src/javascripts/domains/forms/selectors.js +1 -1
- package/src/javascripts/domains/forms/utils.js +1 -1
- package/src/javascripts/domains/i18n/actions.js +1 -1
- package/src/javascripts/domains/i18n/hooks.js +1 -1
- package/src/javascripts/domains/i18n/reducer.js +1 -1
- package/src/javascripts/domains/i18n/utils.js +1 -1
- package/src/javascripts/domains/interrupt/hooks.js +2 -2
- package/src/javascripts/domains/interrupt/middleware.js +6 -6
- package/src/javascripts/domains/interrupt/reducer.js +1 -1
- package/src/javascripts/domains/interrupt/utils.js +1 -1
- package/src/javascripts/domains/options/middleware.js +1 -1
- package/src/javascripts/domains/store/index.js +10 -14
- package/src/javascripts/domains/store/state-reducer.js +3 -3
- package/src/javascripts/domains/translations/components/chat-status.js +8 -5
- package/src/javascripts/domains/translations/components/options-button.js +6 -6
- package/src/javascripts/domains/translations/components/options-dialog/form.js +5 -5
- package/src/javascripts/domains/translations/components/options-dialog/index.js +10 -7
- package/src/javascripts/domains/translations/hooks.js +7 -3
- package/src/javascripts/domains/translations/middleware.js +5 -2
- package/src/javascripts/domains/translations/reducer.js +4 -4
- package/src/javascripts/domains/translations/selectors.js +1 -1
- package/src/javascripts/domains/translations/utils.js +1 -1
- package/src/javascripts/domains/visibility/actions.js +3 -3
- package/src/javascripts/domains/visibility/hooks.js +1 -1
- package/src/javascripts/domains/visibility/utils.js +1 -1
- package/src/javascripts/lib/css.js +1 -1
- package/src/javascripts/lib/engine/index.js +6 -5
- package/src/javascripts/lib/external-api/index.js +1 -1
- package/src/javascripts/lib/redux-helpers/index.js +1 -1
- package/src/javascripts/style-guide/components/app.js +9 -5
- package/src/javascripts/style-guide/components/links.js +6 -6
- package/src/javascripts/style-guide/components/static-core.js +27 -13
- package/src/javascripts/style-guide/components/view.js +16 -3
- package/src/javascripts/style-guide/states.js +23 -41
- package/src/javascripts/style-guide/style-guide-engine.js +13 -1
- package/src/javascripts/style-guide.js +2 -0
- package/src/javascripts/ui/components/app-options/index.js +4 -4
- package/src/javascripts/ui/components/chat-status/index.js +2 -2
- package/src/javascripts/ui/components/conversation/component-filter.js +1 -1
- package/src/javascripts/ui/components/conversation/conversation.js +6 -6
- package/src/javascripts/ui/components/conversation/event/card-component.js +4 -4
- package/src/javascripts/ui/components/conversation/event/card-message.js +3 -3
- package/src/javascripts/ui/components/conversation/event/carousel-component/components/controls.js +3 -3
- package/src/javascripts/ui/components/conversation/event/carousel-component/components/pagination.js +1 -1
- package/src/javascripts/ui/components/conversation/event/carousel-component/index.js +3 -3
- package/src/javascripts/ui/components/conversation/event/carousel-message/components/slide.js +3 -3
- package/src/javascripts/ui/components/conversation/event/carousel-message/index.js +3 -3
- package/src/javascripts/ui/components/conversation/event/choice-prompt.js +7 -7
- package/src/javascripts/ui/components/conversation/event/cta.js +6 -6
- package/src/javascripts/ui/components/conversation/event/divider/index.js +1 -1
- package/src/javascripts/ui/components/conversation/event/divider/variants/default.js +3 -3
- package/src/javascripts/ui/components/conversation/event/divider/variants/new-translation.js +4 -4
- package/src/javascripts/ui/components/conversation/event/divider/variants/time-indicator.js +5 -5
- package/src/javascripts/ui/components/conversation/event/event-participant.js +13 -10
- package/src/javascripts/ui/components/conversation/event/event.js +2 -2
- package/src/javascripts/ui/components/conversation/event/hooks/use-event-link-click-handler.js +2 -2
- package/src/javascripts/ui/components/conversation/event/hooks/use-formatted-date.js +3 -3
- package/src/javascripts/ui/components/conversation/event/image-lightbox.js +4 -4
- package/src/javascripts/ui/components/conversation/event/image.js +2 -2
- package/src/javascripts/ui/components/conversation/event/participant.js +6 -6
- package/src/javascripts/ui/components/conversation/event/text.js +3 -3
- package/src/javascripts/ui/components/conversation/event/translation.js +3 -3
- package/src/javascripts/ui/components/conversation/event/upload.js +18 -15
- package/src/javascripts/ui/components/conversation/event/video.js +4 -4
- package/src/javascripts/ui/components/conversation/event-divider.js +2 -2
- package/src/javascripts/ui/components/conversation/loader.js +2 -2
- package/src/javascripts/ui/components/conversation/message-container.js +4 -4
- package/src/javascripts/ui/components/core/seamly-activity-monitor.js +4 -4
- package/src/javascripts/ui/components/core/seamly-core.js +2 -2
- package/src/javascripts/ui/components/core/seamly-event-subscriber.js +8 -8
- package/src/javascripts/ui/components/core/seamly-file-upload.js +5 -5
- package/src/javascripts/ui/components/core/seamly-idle-detach-counter.js +2 -2
- package/src/javascripts/ui/components/core/seamly-initializer.js +2 -2
- package/src/javascripts/ui/components/core/seamly-instance-functions-loader.js +5 -5
- package/src/javascripts/ui/components/core/seamly-live-region.js +2 -2
- package/src/javascripts/ui/components/core/seamly-new-notifications.js +5 -5
- package/src/javascripts/ui/components/core/seamly-read-state.js +6 -6
- package/src/javascripts/ui/components/entry/deprecated-toggle-button.js +5 -5
- package/src/javascripts/ui/components/entry/entry-container.js +8 -8
- package/src/javascripts/ui/components/entry/text-entry/hooks.js +6 -9
- package/src/javascripts/ui/components/entry/text-entry/index.js +2 -2
- package/src/javascripts/ui/components/entry/text-entry/text-entry-form.js +8 -8
- package/src/javascripts/ui/components/entry/upload/file-upload-form.js +5 -5
- package/src/javascripts/ui/components/entry/upload/index.js +10 -10
- package/src/javascripts/ui/components/entry/upload-toggle.js +9 -9
- package/src/javascripts/ui/components/faq/faq.js +16 -16
- package/src/javascripts/ui/components/form-controls/error.js +2 -2
- package/src/javascripts/ui/components/form-controls/file-input.js +4 -4
- package/src/javascripts/ui/components/form-controls/form.js +2 -2
- package/src/javascripts/ui/components/form-controls/input.js +1 -1
- package/src/javascripts/ui/components/form-controls/select.js +1 -1
- package/src/javascripts/ui/components/form-controls/wrapper.js +1 -1
- package/src/javascripts/ui/components/layout/agent-info.js +13 -17
- package/src/javascripts/ui/components/layout/chat-frame.js +6 -6
- package/src/javascripts/ui/components/layout/deprecated-app-frame.js +7 -7
- package/src/javascripts/ui/components/layout/header.js +3 -3
- package/src/javascripts/ui/components/layout/icon.js +1 -1
- package/src/javascripts/ui/components/layout/interrupt.js +3 -3
- package/src/javascripts/ui/components/layout/privacy-disclaimer.js +3 -3
- package/src/javascripts/ui/components/options/options-button.js +8 -13
- package/src/javascripts/ui/components/options/options-frame.js +4 -4
- package/src/javascripts/ui/components/options/options.js +1 -1
- package/src/javascripts/ui/components/options/transcript/index.js +8 -8
- package/src/javascripts/ui/components/options/transcript/transcript-form.js +4 -4
- package/src/javascripts/ui/components/view/window-view/window-open-button.js +7 -7
- package/src/javascripts/ui/components/warnings/idle-detach-warning.js +6 -6
- package/src/javascripts/ui/components/warnings/prompt.js +2 -2
- package/src/javascripts/ui/components/warnings/resume-conversation-prompt.js +5 -5
- package/src/javascripts/ui/components/widgets/in-out-transition.js +3 -3
- package/src/javascripts/ui/components/widgets/lightbox.js +6 -6
- package/src/javascripts/ui/components/widgets/modal.js +2 -2
- package/src/javascripts/ui/components/widgets/upload-progress.js +4 -4
- package/src/javascripts/ui/hooks/component-helper-hooks.js +1 -1
- package/src/javascripts/ui/hooks/file-upload-hooks.js +2 -3
- package/src/javascripts/ui/hooks/focus-helper-hooks.js +3 -3
- package/src/javascripts/ui/hooks/live-region-hooks.js +2 -2
- package/src/javascripts/ui/hooks/seamly-api-hooks.js +1 -1
- package/src/javascripts/ui/hooks/seamly-entry-hooks.js +2 -2
- package/src/javascripts/ui/hooks/seamly-option-hooks.js +2 -2
- package/src/javascripts/ui/hooks/seamly-state-hooks.js +5 -5
- package/src/javascripts/ui/hooks/use-event-component-mapping.js +2 -2
- package/src/javascripts/ui/hooks/use-seamly-activity-event-handler.js +1 -1
- package/src/javascripts/ui/hooks/use-seamly-chat.js +3 -3
- package/src/javascripts/ui/hooks/use-seamly-commands.js +12 -12
- package/src/javascripts/ui/hooks/use-seamly-dispatch.js +1 -1
- package/src/javascripts/ui/hooks/use-seamly-idle-detach-countdown.js +9 -9
- package/src/javascripts/ui/hooks/use-seamly-resume-conversation-prompt.js +2 -2
- package/src/javascripts/ui/hooks/use-single-file-upload.js +2 -2
- package/src/javascripts/ui/hooks/utility-hooks.js +1 -1
- package/src/javascripts/ui/utils/seamly-utils.js +9 -2
- package/src/stylesheets/4-base/_formelements.scss +3 -3
- package/src/stylesheets/5-components/_buttons.scss +1 -1
- package/src/stylesheets/5-components/_input.scss +2 -2
- package/src/stylesheets/5-components/_message-body.scss +19 -12
- package/src/stylesheets/6-default-implementation/_hover.scss +24 -12
- package/src/stylesheets/7-deprecated/4-base/_formelements.scss +4 -4
- package/src/stylesheets/7-deprecated/5-components/_buttons.scss +1 -1
- package/src/stylesheets/7-deprecated/5-components/_input.scss +1 -1
- package/src/stylesheets/7-deprecated/5-components/_message.scss +4 -3
- package/src/stylesheets/7-deprecated/5-components/_options.scss +2 -2
- package/webpack/config.common.js +5 -0
- package/webpack/config.package.js +3 -0
- package/src/javascripts/domains/config/middleware.js +0 -22
|
@@ -3164,7 +3164,7 @@ module.exports = entryVirtual('Array').map;
|
|
|
3164
3164
|
/***/ 2999:
|
|
3165
3165
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
3166
3166
|
|
|
3167
|
-
__webpack_require__(
|
|
3167
|
+
__webpack_require__(1876);
|
|
3168
3168
|
var entryVirtual = __webpack_require__(5703);
|
|
3169
3169
|
|
|
3170
3170
|
module.exports = entryVirtual('Array').reduce;
|
|
@@ -3172,7 +3172,7 @@ module.exports = entryVirtual('Array').reduce;
|
|
|
3172
3172
|
|
|
3173
3173
|
/***/ }),
|
|
3174
3174
|
|
|
3175
|
-
/***/
|
|
3175
|
+
/***/ 5573:
|
|
3176
3176
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
3177
3177
|
|
|
3178
3178
|
__webpack_require__(1490);
|
|
@@ -3426,7 +3426,7 @@ module.exports = function (it) {
|
|
|
3426
3426
|
/***/ 1060:
|
|
3427
3427
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
3428
3428
|
|
|
3429
|
-
var reverse = __webpack_require__(
|
|
3429
|
+
var reverse = __webpack_require__(5573);
|
|
3430
3430
|
|
|
3431
3431
|
var ArrayPrototype = Array.prototype;
|
|
3432
3432
|
|
|
@@ -7850,7 +7850,7 @@ $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
|
|
|
7850
7850
|
|
|
7851
7851
|
/***/ }),
|
|
7852
7852
|
|
|
7853
|
-
/***/
|
|
7853
|
+
/***/ 1876:
|
|
7854
7854
|
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
7855
7855
|
|
|
7856
7856
|
"use strict";
|
|
@@ -15833,24 +15833,68 @@ const useSelectorWithProps = function useSelectorWithProps(selector, props, inpu
|
|
|
15833
15833
|
function useConfig() {
|
|
15834
15834
|
return useSelector(selectConfig);
|
|
15835
15835
|
}
|
|
15836
|
-
|
|
15837
|
-
|
|
15838
|
-
|
|
15839
|
-
|
|
15840
|
-
|
|
15841
|
-
|
|
15842
|
-
|
|
15843
|
-
|
|
15844
|
-
|
|
15845
|
-
|
|
15846
|
-
|
|
15847
|
-
|
|
15836
|
+
function useParticipants() {
|
|
15837
|
+
const {
|
|
15838
|
+
agentParticipant,
|
|
15839
|
+
userParticipant
|
|
15840
|
+
} = useSelector(selectConfig);
|
|
15841
|
+
return {
|
|
15842
|
+
agent: agentParticipant,
|
|
15843
|
+
user: userParticipant
|
|
15844
|
+
};
|
|
15845
|
+
}
|
|
15846
|
+
function useStartChatIcon() {
|
|
15847
|
+
const {
|
|
15848
|
+
startChatIcon
|
|
15849
|
+
} = useSelector(selectConfig);
|
|
15850
|
+
return startChatIcon;
|
|
15851
|
+
}
|
|
15852
|
+
;// CONCATENATED MODULE: ./src/javascripts/config.js
|
|
15853
|
+
const CSS_NAME = 'cvco';
|
|
15854
|
+
const apiVersion = '2';
|
|
15855
|
+
const userParticipantId = 'seamly-client-participant'; // How long to debounce distinct changes in unread messages for before
|
|
15856
|
+
// broadcasting to the screen reader. This is done to avoid verbosity.
|
|
15857
|
+
|
|
15858
|
+
const unreadScreenReaderWait = 2000;
|
|
15859
|
+
const newMessageScreenReaderWait = 1000;
|
|
15860
|
+
const screenReaderDebounceDelaySeconds = 10;
|
|
15861
|
+
const activitySendDelay = 15000;
|
|
15862
|
+
const maxCharacterWarningLimit = 50;
|
|
15863
|
+
const maxCharacterSrDebounceDelay = 300;
|
|
15864
|
+
const defaultTransitionTimeMs = 300; // How long to wait before we decide the user isn't typing
|
|
15865
|
+
|
|
15866
|
+
const typingTimeout = 2000;
|
|
15867
|
+
const defaultConfig = {
|
|
15868
|
+
namespace: 'default',
|
|
15869
|
+
layoutMode: 'window',
|
|
15870
|
+
// "window", "inline" ("sidebar")
|
|
15871
|
+
messages: {
|
|
15872
|
+
agent: {
|
|
15873
|
+
showAvatar: false,
|
|
15874
|
+
// true, "inline"
|
|
15875
|
+
showName: false
|
|
15876
|
+
},
|
|
15877
|
+
user: {
|
|
15878
|
+
showAvatar: false,
|
|
15879
|
+
// true, "inline"
|
|
15880
|
+
showName: false
|
|
15881
|
+
},
|
|
15882
|
+
timeIndicator: {
|
|
15883
|
+
enabled: false,
|
|
15884
|
+
threshold: 3600000 // Default threshold is an hour in milliseconds
|
|
15885
|
+
|
|
15886
|
+
}
|
|
15887
|
+
}
|
|
15888
|
+
};
|
|
15848
15889
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/set-timeout.js
|
|
15849
15890
|
var set_timeout = __webpack_require__(3032);
|
|
15850
15891
|
var set_timeout_default = /*#__PURE__*/__webpack_require__.n(set_timeout);
|
|
15851
15892
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/parse-float.js
|
|
15852
15893
|
var parse_float = __webpack_require__(1238);
|
|
15853
15894
|
var parse_float_default = /*#__PURE__*/__webpack_require__.n(parse_float);
|
|
15895
|
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/index-of.js
|
|
15896
|
+
var instance_index_of = __webpack_require__(1643);
|
|
15897
|
+
var instance_index_of_default = /*#__PURE__*/__webpack_require__.n(instance_index_of);
|
|
15854
15898
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/reduce.js
|
|
15855
15899
|
var reduce = __webpack_require__(2366);
|
|
15856
15900
|
var reduce_default = /*#__PURE__*/__webpack_require__.n(reduce);
|
|
@@ -16068,6 +16112,15 @@ const omit = (obj, keys) => {
|
|
|
16068
16112
|
return accum;
|
|
16069
16113
|
}, {});
|
|
16070
16114
|
};
|
|
16115
|
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/sort.js
|
|
16116
|
+
var sort = __webpack_require__(7302);
|
|
16117
|
+
var sort_default = /*#__PURE__*/__webpack_require__.n(sort);
|
|
16118
|
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/reverse.js
|
|
16119
|
+
var reverse = __webpack_require__(7093);
|
|
16120
|
+
var reverse_default = /*#__PURE__*/__webpack_require__.n(reverse);
|
|
16121
|
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/find.js
|
|
16122
|
+
var find = __webpack_require__(4473);
|
|
16123
|
+
var find_default = /*#__PURE__*/__webpack_require__.n(find);
|
|
16071
16124
|
;// CONCATENATED MODULE: ./src/javascripts/ui/utils/seamly-utils.js
|
|
16072
16125
|
|
|
16073
16126
|
|
|
@@ -16273,9 +16326,19 @@ const participantReducer = (state, action) => {
|
|
|
16273
16326
|
};
|
|
16274
16327
|
|
|
16275
16328
|
case SET_PARTICIPANT:
|
|
16329
|
+
// TODO: a) Styleguide only! b) Should be removed after styleguide overhaul.
|
|
16330
|
+
if (!state) {
|
|
16331
|
+
return {
|
|
16332
|
+
participants: {},
|
|
16333
|
+
currentAgent: ''
|
|
16334
|
+
};
|
|
16335
|
+
}
|
|
16336
|
+
|
|
16276
16337
|
const {
|
|
16277
16338
|
participants
|
|
16278
|
-
} = state
|
|
16339
|
+
} = state || {
|
|
16340
|
+
participants: {}
|
|
16341
|
+
};
|
|
16279
16342
|
const {
|
|
16280
16343
|
id,
|
|
16281
16344
|
avatar,
|
|
@@ -16824,71 +16887,6 @@ const seamlyStateReducer = (state, action) => {
|
|
|
16824
16887
|
return state;
|
|
16825
16888
|
}
|
|
16826
16889
|
};
|
|
16827
|
-
;// CONCATENATED MODULE: ./src/javascripts/domains/config/middleware.js
|
|
16828
|
-
|
|
16829
|
-
|
|
16830
|
-
function createMiddleware() {
|
|
16831
|
-
return ({
|
|
16832
|
-
dispatch
|
|
16833
|
-
}) => next => action => {
|
|
16834
|
-
var _action$config, _action$config$defaul;
|
|
16835
|
-
|
|
16836
|
-
const result = next(action);
|
|
16837
|
-
|
|
16838
|
-
switch (action.type) {
|
|
16839
|
-
case String(initialize):
|
|
16840
|
-
case String(update):
|
|
16841
|
-
if (action !== null && action !== void 0 && (_action$config = action.config) !== null && _action$config !== void 0 && (_action$config$defaul = _action$config.defaults) !== null && _action$config$defaul !== void 0 && _action$config$defaul.agentName) {
|
|
16842
|
-
var _action$config2, _action$config2$defau;
|
|
16843
|
-
|
|
16844
|
-
dispatch({
|
|
16845
|
-
type: seamlyActions.SET_HEADER_SUB_TITLE,
|
|
16846
|
-
title: action === null || action === void 0 ? void 0 : (_action$config2 = action.config) === null || _action$config2 === void 0 ? void 0 : (_action$config2$defau = _action$config2.defaults) === null || _action$config2$defau === void 0 ? void 0 : _action$config2$defau.agentName
|
|
16847
|
-
});
|
|
16848
|
-
}
|
|
16849
|
-
|
|
16850
|
-
}
|
|
16851
|
-
|
|
16852
|
-
return result;
|
|
16853
|
-
};
|
|
16854
|
-
}
|
|
16855
|
-
;// CONCATENATED MODULE: ./src/javascripts/config.js
|
|
16856
|
-
const CSS_NAME = 'cvco';
|
|
16857
|
-
const apiVersion = '2';
|
|
16858
|
-
const userParticipantId = 'seamly-client-participant'; // How long to debounce distinct changes in unread messages for before
|
|
16859
|
-
// broadcasting to the screen reader. This is done to avoid verbosity.
|
|
16860
|
-
|
|
16861
|
-
const unreadScreenReaderWait = 2000;
|
|
16862
|
-
const newMessageScreenReaderWait = 1000;
|
|
16863
|
-
const screenReaderDebounceDelaySeconds = 10;
|
|
16864
|
-
const activitySendDelay = 15000;
|
|
16865
|
-
const maxCharacterWarningLimit = 50;
|
|
16866
|
-
const maxCharacterSrDebounceDelay = 300;
|
|
16867
|
-
const defaultTransitionTimeMs = 300; // How long to wait before we decide the user isn't typing
|
|
16868
|
-
|
|
16869
|
-
const typingTimeout = 2000;
|
|
16870
|
-
const defaultConfig = {
|
|
16871
|
-
namespace: 'default',
|
|
16872
|
-
layoutMode: 'window',
|
|
16873
|
-
// "window", "inline" ("sidebar")
|
|
16874
|
-
messages: {
|
|
16875
|
-
agent: {
|
|
16876
|
-
showAvatar: false,
|
|
16877
|
-
// true, "inline"
|
|
16878
|
-
showName: false
|
|
16879
|
-
},
|
|
16880
|
-
user: {
|
|
16881
|
-
showAvatar: false,
|
|
16882
|
-
// true, "inline"
|
|
16883
|
-
showName: false
|
|
16884
|
-
},
|
|
16885
|
-
timeIndicator: {
|
|
16886
|
-
enabled: false,
|
|
16887
|
-
threshold: 3600000 // Default threshold is an hour in milliseconds
|
|
16888
|
-
|
|
16889
|
-
}
|
|
16890
|
-
}
|
|
16891
|
-
};
|
|
16892
16890
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/promise.js
|
|
16893
16891
|
var promise = __webpack_require__(3476);
|
|
16894
16892
|
var promise_default = /*#__PURE__*/__webpack_require__.n(promise);
|
|
@@ -16979,43 +16977,6 @@ const {
|
|
|
16979
16977
|
|
|
16980
16978
|
const selectUserHasResponded = createSelector(app_utils_selectState, state => state.userHasResponded);
|
|
16981
16979
|
|
|
16982
|
-
;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/utils.js
|
|
16983
|
-
|
|
16984
|
-
|
|
16985
|
-
const {
|
|
16986
|
-
createAction: visibility_utils_createAction,
|
|
16987
|
-
createActions: utils_createActions,
|
|
16988
|
-
createThunk: visibility_utils_createThunk,
|
|
16989
|
-
createReducer: visibility_utils_createReducer,
|
|
16990
|
-
selectState: visibility_utils_selectState
|
|
16991
|
-
} = createDomain('visibility');
|
|
16992
|
-
const calculateVisibility = ({
|
|
16993
|
-
hasResponded,
|
|
16994
|
-
previousVisibility,
|
|
16995
|
-
requestedVisibility,
|
|
16996
|
-
config
|
|
16997
|
-
}) => {
|
|
16998
|
-
const {
|
|
16999
|
-
defaults,
|
|
17000
|
-
layoutMode,
|
|
17001
|
-
hideOnNoUserResponse
|
|
17002
|
-
} = config;
|
|
17003
|
-
const {
|
|
17004
|
-
visible: defaultVisibility
|
|
17005
|
-
} = defaults || {}; // Requesting open should override the responded check.
|
|
17006
|
-
|
|
17007
|
-
if (layoutMode === 'window' && hideOnNoUserResponse && requestedVisibility !== visibilityStates.open) {
|
|
17008
|
-
return hasResponded ? requestedVisibility || previousVisibility || visibilityStates.open : visibilityStates.hidden;
|
|
17009
|
-
}
|
|
17010
|
-
|
|
17011
|
-
const baseVisibility = visibilityStates.minimized;
|
|
17012
|
-
return requestedVisibility || previousVisibility || defaultVisibility || baseVisibility;
|
|
17013
|
-
};
|
|
17014
|
-
;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/selectors.js
|
|
17015
|
-
|
|
17016
|
-
|
|
17017
|
-
const selectVisibility = createSelector(visibility_utils_selectState, state => state.visibility);
|
|
17018
|
-
|
|
17019
16980
|
;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/seamly-state-hooks.js
|
|
17020
16981
|
|
|
17021
16982
|
|
|
@@ -17138,6 +17099,43 @@ const useSeamlyLayoutMode = () => {
|
|
|
17138
17099
|
isResolving: !layoutMode
|
|
17139
17100
|
};
|
|
17140
17101
|
};
|
|
17102
|
+
;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/utils.js
|
|
17103
|
+
|
|
17104
|
+
|
|
17105
|
+
const {
|
|
17106
|
+
createAction: visibility_utils_createAction,
|
|
17107
|
+
createActions: utils_createActions,
|
|
17108
|
+
createThunk: visibility_utils_createThunk,
|
|
17109
|
+
createReducer: visibility_utils_createReducer,
|
|
17110
|
+
selectState: visibility_utils_selectState
|
|
17111
|
+
} = createDomain('visibility');
|
|
17112
|
+
const calculateVisibility = ({
|
|
17113
|
+
hasResponded,
|
|
17114
|
+
previousVisibility,
|
|
17115
|
+
requestedVisibility,
|
|
17116
|
+
config
|
|
17117
|
+
}) => {
|
|
17118
|
+
const {
|
|
17119
|
+
defaults,
|
|
17120
|
+
layoutMode,
|
|
17121
|
+
hideOnNoUserResponse
|
|
17122
|
+
} = config;
|
|
17123
|
+
const {
|
|
17124
|
+
visible: defaultVisibility
|
|
17125
|
+
} = defaults || {}; // Requesting open should override the responded check.
|
|
17126
|
+
|
|
17127
|
+
if (layoutMode === 'window' && hideOnNoUserResponse && requestedVisibility !== visibilityStates.open) {
|
|
17128
|
+
return hasResponded ? requestedVisibility || previousVisibility || visibilityStates.open : visibilityStates.hidden;
|
|
17129
|
+
}
|
|
17130
|
+
|
|
17131
|
+
const baseVisibility = visibilityStates.minimized;
|
|
17132
|
+
return requestedVisibility || previousVisibility || defaultVisibility || baseVisibility;
|
|
17133
|
+
};
|
|
17134
|
+
;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/selectors.js
|
|
17135
|
+
|
|
17136
|
+
|
|
17137
|
+
const selectVisibility = createSelector(visibility_utils_selectState, state => state.visibility);
|
|
17138
|
+
|
|
17141
17139
|
;// CONCATENATED MODULE: ./src/javascripts/domains/visibility/actions.js
|
|
17142
17140
|
|
|
17143
17141
|
|
|
@@ -17274,6 +17272,7 @@ class SeamlyBaseError extends Error {
|
|
|
17274
17272
|
if (originalError !== null && originalError !== void 0 && originalError.payload) {
|
|
17275
17273
|
this.originalEvent = originalError;
|
|
17276
17274
|
this.originalError = originalError.payload.error;
|
|
17275
|
+
this.message = `Event of type ${originalError.payload.type} encountered`;
|
|
17277
17276
|
}
|
|
17278
17277
|
|
|
17279
17278
|
if (originalError !== null && originalError !== void 0 && originalError.error) {
|
|
@@ -17334,7 +17333,10 @@ const app_actions_initialize = app_utils_createThunk('initialize', async (_, {
|
|
|
17334
17333
|
const {
|
|
17335
17334
|
features,
|
|
17336
17335
|
defaultLocale,
|
|
17337
|
-
preChat
|
|
17336
|
+
preChat,
|
|
17337
|
+
agentParticipant,
|
|
17338
|
+
userParticipant,
|
|
17339
|
+
startChatIcon
|
|
17338
17340
|
} = await api.getConfig();
|
|
17339
17341
|
dispatch({
|
|
17340
17342
|
type: seamlyActions.SET_FEATURES,
|
|
@@ -17346,6 +17348,18 @@ const app_actions_initialize = app_utils_createThunk('initialize', async (_, {
|
|
|
17346
17348
|
type: 'message',
|
|
17347
17349
|
payload
|
|
17348
17350
|
}))));
|
|
17351
|
+
dispatch(update({
|
|
17352
|
+
agentParticipant,
|
|
17353
|
+
userParticipant,
|
|
17354
|
+
startChatIcon
|
|
17355
|
+
}));
|
|
17356
|
+
|
|
17357
|
+
if (agentParticipant !== null && agentParticipant !== void 0 && agentParticipant.name) {
|
|
17358
|
+
dispatch({
|
|
17359
|
+
type: seamlyActions.SET_HEADER_TITLE,
|
|
17360
|
+
title: agentParticipant.name
|
|
17361
|
+
});
|
|
17362
|
+
}
|
|
17349
17363
|
} catch (e) {
|
|
17350
17364
|
throw new SeamlyUnavailableError();
|
|
17351
17365
|
}
|
|
@@ -17422,7 +17436,7 @@ const initialState = reducer_objectSpread(reducer_objectSpread({}, defaultConfig
|
|
|
17422
17436
|
preChatEvents: []
|
|
17423
17437
|
});
|
|
17424
17438
|
|
|
17425
|
-
const configKeys = ['hideOnNoUserResponse', 'showDisclaimer', 'showFaq', 'namespace', 'customComponents', 'defaults', 'layoutMode', 'api', 'zIndex', 'context', 'appContainerClassNames', 'messages', 'visible', 'visibilityCallback', 'errorCallback'];
|
|
17439
|
+
const configKeys = ['hideOnNoUserResponse', 'showDisclaimer', 'showFaq', 'namespace', 'customComponents', 'defaults', 'layoutMode', 'api', 'zIndex', 'context', 'appContainerClassNames', 'messages', 'visible', 'visibilityCallback', 'errorCallback', 'agentParticipant', 'userParticipant', 'startChatIcon'];
|
|
17426
17440
|
|
|
17427
17441
|
const updateState = (state, {
|
|
17428
17442
|
config
|
|
@@ -17470,7 +17484,6 @@ const updateState = (state, {
|
|
|
17470
17484
|
|
|
17471
17485
|
|
|
17472
17486
|
|
|
17473
|
-
|
|
17474
17487
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/flat.js
|
|
17475
17488
|
var flat = __webpack_require__(6423);
|
|
17476
17489
|
var flat_default = /*#__PURE__*/__webpack_require__.n(flat);
|
|
@@ -18628,34 +18641,6 @@ const useFileUploads = () => {
|
|
|
18628
18641
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/trim.js
|
|
18629
18642
|
var trim = __webpack_require__(5843);
|
|
18630
18643
|
var trim_default = /*#__PURE__*/__webpack_require__.n(trim);
|
|
18631
|
-
;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/utility-hooks.js
|
|
18632
|
-
|
|
18633
|
-
|
|
18634
|
-
|
|
18635
|
-
const useForceUpdate = () => {
|
|
18636
|
-
// This is an escape hatch mentioned in the React docs:
|
|
18637
|
-
// https://reactjs.org/docs/hooks-faq.html#is-there-something-like-forceupdate
|
|
18638
|
-
|
|
18639
|
-
/* eslint-disable-next-line no-unused-vars */
|
|
18640
|
-
const [ignored, forceUpdate] = hooks_module_p(x => x + 1, 0);
|
|
18641
|
-
return hooks_module_A(() => {
|
|
18642
|
-
set_timeout_default()(() => {
|
|
18643
|
-
forceUpdate();
|
|
18644
|
-
});
|
|
18645
|
-
}, []);
|
|
18646
|
-
};
|
|
18647
|
-
const useGeneratedId = () => {
|
|
18648
|
-
const [id] = l(() => randomId());
|
|
18649
|
-
return id;
|
|
18650
|
-
};
|
|
18651
|
-
const useStableCallback = callback => {
|
|
18652
|
-
const callbackRef = hooks_module_s();
|
|
18653
|
-
callbackRef.current = callback;
|
|
18654
|
-
const isFunction = typeof callback === 'function';
|
|
18655
|
-
return hooks_module_d(() => {
|
|
18656
|
-
return isFunction ? (...args) => callbackRef.current(...args) : undefined;
|
|
18657
|
-
}, [isFunction]);
|
|
18658
|
-
};
|
|
18659
18644
|
;// CONCATENATED MODULE: ./src/javascripts/domains/interrupt/selectors.js
|
|
18660
18645
|
|
|
18661
18646
|
|
|
@@ -18767,7 +18752,7 @@ class SeamlyUnauthorizedError extends SeamlyBaseError {
|
|
|
18767
18752
|
|
|
18768
18753
|
|
|
18769
18754
|
const handledErrorTypes = [SeamlyGeneralError, SeamlyConfigurationError, SeamlySessionExpiredError, SeamlyOfflineError, SeamlyUnauthorizedError, SeamlyUnavailableError];
|
|
18770
|
-
function
|
|
18755
|
+
function createMiddleware({
|
|
18771
18756
|
api
|
|
18772
18757
|
}) {
|
|
18773
18758
|
return () => next => action => {
|
|
@@ -18898,20 +18883,48 @@ const visibility_reducer_initialState = {
|
|
|
18898
18883
|
|
|
18899
18884
|
|
|
18900
18885
|
|
|
18901
|
-
;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/
|
|
18902
|
-
|
|
18903
|
-
|
|
18904
|
-
|
|
18905
|
-
|
|
18906
|
-
|
|
18907
|
-
|
|
18908
|
-
|
|
18909
|
-
|
|
18910
|
-
|
|
18911
|
-
|
|
18912
|
-
function use_seamly_commands_ownKeys(object, enumerableOnly) { var keys = keys_default()(object); if ((get_own_property_symbols_default())) { var symbols = get_own_property_symbols_default()(object); if (enumerableOnly) { symbols = filter_default()(symbols).call(symbols, function (sym) { return get_own_property_descriptor_default()(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
18886
|
+
;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/utility-hooks.js
|
|
18913
18887
|
|
|
18914
|
-
|
|
18888
|
+
|
|
18889
|
+
|
|
18890
|
+
const useForceUpdate = () => {
|
|
18891
|
+
// This is an escape hatch mentioned in the React docs:
|
|
18892
|
+
// https://reactjs.org/docs/hooks-faq.html#is-there-something-like-forceupdate
|
|
18893
|
+
|
|
18894
|
+
/* eslint-disable-next-line no-unused-vars */
|
|
18895
|
+
const [ignored, forceUpdate] = hooks_module_p(x => x + 1, 0);
|
|
18896
|
+
return hooks_module_A(() => {
|
|
18897
|
+
set_timeout_default()(() => {
|
|
18898
|
+
forceUpdate();
|
|
18899
|
+
});
|
|
18900
|
+
}, []);
|
|
18901
|
+
};
|
|
18902
|
+
const useGeneratedId = () => {
|
|
18903
|
+
const [id] = l(() => randomId());
|
|
18904
|
+
return id;
|
|
18905
|
+
};
|
|
18906
|
+
const useStableCallback = callback => {
|
|
18907
|
+
const callbackRef = hooks_module_s();
|
|
18908
|
+
callbackRef.current = callback;
|
|
18909
|
+
const isFunction = typeof callback === 'function';
|
|
18910
|
+
return hooks_module_d(() => {
|
|
18911
|
+
return isFunction ? (...args) => callbackRef.current(...args) : undefined;
|
|
18912
|
+
}, [isFunction]);
|
|
18913
|
+
};
|
|
18914
|
+
;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/use-seamly-commands.js
|
|
18915
|
+
|
|
18916
|
+
|
|
18917
|
+
|
|
18918
|
+
|
|
18919
|
+
|
|
18920
|
+
|
|
18921
|
+
|
|
18922
|
+
|
|
18923
|
+
|
|
18924
|
+
|
|
18925
|
+
function use_seamly_commands_ownKeys(object, enumerableOnly) { var keys = keys_default()(object); if ((get_own_property_symbols_default())) { var symbols = get_own_property_symbols_default()(object); if (enumerableOnly) { symbols = filter_default()(symbols).call(symbols, function (sym) { return get_own_property_descriptor_default()(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
18926
|
+
|
|
18927
|
+
function use_seamly_commands_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; for_each_default()(_context = use_seamly_commands_ownKeys(Object(source), true)).call(_context, function (key) { defineProperty_defineProperty(target, key, source[key]); }); } else if ((get_own_property_descriptors_default())) { define_properties_default()(target, get_own_property_descriptors_default()(source)); } else { var _context2; for_each_default()(_context2 = use_seamly_commands_ownKeys(Object(source))).call(_context2, function (key) { define_property_default()(target, key, get_own_property_descriptor_default()(source, key)); }); } } return target; }
|
|
18915
18928
|
|
|
18916
18929
|
|
|
18917
18930
|
|
|
@@ -19872,7 +19885,7 @@ function useTranslationsContainer() {
|
|
|
19872
19885
|
|
|
19873
19886
|
|
|
19874
19887
|
|
|
19875
|
-
function
|
|
19888
|
+
function middleware_createMiddleware() {
|
|
19876
19889
|
return ({
|
|
19877
19890
|
dispatch,
|
|
19878
19891
|
getState
|
|
@@ -20565,10 +20578,14 @@ function FormProvider(_ref) {
|
|
|
20565
20578
|
});
|
|
20566
20579
|
}, [setExternalErrors]);
|
|
20567
20580
|
const handleSubmit = hooks_module_A(e => {
|
|
20568
|
-
|
|
20569
|
-
setIsSubmitted(true);
|
|
20581
|
+
var _e$submitter;
|
|
20570
20582
|
|
|
20571
|
-
|
|
20583
|
+
e.preventDefault(); // If the submitter is set to being aria-disabled, block the submit action
|
|
20584
|
+
|
|
20585
|
+
const ariaDisabled = ((_e$submitter = e.submitter) === null || _e$submitter === void 0 ? void 0 : _e$submitter.ariaDisabled) === 'true';
|
|
20586
|
+
setIsSubmitted(!ariaDisabled);
|
|
20587
|
+
|
|
20588
|
+
if (!ariaDisabled && validationIsValid) {
|
|
20572
20589
|
onSubmit(values, {
|
|
20573
20590
|
updateControlValue,
|
|
20574
20591
|
setError
|
|
@@ -20737,6 +20754,201 @@ function updateFormControl(state, formId, name, controlState) {
|
|
|
20737
20754
|
|
|
20738
20755
|
|
|
20739
20756
|
|
|
20757
|
+
;// CONCATENATED MODULE: ./src/javascripts/ui/utils/form-utils.js
|
|
20758
|
+
|
|
20759
|
+
|
|
20760
|
+
|
|
20761
|
+
|
|
20762
|
+
|
|
20763
|
+
|
|
20764
|
+
|
|
20765
|
+
|
|
20766
|
+
|
|
20767
|
+
|
|
20768
|
+
|
|
20769
|
+
|
|
20770
|
+
|
|
20771
|
+
function form_utils_ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) { symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
20772
|
+
|
|
20773
|
+
function form_utils_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context4; _forEachInstanceProperty(_context4 = form_utils_ownKeys(Object(source), true)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { var _context5; _forEachInstanceProperty(_context5 = form_utils_ownKeys(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
20774
|
+
|
|
20775
|
+
const formActions = {
|
|
20776
|
+
REGISTER_FORM: 'REGISTER_FORM',
|
|
20777
|
+
DE_REGISTER_FORM: 'DE_REGISTER_FORM',
|
|
20778
|
+
REGISTER: 'REGISTER',
|
|
20779
|
+
DE_REGISTER: 'DEREGISTER',
|
|
20780
|
+
SET_VALUE: 'SET_VALUE',
|
|
20781
|
+
SET_VALIDITY: 'SET_VALIDITY',
|
|
20782
|
+
SET_STATE: 'SET_STATE',
|
|
20783
|
+
SET_SUBMITTED: 'SET_SUBMITTED',
|
|
20784
|
+
SET_PERSIST_FORM_DATA: 'SET_PERSIST_FORM_DATA'
|
|
20785
|
+
};
|
|
20786
|
+
const {
|
|
20787
|
+
REGISTER_FORM,
|
|
20788
|
+
DE_REGISTER_FORM,
|
|
20789
|
+
REGISTER,
|
|
20790
|
+
DE_REGISTER,
|
|
20791
|
+
SET_VALUE,
|
|
20792
|
+
SET_VALIDITY,
|
|
20793
|
+
SET_STATE,
|
|
20794
|
+
SET_SUBMITTED,
|
|
20795
|
+
SET_PERSIST_FORM_DATA
|
|
20796
|
+
} = formActions;
|
|
20797
|
+
const getValidator = (fn, errorText, compareValue = null) => ({
|
|
20798
|
+
fn,
|
|
20799
|
+
errorText,
|
|
20800
|
+
compareValue
|
|
20801
|
+
});
|
|
20802
|
+
const formReducer = (state, action) => {
|
|
20803
|
+
var _context, _context2, _context3;
|
|
20804
|
+
|
|
20805
|
+
const {
|
|
20806
|
+
formId,
|
|
20807
|
+
name,
|
|
20808
|
+
controlId,
|
|
20809
|
+
value,
|
|
20810
|
+
data,
|
|
20811
|
+
validity,
|
|
20812
|
+
errorText,
|
|
20813
|
+
hasSubmitted,
|
|
20814
|
+
persistData
|
|
20815
|
+
} = action;
|
|
20816
|
+
|
|
20817
|
+
const setControls = controls => form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
|
|
20818
|
+
[formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
|
|
20819
|
+
controls: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls), controls)
|
|
20820
|
+
})
|
|
20821
|
+
});
|
|
20822
|
+
|
|
20823
|
+
switch (action.type) {
|
|
20824
|
+
case REGISTER_FORM:
|
|
20825
|
+
return form_utils_objectSpread({
|
|
20826
|
+
[formId]: {
|
|
20827
|
+
controls: {},
|
|
20828
|
+
validity: true,
|
|
20829
|
+
hasSubmitted: false,
|
|
20830
|
+
persistData: false
|
|
20831
|
+
}
|
|
20832
|
+
}, state);
|
|
20833
|
+
|
|
20834
|
+
case DE_REGISTER_FORM:
|
|
20835
|
+
const removedFormState = form_utils_objectSpread({}, state);
|
|
20836
|
+
|
|
20837
|
+
delete removedFormState[formId];
|
|
20838
|
+
return removedFormState;
|
|
20839
|
+
|
|
20840
|
+
case REGISTER:
|
|
20841
|
+
const {
|
|
20842
|
+
value: existingValue,
|
|
20843
|
+
validity: existingValidity,
|
|
20844
|
+
errorText: existingErrorText
|
|
20845
|
+
} = state[formId].controls[name] || {};
|
|
20846
|
+
return setControls({
|
|
20847
|
+
[name]: {
|
|
20848
|
+
controlId,
|
|
20849
|
+
value: existingValue || value,
|
|
20850
|
+
validity: existingValidity !== false,
|
|
20851
|
+
errorText: existingErrorText || ''
|
|
20852
|
+
}
|
|
20853
|
+
});
|
|
20854
|
+
|
|
20855
|
+
case DE_REGISTER:
|
|
20856
|
+
const relatedForm = state[formId];
|
|
20857
|
+
|
|
20858
|
+
if (!relatedForm) {
|
|
20859
|
+
return state;
|
|
20860
|
+
}
|
|
20861
|
+
|
|
20862
|
+
const newControls = form_utils_objectSpread({}, relatedForm.controls);
|
|
20863
|
+
|
|
20864
|
+
delete newControls[action.name];
|
|
20865
|
+
return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
|
|
20866
|
+
[formId]: form_utils_objectSpread(form_utils_objectSpread({}, relatedForm), {}, {
|
|
20867
|
+
controls: newControls
|
|
20868
|
+
})
|
|
20869
|
+
});
|
|
20870
|
+
|
|
20871
|
+
case SET_VALUE:
|
|
20872
|
+
return setControls({
|
|
20873
|
+
[name]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[name]), {}, {
|
|
20874
|
+
value
|
|
20875
|
+
})
|
|
20876
|
+
});
|
|
20877
|
+
|
|
20878
|
+
case SET_VALIDITY:
|
|
20879
|
+
const newControlValidities = form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls), {}, {
|
|
20880
|
+
[name]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[name]), {}, {
|
|
20881
|
+
validity,
|
|
20882
|
+
errorText
|
|
20883
|
+
})
|
|
20884
|
+
});
|
|
20885
|
+
|
|
20886
|
+
return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
|
|
20887
|
+
[formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
|
|
20888
|
+
controls: newControlValidities,
|
|
20889
|
+
validity: _everyInstanceProperty(_context = _mapInstanceProperty(_context2 = _Object$keys(newControlValidities)).call(_context2, key => newControlValidities[key].validity)).call(_context, v => v)
|
|
20890
|
+
})
|
|
20891
|
+
});
|
|
20892
|
+
|
|
20893
|
+
case SET_STATE:
|
|
20894
|
+
return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
|
|
20895
|
+
[formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
|
|
20896
|
+
controls: _reduceInstanceProperty(_context3 = _Object$keys(data)).call(_context3, (acc, key) => {
|
|
20897
|
+
return form_utils_objectSpread(form_utils_objectSpread({}, acc), {}, {
|
|
20898
|
+
[key]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[key]), {}, {
|
|
20899
|
+
value: data[key],
|
|
20900
|
+
validity: true,
|
|
20901
|
+
errorText: ''
|
|
20902
|
+
})
|
|
20903
|
+
});
|
|
20904
|
+
}, form_utils_objectSpread({}, state.controls))
|
|
20905
|
+
})
|
|
20906
|
+
});
|
|
20907
|
+
|
|
20908
|
+
case SET_SUBMITTED:
|
|
20909
|
+
return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
|
|
20910
|
+
[formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
|
|
20911
|
+
hasSubmitted
|
|
20912
|
+
})
|
|
20913
|
+
});
|
|
20914
|
+
|
|
20915
|
+
case SET_PERSIST_FORM_DATA:
|
|
20916
|
+
return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
|
|
20917
|
+
[formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
|
|
20918
|
+
persistData
|
|
20919
|
+
})
|
|
20920
|
+
});
|
|
20921
|
+
|
|
20922
|
+
default:
|
|
20923
|
+
return state;
|
|
20924
|
+
}
|
|
20925
|
+
};
|
|
20926
|
+
;// CONCATENATED MODULE: ./src/javascripts/ui/utils/validations.js
|
|
20927
|
+
|
|
20928
|
+
const validateFileSize = (fileList, maxSize) => {
|
|
20929
|
+
let isValid = true;
|
|
20930
|
+
|
|
20931
|
+
for (let i = 0; i < fileList.length; i++) {
|
|
20932
|
+
if (fileList[i].size > maxSize) {
|
|
20933
|
+
isValid = false;
|
|
20934
|
+
}
|
|
20935
|
+
}
|
|
20936
|
+
|
|
20937
|
+
return isValid;
|
|
20938
|
+
};
|
|
20939
|
+
const fileListObjectIsNotEmpty = fileListObj => !!(fileListObj !== null && fileListObj !== void 0 && fileListObj.length) > 0;
|
|
20940
|
+
/* eslint-disable no-control-regex */
|
|
20941
|
+
|
|
20942
|
+
const isEmailString = val => {
|
|
20943
|
+
const regex = /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i;
|
|
20944
|
+
|
|
20945
|
+
const trimmedVal = val && trim_default()(val).call(val);
|
|
20946
|
+
|
|
20947
|
+
return !!(trimmedVal && trimmedVal.match(regex));
|
|
20948
|
+
};
|
|
20949
|
+
/* eslint-enable no-control-regex */
|
|
20950
|
+
|
|
20951
|
+
const isNotEmptyString = val => !!val;
|
|
20740
20952
|
;// CONCATENATED MODULE: ./src/javascripts/ui/components/form-controls/form.js
|
|
20741
20953
|
|
|
20742
20954
|
|
|
@@ -20964,248 +21176,53 @@ function TranslationsOptionsDialogForm({
|
|
|
20964
21176
|
var _languages$find;
|
|
20965
21177
|
|
|
20966
21178
|
return languages === null || languages === void 0 ? void 0 : (_languages$find = find_default()(languages).call(languages, lang => lang.locale === currentLocale)) === null || _languages$find === void 0 ? void 0 : _languages$find.nativeName;
|
|
20967
|
-
}, [languages, currentLocale]);
|
|
20968
|
-
const options = hooks_module_d(() => {
|
|
20969
|
-
var _context;
|
|
20970
|
-
|
|
20971
|
-
return [{
|
|
20972
|
-
value: '',
|
|
20973
|
-
label: t('translations.settings.defaultOptionLabel')
|
|
20974
|
-
}, ...map_default()(_context = filter_default()(languages).call(languages, language => language.locale.toLowerCase() !== String(uiLocale).toLowerCase())).call(_context, language => ({
|
|
20975
|
-
value: language.locale,
|
|
20976
|
-
label: language.nativeName
|
|
20977
|
-
}))];
|
|
20978
|
-
}, [t, languages, uiLocale]);
|
|
20979
|
-
return jsxRuntime_module_e(form_controls_form, {
|
|
20980
|
-
noValidate: "true",
|
|
20981
|
-
className: css_className('options__form'),
|
|
20982
|
-
children: [jsxRuntime_module_e("p", {
|
|
20983
|
-
className: css_className('options__description'),
|
|
20984
|
-
id: descriptionId,
|
|
20985
|
-
children: t('translations.settings.description')
|
|
20986
|
-
}), isActive ? jsxRuntime_module_e(d, {
|
|
20987
|
-
children: [jsxRuntime_module_e("h3", {
|
|
20988
|
-
children: t('translations.settings.currentTranslationLabel')
|
|
20989
|
-
}), jsxRuntime_module_e("p", {
|
|
20990
|
-
className: css_className('options__active-language'),
|
|
20991
|
-
children: languageName
|
|
20992
|
-
})]
|
|
20993
|
-
}) : jsxRuntime_module_e(form_controls_select, {
|
|
20994
|
-
name: controlName,
|
|
20995
|
-
type: "text",
|
|
20996
|
-
className: css_className('input__select'),
|
|
20997
|
-
"aria-describedby": descriptionId,
|
|
20998
|
-
labelClass: css_className('label'),
|
|
20999
|
-
labelText: t('translations.settings.inputLabel'),
|
|
21000
|
-
options: options,
|
|
21001
|
-
defaultValue: currentLocale || ''
|
|
21002
|
-
}), jsxRuntime_module_e("div", {
|
|
21003
|
-
className: css_className('options__actions'),
|
|
21004
|
-
children: jsxRuntime_module_e("button", {
|
|
21005
|
-
type: "submit",
|
|
21006
|
-
className: css_className('button', 'button--primary', 'options__submit'),
|
|
21007
|
-
children: isActive ? t('translations.settings.endButtonText') : t('translations.settings.startButtonText')
|
|
21008
|
-
})
|
|
21009
|
-
})]
|
|
21010
|
-
});
|
|
21011
|
-
}
|
|
21012
|
-
|
|
21013
|
-
/* harmony default export */ var options_dialog_form = (TranslationsOptionsDialogForm);
|
|
21014
|
-
;// CONCATENATED MODULE: ./src/javascripts/ui/utils/form-utils.js
|
|
21015
|
-
|
|
21016
|
-
|
|
21017
|
-
|
|
21018
|
-
|
|
21019
|
-
|
|
21020
|
-
|
|
21021
|
-
|
|
21022
|
-
|
|
21023
|
-
|
|
21024
|
-
|
|
21025
|
-
|
|
21026
|
-
|
|
21027
|
-
|
|
21028
|
-
function form_utils_ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) { symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
21029
|
-
|
|
21030
|
-
function form_utils_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context4; _forEachInstanceProperty(_context4 = form_utils_ownKeys(Object(source), true)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { var _context5; _forEachInstanceProperty(_context5 = form_utils_ownKeys(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
21031
|
-
|
|
21032
|
-
const formActions = {
|
|
21033
|
-
REGISTER_FORM: 'REGISTER_FORM',
|
|
21034
|
-
DE_REGISTER_FORM: 'DE_REGISTER_FORM',
|
|
21035
|
-
REGISTER: 'REGISTER',
|
|
21036
|
-
DE_REGISTER: 'DEREGISTER',
|
|
21037
|
-
SET_VALUE: 'SET_VALUE',
|
|
21038
|
-
SET_VALIDITY: 'SET_VALIDITY',
|
|
21039
|
-
SET_STATE: 'SET_STATE',
|
|
21040
|
-
SET_SUBMITTED: 'SET_SUBMITTED',
|
|
21041
|
-
SET_PERSIST_FORM_DATA: 'SET_PERSIST_FORM_DATA'
|
|
21042
|
-
};
|
|
21043
|
-
const {
|
|
21044
|
-
REGISTER_FORM,
|
|
21045
|
-
DE_REGISTER_FORM,
|
|
21046
|
-
REGISTER,
|
|
21047
|
-
DE_REGISTER,
|
|
21048
|
-
SET_VALUE,
|
|
21049
|
-
SET_VALIDITY,
|
|
21050
|
-
SET_STATE,
|
|
21051
|
-
SET_SUBMITTED,
|
|
21052
|
-
SET_PERSIST_FORM_DATA
|
|
21053
|
-
} = formActions;
|
|
21054
|
-
const getValidator = (fn, errorText, compareValue = null) => ({
|
|
21055
|
-
fn,
|
|
21056
|
-
errorText,
|
|
21057
|
-
compareValue
|
|
21058
|
-
});
|
|
21059
|
-
const formReducer = (state, action) => {
|
|
21060
|
-
var _context, _context2, _context3;
|
|
21061
|
-
|
|
21062
|
-
const {
|
|
21063
|
-
formId,
|
|
21064
|
-
name,
|
|
21065
|
-
controlId,
|
|
21066
|
-
value,
|
|
21067
|
-
data,
|
|
21068
|
-
validity,
|
|
21069
|
-
errorText,
|
|
21070
|
-
hasSubmitted,
|
|
21071
|
-
persistData
|
|
21072
|
-
} = action;
|
|
21073
|
-
|
|
21074
|
-
const setControls = controls => form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
|
|
21075
|
-
[formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
|
|
21076
|
-
controls: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls), controls)
|
|
21077
|
-
})
|
|
21078
|
-
});
|
|
21079
|
-
|
|
21080
|
-
switch (action.type) {
|
|
21081
|
-
case REGISTER_FORM:
|
|
21082
|
-
return form_utils_objectSpread({
|
|
21083
|
-
[formId]: {
|
|
21084
|
-
controls: {},
|
|
21085
|
-
validity: true,
|
|
21086
|
-
hasSubmitted: false,
|
|
21087
|
-
persistData: false
|
|
21088
|
-
}
|
|
21089
|
-
}, state);
|
|
21090
|
-
|
|
21091
|
-
case DE_REGISTER_FORM:
|
|
21092
|
-
const removedFormState = form_utils_objectSpread({}, state);
|
|
21093
|
-
|
|
21094
|
-
delete removedFormState[formId];
|
|
21095
|
-
return removedFormState;
|
|
21096
|
-
|
|
21097
|
-
case REGISTER:
|
|
21098
|
-
const {
|
|
21099
|
-
value: existingValue,
|
|
21100
|
-
validity: existingValidity,
|
|
21101
|
-
errorText: existingErrorText
|
|
21102
|
-
} = state[formId].controls[name] || {};
|
|
21103
|
-
return setControls({
|
|
21104
|
-
[name]: {
|
|
21105
|
-
controlId,
|
|
21106
|
-
value: existingValue || value,
|
|
21107
|
-
validity: existingValidity !== false,
|
|
21108
|
-
errorText: existingErrorText || ''
|
|
21109
|
-
}
|
|
21110
|
-
});
|
|
21111
|
-
|
|
21112
|
-
case DE_REGISTER:
|
|
21113
|
-
const relatedForm = state[formId];
|
|
21114
|
-
|
|
21115
|
-
if (!relatedForm) {
|
|
21116
|
-
return state;
|
|
21117
|
-
}
|
|
21118
|
-
|
|
21119
|
-
const newControls = form_utils_objectSpread({}, relatedForm.controls);
|
|
21120
|
-
|
|
21121
|
-
delete newControls[action.name];
|
|
21122
|
-
return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
|
|
21123
|
-
[formId]: form_utils_objectSpread(form_utils_objectSpread({}, relatedForm), {}, {
|
|
21124
|
-
controls: newControls
|
|
21125
|
-
})
|
|
21126
|
-
});
|
|
21127
|
-
|
|
21128
|
-
case SET_VALUE:
|
|
21129
|
-
return setControls({
|
|
21130
|
-
[name]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[name]), {}, {
|
|
21131
|
-
value
|
|
21132
|
-
})
|
|
21133
|
-
});
|
|
21134
|
-
|
|
21135
|
-
case SET_VALIDITY:
|
|
21136
|
-
const newControlValidities = form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls), {}, {
|
|
21137
|
-
[name]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[name]), {}, {
|
|
21138
|
-
validity,
|
|
21139
|
-
errorText
|
|
21140
|
-
})
|
|
21141
|
-
});
|
|
21142
|
-
|
|
21143
|
-
return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
|
|
21144
|
-
[formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
|
|
21145
|
-
controls: newControlValidities,
|
|
21146
|
-
validity: _everyInstanceProperty(_context = _mapInstanceProperty(_context2 = _Object$keys(newControlValidities)).call(_context2, key => newControlValidities[key].validity)).call(_context, v => v)
|
|
21147
|
-
})
|
|
21148
|
-
});
|
|
21149
|
-
|
|
21150
|
-
case SET_STATE:
|
|
21151
|
-
return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
|
|
21152
|
-
[formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
|
|
21153
|
-
controls: _reduceInstanceProperty(_context3 = _Object$keys(data)).call(_context3, (acc, key) => {
|
|
21154
|
-
return form_utils_objectSpread(form_utils_objectSpread({}, acc), {}, {
|
|
21155
|
-
[key]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId].controls[key]), {}, {
|
|
21156
|
-
value: data[key],
|
|
21157
|
-
validity: true,
|
|
21158
|
-
errorText: ''
|
|
21159
|
-
})
|
|
21160
|
-
});
|
|
21161
|
-
}, form_utils_objectSpread({}, state.controls))
|
|
21162
|
-
})
|
|
21163
|
-
});
|
|
21164
|
-
|
|
21165
|
-
case SET_SUBMITTED:
|
|
21166
|
-
return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
|
|
21167
|
-
[formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
|
|
21168
|
-
hasSubmitted
|
|
21169
|
-
})
|
|
21170
|
-
});
|
|
21171
|
-
|
|
21172
|
-
case SET_PERSIST_FORM_DATA:
|
|
21173
|
-
return form_utils_objectSpread(form_utils_objectSpread({}, state), {}, {
|
|
21174
|
-
[formId]: form_utils_objectSpread(form_utils_objectSpread({}, state[formId]), {}, {
|
|
21175
|
-
persistData
|
|
21176
|
-
})
|
|
21177
|
-
});
|
|
21178
|
-
|
|
21179
|
-
default:
|
|
21180
|
-
return state;
|
|
21181
|
-
}
|
|
21182
|
-
};
|
|
21183
|
-
;// CONCATENATED MODULE: ./src/javascripts/ui/utils/validations.js
|
|
21184
|
-
|
|
21185
|
-
const validateFileSize = (fileList, maxSize) => {
|
|
21186
|
-
let isValid = true;
|
|
21187
|
-
|
|
21188
|
-
for (let i = 0; i < fileList.length; i++) {
|
|
21189
|
-
if (fileList[i].size > maxSize) {
|
|
21190
|
-
isValid = false;
|
|
21191
|
-
}
|
|
21192
|
-
}
|
|
21193
|
-
|
|
21194
|
-
return isValid;
|
|
21195
|
-
};
|
|
21196
|
-
const fileListObjectIsNotEmpty = fileListObj => !!(fileListObj !== null && fileListObj !== void 0 && fileListObj.length) > 0;
|
|
21197
|
-
/* eslint-disable no-control-regex */
|
|
21198
|
-
|
|
21199
|
-
const isEmailString = val => {
|
|
21200
|
-
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;
|
|
21201
|
-
|
|
21202
|
-
const trimmedVal = val && trim_default()(val).call(val);
|
|
21179
|
+
}, [languages, currentLocale]);
|
|
21180
|
+
const options = hooks_module_d(() => {
|
|
21181
|
+
var _context;
|
|
21203
21182
|
|
|
21204
|
-
|
|
21205
|
-
|
|
21206
|
-
|
|
21183
|
+
return [{
|
|
21184
|
+
value: '',
|
|
21185
|
+
label: t('translations.settings.defaultOptionLabel')
|
|
21186
|
+
}, ...map_default()(_context = filter_default()(languages).call(languages, language => language.locale.toLowerCase() !== String(uiLocale).toLowerCase())).call(_context, language => ({
|
|
21187
|
+
value: language.locale,
|
|
21188
|
+
label: language.nativeName
|
|
21189
|
+
}))];
|
|
21190
|
+
}, [t, languages, uiLocale]);
|
|
21191
|
+
return jsxRuntime_module_e(form_controls_form, {
|
|
21192
|
+
noValidate: "true",
|
|
21193
|
+
className: css_className('options__form'),
|
|
21194
|
+
children: [jsxRuntime_module_e("p", {
|
|
21195
|
+
className: css_className('options__description'),
|
|
21196
|
+
id: descriptionId,
|
|
21197
|
+
children: t('translations.settings.description')
|
|
21198
|
+
}), isActive ? jsxRuntime_module_e(d, {
|
|
21199
|
+
children: [jsxRuntime_module_e("h3", {
|
|
21200
|
+
children: t('translations.settings.currentTranslationLabel')
|
|
21201
|
+
}), jsxRuntime_module_e("p", {
|
|
21202
|
+
className: css_className('options__active-language'),
|
|
21203
|
+
children: languageName
|
|
21204
|
+
})]
|
|
21205
|
+
}) : jsxRuntime_module_e(form_controls_select, {
|
|
21206
|
+
name: controlName,
|
|
21207
|
+
type: "text",
|
|
21208
|
+
className: css_className('input__select'),
|
|
21209
|
+
"aria-describedby": descriptionId,
|
|
21210
|
+
labelClass: css_className('label'),
|
|
21211
|
+
labelText: t('translations.settings.inputLabel'),
|
|
21212
|
+
options: options,
|
|
21213
|
+
defaultValue: currentLocale || ''
|
|
21214
|
+
}), jsxRuntime_module_e("div", {
|
|
21215
|
+
className: css_className('options__actions'),
|
|
21216
|
+
children: jsxRuntime_module_e("button", {
|
|
21217
|
+
type: "submit",
|
|
21218
|
+
className: css_className('button', 'button--primary', 'options__submit'),
|
|
21219
|
+
children: isActive ? t('translations.settings.endButtonText') : t('translations.settings.startButtonText')
|
|
21220
|
+
})
|
|
21221
|
+
})]
|
|
21222
|
+
});
|
|
21223
|
+
}
|
|
21207
21224
|
|
|
21208
|
-
|
|
21225
|
+
/* harmony default export */ var options_dialog_form = (TranslationsOptionsDialogForm);
|
|
21209
21226
|
;// CONCATENATED MODULE: ./src/javascripts/domains/translations/components/options-dialog/index.js
|
|
21210
21227
|
|
|
21211
21228
|
|
|
@@ -21837,6 +21854,36 @@ const Interrupt = ({
|
|
|
21837
21854
|
};
|
|
21838
21855
|
|
|
21839
21856
|
/* harmony default export */ var interrupt = (Interrupt);
|
|
21857
|
+
;// CONCATENATED MODULE: ./src/javascripts/ui/components/layout/privacy-disclaimer.js
|
|
21858
|
+
|
|
21859
|
+
|
|
21860
|
+
|
|
21861
|
+
|
|
21862
|
+
|
|
21863
|
+
|
|
21864
|
+
const PrivacyDisclaimer = () => {
|
|
21865
|
+
const {
|
|
21866
|
+
t
|
|
21867
|
+
} = useI18n();
|
|
21868
|
+
const {
|
|
21869
|
+
showDisclaimer
|
|
21870
|
+
} = useConfig();
|
|
21871
|
+
return showDisclaimer && jsxRuntime_module_e("div", {
|
|
21872
|
+
className: css_className('disclaimer'),
|
|
21873
|
+
tabIndex: "0",
|
|
21874
|
+
children: [jsxRuntime_module_e("h2", {
|
|
21875
|
+
className: css_className('disclaimer__title'),
|
|
21876
|
+
children: t('disclaimer.title')
|
|
21877
|
+
}), jsxRuntime_module_e("div", {
|
|
21878
|
+
className: css_className('disclaimer__message'),
|
|
21879
|
+
dangerouslySetInnerHTML: {
|
|
21880
|
+
__html: t('disclaimer.content')
|
|
21881
|
+
}
|
|
21882
|
+
})]
|
|
21883
|
+
});
|
|
21884
|
+
};
|
|
21885
|
+
|
|
21886
|
+
/* harmony default export */ var privacy_disclaimer = (PrivacyDisclaimer);
|
|
21840
21887
|
;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/component-context.js
|
|
21841
21888
|
|
|
21842
21889
|
const ComponentContext = D({});
|
|
@@ -22072,26 +22119,26 @@ const Event = ({
|
|
|
22072
22119
|
|
|
22073
22120
|
|
|
22074
22121
|
|
|
22122
|
+
|
|
22075
22123
|
const EventParticipant = ({
|
|
22076
22124
|
eventPayload
|
|
22077
22125
|
}) => {
|
|
22126
|
+
const {
|
|
22127
|
+
t
|
|
22128
|
+
} = useI18n();
|
|
22078
22129
|
const {
|
|
22079
22130
|
fromClient,
|
|
22080
22131
|
participant: participantId
|
|
22081
22132
|
} = eventPayload;
|
|
22082
22133
|
const participant = useSeamlyParticipant(participantId) || {};
|
|
22083
22134
|
const {
|
|
22084
|
-
messages
|
|
22085
|
-
defaults
|
|
22135
|
+
messages
|
|
22086
22136
|
} = useConfig();
|
|
22087
|
-
const participantName = participant && participant.name;
|
|
22137
|
+
const participantName = fromClient ? t('participants.user.name') : participant && participant.name;
|
|
22088
22138
|
const {
|
|
22089
22139
|
showAvatar,
|
|
22090
22140
|
showName
|
|
22091
22141
|
} = messages[fromClient ? 'user' : 'agent'] || {};
|
|
22092
|
-
const {
|
|
22093
|
-
userName
|
|
22094
|
-
} = defaults || {};
|
|
22095
22142
|
|
|
22096
22143
|
if (!showAvatar && !showName) {
|
|
22097
22144
|
return null;
|
|
@@ -22110,12 +22157,10 @@ const EventParticipant = ({
|
|
|
22110
22157
|
}));
|
|
22111
22158
|
}
|
|
22112
22159
|
|
|
22113
|
-
|
|
22114
|
-
|
|
22115
|
-
if (showName && authorName) {
|
|
22160
|
+
if (showName) {
|
|
22116
22161
|
authorInfo.push(jsxRuntime_module_e("span", {
|
|
22117
22162
|
className: css_className('message__author-name'),
|
|
22118
|
-
children:
|
|
22163
|
+
children: participantName
|
|
22119
22164
|
}));
|
|
22120
22165
|
}
|
|
22121
22166
|
|
|
@@ -27522,8 +27567,8 @@ const Participant = ({
|
|
|
27522
27567
|
event
|
|
27523
27568
|
}) => {
|
|
27524
27569
|
const {
|
|
27525
|
-
|
|
27526
|
-
} =
|
|
27570
|
+
agent
|
|
27571
|
+
} = useParticipants();
|
|
27527
27572
|
const {
|
|
27528
27573
|
participant
|
|
27529
27574
|
} = event.payload;
|
|
@@ -27536,7 +27581,7 @@ const Participant = ({
|
|
|
27536
27581
|
return null;
|
|
27537
27582
|
}
|
|
27538
27583
|
|
|
27539
|
-
const avatar = participant.avatar ||
|
|
27584
|
+
const avatar = participant.avatar || (agent === null || agent === void 0 ? void 0 : agent.avatar);
|
|
27540
27585
|
return jsxRuntime_module_e(EventDivider, {
|
|
27541
27586
|
graphicSrc: avatar,
|
|
27542
27587
|
graphicType: participant.avatar ? 'avatar' : undefined,
|
|
@@ -27630,8 +27675,10 @@ const UploadContent = ({
|
|
|
27630
27675
|
href: url,
|
|
27631
27676
|
download: true,
|
|
27632
27677
|
target: target || undefined,
|
|
27678
|
+
className: css_className(['download', 'download-link']),
|
|
27633
27679
|
children: children
|
|
27634
27680
|
}) : jsxRuntime_module_e("span", {
|
|
27681
|
+
className: css_className('download'),
|
|
27635
27682
|
children: children
|
|
27636
27683
|
});
|
|
27637
27684
|
|
|
@@ -27661,22 +27708,19 @@ const Upload = _ref => {
|
|
|
27661
27708
|
event: event,
|
|
27662
27709
|
type: "upload"
|
|
27663
27710
|
}, props), {}, {
|
|
27664
|
-
children: jsxRuntime_module_e(
|
|
27665
|
-
|
|
27711
|
+
children: jsxRuntime_module_e(UploadContent, {
|
|
27712
|
+
url: url,
|
|
27713
|
+
target: !fromClient ? '_blank' : undefined,
|
|
27666
27714
|
children: [jsxRuntime_module_e(icon, {
|
|
27667
27715
|
name: "download",
|
|
27668
27716
|
size: "16"
|
|
27669
|
-
}), jsxRuntime_module_e(
|
|
27670
|
-
|
|
27671
|
-
|
|
27672
|
-
children:
|
|
27673
|
-
|
|
27674
|
-
|
|
27675
|
-
|
|
27676
|
-
}), jsxRuntime_module_e("span", {
|
|
27677
|
-
className: css_className('visually-hidden'),
|
|
27678
|
-
children: srText
|
|
27679
|
-
})]
|
|
27717
|
+
}), jsxRuntime_module_e("span", {
|
|
27718
|
+
"aria-hidden": "true",
|
|
27719
|
+
className: css_className('file-download'),
|
|
27720
|
+
children: filename
|
|
27721
|
+
}), jsxRuntime_module_e("span", {
|
|
27722
|
+
className: css_className('visually-hidden'),
|
|
27723
|
+
children: srText
|
|
27680
27724
|
})]
|
|
27681
27725
|
})
|
|
27682
27726
|
}));
|
|
@@ -27737,95 +27781,6 @@ const Cta = ({
|
|
|
27737
27781
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/fill.js
|
|
27738
27782
|
var fill = __webpack_require__(4494);
|
|
27739
27783
|
var fill_default = /*#__PURE__*/__webpack_require__.n(fill);
|
|
27740
|
-
;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/components/pagination.js
|
|
27741
|
-
|
|
27742
|
-
|
|
27743
|
-
|
|
27744
|
-
|
|
27745
|
-
function CarouselPagination({
|
|
27746
|
-
items,
|
|
27747
|
-
currentIndex,
|
|
27748
|
-
onChange,
|
|
27749
|
-
getItemKey,
|
|
27750
|
-
getItemLabel
|
|
27751
|
-
}) {
|
|
27752
|
-
const itemCount = items.length;
|
|
27753
|
-
const handlePaginate = hooks_module_A(event => {
|
|
27754
|
-
const slideIndex = Number(event.target.dataset.item || '0');
|
|
27755
|
-
const nextIndex = Math.min(itemCount - 1, Math.max(0, slideIndex));
|
|
27756
|
-
|
|
27757
|
-
if (nextIndex !== currentIndex) {
|
|
27758
|
-
onChange(nextIndex);
|
|
27759
|
-
}
|
|
27760
|
-
}, [itemCount, currentIndex, onChange]);
|
|
27761
|
-
return jsxRuntime_module_e("div", {
|
|
27762
|
-
className: css_className('carousel-pagination__wrapper'),
|
|
27763
|
-
role: "group",
|
|
27764
|
-
children: jsxRuntime_module_e("ul", {
|
|
27765
|
-
className: css_className('carousel-pagination'),
|
|
27766
|
-
children: map_default()(items).call(items, (item, idx) => {
|
|
27767
|
-
const isActive = currentIndex === idx;
|
|
27768
|
-
return jsxRuntime_module_e("li", {
|
|
27769
|
-
className: css_className('carousel-pagination__item', isActive ? 'is-active' : undefined),
|
|
27770
|
-
children: jsxRuntime_module_e("button", {
|
|
27771
|
-
className: css_className('carousel-pagination__button'),
|
|
27772
|
-
type: "button",
|
|
27773
|
-
onClick: handlePaginate,
|
|
27774
|
-
"data-item": idx,
|
|
27775
|
-
"aria-disabled": isActive ? 'true' : undefined,
|
|
27776
|
-
"aria-label": getItemLabel(item, idx)
|
|
27777
|
-
})
|
|
27778
|
-
}, getItemKey(item, idx, 'pagination-item-'));
|
|
27779
|
-
})
|
|
27780
|
-
})
|
|
27781
|
-
});
|
|
27782
|
-
}
|
|
27783
|
-
;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/components/controls.js
|
|
27784
|
-
|
|
27785
|
-
|
|
27786
|
-
|
|
27787
|
-
|
|
27788
|
-
|
|
27789
|
-
function CarouselControls({
|
|
27790
|
-
items,
|
|
27791
|
-
currentIndex,
|
|
27792
|
-
onChange,
|
|
27793
|
-
children
|
|
27794
|
-
}) {
|
|
27795
|
-
const {
|
|
27796
|
-
t
|
|
27797
|
-
} = useI18n();
|
|
27798
|
-
const itemCount = items.length;
|
|
27799
|
-
|
|
27800
|
-
const handlePrevious = () => {
|
|
27801
|
-
onChange((currentIndex - 1 + itemCount) % itemCount);
|
|
27802
|
-
};
|
|
27803
|
-
|
|
27804
|
-
const handleNext = () => {
|
|
27805
|
-
onChange((currentIndex + 1) % itemCount);
|
|
27806
|
-
};
|
|
27807
|
-
|
|
27808
|
-
return jsxRuntime_module_e("div", {
|
|
27809
|
-
className: css_className('carousel-controls'),
|
|
27810
|
-
children: [jsxRuntime_module_e("button", {
|
|
27811
|
-
className: css_className('button', 'button--previous'),
|
|
27812
|
-
"aria-label": t('carousel.controls.previous'),
|
|
27813
|
-
onClick: handlePrevious,
|
|
27814
|
-
children: jsxRuntime_module_e(icon, {
|
|
27815
|
-
name: "arrowLeft",
|
|
27816
|
-
size: "16"
|
|
27817
|
-
})
|
|
27818
|
-
}), children, jsxRuntime_module_e("button", {
|
|
27819
|
-
className: css_className('button', 'button--next'),
|
|
27820
|
-
"aria-label": t('carousel.controls.next'),
|
|
27821
|
-
onClick: handleNext,
|
|
27822
|
-
children: jsxRuntime_module_e(icon, {
|
|
27823
|
-
name: "arrowRight",
|
|
27824
|
-
size: "16"
|
|
27825
|
-
})
|
|
27826
|
-
})]
|
|
27827
|
-
});
|
|
27828
|
-
}
|
|
27829
27784
|
;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/card-component.js
|
|
27830
27785
|
|
|
27831
27786
|
|
|
@@ -27966,27 +27921,116 @@ function slide_objectSpread(target) { for (var i = 1; i < arguments.length; i++)
|
|
|
27966
27921
|
|
|
27967
27922
|
|
|
27968
27923
|
|
|
27969
|
-
function CarouselMessageSlide({
|
|
27970
|
-
item: slide,
|
|
27924
|
+
function CarouselMessageSlide({
|
|
27925
|
+
item: slide,
|
|
27926
|
+
items,
|
|
27927
|
+
index,
|
|
27928
|
+
isActive
|
|
27929
|
+
}) {
|
|
27930
|
+
const {
|
|
27931
|
+
t
|
|
27932
|
+
} = useI18n();
|
|
27933
|
+
return jsxRuntime_module_e("div", {
|
|
27934
|
+
className: css_className('carousel-item', `carousel-item--${slide.type}`),
|
|
27935
|
+
role: "group",
|
|
27936
|
+
"aria-roledescription": "slide",
|
|
27937
|
+
"aria-label": t('carousel.slide.label', {
|
|
27938
|
+
index: index + 1,
|
|
27939
|
+
total: items.length
|
|
27940
|
+
}),
|
|
27941
|
+
children: jsxRuntime_module_e(card_component, slide_objectSpread(slide_objectSpread({}, slide), {}, {
|
|
27942
|
+
isCarouselItem: true,
|
|
27943
|
+
hasFocus: isActive
|
|
27944
|
+
}))
|
|
27945
|
+
});
|
|
27946
|
+
}
|
|
27947
|
+
;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/components/pagination.js
|
|
27948
|
+
|
|
27949
|
+
|
|
27950
|
+
|
|
27951
|
+
|
|
27952
|
+
function CarouselPagination({
|
|
27953
|
+
items,
|
|
27954
|
+
currentIndex,
|
|
27955
|
+
onChange,
|
|
27956
|
+
getItemKey,
|
|
27957
|
+
getItemLabel
|
|
27958
|
+
}) {
|
|
27959
|
+
const itemCount = items.length;
|
|
27960
|
+
const handlePaginate = hooks_module_A(event => {
|
|
27961
|
+
const slideIndex = Number(event.target.dataset.item || '0');
|
|
27962
|
+
const nextIndex = Math.min(itemCount - 1, Math.max(0, slideIndex));
|
|
27963
|
+
|
|
27964
|
+
if (nextIndex !== currentIndex) {
|
|
27965
|
+
onChange(nextIndex);
|
|
27966
|
+
}
|
|
27967
|
+
}, [itemCount, currentIndex, onChange]);
|
|
27968
|
+
return jsxRuntime_module_e("div", {
|
|
27969
|
+
className: css_className('carousel-pagination__wrapper'),
|
|
27970
|
+
role: "group",
|
|
27971
|
+
children: jsxRuntime_module_e("ul", {
|
|
27972
|
+
className: css_className('carousel-pagination'),
|
|
27973
|
+
children: map_default()(items).call(items, (item, idx) => {
|
|
27974
|
+
const isActive = currentIndex === idx;
|
|
27975
|
+
return jsxRuntime_module_e("li", {
|
|
27976
|
+
className: css_className('carousel-pagination__item', isActive ? 'is-active' : undefined),
|
|
27977
|
+
children: jsxRuntime_module_e("button", {
|
|
27978
|
+
className: css_className('carousel-pagination__button'),
|
|
27979
|
+
type: "button",
|
|
27980
|
+
onClick: handlePaginate,
|
|
27981
|
+
"data-item": idx,
|
|
27982
|
+
"aria-disabled": isActive ? 'true' : undefined,
|
|
27983
|
+
"aria-label": getItemLabel(item, idx)
|
|
27984
|
+
})
|
|
27985
|
+
}, getItemKey(item, idx, 'pagination-item-'));
|
|
27986
|
+
})
|
|
27987
|
+
})
|
|
27988
|
+
});
|
|
27989
|
+
}
|
|
27990
|
+
;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/components/controls.js
|
|
27991
|
+
|
|
27992
|
+
|
|
27993
|
+
|
|
27994
|
+
|
|
27995
|
+
|
|
27996
|
+
function CarouselControls({
|
|
27971
27997
|
items,
|
|
27972
|
-
|
|
27973
|
-
|
|
27998
|
+
currentIndex,
|
|
27999
|
+
onChange,
|
|
28000
|
+
children
|
|
27974
28001
|
}) {
|
|
27975
28002
|
const {
|
|
27976
28003
|
t
|
|
27977
28004
|
} = useI18n();
|
|
28005
|
+
const itemCount = items.length;
|
|
28006
|
+
|
|
28007
|
+
const handlePrevious = () => {
|
|
28008
|
+
onChange((currentIndex - 1 + itemCount) % itemCount);
|
|
28009
|
+
};
|
|
28010
|
+
|
|
28011
|
+
const handleNext = () => {
|
|
28012
|
+
onChange((currentIndex + 1) % itemCount);
|
|
28013
|
+
};
|
|
28014
|
+
|
|
27978
28015
|
return jsxRuntime_module_e("div", {
|
|
27979
|
-
className: css_className('carousel-
|
|
27980
|
-
|
|
27981
|
-
|
|
27982
|
-
|
|
27983
|
-
|
|
27984
|
-
|
|
27985
|
-
|
|
27986
|
-
|
|
27987
|
-
|
|
27988
|
-
|
|
27989
|
-
|
|
28016
|
+
className: css_className('carousel-controls'),
|
|
28017
|
+
children: [jsxRuntime_module_e("button", {
|
|
28018
|
+
className: css_className('button', 'button--previous'),
|
|
28019
|
+
"aria-label": t('carousel.controls.previous'),
|
|
28020
|
+
onClick: handlePrevious,
|
|
28021
|
+
children: jsxRuntime_module_e(icon, {
|
|
28022
|
+
name: "arrowLeft",
|
|
28023
|
+
size: "16"
|
|
28024
|
+
})
|
|
28025
|
+
}), children, jsxRuntime_module_e("button", {
|
|
28026
|
+
className: css_className('button', 'button--next'),
|
|
28027
|
+
"aria-label": t('carousel.controls.next'),
|
|
28028
|
+
onClick: handleNext,
|
|
28029
|
+
children: jsxRuntime_module_e(icon, {
|
|
28030
|
+
name: "arrowRight",
|
|
28031
|
+
size: "16"
|
|
28032
|
+
})
|
|
28033
|
+
})]
|
|
27990
28034
|
});
|
|
27991
28035
|
}
|
|
27992
28036
|
;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/event/carousel-component/index.js
|
|
@@ -28357,36 +28401,6 @@ const ComponentFilter = ({
|
|
|
28357
28401
|
};
|
|
28358
28402
|
|
|
28359
28403
|
/* harmony default export */ var component_filter = (ComponentFilter);
|
|
28360
|
-
;// CONCATENATED MODULE: ./src/javascripts/ui/components/layout/privacy-disclaimer.js
|
|
28361
|
-
|
|
28362
|
-
|
|
28363
|
-
|
|
28364
|
-
|
|
28365
|
-
|
|
28366
|
-
|
|
28367
|
-
const PrivacyDisclaimer = () => {
|
|
28368
|
-
const {
|
|
28369
|
-
t
|
|
28370
|
-
} = useI18n();
|
|
28371
|
-
const {
|
|
28372
|
-
showDisclaimer
|
|
28373
|
-
} = useConfig();
|
|
28374
|
-
return showDisclaimer && jsxRuntime_module_e("div", {
|
|
28375
|
-
className: css_className('disclaimer'),
|
|
28376
|
-
tabIndex: "0",
|
|
28377
|
-
children: [jsxRuntime_module_e("h2", {
|
|
28378
|
-
className: css_className('disclaimer__title'),
|
|
28379
|
-
children: t('disclaimer.title')
|
|
28380
|
-
}), jsxRuntime_module_e("div", {
|
|
28381
|
-
className: css_className('disclaimer__message'),
|
|
28382
|
-
dangerouslySetInnerHTML: {
|
|
28383
|
-
__html: t('disclaimer.content')
|
|
28384
|
-
}
|
|
28385
|
-
})]
|
|
28386
|
-
});
|
|
28387
|
-
};
|
|
28388
|
-
|
|
28389
|
-
/* harmony default export */ var privacy_disclaimer = (PrivacyDisclaimer);
|
|
28390
28404
|
;// CONCATENATED MODULE: ./src/javascripts/ui/components/conversation/conversation.js
|
|
28391
28405
|
|
|
28392
28406
|
|
|
@@ -28869,7 +28883,7 @@ function TextEntryForm({
|
|
|
28869
28883
|
}), jsxRuntime_module_e("button", {
|
|
28870
28884
|
className: css_className('button', 'input__submit'),
|
|
28871
28885
|
type: "submit",
|
|
28872
|
-
disabled: !hasValue || reachedCharacterLimit,
|
|
28886
|
+
"aria-disabled": !hasValue || reachedCharacterLimit ? 'true' : null,
|
|
28873
28887
|
children: jsxRuntime_module_e(icon, {
|
|
28874
28888
|
name: "send",
|
|
28875
28889
|
size: "32",
|
|
@@ -29010,9 +29024,9 @@ const UploadToggle = () => {
|
|
|
29010
29024
|
children: jsxRuntime_module_e("button", {
|
|
29011
29025
|
className: css_className(['button', 'button--secondary', 'upload-toggle']),
|
|
29012
29026
|
ref: uploadButton,
|
|
29013
|
-
disabled: !showUploadButton ? 'true' : null,
|
|
29027
|
+
"aria-disabled": !showUploadButton ? 'true' : null,
|
|
29014
29028
|
type: "button",
|
|
29015
|
-
onClick: onClickHandler,
|
|
29029
|
+
onClick: showUploadButton ? onClickHandler : null,
|
|
29016
29030
|
children: jsxRuntime_module_e(icon, {
|
|
29017
29031
|
name: "file",
|
|
29018
29032
|
size: "32",
|
|
@@ -29887,7 +29901,7 @@ const OptionsButton = () => {
|
|
|
29887
29901
|
ref: item => {
|
|
29888
29902
|
menuItemButtons.current[i] = item;
|
|
29889
29903
|
},
|
|
29890
|
-
className: css_className(['button', 'button--secondary'
|
|
29904
|
+
className: css_className(['button', 'button--secondary']),
|
|
29891
29905
|
onKeyDown: e => onMenuItemKeyDownHandler(e, i),
|
|
29892
29906
|
onKeyPress: e => onKeyPressHandler(e, i),
|
|
29893
29907
|
onClick: () => onMenuItemClickHandler(name, available),
|
|
@@ -29904,7 +29918,7 @@ const OptionsButton = () => {
|
|
|
29904
29918
|
})
|
|
29905
29919
|
}), jsxRuntime_module_e("button", {
|
|
29906
29920
|
type: "button",
|
|
29907
|
-
className: css_className(['button', 'button--secondary', 'chat__options__button', ...(!multiMenu && firstOptionName ? [`chat__options__button--${firstOptionName}`] : [])
|
|
29921
|
+
className: css_className(['button', 'button--secondary', 'chat__options__button', ...(!multiMenu && firstOptionName ? [`chat__options__button--${firstOptionName}`] : [])]),
|
|
29908
29922
|
id: id,
|
|
29909
29923
|
onClick: onClickHandler,
|
|
29910
29924
|
onKeyDown: multiMenu ? onButtonKeyDownHandler : null,
|
|
@@ -30010,7 +30024,7 @@ function ChatFrame({
|
|
|
30010
30024
|
children: [jsxRuntime_module_e(TranslationsChatStatus, {}), jsxRuntime_module_e("div", {
|
|
30011
30025
|
className: css_className('chat__container'),
|
|
30012
30026
|
children: getContent()
|
|
30013
|
-
}), jsxRuntime_module_e(AppOptions, {})]
|
|
30027
|
+
}), isOpen && jsxRuntime_module_e(AppOptions, {})]
|
|
30014
30028
|
});
|
|
30015
30029
|
}
|
|
30016
30030
|
|
|
@@ -30157,18 +30171,16 @@ const InlineView = () => {
|
|
|
30157
30171
|
|
|
30158
30172
|
|
|
30159
30173
|
const ButtonIcon = () => {
|
|
30174
|
+
const startChatIcon = useStartChatIcon();
|
|
30160
30175
|
const currentAgent = useSeamlyCurrentAgent();
|
|
30161
30176
|
const {
|
|
30162
30177
|
hasInterrupt
|
|
30163
30178
|
} = useInterrupt();
|
|
30164
|
-
const
|
|
30165
|
-
|
|
30166
|
-
|
|
30167
|
-
|
|
30168
|
-
|
|
30169
|
-
return avatar || startChatIcon ? jsxRuntime_module_e("img", {
|
|
30170
|
-
className: css_className(avatar ? 'avatar' : 'icon'),
|
|
30171
|
-
src: avatar || startChatIcon,
|
|
30179
|
+
const isActiveConversation = currentAgent && !hasInterrupt;
|
|
30180
|
+
const src = isActiveConversation ? currentAgent.avatar : startChatIcon;
|
|
30181
|
+
return src ? jsxRuntime_module_e("img", {
|
|
30182
|
+
className: css_className(isActiveConversation ? 'avatar' : 'icon'),
|
|
30183
|
+
src: src,
|
|
30172
30184
|
alt: ""
|
|
30173
30185
|
}) : jsxRuntime_module_e(icon, {
|
|
30174
30186
|
name: "avatar",
|
|
@@ -30395,6 +30407,53 @@ const View = () => {
|
|
|
30395
30407
|
};
|
|
30396
30408
|
|
|
30397
30409
|
/* harmony default export */ var view = (View);
|
|
30410
|
+
;// CONCATENATED MODULE: ./src/javascripts/domains/errors/index.js
|
|
30411
|
+
|
|
30412
|
+
|
|
30413
|
+
const {
|
|
30414
|
+
createAction: errors_createAction
|
|
30415
|
+
} = createDomain('errors');
|
|
30416
|
+
const catchError = errors_createAction('catch-error', error => ({
|
|
30417
|
+
error
|
|
30418
|
+
}));
|
|
30419
|
+
function errors_createMiddleware({
|
|
30420
|
+
api: seamlyApi
|
|
30421
|
+
}) {
|
|
30422
|
+
return ({
|
|
30423
|
+
getState
|
|
30424
|
+
}) => {
|
|
30425
|
+
const handleError = action => {
|
|
30426
|
+
const {
|
|
30427
|
+
errorCallback,
|
|
30428
|
+
namespace,
|
|
30429
|
+
api,
|
|
30430
|
+
layoutMode
|
|
30431
|
+
} = selectConfig(getState());
|
|
30432
|
+
errorCallback === null || errorCallback === void 0 ? void 0 : errorCallback(action.error, {
|
|
30433
|
+
namespace,
|
|
30434
|
+
api,
|
|
30435
|
+
layoutMode,
|
|
30436
|
+
conversationUrl: seamlyApi.getConversationUrl(),
|
|
30437
|
+
action: action.type ? action : undefined
|
|
30438
|
+
});
|
|
30439
|
+
};
|
|
30440
|
+
|
|
30441
|
+
return next => action => {
|
|
30442
|
+
try {
|
|
30443
|
+
if (action.error) {
|
|
30444
|
+
handleError(action);
|
|
30445
|
+
}
|
|
30446
|
+
|
|
30447
|
+
return next(action);
|
|
30448
|
+
} catch (error) {
|
|
30449
|
+
handleError({
|
|
30450
|
+
error
|
|
30451
|
+
});
|
|
30452
|
+
throw error;
|
|
30453
|
+
}
|
|
30454
|
+
};
|
|
30455
|
+
};
|
|
30456
|
+
}
|
|
30398
30457
|
;// CONCATENATED MODULE: ./src/javascripts/ui/components/core/seamly-instance-functions-loader.js
|
|
30399
30458
|
|
|
30400
30459
|
|
|
@@ -31286,53 +31345,6 @@ const SeamlyFileUpload = ({
|
|
|
31286
31345
|
};
|
|
31287
31346
|
|
|
31288
31347
|
/* harmony default export */ var seamly_file_upload = (SeamlyFileUpload);
|
|
31289
|
-
;// CONCATENATED MODULE: ./src/javascripts/domains/errors/index.js
|
|
31290
|
-
|
|
31291
|
-
|
|
31292
|
-
const {
|
|
31293
|
-
createAction: errors_createAction
|
|
31294
|
-
} = createDomain('errors');
|
|
31295
|
-
const catchError = errors_createAction('catch-error', error => ({
|
|
31296
|
-
error
|
|
31297
|
-
}));
|
|
31298
|
-
function errors_createMiddleware({
|
|
31299
|
-
api: seamlyApi
|
|
31300
|
-
}) {
|
|
31301
|
-
return ({
|
|
31302
|
-
getState
|
|
31303
|
-
}) => {
|
|
31304
|
-
const handleError = action => {
|
|
31305
|
-
const {
|
|
31306
|
-
errorCallback,
|
|
31307
|
-
namespace,
|
|
31308
|
-
api,
|
|
31309
|
-
layoutMode
|
|
31310
|
-
} = selectConfig(getState());
|
|
31311
|
-
errorCallback === null || errorCallback === void 0 ? void 0 : errorCallback(action.error, {
|
|
31312
|
-
namespace,
|
|
31313
|
-
api,
|
|
31314
|
-
layoutMode,
|
|
31315
|
-
conversationUrl: seamlyApi.getConversationUrl(),
|
|
31316
|
-
action: action.type ? action : undefined
|
|
31317
|
-
});
|
|
31318
|
-
};
|
|
31319
|
-
|
|
31320
|
-
return next => action => {
|
|
31321
|
-
try {
|
|
31322
|
-
if (action.error) {
|
|
31323
|
-
handleError(action);
|
|
31324
|
-
}
|
|
31325
|
-
|
|
31326
|
-
return next(action);
|
|
31327
|
-
} catch (error) {
|
|
31328
|
-
handleError({
|
|
31329
|
-
error
|
|
31330
|
-
});
|
|
31331
|
-
throw error;
|
|
31332
|
-
}
|
|
31333
|
-
};
|
|
31334
|
-
};
|
|
31335
|
-
}
|
|
31336
31348
|
;// CONCATENATED MODULE: ./src/javascripts/ui/components/core/seamly-core.js
|
|
31337
31349
|
|
|
31338
31350
|
|
|
@@ -31445,11 +31457,43 @@ function objectStore(key, storageProvider) {
|
|
|
31445
31457
|
|
|
31446
31458
|
};
|
|
31447
31459
|
}
|
|
31448
|
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/object/get-own-property-names.js
|
|
31449
|
-
var get_own_property_names = __webpack_require__(8604);
|
|
31450
31460
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/json/stringify.js
|
|
31451
31461
|
var stringify = __webpack_require__(9340);
|
|
31452
31462
|
var stringify_default = /*#__PURE__*/__webpack_require__.n(stringify);
|
|
31463
|
+
;// CONCATENATED MODULE: ./src/javascripts/lib/store/providers/session-storage.js
|
|
31464
|
+
|
|
31465
|
+
|
|
31466
|
+
function store(key) {
|
|
31467
|
+
const KEY = 'cvco.' + key;
|
|
31468
|
+
return {
|
|
31469
|
+
get() {
|
|
31470
|
+
var _context;
|
|
31471
|
+
|
|
31472
|
+
const candidates = [KEY, slice_default()(_context = KEY.split('.')).call(_context, 0, -1).join('.')];
|
|
31473
|
+
let val;
|
|
31474
|
+
|
|
31475
|
+
do {
|
|
31476
|
+
val = sessionStorage.getItem(candidates[0]);
|
|
31477
|
+
} while (candidates.shift() && !val);
|
|
31478
|
+
|
|
31479
|
+
return JSON.parse(val);
|
|
31480
|
+
},
|
|
31481
|
+
|
|
31482
|
+
set(value) {
|
|
31483
|
+
if (!value) {
|
|
31484
|
+
return;
|
|
31485
|
+
}
|
|
31486
|
+
|
|
31487
|
+
sessionStorage.setItem(KEY, stringify_default()(value));
|
|
31488
|
+
}
|
|
31489
|
+
|
|
31490
|
+
};
|
|
31491
|
+
}
|
|
31492
|
+
// EXTERNAL MODULE: ./src/javascripts/lib/debug.js
|
|
31493
|
+
var debug = __webpack_require__(1905);
|
|
31494
|
+
var debug_default = /*#__PURE__*/__webpack_require__.n(debug);
|
|
31495
|
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/object/get-own-property-names.js
|
|
31496
|
+
var get_own_property_names = __webpack_require__(8604);
|
|
31453
31497
|
;// CONCATENATED MODULE: ./node_modules/phoenix/priv/static/phoenix.esm.js
|
|
31454
31498
|
|
|
31455
31499
|
|
|
@@ -32951,9 +32995,6 @@ const splitUrlParams = url => {
|
|
|
32951
32995
|
};
|
|
32952
32996
|
|
|
32953
32997
|
/* harmony default export */ var split_url_params = (splitUrlParams);
|
|
32954
|
-
// EXTERNAL MODULE: ./src/javascripts/lib/debug.js
|
|
32955
|
-
var debug = __webpack_require__(1905);
|
|
32956
|
-
var debug_default = /*#__PURE__*/__webpack_require__.n(debug);
|
|
32957
32998
|
;// CONCATENATED MODULE: ./src/javascripts/api/producer.js
|
|
32958
32999
|
|
|
32959
33000
|
|
|
@@ -33125,35 +33166,6 @@ class ConversationProducer {
|
|
|
33125
33166
|
}
|
|
33126
33167
|
|
|
33127
33168
|
}
|
|
33128
|
-
;// CONCATENATED MODULE: ./src/javascripts/lib/store/providers/session-storage.js
|
|
33129
|
-
|
|
33130
|
-
|
|
33131
|
-
function store(key) {
|
|
33132
|
-
const KEY = 'cvco.' + key;
|
|
33133
|
-
return {
|
|
33134
|
-
get() {
|
|
33135
|
-
var _context;
|
|
33136
|
-
|
|
33137
|
-
const candidates = [KEY, slice_default()(_context = KEY.split('.')).call(_context, 0, -1).join('.')];
|
|
33138
|
-
let val;
|
|
33139
|
-
|
|
33140
|
-
do {
|
|
33141
|
-
val = sessionStorage.getItem(candidates[0]);
|
|
33142
|
-
} while (candidates.shift() && !val);
|
|
33143
|
-
|
|
33144
|
-
return JSON.parse(val);
|
|
33145
|
-
},
|
|
33146
|
-
|
|
33147
|
-
set(value) {
|
|
33148
|
-
if (!value) {
|
|
33149
|
-
return;
|
|
33150
|
-
}
|
|
33151
|
-
|
|
33152
|
-
sessionStorage.setItem(KEY, stringify_default()(value));
|
|
33153
|
-
}
|
|
33154
|
-
|
|
33155
|
-
};
|
|
33156
|
-
}
|
|
33157
33169
|
;// CONCATENATED MODULE: ./src/javascripts/api/event-producer.js
|
|
33158
33170
|
class EventProducer {
|
|
33159
33171
|
constructor(name) {
|
|
@@ -33265,15 +33277,6 @@ function getTimeZone() {
|
|
|
33265
33277
|
}
|
|
33266
33278
|
}
|
|
33267
33279
|
|
|
33268
|
-
function getEnvironment() {
|
|
33269
|
-
return {
|
|
33270
|
-
screenResolution: `${window.screen.width}x${window.screen.height}`,
|
|
33271
|
-
userAgent: navigator.userAgent,
|
|
33272
|
-
currentUrl: window.location.toString(),
|
|
33273
|
-
timezone: getTimeZone()
|
|
33274
|
-
};
|
|
33275
|
-
}
|
|
33276
|
-
|
|
33277
33280
|
class API {
|
|
33278
33281
|
/**
|
|
33279
33282
|
* Creates an instance of API.
|
|
@@ -33283,6 +33286,7 @@ class API {
|
|
|
33283
33286
|
* @param {string} config.secure Connect securely
|
|
33284
33287
|
* @param {string} config.externalId Unique visitor identifier (optional)
|
|
33285
33288
|
* @param {boolean} config.sendEnvironment
|
|
33289
|
+
* @param {string} layoutMode
|
|
33286
33290
|
* @param {string} namespace
|
|
33287
33291
|
* @param {Object} [context={ channelName: undefined, variables: undefined, locale: undefined }]
|
|
33288
33292
|
* @param {string} context.channelName
|
|
@@ -33291,6 +33295,7 @@ class API {
|
|
|
33291
33295
|
* @memberof API
|
|
33292
33296
|
*/
|
|
33293
33297
|
constructor({
|
|
33298
|
+
layoutMode,
|
|
33294
33299
|
namespace,
|
|
33295
33300
|
config = {},
|
|
33296
33301
|
context = {}
|
|
@@ -33312,6 +33317,7 @@ class API {
|
|
|
33312
33317
|
this.connected = false;
|
|
33313
33318
|
this.configReady = false;
|
|
33314
33319
|
this.externalId = config.externalId;
|
|
33320
|
+
this.layoutMode = layoutMode;
|
|
33315
33321
|
this.internalProducer = new EventProducer('API');
|
|
33316
33322
|
this.internal$ = xstream_default().create(this.internalProducer).flatten();
|
|
33317
33323
|
this.connection$ = filter_default()(_context = this.internal$).call(_context, event => event.type === 'connection');
|
|
@@ -33438,7 +33444,7 @@ class API {
|
|
|
33438
33444
|
v: apiVersion
|
|
33439
33445
|
}).send({
|
|
33440
33446
|
context: api_objectSpread(api_objectSpread({}, this.config.context), {}, {
|
|
33441
|
-
environment: this.config.sendEnvironment === true ? getEnvironment() : this.config.sendEnvironment
|
|
33447
|
+
environment: this.config.sendEnvironment === true ? this.getEnvironment() : this.config.sendEnvironment
|
|
33442
33448
|
})
|
|
33443
33449
|
}).then(({
|
|
33444
33450
|
body
|
|
@@ -33452,7 +33458,7 @@ class API {
|
|
|
33452
33458
|
}
|
|
33453
33459
|
|
|
33454
33460
|
if (error.status >= 500) {
|
|
33455
|
-
throw new SeamlyGeneralError();
|
|
33461
|
+
throw new SeamlyGeneralError(error);
|
|
33456
33462
|
}
|
|
33457
33463
|
|
|
33458
33464
|
throw error;
|
|
@@ -33526,7 +33532,7 @@ class API {
|
|
|
33526
33532
|
|
|
33527
33533
|
if (this.config.sendEnvironment) {
|
|
33528
33534
|
this.send('context', {
|
|
33529
|
-
environment: this.config.sendEnvironment === true ? getEnvironment() : this.config.sendEnvironment
|
|
33535
|
+
environment: this.config.sendEnvironment === true ? this.getEnvironment() : this.config.sendEnvironment
|
|
33530
33536
|
}, false);
|
|
33531
33537
|
}
|
|
33532
33538
|
|
|
@@ -33656,6 +33662,18 @@ class API {
|
|
|
33656
33662
|
return filter_default()(_context5 = this.internal$).call(_context5, event => event.type !== 'connection');
|
|
33657
33663
|
}
|
|
33658
33664
|
|
|
33665
|
+
getEnvironment() {
|
|
33666
|
+
return {
|
|
33667
|
+
clientName: PACKAGE_NAME,
|
|
33668
|
+
clientVariant: this.layoutMode,
|
|
33669
|
+
clientVersion: PACKAGE_VERSION,
|
|
33670
|
+
currentUrl: window.location.toString(),
|
|
33671
|
+
screenResolution: `${window.screen.width}x${window.screen.height}`,
|
|
33672
|
+
timezone: getTimeZone(),
|
|
33673
|
+
userAgent: navigator.userAgent
|
|
33674
|
+
};
|
|
33675
|
+
}
|
|
33676
|
+
|
|
33659
33677
|
}
|
|
33660
33678
|
;// CONCATENATED MODULE: ./node_modules/redux-thunk/es/index.js
|
|
33661
33679
|
function createThunkMiddleware(extraArgument) {
|
|
@@ -33810,11 +33828,11 @@ function store_createStore({
|
|
|
33810
33828
|
api,
|
|
33811
33829
|
eventBus,
|
|
33812
33830
|
config
|
|
33813
|
-
}), createMiddleware(
|
|
33831
|
+
}), createMiddleware({
|
|
33814
33832
|
api
|
|
33815
33833
|
}), options_middleware_createMiddleware({
|
|
33816
33834
|
api
|
|
33817
|
-
}),
|
|
33835
|
+
}), middleware_createMiddleware()]
|
|
33818
33836
|
});
|
|
33819
33837
|
return store;
|
|
33820
33838
|
}
|
|
@@ -33862,6 +33880,7 @@ class Engine {
|
|
|
33862
33880
|
this.parentElement = parentElement;
|
|
33863
33881
|
this.externalApi = externalApi;
|
|
33864
33882
|
this.api = new API({
|
|
33883
|
+
layoutMode: config.layoutMode,
|
|
33865
33884
|
namespace: config.namespace,
|
|
33866
33885
|
config: config.api,
|
|
33867
33886
|
context: config.context
|
|
@@ -34179,13 +34198,8 @@ const AgentInfo = () => {
|
|
|
34179
34198
|
const {
|
|
34180
34199
|
hasInterrupt
|
|
34181
34200
|
} = useInterrupt();
|
|
34182
|
-
const
|
|
34183
|
-
|
|
34184
|
-
} = useConfig();
|
|
34185
|
-
const {
|
|
34186
|
-
startChatIcon
|
|
34187
|
-
} = defaults || {};
|
|
34188
|
-
const avatar = currentAgent && !hasInterrupt ? currentAgent.avatar : null;
|
|
34201
|
+
const startChatIcon = useStartChatIcon();
|
|
34202
|
+
const src = (currentAgent === null || currentAgent === void 0 ? void 0 : currentAgent.avatar) ?? startChatIcon;
|
|
34189
34203
|
const displaySubtitle = hasInterrupt ? '' : subTitle;
|
|
34190
34204
|
const classNames = ['message-count'];
|
|
34191
34205
|
|
|
@@ -34197,13 +34211,13 @@ const AgentInfo = () => {
|
|
|
34197
34211
|
classNames.push('message-count__empty');
|
|
34198
34212
|
}
|
|
34199
34213
|
|
|
34200
|
-
return (
|
|
34214
|
+
return (displaySubtitle || !isOpen) && jsxRuntime_module_e("div", {
|
|
34201
34215
|
className: css_className('agent-info'),
|
|
34202
34216
|
children: [jsxRuntime_module_e("div", {
|
|
34203
34217
|
className: css_className('agent-info__graphic'),
|
|
34204
|
-
children: [
|
|
34205
|
-
className: css_className(avatar ? 'avatar' : 'icon'),
|
|
34206
|
-
src:
|
|
34218
|
+
children: [src ? jsxRuntime_module_e("img", {
|
|
34219
|
+
className: css_className(currentAgent !== null && currentAgent !== void 0 && currentAgent.avatar ? 'avatar' : 'icon'),
|
|
34220
|
+
src: src,
|
|
34207
34221
|
alt: ""
|
|
34208
34222
|
}) : jsxRuntime_module_e(icon, {
|
|
34209
34223
|
name: "avatar",
|