@cognigy/webchat 3.50.0 → 3.51.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/OSS_LICENSES.txt +4 -4
- package/dist/webchat.esm.js +714 -224
- package/dist/webchat.js +30 -30
- package/package.json +3 -3
package/dist/webchat.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* webchat.esm.js v3.
|
|
3
|
-
* https://github.com/Cognigy/Webchat/tree/v3.
|
|
4
|
-
* https://github.com/Cognigy/Webchat/tree/v3.
|
|
2
|
+
* webchat.esm.js v3.51.0
|
|
3
|
+
* https://github.com/Cognigy/Webchat/tree/v3.51.0
|
|
4
|
+
* https://github.com/Cognigy/Webchat/tree/v3.51.0/OSS_LICENSES.txt
|
|
5
5
|
*/
|
|
6
6
|
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
|
|
7
7
|
import * as __WEBPACK_EXTERNAL_MODULE_react_dom_7dac9eee__ from "react-dom";
|
|
@@ -35390,17 +35390,19 @@ const DeleteConfirmModal = props => {
|
|
|
35390
35390
|
cancelButtonBackground,
|
|
35391
35391
|
confirmButtonBackground
|
|
35392
35392
|
} = props;
|
|
35393
|
+
|
|
35394
|
+
// Focus the safe default (Cancel) action via the Modal's deferred focus
|
|
35395
|
+
// path, not React's autoFocus: autoFocus fires in the same task that
|
|
35396
|
+
// inserts the dialog subtree, and VoiceOver then reads a stale
|
|
35397
|
+
// accessibility tree — the dialog role/title and the focused button are
|
|
35398
|
+
// never announced (CGY-3274). The deferral lets the tree settle first.
|
|
35399
|
+
const cancelButtonRef = react__WEBPACK_IMPORTED_MODULE_0__["default"].useRef(null);
|
|
35393
35400
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(_Modal__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A, {
|
|
35394
35401
|
footer: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(react__WEBPACK_IMPORTED_MODULE_0__["default"].Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(CancelButton, {
|
|
35402
|
+
ref: cancelButtonRef,
|
|
35395
35403
|
className: "webchat-delete-confirmation-cancel-button",
|
|
35396
35404
|
onClick: () => onClose(false),
|
|
35397
35405
|
background: cancelButtonBackground
|
|
35398
|
-
// Intentional: move focus to the safe default (Cancel) action
|
|
35399
|
-
// when this confirmation modal opens — expected dialog focus
|
|
35400
|
-
// management, not an unexpected focus shift.
|
|
35401
|
-
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
35402
|
-
,
|
|
35403
|
-
autoFocus: true
|
|
35404
35406
|
}, cancelText), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(DeleteConfirmation, {
|
|
35405
35407
|
className: "webchat-delete-confirmation-confirm-button",
|
|
35406
35408
|
onClick: onConfirmDelete,
|
|
@@ -35408,7 +35410,8 @@ const DeleteConfirmModal = props => {
|
|
|
35408
35410
|
}, confirmText)),
|
|
35409
35411
|
isOpen: isOpen,
|
|
35410
35412
|
onClose: onClose,
|
|
35411
|
-
title: title
|
|
35413
|
+
title: title,
|
|
35414
|
+
initialFocusRef: cancelButtonRef
|
|
35412
35415
|
}, children);
|
|
35413
35416
|
};
|
|
35414
35417
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DeleteConfirmModal);
|
|
@@ -35774,21 +35777,22 @@ const Modal = ({
|
|
|
35774
35777
|
/* harmony import */ var _plugins_input_file_DropZone__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(1339);
|
|
35775
35778
|
/* harmony import */ var react_transition_group__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(66492);
|
|
35776
35779
|
/* harmony import */ var _presentational_TeaserMessage__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(49888);
|
|
35777
|
-
/* harmony import */ var
|
|
35778
|
-
/* harmony import */ var
|
|
35779
|
-
/* harmony import */ var
|
|
35780
|
-
/* harmony import */ var
|
|
35781
|
-
/* harmony import */ var
|
|
35782
|
-
/* harmony import */ var
|
|
35783
|
-
/* harmony import */ var
|
|
35784
|
-
/* harmony import */ var
|
|
35785
|
-
/* harmony import */ var
|
|
35786
|
-
/* harmony import */ var
|
|
35787
|
-
/* harmony import */ var
|
|
35788
|
-
/* harmony import */ var
|
|
35789
|
-
/* harmony import */ var
|
|
35790
|
-
/* harmony import */ var
|
|
35791
|
-
/* harmony import */ var
|
|
35780
|
+
/* harmony import */ var _presentational_TeaserMessageAnnouncer__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(59359);
|
|
35781
|
+
/* harmony import */ var _functional_xapp_overlay_XAppOverlay__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(12381);
|
|
35782
|
+
/* harmony import */ var _utils_sourceMapping__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(25091);
|
|
35783
|
+
/* harmony import */ var _plugins_speech_output__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(83679);
|
|
35784
|
+
/* harmony import */ var _utils_filter_out_control_commands__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(70562);
|
|
35785
|
+
/* harmony import */ var _utils_isMobile__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(40794);
|
|
35786
|
+
/* harmony import */ var _webchat_helper_handleMarkdown__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(71621);
|
|
35787
|
+
/* harmony import */ var _presentational_previous_conversations_DeleteAllConversations__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(5196);
|
|
35788
|
+
/* harmony import */ var _presentational_ScreenReaderLiveRegion__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(41426);
|
|
35789
|
+
/* harmony import */ var _presentational_StatusLiveRegion__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(63813);
|
|
35790
|
+
/* harmony import */ var _presentational_FreezeOnExit__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(97475);
|
|
35791
|
+
/* harmony import */ var _presentational_HomeScreenAnnouncer__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(55115);
|
|
35792
|
+
/* harmony import */ var _utils_ai_agent_notice__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(39191);
|
|
35793
|
+
/* harmony import */ var _utils_screen_visibility__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(48245);
|
|
35794
|
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(14176);
|
|
35795
|
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_57___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_57__);
|
|
35792
35796
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
35793
35797
|
|
|
35794
35798
|
|
|
@@ -35845,6 +35849,7 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
35845
35849
|
|
|
35846
35850
|
|
|
35847
35851
|
|
|
35852
|
+
|
|
35848
35853
|
|
|
35849
35854
|
|
|
35850
35855
|
const stylisPlugins = [(0,_utils_css__WEBPACK_IMPORTED_MODULE_8__/* .isolate */ .az)("[data-cognigy-webchat-root]")];
|
|
@@ -35949,7 +35954,7 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
35949
35954
|
deleteConversationsModalState: false,
|
|
35950
35955
|
liveContent: {},
|
|
35951
35956
|
isMobile: false,
|
|
35952
|
-
noticeSession:
|
|
35957
|
+
noticeSession: _utils_ai_agent_notice__WEBPACK_IMPORTED_MODULE_55__/* .INITIAL_NOTICE_SESSION */ .j_
|
|
35953
35958
|
};
|
|
35954
35959
|
unreadTitleIndicatorInterval = null;
|
|
35955
35960
|
originalTitle = window.document.title;
|
|
@@ -35997,9 +36002,9 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
35997
36002
|
const secondaryColor = props?.config?.settings?.colors?.secondaryColor;
|
|
35998
36003
|
const chatInterfaceColor = props?.config?.settings?.colors?.chatInterfaceColor;
|
|
35999
36004
|
const sourceColorMapping = props?.config?.settings?.widgetSettings?.sourceColorMapping;
|
|
36000
|
-
const overrideBotMessageColor = (0,
|
|
36001
|
-
const overrideUserMessageColor = (0,
|
|
36002
|
-
const overrideAgentMessageColor = (0,
|
|
36005
|
+
const overrideBotMessageColor = (0,_utils_sourceMapping__WEBPACK_IMPORTED_MODULE_45__/* .getSourceBackgroundColor */ .N)(sourceColorMapping?.bot, props?.config?.settings?.colors);
|
|
36006
|
+
const overrideUserMessageColor = (0,_utils_sourceMapping__WEBPACK_IMPORTED_MODULE_45__/* .getSourceBackgroundColor */ .N)(sourceColorMapping?.user, props?.config?.settings?.colors);
|
|
36007
|
+
const overrideAgentMessageColor = (0,_utils_sourceMapping__WEBPACK_IMPORTED_MODULE_45__/* .getSourceBackgroundColor */ .N)(sourceColorMapping?.agent, props?.config?.settings?.colors);
|
|
36003
36008
|
const overrideBotMessageBorderColor = sourceColorMapping?.bot === "user" ? "transparent" : null;
|
|
36004
36009
|
const overrideUserMessageBorderColor = sourceColorMapping?.user === "bot" ? state.theme.black80 : null;
|
|
36005
36010
|
const overrideAgentMessageBorderColor = sourceColorMapping?.agent === "user" ? "transparent" : null;
|
|
@@ -36103,14 +36108,14 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
36103
36108
|
evaluateNoticeSession(prevConversationsSnapshot) {
|
|
36104
36109
|
const id = this.props.currentSession || "";
|
|
36105
36110
|
this.setState(prev => ({
|
|
36106
|
-
noticeSession: (0,
|
|
36111
|
+
noticeSession: (0,_utils_ai_agent_notice__WEBPACK_IMPORTED_MODULE_55__/* .computeNoticeSession */ .Kr)(prev.noticeSession, id, prevConversationsSnapshot, this.props.hasRestoredPersistedHistory)
|
|
36107
36112
|
}));
|
|
36108
36113
|
}
|
|
36109
36114
|
handleNoticeIntroAnnounced = introKey => {
|
|
36110
36115
|
this.announcedNoticeKeys.add(introKey);
|
|
36111
36116
|
};
|
|
36112
36117
|
getNoticeIntro() {
|
|
36113
|
-
const text = (0,
|
|
36118
|
+
const text = (0,_utils_ai_agent_notice__WEBPACK_IMPORTED_MODULE_55__/* .getAIAgentNoticeIntroText */ .bu)({
|
|
36114
36119
|
behavior: this.props.config.settings.behavior,
|
|
36115
36120
|
showDisconnectOverlay: this.showDisconnectOverlay,
|
|
36116
36121
|
noticeSession: this.state.noticeSession,
|
|
@@ -36126,12 +36131,12 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
36126
36131
|
componentDidMount() {
|
|
36127
36132
|
const defaultMessagePlugins = [];
|
|
36128
36133
|
if (this.props.ttsActive) {
|
|
36129
|
-
defaultMessagePlugins.push(
|
|
36134
|
+
defaultMessagePlugins.push(_plugins_speech_output__WEBPACK_IMPORTED_MODULE_46__/* ["default"] */ .A);
|
|
36130
36135
|
}
|
|
36131
36136
|
this.setState({
|
|
36132
36137
|
inputPlugins: [...(this.props.inputPlugins || []), _plugins_input_base__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .A],
|
|
36133
36138
|
messagePlugins: [...(this.props.messagePlugins || []), ...defaultMessagePlugins],
|
|
36134
|
-
isMobile: (0,
|
|
36139
|
+
isMobile: (0,_utils_isMobile__WEBPACK_IMPORTED_MODULE_48__/* .isMobileViewport */ .$)()
|
|
36135
36140
|
});
|
|
36136
36141
|
this.setupIconAnimationInterval();
|
|
36137
36142
|
|
|
@@ -36209,7 +36214,7 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
36209
36214
|
if (prevProps.ttsActive !== this.props.ttsActive || prevProps.inputPlugins !== this.props.inputPlugins || prevProps.messagePlugins !== this.props.messagePlugins) {
|
|
36210
36215
|
const defaultMessagePlugins = [];
|
|
36211
36216
|
if (this.props.ttsActive) {
|
|
36212
|
-
defaultMessagePlugins.push(
|
|
36217
|
+
defaultMessagePlugins.push(_plugins_speech_output__WEBPACK_IMPORTED_MODULE_46__/* ["default"] */ .A);
|
|
36213
36218
|
}
|
|
36214
36219
|
this.setState({
|
|
36215
36220
|
inputPlugins: [...(this.props.inputPlugins || []), _plugins_input_base__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .A],
|
|
@@ -36259,7 +36264,7 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
36259
36264
|
// TODO: Add markdown rendering if there is valid markdown and renderMarkdown is enabled
|
|
36260
36265
|
// adding react-markdown is blocked by updating React to v18
|
|
36261
36266
|
if (!this.props.config.settings.widgetSettings.disableTeaserMarkdownRemoval) {
|
|
36262
|
-
lastUnseenMessageText = (0,
|
|
36267
|
+
lastUnseenMessageText = (0,_webchat_helper_handleMarkdown__WEBPACK_IMPORTED_MODULE_49__/* .removeMarkdownChars */ .$)(lastUnseenMessageText);
|
|
36263
36268
|
}
|
|
36264
36269
|
this.setState({
|
|
36265
36270
|
lastUnseenMessageText
|
|
@@ -36328,7 +36333,7 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
36328
36333
|
window.removeEventListener("resize", this.handleResize);
|
|
36329
36334
|
}
|
|
36330
36335
|
handleResize() {
|
|
36331
|
-
const isMobile = (0,
|
|
36336
|
+
const isMobile = (0,_utils_isMobile__WEBPACK_IMPORTED_MODULE_48__/* .isMobileViewport */ .$)();
|
|
36332
36337
|
if (isMobile !== this.state.isMobile) {
|
|
36333
36338
|
this.setState({
|
|
36334
36339
|
isMobile
|
|
@@ -36738,7 +36743,7 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
36738
36743
|
// while the webchat is open, so no `open` check is needed here.
|
|
36739
36744
|
const {
|
|
36740
36745
|
showHomeScreenView
|
|
36741
|
-
} = (0,
|
|
36746
|
+
} = (0,_utils_screen_visibility__WEBPACK_IMPORTED_MODULE_56__/* .getScreenVisibility */ .p)(this.props, isInforming);
|
|
36742
36747
|
const openChatAriaLabel = () => {
|
|
36743
36748
|
if (open) return config.settings.customTranslations?.ariaLabels?.closeChat ?? "Close chat";
|
|
36744
36749
|
const openChat = config.settings.customTranslations?.ariaLabels?.openChat ?? "Open chat";
|
|
@@ -36813,7 +36818,7 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
36813
36818
|
el.removeAttribute("inert");
|
|
36814
36819
|
}
|
|
36815
36820
|
}
|
|
36816
|
-
}, !fullscreenMessage ? this.renderRegularLayout(isInforming) : this.renderFullscreenMessageLayout()), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(
|
|
36821
|
+
}, !fullscreenMessage ? this.renderRegularLayout(isInforming) : this.renderFullscreenMessageLayout()), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(_presentational_StatusLiveRegion__WEBPACK_IMPORTED_MODULE_52__/* .StatusLiveRegion */ .t, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(_presentational_HomeScreenAnnouncer__WEBPACK_IMPORTED_MODULE_54__/* ["default"] */ .A, {
|
|
36817
36822
|
active: showHomeScreenView,
|
|
36818
36823
|
label: config.settings.customTranslations?.ariaLabels?.homeScreen ?? "Chat window home screen"
|
|
36819
36824
|
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(_presentational_DisconnectOverlay__WEBPACK_IMPORTED_MODULE_20__/* ["default"] */ .A, {
|
|
@@ -36823,7 +36828,11 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
36823
36828
|
isConnecting: !!this.props.connecting,
|
|
36824
36829
|
onClose: handleClose,
|
|
36825
36830
|
config: config
|
|
36826
|
-
})), !disableToggleButton && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement("div", null,
|
|
36831
|
+
})), !disableToggleButton && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(_presentational_TeaserMessageAnnouncer__WEBPACK_IMPORTED_MODULE_43__/* ["default"] */ .A, {
|
|
36832
|
+
active: !!lastUnseenMessageText && !open,
|
|
36833
|
+
text: lastUnseenMessageText,
|
|
36834
|
+
label: config.settings.customTranslations?.ariaLabels?.newMessagePreview ?? "New message preview"
|
|
36835
|
+
}),
|
|
36827
36836
|
// Show the message teaser if there is a last bot message and the webchat is closed
|
|
36828
36837
|
lastUnseenMessageText && !open && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(_presentational_TeaserMessage__WEBPACK_IMPORTED_MODULE_42__/* .TeaserMessage */ .I, {
|
|
36829
36838
|
messageText: lastUnseenMessageText,
|
|
@@ -36853,7 +36862,7 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
36853
36862
|
onClick: this.handleFabClick
|
|
36854
36863
|
}, webchatToggleProps, {
|
|
36855
36864
|
type: "button",
|
|
36856
|
-
className:
|
|
36865
|
+
className: classnames__WEBPACK_IMPORTED_MODULE_57___default()("webchat-toggle-button burst", config.settings?.layout?.iconAnimation),
|
|
36857
36866
|
id: "webchatWindowToggleButton",
|
|
36858
36867
|
"aria-label": openChatAriaLabel(),
|
|
36859
36868
|
ref: this.chatToggleButtonRef,
|
|
@@ -36991,7 +37000,7 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
36991
37000
|
onAcceptTerms: handleAcceptTerms,
|
|
36992
37001
|
isHomeScreenEnabled: isHomeScreenEnabled
|
|
36993
37002
|
});
|
|
36994
|
-
if (isXAppOverlayOpen) return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(
|
|
37003
|
+
if (isXAppOverlayOpen) return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(_functional_xapp_overlay_XAppOverlay__WEBPACK_IMPORTED_MODULE_44__/* ["default"] */ .A, null);
|
|
36995
37004
|
if (showPrevConversations) return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(_presentational_previous_conversations_ConversationsList__WEBPACK_IMPORTED_MODULE_33__/* .PrevConversationsList */ .K, {
|
|
36996
37005
|
conversations: this.props.prevConversations,
|
|
36997
37006
|
onSetShowPrevConversations: onSetShowPrevConversations,
|
|
@@ -37030,7 +37039,7 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
37030
37039
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement("h3", {
|
|
37031
37040
|
className: "sr-only",
|
|
37032
37041
|
id: "webchatChatHistoryHeading"
|
|
37033
|
-
}, config.settings.customTranslations?.ariaLabels?.chatHistory ?? "Chat history"), this.renderHistory()), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(
|
|
37042
|
+
}, config.settings.customTranslations?.ariaLabels?.chatHistory ?? "Chat history"), this.renderHistory()), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(_presentational_ScreenReaderLiveRegion__WEBPACK_IMPORTED_MODULE_51__/* ["default"] */ .A, {
|
|
37034
37043
|
liveContent: this.state.liveContent,
|
|
37035
37044
|
intro: this.getNoticeIntro(),
|
|
37036
37045
|
onIntroAnnounced: this.handleNoticeIntroAnnounced
|
|
@@ -37061,7 +37070,7 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
37061
37070
|
const {
|
|
37062
37071
|
showEnabledHomeScreen,
|
|
37063
37072
|
showChatScreen
|
|
37064
|
-
} = (0,
|
|
37073
|
+
} = (0,_utils_screen_visibility__WEBPACK_IMPORTED_MODULE_56__/* .getScreenVisibility */ .p)(this.props, isInforming);
|
|
37065
37074
|
const isChatOptionsButtonVisible = config.settings.chatOptions.enabled && showChatScreen;
|
|
37066
37075
|
const hideBackButton = showChatScreen && !isHomeScreenEnabled;
|
|
37067
37076
|
const showDeleteAllConversationButton = !!((config.settings.privacyNotice.enabled && this.props.hasAcceptedTerms || !config.settings.privacyNotice.enabled) && config.settings.homeScreen.previousConversations.enableDeleteAllConversations && showPrevConversations && Object.keys(this.props.prevConversations).length);
|
|
@@ -37133,9 +37142,9 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
37133
37142
|
className: "webchat-regular-layout-content",
|
|
37134
37143
|
"aria-hidden": isRegularLayoutActiveView ? undefined : true,
|
|
37135
37144
|
inert: isRegularLayoutActiveView ? undefined : ""
|
|
37136
|
-
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(
|
|
37145
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(_presentational_FreezeOnExit__WEBPACK_IMPORTED_MODULE_53__/* ["default"] */ .A, {
|
|
37137
37146
|
active: isRegularLayoutActiveView
|
|
37138
|
-
}, getRegularLayoutContent()), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(
|
|
37147
|
+
}, getRegularLayoutContent()), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(_presentational_previous_conversations_DeleteAllConversations__WEBPACK_IMPORTED_MODULE_50__/* ["default"] */ .A, {
|
|
37139
37148
|
config: config,
|
|
37140
37149
|
isOpen: this.state.showDeleteAllConversationsModal,
|
|
37141
37150
|
onOpenChange: (open, confirmDelete) => {
|
|
@@ -37198,7 +37207,7 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
37198
37207
|
|
|
37199
37208
|
// Find privacy message and remove it from the messages list (these message types are not displayed in the chat log).
|
|
37200
37209
|
// If we do not remove, it will cause the collatation of the first user message.
|
|
37201
|
-
const messagesExcludingPrivacyMessage = (0,
|
|
37210
|
+
const messagesExcludingPrivacyMessage = (0,_utils_filter_out_control_commands__WEBPACK_IMPORTED_MODULE_47__/* ["default"] */ .A)(messages, ["acceptPrivacyPolicy"]);
|
|
37202
37211
|
|
|
37203
37212
|
// Filter messages based on progressive rendering settings
|
|
37204
37213
|
const visibleMessages = progressiveMessageRendering ? messagesExcludingPrivacyMessage.filter(message => {
|
|
@@ -37219,7 +37228,7 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
37219
37228
|
variant: "body-regular",
|
|
37220
37229
|
component: "div",
|
|
37221
37230
|
className: "webchat-log-ai-agent-notice-text"
|
|
37222
|
-
}, AIAgentNoticeText ||
|
|
37231
|
+
}, AIAgentNoticeText || _utils_ai_agent_notice__WEBPACK_IMPORTED_MODULE_55__/* .DEFAULT_AI_AGENT_NOTICE_TEXT */ .S5), visibleMessages.map((message, index) => {
|
|
37223
37232
|
// Lookahead if there is a user reply that includes text or attachments
|
|
37224
37233
|
const hasReply = visibleMessages.slice(index + 1).some(message => {
|
|
37225
37234
|
const isUser = message.source === "user";
|
|
@@ -37256,7 +37265,8 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
37256
37265
|
active: isTyping,
|
|
37257
37266
|
delay: messageDelay,
|
|
37258
37267
|
direction: config?.settings?.widgetSettings?.sourceDirectionMapping?.bot || "incoming",
|
|
37259
|
-
disableBorder: config?.settings?.layout?.disableBotOutputBorder
|
|
37268
|
+
disableBorder: config?.settings?.layout?.disableBotOutputBorder,
|
|
37269
|
+
announcementText: config?.settings?.customTranslations?.ariaLabels?.typingIndicator
|
|
37260
37270
|
}));
|
|
37261
37271
|
}
|
|
37262
37272
|
}
|
|
@@ -37848,10 +37858,23 @@ const QueueUpdates = props => {
|
|
|
37848
37858
|
/* harmony import */ var _emotion_styled__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84937);
|
|
37849
37859
|
/* harmony import */ var _cognigy_chat_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2854);
|
|
37850
37860
|
/* harmony import */ var _utils_is_mounted__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3657);
|
|
37861
|
+
/* harmony import */ var _presentational_SrOnlyLiveRegion__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(65766);
|
|
37851
37862
|
|
|
37852
37863
|
|
|
37853
37864
|
|
|
37854
37865
|
|
|
37866
|
+
|
|
37867
|
+
// How long typing must be continuously visible before it is announced to
|
|
37868
|
+
// screen readers (CGY-3146). Short bursts stay silent on purpose: when the
|
|
37869
|
+
// reply lands within this window, its own announcement (through
|
|
37870
|
+
// <ScreenReaderLiveRegion>) supersedes a "typing" heads-up, which would only
|
|
37871
|
+
// add noise to the polite queue.
|
|
37872
|
+
const ANNOUNCE_DELAY_MS = 2000;
|
|
37873
|
+
|
|
37874
|
+
// Module-global so every typing session gets a fresh LiveRegionMessage id —
|
|
37875
|
+
// a repeated announcement with the same text still needs a new node to be
|
|
37876
|
+
// re-announced (see SrOnlyLiveRegion's keying).
|
|
37877
|
+
let announcementCounter = 0;
|
|
37855
37878
|
const ChatTypingIndicator = (0,_emotion_styled__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(_cognigy_chat_components__WEBPACK_IMPORTED_MODULE_2__/* .TypingIndicator */ .Vp)({
|
|
37856
37879
|
marginBlock: 0
|
|
37857
37880
|
});
|
|
@@ -37863,7 +37886,8 @@ const TypingIndicator = props => {
|
|
|
37863
37886
|
active,
|
|
37864
37887
|
delay,
|
|
37865
37888
|
direction,
|
|
37866
|
-
disableBorder
|
|
37889
|
+
disableBorder,
|
|
37890
|
+
announcementText
|
|
37867
37891
|
} = props;
|
|
37868
37892
|
const isMounted = (0,_utils_is_mounted__WEBPACK_IMPORTED_MODULE_3__/* .useIsMounted */ .a)();
|
|
37869
37893
|
|
|
@@ -37878,6 +37902,7 @@ const TypingIndicator = props => {
|
|
|
37878
37902
|
* -----++++++++++++++++++++++--------++++++++-
|
|
37879
37903
|
*/
|
|
37880
37904
|
const [isVisible, setIsVisible] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(active);
|
|
37905
|
+
const [announcement, setAnnouncement] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
|
|
37881
37906
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
37882
37907
|
let timeout;
|
|
37883
37908
|
if (active) {
|
|
@@ -37891,11 +37916,51 @@ const TypingIndicator = props => {
|
|
|
37891
37916
|
if (timeout) clearTimeout(timeout);
|
|
37892
37917
|
};
|
|
37893
37918
|
}, [active]);
|
|
37894
|
-
|
|
37895
|
-
|
|
37919
|
+
|
|
37920
|
+
// Read at fire time through a ref so a translations/config update while
|
|
37921
|
+
// typing is visible neither restarts the delay nor emits a duplicate
|
|
37922
|
+
// announcement mid-session.
|
|
37923
|
+
const announcementTextRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(announcementText);
|
|
37924
|
+
announcementTextRef.current = announcementText;
|
|
37925
|
+
|
|
37926
|
+
// Announce a sustained typing session once (WCAG 4.1.3 Status Messages).
|
|
37927
|
+
//
|
|
37928
|
+
// The delay counts continuous typing ("active"): typing stopping (typingOff,
|
|
37929
|
+
// or an output removing the indicator) cancels the pending announcement,
|
|
37930
|
+
// resuming restarts it. The indicator's visible hide tail (`delay`) is not
|
|
37931
|
+
// typing, so nothing can be announced after the reply has already landed.
|
|
37932
|
+
//
|
|
37933
|
+
// The emitted announcement lives as long as the indicator is visible: at
|
|
37934
|
+
// most one per visible session, so typing flapping off/on between queued
|
|
37935
|
+
// delayed messages of one bot turn doesn't re-announce. When the indicator
|
|
37936
|
+
// hides, the text is removed silently (removals aren't announced) so it
|
|
37937
|
+
// can't be read later as stale status. Typing-stopped itself is not
|
|
37938
|
+
// announced — the arriving message covers it.
|
|
37939
|
+
const hasAnnouncedRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false);
|
|
37940
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
37941
|
+
if (isVisible) return;
|
|
37942
|
+
hasAnnouncedRef.current = false;
|
|
37943
|
+
setAnnouncement(null);
|
|
37944
|
+
}, [isVisible]);
|
|
37945
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
37946
|
+
if (!active || hasAnnouncedRef.current) return;
|
|
37947
|
+
const timeout = setTimeout(() => {
|
|
37948
|
+
hasAnnouncedRef.current = true;
|
|
37949
|
+
setAnnouncement({
|
|
37950
|
+
id: `typing-${++announcementCounter}`,
|
|
37951
|
+
text: announcementTextRef.current ?? "A reply is being typed"
|
|
37952
|
+
});
|
|
37953
|
+
}, ANNOUNCE_DELAY_MS);
|
|
37954
|
+
return () => clearTimeout(timeout);
|
|
37955
|
+
}, [active]);
|
|
37956
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(react__WEBPACK_IMPORTED_MODULE_0__["default"].Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(_presentational_SrOnlyLiveRegion__WEBPACK_IMPORTED_MODULE_4__/* .SrOnlyLiveRegion */ .Y, {
|
|
37957
|
+
id: "webchatTypingIndicatorLiveRegion",
|
|
37958
|
+
role: "status",
|
|
37959
|
+
message: announcement
|
|
37960
|
+
}), isVisible ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(ChatTypingIndicator, {
|
|
37896
37961
|
direction: direction,
|
|
37897
37962
|
disableBorder: disableBorder
|
|
37898
|
-
});
|
|
37963
|
+
}) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(HiddenChatTypingIndicator, null));
|
|
37899
37964
|
};
|
|
37900
37965
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TypingIndicator);
|
|
37901
37966
|
|
|
@@ -41388,8 +41453,7 @@ const TeaserMessage = props => {
|
|
|
41388
41453
|
className: "webchat-teaser-message-root"
|
|
41389
41454
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(_UnreadMessagePreview__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A, {
|
|
41390
41455
|
className: "webchat-teaser-message-bubble",
|
|
41391
|
-
onClick: handleMessageClick
|
|
41392
|
-
"aria-live": "polite"
|
|
41456
|
+
onClick: handleMessageClick
|
|
41393
41457
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(TeaserMessageHeader, {
|
|
41394
41458
|
className: "webchat-teaser-message-header"
|
|
41395
41459
|
}, config?.settings?.layout?.logoUrl ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(HeaderLogo, {
|
|
@@ -41430,6 +41494,63 @@ const TeaserMessage = props => {
|
|
|
41430
41494
|
|
|
41431
41495
|
/***/ },
|
|
41432
41496
|
|
|
41497
|
+
/***/ 59359
|
|
41498
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
41499
|
+
|
|
41500
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
41501
|
+
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
41502
|
+
/* harmony export */ });
|
|
41503
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
|
|
41504
|
+
/* harmony import */ var _SrOnlyLiveRegion__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65766);
|
|
41505
|
+
|
|
41506
|
+
|
|
41507
|
+
let teaserAnnouncementCounter = 0;
|
|
41508
|
+
|
|
41509
|
+
/**
|
|
41510
|
+
* Announces the teaser message popup when it appears next to the toggle
|
|
41511
|
+
* button (WCAG 4.1.3 Status Messages, CGY-3270). The teaser shows while the
|
|
41512
|
+
* webchat is CLOSED, so it cannot announce through <StatusLiveRegion> —
|
|
41513
|
+
* that region lives inside the open chat window and is unmounted at that
|
|
41514
|
+
* point. This announcer therefore owns a separate region that is mounted
|
|
41515
|
+
* with the toggle button for the whole page lifetime, so it pre-exists any
|
|
41516
|
+
* teaser (a live region only announces changes to a node already in the
|
|
41517
|
+
* accessibility tree — an `aria-live` attribute on the teaser bubble itself
|
|
41518
|
+
* mounts together with its content and is never voiced).
|
|
41519
|
+
*
|
|
41520
|
+
* role="status" (polite), not role="alert": a proactive teaser is advisory
|
|
41521
|
+
* and must not interrupt what the user is currently doing on the host page.
|
|
41522
|
+
*
|
|
41523
|
+
* Announces again when the preview text changes while the teaser is showing
|
|
41524
|
+
* (a newer bot message replaces the preview). Hiding the teaser (dismissed,
|
|
41525
|
+
* chat opened) clears the region silently so users browsing the page later
|
|
41526
|
+
* don't find stale preview text.
|
|
41527
|
+
*/
|
|
41528
|
+
const TeaserMessageAnnouncer = ({
|
|
41529
|
+
active,
|
|
41530
|
+
text,
|
|
41531
|
+
label
|
|
41532
|
+
}) => {
|
|
41533
|
+
const [message, setMessage] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
|
|
41534
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
41535
|
+
if (!active || !text) {
|
|
41536
|
+
setMessage(null);
|
|
41537
|
+
return;
|
|
41538
|
+
}
|
|
41539
|
+
setMessage({
|
|
41540
|
+
id: `webchatTeaserMessage-${++teaserAnnouncementCounter}`,
|
|
41541
|
+
text: `${label}: ${text}`
|
|
41542
|
+
});
|
|
41543
|
+
}, [active, text, label]);
|
|
41544
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(_SrOnlyLiveRegion__WEBPACK_IMPORTED_MODULE_1__/* .SrOnlyLiveRegion */ .Y, {
|
|
41545
|
+
id: "webchatTeaserMessageLiveRegion",
|
|
41546
|
+
role: "status",
|
|
41547
|
+
message: message
|
|
41548
|
+
});
|
|
41549
|
+
};
|
|
41550
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TeaserMessageAnnouncer);
|
|
41551
|
+
|
|
41552
|
+
/***/ },
|
|
41553
|
+
|
|
41433
41554
|
/***/ 52077
|
|
41434
41555
|
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
41435
41556
|
|
|
@@ -41454,10 +41575,28 @@ const StyledToggleButtonOuter = _emotion_styled__WEBPACK_IMPORTED_MODULE_1__/* [
|
|
|
41454
41575
|
width: 30,
|
|
41455
41576
|
height: 16,
|
|
41456
41577
|
borderRadius: 15,
|
|
41457
|
-
|
|
41578
|
+
// black50 (#808080) keeps the track boundary ≥ 3:1 on white (WCAG 1.4.11) — black80 was ~1.6:1
|
|
41579
|
+
border: `1px solid ${theme.black50}`,
|
|
41458
41580
|
backgroundColor: theme.white,
|
|
41459
41581
|
cursor: disabled ? "default" : "pointer",
|
|
41460
41582
|
transition: "background-color 0.2s ease-in-out",
|
|
41583
|
+
// Invisible hit-area extension so the pointer target is ≥ 24x24px (WCAG 2.2 SC 2.5.8)
|
|
41584
|
+
position: "relative",
|
|
41585
|
+
"&::before": {
|
|
41586
|
+
content: '""',
|
|
41587
|
+
position: "absolute",
|
|
41588
|
+
top: -5,
|
|
41589
|
+
bottom: -5,
|
|
41590
|
+
left: 0,
|
|
41591
|
+
right: 0
|
|
41592
|
+
},
|
|
41593
|
+
"&:focus-visible": {
|
|
41594
|
+
outline: `2px solid ${theme.primaryColorFocus}`,
|
|
41595
|
+
outlineOffset: 2
|
|
41596
|
+
},
|
|
41597
|
+
"@media (prefers-reduced-motion: reduce)": {
|
|
41598
|
+
transition: "none"
|
|
41599
|
+
},
|
|
41461
41600
|
"&.active": {
|
|
41462
41601
|
backgroundColor: disabled ? theme.secondaryColorDisabled : theme.secondaryColor,
|
|
41463
41602
|
"&:hover": {
|
|
@@ -41477,6 +41616,9 @@ const StyledToggleButtonInner = _emotion_styled__WEBPACK_IMPORTED_MODULE_1__/* [
|
|
|
41477
41616
|
cursor: disabled ? "default" : "pointer",
|
|
41478
41617
|
transform: isActive ? "translateX(14px)" : "translateX(0px)",
|
|
41479
41618
|
transition: "transform 0.2s ease-in-out, background-color 0.2s ease-in-out",
|
|
41619
|
+
"@media (prefers-reduced-motion: reduce)": {
|
|
41620
|
+
transition: "none"
|
|
41621
|
+
},
|
|
41480
41622
|
"&:hover": {
|
|
41481
41623
|
backgroundColor: disabled ? theme.secondaryColorDisabled : theme.secondaryColorHover
|
|
41482
41624
|
},
|
|
@@ -41493,10 +41635,13 @@ const ToggleButton = props => {
|
|
|
41493
41635
|
isActive,
|
|
41494
41636
|
className,
|
|
41495
41637
|
disabled,
|
|
41638
|
+
id,
|
|
41496
41639
|
"aria-labelledby": ariaLabelledBy
|
|
41497
41640
|
} = props;
|
|
41498
41641
|
const [isHovered, setIsHovered] = react__WEBPACK_IMPORTED_MODULE_0__["default"].useState(false);
|
|
41499
41642
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(StyledToggleButtonOuter, {
|
|
41643
|
+
type: "button",
|
|
41644
|
+
id: id,
|
|
41500
41645
|
className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, "webchat-toggle-button-root", isActive && "active"),
|
|
41501
41646
|
onClick: onClick,
|
|
41502
41647
|
isActive: isActive,
|
|
@@ -41508,7 +41653,6 @@ const ToggleButton = props => {
|
|
|
41508
41653
|
onMouseLeave: () => setIsHovered(false)
|
|
41509
41654
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(StyledToggleButtonInner, {
|
|
41510
41655
|
className: classnames__WEBPACK_IMPORTED_MODULE_2___default()("webchat-toggle-button-inner-circle", isActive && "active", isHovered && "hovered"),
|
|
41511
|
-
onClick: onClick,
|
|
41512
41656
|
isActive: isActive,
|
|
41513
41657
|
disabled: disabled
|
|
41514
41658
|
}));
|
|
@@ -41845,8 +41989,7 @@ const ChatOptionsFooter = props => {
|
|
|
41845
41989
|
/* harmony import */ var _emotion_styled__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(84937);
|
|
41846
41990
|
/* harmony import */ var _webchat_store_messages_message_reducer__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22284);
|
|
41847
41991
|
/* harmony import */ var _Modal_DeleteConfirmModal__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(75691);
|
|
41848
|
-
/* harmony import */ var
|
|
41849
|
-
/* harmony import */ var _webchat_store_options_options__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(48242);
|
|
41992
|
+
/* harmony import */ var _webchat_store_options_options__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(48242);
|
|
41850
41993
|
|
|
41851
41994
|
|
|
41852
41995
|
|
|
@@ -41888,14 +42031,14 @@ const DeleteConversation = props => {
|
|
|
41888
42031
|
const handleConfirmDelete = () => {
|
|
41889
42032
|
dispatch((0,_webchat_store_previous_conversations_previous_conversations_reducer__WEBPACK_IMPORTED_MODULE_3__/* .deletePrevConversation */ .YD)(sessionId));
|
|
41890
42033
|
dispatch((0,_webchat_store_messages_message_reducer__WEBPACK_IMPORTED_MODULE_7__/* .clearMessages */ .oI)());
|
|
41891
|
-
dispatch((0,
|
|
42034
|
+
dispatch((0,_webchat_store_previous_conversations_previous_conversations_reducer__WEBPACK_IMPORTED_MODULE_3__/* .switchSession */ .rm)());
|
|
41892
42035
|
const storage = (0,_webchat_helper_storage__WEBPACK_IMPORTED_MODULE_4__/* .getStorage */ .c)({
|
|
41893
42036
|
disableLocalStorage: props.config.settings.embeddingConfiguration?.disableLocalStorage ?? false,
|
|
41894
42037
|
useSessionStorage: props.config.settings.embeddingConfiguration?.useSessionStorage ?? false
|
|
41895
42038
|
});
|
|
41896
42039
|
if (storage) {
|
|
41897
42040
|
Object.keys(storage).forEach(_ => {
|
|
41898
|
-
const key = (0,
|
|
42041
|
+
const key = (0,_webchat_store_options_options__WEBPACK_IMPORTED_MODULE_9__/* .getOptionsKey */ .W)({
|
|
41899
42042
|
channel,
|
|
41900
42043
|
userId,
|
|
41901
42044
|
sessionId
|
|
@@ -42190,6 +42333,11 @@ const TTSOptionRoot = _emotion_styled__WEBPACK_IMPORTED_MODULE_1__/* ["default"]
|
|
|
42190
42333
|
alignItems: "center",
|
|
42191
42334
|
height: 50
|
|
42192
42335
|
}));
|
|
42336
|
+
|
|
42337
|
+
// Native <label for> so clicking the visible text also activates the switch (WCAG technique H44)
|
|
42338
|
+
const ToggleLabel = _emotion_styled__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.label(() => ({
|
|
42339
|
+
cursor: "pointer"
|
|
42340
|
+
}));
|
|
42193
42341
|
const TTSOption = props => {
|
|
42194
42342
|
const {
|
|
42195
42343
|
config,
|
|
@@ -42197,6 +42345,7 @@ const TTSOption = props => {
|
|
|
42197
42345
|
} = props;
|
|
42198
42346
|
const isActive = (0,_webchat_helper_useSelector__WEBPACK_IMPORTED_MODULE_4__/* .useSelector */ .d)(state => state.ui.ttsActive);
|
|
42199
42347
|
const labelId = react__WEBPACK_IMPORTED_MODULE_0__["default"].useId();
|
|
42348
|
+
const toggleId = react__WEBPACK_IMPORTED_MODULE_0__["default"].useId();
|
|
42200
42349
|
const label = config.settings.chatOptions.labelTTSToggle || "Enable Text-to-Speech";
|
|
42201
42350
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(TTSOptionRoot, {
|
|
42202
42351
|
className: "webchat-tts-option-root"
|
|
@@ -42205,7 +42354,10 @@ const TTSOption = props => {
|
|
|
42205
42354
|
variant: "title1-semibold",
|
|
42206
42355
|
margin: 0,
|
|
42207
42356
|
className: "webchat-chat-options-tts-option-label"
|
|
42208
|
-
},
|
|
42357
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(ToggleLabel, {
|
|
42358
|
+
htmlFor: toggleId
|
|
42359
|
+
}, label)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(_ToggleButton__WEBPACK_IMPORTED_MODULE_3__/* .ToggleButton */ .f, {
|
|
42360
|
+
id: toggleId,
|
|
42209
42361
|
onClick: onToggle,
|
|
42210
42362
|
className: "webchat-chat-options-tts-option-toggle",
|
|
42211
42363
|
isActive: isActive,
|
|
@@ -42532,7 +42684,6 @@ const ConversationsListItem = props => {
|
|
|
42532
42684
|
/* harmony import */ var _cognigy_chat_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2854);
|
|
42533
42685
|
/* harmony import */ var _webchat_store_connection_connection_middleware__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(12193);
|
|
42534
42686
|
/* harmony import */ var _webchat_store_messages_message_reducer__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22284);
|
|
42535
|
-
/* harmony import */ var _webchat_store_previous_conversations_previous_conversations_middleware__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(92101);
|
|
42536
42687
|
|
|
42537
42688
|
|
|
42538
42689
|
|
|
@@ -42556,7 +42707,7 @@ const DeleteAllConversationsModal = props => {
|
|
|
42556
42707
|
const handleConfirmDelete = () => {
|
|
42557
42708
|
dispatch((0,_webchat_store_previous_conversations_previous_conversations_reducer__WEBPACK_IMPORTED_MODULE_2__/* .setConversations */ .dU)({}));
|
|
42558
42709
|
dispatch((0,_webchat_store_messages_message_reducer__WEBPACK_IMPORTED_MODULE_7__/* .clearMessages */ .oI)()); // Clear any existing messages
|
|
42559
|
-
dispatch((0,
|
|
42710
|
+
dispatch((0,_webchat_store_previous_conversations_previous_conversations_reducer__WEBPACK_IMPORTED_MODULE_2__/* .switchSession */ .rm)()); // Switch the session to a new one
|
|
42560
42711
|
dispatch((0,_webchat_store_connection_connection_middleware__WEBPACK_IMPORTED_MODULE_6__/* .disconnect */ .Zf)()); // Disconnect the socket to prevent from receiving any new messages. Socket will be reconnected upon starting a new conversation
|
|
42561
42712
|
const storage = (0,_webchat_helper_storage__WEBPACK_IMPORTED_MODULE_3__/* .getStorage */ .c)({
|
|
42562
42713
|
disableLocalStorage: config.settings.embeddingConfiguration?.disableLocalStorage ?? false,
|
|
@@ -43547,9 +43698,9 @@ function getSourceBackgroundColor(mappedValue, colors) {
|
|
|
43547
43698
|
/* harmony import */ var _store_messages_message_middleware__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20570);
|
|
43548
43699
|
/* harmony import */ var _store_ui_ui_reducer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(55361);
|
|
43549
43700
|
/* harmony import */ var _plugins_helper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(59977);
|
|
43550
|
-
/* harmony import */ var
|
|
43701
|
+
/* harmony import */ var _store_connection_connection_reducer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(64789);
|
|
43551
43702
|
/* harmony import */ var _store_rating_rating_reducer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(69823);
|
|
43552
|
-
/* harmony import */ var
|
|
43703
|
+
/* harmony import */ var _store_previous_conversations_previous_conversations_reducer__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(39801);
|
|
43553
43704
|
/* harmony import */ var _store_input_input_reducer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(16967);
|
|
43554
43705
|
/* harmony import */ var _store_xapp_overlay_slice__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(97114);
|
|
43555
43706
|
/* harmony import */ var _store_messages_message_reducer__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(22284);
|
|
@@ -43663,14 +43814,14 @@ const ConnectedWebchatUI = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__/* .connec
|
|
|
43663
43814
|
onMinimize: () => dispatch((0,_store_ui_ui_reducer__WEBPACK_IMPORTED_MODULE_3__/* .setMinimize */ .R1)()),
|
|
43664
43815
|
onToggle: () => dispatch((0,_store_ui_ui_reducer__WEBPACK_IMPORTED_MODULE_3__/* .toggleOpen */ .nL)()),
|
|
43665
43816
|
onTriggerEngagementMessage: () => dispatch((0,_store_messages_message_middleware__WEBPACK_IMPORTED_MODULE_2__/* .triggerEngagementMessage */ .Nh)()),
|
|
43666
|
-
onConnect: () => dispatch((0,
|
|
43817
|
+
onConnect: () => dispatch((0,_store_connection_connection_reducer__WEBPACK_IMPORTED_MODULE_5__/* .connect */ .Ng)()),
|
|
43667
43818
|
onShowRatingScreen: show => dispatch((0,_store_rating_rating_reducer__WEBPACK_IMPORTED_MODULE_6__/* .showRatingScreen */ .xW)(show)),
|
|
43668
43819
|
onSetHasGivenRating: () => dispatch((0,_store_rating_rating_reducer__WEBPACK_IMPORTED_MODULE_6__/* .setHasGivenRating */ .n_)()),
|
|
43669
43820
|
onSetShowHomeScreen: show => dispatch((0,_store_ui_ui_reducer__WEBPACK_IMPORTED_MODULE_3__/* .setShowHomeScreen */ .zn)(show)),
|
|
43670
43821
|
onSetShowPrevConversations: show => dispatch((0,_store_ui_ui_reducer__WEBPACK_IMPORTED_MODULE_3__/* .setShowPrevConversations */ .Rg)(show)),
|
|
43671
43822
|
onSetShowChatOptionsScreen: show => dispatch((0,_store_ui_ui_reducer__WEBPACK_IMPORTED_MODULE_3__/* .setShowChatOptionsScreen */ .QE)(show)),
|
|
43672
43823
|
onShowChatScreen: () => dispatch((0,_store_ui_ui_reducer__WEBPACK_IMPORTED_MODULE_3__/* .showChatScreen */ .YW)()),
|
|
43673
|
-
onSwitchSession: (sessionId, conversation) => dispatch((0,
|
|
43824
|
+
onSwitchSession: (sessionId, conversation) => dispatch((0,_store_previous_conversations_previous_conversations_reducer__WEBPACK_IMPORTED_MODULE_7__/* .switchSession */ .rm)(sessionId, conversation)),
|
|
43674
43825
|
onAcceptTerms: userId => dispatch((0,_store_ui_ui_reducer__WEBPACK_IMPORTED_MODULE_3__/* .setHasAcceptedTerms */ .Pk)(userId)),
|
|
43675
43826
|
onSetStoredMessage: message => dispatch((0,_store_ui_ui_reducer__WEBPACK_IMPORTED_MODULE_3__/* .setStoredMessage */ .LK)(message)),
|
|
43676
43827
|
onSetDropZoneVisible: isVisible => dispatch((0,_store_input_input_reducer__WEBPACK_IMPORTED_MODULE_8__/* .setDropZoneVisible */ .aJ)(isVisible)),
|
|
@@ -43712,19 +43863,20 @@ const ConnectedWebchatUI = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__/* .connec
|
|
|
43712
43863
|
/* harmony import */ var _store_ui_ui_reducer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(55361);
|
|
43713
43864
|
/* harmony import */ var _store_config_config_middleware__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(56121);
|
|
43714
43865
|
/* harmony import */ var _store_connection_connection_middleware__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(12193);
|
|
43715
|
-
/* harmony import */ var
|
|
43716
|
-
/* harmony import */ var
|
|
43717
|
-
/* harmony import */ var
|
|
43718
|
-
/* harmony import */ var
|
|
43719
|
-
/* harmony import */ var
|
|
43720
|
-
/* harmony import */ var
|
|
43721
|
-
/* harmony import */ var
|
|
43722
|
-
/* harmony import */ var
|
|
43723
|
-
/* harmony import */ var
|
|
43724
|
-
/* harmony import */ var
|
|
43725
|
-
/* harmony import */ var
|
|
43726
|
-
/* harmony import */ var
|
|
43727
|
-
/* harmony import */ var
|
|
43866
|
+
/* harmony import */ var _store_connection_connection_reducer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(64789);
|
|
43867
|
+
/* harmony import */ var events__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(98657);
|
|
43868
|
+
/* harmony import */ var events__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(events__WEBPACK_IMPORTED_MODULE_9__);
|
|
43869
|
+
/* harmony import */ var _cognigy_socket_client__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(72166);
|
|
43870
|
+
/* harmony import */ var _cognigy_socket_client__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_cognigy_socket_client__WEBPACK_IMPORTED_MODULE_10__);
|
|
43871
|
+
/* harmony import */ var _helper_endpoint__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(11351);
|
|
43872
|
+
/* harmony import */ var _store_config_config_reducer__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(46509);
|
|
43873
|
+
/* harmony import */ var _store_messages_message_handler__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(59788);
|
|
43874
|
+
/* harmony import */ var _webchat_ui_components_presentational_Notifications__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(82833);
|
|
43875
|
+
/* harmony import */ var _helper_storage__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(62473);
|
|
43876
|
+
/* harmony import */ var _helper_privacyPolicy__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(8470);
|
|
43877
|
+
/* harmony import */ var _store_options_options_reducer__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(74327);
|
|
43878
|
+
/* harmony import */ var _store_previous_conversations_previous_conversations_reducer__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(39801);
|
|
43879
|
+
/* harmony import */ var _store_messages_message_reducer__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(22284);
|
|
43728
43880
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
43729
43881
|
|
|
43730
43882
|
|
|
@@ -43745,8 +43897,9 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
43745
43897
|
|
|
43746
43898
|
|
|
43747
43899
|
|
|
43900
|
+
|
|
43748
43901
|
class Webchat extends react__WEBPACK_IMPORTED_MODULE_0__.PureComponent {
|
|
43749
|
-
analytics = new
|
|
43902
|
+
analytics = new events__WEBPACK_IMPORTED_MODULE_9__.EventEmitter();
|
|
43750
43903
|
// component lifecycle methods
|
|
43751
43904
|
constructor(props) {
|
|
43752
43905
|
super(props);
|
|
@@ -43755,17 +43908,17 @@ class Webchat extends react__WEBPACK_IMPORTED_MODULE_0__.PureComponent {
|
|
|
43755
43908
|
options,
|
|
43756
43909
|
settings
|
|
43757
43910
|
} = props;
|
|
43758
|
-
const baseUrl = (0,
|
|
43759
|
-
const token = (0,
|
|
43911
|
+
const baseUrl = (0,_helper_endpoint__WEBPACK_IMPORTED_MODULE_11__/* .getEndpointBaseUrl */ .Ul)(url);
|
|
43912
|
+
const token = (0,_helper_endpoint__WEBPACK_IMPORTED_MODULE_11__/* .getEndpointUrlToken */ .a4)(url);
|
|
43760
43913
|
const socketOptions = {
|
|
43761
43914
|
channel: options?.channel || "webchat3",
|
|
43762
43915
|
...options
|
|
43763
43916
|
};
|
|
43764
|
-
const client = new
|
|
43917
|
+
const client = new _cognigy_socket_client__WEBPACK_IMPORTED_MODULE_10__.SocketClient(baseUrl, token, socketOptions);
|
|
43765
43918
|
this.client = client;
|
|
43766
43919
|
const store = (0,_store_store__WEBPACK_IMPORTED_MODULE_1__/* .createWebchatStore */ .E7)(this, url, settings);
|
|
43767
43920
|
this.store = store;
|
|
43768
|
-
this._handleOutput = (0,
|
|
43921
|
+
this._handleOutput = (0,_store_messages_message_handler__WEBPACK_IMPORTED_MODULE_13__/* .createOutputHandler */ .i0)(this.store);
|
|
43769
43922
|
}
|
|
43770
43923
|
UNSAFE_componentWillMount() {
|
|
43771
43924
|
const {
|
|
@@ -43773,20 +43926,20 @@ class Webchat extends react__WEBPACK_IMPORTED_MODULE_0__.PureComponent {
|
|
|
43773
43926
|
} = this.props;
|
|
43774
43927
|
const disableLocalStorage = settings?.embeddingConfiguration?.disableLocalStorage ?? false;
|
|
43775
43928
|
const useSessionStorage = settings?.embeddingConfiguration?.useSessionStorage ?? false;
|
|
43776
|
-
const browserStorage = (0,
|
|
43929
|
+
const browserStorage = (0,_helper_storage__WEBPACK_IMPORTED_MODULE_15__/* .getStorage */ .c)({
|
|
43777
43930
|
disableLocalStorage,
|
|
43778
43931
|
useSessionStorage
|
|
43779
43932
|
});
|
|
43780
43933
|
const userId = this.client.socketOptions.userId;
|
|
43781
|
-
if ((0,
|
|
43934
|
+
if ((0,_helper_privacyPolicy__WEBPACK_IMPORTED_MODULE_16__/* .hasAcceptedTermsInStorage */ .z)(browserStorage, userId)) {
|
|
43782
43935
|
this.store.dispatch((0,_store_ui_ui_reducer__WEBPACK_IMPORTED_MODULE_5__/* .setHasAcceptedTerms */ .Pk)(userId));
|
|
43783
43936
|
}
|
|
43784
43937
|
this.store.dispatch((0,_store_config_config_middleware__WEBPACK_IMPORTED_MODULE_6__/* .loadConfig */ .Z)());
|
|
43785
43938
|
if (this.props.options?.sessionId) {
|
|
43786
|
-
this.store.dispatch((0,
|
|
43939
|
+
this.store.dispatch((0,_store_config_config_reducer__WEBPACK_IMPORTED_MODULE_12__/* .setInitialSessionId */ .mD)(this.props.options.sessionId));
|
|
43787
43940
|
}
|
|
43788
43941
|
if (this.props.options?.userId) {
|
|
43789
|
-
this.store.dispatch((0,
|
|
43942
|
+
this.store.dispatch((0,_store_options_options_reducer__WEBPACK_IMPORTED_MODULE_17__/* .setUserId */ ["do"])(this.props.options?.userId));
|
|
43790
43943
|
}
|
|
43791
43944
|
}
|
|
43792
43945
|
componentWillUnmount() {
|
|
@@ -43804,7 +43957,7 @@ class Webchat extends react__WEBPACK_IMPORTED_MODULE_0__.PureComponent {
|
|
|
43804
43957
|
|
|
43805
43958
|
// component API (for usage via ref)
|
|
43806
43959
|
connect = async () => {
|
|
43807
|
-
this.store.dispatch((0,
|
|
43960
|
+
this.store.dispatch((0,_store_connection_connection_reducer__WEBPACK_IMPORTED_MODULE_8__/* .connect */ .Ng)());
|
|
43808
43961
|
};
|
|
43809
43962
|
|
|
43810
43963
|
/**
|
|
@@ -43836,14 +43989,14 @@ class Webchat extends react__WEBPACK_IMPORTED_MODULE_0__.PureComponent {
|
|
|
43836
43989
|
} = this.store.getState().config;
|
|
43837
43990
|
const disableLocalStorage = settings?.embeddingConfiguration?.disableLocalStorage ?? false;
|
|
43838
43991
|
const useSessionStorage = settings?.embeddingConfiguration?.useSessionStorage ?? false;
|
|
43839
|
-
const browserStorage = (0,
|
|
43992
|
+
const browserStorage = (0,_helper_storage__WEBPACK_IMPORTED_MODULE_15__/* .getStorage */ .c)({
|
|
43840
43993
|
disableLocalStorage,
|
|
43841
43994
|
useSessionStorage
|
|
43842
43995
|
});
|
|
43843
43996
|
const userId = this.client.socketOptions.userId;
|
|
43844
43997
|
const homeScreenEnabled = settings?.homeScreen?.enabled === true;
|
|
43845
43998
|
const privacyNoticeEnabled = settings?.privacyNotice?.enabled === true;
|
|
43846
|
-
const skipPrivacyNotice = !privacyNoticeEnabled || (0,
|
|
43999
|
+
const skipPrivacyNotice = !privacyNoticeEnabled || (0,_helper_privacyPolicy__WEBPACK_IMPORTED_MODULE_16__/* .hasAcceptedTermsInStorage */ .z)(browserStorage, userId);
|
|
43847
44000
|
if (!homeScreenEnabled && skipPrivacyNotice) {
|
|
43848
44001
|
this.store.dispatch((0,_store_ui_ui_reducer__WEBPACK_IMPORTED_MODULE_5__/* .setShowHomeScreen */ .zn)(false));
|
|
43849
44002
|
this.store.dispatch((0,_store_ui_ui_reducer__WEBPACK_IMPORTED_MODULE_5__/* .setShowChatOptionsScreen */ .QE)(false));
|
|
@@ -43881,7 +44034,7 @@ class Webchat extends react__WEBPACK_IMPORTED_MODULE_0__.PureComponent {
|
|
|
43881
44034
|
this.store.dispatch((0,_store_ui_ui_reducer__WEBPACK_IMPORTED_MODULE_5__/* .toggleOpen */ .nL)());
|
|
43882
44035
|
};
|
|
43883
44036
|
showNotification = message => {
|
|
43884
|
-
(0,
|
|
44037
|
+
(0,_webchat_ui_components_presentational_Notifications__WEBPACK_IMPORTED_MODULE_14__/* .createNotification */ .UI)(message);
|
|
43885
44038
|
};
|
|
43886
44039
|
startConversation = () => {
|
|
43887
44040
|
this.store.dispatch((0,_store_ui_ui_reducer__WEBPACK_IMPORTED_MODULE_5__/* .setShowHomeScreen */ .zn)(false));
|
|
@@ -43894,15 +44047,15 @@ class Webchat extends react__WEBPACK_IMPORTED_MODULE_0__.PureComponent {
|
|
|
43894
44047
|
this.client.on("output", handler);
|
|
43895
44048
|
};
|
|
43896
44049
|
updateSettings = settings => {
|
|
43897
|
-
this.store.dispatch((0,
|
|
44050
|
+
this.store.dispatch((0,_store_config_config_reducer__WEBPACK_IMPORTED_MODULE_12__/* .updateSettings */ .Xx)(settings));
|
|
43898
44051
|
};
|
|
43899
44052
|
|
|
43900
44053
|
/**
|
|
43901
44054
|
* This method will switch to a new session and clear the messages in the current session.
|
|
43902
44055
|
*/
|
|
43903
44056
|
endSession = () => {
|
|
43904
|
-
this.store.dispatch((0,
|
|
43905
|
-
this.store.dispatch((0,
|
|
44057
|
+
this.store.dispatch((0,_store_previous_conversations_previous_conversations_reducer__WEBPACK_IMPORTED_MODULE_18__/* .switchSession */ .rm)());
|
|
44058
|
+
this.store.dispatch((0,_store_messages_message_reducer__WEBPACK_IMPORTED_MODULE_19__/* .clearMessages */ .oI)());
|
|
43906
44059
|
};
|
|
43907
44060
|
render() {
|
|
43908
44061
|
const {
|
|
@@ -44029,7 +44182,7 @@ const isInformingOutOfBusinessHours = businessHours => {
|
|
|
44029
44182
|
/* harmony export */ R: () => (/* binding */ onNetworkOn),
|
|
44030
44183
|
/* harmony export */ s: () => (/* binding */ shouldReestablishConnection)
|
|
44031
44184
|
/* harmony export */ });
|
|
44032
|
-
const shouldReestablishConnection = store => store?.
|
|
44185
|
+
const shouldReestablishConnection = store => store?.connection?.hasAttemptedConnection;
|
|
44033
44186
|
const onNetworkOn = handler => {
|
|
44034
44187
|
window.addEventListener("online", handler, false);
|
|
44035
44188
|
return () => {
|
|
@@ -45058,7 +45211,6 @@ const registerConnectionHandler = (store, client) => {
|
|
|
45058
45211
|
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
45059
45212
|
|
|
45060
45213
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
45061
|
-
/* harmony export */ Ng: () => (/* binding */ connect),
|
|
45062
45214
|
/* harmony export */ PJ: () => (/* binding */ createConnectionMiddleware),
|
|
45063
45215
|
/* harmony export */ Zf: () => (/* binding */ disconnect),
|
|
45064
45216
|
/* harmony export */ vD: () => (/* binding */ announceNetworkOn)
|
|
@@ -45073,10 +45225,6 @@ const registerConnectionHandler = (store, client) => {
|
|
|
45073
45225
|
|
|
45074
45226
|
|
|
45075
45227
|
|
|
45076
|
-
const CONNECT = "CONNECT";
|
|
45077
|
-
const connect = () => ({
|
|
45078
|
-
type: CONNECT
|
|
45079
|
-
});
|
|
45080
45228
|
const DISCONNECT = "DISCONNECT";
|
|
45081
45229
|
const disconnect = () => ({
|
|
45082
45230
|
type: DISCONNECT
|
|
@@ -45116,19 +45264,19 @@ const createConnectionMiddleware = client => store => next => action => {
|
|
|
45116
45264
|
case "SHOW_CHAT_SCREEN":
|
|
45117
45265
|
{
|
|
45118
45266
|
if (!client.connected) {
|
|
45119
|
-
store.dispatch(connect());
|
|
45267
|
+
store.dispatch((0,_connection_reducer__WEBPACK_IMPORTED_MODULE_3__/* .connect */ .Ng)());
|
|
45120
45268
|
}
|
|
45121
45269
|
break;
|
|
45122
45270
|
}
|
|
45123
45271
|
case "SEND_MESSAGE":
|
|
45124
45272
|
{
|
|
45125
|
-
store.dispatch(connect());
|
|
45273
|
+
store.dispatch((0,_connection_reducer__WEBPACK_IMPORTED_MODULE_3__/* .connect */ .Ng)());
|
|
45126
45274
|
break;
|
|
45127
45275
|
}
|
|
45128
45276
|
case "SET_PAGE_VISIBLE":
|
|
45129
45277
|
{
|
|
45130
45278
|
if (action.visible && (0,_helper_connection_watchdog__WEBPACK_IMPORTED_MODULE_4__/* .shouldReestablishConnection */ .s)(store.getState())) {
|
|
45131
|
-
store.dispatch(connect());
|
|
45279
|
+
store.dispatch((0,_connection_reducer__WEBPACK_IMPORTED_MODULE_3__/* .connect */ .Ng)());
|
|
45132
45280
|
}
|
|
45133
45281
|
break;
|
|
45134
45282
|
}
|
|
@@ -45140,7 +45288,7 @@ const createConnectionMiddleware = client => store => next => action => {
|
|
|
45140
45288
|
case "NETWORK_ON":
|
|
45141
45289
|
{
|
|
45142
45290
|
if ((0,_helper_connection_watchdog__WEBPACK_IMPORTED_MODULE_4__/* .shouldReestablishConnection */ .s)(store.getState())) {
|
|
45143
|
-
store.dispatch(connect());
|
|
45291
|
+
store.dispatch((0,_connection_reducer__WEBPACK_IMPORTED_MODULE_3__/* .connect */ .Ng)());
|
|
45144
45292
|
}
|
|
45145
45293
|
break;
|
|
45146
45294
|
}
|
|
@@ -45155,16 +45303,22 @@ const createConnectionMiddleware = client => store => next => action => {
|
|
|
45155
45303
|
|
|
45156
45304
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
45157
45305
|
/* harmony export */ FI: () => (/* binding */ connection),
|
|
45306
|
+
/* harmony export */ Ng: () => (/* binding */ connect),
|
|
45158
45307
|
/* harmony export */ Pr: () => (/* binding */ setReconnectionLimit),
|
|
45159
45308
|
/* harmony export */ pE: () => (/* binding */ setConnecting),
|
|
45160
45309
|
/* harmony export */ qJ: () => (/* binding */ setConnected)
|
|
45161
45310
|
/* harmony export */ });
|
|
45162
|
-
/* unused harmony exports SET_CONNECTING, SET_CONNECTED, SET_RECONNECTION_LIMIT */
|
|
45311
|
+
/* unused harmony exports CONNECT, SET_CONNECTING, SET_CONNECTED, SET_RECONNECTION_LIMIT */
|
|
45163
45312
|
const initialState = {
|
|
45164
45313
|
connected: false,
|
|
45165
45314
|
connecting: false,
|
|
45166
|
-
reconnectionLimit: false
|
|
45315
|
+
reconnectionLimit: false,
|
|
45316
|
+
hasAttemptedConnection: false
|
|
45167
45317
|
};
|
|
45318
|
+
const CONNECT = "CONNECT";
|
|
45319
|
+
const connect = () => ({
|
|
45320
|
+
type: CONNECT
|
|
45321
|
+
});
|
|
45168
45322
|
const SET_CONNECTING = "SET_CONNECTING";
|
|
45169
45323
|
const setConnecting = connecting => ({
|
|
45170
45324
|
type: SET_CONNECTING,
|
|
@@ -45186,7 +45340,10 @@ const connection = (state = initialState, action) => {
|
|
|
45186
45340
|
{
|
|
45187
45341
|
return {
|
|
45188
45342
|
...state,
|
|
45189
|
-
connected: action.connected
|
|
45343
|
+
connected: action.connected,
|
|
45344
|
+
// Never reset once true: a past connection attempt is what gates
|
|
45345
|
+
// automatic reconnection, regardless of the current connected state.
|
|
45346
|
+
hasAttemptedConnection: state.hasAttemptedConnection || action.connected
|
|
45190
45347
|
};
|
|
45191
45348
|
}
|
|
45192
45349
|
case "SET_CONNECTING":
|
|
@@ -45203,6 +45360,18 @@ const connection = (state = initialState, action) => {
|
|
|
45203
45360
|
reconnectionLimit: action.reconnectionLimit
|
|
45204
45361
|
};
|
|
45205
45362
|
}
|
|
45363
|
+
case "CONNECT":
|
|
45364
|
+
case "SWITCH_SESSION":
|
|
45365
|
+
{
|
|
45366
|
+
// A session switch connects the socket directly, bypassing CONNECT.
|
|
45367
|
+
// It is still a deliberate connection request, so it must arm the
|
|
45368
|
+
// reconnect latch even if this first attempt fails (e.g. offline).
|
|
45369
|
+
if (state.hasAttemptedConnection) return state;
|
|
45370
|
+
return {
|
|
45371
|
+
...state,
|
|
45372
|
+
hasAttemptedConnection: true
|
|
45373
|
+
};
|
|
45374
|
+
}
|
|
45206
45375
|
default:
|
|
45207
45376
|
{
|
|
45208
45377
|
return state;
|
|
@@ -45583,8 +45752,10 @@ const input = (state = getInitialState(), action) => {
|
|
|
45583
45752
|
/* harmony export */ mN: () => (/* binding */ isAnimatedRichBotMessage),
|
|
45584
45753
|
/* harmony export */ oy: () => (/* binding */ isTextOnlyEscapeSequence)
|
|
45585
45754
|
/* harmony export */ });
|
|
45755
|
+
/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55252);
|
|
45756
|
+
|
|
45586
45757
|
function generateRandomId() {
|
|
45587
|
-
return
|
|
45758
|
+
return crypto.randomUUID?.() ?? (0,uuid__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)();
|
|
45588
45759
|
}
|
|
45589
45760
|
function isAnimatedRichBotMessage(message) {
|
|
45590
45761
|
const {
|
|
@@ -45884,7 +46055,7 @@ const createMessageMiddleware = client => store => next => action => {
|
|
|
45884
46055
|
if (text) {
|
|
45885
46056
|
store.dispatch((0,_message_handler__WEBPACK_IMPORTED_MODULE_2__/* .receiveMessage */ .VI)({
|
|
45886
46057
|
source: "engagement",
|
|
45887
|
-
traceId: `engagement-${
|
|
46058
|
+
traceId: `engagement-${(0,_helper__WEBPACK_IMPORTED_MODULE_5__/* .generateRandomId */ .MZ)()}`,
|
|
45888
46059
|
text
|
|
45889
46060
|
}));
|
|
45890
46061
|
}
|
|
@@ -46330,7 +46501,6 @@ const getOptionsKey = ({
|
|
|
46330
46501
|
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
46331
46502
|
|
|
46332
46503
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
46333
|
-
/* harmony export */ r: () => (/* binding */ switchSession),
|
|
46334
46504
|
/* harmony export */ w: () => (/* binding */ createPrevConversationsMiddleware)
|
|
46335
46505
|
/* harmony export */ });
|
|
46336
46506
|
/* harmony import */ var _previous_conversations_reducer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39801);
|
|
@@ -46345,12 +46515,6 @@ const getOptionsKey = ({
|
|
|
46345
46515
|
|
|
46346
46516
|
|
|
46347
46517
|
|
|
46348
|
-
const SWITCH_SESSION = "SWITCH_SESSION";
|
|
46349
|
-
const switchSession = (sessionId = self.crypto?.randomUUID?.(), conversation) => ({
|
|
46350
|
-
type: SWITCH_SESSION,
|
|
46351
|
-
sessionId,
|
|
46352
|
-
conversation
|
|
46353
|
-
});
|
|
46354
46518
|
const createPrevConversationsMiddleware = client => store => next => action => {
|
|
46355
46519
|
switch (action.type) {
|
|
46356
46520
|
case "SWITCH_SESSION":
|
|
@@ -46407,9 +46571,16 @@ const createPrevConversationsMiddleware = client => store => next => action => {
|
|
|
46407
46571
|
/* harmony export */ CK: () => (/* binding */ prevConversations),
|
|
46408
46572
|
/* harmony export */ Wu: () => (/* binding */ upsertPrevConversation),
|
|
46409
46573
|
/* harmony export */ YD: () => (/* binding */ deletePrevConversation),
|
|
46410
|
-
/* harmony export */ dU: () => (/* binding */ setConversations)
|
|
46574
|
+
/* harmony export */ dU: () => (/* binding */ setConversations),
|
|
46575
|
+
/* harmony export */ rm: () => (/* binding */ switchSession)
|
|
46411
46576
|
/* harmony export */ });
|
|
46412
46577
|
const getInitialState = () => ({});
|
|
46578
|
+
const SWITCH_SESSION = "SWITCH_SESSION";
|
|
46579
|
+
const switchSession = (sessionId = self.crypto?.randomUUID?.(), conversation) => ({
|
|
46580
|
+
type: SWITCH_SESSION,
|
|
46581
|
+
sessionId,
|
|
46582
|
+
conversation
|
|
46583
|
+
});
|
|
46413
46584
|
const SET_CONVERSATIONS = "SET_CONVERSATIONS";
|
|
46414
46585
|
const setConversations = conversations => ({
|
|
46415
46586
|
type: SET_CONVERSATIONS,
|
|
@@ -85376,9 +85547,11 @@ const ActionButtons = props2 => {
|
|
|
85376
85547
|
}, index2) : actionButton2;
|
|
85377
85548
|
});
|
|
85378
85549
|
const Component = buttons2.length > 1 ? "ul" : "div";
|
|
85550
|
+
const singleButtonRole = Component === "div" && templateTextId ? "group" : void 0;
|
|
85379
85551
|
return /* @__PURE__ */(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Component, {
|
|
85380
85552
|
className: classnames$1(className, classes$d.buttons, containerClassName),
|
|
85381
85553
|
style: containerStyle || {},
|
|
85554
|
+
role: singleButtonRole,
|
|
85382
85555
|
"aria-labelledby": templateTextId,
|
|
85383
85556
|
"data-testid": "action-buttons",
|
|
85384
85557
|
children: buttonElements
|
|
@@ -98447,7 +98620,8 @@ const Gallery = () => {
|
|
|
98447
98620
|
nextEl: ".gallery-button-next"
|
|
98448
98621
|
},
|
|
98449
98622
|
pagination: {
|
|
98450
|
-
clickable: true
|
|
98623
|
+
clickable: true,
|
|
98624
|
+
el: ".gallery-pagination"
|
|
98451
98625
|
},
|
|
98452
98626
|
className: classnames$1("webchat-carousel-template-root", classes$8.wrapper),
|
|
98453
98627
|
"data-testid": "gallery-message",
|
|
@@ -98468,6 +98642,8 @@ const Gallery = () => {
|
|
|
98468
98642
|
}), /* @__PURE__ */(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", {
|
|
98469
98643
|
className: "gallery-button-next",
|
|
98470
98644
|
children: /* @__PURE__ */(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SvgArrowBack, {})
|
|
98645
|
+
}), /* @__PURE__ */(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
|
|
98646
|
+
className: "gallery-pagination swiper-pagination"
|
|
98471
98647
|
})]
|
|
98472
98648
|
});
|
|
98473
98649
|
};
|
|
@@ -118091,7 +118267,7 @@ const TextWithButtons = props2 => {
|
|
|
118091
118267
|
showUrlIcon: true,
|
|
118092
118268
|
config: config2,
|
|
118093
118269
|
onEmitAnalytics,
|
|
118094
|
-
templateTextId: webchatButtonTemplateTextId,
|
|
118270
|
+
templateTextId: text2 ? webchatButtonTemplateTextId : void 0,
|
|
118095
118271
|
openXAppOverlay
|
|
118096
118272
|
})]
|
|
118097
118273
|
});
|
|
@@ -133782,12 +133958,14 @@ const AdaptiveCards = () => {
|
|
|
133782
133958
|
}
|
|
133783
133959
|
case "Action.OpenUrl":
|
|
133784
133960
|
{
|
|
133785
|
-
const
|
|
133786
|
-
|
|
133961
|
+
const rawUrl = action._propertyBag?.url;
|
|
133962
|
+
const url = config2?.settings?.layout?.disableUrlButtonSanitization ? rawUrl : distExports.sanitizeUrl(rawUrl);
|
|
133963
|
+
if (!url || url === "about:blank") return;
|
|
133964
|
+
window.open(url, "_blank", "noopener");
|
|
133787
133965
|
return;
|
|
133788
133966
|
}
|
|
133789
133967
|
}
|
|
133790
|
-
}, [onSendMessage, shouldBeDisabled]);
|
|
133968
|
+
}, [onSendMessage, shouldBeDisabled, config2?.settings?.layout?.disableUrlButtonSanitization]);
|
|
133791
133969
|
return /* @__PURE__ */(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ChatBubble, {
|
|
133792
133970
|
className: classnames$1(styles["adaptivecard-wrapper"], "adaptivecard-wrapper internal", shouldBeDisabled && styles.chatDisabled),
|
|
133793
133971
|
children: /* @__PURE__ */(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AdaptiveCard, {
|
|
@@ -138626,6 +138804,17 @@ function getAdapter(adapters, config) {
|
|
|
138626
138804
|
|
|
138627
138805
|
|
|
138628
138806
|
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
138807
|
+
const DEFAULT_REQUEST_OPTIONS = {
|
|
138808
|
+
cache: 'default',
|
|
138809
|
+
redirect: 'follow',
|
|
138810
|
+
referrer: 'about:client',
|
|
138811
|
+
referrerPolicy: '',
|
|
138812
|
+
mode: 'cors',
|
|
138813
|
+
integrity: '',
|
|
138814
|
+
keepalive: false,
|
|
138815
|
+
priority: 'auto',
|
|
138816
|
+
window: null
|
|
138817
|
+
};
|
|
138629
138818
|
const {
|
|
138630
138819
|
isFunction
|
|
138631
138820
|
} = _utils_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A;
|
|
@@ -138768,7 +138957,8 @@ const factory = env => {
|
|
|
138768
138957
|
withCredentials = 'same-origin',
|
|
138769
138958
|
fetchOptions,
|
|
138770
138959
|
maxContentLength,
|
|
138771
|
-
maxBodyLength
|
|
138960
|
+
maxBodyLength,
|
|
138961
|
+
maxRedirects
|
|
138772
138962
|
} = (0,_helpers_resolveConfig_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)(config);
|
|
138773
138963
|
const hasMaxContentLength = _utils_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.isNumber(maxContentLength) && maxContentLength > -1;
|
|
138774
138964
|
const hasMaxBodyLength = _utils_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.isNumber(maxBodyLength) && maxBodyLength > -1;
|
|
@@ -138899,17 +139089,46 @@ const factory = env => {
|
|
|
138899
139089
|
|
|
138900
139090
|
// Set User-Agent header if not already set (fetch defaults to 'node' in Node.js)
|
|
138901
139091
|
headers.set('User-Agent', 'axios/' + _env_data_js__WEBPACK_IMPORTED_MODULE_10__/* .VERSION */ .x, false);
|
|
138902
|
-
const
|
|
138903
|
-
|
|
139092
|
+
const safeFetchOptions = fetchOptions == null ? fetchOptions : Object.assign(Object.create(null), fetchOptions);
|
|
139093
|
+
if (safeFetchOptions) {
|
|
139094
|
+
// These options are owned by Axios and are already reflected in the
|
|
139095
|
+
// resolved Request passed to fetch.
|
|
139096
|
+
delete safeFetchOptions.body;
|
|
139097
|
+
delete safeFetchOptions.headers;
|
|
139098
|
+
delete safeFetchOptions.method;
|
|
139099
|
+
delete safeFetchOptions.signal;
|
|
139100
|
+
delete safeFetchOptions.duplex;
|
|
139101
|
+
delete safeFetchOptions.credentials;
|
|
139102
|
+
}
|
|
139103
|
+
const resolvedOptions = Object.assign(Object.create(null), safeFetchOptions, {
|
|
138904
139104
|
signal: composedSignal,
|
|
138905
139105
|
method: method.toUpperCase(),
|
|
138906
139106
|
headers: (0,_helpers_sanitizeHeaderValue_js__WEBPACK_IMPORTED_MODULE_11__/* .toByteStringHeaderObject */ .$$)(headers.normalize()),
|
|
138907
139107
|
body: data,
|
|
138908
139108
|
duplex: 'half',
|
|
138909
139109
|
credentials: isCredentialsSupported ? withCredentials : undefined
|
|
138910
|
-
};
|
|
139110
|
+
});
|
|
139111
|
+
if (isRequestSupported) {
|
|
139112
|
+
_utils_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.forEach(DEFAULT_REQUEST_OPTIONS, (value, key) => {
|
|
139113
|
+
if (resolvedOptions[key] === undefined) {
|
|
139114
|
+
resolvedOptions[key] = value;
|
|
139115
|
+
}
|
|
139116
|
+
});
|
|
139117
|
+
if (resolvedOptions.signal === undefined) {
|
|
139118
|
+
resolvedOptions.signal = null;
|
|
139119
|
+
}
|
|
139120
|
+
if (resolvedOptions.body === undefined) {
|
|
139121
|
+
resolvedOptions.body = null;
|
|
139122
|
+
}
|
|
139123
|
+
}
|
|
139124
|
+
if (maxRedirects === 0) {
|
|
139125
|
+
resolvedOptions.redirect = 'manual';
|
|
139126
|
+
if (safeFetchOptions) {
|
|
139127
|
+
safeFetchOptions.redirect = 'manual';
|
|
139128
|
+
}
|
|
139129
|
+
}
|
|
138911
139130
|
request = isRequestSupported && new Request(url, resolvedOptions);
|
|
138912
|
-
let response = await (isRequestSupported ? _fetch(request,
|
|
139131
|
+
let response = await (isRequestSupported ? _fetch(request, safeFetchOptions) : _fetch(url, resolvedOptions));
|
|
138913
139132
|
const responseHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.from(response.headers);
|
|
138914
139133
|
|
|
138915
139134
|
// Cheap pre-check: if the server honestly declares a content-length that
|
|
@@ -139070,12 +139289,14 @@ const adapter = getFetch();
|
|
|
139070
139289
|
/* harmony import */ var _defaults_transitional_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(96458);
|
|
139071
139290
|
/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7996);
|
|
139072
139291
|
/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(62200);
|
|
139073
|
-
/* harmony import */ var
|
|
139074
|
-
/* harmony import */ var
|
|
139075
|
-
/* harmony import */ var
|
|
139076
|
-
/* harmony import */ var
|
|
139077
|
-
/* harmony import */ var
|
|
139078
|
-
/* harmony import */ var
|
|
139292
|
+
/* harmony import */ var _helpers_normalizeURLForProtocolCheck_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(69893);
|
|
139293
|
+
/* harmony import */ var _helpers_parseProtocol_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(58177);
|
|
139294
|
+
/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(75194);
|
|
139295
|
+
/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(88580);
|
|
139296
|
+
/* harmony import */ var _helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(41487);
|
|
139297
|
+
/* harmony import */ var _helpers_resolveConfig_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(38652);
|
|
139298
|
+
/* harmony import */ var _helpers_sanitizeHeaderValue_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(5681);
|
|
139299
|
+
|
|
139079
139300
|
|
|
139080
139301
|
|
|
139081
139302
|
|
|
@@ -139090,9 +139311,9 @@ const adapter = getFetch();
|
|
|
139090
139311
|
const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
|
|
139091
139312
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isXHRAdapterSupported && function (config) {
|
|
139092
139313
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
139093
|
-
const _config = (0,
|
|
139314
|
+
const _config = (0,_helpers_resolveConfig_js__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .A)(config);
|
|
139094
139315
|
let requestData = _config.data;
|
|
139095
|
-
const requestHeaders =
|
|
139316
|
+
const requestHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A.from(_config.headers).normalize();
|
|
139096
139317
|
let {
|
|
139097
139318
|
responseType,
|
|
139098
139319
|
onUploadProgress,
|
|
@@ -139100,7 +139321,7 @@ const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
|
|
|
139100
139321
|
} = _config;
|
|
139101
139322
|
let onCanceled;
|
|
139102
139323
|
let uploadThrottled, downloadThrottled;
|
|
139103
|
-
let flushUpload, flushDownload;
|
|
139324
|
+
let flushUpload, flushDownload, flushDownloadWithEvent;
|
|
139104
139325
|
function done() {
|
|
139105
139326
|
flushUpload && flushUpload(); // flush events
|
|
139106
139327
|
flushDownload && flushDownload(); // flush events
|
|
@@ -139113,12 +139334,52 @@ const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
|
|
|
139113
139334
|
|
|
139114
139335
|
// Set the request timeout in MS
|
|
139115
139336
|
request.timeout = _config.timeout;
|
|
139116
|
-
function onloadend() {
|
|
139337
|
+
function onloadend(event) {
|
|
139338
|
+
if (!request) {
|
|
139339
|
+
return;
|
|
139340
|
+
}
|
|
139341
|
+
|
|
139342
|
+
// Status 0 means no response was received, which onerror and onabort normally
|
|
139343
|
+
// reject before this runs. Firefox 152 fires only readystatechange and loadend for
|
|
139344
|
+
// navigation-canceled requests (https://bugzilla.mozilla.org/show_bug.cgi?id=1505389),
|
|
139345
|
+
// leaving settle() to resolve them as an empty success. ECONNABORTED is the error
|
|
139346
|
+
// onabort raised on Firefox 151. Reads over file:, which some environments report as
|
|
139347
|
+
// status 0 on success, are excluded by the request URL's scheme after browser-style
|
|
139348
|
+
// preprocessing, by the page origin's scheme for relative URLs (which inherit it), or
|
|
139349
|
+
// by responseURL where implemented.
|
|
139350
|
+
if (request.status === 0 && ((0,_helpers_parseProtocol_js__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A)((0,_helpers_normalizeURLForProtocolCheck_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)(_config.url)) || (0,_helpers_parseProtocol_js__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A)(_platform_index_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A.origin)) !== 'file' && !(request.responseURL && request.responseURL.startsWith('file:'))) {
|
|
139351
|
+
reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A('Request aborted', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.ECONNABORTED, config, request));
|
|
139352
|
+
done();
|
|
139353
|
+
|
|
139354
|
+
// Clean up request
|
|
139355
|
+
request = null;
|
|
139356
|
+
return;
|
|
139357
|
+
}
|
|
139358
|
+
|
|
139359
|
+
// When loadend is still dispatching, flushing with it gives progress
|
|
139360
|
+
// listeners a final delivery whose event has a live target. The legacy
|
|
139361
|
+
// ready-state fallback has no event, so replay its pending progress.
|
|
139362
|
+
// A throwing listener must not block settlement; rethrow asynchronously,
|
|
139363
|
+
// matching how listener errors surface on the throttle timer path.
|
|
139364
|
+
try {
|
|
139365
|
+
if (event) {
|
|
139366
|
+
flushDownloadWithEvent && flushDownloadWithEvent(event);
|
|
139367
|
+
} else {
|
|
139368
|
+
flushDownload && flushDownload();
|
|
139369
|
+
}
|
|
139370
|
+
} catch (err) {
|
|
139371
|
+
setTimeout(() => {
|
|
139372
|
+
throw err;
|
|
139373
|
+
});
|
|
139374
|
+
}
|
|
139375
|
+
|
|
139376
|
+
// A final progress callback can cancel the request synchronously.
|
|
139117
139377
|
if (!request) {
|
|
139118
139378
|
return;
|
|
139119
139379
|
}
|
|
139380
|
+
|
|
139120
139381
|
// Prepare the response
|
|
139121
|
-
const responseHeaders =
|
|
139382
|
+
const responseHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A.from('getAllResponseHeaders' in request && request.getAllResponseHeaders());
|
|
139122
139383
|
const responseData = !responseType || responseType === 'text' || responseType === 'json' ? request.responseText : request.response;
|
|
139123
139384
|
const response = {
|
|
139124
139385
|
data: responseData,
|
|
@@ -139207,7 +139468,7 @@ const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
|
|
|
139207
139468
|
|
|
139208
139469
|
// Add headers to the request
|
|
139209
139470
|
if ('setRequestHeader' in request) {
|
|
139210
|
-
_utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.forEach((0,
|
|
139471
|
+
_utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.forEach((0,_helpers_sanitizeHeaderValue_js__WEBPACK_IMPORTED_MODULE_11__/* .toByteStringHeaderObject */ .$$)(requestHeaders), function setRequestHeader(val, key) {
|
|
139211
139472
|
request.setRequestHeader(key, val);
|
|
139212
139473
|
});
|
|
139213
139474
|
}
|
|
@@ -139224,13 +139485,13 @@ const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
|
|
|
139224
139485
|
|
|
139225
139486
|
// Handle progress if needed
|
|
139226
139487
|
if (onDownloadProgress) {
|
|
139227
|
-
[downloadThrottled, flushDownload] = (0,
|
|
139488
|
+
[downloadThrottled, flushDownload, flushDownloadWithEvent] = (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_9__/* .progressEventReducer */ .C1)(onDownloadProgress, true);
|
|
139228
139489
|
request.addEventListener('progress', downloadThrottled);
|
|
139229
139490
|
}
|
|
139230
139491
|
|
|
139231
139492
|
// Not all browsers support upload events
|
|
139232
139493
|
if (onUploadProgress && request.upload) {
|
|
139233
|
-
[uploadThrottled, flushUpload] = (0,
|
|
139494
|
+
[uploadThrottled, flushUpload] = (0,_helpers_progressEventReducer_js__WEBPACK_IMPORTED_MODULE_9__/* .progressEventReducer */ .C1)(onUploadProgress);
|
|
139234
139495
|
request.upload.addEventListener('progress', uploadThrottled);
|
|
139235
139496
|
request.upload.addEventListener('loadend', flushUpload);
|
|
139236
139497
|
}
|
|
@@ -139251,8 +139512,8 @@ const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
|
|
|
139251
139512
|
_config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);
|
|
139252
139513
|
}
|
|
139253
139514
|
}
|
|
139254
|
-
const protocol = (0,
|
|
139255
|
-
if (protocol && !
|
|
139515
|
+
const protocol = (0,_helpers_parseProtocol_js__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A)(_config.url);
|
|
139516
|
+
if (protocol && !_platform_index_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A.protocols.includes(protocol)) {
|
|
139256
139517
|
reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A('Unsupported protocol ' + protocol + ':', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.ERR_BAD_REQUEST, config));
|
|
139257
139518
|
done();
|
|
139258
139519
|
return;
|
|
@@ -139562,9 +139823,11 @@ function isCancel(value) {
|
|
|
139562
139823
|
/* harmony import */ var _dispatchRequest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(11669);
|
|
139563
139824
|
/* harmony import */ var _mergeConfig_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6068);
|
|
139564
139825
|
/* harmony import */ var _buildFullPath_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1216);
|
|
139565
|
-
/* harmony import */ var
|
|
139566
|
-
/* harmony import */ var
|
|
139567
|
-
/* harmony import */ var
|
|
139826
|
+
/* harmony import */ var _methodList_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(31109);
|
|
139827
|
+
/* harmony import */ var _helpers_validator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(83092);
|
|
139828
|
+
/* harmony import */ var _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(88580);
|
|
139829
|
+
/* harmony import */ var _defaults_transitional_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(96458);
|
|
139830
|
+
|
|
139568
139831
|
|
|
139569
139832
|
|
|
139570
139833
|
|
|
@@ -139576,7 +139839,7 @@ function isCancel(value) {
|
|
|
139576
139839
|
|
|
139577
139840
|
|
|
139578
139841
|
|
|
139579
|
-
const validators =
|
|
139842
|
+
const validators = _helpers_validator_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A.validators;
|
|
139580
139843
|
|
|
139581
139844
|
/**
|
|
139582
139845
|
* Create a new instance of Axios
|
|
@@ -139607,18 +139870,17 @@ class Axios {
|
|
|
139607
139870
|
return await this._request(configOrUrl, config);
|
|
139608
139871
|
} catch (err) {
|
|
139609
139872
|
if (err instanceof Error) {
|
|
139610
|
-
|
|
139611
|
-
|
|
139873
|
+
try {
|
|
139874
|
+
let dummy = {};
|
|
139875
|
+
Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
|
|
139876
|
+
const dummyStack = dummy.stack;
|
|
139877
|
+
let stack = '';
|
|
139612
139878
|
|
|
139613
|
-
|
|
139614
|
-
|
|
139615
|
-
|
|
139616
|
-
|
|
139879
|
+
// slice off the Error: ... line
|
|
139880
|
+
if (typeof dummyStack === 'string') {
|
|
139881
|
+
const firstNewlineIndex = dummyStack.indexOf('\n');
|
|
139882
|
+
stack = firstNewlineIndex === -1 ? '' : dummyStack.slice(firstNewlineIndex + 1);
|
|
139617
139883
|
}
|
|
139618
|
-
const firstNewlineIndex = dummy.stack.indexOf('\n');
|
|
139619
|
-
return firstNewlineIndex === -1 ? '' : dummy.stack.slice(firstNewlineIndex + 1);
|
|
139620
|
-
})();
|
|
139621
|
-
try {
|
|
139622
139884
|
if (!err.stack) {
|
|
139623
139885
|
err.stack = stack;
|
|
139624
139886
|
// match without the 2 top stack lines
|
|
@@ -139631,7 +139893,7 @@ class Axios {
|
|
|
139631
139893
|
}
|
|
139632
139894
|
}
|
|
139633
139895
|
} catch (e) {
|
|
139634
|
-
//
|
|
139896
|
+
// Ignore failures from custom stack hooks or un-writable stack properties.
|
|
139635
139897
|
}
|
|
139636
139898
|
}
|
|
139637
139899
|
throw err;
|
|
@@ -139653,7 +139915,7 @@ class Axios {
|
|
|
139653
139915
|
headers
|
|
139654
139916
|
} = config;
|
|
139655
139917
|
if (transitional !== undefined) {
|
|
139656
|
-
|
|
139918
|
+
_helpers_validator_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A.assertOptions(transitional, {
|
|
139657
139919
|
silentJSONParsing: validators.transitional(validators.boolean),
|
|
139658
139920
|
forcedJSONParsing: validators.transitional(validators.boolean),
|
|
139659
139921
|
clarifyTimeoutError: validators.transitional(validators.boolean),
|
|
@@ -139668,7 +139930,7 @@ class Axios {
|
|
|
139668
139930
|
serialize: paramsSerializer
|
|
139669
139931
|
};
|
|
139670
139932
|
} else {
|
|
139671
|
-
|
|
139933
|
+
_helpers_validator_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A.assertOptions(paramsSerializer, {
|
|
139672
139934
|
encode: validators.function,
|
|
139673
139935
|
serialize: validators.function
|
|
139674
139936
|
}, true);
|
|
@@ -139683,20 +139945,20 @@ class Axios {
|
|
|
139683
139945
|
} else {
|
|
139684
139946
|
config.allowAbsoluteUrls = true;
|
|
139685
139947
|
}
|
|
139686
|
-
|
|
139948
|
+
_helpers_validator_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A.assertOptions(config, {
|
|
139687
139949
|
baseUrl: validators.spelling('baseURL'),
|
|
139688
139950
|
withXsrfToken: validators.spelling('withXSRFToken')
|
|
139689
139951
|
}, true);
|
|
139690
139952
|
|
|
139691
139953
|
// Set config.method
|
|
139692
|
-
config.method = (config
|
|
139954
|
+
config.method = (_utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.getSafeProp(config, 'method') || _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.getSafeProp(this.defaults, 'method') || 'get').toLowerCase();
|
|
139693
139955
|
|
|
139694
139956
|
// Flatten headers
|
|
139695
139957
|
let contextHeaders = headers && _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.merge(headers.common, headers[config.method]);
|
|
139696
|
-
headers && _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.forEach([
|
|
139958
|
+
headers && _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.forEach(_methodList_js__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.concat('common'), method => {
|
|
139697
139959
|
delete headers[method];
|
|
139698
139960
|
});
|
|
139699
|
-
config.headers =
|
|
139961
|
+
config.headers = _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A.concat(contextHeaders, headers);
|
|
139700
139962
|
|
|
139701
139963
|
// filter out skipped interceptors
|
|
139702
139964
|
const requestInterceptorChain = [];
|
|
@@ -139706,7 +139968,7 @@ class Axios {
|
|
|
139706
139968
|
return;
|
|
139707
139969
|
}
|
|
139708
139970
|
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
139709
|
-
const transitional = config.transitional ||
|
|
139971
|
+
const transitional = config.transitional || _defaults_transitional_js__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A;
|
|
139710
139972
|
const legacyInterceptorReqResOrdering = transitional && transitional.legacyInterceptorReqResOrdering;
|
|
139711
139973
|
if (legacyInterceptorReqResOrdering) {
|
|
139712
139974
|
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
|
@@ -140371,9 +140633,51 @@ _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.freezeMethods(AxiosHe
|
|
|
140371
140633
|
|
|
140372
140634
|
|
|
140373
140635
|
|
|
140636
|
+
const $internals = Symbol('internals');
|
|
140637
|
+
|
|
140638
|
+
// `handlers` is public and may be replaced with a nullish value by user code;
|
|
140639
|
+
// `clear()` has always tolerated that. Treat it as an empty stack rather than
|
|
140640
|
+
// dereferencing it.
|
|
140641
|
+
function countHandlers(handlers) {
|
|
140642
|
+
return handlers ? handlers.length : 0;
|
|
140643
|
+
}
|
|
140644
|
+
function trimHandlers(handlers) {
|
|
140645
|
+
if (!handlers) {
|
|
140646
|
+
return;
|
|
140647
|
+
}
|
|
140648
|
+
while (handlers.length && handlers[handlers.length - 1] === null) {
|
|
140649
|
+
handlers.pop();
|
|
140650
|
+
}
|
|
140651
|
+
}
|
|
140652
|
+
function syncHandlerEntries(manager, internals) {
|
|
140653
|
+
const handlers = manager.handlers;
|
|
140654
|
+
const length = countHandlers(handlers);
|
|
140655
|
+
if (handlers !== internals.handlersRef) {
|
|
140656
|
+
internals.handlersRef = handlers;
|
|
140657
|
+
internals.handlerEntries.clear();
|
|
140658
|
+
} else if (length !== internals.handlersLength) {
|
|
140659
|
+
if (!length) {
|
|
140660
|
+
internals.handlerEntries.clear();
|
|
140661
|
+
} else {
|
|
140662
|
+
internals.handlerEntries.forEach(function removeStaleEntry(entry, id) {
|
|
140663
|
+
if (handlers[entry.index] !== entry.handler) {
|
|
140664
|
+
internals.handlerEntries.delete(id);
|
|
140665
|
+
}
|
|
140666
|
+
});
|
|
140667
|
+
}
|
|
140668
|
+
}
|
|
140669
|
+
internals.handlersLength = length;
|
|
140670
|
+
}
|
|
140374
140671
|
class InterceptorManager {
|
|
140375
140672
|
constructor() {
|
|
140376
140673
|
this.handlers = [];
|
|
140674
|
+
this[$internals] = {
|
|
140675
|
+
handlersRef: this.handlers,
|
|
140676
|
+
handlersLength: this.handlers.length,
|
|
140677
|
+
handlerEntries: new Map(),
|
|
140678
|
+
iterationDepth: 0,
|
|
140679
|
+
nextId: 0
|
|
140680
|
+
};
|
|
140377
140681
|
}
|
|
140378
140682
|
|
|
140379
140683
|
/**
|
|
@@ -140386,13 +140690,25 @@ class InterceptorManager {
|
|
|
140386
140690
|
* @return {Number} An ID used to remove interceptor later
|
|
140387
140691
|
*/
|
|
140388
140692
|
use(fulfilled, rejected, options) {
|
|
140389
|
-
|
|
140693
|
+
const handler = {
|
|
140390
140694
|
fulfilled,
|
|
140391
140695
|
rejected,
|
|
140392
140696
|
synchronous: options ? options.synchronous : false,
|
|
140393
140697
|
runWhen: options ? options.runWhen : null
|
|
140698
|
+
};
|
|
140699
|
+
const internals = this[$internals];
|
|
140700
|
+
if (this.handlers == null) {
|
|
140701
|
+
this.handlers = [];
|
|
140702
|
+
}
|
|
140703
|
+
syncHandlerEntries(this, internals);
|
|
140704
|
+
const id = internals.nextId++;
|
|
140705
|
+
this.handlers.push(handler);
|
|
140706
|
+
internals.handlerEntries.set(id, {
|
|
140707
|
+
handler,
|
|
140708
|
+
index: this.handlers.length - 1
|
|
140394
140709
|
});
|
|
140395
|
-
|
|
140710
|
+
internals.handlersLength = this.handlers.length;
|
|
140711
|
+
return id;
|
|
140396
140712
|
}
|
|
140397
140713
|
|
|
140398
140714
|
/**
|
|
@@ -140403,8 +140719,23 @@ class InterceptorManager {
|
|
|
140403
140719
|
* @returns {void}
|
|
140404
140720
|
*/
|
|
140405
140721
|
eject(id) {
|
|
140406
|
-
|
|
140407
|
-
|
|
140722
|
+
const internals = this[$internals];
|
|
140723
|
+
syncHandlerEntries(this, internals);
|
|
140724
|
+
const entry = internals.handlerEntries.get(id);
|
|
140725
|
+
if (entry) {
|
|
140726
|
+
internals.handlerEntries.delete(id);
|
|
140727
|
+
|
|
140728
|
+
// Ignore IDs invalidated by clear or direct replacement of handlers.
|
|
140729
|
+
if (this.handlers[entry.index] !== entry.handler) {
|
|
140730
|
+
return;
|
|
140731
|
+
}
|
|
140732
|
+
this.handlers[entry.index] = null;
|
|
140733
|
+
|
|
140734
|
+
// Do not reuse an index while forEach is walking its length snapshot.
|
|
140735
|
+
if (!internals.iterationDepth) {
|
|
140736
|
+
trimHandlers(this.handlers);
|
|
140737
|
+
internals.handlersLength = this.handlers.length;
|
|
140738
|
+
}
|
|
140408
140739
|
}
|
|
140409
140740
|
}
|
|
140410
140741
|
|
|
@@ -140416,6 +140747,7 @@ class InterceptorManager {
|
|
|
140416
140747
|
clear() {
|
|
140417
140748
|
if (this.handlers) {
|
|
140418
140749
|
this.handlers = [];
|
|
140750
|
+
syncHandlerEntries(this, this[$internals]);
|
|
140419
140751
|
}
|
|
140420
140752
|
}
|
|
140421
140753
|
|
|
@@ -140430,11 +140762,22 @@ class InterceptorManager {
|
|
|
140430
140762
|
* @returns {void}
|
|
140431
140763
|
*/
|
|
140432
140764
|
forEach(fn) {
|
|
140433
|
-
|
|
140434
|
-
|
|
140435
|
-
|
|
140765
|
+
const internals = this[$internals];
|
|
140766
|
+
syncHandlerEntries(this, internals);
|
|
140767
|
+
internals.iterationDepth++;
|
|
140768
|
+
try {
|
|
140769
|
+
_utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.forEach(this.handlers, function forEachHandler(h) {
|
|
140770
|
+
if (h !== null) {
|
|
140771
|
+
fn(h);
|
|
140772
|
+
}
|
|
140773
|
+
});
|
|
140774
|
+
} finally {
|
|
140775
|
+
if (! --internals.iterationDepth) {
|
|
140776
|
+
syncHandlerEntries(this, internals);
|
|
140777
|
+
trimHandlers(this.handlers);
|
|
140778
|
+
internals.handlersLength = countHandlers(this.handlers);
|
|
140436
140779
|
}
|
|
140437
|
-
}
|
|
140780
|
+
}
|
|
140438
140781
|
}
|
|
140439
140782
|
}
|
|
140440
140783
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InterceptorManager);
|
|
@@ -140450,23 +140793,14 @@ class InterceptorManager {
|
|
|
140450
140793
|
/* harmony import */ var _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7996);
|
|
140451
140794
|
/* harmony import */ var _helpers_isAbsoluteURL_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6392);
|
|
140452
140795
|
/* harmony import */ var _helpers_combineURLs_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(64133);
|
|
140796
|
+
/* harmony import */ var _helpers_normalizeURLForProtocolCheck_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(69893);
|
|
140797
|
+
|
|
140453
140798
|
|
|
140454
140799
|
|
|
140455
140800
|
|
|
140456
140801
|
|
|
140457
140802
|
|
|
140458
140803
|
const malformedHttpProtocol = /^https?:(?!\/\/)/i;
|
|
140459
|
-
const httpProtocolControlCharacters = /[\t\n\r]/g;
|
|
140460
|
-
function stripLeadingC0ControlOrSpace(url) {
|
|
140461
|
-
let i = 0;
|
|
140462
|
-
while (i < url.length && url.charCodeAt(i) <= 0x20) {
|
|
140463
|
-
i++;
|
|
140464
|
-
}
|
|
140465
|
-
return url.slice(i);
|
|
140466
|
-
}
|
|
140467
|
-
function normalizeURLForProtocolCheck(url) {
|
|
140468
|
-
return stripLeadingC0ControlOrSpace(url).replace(httpProtocolControlCharacters, '');
|
|
140469
|
-
}
|
|
140470
140804
|
|
|
140471
140805
|
// Redact the parts of a URL that can carry secrets before it is embedded in an
|
|
140472
140806
|
// error message. AxiosError.toJSON() serializes `message` verbatim and errors
|
|
@@ -140496,7 +140830,7 @@ function redactSensitiveURLParts(url) {
|
|
|
140496
140830
|
}
|
|
140497
140831
|
function assertValidHttpProtocolURL(url, config) {
|
|
140498
140832
|
if (typeof url === 'string') {
|
|
140499
|
-
const normalizedURL =
|
|
140833
|
+
const normalizedURL = (0,_helpers_normalizeURLForProtocolCheck_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A)(url);
|
|
140500
140834
|
if (malformedHttpProtocol.test(normalizedURL)) {
|
|
140501
140835
|
throw new _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A(`Invalid URL ${JSON.stringify(redactSensitiveURLParts(normalizedURL))}: missing "//" after protocol`, _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.ERR_INVALID_URL, config);
|
|
140502
140836
|
}
|
|
@@ -140537,6 +140871,8 @@ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) {
|
|
|
140537
140871
|
/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(62200);
|
|
140538
140872
|
/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(88580);
|
|
140539
140873
|
/* harmony import */ var _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(93129);
|
|
140874
|
+
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(21285);
|
|
140875
|
+
|
|
140540
140876
|
|
|
140541
140877
|
|
|
140542
140878
|
|
|
@@ -140569,9 +140905,13 @@ function throwIfCancellationRequested(config) {
|
|
|
140569
140905
|
*
|
|
140570
140906
|
* @returns {Promise} The Promise to be fulfilled
|
|
140571
140907
|
*/
|
|
140572
|
-
function dispatchRequest(
|
|
140908
|
+
function dispatchRequest(_config) {
|
|
140909
|
+
// Interceptors may replace the merged config with an ordinary object. Flatten
|
|
140910
|
+
// it at the dispatch boundary so shared prototype members cannot become
|
|
140911
|
+
// request behavior, while preserving intentional template/class members.
|
|
140912
|
+
const config = _utils_js__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.toSafeFlatObject(_config);
|
|
140573
140913
|
throwIfCancellationRequested(config);
|
|
140574
|
-
config.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.from(config
|
|
140914
|
+
config.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.from(_utils_js__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.getSafeProp(config, 'headers'));
|
|
140575
140915
|
|
|
140576
140916
|
// Transform request data
|
|
140577
140917
|
config.data = _transformData_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.call(config, config.transformRequest);
|
|
@@ -140734,7 +141074,7 @@ function mergeConfig(config1, config2) {
|
|
|
140734
141074
|
transformResponse: defaultToConfig2,
|
|
140735
141075
|
paramsSerializer: defaultToConfig2,
|
|
140736
141076
|
timeout: defaultToConfig2,
|
|
140737
|
-
|
|
141077
|
+
timeoutErrorMessage: defaultToConfig2,
|
|
140738
141078
|
withCredentials: defaultToConfig2,
|
|
140739
141079
|
withXSRFToken: defaultToConfig2,
|
|
140740
141080
|
adapter: defaultToConfig2,
|
|
@@ -140780,6 +141120,19 @@ function mergeConfig(config1, config2) {
|
|
|
140780
141120
|
|
|
140781
141121
|
/***/ },
|
|
140782
141122
|
|
|
141123
|
+
/***/ 31109
|
|
141124
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
141125
|
+
|
|
141126
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
141127
|
+
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
141128
|
+
/* harmony export */ });
|
|
141129
|
+
|
|
141130
|
+
|
|
141131
|
+
const methodList = Object.freeze(['get', 'delete', 'head', 'options', 'post', 'put', 'patch', 'purge', 'link', 'unlink', 'query']);
|
|
141132
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (methodList);
|
|
141133
|
+
|
|
141134
|
+
/***/ },
|
|
141135
|
+
|
|
140783
141136
|
/***/ 19524
|
|
140784
141137
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
140785
141138
|
|
|
@@ -140896,6 +141249,8 @@ function transformData(fns, response) {
|
|
|
140896
141249
|
/* harmony import */ var _helpers_toURLEncodedForm_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(88898);
|
|
140897
141250
|
/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(75194);
|
|
140898
141251
|
/* harmony import */ var _helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(17757);
|
|
141252
|
+
/* harmony import */ var _core_methodList_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31109);
|
|
141253
|
+
|
|
140899
141254
|
|
|
140900
141255
|
|
|
140901
141256
|
|
|
@@ -141021,7 +141376,7 @@ const defaults = {
|
|
|
141021
141376
|
}
|
|
141022
141377
|
}
|
|
141023
141378
|
};
|
|
141024
|
-
_utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.forEach([
|
|
141379
|
+
_utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.forEach(_core_methodList_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A, method => {
|
|
141025
141380
|
defaults.headers[method] = {};
|
|
141026
141381
|
});
|
|
141027
141382
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (defaults);
|
|
@@ -141053,7 +141408,7 @@ _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.forEach(['delete', 'g
|
|
|
141053
141408
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
141054
141409
|
/* harmony export */ x: () => (/* binding */ VERSION)
|
|
141055
141410
|
/* harmony export */ });
|
|
141056
|
-
const VERSION = "1.
|
|
141411
|
+
const VERSION = "1.20.0";
|
|
141057
141412
|
|
|
141058
141413
|
/***/ },
|
|
141059
141414
|
|
|
@@ -141159,14 +141514,22 @@ const HttpStatusCode = {
|
|
|
141159
141514
|
Gone: 410,
|
|
141160
141515
|
LengthRequired: 411,
|
|
141161
141516
|
PreconditionFailed: 412,
|
|
141517
|
+
/**
|
|
141518
|
+
* @deprecated Use `ContentTooLarge` instead.
|
|
141519
|
+
*/
|
|
141162
141520
|
PayloadTooLarge: 413,
|
|
141521
|
+
ContentTooLarge: 413,
|
|
141163
141522
|
UriTooLong: 414,
|
|
141164
141523
|
UnsupportedMediaType: 415,
|
|
141165
141524
|
RangeNotSatisfiable: 416,
|
|
141166
141525
|
ExpectationFailed: 417,
|
|
141167
141526
|
ImATeapot: 418,
|
|
141168
141527
|
MisdirectedRequest: 421,
|
|
141528
|
+
/**
|
|
141529
|
+
* @deprecated Use `UnprocessableContent` instead.
|
|
141530
|
+
*/
|
|
141169
141531
|
UnprocessableEntity: 422,
|
|
141532
|
+
UnprocessableContent: 422,
|
|
141170
141533
|
Locked: 423,
|
|
141171
141534
|
FailedDependency: 424,
|
|
141172
141535
|
TooEarly: 425,
|
|
@@ -141195,7 +141558,9 @@ const HttpStatusCode = {
|
|
|
141195
141558
|
InvalidSslCertificate: 526
|
|
141196
141559
|
};
|
|
141197
141560
|
Object.entries(HttpStatusCode).forEach(([key, value]) => {
|
|
141198
|
-
HttpStatusCode[value]
|
|
141561
|
+
if (HttpStatusCode[value] === undefined) {
|
|
141562
|
+
HttpStatusCode[value] = key;
|
|
141563
|
+
}
|
|
141199
141564
|
});
|
|
141200
141565
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (HttpStatusCode);
|
|
141201
141566
|
|
|
@@ -141781,6 +142146,36 @@ function isAxiosError(payload) {
|
|
|
141781
142146
|
|
|
141782
142147
|
/***/ },
|
|
141783
142148
|
|
|
142149
|
+
/***/ 69893
|
|
142150
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
142151
|
+
|
|
142152
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
142153
|
+
/* harmony export */ A: () => (/* binding */ normalizeURLForProtocolCheck)
|
|
142154
|
+
/* harmony export */ });
|
|
142155
|
+
|
|
142156
|
+
|
|
142157
|
+
const urlParserControlCharacters = /[\t\n\r]/g;
|
|
142158
|
+
|
|
142159
|
+
/**
|
|
142160
|
+
* Match WHATWG URL preprocessing before checking a URL's protocol.
|
|
142161
|
+
*
|
|
142162
|
+
* @param {string} url
|
|
142163
|
+
*
|
|
142164
|
+
* @returns {string}
|
|
142165
|
+
*/
|
|
142166
|
+
function normalizeURLForProtocolCheck(url) {
|
|
142167
|
+
if (typeof url !== 'string') {
|
|
142168
|
+
return url;
|
|
142169
|
+
}
|
|
142170
|
+
let start = 0;
|
|
142171
|
+
while (start < url.length && url.charCodeAt(start) <= 0x20) {
|
|
142172
|
+
start++;
|
|
142173
|
+
}
|
|
142174
|
+
return url.slice(start).replace(urlParserControlCharacters, '');
|
|
142175
|
+
}
|
|
142176
|
+
|
|
142177
|
+
/***/ },
|
|
142178
|
+
|
|
141784
142179
|
/***/ 65265
|
|
141785
142180
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
141786
142181
|
|
|
@@ -141883,7 +142278,7 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
|
141883
142278
|
let bytesNotified = 0;
|
|
141884
142279
|
const _speedometer = (0,_speedometer_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(50, 250);
|
|
141885
142280
|
return (0,_throttle_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(e => {
|
|
141886
|
-
if (!e ||
|
|
142281
|
+
if (!e || !_utils_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.isNumber(e.loaded)) {
|
|
141887
142282
|
return;
|
|
141888
142283
|
}
|
|
141889
142284
|
const rawLoaded = e.loaded;
|
|
@@ -141983,11 +142378,12 @@ function resolveConfig(config) {
|
|
|
141983
142378
|
}
|
|
141984
142379
|
}
|
|
141985
142380
|
if (_utils_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.isFormData(data)) {
|
|
142381
|
+
const getHeaders = _utils_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.getSafeProp(data, 'getHeaders');
|
|
141986
142382
|
if (_platform_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.hasStandardBrowserEnv || _platform_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.hasStandardBrowserWebWorkerEnv || _utils_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.isReactNative(data)) {
|
|
141987
142383
|
headers.setContentType(undefined); // browser/web worker/RN handles it
|
|
141988
|
-
} else if (_utils_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.isFunction(
|
|
142384
|
+
} else if (_utils_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.isFunction(getHeaders)) {
|
|
141989
142385
|
// Node.js FormData (like form-data package)
|
|
141990
|
-
(0,_core_setFormDataHeaders_js__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A)(headers,
|
|
142386
|
+
(0,_core_setFormDataHeaders_js__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A)(headers, getHeaders.call(data), own('formDataHeaderPolicy'));
|
|
141991
142387
|
}
|
|
141992
142388
|
}
|
|
141993
142389
|
|
|
@@ -142170,7 +142566,7 @@ function spread(callback) {
|
|
|
142170
142566
|
* Throttle decorator
|
|
142171
142567
|
* @param {Function} fn
|
|
142172
142568
|
* @param {Number} freq
|
|
142173
|
-
* @return {Function}
|
|
142569
|
+
* @return {Array<Function>}
|
|
142174
142570
|
*/
|
|
142175
142571
|
function throttle(fn, freq) {
|
|
142176
142572
|
let timestamp = 0;
|
|
@@ -142202,7 +142598,8 @@ function throttle(fn, freq) {
|
|
|
142202
142598
|
}
|
|
142203
142599
|
};
|
|
142204
142600
|
const flush = () => lastArgs && invoke(lastArgs);
|
|
142205
|
-
|
|
142601
|
+
const flushWith = (...args) => invoke(args);
|
|
142602
|
+
return [throttled, flush, flushWith];
|
|
142206
142603
|
}
|
|
142207
142604
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (throttle);
|
|
142208
142605
|
|
|
@@ -142314,23 +142711,17 @@ function toFormData(obj, formData, options) {
|
|
|
142314
142711
|
|
|
142315
142712
|
// eslint-disable-next-line no-param-reassign
|
|
142316
142713
|
formData = formData || new (_platform_node_classes_FormData_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A || FormData)();
|
|
142317
|
-
|
|
142318
|
-
|
|
142319
|
-
|
|
142320
|
-
|
|
142321
|
-
|
|
142322
|
-
indexes: false
|
|
142323
|
-
}, false, function defined(option, source) {
|
|
142324
|
-
// eslint-disable-next-line no-eq-null,eqeqeq
|
|
142325
|
-
return !_utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.isUndefined(source[option]);
|
|
142326
|
-
});
|
|
142327
|
-
const metaTokens = options.metaTokens;
|
|
142714
|
+
const option = (name, fallback) => {
|
|
142715
|
+
const value = _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.getSafeProp(options, name);
|
|
142716
|
+
return _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.isUndefined(value) ? fallback : value;
|
|
142717
|
+
};
|
|
142718
|
+
const metaTokens = option('metaTokens', true);
|
|
142328
142719
|
// eslint-disable-next-line no-use-before-define
|
|
142329
|
-
const visitor =
|
|
142330
|
-
const dots =
|
|
142331
|
-
const indexes =
|
|
142332
|
-
const _Blob =
|
|
142333
|
-
const maxDepth =
|
|
142720
|
+
const visitor = option('visitor') || defaultVisitor;
|
|
142721
|
+
const dots = option('dots', false);
|
|
142722
|
+
const indexes = option('indexes', false);
|
|
142723
|
+
const _Blob = option('Blob') || typeof Blob !== 'undefined' && Blob;
|
|
142724
|
+
const maxDepth = option('maxDepth', DEFAULT_FORM_DATA_MAX_DEPTH);
|
|
142334
142725
|
const useBlob = _Blob && _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.isSpecCompliantForm(formData);
|
|
142335
142726
|
const stack = [];
|
|
142336
142727
|
if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.isFunction(visitor)) {
|
|
@@ -142827,13 +143218,57 @@ const {
|
|
|
142827
143218
|
const hasOwnProperty = (({
|
|
142828
143219
|
hasOwnProperty
|
|
142829
143220
|
}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);
|
|
143221
|
+
const isUnsafeObjectKey = prop => typeof prop === 'string' && (prop === '__proto__' || prop === 'constructor' || prop === 'prototype');
|
|
143222
|
+
|
|
143223
|
+
/**
|
|
143224
|
+
* Determine whether an inherited object must be treated as a shared-prototype
|
|
143225
|
+
* boundary. Cross-realm Object.prototype objects cannot be distinguished
|
|
143226
|
+
* reliably from application-created null-prototype objects because their
|
|
143227
|
+
* properties are mutable, so all inherited terminal prototypes are excluded
|
|
143228
|
+
* as a fail-closed boundary. A null-prototype source still keeps its own
|
|
143229
|
+
* properties, as produced by mergeConfig and other safe materialization paths.
|
|
143230
|
+
*
|
|
143231
|
+
* @param {*} obj The object to inspect
|
|
143232
|
+
* @param {*} prototype The object's prototype
|
|
143233
|
+
* @param {boolean} source Whether obj is the original traversal source
|
|
143234
|
+
*
|
|
143235
|
+
* @returns {boolean} True when obj is a safe prototype traversal boundary
|
|
143236
|
+
*/
|
|
143237
|
+
const isPrototypeBoundary = (obj, prototype, source) => obj === Object.prototype || !source && prototype === null;
|
|
143238
|
+
|
|
143239
|
+
/**
|
|
143240
|
+
* Determine whether an object can retain its identity through code paths that
|
|
143241
|
+
* add, replace, and remove config properties without bypassing unsafe-key
|
|
143242
|
+
* filtering. Immutable objects, unsafe-key-bearing objects, and objects with
|
|
143243
|
+
* accessor or restricted data properties must be materialized instead.
|
|
143244
|
+
*
|
|
143245
|
+
* @param {*} obj The object to inspect
|
|
143246
|
+
*
|
|
143247
|
+
* @returns {boolean} True when every own property is safe and fully mutable
|
|
143248
|
+
*/
|
|
143249
|
+
const isSafeAndFullyMutable = obj => {
|
|
143250
|
+
if (!Object.isExtensible(obj)) {
|
|
143251
|
+
return false;
|
|
143252
|
+
}
|
|
143253
|
+
const props = Object.getOwnPropertyNames(obj);
|
|
143254
|
+
if (Object.getOwnPropertySymbols) {
|
|
143255
|
+
props.push(...Object.getOwnPropertySymbols(obj));
|
|
143256
|
+
}
|
|
143257
|
+
return props.every(prop => {
|
|
143258
|
+
if (isUnsafeObjectKey(prop)) {
|
|
143259
|
+
return false;
|
|
143260
|
+
}
|
|
143261
|
+
const descriptor = Object.getOwnPropertyDescriptor(obj, prop);
|
|
143262
|
+
return !!descriptor && descriptor.configurable && descriptor.writable === true;
|
|
143263
|
+
});
|
|
143264
|
+
};
|
|
142830
143265
|
|
|
142831
143266
|
/**
|
|
142832
|
-
* Walk the prototype chain (excluding the
|
|
142833
|
-
* an own `prop`. This distinguishes genuine own/inherited members
|
|
142834
|
-
* class accessors and template prototypes — from members injected
|
|
142835
|
-
* Object.prototype pollution (e.g. `Object.prototype.username = '...'`),
|
|
142836
|
-
* live on Object.prototype itself and are therefore never matched.
|
|
143267
|
+
* Walk the prototype chain (excluding the source realm's Object.prototype)
|
|
143268
|
+
* looking for an own `prop`. This distinguishes genuine own/inherited members
|
|
143269
|
+
* — including class accessors and template prototypes — from members injected
|
|
143270
|
+
* via Object.prototype pollution (e.g. `Object.prototype.username = '...'`),
|
|
143271
|
+
* which live on Object.prototype itself and are therefore never matched.
|
|
142837
143272
|
*
|
|
142838
143273
|
* @param {*} thing The value whose chain to inspect
|
|
142839
143274
|
* @param {string|symbol} prop The property key to look for
|
|
@@ -142843,15 +143278,19 @@ const hasOwnProperty = (({
|
|
|
142843
143278
|
const hasOwnInPrototypeChain = (thing, prop) => {
|
|
142844
143279
|
let obj = thing;
|
|
142845
143280
|
const seen = [];
|
|
142846
|
-
while (obj != null
|
|
143281
|
+
while (obj != null) {
|
|
142847
143282
|
if (seen.indexOf(obj) !== -1) {
|
|
142848
143283
|
return false;
|
|
142849
143284
|
}
|
|
142850
143285
|
seen.push(obj);
|
|
143286
|
+
const prototype = getPrototypeOf(obj);
|
|
143287
|
+
if (isPrototypeBoundary(obj, prototype, obj === thing)) {
|
|
143288
|
+
return false;
|
|
143289
|
+
}
|
|
142851
143290
|
if (hasOwnProperty(obj, prop)) {
|
|
142852
143291
|
return true;
|
|
142853
143292
|
}
|
|
142854
|
-
obj =
|
|
143293
|
+
obj = prototype;
|
|
142855
143294
|
}
|
|
142856
143295
|
return false;
|
|
142857
143296
|
};
|
|
@@ -142868,6 +143307,56 @@ const hasOwnInPrototypeChain = (thing, prop) => {
|
|
|
142868
143307
|
* @returns {*} The resolved value, or undefined when unsafe/absent
|
|
142869
143308
|
*/
|
|
142870
143309
|
const getSafeProp = (obj, prop) => obj != null && hasOwnInPrototypeChain(obj, prop) ? obj[prop] : undefined;
|
|
143310
|
+
|
|
143311
|
+
/**
|
|
143312
|
+
* Flatten an object and its application-defined prototype chain into a
|
|
143313
|
+
* null-prototype object. Members inherited only from the source realm's
|
|
143314
|
+
* Object.prototype are deliberately excluded, while class/template members
|
|
143315
|
+
* below that boundary are preserved.
|
|
143316
|
+
*
|
|
143317
|
+
* @param {*} thing The value to flatten
|
|
143318
|
+
*
|
|
143319
|
+
* @returns {*} A null-prototype copy, or the original value when it is already
|
|
143320
|
+
* structurally safe or is not an object
|
|
143321
|
+
*/
|
|
143322
|
+
const toSafeFlatObject = thing => {
|
|
143323
|
+
if (thing == null || typeof thing !== 'object' && typeof thing !== 'function') {
|
|
143324
|
+
return thing;
|
|
143325
|
+
}
|
|
143326
|
+
const sourcePrototype = getPrototypeOf(thing);
|
|
143327
|
+
if (sourcePrototype === null && isSafeAndFullyMutable(thing)) {
|
|
143328
|
+
return thing;
|
|
143329
|
+
}
|
|
143330
|
+
const result = Object.create(null);
|
|
143331
|
+
const merged = Object.create(null);
|
|
143332
|
+
const seen = [];
|
|
143333
|
+
let current = thing;
|
|
143334
|
+
while (current != null) {
|
|
143335
|
+
if (seen.indexOf(current) !== -1) {
|
|
143336
|
+
break;
|
|
143337
|
+
}
|
|
143338
|
+
seen.push(current);
|
|
143339
|
+
const prototype = current === thing ? sourcePrototype : getPrototypeOf(current);
|
|
143340
|
+
if (isPrototypeBoundary(current, prototype, current === thing)) {
|
|
143341
|
+
break;
|
|
143342
|
+
}
|
|
143343
|
+
const props = Object.getOwnPropertyNames(current);
|
|
143344
|
+
if (Object.getOwnPropertySymbols) {
|
|
143345
|
+
props.push(...Object.getOwnPropertySymbols(current));
|
|
143346
|
+
}
|
|
143347
|
+
for (const prop of props) {
|
|
143348
|
+
if (isUnsafeObjectKey(prop)) {
|
|
143349
|
+
continue;
|
|
143350
|
+
}
|
|
143351
|
+
if (!hasOwnProperty(merged, prop)) {
|
|
143352
|
+
result[prop] = thing[prop];
|
|
143353
|
+
merged[prop] = true;
|
|
143354
|
+
}
|
|
143355
|
+
}
|
|
143356
|
+
current = prototype;
|
|
143357
|
+
}
|
|
143358
|
+
return result;
|
|
143359
|
+
};
|
|
142871
143360
|
const kindOf = (cache => thing => {
|
|
142872
143361
|
const str = toString.call(thing);
|
|
142873
143362
|
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
@@ -142991,9 +143480,9 @@ const isPlainObject = val => {
|
|
|
142991
143480
|
}
|
|
142992
143481
|
const prototype = getPrototypeOf(val);
|
|
142993
143482
|
return (prototype === null || prototype === Object.prototype || getPrototypeOf(prototype) === null) &&
|
|
142994
|
-
// Treat
|
|
142995
|
-
//
|
|
142996
|
-
//
|
|
143483
|
+
// Treat safe own/inherited Symbol.toStringTag or Symbol.iterator members as
|
|
143484
|
+
// evidence the value is tagged/iterable, while ignoring members reachable
|
|
143485
|
+
// only through shared or terminal prototype boundaries.
|
|
142997
143486
|
!hasOwnInPrototypeChain(val, toStringTag) && !hasOwnInPrototypeChain(val, iterator);
|
|
142998
143487
|
};
|
|
142999
143488
|
|
|
@@ -143741,6 +144230,7 @@ const isSafeIterable = thing => thing != null && hasOwnInPrototypeChain(thing, i
|
|
|
143741
144230
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
143742
144231
|
hasOwnInPrototypeChain,
|
|
143743
144232
|
getSafeProp,
|
|
144233
|
+
toSafeFlatObject,
|
|
143744
144234
|
reduceDescriptors,
|
|
143745
144235
|
freezeMethods,
|
|
143746
144236
|
toObjectSet,
|