@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
|
@@ -8,14 +8,18 @@ var _utils = require("../common/utils");
|
|
|
8
8
|
var _defaultLibraryScripts = _interopRequireDefault(require("../components/footerstateful/downloadtranscriptstateful/common/defaultLibraryScripts"));
|
|
9
9
|
var _dompurify = _interopRequireDefault(require("dompurify"));
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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; }
|
|
11
14
|
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; }
|
|
12
15
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
13
16
|
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
|
-
|
|
17
|
+
let TranscriptHTMLBuilder = /*#__PURE__*/function () {
|
|
15
18
|
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
16
19
|
|
|
17
|
-
|
|
20
|
+
function TranscriptHTMLBuilder(options) {
|
|
18
21
|
var _this$options, _this$options2, _this$options3, _this$options4, _this$options5, _this$options6, _this$options7, _this$options8, _this$options9, _this$options10, _this$options11, _this$options12, _this$options13;
|
|
22
|
+
_classCallCheck(this, TranscriptHTMLBuilder);
|
|
19
23
|
_defineProperty(this, "options", void 0);
|
|
20
24
|
_defineProperty(this, "pageTitle", "Customer Transcript");
|
|
21
25
|
_defineProperty(this, "attachmentMessage", "The following attachment was uploaded during the conversation: ");
|
|
@@ -75,59 +79,79 @@ class TranscriptHTMLBuilder {
|
|
|
75
79
|
this.externalScripts = this.options.externalScripts;
|
|
76
80
|
}
|
|
77
81
|
}
|
|
78
|
-
|
|
79
|
-
|
|
82
|
+
_createClass(TranscriptHTMLBuilder, [{
|
|
83
|
+
key: "createMetaElement",
|
|
84
|
+
value: function createMetaElement() {
|
|
85
|
+
const htmlData = `
|
|
80
86
|
<meta charset="UTF-8">
|
|
81
87
|
`;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
88
|
+
return htmlData;
|
|
89
|
+
}
|
|
90
|
+
}, {
|
|
91
|
+
key: "createTitleElement",
|
|
92
|
+
value: function createTitleElement() {
|
|
93
|
+
const htmlData = `<title> ${this.pageTitle} </title>`;
|
|
94
|
+
return htmlData;
|
|
95
|
+
}
|
|
96
|
+
}, {
|
|
97
|
+
key: "createScriptElement",
|
|
98
|
+
value: function createScriptElement(src) {
|
|
99
|
+
let integrity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
|
|
100
|
+
let crossOrigin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
|
|
101
|
+
let referrerPolicy = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
|
|
102
|
+
return `<script src="${src}" ${integrity ? `integrity="${integrity}"` : ""} ${crossOrigin ? `crossorigin="${crossOrigin}"` : ""} ${referrerPolicy ? `referrerpolicy="${referrerPolicy}"` : ""}><\/script>`;
|
|
103
|
+
}
|
|
104
|
+
}, {
|
|
105
|
+
key: "createWebChatScriptElement",
|
|
106
|
+
value: function createWebChatScriptElement() {
|
|
107
|
+
var _this$externalScripts, _this$externalScripts2, _this$externalScripts3, _this$externalScripts4, _this$externalScripts5, _this$externalScripts6, _this$externalScripts7, _this$externalScripts8, _this$externalScripts9, _this$externalScripts10;
|
|
108
|
+
return (_this$externalScripts = this.externalScripts) !== null && _this$externalScripts !== void 0 && (_this$externalScripts2 = _this$externalScripts.botframeworkWebChat) !== null && _this$externalScripts2 !== void 0 && _this$externalScripts2.src ? this.createScriptElement((_this$externalScripts3 = this.externalScripts) === null || _this$externalScripts3 === void 0 ? void 0 : (_this$externalScripts4 = _this$externalScripts3.botframeworkWebChat) === null || _this$externalScripts4 === void 0 ? void 0 : _this$externalScripts4.src, (_this$externalScripts5 = this.externalScripts) === null || _this$externalScripts5 === void 0 ? void 0 : (_this$externalScripts6 = _this$externalScripts5.botframeworkWebChat) === null || _this$externalScripts6 === void 0 ? void 0 : _this$externalScripts6.integrity, (_this$externalScripts7 = this.externalScripts) === null || _this$externalScripts7 === void 0 ? void 0 : (_this$externalScripts8 = _this$externalScripts7.botframeworkWebChat) === null || _this$externalScripts8 === void 0 ? void 0 : _this$externalScripts8.crossOrigin, (_this$externalScripts9 = this.externalScripts) === null || _this$externalScripts9 === void 0 ? void 0 : (_this$externalScripts10 = _this$externalScripts9.botframeworkWebChat) === null || _this$externalScripts10 === void 0 ? void 0 : _this$externalScripts10.referrerPolicy) : this.createScriptElement(_defaultLibraryScripts.default.botframeworkWebChat.src);
|
|
109
|
+
}
|
|
110
|
+
}, {
|
|
111
|
+
key: "createRxJsScriptElement",
|
|
112
|
+
value: function createRxJsScriptElement() {
|
|
113
|
+
var _this$externalScripts11, _this$externalScripts12, _this$externalScripts13, _this$externalScripts14, _this$externalScripts15, _this$externalScripts16, _this$externalScripts17, _this$externalScripts18, _this$externalScripts19, _this$externalScripts20;
|
|
114
|
+
return (_this$externalScripts11 = this.externalScripts) !== null && _this$externalScripts11 !== void 0 && (_this$externalScripts12 = _this$externalScripts11.rxJs) !== null && _this$externalScripts12 !== void 0 && _this$externalScripts12.src ? this.createScriptElement((_this$externalScripts13 = this.externalScripts) === null || _this$externalScripts13 === void 0 ? void 0 : (_this$externalScripts14 = _this$externalScripts13.rxJs) === null || _this$externalScripts14 === void 0 ? void 0 : _this$externalScripts14.src, (_this$externalScripts15 = this.externalScripts) === null || _this$externalScripts15 === void 0 ? void 0 : (_this$externalScripts16 = _this$externalScripts15.rxJs) === null || _this$externalScripts16 === void 0 ? void 0 : _this$externalScripts16.integrity, (_this$externalScripts17 = this.externalScripts) === null || _this$externalScripts17 === void 0 ? void 0 : (_this$externalScripts18 = _this$externalScripts17.rxJs) === null || _this$externalScripts18 === void 0 ? void 0 : _this$externalScripts18.crossOrigin, (_this$externalScripts19 = this.externalScripts) === null || _this$externalScripts19 === void 0 ? void 0 : (_this$externalScripts20 = _this$externalScripts19.rxJs) === null || _this$externalScripts20 === void 0 ? void 0 : _this$externalScripts20.referrerPolicy) : this.createScriptElement(_defaultLibraryScripts.default.rxJs.src, _defaultLibraryScripts.default.rxJs.integrity, _defaultLibraryScripts.default.rxJs.crossOrigin, _defaultLibraryScripts.default.rxJs.referrerPolicy);
|
|
115
|
+
}
|
|
116
|
+
}, {
|
|
117
|
+
key: "createReactScriptElement",
|
|
118
|
+
value: function createReactScriptElement() {
|
|
119
|
+
var _this$externalScripts21, _this$externalScripts22, _this$externalScripts23, _this$externalScripts24, _this$externalScripts25, _this$externalScripts26, _this$externalScripts27, _this$externalScripts28, _this$externalScripts29, _this$externalScripts30;
|
|
120
|
+
return (_this$externalScripts21 = this.externalScripts) !== null && _this$externalScripts21 !== void 0 && (_this$externalScripts22 = _this$externalScripts21.react) !== null && _this$externalScripts22 !== void 0 && _this$externalScripts22.src ? this.createScriptElement((_this$externalScripts23 = this.externalScripts) === null || _this$externalScripts23 === void 0 ? void 0 : (_this$externalScripts24 = _this$externalScripts23.react) === null || _this$externalScripts24 === void 0 ? void 0 : _this$externalScripts24.src, (_this$externalScripts25 = this.externalScripts) === null || _this$externalScripts25 === void 0 ? void 0 : (_this$externalScripts26 = _this$externalScripts25.react) === null || _this$externalScripts26 === void 0 ? void 0 : _this$externalScripts26.integrity, (_this$externalScripts27 = this.externalScripts) === null || _this$externalScripts27 === void 0 ? void 0 : (_this$externalScripts28 = _this$externalScripts27.react) === null || _this$externalScripts28 === void 0 ? void 0 : _this$externalScripts28.crossOrigin, (_this$externalScripts29 = this.externalScripts) === null || _this$externalScripts29 === void 0 ? void 0 : (_this$externalScripts30 = _this$externalScripts29.react) === null || _this$externalScripts30 === void 0 ? void 0 : _this$externalScripts30.referrerPolicy) : this.createScriptElement(_defaultLibraryScripts.default.react.src);
|
|
121
|
+
}
|
|
122
|
+
}, {
|
|
123
|
+
key: "createReactDomScriptElement",
|
|
124
|
+
value: function createReactDomScriptElement() {
|
|
125
|
+
var _this$externalScripts31, _this$externalScripts32, _this$externalScripts33, _this$externalScripts34, _this$externalScripts35, _this$externalScripts36, _this$externalScripts37, _this$externalScripts38, _this$externalScripts39, _this$externalScripts40, _this$externalScripts41, _this$externalScripts42;
|
|
126
|
+
return (_this$externalScripts31 = this.externalScripts) !== null && _this$externalScripts31 !== void 0 && (_this$externalScripts32 = _this$externalScripts31.reactDom) !== null && _this$externalScripts32 !== void 0 && _this$externalScripts32.src ? this.createScriptElement((_this$externalScripts33 = this.externalScripts) === null || _this$externalScripts33 === void 0 ? void 0 : (_this$externalScripts34 = _this$externalScripts33.reactDom) === null || _this$externalScripts34 === void 0 ? void 0 : _this$externalScripts34.src, (_this$externalScripts35 = this.externalScripts) === null || _this$externalScripts35 === void 0 ? void 0 : (_this$externalScripts36 = _this$externalScripts35.reactDom) === null || _this$externalScripts36 === void 0 ? void 0 : _this$externalScripts36.integrity, (_this$externalScripts37 = this.externalScripts) === null || _this$externalScripts37 === void 0 ? void 0 : (_this$externalScripts38 = _this$externalScripts37.reactDom) === null || _this$externalScripts38 === void 0 ? void 0 : _this$externalScripts38.crossOrigin, (_this$externalScripts39 = this.externalScripts) === null || _this$externalScripts39 === void 0 ? void 0 : (_this$externalScripts40 = _this$externalScripts39.reactDom) === null || _this$externalScripts40 === void 0 ? void 0 : _this$externalScripts40.referrerPolicy) : this.createScriptElement(((_this$externalScripts41 = this.externalScripts) === null || _this$externalScripts41 === void 0 ? void 0 : (_this$externalScripts42 = _this$externalScripts41.reactDom) === null || _this$externalScripts42 === void 0 ? void 0 : _this$externalScripts42.src) ?? _defaultLibraryScripts.default.reactDom.src);
|
|
127
|
+
}
|
|
128
|
+
}, {
|
|
129
|
+
key: "createMarkdownItScriptElement",
|
|
130
|
+
value: function createMarkdownItScriptElement() {
|
|
131
|
+
var _this$externalScripts43, _this$externalScripts44, _this$externalScripts45, _this$externalScripts46, _this$externalScripts47, _this$externalScripts48, _this$externalScripts49, _this$externalScripts50, _this$externalScripts51, _this$externalScripts52;
|
|
132
|
+
return (_this$externalScripts43 = this.externalScripts) !== null && _this$externalScripts43 !== void 0 && (_this$externalScripts44 = _this$externalScripts43.markdownIt) !== null && _this$externalScripts44 !== void 0 && _this$externalScripts44.src ? this.createScriptElement((_this$externalScripts45 = this.externalScripts) === null || _this$externalScripts45 === void 0 ? void 0 : (_this$externalScripts46 = _this$externalScripts45.markdownIt) === null || _this$externalScripts46 === void 0 ? void 0 : _this$externalScripts46.src, (_this$externalScripts47 = this.externalScripts) === null || _this$externalScripts47 === void 0 ? void 0 : (_this$externalScripts48 = _this$externalScripts47.markdownIt) === null || _this$externalScripts48 === void 0 ? void 0 : _this$externalScripts48.integrity, (_this$externalScripts49 = this.externalScripts) === null || _this$externalScripts49 === void 0 ? void 0 : (_this$externalScripts50 = _this$externalScripts49.markdownIt) === null || _this$externalScripts50 === void 0 ? void 0 : _this$externalScripts50.crossOrigin, (_this$externalScripts51 = this.externalScripts) === null || _this$externalScripts51 === void 0 ? void 0 : (_this$externalScripts52 = _this$externalScripts51.markdownIt) === null || _this$externalScripts52 === void 0 ? void 0 : _this$externalScripts52.referrerPolicy) : this.createScriptElement(_defaultLibraryScripts.default.markdownIt.src, _defaultLibraryScripts.default.markdownIt.integrity, _defaultLibraryScripts.default.markdownIt.crossOrigin);
|
|
133
|
+
}
|
|
134
|
+
}, {
|
|
135
|
+
key: "createExternalScriptElements",
|
|
136
|
+
value: function createExternalScriptElements() {
|
|
137
|
+
const webChatScript = this.createWebChatScriptElement();
|
|
138
|
+
const rxJsScript = this.createRxJsScriptElement();
|
|
139
|
+
const reactScript = this.createReactScriptElement();
|
|
140
|
+
const reactDomScript = this.createReactDomScriptElement();
|
|
141
|
+
const markdownItScript = this.createMarkdownItScriptElement();
|
|
142
|
+
const htmlData = `
|
|
121
143
|
${webChatScript}
|
|
122
144
|
${rxJsScript}
|
|
123
145
|
${reactScript}
|
|
124
146
|
${reactDomScript}
|
|
125
147
|
${markdownItScript}
|
|
126
148
|
`;
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
149
|
+
return htmlData;
|
|
150
|
+
}
|
|
151
|
+
}, {
|
|
152
|
+
key: "createHeadElement",
|
|
153
|
+
value: function createHeadElement() {
|
|
154
|
+
const htmlData = `
|
|
131
155
|
<head>
|
|
132
156
|
${this.createMetaElement()}
|
|
133
157
|
${this.createTitleElement()}
|
|
@@ -367,10 +391,12 @@ class TranscriptHTMLBuilder {
|
|
|
367
391
|
<\/style>
|
|
368
392
|
</head>
|
|
369
393
|
`;
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
394
|
+
return htmlData;
|
|
395
|
+
}
|
|
396
|
+
}, {
|
|
397
|
+
key: "createBodyElement",
|
|
398
|
+
value: function createBodyElement() {
|
|
399
|
+
const htmlData = `
|
|
374
400
|
<body>
|
|
375
401
|
<script>
|
|
376
402
|
if (!navigator.onLine) {
|
|
@@ -651,18 +677,22 @@ class TranscriptHTMLBuilder {
|
|
|
651
677
|
<\/script>
|
|
652
678
|
</body>
|
|
653
679
|
`;
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
680
|
+
return htmlData;
|
|
681
|
+
}
|
|
682
|
+
}, {
|
|
683
|
+
key: "createHTML",
|
|
684
|
+
value: function createHTML() {
|
|
685
|
+
const htmlData = `
|
|
658
686
|
<html>
|
|
659
687
|
${this.createHeadElement()}
|
|
660
688
|
${this.createBodyElement()}
|
|
661
689
|
</html>
|
|
662
690
|
`;
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
}
|
|
691
|
+
return htmlData;
|
|
692
|
+
}
|
|
693
|
+
}]);
|
|
694
|
+
return TranscriptHTMLBuilder;
|
|
695
|
+
}();
|
|
666
696
|
const createChatTranscript = async function (transcript, facadeChatSDK) {
|
|
667
697
|
let renderAttachments = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
668
698
|
let transcriptOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
@@ -5,102 +5,116 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.createOnNewAdapterActivityHandler = void 0;
|
|
7
7
|
var _TelemetryConstants = require("../common/telemetry/TelemetryConstants");
|
|
8
|
+
var _Constants = require("../firstresponselatency/Constants");
|
|
9
|
+
var _util = require("../firstresponselatency/util");
|
|
8
10
|
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
9
|
-
var
|
|
11
|
+
var _Constants2 = require("../common/Constants");
|
|
12
|
+
var _FirstResponseLatencyTracker = require("../firstresponselatency/FirstResponseLatencyTracker");
|
|
10
13
|
var _TelemetryHelper = require("../common/telemetry/TelemetryHelper");
|
|
11
14
|
var _TelemetryManager = require("../common/telemetry/TelemetryManager");
|
|
12
15
|
const createOnNewAdapterActivityHandler = (chatId, userId) => {
|
|
16
|
+
// Hooking the message tracker in the listener, a bit invasive but easier to control.
|
|
17
|
+
const firstResponseLatencyTracker = new _FirstResponseLatencyTracker.FirstResponseLatencyTracker();
|
|
18
|
+
// epoch time in utc for when start to listen.
|
|
19
|
+
// We dont longer have a mechanism to know if a message is history or new, so any message older than the time we start listening will be considered a history message.
|
|
20
|
+
// this is a workaround for the fact that we dont have a way to identify if a message is history or new, and it will provide consistency across different scenarios
|
|
21
|
+
const startTime = new Date().getTime();
|
|
22
|
+
let isHistoryMessageReceivedEventRaised = false;
|
|
13
23
|
const onNewAdapterActivityHandler = activity => {
|
|
14
|
-
|
|
15
|
-
const isActivityMessage = (activity === null || activity === void 0 ? void 0 : activity.type) === _Constants.Constants.message;
|
|
16
|
-
const isHistoryMessage = isActivityMessage && ((activity === null || activity === void 0 ? void 0 : (_activity$channelData = activity.channelData) === null || _activity$channelData === void 0 ? void 0 : (_activity$channelData2 = _activity$channelData.tags) === null || _activity$channelData2 === void 0 ? void 0 : _activity$channelData2.includes(_Constants.Constants.historyMessageTag)) || (activity === null || activity === void 0 ? void 0 : (_activity$channelData3 = activity.channelData) === null || _activity$channelData3 === void 0 ? void 0 : _activity$channelData3.fromList));
|
|
17
|
-
raiseMessageEvent(activity, isHistoryMessage);
|
|
24
|
+
raiseMessageEvent(activity);
|
|
18
25
|
};
|
|
19
|
-
|
|
20
|
-
|
|
26
|
+
const userSendMessageStrategy = activity => {
|
|
27
|
+
var _TelemetryManager$Int;
|
|
28
|
+
const payload = (0, _util.buildMessagePayload)(activity, userId);
|
|
21
29
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
channelData: activity === null || activity === void 0 ? void 0 : activity.channelData,
|
|
27
|
-
chatId: activity === null || activity === void 0 ? void 0 : (_activity$conversatio = activity.conversation) === null || _activity$conversatio === void 0 ? void 0 : _activity$conversatio.id,
|
|
28
|
-
conversationId: (_TelemetryManager$Int = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int === void 0 ? void 0 : _TelemetryManager$Int.conversationId,
|
|
29
|
-
id: activity === null || activity === void 0 ? void 0 : activity.id,
|
|
30
|
-
isChatComplete: false,
|
|
31
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
32
|
-
text: activity === null || activity === void 0 ? void 0 : activity.text,
|
|
33
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
34
|
-
attachment: (activity === null || activity === void 0 ? void 0 : (_attachments = activity.attachments) === null || _attachments === void 0 ? void 0 : _attachments.length) >= 1 ? activity === null || activity === void 0 ? void 0 : activity.attachments : []
|
|
35
|
-
};
|
|
30
|
+
payload.messageType = _Constants2.Constants.userMessageTag;
|
|
31
|
+
const newMessageSentEvent = {
|
|
32
|
+
eventName: _TelemetryConstants.BroadcastEvent.NewMessageSent,
|
|
33
|
+
payload: (0, _util.polyfillMessagePayloadForEvent)(activity, payload, (_TelemetryManager$Int = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int === void 0 ? void 0 : _TelemetryManager$Int.conversationId)
|
|
36
34
|
};
|
|
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
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
35
|
+
_omnichannelChatComponents.BroadcastService.postMessage(newMessageSentEvent);
|
|
36
|
+
if (!(0, _util.isHistoryMessage)(activity, startTime)) {
|
|
37
|
+
firstResponseLatencyTracker.startClock(payload);
|
|
38
|
+
}
|
|
39
|
+
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
40
|
+
Event: _TelemetryConstants.TelemetryEvent.MessageSent,
|
|
41
|
+
Description: "New message sent"
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
const systemMessageStrategy = activity => {
|
|
45
|
+
const payload = (0, _util.buildMessagePayload)(activity, userId);
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
47
|
+
payload.messageType = _Constants2.Constants.systemMessageTag;
|
|
48
|
+
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
49
|
+
Event: _TelemetryConstants.TelemetryEvent.SystemMessageReceived,
|
|
50
|
+
Description: "System message received"
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
const historyMessageStrategy = payload => {
|
|
54
|
+
const newMessageReceivedEvent = {
|
|
55
|
+
eventName: _TelemetryConstants.BroadcastEvent.HistoryMessageReceived,
|
|
56
|
+
payload: payload
|
|
57
|
+
};
|
|
58
|
+
_omnichannelChatComponents.BroadcastService.postMessage(newMessageReceivedEvent);
|
|
59
|
+
if (!isHistoryMessageReceivedEventRaised) {
|
|
60
|
+
// this is needed for reload scenarios, it helps to identify the last message received before the reload
|
|
61
|
+
isHistoryMessageReceivedEventRaised = true;
|
|
62
|
+
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
63
|
+
Event: _TelemetryConstants.TelemetryEvent.RehydrateMessageReceived,
|
|
64
|
+
Description: "History message received",
|
|
65
|
+
CustomProperties: payload
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const isValidMessage = activity => {
|
|
70
|
+
var _activity$channelData, _activity$channelData2, _activity$channelData3;
|
|
71
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
72
|
+
const messageHasNoText = !(activity !== null && activity !== void 0 && activity.text);
|
|
73
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
74
|
+
const messageHasNoTags = !(activity !== null && activity !== void 0 && activity.channelData) || !(activity !== null && activity !== void 0 && (_activity$channelData = activity.channelData) !== null && _activity$channelData !== void 0 && _activity$channelData.tags) || (activity === null || activity === void 0 ? void 0 : (_activity$channelData2 = activity.channelData) === null || _activity$channelData2 === void 0 ? void 0 : (_activity$channelData3 = _activity$channelData2.tags) === null || _activity$channelData3 === void 0 ? void 0 : _activity$channelData3.length) === 0;
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
76
|
+
const messageHasNoAttachments = !(activity !== null && activity !== void 0 && activity.attachments) || (activity === null || activity === void 0 ? void 0 : activity.attachments.length) === 0;
|
|
77
|
+
if (messageHasNoTags && messageHasNoText && messageHasNoAttachments) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
return true;
|
|
81
|
+
};
|
|
82
|
+
const receivedMessageStrategy = activity => {
|
|
83
|
+
var _TelemetryManager$Int3;
|
|
84
|
+
if (!isValidMessage(activity)) return;
|
|
85
|
+
const isHistoryMessageReceived = (0, _util.isHistoryMessage)(activity, startTime);
|
|
86
|
+
const payload = (0, _util.buildMessagePayload)(activity, userId);
|
|
87
|
+
payload.messageType = _Constants2.Constants.userMessageTag;
|
|
88
|
+
if (isHistoryMessageReceived) {
|
|
89
|
+
var _TelemetryManager$Int2;
|
|
90
|
+
historyMessageStrategy((0, _util.polyfillMessagePayloadForEvent)(activity, payload, (_TelemetryManager$Int2 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int2 === void 0 ? void 0 : _TelemetryManager$Int2.conversationId));
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
firstResponseLatencyTracker.stopClock(payload);
|
|
94
|
+
const newMessageReceivedEvent = {
|
|
95
|
+
eventName: _TelemetryConstants.BroadcastEvent.NewMessageReceived,
|
|
96
|
+
payload: (0, _util.polyfillMessagePayloadForEvent)(activity, payload, (_TelemetryManager$Int3 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int3 === void 0 ? void 0 : _TelemetryManager$Int3.conversationId)
|
|
97
|
+
};
|
|
98
|
+
_omnichannelChatComponents.BroadcastService.postMessage(newMessageReceivedEvent);
|
|
99
|
+
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
100
|
+
Event: _TelemetryConstants.TelemetryEvent.MessageReceived,
|
|
101
|
+
Description: "New message received",
|
|
102
|
+
CustomProperties: payload
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
const raiseMessageEvent = activity => {
|
|
106
|
+
if ((activity === null || activity === void 0 ? void 0 : activity.type) === _Constants2.Constants.message) {
|
|
107
|
+
const scenarioType = (0, _util.getScenarioType)(activity);
|
|
108
|
+
switch (scenarioType) {
|
|
109
|
+
case _Constants.ScenarioType.UserSendMessageStrategy:
|
|
110
|
+
userSendMessageStrategy(activity);
|
|
111
|
+
break;
|
|
112
|
+
case _Constants.ScenarioType.SystemMessageStrategy:
|
|
113
|
+
systemMessageStrategy(activity);
|
|
114
|
+
break;
|
|
115
|
+
case _Constants.ScenarioType.ReceivedMessageStrategy:
|
|
116
|
+
receivedMessageStrategy(activity);
|
|
117
|
+
break;
|
|
104
118
|
}
|
|
105
119
|
}
|
|
106
120
|
};
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
var _class;
|
|
2
|
+
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); } }
|
|
3
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
4
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2
5
|
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; }
|
|
3
6
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
4
7
|
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); }
|
|
5
|
-
export
|
|
8
|
+
export let Constants = /*#__PURE__*/_createClass(function Constants() {
|
|
9
|
+
_classCallCheck(this, Constants);
|
|
10
|
+
});
|
|
6
11
|
_defineProperty(Constants, "magicCodeBroadcastChannel", "MagicCodeChannel");
|
|
7
12
|
_defineProperty(Constants, "magicCodeResponseBroadcastChannel", "MagicCodeResponseChannel");
|
|
8
13
|
_defineProperty(Constants, "systemMessageTag", "system");
|
|
@@ -116,16 +121,26 @@ _defineProperty(Constants, "InitContextParamsResponse", "initContextParamsRespon
|
|
|
116
121
|
_defineProperty(Constants, "OCOriginalMessageId", "OriginalMessageId");
|
|
117
122
|
_defineProperty(Constants, "WebchatSequenceIdAttribute", "webchat:sequence-id");
|
|
118
123
|
_defineProperty(Constants, "MessageSequenceIdOverride", "MessageSequenceIdOverride");
|
|
119
|
-
export const Regex = (_class =
|
|
120
|
-
|
|
124
|
+
export const Regex = (_class = /*#__PURE__*/_createClass(function Regex() {
|
|
125
|
+
_classCallCheck(this, Regex);
|
|
126
|
+
}), _defineProperty(_class, "EmailRegex", "(?:[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-zA-Z0-9-]*[a-zA-Z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])"), _class);
|
|
127
|
+
export let HtmlIdNames = /*#__PURE__*/_createClass(function HtmlIdNames() {
|
|
128
|
+
_classCallCheck(this, HtmlIdNames);
|
|
129
|
+
});
|
|
121
130
|
_defineProperty(HtmlIdNames, "MSLiveChatWidget", "MSLiveChatWidget");
|
|
122
|
-
export
|
|
131
|
+
export let HtmlClassNames = /*#__PURE__*/_createClass(function HtmlClassNames() {
|
|
132
|
+
_classCallCheck(this, HtmlClassNames);
|
|
133
|
+
});
|
|
123
134
|
_defineProperty(HtmlClassNames, "webChatBannerCloseButton", "webchat__toast__dismissButton");
|
|
124
135
|
_defineProperty(HtmlClassNames, "webChatBannerExpandButton", "webchat__toaster__expandIcon");
|
|
125
136
|
_defineProperty(HtmlClassNames, "webChatHistoryContainer", "webchat__basic-transcript");
|
|
126
|
-
export
|
|
137
|
+
export let HtmlElementSelectors = /*#__PURE__*/_createClass(function HtmlElementSelectors() {
|
|
138
|
+
_classCallCheck(this, HtmlElementSelectors);
|
|
139
|
+
});
|
|
127
140
|
_defineProperty(HtmlElementSelectors, "sendBoxSelector", "textarea[data-id=\"webchat-sendbox-input\"]");
|
|
128
|
-
export
|
|
141
|
+
export let HtmlAttributeNames = /*#__PURE__*/_createClass(function HtmlAttributeNames() {
|
|
142
|
+
_classCallCheck(this, HtmlAttributeNames);
|
|
143
|
+
});
|
|
129
144
|
_defineProperty(HtmlAttributeNames, "role", "role");
|
|
130
145
|
_defineProperty(HtmlAttributeNames, "navigation", "navigation");
|
|
131
146
|
_defineProperty(HtmlAttributeNames, "ariaLabel", "aria-label");
|
|
@@ -159,20 +174,28 @@ _defineProperty(HtmlAttributeNames, "adaptiveCardClassName", "ac-adaptiveCard");
|
|
|
159
174
|
_defineProperty(HtmlAttributeNames, "adaptiveCardTextBlockClassName", "ac-textBlock");
|
|
160
175
|
_defineProperty(HtmlAttributeNames, "adaptiveCardToggleInputClassName", "ac-toggleInput");
|
|
161
176
|
_defineProperty(HtmlAttributeNames, "adaptiveCardActionSetClassName", "ac-actionSet");
|
|
162
|
-
export
|
|
177
|
+
export let WebChatMiddlewareConstants = /*#__PURE__*/_createClass(function WebChatMiddlewareConstants() {
|
|
178
|
+
_classCallCheck(this, WebChatMiddlewareConstants);
|
|
179
|
+
});
|
|
163
180
|
_defineProperty(WebChatMiddlewareConstants, "nextVisibleActivity", "nextVisibleActivity");
|
|
164
181
|
_defineProperty(WebChatMiddlewareConstants, "timeBetweenTimestampGroups", 300000);
|
|
165
182
|
//5 minutes
|
|
166
183
|
_defineProperty(WebChatMiddlewareConstants, "maxTextLength", 6000);
|
|
167
184
|
_defineProperty(WebChatMiddlewareConstants, "adaptiveCard", "AdaptiveCard");
|
|
168
|
-
export
|
|
185
|
+
export let AMSConstants = /*#__PURE__*/_createClass(function AMSConstants() {
|
|
186
|
+
_classCallCheck(this, AMSConstants);
|
|
187
|
+
});
|
|
169
188
|
_defineProperty(AMSConstants, "supportedImagesMimeTypes", ["image/jpeg", "image/png", "image/gif", "image/heic", "image/webp"]);
|
|
170
189
|
_defineProperty(AMSConstants, "maxSupportedImageSize", 20);
|
|
171
190
|
// AMS max file limit outside of supported Images MIME Types.
|
|
172
191
|
_defineProperty(AMSConstants, "maxSupportedFileSize", 300);
|
|
173
|
-
export
|
|
192
|
+
export let MimeTypes = /*#__PURE__*/_createClass(function MimeTypes() {
|
|
193
|
+
_classCallCheck(this, MimeTypes);
|
|
194
|
+
});
|
|
174
195
|
_defineProperty(MimeTypes, "UnknownFileType", "application/octet-stream");
|
|
175
|
-
export
|
|
196
|
+
export let LocaleConstants = /*#__PURE__*/_createClass(function LocaleConstants() {
|
|
197
|
+
_classCallCheck(this, LocaleConstants);
|
|
198
|
+
});
|
|
176
199
|
_defineProperty(LocaleConstants, "RTL_LOCALES", ["1025", "1037"]);
|
|
177
200
|
export let ElementType;
|
|
178
201
|
(function (ElementType) {
|
|
@@ -227,7 +250,9 @@ export let ConfirmationState;
|
|
|
227
250
|
ConfirmationState["Cancel"] = "Cancel";
|
|
228
251
|
ConfirmationState["NotSet"] = "NotSet";
|
|
229
252
|
})(ConfirmationState || (ConfirmationState = {}));
|
|
230
|
-
export
|
|
253
|
+
export let TranscriptConstants = /*#__PURE__*/_createClass(function TranscriptConstants() {
|
|
254
|
+
_classCallCheck(this, TranscriptConstants);
|
|
255
|
+
});
|
|
231
256
|
_defineProperty(TranscriptConstants, "ChatTranscriptsBodyColor", "#F5F5F5");
|
|
232
257
|
_defineProperty(TranscriptConstants, "TranscriptMessageEmojiMessageType", "http://schema.skype.com/emoji");
|
|
233
258
|
_defineProperty(TranscriptConstants, "ChatTranscriptDownloadFile", "ChatTranscripts.html");
|
|
@@ -238,7 +263,9 @@ _defineProperty(TranscriptConstants, "AdaptiveCardType", "adaptivecard");
|
|
|
238
263
|
_defineProperty(TranscriptConstants, "InternalMode", "internal");
|
|
239
264
|
_defineProperty(TranscriptConstants, "AgentDialogColor", "#2266E3");
|
|
240
265
|
_defineProperty(TranscriptConstants, "AgentFontColor", "white");
|
|
241
|
-
export
|
|
266
|
+
export let NotificationPaneConstants = /*#__PURE__*/_createClass(function NotificationPaneConstants() {
|
|
267
|
+
_classCallCheck(this, NotificationPaneConstants);
|
|
268
|
+
});
|
|
242
269
|
_defineProperty(NotificationPaneConstants, "DefaultNotificationPaneId", "lcw-notification-pane");
|
|
243
270
|
_defineProperty(NotificationPaneConstants, "DismissId", "lcw-notification-pane-dismiss-button");
|
|
244
271
|
_defineProperty(NotificationPaneConstants, "DismissText", "Dismiss");
|
|
@@ -251,7 +278,9 @@ _defineProperty(NotificationPaneConstants, "IconText", "Notification Icon");
|
|
|
251
278
|
_defineProperty(NotificationPaneConstants, "ChatDisconnectTitleText", "Chat disconnected");
|
|
252
279
|
_defineProperty(NotificationPaneConstants, "ChatDisconnectSubtitleText", "For additional assistance, please close the chat and try again.");
|
|
253
280
|
_defineProperty(NotificationPaneConstants, "ChromeCloseIconName", "ChromeClose");
|
|
254
|
-
export
|
|
281
|
+
export let StartChatErrorPaneConstants = /*#__PURE__*/_createClass(function StartChatErrorPaneConstants() {
|
|
282
|
+
_classCallCheck(this, StartChatErrorPaneConstants);
|
|
283
|
+
});
|
|
255
284
|
_defineProperty(StartChatErrorPaneConstants, "DefaultStartChatErrorPaneId", "oc-lcw-start-chat-error-pane");
|
|
256
285
|
_defineProperty(StartChatErrorPaneConstants, "DefaultStartChatErrorTitleText", "We are unable to load chat at this time.");
|
|
257
286
|
_defineProperty(StartChatErrorPaneConstants, "DefaultStartChatErrorSubtitleText", "Please try again later.");
|
|
@@ -259,7 +288,9 @@ _defineProperty(StartChatErrorPaneConstants, "DefaultStartChatErrorUnauthorizedT
|
|
|
259
288
|
_defineProperty(StartChatErrorPaneConstants, "DefaultStartChatErrorAuthSetupErrorTitleText", "Chat authentication has failed.");
|
|
260
289
|
_defineProperty(StartChatErrorPaneConstants, "DefaultStartChatErrorUnauthorizedSubtitleText", "UNAUTHORIZED");
|
|
261
290
|
_defineProperty(StartChatErrorPaneConstants, "DefaultStartChatErrorAuthSetupErrorSubtitleText", "AUTH SETUP ERROR");
|
|
262
|
-
export
|
|
291
|
+
export let AriaTelemetryConstants = /*#__PURE__*/_createClass(function AriaTelemetryConstants() {
|
|
292
|
+
_classCallCheck(this, AriaTelemetryConstants);
|
|
293
|
+
});
|
|
263
294
|
// Aria Endpoint for different environment types.
|
|
264
295
|
_defineProperty(AriaTelemetryConstants, "GERMANY_ENDPOINT", "https://de.pipe.aria.microsoft.com/Collector/3.0/");
|
|
265
296
|
_defineProperty(AriaTelemetryConstants, "GCCH_ENDPOINT", "https://tb.pipe.aria.microsoft.com/Collector/3.0/");
|
|
@@ -273,14 +304,20 @@ _defineProperty(AriaTelemetryConstants, "Public", "Public");
|
|
|
273
304
|
_defineProperty(AriaTelemetryConstants, "EU", "Europe");
|
|
274
305
|
// EUR: crm4; FRA: crm12; GER: crm16; CHE: crm17; NOR: crm19
|
|
275
306
|
_defineProperty(AriaTelemetryConstants, "lcwEUDomainNames", ["crm4.omnichannelengagementhub.com", "crm12.omnichannelengagementhub.com", "crm16.omnichannelengagementhub.com", "crm17.omnichannelengagementhub.com", "crm19.omnichannelengagementhub.com"]);
|
|
276
|
-
export
|
|
307
|
+
export let WidgetLoadTelemetryMessage = /*#__PURE__*/_createClass(function WidgetLoadTelemetryMessage() {
|
|
308
|
+
_classCallCheck(this, WidgetLoadTelemetryMessage);
|
|
309
|
+
});
|
|
277
310
|
_defineProperty(WidgetLoadTelemetryMessage, "OOOHMessage", "Widget is OOOH");
|
|
278
311
|
_defineProperty(WidgetLoadTelemetryMessage, "PersistedStateRetrievedMessage", "Persisted state retrieved");
|
|
279
|
-
export
|
|
312
|
+
export let WidgetLoadCustomErrorString = /*#__PURE__*/_createClass(function WidgetLoadCustomErrorString() {
|
|
313
|
+
_classCallCheck(this, WidgetLoadCustomErrorString);
|
|
314
|
+
});
|
|
280
315
|
_defineProperty(WidgetLoadCustomErrorString, "AuthenticationFailedErrorString", "Authentication was not successful");
|
|
281
316
|
_defineProperty(WidgetLoadCustomErrorString, "NetworkErrorString", "Network Error");
|
|
282
317
|
_defineProperty(WidgetLoadCustomErrorString, "CloseAdapterAfterDisconnectionErrorString", "Error trying to end/close chat adapter after the widget is back on-line, for an already disconnected session");
|
|
283
|
-
export
|
|
318
|
+
export let PrepareEndChatDescriptionConstants = /*#__PURE__*/_createClass(function PrepareEndChatDescriptionConstants() {
|
|
319
|
+
_classCallCheck(this, PrepareEndChatDescriptionConstants);
|
|
320
|
+
});
|
|
284
321
|
_defineProperty(PrepareEndChatDescriptionConstants, "ConversationEndedByCustomerWithoutPostChat", "Conversation ended by customer. Post chat not configured or should not show.");
|
|
285
322
|
_defineProperty(PrepareEndChatDescriptionConstants, "ConversationEndedByCustomerWithInvalidPostChat", "Conversation ended by customer. Post chat context is invalid.");
|
|
286
323
|
_defineProperty(PrepareEndChatDescriptionConstants, "ConversationEndedBy", "Conversation ended by");
|
|
@@ -291,6 +328,8 @@ _defineProperty(PrepareEndChatDescriptionConstants, "EndChatReceivedFromOtherTab
|
|
|
291
328
|
_defineProperty(PrepareEndChatDescriptionConstants, "CustomerCloseChatOnFailureOrPostChat", "Customer is trying to close chat widget on start chat failure or post chat pane.");
|
|
292
329
|
_defineProperty(PrepareEndChatDescriptionConstants, "CustomerCloseInactiveChat", "Chat was Inactive and customer is trying to close chat widget or refreshing the page.");
|
|
293
330
|
_defineProperty(PrepareEndChatDescriptionConstants, "BrowserUnload", "Browser unload event received. Ending chat.");
|
|
294
|
-
export
|
|
331
|
+
export let PostChatSurveyTelemetryMessage = /*#__PURE__*/_createClass(function PostChatSurveyTelemetryMessage() {
|
|
332
|
+
_classCallCheck(this, PostChatSurveyTelemetryMessage);
|
|
333
|
+
});
|
|
295
334
|
_defineProperty(PostChatSurveyTelemetryMessage, "PostChatContextCallFailed", "Failed to get post chat context.");
|
|
296
335
|
_defineProperty(PostChatSurveyTelemetryMessage, "PostChatContextCallSucceed", "Postchat context call succeed.");
|