@microsoft/omnichannel-chat-widget 1.7.8-main.29ce174 → 1.7.8-main.50111af
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/lib/cjs/common/Constants.js +57 -18
- package/lib/cjs/common/KeyCodes.js +6 -1
- package/lib/cjs/common/contextDataStore/DataStoreManager.js +6 -1
- package/lib/cjs/common/facades/FacadeChatSDK.js +385 -292
- package/lib/cjs/common/storage/default/defaultCacheManager.js +6 -3
- package/lib/cjs/common/telemetry/TelemetryConstants.js +137 -116
- package/lib/cjs/common/telemetry/TelemetryHelper.js +219 -181
- package/lib/cjs/common/telemetry/TelemetryManager.js +9 -2
- package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +4 -5
- package/lib/cjs/components/headerstateful/HeaderStateful.js +3 -5
- package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +32 -19
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +71 -56
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +17 -8
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.js +65 -52
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +31 -18
- package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +14 -6
- package/lib/cjs/components/livechatwidget/common/Deferred.js +14 -6
- package/lib/cjs/components/livechatwidget/common/chatDisconnectHelper.js +3 -1
- package/lib/cjs/components/livechatwidget/common/endChat.js +4 -18
- package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +0 -5
- package/lib/cjs/components/livechatwidget/common/startChat.js +2 -23
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +3 -3
- package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +6 -4
- package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +7 -6
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +4 -3
- package/lib/cjs/components/webchatcontainerstateful/common/DemoChatAdapter.js +88 -65
- package/lib/cjs/components/webchatcontainerstateful/common/DemoChatSDK.js +26 -7
- package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatAdapter.js +49 -26
- package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatSDK.js +57 -35
- package/lib/cjs/components/webchatcontainerstateful/common/mockadapter.js +62 -52
- package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +95 -61
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +6 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +6 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.js +53 -39
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +4 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +88 -60
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +18 -6
- package/lib/cjs/firstresponselatency/Constants.js +13 -0
- package/lib/cjs/firstresponselatency/FirstMessageTrackerFromBot.js +118 -0
- package/lib/cjs/firstresponselatency/FirstResponseLatencyTracker.js +201 -0
- package/lib/cjs/firstresponselatency/util.js +98 -0
- package/lib/cjs/plugins/createChatTranscript.js +88 -58
- package/lib/cjs/plugins/newMessageEventHandler.js +102 -88
- package/lib/esm/common/Constants.js +57 -18
- package/lib/esm/common/KeyCodes.js +6 -1
- package/lib/esm/common/contextDataStore/DataStoreManager.js +6 -1
- package/lib/esm/common/facades/FacadeChatSDK.js +385 -292
- package/lib/esm/common/storage/default/defaultCacheManager.js +6 -1
- package/lib/esm/common/telemetry/TelemetryConstants.js +137 -116
- package/lib/esm/common/telemetry/TelemetryHelper.js +219 -181
- package/lib/esm/common/telemetry/TelemetryManager.js +9 -2
- package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +4 -5
- package/lib/esm/components/headerstateful/HeaderStateful.js +3 -5
- package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +32 -19
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +71 -56
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +17 -8
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.js +65 -52
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +31 -18
- package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +14 -6
- package/lib/esm/components/livechatwidget/common/Deferred.js +14 -6
- package/lib/esm/components/livechatwidget/common/chatDisconnectHelper.js +3 -1
- package/lib/esm/components/livechatwidget/common/endChat.js +4 -18
- package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +1 -6
- package/lib/esm/components/livechatwidget/common/startChat.js +3 -24
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +3 -3
- package/lib/esm/components/ooohpanestateful/OOOHPaneStateful.js +6 -4
- package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +7 -6
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +4 -3
- package/lib/esm/components/webchatcontainerstateful/common/DemoChatAdapter.js +88 -65
- package/lib/esm/components/webchatcontainerstateful/common/DemoChatSDK.js +26 -7
- package/lib/esm/components/webchatcontainerstateful/common/DesignerChatAdapter.js +49 -26
- package/lib/esm/components/webchatcontainerstateful/common/DesignerChatSDK.js +57 -35
- package/lib/esm/components/webchatcontainerstateful/common/mockadapter.js +63 -52
- package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +95 -61
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +6 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +6 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.js +53 -39
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +4 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +88 -60
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +18 -6
- package/lib/esm/firstresponselatency/Constants.js +6 -0
- package/lib/esm/firstresponselatency/FirstMessageTrackerFromBot.js +112 -0
- package/lib/esm/firstresponselatency/FirstResponseLatencyTracker.js +194 -0
- package/lib/esm/firstresponselatency/util.js +87 -0
- package/lib/esm/plugins/createChatTranscript.js +88 -58
- package/lib/esm/plugins/newMessageEventHandler.js +100 -86
- package/lib/types/common/facades/FacadeChatSDK.d.ts +1 -0
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +8 -1
- package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatProps.d.ts +2 -2
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +1 -1
- package/lib/types/firstresponselatency/Constants.d.ts +30 -0
- package/lib/types/firstresponselatency/FirstMessageTrackerFromBot.d.ts +1 -0
- package/lib/types/firstresponselatency/FirstResponseLatencyTracker.d.ts +22 -0
- package/lib/types/firstresponselatency/util.d.ts +7 -0
- package/package.json +18 -6
|
@@ -64,7 +64,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
64
64
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
65
65
|
let uiTimer;
|
|
66
66
|
const LiveChatWidgetStateful = props => {
|
|
67
|
-
var _props$webChatContain, _props$styleProps, _props$webChatContain2, _props$webChatContain3, _props$controlProps, _props$controlProps3, _state$appStates7, _props$webChatContain7, _state$appStates14, _props$webChatContain9, _props$webChatContain10, _props$controlProps12, _props$draggableChatW, _props$draggableChatW2, _props$draggableChatW3, _props$draggableChatW4, _props$draggableChatW5, _livechatProps$webCha, _props$webChatContain11, _props$webChatContain12, _props$webChatContain13, _props$webChatContain14, _livechatProps$styleP, _livechatProps$contro, _livechatProps$contro2, _livechatProps$compon, _livechatProps$contro3, _livechatProps$compon2, _livechatProps$contro4, _livechatProps$compon3, _livechatProps$contro5, _livechatProps$compon4, _livechatProps$contro6, _livechatProps$compon5, _livechatProps$contro7, _livechatProps$compon6, _livechatProps$contro8, _livechatProps$compon7, _livechatProps$contro9, _livechatProps$compon8, _livechatProps$contro10, _livechatProps$contro11, _livechatProps$compon9, _livechatProps$contro12, _livechatProps$compon10, _livechatProps$contro13, _livechatProps$compon11, _livechatProps$compon12, _livechatProps$compon13;
|
|
67
|
+
var _props$webChatContain, _props$styleProps, _props$webChatContain2, _props$webChatContain3, _props$controlProps, _props$controlProps3, _state$appStates7, _props$webChatContain7, _state$appStates14, _props$webChatContain9, _props$webChatContain10, _props$controlProps12, _props$draggableChatW, _props$draggableChatW2, _props$draggableChatW3, _props$draggableChatW4, _props$draggableChatW5, _livechatProps$webCha, _props$webChatContain11, _props$webChatContain12, _props$webChatContain13, _props$webChatContain14, _props$webChatContain15, _props$webChatContain16, _props$webChatContain17, _props$webChatContain18, _livechatProps$styleP, _livechatProps$contro, _livechatProps$contro2, _livechatProps$compon, _livechatProps$contro3, _livechatProps$compon2, _livechatProps$contro4, _livechatProps$compon3, _livechatProps$contro5, _livechatProps$compon4, _livechatProps$contro6, _livechatProps$compon5, _livechatProps$contro7, _livechatProps$compon6, _livechatProps$contro8, _livechatProps$compon7, _livechatProps$contro9, _livechatProps$compon8, _livechatProps$contro10, _livechatProps$contro11, _livechatProps$compon9, _livechatProps$contro12, _livechatProps$compon10, _livechatProps$contro13, _livechatProps$compon11, _livechatProps$compon12, _livechatProps$compon13;
|
|
68
68
|
(0, _react2.useEffect)(() => {
|
|
69
69
|
uiTimer = (0, _utils.createTimer)();
|
|
70
70
|
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
@@ -882,8 +882,8 @@ const LiveChatWidgetStateful = props => {
|
|
|
882
882
|
userID: userID,
|
|
883
883
|
styleOptions: {
|
|
884
884
|
...webChatStyles,
|
|
885
|
-
bubbleBackground: ((_props$webChatContain11 = props.webChatContainerProps) === null || _props$webChatContain11 === void 0 ? void 0 : (_props$webChatContain12 = _props$webChatContain11.
|
|
886
|
-
bubbleTextColor: ((_props$
|
|
885
|
+
bubbleBackground: ((_props$webChatContain11 = props.webChatContainerProps) === null || _props$webChatContain11 === void 0 ? void 0 : (_props$webChatContain12 = _props$webChatContain11.webChatStyles) === null || _props$webChatContain12 === void 0 ? void 0 : _props$webChatContain12.bubbleBackground) ?? ((_props$webChatContain13 = props.webChatContainerProps) === null || _props$webChatContain13 === void 0 ? void 0 : (_props$webChatContain14 = _props$webChatContain13.adaptiveCardStyles) === null || _props$webChatContain14 === void 0 ? void 0 : _props$webChatContain14.background) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.background,
|
|
886
|
+
bubbleTextColor: ((_props$webChatContain15 = props.webChatContainerProps) === null || _props$webChatContain15 === void 0 ? void 0 : (_props$webChatContain16 = _props$webChatContain15.webChatStyles) === null || _props$webChatContain16 === void 0 ? void 0 : _props$webChatContain16.bubbleTextColor) ?? ((_props$webChatContain17 = props.webChatContainerProps) === null || _props$webChatContain17 === void 0 ? void 0 : (_props$webChatContain18 = _props$webChatContain17.adaptiveCardStyles) === null || _props$webChatContain18 === void 0 ? void 0 : _props$webChatContain18.color) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.color
|
|
887
887
|
},
|
|
888
888
|
directLine: directLine
|
|
889
889
|
}), /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
@@ -7,11 +7,11 @@ exports.default = exports.OutOfOfficeHoursPaneStateful = void 0;
|
|
|
7
7
|
var _TelemetryConstants = require("../../common/telemetry/TelemetryConstants");
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _utils = require("../../common/utils");
|
|
10
|
+
var _dompurify = _interopRequireDefault(require("dompurify"));
|
|
10
11
|
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
11
12
|
var _TelemetryHelper = require("../../common/telemetry/TelemetryHelper");
|
|
12
13
|
var _defaultgeneralOOOHPaneStyleProps = require("./common/defaultStyleProps/defaultgeneralOOOHPaneStyleProps");
|
|
13
14
|
var _useChatContextStore = _interopRequireDefault(require("../../hooks/useChatContextStore"));
|
|
14
|
-
var _dompurify = _interopRequireDefault(require("dompurify"));
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
17
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -38,9 +38,11 @@ const OutOfOfficeHoursPaneStateful = props => {
|
|
|
38
38
|
|
|
39
39
|
// Move focus to the first button
|
|
40
40
|
(0, _react.useEffect)(() => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
firstElement[0]
|
|
41
|
+
if (state.domainStates.widgetElementId !== null && state.domainStates.widgetElementId !== undefined && state.domainStates.widgetElementId.trim() !== "") {
|
|
42
|
+
const firstElement = (0, _utils.findAllFocusableElement)(`#${state.domainStates.widgetElementId}`);
|
|
43
|
+
if (firstElement && firstElement[0]) {
|
|
44
|
+
firstElement[0].focus();
|
|
45
|
+
}
|
|
44
46
|
}
|
|
45
47
|
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
46
48
|
Event: _TelemetryConstants.TelemetryEvent.OutOfOfficePaneLoaded
|
|
@@ -20,12 +20,13 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
20
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
21
|
const generateSurveyInviteLink = function (surveyInviteLink, isEmbed, locale, compact) {
|
|
22
22
|
let showMultiLingual = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
const surveyLinkParams = new URLSearchParams({
|
|
24
|
+
embed: isEmbed.toString(),
|
|
25
|
+
compact: (compact ?? true).toString(),
|
|
26
|
+
lang: locale ?? "en-us",
|
|
27
|
+
showmultilingual: (showMultiLingual ?? false).toString()
|
|
28
|
+
});
|
|
29
|
+
return `${surveyInviteLink}&${surveyLinkParams.toString()}`;
|
|
29
30
|
};
|
|
30
31
|
const PostChatSurveyPaneStateful = props => {
|
|
31
32
|
var _props$styleProps, _state$appStates, _props$controlProps;
|
|
@@ -4,13 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.WebChatContainerStateful = void 0;
|
|
7
|
+
var _Constants = require("../../common/Constants");
|
|
7
8
|
var _react = require("@fluentui/react");
|
|
8
9
|
var _TelemetryConstants = require("../../common/telemetry/TelemetryConstants");
|
|
9
10
|
var _react2 = _interopRequireWildcard(require("react"));
|
|
10
11
|
var _utils = require("../../common/utils");
|
|
11
12
|
var _BotMagicCodeStore = require("./webchatcontroller/BotMagicCodeStore");
|
|
12
13
|
var _botframeworkWebchat = require("botframework-webchat");
|
|
13
|
-
var _Constants = require("../../common/Constants");
|
|
14
14
|
var _LiveChatWidgetActionType = require("../../contexts/common/LiveChatWidgetActionType");
|
|
15
15
|
var _NotificationHandler = require("./webchatcontroller/notification/NotificationHandler");
|
|
16
16
|
var _NotificationScenarios = require("./webchatcontroller/enums/NotificationScenarios");
|
|
@@ -56,7 +56,7 @@ const createMagicCodeSuccessResponse = signin => {
|
|
|
56
56
|
};
|
|
57
57
|
};
|
|
58
58
|
const WebChatContainerStateful = props => {
|
|
59
|
-
var _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _webChatContainerProp7, _props$webChatContain5, _props$webChatContain6, _defaultWebChatContai, _props$webChatContain7, _props$webChatContain8, _defaultWebChatContai2, _webChatContainerProp8, _webChatContainerProp9, _webChatContainerProp10, _webChatContainerProp11, _webChatContainerProp12, _webChatContainerProp13, _webChatContainerProp14, _webChatContainerProp15, _props$webChatContain9, _props$webChatContain10;
|
|
59
|
+
var _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _webChatContainerProp7, _props$webChatContain5, _props$webChatContain6, _defaultWebChatContai, _props$webChatContain7, _props$webChatContain8, _defaultWebChatContai2, _webChatContainerProp8, _webChatContainerProp9, _webChatContainerProp10, _webChatContainerProp11, _webChatContainerProp12, _webChatContainerProp13, _webChatContainerProp14, _webChatContainerProp15, _webChatContainerProp16, _props$webChatContain9, _props$webChatContain10;
|
|
60
60
|
(0, _react2.useEffect)(() => {
|
|
61
61
|
uiTimer = (0, _utils.createTimer)();
|
|
62
62
|
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
@@ -241,8 +241,9 @@ const WebChatContainerStateful = props => {
|
|
|
241
241
|
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp14 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp14 === void 0 ? void 0 : (_webChatContainerProp15 = _webChatContainerProp14.sentMessageAnchorStyles) === null || _webChatContainerProp15 === void 0 ? void 0 : _webChatContainerProp15.color) ?? (_defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles === null || _defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles === void 0 ? void 0 : _defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles.color)};
|
|
242
242
|
}
|
|
243
243
|
|
|
244
|
+
// we had a nasty bug long time ago with crashing borders messing with the sendbox, so if customer adds this value, they need to deal with that
|
|
244
245
|
.webchat__bubble:not(.webchat__bubble--from-user) .webchat__bubble__content {
|
|
245
|
-
border-radius: 0 !important; /* Override border-radius */
|
|
246
|
+
border-radius: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp16 = webChatContainerProps.webChatStyles) === null || _webChatContainerProp16 === void 0 ? void 0 : _webChatContainerProp16.bubbleBorderRadius) ?? 0} !important; /* Override border-radius */
|
|
246
247
|
}
|
|
247
248
|
|
|
248
249
|
.webchat__stacked-layout_container>div {
|
|
@@ -13,75 +13,98 @@ var _attachmentActivityUtils = require("./utils/attachmentActivityUtils");
|
|
|
13
13
|
var _MockBotCommand = _interopRequireDefault(require("./MockBotCommand"));
|
|
14
14
|
var _MockBotCardCommandType = _interopRequireDefault(require("./MockBotCardCommandType"));
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
class
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
17
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
18
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
19
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
20
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
21
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
22
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
23
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
24
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
25
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
26
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
27
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
28
|
+
let DemoChatAdapter = /*#__PURE__*/function (_MockAdapter) {
|
|
29
|
+
_inherits(DemoChatAdapter, _MockAdapter);
|
|
30
|
+
var _super = _createSuper(DemoChatAdapter);
|
|
31
|
+
function DemoChatAdapter() {
|
|
32
|
+
var _this;
|
|
33
|
+
_classCallCheck(this, DemoChatAdapter);
|
|
34
|
+
_this = _super.call(this);
|
|
19
35
|
setTimeout(() => {
|
|
20
|
-
(0, _chatAdapterUtils.postSystemMessageActivity)(
|
|
21
|
-
(0, _chatAdapterUtils.postBotMessageActivity)(
|
|
36
|
+
(0, _chatAdapterUtils.postSystemMessageActivity)(_this.activityObserver, "You're currently using a demo.", 0);
|
|
37
|
+
(0, _chatAdapterUtils.postBotMessageActivity)(_this.activityObserver, "Type `/help` to learn more", undefined, 0); // send init message from bot
|
|
22
38
|
}, 1000);
|
|
39
|
+
return _this;
|
|
23
40
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
41
|
+
_createClass(DemoChatAdapter, [{
|
|
42
|
+
key: "postBotCommandsActivity",
|
|
43
|
+
value: function postBotCommandsActivity() {
|
|
44
|
+
let delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1000;
|
|
45
|
+
(0, _chatAdapterUtils.postBotAttachmentActivity)(this.activityObserver, [{
|
|
46
|
+
contentType: "application/vnd.microsoft.card.thumbnail",
|
|
47
|
+
content: {
|
|
48
|
+
buttons: [{
|
|
49
|
+
title: "Send system message",
|
|
50
|
+
type: "imBack",
|
|
51
|
+
value: "send system message"
|
|
52
|
+
}, {
|
|
53
|
+
title: "Send typing",
|
|
54
|
+
type: "imBack",
|
|
55
|
+
value: "send typing"
|
|
56
|
+
}, {
|
|
57
|
+
title: "Send bot message",
|
|
58
|
+
type: "imBack",
|
|
59
|
+
value: "send bot message"
|
|
60
|
+
}],
|
|
61
|
+
title: "Commands"
|
|
62
|
+
}
|
|
63
|
+
}], delay);
|
|
64
|
+
}
|
|
65
|
+
}, {
|
|
66
|
+
key: "postActivity",
|
|
67
|
+
value: function postActivity(activity) {
|
|
68
|
+
if (activity) {
|
|
69
|
+
(0, _chatAdapterUtils.postEchoActivity)(this.activityObserver, activity, _chatAdapterUtils.customerUser);
|
|
70
|
+
if (activity.text) {
|
|
71
|
+
switch (true) {
|
|
72
|
+
case activity.text === _MockBotCommand.default.Help:
|
|
73
|
+
this.postBotCommandsActivity();
|
|
74
|
+
break;
|
|
75
|
+
case activity.text === _MockBotCommand.default.SendSystemMessage:
|
|
76
|
+
(0, _chatAdapterUtils.postSystemMessageActivity)(this.activityObserver, "Contoso has joined the chat.");
|
|
77
|
+
break;
|
|
78
|
+
case activity.text === _MockBotCommand.default.SendTyping:
|
|
79
|
+
(0, _chatAdapterUtils.postBotTypingActivity)(this.activityObserver);
|
|
80
|
+
break;
|
|
81
|
+
case activity.text === _MockBotCommand.default.SendAttachment:
|
|
82
|
+
(0, _chatAdapterUtils.postBotAttachmentActivity)(this.activityObserver, [(0, _attachmentActivityUtils.createJpgFileAttachment)()]);
|
|
83
|
+
break;
|
|
84
|
+
case activity.text === _MockBotCommand.default.SendBotMessage:
|
|
85
|
+
(0, _chatAdapterUtils.postBotMessageActivity)(this.activityObserver, "Hi, how can I help you?");
|
|
86
|
+
break;
|
|
87
|
+
case activity.text === `${_MockBotCommand.default.Card} ${_MockBotCardCommandType.default.Signin}`:
|
|
88
|
+
(0, _chatAdapterUtils.postBotAttachmentActivity)(this.activityObserver, [(0, _attachmentActivityUtils.createSigninCardAttachment)()]);
|
|
89
|
+
break;
|
|
90
|
+
case activity.text === `${_MockBotCommand.default.Card} ${_MockBotCardCommandType.default.Hero}`:
|
|
91
|
+
(0, _chatAdapterUtils.postBotAttachmentActivity)(this.activityObserver, [(0, _attachmentActivityUtils.createHeroCardAttachment)()]);
|
|
92
|
+
break;
|
|
93
|
+
case activity.text === `${_MockBotCommand.default.Card} ${_MockBotCardCommandType.default.Thumbnail}`:
|
|
94
|
+
(0, _chatAdapterUtils.postBotAttachmentActivity)(this.activityObserver, [(0, _attachmentActivityUtils.createThumbnailCardAttachment)()]);
|
|
95
|
+
break;
|
|
96
|
+
case activity.text.startsWith(`${_MockBotCommand.default.Bot} `):
|
|
97
|
+
(0, _chatAdapterUtils.postBotMessageActivity)(this.activityObserver, activity.text.substring(5));
|
|
98
|
+
break;
|
|
99
|
+
case activity.text.startsWith(`${_MockBotCommand.default.System} `):
|
|
100
|
+
(0, _chatAdapterUtils.postSystemMessageActivity)(this.activityObserver, activity.text.substring(8));
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
81
103
|
}
|
|
82
104
|
}
|
|
105
|
+
return _Observable.Observable.of(activity.id || "");
|
|
83
106
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
107
|
+
}]);
|
|
108
|
+
return DemoChatAdapter;
|
|
109
|
+
}(_mockadapter.default);
|
|
87
110
|
exports.DemoChatAdapter = DemoChatAdapter;
|
|
@@ -6,12 +6,31 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.DemoChatSDK = void 0;
|
|
7
7
|
var _DemoChatAdapter = require("./DemoChatAdapter");
|
|
8
8
|
var _mockchatsdk = require("./mockchatsdk");
|
|
9
|
-
class
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
10
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
11
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
12
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
13
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
14
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
15
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
16
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
17
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
18
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
19
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
20
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
21
|
+
let DemoChatSDK = /*#__PURE__*/function (_MockChatSDK) {
|
|
22
|
+
_inherits(DemoChatSDK, _MockChatSDK);
|
|
23
|
+
var _super = _createSuper(DemoChatSDK);
|
|
24
|
+
function DemoChatSDK() {
|
|
25
|
+
_classCallCheck(this, DemoChatSDK);
|
|
26
|
+
return _super.call(this);
|
|
12
27
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
28
|
+
_createClass(DemoChatSDK, [{
|
|
29
|
+
key: "createChatAdapter",
|
|
30
|
+
value: function createChatAdapter() {
|
|
31
|
+
return new _DemoChatAdapter.DemoChatAdapter();
|
|
32
|
+
}
|
|
33
|
+
}]);
|
|
34
|
+
return DemoChatSDK;
|
|
35
|
+
}(_mockchatsdk.MockChatSDK);
|
|
17
36
|
exports.DemoChatSDK = DemoChatSDK;
|
|
@@ -8,34 +8,57 @@ var _Observable = require("rxjs/Observable");
|
|
|
8
8
|
var _mockadapter = _interopRequireDefault(require("./mockadapter"));
|
|
9
9
|
var _chatAdapterUtils = require("./utils/chatAdapterUtils");
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
class
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
12
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
13
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
14
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
15
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
16
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
17
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
18
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
19
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
20
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
21
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
22
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
23
|
+
let DesignerChatAdapter = /*#__PURE__*/function (_MockAdapter) {
|
|
24
|
+
_inherits(DesignerChatAdapter, _MockAdapter);
|
|
25
|
+
var _super = _createSuper(DesignerChatAdapter);
|
|
26
|
+
function DesignerChatAdapter() {
|
|
27
|
+
var _this;
|
|
28
|
+
_classCallCheck(this, DesignerChatAdapter);
|
|
29
|
+
_this = _super.call(this);
|
|
14
30
|
setTimeout(() => {
|
|
15
|
-
(0, _chatAdapterUtils.postBotMessageActivity)(
|
|
16
|
-
|
|
17
|
-
(0, _chatAdapterUtils.postBotMessageActivity)(
|
|
18
|
-
(0, _chatAdapterUtils.postSystemMessageActivity)(
|
|
19
|
-
(0, _chatAdapterUtils.postBotMessageActivity)(
|
|
31
|
+
(0, _chatAdapterUtils.postBotMessageActivity)(_this.activityObserver, "Thank you for contacting us! How can I help you today?", undefined, 0);
|
|
32
|
+
_this.postUserActivity("I need to change my address.", 0);
|
|
33
|
+
(0, _chatAdapterUtils.postBotMessageActivity)(_this.activityObserver, "Okay, let me connect you with a live agent.", undefined, 100);
|
|
34
|
+
(0, _chatAdapterUtils.postSystemMessageActivity)(_this.activityObserver, "John has joined the chat", 100);
|
|
35
|
+
(0, _chatAdapterUtils.postBotMessageActivity)(_this.activityObserver, "I'd be happy to help you update your account.", undefined, 100);
|
|
20
36
|
}, 1000);
|
|
37
|
+
return _this;
|
|
21
38
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if (activity) {
|
|
36
|
-
(0, _chatAdapterUtils.postEchoActivity)(this.activityObserver, activity, _chatAdapterUtils.customerUser);
|
|
39
|
+
_createClass(DesignerChatAdapter, [{
|
|
40
|
+
key: "postUserActivity",
|
|
41
|
+
value: function postUserActivity(text) {
|
|
42
|
+
let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
|
|
43
|
+
setTimeout(() => {
|
|
44
|
+
(0, _chatAdapterUtils.postEchoActivity)(this.activityObserver, {
|
|
45
|
+
text,
|
|
46
|
+
from: {
|
|
47
|
+
..._chatAdapterUtils.customerUser
|
|
48
|
+
},
|
|
49
|
+
type: "message"
|
|
50
|
+
}, _chatAdapterUtils.customerUser, 0);
|
|
51
|
+
}, delay);
|
|
37
52
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
53
|
+
}, {
|
|
54
|
+
key: "postActivity",
|
|
55
|
+
value: function postActivity(activity) {
|
|
56
|
+
if (activity) {
|
|
57
|
+
(0, _chatAdapterUtils.postEchoActivity)(this.activityObserver, activity, _chatAdapterUtils.customerUser);
|
|
58
|
+
}
|
|
59
|
+
return _Observable.Observable.of(activity.id || "");
|
|
60
|
+
}
|
|
61
|
+
}]);
|
|
62
|
+
return DesignerChatAdapter;
|
|
63
|
+
}(_mockadapter.default);
|
|
41
64
|
exports.DesignerChatAdapter = DesignerChatAdapter;
|
|
@@ -6,43 +6,65 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.DesignerChatSDK = void 0;
|
|
7
7
|
var _DesignerChatAdapter = require("./DesignerChatAdapter");
|
|
8
8
|
var _mockchatsdk = require("./mockchatsdk");
|
|
9
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
10
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
11
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
12
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
13
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
14
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
15
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
16
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
17
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
18
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
9
19
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
10
20
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
11
21
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
22
|
+
let DesignerChatSDK = /*#__PURE__*/function (_MockChatSDK) {
|
|
23
|
+
_inherits(DesignerChatSDK, _MockChatSDK);
|
|
24
|
+
var _super = _createSuper(DesignerChatSDK);
|
|
25
|
+
function DesignerChatSDK() {
|
|
26
|
+
var _this;
|
|
27
|
+
_classCallCheck(this, DesignerChatSDK);
|
|
28
|
+
_this = _super.call(this);
|
|
29
|
+
_defineProperty(_assertThisInitialized(_this), "localeId", _this.getLiveChatConfig().ChatWidgetLanguage.msdyn_localeid);
|
|
30
|
+
return _this;
|
|
16
31
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
32
|
+
_createClass(DesignerChatSDK, [{
|
|
33
|
+
key: "createChatAdapter",
|
|
34
|
+
value: function createChatAdapter() {
|
|
35
|
+
return new _DesignerChatAdapter.DesignerChatAdapter();
|
|
36
|
+
}
|
|
37
|
+
}, {
|
|
38
|
+
key: "getLiveChatConfig",
|
|
39
|
+
value:
|
|
40
|
+
/**
|
|
41
|
+
* If the widget is running in designer mode, we mock the initialize response. We don't want
|
|
42
|
+
* any interactions with a real server in when designing LCW widget visually in Modern Admin.
|
|
43
|
+
*
|
|
44
|
+
* - All GUIDs were changed to 00000000-0000-0000-0000-000000000000.
|
|
45
|
+
* - msdyn_callingoptions was changed to disable calling functionality
|
|
46
|
+
*/
|
|
47
|
+
function getLiveChatConfig() {
|
|
48
|
+
return {
|
|
49
|
+
LiveWSAndLiveChatEngJoin: {
|
|
50
|
+
msdyn_widgetthemecolor: "19236002",
|
|
51
|
+
// msdyn_callingoptions was changed to disable calling functionality
|
|
52
|
+
msdyn_callingoptions: "192350000",
|
|
53
|
+
msdyn_widgettitle: "Let\u0027s chat",
|
|
54
|
+
msdyn_conversationmode: "192350000",
|
|
55
|
+
msdyn_avatarurl: "https://oc-cdn-ocprod.azureedge.net/livechatwidget/images/chatIcon.svg",
|
|
56
|
+
msdyn_name: "Let's Chat",
|
|
57
|
+
msdyn_postconversationsurveyenable: "false",
|
|
58
|
+
OutOfOperatingHours: "False",
|
|
59
|
+
ShowWidget: "True"
|
|
60
|
+
},
|
|
61
|
+
ChatWidgetLanguage: {
|
|
62
|
+
msdyn_localeid: "1033",
|
|
63
|
+
msdyn_languagename: "English - United States"
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}]);
|
|
68
|
+
return DesignerChatSDK;
|
|
69
|
+
}(_mockchatsdk.MockChatSDK);
|
|
48
70
|
exports.DesignerChatSDK = DesignerChatSDK;
|