@ada-support/embed2 1.0.31 → 1.0.32
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/storage-keys.d.ts +6 -1
- package/dist/npm-entry/common/lib/fc/index.d.ts +1 -1
- package/dist/npm-entry/common/types/store-state.d.ts +4 -1
- package/dist/npm-entry/frames/components/x-storage/index.d.ts +12 -0
- package/dist/npm-entry/frames/helpers/frame-init.d.ts +3 -0
- package/dist/npm-entry/frames/lib/error-tracker.d.ts +6 -0
- package/dist/npm-entry/frames/lib/frame-fc.d.ts +3 -0
- package/dist/npm-entry/frames/lib/safe-storage/index.d.ts +8 -4
- package/dist/npm-entry/frames/lib/store-proxy.d.ts +2 -0
- package/dist/npm-entry/index.js +1008 -369
- package/package.json +6 -5
package/dist/npm-entry/index.js
CHANGED
|
@@ -722,7 +722,7 @@ var browserPerformanceTimeOrigin = (function () {
|
|
|
722
722
|
|
|
723
723
|
/***/ }),
|
|
724
724
|
|
|
725
|
-
/***/
|
|
725
|
+
/***/ 2396:
|
|
726
726
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
727
727
|
|
|
728
728
|
"use strict";
|
|
@@ -1738,7 +1738,7 @@ var States;
|
|
|
1738
1738
|
* Thenable class that behaves like a Promise and follows it's interface
|
|
1739
1739
|
* but is not async internally
|
|
1740
1740
|
*/
|
|
1741
|
-
var
|
|
1741
|
+
var syncpromise_SyncPromise = /** @class */ (function () {
|
|
1742
1742
|
function SyncPromise(executor) {
|
|
1743
1743
|
var _this = this;
|
|
1744
1744
|
this._state = States.PENDING;
|
|
@@ -2287,7 +2287,7 @@ var Scope = /** @class */ (function () {
|
|
|
2287
2287
|
Scope.prototype._notifyEventProcessors = function (processors, event, hint, index) {
|
|
2288
2288
|
var _this = this;
|
|
2289
2289
|
if (index === void 0) { index = 0; }
|
|
2290
|
-
return new
|
|
2290
|
+
return new syncpromise_SyncPromise(function (resolve, reject) {
|
|
2291
2291
|
var processor = processors[index];
|
|
2292
2292
|
if (event === null || typeof processor !== 'function') {
|
|
2293
2293
|
resolve(event);
|
|
@@ -3818,7 +3818,7 @@ function makeMain(hub) {
|
|
|
3818
3818
|
* contains a more recent version, it replaces the registered version.
|
|
3819
3819
|
* Otherwise, the currently registered hub will be returned.
|
|
3820
3820
|
*/
|
|
3821
|
-
function
|
|
3821
|
+
function hub_getCurrentHub() {
|
|
3822
3822
|
// Get main carrier (global for every environment)
|
|
3823
3823
|
var registry = getMainCarrier();
|
|
3824
3824
|
// If there's no hub, or its an old API, assign a new one
|
|
@@ -3924,7 +3924,7 @@ var InboundFilters = /** @class */ (function () {
|
|
|
3924
3924
|
*/
|
|
3925
3925
|
InboundFilters.prototype.setupOnce = function () {
|
|
3926
3926
|
addGlobalEventProcessor(function (event) {
|
|
3927
|
-
var hub =
|
|
3927
|
+
var hub = hub_getCurrentHub();
|
|
3928
3928
|
if (!hub) {
|
|
3929
3929
|
return event;
|
|
3930
3930
|
}
|
|
@@ -5186,7 +5186,7 @@ function eventFromException(options, exception, hint) {
|
|
|
5186
5186
|
if (hint && hint.event_id) {
|
|
5187
5187
|
event.event_id = hint.event_id;
|
|
5188
5188
|
}
|
|
5189
|
-
return
|
|
5189
|
+
return syncpromise_SyncPromise.resolve(event);
|
|
5190
5190
|
}
|
|
5191
5191
|
/**
|
|
5192
5192
|
* Builds and Event from a Message
|
|
@@ -5202,7 +5202,7 @@ function eventFromMessage(options, message, level, hint) {
|
|
|
5202
5202
|
if (hint && hint.event_id) {
|
|
5203
5203
|
event.event_id = hint.event_id;
|
|
5204
5204
|
}
|
|
5205
|
-
return
|
|
5205
|
+
return syncpromise_SyncPromise.resolve(event);
|
|
5206
5206
|
}
|
|
5207
5207
|
/**
|
|
5208
5208
|
* @hidden
|
|
@@ -5512,7 +5512,7 @@ function callOnHub(method) {
|
|
|
5512
5512
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
5513
5513
|
args[_i - 1] = arguments[_i];
|
|
5514
5514
|
}
|
|
5515
|
-
var hub =
|
|
5515
|
+
var hub = hub_getCurrentHub();
|
|
5516
5516
|
if (hub && hub[method]) {
|
|
5517
5517
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5518
5518
|
return hub[method].apply(hub, minimal_node_modules_tslib_tslib_es6_spread(args));
|
|
@@ -6172,7 +6172,7 @@ var GlobalHandlers = /** @class */ (function () {
|
|
|
6172
6172
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6173
6173
|
callback: function (data) {
|
|
6174
6174
|
var error = data.error;
|
|
6175
|
-
var currentHub =
|
|
6175
|
+
var currentHub = hub_getCurrentHub();
|
|
6176
6176
|
var hasIntegration = currentHub.getIntegration(GlobalHandlers);
|
|
6177
6177
|
var isFailedOwnDelivery = error && error.__sentry_own_request__ === true;
|
|
6178
6178
|
if (!hasIntegration || shouldIgnoreOnError() || isFailedOwnDelivery) {
|
|
@@ -6226,7 +6226,7 @@ var GlobalHandlers = /** @class */ (function () {
|
|
|
6226
6226
|
catch (_oO) {
|
|
6227
6227
|
// no-empty
|
|
6228
6228
|
}
|
|
6229
|
-
var currentHub =
|
|
6229
|
+
var currentHub = hub_getCurrentHub();
|
|
6230
6230
|
var hasIntegration = currentHub.getIntegration(GlobalHandlers);
|
|
6231
6231
|
var isFailedOwnDelivery = error && error.__sentry_own_request__ === true;
|
|
6232
6232
|
if (!hasIntegration || shouldIgnoreOnError() || isFailedOwnDelivery) {
|
|
@@ -6588,7 +6588,7 @@ var Breadcrumbs = /** @class */ (function () {
|
|
|
6588
6588
|
if (!this._options.sentry) {
|
|
6589
6589
|
return;
|
|
6590
6590
|
}
|
|
6591
|
-
|
|
6591
|
+
hub_getCurrentHub().addBreadcrumb({
|
|
6592
6592
|
category: "sentry." + (event.type === 'transaction' ? 'transaction' : 'event'),
|
|
6593
6593
|
event_id: event.event_id,
|
|
6594
6594
|
level: event.level,
|
|
@@ -6692,7 +6692,7 @@ var Breadcrumbs = /** @class */ (function () {
|
|
|
6692
6692
|
return;
|
|
6693
6693
|
}
|
|
6694
6694
|
}
|
|
6695
|
-
|
|
6695
|
+
hub_getCurrentHub().addBreadcrumb(breadcrumb, {
|
|
6696
6696
|
input: handlerData.args,
|
|
6697
6697
|
level: handlerData.level,
|
|
6698
6698
|
});
|
|
@@ -6719,7 +6719,7 @@ var Breadcrumbs = /** @class */ (function () {
|
|
|
6719
6719
|
if (target.length === 0) {
|
|
6720
6720
|
return;
|
|
6721
6721
|
}
|
|
6722
|
-
|
|
6722
|
+
hub_getCurrentHub().addBreadcrumb({
|
|
6723
6723
|
category: "ui." + handlerData.name,
|
|
6724
6724
|
message: target,
|
|
6725
6725
|
}, {
|
|
@@ -6739,7 +6739,7 @@ var Breadcrumbs = /** @class */ (function () {
|
|
|
6739
6739
|
return;
|
|
6740
6740
|
}
|
|
6741
6741
|
var _a = handlerData.xhr.__sentry_xhr__ || {}, method = _a.method, url = _a.url, status_code = _a.status_code, body = _a.body;
|
|
6742
|
-
|
|
6742
|
+
hub_getCurrentHub().addBreadcrumb({
|
|
6743
6743
|
category: 'xhr',
|
|
6744
6744
|
data: {
|
|
6745
6745
|
method: method,
|
|
@@ -6768,7 +6768,7 @@ var Breadcrumbs = /** @class */ (function () {
|
|
|
6768
6768
|
return;
|
|
6769
6769
|
}
|
|
6770
6770
|
if (handlerData.error) {
|
|
6771
|
-
|
|
6771
|
+
hub_getCurrentHub().addBreadcrumb({
|
|
6772
6772
|
category: 'fetch',
|
|
6773
6773
|
data: handlerData.fetchData,
|
|
6774
6774
|
level: Severity.Error,
|
|
@@ -6779,7 +6779,7 @@ var Breadcrumbs = /** @class */ (function () {
|
|
|
6779
6779
|
});
|
|
6780
6780
|
}
|
|
6781
6781
|
else {
|
|
6782
|
-
|
|
6782
|
+
hub_getCurrentHub().addBreadcrumb({
|
|
6783
6783
|
category: 'fetch',
|
|
6784
6784
|
data: tslib_es6_assign(tslib_es6_assign({}, handlerData.fetchData), { status_code: handlerData.response.status }),
|
|
6785
6785
|
type: 'http',
|
|
@@ -6812,7 +6812,7 @@ var Breadcrumbs = /** @class */ (function () {
|
|
|
6812
6812
|
if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) {
|
|
6813
6813
|
from = parsedFrom.relative;
|
|
6814
6814
|
}
|
|
6815
|
-
|
|
6815
|
+
hub_getCurrentHub().addBreadcrumb({
|
|
6816
6816
|
category: 'navigation',
|
|
6817
6817
|
data: {
|
|
6818
6818
|
from: from,
|
|
@@ -6855,7 +6855,7 @@ var LinkedErrors = /** @class */ (function () {
|
|
|
6855
6855
|
*/
|
|
6856
6856
|
LinkedErrors.prototype.setupOnce = function () {
|
|
6857
6857
|
addGlobalEventProcessor(function (event, hint) {
|
|
6858
|
-
var self =
|
|
6858
|
+
var self = hub_getCurrentHub().getIntegration(LinkedErrors);
|
|
6859
6859
|
if (self) {
|
|
6860
6860
|
var handler = self._handler && self._handler.bind(self);
|
|
6861
6861
|
return typeof handler === 'function' ? handler(event, hint) : event;
|
|
@@ -6913,7 +6913,7 @@ var UserAgent = /** @class */ (function () {
|
|
|
6913
6913
|
UserAgent.prototype.setupOnce = function () {
|
|
6914
6914
|
addGlobalEventProcessor(function (event) {
|
|
6915
6915
|
var _a, _b, _c;
|
|
6916
|
-
if (
|
|
6916
|
+
if (hub_getCurrentHub().getIntegration(UserAgent)) {
|
|
6917
6917
|
// if none of the information we want exists, don't bother
|
|
6918
6918
|
if (!useragent_global.navigator && !useragent_global.location && !useragent_global.document) {
|
|
6919
6919
|
return event;
|
|
@@ -7176,7 +7176,7 @@ function setupIntegration(integration) {
|
|
|
7176
7176
|
if (installedIntegrations.indexOf(integration.name) !== -1) {
|
|
7177
7177
|
return;
|
|
7178
7178
|
}
|
|
7179
|
-
integration.setupOnce(addGlobalEventProcessor,
|
|
7179
|
+
integration.setupOnce(addGlobalEventProcessor, hub_getCurrentHub);
|
|
7180
7180
|
installedIntegrations.push(integration.name);
|
|
7181
7181
|
logger_logger.log("Integration installed: " + integration.name);
|
|
7182
7182
|
}
|
|
@@ -7420,7 +7420,7 @@ var BaseClient = /** @class */ (function () {
|
|
|
7420
7420
|
*/
|
|
7421
7421
|
BaseClient.prototype._isClientDoneProcessing = function (timeout) {
|
|
7422
7422
|
var _this = this;
|
|
7423
|
-
return new
|
|
7423
|
+
return new syncpromise_SyncPromise(function (resolve) {
|
|
7424
7424
|
var ticked = 0;
|
|
7425
7425
|
var tick = 1;
|
|
7426
7426
|
var interval = setInterval(function () {
|
|
@@ -7473,7 +7473,7 @@ var BaseClient = /** @class */ (function () {
|
|
|
7473
7473
|
finalScope = Scope.clone(finalScope).update(hint.captureContext);
|
|
7474
7474
|
}
|
|
7475
7475
|
// We prepare the result here with a resolved Event.
|
|
7476
|
-
var result =
|
|
7476
|
+
var result = syncpromise_SyncPromise.resolve(prepared);
|
|
7477
7477
|
// This should be the last thing called, since we want that
|
|
7478
7478
|
// {@link Hub.addEventProcessor} gets the finished prepared event.
|
|
7479
7479
|
if (finalScope) {
|
|
@@ -7609,14 +7609,14 @@ var BaseClient = /** @class */ (function () {
|
|
|
7609
7609
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
7610
7610
|
var _a = this.getOptions(), beforeSend = _a.beforeSend, sampleRate = _a.sampleRate;
|
|
7611
7611
|
if (!this._isEnabled()) {
|
|
7612
|
-
return
|
|
7612
|
+
return syncpromise_SyncPromise.reject(new SentryError('SDK not enabled, will not capture event.'));
|
|
7613
7613
|
}
|
|
7614
7614
|
var isTransaction = event.type === 'transaction';
|
|
7615
7615
|
// 1.0 === 100% events are sent
|
|
7616
7616
|
// 0.0 === 0% events are sent
|
|
7617
7617
|
// Sampling for transaction happens somewhere else
|
|
7618
7618
|
if (!isTransaction && typeof sampleRate === 'number' && Math.random() > sampleRate) {
|
|
7619
|
-
return
|
|
7619
|
+
return syncpromise_SyncPromise.reject(new SentryError("Discarding event because it's not included in the random sample (sampling rate = " + sampleRate + ")"));
|
|
7620
7620
|
}
|
|
7621
7621
|
return this._prepareEvent(event, scope, hint)
|
|
7622
7622
|
.then(function (prepared) {
|
|
@@ -7747,7 +7747,7 @@ var NoopTransport = /** @class */ (function () {
|
|
|
7747
7747
|
* @inheritDoc
|
|
7748
7748
|
*/
|
|
7749
7749
|
NoopTransport.prototype.sendEvent = function (_) {
|
|
7750
|
-
return
|
|
7750
|
+
return syncpromise_SyncPromise.resolve({
|
|
7751
7751
|
reason: "NoopTransport: Event has been skipped because no Dsn is configured.",
|
|
7752
7752
|
status: Status.Skipped,
|
|
7753
7753
|
});
|
|
@@ -7756,7 +7756,7 @@ var NoopTransport = /** @class */ (function () {
|
|
|
7756
7756
|
* @inheritDoc
|
|
7757
7757
|
*/
|
|
7758
7758
|
NoopTransport.prototype.close = function (_) {
|
|
7759
|
-
return
|
|
7759
|
+
return syncpromise_SyncPromise.resolve(true);
|
|
7760
7760
|
};
|
|
7761
7761
|
return NoopTransport;
|
|
7762
7762
|
}());
|
|
@@ -7937,7 +7937,7 @@ var PromiseBuffer = /** @class */ (function () {
|
|
|
7937
7937
|
PromiseBuffer.prototype.add = function (taskProducer) {
|
|
7938
7938
|
var _this = this;
|
|
7939
7939
|
if (!this.isReady()) {
|
|
7940
|
-
return
|
|
7940
|
+
return syncpromise_SyncPromise.reject(new SentryError('Not adding Promise due to buffer limit reached.'));
|
|
7941
7941
|
}
|
|
7942
7942
|
// start the task and add its promise to the queue
|
|
7943
7943
|
var task = taskProducer();
|
|
@@ -7983,7 +7983,7 @@ var PromiseBuffer = /** @class */ (function () {
|
|
|
7983
7983
|
*/
|
|
7984
7984
|
PromiseBuffer.prototype.drain = function (timeout) {
|
|
7985
7985
|
var _this = this;
|
|
7986
|
-
return new
|
|
7986
|
+
return new syncpromise_SyncPromise(function (resolve) {
|
|
7987
7987
|
// wait for `timeout` ms and then resolve to `false` (if not cancelled first)
|
|
7988
7988
|
var capturedSetTimeout = setTimeout(function () {
|
|
7989
7989
|
if (timeout && timeout > 0) {
|
|
@@ -7991,7 +7991,7 @@ var PromiseBuffer = /** @class */ (function () {
|
|
|
7991
7991
|
}
|
|
7992
7992
|
}, timeout);
|
|
7993
7993
|
// if all promises resolve in time, cancel the timer and resolve to `true`
|
|
7994
|
-
void
|
|
7994
|
+
void syncpromise_SyncPromise.all(_this._buffer)
|
|
7995
7995
|
.then(function () {
|
|
7996
7996
|
clearTimeout(capturedSetTimeout);
|
|
7997
7997
|
resolve(true);
|
|
@@ -8253,7 +8253,7 @@ var FetchTransport = /** @class */ (function (_super) {
|
|
|
8253
8253
|
options.headers = this.options.headers;
|
|
8254
8254
|
}
|
|
8255
8255
|
return this._buffer.add(function () {
|
|
8256
|
-
return new
|
|
8256
|
+
return new syncpromise_SyncPromise(function (resolve, reject) {
|
|
8257
8257
|
void _this._fetch(sentryRequest.url, options)
|
|
8258
8258
|
.then(function (response) {
|
|
8259
8259
|
var headers = {
|
|
@@ -8314,7 +8314,7 @@ var XHRTransport = /** @class */ (function (_super) {
|
|
|
8314
8314
|
});
|
|
8315
8315
|
}
|
|
8316
8316
|
return this._buffer.add(function () {
|
|
8317
|
-
return new
|
|
8317
|
+
return new syncpromise_SyncPromise(function (resolve, reject) {
|
|
8318
8318
|
var request = new XMLHttpRequest();
|
|
8319
8319
|
request.onreadystatechange = function () {
|
|
8320
8320
|
if (request.readyState === 4) {
|
|
@@ -8492,7 +8492,7 @@ var client = new error_tracker_BrowserClient({
|
|
|
8492
8492
|
return event;
|
|
8493
8493
|
},
|
|
8494
8494
|
environment: "production",
|
|
8495
|
-
release: "
|
|
8495
|
+
release: "b927fbc53de55016366277a4933b82a271d7aa9b",
|
|
8496
8496
|
sampleRate: 0.25,
|
|
8497
8497
|
autoSessionTracking: false,
|
|
8498
8498
|
// Integrations don't seem to work with Sentry: https://github.com/getsentry/sentry-javascript/issues/2541
|
|
@@ -8778,7 +8778,6 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !(c
|
|
|
8778
8778
|
|
|
8779
8779
|
|
|
8780
8780
|
|
|
8781
|
-
|
|
8782
8781
|
/**
|
|
8783
8782
|
* Frame Channel: Used for postMessage communication between iFrames.
|
|
8784
8783
|
* NOTE: iFrames must have the same domain - when postMessages are sent between
|
|
@@ -8843,7 +8842,6 @@ var FC = /*#__PURE__*/function (_Channel) {
|
|
|
8843
8842
|
parsedData = JSON.parse(event.data);
|
|
8844
8843
|
}
|
|
8845
8844
|
} catch (_unused) {
|
|
8846
|
-
(0,errors/* warn */.Z)("postMessage not sent as JSON.");
|
|
8847
8845
|
return;
|
|
8848
8846
|
}
|
|
8849
8847
|
|
|
@@ -8868,7 +8866,7 @@ var FC = /*#__PURE__*/function (_Channel) {
|
|
|
8868
8866
|
key: "constructObjectToSend",
|
|
8869
8867
|
value: function constructObjectToSend() {
|
|
8870
8868
|
var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
8871
|
-
var payload = arguments.length > 1
|
|
8869
|
+
var payload = arguments.length > 1 ? arguments[1] : undefined;
|
|
8872
8870
|
var id = arguments.length > 2 ? arguments[2] : undefined;
|
|
8873
8871
|
var status = arguments.length > 3 ? arguments[3] : undefined;
|
|
8874
8872
|
// IE passes event message data as a string, so we normalize to string for all objects
|
|
@@ -9023,7 +9021,7 @@ var CE = /*#__PURE__*/function (_Channel) {
|
|
|
9023
9021
|
// (for all browsers)
|
|
9024
9022
|
return {
|
|
9025
9023
|
type: type || "",
|
|
9026
|
-
payload: payload
|
|
9024
|
+
payload: payload,
|
|
9027
9025
|
id: id,
|
|
9028
9026
|
status: status
|
|
9029
9027
|
};
|
|
@@ -9178,7 +9176,7 @@ function getEmbedURL(_ref) {
|
|
|
9178
9176
|
polyfillVersionString = "legacy";
|
|
9179
9177
|
}
|
|
9180
9178
|
|
|
9181
|
-
return concat_default()(_context5 = concat_default()(_context6 = concat_default()(_context7 = "".concat(host, "/embed/")).call(_context7, polyfillVersionString, "/")).call(_context6, frameName, "/")).call(_context5, "
|
|
9179
|
+
return concat_default()(_context5 = concat_default()(_context6 = concat_default()(_context7 = "".concat(host, "/embed/")).call(_context7, polyfillVersionString, "/")).call(_context6, frameName, "/")).call(_context5, "b927fbc", "/index.html");
|
|
9182
9180
|
}
|
|
9183
9181
|
/**
|
|
9184
9182
|
* Generate the Chat / API URL
|
|
@@ -9215,18 +9213,26 @@ function getURL(_ref2) {
|
|
|
9215
9213
|
}
|
|
9216
9214
|
|
|
9217
9215
|
if (includes_default()(_context17 = window.location.hostname).call(_context17, "localhost") || handle === "e2ereference") {
|
|
9218
|
-
var _context18,
|
|
9216
|
+
var _context18, _context23, _context24, _context25;
|
|
9219
9217
|
|
|
9220
9218
|
var host = window.location.hostname;
|
|
9221
9219
|
var domainName = includes_default()(_context18 = window.location.hostname).call(_context18, "localhost") ? "localhost" : "e2ereference";
|
|
9222
9220
|
|
|
9221
|
+
if (domainName === "localhost" && name === "chat") {
|
|
9222
|
+
var _context19, _context20, _context21, _context22;
|
|
9223
|
+
|
|
9224
|
+
// Chat should be on a different domain (even though the port is different).
|
|
9225
|
+
// We need this to test Embed+Chat behaviour when third-party cookies are disabled (incognito mode).
|
|
9226
|
+
return concat_default()(_context19 = concat_default()(_context20 = concat_default()(_context21 = concat_default()(_context22 = "".concat(window.location.protocol, "//")).call(_context22, handle, ".chat:8002/")).call(_context21, routeString)).call(_context20, questionSym)).call(_context19, queryString);
|
|
9227
|
+
}
|
|
9228
|
+
|
|
9223
9229
|
if (name === "api" || name === "chat") {
|
|
9224
9230
|
host += ":".concat(ports[domainName][name]);
|
|
9225
9231
|
} else {
|
|
9226
9232
|
host += ":".concat(ports[domainName].default);
|
|
9227
9233
|
}
|
|
9228
9234
|
|
|
9229
|
-
return concat_default()(
|
|
9235
|
+
return concat_default()(_context23 = concat_default()(_context24 = concat_default()(_context25 = "http://".concat(host, "/")).call(_context25, routeString)).call(_context24, questionSym)).call(_context23, queryString);
|
|
9230
9236
|
}
|
|
9231
9237
|
|
|
9232
9238
|
return prodUrl;
|
|
@@ -9319,165 +9325,839 @@ var actions = {
|
|
|
9319
9325
|
}
|
|
9320
9326
|
};
|
|
9321
9327
|
/* harmony default export */ var store_actions = (actions);
|
|
9322
|
-
;// CONCATENATED MODULE: ./src/
|
|
9328
|
+
;// CONCATENATED MODULE: ./src/common/constants/storage-keys.ts
|
|
9329
|
+
var CHATTER_TOKEN_STORAGE_KEY = "chatter";
|
|
9330
|
+
var CHATTER_CREATED_STORAGE_KEY = "ada-embed_chatter-created";
|
|
9331
|
+
var IN_LIVE_CHAT_STORAGE_KEY = "inLiveChat";
|
|
9332
|
+
var ZD_SESSION_STORAGE_KEY = "ada-embed_zd-session-id";
|
|
9333
|
+
var ZD_PREVIOUS_TAGS_STORAGE_KEY = "ada-embed_zd-previous-tags";
|
|
9334
|
+
/** @deprecated - Use CHATTER_TOKEN_STORAGE_KEY */
|
|
9323
9335
|
|
|
9336
|
+
var CHATTER_STORAGE_KEY = CHATTER_TOKEN_STORAGE_KEY;
|
|
9337
|
+
;// CONCATENATED MODULE: ./src/frames/lib/frame-fc.ts
|
|
9324
9338
|
|
|
9339
|
+
var frameName = null;
|
|
9340
|
+
/* harmony default export */ var frame_fc = (new FC(frameName, window.parent));
|
|
9341
|
+
;// CONCATENATED MODULE: ./src/frames/helpers/frame-init.ts
|
|
9325
9342
|
|
|
9326
9343
|
|
|
9327
9344
|
|
|
9328
9345
|
|
|
9346
|
+
function initializeFrame() {
|
|
9347
|
+
var waitForOtherFrames = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
9348
|
+
var initialState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
9329
9349
|
|
|
9350
|
+
if (!waitForOtherFrames) {
|
|
9351
|
+
return promise_default().resolve(true);
|
|
9352
|
+
}
|
|
9330
9353
|
|
|
9331
|
-
|
|
9354
|
+
return new (promise_default())(function (resolve) {
|
|
9355
|
+
var timeout;
|
|
9356
|
+
var handlerRef;
|
|
9357
|
+
|
|
9358
|
+
var initMessageHandler = function initMessageHandler(type) {
|
|
9359
|
+
if (type === ALL_FRAMES_LOADED) {
|
|
9360
|
+
frame_fc.removeEventListener(handlerRef);
|
|
9361
|
+
clearTimeout(timeout);
|
|
9362
|
+
resolve(true);
|
|
9363
|
+
}
|
|
9364
|
+
};
|
|
9332
9365
|
|
|
9333
|
-
|
|
9366
|
+
timeout = window.setTimeout(function () {
|
|
9367
|
+
frame_fc.removeEventListener(handlerRef);
|
|
9368
|
+
(0,errors/* warn */.Z)("".concat(null, " frame never received all frames loaded"));
|
|
9369
|
+
resolve(false);
|
|
9370
|
+
}, DEFAULT_CONNECTION_TIMEOUT);
|
|
9371
|
+
handlerRef = frame_fc.addEventListener(initMessageHandler);
|
|
9372
|
+
frame_fc.postMessage("".concat(null, "_INIT"), initialState);
|
|
9373
|
+
});
|
|
9374
|
+
}
|
|
9375
|
+
function addCustomStyles(styles, hasUICustomization) {
|
|
9376
|
+
if (!styles) {
|
|
9377
|
+
return;
|
|
9378
|
+
}
|
|
9334
9379
|
|
|
9380
|
+
if (!hasUICustomization) {
|
|
9381
|
+
warn("UI Customization is not available in your feature set.");
|
|
9382
|
+
return;
|
|
9383
|
+
}
|
|
9335
9384
|
|
|
9385
|
+
var styleSheet = document.createElement("style");
|
|
9386
|
+
styleSheet.type = "text/css";
|
|
9387
|
+
styleSheet.appendChild(document.createTextNode(styles)); // Append the stylesheet to the head of the document
|
|
9336
9388
|
|
|
9389
|
+
document.head.appendChild(styleSheet);
|
|
9390
|
+
}
|
|
9391
|
+
;// CONCATENATED MODULE: ./src/frames/lib/safe-storage/index.ts
|
|
9337
9392
|
|
|
9338
|
-
var mutations = function mutations(state, action) {
|
|
9339
|
-
switch (action.type) {
|
|
9340
|
-
case ActionTypes.TOGGLE_CHAT_TYPE:
|
|
9341
|
-
{
|
|
9342
|
-
var hasChatOpenedAfterProactiveMessagesShown = state.hasChatOpenedAfterProactiveMessagesShown;
|
|
9343
9393
|
|
|
9344
|
-
if (!state.isDrawerOpen && state.latestCampaignKey && !hasChatOpenedAfterProactiveMessagesShown) {
|
|
9345
|
-
hasChatOpenedAfterProactiveMessagesShown = true;
|
|
9346
|
-
}
|
|
9347
9394
|
|
|
9348
|
-
return _objectSpread(_objectSpread({}, state), {}, {
|
|
9349
|
-
isDrawerOpen: !state.isDrawerOpen,
|
|
9350
|
-
isIntroShown: false,
|
|
9351
|
-
drawerHasBeenOpened: true,
|
|
9352
|
-
unreadMessageCount: 0,
|
|
9353
|
-
hasChatOpenedAfterProactiveMessagesShown: hasChatOpenedAfterProactiveMessagesShown
|
|
9354
|
-
});
|
|
9355
|
-
}
|
|
9356
9395
|
|
|
9357
|
-
case ActionTypes.SET_STATE_TYPE:
|
|
9358
|
-
return _objectSpread(_objectSpread({}, state), action.payload);
|
|
9359
9396
|
|
|
9360
|
-
case ActionTypes.INCREMENT_MESSAGE_COUNT_TYPE:
|
|
9361
|
-
{
|
|
9362
|
-
var messages = action.payload.messages; // Filter out Proactive Messages
|
|
9363
9397
|
|
|
9364
|
-
|
|
9365
|
-
return !message.campaign_key;
|
|
9366
|
-
});
|
|
9398
|
+
var StorageTypes;
|
|
9367
9399
|
|
|
9368
|
-
|
|
9369
|
-
|
|
9370
|
-
|
|
9400
|
+
(function (StorageTypes) {
|
|
9401
|
+
StorageTypes["Local"] = "local";
|
|
9402
|
+
StorageTypes["Session"] = "session";
|
|
9403
|
+
})(StorageTypes || (StorageTypes = {}));
|
|
9404
|
+
|
|
9405
|
+
/**
|
|
9406
|
+
* local and session storage can throw exceptions when trying to access them
|
|
9407
|
+
* from the Window object and third-party cookies are disabled. SafeStorage
|
|
9408
|
+
* wraps common Storage methods in try catch blocks.
|
|
9409
|
+
*/
|
|
9410
|
+
var SafeStorage = /*#__PURE__*/function () {
|
|
9411
|
+
function SafeStorage(storageType) {
|
|
9412
|
+
(0,classCallCheck/* default */.Z)(this, SafeStorage);
|
|
9413
|
+
|
|
9414
|
+
(0,defineProperty/* default */.Z)(this, "storageType", void 0);
|
|
9415
|
+
|
|
9416
|
+
(0,defineProperty/* default */.Z)(this, "storage", null);
|
|
9417
|
+
|
|
9418
|
+
this.storageType = storageType;
|
|
9419
|
+
|
|
9420
|
+
try {
|
|
9421
|
+
this.storage = storageType === "local" ? window.localStorage : window.sessionStorage;
|
|
9422
|
+
} catch (e) {
|
|
9423
|
+
(0,errors/* warn */.Z)("".concat(this.storageType, "Storage is disabled. This is likely because your browser is blocking third-party cookies."));
|
|
9424
|
+
}
|
|
9425
|
+
} // eslint-disable-next-line class-methods-use-this
|
|
9426
|
+
|
|
9427
|
+
|
|
9428
|
+
_createClass(SafeStorage, [{
|
|
9429
|
+
key: "seralizeItem",
|
|
9430
|
+
value: function seralizeItem(value) {
|
|
9431
|
+
try {
|
|
9432
|
+
return stringify_default()(value);
|
|
9433
|
+
} catch (error) {
|
|
9434
|
+
(0,errors/* warn */.Z)("Attempt to seralize failed: ".concat(error));
|
|
9371
9435
|
}
|
|
9372
9436
|
|
|
9373
|
-
|
|
9374
|
-
|
|
9375
|
-
var newConnections = _objectSpread(_objectSpread({}, state.connections), action.payload);
|
|
9437
|
+
return null;
|
|
9438
|
+
} // eslint-disable-next-line class-methods-use-this
|
|
9376
9439
|
|
|
9377
|
-
|
|
9440
|
+
}, {
|
|
9441
|
+
key: "deserializeItem",
|
|
9442
|
+
value: function deserializeItem(value) {
|
|
9443
|
+
try {
|
|
9444
|
+
return JSON.parse(value);
|
|
9445
|
+
} catch (error) {
|
|
9446
|
+
(0,errors/* warn */.Z)("Attempt to deserialize failed: ".concat(error));
|
|
9447
|
+
}
|
|
9378
9448
|
|
|
9379
|
-
|
|
9380
|
-
|
|
9381
|
-
|
|
9382
|
-
|
|
9383
|
-
|
|
9384
|
-
|
|
9385
|
-
|
|
9386
|
-
|
|
9387
|
-
|
|
9388
|
-
});
|
|
9449
|
+
return null;
|
|
9450
|
+
}
|
|
9451
|
+
}, {
|
|
9452
|
+
key: "getItem",
|
|
9453
|
+
value: function getItem(key) {
|
|
9454
|
+
try {
|
|
9455
|
+
if (!this.storage) {
|
|
9456
|
+
throw new errors/* AdaEmbedError */.S("`storage` is null");
|
|
9457
|
+
}
|
|
9389
9458
|
|
|
9390
|
-
|
|
9391
|
-
|
|
9392
|
-
|
|
9393
|
-
|
|
9394
|
-
|
|
9395
|
-
|
|
9396
|
-
|
|
9397
|
-
|
|
9459
|
+
return this.deserializeItem(this.storage.getItem(key));
|
|
9460
|
+
} catch (e) {
|
|
9461
|
+
(0,errors/* warn */.Z)("Cannot getItem from ".concat(this.storageType, "Storage."));
|
|
9462
|
+
return null;
|
|
9463
|
+
}
|
|
9464
|
+
}
|
|
9465
|
+
}, {
|
|
9466
|
+
key: "setItem",
|
|
9467
|
+
value: function setItem(key, value) {
|
|
9468
|
+
try {
|
|
9469
|
+
if (!this.storage) {
|
|
9470
|
+
throw new errors/* AdaEmbedError */.S("`storage` is null");
|
|
9398
9471
|
}
|
|
9399
9472
|
|
|
9400
|
-
|
|
9401
|
-
|
|
9402
|
-
|
|
9403
|
-
});
|
|
9473
|
+
this.storage.setItem(key, this.seralizeItem(value));
|
|
9474
|
+
} catch (e) {
|
|
9475
|
+
(0,errors/* warn */.Z)("Cannot setItem in ".concat(this.storageType, "Storage."));
|
|
9404
9476
|
}
|
|
9477
|
+
}
|
|
9478
|
+
}, {
|
|
9479
|
+
key: "removeItem",
|
|
9480
|
+
value: function removeItem(key) {
|
|
9481
|
+
try {
|
|
9482
|
+
if (!this.storage) {
|
|
9483
|
+
throw new errors/* AdaEmbedError */.S("`storage` is null");
|
|
9484
|
+
}
|
|
9405
9485
|
|
|
9406
|
-
|
|
9407
|
-
|
|
9408
|
-
|
|
9409
|
-
}
|
|
9486
|
+
this.storage.removeItem(key);
|
|
9487
|
+
} catch (e) {
|
|
9488
|
+
(0,errors/* warn */.Z)("Cannot removeItem from ".concat(this.storageType, "Storage."));
|
|
9489
|
+
}
|
|
9490
|
+
}
|
|
9491
|
+
}]);
|
|
9410
9492
|
|
|
9411
|
-
|
|
9412
|
-
|
|
9413
|
-
var
|
|
9414
|
-
|
|
9415
|
-
|
|
9416
|
-
return false;
|
|
9417
|
-
}
|
|
9493
|
+
return SafeStorage;
|
|
9494
|
+
}();
|
|
9495
|
+
var safeLocalStorage = new SafeStorage(StorageTypes.Local);
|
|
9496
|
+
var safeSessionStorage = new SafeStorage(StorageTypes.Session);
|
|
9497
|
+
;// CONCATENATED MODULE: ./src/frames/helpers/storage/index.ts
|
|
9418
9498
|
|
|
9419
|
-
|
|
9420
|
-
|
|
9421
|
-
|
|
9422
|
-
|
|
9423
|
-
|
|
9424
|
-
|
|
9499
|
+
var PERSISTENCE_NORMAL = "normal";
|
|
9500
|
+
var PERSISTENCE_SESSION = "session";
|
|
9501
|
+
/**
|
|
9502
|
+
* Retrieves items from local or session storage, depending on the client's
|
|
9503
|
+
* persistence setting. If privateMode is set, it returns null.
|
|
9504
|
+
*/
|
|
9425
9505
|
|
|
9426
|
-
|
|
9427
|
-
|
|
9428
|
-
|
|
9429
|
-
if (
|
|
9506
|
+
function retrieveStorage(key, client, privateMode) {
|
|
9507
|
+
var persistence = client.persistence;
|
|
9508
|
+
|
|
9509
|
+
if (privateMode) {
|
|
9430
9510
|
return null;
|
|
9431
9511
|
}
|
|
9432
9512
|
|
|
9433
|
-
|
|
9434
|
-
|
|
9435
|
-
|
|
9436
|
-
if (onClickHandler) {
|
|
9437
|
-
onClickHandler();
|
|
9438
|
-
}
|
|
9513
|
+
if (persistence === PERSISTENCE_NORMAL) {
|
|
9514
|
+
return safeLocalStorage.getItem(key);
|
|
9515
|
+
}
|
|
9439
9516
|
|
|
9440
|
-
|
|
9441
|
-
|
|
9517
|
+
if (persistence === PERSISTENCE_SESSION) {
|
|
9518
|
+
return safeSessionStorage.getItem(key);
|
|
9519
|
+
}
|
|
9442
9520
|
|
|
9443
|
-
return
|
|
9521
|
+
return null;
|
|
9444
9522
|
}
|
|
9523
|
+
;// CONCATENATED MODULE: ./src/frames/lib/store-proxy.ts
|
|
9445
9524
|
|
|
9446
|
-
|
|
9447
|
-
|
|
9448
|
-
|
|
9525
|
+
|
|
9526
|
+
var store = {
|
|
9527
|
+
get: function get(key) {
|
|
9528
|
+
return frame_fc.fetch(GET_EVENT, GET_RESPONSE_EVENT, {
|
|
9529
|
+
key: key
|
|
9530
|
+
});
|
|
9531
|
+
},
|
|
9532
|
+
getState: function getState() {
|
|
9533
|
+
return frame_fc.fetch(GET_STATE_EVENT, GET_STATE_RESPONSE_EVENT);
|
|
9534
|
+
},
|
|
9535
|
+
dispatch: function dispatch(actionKey, payload) {
|
|
9536
|
+
return frame_fc.fetch(DISPATCH_EVENT, DISPATCH_RESPONSE_EVENT, {
|
|
9537
|
+
actionKey: actionKey,
|
|
9538
|
+
payload: payload
|
|
9539
|
+
});
|
|
9540
|
+
},
|
|
9541
|
+
subscribe: function subscribe(callback) {
|
|
9542
|
+
frame_fc.addEventListener(function (type, payload) {
|
|
9543
|
+
if (type === STATE_CHANGE_EVENT) {
|
|
9544
|
+
callback(payload);
|
|
9545
|
+
}
|
|
9546
|
+
});
|
|
9449
9547
|
}
|
|
9548
|
+
};
|
|
9549
|
+
;// CONCATENATED MODULE: ./node_modules/@sentry/core/esm/sdk.js
|
|
9550
|
+
|
|
9450
9551
|
|
|
9451
|
-
return "default";
|
|
9452
|
-
}
|
|
9453
9552
|
/**
|
|
9454
|
-
*
|
|
9553
|
+
* Internal function to create a new SDK client instance. The client is
|
|
9554
|
+
* installed and then bound to the current scope.
|
|
9555
|
+
*
|
|
9556
|
+
* @param clientClass The client class to instantiate.
|
|
9557
|
+
* @param options Options to pass to the client.
|
|
9455
9558
|
*/
|
|
9559
|
+
function initAndBind(clientClass, options) {
|
|
9560
|
+
var _a;
|
|
9561
|
+
if (options.debug === true) {
|
|
9562
|
+
logger_logger.enable();
|
|
9563
|
+
}
|
|
9564
|
+
var hub = hub_getCurrentHub();
|
|
9565
|
+
(_a = hub.getScope()) === null || _a === void 0 ? void 0 : _a.update(options.initialScope);
|
|
9566
|
+
var client = new clientClass(options);
|
|
9567
|
+
hub.bindClient(client);
|
|
9568
|
+
}
|
|
9569
|
+
//# sourceMappingURL=sdk.js.map
|
|
9570
|
+
;// CONCATENATED MODULE: ./node_modules/@sentry/browser/esm/sdk.js
|
|
9456
9571
|
|
|
9457
9572
|
|
|
9458
|
-
function notificationPermListener(notificationPermChangeHandler) {
|
|
9459
|
-
if (!("permissions" in navigator)) {
|
|
9460
|
-
return;
|
|
9461
|
-
}
|
|
9462
9573
|
|
|
9463
|
-
navigator.permissions.query({
|
|
9464
|
-
name: "notifications"
|
|
9465
|
-
}).then(function (notificationPerm) {
|
|
9466
|
-
// eslint-disable-next-line no-param-reassign
|
|
9467
|
-
notificationPerm.onchange = function () {
|
|
9468
|
-
notificationPermChangeHandler(notificationPermissionGuard(notificationPerm.state));
|
|
9469
|
-
};
|
|
9470
|
-
});
|
|
9471
|
-
}
|
|
9472
|
-
;// CONCATENATED MODULE: ./src/client/store/state.ts
|
|
9473
9574
|
|
|
9474
9575
|
|
|
9475
|
-
|
|
9476
|
-
|
|
9477
|
-
|
|
9478
|
-
|
|
9479
|
-
|
|
9480
|
-
|
|
9576
|
+
|
|
9577
|
+
var defaultIntegrations = [
|
|
9578
|
+
new InboundFilters(),
|
|
9579
|
+
new FunctionToString(),
|
|
9580
|
+
new TryCatch(),
|
|
9581
|
+
new Breadcrumbs(),
|
|
9582
|
+
new GlobalHandlers(),
|
|
9583
|
+
new LinkedErrors(),
|
|
9584
|
+
new Dedupe(),
|
|
9585
|
+
new UserAgent(),
|
|
9586
|
+
];
|
|
9587
|
+
/**
|
|
9588
|
+
* The Sentry Browser SDK Client.
|
|
9589
|
+
*
|
|
9590
|
+
* To use this SDK, call the {@link init} function as early as possible when
|
|
9591
|
+
* loading the web page. To set context information or send manual events, use
|
|
9592
|
+
* the provided methods.
|
|
9593
|
+
*
|
|
9594
|
+
* @example
|
|
9595
|
+
*
|
|
9596
|
+
* ```
|
|
9597
|
+
*
|
|
9598
|
+
* import { init } from '@sentry/browser';
|
|
9599
|
+
*
|
|
9600
|
+
* init({
|
|
9601
|
+
* dsn: '__DSN__',
|
|
9602
|
+
* // ...
|
|
9603
|
+
* });
|
|
9604
|
+
* ```
|
|
9605
|
+
*
|
|
9606
|
+
* @example
|
|
9607
|
+
* ```
|
|
9608
|
+
*
|
|
9609
|
+
* import { configureScope } from '@sentry/browser';
|
|
9610
|
+
* configureScope((scope: Scope) => {
|
|
9611
|
+
* scope.setExtra({ battery: 0.7 });
|
|
9612
|
+
* scope.setTag({ user_mode: 'admin' });
|
|
9613
|
+
* scope.setUser({ id: '4711' });
|
|
9614
|
+
* });
|
|
9615
|
+
* ```
|
|
9616
|
+
*
|
|
9617
|
+
* @example
|
|
9618
|
+
* ```
|
|
9619
|
+
*
|
|
9620
|
+
* import { addBreadcrumb } from '@sentry/browser';
|
|
9621
|
+
* addBreadcrumb({
|
|
9622
|
+
* message: 'My Breadcrumb',
|
|
9623
|
+
* // ...
|
|
9624
|
+
* });
|
|
9625
|
+
* ```
|
|
9626
|
+
*
|
|
9627
|
+
* @example
|
|
9628
|
+
*
|
|
9629
|
+
* ```
|
|
9630
|
+
*
|
|
9631
|
+
* import * as Sentry from '@sentry/browser';
|
|
9632
|
+
* Sentry.captureMessage('Hello, world!');
|
|
9633
|
+
* Sentry.captureException(new Error('Good bye'));
|
|
9634
|
+
* Sentry.captureEvent({
|
|
9635
|
+
* message: 'Manual',
|
|
9636
|
+
* stacktrace: [
|
|
9637
|
+
* // ...
|
|
9638
|
+
* ],
|
|
9639
|
+
* });
|
|
9640
|
+
* ```
|
|
9641
|
+
*
|
|
9642
|
+
* @see {@link BrowserOptions} for documentation on configuration options.
|
|
9643
|
+
*/
|
|
9644
|
+
function init(options) {
|
|
9645
|
+
if (options === void 0) { options = {}; }
|
|
9646
|
+
if (options.defaultIntegrations === undefined) {
|
|
9647
|
+
options.defaultIntegrations = defaultIntegrations;
|
|
9648
|
+
}
|
|
9649
|
+
if (options.release === undefined) {
|
|
9650
|
+
var window_1 = (0,misc/* getGlobalObject */.Rf)();
|
|
9651
|
+
// This supports the variable that sentry-webpack-plugin injects
|
|
9652
|
+
if (window_1.SENTRY_RELEASE && window_1.SENTRY_RELEASE.id) {
|
|
9653
|
+
options.release = window_1.SENTRY_RELEASE.id;
|
|
9654
|
+
}
|
|
9655
|
+
}
|
|
9656
|
+
if (options.autoSessionTracking === undefined) {
|
|
9657
|
+
options.autoSessionTracking = true;
|
|
9658
|
+
}
|
|
9659
|
+
initAndBind(BrowserClient, options);
|
|
9660
|
+
if (options.autoSessionTracking) {
|
|
9661
|
+
startSessionTracking();
|
|
9662
|
+
}
|
|
9663
|
+
}
|
|
9664
|
+
/**
|
|
9665
|
+
* Present the user with a report dialog.
|
|
9666
|
+
*
|
|
9667
|
+
* @param options Everything is optional, we try to fetch all info need from the global scope.
|
|
9668
|
+
*/
|
|
9669
|
+
function showReportDialog(options) {
|
|
9670
|
+
if (options === void 0) { options = {}; }
|
|
9671
|
+
var hub = getCurrentHub();
|
|
9672
|
+
var scope = hub.getScope();
|
|
9673
|
+
if (scope) {
|
|
9674
|
+
options.user = __assign(__assign({}, scope.getUser()), options.user);
|
|
9675
|
+
}
|
|
9676
|
+
if (!options.eventId) {
|
|
9677
|
+
options.eventId = hub.lastEventId();
|
|
9678
|
+
}
|
|
9679
|
+
var client = hub.getClient();
|
|
9680
|
+
if (client) {
|
|
9681
|
+
client.showReportDialog(options);
|
|
9682
|
+
}
|
|
9683
|
+
}
|
|
9684
|
+
/**
|
|
9685
|
+
* This is the getter for lastEventId.
|
|
9686
|
+
*
|
|
9687
|
+
* @returns The last event id of a captured event.
|
|
9688
|
+
*/
|
|
9689
|
+
function lastEventId() {
|
|
9690
|
+
return getCurrentHub().lastEventId();
|
|
9691
|
+
}
|
|
9692
|
+
/**
|
|
9693
|
+
* This function is here to be API compatible with the loader.
|
|
9694
|
+
* @hidden
|
|
9695
|
+
*/
|
|
9696
|
+
function forceLoad() {
|
|
9697
|
+
// Noop
|
|
9698
|
+
}
|
|
9699
|
+
/**
|
|
9700
|
+
* This function is here to be API compatible with the loader.
|
|
9701
|
+
* @hidden
|
|
9702
|
+
*/
|
|
9703
|
+
function onLoad(callback) {
|
|
9704
|
+
callback();
|
|
9705
|
+
}
|
|
9706
|
+
/**
|
|
9707
|
+
* Call `flush()` on the current client, if there is one. See {@link Client.flush}.
|
|
9708
|
+
*
|
|
9709
|
+
* @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause
|
|
9710
|
+
* the client to wait until all events are sent before resolving the promise.
|
|
9711
|
+
* @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it
|
|
9712
|
+
* doesn't (or if there's no client defined).
|
|
9713
|
+
*/
|
|
9714
|
+
function flush(timeout) {
|
|
9715
|
+
var client = getCurrentHub().getClient();
|
|
9716
|
+
if (client) {
|
|
9717
|
+
return client.flush(timeout);
|
|
9718
|
+
}
|
|
9719
|
+
logger.warn('Cannot flush events. No client defined.');
|
|
9720
|
+
return SyncPromise.resolve(false);
|
|
9721
|
+
}
|
|
9722
|
+
/**
|
|
9723
|
+
* Call `close()` on the current client, if there is one. See {@link Client.close}.
|
|
9724
|
+
*
|
|
9725
|
+
* @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this
|
|
9726
|
+
* parameter will cause the client to wait until all events are sent before disabling itself.
|
|
9727
|
+
* @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it
|
|
9728
|
+
* doesn't (or if there's no client defined).
|
|
9729
|
+
*/
|
|
9730
|
+
function sdk_close(timeout) {
|
|
9731
|
+
var client = getCurrentHub().getClient();
|
|
9732
|
+
if (client) {
|
|
9733
|
+
return client.close(timeout);
|
|
9734
|
+
}
|
|
9735
|
+
logger.warn('Cannot flush events and disable SDK. No client defined.');
|
|
9736
|
+
return SyncPromise.resolve(false);
|
|
9737
|
+
}
|
|
9738
|
+
/**
|
|
9739
|
+
* Wrap code within a try/catch block so the SDK is able to capture errors.
|
|
9740
|
+
*
|
|
9741
|
+
* @param fn A function to wrap.
|
|
9742
|
+
*
|
|
9743
|
+
* @returns The result of wrapped function call.
|
|
9744
|
+
*/
|
|
9745
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9746
|
+
function sdk_wrap(fn) {
|
|
9747
|
+
return internalWrap(fn)();
|
|
9748
|
+
}
|
|
9749
|
+
/**
|
|
9750
|
+
* Enable automatic Session Tracking for the initial page load.
|
|
9751
|
+
*/
|
|
9752
|
+
function startSessionTracking() {
|
|
9753
|
+
var window = (0,misc/* getGlobalObject */.Rf)();
|
|
9754
|
+
var document = window.document;
|
|
9755
|
+
if (typeof document === 'undefined') {
|
|
9756
|
+
logger_logger.warn('Session tracking in non-browser environment with @sentry/browser is not supported.');
|
|
9757
|
+
return;
|
|
9758
|
+
}
|
|
9759
|
+
var hub = hub_getCurrentHub();
|
|
9760
|
+
// The only way for this to be false is for there to be a version mismatch between @sentry/browser (>= 6.0.0) and
|
|
9761
|
+
// @sentry/hub (< 5.27.0). In the simple case, there won't ever be such a mismatch, because the two packages are
|
|
9762
|
+
// pinned at the same version in package.json, but there are edge cases where it's possible. See
|
|
9763
|
+
// https://github.com/getsentry/sentry-javascript/issues/3207 and
|
|
9764
|
+
// https://github.com/getsentry/sentry-javascript/issues/3234 and
|
|
9765
|
+
// https://github.com/getsentry/sentry-javascript/issues/3278.
|
|
9766
|
+
if (typeof hub.startSession !== 'function' || typeof hub.captureSession !== 'function') {
|
|
9767
|
+
return;
|
|
9768
|
+
}
|
|
9769
|
+
// The session duration for browser sessions does not track a meaningful
|
|
9770
|
+
// concept that can be used as a metric.
|
|
9771
|
+
// Automatically captured sessions are akin to page views, and thus we
|
|
9772
|
+
// discard their duration.
|
|
9773
|
+
hub.startSession({ ignoreDuration: true });
|
|
9774
|
+
hub.captureSession();
|
|
9775
|
+
// We want to create a session for every navigation as well
|
|
9776
|
+
addInstrumentationHandler({
|
|
9777
|
+
callback: function (_a) {
|
|
9778
|
+
var from = _a.from, to = _a.to;
|
|
9779
|
+
// Don't create an additional session for the initial route or if the location did not change
|
|
9780
|
+
if (from === undefined || from === to) {
|
|
9781
|
+
return;
|
|
9782
|
+
}
|
|
9783
|
+
hub.startSession({ ignoreDuration: true });
|
|
9784
|
+
hub.captureSession();
|
|
9785
|
+
},
|
|
9786
|
+
type: 'history',
|
|
9787
|
+
});
|
|
9788
|
+
}
|
|
9789
|
+
//# sourceMappingURL=sdk.js.map
|
|
9790
|
+
;// CONCATENATED MODULE: ./src/frames/lib/error-tracker.ts
|
|
9791
|
+
var _window$location$host;
|
|
9792
|
+
|
|
9793
|
+
|
|
9794
|
+
|
|
9795
|
+
var IGNORED_ERRORS = [// This error most likely comes from a browser extension
|
|
9796
|
+
/ceCurrentVideo\.currentTime/];
|
|
9797
|
+
init({
|
|
9798
|
+
dsn: null,
|
|
9799
|
+
environment: "production",
|
|
9800
|
+
release: "b927fbc53de55016366277a4933b82a271d7aa9b",
|
|
9801
|
+
ignoreErrors: IGNORED_ERRORS,
|
|
9802
|
+
tracesSampleRate: 0.1,
|
|
9803
|
+
autoSessionTracking: false
|
|
9804
|
+
});
|
|
9805
|
+
setTag("client", (_window$location$host = window.location.hostname) === null || _window$location$host === void 0 ? void 0 : _window$location$host.split(".")[0]);
|
|
9806
|
+
setTag("Embed2 Component", null);
|
|
9807
|
+
var error_tracker_errorTracker = {
|
|
9808
|
+
trackException: function trackException(error) {
|
|
9809
|
+
(0,errors/* warn */.Z)(error.message);
|
|
9810
|
+
captureException(error);
|
|
9811
|
+
},
|
|
9812
|
+
addBreadCrumb: function addBreadCrumb(category, message, data) {
|
|
9813
|
+
var level = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Severity.Info;
|
|
9814
|
+
addBreadcrumb({
|
|
9815
|
+
category: category,
|
|
9816
|
+
message: message,
|
|
9817
|
+
data: data,
|
|
9818
|
+
level: level
|
|
9819
|
+
});
|
|
9820
|
+
}
|
|
9821
|
+
};
|
|
9822
|
+
/* harmony default export */ var lib_error_tracker = ((/* unused pure expression or super */ null && (error_tracker_errorTracker)));
|
|
9823
|
+
;// CONCATENATED MODULE: ./src/frames/components/x-storage/index.ts
|
|
9824
|
+
|
|
9825
|
+
|
|
9826
|
+
|
|
9827
|
+
|
|
9828
|
+
|
|
9829
|
+
|
|
9830
|
+
|
|
9831
|
+
|
|
9832
|
+
|
|
9833
|
+
|
|
9834
|
+
|
|
9835
|
+
var LIVE_CHAT_PENDING_STORAGE_KEY = "liveChatPending";
|
|
9836
|
+
var IS_DRAWER_OPEN_STORAGE_KEY = "ada-embed_is-drawer-open";
|
|
9837
|
+
var lastDrawerState;
|
|
9838
|
+
/**
|
|
9839
|
+
* NOTE: If you import this file into any other file
|
|
9840
|
+
* it will trigger the init() function below - may cause errors!
|
|
9841
|
+
*/
|
|
9842
|
+
|
|
9843
|
+
/**
|
|
9844
|
+
* Auto-opens the chat door if crossWindowPersistence is one, the chatter is in
|
|
9845
|
+
* a live chat, and if the drawer was previously opened.
|
|
9846
|
+
*/
|
|
9847
|
+
|
|
9848
|
+
function setIsDrawerOpen() {
|
|
9849
|
+
return _setIsDrawerOpen.apply(this, arguments);
|
|
9850
|
+
}
|
|
9851
|
+
/**
|
|
9852
|
+
* Retrieves the chatter token from storage.
|
|
9853
|
+
*/
|
|
9854
|
+
|
|
9855
|
+
function _setIsDrawerOpen() {
|
|
9856
|
+
_setIsDrawerOpen = (0,asyncToGenerator/* default */.Z)( /*#__PURE__*/regenerator_default().mark(function _callee2() {
|
|
9857
|
+
var _yield$store$getState, crossWindowPersistence, client, privateMode, isDrawerOpen, liveChatPending, inLiveChat, liveChatActive;
|
|
9858
|
+
|
|
9859
|
+
return regenerator_default().wrap(function _callee2$(_context2) {
|
|
9860
|
+
while (1) {
|
|
9861
|
+
switch (_context2.prev = _context2.next) {
|
|
9862
|
+
case 0:
|
|
9863
|
+
_context2.next = 2;
|
|
9864
|
+
return store.getState();
|
|
9865
|
+
|
|
9866
|
+
case 2:
|
|
9867
|
+
_yield$store$getState = _context2.sent;
|
|
9868
|
+
crossWindowPersistence = _yield$store$getState.crossWindowPersistence;
|
|
9869
|
+
client = _yield$store$getState.client;
|
|
9870
|
+
privateMode = _yield$store$getState.privateMode;
|
|
9871
|
+
isDrawerOpen = safeSessionStorage.getItem(IS_DRAWER_OPEN_STORAGE_KEY);
|
|
9872
|
+
liveChatPending = retrieveStorage(LIVE_CHAT_PENDING_STORAGE_KEY, client, privateMode);
|
|
9873
|
+
inLiveChat = retrieveStorage(IN_LIVE_CHAT_STORAGE_KEY, client, privateMode);
|
|
9874
|
+
liveChatActive = inLiveChat || liveChatPending;
|
|
9875
|
+
|
|
9876
|
+
if (crossWindowPersistence && isDrawerOpen && liveChatActive) {
|
|
9877
|
+
store.dispatch(ActionCreators.TOGGLE_CHAT_ACTION);
|
|
9878
|
+
}
|
|
9879
|
+
|
|
9880
|
+
case 11:
|
|
9881
|
+
case "end":
|
|
9882
|
+
return _context2.stop();
|
|
9883
|
+
}
|
|
9884
|
+
}
|
|
9885
|
+
}, _callee2);
|
|
9886
|
+
}));
|
|
9887
|
+
return _setIsDrawerOpen.apply(this, arguments);
|
|
9888
|
+
}
|
|
9889
|
+
|
|
9890
|
+
function getChatterFromStorage() {
|
|
9891
|
+
return _getChatterFromStorage.apply(this, arguments);
|
|
9892
|
+
}
|
|
9893
|
+
/**
|
|
9894
|
+
* Initialization
|
|
9895
|
+
*/
|
|
9896
|
+
|
|
9897
|
+
|
|
9898
|
+
function _getChatterFromStorage() {
|
|
9899
|
+
_getChatterFromStorage = (0,asyncToGenerator/* default */.Z)( /*#__PURE__*/regenerator_default().mark(function _callee3() {
|
|
9900
|
+
var _yield$store$getState2, privateMode, client;
|
|
9901
|
+
|
|
9902
|
+
return regenerator_default().wrap(function _callee3$(_context3) {
|
|
9903
|
+
while (1) {
|
|
9904
|
+
switch (_context3.prev = _context3.next) {
|
|
9905
|
+
case 0:
|
|
9906
|
+
_context3.next = 2;
|
|
9907
|
+
return store.getState();
|
|
9908
|
+
|
|
9909
|
+
case 2:
|
|
9910
|
+
_yield$store$getState2 = _context3.sent;
|
|
9911
|
+
privateMode = _yield$store$getState2.privateMode;
|
|
9912
|
+
client = _yield$store$getState2.client;
|
|
9913
|
+
return _context3.abrupt("return", retrieveStorage(CHATTER_STORAGE_KEY, client, Boolean(privateMode)));
|
|
9914
|
+
|
|
9915
|
+
case 6:
|
|
9916
|
+
case "end":
|
|
9917
|
+
return _context3.stop();
|
|
9918
|
+
}
|
|
9919
|
+
}
|
|
9920
|
+
}, _callee3);
|
|
9921
|
+
}));
|
|
9922
|
+
return _getChatterFromStorage.apply(this, arguments);
|
|
9923
|
+
}
|
|
9924
|
+
|
|
9925
|
+
(0,asyncToGenerator/* default */.Z)( /*#__PURE__*/regenerator_default().mark(function _callee() {
|
|
9926
|
+
var chatterFromStorage, frameInitialized;
|
|
9927
|
+
return regenerator_default().wrap(function _callee$(_context) {
|
|
9928
|
+
while (1) {
|
|
9929
|
+
switch (_context.prev = _context.next) {
|
|
9930
|
+
case 0:
|
|
9931
|
+
_context.next = 2;
|
|
9932
|
+
return getChatterFromStorage();
|
|
9933
|
+
|
|
9934
|
+
case 2:
|
|
9935
|
+
chatterFromStorage = _context.sent;
|
|
9936
|
+
_context.next = 5;
|
|
9937
|
+
return initializeFrame(true, {
|
|
9938
|
+
chatterToken: chatterFromStorage || undefined
|
|
9939
|
+
});
|
|
9940
|
+
|
|
9941
|
+
case 5:
|
|
9942
|
+
frameInitialized = _context.sent;
|
|
9943
|
+
|
|
9944
|
+
if (frameInitialized) {
|
|
9945
|
+
_context.next = 8;
|
|
9946
|
+
break;
|
|
9947
|
+
}
|
|
9948
|
+
|
|
9949
|
+
return _context.abrupt("return");
|
|
9950
|
+
|
|
9951
|
+
case 8:
|
|
9952
|
+
setIsDrawerOpen();
|
|
9953
|
+
/**
|
|
9954
|
+
* Listen for FC events
|
|
9955
|
+
*/
|
|
9956
|
+
|
|
9957
|
+
frame_fc.addEventListener(function (type) {
|
|
9958
|
+
switch (type) {
|
|
9959
|
+
case DELETE_HISTORY_EVENT:
|
|
9960
|
+
{
|
|
9961
|
+
safeLocalStorage.removeItem(CHATTER_STORAGE_KEY);
|
|
9962
|
+
safeSessionStorage.removeItem(CHATTER_STORAGE_KEY);
|
|
9963
|
+
safeLocalStorage.removeItem(IN_LIVE_CHAT_STORAGE_KEY);
|
|
9964
|
+
safeSessionStorage.removeItem(IN_LIVE_CHAT_STORAGE_KEY);
|
|
9965
|
+
break;
|
|
9966
|
+
}
|
|
9967
|
+
|
|
9968
|
+
default:
|
|
9969
|
+
break;
|
|
9970
|
+
}
|
|
9971
|
+
});
|
|
9972
|
+
/**
|
|
9973
|
+
* Listen for store changes
|
|
9974
|
+
*/
|
|
9975
|
+
|
|
9976
|
+
store.subscribe(function (state) {
|
|
9977
|
+
/**
|
|
9978
|
+
* Store isDrawerOpen state in sessionStorage if crossWindowPersistence is enabled
|
|
9979
|
+
*/
|
|
9980
|
+
if (state.isDrawerOpen !== lastDrawerState && state.crossWindowPersistence) {
|
|
9981
|
+
safeSessionStorage.setItem(IS_DRAWER_OPEN_STORAGE_KEY, state.isDrawerOpen);
|
|
9982
|
+
}
|
|
9983
|
+
});
|
|
9984
|
+
|
|
9985
|
+
case 11:
|
|
9986
|
+
case "end":
|
|
9987
|
+
return _context.stop();
|
|
9988
|
+
}
|
|
9989
|
+
}
|
|
9990
|
+
}, _callee);
|
|
9991
|
+
}))();
|
|
9992
|
+
;// CONCATENATED MODULE: ./src/client/store/mutations/index.ts
|
|
9993
|
+
|
|
9994
|
+
|
|
9995
|
+
|
|
9996
|
+
|
|
9997
|
+
|
|
9998
|
+
|
|
9999
|
+
|
|
10000
|
+
|
|
10001
|
+
function ownKeys(object, enumerableOnly) { var keys = keys_default()(object); if ((get_own_property_symbols_default())) { var symbols = get_own_property_symbols_default()(object); if (enumerableOnly) { symbols = filter_default()(symbols).call(symbols, function (sym) { return get_own_property_descriptor_default()(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
10002
|
+
|
|
10003
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0,defineProperty/* default */.Z)(target, key, source[key]); }); } else if ((get_own_property_descriptors_default())) { Object.defineProperties(target, get_own_property_descriptors_default()(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, get_own_property_descriptor_default()(source, key)); }); } } return target; }
|
|
10004
|
+
|
|
10005
|
+
|
|
10006
|
+
|
|
10007
|
+
|
|
10008
|
+
|
|
10009
|
+
|
|
10010
|
+
var mutations = function mutations(state, action) {
|
|
10011
|
+
switch (action.type) {
|
|
10012
|
+
case ActionTypes.TOGGLE_CHAT_TYPE:
|
|
10013
|
+
{
|
|
10014
|
+
var hasChatOpenedAfterProactiveMessagesShown = state.hasChatOpenedAfterProactiveMessagesShown;
|
|
10015
|
+
|
|
10016
|
+
if (!state.isDrawerOpen && state.latestCampaignKey && !hasChatOpenedAfterProactiveMessagesShown) {
|
|
10017
|
+
hasChatOpenedAfterProactiveMessagesShown = true;
|
|
10018
|
+
}
|
|
10019
|
+
|
|
10020
|
+
safeLocalStorage.setItem(IS_DRAWER_OPEN_STORAGE_KEY, !state.isDrawerOpen);
|
|
10021
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
10022
|
+
isDrawerOpen: !state.isDrawerOpen,
|
|
10023
|
+
isIntroShown: false,
|
|
10024
|
+
drawerHasBeenOpened: true,
|
|
10025
|
+
unreadMessageCount: 0,
|
|
10026
|
+
hasChatOpenedAfterProactiveMessagesShown: hasChatOpenedAfterProactiveMessagesShown
|
|
10027
|
+
});
|
|
10028
|
+
}
|
|
10029
|
+
|
|
10030
|
+
case ActionTypes.SET_STATE_TYPE:
|
|
10031
|
+
return _objectSpread(_objectSpread({}, state), action.payload);
|
|
10032
|
+
|
|
10033
|
+
case ActionTypes.INCREMENT_MESSAGE_COUNT_TYPE:
|
|
10034
|
+
{
|
|
10035
|
+
var messages = action.payload.messages; // Filter out Proactive Messages
|
|
10036
|
+
|
|
10037
|
+
var nonProactive = filter_default()(messages).call(messages, function (message) {
|
|
10038
|
+
return !message.campaign_key;
|
|
10039
|
+
});
|
|
10040
|
+
|
|
10041
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
10042
|
+
unreadMessageCount: nonProactive.length
|
|
10043
|
+
});
|
|
10044
|
+
}
|
|
10045
|
+
|
|
10046
|
+
case ActionTypes.SET_CONNECTION_STATE_TYPE:
|
|
10047
|
+
{
|
|
10048
|
+
var newConnections = _objectSpread(_objectSpread({}, state.connections), action.payload);
|
|
10049
|
+
|
|
10050
|
+
var connectionValues = values_default()(newConnections);
|
|
10051
|
+
|
|
10052
|
+
var appConnectionState;
|
|
10053
|
+
var done = connectionValues.every(function (connectionState) {
|
|
10054
|
+
return connectionState === ConnectionState.Done;
|
|
10055
|
+
});
|
|
10056
|
+
var loading = connectionValues.some(function (connectionState) {
|
|
10057
|
+
return connectionState === ConnectionState.Done;
|
|
10058
|
+
});
|
|
10059
|
+
var failure = connectionValues.some(function (connectionState) {
|
|
10060
|
+
return connectionState === ConnectionState.Failure;
|
|
10061
|
+
});
|
|
10062
|
+
|
|
10063
|
+
if (done) {
|
|
10064
|
+
appConnectionState = ConnectionState.Done;
|
|
10065
|
+
} else if (failure) {
|
|
10066
|
+
appConnectionState = ConnectionState.Failure;
|
|
10067
|
+
} else if (loading) {
|
|
10068
|
+
appConnectionState = ConnectionState.Loading;
|
|
10069
|
+
} else {
|
|
10070
|
+
appConnectionState = ConnectionState.Uninitiated;
|
|
10071
|
+
}
|
|
10072
|
+
|
|
10073
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
10074
|
+
connections: newConnections,
|
|
10075
|
+
appConnectionState: appConnectionState
|
|
10076
|
+
});
|
|
10077
|
+
}
|
|
10078
|
+
|
|
10079
|
+
default:
|
|
10080
|
+
return state;
|
|
10081
|
+
}
|
|
10082
|
+
};
|
|
10083
|
+
|
|
10084
|
+
/* harmony default export */ var store_mutations = (mutations);
|
|
10085
|
+
;// CONCATENATED MODULE: ./src/client/helpers/local-notifications/index.ts
|
|
10086
|
+
var browserHasNotificationSupport = ("Notification" in window);
|
|
10087
|
+
function checkIfUserHasGivenPermission() {
|
|
10088
|
+
if (!browserHasNotificationSupport) {
|
|
10089
|
+
return false;
|
|
10090
|
+
}
|
|
10091
|
+
|
|
10092
|
+
return Notification.permission === "granted";
|
|
10093
|
+
}
|
|
10094
|
+
function requestNotificationPermission() {
|
|
10095
|
+
if (!browserHasNotificationSupport) {
|
|
10096
|
+
return null;
|
|
10097
|
+
}
|
|
10098
|
+
|
|
10099
|
+
return Notification.requestPermission();
|
|
10100
|
+
}
|
|
10101
|
+
function createNotification(title, isChatOpen, onClickHandler, options) {
|
|
10102
|
+
if (!checkIfUserHasGivenPermission() || !document.hidden && isChatOpen) {
|
|
10103
|
+
return null;
|
|
10104
|
+
}
|
|
10105
|
+
|
|
10106
|
+
var notification = new Notification(title, options);
|
|
10107
|
+
|
|
10108
|
+
notification.onclick = function () {
|
|
10109
|
+
if (onClickHandler) {
|
|
10110
|
+
onClickHandler();
|
|
10111
|
+
}
|
|
10112
|
+
|
|
10113
|
+
notification.close();
|
|
10114
|
+
};
|
|
10115
|
+
|
|
10116
|
+
return notification;
|
|
10117
|
+
}
|
|
10118
|
+
|
|
10119
|
+
function notificationPermissionGuard(state) {
|
|
10120
|
+
if (state === "granted" || state === "denied") {
|
|
10121
|
+
return state;
|
|
10122
|
+
}
|
|
10123
|
+
|
|
10124
|
+
return "default";
|
|
10125
|
+
}
|
|
10126
|
+
/**
|
|
10127
|
+
* Used to listen for changes in Notification permission state
|
|
10128
|
+
*/
|
|
10129
|
+
|
|
10130
|
+
|
|
10131
|
+
function notificationPermListener(notificationPermChangeHandler) {
|
|
10132
|
+
if (!("permissions" in navigator)) {
|
|
10133
|
+
return;
|
|
10134
|
+
}
|
|
10135
|
+
|
|
10136
|
+
navigator.permissions.query({
|
|
10137
|
+
name: "notifications"
|
|
10138
|
+
}).then(function (notificationPerm) {
|
|
10139
|
+
// eslint-disable-next-line no-param-reassign
|
|
10140
|
+
notificationPerm.onchange = function () {
|
|
10141
|
+
notificationPermChangeHandler(notificationPermissionGuard(notificationPerm.state));
|
|
10142
|
+
};
|
|
10143
|
+
});
|
|
10144
|
+
}
|
|
10145
|
+
;// CONCATENATED MODULE: ./src/client/store/state.ts
|
|
10146
|
+
|
|
10147
|
+
|
|
10148
|
+
|
|
10149
|
+
|
|
10150
|
+
|
|
10151
|
+
function getValueFromStorage(key) {
|
|
10152
|
+
return safeLocalStorage.getItem(key) || safeSessionStorage.getItem(key);
|
|
10153
|
+
}
|
|
10154
|
+
|
|
10155
|
+
var state = {
|
|
10156
|
+
handle: undefined,
|
|
10157
|
+
styles: undefined,
|
|
10158
|
+
domain: undefined,
|
|
10159
|
+
cluster: undefined,
|
|
10160
|
+
language: undefined,
|
|
9481
10161
|
greeting: undefined,
|
|
9482
10162
|
crossWindowPersistence: true,
|
|
9483
10163
|
hideMask: true,
|
|
@@ -9495,7 +10175,10 @@ var state = {
|
|
|
9495
10175
|
initialURL: undefined,
|
|
9496
10176
|
privateMode: false,
|
|
9497
10177
|
rolloutOverride: undefined,
|
|
9498
|
-
chatterToken: undefined,
|
|
10178
|
+
chatterToken: getValueFromStorage(CHATTER_TOKEN_STORAGE_KEY) || undefined,
|
|
10179
|
+
chatterCreated: getValueFromStorage(CHATTER_CREATED_STORAGE_KEY) || undefined,
|
|
10180
|
+
zdSessionId: getValueFromStorage(ZD_SESSION_STORAGE_KEY) || undefined,
|
|
10181
|
+
zdPreviousTags: getValueFromStorage(ZD_PREVIOUS_TAGS_STORAGE_KEY) || undefined,
|
|
9499
10182
|
connections: {},
|
|
9500
10183
|
appConnectionState: ConnectionState.Uninitiated,
|
|
9501
10184
|
testMode: false,
|
|
@@ -9877,111 +10560,6 @@ var get_browser_language_getBrowserLanguage = function getBrowserLanguage() {
|
|
|
9877
10560
|
};
|
|
9878
10561
|
|
|
9879
10562
|
/* harmony default export */ var get_browser_language = (get_browser_language_getBrowserLanguage);
|
|
9880
|
-
;// CONCATENATED MODULE: ./src/frames/lib/safe-storage/index.ts
|
|
9881
|
-
|
|
9882
|
-
|
|
9883
|
-
|
|
9884
|
-
|
|
9885
|
-
|
|
9886
|
-
var StorageTypes;
|
|
9887
|
-
|
|
9888
|
-
(function (StorageTypes) {
|
|
9889
|
-
StorageTypes["Local"] = "local";
|
|
9890
|
-
StorageTypes["Session"] = "session";
|
|
9891
|
-
})(StorageTypes || (StorageTypes = {}));
|
|
9892
|
-
|
|
9893
|
-
/**
|
|
9894
|
-
* local and session storage can throw exceptions when trying to access them
|
|
9895
|
-
* from the Window object and third-party cookies are disabled. SafeStorage
|
|
9896
|
-
* wraps common Storage methods in try catch blocks.
|
|
9897
|
-
*/
|
|
9898
|
-
var SafeStorage = /*#__PURE__*/function () {
|
|
9899
|
-
function SafeStorage(storageType) {
|
|
9900
|
-
(0,classCallCheck/* default */.Z)(this, SafeStorage);
|
|
9901
|
-
|
|
9902
|
-
(0,defineProperty/* default */.Z)(this, "storageType", void 0);
|
|
9903
|
-
|
|
9904
|
-
(0,defineProperty/* default */.Z)(this, "storage", null);
|
|
9905
|
-
|
|
9906
|
-
this.storageType = storageType;
|
|
9907
|
-
|
|
9908
|
-
try {
|
|
9909
|
-
this.storage = storageType === "local" ? window.localStorage : window.sessionStorage;
|
|
9910
|
-
} catch (e) {
|
|
9911
|
-
(0,errors/* warn */.Z)("".concat(this.storageType, "Storage is disabled. This is likely because your browser is blocking third-party cookies."));
|
|
9912
|
-
}
|
|
9913
|
-
} // eslint-disable-next-line class-methods-use-this
|
|
9914
|
-
|
|
9915
|
-
|
|
9916
|
-
_createClass(SafeStorage, [{
|
|
9917
|
-
key: "seralizeItem",
|
|
9918
|
-
value: function seralizeItem(value) {
|
|
9919
|
-
try {
|
|
9920
|
-
return stringify_default()(value);
|
|
9921
|
-
} catch (error) {
|
|
9922
|
-
(0,errors/* warn */.Z)("Attempt to seralize failed: ".concat(error));
|
|
9923
|
-
}
|
|
9924
|
-
|
|
9925
|
-
return null;
|
|
9926
|
-
} // eslint-disable-next-line class-methods-use-this
|
|
9927
|
-
|
|
9928
|
-
}, {
|
|
9929
|
-
key: "deserializeItem",
|
|
9930
|
-
value: function deserializeItem(value) {
|
|
9931
|
-
try {
|
|
9932
|
-
return JSON.parse(value);
|
|
9933
|
-
} catch (error) {
|
|
9934
|
-
(0,errors/* warn */.Z)("Attempt to deserialize failed: ".concat(error));
|
|
9935
|
-
}
|
|
9936
|
-
|
|
9937
|
-
return null;
|
|
9938
|
-
}
|
|
9939
|
-
}, {
|
|
9940
|
-
key: "getItem",
|
|
9941
|
-
value: function getItem(key) {
|
|
9942
|
-
try {
|
|
9943
|
-
if (!this.storage) {
|
|
9944
|
-
throw new errors/* AdaEmbedError */.S("`storage` is null");
|
|
9945
|
-
}
|
|
9946
|
-
|
|
9947
|
-
return this.deserializeItem(this.storage.getItem(key));
|
|
9948
|
-
} catch (e) {
|
|
9949
|
-
(0,errors/* warn */.Z)("Cannot getItem from ".concat(this.storageType, "Storage."));
|
|
9950
|
-
return null;
|
|
9951
|
-
}
|
|
9952
|
-
}
|
|
9953
|
-
}, {
|
|
9954
|
-
key: "setItem",
|
|
9955
|
-
value: function setItem(key, value) {
|
|
9956
|
-
try {
|
|
9957
|
-
if (!this.storage) {
|
|
9958
|
-
throw new errors/* AdaEmbedError */.S("`storage` is null");
|
|
9959
|
-
}
|
|
9960
|
-
|
|
9961
|
-
this.storage.setItem(key, this.seralizeItem(value));
|
|
9962
|
-
} catch (e) {
|
|
9963
|
-
(0,errors/* warn */.Z)("Cannot setItem in ".concat(this.storageType, "Storage."));
|
|
9964
|
-
}
|
|
9965
|
-
}
|
|
9966
|
-
}, {
|
|
9967
|
-
key: "removeItem",
|
|
9968
|
-
value: function removeItem(key) {
|
|
9969
|
-
try {
|
|
9970
|
-
if (!this.storage) {
|
|
9971
|
-
throw new errors/* AdaEmbedError */.S("`storage` is null");
|
|
9972
|
-
}
|
|
9973
|
-
|
|
9974
|
-
this.storage.removeItem(key);
|
|
9975
|
-
} catch (e) {
|
|
9976
|
-
(0,errors/* warn */.Z)("Cannot removeItem from ".concat(this.storageType, "Storage."));
|
|
9977
|
-
}
|
|
9978
|
-
}
|
|
9979
|
-
}]);
|
|
9980
|
-
|
|
9981
|
-
return SafeStorage;
|
|
9982
|
-
}();
|
|
9983
|
-
var safeLocalStorage = new SafeStorage(StorageTypes.Local);
|
|
9984
|
-
var safeSessionStorage = new SafeStorage(StorageTypes.Session);
|
|
9985
10563
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/trim.js
|
|
9986
10564
|
var trim = __webpack_require__(5843);
|
|
9987
10565
|
var trim_default = /*#__PURE__*/__webpack_require__.n(trim);
|
|
@@ -10610,9 +11188,6 @@ function bindActionCreators(action, dispatch) {
|
|
|
10610
11188
|
return dispatch(action, payload);
|
|
10611
11189
|
};
|
|
10612
11190
|
}
|
|
10613
|
-
;// CONCATENATED MODULE: ./src/common/constants/storage-keys.ts
|
|
10614
|
-
var CHATTER_STORAGE_KEY = "chatter";
|
|
10615
|
-
var IN_LIVE_CHAT_STORAGE_KEY = "inLiveChat";
|
|
10616
11191
|
;// CONCATENATED MODULE: ./src/common/helpers/fetch-client.ts
|
|
10617
11192
|
|
|
10618
11193
|
|
|
@@ -10822,32 +11397,6 @@ var INTRO_IFRAME = "intro";
|
|
|
10822
11397
|
var BUTTON_IFRAME = "button";
|
|
10823
11398
|
var MASK_IFRAME = "drawer-mask";
|
|
10824
11399
|
var XSTORAGE_IFRAME = "x-storage";
|
|
10825
|
-
;// CONCATENATED MODULE: ./src/frames/helpers/storage/index.ts
|
|
10826
|
-
|
|
10827
|
-
var PERSISTENCE_NORMAL = "normal";
|
|
10828
|
-
var PERSISTENCE_SESSION = "session";
|
|
10829
|
-
/**
|
|
10830
|
-
* Retrieves items from local or session storage, depending on the client's
|
|
10831
|
-
* persistence setting. If privateMode is set, it returns null.
|
|
10832
|
-
*/
|
|
10833
|
-
|
|
10834
|
-
function retrieveStorage(key, client, privateMode) {
|
|
10835
|
-
var persistence = client.persistence;
|
|
10836
|
-
|
|
10837
|
-
if (privateMode) {
|
|
10838
|
-
return null;
|
|
10839
|
-
}
|
|
10840
|
-
|
|
10841
|
-
if (persistence === PERSISTENCE_NORMAL) {
|
|
10842
|
-
return safeLocalStorage.getItem(key);
|
|
10843
|
-
}
|
|
10844
|
-
|
|
10845
|
-
if (persistence === PERSISTENCE_SESSION) {
|
|
10846
|
-
return safeSessionStorage.getItem(key);
|
|
10847
|
-
}
|
|
10848
|
-
|
|
10849
|
-
return null;
|
|
10850
|
-
}
|
|
10851
11400
|
// EXTERNAL MODULE: ./src/services/logger/index.ts
|
|
10852
11401
|
var services_logger = __webpack_require__(9517);
|
|
10853
11402
|
;// CONCATENATED MODULE: ./src/client/components/IFrame/index.tsx
|
|
@@ -11252,6 +11801,7 @@ function ChatFrame_isNativeReflectConstruct() { if (typeof Reflect === "undefine
|
|
|
11252
11801
|
|
|
11253
11802
|
|
|
11254
11803
|
|
|
11804
|
+
|
|
11255
11805
|
var ChatFrame = /*#__PURE__*/function (_Component) {
|
|
11256
11806
|
(0,inherits/* default */.Z)(ChatFrame, _Component);
|
|
11257
11807
|
|
|
@@ -11580,7 +12130,7 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
|
|
|
11580
12130
|
var _handleChatEvent = (0,asyncToGenerator/* default */.Z)( /*#__PURE__*/regenerator_default().mark(function _callee(type, payload, id) {
|
|
11581
12131
|
var _this4 = this;
|
|
11582
12132
|
|
|
11583
|
-
var _this$props8, adaSettings, setState, setConnectionState, _ref, eventKey, data, _ref2, analytics, analyticsCallback, client, _ref3, chatter, chatterTokenCallback, _client, _ref4, inLiveChat, eventCallbacks, customJavascriptEvent, specificCallback, genericCallback, resetChat, zdChatterAuthCallback, conversationEndCallback;
|
|
12133
|
+
var _this$props8, 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;
|
|
11584
12134
|
|
|
11585
12135
|
return regenerator_default().wrap(function _callee$(_context22) {
|
|
11586
12136
|
while (1) {
|
|
@@ -11588,30 +12138,30 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
|
|
|
11588
12138
|
case 0:
|
|
11589
12139
|
_this$props8 = this.props, adaSettings = _this$props8.adaSettings, setState = _this$props8.setState, setConnectionState = _this$props8.setConnectionState;
|
|
11590
12140
|
_context22.t0 = type;
|
|
11591
|
-
_context22.next = _context22.t0 === GET_WINDOW_ORIGIN ? 4 : _context22.t0 === CHAT_STARTED ? 6 : _context22.t0 === CHAT_WEBSOCKET_CONNECTED ? 9 : _context22.t0 === PUBLISH_EVENT ? 11 : _context22.t0 === ANALYTICS_EVENT ? 14 : _context22.t0 === CHATTER_EVENT ? 18 : _context22.t0 === CHATTER_LIVECHAT_EVENT ?
|
|
12141
|
+
_context22.next = _context22.t0 === GET_WINDOW_ORIGIN ? 4 : _context22.t0 === CHAT_STARTED ? 6 : _context22.t0 === CHAT_WEBSOCKET_CONNECTED ? 9 : _context22.t0 === PUBLISH_EVENT ? 11 : _context22.t0 === ANALYTICS_EVENT ? 14 : _context22.t0 === CHATTER_EVENT ? 18 : _context22.t0 === "ZD_SESSION" ? 28 : _context22.t0 === CHATTER_LIVECHAT_EVENT ? 37 : _context22.t0 === CUSTOM_JAVASCRIPT_EVENT ? 43 : _context22.t0 === RESET_FROM_CHAT_EVENT ? 52 : _context22.t0 === ZD_JWT_AUTH_EVENT ? 55 : _context22.t0 === CREATE_NOTIFICATION_EVENT ? 58 : _context22.t0 === BROWSER_HAS_NOTIFICATIONS_EVENT ? 60 : _context22.t0 === REQUEST_NOTIFICATIONS_EVENT ? 62 : _context22.t0 === END_CONVERSATION_EVENT ? 64 : 67;
|
|
11592
12142
|
break;
|
|
11593
12143
|
|
|
11594
12144
|
case 4:
|
|
11595
12145
|
this.channel.postMessage("SET_WINDOW_ORIGIN", window.location, id);
|
|
11596
|
-
return _context22.abrupt("break",
|
|
12146
|
+
return _context22.abrupt("break", 68);
|
|
11597
12147
|
|
|
11598
12148
|
case 6:
|
|
11599
12149
|
this.channel.isConnected = true;
|
|
11600
12150
|
setConnectionState({
|
|
11601
12151
|
"chat": ConnectionState.Done
|
|
11602
12152
|
});
|
|
11603
|
-
return _context22.abrupt("break",
|
|
12153
|
+
return _context22.abrupt("break", 68);
|
|
11604
12154
|
|
|
11605
12155
|
case 9:
|
|
11606
12156
|
setState({
|
|
11607
12157
|
isChatWebsocketConnected: true
|
|
11608
12158
|
});
|
|
11609
|
-
return _context22.abrupt("break",
|
|
12159
|
+
return _context22.abrupt("break", 68);
|
|
11610
12160
|
|
|
11611
12161
|
case 11:
|
|
11612
12162
|
_ref = payload, eventKey = _ref.eventKey, data = _ref.data;
|
|
11613
12163
|
publishEvent(eventKey, data);
|
|
11614
|
-
return _context22.abrupt("break",
|
|
12164
|
+
return _context22.abrupt("break", 68);
|
|
11615
12165
|
|
|
11616
12166
|
case 14:
|
|
11617
12167
|
_ref2 = payload, analytics = _ref2.analytics;
|
|
@@ -11621,66 +12171,124 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
|
|
|
11621
12171
|
analyticsCallback(analytics);
|
|
11622
12172
|
}
|
|
11623
12173
|
|
|
11624
|
-
return _context22.abrupt("break",
|
|
12174
|
+
return _context22.abrupt("break", 68);
|
|
11625
12175
|
|
|
11626
12176
|
case 18:
|
|
11627
12177
|
client = this.props.client;
|
|
11628
|
-
_ref3 = payload, chatter = _ref3.chatter;
|
|
12178
|
+
_ref3 = payload, chatter = _ref3.chatter, created = _ref3.created;
|
|
11629
12179
|
chatterTokenCallback = adaSettings.chatterTokenCallback;
|
|
11630
|
-
|
|
12180
|
+
|
|
12181
|
+
if (client) {
|
|
12182
|
+
_context22.next = 23;
|
|
12183
|
+
break;
|
|
12184
|
+
}
|
|
12185
|
+
|
|
12186
|
+
throw new errors/* AdaEmbedError */.S("`client` is undefined");
|
|
12187
|
+
|
|
12188
|
+
case 23:
|
|
12189
|
+
_context22.next = 25;
|
|
11631
12190
|
return setState({
|
|
11632
|
-
chatterToken: chatter
|
|
12191
|
+
chatterToken: chatter,
|
|
12192
|
+
chatterCreated: created
|
|
11633
12193
|
});
|
|
11634
12194
|
|
|
11635
|
-
case
|
|
12195
|
+
case 25:
|
|
11636
12196
|
/**
|
|
11637
12197
|
* Store the token so when embed loads in the future, it doesn't have to wait for it to
|
|
11638
12198
|
* come from chat. This is important for campaign and business event triggers.
|
|
11639
12199
|
*/
|
|
11640
12200
|
if (client.persistence === PERSISTENCE_NORMAL) {
|
|
11641
12201
|
safeLocalStorage.setItem(CHATTER_STORAGE_KEY, chatter);
|
|
12202
|
+
safeLocalStorage.setItem(CHATTER_CREATED_STORAGE_KEY, created);
|
|
11642
12203
|
} else if (client.persistence === PERSISTENCE_SESSION) {
|
|
11643
12204
|
safeSessionStorage.setItem(CHATTER_STORAGE_KEY, chatter);
|
|
12205
|
+
safeSessionStorage.setItem(CHATTER_CREATED_STORAGE_KEY, created);
|
|
11644
12206
|
}
|
|
11645
12207
|
|
|
11646
12208
|
if (chatterTokenCallback) {
|
|
11647
12209
|
chatterTokenCallback(chatter);
|
|
11648
12210
|
}
|
|
11649
12211
|
|
|
11650
|
-
return _context22.abrupt("break",
|
|
12212
|
+
return _context22.abrupt("break", 68);
|
|
11651
12213
|
|
|
11652
|
-
case
|
|
12214
|
+
case 28:
|
|
11653
12215
|
_client = this.props.client;
|
|
11654
|
-
_ref4 = payload,
|
|
11655
|
-
|
|
12216
|
+
_ref4 = payload, zdSessionId = _ref4.zdSessionId, zdPreviousTags = _ref4.zdPreviousTags;
|
|
12217
|
+
|
|
12218
|
+
if (_client) {
|
|
12219
|
+
_context22.next = 32;
|
|
12220
|
+
break;
|
|
12221
|
+
}
|
|
12222
|
+
|
|
12223
|
+
throw new errors/* AdaEmbedError */.S("`client` is undefined");
|
|
12224
|
+
|
|
12225
|
+
case 32:
|
|
12226
|
+
_context22.next = 34;
|
|
12227
|
+
return setState({
|
|
12228
|
+
zdSessionId: zdSessionId
|
|
12229
|
+
});
|
|
12230
|
+
|
|
12231
|
+
case 34:
|
|
12232
|
+
storage = function () {
|
|
12233
|
+
if (_client.persistence === PERSISTENCE_NORMAL) {
|
|
12234
|
+
return safeLocalStorage;
|
|
12235
|
+
}
|
|
12236
|
+
|
|
12237
|
+
if (_client.persistence === PERSISTENCE_SESSION) {
|
|
12238
|
+
return safeSessionStorage;
|
|
12239
|
+
}
|
|
12240
|
+
|
|
12241
|
+
return null;
|
|
12242
|
+
}();
|
|
12243
|
+
|
|
12244
|
+
if (storage) {
|
|
12245
|
+
if (zdSessionId === null) {
|
|
12246
|
+
storage.removeItem(ZD_SESSION_STORAGE_KEY);
|
|
12247
|
+
} else {
|
|
12248
|
+
storage.setItem(ZD_SESSION_STORAGE_KEY, zdSessionId);
|
|
12249
|
+
}
|
|
12250
|
+
|
|
12251
|
+
if (zdPreviousTags === null) {
|
|
12252
|
+
storage.removeItem(ZD_PREVIOUS_TAGS_STORAGE_KEY);
|
|
12253
|
+
} else {
|
|
12254
|
+
storage.setItem(ZD_PREVIOUS_TAGS_STORAGE_KEY, zdPreviousTags);
|
|
12255
|
+
}
|
|
12256
|
+
}
|
|
12257
|
+
|
|
12258
|
+
return _context22.abrupt("break", 68);
|
|
12259
|
+
|
|
12260
|
+
case 37:
|
|
12261
|
+
_client2 = this.props.client;
|
|
12262
|
+
_ref5 = payload, inLiveChat = _ref5.inLiveChat;
|
|
12263
|
+
_context22.next = 41;
|
|
11656
12264
|
return setState({
|
|
11657
12265
|
chatterInLiveChat: inLiveChat
|
|
11658
12266
|
});
|
|
11659
12267
|
|
|
11660
|
-
case
|
|
12268
|
+
case 41:
|
|
11661
12269
|
/**
|
|
11662
12270
|
* Store the token so when embed loads in the future, it doesn't have to wait for it to
|
|
11663
12271
|
* come from chat. This is important for campaign and business event triggers.
|
|
11664
12272
|
*/
|
|
11665
|
-
if (
|
|
12273
|
+
if (_client2.persistence === PERSISTENCE_NORMAL) {
|
|
11666
12274
|
safeLocalStorage.setItem(IN_LIVE_CHAT_STORAGE_KEY, inLiveChat);
|
|
11667
|
-
} else if (
|
|
12275
|
+
} else if (_client2.persistence === PERSISTENCE_SESSION) {
|
|
11668
12276
|
safeSessionStorage.setItem(IN_LIVE_CHAT_STORAGE_KEY, inLiveChat);
|
|
11669
12277
|
}
|
|
11670
12278
|
|
|
11671
|
-
return _context22.abrupt("break",
|
|
12279
|
+
return _context22.abrupt("break", 68);
|
|
11672
12280
|
|
|
11673
|
-
case
|
|
12281
|
+
case 43:
|
|
11674
12282
|
eventCallbacks = adaSettings.eventCallbacks;
|
|
11675
12283
|
|
|
11676
12284
|
if (eventCallbacks) {
|
|
11677
|
-
_context22.next =
|
|
12285
|
+
_context22.next = 46;
|
|
11678
12286
|
break;
|
|
11679
12287
|
}
|
|
11680
12288
|
|
|
11681
|
-
return _context22.abrupt("break",
|
|
12289
|
+
return _context22.abrupt("break", 68);
|
|
11682
12290
|
|
|
11683
|
-
case
|
|
12291
|
+
case 46:
|
|
11684
12292
|
customJavascriptEvent = payload.event_data;
|
|
11685
12293
|
specificCallback = eventCallbacks[customJavascriptEvent.event_name];
|
|
11686
12294
|
genericCallback = eventCallbacks["*"];
|
|
@@ -11693,14 +12301,14 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
|
|
|
11693
12301
|
genericCallback(customJavascriptEvent);
|
|
11694
12302
|
}
|
|
11695
12303
|
|
|
11696
|
-
return _context22.abrupt("break",
|
|
12304
|
+
return _context22.abrupt("break", 68);
|
|
11697
12305
|
|
|
11698
|
-
case
|
|
12306
|
+
case 52:
|
|
11699
12307
|
resetChat = this.props.resetChat;
|
|
11700
12308
|
resetChat();
|
|
11701
|
-
return _context22.abrupt("break",
|
|
12309
|
+
return _context22.abrupt("break", 68);
|
|
11702
12310
|
|
|
11703
|
-
case
|
|
12311
|
+
case 55:
|
|
11704
12312
|
zdChatterAuthCallback = adaSettings.zdChatterAuthCallback;
|
|
11705
12313
|
|
|
11706
12314
|
if (zdChatterAuthCallback) {
|
|
@@ -11718,35 +12326,35 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
|
|
|
11718
12326
|
this.channel.postMessage(ZD_JWT_AUTH_RESPONSE_EVENT, {}, id);
|
|
11719
12327
|
}
|
|
11720
12328
|
|
|
11721
|
-
return _context22.abrupt("break",
|
|
12329
|
+
return _context22.abrupt("break", 68);
|
|
11722
12330
|
|
|
11723
|
-
case
|
|
12331
|
+
case 58:
|
|
11724
12332
|
this.handleNotifications(payload);
|
|
11725
|
-
return _context22.abrupt("break",
|
|
12333
|
+
return _context22.abrupt("break", 68);
|
|
11726
12334
|
|
|
11727
|
-
case
|
|
12335
|
+
case 60:
|
|
11728
12336
|
this.channel.postMessage(BROWSER_HAS_NOTIFICATIONS_RESPONSE_EVENT, {
|
|
11729
12337
|
browserHasNotificationSupport: browserHasNotificationSupport
|
|
11730
12338
|
});
|
|
11731
|
-
return _context22.abrupt("break",
|
|
12339
|
+
return _context22.abrupt("break", 68);
|
|
11732
12340
|
|
|
11733
|
-
case
|
|
12341
|
+
case 62:
|
|
11734
12342
|
requestNotificationPermission();
|
|
11735
|
-
return _context22.abrupt("break",
|
|
12343
|
+
return _context22.abrupt("break", 68);
|
|
11736
12344
|
|
|
11737
|
-
case
|
|
12345
|
+
case 64:
|
|
11738
12346
|
conversationEndCallback = adaSettings.conversationEndCallback;
|
|
11739
12347
|
|
|
11740
12348
|
if (conversationEndCallback) {
|
|
11741
12349
|
conversationEndCallback(payload);
|
|
11742
12350
|
}
|
|
11743
12351
|
|
|
11744
|
-
return _context22.abrupt("break",
|
|
12352
|
+
return _context22.abrupt("break", 68);
|
|
11745
12353
|
|
|
11746
|
-
case
|
|
11747
|
-
return _context22.abrupt("break",
|
|
12354
|
+
case 67:
|
|
12355
|
+
return _context22.abrupt("break", 68);
|
|
11748
12356
|
|
|
11749
|
-
case
|
|
12357
|
+
case 68:
|
|
11750
12358
|
case "end":
|
|
11751
12359
|
return _context22.stop();
|
|
11752
12360
|
}
|
|
@@ -12166,6 +12774,7 @@ function Container_isNativeReflectConstruct() { if (typeof Reflect === "undefine
|
|
|
12166
12774
|
|
|
12167
12775
|
|
|
12168
12776
|
|
|
12777
|
+
|
|
12169
12778
|
|
|
12170
12779
|
|
|
12171
12780
|
var Container = /*#__PURE__*/function (_Component) {
|
|
@@ -12294,7 +12903,6 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
12294
12903
|
campaignToTrigger = _this$state.campaignToTrigger,
|
|
12295
12904
|
campaignTriggerOptions = _this$state.campaignTriggerOptions,
|
|
12296
12905
|
followUpResponseId = _this$state.followUpResponseId;
|
|
12297
|
-
var chatChannel = messageService.getChannel(CHAT_IFRAME);
|
|
12298
12906
|
/* We wait for all necessary preconditions (e.g. necessary connections established) to be true,
|
|
12299
12907
|
* then trigger the campaign. campaignToTrigger is cleared after triggering, so we do not need
|
|
12300
12908
|
* to worry about duplicate triggers.
|
|
@@ -12317,13 +12925,17 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
12317
12925
|
} // If a follow-up response has been queued by a triggered Campaign, tell chat to show it
|
|
12318
12926
|
|
|
12319
12927
|
|
|
12320
|
-
if (
|
|
12321
|
-
chatChannel.
|
|
12322
|
-
|
|
12323
|
-
|
|
12324
|
-
|
|
12325
|
-
|
|
12326
|
-
|
|
12928
|
+
if (isChatWebsocketConnected && isDrawerOpen && followUpResponseId) {
|
|
12929
|
+
var chatChannel = messageService.getChannel(CHAT_IFRAME);
|
|
12930
|
+
|
|
12931
|
+
if (chatChannel) {
|
|
12932
|
+
chatChannel.postMessage(SEND_GREETING, {
|
|
12933
|
+
responseId: followUpResponseId
|
|
12934
|
+
});
|
|
12935
|
+
this.setState({
|
|
12936
|
+
followUpResponseId: null
|
|
12937
|
+
});
|
|
12938
|
+
}
|
|
12327
12939
|
}
|
|
12328
12940
|
|
|
12329
12941
|
if (prevProps.isDrawerOpen !== isDrawerOpen && toggleCallback) {
|
|
@@ -12532,7 +13144,7 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
12532
13144
|
var _handleEmbedAction = (0,asyncToGenerator/* default */.Z)( /*#__PURE__*/regenerator_default().mark(function _callee2(type, payload, id) {
|
|
12533
13145
|
var _this5 = this;
|
|
12534
13146
|
|
|
12535
|
-
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, _ref2, body, duration, EXTRA_PROACTIVE_DELAY, canCreateProactive;
|
|
13147
|
+
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, canCreateProactive;
|
|
12536
13148
|
|
|
12537
13149
|
return regenerator_default().wrap(function _callee2$(_context3) {
|
|
12538
13150
|
while (1) {
|
|
@@ -12552,7 +13164,7 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
12552
13164
|
|
|
12553
13165
|
case 6:
|
|
12554
13166
|
_context3.t0 = type;
|
|
12555
|
-
_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 ?
|
|
13167
|
+
_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 : 89;
|
|
12556
13168
|
break;
|
|
12557
13169
|
|
|
12558
13170
|
case 9:
|
|
@@ -12566,7 +13178,7 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
12566
13178
|
|
|
12567
13179
|
case 12:
|
|
12568
13180
|
this.trackEvent(payload);
|
|
12569
|
-
return _context3.abrupt("break",
|
|
13181
|
+
return _context3.abrupt("break", 89);
|
|
12570
13182
|
|
|
12571
13183
|
case 14:
|
|
12572
13184
|
if (client.features.afm_proactive_messaging) {
|
|
@@ -12579,7 +13191,7 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
12579
13191
|
|
|
12580
13192
|
case 17:
|
|
12581
13193
|
this.triggerCampaign(payload);
|
|
12582
|
-
return _context3.abrupt("break",
|
|
13194
|
+
return _context3.abrupt("break", 89);
|
|
12583
13195
|
|
|
12584
13196
|
case 19:
|
|
12585
13197
|
if (client.features.afm_proactive_messaging) {
|
|
@@ -12592,7 +13204,7 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
12592
13204
|
|
|
12593
13205
|
case 22:
|
|
12594
13206
|
this.evaluateCampaignConditions(payload);
|
|
12595
|
-
return _context3.abrupt("break",
|
|
13207
|
+
return _context3.abrupt("break", 89);
|
|
12596
13208
|
|
|
12597
13209
|
case 24:
|
|
12598
13210
|
toggleChat = this.props.toggleChat;
|
|
@@ -12601,7 +13213,7 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
12601
13213
|
|
|
12602
13214
|
case 27:
|
|
12603
13215
|
localChannel.postMessage(TOGGLE_RESPONSE, null, id);
|
|
12604
|
-
return _context3.abrupt("break",
|
|
13216
|
+
return _context3.abrupt("break", 89);
|
|
12605
13217
|
|
|
12606
13218
|
case 29:
|
|
12607
13219
|
_this$props10 = this.props, isDrawerOpen = _this$props10.isDrawerOpen, drawerHasBeenOpened = _this$props10.drawerHasBeenOpened, chatterToken = _this$props10.chatterToken;
|
|
@@ -12612,7 +13224,7 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
12612
13224
|
hasClosedChat: drawerHasBeenOpened && !isDrawerOpen
|
|
12613
13225
|
};
|
|
12614
13226
|
localChannel.postMessage(GET_INFO_RESPONSE, contentToReturn, id);
|
|
12615
|
-
return _context3.abrupt("break",
|
|
13227
|
+
return _context3.abrupt("break", 89);
|
|
12616
13228
|
|
|
12617
13229
|
case 33:
|
|
12618
13230
|
_this$props11 = this.props, metaFields = _this$props11.metaFields, setState = _this$props11.setState;
|
|
@@ -12625,7 +13237,7 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
12625
13237
|
|
|
12626
13238
|
case 38:
|
|
12627
13239
|
localChannel.postMessage(SET_META_FIELDS_RESPONSE, null, id);
|
|
12628
|
-
return _context3.abrupt("break",
|
|
13240
|
+
return _context3.abrupt("break", 89);
|
|
12629
13241
|
|
|
12630
13242
|
case 40:
|
|
12631
13243
|
_this$props12 = this.props, sensitiveMetaFields = _this$props12.sensitiveMetaFields, _setState = _this$props12.setState;
|
|
@@ -12636,42 +13248,54 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
12636
13248
|
|
|
12637
13249
|
case 43:
|
|
12638
13250
|
localChannel.postMessage("SET_SENSITIVE_META_FIELDS_RESPONSE", null, id);
|
|
12639
|
-
return _context3.abrupt("break",
|
|
13251
|
+
return _context3.abrupt("break", 89);
|
|
12640
13252
|
|
|
12641
13253
|
case 45:
|
|
12642
13254
|
localChannel.postMessage(STOP_RESPONSE, null, id);
|
|
12643
13255
|
this.unmount();
|
|
12644
|
-
return _context3.abrupt("break",
|
|
13256
|
+
return _context3.abrupt("break", 89);
|
|
12645
13257
|
|
|
12646
13258
|
case 48:
|
|
12647
13259
|
_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;
|
|
12648
13260
|
_setState2 = this.props.setState;
|
|
12649
13261
|
chatHasBeenRendered = this.state.chatHasBeenRendered;
|
|
12650
|
-
|
|
12651
|
-
return _setState2({
|
|
13262
|
+
newState = {
|
|
12652
13263
|
greeting: greeting,
|
|
12653
13264
|
language: language,
|
|
12654
13265
|
metaFields: _newMetaFields,
|
|
12655
13266
|
sensitiveMetaFields: _sensitiveMetaFields
|
|
12656
|
-
}
|
|
13267
|
+
};
|
|
12657
13268
|
|
|
12658
|
-
case 53:
|
|
12659
13269
|
if (!resetChatHistory) {
|
|
12660
|
-
_context3.next =
|
|
13270
|
+
_context3.next = 61;
|
|
12661
13271
|
break;
|
|
12662
13272
|
}
|
|
12663
13273
|
|
|
12664
13274
|
if (xStorageChannel) {
|
|
12665
|
-
_context3.next =
|
|
13275
|
+
_context3.next = 55;
|
|
12666
13276
|
break;
|
|
12667
13277
|
}
|
|
12668
13278
|
|
|
12669
13279
|
throw new errors/* AdaEmbedError */.S("`xStorageChannel` is null");
|
|
12670
13280
|
|
|
12671
|
-
case
|
|
12672
|
-
xStorageChannel.postMessage(DELETE_HISTORY_EVENT);
|
|
13281
|
+
case 55:
|
|
13282
|
+
xStorageChannel.postMessage(DELETE_HISTORY_EVENT); // Clear chatter data from local storage
|
|
13283
|
+
|
|
13284
|
+
safeLocalStorage.removeItem(CHATTER_TOKEN_STORAGE_KEY);
|
|
13285
|
+
safeSessionStorage.removeItem(CHATTER_TOKEN_STORAGE_KEY);
|
|
13286
|
+
safeLocalStorage.removeItem(CHATTER_CREATED_STORAGE_KEY);
|
|
13287
|
+
safeSessionStorage.removeItem(CHATTER_CREATED_STORAGE_KEY); // And from state
|
|
12673
13288
|
|
|
12674
|
-
|
|
13289
|
+
newState = Container_objectSpread(Container_objectSpread({}, newState), {}, {
|
|
13290
|
+
chatterToken: null,
|
|
13291
|
+
chatterCreated: null
|
|
13292
|
+
});
|
|
13293
|
+
|
|
13294
|
+
case 61:
|
|
13295
|
+
_context3.next = 63;
|
|
13296
|
+
return _setState2(newState);
|
|
13297
|
+
|
|
13298
|
+
case 63:
|
|
12675
13299
|
if (chatHasBeenRendered) {
|
|
12676
13300
|
this.setState({
|
|
12677
13301
|
hideChatOverride: true
|
|
@@ -12683,36 +13307,51 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
12683
13307
|
}
|
|
12684
13308
|
|
|
12685
13309
|
localChannel.postMessage(RESET_RESPONSE, null, id);
|
|
12686
|
-
return _context3.abrupt("break",
|
|
13310
|
+
return _context3.abrupt("break", 89);
|
|
13311
|
+
|
|
13312
|
+
case 66:
|
|
13313
|
+
_setState3 = this.props.setState;
|
|
12687
13314
|
|
|
12688
|
-
case 60:
|
|
12689
13315
|
if (xStorageChannel) {
|
|
12690
|
-
_context3.next =
|
|
13316
|
+
_context3.next = 69;
|
|
12691
13317
|
break;
|
|
12692
13318
|
}
|
|
12693
13319
|
|
|
12694
13320
|
throw new errors/* AdaEmbedError */.S("`xStorageChannel` is null");
|
|
12695
13321
|
|
|
12696
|
-
case
|
|
13322
|
+
case 69:
|
|
13323
|
+
// Clear chatter data from local storage
|
|
13324
|
+
safeLocalStorage.removeItem(CHATTER_TOKEN_STORAGE_KEY);
|
|
13325
|
+
safeSessionStorage.removeItem(CHATTER_TOKEN_STORAGE_KEY);
|
|
13326
|
+
safeLocalStorage.removeItem(CHATTER_CREATED_STORAGE_KEY);
|
|
13327
|
+
safeSessionStorage.removeItem(CHATTER_CREATED_STORAGE_KEY); // And from state
|
|
13328
|
+
|
|
13329
|
+
_context3.next = 75;
|
|
13330
|
+
return _setState3({
|
|
13331
|
+
chatterToken: null,
|
|
13332
|
+
chatterCreated: null
|
|
13333
|
+
});
|
|
13334
|
+
|
|
13335
|
+
case 75:
|
|
12697
13336
|
xStorageChannel.postMessage(DELETE_HISTORY_EVENT);
|
|
12698
13337
|
localChannel.postMessage(DELETE_HISTORY_RESPONSE, null, id);
|
|
12699
|
-
return _context3.abrupt("break",
|
|
13338
|
+
return _context3.abrupt("break", 89);
|
|
12700
13339
|
|
|
12701
|
-
case
|
|
13340
|
+
case 78:
|
|
12702
13341
|
_ref2 = payload, body = _ref2.body, duration = _ref2.duration;
|
|
12703
13342
|
EXTRA_PROACTIVE_DELAY = 1000; // Free tier campaigns re-use the createProactive infrastructure
|
|
12704
13343
|
|
|
12705
13344
|
canCreateProactive = client.features.developer_proactive || client.features.afm_proactive_messaging_free_tier;
|
|
12706
13345
|
|
|
12707
13346
|
if (canCreateProactive) {
|
|
12708
|
-
_context3.next =
|
|
13347
|
+
_context3.next = 84;
|
|
12709
13348
|
break;
|
|
12710
13349
|
}
|
|
12711
13350
|
|
|
12712
13351
|
localChannel.postMessage(CREATE_PROACTIVE_RESPONSE, "Ada Embed - Proactive intros are not available in your feature set.", id, FetchEventStatus.Failure);
|
|
12713
13352
|
return _context3.abrupt("return");
|
|
12714
13353
|
|
|
12715
|
-
case
|
|
13354
|
+
case 84:
|
|
12716
13355
|
this.setState({
|
|
12717
13356
|
hideIntroOverride: true
|
|
12718
13357
|
}, /*#__PURE__*/(0,asyncToGenerator/* default */.Z)( /*#__PURE__*/regenerator_default().mark(function _callee() {
|
|
@@ -12750,14 +13389,14 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
12750
13389
|
}
|
|
12751
13390
|
}, _callee);
|
|
12752
13391
|
})));
|
|
12753
|
-
_context3.next =
|
|
13392
|
+
_context3.next = 87;
|
|
12754
13393
|
return wait(duration * 1000 + EXTRA_PROACTIVE_DELAY);
|
|
12755
13394
|
|
|
12756
|
-
case
|
|
13395
|
+
case 87:
|
|
12757
13396
|
localChannel.postMessage(CREATE_PROACTIVE_RESPONSE, null, id);
|
|
12758
|
-
return _context3.abrupt("break",
|
|
13397
|
+
return _context3.abrupt("break", 89);
|
|
12759
13398
|
|
|
12760
|
-
case
|
|
13399
|
+
case 89:
|
|
12761
13400
|
case "end":
|
|
12762
13401
|
return _context3.stop();
|
|
12763
13402
|
}
|
|
@@ -13726,7 +14365,7 @@ window.__AdaEmbedConstructor = Embed;
|
|
|
13726
14365
|
/* harmony export */ });
|
|
13727
14366
|
var isModern = new RegExp("((CPU[ +]OS|iPhone[ +]OS|CPU[ +]iPhone|CPU IPhone OS)[ +]+(14|(1[5-9]|[2-9]\\d|\\d{3,}))[_.]\\d+(?:[_.]\\d+)?)|((Chromium|Chrome)\\/(92|(9[3-9]|\\d{3,}))\\.\\d+(?:\\.\\d+)?)|(Version\\/(14|(1[5-9]|[2-9]\\d|\\d{3,}))\\.\\d+(?:\\.\\d+)? Safari\\/)|(Firefox\\/(91|(9[2-9]|\\d{3,}))\\.\\d+\\.\\d+)|(Firefox\\/(91|(9[2-9]|\\d{3,}))\\.\\d+(pre|[ab]\\d+[a-z]*)?)").test(navigator.userAgent);
|
|
13728
14367
|
var isProduction = "production" === "production";
|
|
13729
|
-
var embed2Version = "
|
|
14368
|
+
var embed2Version = "b927fbc";
|
|
13730
14369
|
|
|
13731
14370
|
/***/ }),
|
|
13732
14371
|
|
|
@@ -23123,7 +23762,7 @@ function _loadEmbed() {
|
|
|
23123
23762
|
polyfillVersionString = "legacy";
|
|
23124
23763
|
}
|
|
23125
23764
|
|
|
23126
|
-
embedScriptSource = concat_default()(_context16 = concat_default()(_context17 = "".concat(host, "/embed/")).call(_context17, polyfillVersionString, "/client/")).call(_context16, "
|
|
23765
|
+
embedScriptSource = concat_default()(_context16 = concat_default()(_context17 = "".concat(host, "/embed/")).call(_context17, polyfillVersionString, "/client/")).call(_context16, "b927fbc", "/index.js");
|
|
23127
23766
|
}
|
|
23128
23767
|
|
|
23129
23768
|
clientScriptExists = Boolean( true || // The client script is bundled with npm module
|
|
@@ -23250,10 +23889,10 @@ function createEmbedObject() {
|
|
|
23250
23889
|
handle: adaSettings.handle,
|
|
23251
23890
|
embedVersion: 2,
|
|
23252
23891
|
embedSettings: adaSettings,
|
|
23253
|
-
version: "1.0.
|
|
23892
|
+
version: "1.0.32",
|
|
23254
23893
|
isNpm: true,
|
|
23255
23894
|
hostPage: window.location.href,
|
|
23256
|
-
commitHash: "
|
|
23895
|
+
commitHash: "b927fbc"
|
|
23257
23896
|
}, {
|
|
23258
23897
|
sampleRate: 0.01 // 1% of logs will go through
|
|
23259
23898
|
|
|
@@ -23668,7 +24307,7 @@ function createEmbedObject() {
|
|
|
23668
24307
|
}
|
|
23669
24308
|
;// CONCATENATED MODULE: ./src/index-npm.ts
|
|
23670
24309
|
|
|
23671
|
-
Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
24310
|
+
Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2396));
|
|
23672
24311
|
/* harmony default export */ var index_npm = (createEmbedObject());
|
|
23673
24312
|
}();
|
|
23674
24313
|
module.exports = __webpack_exports__;
|