@pendo/agent 2.323.0 → 2.324.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dom.esm.js +1 -1
- package/dist/pendo.module.js +376 -358
- package/dist/pendo.module.min.js +9 -57
- package/dist/servers.json +7 -7
- package/package.json +1 -1
package/dist/pendo.module.js
CHANGED
|
@@ -3967,8 +3967,8 @@ let SERVER = '';
|
|
|
3967
3967
|
let ASSET_HOST = '';
|
|
3968
3968
|
let ASSET_PATH = '';
|
|
3969
3969
|
let DESIGNER_SERVER = '';
|
|
3970
|
-
let VERSION = '2.
|
|
3971
|
-
let PACKAGE_VERSION = '2.
|
|
3970
|
+
let VERSION = '2.324.0_';
|
|
3971
|
+
let PACKAGE_VERSION = '2.324.0';
|
|
3972
3972
|
let LOADER = 'xhr';
|
|
3973
3973
|
/* eslint-enable web-sdk-eslint-rules/no-gulp-env-references */
|
|
3974
3974
|
/**
|
|
@@ -12939,6 +12939,13 @@ function filterAnalyticsDisabled(silo, next) {
|
|
|
12939
12939
|
return;
|
|
12940
12940
|
next(silo);
|
|
12941
12941
|
}
|
|
12942
|
+
function filterBrokenTimestamps(silo, next) {
|
|
12943
|
+
if (!_.isNumber(silo.browser_time) || isNaN(silo.browser_time)) {
|
|
12944
|
+
log.critical(new Error('Event missing browser_time'));
|
|
12945
|
+
return;
|
|
12946
|
+
}
|
|
12947
|
+
next(silo);
|
|
12948
|
+
}
|
|
12942
12949
|
function fireEventCaptured(silo, next) {
|
|
12943
12950
|
var captureEvent = Events.eventCaptured.trigger(silo);
|
|
12944
12951
|
if (captureEvent.cancel) {
|
|
@@ -13287,7 +13294,7 @@ class EventQueue {
|
|
|
13287
13294
|
}
|
|
13288
13295
|
function createEventQueue(options) {
|
|
13289
13296
|
const processSilos = createSiloQueue(options);
|
|
13290
|
-
const packageSilos = pipeline(filterNonGuideAnalytics(options.beacon), filterAnalyticsByType, eventSequence, siloReducer(options.cache), filterSiloCapacity({
|
|
13297
|
+
const packageSilos = pipeline(filterBrokenTimestamps, filterNonGuideAnalytics(options.beacon), filterAnalyticsByType, eventSequence, siloReducer(options.cache), filterSiloCapacity({
|
|
13291
13298
|
overhead: jwtSizeOverhead,
|
|
13292
13299
|
lower: ConfigReader.get('sendEventsWithPostOnly') ? ENCODED_EVENT_MAX_POST_LENGTH : ENCODED_EVENT_MAX_LENGTH,
|
|
13293
13300
|
upper: ENCODED_EVENT_MAX_POST_LENGTH,
|
|
@@ -18905,7 +18912,7 @@ var BuildingBlockResourceCenter = (function () {
|
|
|
18905
18912
|
integrationIframe.css({ display: 'none' });
|
|
18906
18913
|
}
|
|
18907
18914
|
function getSupportedNativeIntegrations() {
|
|
18908
|
-
return ['drift-native-chat', 'intercom-chat', 'zendesk-chat', 'zendesk-native-kb', 'zendesk-messaging'];
|
|
18915
|
+
return ['drift-native-chat', 'intercom-chat', 'zendesk-chat', 'zendesk-native-kb', 'zendesk-messaging', 'visitorAssist'];
|
|
18909
18916
|
}
|
|
18910
18917
|
function isSupportedNativeIntegration(provider) {
|
|
18911
18918
|
if (!provider)
|
|
@@ -18932,6 +18939,8 @@ var BuildingBlockResourceCenter = (function () {
|
|
|
18932
18939
|
return 'Intercom';
|
|
18933
18940
|
case 'drift-native-chat':
|
|
18934
18941
|
return 'drift';
|
|
18942
|
+
case 'visitorAssist':
|
|
18943
|
+
return 'visitorAssist';
|
|
18935
18944
|
default:
|
|
18936
18945
|
return null;
|
|
18937
18946
|
}
|
|
@@ -19029,6 +19038,9 @@ var BuildingBlockResourceCenter = (function () {
|
|
|
19029
19038
|
break;
|
|
19030
19039
|
case 'drift-native-chat':
|
|
19031
19040
|
configureDriftChatSettings();
|
|
19041
|
+
break;
|
|
19042
|
+
case 'visitorAssist':
|
|
19043
|
+
configureVisitorAssistChatSettings();
|
|
19032
19044
|
}
|
|
19033
19045
|
}
|
|
19034
19046
|
function webWidgetWrapper(provider, ...webWidgetArgs) {
|
|
@@ -19134,6 +19146,11 @@ var BuildingBlockResourceCenter = (function () {
|
|
|
19134
19146
|
endNativeChatExperience();
|
|
19135
19147
|
});
|
|
19136
19148
|
}
|
|
19149
|
+
function configureVisitorAssistChatSettings() {
|
|
19150
|
+
window.visitorAssist.onClose(function () {
|
|
19151
|
+
endNativeChatExperience();
|
|
19152
|
+
});
|
|
19153
|
+
}
|
|
19137
19154
|
function flattenMetadata(metadata) {
|
|
19138
19155
|
const flatMetadata = {};
|
|
19139
19156
|
for (const key in metadata) {
|
|
@@ -19243,6 +19260,9 @@ var BuildingBlockResourceCenter = (function () {
|
|
|
19243
19260
|
});
|
|
19244
19261
|
}
|
|
19245
19262
|
break;
|
|
19263
|
+
case 'visitorAssist':
|
|
19264
|
+
window.visitorAssist.launch();
|
|
19265
|
+
break;
|
|
19246
19266
|
}
|
|
19247
19267
|
// reset chat notification count
|
|
19248
19268
|
updateNotificationBubbleCount(0, 'chat');
|
|
@@ -23828,32 +23848,11 @@ const captureStepRenderStatus = (step, eligible, reason) => {
|
|
|
23828
23848
|
Events.stepEligibility.trigger({ stepId: id, guideId, eligible, reason });
|
|
23829
23849
|
return eligible;
|
|
23830
23850
|
};
|
|
23831
|
-
function isHtmlTooltipStep(step) {
|
|
23832
|
-
if (_.get(step, 'attributes.buildingBlockLayoutType') !== 'tooltip')
|
|
23833
|
-
return false;
|
|
23834
|
-
return Boolean(_.get(step, 'attributes.htmlContent') || step.htmlContent || step.htmlContentUrl);
|
|
23835
|
-
}
|
|
23836
|
-
function getHtmlTooltipSelector(step) {
|
|
23837
|
-
return step.elementPathRule || _.get(step, 'attributes.elementPathRule');
|
|
23838
|
-
}
|
|
23839
23851
|
var canStepBeRendered = function (step) {
|
|
23840
23852
|
const statusWriter = _.partial(captureStepRenderStatus, step);
|
|
23841
23853
|
if (isDismissedUntilReload(step)) {
|
|
23842
23854
|
return statusWriter(false, 'dismissed');
|
|
23843
23855
|
}
|
|
23844
|
-
// HTML guide tooltips don't set step.type === 'tooltip' (they keep the
|
|
23845
|
-
// guide-level type, typically 'lightbox') and don't have step.domJson, so
|
|
23846
|
-
// the standard tooltip detection below misses them. Without filtering here,
|
|
23847
|
-
// an HTML tooltip with a missing or invisible anchor sails through eligibility
|
|
23848
|
-
// and silently falls back to a lightbox layout at render time.
|
|
23849
|
-
if (isHtmlTooltipStep(step)) {
|
|
23850
|
-
var htmlSelector = getHtmlTooltipSelector(step);
|
|
23851
|
-
var htmlAnchor = htmlSelector ? SizzleProxy(htmlSelector)[0] : null;
|
|
23852
|
-
if (isElementVisible(htmlAnchor)) {
|
|
23853
|
-
return statusWriter(true, 'target_element_html_tooltip');
|
|
23854
|
-
}
|
|
23855
|
-
return statusWriter(wouldBeVisibleAfterAutoScroll(htmlAnchor), 'target_element_html_tooltip_scroll');
|
|
23856
|
-
}
|
|
23857
23856
|
if (!step.elementPathRule && (step.type === 'lightbox' || step.type === 'whatsnew')) {
|
|
23858
23857
|
return statusWriter(true, '');
|
|
23859
23858
|
}
|
|
@@ -24172,7 +24171,6 @@ function createGuideEvent(name, guideId, stepId, visitorId, reason, language) {
|
|
|
24172
24171
|
type: name,
|
|
24173
24172
|
guideId,
|
|
24174
24173
|
stepId,
|
|
24175
|
-
visitorId,
|
|
24176
24174
|
language
|
|
24177
24175
|
};
|
|
24178
24176
|
}
|
|
@@ -24188,7 +24186,7 @@ function createGuideEvent(name, guideId, stepId, visitorId, reason, language) {
|
|
|
24188
24186
|
}, _.omit(params, 'type', 'guideId', 'stepId', 'visitorId'));
|
|
24189
24187
|
var event = EventTracer.addTracerIds({
|
|
24190
24188
|
type: params.type,
|
|
24191
|
-
visitor_id:
|
|
24189
|
+
visitor_id: get_visitor_id({ generate: true }),
|
|
24192
24190
|
account_id: get_account_id(),
|
|
24193
24191
|
browser_time: new Date().getTime(),
|
|
24194
24192
|
url: pendoDotUrl.externalizeURL(),
|
|
@@ -24760,7 +24758,7 @@ var getGuideEventCache = function () {
|
|
|
24760
24758
|
};
|
|
24761
24759
|
function createGuideEventQueue(options) {
|
|
24762
24760
|
const processSilos = pipeline(filterAnalyticsDisabled, splitSiloOnFieldChange('visitor_id'), splitSiloOnFieldChange('props.source'), filterAccountIdsForSendQueue, compressSilo, errorLogger(), addSiloParams(options), addAccountIdParamIfAdoptPartner, addSourceParamIfPresent, convertSiloToObject);
|
|
24763
|
-
const packageSilos = pipeline(fireEventCaptured, eventSequence, siloReducer(options.cache), _.noop // do not move to the silo queue until manual flush
|
|
24761
|
+
const packageSilos = pipeline(filterBrokenTimestamps, fireEventCaptured, eventSequence, siloReducer(options.cache), _.noop // do not move to the silo queue until manual flush
|
|
24764
24762
|
);
|
|
24765
24763
|
return new EventQueue(_.extend({ processSilos, packageSilos }, options));
|
|
24766
24764
|
}
|
|
@@ -28444,7 +28442,8 @@ const PluginAPI = {
|
|
|
28444
28442
|
},
|
|
28445
28443
|
guides: {
|
|
28446
28444
|
GuideFactory,
|
|
28447
|
-
GuideStepFactory
|
|
28445
|
+
GuideStepFactory,
|
|
28446
|
+
getElementForGuideStep
|
|
28448
28447
|
},
|
|
28449
28448
|
hosts: {
|
|
28450
28449
|
SERVER
|
|
@@ -40847,17 +40846,19 @@ function TextCapture() {
|
|
|
40847
40846
|
}
|
|
40848
40847
|
}
|
|
40849
40848
|
|
|
40850
|
-
|
|
40851
|
-
|
|
40852
|
-
|
|
40853
|
-
|
|
40854
|
-
|
|
40855
|
-
function lookupGuideButtons(domJson, buttons
|
|
40849
|
+
var substitutionRegex = '\\{(?:\\s?)([^.\\s]?visitor|account|parentAccount)\\.([^|\\s/]*)(?:\\s?\\|\\s?([^}]+|[\\/s]+))?(?:\\s?\\/\\s?){1}\\}';
|
|
40850
|
+
var skipStepString = '{skipStep:* *(auto|\\d+)\\/}';
|
|
40851
|
+
var goToMiddleString = '(?!0)(\\d+)';
|
|
40852
|
+
var goToString = "({goto-".concat(goToMiddleString, "\\/})");
|
|
40853
|
+
var containerSelector = '[id^="pendo-guide-container"]';
|
|
40854
|
+
function lookupGuideButtons(domJson, buttons) {
|
|
40855
|
+
if (buttons === void 0) { buttons = []; }
|
|
40856
40856
|
if (domJson.type === 'button' && domJson.actions) {
|
|
40857
40857
|
buttons.push(domJson);
|
|
40858
40858
|
}
|
|
40859
40859
|
if (domJson.children) {
|
|
40860
|
-
for (
|
|
40860
|
+
for (var _i = 0, _a = domJson.children; _i < _a.length; _i++) {
|
|
40861
|
+
var child = _a[_i];
|
|
40861
40862
|
lookupGuideButtons(child, buttons);
|
|
40862
40863
|
}
|
|
40863
40864
|
}
|
|
@@ -40886,15 +40887,16 @@ function removeMarkdownSyntax(element, textToReplace, replacementText, pendo) {
|
|
|
40886
40887
|
}
|
|
40887
40888
|
}
|
|
40888
40889
|
var guideMarkdownUtil = {
|
|
40889
|
-
substitutionRegex,
|
|
40890
|
-
skipStepString,
|
|
40891
|
-
goToString,
|
|
40892
|
-
containerSelector,
|
|
40893
|
-
lookupGuideButtons,
|
|
40894
|
-
removeMarkdownSyntax
|
|
40890
|
+
substitutionRegex: substitutionRegex,
|
|
40891
|
+
skipStepString: skipStepString,
|
|
40892
|
+
goToString: goToString,
|
|
40893
|
+
containerSelector: containerSelector,
|
|
40894
|
+
lookupGuideButtons: lookupGuideButtons,
|
|
40895
|
+
removeMarkdownSyntax: removeMarkdownSyntax
|
|
40895
40896
|
};
|
|
40896
40897
|
|
|
40897
|
-
function getZoneSafeMethod(_, method, target
|
|
40898
|
+
function getZoneSafeMethod(_, method, target) {
|
|
40899
|
+
if (target === void 0) { target = window; }
|
|
40898
40900
|
var zoneSymbol = '__symbol__';
|
|
40899
40901
|
/* global Zone */
|
|
40900
40902
|
if (typeof Zone !== 'undefined' && _.isFunction(Zone[zoneSymbol])) {
|
|
@@ -48943,31 +48945,32 @@ var n;
|
|
|
48943
48945
|
}(n || (n = {}));
|
|
48944
48946
|
return record; }
|
|
48945
48947
|
|
|
48946
|
-
|
|
48947
|
-
|
|
48948
|
+
var SessionRecorderBuffer = /** @class */ (function () {
|
|
48949
|
+
function SessionRecorderBuffer(interval, maxCount) {
|
|
48950
|
+
if (maxCount === void 0) { maxCount = Infinity; }
|
|
48948
48951
|
this.data = [];
|
|
48949
48952
|
this.sequenceNumber = 0;
|
|
48950
48953
|
this.interval = interval;
|
|
48951
48954
|
this.maxCount = maxCount;
|
|
48952
48955
|
this.doubledMaxCount = maxCount * 2;
|
|
48953
48956
|
}
|
|
48954
|
-
isEmpty() {
|
|
48957
|
+
SessionRecorderBuffer.prototype.isEmpty = function () {
|
|
48955
48958
|
return this.data.length === 0;
|
|
48956
|
-
}
|
|
48957
|
-
count() {
|
|
48959
|
+
};
|
|
48960
|
+
SessionRecorderBuffer.prototype.count = function () {
|
|
48958
48961
|
return this.data.length;
|
|
48959
|
-
}
|
|
48960
|
-
clear() {
|
|
48962
|
+
};
|
|
48963
|
+
SessionRecorderBuffer.prototype.clear = function () {
|
|
48961
48964
|
this.data.length = 0;
|
|
48962
|
-
}
|
|
48963
|
-
clearSequence() {
|
|
48965
|
+
};
|
|
48966
|
+
SessionRecorderBuffer.prototype.clearSequence = function () {
|
|
48964
48967
|
this.sequenceNumber = 0;
|
|
48965
|
-
}
|
|
48966
|
-
push(event) {
|
|
48968
|
+
};
|
|
48969
|
+
SessionRecorderBuffer.prototype.push = function (event) {
|
|
48967
48970
|
this.data.push(event);
|
|
48968
48971
|
this.checkRateLimit();
|
|
48969
|
-
}
|
|
48970
|
-
pack(envelope, _) {
|
|
48972
|
+
};
|
|
48973
|
+
SessionRecorderBuffer.prototype.pack = function (envelope, _) {
|
|
48971
48974
|
var eventsToSend = this.data.splice(0, this.maxCount);
|
|
48972
48975
|
envelope.recordingPayload = eventsToSend;
|
|
48973
48976
|
envelope.sequence = this.sequenceNumber;
|
|
@@ -48975,8 +48978,8 @@ class SessionRecorderBuffer {
|
|
|
48975
48978
|
if (eventsToSend.length) {
|
|
48976
48979
|
envelope.browserTime = eventsToSend[0].timestamp;
|
|
48977
48980
|
}
|
|
48978
|
-
envelope.recordingPayloadMetadata = _.map(eventsToSend, event
|
|
48979
|
-
|
|
48981
|
+
envelope.recordingPayloadMetadata = _.map(eventsToSend, function (event) {
|
|
48982
|
+
var metadata = _.pick(event, 'type', 'timestamp');
|
|
48980
48983
|
if (event.data) {
|
|
48981
48984
|
metadata.data = _.pick(event.data, 'source', 'type', 'x', 'y', 'id', 'height', 'width', 'href');
|
|
48982
48985
|
}
|
|
@@ -48984,17 +48987,18 @@ class SessionRecorderBuffer {
|
|
|
48984
48987
|
});
|
|
48985
48988
|
this.sequenceNumber += eventsToSend.length;
|
|
48986
48989
|
return envelope;
|
|
48987
|
-
}
|
|
48988
|
-
checkRateLimit() {
|
|
48989
|
-
|
|
48990
|
+
};
|
|
48991
|
+
SessionRecorderBuffer.prototype.checkRateLimit = function () {
|
|
48992
|
+
var length = this.data.length;
|
|
48990
48993
|
if (length >= this.doubledMaxCount && length % this.maxCount === 0) {
|
|
48991
|
-
|
|
48994
|
+
var elapsed = this.data[length - 1].timestamp - this.data[length - this.doubledMaxCount].timestamp;
|
|
48992
48995
|
if (elapsed <= this.interval && this.onRateLimit) {
|
|
48993
48996
|
this.onRateLimit();
|
|
48994
48997
|
}
|
|
48995
48998
|
}
|
|
48996
|
-
}
|
|
48997
|
-
|
|
48999
|
+
};
|
|
49000
|
+
return SessionRecorderBuffer;
|
|
49001
|
+
}());
|
|
48998
49002
|
|
|
48999
49003
|
function __rest(s, e) {
|
|
49000
49004
|
var t = {};
|
|
@@ -49018,24 +49022,52 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
49018
49022
|
});
|
|
49019
49023
|
}
|
|
49020
49024
|
|
|
49025
|
+
function __generator(thisArg, body) {
|
|
49026
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
49027
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
49028
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
49029
|
+
function step(op) {
|
|
49030
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
49031
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
49032
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
49033
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
49034
|
+
switch (op[0]) {
|
|
49035
|
+
case 0: case 1: t = op; break;
|
|
49036
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
49037
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
49038
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
49039
|
+
default:
|
|
49040
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
49041
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
49042
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
49043
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
49044
|
+
if (t[2]) _.ops.pop();
|
|
49045
|
+
_.trys.pop(); continue;
|
|
49046
|
+
}
|
|
49047
|
+
op = body.call(thisArg, _);
|
|
49048
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
49049
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
49050
|
+
}
|
|
49051
|
+
}
|
|
49052
|
+
|
|
49021
49053
|
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
49022
49054
|
var e = new Error(message);
|
|
49023
49055
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
49024
49056
|
};
|
|
49025
49057
|
|
|
49026
|
-
|
|
49027
|
-
|
|
49028
|
-
|
|
49029
|
-
|
|
49030
|
-
|
|
49058
|
+
var RECORDING_CONFIG_WORKERURL$1 = 'recording.workerUrl';
|
|
49059
|
+
var MAX_SIZE = 2000000;
|
|
49060
|
+
var RESOURCE_CACHING$1 = 'resourceCaching';
|
|
49061
|
+
var Transport = /** @class */ (function () {
|
|
49062
|
+
function Transport(WorkerClass, pendo, api) {
|
|
49031
49063
|
this.WorkerClass = WorkerClass;
|
|
49032
49064
|
this.pendo = pendo;
|
|
49033
49065
|
this.api = api;
|
|
49034
49066
|
this.maxSize = MAX_SIZE;
|
|
49035
|
-
this.lockID =
|
|
49067
|
+
this.lockID = "worker-lock-".concat(this.pendo.randomString(16));
|
|
49036
49068
|
this.isResourceCachingEnabled = this.api.ConfigReader.get(RESOURCE_CACHING$1);
|
|
49037
49069
|
}
|
|
49038
|
-
start(config) {
|
|
49070
|
+
Transport.prototype.start = function (config) {
|
|
49039
49071
|
if (config.disableWorker)
|
|
49040
49072
|
return;
|
|
49041
49073
|
if (!this.worker) {
|
|
@@ -49045,7 +49077,7 @@ class Transport {
|
|
|
49045
49077
|
this.worker = config.workerOverride;
|
|
49046
49078
|
}
|
|
49047
49079
|
else {
|
|
49048
|
-
|
|
49080
|
+
var workerUrl = this.api.ConfigReader.get(RECORDING_CONFIG_WORKERURL$1);
|
|
49049
49081
|
this.usesSelfHostedWorker = workerUrl != null;
|
|
49050
49082
|
this.worker = workerUrl ? new Worker(workerUrl) : new this.WorkerClass();
|
|
49051
49083
|
}
|
|
@@ -49059,34 +49091,35 @@ class Transport {
|
|
|
49059
49091
|
this.worker = null;
|
|
49060
49092
|
}
|
|
49061
49093
|
}
|
|
49062
|
-
}
|
|
49063
|
-
stop() {
|
|
49094
|
+
};
|
|
49095
|
+
Transport.prototype.stop = function () {
|
|
49064
49096
|
if (this.worker) {
|
|
49065
49097
|
this.worker.terminate();
|
|
49066
49098
|
delete this.worker;
|
|
49067
49099
|
}
|
|
49068
|
-
}
|
|
49069
|
-
send(envelope, isUnload, failureCount
|
|
49070
|
-
|
|
49071
|
-
|
|
49100
|
+
};
|
|
49101
|
+
Transport.prototype.send = function (envelope, isUnload, failureCount) {
|
|
49102
|
+
if (failureCount === void 0) { failureCount = 0; }
|
|
49103
|
+
var url = envelope.url;
|
|
49104
|
+
var payload = envelope.payload;
|
|
49072
49105
|
if (failureCount > 0) {
|
|
49073
|
-
url =
|
|
49106
|
+
url = "".concat(url, "&rt=").concat(failureCount);
|
|
49074
49107
|
}
|
|
49075
49108
|
if (this.worker && !isUnload && payload) {
|
|
49076
|
-
|
|
49077
|
-
|
|
49078
|
-
|
|
49079
|
-
|
|
49109
|
+
var deferred_1 = {};
|
|
49110
|
+
deferred_1.promise = new Promise$2(function (resolve, reject) {
|
|
49111
|
+
deferred_1.resolve = resolve;
|
|
49112
|
+
deferred_1.reject = reject;
|
|
49080
49113
|
});
|
|
49081
|
-
this.workerResponse =
|
|
49082
|
-
this.worker.postMessage({ url, payload, shouldCacheResources: this.isResourceCachingEnabled });
|
|
49083
|
-
return
|
|
49114
|
+
this.workerResponse = deferred_1;
|
|
49115
|
+
this.worker.postMessage({ url: url, payload: payload, shouldCacheResources: this.isResourceCachingEnabled });
|
|
49116
|
+
return deferred_1.promise;
|
|
49084
49117
|
}
|
|
49085
49118
|
else {
|
|
49086
49119
|
if (!envelope.body) {
|
|
49087
|
-
|
|
49120
|
+
var strPayload = JSON.stringify(payload);
|
|
49088
49121
|
if (strPayload.length > this.maxSize) {
|
|
49089
|
-
|
|
49122
|
+
var error = new Error('maximum recording payload size exceeded');
|
|
49090
49123
|
error.reason = 'HEAVY_EVENT';
|
|
49091
49124
|
error.context = {
|
|
49092
49125
|
size: strPayload.length,
|
|
@@ -49097,14 +49130,14 @@ class Transport {
|
|
|
49097
49130
|
envelope.body = this.pendo.compress(strPayload, 'binary');
|
|
49098
49131
|
delete envelope.payload;
|
|
49099
49132
|
}
|
|
49100
|
-
url =
|
|
49133
|
+
url = "".concat(url, "&ct=").concat(new Date().getTime());
|
|
49101
49134
|
return this.post(url, {
|
|
49102
49135
|
keepalive: isUnload,
|
|
49103
49136
|
body: envelope.body
|
|
49104
49137
|
});
|
|
49105
49138
|
}
|
|
49106
|
-
}
|
|
49107
|
-
post(url, options) {
|
|
49139
|
+
};
|
|
49140
|
+
Transport.prototype.post = function (url, options) {
|
|
49108
49141
|
options.method = 'POST';
|
|
49109
49142
|
if (options.keepalive && this.api.transmit.fetchKeepalive.supported()) {
|
|
49110
49143
|
return this.api.transmit.fetchKeepalive(url, options);
|
|
@@ -49116,46 +49149,57 @@ class Transport {
|
|
|
49116
49149
|
else {
|
|
49117
49150
|
return this.pendo.ajax.post(url, options.body);
|
|
49118
49151
|
}
|
|
49119
|
-
}
|
|
49120
|
-
_onMessage(messageEvent) {
|
|
49121
|
-
return __awaiter(this, void 0, void 0, function
|
|
49122
|
-
|
|
49123
|
-
|
|
49124
|
-
|
|
49125
|
-
|
|
49126
|
-
|
|
49127
|
-
|
|
49128
|
-
|
|
49129
|
-
|
|
49130
|
-
|
|
49131
|
-
|
|
49132
|
-
|
|
49133
|
-
|
|
49134
|
-
|
|
49135
|
-
|
|
49136
|
-
|
|
49137
|
-
|
|
49138
|
-
|
|
49139
|
-
|
|
49140
|
-
|
|
49152
|
+
};
|
|
49153
|
+
Transport.prototype._onMessage = function (messageEvent) {
|
|
49154
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
49155
|
+
return __generator(this, function (_a) {
|
|
49156
|
+
switch (_a.label) {
|
|
49157
|
+
case 0:
|
|
49158
|
+
if (!(messageEvent.data && messageEvent.data.ready && navigator.locks)) return [3 /*break*/, 2];
|
|
49159
|
+
// When the lock is released, we can assume the worker was terminated or closed
|
|
49160
|
+
return [4 /*yield*/, navigator.locks.request(this.lockID, function () { })];
|
|
49161
|
+
case 1:
|
|
49162
|
+
// When the lock is released, we can assume the worker was terminated or closed
|
|
49163
|
+
_a.sent();
|
|
49164
|
+
this.onWorkerMessage({ type: 'workerDied' });
|
|
49165
|
+
_a.label = 2;
|
|
49166
|
+
case 2:
|
|
49167
|
+
// handle non-POST request responses from worker
|
|
49168
|
+
if (messageEvent.data && messageEvent.data.type) {
|
|
49169
|
+
this.onWorkerMessage(messageEvent.data);
|
|
49170
|
+
return [2 /*return*/];
|
|
49171
|
+
}
|
|
49172
|
+
// handle POST request response from worker
|
|
49173
|
+
if (messageEvent.data && messageEvent.data.error) {
|
|
49174
|
+
if ((messageEvent.data.status && messageEvent.data.status < 500) ||
|
|
49175
|
+
messageEvent.data.sequence == null) {
|
|
49176
|
+
this.api.log.critical('Failed to send recording data from web worker', { error: messageEvent.data.error });
|
|
49177
|
+
}
|
|
49178
|
+
if (this.workerResponse) {
|
|
49179
|
+
this.workerResponse.reject();
|
|
49180
|
+
this.workerResponse = null;
|
|
49181
|
+
}
|
|
49182
|
+
}
|
|
49183
|
+
if (this.workerResponse) {
|
|
49184
|
+
this.workerResponse.resolve();
|
|
49185
|
+
this.workerResponse = null;
|
|
49186
|
+
}
|
|
49187
|
+
return [2 /*return*/];
|
|
49141
49188
|
}
|
|
49142
|
-
}
|
|
49143
|
-
if (this.workerResponse) {
|
|
49144
|
-
this.workerResponse.resolve();
|
|
49145
|
-
this.workerResponse = null;
|
|
49146
|
-
}
|
|
49189
|
+
});
|
|
49147
49190
|
});
|
|
49148
|
-
}
|
|
49149
|
-
_onError() {
|
|
49191
|
+
};
|
|
49192
|
+
Transport.prototype._onError = function () {
|
|
49150
49193
|
if (this.onError) {
|
|
49151
49194
|
this.onError();
|
|
49152
49195
|
}
|
|
49153
|
-
}
|
|
49154
|
-
|
|
49196
|
+
};
|
|
49197
|
+
return Transport;
|
|
49198
|
+
}());
|
|
49155
49199
|
|
|
49156
|
-
|
|
49157
|
-
|
|
49158
|
-
|
|
49200
|
+
var ELEMENT_NODE = 1;
|
|
49201
|
+
var INPUT_MASK = '*'.repeat(10);
|
|
49202
|
+
var NUMBER_INPUT_MASK = '0'.repeat(10);
|
|
49159
49203
|
function isElementNode(node) {
|
|
49160
49204
|
if (!node)
|
|
49161
49205
|
return false;
|
|
@@ -49164,10 +49208,12 @@ function isElementNode(node) {
|
|
|
49164
49208
|
return true;
|
|
49165
49209
|
}
|
|
49166
49210
|
function getParent(elem) {
|
|
49167
|
-
|
|
49211
|
+
var isElementShadowRoot = typeof window.ShadowRoot !== 'undefined' && elem instanceof window.ShadowRoot && elem.host;
|
|
49168
49212
|
return isElementShadowRoot ? elem.host : elem.parentNode;
|
|
49169
49213
|
}
|
|
49170
|
-
function distanceToMatch(node, selector, limit
|
|
49214
|
+
function distanceToMatch(node, selector, limit, distance) {
|
|
49215
|
+
if (limit === void 0) { limit = Infinity; }
|
|
49216
|
+
if (distance === void 0) { distance = 0; }
|
|
49171
49217
|
if (distance > limit)
|
|
49172
49218
|
return -1;
|
|
49173
49219
|
if (!node)
|
|
@@ -49181,13 +49227,13 @@ function distanceToMatch(node, selector, limit = Infinity, distance = 0) {
|
|
|
49181
49227
|
return distanceToMatch(getParent(node), selector, limit, distance + 1);
|
|
49182
49228
|
}
|
|
49183
49229
|
function shouldMask(node, options) {
|
|
49184
|
-
|
|
49230
|
+
var maskAllText = options.maskAllText, maskTextSelector = options.maskTextSelector, unmaskTextSelector = options.unmaskTextSelector;
|
|
49185
49231
|
try {
|
|
49186
|
-
|
|
49232
|
+
var el = isElementNode(node) ? node : node.parentElement;
|
|
49187
49233
|
if (el === null)
|
|
49188
49234
|
return false;
|
|
49189
|
-
|
|
49190
|
-
|
|
49235
|
+
var maskDistance = -1;
|
|
49236
|
+
var unmaskDistance = -1;
|
|
49191
49237
|
if (maskAllText) {
|
|
49192
49238
|
unmaskDistance = distanceToMatch(el, unmaskTextSelector);
|
|
49193
49239
|
if (unmaskDistance < 0) {
|
|
@@ -49220,8 +49266,8 @@ function isNumberInput(element) {
|
|
|
49220
49266
|
}
|
|
49221
49267
|
function shouldMaskInput(element, maskInputOptions) {
|
|
49222
49268
|
if (maskInputOptions && isElementNode(element)) {
|
|
49223
|
-
|
|
49224
|
-
|
|
49269
|
+
var tagName = (element.tagName || '').toLowerCase();
|
|
49270
|
+
var type = (element.type || '').toLowerCase();
|
|
49225
49271
|
if (maskInputOptions[tagName] || maskInputOptions[type]) {
|
|
49226
49272
|
return true;
|
|
49227
49273
|
}
|
|
@@ -49420,9 +49466,15 @@ class SessionRecorder {
|
|
|
49420
49466
|
this.api.attachEvent(this.api.Events, 'eventCaptured', bind(this.addRecordingId, this)),
|
|
49421
49467
|
this.api.attachEvent(this.api.Events, 'transmit:locked', bind(this.stop, this)),
|
|
49422
49468
|
this.api.attachEvent(this.api.Events, 'transmit:unlocked', bind(this._start, this)),
|
|
49423
|
-
this.api.attachEvent(this.api.frames.getChannel(), 'message', bind(this._frameMessage, this)),
|
|
49424
49469
|
this.api.attachEvent(this.api.Events, 'tabIdChanged:self', bind(this.handleTabIdChange, this))
|
|
49425
49470
|
];
|
|
49471
|
+
// APP-153357 Zone.js could bypass filterCrossWindowMessages (don't use attachEvent)
|
|
49472
|
+
const channel = this.api.frames.getChannel();
|
|
49473
|
+
const frameMessageHandler = bind(this._frameMessage, this);
|
|
49474
|
+
channel.addEventListener('message', frameMessageHandler);
|
|
49475
|
+
this.subscriptions.push(() => {
|
|
49476
|
+
channel.removeEventListener('message', frameMessageHandler);
|
|
49477
|
+
});
|
|
49426
49478
|
if (this.api.store.getters['frames/isReady']()) {
|
|
49427
49479
|
this.ready();
|
|
49428
49480
|
}
|
|
@@ -50833,12 +50885,12 @@ function createReplayPlugin() {
|
|
|
50833
50885
|
* limit of number of keys in an object
|
|
50834
50886
|
* if an object contains more keys than this limit, we would call its toString function directly
|
|
50835
50887
|
*/
|
|
50836
|
-
|
|
50888
|
+
var NUM_OF_KEYS_LIMIT = 50;
|
|
50837
50889
|
/**
|
|
50838
50890
|
* limit number of depth in an object
|
|
50839
50891
|
* if an object is too deep, toString process may cause browser OOM
|
|
50840
50892
|
*/
|
|
50841
|
-
|
|
50893
|
+
var DEPTH_OF_LIMIT = 4;
|
|
50842
50894
|
/**
|
|
50843
50895
|
* serialize an HTML element by creating a shallow clone of it with text content
|
|
50844
50896
|
* and return the resulting outerHTML string (without the subtree)
|
|
@@ -50849,8 +50901,8 @@ function serializeHTML(node) {
|
|
|
50849
50901
|
if (!node || node.nodeType !== node.ELEMENT_NODE) {
|
|
50850
50902
|
return '';
|
|
50851
50903
|
}
|
|
50852
|
-
|
|
50853
|
-
|
|
50904
|
+
var nodeClone = node.cloneNode(false);
|
|
50905
|
+
var textContent = node.textContent;
|
|
50854
50906
|
if (textContent) {
|
|
50855
50907
|
nodeClone.textContent = textContent;
|
|
50856
50908
|
}
|
|
@@ -50864,7 +50916,7 @@ function isObject(obj) {
|
|
|
50864
50916
|
return false;
|
|
50865
50917
|
if (typeof obj !== 'object')
|
|
50866
50918
|
return false;
|
|
50867
|
-
|
|
50919
|
+
var proto = Object.getPrototypeOf(obj);
|
|
50868
50920
|
return proto === Object.prototype || proto === null;
|
|
50869
50921
|
}
|
|
50870
50922
|
/**
|
|
@@ -50873,11 +50925,11 @@ function isObject(obj) {
|
|
|
50873
50925
|
function isObjTooDeep(obj, limit) {
|
|
50874
50926
|
if (limit === 0)
|
|
50875
50927
|
return true;
|
|
50876
|
-
|
|
50928
|
+
var keys = Object.keys(obj);
|
|
50877
50929
|
if (keys.length === 0)
|
|
50878
50930
|
return false;
|
|
50879
|
-
return keys.some(key
|
|
50880
|
-
|
|
50931
|
+
return keys.some(function (key) {
|
|
50932
|
+
var value = obj[key];
|
|
50881
50933
|
return isObject(value) && isObjTooDeep(value, limit - 1);
|
|
50882
50934
|
});
|
|
50883
50935
|
}
|
|
@@ -50893,7 +50945,7 @@ function shouldIgnore(_obj) {
|
|
|
50893
50945
|
return false;
|
|
50894
50946
|
}
|
|
50895
50947
|
// out of keys limit
|
|
50896
|
-
|
|
50948
|
+
var keys = Object.keys(_obj);
|
|
50897
50949
|
if (keys.length > NUM_OF_KEYS_LIMIT) {
|
|
50898
50950
|
return true;
|
|
50899
50951
|
}
|
|
@@ -50925,7 +50977,7 @@ function stringify(arg) {
|
|
|
50925
50977
|
return value.toString ? value.toString() : '[object Object]';
|
|
50926
50978
|
}
|
|
50927
50979
|
if (value instanceof ArrayBuffer)
|
|
50928
|
-
return
|
|
50980
|
+
return "ArrayBuffer { byteLength: ".concat(value.byteLength, " }");
|
|
50929
50981
|
if (value instanceof Error)
|
|
50930
50982
|
return value.name + ': ' + value.message;
|
|
50931
50983
|
if (value instanceof Node) {
|
|
@@ -50933,10 +50985,10 @@ function stringify(arg) {
|
|
|
50933
50985
|
}
|
|
50934
50986
|
// Handle events
|
|
50935
50987
|
if (value instanceof Event) {
|
|
50936
|
-
|
|
50988
|
+
var eventResult = {};
|
|
50937
50989
|
// eslint-disable-next-line guard-for-in
|
|
50938
|
-
for (
|
|
50939
|
-
|
|
50990
|
+
for (var eventKey in value) {
|
|
50991
|
+
var eventValue = value[eventKey];
|
|
50940
50992
|
eventResult[eventKey] = Array.isArray(eventValue) && eventValue[0] instanceof HTMLElement
|
|
50941
50993
|
? serializeHTML(eventValue[0])
|
|
50942
50994
|
: eventValue;
|
|
@@ -50947,30 +50999,31 @@ function stringify(arg) {
|
|
|
50947
50999
|
});
|
|
50948
51000
|
}
|
|
50949
51001
|
|
|
50950
|
-
|
|
50951
|
-
|
|
51002
|
+
var StackFrame = /** @class */ (function () {
|
|
51003
|
+
function StackFrame(obj) {
|
|
50952
51004
|
this.fileName = obj.fileName || '';
|
|
50953
51005
|
this.functionName = obj.functionName || '';
|
|
50954
51006
|
this.lineNumber = obj.lineNumber;
|
|
50955
51007
|
this.columnNumber = obj.columnNumber;
|
|
50956
51008
|
}
|
|
50957
|
-
toString() {
|
|
50958
|
-
|
|
51009
|
+
StackFrame.prototype.toString = function () {
|
|
51010
|
+
var _a = this, fileName = _a.fileName, functionName = _a.functionName, _b = _a.lineNumber, lineNumber = _b === void 0 ? '' : _b, _c = _a.columnNumber, columnNumber = _c === void 0 ? '' : _c;
|
|
50959
51011
|
return functionName
|
|
50960
|
-
?
|
|
50961
|
-
:
|
|
50962
|
-
}
|
|
50963
|
-
|
|
50964
|
-
|
|
50965
|
-
|
|
50966
|
-
|
|
50967
|
-
|
|
50968
|
-
|
|
50969
|
-
|
|
51012
|
+
? "".concat(functionName, " (").concat(fileName, ":").concat(lineNumber, ":").concat(columnNumber, ")")
|
|
51013
|
+
: "".concat(fileName, ":").concat(lineNumber, ":").concat(columnNumber);
|
|
51014
|
+
};
|
|
51015
|
+
return StackFrame;
|
|
51016
|
+
}());
|
|
51017
|
+
var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\S+:\d+/;
|
|
51018
|
+
var CHROME_EDGE_STACK_REGEXP = /^\s*at .*(\S+:\d+|\(native\))/m;
|
|
51019
|
+
var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code])?$/;
|
|
51020
|
+
var LOCATION_REGEXP = /(.+?)(?::(\d+))?(?::(\d+))?$/;
|
|
51021
|
+
var DEFAULT_NUM_FRAMES_TO_SKIP = 5;
|
|
51022
|
+
var ErrorStackParser = {
|
|
50970
51023
|
/**
|
|
50971
51024
|
* Given an Error object, extract the most information from it.
|
|
50972
51025
|
*/
|
|
50973
|
-
parse(error, maxFramesToSave) {
|
|
51026
|
+
parse: function (error, maxFramesToSave) {
|
|
50974
51027
|
if (!(error === null || error === void 0 ? void 0 : error.stack))
|
|
50975
51028
|
return [];
|
|
50976
51029
|
// Chrome, Edge, Opera ≥15
|
|
@@ -50984,24 +51037,25 @@ const ErrorStackParser = {
|
|
|
50984
51037
|
return [];
|
|
50985
51038
|
},
|
|
50986
51039
|
// Separate line and column numbers from a string of the form: (URI:Line:Column)
|
|
50987
|
-
extractLocation(urlLike) {
|
|
51040
|
+
extractLocation: function (urlLike) {
|
|
50988
51041
|
// Fail-fast but return locations like "(native)"
|
|
50989
51042
|
if (urlLike.indexOf(':') === -1) {
|
|
50990
51043
|
return [urlLike];
|
|
50991
51044
|
}
|
|
50992
|
-
|
|
51045
|
+
var parts = LOCATION_REGEXP.exec(urlLike.replace(/[()]/g, ''));
|
|
50993
51046
|
if (!parts)
|
|
50994
|
-
throw new Error(
|
|
51047
|
+
throw new Error("Cannot parse given url: ".concat(urlLike));
|
|
50995
51048
|
return [parts[1], parts[2] || undefined, parts[3] || undefined];
|
|
50996
51049
|
},
|
|
50997
|
-
parseHelper
|
|
50998
|
-
|
|
50999
|
-
|
|
51000
|
-
|
|
51001
|
-
|
|
51002
|
-
|
|
51003
|
-
|
|
51004
|
-
|
|
51050
|
+
parseHelper: function (_a, error, maxFramesToSave, callback) {
|
|
51051
|
+
var regex = _a.regex, includeMatchedLine = _a.includeMatchedLine;
|
|
51052
|
+
var lines = error.stack.split('\n');
|
|
51053
|
+
var frames = [];
|
|
51054
|
+
var validFramesFound = 0;
|
|
51055
|
+
for (var i = 0; i < lines.length; i++) {
|
|
51056
|
+
var line = lines[i];
|
|
51057
|
+
var lineMatchesRegex = regex.test(line);
|
|
51058
|
+
var shouldSkipLine = (includeMatchedLine && !lineMatchesRegex) || // if line doesn't match regex and we want matched lines, skip it
|
|
51005
51059
|
(!includeMatchedLine && lineMatchesRegex); // if line does match regex but we don't want matched lines, skip it
|
|
51006
51060
|
if (shouldSkipLine)
|
|
51007
51061
|
continue;
|
|
@@ -51016,11 +51070,12 @@ const ErrorStackParser = {
|
|
|
51016
51070
|
}
|
|
51017
51071
|
return frames;
|
|
51018
51072
|
},
|
|
51019
|
-
parseChromiumStack(error, maxFramesToSave) {
|
|
51020
|
-
|
|
51021
|
-
|
|
51073
|
+
parseChromiumStack: function (error, maxFramesToSave) {
|
|
51074
|
+
var _this = this;
|
|
51075
|
+
return this.parseHelper({ regex: CHROME_EDGE_STACK_REGEXP, includeMatchedLine: true }, error, maxFramesToSave, function (line, frames) {
|
|
51076
|
+
var sanitizedLine;
|
|
51022
51077
|
if (line.indexOf('(eval ') > -1) {
|
|
51023
|
-
|
|
51078
|
+
var processedLine = line
|
|
51024
51079
|
.replace(/eval code/g, 'eval')
|
|
51025
51080
|
.replace(/(\(eval at [^()]*)|(\),.*$)/g, '');
|
|
51026
51081
|
sanitizedLine = processedLine.replace(/^\s+/, '').replace(/\(eval code/g, '(');
|
|
@@ -51030,7 +51085,7 @@ const ErrorStackParser = {
|
|
|
51030
51085
|
}
|
|
51031
51086
|
// capture and preserve the parenthesized location "(/foo/my bar.js:12:87)"
|
|
51032
51087
|
// in case it has spaces in it, as the string is split on \s+ later on
|
|
51033
|
-
|
|
51088
|
+
var location;
|
|
51034
51089
|
if (sanitizedLine.indexOf('(') > -1 && sanitizedLine.indexOf('):') > -1) {
|
|
51035
51090
|
location = sanitizedLine.match(/ (\((.+):(\d+):(\d+)\)$)/);
|
|
51036
51091
|
}
|
|
@@ -51038,22 +51093,23 @@ const ErrorStackParser = {
|
|
|
51038
51093
|
sanitizedLine = location
|
|
51039
51094
|
? sanitizedLine.replace(location[0], '')
|
|
51040
51095
|
: sanitizedLine;
|
|
51041
|
-
|
|
51096
|
+
var tokens = sanitizedLine.split(/\s+/).slice(1);
|
|
51042
51097
|
// if a location was matched, pass it to extractLocation() otherwise pop the last token
|
|
51043
|
-
|
|
51044
|
-
|
|
51045
|
-
|
|
51098
|
+
var locationParts = _this.extractLocation(location ? location[1] : tokens.pop() || '');
|
|
51099
|
+
var functionName = tokens.join(' ') || undefined;
|
|
51100
|
+
var fileName = (locationParts[0] === 'eval' || locationParts[0] === '<anonymous>') ? undefined : locationParts[0];
|
|
51046
51101
|
frames.push(new StackFrame({
|
|
51047
|
-
functionName,
|
|
51048
|
-
fileName,
|
|
51102
|
+
functionName: functionName,
|
|
51103
|
+
fileName: fileName,
|
|
51049
51104
|
lineNumber: locationParts[1],
|
|
51050
51105
|
columnNumber: locationParts[2]
|
|
51051
51106
|
}));
|
|
51052
51107
|
});
|
|
51053
51108
|
},
|
|
51054
|
-
parseFirefoxSafariStack(error, maxFramesToSave) {
|
|
51055
|
-
|
|
51056
|
-
|
|
51109
|
+
parseFirefoxSafariStack: function (error, maxFramesToSave) {
|
|
51110
|
+
var _this = this;
|
|
51111
|
+
return this.parseHelper({ regex: SAFARI_NATIVE_CODE_REGEXP, includeMatchedLine: false }, error, maxFramesToSave, function (line, frames) {
|
|
51112
|
+
var processedLine = line;
|
|
51057
51113
|
// Throw away eval information until we implement stacktrace.js/stackframe#8
|
|
51058
51114
|
if (processedLine.indexOf(' > eval') > -1) {
|
|
51059
51115
|
processedLine = processedLine.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ':$1');
|
|
@@ -51065,12 +51121,12 @@ const ErrorStackParser = {
|
|
|
51065
51121
|
}));
|
|
51066
51122
|
return;
|
|
51067
51123
|
}
|
|
51068
|
-
|
|
51069
|
-
|
|
51070
|
-
|
|
51071
|
-
|
|
51124
|
+
var functionNameRegex = /((.*".+"[^@]*)?[^@]*)(?:@)/;
|
|
51125
|
+
var matches = processedLine.match(functionNameRegex);
|
|
51126
|
+
var functionName = matches && matches[1] ? matches[1] : undefined;
|
|
51127
|
+
var locationParts = _this.extractLocation(processedLine.replace(functionNameRegex, ''));
|
|
51072
51128
|
frames.push(new StackFrame({
|
|
51073
|
-
functionName,
|
|
51129
|
+
functionName: functionName,
|
|
51074
51130
|
fileName: locationParts[0],
|
|
51075
51131
|
lineNumber: locationParts[1],
|
|
51076
51132
|
columnNumber: locationParts[2]
|
|
@@ -52172,18 +52228,20 @@ function NetworkCapture() {
|
|
|
52172
52228
|
}
|
|
52173
52229
|
}
|
|
52174
52230
|
|
|
52175
|
-
|
|
52176
|
-
|
|
52177
|
-
|
|
52178
|
-
|
|
52179
|
-
|
|
52180
|
-
|
|
52181
|
-
|
|
52182
|
-
|
|
52183
|
-
|
|
52184
|
-
|
|
52185
|
-
|
|
52186
|
-
|
|
52231
|
+
var PREDICT_STEP_REGEX = /\$\$predict\$\$/;
|
|
52232
|
+
var DRAG_THRESHOLD = 5;
|
|
52233
|
+
var STYLE_ID = 'pendo-predict-plugin-styles';
|
|
52234
|
+
var PREDICT_BASE_URL = 'https://predict.pendo.io';
|
|
52235
|
+
var GUIDE_BUTTON_IDENTIFIER = 'button:contains("token")';
|
|
52236
|
+
var pluginVersion = '1.0.1';
|
|
52237
|
+
var $ = function (id) { return document.getElementById(id); };
|
|
52238
|
+
var createElement = function (tag, attrs, parent) {
|
|
52239
|
+
if (attrs === void 0) { attrs = {}; }
|
|
52240
|
+
if (parent === void 0) { parent = null; }
|
|
52241
|
+
var el = document.createElement(tag);
|
|
52242
|
+
var entries = Object.entries(attrs);
|
|
52243
|
+
for (var i = 0; i < entries.length; i++) {
|
|
52244
|
+
var _a = entries[i], key = _a[0], value = _a[1];
|
|
52187
52245
|
if (key === 'className')
|
|
52188
52246
|
el.className = value;
|
|
52189
52247
|
else if (key === 'innerHTML')
|
|
@@ -52195,69 +52253,28 @@ const createElement = (tag, attrs = {}, parent = null) => {
|
|
|
52195
52253
|
parent.appendChild(el);
|
|
52196
52254
|
return el;
|
|
52197
52255
|
};
|
|
52198
|
-
|
|
52199
|
-
|
|
52256
|
+
var injectStyles = function (pendoContainerId, log) {
|
|
52257
|
+
if (log === void 0) { log = function () { }; }
|
|
52258
|
+
var styleId = "".concat(STYLE_ID, "-").concat(pendoContainerId);
|
|
52200
52259
|
if ($(styleId)) {
|
|
52201
|
-
log(
|
|
52260
|
+
log("[predict] style already exists, skipping: ".concat(styleId));
|
|
52202
52261
|
return;
|
|
52203
52262
|
}
|
|
52204
|
-
log(
|
|
52263
|
+
log("[predict] injecting styles: ".concat(styleId));
|
|
52205
52264
|
createElement('style', {
|
|
52206
52265
|
id: styleId,
|
|
52207
|
-
textContent:
|
|
52208
|
-
#${pendoContainerId} {
|
|
52209
|
-
display: none !important;
|
|
52210
|
-
}
|
|
52211
|
-
.frame-explanation {
|
|
52212
|
-
aspect-ratio: 16/9; overflow: hidden; min-height: 300px;
|
|
52213
|
-
width: 100vw; height: 100vh; background: transparent;
|
|
52214
|
-
position: fixed; bottom: 0; right: 0; z-index: 999999; border: none;
|
|
52215
|
-
visibility: hidden; opacity: 0; pointer-events: none;
|
|
52216
|
-
transition: opacity 0.1s ease-out, visibility 0s linear 0.1s;
|
|
52217
|
-
display: none;
|
|
52218
|
-
}
|
|
52219
|
-
.frame-explanation.is-visible {
|
|
52220
|
-
visibility: visible; opacity: 1; pointer-events: auto;
|
|
52221
|
-
transition: opacity 0.1s ease-out, visibility 0s linear 0s;
|
|
52222
|
-
}
|
|
52223
|
-
.frame-explanation.is-exists {
|
|
52224
|
-
display: block !important;
|
|
52225
|
-
}
|
|
52226
|
-
.floating-modal-container {
|
|
52227
|
-
position: fixed; top: 20px; right: 20px; z-index: 500000;
|
|
52228
|
-
visibility: hidden; opacity: 0; pointer-events: none;
|
|
52229
|
-
transition: opacity 0.1s ease-out, visibility 0s linear 0.1s;
|
|
52230
|
-
border-radius: 8px; box-shadow: 0px 4px 12px 0px rgba(0,0,0,0.15);
|
|
52231
|
-
overflow: hidden; width: 384px; height: 176px;
|
|
52232
|
-
}
|
|
52233
|
-
.floating-modal-container.is-visible {
|
|
52234
|
-
visibility: visible; opacity: 1; pointer-events: auto;
|
|
52235
|
-
transition: opacity 0.1s ease-out, visibility 0s linear 0s;
|
|
52236
|
-
}
|
|
52237
|
-
.floating-modal-container.is-dragging { will-change: left, top; }
|
|
52238
|
-
.floating-modal-drag-handle {
|
|
52239
|
-
position: absolute; left: 50%; transform: translateX(-50%);
|
|
52240
|
-
top: 5px; width: calc(100% - 46px); min-width: 166px; height: 17px;
|
|
52241
|
-
z-index: 9999; transition: left 0.2s ease, right 0.2s ease;
|
|
52242
|
-
display: flex; justify-content: center; align-items: center;
|
|
52243
|
-
}
|
|
52244
|
-
.floating-modal-drag-handle svg g { fill: #A0A0A0; }
|
|
52245
|
-
.floating-modal-drag-handle:hover { cursor: grab; }
|
|
52246
|
-
.floating-modal-drag-handle:hover svg g { fill: #1f2937; }
|
|
52247
|
-
.floating-modal-drag-handle.is-dragging { cursor: grabbing; }
|
|
52248
|
-
.floating-modal-drag-handle.is-collapsed { top: 0px; }
|
|
52249
|
-
.frame-floating-modal { width: 100%; height: 100%; background: white; border: none; display: block; }
|
|
52250
|
-
`
|
|
52266
|
+
textContent: "\n #".concat(pendoContainerId, " {\n display: none !important;\n }\n .frame-explanation {\n aspect-ratio: 16/9; overflow: hidden; min-height: 300px;\n width: 100vw; height: 100vh; background: transparent;\n position: fixed; bottom: 0; right: 0; z-index: 999999; border: none;\n visibility: hidden; opacity: 0; pointer-events: none;\n transition: opacity 0.1s ease-out, visibility 0s linear 0.1s;\n display: none;\n }\n .frame-explanation.is-visible {\n visibility: visible; opacity: 1; pointer-events: auto;\n transition: opacity 0.1s ease-out, visibility 0s linear 0s;\n }\n .frame-explanation.is-exists {\n display: block !important;\n }\n .floating-modal-container {\n position: fixed; top: 20px; right: 20px; z-index: 500000;\n visibility: hidden; opacity: 0; pointer-events: none;\n transition: opacity 0.1s ease-out, visibility 0s linear 0.1s;\n border-radius: 8px; box-shadow: 0px 4px 12px 0px rgba(0,0,0,0.15);\n overflow: hidden; width: 384px; height: 176px;\n }\n .floating-modal-container.is-visible {\n visibility: visible; opacity: 1; pointer-events: auto;\n transition: opacity 0.1s ease-out, visibility 0s linear 0s;\n }\n .floating-modal-container.is-dragging { will-change: left, top; }\n .floating-modal-drag-handle {\n position: absolute; left: 50%; transform: translateX(-50%);\n top: 5px; width: calc(100% - 46px); min-width: 166px; height: 17px;\n z-index: 9999; transition: left 0.2s ease, right 0.2s ease;\n display: flex; justify-content: center; align-items: center;\n }\n .floating-modal-drag-handle svg g { fill: #A0A0A0; }\n .floating-modal-drag-handle:hover { cursor: grab; }\n .floating-modal-drag-handle:hover svg g { fill: #1f2937; }\n .floating-modal-drag-handle.is-dragging { cursor: grabbing; }\n .floating-modal-drag-handle.is-collapsed { top: 0px; }\n .frame-floating-modal { width: 100%; height: 100%; background: white; border: none; display: block; }\n ")
|
|
52251
52267
|
}, document.head);
|
|
52252
52268
|
};
|
|
52253
|
-
|
|
52269
|
+
var getRecordIdFromUrl = function (recordRegex, log) {
|
|
52254
52270
|
var _a;
|
|
52255
|
-
|
|
52256
|
-
|
|
52257
|
-
|
|
52271
|
+
if (log === void 0) { log = function () { }; }
|
|
52272
|
+
var match = window.location.href.match(recordRegex);
|
|
52273
|
+
var recordId = (_a = match === null || match === void 0 ? void 0 : match[1]) !== null && _a !== void 0 ? _a : null;
|
|
52274
|
+
log("[predict] recordId found: ".concat(recordId));
|
|
52258
52275
|
return recordId;
|
|
52259
52276
|
};
|
|
52260
|
-
|
|
52277
|
+
var safeStringify = function (value, fallback) {
|
|
52261
52278
|
try {
|
|
52262
52279
|
return JSON.stringify(value);
|
|
52263
52280
|
}
|
|
@@ -52265,21 +52282,22 @@ const safeStringify = (value, fallback) => {
|
|
|
52265
52282
|
return fallback !== null && fallback !== void 0 ? fallback : '';
|
|
52266
52283
|
}
|
|
52267
52284
|
};
|
|
52268
|
-
|
|
52285
|
+
var safeParse = function (value, fallback, log) {
|
|
52286
|
+
if (log === void 0) { log = function () { }; }
|
|
52269
52287
|
try {
|
|
52270
52288
|
return JSON.parse(value);
|
|
52271
52289
|
}
|
|
52272
52290
|
catch (error) {
|
|
52273
|
-
log(
|
|
52291
|
+
log("[predict] JSON parse error: ".concat(error));
|
|
52274
52292
|
return fallback;
|
|
52275
52293
|
}
|
|
52276
52294
|
};
|
|
52277
|
-
|
|
52278
|
-
|
|
52279
|
-
|
|
52295
|
+
var buildQueryParams = function (params) {
|
|
52296
|
+
var urlParams = new URLSearchParams();
|
|
52297
|
+
var entries = Object.entries(params);
|
|
52280
52298
|
urlParams.set('pluginVersion', pluginVersion);
|
|
52281
|
-
for (
|
|
52282
|
-
|
|
52299
|
+
for (var i = 0; i < entries.length; i++) {
|
|
52300
|
+
var _a = entries[i], key = _a[0], value = _a[1];
|
|
52283
52301
|
if (value != null) {
|
|
52284
52302
|
urlParams.set(key, typeof value === 'object' ? safeStringify(value) : String(value));
|
|
52285
52303
|
}
|
|
@@ -52287,17 +52305,17 @@ const buildQueryParams = (params) => {
|
|
|
52287
52305
|
return urlParams.toString();
|
|
52288
52306
|
};
|
|
52289
52307
|
// ----- Drag & Drop -----
|
|
52290
|
-
|
|
52291
|
-
|
|
52292
|
-
|
|
52293
|
-
|
|
52294
|
-
|
|
52295
|
-
|
|
52296
|
-
|
|
52297
|
-
|
|
52298
|
-
|
|
52299
|
-
|
|
52300
|
-
|
|
52308
|
+
var setupDragAndDrop = function (handle, container) {
|
|
52309
|
+
var isDragging = false;
|
|
52310
|
+
var hasMoved = false;
|
|
52311
|
+
var isCollapsed = false;
|
|
52312
|
+
var startX = 0;
|
|
52313
|
+
var startY = 0;
|
|
52314
|
+
var initialLeft = 0;
|
|
52315
|
+
var initialTop = 0;
|
|
52316
|
+
var rafId = null;
|
|
52317
|
+
var iframe = container.querySelector('iframe');
|
|
52318
|
+
var onMouseDown = function (e) {
|
|
52301
52319
|
if (e.button !== 0)
|
|
52302
52320
|
return;
|
|
52303
52321
|
e.preventDefault();
|
|
@@ -52307,35 +52325,35 @@ const setupDragAndDrop = (handle, container) => {
|
|
|
52307
52325
|
container.classList.add('is-dragging');
|
|
52308
52326
|
if (iframe)
|
|
52309
52327
|
iframe.style.pointerEvents = 'none';
|
|
52310
|
-
|
|
52328
|
+
var rect = container.getBoundingClientRect();
|
|
52311
52329
|
initialLeft = rect.left;
|
|
52312
52330
|
initialTop = rect.top;
|
|
52313
|
-
container.style.left =
|
|
52331
|
+
container.style.left = "".concat(initialLeft, "px");
|
|
52314
52332
|
container.style.right = 'auto';
|
|
52315
52333
|
startX = e.clientX;
|
|
52316
52334
|
startY = e.clientY;
|
|
52317
52335
|
document.addEventListener('mousemove', onMouseMove);
|
|
52318
52336
|
document.addEventListener('mouseup', onMouseUp);
|
|
52319
52337
|
};
|
|
52320
|
-
|
|
52338
|
+
var onMouseMove = function (e) {
|
|
52321
52339
|
if (!isDragging)
|
|
52322
52340
|
return;
|
|
52323
|
-
|
|
52324
|
-
|
|
52341
|
+
var deltaX = e.clientX - startX;
|
|
52342
|
+
var deltaY = e.clientY - startY;
|
|
52325
52343
|
if (Math.abs(deltaX) > DRAG_THRESHOLD || Math.abs(deltaY) > DRAG_THRESHOLD) {
|
|
52326
52344
|
hasMoved = true;
|
|
52327
52345
|
}
|
|
52328
52346
|
if (rafId)
|
|
52329
52347
|
cancelAnimationFrame(rafId);
|
|
52330
|
-
rafId = requestAnimationFrame(()
|
|
52331
|
-
|
|
52332
|
-
|
|
52333
|
-
|
|
52334
|
-
container.style.left =
|
|
52335
|
-
container.style.top =
|
|
52348
|
+
rafId = requestAnimationFrame(function () {
|
|
52349
|
+
var rect = container.getBoundingClientRect();
|
|
52350
|
+
var newLeft = Math.max(0, Math.min(initialLeft + deltaX, window.innerWidth - rect.width));
|
|
52351
|
+
var newTop = Math.max(0, Math.min(initialTop + deltaY, window.innerHeight - rect.height));
|
|
52352
|
+
container.style.left = "".concat(newLeft, "px");
|
|
52353
|
+
container.style.top = "".concat(newTop, "px");
|
|
52336
52354
|
});
|
|
52337
52355
|
};
|
|
52338
|
-
|
|
52356
|
+
var onMouseUp = function (e) {
|
|
52339
52357
|
var _a;
|
|
52340
52358
|
if (!isDragging)
|
|
52341
52359
|
return;
|
|
@@ -52353,12 +52371,12 @@ const setupDragAndDrop = (handle, container) => {
|
|
|
52353
52371
|
(_a = iframe === null || iframe === void 0 ? void 0 : iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage({ type: 'TRIGGER_EXPAND' }, PREDICT_BASE_URL);
|
|
52354
52372
|
}
|
|
52355
52373
|
};
|
|
52356
|
-
handle.setCollapsedState = (collapsed)
|
|
52374
|
+
handle.setCollapsedState = function (collapsed) {
|
|
52357
52375
|
isCollapsed = collapsed;
|
|
52358
52376
|
handle.classList.toggle('is-collapsed', collapsed);
|
|
52359
52377
|
};
|
|
52360
52378
|
handle.addEventListener('mousedown', onMouseDown);
|
|
52361
|
-
handle.cleanup = ()
|
|
52379
|
+
handle.cleanup = function () {
|
|
52362
52380
|
handle.removeEventListener('mousedown', onMouseDown);
|
|
52363
52381
|
document.removeEventListener('mousemove', onMouseMove);
|
|
52364
52382
|
document.removeEventListener('mouseup', onMouseUp);
|
|
@@ -52368,12 +52386,13 @@ const setupDragAndDrop = (handle, container) => {
|
|
|
52368
52386
|
return handle;
|
|
52369
52387
|
};
|
|
52370
52388
|
// ----- Explanation Iframe Creation -----
|
|
52371
|
-
|
|
52372
|
-
var
|
|
52373
|
-
|
|
52374
|
-
|
|
52375
|
-
|
|
52376
|
-
|
|
52389
|
+
var createExplanationIframe = function (_a) {
|
|
52390
|
+
var _b;
|
|
52391
|
+
var analysisId = _a.analysisId, recordId = _a.recordId, configuration = _a.configuration;
|
|
52392
|
+
var frameId = "frameExplanation-".concat(analysisId);
|
|
52393
|
+
(_b = $(frameId)) === null || _b === void 0 ? void 0 : _b.remove();
|
|
52394
|
+
var base = "".concat(PREDICT_BASE_URL, "/external/analysis/").concat(analysisId, "/prediction/drilldown/").concat(recordId);
|
|
52395
|
+
var params = buildQueryParams(configuration);
|
|
52377
52396
|
createElement('iframe', {
|
|
52378
52397
|
id: frameId,
|
|
52379
52398
|
className: 'frame-explanation',
|
|
@@ -52381,28 +52400,24 @@ const createExplanationIframe = ({ analysisId, recordId, configuration }) => {
|
|
|
52381
52400
|
loading: 'lazy',
|
|
52382
52401
|
referrerPolicy: 'strict-origin-when-cross-origin',
|
|
52383
52402
|
allowFullscreen: true,
|
|
52384
|
-
src:
|
|
52403
|
+
src: "".concat(base, "?").concat(params)
|
|
52385
52404
|
}, document.body);
|
|
52386
52405
|
};
|
|
52387
52406
|
// ----- Floating Modal Creation -----
|
|
52388
|
-
|
|
52389
|
-
var
|
|
52390
|
-
|
|
52391
|
-
|
|
52392
|
-
|
|
52393
|
-
|
|
52394
|
-
|
|
52395
|
-
|
|
52407
|
+
var createFloatingModal = function (_a) {
|
|
52408
|
+
var _b;
|
|
52409
|
+
var recordId = _a.recordId, configuration = _a.configuration;
|
|
52410
|
+
var flatIds = (_b = configuration.analysisIds) === null || _b === void 0 ? void 0 : _b.flat(Infinity);
|
|
52411
|
+
for (var i = 0; i < flatIds.length; i++) {
|
|
52412
|
+
createExplanationIframe({ analysisId: flatIds[i], recordId: recordId, configuration: configuration });
|
|
52413
|
+
}
|
|
52414
|
+
var container = createElement('div', { id: 'floatingModalContainer', className: 'floating-modal-container' }, document.body);
|
|
52415
|
+
var dragHandle = createElement('div', {
|
|
52396
52416
|
className: 'floating-modal-drag-handle',
|
|
52397
|
-
innerHTML:
|
|
52398
|
-
<g fill="#EBEBEB">
|
|
52399
|
-
<circle cx="3.33" cy="6" r="1.5"/><circle cx="8" cy="6" r="1.5"/><circle cx="12.67" cy="6" r="1.5"/>
|
|
52400
|
-
<circle cx="3.33" cy="10" r="1.5"/><circle cx="8" cy="10" r="1.5"/><circle cx="12.67" cy="10" r="1.5"/>
|
|
52401
|
-
</g>
|
|
52402
|
-
</svg>`
|
|
52417
|
+
innerHTML: "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\">\n <g fill=\"#EBEBEB\">\n <circle cx=\"3.33\" cy=\"6\" r=\"1.5\"/><circle cx=\"8\" cy=\"6\" r=\"1.5\"/><circle cx=\"12.67\" cy=\"6\" r=\"1.5\"/>\n <circle cx=\"3.33\" cy=\"10\" r=\"1.5\"/><circle cx=\"8\" cy=\"10\" r=\"1.5\"/><circle cx=\"12.67\" cy=\"10\" r=\"1.5\"/>\n </g>\n </svg>"
|
|
52403
52418
|
}, container);
|
|
52404
|
-
|
|
52405
|
-
|
|
52419
|
+
var baseUrl = "".concat(PREDICT_BASE_URL, "/external/analysis/prediction/summary/").concat(recordId);
|
|
52420
|
+
var params = buildQueryParams(configuration);
|
|
52406
52421
|
createElement('iframe', {
|
|
52407
52422
|
id: 'frameFloatingModal',
|
|
52408
52423
|
className: 'frame-floating-modal',
|
|
@@ -52410,133 +52425,136 @@ const createFloatingModal = ({ recordId, configuration }) => {
|
|
|
52410
52425
|
referrerPolicy: 'strict-origin-when-cross-origin',
|
|
52411
52426
|
allowFullscreen: true,
|
|
52412
52427
|
title: 'Floating Modal',
|
|
52413
|
-
src:
|
|
52428
|
+
src: "".concat(baseUrl, "?").concat(params)
|
|
52414
52429
|
}, container);
|
|
52415
52430
|
container.dragHandle = setupDragAndDrop(dragHandle, container);
|
|
52416
|
-
return ()
|
|
52431
|
+
return function () {
|
|
52417
52432
|
var _a, _b;
|
|
52418
52433
|
(_b = (_a = container.dragHandle) === null || _a === void 0 ? void 0 : _a.cleanup) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
52419
52434
|
container.remove();
|
|
52420
|
-
for (
|
|
52421
|
-
|
|
52435
|
+
for (var i = 0; i < flatIds.length; i++) {
|
|
52436
|
+
var frame = $("frameExplanation-".concat(flatIds[i]));
|
|
52422
52437
|
if (frame)
|
|
52423
52438
|
frame.remove();
|
|
52424
52439
|
}
|
|
52425
52440
|
};
|
|
52426
52441
|
};
|
|
52427
|
-
|
|
52428
|
-
|
|
52429
|
-
|
|
52442
|
+
var setupMessageListener = function (_a) {
|
|
52443
|
+
var token = _a.token, forceAccountId = _a.forceAccountId, cleanup = _a.cleanup, pendo = _a.pendo;
|
|
52444
|
+
var messageHandler = function (_a) {
|
|
52445
|
+
var _b;
|
|
52446
|
+
var origin = _a.origin, data = _a.data;
|
|
52430
52447
|
if (origin !== PREDICT_BASE_URL || !data || typeof data !== 'object')
|
|
52431
52448
|
return;
|
|
52432
|
-
|
|
52433
|
-
|
|
52434
|
-
|
|
52435
|
-
|
|
52449
|
+
var _c = data, type = _c.type, analysisId = _c.analysisId, height = _c.height, width = _c.width;
|
|
52450
|
+
var explanationFrame = $("frameExplanation-".concat(analysisId));
|
|
52451
|
+
var floatingModal = $('floatingModalContainer');
|
|
52452
|
+
var setFloatingModalSize = function () {
|
|
52436
52453
|
if (floatingModal) {
|
|
52437
|
-
floatingModal.style.height =
|
|
52438
|
-
floatingModal.style.width =
|
|
52454
|
+
floatingModal.style.height = "".concat(height, "px");
|
|
52455
|
+
floatingModal.style.width = "".concat(width, "px");
|
|
52439
52456
|
}
|
|
52440
52457
|
};
|
|
52441
|
-
|
|
52458
|
+
var setFloatingModalCollapsedState = function (collapsed) {
|
|
52442
52459
|
var _a, _b;
|
|
52443
52460
|
if (floatingModal)
|
|
52444
52461
|
(_b = (_a = floatingModal.dragHandle) === null || _a === void 0 ? void 0 : _a.setCollapsedState) === null || _b === void 0 ? void 0 : _b.call(_a, collapsed);
|
|
52445
52462
|
};
|
|
52446
|
-
|
|
52447
|
-
MODAL_INITIALIZED: ()
|
|
52463
|
+
var actions = {
|
|
52464
|
+
MODAL_INITIALIZED: function () {
|
|
52448
52465
|
var _a, _b, _c;
|
|
52449
|
-
|
|
52466
|
+
var iframe = $('frameFloatingModal');
|
|
52450
52467
|
if (iframe) {
|
|
52451
|
-
|
|
52452
|
-
|
|
52453
|
-
|
|
52468
|
+
var idToken = null;
|
|
52469
|
+
var extensionAPIKeys = null;
|
|
52470
|
+
var retrieveIDPToken = pendo.getConfigValue('retrieveIDPToken');
|
|
52454
52471
|
if (pendo._.isFunction(retrieveIDPToken)) {
|
|
52455
|
-
|
|
52472
|
+
var result = retrieveIDPToken();
|
|
52456
52473
|
if (result) {
|
|
52457
52474
|
idToken = result.idToken;
|
|
52458
52475
|
extensionAPIKeys = result.extensionAPIKeys;
|
|
52459
52476
|
}
|
|
52460
52477
|
}
|
|
52461
|
-
|
|
52462
|
-
|
|
52463
|
-
(_c = iframe.contentWindow) === null || _c === void 0 ? void 0 : _c.postMessage({ type: 'TOKEN_RECEIVED', token, idToken, extensionAPIKeys, visitorId, accountId }, PREDICT_BASE_URL);
|
|
52478
|
+
var visitorId = (_a = pendo === null || pendo === void 0 ? void 0 : pendo.getVisitorId) === null || _a === void 0 ? void 0 : _a.call(pendo);
|
|
52479
|
+
var accountId = forceAccountId !== null && forceAccountId !== void 0 ? forceAccountId : (_b = pendo === null || pendo === void 0 ? void 0 : pendo.getAccountId) === null || _b === void 0 ? void 0 : _b.call(pendo);
|
|
52480
|
+
(_c = iframe.contentWindow) === null || _c === void 0 ? void 0 : _c.postMessage({ type: 'TOKEN_RECEIVED', token: token, idToken: idToken, extensionAPIKeys: extensionAPIKeys, visitorId: visitorId, accountId: accountId }, PREDICT_BASE_URL);
|
|
52464
52481
|
}
|
|
52465
52482
|
},
|
|
52466
|
-
OPEN_EXPLANATION: ()
|
|
52483
|
+
OPEN_EXPLANATION: function () {
|
|
52467
52484
|
var _a;
|
|
52468
52485
|
explanationFrame === null || explanationFrame === void 0 ? void 0 : explanationFrame.classList.add('is-visible');
|
|
52469
52486
|
(_a = explanationFrame === null || explanationFrame === void 0 ? void 0 : explanationFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(data, PREDICT_BASE_URL);
|
|
52470
52487
|
},
|
|
52471
|
-
CLOSE_EXPLANATION: ()
|
|
52472
|
-
AUTH_ERROR_EXPLANATION: ()
|
|
52488
|
+
CLOSE_EXPLANATION: function () { return explanationFrame === null || explanationFrame === void 0 ? void 0 : explanationFrame.classList.remove('is-visible'); },
|
|
52489
|
+
AUTH_ERROR_EXPLANATION: function () {
|
|
52473
52490
|
explanationFrame === null || explanationFrame === void 0 ? void 0 : explanationFrame.classList.remove('is-visible');
|
|
52474
|
-
|
|
52491
|
+
var iframe = $('frameFloatingModal');
|
|
52475
52492
|
// eslint-disable-next-line no-self-assign
|
|
52476
52493
|
if (iframe)
|
|
52477
52494
|
iframe.src = iframe.src;
|
|
52478
52495
|
},
|
|
52479
|
-
DATA_READY: ()
|
|
52496
|
+
DATA_READY: function () {
|
|
52480
52497
|
floatingModal === null || floatingModal === void 0 ? void 0 : floatingModal.classList.add('is-visible');
|
|
52481
52498
|
setFloatingModalSize();
|
|
52482
52499
|
// Use analysisIds from the message data if available, otherwise use all IDs
|
|
52483
|
-
|
|
52484
|
-
for (
|
|
52485
|
-
|
|
52500
|
+
var idsToShow = data.analysisIds || [];
|
|
52501
|
+
for (var i = 0; i < idsToShow.length; i++) {
|
|
52502
|
+
var frame = $("frameExplanation-".concat(idsToShow[i]));
|
|
52486
52503
|
if (frame)
|
|
52487
52504
|
frame.classList.add('is-exists');
|
|
52488
52505
|
}
|
|
52489
52506
|
},
|
|
52490
|
-
AUTH_ERROR: ()
|
|
52507
|
+
AUTH_ERROR: function () {
|
|
52491
52508
|
floatingModal === null || floatingModal === void 0 ? void 0 : floatingModal.classList.add('is-visible');
|
|
52492
52509
|
setFloatingModalSize();
|
|
52493
52510
|
},
|
|
52494
52511
|
CLOSE_FLOATING_MODAL: cleanup,
|
|
52495
|
-
EXPAND_FLOATING_MODAL: ()
|
|
52512
|
+
EXPAND_FLOATING_MODAL: function () {
|
|
52496
52513
|
setFloatingModalSize();
|
|
52497
52514
|
setFloatingModalCollapsedState(false);
|
|
52498
52515
|
},
|
|
52499
|
-
COLLAPSE_FLOATING_MODAL: ()
|
|
52516
|
+
COLLAPSE_FLOATING_MODAL: function () {
|
|
52500
52517
|
setFloatingModalSize();
|
|
52501
52518
|
setFloatingModalCollapsedState(true);
|
|
52502
52519
|
}
|
|
52503
52520
|
};
|
|
52504
52521
|
if (type && type in actions) {
|
|
52505
|
-
(
|
|
52522
|
+
(_b = actions === null || actions === void 0 ? void 0 : actions[type]) === null || _b === void 0 ? void 0 : _b.call(actions);
|
|
52506
52523
|
}
|
|
52507
52524
|
};
|
|
52508
52525
|
window.addEventListener('message', messageHandler);
|
|
52509
|
-
return ()
|
|
52526
|
+
return function () { return window.removeEventListener('message', messageHandler); };
|
|
52510
52527
|
};
|
|
52511
|
-
|
|
52512
|
-
var
|
|
52528
|
+
var predictGuidesScript = function (_a) {
|
|
52529
|
+
var _b;
|
|
52530
|
+
var step = _a.step, pendo = _a.pendo, cleanupArray = _a.cleanupArray, cleanup = _a.cleanup, log = _a.log;
|
|
52513
52531
|
log('[predict] initializing');
|
|
52514
52532
|
// Before anything else, inject styles so that the guide will be hidden
|
|
52515
|
-
|
|
52533
|
+
var pendoContainerId = step === null || step === void 0 ? void 0 : step.containerId;
|
|
52516
52534
|
injectStyles(pendoContainerId, log);
|
|
52517
52535
|
if (cleanupArray.length > 0) {
|
|
52518
52536
|
log('[predict] cleanupArray is not empty');
|
|
52519
52537
|
return;
|
|
52520
52538
|
}
|
|
52521
52539
|
// ----- Extract Configuration -----
|
|
52522
|
-
|
|
52540
|
+
var guideButton = (_b = step.guideElement.find(GUIDE_BUTTON_IDENTIFIER)) === null || _b === void 0 ? void 0 : _b[0];
|
|
52523
52541
|
if (!guideButton) {
|
|
52524
52542
|
log('[predict] no guide button found, aborting');
|
|
52525
52543
|
return;
|
|
52526
52544
|
}
|
|
52527
|
-
|
|
52545
|
+
var _c = safeParse(guideButton.textContent, {}, log), token = _c.token, configuration = __rest(_c, ["token"]);
|
|
52528
52546
|
if (!configuration || !token) {
|
|
52529
52547
|
log('[predict] no configuration found, aborting');
|
|
52530
52548
|
return;
|
|
52531
52549
|
}
|
|
52532
|
-
|
|
52533
|
-
|
|
52550
|
+
var recordRegex = new RegExp("/".concat(configuration.recordRegexName, "/([a-zA-Z0-9]+)(?:/|$)"));
|
|
52551
|
+
var recordId = getRecordIdFromUrl(recordRegex, log);
|
|
52534
52552
|
if (!recordId) {
|
|
52535
52553
|
log('[predict] no recordId found in URL, aborting');
|
|
52536
52554
|
return;
|
|
52537
52555
|
}
|
|
52538
|
-
cleanupArray.push(setupMessageListener({ token, forceAccountId: configuration === null || configuration === void 0 ? void 0 : configuration.forceAccountId, cleanup, pendo }));
|
|
52539
|
-
cleanupArray.push(createFloatingModal({ recordId, configuration }));
|
|
52556
|
+
cleanupArray.push(setupMessageListener({ token: token, forceAccountId: configuration === null || configuration === void 0 ? void 0 : configuration.forceAccountId, cleanup: cleanup, pendo: pendo }));
|
|
52557
|
+
cleanupArray.push(createFloatingModal({ recordId: recordId, configuration: configuration }));
|
|
52540
52558
|
};
|
|
52541
52559
|
|
|
52542
52560
|
const PredictGuides = () => {
|