@ada-support/embed2 1.0.54 → 1.0.58
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/dist/npm-entry/common/constants/events.d.ts +1 -0
- package/dist/npm-entry/common/constants/storage-keys.d.ts +2 -0
- package/dist/npm-entry/common/helpers/get-intro-for-url.d.ts +0 -2
- package/dist/npm-entry/common/models/client/index.d.ts +0 -1
- package/dist/npm-entry/common/types/http.d.ts +1 -17
- package/dist/npm-entry/common/types/index.d.ts +2 -1
- package/dist/npm-entry/common/types/store-state.d.ts +4 -0
- package/dist/npm-entry/frames/lib/safe-storage/index.d.ts +3 -1
- package/dist/npm-entry/index.js +160 -175
- package/package.json +1 -1
|
@@ -21,6 +21,7 @@ export declare const BROWSER_HAS_NOTIFICATIONS_RESPONSE_EVENT = "BROWSER_HAS_NOT
|
|
|
21
21
|
export declare const REQUEST_NOTIFICATIONS_EVENT = "REQUEST_NOTIFICATIONS";
|
|
22
22
|
export declare const END_CONVERSATION_EVENT = "END_CONVERSATION";
|
|
23
23
|
export declare const PUBLISH_EVENT = "PUBLISH_EVENT";
|
|
24
|
+
export declare const ZD_MESSAGING_HANDOFF = "ZD_MESSAGING_HANDOFF";
|
|
24
25
|
/**
|
|
25
26
|
* Store Events
|
|
26
27
|
*/
|
|
@@ -4,5 +4,7 @@ export declare const IN_LIVE_CHAT_STORAGE_KEY = "inLiveChat";
|
|
|
4
4
|
export declare const ZD_SESSION_STORAGE_KEY = "ada-embed_zd-session-id";
|
|
5
5
|
export declare const ZD_PREVIOUS_TAGS_STORAGE_KEY = "ada-embed_zd-previous-tags";
|
|
6
6
|
export declare const IS_DRAWER_OPEN_STORAGE_KEY = "ada-embed_is-drawer-open";
|
|
7
|
+
export declare const ZD_MESSAGING_EXTERNAL_USER_ID_STORAGE_KEY = "ada-embed_zd-messaging-external-user-id";
|
|
8
|
+
export declare const ZD_MESSAGING_CHATTER_CREATED_STORAGE_KEY = "ada-embed_zd-messaging-chatter-created";
|
|
7
9
|
/** @deprecated - Use CHATTER_TOKEN_STORAGE_KEY */
|
|
8
10
|
export declare const CHATTER_STORAGE_KEY = "chatter";
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { CurrentIntro, Intro } from "common/types/http";
|
|
2
1
|
export declare function getProcessedPath(path: string): string;
|
|
3
2
|
export declare function getPathSearchRegex(path: string): RegExp;
|
|
4
3
|
export declare function doesUrlMatchPath(url: string, path: string): boolean;
|
|
5
|
-
export declare function getIntroForCurrentUrl(intros: Intro[], language: string): CurrentIntro | undefined;
|
|
@@ -6,20 +6,6 @@ export interface ChatButton {
|
|
|
6
6
|
icon_path: string;
|
|
7
7
|
icon_type: string;
|
|
8
8
|
}
|
|
9
|
-
interface MessageBody {
|
|
10
|
-
message_text: {
|
|
11
|
-
[language: string]: string;
|
|
12
|
-
};
|
|
13
|
-
emoji_link: string;
|
|
14
|
-
}
|
|
15
|
-
export interface Intro {
|
|
16
|
-
style: "Text" | "Emoji";
|
|
17
|
-
response_id: string;
|
|
18
|
-
duration: number;
|
|
19
|
-
paths: string[];
|
|
20
|
-
delay: number;
|
|
21
|
-
body: MessageBody;
|
|
22
|
-
}
|
|
23
9
|
export interface CurrentIntro {
|
|
24
10
|
response_id: string;
|
|
25
11
|
body: string;
|
|
@@ -34,7 +20,7 @@ export interface Features {
|
|
|
34
20
|
developer_proactive?: boolean;
|
|
35
21
|
afm_business_events?: boolean;
|
|
36
22
|
afm_proactive_messaging?: boolean;
|
|
37
|
-
|
|
23
|
+
afm_dont_show_proactive_messages_in_chat?: boolean;
|
|
38
24
|
embed_test_bot?: boolean;
|
|
39
25
|
rtl_language_support?: boolean;
|
|
40
26
|
translations?: boolean;
|
|
@@ -62,7 +48,6 @@ export interface CachedClientObject {
|
|
|
62
48
|
privacy: boolean;
|
|
63
49
|
tint: string;
|
|
64
50
|
chat_button: ChatButton | null;
|
|
65
|
-
intros?: Intro[];
|
|
66
51
|
features: Features;
|
|
67
52
|
business_events?: BusinessEvent[];
|
|
68
53
|
marketing_campaigns_order?: string[];
|
|
@@ -75,4 +60,3 @@ export interface NotificationStatusResponse {
|
|
|
75
60
|
is_live_state: boolean;
|
|
76
61
|
unread_amount: number;
|
|
77
62
|
}
|
|
78
|
-
export {};
|
|
@@ -44,6 +44,8 @@ export interface StoreState extends StartOptionsNoFunction {
|
|
|
44
44
|
isDrawerOpen: boolean;
|
|
45
45
|
zdSessionId?: string | null;
|
|
46
46
|
zdPreviousTags?: string | null;
|
|
47
|
+
zdMessagingExternalUserId?: string | null;
|
|
48
|
+
zdMessagingChatterCreated?: string | null;
|
|
47
49
|
drawerHasBeenOpened: boolean;
|
|
48
50
|
isIntroShown: boolean;
|
|
49
51
|
isButtonShown: boolean;
|
|
@@ -71,6 +73,8 @@ export interface StoreState extends StartOptionsNoFunction {
|
|
|
71
73
|
chatterInLiveChat: boolean;
|
|
72
74
|
language?: string;
|
|
73
75
|
adaSettings: StartOptions;
|
|
76
|
+
wasCampaignShownButNowClosed: boolean;
|
|
77
|
+
isChatEmpty: boolean;
|
|
74
78
|
}
|
|
75
79
|
export interface StartOptionsNoFunction {
|
|
76
80
|
handle?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CHATTER_CREATED_STORAGE_KEY, CHATTER_TOKEN_STORAGE_KEY, IN_LIVE_CHAT_STORAGE_KEY, ZD_PREVIOUS_TAGS_STORAGE_KEY, ZD_SESSION_STORAGE_KEY } from "common/constants/storage-keys";
|
|
1
|
+
import { CHATTER_CREATED_STORAGE_KEY, CHATTER_TOKEN_STORAGE_KEY, IN_LIVE_CHAT_STORAGE_KEY, ZD_MESSAGING_CHATTER_CREATED_STORAGE_KEY, ZD_MESSAGING_EXTERNAL_USER_ID_STORAGE_KEY, ZD_PREVIOUS_TAGS_STORAGE_KEY, ZD_SESSION_STORAGE_KEY } from "common/constants/storage-keys";
|
|
2
2
|
export declare enum StorageTypes {
|
|
3
3
|
Local = "local",
|
|
4
4
|
Session = "session"
|
|
@@ -11,6 +11,8 @@ export interface StorageValueByKey {
|
|
|
11
11
|
[IN_LIVE_CHAT_STORAGE_KEY]: boolean;
|
|
12
12
|
[ZD_SESSION_STORAGE_KEY]: string;
|
|
13
13
|
[ZD_PREVIOUS_TAGS_STORAGE_KEY]: string;
|
|
14
|
+
[ZD_MESSAGING_EXTERNAL_USER_ID_STORAGE_KEY]: string;
|
|
15
|
+
[ZD_MESSAGING_CHATTER_CREATED_STORAGE_KEY]: string;
|
|
14
16
|
"liveChatPending": boolean;
|
|
15
17
|
"ada-embed_is-drawer-open": boolean;
|
|
16
18
|
"[handle]_marketing_campaigns_shown": string;
|
package/dist/npm-entry/index.js
CHANGED
|
@@ -8788,7 +8788,7 @@ var client = new error_tracker_BrowserClient({
|
|
|
8788
8788
|
return event;
|
|
8789
8789
|
},
|
|
8790
8790
|
environment: "production",
|
|
8791
|
-
release: "1.0.
|
|
8791
|
+
release: "1.0.58-8858d05",
|
|
8792
8792
|
sampleRate: 0.25,
|
|
8793
8793
|
autoSessionTracking: false,
|
|
8794
8794
|
// Integrations don't seem to work with Sentry: https://github.com/getsentry/sentry-javascript/issues/2541
|
|
@@ -8867,6 +8867,7 @@ var BROWSER_HAS_NOTIFICATIONS_RESPONSE_EVENT = "BROWSER_HAS_NOTIFICATIONS_RESPON
|
|
|
8867
8867
|
var REQUEST_NOTIFICATIONS_EVENT = "REQUEST_NOTIFICATIONS";
|
|
8868
8868
|
var END_CONVERSATION_EVENT = "END_CONVERSATION";
|
|
8869
8869
|
var PUBLISH_EVENT = "PUBLISH_EVENT";
|
|
8870
|
+
var ZD_MESSAGING_HANDOFF = "ZD_MESSAGING_HANDOFF";
|
|
8870
8871
|
/**
|
|
8871
8872
|
* Store Events
|
|
8872
8873
|
*/
|
|
@@ -9487,7 +9488,7 @@ function getEmbedURL(_ref) {
|
|
|
9487
9488
|
polyfillVersionString = "legacy";
|
|
9488
9489
|
}
|
|
9489
9490
|
|
|
9490
|
-
return concat_default()(_context5 = concat_default()(_context6 = concat_default()(_context7 = "".concat(host, "/embed/")).call(_context7, polyfillVersionString, "/")).call(_context6, frameName, "/")).call(_context5, "
|
|
9491
|
+
return concat_default()(_context5 = concat_default()(_context6 = concat_default()(_context7 = "".concat(host, "/embed/")).call(_context7, polyfillVersionString, "/")).call(_context6, frameName, "/")).call(_context5, "8858d05", "/index.html");
|
|
9491
9492
|
}
|
|
9492
9493
|
/**
|
|
9493
9494
|
* Generate the Chat / API URL
|
|
@@ -9649,6 +9650,8 @@ var IN_LIVE_CHAT_STORAGE_KEY = "inLiveChat";
|
|
|
9649
9650
|
var ZD_SESSION_STORAGE_KEY = "ada-embed_zd-session-id";
|
|
9650
9651
|
var ZD_PREVIOUS_TAGS_STORAGE_KEY = "ada-embed_zd-previous-tags";
|
|
9651
9652
|
var IS_DRAWER_OPEN_STORAGE_KEY = "ada-embed_is-drawer-open";
|
|
9653
|
+
var ZD_MESSAGING_EXTERNAL_USER_ID_STORAGE_KEY = "ada-embed_zd-messaging-external-user-id";
|
|
9654
|
+
var ZD_MESSAGING_CHATTER_CREATED_STORAGE_KEY = "ada-embed_zd-messaging-chatter-created";
|
|
9652
9655
|
/** @deprecated - Use CHATTER_TOKEN_STORAGE_KEY */
|
|
9653
9656
|
|
|
9654
9657
|
var CHATTER_STORAGE_KEY = CHATTER_TOKEN_STORAGE_KEY;
|
|
@@ -9950,6 +9953,8 @@ var state = {
|
|
|
9950
9953
|
chatterCreated: getValueFromStorage(CHATTER_CREATED_STORAGE_KEY) || undefined,
|
|
9951
9954
|
zdSessionId: getValueFromStorage(ZD_SESSION_STORAGE_KEY) || undefined,
|
|
9952
9955
|
zdPreviousTags: getValueFromStorage(ZD_PREVIOUS_TAGS_STORAGE_KEY) || undefined,
|
|
9956
|
+
zdMessagingExternalUserId: getValueFromStorage(ZD_MESSAGING_EXTERNAL_USER_ID_STORAGE_KEY) || null,
|
|
9957
|
+
zdMessagingChatterCreated: getValueFromStorage(ZD_MESSAGING_CHATTER_CREATED_STORAGE_KEY) || null,
|
|
9953
9958
|
connections: {},
|
|
9954
9959
|
appConnectionState: ConnectionState.Uninitiated,
|
|
9955
9960
|
testMode: false,
|
|
@@ -9962,7 +9967,9 @@ var state = {
|
|
|
9962
9967
|
latestCampaignKey: undefined,
|
|
9963
9968
|
hasChatOpenedAfterProactiveMessagesShown: false,
|
|
9964
9969
|
chatterInLiveChat: false,
|
|
9965
|
-
adaSettings: {}
|
|
9970
|
+
adaSettings: {},
|
|
9971
|
+
wasCampaignShownButNowClosed: false,
|
|
9972
|
+
isChatEmpty: false
|
|
9966
9973
|
};
|
|
9967
9974
|
/* harmony default export */ var store_state = (state);
|
|
9968
9975
|
;// CONCATENATED MODULE: ./src/client/store/index.ts
|
|
@@ -10345,7 +10352,6 @@ var trim_default = /*#__PURE__*/__webpack_require__.n(trim);
|
|
|
10345
10352
|
;// CONCATENATED MODULE: ./src/common/helpers/get-intro-for-url.ts
|
|
10346
10353
|
|
|
10347
10354
|
|
|
10348
|
-
|
|
10349
10355
|
function getProcessedPath(path) {
|
|
10350
10356
|
var regex = new RegExp("^http(s)?://(www.)?");
|
|
10351
10357
|
return trim_default()(path).call(path).replace(regex, "");
|
|
@@ -10370,53 +10376,6 @@ function doesUrlMatchPath(url, path) {
|
|
|
10370
10376
|
var matches = pathRegex.exec(processedUrl);
|
|
10371
10377
|
return matches !== null;
|
|
10372
10378
|
}
|
|
10373
|
-
|
|
10374
|
-
function findMatchingIntro(intros) {
|
|
10375
|
-
var currentUrl = window.location.href;
|
|
10376
|
-
|
|
10377
|
-
var matchingIntros = filter_default()(intros).call(intros, function (intro) {
|
|
10378
|
-
var _context2;
|
|
10379
|
-
|
|
10380
|
-
var matchingPaths = filter_default()(_context2 = intro.paths).call(_context2, function (path) {
|
|
10381
|
-
return doesUrlMatchPath(currentUrl, path);
|
|
10382
|
-
});
|
|
10383
|
-
|
|
10384
|
-
return matchingPaths.length > 0;
|
|
10385
|
-
});
|
|
10386
|
-
|
|
10387
|
-
if (matchingIntros.length === 0) {
|
|
10388
|
-
return null;
|
|
10389
|
-
}
|
|
10390
|
-
|
|
10391
|
-
return matchingIntros[0];
|
|
10392
|
-
}
|
|
10393
|
-
|
|
10394
|
-
function getIntroForCurrentUrl(intros, language) {
|
|
10395
|
-
var matchingIntro = findMatchingIntro(intros);
|
|
10396
|
-
|
|
10397
|
-
if (!matchingIntro) {
|
|
10398
|
-
return undefined;
|
|
10399
|
-
}
|
|
10400
|
-
|
|
10401
|
-
if (matchingIntro.style === "Emoji") {
|
|
10402
|
-
return {
|
|
10403
|
-
response_id: matchingIntro.response_id,
|
|
10404
|
-
body: matchingIntro.body.emoji_link,
|
|
10405
|
-
style: matchingIntro.style,
|
|
10406
|
-
delay: matchingIntro.delay,
|
|
10407
|
-
duration: matchingIntro.duration
|
|
10408
|
-
};
|
|
10409
|
-
} // Default - "Text" style
|
|
10410
|
-
|
|
10411
|
-
|
|
10412
|
-
return {
|
|
10413
|
-
response_id: matchingIntro.response_id,
|
|
10414
|
-
body: matchingIntro.body.message_text[language],
|
|
10415
|
-
style: matchingIntro.style,
|
|
10416
|
-
delay: matchingIntro.delay,
|
|
10417
|
-
duration: matchingIntro.duration
|
|
10418
|
-
};
|
|
10419
|
-
}
|
|
10420
10379
|
;// CONCATENATED MODULE: ./src/campaigns/TriggerConditionEvaluator.ts
|
|
10421
10380
|
|
|
10422
10381
|
|
|
@@ -10976,20 +10935,6 @@ function bindActionCreators(action, dispatch) {
|
|
|
10976
10935
|
|
|
10977
10936
|
|
|
10978
10937
|
|
|
10979
|
-
|
|
10980
|
-
|
|
10981
|
-
|
|
10982
|
-
|
|
10983
|
-
|
|
10984
|
-
function fetch_client_ownKeys(object, enumerableOnly) { var keys = keys_default()(object); if ((get_own_property_symbols_default())) { var symbols = get_own_property_symbols_default()(object); enumerableOnly && (symbols = filter_default()(symbols).call(symbols, function (sym) { return get_own_property_descriptor_default()(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10985
|
-
|
|
10986
|
-
function fetch_client_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? fetch_client_ownKeys(Object(source), !0).forEach(function (key) { (0,defineProperty/* default */.Z)(target, key, source[key]); }) : (get_own_property_descriptors_default()) ? define_properties_default()(target, get_own_property_descriptors_default()(source)) : fetch_client_ownKeys(Object(source)).forEach(function (key) { define_property_default()(target, key, get_own_property_descriptor_default()(source, key)); }); } return target; }
|
|
10987
|
-
|
|
10988
|
-
|
|
10989
|
-
|
|
10990
|
-
|
|
10991
|
-
|
|
10992
|
-
|
|
10993
10938
|
function isClientObject(client) {
|
|
10994
10939
|
// We require the following properties defined
|
|
10995
10940
|
return ["handle", "rollout", "chat", "features"].every(function (key) {
|
|
@@ -11027,9 +10972,7 @@ function _fetchClient() {
|
|
|
11027
10972
|
}
|
|
11028
10973
|
|
|
11029
10974
|
return _context.abrupt("return", {
|
|
11030
|
-
client:
|
|
11031
|
-
intro: getIntroForCurrentUrl(cachedClient.intros || [], language || cachedClient.language)
|
|
11032
|
-
}, cachedClient)
|
|
10975
|
+
client: cachedClient
|
|
11033
10976
|
});
|
|
11034
10977
|
|
|
11035
10978
|
case 6:
|
|
@@ -11225,9 +11168,6 @@ var Client = /*#__PURE__*/(0,createClass/* default */.Z)(function Client(clientR
|
|
|
11225
11168
|
|
|
11226
11169
|
object_assign_default()(this, rest);
|
|
11227
11170
|
});
|
|
11228
|
-
function hasCampaignsEnabled(client) {
|
|
11229
|
-
return (client === null || client === void 0 ? void 0 : client.features.afm_proactive_messaging) || (client === null || client === void 0 ? void 0 : client.features.afm_proactive_messaging_free_tier);
|
|
11230
|
-
}
|
|
11231
11171
|
function getButtonText(client) {
|
|
11232
11172
|
var _client$ui_settings, _client$ui_settings$e;
|
|
11233
11173
|
|
|
@@ -12037,7 +11977,7 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
|
|
|
12037
11977
|
var _handleChatEvent = (0,asyncToGenerator/* default */.Z)( /*#__PURE__*/regenerator_default().mark(function _callee(type, payload, id) {
|
|
12038
11978
|
var _this4 = this;
|
|
12039
11979
|
|
|
12040
|
-
var _this$props9, adaSettings, setState, setConnectionState, _ref, eventKey, data, _ref2, analytics, analyticsCallback, client, _ref3, chatter, created, chatterTokenCallback, _client, _ref4, zdSessionId, zdPreviousTags, storage, _client2, _ref5, inLiveChat, eventCallbacks, customJavascriptEvent, specificCallback, genericCallback, resetChat, zdChatterAuthCallback, conversationEndCallback;
|
|
11980
|
+
var _this$props9, adaSettings, setState, setConnectionState, _ref, eventKey, data, _ref2, analytics, analyticsCallback, client, _ref3, chatter, created, chatterTokenCallback, _client, _ref4, zdSessionId, zdPreviousTags, storage, _client2, _ref5, zdMessagingExternalUserId, zdMessagingChatterCreated, _client3, _ref6, inLiveChat, eventCallbacks, customJavascriptEvent, specificCallback, genericCallback, resetChat, zdChatterAuthCallback, conversationEndCallback;
|
|
12041
11981
|
|
|
12042
11982
|
return regenerator_default().wrap(function _callee$(_context22) {
|
|
12043
11983
|
while (1) {
|
|
@@ -12045,7 +11985,7 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
|
|
|
12045
11985
|
case 0:
|
|
12046
11986
|
_this$props9 = this.props, adaSettings = _this$props9.adaSettings, setState = _this$props9.setState, setConnectionState = _this$props9.setConnectionState;
|
|
12047
11987
|
_context22.t0 = type;
|
|
12048
|
-
_context22.next = _context22.t0 === GET_WINDOW_ORIGIN ? 4 : _context22.t0 === CHAT_STARTED ? 8 : _context22.t0 === CHAT_WEBSOCKET_CONNECTED ? 13 : _context22.t0 === PUBLISH_EVENT ? 15 : _context22.t0 === ANALYTICS_EVENT ? 18 : _context22.t0 === CHATTER_EVENT ? 22 : _context22.t0 === "ZD_SESSION" ? 32 : _context22.t0 ===
|
|
11988
|
+
_context22.next = _context22.t0 === GET_WINDOW_ORIGIN ? 4 : _context22.t0 === CHAT_STARTED ? 8 : _context22.t0 === CHAT_WEBSOCKET_CONNECTED ? 13 : _context22.t0 === PUBLISH_EVENT ? 15 : _context22.t0 === ANALYTICS_EVENT ? 18 : _context22.t0 === CHATTER_EVENT ? 22 : _context22.t0 === "ZD_SESSION" ? 32 : _context22.t0 === ZD_MESSAGING_HANDOFF ? 41 : _context22.t0 === CHATTER_LIVECHAT_EVENT ? 50 : _context22.t0 === CUSTOM_JAVASCRIPT_EVENT ? 58 : _context22.t0 === RESET_FROM_CHAT_EVENT ? 67 : _context22.t0 === ZD_JWT_AUTH_EVENT ? 70 : _context22.t0 === CREATE_NOTIFICATION_EVENT ? 88 : _context22.t0 === BROWSER_HAS_NOTIFICATIONS_EVENT ? 90 : _context22.t0 === REQUEST_NOTIFICATIONS_EVENT ? 94 : _context22.t0 === END_CONVERSATION_EVENT ? 96 : 99;
|
|
12049
11989
|
break;
|
|
12050
11990
|
|
|
12051
11991
|
case 4:
|
|
@@ -12058,7 +11998,7 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
|
|
|
12058
11998
|
|
|
12059
11999
|
case 6:
|
|
12060
12000
|
this.channel.postMessage("SET_WINDOW_ORIGIN", window.location, id);
|
|
12061
|
-
return _context22.abrupt("break",
|
|
12001
|
+
return _context22.abrupt("break", 100);
|
|
12062
12002
|
|
|
12063
12003
|
case 8:
|
|
12064
12004
|
if (this.channel) {
|
|
@@ -12073,18 +12013,18 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
|
|
|
12073
12013
|
setConnectionState({
|
|
12074
12014
|
"chat": ConnectionState.Done
|
|
12075
12015
|
});
|
|
12076
|
-
return _context22.abrupt("break",
|
|
12016
|
+
return _context22.abrupt("break", 100);
|
|
12077
12017
|
|
|
12078
12018
|
case 13:
|
|
12079
12019
|
setState({
|
|
12080
12020
|
isChatWebsocketConnected: true
|
|
12081
12021
|
});
|
|
12082
|
-
return _context22.abrupt("break",
|
|
12022
|
+
return _context22.abrupt("break", 100);
|
|
12083
12023
|
|
|
12084
12024
|
case 15:
|
|
12085
12025
|
_ref = payload, eventKey = _ref.eventKey, data = _ref.data;
|
|
12086
12026
|
publishEvent(eventKey, data);
|
|
12087
|
-
return _context22.abrupt("break",
|
|
12027
|
+
return _context22.abrupt("break", 100);
|
|
12088
12028
|
|
|
12089
12029
|
case 18:
|
|
12090
12030
|
_ref2 = payload, analytics = _ref2.analytics;
|
|
@@ -12094,7 +12034,7 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
|
|
|
12094
12034
|
analyticsCallback(analytics);
|
|
12095
12035
|
}
|
|
12096
12036
|
|
|
12097
|
-
return _context22.abrupt("break",
|
|
12037
|
+
return _context22.abrupt("break", 100);
|
|
12098
12038
|
|
|
12099
12039
|
case 22:
|
|
12100
12040
|
client = this.props.client;
|
|
@@ -12132,7 +12072,7 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
|
|
|
12132
12072
|
chatterTokenCallback(chatter);
|
|
12133
12073
|
}
|
|
12134
12074
|
|
|
12135
|
-
return _context22.abrupt("break",
|
|
12075
|
+
return _context22.abrupt("break", 100);
|
|
12136
12076
|
|
|
12137
12077
|
case 32:
|
|
12138
12078
|
_client = this.props.client;
|
|
@@ -12178,48 +12118,81 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
|
|
|
12178
12118
|
}
|
|
12179
12119
|
}
|
|
12180
12120
|
|
|
12181
|
-
return _context22.abrupt("break",
|
|
12121
|
+
return _context22.abrupt("break", 100);
|
|
12182
12122
|
|
|
12183
12123
|
case 41:
|
|
12184
12124
|
_client2 = this.props.client;
|
|
12185
|
-
_ref5 = payload,
|
|
12186
|
-
|
|
12125
|
+
_ref5 = payload, zdMessagingExternalUserId = _ref5.zdMessagingExternalUserId, zdMessagingChatterCreated = _ref5.zdMessagingChatterCreated;
|
|
12126
|
+
|
|
12127
|
+
if (_client2) {
|
|
12128
|
+
_context22.next = 45;
|
|
12129
|
+
break;
|
|
12130
|
+
}
|
|
12131
|
+
|
|
12132
|
+
throw new errors/* AdaEmbedError */.S("`client` is undefined");
|
|
12133
|
+
|
|
12134
|
+
case 45:
|
|
12135
|
+
_context22.next = 47;
|
|
12136
|
+
return setState({
|
|
12137
|
+
zdMessagingExternalUserId: zdMessagingExternalUserId,
|
|
12138
|
+
zdMessagingChatterCreated: zdMessagingChatterCreated
|
|
12139
|
+
});
|
|
12140
|
+
|
|
12141
|
+
case 47:
|
|
12142
|
+
if (zdMessagingExternalUserId === null) {
|
|
12143
|
+
safeLocalStorage.removeItem(ZD_MESSAGING_EXTERNAL_USER_ID_STORAGE_KEY);
|
|
12144
|
+
} else {
|
|
12145
|
+
safeLocalStorage.setItem(ZD_MESSAGING_EXTERNAL_USER_ID_STORAGE_KEY, zdMessagingExternalUserId);
|
|
12146
|
+
}
|
|
12147
|
+
|
|
12148
|
+
if (zdMessagingChatterCreated === null) {
|
|
12149
|
+
safeLocalStorage.removeItem(ZD_MESSAGING_CHATTER_CREATED_STORAGE_KEY);
|
|
12150
|
+
} else {
|
|
12151
|
+
safeLocalStorage.setItem(ZD_MESSAGING_CHATTER_CREATED_STORAGE_KEY, zdMessagingChatterCreated);
|
|
12152
|
+
}
|
|
12153
|
+
|
|
12154
|
+
return _context22.abrupt("break", 100);
|
|
12155
|
+
|
|
12156
|
+
case 50:
|
|
12157
|
+
_client3 = this.props.client;
|
|
12158
|
+
_ref6 = payload, inLiveChat = _ref6.inLiveChat;
|
|
12159
|
+
_context22.next = 54;
|
|
12187
12160
|
return setState({
|
|
12188
12161
|
chatterInLiveChat: inLiveChat
|
|
12189
12162
|
});
|
|
12190
12163
|
|
|
12191
|
-
case
|
|
12192
|
-
if (
|
|
12193
|
-
_context22.next =
|
|
12164
|
+
case 54:
|
|
12165
|
+
if (_client3) {
|
|
12166
|
+
_context22.next = 56;
|
|
12194
12167
|
break;
|
|
12195
12168
|
}
|
|
12196
12169
|
|
|
12197
12170
|
throw new errors/* AdaEmbedError */.S("`client` is not defined");
|
|
12198
12171
|
|
|
12199
|
-
case
|
|
12172
|
+
case 56:
|
|
12200
12173
|
/**
|
|
12201
12174
|
* Store the token so when embed loads in the future, it doesn't have to wait for it to
|
|
12202
12175
|
* come from chat. This is important for campaign and business event triggers.
|
|
12203
12176
|
*/
|
|
12204
|
-
if (
|
|
12177
|
+
if (_client3.persistence === PERSISTENCE_NORMAL) {
|
|
12205
12178
|
safeLocalStorage.setItem(IN_LIVE_CHAT_STORAGE_KEY, inLiveChat);
|
|
12206
|
-
} else if (
|
|
12179
|
+
} else if (_client3.persistence === PERSISTENCE_SESSION) {
|
|
12207
12180
|
safeSessionStorage.setItem(IN_LIVE_CHAT_STORAGE_KEY, inLiveChat);
|
|
12208
12181
|
}
|
|
12209
12182
|
|
|
12210
|
-
return _context22.abrupt("break",
|
|
12183
|
+
return _context22.abrupt("break", 100);
|
|
12211
12184
|
|
|
12212
|
-
case
|
|
12185
|
+
case 58:
|
|
12213
12186
|
eventCallbacks = adaSettings.eventCallbacks;
|
|
12214
12187
|
|
|
12215
12188
|
if (eventCallbacks) {
|
|
12216
|
-
_context22.next =
|
|
12189
|
+
_context22.next = 61;
|
|
12217
12190
|
break;
|
|
12218
12191
|
}
|
|
12219
12192
|
|
|
12220
|
-
return _context22.abrupt("break",
|
|
12193
|
+
return _context22.abrupt("break", 100);
|
|
12221
12194
|
|
|
12222
|
-
case
|
|
12195
|
+
case 61:
|
|
12223
12196
|
customJavascriptEvent = payload.event_data;
|
|
12224
12197
|
specificCallback = eventCallbacks[customJavascriptEvent.event_name];
|
|
12225
12198
|
genericCallback = eventCallbacks["*"];
|
|
@@ -12232,22 +12205,22 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
|
|
|
12232
12205
|
genericCallback(customJavascriptEvent);
|
|
12233
12206
|
}
|
|
12234
12207
|
|
|
12235
|
-
return _context22.abrupt("break",
|
|
12208
|
+
return _context22.abrupt("break", 100);
|
|
12236
12209
|
|
|
12237
|
-
case
|
|
12210
|
+
case 67:
|
|
12238
12211
|
resetChat = this.props.resetChat;
|
|
12239
12212
|
resetChat();
|
|
12240
|
-
return _context22.abrupt("break",
|
|
12213
|
+
return _context22.abrupt("break", 100);
|
|
12241
12214
|
|
|
12242
|
-
case
|
|
12215
|
+
case 70:
|
|
12243
12216
|
zdChatterAuthCallback = adaSettings.zdChatterAuthCallback;
|
|
12244
12217
|
|
|
12245
12218
|
if (!zdChatterAuthCallback) {
|
|
12246
|
-
_context22.next =
|
|
12219
|
+
_context22.next = 84;
|
|
12247
12220
|
break;
|
|
12248
12221
|
}
|
|
12249
12222
|
|
|
12250
|
-
_context22.prev =
|
|
12223
|
+
_context22.prev = 72;
|
|
12251
12224
|
zdChatterAuthCallback(function (token) {
|
|
12252
12225
|
if (!_this4.channel) {
|
|
12253
12226
|
throw new errors/* AdaEmbedError */.S("`this.channel` is not defined");
|
|
@@ -12257,82 +12230,82 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
|
|
|
12257
12230
|
token: token
|
|
12258
12231
|
}, id);
|
|
12259
12232
|
});
|
|
12260
|
-
_context22.next =
|
|
12233
|
+
_context22.next = 82;
|
|
12261
12234
|
break;
|
|
12262
12235
|
|
|
12263
|
-
case
|
|
12264
|
-
_context22.prev =
|
|
12265
|
-
_context22.t1 = _context22["catch"](
|
|
12236
|
+
case 76:
|
|
12237
|
+
_context22.prev = 76;
|
|
12238
|
+
_context22.t1 = _context22["catch"](72);
|
|
12266
12239
|
console.warn("Function for zdChatterAuthCallback produced an error - please ensure the callback is functioning normally");
|
|
12267
12240
|
|
|
12268
12241
|
if (this.channel) {
|
|
12269
|
-
_context22.next =
|
|
12242
|
+
_context22.next = 81;
|
|
12270
12243
|
break;
|
|
12271
12244
|
}
|
|
12272
12245
|
|
|
12273
12246
|
throw new errors/* AdaEmbedError */.S("`this.channel` is not defined");
|
|
12274
12247
|
|
|
12275
|
-
case
|
|
12248
|
+
case 81:
|
|
12276
12249
|
this.channel.postMessage(ZD_JWT_AUTH_RESPONSE_EVENT, {}, id);
|
|
12277
12250
|
|
|
12278
|
-
case
|
|
12279
|
-
_context22.next =
|
|
12251
|
+
case 82:
|
|
12252
|
+
_context22.next = 87;
|
|
12280
12253
|
break;
|
|
12281
12254
|
|
|
12282
|
-
case
|
|
12255
|
+
case 84:
|
|
12283
12256
|
if (this.channel) {
|
|
12284
|
-
_context22.next =
|
|
12257
|
+
_context22.next = 86;
|
|
12285
12258
|
break;
|
|
12286
12259
|
}
|
|
12287
12260
|
|
|
12288
12261
|
throw new errors/* AdaEmbedError */.S("`this.channel` is not defined");
|
|
12289
12262
|
|
|
12290
|
-
case
|
|
12263
|
+
case 86:
|
|
12291
12264
|
this.channel.postMessage(ZD_JWT_AUTH_RESPONSE_EVENT, {}, id);
|
|
12292
12265
|
|
|
12293
|
-
case
|
|
12294
|
-
return _context22.abrupt("break",
|
|
12266
|
+
case 87:
|
|
12267
|
+
return _context22.abrupt("break", 100);
|
|
12295
12268
|
|
|
12296
|
-
case
|
|
12269
|
+
case 88:
|
|
12297
12270
|
this.handleNotifications(payload);
|
|
12298
|
-
return _context22.abrupt("break",
|
|
12271
|
+
return _context22.abrupt("break", 100);
|
|
12299
12272
|
|
|
12300
|
-
case
|
|
12273
|
+
case 90:
|
|
12301
12274
|
if (this.channel) {
|
|
12302
|
-
_context22.next =
|
|
12275
|
+
_context22.next = 92;
|
|
12303
12276
|
break;
|
|
12304
12277
|
}
|
|
12305
12278
|
|
|
12306
12279
|
throw new errors/* AdaEmbedError */.S("`this.channel` is not defined");
|
|
12307
12280
|
|
|
12308
|
-
case
|
|
12281
|
+
case 92:
|
|
12309
12282
|
this.channel.postMessage(BROWSER_HAS_NOTIFICATIONS_RESPONSE_EVENT, {
|
|
12310
12283
|
browserHasNotificationSupport: browserHasNotificationSupport
|
|
12311
12284
|
});
|
|
12312
|
-
return _context22.abrupt("break",
|
|
12285
|
+
return _context22.abrupt("break", 100);
|
|
12313
12286
|
|
|
12314
|
-
case
|
|
12287
|
+
case 94:
|
|
12315
12288
|
requestNotificationPermission();
|
|
12316
|
-
return _context22.abrupt("break",
|
|
12289
|
+
return _context22.abrupt("break", 100);
|
|
12317
12290
|
|
|
12318
|
-
case
|
|
12291
|
+
case 96:
|
|
12319
12292
|
conversationEndCallback = adaSettings.conversationEndCallback;
|
|
12320
12293
|
|
|
12321
12294
|
if (conversationEndCallback) {
|
|
12322
12295
|
conversationEndCallback(payload);
|
|
12323
12296
|
}
|
|
12324
12297
|
|
|
12325
|
-
return _context22.abrupt("break",
|
|
12298
|
+
return _context22.abrupt("break", 100);
|
|
12326
12299
|
|
|
12327
|
-
case
|
|
12328
|
-
return _context22.abrupt("break",
|
|
12300
|
+
case 99:
|
|
12301
|
+
return _context22.abrupt("break", 100);
|
|
12329
12302
|
|
|
12330
|
-
case
|
|
12303
|
+
case 100:
|
|
12331
12304
|
case "end":
|
|
12332
12305
|
return _context22.stop();
|
|
12333
12306
|
}
|
|
12334
12307
|
}
|
|
12335
|
-
}, _callee, this, [[
|
|
12308
|
+
}, _callee, this, [[72, 76]]);
|
|
12336
12309
|
}));
|
|
12337
12310
|
|
|
12338
12311
|
function handleChatEvent(_x, _x2, _x3) {
|
|
@@ -12785,7 +12758,8 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
12785
12758
|
chatHasBeenRendered: false,
|
|
12786
12759
|
hideChatOverride: false,
|
|
12787
12760
|
hideIntroOverride: false,
|
|
12788
|
-
followUpResponseId: null
|
|
12761
|
+
followUpResponseId: null,
|
|
12762
|
+
wasCampaignShownButNowClosed: false
|
|
12789
12763
|
});
|
|
12790
12764
|
|
|
12791
12765
|
(0,defineProperty/* default */.Z)((0,assertThisInitialized/* default */.Z)(_this), "resetChatBound", _this.resetChat.bind((0,assertThisInitialized/* default */.Z)(_this)));
|
|
@@ -12848,7 +12822,10 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
12848
12822
|
isChatWebsocketConnected = _this$props2.isChatWebsocketConnected,
|
|
12849
12823
|
adaSettings = _this$props2.adaSettings,
|
|
12850
12824
|
chatterInLiveChat = _this$props2.chatterInLiveChat,
|
|
12851
|
-
messageService = _this$props2.messageService
|
|
12825
|
+
messageService = _this$props2.messageService,
|
|
12826
|
+
wasCampaignShownButNowClosed = _this$props2.wasCampaignShownButNowClosed,
|
|
12827
|
+
isChatEmpty = _this$props2.isChatEmpty,
|
|
12828
|
+
setState = _this$props2.setState;
|
|
12852
12829
|
var adaReadyCallback = adaSettings.adaReadyCallback,
|
|
12853
12830
|
toggleCallback = adaSettings.toggleCallback;
|
|
12854
12831
|
|
|
@@ -12893,7 +12870,7 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
12893
12870
|
// (message_text) campaigns
|
|
12894
12871
|
campaignToTrigger.message_text || chatterToken) && (campaignToTrigger.message_text || isChatWebsocketConnected) && ( // We need to wait for bindEmbedActionEventHandlerOnce to be called, but only for free tier
|
|
12895
12872
|
// campaigns, we don't need this for engage (response_id) campaigns
|
|
12896
|
-
campaignToTrigger.response_id || appConnectionState === ConnectionState.Done) && !isDrawerOpen && !chatterInLiveChat
|
|
12873
|
+
campaignToTrigger.response_id || appConnectionState === ConnectionState.Done) && !isDrawerOpen && !chatterInLiveChat) {
|
|
12897
12874
|
triggerCampaignImpl({
|
|
12898
12875
|
adaSettings: adaSettings,
|
|
12899
12876
|
chatterToken: chatterToken,
|
|
@@ -12914,9 +12891,22 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
12914
12891
|
var chatChannel = messageService.getChannel(CHAT_IFRAME);
|
|
12915
12892
|
|
|
12916
12893
|
if (chatChannel) {
|
|
12917
|
-
|
|
12918
|
-
|
|
12919
|
-
|
|
12894
|
+
if (!wasCampaignShownButNowClosed) {
|
|
12895
|
+
chatChannel.postMessage(SEND_GREETING, {
|
|
12896
|
+
responseId: followUpResponseId
|
|
12897
|
+
}); // If the campaign has not been closed (i.e. is still visible), send the follow up response
|
|
12898
|
+
} else if (isChatEmpty) {
|
|
12899
|
+
chatChannel.postMessage(SEND_GREETING);
|
|
12900
|
+
} // We want to reset the state because there's a possibility
|
|
12901
|
+
// that a user might engage with another campaign on another page path
|
|
12902
|
+
|
|
12903
|
+
|
|
12904
|
+
if (followUpResponseId && wasCampaignShownButNowClosed) {
|
|
12905
|
+
setState({
|
|
12906
|
+
wasCampaignShownButNowClosed: false
|
|
12907
|
+
});
|
|
12908
|
+
}
|
|
12909
|
+
|
|
12920
12910
|
this.setState({
|
|
12921
12911
|
followUpResponseId: null
|
|
12922
12912
|
});
|
|
@@ -12928,7 +12918,7 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
12928
12918
|
} // Wait for client to be available, then set campaign to trigger
|
|
12929
12919
|
|
|
12930
12920
|
|
|
12931
|
-
if (client && !prevProps.client
|
|
12921
|
+
if (client && !prevProps.client) {
|
|
12932
12922
|
this.evaluateCampaignConditions({}, true);
|
|
12933
12923
|
}
|
|
12934
12924
|
/**
|
|
@@ -13077,6 +13067,12 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
13077
13067
|
throw new errors/* AdaEmbedError */.S("Could not find campaign with key: ".concat(campaignKey));
|
|
13078
13068
|
}
|
|
13079
13069
|
|
|
13070
|
+
var followUpResponseId = campaign.follow_up_response_id;
|
|
13071
|
+
|
|
13072
|
+
if (client !== null && client !== void 0 && client.features.afm_dont_show_proactive_messages_in_chat && !followUpResponseId) {
|
|
13073
|
+
followUpResponseId = campaign.response_id;
|
|
13074
|
+
}
|
|
13075
|
+
|
|
13080
13076
|
setState({
|
|
13081
13077
|
latestCampaignKey: campaignKey,
|
|
13082
13078
|
hasChatOpenedAfterProactiveMessagesShown: false
|
|
@@ -13085,7 +13081,7 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
13085
13081
|
// Only need to load chat for engage campaigns, not free tier (message_text) campaigns
|
|
13086
13082
|
chatHasBeenRendered: chatHasBeenRendered || !campaign.message_text,
|
|
13087
13083
|
campaignToTrigger: campaign,
|
|
13088
|
-
followUpResponseId:
|
|
13084
|
+
followUpResponseId: followUpResponseId,
|
|
13089
13085
|
campaignTriggerOptions: {
|
|
13090
13086
|
ignoreFrequency: ignoreFrequency,
|
|
13091
13087
|
ignoreStatus: ignoreStatus
|
|
@@ -13101,11 +13097,6 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
13101
13097
|
var _this$props8 = this.props,
|
|
13102
13098
|
adaSettings = _this$props8.adaSettings,
|
|
13103
13099
|
client = _this$props8.client;
|
|
13104
|
-
|
|
13105
|
-
if (!hasCampaignsEnabled(client)) {
|
|
13106
|
-
return;
|
|
13107
|
-
}
|
|
13108
|
-
|
|
13109
13100
|
var campaignToTrigger = getCampaignToTrigger(adaSettings, client.marketing_campaigns, params, !client.features.afm_proactive_messaging);
|
|
13110
13101
|
|
|
13111
13102
|
if (campaignToTrigger) {
|
|
@@ -13128,7 +13119,7 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
13128
13119
|
var _handleEmbedAction = (0,asyncToGenerator/* default */.Z)( /*#__PURE__*/regenerator_default().mark(function _callee2(type, payload, id) {
|
|
13129
13120
|
var _this5 = this;
|
|
13130
13121
|
|
|
13131
|
-
var _this$props9, client, messageService, adaSettings, parentElement, localChannel, xStorageChannel, toggleChat, _this$props10, isDrawerOpen, drawerHasBeenOpened, chatterToken, contentToReturn, _this$props11, metaFields, setState, metaData, newMetaFields, _this$props12, sensitiveMetaFields, _setState, _ref, greeting, language, _newMetaFields, _sensitiveMetaFields, _ref$resetChatHistory, resetChatHistory, _setState2, chatHasBeenRendered, newState, _setState3, _ref2, body, duration, EXTRA_PROACTIVE_DELAY
|
|
13122
|
+
var _this$props9, client, messageService, adaSettings, parentElement, localChannel, xStorageChannel, toggleChat, _this$props10, isDrawerOpen, drawerHasBeenOpened, chatterToken, contentToReturn, _this$props11, metaFields, setState, metaData, newMetaFields, _this$props12, sensitiveMetaFields, _setState, _ref, greeting, language, _newMetaFields, _sensitiveMetaFields, _ref$resetChatHistory, resetChatHistory, _setState2, chatHasBeenRendered, newState, _setState3, _ref2, body, duration, EXTRA_PROACTIVE_DELAY;
|
|
13132
13123
|
|
|
13133
13124
|
return regenerator_default().wrap(function _callee2$(_context3) {
|
|
13134
13125
|
while (1) {
|
|
@@ -13148,7 +13139,7 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
13148
13139
|
|
|
13149
13140
|
case 6:
|
|
13150
13141
|
_context3.t0 = type;
|
|
13151
|
-
_context3.next = _context3.t0 === TRACK_EVENT ? 9 : _context3.t0 === TRIGGER_CAMPAIGN ? 14 : _context3.t0 === EVAL_CAMPAIGN_CONDITIONS ? 19 : _context3.t0 === TOGGLE ? 24 : _context3.t0 === GET_INFO ? 29 : _context3.t0 === SET_META_FIELDS ? 33 : _context3.t0 === "SET_SENSITIVE_META_FIELDS" ? 40 : _context3.t0 === STOP ? 45 : _context3.t0 === RESET ? 48 : _context3.t0 === DELETE_HISTORY ? 66 : _context3.t0 === CREATE_PROACTIVE ? 78 :
|
|
13142
|
+
_context3.next = _context3.t0 === TRACK_EVENT ? 9 : _context3.t0 === TRIGGER_CAMPAIGN ? 14 : _context3.t0 === EVAL_CAMPAIGN_CONDITIONS ? 19 : _context3.t0 === TOGGLE ? 24 : _context3.t0 === GET_INFO ? 29 : _context3.t0 === SET_META_FIELDS ? 33 : _context3.t0 === "SET_SENSITIVE_META_FIELDS" ? 40 : _context3.t0 === STOP ? 45 : _context3.t0 === RESET ? 48 : _context3.t0 === DELETE_HISTORY ? 66 : _context3.t0 === CREATE_PROACTIVE ? 78 : 87;
|
|
13152
13143
|
break;
|
|
13153
13144
|
|
|
13154
13145
|
case 9:
|
|
@@ -13162,7 +13153,7 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
13162
13153
|
|
|
13163
13154
|
case 12:
|
|
13164
13155
|
this.trackEvent(payload);
|
|
13165
|
-
return _context3.abrupt("break",
|
|
13156
|
+
return _context3.abrupt("break", 87);
|
|
13166
13157
|
|
|
13167
13158
|
case 14:
|
|
13168
13159
|
if (client.features.afm_proactive_messaging) {
|
|
@@ -13175,7 +13166,7 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
13175
13166
|
|
|
13176
13167
|
case 17:
|
|
13177
13168
|
this.triggerCampaign(payload);
|
|
13178
|
-
return _context3.abrupt("break",
|
|
13169
|
+
return _context3.abrupt("break", 87);
|
|
13179
13170
|
|
|
13180
13171
|
case 19:
|
|
13181
13172
|
if (client.features.afm_proactive_messaging) {
|
|
@@ -13188,7 +13179,7 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
13188
13179
|
|
|
13189
13180
|
case 22:
|
|
13190
13181
|
this.evaluateCampaignConditions(payload);
|
|
13191
|
-
return _context3.abrupt("break",
|
|
13182
|
+
return _context3.abrupt("break", 87);
|
|
13192
13183
|
|
|
13193
13184
|
case 24:
|
|
13194
13185
|
toggleChat = this.props.toggleChat;
|
|
@@ -13197,7 +13188,7 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
13197
13188
|
|
|
13198
13189
|
case 27:
|
|
13199
13190
|
localChannel.postMessage(TOGGLE_RESPONSE, null, id);
|
|
13200
|
-
return _context3.abrupt("break",
|
|
13191
|
+
return _context3.abrupt("break", 87);
|
|
13201
13192
|
|
|
13202
13193
|
case 29:
|
|
13203
13194
|
_this$props10 = this.props, isDrawerOpen = _this$props10.isDrawerOpen, drawerHasBeenOpened = _this$props10.drawerHasBeenOpened, chatterToken = _this$props10.chatterToken;
|
|
@@ -13208,7 +13199,7 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
13208
13199
|
hasClosedChat: drawerHasBeenOpened && !isDrawerOpen
|
|
13209
13200
|
};
|
|
13210
13201
|
localChannel.postMessage(GET_INFO_RESPONSE, contentToReturn, id);
|
|
13211
|
-
return _context3.abrupt("break",
|
|
13202
|
+
return _context3.abrupt("break", 87);
|
|
13212
13203
|
|
|
13213
13204
|
case 33:
|
|
13214
13205
|
_this$props11 = this.props, metaFields = _this$props11.metaFields, setState = _this$props11.setState;
|
|
@@ -13221,7 +13212,7 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
13221
13212
|
|
|
13222
13213
|
case 38:
|
|
13223
13214
|
localChannel.postMessage(SET_META_FIELDS_RESPONSE, null, id);
|
|
13224
|
-
return _context3.abrupt("break",
|
|
13215
|
+
return _context3.abrupt("break", 87);
|
|
13225
13216
|
|
|
13226
13217
|
case 40:
|
|
13227
13218
|
_this$props12 = this.props, sensitiveMetaFields = _this$props12.sensitiveMetaFields, _setState = _this$props12.setState;
|
|
@@ -13232,12 +13223,12 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
13232
13223
|
|
|
13233
13224
|
case 43:
|
|
13234
13225
|
localChannel.postMessage("SET_SENSITIVE_META_FIELDS_RESPONSE", null, id);
|
|
13235
|
-
return _context3.abrupt("break",
|
|
13226
|
+
return _context3.abrupt("break", 87);
|
|
13236
13227
|
|
|
13237
13228
|
case 45:
|
|
13238
13229
|
localChannel.postMessage(STOP_RESPONSE, null, id);
|
|
13239
13230
|
this.unmount();
|
|
13240
|
-
return _context3.abrupt("break",
|
|
13231
|
+
return _context3.abrupt("break", 87);
|
|
13241
13232
|
|
|
13242
13233
|
case 48:
|
|
13243
13234
|
_ref = payload, greeting = _ref.greeting, language = _ref.language, _newMetaFields = _ref.metaFields, _sensitiveMetaFields = _ref.sensitiveMetaFields, _ref$resetChatHistory = _ref.resetChatHistory, resetChatHistory = _ref$resetChatHistory === void 0 ? true : _ref$resetChatHistory;
|
|
@@ -13291,7 +13282,7 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
13291
13282
|
}
|
|
13292
13283
|
|
|
13293
13284
|
localChannel.postMessage(RESET_RESPONSE, null, id);
|
|
13294
|
-
return _context3.abrupt("break",
|
|
13285
|
+
return _context3.abrupt("break", 87);
|
|
13295
13286
|
|
|
13296
13287
|
case 66:
|
|
13297
13288
|
_setState3 = this.props.setState;
|
|
@@ -13319,7 +13310,7 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
13319
13310
|
case 75:
|
|
13320
13311
|
xStorageChannel.postMessage(DELETE_HISTORY_EVENT);
|
|
13321
13312
|
localChannel.postMessage(DELETE_HISTORY_RESPONSE, null, id);
|
|
13322
|
-
return _context3.abrupt("break",
|
|
13313
|
+
return _context3.abrupt("break", 87);
|
|
13323
13314
|
|
|
13324
13315
|
case 78:
|
|
13325
13316
|
_ref2 = payload, body = _ref2.body, duration = _ref2.duration;
|
|
@@ -13333,18 +13324,8 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
13333
13324
|
throw new errors/* AdaEmbedError */.S("`client` is not defined");
|
|
13334
13325
|
|
|
13335
13326
|
case 82:
|
|
13336
|
-
//
|
|
13337
|
-
|
|
13338
|
-
|
|
13339
|
-
if (canCreateProactive) {
|
|
13340
|
-
_context3.next = 86;
|
|
13341
|
-
break;
|
|
13342
|
-
}
|
|
13343
|
-
|
|
13344
|
-
localChannel.postMessage(CREATE_PROACTIVE_RESPONSE, "Ada Embed - Proactive intros are not available in your feature set.", id, FetchEventStatus.Failure);
|
|
13345
|
-
return _context3.abrupt("return");
|
|
13346
|
-
|
|
13347
|
-
case 86:
|
|
13327
|
+
// Do not feature flag gate this behind the developer_proactive flag
|
|
13328
|
+
// It's also used for free-tier campaigns, which are available to all clients
|
|
13348
13329
|
this.setState({
|
|
13349
13330
|
hideIntroOverride: true
|
|
13350
13331
|
}, /*#__PURE__*/(0,asyncToGenerator/* default */.Z)( /*#__PURE__*/regenerator_default().mark(function _callee() {
|
|
@@ -13382,14 +13363,14 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
13382
13363
|
}
|
|
13383
13364
|
}, _callee);
|
|
13384
13365
|
})));
|
|
13385
|
-
_context3.next =
|
|
13366
|
+
_context3.next = 85;
|
|
13386
13367
|
return wait(duration * 1000 + EXTRA_PROACTIVE_DELAY);
|
|
13387
13368
|
|
|
13388
|
-
case
|
|
13369
|
+
case 85:
|
|
13389
13370
|
localChannel.postMessage(CREATE_PROACTIVE_RESPONSE, null, id);
|
|
13390
|
-
return _context3.abrupt("break",
|
|
13371
|
+
return _context3.abrupt("break", 87);
|
|
13391
13372
|
|
|
13392
|
-
case
|
|
13373
|
+
case 87:
|
|
13393
13374
|
case "end":
|
|
13394
13375
|
return _context3.stop();
|
|
13395
13376
|
}
|
|
@@ -13522,7 +13503,7 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
13522
13503
|
(0,errors/* warn */.Z)("Failed to fetch events from API.");
|
|
13523
13504
|
|
|
13524
13505
|
case 25:
|
|
13525
|
-
if (
|
|
13506
|
+
if (newClient.marketing_campaigns) {
|
|
13526
13507
|
_context8.next = 38;
|
|
13527
13508
|
break;
|
|
13528
13509
|
}
|
|
@@ -13548,7 +13529,7 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
13548
13529
|
|
|
13549
13530
|
case 38:
|
|
13550
13531
|
// Sort the campaigns by marketing_campaigns_order
|
|
13551
|
-
if (
|
|
13532
|
+
if (newClient.marketing_campaigns_order) {
|
|
13552
13533
|
newClient.marketing_campaigns = filter_default()(_context5 = map_default()(_context6 = newClient.marketing_campaigns_order).call(_context6, function (campaignId) {
|
|
13553
13534
|
var _context7;
|
|
13554
13535
|
|
|
@@ -13804,7 +13785,9 @@ function Container_mapStateToProps(storeState) {
|
|
|
13804
13785
|
chatterInLiveChat = storeState.chatterInLiveChat,
|
|
13805
13786
|
chatDimensions = storeState.chatDimensions,
|
|
13806
13787
|
isIntroShown = storeState.isIntroShown,
|
|
13807
|
-
language = storeState.language
|
|
13788
|
+
language = storeState.language,
|
|
13789
|
+
wasCampaignShownButNowClosed = storeState.wasCampaignShownButNowClosed,
|
|
13790
|
+
isChatEmpty = storeState.isChatEmpty;
|
|
13808
13791
|
return {
|
|
13809
13792
|
client: client,
|
|
13810
13793
|
hideMask: hideMask,
|
|
@@ -13818,7 +13801,9 @@ function Container_mapStateToProps(storeState) {
|
|
|
13818
13801
|
chatterInLiveChat: chatterInLiveChat,
|
|
13819
13802
|
chatDimensions: chatDimensions,
|
|
13820
13803
|
isIntroShown: isIntroShown,
|
|
13821
|
-
language: language
|
|
13804
|
+
language: language,
|
|
13805
|
+
wasCampaignShownButNowClosed: wasCampaignShownButNowClosed,
|
|
13806
|
+
isChatEmpty: isChatEmpty
|
|
13822
13807
|
};
|
|
13823
13808
|
}
|
|
13824
13809
|
|
|
@@ -14384,7 +14369,7 @@ window.__AdaEmbedConstructor = Embed;
|
|
|
14384
14369
|
/* harmony export */ });
|
|
14385
14370
|
var isModern = new RegExp("((CPU[ +]OS|iPhone[ +]OS|CPU[ +]iPhone|CPU IPhone OS)[ +]+(15|(1[6-9]|[2-9]\\d|\\d{3,}))[_.]\\d+(?:[_.]\\d+)?)|((Chromium|Chrome)\\/(97|(9[8-9]|\\d{3,}))\\.\\d+(?:\\.\\d+)?)|(Version\\/(15|(1[6-9]|[2-9]\\d|\\d{3,}))\\.\\d+(?:\\.\\d+)? Safari\\/)|(Firefox\\/(96|(9[7-9]|\\d{3,}))\\.\\d+\\.\\d+)|(Firefox\\/(96|(9[7-9]|\\d{3,}))\\.\\d+(pre|[ab]\\d+[a-z]*)?)").test(navigator.userAgent);
|
|
14386
14371
|
var isProduction = "production" === "production";
|
|
14387
|
-
var embed2Version = "
|
|
14372
|
+
var embed2Version = "8858d05";
|
|
14388
14373
|
|
|
14389
14374
|
/***/ }),
|
|
14390
14375
|
|
|
@@ -14726,9 +14711,9 @@ function _log() {
|
|
|
14726
14711
|
service: "embed",
|
|
14727
14712
|
env: "production",
|
|
14728
14713
|
embedVersion: 2,
|
|
14729
|
-
version: "1.0.
|
|
14714
|
+
version: "1.0.58",
|
|
14730
14715
|
isNpm: true,
|
|
14731
|
-
commitHash: "
|
|
14716
|
+
commitHash: "8858d05"
|
|
14732
14717
|
}))
|
|
14733
14718
|
});
|
|
14734
14719
|
|
|
@@ -24275,7 +24260,7 @@ function _loadEmbed() {
|
|
|
24275
24260
|
polyfillVersionString = "legacy";
|
|
24276
24261
|
}
|
|
24277
24262
|
|
|
24278
|
-
embedScriptSource = concat_default()(_context16 = concat_default()(_context17 = "".concat(host, "/embed/")).call(_context17, polyfillVersionString, "/client/")).call(_context16, "
|
|
24263
|
+
embedScriptSource = concat_default()(_context16 = concat_default()(_context17 = "".concat(host, "/embed/")).call(_context17, polyfillVersionString, "/client/")).call(_context16, "8858d05", "/index.js");
|
|
24279
24264
|
}
|
|
24280
24265
|
|
|
24281
24266
|
clientScriptExists = Boolean( true || // The client script is bundled with npm module
|