apxor-qe 1.5.1 → 1.6.1-qa.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/apxor.qe.js.bak +913 -564
- package/dist/apxor.qe.min.js +1 -1
- package/package.json +2 -2
package/dist/apxor.qe.js.bak
CHANGED
|
@@ -112,6 +112,7 @@
|
|
|
112
112
|
return typeof key === "symbol" ? key : String(key);
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
+
var Logger = window.ApxorLogger;
|
|
115
116
|
var isUndefined = function isUndefined(term) {
|
|
116
117
|
return typeof term === "undefined";
|
|
117
118
|
};
|
|
@@ -207,7 +208,7 @@
|
|
|
207
208
|
var toUpperCase = function toUpperCase(key) {
|
|
208
209
|
return key.toUpperCase();
|
|
209
210
|
};
|
|
210
|
-
var
|
|
211
|
+
var bptN = function bptN(actual, expected, operator) {
|
|
211
212
|
switch (operator) {
|
|
212
213
|
case "EQ":
|
|
213
214
|
return actual === expected;
|
|
@@ -263,39 +264,243 @@
|
|
|
263
264
|
mins: currentTime.getMinutes()
|
|
264
265
|
};
|
|
265
266
|
};
|
|
267
|
+
var _doesUrlMatchSkeleton = function _doesUrlMatchSkeleton(currenturl, skeleton, variable) {
|
|
268
|
+
var startsWith = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
269
|
+
var variablePattern = "([^/]+)";
|
|
270
|
+
var escapedVariable = variable ?
|
|
271
|
+
// eslint-disable-next-line no-useless-escape
|
|
272
|
+
variable.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&") : "";
|
|
273
|
+
var pattern = skeleton.replace(new RegExp(escapedVariable, "g"), variablePattern);
|
|
274
|
+
// Adjust regex based on startsWith
|
|
275
|
+
var regex = new RegExp("^".concat(pattern) + (startsWith ? "" : "$"));
|
|
276
|
+
var match = currenturl.match(regex);
|
|
277
|
+
return match !== null;
|
|
278
|
+
};
|
|
266
279
|
|
|
267
|
-
|
|
280
|
+
// Checks if the given element is in viewport or not.
|
|
281
|
+
var isElementInViewport = function isElementInViewport(el) {
|
|
282
|
+
var elementOffsetHight = el.offsetHeight;
|
|
283
|
+
var elementOffsetWidth = el.offsetWidth;
|
|
284
|
+
var boundingRect = el.getBoundingClientRect();
|
|
285
|
+
if (boundingRect.left >= -elementOffsetWidth && boundingRect.top >= -elementOffsetHight && boundingRect.right <= (window.innerWidth || document.documentElement.clientWidth) + elementOffsetWidth && boundingRect.bottom <= (window.innerHeight || document.documentElement.clientHeight) + elementOffsetHight) {
|
|
286
|
+
return true;
|
|
287
|
+
} else {
|
|
288
|
+
return false;
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* @function _findTargetElement
|
|
294
|
+
* @private
|
|
295
|
+
* @description Finds the target element in the DOM.
|
|
296
|
+
* @param {function} targetFoundCallback
|
|
297
|
+
*/
|
|
298
|
+
function _findTargetElement(id) {
|
|
299
|
+
var frame_id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
300
|
+
var enable_retry = arguments.length > 2 ? arguments[2] : undefined;
|
|
301
|
+
var interval = arguments.length > 3 ? arguments[3] : undefined;
|
|
302
|
+
var max_retries = arguments.length > 4 ? arguments[4] : undefined;
|
|
303
|
+
var targetElement = getElementFromSelector(id, frame_id);
|
|
304
|
+
if (!targetElement) {
|
|
305
|
+
if (enable_retry) {
|
|
306
|
+
Logger.info("Not found yet. Rechecking the DOM.");
|
|
307
|
+
return _retryFindingTargetElement(max_retries, interval, id, frame_id);
|
|
308
|
+
} else {
|
|
309
|
+
Logger.info("Element with selector:".concat(id, " not found."));
|
|
310
|
+
return false;
|
|
311
|
+
}
|
|
312
|
+
} else {
|
|
313
|
+
var targetFoundCallback = function targetFoundCallback() {
|
|
314
|
+
var isElementVisible = _isElementVisible(targetElement);
|
|
315
|
+
if (isElementVisible) {
|
|
316
|
+
// Attch a click callback to the target. If the target dismiss config is true, it will dismiss the tooltip
|
|
317
|
+
// let targetClickCallback = this._targetClickCallback.bind(this);
|
|
318
|
+
// this.targetElement.addEventListener("click", targetClickCallback);
|
|
319
|
+
var targetValidCallback = function targetValidCallback(targetElement) {
|
|
320
|
+
//Once the target is found then scroll into it.
|
|
321
|
+
return _scrollIntoTargetIfNeeded(targetElement);
|
|
322
|
+
};
|
|
323
|
+
return targetValidCallback(targetElement);
|
|
324
|
+
} else {
|
|
325
|
+
Logger.info("Invalid target element. Width and height are 0 for element: ".concat(id, ". Can't show tooltip"));
|
|
326
|
+
return false;
|
|
327
|
+
//_resetRTMAction();
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
return targetFoundCallback();
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* @function _retryFindingTargetElement
|
|
337
|
+
* @private
|
|
338
|
+
* @description Continuously rechecks the DOM for the target element after every retry_interval.
|
|
339
|
+
* Maximum times it checks is configured through max_retries
|
|
340
|
+
* @param {function} targetFoundCallback
|
|
341
|
+
*/
|
|
342
|
+
function _retryFindingTargetElement(max_retries, interval, id) {
|
|
343
|
+
var frame_id = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "";
|
|
344
|
+
//After every find_interval check the DOM for target element.
|
|
345
|
+
var elementRecheckIntervalId = setInterval(function () {
|
|
346
|
+
var targetElement = getElementFromSelector(id, frame_id);
|
|
347
|
+
//If the element is found, stop checking the DOM.
|
|
348
|
+
if (targetElement) {
|
|
349
|
+
clearInterval(elementRecheckIntervalId);
|
|
350
|
+
var targetFoundCallback = function targetFoundCallback() {
|
|
351
|
+
var isElementVisible = _isElementVisible();
|
|
352
|
+
if (isElementVisible) {
|
|
353
|
+
// Attch a click callback to the target. If the target dismiss config is true, it will dismiss the tooltip
|
|
354
|
+
// let targetClickCallback = this._targetClickCallback.bind(this);
|
|
355
|
+
// this.targetElement.addEventListener("click", targetClickCallback);
|
|
356
|
+
var targetValidCallback = function targetValidCallback() {
|
|
357
|
+
//Once the target is found then scroll into it.
|
|
358
|
+
_scrollIntoTargetIfNeeded();
|
|
359
|
+
};
|
|
360
|
+
targetValidCallback();
|
|
361
|
+
} else {
|
|
362
|
+
Logger.info("Invalid target element. Width and height are 0 for element: ".concat(id, ". Can't show tooltip"));
|
|
363
|
+
//this._resetRTMAction();
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
targetFoundCallback(targetElement);
|
|
368
|
+
} else {
|
|
369
|
+
max_retries = max_retries - 1;
|
|
370
|
+
// If the element is not found even after max interval, stop checking
|
|
371
|
+
if (max_retries <= 0) {
|
|
372
|
+
clearInterval(elementRecheckIntervalId);
|
|
373
|
+
console.warn("Element with selector:".concat(id, " not found."));
|
|
374
|
+
//this._resetRTMAction();
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}, interval);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* @function getElementFromSelector
|
|
382
|
+
* @description Finds the element in DOM for a given selector. Selector can be an ID, or any css selector. It can also be an XPath.
|
|
383
|
+
* @param {string} selector
|
|
384
|
+
* @returns {HTMLElement} Returns the HTML element that matches the given selector
|
|
385
|
+
*/
|
|
386
|
+
var getElementFromSelector = function getElementFromSelector(selector) {
|
|
387
|
+
var iframe_id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
388
|
+
// Given selector can be an ID.
|
|
389
|
+
var element = document.getElementById(selector);
|
|
390
|
+
if (!element) {
|
|
391
|
+
try {
|
|
392
|
+
element = document.querySelector(selector);
|
|
393
|
+
} catch (e) {
|
|
394
|
+
//If there is an exception, it means it is not a valid selector.
|
|
395
|
+
window.ApxorLogger.error("Error finding element in DOM:" + e);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
// If no element is found till now, it means it is neither an ID nor a valid css selector. It could be an XPath.
|
|
399
|
+
if (!element) {
|
|
400
|
+
element = getElementByXPath(selector);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
// If no element is found, it means the selector is not an ID. It could be a css selector
|
|
404
|
+
if (!element && iframe_id.length > 0) {
|
|
405
|
+
var _document$getElementB;
|
|
406
|
+
element = (_document$getElementB = document.getElementById(iframe_id)) === null || _document$getElementB === void 0 || (_document$getElementB = _document$getElementB.contentWindow) === null || _document$getElementB === void 0 || (_document$getElementB = _document$getElementB.document) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.querySelector(selector);
|
|
407
|
+
}
|
|
408
|
+
return element;
|
|
409
|
+
};
|
|
410
|
+
var getElementByXPath = function getElementByXPath(path) {
|
|
411
|
+
var index = path.indexOf("svg");
|
|
412
|
+
if (index !== -1) {
|
|
413
|
+
path = path.substring(0, index) + "svg:svg";
|
|
414
|
+
}
|
|
415
|
+
try {
|
|
416
|
+
return document.iHps(path, document, function (prefix) {
|
|
417
|
+
if (prefix === "svg") {
|
|
418
|
+
return "http://www.w3.org/2000/svg";
|
|
419
|
+
} else {
|
|
420
|
+
return null;
|
|
421
|
+
}
|
|
422
|
+
}, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
|
|
423
|
+
} catch (e) {
|
|
424
|
+
window.ApxorLogger.error("Error finding element in DOM:" + e);
|
|
425
|
+
}
|
|
426
|
+
return null;
|
|
427
|
+
};
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* @function _isElementVisible
|
|
431
|
+
* @private
|
|
432
|
+
* @description Checks if the element has a visible height and width
|
|
433
|
+
* @returns {boolean} true - If element is visible
|
|
434
|
+
* false - If the element is not visible
|
|
435
|
+
*/
|
|
436
|
+
function _isElementVisible(targetElement) {
|
|
437
|
+
try {
|
|
438
|
+
var rect = targetElement.getBoundingClientRect();
|
|
439
|
+
if (rect.width === 0 || rect.height === 0) {
|
|
440
|
+
return false;
|
|
441
|
+
}
|
|
442
|
+
} catch (e) {
|
|
443
|
+
return false;
|
|
444
|
+
}
|
|
445
|
+
return true;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* @function _scrollIntoTargetIfNeeded
|
|
450
|
+
* @private
|
|
451
|
+
* @description Scrolls into the target element if needed.
|
|
452
|
+
* @param {function} targetReachedCallback
|
|
453
|
+
*/
|
|
454
|
+
function _scrollIntoTargetIfNeeded(targetElement) {
|
|
455
|
+
var isTargetInViewPort = isElementInViewport(targetElement);
|
|
456
|
+
// If the element is not in the viewport. scroll into the target element only if the config says so.
|
|
457
|
+
if (isTargetInViewPort) {
|
|
458
|
+
return true;
|
|
459
|
+
} else {
|
|
460
|
+
return false;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
var feedBackMessagePopUpCE = function feedBackMessagePopUpCE(message) {
|
|
464
|
+
var feedbackModal = "\n <style> \n .apx-container{\n padding:10px;\n }\n </style>\n <div id=\"apx-innerElement\" class=\"apx-container\">\n <div id=\"close-button\" style=\"cursor: pointer;position:absolute;top:9px;right:9px;\"><svg width=\"11\" height=\"11\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path opacity=\"0.5\" d=\"M11.0962 9.07071L17.8586 15.8331L15.8331 17.8586L9.0707 11.0962L8.99999 11.0255L8.92928 11.0962L2.16693 17.8586L0.141421 15.8331L6.90379 9.07071L6.9745 9L6.90379 8.92929L0.141421 2.16694L2.16693 0.141422L8.92928 6.9038L8.99999 6.97451L9.0707 6.9038L15.8331 0.141422L17.8586 2.16694L11.0962 8.92929L11.0255 9L11.0962 9.07071Z\" fill=\"white\" stroke=\"#002845\" stroke-width=\"0.2\"/>\n </svg>\n </div>\n <div style=\"font-family: inherit;font-style: normal;font-weight: 600;font-size: 16px;line-height: 22px;\n color: #FFFFFF; display: flex; gap: 12px;\"><svg xmlns=\"http://www.w3.org/2000/svg\" class=\"icon icon-tabler icon-tabler-circle-check-filled\" width=\"33\" height=\"33\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"#ffffff\" fill=\"none\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/>\n <path d=\"M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z\" stroke-width=\"0\" fill=\"currentColor\" />\n</svg><div style = \"align-self: center;padding-right:20px;\">".concat(message, "</div></div>\n </div>\n ");
|
|
465
|
+
var feedbackParentDiv = document.createElement("div");
|
|
466
|
+
feedbackParentDiv.style = "\n z-index:99999999;\n background:#16202f;\n position:fixed;\n top:1%;\n right:1%;\n border-radius: 12px;\n ";
|
|
467
|
+
feedbackParentDiv.innerHTML = feedbackModal;
|
|
468
|
+
feedbackParentDiv.id = "apx-container";
|
|
469
|
+
document.body.appendChild(feedbackParentDiv);
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
var Logger$1 = window.ApxorLogger;
|
|
268
473
|
var Audience = /*#__PURE__*/_createClass(function Audience() {
|
|
269
474
|
var _this = this;
|
|
270
475
|
_classCallCheck(this, Audience);
|
|
271
|
-
_defineProperty(this, "
|
|
272
|
-
_defineProperty(this, "
|
|
273
|
-
_defineProperty(this, "
|
|
476
|
+
_defineProperty(this, "ARue", "ALL");
|
|
477
|
+
_defineProperty(this, "LpbY", []);
|
|
478
|
+
_defineProperty(this, "Hlto", []);
|
|
274
479
|
_defineProperty(this, "userAttributesValidated", true);
|
|
275
480
|
_defineProperty(this, "sessionAttributeValidated", true);
|
|
276
481
|
_defineProperty(this, "parse", function () {
|
|
277
482
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
278
483
|
try {
|
|
279
|
-
_this.
|
|
280
|
-
_this.
|
|
281
|
-
_this.
|
|
282
|
-
if (!Array.isArray(_this.
|
|
283
|
-
Logger.error("No attributes");
|
|
484
|
+
_this.ARue = config.audience.audience_type;
|
|
485
|
+
_this.LpbY = config.audience.attributes.user;
|
|
486
|
+
_this.Hlto = config.audience.attributes.session;
|
|
487
|
+
if (!Array.isArray(_this.LpbY) || !Array.isArray(_this.Hlto)) {
|
|
488
|
+
Logger$1.error("No attributes");
|
|
284
489
|
return false;
|
|
285
490
|
}
|
|
286
491
|
} catch (error) {
|
|
287
|
-
Logger.error(error);
|
|
492
|
+
Logger$1.error(error);
|
|
288
493
|
return false;
|
|
289
494
|
}
|
|
290
495
|
return true;
|
|
291
496
|
});
|
|
292
497
|
_defineProperty(this, "validate", function (user, session) {
|
|
293
498
|
var status = true;
|
|
294
|
-
if (_this.
|
|
499
|
+
if (_this.ARue === "FTU") {
|
|
295
500
|
status = Apxor.getController().getSessionInfo().is_first_session;
|
|
296
501
|
}
|
|
297
|
-
var userAttributesCompare = _this.
|
|
298
|
-
var sessionAttributesCompare = _this.
|
|
502
|
+
var userAttributesCompare = _this.asXO(user, _this.LpbY);
|
|
503
|
+
var sessionAttributesCompare = _this.asXO(session, _this.Hlto);
|
|
299
504
|
if (!userAttributesCompare) {
|
|
300
505
|
_this.userAttributesValidated = false;
|
|
301
506
|
}
|
|
@@ -304,7 +509,7 @@
|
|
|
304
509
|
}
|
|
305
510
|
return status && userAttributesCompare && sessionAttributesCompare;
|
|
306
511
|
});
|
|
307
|
-
_defineProperty(this, "
|
|
512
|
+
_defineProperty(this, "asXO", function (attributes, expected) {
|
|
308
513
|
var length = expected.length;
|
|
309
514
|
var status = true;
|
|
310
515
|
try {
|
|
@@ -330,6 +535,8 @@
|
|
|
330
535
|
return true;
|
|
331
536
|
case "false":
|
|
332
537
|
return false;
|
|
538
|
+
default:
|
|
539
|
+
return value;
|
|
333
540
|
}
|
|
334
541
|
}
|
|
335
542
|
});
|
|
@@ -350,7 +557,7 @@
|
|
|
350
557
|
} else if (type === "b") {
|
|
351
558
|
loggedValue = !!loggedValue;
|
|
352
559
|
}
|
|
353
|
-
return
|
|
560
|
+
return bptN(loggedValue, configValue, operator);
|
|
354
561
|
});
|
|
355
562
|
});
|
|
356
563
|
status = status && match;
|
|
@@ -361,83 +568,98 @@
|
|
|
361
568
|
if (_ret) return _ret.v;
|
|
362
569
|
}
|
|
363
570
|
} catch (error) {
|
|
364
|
-
Logger.error(error);
|
|
571
|
+
Logger$1.error(error);
|
|
365
572
|
status = false;
|
|
366
573
|
}
|
|
367
574
|
return status;
|
|
368
575
|
});
|
|
369
576
|
});
|
|
370
577
|
|
|
371
|
-
var
|
|
578
|
+
var QE_STATE = "qe_state";
|
|
579
|
+
var APX_RETAINED_SESSIONS = "apx_retained_session";
|
|
580
|
+
var APX_RETAINED_DAYS = "apx_retained_days";
|
|
581
|
+
var APX_CONTEXT_EVALUATED = "apx_context_evaluated";
|
|
582
|
+
var APX_VARIANT_CODE = "apx_variant_code";
|
|
583
|
+
|
|
584
|
+
var Logger$2 = window.ApxorLogger;
|
|
372
585
|
var Frequency = /*#__PURE__*/_createClass(function Frequency() {
|
|
373
586
|
var _this = this;
|
|
374
587
|
_classCallCheck(this, Frequency);
|
|
375
|
-
_defineProperty(this, "
|
|
376
|
-
_defineProperty(this, "
|
|
377
|
-
_defineProperty(this, "
|
|
378
|
-
_defineProperty(this, "
|
|
379
|
-
_defineProperty(this, "
|
|
380
|
-
_defineProperty(this, "
|
|
588
|
+
_defineProperty(this, "gJSN", 0);
|
|
589
|
+
_defineProperty(this, "XtEG", 0);
|
|
590
|
+
_defineProperty(this, "lrki", "SESSION");
|
|
591
|
+
_defineProperty(this, "pTMN", 0);
|
|
592
|
+
_defineProperty(this, "rzbk", 0);
|
|
593
|
+
_defineProperty(this, "GsAb", 0);
|
|
381
594
|
_defineProperty(this, "parse", function () {
|
|
382
595
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
383
596
|
try {
|
|
384
|
-
_this.
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
_this.
|
|
391
|
-
_this.
|
|
597
|
+
_this.ltQf = config._id;
|
|
598
|
+
_this.liLD = config.meta;
|
|
599
|
+
_this.gJSN = config.frequency.count;
|
|
600
|
+
if (_this.gJSN === -1) {
|
|
601
|
+
_this.gJSN = 1000;
|
|
602
|
+
}
|
|
603
|
+
_this.GsAb = _this.gJSN;
|
|
604
|
+
_this.XtEG = config.frequency.time_interval;
|
|
605
|
+
_this.lrki = config.frequency.validity;
|
|
606
|
+
_this.rzbk = config.frequency.ses_lmt;
|
|
392
607
|
_this._dayCount = config.frequency.day_lmt;
|
|
393
608
|
// let data = Apxor.getController().getFromStorage(QE_STATE);
|
|
394
609
|
// let qe_state = JSON.parse(decode(Apxor.getSiteId(), data));
|
|
395
610
|
var qe_state = CE.getInstance().getQeState();
|
|
396
611
|
if (!isDefined(qe_state) || !isDefined(qe_state[config._id])) return true;
|
|
397
|
-
if (_this.
|
|
398
|
-
_this.
|
|
399
|
-
if (_this.
|
|
612
|
+
if (_this.lrki === "SESSION") {
|
|
613
|
+
_this.gJSN = parseInt(_this.gJSN) - parseInt(qe_state[config._id]["SESSION"]);
|
|
614
|
+
if (_this.gJSN <= 0) {
|
|
615
|
+
_this.zMgT("Session limit reached");
|
|
400
616
|
console.warn("Max count limit reached for session:" + config._id);
|
|
401
617
|
return false;
|
|
402
618
|
}
|
|
403
|
-
} else if (_this.
|
|
404
|
-
_this.
|
|
405
|
-
if (_this.
|
|
619
|
+
} else if (_this.lrki === "OVERALL") {
|
|
620
|
+
_this.gJSN = parseInt(_this.gJSN) - parseInt(qe_state[config._id]["OVERALL"]);
|
|
621
|
+
if (_this.gJSN <= 0) {
|
|
622
|
+
_this.zMgT("Overall limit reached");
|
|
406
623
|
console.warn("Max count limit reached for overall:" + config._id);
|
|
407
624
|
return false;
|
|
408
625
|
}
|
|
409
626
|
} else {
|
|
410
|
-
Logger$
|
|
627
|
+
Logger$2.info("Invalid config.");
|
|
411
628
|
return false;
|
|
412
629
|
}
|
|
413
630
|
} catch (error) {
|
|
414
|
-
Logger$
|
|
631
|
+
Logger$2.error(error);
|
|
415
632
|
return false;
|
|
416
633
|
}
|
|
417
634
|
return true;
|
|
418
635
|
});
|
|
419
|
-
_defineProperty(this, "
|
|
420
|
-
_this.
|
|
636
|
+
_defineProperty(this, "GDwW", function () {
|
|
637
|
+
_this.gJSN = _this.gJSN - 1;
|
|
421
638
|
});
|
|
422
639
|
_defineProperty(this, "getFrequencyCount", function () {
|
|
423
|
-
return _this.
|
|
640
|
+
return _this.gJSN;
|
|
424
641
|
});
|
|
425
|
-
_defineProperty(this, "
|
|
426
|
-
if (_this.
|
|
427
|
-
_this.
|
|
428
|
-
Logger$
|
|
642
|
+
_defineProperty(this, "MYCG", function () {
|
|
643
|
+
if (_this.lrki === "SESSION") {
|
|
644
|
+
_this.gJSN = _this.GsAb;
|
|
645
|
+
Logger$2.info("Campaign Limit reset");
|
|
429
646
|
}
|
|
430
647
|
});
|
|
431
648
|
/**
|
|
432
|
-
* @function
|
|
649
|
+
* @function gbnE
|
|
433
650
|
* @description Validates if the campaign count is with in the limits set in the config.
|
|
434
651
|
* @param {string} Config id
|
|
435
652
|
* @returns {boolean} true - If the Campaign limits are not reached
|
|
436
653
|
* false - Otherwise
|
|
437
654
|
*/
|
|
438
|
-
_defineProperty(this, "
|
|
655
|
+
_defineProperty(this, "gbnE", function (id) {
|
|
439
656
|
try {
|
|
440
|
-
if (_this.
|
|
657
|
+
if (_this.gJSN <= 0) {
|
|
658
|
+
if (_this.lrki === "OVERALL") {
|
|
659
|
+
_this.zMgT("Overall limit reached");
|
|
660
|
+
} else if (_this.lrki === "SESSION") {
|
|
661
|
+
_this.zMgT("Session limit reached");
|
|
662
|
+
}
|
|
441
663
|
return false;
|
|
442
664
|
}
|
|
443
665
|
|
|
@@ -448,10 +670,11 @@
|
|
|
448
670
|
if (!isDefined(qe_state) || !isDefined(qe_state[id])) return true;
|
|
449
671
|
|
|
450
672
|
//If the config has a session count limit set
|
|
451
|
-
if (_this.
|
|
452
|
-
var sessionCountInConfig = parseInt(_this.
|
|
673
|
+
if (_this.rzbk !== 0) {
|
|
674
|
+
var sessionCountInConfig = parseInt(_this.rzbk);
|
|
453
675
|
var thisSessionCount = parseInt(qe_state[id]["SESSION"]);
|
|
454
676
|
if (sessionCountInConfig - thisSessionCount <= 0) {
|
|
677
|
+
_this.zMgT("Session limit reached");
|
|
455
678
|
return false;
|
|
456
679
|
}
|
|
457
680
|
}
|
|
@@ -463,27 +686,40 @@
|
|
|
463
686
|
var dayCountInConfig = parseInt(_this._dayCount);
|
|
464
687
|
var thisDayCount = parseInt(((_qe_state$id = qe_state[id]) === null || _qe_state$id === void 0 ? void 0 : _qe_state$id.DATES[date]) || 0);
|
|
465
688
|
if (dayCountInConfig - thisDayCount <= 0) {
|
|
689
|
+
_this.zMgT("Day limit reached");
|
|
466
690
|
return false;
|
|
467
691
|
}
|
|
468
692
|
}
|
|
469
693
|
} catch (e) {
|
|
470
|
-
|
|
694
|
+
_this.zMgT("Error validating the frequency: ".concat(e));
|
|
695
|
+
Logger$2.error("Error validating the frequency:" + e);
|
|
471
696
|
}
|
|
472
697
|
return true;
|
|
473
698
|
});
|
|
699
|
+
_defineProperty(this, "zMgT", function (reason) {
|
|
700
|
+
var _this$liLD$attr;
|
|
701
|
+
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
|
|
702
|
+
apx_nudge_type: _this.liLD.type === "SURVEY" ? "survey" : "campaign",
|
|
703
|
+
apx_nudge_id: _this.ltQf,
|
|
704
|
+
apx_nudge_name: _this.liLD.name,
|
|
705
|
+
apx_variant_code: _this.liLD.isExperiment || _this.liLD.only_context ? (_this$liLD$attr = _this.liLD.attr) === null || _this$liLD$attr === void 0 ? void 0 : _this$liLD$attr[APX_VARIANT_CODE] : "TG",
|
|
706
|
+
apx_failure_type: "warn",
|
|
707
|
+
apx_reason: reason
|
|
708
|
+
});
|
|
709
|
+
});
|
|
474
710
|
});
|
|
475
711
|
|
|
476
712
|
var Meta = /*#__PURE__*/_createClass(function Meta() {
|
|
477
713
|
var _this = this;
|
|
478
714
|
_classCallCheck(this, Meta);
|
|
479
|
-
_defineProperty(this, "
|
|
480
|
-
_defineProperty(this, "
|
|
715
|
+
_defineProperty(this, "gNrp", "");
|
|
716
|
+
_defineProperty(this, "ARue", "");
|
|
481
717
|
_defineProperty(this, "parse", function () {
|
|
482
718
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
483
719
|
try {
|
|
484
720
|
var _config$meta, _config$meta2;
|
|
485
|
-
_this.
|
|
486
|
-
_this.
|
|
721
|
+
_this.gNrp = config.meta.name;
|
|
722
|
+
_this.ARue = config.meta.type;
|
|
487
723
|
_this._only_context = config.meta.only_context;
|
|
488
724
|
_this._attr = ((_config$meta = config.meta) === null || _config$meta === void 0 ? void 0 : _config$meta.attr) || {};
|
|
489
725
|
_this._isExperiment = (_config$meta2 = config.meta) === null || _config$meta2 === void 0 ? void 0 : _config$meta2.isExperiment;
|
|
@@ -495,53 +731,57 @@
|
|
|
495
731
|
});
|
|
496
732
|
});
|
|
497
733
|
|
|
498
|
-
var Logger$
|
|
734
|
+
var Logger$3 = window.ApxorLogger;
|
|
499
735
|
var Validity = /*#__PURE__*/_createClass(function Validity() {
|
|
500
736
|
var _this = this;
|
|
501
737
|
_classCallCheck(this, Validity);
|
|
502
|
-
_defineProperty(this, "
|
|
503
|
-
_defineProperty(this, "
|
|
504
|
-
_defineProperty(this, "
|
|
505
|
-
_defineProperty(this, "
|
|
506
|
-
_defineProperty(this, "
|
|
738
|
+
_defineProperty(this, "Qnke", -1);
|
|
739
|
+
_defineProperty(this, "iLgX", -1);
|
|
740
|
+
_defineProperty(this, "EfLi", -1);
|
|
741
|
+
_defineProperty(this, "PpNt", -1);
|
|
742
|
+
_defineProperty(this, "VIcS", false);
|
|
507
743
|
_defineProperty(this, "_nudge_expired", false);
|
|
508
744
|
_defineProperty(this, "_not_yet_active", false);
|
|
745
|
+
_defineProperty(this, "_not_in_specified_time", false);
|
|
509
746
|
_defineProperty(this, "parse", function () {
|
|
510
747
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
511
748
|
try {
|
|
512
749
|
if (isNaN(Date.parse(config.validity.start_date)) || isNaN(Date.parse(config.validity.end_date))) {
|
|
513
|
-
Logger$
|
|
750
|
+
Logger$3.error("Not valid dates");
|
|
514
751
|
return false;
|
|
515
752
|
}
|
|
516
|
-
_this.
|
|
517
|
-
_this.
|
|
518
|
-
if (isDefined(config.
|
|
519
|
-
_this.
|
|
520
|
-
if (_this.
|
|
753
|
+
_this.Qnke = Date.parse(config.validity.start_date);
|
|
754
|
+
_this.iLgX = Date.parse(config.validity.end_date);
|
|
755
|
+
if (isDefined(config.at_specific_time)) {
|
|
756
|
+
_this.VIcS = config.at_specific_time;
|
|
757
|
+
if (_this.VIcS && isDefined(config.time_limits)) {
|
|
521
758
|
var currentDate = new Date().toISOString().split("T")[0];
|
|
522
|
-
_this.
|
|
523
|
-
_this.
|
|
759
|
+
_this.EfLi = Date.parse(currentDate + "T" + config.time_limits.start_time + ":00.000Z");
|
|
760
|
+
_this.PpNt = Date.parse(currentDate + "T" + config.time_limits.end_time + ":00.000Z");
|
|
524
761
|
|
|
525
762
|
// If invalid format is passed, return false
|
|
526
|
-
if (isNaN(_this.
|
|
527
|
-
Logger$
|
|
763
|
+
if (isNaN(_this.EfLi) || isNaN(_this.PpNt)) {
|
|
764
|
+
Logger$3.error("Not valid times");
|
|
528
765
|
return false;
|
|
529
766
|
}
|
|
530
767
|
}
|
|
531
768
|
}
|
|
532
769
|
} catch (error) {
|
|
533
|
-
Logger$
|
|
770
|
+
Logger$3.error(error);
|
|
534
771
|
return false;
|
|
535
772
|
}
|
|
536
773
|
return true;
|
|
537
774
|
});
|
|
538
775
|
_defineProperty(this, "validate", function () {
|
|
539
776
|
var currentTime = Date.now();
|
|
540
|
-
if (currentTime > _this.
|
|
541
|
-
|
|
542
|
-
|
|
777
|
+
if (currentTime > _this.Qnke && currentTime < _this.iLgX) {
|
|
778
|
+
if (_this.VIcS && !(currentTime >= _this.EfLi && currentTime <= _this.PpNt)) {
|
|
779
|
+
_this._not_in_specified_time = true;
|
|
780
|
+
}
|
|
781
|
+
return !_this.VIcS || currentTime >= _this.EfLi && currentTime <= _this.PpNt;
|
|
782
|
+
} else if (currentTime < _this.Qnke) {
|
|
543
783
|
_this._not_yet_active = true;
|
|
544
|
-
} else if (currentTime > _this.
|
|
784
|
+
} else if (currentTime > _this.iLgX) {
|
|
545
785
|
_this._nudge_expired = true;
|
|
546
786
|
}
|
|
547
787
|
return false;
|
|
@@ -551,13 +791,13 @@
|
|
|
551
791
|
var Details = /*#__PURE__*/_createClass(function Details() {
|
|
552
792
|
var _this = this;
|
|
553
793
|
_classCallCheck(this, Details);
|
|
554
|
-
_defineProperty(this, "
|
|
555
|
-
_defineProperty(this, "
|
|
794
|
+
_defineProperty(this, "gNrp", "");
|
|
795
|
+
_defineProperty(this, "PvVy", {});
|
|
556
796
|
_defineProperty(this, "parse", function () {
|
|
557
797
|
var details = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
558
798
|
try {
|
|
559
|
-
_this.
|
|
560
|
-
_this.
|
|
799
|
+
_this.gNrp = details.name;
|
|
800
|
+
_this.PvVy = details.additional_info;
|
|
561
801
|
} catch (error) {
|
|
562
802
|
return false;
|
|
563
803
|
}
|
|
@@ -568,14 +808,14 @@
|
|
|
568
808
|
var Timebounds = /*#__PURE__*/_createClass(function Timebounds() {
|
|
569
809
|
var _this = this;
|
|
570
810
|
_classCallCheck(this, Timebounds);
|
|
571
|
-
_defineProperty(this, "
|
|
572
|
-
_defineProperty(this, "
|
|
811
|
+
_defineProperty(this, "ejXF", 0);
|
|
812
|
+
_defineProperty(this, "dQza", 0);
|
|
573
813
|
_defineProperty(this, "parse", function () {
|
|
574
814
|
var timeBounds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
575
815
|
try {
|
|
576
|
-
_this.
|
|
577
|
-
_this.
|
|
578
|
-
if (isNaN(_this.
|
|
816
|
+
_this.ejXF = Number(timeBounds.lower);
|
|
817
|
+
_this.dQza = Number(timeBounds.upper);
|
|
818
|
+
if (isNaN(_this.ejXF) || isNaN(_this.dQza)) {
|
|
579
819
|
return false;
|
|
580
820
|
}
|
|
581
821
|
} catch (error) {
|
|
@@ -588,102 +828,102 @@
|
|
|
588
828
|
var PreCondition = /*#__PURE__*/_createClass(function PreCondition() {
|
|
589
829
|
var _this = this;
|
|
590
830
|
_classCallCheck(this, PreCondition);
|
|
591
|
-
_defineProperty(this, "
|
|
592
|
-
_defineProperty(this, "
|
|
593
|
-
_defineProperty(this, "
|
|
594
|
-
_defineProperty(this, "
|
|
595
|
-
_defineProperty(this, "
|
|
831
|
+
_defineProperty(this, "OOcg", 0);
|
|
832
|
+
_defineProperty(this, "vmZw", "");
|
|
833
|
+
_defineProperty(this, "aKIq", "");
|
|
834
|
+
_defineProperty(this, "UhhO", new Details());
|
|
835
|
+
_defineProperty(this, "sMpO", new Timebounds());
|
|
596
836
|
_defineProperty(this, "parse", function () {
|
|
597
837
|
var precondition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
598
838
|
try {
|
|
599
|
-
_this.
|
|
600
|
-
_this.
|
|
601
|
-
return _this.
|
|
839
|
+
_this.vmZw = precondition.event_type;
|
|
840
|
+
_this.aKIq = precondition.activity;
|
|
841
|
+
return _this.UhhO.parse(precondition.details) && _this.sMpO.parse(precondition.time_bounds);
|
|
602
842
|
} catch (error) {
|
|
603
843
|
return false;
|
|
604
844
|
}
|
|
605
845
|
});
|
|
606
846
|
});
|
|
607
847
|
|
|
608
|
-
var Logger$
|
|
848
|
+
var Logger$4 = window.ApxorLogger;
|
|
609
849
|
var Condition = /*#__PURE__*/_createClass(function Condition() {
|
|
610
850
|
var _this = this;
|
|
611
851
|
_classCallCheck(this, Condition);
|
|
612
|
-
_defineProperty(this, "
|
|
613
|
-
_defineProperty(this, "
|
|
614
|
-
_defineProperty(this, "
|
|
615
|
-
_defineProperty(this, "
|
|
616
|
-
_defineProperty(this, "
|
|
617
|
-
_defineProperty(this, "
|
|
618
|
-
_defineProperty(this, "
|
|
619
|
-
_defineProperty(this, "
|
|
620
|
-
_defineProperty(this, "
|
|
621
|
-
_defineProperty(this, "
|
|
622
|
-
_defineProperty(this, "
|
|
623
|
-
_defineProperty(this, "
|
|
852
|
+
_defineProperty(this, "OOcg", 0);
|
|
853
|
+
_defineProperty(this, "Nixp", -1);
|
|
854
|
+
_defineProperty(this, "gJSN", 0);
|
|
855
|
+
_defineProperty(this, "zzjI", "");
|
|
856
|
+
_defineProperty(this, "aKIq", "");
|
|
857
|
+
_defineProperty(this, "vmZw", "");
|
|
858
|
+
_defineProperty(this, "sMpO", new Timebounds());
|
|
859
|
+
_defineProperty(this, "UhhO", new Details());
|
|
860
|
+
_defineProperty(this, "iBqE", new PreCondition());
|
|
861
|
+
_defineProperty(this, "mEtI", "AND");
|
|
862
|
+
_defineProperty(this, "xPfP", false);
|
|
863
|
+
_defineProperty(this, "ARue", void 0);
|
|
624
864
|
_defineProperty(this, "parse", function () {
|
|
625
865
|
var condition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
626
866
|
try {
|
|
627
|
-
_this.
|
|
628
|
-
_this.
|
|
629
|
-
_this.
|
|
630
|
-
_this.
|
|
631
|
-
_this.
|
|
632
|
-
_this.
|
|
633
|
-
_this.
|
|
634
|
-
return _this.
|
|
867
|
+
_this.Nixp = condition.sequence;
|
|
868
|
+
_this.gJSN = condition.count_config.count;
|
|
869
|
+
_this.zzjI = condition.count_config.operator;
|
|
870
|
+
_this.aKIq = condition.activity;
|
|
871
|
+
_this.vmZw = condition.event_type;
|
|
872
|
+
_this.mEtI = condition.combine_operator;
|
|
873
|
+
_this.ARue = condition.type;
|
|
874
|
+
return _this.UhhO.parse(condition.details) && _this.iBqE.parse(condition.trigger) && _this.sMpO.parse(condition.time_bounds);
|
|
635
875
|
} catch (error) {
|
|
636
|
-
Logger$
|
|
876
|
+
Logger$4.error(error);
|
|
637
877
|
return false;
|
|
638
878
|
}
|
|
639
879
|
});
|
|
640
880
|
});
|
|
641
881
|
|
|
642
|
-
var Logger$
|
|
882
|
+
var Logger$5 = window.ApxorLogger;
|
|
643
883
|
var GoalEvent = /*#__PURE__*/_createClass(function GoalEvent() {
|
|
644
884
|
var _this = this;
|
|
645
885
|
_classCallCheck(this, GoalEvent);
|
|
646
|
-
_defineProperty(this, "
|
|
647
|
-
_defineProperty(this, "
|
|
648
|
-
_defineProperty(this, "
|
|
649
|
-
_defineProperty(this, "
|
|
650
|
-
_defineProperty(this, "
|
|
651
|
-
_defineProperty(this, "
|
|
886
|
+
_defineProperty(this, "gJSN", 0);
|
|
887
|
+
_defineProperty(this, "zzjI", "");
|
|
888
|
+
_defineProperty(this, "vmZw", "");
|
|
889
|
+
_defineProperty(this, "sMpO", new Timebounds());
|
|
890
|
+
_defineProperty(this, "UhhO", new Details());
|
|
891
|
+
_defineProperty(this, "mEtI", "AND");
|
|
652
892
|
_defineProperty(this, "parse", function (data) {
|
|
653
893
|
try {
|
|
654
|
-
_this.
|
|
655
|
-
_this.
|
|
656
|
-
_this.
|
|
657
|
-
_this.
|
|
658
|
-
return _this.
|
|
894
|
+
_this.gJSN = data.count_config.count;
|
|
895
|
+
_this.zzjI = data.count_config.operator;
|
|
896
|
+
_this.vmZw = data.event_type;
|
|
897
|
+
_this.mEtI = data.combine_operator;
|
|
898
|
+
return _this.UhhO.parse(data.details) && _this.sMpO.parse(data.time_bounds);
|
|
659
899
|
} catch (error) {
|
|
660
|
-
Logger$
|
|
900
|
+
Logger$5.error(error);
|
|
661
901
|
return false;
|
|
662
902
|
}
|
|
663
903
|
});
|
|
664
904
|
});
|
|
665
905
|
|
|
666
906
|
/* eslint-disable no-unused-vars */
|
|
667
|
-
var Logger$
|
|
907
|
+
var Logger$6 = window.ApxorLogger;
|
|
668
908
|
var ConditionValidator = /*#__PURE__*/function () {
|
|
669
909
|
function ConditionValidator() {
|
|
670
910
|
var _this = this;
|
|
671
911
|
_classCallCheck(this, ConditionValidator);
|
|
672
|
-
_defineProperty(this, "
|
|
673
|
-
_defineProperty(this, "
|
|
674
|
-
_defineProperty(this, "
|
|
675
|
-
_defineProperty(this, "
|
|
676
|
-
_defineProperty(this, "
|
|
677
|
-
_defineProperty(this, "
|
|
678
|
-
_defineProperty(this, "
|
|
679
|
-
_defineProperty(this, "
|
|
680
|
-
_defineProperty(this, "
|
|
681
|
-
_defineProperty(this, "
|
|
682
|
-
_defineProperty(this, "
|
|
683
|
-
_defineProperty(this, "
|
|
684
|
-
_defineProperty(this, "
|
|
912
|
+
_defineProperty(this, "zfeU", 0);
|
|
913
|
+
_defineProperty(this, "ltQf", "");
|
|
914
|
+
_defineProperty(this, "LnyZ", new Condition());
|
|
915
|
+
_defineProperty(this, "gYxJ", new GoalEvent());
|
|
916
|
+
_defineProperty(this, "rrDQ", false);
|
|
917
|
+
_defineProperty(this, "kpHz", false);
|
|
918
|
+
_defineProperty(this, "yvsV", 0);
|
|
919
|
+
_defineProperty(this, "mEtI", "AND");
|
|
920
|
+
_defineProperty(this, "aCAW", "OR");
|
|
921
|
+
_defineProperty(this, "WXbt", -1);
|
|
922
|
+
_defineProperty(this, "jzCx", []);
|
|
923
|
+
_defineProperty(this, "uNrb", {});
|
|
924
|
+
_defineProperty(this, "WWDG", false);
|
|
685
925
|
/**
|
|
686
|
-
* If respectSequence is true, don't auto-
|
|
926
|
+
* If respectSequence is true, don't auto-kpoN to events except for the condition whose index is 0
|
|
687
927
|
*
|
|
688
928
|
* @param condition
|
|
689
929
|
* @param type
|
|
@@ -699,191 +939,191 @@
|
|
|
699
939
|
var respectSequence = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
700
940
|
var noKpiArray = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
701
941
|
var flag = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : "";
|
|
702
|
-
_this.
|
|
703
|
-
_this.
|
|
704
|
-
_this.
|
|
942
|
+
_this.ltQf = id;
|
|
943
|
+
_this.yvsV = index;
|
|
944
|
+
_this.jzCx = noKpiArray;
|
|
705
945
|
if (flag !== "termination" || flag === "") {
|
|
706
|
-
var result = _this.
|
|
946
|
+
var result = _this.LnyZ.parse(condition);
|
|
707
947
|
if (result) {
|
|
708
|
-
_this.
|
|
948
|
+
_this.mEtI = _this.LnyZ.mEtI;
|
|
709
949
|
|
|
710
950
|
// FIXME: Why this code is written? Don't see any usecase
|
|
711
|
-
if (_this.
|
|
712
|
-
var eventName = _this.
|
|
951
|
+
if (_this.LnyZ.xPfP) {
|
|
952
|
+
var eventName = _this.LnyZ.UhhO.gNrp;
|
|
713
953
|
if (eventName === "APX_PAGE_OPENED") {
|
|
714
|
-
eventName = _this.
|
|
715
|
-
eventName = isDefined(eventName) ? eventName : _this.
|
|
954
|
+
eventName = _this.LnyZ.UhhO.PvVy["navigation_id"];
|
|
955
|
+
eventName = isDefined(eventName) ? eventName : _this.LnyZ.UhhO.gNrp;
|
|
716
956
|
}
|
|
717
|
-
_this.
|
|
718
|
-
var count = _this.
|
|
719
|
-
var operator = _this.
|
|
720
|
-
_this.
|
|
721
|
-
_this.
|
|
722
|
-
// If the condition is already satisfied and if it is page view, no need to
|
|
957
|
+
_this.WXbt = Apxor.getController().getEventCount(eventName);
|
|
958
|
+
var count = _this.LnyZ.gJSN;
|
|
959
|
+
var operator = _this.LnyZ.zzjI;
|
|
960
|
+
_this.kpHz = _this.WCWA(_this.WXbt - 1, count, operator, false);
|
|
961
|
+
_this.rrDQ = _this.kpHz;
|
|
962
|
+
// If the condition is already satisfied and if it is page view, no need to kpoN
|
|
723
963
|
// This only applies for NAVIGATION_EVENTS
|
|
724
|
-
if (_this.
|
|
964
|
+
if (_this.kpHz && _this.LnyZ.UhhO.gNrp === "APX_PAGE_OPENED") {
|
|
725
965
|
return true;
|
|
726
966
|
}
|
|
727
967
|
}
|
|
728
968
|
if (!respectSequence || index === 0) {
|
|
729
|
-
_this.
|
|
969
|
+
_this.kpoN();
|
|
730
970
|
}
|
|
731
971
|
return true;
|
|
732
972
|
}
|
|
733
973
|
} else {
|
|
734
|
-
var _result = _this.
|
|
735
|
-
_this.
|
|
736
|
-
_this.
|
|
974
|
+
var _result = _this.gYxJ.parse(condition);
|
|
975
|
+
_this.aCAW = _this.gYxJ.mEtI;
|
|
976
|
+
_this.maFW();
|
|
737
977
|
return true;
|
|
738
978
|
}
|
|
739
979
|
return false;
|
|
740
980
|
});
|
|
741
|
-
_defineProperty(this, "
|
|
981
|
+
_defineProperty(this, "kpoN", function () {
|
|
742
982
|
var _window$ApxorRTM;
|
|
743
|
-
var condition = _this.
|
|
744
|
-
var precondition = condition.
|
|
983
|
+
var condition = _this.LnyZ;
|
|
984
|
+
var precondition = condition.iBqE;
|
|
745
985
|
var ceInstance = CE.getInstance();
|
|
746
|
-
if (precondition.
|
|
747
|
-
_this.
|
|
748
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
986
|
+
if (precondition.vmZw === "app_start") {
|
|
987
|
+
_this.rrDQ = true;
|
|
988
|
+
ceInstance.registerForEvent(generateKey(condition.vmZw) + "___" + condition.UhhO.gNrp, _this.DTtA);
|
|
749
989
|
} else {
|
|
750
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
990
|
+
ceInstance.registerForEvent(generateKey(condition.vmZw) + "___" + precondition.UhhO.gNrp, _this.DTtA);
|
|
751
991
|
}
|
|
752
|
-
if ((_window$ApxorRTM = window.ApxorRTM) !== null && _window$ApxorRTM !== void 0 && _window$ApxorRTM.badgesLists.includes(_this.
|
|
753
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
992
|
+
if ((_window$ApxorRTM = window.ApxorRTM) !== null && _window$ApxorRTM !== void 0 && _window$ApxorRTM.badgesLists.includes(_this.ltQf)) {
|
|
993
|
+
ceInstance.registerForEvent(generateKey(condition.vmZw) + "___" + "apxor-badge-container-".concat("-".concat(_this.ltQf).replaceAll(" ", "").replace(/[^\w\s]/gi, "")), _this.DTtA);
|
|
754
994
|
}
|
|
755
995
|
});
|
|
756
|
-
_defineProperty(this, "
|
|
757
|
-
var condition = _this.
|
|
996
|
+
_defineProperty(this, "maFW", function () {
|
|
997
|
+
var condition = _this.gYxJ;
|
|
758
998
|
var ceInstance = CE.getInstance();
|
|
759
|
-
_this.
|
|
760
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
999
|
+
_this.rrDQ = true;
|
|
1000
|
+
ceInstance.registerForEvent(generateKey(condition.vmZw) + "___" + condition.UhhO.gNrp, _this.lTzm);
|
|
761
1001
|
});
|
|
762
|
-
_defineProperty(this, "
|
|
763
|
-
var _this$
|
|
1002
|
+
_defineProperty(this, "WPAT", function (type, name, time, additionalInfo) {
|
|
1003
|
+
var _this$LnyZ;
|
|
764
1004
|
var eventTime = Date.now();
|
|
765
|
-
var time_differnce = (eventTime - _this.
|
|
766
|
-
var time_fromConfig = ((_this$
|
|
1005
|
+
var time_differnce = (eventTime - _this.uNrb[name]) / 1000;
|
|
1006
|
+
var time_fromConfig = ((_this$LnyZ = _this.LnyZ) === null || _this$LnyZ === void 0 || (_this$LnyZ = _this$LnyZ.UhhO) === null || _this$LnyZ === void 0 || (_this$LnyZ = _this$LnyZ.PvVy) === null || _this$LnyZ === void 0 ? void 0 : _this$LnyZ.time) / 1000;
|
|
767
1007
|
if (time_fromConfig > time_differnce) {
|
|
768
1008
|
_this._displayCampaign(time);
|
|
769
1009
|
}
|
|
770
1010
|
});
|
|
771
|
-
_defineProperty(this, "
|
|
1011
|
+
_defineProperty(this, "TFdl", function (type, name, time, additionalInfo) {
|
|
772
1012
|
var _this$_condition2, _this$_condition3;
|
|
773
|
-
_this.
|
|
1013
|
+
_this.WWDG = true;
|
|
774
1014
|
var currentTime = Date.now();
|
|
775
|
-
var eventName = (_this$_condition2 = _this.
|
|
776
|
-
var eventTime = _this.
|
|
1015
|
+
var eventName = (_this$_condition2 = _this.LnyZ) === null || _this$_condition2 === void 0 || (_this$_condition2 = _this$_condition2.iBqE) === null || _this$_condition2 === void 0 ? void 0 : _this$_condition2.UhhO.gNrp;
|
|
1016
|
+
var eventTime = _this.uNrb[eventName];
|
|
777
1017
|
var time_differnce = (currentTime - eventTime) / 1000;
|
|
778
|
-
var time_fromConfig = (_this$_condition3 = _this.
|
|
1018
|
+
var time_fromConfig = (_this$_condition3 = _this.LnyZ) === null || _this$_condition3 === void 0 || (_this$_condition3 = _this$_condition3.UhhO) === null || _this$_condition3 === void 0 || (_this$_condition3 = _this$_condition3.PvVy) === null || _this$_condition3 === void 0 ? void 0 : _this$_condition3.time;
|
|
779
1019
|
time_fromConfig = time_fromConfig / 1000;
|
|
780
1020
|
if (time_fromConfig > time_differnce) {
|
|
781
1021
|
_this._displayCampaign(time);
|
|
782
1022
|
}
|
|
783
1023
|
//unregister the event
|
|
784
1024
|
});
|
|
785
|
-
_defineProperty(this, "
|
|
1025
|
+
_defineProperty(this, "DTtA", function (type, name, time, additionalInfo) {
|
|
786
1026
|
var _window$ApxorRTM2, _window$ApxorRTM3;
|
|
787
1027
|
var ceInstance = CE.getInstance();
|
|
788
|
-
if (!_this.
|
|
1028
|
+
if (!_this.rrDQ) {
|
|
789
1029
|
// Validate Precondition
|
|
790
|
-
_this.
|
|
791
|
-
if (_this.
|
|
792
|
-
var condition = _this.
|
|
793
|
-
var precondition = condition.
|
|
794
|
-
precondition.
|
|
1030
|
+
_this.rrDQ = _this.LrmB(type, name, time, additionalInfo);
|
|
1031
|
+
if (_this.rrDQ) {
|
|
1032
|
+
var condition = _this.LnyZ;
|
|
1033
|
+
var precondition = condition.iBqE;
|
|
1034
|
+
precondition.OOcg = time;
|
|
795
1035
|
//events will be registred by its type activity event_type: "activity_time"
|
|
796
|
-
if ((condition === null || condition === void 0 ? void 0 : condition.
|
|
797
|
-
var
|
|
798
|
-
var event_time = condition === null || condition === void 0 || (
|
|
799
|
-
if ((condition === null || condition === void 0 || (
|
|
1036
|
+
if ((condition === null || condition === void 0 ? void 0 : condition.vmZw) === "activity_time") {
|
|
1037
|
+
var LnyZ$UhhO, LnyZ$_details2, LnyZ$_details3;
|
|
1038
|
+
var event_time = condition === null || condition === void 0 || (LnyZ$UhhO = condition.UhhO) === null || LnyZ$UhhO === void 0 || (LnyZ$UhhO = LnyZ$UhhO.PvVy) === null || LnyZ$UhhO === void 0 ? void 0 : LnyZ$UhhO.time;
|
|
1039
|
+
if ((condition === null || condition === void 0 || (LnyZ$_details2 = condition.UhhO) === null || LnyZ$_details2 === void 0 || (LnyZ$_details2 = LnyZ$_details2.PvVy) === null || LnyZ$_details2 === void 0 ? void 0 : LnyZ$_details2.nkpi.length) > 0) {
|
|
800
1040
|
setTimeout(function () {
|
|
801
|
-
if (!_this.
|
|
802
|
-
_this.
|
|
803
|
-
if (_this.
|
|
804
|
-
_this.
|
|
805
|
-
_this.
|
|
806
|
-
if (_this.
|
|
807
|
-
_this.
|
|
808
|
-
ceInstance.validate(_this.
|
|
1041
|
+
if (!_this.WWDG) {
|
|
1042
|
+
_this.kpHz = true;
|
|
1043
|
+
if (_this.kpHz) {
|
|
1044
|
+
_this.zfeU += 1;
|
|
1045
|
+
_this.kpHz = _this.WCWA(_this.zfeU, _this.LnyZ.gJSN, _this.LnyZ.zzjI);
|
|
1046
|
+
if (_this.kpHz) {
|
|
1047
|
+
_this.LnyZ.OOcg = time;
|
|
1048
|
+
ceInstance.validate(_this.ltQf, _this.yvsV);
|
|
809
1049
|
}
|
|
810
1050
|
}
|
|
811
1051
|
}
|
|
812
|
-
condition.
|
|
813
|
-
ceInstance.unregisterFromEvent(toUpperCase(condition.
|
|
1052
|
+
condition.UhhO.PvVy.nkpi.map(function (nokpi) {
|
|
1053
|
+
ceInstance.unregisterFromEvent(toUpperCase(condition.UhhO.PvVy.et) + "___" + nokpi, _this);
|
|
814
1054
|
});
|
|
815
1055
|
}, event_time);
|
|
816
|
-
condition.
|
|
817
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
1056
|
+
condition.UhhO.PvVy.nkpi.map(function (nokpi) {
|
|
1057
|
+
ceInstance.registerForEvent(toUpperCase(condition.UhhO.PvVy.et) + "___" + nokpi, _this.TFdl);
|
|
818
1058
|
});
|
|
819
1059
|
}
|
|
820
1060
|
//it is for unregistering the events did case after completing the time imit
|
|
821
|
-
if ((condition === null || condition === void 0 || (
|
|
1061
|
+
if ((condition === null || condition === void 0 || (LnyZ$_details3 = condition.UhhO) === null || LnyZ$_details3 === void 0 || (LnyZ$_details3 = LnyZ$_details3.PvVy) === null || LnyZ$_details3 === void 0 ? void 0 : LnyZ$_details3.kpi.length) > 0) {
|
|
822
1062
|
setTimeout(function () {
|
|
823
|
-
condition.
|
|
824
|
-
ceInstance.unregisterFromEvent(toUpperCase(condition.
|
|
1063
|
+
condition.UhhO.PvVy.kpi.map(function (kpi) {
|
|
1064
|
+
ceInstance.unregisterFromEvent(toUpperCase(condition.UhhO.PvVy.et) + "___" + kpi, _this);
|
|
825
1065
|
});
|
|
826
1066
|
}, event_time);
|
|
827
|
-
condition.
|
|
828
|
-
if (kpi === condition.
|
|
1067
|
+
condition.UhhO.PvVy.kpi.map(function (kpi) {
|
|
1068
|
+
if (kpi === condition.iBqE.UhhO.gNrp) {
|
|
829
1069
|
//unregister the previous event
|
|
830
|
-
ceInstance.unregisterFromEvent(generateKey(precondition.
|
|
831
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
1070
|
+
ceInstance.unregisterFromEvent(generateKey(precondition.vmZw) + "___" + precondition.UhhO.gNrp, _this);
|
|
1071
|
+
ceInstance.registerForEvent(toUpperCase(condition.UhhO.PvVy.et) + "___" + kpi, _this.WPAT);
|
|
832
1072
|
} else {
|
|
833
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
1073
|
+
ceInstance.registerForEvent(toUpperCase(condition.UhhO.PvVy.et) + "___" + kpi, _this.TFdl);
|
|
834
1074
|
}
|
|
835
1075
|
});
|
|
836
1076
|
}
|
|
837
1077
|
} else {
|
|
838
|
-
ceInstance.unregisterFromEvent(generateKey(precondition.
|
|
839
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
1078
|
+
ceInstance.unregisterFromEvent(generateKey(precondition.vmZw) + "___" + precondition.UhhO.gNrp, _this);
|
|
1079
|
+
ceInstance.registerForEvent(generateKey(condition.vmZw) + "___" + condition.UhhO.gNrp, _this);
|
|
840
1080
|
}
|
|
841
|
-
_this.
|
|
1081
|
+
_this.uNrb[name] = Date.now();
|
|
842
1082
|
}
|
|
843
1083
|
return;
|
|
844
1084
|
}
|
|
845
|
-
if ((_window$ApxorRTM2 = window.ApxorRTM) !== null && _window$ApxorRTM2 !== void 0 && _window$ApxorRTM2.isBadgePresent && (_window$ApxorRTM3 = window.ApxorRTM) !== null && _window$ApxorRTM3 !== void 0 && _window$ApxorRTM3.badgesLists.includes(_this.
|
|
846
|
-
_this.
|
|
847
|
-
_this.
|
|
848
|
-
ceInstance.validate(_this.
|
|
1085
|
+
if ((_window$ApxorRTM2 = window.ApxorRTM) !== null && _window$ApxorRTM2 !== void 0 && _window$ApxorRTM2.isBadgePresent && (_window$ApxorRTM3 = window.ApxorRTM) !== null && _window$ApxorRTM3 !== void 0 && _window$ApxorRTM3.badgesLists.includes(_this.ltQf) && Apxor.getController().isBadgeTriggerSatisfied(_this.ltQf)) {
|
|
1086
|
+
_this.kpHz = true;
|
|
1087
|
+
_this.LnyZ.OOcg = time;
|
|
1088
|
+
ceInstance.validate(_this.ltQf, _this.yvsV);
|
|
849
1089
|
return;
|
|
850
1090
|
}
|
|
851
1091
|
|
|
852
1092
|
// Validate Condition
|
|
853
|
-
var validationStatus = generateKey(_this.
|
|
1093
|
+
var validationStatus = generateKey(_this.LnyZ.vmZw) === type && _this.AnPN(time - _this.LnyZ.iBqE.OOcg, _this.LnyZ.sMpO) && _this.LnyZ.UhhO.gNrp === name && _this.aZfX(_this.LnyZ.UhhO.PvVy, additionalInfo);
|
|
854
1094
|
if (validationStatus) {
|
|
855
|
-
_this.
|
|
856
|
-
_this.
|
|
857
|
-
if (_this.
|
|
858
|
-
_this.
|
|
859
|
-
ceInstance.validate(_this.
|
|
1095
|
+
_this.zfeU += 1;
|
|
1096
|
+
_this.kpHz = _this.WCWA(_this.zfeU, _this.LnyZ.gJSN, _this.LnyZ.zzjI);
|
|
1097
|
+
if (_this.kpHz) {
|
|
1098
|
+
_this.LnyZ.OOcg = time;
|
|
1099
|
+
ceInstance.validate(_this.ltQf, _this.yvsV);
|
|
860
1100
|
}
|
|
861
1101
|
}
|
|
862
1102
|
});
|
|
863
|
-
_defineProperty(this, "
|
|
1103
|
+
_defineProperty(this, "lTzm", function (type, name, time, additionalInfo) {
|
|
864
1104
|
var ceInstance = CE.getInstance();
|
|
865
|
-
var validationStatus = generateKey(_this.
|
|
1105
|
+
var validationStatus = generateKey(_this.gYxJ.vmZw) === type && _this.AnPN(time, _this.gYxJ.sMpO) && _this.gYxJ.UhhO.gNrp === name && _this.aZfX(_this.gYxJ.UhhO.PvVy, additionalInfo);
|
|
866
1106
|
if (validationStatus) {
|
|
867
|
-
_this.
|
|
868
|
-
_this.
|
|
869
|
-
if (_this.
|
|
870
|
-
_this.
|
|
871
|
-
ceInstance.validateForTermination(_this.
|
|
1107
|
+
_this.zfeU += 1;
|
|
1108
|
+
_this.kpHz = _this.WCWA(_this.zfeU, _this.gYxJ.gJSN, _this.gYxJ.zzjI);
|
|
1109
|
+
if (_this.kpHz) {
|
|
1110
|
+
_this.gYxJ.OOcg = time;
|
|
1111
|
+
ceInstance.validateForTermination(_this.ltQf, _this.yvsV);
|
|
872
1112
|
}
|
|
873
1113
|
}
|
|
874
1114
|
});
|
|
875
|
-
_defineProperty(this, "
|
|
876
|
-
var precondition = _this.
|
|
877
|
-
return generateKey(precondition.
|
|
1115
|
+
_defineProperty(this, "LrmB", function (type, name, time, additionalInfo) {
|
|
1116
|
+
var precondition = _this.LnyZ.iBqE;
|
|
1117
|
+
return generateKey(precondition.vmZw) === type && precondition.UhhO.gNrp === name && _this.AnPN(time, precondition.sMpO) && _this.aZfX(precondition.UhhO.PvVy, additionalInfo);
|
|
878
1118
|
});
|
|
879
|
-
_defineProperty(this, "
|
|
1119
|
+
_defineProperty(this, "AnPN", function (time, timeBounds) {
|
|
880
1120
|
var currentTime = Math.ceil(time);
|
|
881
|
-
return currentTime > timeBounds.
|
|
1121
|
+
return currentTime > timeBounds.ejXF && currentTime < timeBounds.dQza;
|
|
882
1122
|
});
|
|
883
|
-
_defineProperty(this, "
|
|
1123
|
+
_defineProperty(this, "WCWA", function (current, required, operator) {
|
|
884
1124
|
var checkOld = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
885
|
-
if (checkOld && _this.
|
|
886
|
-
current = current + _this.
|
|
1125
|
+
if (checkOld && _this.LnyZ.xPfP) {
|
|
1126
|
+
current = current + _this.WXbt;
|
|
887
1127
|
}
|
|
888
1128
|
switch (operator) {
|
|
889
1129
|
case "EQ":
|
|
@@ -900,11 +1140,11 @@
|
|
|
900
1140
|
return false;
|
|
901
1141
|
}
|
|
902
1142
|
});
|
|
903
|
-
_defineProperty(this, "
|
|
1143
|
+
_defineProperty(this, "aZfX", function (expected, received) {
|
|
904
1144
|
var status = true;
|
|
905
1145
|
try {
|
|
906
1146
|
var _loop = function _loop() {
|
|
907
|
-
if (
|
|
1147
|
+
if (status === false) {
|
|
908
1148
|
return {
|
|
909
1149
|
v: false
|
|
910
1150
|
};
|
|
@@ -917,6 +1157,17 @@
|
|
|
917
1157
|
expectedValue = expected[item].val;
|
|
918
1158
|
} else if (type === "l" || type === "f") {
|
|
919
1159
|
expectedValue = parseFloat(expected[item].val);
|
|
1160
|
+
} else if (type === "b") {
|
|
1161
|
+
switch (expected[item].val) {
|
|
1162
|
+
case "true":
|
|
1163
|
+
expectedValue = true;
|
|
1164
|
+
break;
|
|
1165
|
+
case "false":
|
|
1166
|
+
expectedValue = false;
|
|
1167
|
+
break;
|
|
1168
|
+
default:
|
|
1169
|
+
expectedValue = expected[item].val;
|
|
1170
|
+
}
|
|
920
1171
|
}
|
|
921
1172
|
var loggedValues = [];
|
|
922
1173
|
if (Array.isArray(received[item])) {
|
|
@@ -925,11 +1176,23 @@
|
|
|
925
1176
|
loggedValues = [received[item]];
|
|
926
1177
|
}
|
|
927
1178
|
var match = loggedValues.some(function (loggedValue) {
|
|
928
|
-
|
|
929
|
-
|
|
1179
|
+
if (type === "s") {
|
|
1180
|
+
loggedValue = "".concat(loggedValue);
|
|
1181
|
+
} else if (type === "l") {
|
|
1182
|
+
loggedValue = parseInt(loggedValue);
|
|
1183
|
+
} else if (type === "f") {
|
|
1184
|
+
loggedValue = parseFloat(loggedValue);
|
|
1185
|
+
} else if (type === "b") {
|
|
1186
|
+
loggedValue = !!loggedValue;
|
|
1187
|
+
}
|
|
1188
|
+
return bptN(loggedValue, expectedValue, operator);
|
|
1189
|
+
}
|
|
1190
|
+
// bptN(loggedValue, expectedValue, operator)
|
|
1191
|
+
);
|
|
1192
|
+
|
|
930
1193
|
status = status && match;
|
|
931
1194
|
} else {
|
|
932
|
-
status = status &&
|
|
1195
|
+
status = status && bptN(received[item], expected[item], "EQ");
|
|
933
1196
|
}
|
|
934
1197
|
},
|
|
935
1198
|
_ret;
|
|
@@ -938,7 +1201,7 @@
|
|
|
938
1201
|
if (_ret) return _ret.v;
|
|
939
1202
|
}
|
|
940
1203
|
} catch (error) {
|
|
941
|
-
Logger$
|
|
1204
|
+
Logger$6.error(error);
|
|
942
1205
|
status = false;
|
|
943
1206
|
}
|
|
944
1207
|
return status;
|
|
@@ -948,13 +1211,13 @@
|
|
|
948
1211
|
key: "_displayCampaign",
|
|
949
1212
|
value: function _displayCampaign(time) {
|
|
950
1213
|
var ceInstance = CE.getInstance();
|
|
951
|
-
this.
|
|
952
|
-
if (this.
|
|
953
|
-
this.
|
|
954
|
-
this.
|
|
955
|
-
if (this.
|
|
956
|
-
this.
|
|
957
|
-
ceInstance.validate(this.
|
|
1214
|
+
this.kpHz = true;
|
|
1215
|
+
if (this.kpHz) {
|
|
1216
|
+
this.zfeU += 1;
|
|
1217
|
+
this.kpHz = this.WCWA(this.zfeU, this.LnyZ.gJSN, this.LnyZ.zzjI);
|
|
1218
|
+
if (this.kpHz) {
|
|
1219
|
+
this.LnyZ.OOcg = time;
|
|
1220
|
+
ceInstance.validate(this.ltQf, this.yvsV);
|
|
958
1221
|
}
|
|
959
1222
|
}
|
|
960
1223
|
}
|
|
@@ -962,21 +1225,15 @@
|
|
|
962
1225
|
return ConditionValidator;
|
|
963
1226
|
}();
|
|
964
1227
|
|
|
965
|
-
var
|
|
966
|
-
var APX_RETAINED_SESSIONS = "apx_retained_session";
|
|
967
|
-
var APX_RETAINED_DAYS = "apx_retained_days";
|
|
968
|
-
var APX_CONTEXT_EVALUATED = "apx_context_evaluated";
|
|
969
|
-
var APX_VARIANT_CODE = "apx_variant_code";
|
|
970
|
-
|
|
971
|
-
var Logger$6 = window.ApxorLogger;
|
|
1228
|
+
var Logger$7 = window.ApxorLogger;
|
|
972
1229
|
var OverallConfig = /*#__PURE__*/_createClass(function OverallConfig() {
|
|
973
1230
|
var _this = this;
|
|
974
1231
|
_classCallCheck(this, OverallConfig);
|
|
975
|
-
_defineProperty(this, "
|
|
1232
|
+
_defineProperty(this, "MOQE", []);
|
|
976
1233
|
_defineProperty(this, "_ret_day", {});
|
|
977
|
-
_defineProperty(this, "
|
|
978
|
-
_defineProperty(this, "
|
|
979
|
-
_defineProperty(this, "
|
|
1234
|
+
_defineProperty(this, "svXn", {});
|
|
1235
|
+
_defineProperty(this, "tkzI", false);
|
|
1236
|
+
_defineProperty(this, "paZC", false);
|
|
980
1237
|
_defineProperty(this, "retainedDaysValidated", true);
|
|
981
1238
|
_defineProperty(this, "retainedSessionValidated", true);
|
|
982
1239
|
_defineProperty(this, "eventDoneInLT", false);
|
|
@@ -984,13 +1241,13 @@
|
|
|
984
1241
|
_defineProperty(this, "parse", function () {
|
|
985
1242
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
986
1243
|
try {
|
|
987
|
-
_this.
|
|
1244
|
+
_this.MOQE = config.overall_cfg.events;
|
|
988
1245
|
_this._ret_day = config.overall_cfg.ret_day;
|
|
989
|
-
_this.
|
|
990
|
-
_this.
|
|
991
|
-
_this.
|
|
1246
|
+
_this.svXn = config.overall_cfg.session;
|
|
1247
|
+
_this.tkzI = config.overall_cfg.toggleRetDay;
|
|
1248
|
+
_this.paZC = config.overall_cfg.toggleSession;
|
|
992
1249
|
} catch (error) {
|
|
993
|
-
Logger$
|
|
1250
|
+
Logger$7.error(error);
|
|
994
1251
|
return false;
|
|
995
1252
|
}
|
|
996
1253
|
return true;
|
|
@@ -998,11 +1255,11 @@
|
|
|
998
1255
|
_defineProperty(this, "validate", function () {
|
|
999
1256
|
var retainedDays = parseInt(Apxor.getController().getFromStorage(APX_RETAINED_DAYS));
|
|
1000
1257
|
var retainedSession = parseInt(Apxor.getController().getFromStorage(APX_RETAINED_SESSIONS));
|
|
1001
|
-
if (_this.
|
|
1258
|
+
if (_this.tkzI && !isNaN(retainedDays) && !(retainedDays >= _this._ret_day.from && retainedDays <= _this._ret_day.to)) {
|
|
1002
1259
|
_this.retainedDaysValidated = false;
|
|
1003
1260
|
return false;
|
|
1004
1261
|
}
|
|
1005
|
-
if (_this.
|
|
1262
|
+
if (_this.paZC && !isNaN(retainedSession) && !(retainedSession >= _this.svXn.from && retainedSession <= _this.svXn.to)) {
|
|
1006
1263
|
_this.retainedSessionValidated = false;
|
|
1007
1264
|
return false;
|
|
1008
1265
|
}
|
|
@@ -1011,45 +1268,45 @@
|
|
|
1011
1268
|
var data = Apxor.getController().getFromStorage("_apx_lt_count");
|
|
1012
1269
|
var siteid = Apxor.getSiteId();
|
|
1013
1270
|
var LtCountObjDecoded = JSON.parse(new TextDecoder().decode(stringToArrayBuffer(decode(siteid, data))));
|
|
1014
|
-
for (var i = 0; i < _this.
|
|
1015
|
-
var evName = _this.
|
|
1271
|
+
for (var i = 0; i < _this.MOQE.length; i++) {
|
|
1272
|
+
var evName = _this.MOQE[i].name.replace("'", "").replace("’", "");
|
|
1016
1273
|
if (LtCountObjDecoded[evName]) {
|
|
1017
1274
|
_this.eventDoneInLT = true;
|
|
1018
1275
|
return false;
|
|
1019
1276
|
}
|
|
1020
1277
|
}
|
|
1021
1278
|
} catch (e) {
|
|
1022
|
-
Logger$
|
|
1279
|
+
Logger$7.error("Failed to validate the lt count:" + e);
|
|
1023
1280
|
}
|
|
1024
1281
|
return true;
|
|
1025
1282
|
});
|
|
1026
1283
|
});
|
|
1027
1284
|
|
|
1028
|
-
var Logger$
|
|
1285
|
+
var Logger$8 = window.ApxorLogger;
|
|
1029
1286
|
var Attributes = /*#__PURE__*/_createClass(function Attributes() {
|
|
1030
1287
|
var _this = this;
|
|
1031
1288
|
_classCallCheck(this, Attributes);
|
|
1032
|
-
_defineProperty(this, "
|
|
1033
|
-
_defineProperty(this, "
|
|
1289
|
+
_defineProperty(this, "LpbY", []);
|
|
1290
|
+
_defineProperty(this, "Hlto", []);
|
|
1034
1291
|
_defineProperty(this, "parse", function () {
|
|
1035
1292
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1036
1293
|
try {
|
|
1037
|
-
_this.
|
|
1038
|
-
_this.
|
|
1039
|
-
if (!Array.isArray(_this.
|
|
1040
|
-
Logger$
|
|
1294
|
+
_this.LpbY = config.attributes.user;
|
|
1295
|
+
_this.Hlto = config.attributes.session;
|
|
1296
|
+
if (!Array.isArray(_this.LpbY) || !Array.isArray(_this.Hlto)) {
|
|
1297
|
+
Logger$8.error("No attributes");
|
|
1041
1298
|
return false;
|
|
1042
1299
|
}
|
|
1043
1300
|
} catch (error) {
|
|
1044
|
-
Logger$
|
|
1301
|
+
Logger$8.error(error);
|
|
1045
1302
|
return false;
|
|
1046
1303
|
}
|
|
1047
1304
|
return true;
|
|
1048
1305
|
});
|
|
1049
1306
|
_defineProperty(this, "validate", function (user, session) {
|
|
1050
|
-
return _this.
|
|
1307
|
+
return _this.asXO(user, _this.LpbY) && _this.asXO(session, _this.Hlto);
|
|
1051
1308
|
});
|
|
1052
|
-
_defineProperty(this, "
|
|
1309
|
+
_defineProperty(this, "asXO", function (attributes, expected) {
|
|
1053
1310
|
var length = expected.length;
|
|
1054
1311
|
var status = true;
|
|
1055
1312
|
try {
|
|
@@ -1079,7 +1336,7 @@
|
|
|
1079
1336
|
}
|
|
1080
1337
|
var match = loggedValues.some(function (loggedValue) {
|
|
1081
1338
|
return values.some(function (configValue) {
|
|
1082
|
-
return
|
|
1339
|
+
return bptN(loggedValue, configValue, operator);
|
|
1083
1340
|
});
|
|
1084
1341
|
});
|
|
1085
1342
|
status = status && match;
|
|
@@ -1090,7 +1347,7 @@
|
|
|
1090
1347
|
if (_ret) return _ret.v;
|
|
1091
1348
|
}
|
|
1092
1349
|
} catch (error) {
|
|
1093
|
-
Logger$
|
|
1350
|
+
Logger$8.error(error);
|
|
1094
1351
|
status = false;
|
|
1095
1352
|
}
|
|
1096
1353
|
return status;
|
|
@@ -1103,18 +1360,18 @@
|
|
|
1103
1360
|
var TimeBasedTermination = /*#__PURE__*/_createClass(function TimeBasedTermination() {
|
|
1104
1361
|
var _this = this;
|
|
1105
1362
|
_classCallCheck(this, TimeBasedTermination);
|
|
1106
|
-
_defineProperty(this, "
|
|
1363
|
+
_defineProperty(this, "VYrJ", Apxor.getController());
|
|
1107
1364
|
_defineProperty(this, "type", "");
|
|
1108
1365
|
_defineProperty(this, "_duration_seconds", 0);
|
|
1109
|
-
_defineProperty(this, "
|
|
1366
|
+
_defineProperty(this, "ymgl", 1);
|
|
1110
1367
|
_defineProperty(this, "parse", function (config) {
|
|
1111
1368
|
try {
|
|
1112
1369
|
var _config$terminate_inf, _config$terminate_inf2, _config$terminate_inf3;
|
|
1113
|
-
_this.
|
|
1370
|
+
_this.ARue = (_config$terminate_inf = config.terminate_info.time_based) === null || _config$terminate_inf === void 0 ? void 0 : _config$terminate_inf.type;
|
|
1114
1371
|
_this._duration_seconds = (_config$terminate_inf2 = config.terminate_info) === null || _config$terminate_inf2 === void 0 ? void 0 : _config$terminate_inf2.time_based.duration_seconds;
|
|
1115
|
-
_this.
|
|
1116
|
-
if (_this.
|
|
1117
|
-
_this.
|
|
1372
|
+
_this.ymgl = (_config$terminate_inf3 = config.terminate_info.time_based) === null || _config$terminate_inf3 === void 0 ? void 0 : _config$terminate_inf3.days;
|
|
1373
|
+
if (_this.bptN(config._id)) {
|
|
1374
|
+
_this.VYrJ.persistTerminationInfoLocally(config._id);
|
|
1118
1375
|
return false;
|
|
1119
1376
|
}
|
|
1120
1377
|
} catch (_unused) {
|
|
@@ -1122,16 +1379,16 @@
|
|
|
1122
1379
|
}
|
|
1123
1380
|
return true;
|
|
1124
1381
|
});
|
|
1125
|
-
_defineProperty(this, "
|
|
1382
|
+
_defineProperty(this, "bptN", function (id) {
|
|
1126
1383
|
var _Data$id;
|
|
1127
|
-
var Data = JSON.parse(_this.
|
|
1384
|
+
var Data = JSON.parse(_this.VYrJ.getFromStorage(APX_TERMINATION_ID));
|
|
1128
1385
|
if (!Data[id] || !((_Data$id = Data[id]) !== null && _Data$id !== void 0 && _Data$id.startDate)) return false;
|
|
1129
1386
|
var startDate = new Date(Data[id].startDate);
|
|
1130
1387
|
var presentDate = new Date(getDateInMMDDYYYY());
|
|
1131
1388
|
var diff = parseInt((presentDate - startDate) / (1000 * 60 * 60 * 24), 10);
|
|
1132
1389
|
var currentTime = _getTime();
|
|
1133
|
-
var
|
|
1134
|
-
return diff === _this.
|
|
1390
|
+
var EfLi = Data[id].EfLi;
|
|
1391
|
+
return diff === _this.ymgl && currentTime.hours >= EfLi.hours || diff > _this.ymgl || Data[id].goalAcheived;
|
|
1135
1392
|
});
|
|
1136
1393
|
});
|
|
1137
1394
|
|
|
@@ -1140,19 +1397,19 @@
|
|
|
1140
1397
|
_classCallCheck(this, TerminationInfo);
|
|
1141
1398
|
_defineProperty(this, "enable_goal_events", false);
|
|
1142
1399
|
_defineProperty(this, "attributes", {});
|
|
1143
|
-
_defineProperty(this, "
|
|
1144
|
-
_defineProperty(this, "
|
|
1400
|
+
_defineProperty(this, "QkAi", new Attributes());
|
|
1401
|
+
_defineProperty(this, "vykZ", new TimeBasedTermination());
|
|
1145
1402
|
_defineProperty(this, "parse", function () {
|
|
1146
1403
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1147
1404
|
try {
|
|
1148
1405
|
var _config$terminate_inf, _config$terminate_inf2, _config$terminate_inf3;
|
|
1149
1406
|
_this.enable_time_based = config === null || config === void 0 || (_config$terminate_inf = config.terminate_info) === null || _config$terminate_inf === void 0 ? void 0 : _config$terminate_inf.enable_time_based;
|
|
1150
|
-
if (_this.enable_time_based && !_this.
|
|
1407
|
+
if (_this.enable_time_based && !_this.vykZ.parse(config)) {
|
|
1151
1408
|
return false;
|
|
1152
1409
|
}
|
|
1153
1410
|
_this.enable_goal_events = config === null || config === void 0 || (_config$terminate_inf2 = config.terminate_info) === null || _config$terminate_inf2 === void 0 ? void 0 : _config$terminate_inf2.enable_goal_events;
|
|
1154
1411
|
_this.enable_attributes = config === null || config === void 0 || (_config$terminate_inf3 = config.terminate_info) === null || _config$terminate_inf3 === void 0 ? void 0 : _config$terminate_inf3.enable_attributes;
|
|
1155
|
-
if (_this.enable_attributes && !_this.
|
|
1412
|
+
if (_this.enable_attributes && !_this.QkAi.parse(config.terminate_info)) {
|
|
1156
1413
|
return false;
|
|
1157
1414
|
}
|
|
1158
1415
|
} catch (error) {
|
|
@@ -1162,55 +1419,129 @@
|
|
|
1162
1419
|
return true;
|
|
1163
1420
|
});
|
|
1164
1421
|
_defineProperty(this, "validate", function (user, session) {
|
|
1165
|
-
return _this.
|
|
1422
|
+
return _this.QkAi.validate(user, session);
|
|
1166
1423
|
});
|
|
1167
1424
|
});
|
|
1168
1425
|
|
|
1169
|
-
var
|
|
1426
|
+
var Binding = /*#__PURE__*/_createClass(function Binding() {
|
|
1427
|
+
var _this = this;
|
|
1428
|
+
_classCallCheck(this, Binding);
|
|
1429
|
+
_defineProperty(this, "vrga", "");
|
|
1430
|
+
_defineProperty(this, "NSgn", "");
|
|
1431
|
+
_defineProperty(this, "hgtN", "");
|
|
1432
|
+
_defineProperty(this, "OmGM", "");
|
|
1433
|
+
_defineProperty(this, "parse", function () {
|
|
1434
|
+
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1435
|
+
try {
|
|
1436
|
+
_this.vrga = config === null || config === void 0 ? void 0 : config.screen_binding;
|
|
1437
|
+
if (!_this.vrga) {
|
|
1438
|
+
return true;
|
|
1439
|
+
} else {
|
|
1440
|
+
_this.NSgn = config === null || config === void 0 ? void 0 : config.binding.url;
|
|
1441
|
+
_this.hgtN = config === null || config === void 0 ? void 0 : config.binding["var"];
|
|
1442
|
+
_this.OmGM = config === null || config === void 0 ? void 0 : config.binding.operator;
|
|
1443
|
+
return true;
|
|
1444
|
+
}
|
|
1445
|
+
} catch (error) {
|
|
1446
|
+
window.ApxorLogger.error(error);
|
|
1447
|
+
return false;
|
|
1448
|
+
}
|
|
1449
|
+
});
|
|
1450
|
+
/**
|
|
1451
|
+
* compares the current url with url from config based on the operator
|
|
1452
|
+
* url :Screen binding url from config
|
|
1453
|
+
* variable :variable is the dynamic part of the url which we get in config which is by default "$"
|
|
1454
|
+
* operator :operator can be either "EQ" used for equality comparision or "SW" used for startswith comparision
|
|
1455
|
+
*/
|
|
1456
|
+
_defineProperty(this, "validate", function () {
|
|
1457
|
+
var url = _this.NSgn;
|
|
1458
|
+
var variable = _this.hgtN;
|
|
1459
|
+
var operator = _this.OmGM;
|
|
1460
|
+
var currentUrl = window.location.href;
|
|
1461
|
+
if (!_this.vrga) {
|
|
1462
|
+
return true;
|
|
1463
|
+
} else {
|
|
1464
|
+
if (operator === "EQ") {
|
|
1465
|
+
if (!url.includes(variable)) {
|
|
1466
|
+
if (currentUrl === url) {
|
|
1467
|
+
return true;
|
|
1468
|
+
} else {
|
|
1469
|
+
return false;
|
|
1470
|
+
}
|
|
1471
|
+
} else {
|
|
1472
|
+
var matched = _doesUrlMatchSkeleton(currentUrl, url, variable, false);
|
|
1473
|
+
if (matched) {
|
|
1474
|
+
return true;
|
|
1475
|
+
} else {
|
|
1476
|
+
return false;
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
} else if (operator === "SW") {
|
|
1480
|
+
if (!url.includes(variable)) {
|
|
1481
|
+
if (currentUrl.startsWith(url)) {
|
|
1482
|
+
return true;
|
|
1483
|
+
} else {
|
|
1484
|
+
return false;
|
|
1485
|
+
}
|
|
1486
|
+
} else {
|
|
1487
|
+
var _matched = _doesUrlMatchSkeleton(currentUrl, url, variable, true);
|
|
1488
|
+
if (_matched) {
|
|
1489
|
+
return true;
|
|
1490
|
+
} else {
|
|
1491
|
+
return false;
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
});
|
|
1497
|
+
});
|
|
1498
|
+
|
|
1499
|
+
var Logger$9 = window.ApxorLogger;
|
|
1170
1500
|
var ConfigItem = /*#__PURE__*/_createClass(function ConfigItem() {
|
|
1171
1501
|
var _this = this;
|
|
1172
1502
|
_classCallCheck(this, ConfigItem);
|
|
1173
|
-
_defineProperty(this, "
|
|
1174
|
-
_defineProperty(this, "
|
|
1175
|
-
_defineProperty(this, "
|
|
1176
|
-
_defineProperty(this, "
|
|
1177
|
-
_defineProperty(this, "
|
|
1178
|
-
_defineProperty(this, "
|
|
1179
|
-
_defineProperty(this, "
|
|
1180
|
-
_defineProperty(this, "
|
|
1181
|
-
_defineProperty(this, "
|
|
1182
|
-
_defineProperty(this, "
|
|
1183
|
-
_defineProperty(this, "
|
|
1503
|
+
_defineProperty(this, "lLoL", []);
|
|
1504
|
+
_defineProperty(this, "kuIQ", []);
|
|
1505
|
+
_defineProperty(this, "ltQf", "");
|
|
1506
|
+
_defineProperty(this, "liLD", new Meta());
|
|
1507
|
+
_defineProperty(this, "bEUi", new Audience());
|
|
1508
|
+
_defineProperty(this, "lrki", new Validity());
|
|
1509
|
+
_defineProperty(this, "Sfjv", new Frequency());
|
|
1510
|
+
_defineProperty(this, "qTcR", new OverallConfig());
|
|
1511
|
+
_defineProperty(this, "DhFu", new TerminationInfo());
|
|
1512
|
+
_defineProperty(this, "pEEU", new Binding());
|
|
1513
|
+
_defineProperty(this, "YVfa", false);
|
|
1514
|
+
_defineProperty(this, "VKON", []);
|
|
1184
1515
|
_defineProperty(this, "_variant_code", "");
|
|
1185
1516
|
_defineProperty(this, "parse", function () {
|
|
1186
1517
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1187
1518
|
try {
|
|
1188
|
-
var _this$
|
|
1519
|
+
var _this$liLD$_attr;
|
|
1189
1520
|
// If ID is not present, throw it out
|
|
1190
1521
|
if (!isDefined(config._id)) {
|
|
1191
|
-
Logger$
|
|
1522
|
+
Logger$9.error("No Id");
|
|
1192
1523
|
return false;
|
|
1193
1524
|
}
|
|
1194
1525
|
|
|
1195
1526
|
// If config is disabled, throw it out
|
|
1196
1527
|
if (!isDefined(config.enabled) || !config.enabled) {
|
|
1197
|
-
Logger$
|
|
1528
|
+
Logger$9.error("Not enabled");
|
|
1198
1529
|
return false;
|
|
1199
1530
|
}
|
|
1200
1531
|
|
|
1201
1532
|
// If META, VALIDITY, FREQUENCY and AUDIENCE is not parsed properly, throw it out
|
|
1202
|
-
if (!(_this.
|
|
1533
|
+
if (!(_this.liLD.parse(config) && _this.lrki.parse(config) && _this.Sfjv.parse(config) && _this.bEUi.parse(config) && _this.qTcR.parse(config) && _this.DhFu.parse(config) && _this.pEEU.parse(config))) {
|
|
1203
1534
|
return false;
|
|
1204
1535
|
}
|
|
1205
|
-
_this._variant_code = _this.
|
|
1536
|
+
_this._variant_code = _this.liLD._isExperiment || _this.liLD._only_context ? (_this$liLD$_attr = _this.liLD._attr) === null || _this$liLD$_attr === void 0 ? void 0 : _this$liLD$_attr[APX_VARIANT_CODE] : "TG";
|
|
1206
1537
|
// If there are no conditions, throw it out
|
|
1207
1538
|
if (!isDefined(config.conditions) || !Array.isArray(config.conditions)) {
|
|
1208
|
-
Logger$
|
|
1539
|
+
Logger$9.error("No valid conditions", config.conditions);
|
|
1209
1540
|
return false;
|
|
1210
1541
|
}
|
|
1211
|
-
_this.
|
|
1212
|
-
_this.
|
|
1213
|
-
if (_this.
|
|
1542
|
+
_this.ltQf = config._id;
|
|
1543
|
+
_this.YVfa = isDefined(config.sequence_enabled) ? config.sequence_enabled : false;
|
|
1544
|
+
if (_this.YVfa) {
|
|
1214
1545
|
// iff respectSequence is true, Sort the Conditions by their sequence order
|
|
1215
1546
|
// We need to sort, if server sends them in orderless manner
|
|
1216
1547
|
config.conditions.sort(function (prev, current) {
|
|
@@ -1221,18 +1552,22 @@
|
|
|
1221
1552
|
// Parse all conditions now
|
|
1222
1553
|
var conditions = config.conditions;
|
|
1223
1554
|
var length = conditions.length;
|
|
1224
|
-
|
|
1225
|
-
|
|
1555
|
+
var no_context_enabled = config === null || config === void 0 ? void 0 : config.no_context_enabled;
|
|
1556
|
+
if (length === 0 && no_context_enabled) {
|
|
1557
|
+
_this.ALzC();
|
|
1558
|
+
}
|
|
1559
|
+
var _loop = function _loop() {
|
|
1560
|
+
_this.VKON = [];
|
|
1226
1561
|
var condition = conditions[index];
|
|
1227
1562
|
if (condition.type === "didn't") {
|
|
1228
|
-
var
|
|
1563
|
+
var LnyZ$details;
|
|
1229
1564
|
var obj = {
|
|
1230
1565
|
trigger_key: condition.trigger.details.name,
|
|
1231
|
-
no_kpi_array: condition === null || condition === void 0 || (
|
|
1566
|
+
no_kpi_array: condition === null || condition === void 0 || (LnyZ$details = condition.details) === null || LnyZ$details === void 0 || (LnyZ$details = LnyZ$details.additional_info) === null || LnyZ$details === void 0 ? void 0 : LnyZ$details.nkpi,
|
|
1232
1567
|
condition_id: condition === null || condition === void 0 ? void 0 : condition._id,
|
|
1233
1568
|
time_bounds: condition.time_bounds.upper
|
|
1234
1569
|
};
|
|
1235
|
-
_this.
|
|
1570
|
+
_this.VKON = [].concat(_toConsumableArray(_this.VKON), [obj]);
|
|
1236
1571
|
//this will be the key
|
|
1237
1572
|
//when event occur check this array and then then check the time
|
|
1238
1573
|
//check the time diffrence
|
|
@@ -1241,143 +1576,144 @@
|
|
|
1241
1576
|
}
|
|
1242
1577
|
|
|
1243
1578
|
var conditionValidator = new ConditionValidator();
|
|
1244
|
-
if (conditionValidator.initialize(condition, _this.
|
|
1245
|
-
_this.
|
|
1579
|
+
if (conditionValidator.initialize(condition, _this.ltQf, index, _this.YVfa, _this.VKON)) {
|
|
1580
|
+
_this.lLoL.push(conditionValidator);
|
|
1581
|
+
var max_retries = (condition === null || condition === void 0 ? void 0 : condition.timeout) / (condition === null || condition === void 0 ? void 0 : condition.findinterval);
|
|
1582
|
+
var frame_id = (condition === null || condition === void 0 ? void 0 : condition.frameid) || "";
|
|
1583
|
+
var url = condition === null || condition === void 0 ? void 0 : condition.url;
|
|
1584
|
+
if (window.location.href === url) {
|
|
1585
|
+
if (condition.event_type === "view_visibility") {
|
|
1586
|
+
if (_findTargetElement(condition.view_id, frame_id, condition === null || condition === void 0 ? void 0 : condition.enable_retry, condition === null || condition === void 0 ? void 0 : condition.findinterval, max_retries) === true) {
|
|
1587
|
+
//this.kpoN();
|
|
1588
|
+
_this.ALzC(true);
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1592
|
+
// eslint-disable-next-line no-unused-vars
|
|
1593
|
+
window.addEventListener("navigate", function (event) {
|
|
1594
|
+
var url = condition === null || condition === void 0 ? void 0 : condition.url;
|
|
1595
|
+
if (window.location.href === url) {
|
|
1596
|
+
if (condition.event_type === "view_visibility") {
|
|
1597
|
+
if (_findTargetElement(condition.view_id, frame_id, condition === null || condition === void 0 ? void 0 : condition.enable_retry, condition === null || condition === void 0 ? void 0 : condition.findinterval, max_retries) === true) {
|
|
1598
|
+
//this.kpoN();
|
|
1599
|
+
_this.ALzC(true);
|
|
1600
|
+
}
|
|
1601
|
+
}
|
|
1602
|
+
}
|
|
1603
|
+
});
|
|
1246
1604
|
}
|
|
1605
|
+
};
|
|
1606
|
+
for (var index = 0; index < length; index++) {
|
|
1607
|
+
_loop();
|
|
1247
1608
|
}
|
|
1248
|
-
if (_this.
|
|
1609
|
+
if (_this.DhFu.enable_goal_events) {
|
|
1249
1610
|
var goal_events = config.terminate_info.goal_events.events;
|
|
1250
1611
|
var goaleventslength = goal_events.length;
|
|
1251
1612
|
for (var i = 0; i < goaleventslength; i++) {
|
|
1252
|
-
var
|
|
1253
|
-
if (
|
|
1254
|
-
_this.
|
|
1613
|
+
var conditionValidator = new ConditionValidator();
|
|
1614
|
+
if (conditionValidator.initialize(goal_events[i], _this.ltQf, i, true, [], "termination")) {
|
|
1615
|
+
_this.kuIQ.push(conditionValidator);
|
|
1255
1616
|
}
|
|
1256
1617
|
}
|
|
1257
1618
|
}
|
|
1258
|
-
return _this.
|
|
1619
|
+
return _this.lLoL.length > 0;
|
|
1259
1620
|
} catch (error) {
|
|
1260
|
-
Logger$
|
|
1621
|
+
Logger$9.error(error);
|
|
1261
1622
|
return false;
|
|
1262
1623
|
}
|
|
1263
1624
|
});
|
|
1264
|
-
_defineProperty(this, "
|
|
1625
|
+
_defineProperty(this, "iHps", function (index) {
|
|
1265
1626
|
if (index < 0) {
|
|
1266
1627
|
return;
|
|
1267
1628
|
}
|
|
1268
|
-
if (_this.
|
|
1269
|
-
var conditionValidator = _this.
|
|
1270
|
-
if (isDefined(conditionValidator) && conditionValidator.
|
|
1629
|
+
if (_this.YVfa) {
|
|
1630
|
+
var conditionValidator = _this.lLoL[index];
|
|
1631
|
+
if (isDefined(conditionValidator) && conditionValidator.kpHz) {
|
|
1271
1632
|
// Check if previous validator is satisfied
|
|
1272
|
-
var prevValidator = _this.
|
|
1273
|
-
if (isDefined(prevValidator) && !prevValidator.
|
|
1633
|
+
var prevValidator = _this.lLoL[index - 1];
|
|
1634
|
+
if (isDefined(prevValidator) && !prevValidator.kpHz) {
|
|
1274
1635
|
// TODO: If current index is satisfied before previous one, do something
|
|
1275
1636
|
// either unregister all conditions or remove this item from ConfigLookup
|
|
1276
1637
|
return;
|
|
1277
1638
|
}
|
|
1278
|
-
var nextValidator = _this.
|
|
1639
|
+
var nextValidator = _this.lLoL[index + 1];
|
|
1279
1640
|
if (!isDefined(nextValidator)) {
|
|
1280
1641
|
// It means this is the last condition
|
|
1281
1642
|
// Validate all conditions
|
|
1282
|
-
_this.
|
|
1643
|
+
_this.ALzC();
|
|
1283
1644
|
} else {
|
|
1284
|
-
nextValidator.
|
|
1645
|
+
nextValidator.kpoN();
|
|
1285
1646
|
}
|
|
1286
1647
|
}
|
|
1287
1648
|
} else {
|
|
1288
1649
|
// Validate all conditions
|
|
1289
|
-
_this.
|
|
1650
|
+
_this.ALzC();
|
|
1290
1651
|
}
|
|
1291
1652
|
});
|
|
1292
|
-
_defineProperty(this, "
|
|
1653
|
+
_defineProperty(this, "ybGY", function (index) {
|
|
1293
1654
|
if (index < 0) {
|
|
1294
1655
|
return;
|
|
1295
1656
|
}
|
|
1296
|
-
_this.
|
|
1657
|
+
_this.puwz();
|
|
1297
1658
|
});
|
|
1298
|
-
_defineProperty(this, "
|
|
1659
|
+
_defineProperty(this, "ALzC", function () {
|
|
1660
|
+
var _window$ApxorRTM, _window$ApxorRTM2;
|
|
1661
|
+
var view_visibility = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
1299
1662
|
// Check If Audience, Validity is satisfied or not
|
|
1300
1663
|
var userAttributes = Apxor.getController().getUserAttributes();
|
|
1301
1664
|
var sessionAttributes = Apxor.getController().getSessionAttributes();
|
|
1302
|
-
if (!
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1665
|
+
if (!((_window$ApxorRTM = window.ApxorRTM) !== null && _window$ApxorRTM !== void 0 && _window$ApxorRTM.isBadgePresent && (_window$ApxorRTM2 = window.ApxorRTM) !== null && _window$ApxorRTM2 !== void 0 && _window$ApxorRTM2.badgesLists.includes(_this.ltQf) && Apxor.getController().isBadgeTriggerSatisfied(_this.ltQf))) {
|
|
1666
|
+
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_trigger_satisfied", {
|
|
1667
|
+
apx_nudge_type: _this.liLD.ARue === "SURVEY" ? "survey" : "campaign",
|
|
1668
|
+
apx_nudge_id: _this.ltQf,
|
|
1669
|
+
apx_nudge_name: _this.liLD.gNrp,
|
|
1670
|
+
apx_variant_code: _this.liLD._isExperiment || _this.liLD._only_context ? _this.liLD._attr[APX_VARIANT_CODE] : "TG"
|
|
1671
|
+
});
|
|
1672
|
+
}
|
|
1673
|
+
if (!_this.lrki.validate() || !_this.bEUi.validate(userAttributes, sessionAttributes) || !_this.qTcR.validate() || !_this.pEEU.validate()) {
|
|
1674
|
+
if (!_this.qTcR.retainedDaysValidated) {
|
|
1675
|
+
_this.zMgT("Retained day criteria not met");
|
|
1676
|
+
return;
|
|
1312
1677
|
}
|
|
1313
|
-
if (!_this.
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
apx_nudge_id: _this.jUXZ,
|
|
1317
|
-
apx_nudge_name: _this.ByBE.figp,
|
|
1318
|
-
apx_variant_code: _this.ByBE._isExperiment || _this.ByBE._only_context ? _this.ByBE._attr[APX_VARIANT_CODE] : "TG",
|
|
1319
|
-
apx_failure_type: "warn",
|
|
1320
|
-
apx_reason: "User session criteria not met"
|
|
1321
|
-
});
|
|
1678
|
+
if (!_this.qTcR.retainedSessionValidated) {
|
|
1679
|
+
_this.zMgT("User session criteria not met");
|
|
1680
|
+
return;
|
|
1322
1681
|
}
|
|
1323
|
-
if (_this.
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
apx_nudge_id: _this.jUXZ,
|
|
1327
|
-
apx_nudge_name: _this.ByBE.figp,
|
|
1328
|
-
apx_variant_code: _this.ByBE._isExperiment || _this.ByBE._only_context ? _this.ByBE._attr[APX_VARIANT_CODE] : "TG",
|
|
1329
|
-
apx_failure_type: "warn",
|
|
1330
|
-
apx_reason: "Event done in life time"
|
|
1331
|
-
});
|
|
1682
|
+
if (_this.qTcR.eventDoneInLT) {
|
|
1683
|
+
_this.zMgT("Event done in life time");
|
|
1684
|
+
return;
|
|
1332
1685
|
}
|
|
1333
|
-
if (!_this.
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
apx_nudge_id: _this.jUXZ,
|
|
1337
|
-
apx_nudge_name: _this.ByBE.figp,
|
|
1338
|
-
apx_variant_code: _this.ByBE._isExperiment || _this.ByBE._only_context ? _this.ByBE._attr[APX_VARIANT_CODE] : "TG",
|
|
1339
|
-
apx_failure_type: "warn",
|
|
1340
|
-
apx_reason: "User property filter not met"
|
|
1341
|
-
});
|
|
1686
|
+
if (!_this.bEUi.userAttributesValidated) {
|
|
1687
|
+
_this.zMgT("User property filter not met");
|
|
1688
|
+
return;
|
|
1342
1689
|
}
|
|
1343
|
-
if (!_this.
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
apx_nudge_id: _this.jUXZ,
|
|
1347
|
-
apx_nudge_name: _this.ByBE.figp,
|
|
1348
|
-
apx_variant_code: _this.ByBE._isExperiment || _this.ByBE._only_context ? _this.ByBE._attr[APX_VARIANT_CODE] : "TG",
|
|
1349
|
-
apx_failure_type: "warn",
|
|
1350
|
-
apx_reason: "Session property filter not met"
|
|
1351
|
-
});
|
|
1690
|
+
if (!_this.bEUi.sessionAttributeValidated) {
|
|
1691
|
+
_this.zMgT("Session property filter not met");
|
|
1692
|
+
return;
|
|
1352
1693
|
}
|
|
1353
|
-
if (_this.
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
apx_nudge_id: _this.jUXZ,
|
|
1357
|
-
apx_nudge_name: _this.ByBE.figp,
|
|
1358
|
-
apx_variant_code: _this.ByBE._isExperiment || _this.ByBE._only_context ? _this.ByBE._attr[APX_VARIANT_CODE] : "TG",
|
|
1359
|
-
apx_failure_type: "warn",
|
|
1360
|
-
apx_reason: "nudge not yet active"
|
|
1361
|
-
});
|
|
1694
|
+
if (_this.lrki._not_in_specified_time) {
|
|
1695
|
+
_this.zMgT("Time limits check failed");
|
|
1696
|
+
return;
|
|
1362
1697
|
}
|
|
1363
|
-
if (_this.
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
apx_reason: "nudge expired"
|
|
1371
|
-
});
|
|
1698
|
+
if (_this.lrki._not_yet_active) {
|
|
1699
|
+
_this.zMgT("not in the scheduled time");
|
|
1700
|
+
return;
|
|
1701
|
+
}
|
|
1702
|
+
if (_this.lrki._nudge_expired) {
|
|
1703
|
+
_this.zMgT("nudge expired");
|
|
1704
|
+
return;
|
|
1372
1705
|
}
|
|
1373
1706
|
return;
|
|
1374
1707
|
}
|
|
1375
|
-
var length = _this.
|
|
1708
|
+
var length = _this.lLoL.length;
|
|
1376
1709
|
var isSatisfied = length < 1;
|
|
1377
1710
|
var combineOperator = "";
|
|
1711
|
+
if (length === 0) {
|
|
1712
|
+
isSatisfied = true;
|
|
1713
|
+
}
|
|
1378
1714
|
for (var index = 0; index < length; index++) {
|
|
1379
|
-
var validator = _this.
|
|
1380
|
-
var currentResult = validator.
|
|
1715
|
+
var validator = _this.lLoL[index];
|
|
1716
|
+
var currentResult = validator.kpHz;
|
|
1381
1717
|
if (combineOperator.trim() === "") {
|
|
1382
1718
|
isSatisfied = currentResult;
|
|
1383
1719
|
} else {
|
|
@@ -1390,59 +1726,61 @@
|
|
|
1390
1726
|
break;
|
|
1391
1727
|
}
|
|
1392
1728
|
}
|
|
1393
|
-
combineOperator = validator.
|
|
1729
|
+
combineOperator = validator.mEtI;
|
|
1730
|
+
}
|
|
1731
|
+
if (view_visibility === true) {
|
|
1732
|
+
isSatisfied = true;
|
|
1394
1733
|
}
|
|
1395
1734
|
if (isSatisfied) {
|
|
1396
|
-
var _window$ApxorRTM, _window$ApxorRTM2;
|
|
1397
1735
|
console.debug("onCondition satisfied");
|
|
1398
1736
|
// Check if count reached it's maximum
|
|
1399
|
-
if (!_this.
|
|
1400
|
-
console.warn("Maximum limit reached", _this.
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1737
|
+
if (!_this.Sfjv.gbnE(_this.ltQf)) {
|
|
1738
|
+
console.warn("Maximum limit reached", _this.ltQf);
|
|
1739
|
+
if (Apxor.getController().isTestDevice()) {
|
|
1740
|
+
feedBackMessagePopUpCE("Maximum limit reached for campaign name ".concat(_this.liLD.gNrp));
|
|
1741
|
+
var closeButton = document.getElementById("close-button");
|
|
1742
|
+
var dismissCallback = function dismissCallback() {
|
|
1743
|
+
var modal_popup_container = document.getElementById("apx-container");
|
|
1744
|
+
modal_popup_container === null || modal_popup_container === void 0 || modal_popup_container.remove();
|
|
1745
|
+
};
|
|
1746
|
+
closeButton === null || closeButton === void 0 || closeButton.addEventListener("click", dismissCallback);
|
|
1747
|
+
window.setTimeout(dismissCallback, 20000);
|
|
1748
|
+
}
|
|
1410
1749
|
return;
|
|
1411
1750
|
}
|
|
1412
1751
|
|
|
1413
1752
|
//logging event for view not found for test device
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
}
|
|
1753
|
+
|
|
1754
|
+
console.log("Dispatching event", _this.liLD.ARue);
|
|
1755
|
+
|
|
1756
|
+
//if (this.liLD._only_context === true) {
|
|
1757
|
+
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({
|
|
1758
|
+
apx_nudge_type: _this.liLD.ARue === "SURVEY" ? "survey" : "campaign",
|
|
1759
|
+
apx_nudge_id: _this.ltQf,
|
|
1760
|
+
apx_nudge_name: _this.liLD.gNrp,
|
|
1761
|
+
apx_variant_code: _this.liLD._isExperiment || _this.liLD._only_context ? _this.liLD._attr[APX_VARIANT_CODE] : "TG"
|
|
1762
|
+
}, _this.liLD._attr), {}, {
|
|
1763
|
+
message_name: _this.liLD.gNrp,
|
|
1764
|
+
id: _this.ltQf
|
|
1765
|
+
}));
|
|
1766
|
+
//}
|
|
1429
1767
|
// Emit event
|
|
1430
|
-
Apxor.getController().dispatchEvent(_this.
|
|
1431
|
-
name: _this.
|
|
1768
|
+
Apxor.getController().dispatchEvent(_this.liLD.ARue, {
|
|
1769
|
+
name: _this.liLD.ARue,
|
|
1432
1770
|
additional_info: {
|
|
1433
|
-
uuid: _this.
|
|
1434
|
-
name: _this.
|
|
1771
|
+
uuid: _this.ltQf,
|
|
1772
|
+
name: _this.liLD.gNrp
|
|
1435
1773
|
}
|
|
1436
1774
|
});
|
|
1437
1775
|
}
|
|
1438
1776
|
});
|
|
1439
|
-
_defineProperty(this, "
|
|
1440
|
-
var length = _this.
|
|
1777
|
+
_defineProperty(this, "puwz", function () {
|
|
1778
|
+
var length = _this.kuIQ.length;
|
|
1441
1779
|
var isSatisfied = length < 1;
|
|
1442
1780
|
var combineOperator = "";
|
|
1443
1781
|
for (var index = 0; index < length; index++) {
|
|
1444
|
-
var validator = _this.
|
|
1445
|
-
var currentResult = validator.
|
|
1782
|
+
var validator = _this.kuIQ[index];
|
|
1783
|
+
var currentResult = validator.kpHz;
|
|
1446
1784
|
if (combineOperator.trim() === "") {
|
|
1447
1785
|
isSatisfied = currentResult;
|
|
1448
1786
|
} else {
|
|
@@ -1455,23 +1793,23 @@
|
|
|
1455
1793
|
break;
|
|
1456
1794
|
}
|
|
1457
1795
|
}
|
|
1458
|
-
combineOperator = validator.
|
|
1796
|
+
combineOperator = validator.aCAW;
|
|
1459
1797
|
}
|
|
1460
1798
|
if (isSatisfied) {
|
|
1461
|
-
console.log("Dispatching event", _this.
|
|
1462
|
-
Apxor.getController().persistTerminationInfoLocally(_this.
|
|
1463
|
-
if (_this.
|
|
1464
|
-
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.
|
|
1465
|
-
message_name: _this.
|
|
1466
|
-
id: _this.
|
|
1799
|
+
console.log("Dispatching event", _this.liLD.ARue);
|
|
1800
|
+
Apxor.getController().persistTerminationInfoLocally(_this.ltQf);
|
|
1801
|
+
if (_this.liLD._only_context === true) {
|
|
1802
|
+
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.liLD._attr), {}, {
|
|
1803
|
+
message_name: _this.liLD.gNrp,
|
|
1804
|
+
id: _this.ltQf
|
|
1467
1805
|
}));
|
|
1468
1806
|
}
|
|
1469
1807
|
// Emit event
|
|
1470
|
-
Apxor.getController().dispatchEvent(_this.
|
|
1471
|
-
name: _this.
|
|
1808
|
+
Apxor.getController().dispatchEvent(_this.liLD.ARue, {
|
|
1809
|
+
name: _this.liLD.ARue,
|
|
1472
1810
|
additional_info: {
|
|
1473
|
-
uuid: _this.
|
|
1474
|
-
name: _this.
|
|
1811
|
+
uuid: _this.ltQf,
|
|
1812
|
+
name: _this.liLD.gNrp
|
|
1475
1813
|
}
|
|
1476
1814
|
});
|
|
1477
1815
|
}
|
|
@@ -1479,23 +1817,34 @@
|
|
|
1479
1817
|
_defineProperty(this, "validateForTerminationAttributes", function () {
|
|
1480
1818
|
var userAttributes = Apxor.getController().getUserAttributes();
|
|
1481
1819
|
var sessionAttributes = Apxor.getController().getSessionAttributes();
|
|
1482
|
-
return _this.
|
|
1820
|
+
return _this.DhFu.validate(userAttributes, sessionAttributes);
|
|
1483
1821
|
});
|
|
1484
|
-
_defineProperty(this, "
|
|
1485
|
-
_this.
|
|
1822
|
+
_defineProperty(this, "GDwW", function () {
|
|
1823
|
+
_this.Sfjv.GDwW();
|
|
1486
1824
|
});
|
|
1487
1825
|
_defineProperty(this, "getFrequencyCount", function () {
|
|
1488
|
-
return _this.
|
|
1826
|
+
return _this.Sfjv.getFrequencyCount();
|
|
1827
|
+
});
|
|
1828
|
+
_defineProperty(this, "PAkQ", function () {
|
|
1829
|
+
return _this.Sfjv.MYCG();
|
|
1489
1830
|
});
|
|
1490
|
-
_defineProperty(this, "
|
|
1491
|
-
|
|
1831
|
+
_defineProperty(this, "zMgT", function (reason) {
|
|
1832
|
+
var _this$liLD$_attr2;
|
|
1833
|
+
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
|
|
1834
|
+
apx_nudge_type: _this.liLD.ARue === "SURVEY" ? "survey" : "campaign",
|
|
1835
|
+
apx_nudge_id: _this.ltQf,
|
|
1836
|
+
apx_nudge_name: _this.liLD.gNrp,
|
|
1837
|
+
apx_variant_code: _this.liLD._isExperiment || _this.liLD._only_context ? (_this$liLD$_attr2 = _this.liLD._attr) === null || _this$liLD$_attr2 === void 0 ? void 0 : _this$liLD$_attr2[APX_VARIANT_CODE] : "TG",
|
|
1838
|
+
apx_failure_type: "warn",
|
|
1839
|
+
apx_reason: reason
|
|
1840
|
+
});
|
|
1492
1841
|
});
|
|
1493
1842
|
});
|
|
1494
1843
|
|
|
1495
1844
|
var ConfigLookup = /*#__PURE__*/_createClass(function ConfigLookup() {
|
|
1496
1845
|
var _this = this;
|
|
1497
1846
|
_classCallCheck(this, ConfigLookup);
|
|
1498
|
-
_defineProperty(this, "
|
|
1847
|
+
_defineProperty(this, "Uyzu", {});
|
|
1499
1848
|
_defineProperty(this, "parse", function () {
|
|
1500
1849
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
1501
1850
|
configs: []
|
|
@@ -1518,7 +1867,7 @@
|
|
|
1518
1867
|
var configId = _config._id;
|
|
1519
1868
|
var configItem = new ConfigItem();
|
|
1520
1869
|
if (configItem.parse(_config)) {
|
|
1521
|
-
_this.
|
|
1870
|
+
_this.Uyzu[configId] = configItem;
|
|
1522
1871
|
} else {
|
|
1523
1872
|
console.warn("Failed to parse cfg", configId);
|
|
1524
1873
|
}
|
|
@@ -1526,51 +1875,51 @@
|
|
|
1526
1875
|
}
|
|
1527
1876
|
});
|
|
1528
1877
|
_defineProperty(this, "validate", function (id, index) {
|
|
1529
|
-
if (_this.
|
|
1530
|
-
var configItem = _this.
|
|
1531
|
-
configItem.
|
|
1878
|
+
if (_this.Uyzu[id]) {
|
|
1879
|
+
var configItem = _this.Uyzu[id];
|
|
1880
|
+
configItem.iHps(index);
|
|
1532
1881
|
}
|
|
1533
1882
|
});
|
|
1534
1883
|
_defineProperty(this, "getVariantCode", function (id) {
|
|
1535
|
-
if (_this.
|
|
1536
|
-
var configItem = _this.
|
|
1884
|
+
if (_this.Uyzu[id]) {
|
|
1885
|
+
var configItem = _this.Uyzu[id];
|
|
1537
1886
|
return configItem._variant_code;
|
|
1538
1887
|
}
|
|
1539
1888
|
return "";
|
|
1540
1889
|
});
|
|
1541
1890
|
_defineProperty(this, "validateForTermination", function (id, index) {
|
|
1542
|
-
if (_this.
|
|
1543
|
-
var configItem = _this.
|
|
1544
|
-
configItem.
|
|
1891
|
+
if (_this.Uyzu[id]) {
|
|
1892
|
+
var configItem = _this.Uyzu[id];
|
|
1893
|
+
configItem.ybGY(index);
|
|
1545
1894
|
}
|
|
1546
1895
|
});
|
|
1547
1896
|
_defineProperty(this, "validateForTerminationAttributes", function (id) {
|
|
1548
|
-
if (_this.
|
|
1549
|
-
var configItem = _this.
|
|
1897
|
+
if (_this.Uyzu[id]) {
|
|
1898
|
+
var configItem = _this.Uyzu[id];
|
|
1550
1899
|
return configItem.validateForTerminationAttributes();
|
|
1551
1900
|
}
|
|
1552
1901
|
return false;
|
|
1553
1902
|
});
|
|
1554
|
-
_defineProperty(this, "
|
|
1555
|
-
var campiagnConfig = _this.
|
|
1556
|
-
campiagnConfig.
|
|
1903
|
+
_defineProperty(this, "GDwW", function (id) {
|
|
1904
|
+
var campiagnConfig = _this.Uyzu[id];
|
|
1905
|
+
campiagnConfig.GDwW();
|
|
1557
1906
|
});
|
|
1558
1907
|
_defineProperty(this, "getFrequencyCount", function (id) {
|
|
1559
|
-
var campiagnConfig = _this.
|
|
1560
|
-
return campiagnConfig.getFrequencyCount();
|
|
1908
|
+
var campiagnConfig = _this.Uyzu[id];
|
|
1909
|
+
if (campiagnConfig != undefined) return campiagnConfig.getFrequencyCount();
|
|
1561
1910
|
});
|
|
1562
1911
|
_defineProperty(this, "resetFrequencyCounts", function () {
|
|
1563
|
-
var configs = _this.
|
|
1912
|
+
var configs = _this.Uyzu;
|
|
1564
1913
|
for (var configId in configs) {
|
|
1565
|
-
configs[configId].
|
|
1914
|
+
configs[configId].PAkQ();
|
|
1566
1915
|
}
|
|
1567
1916
|
});
|
|
1568
|
-
_defineProperty(this, "
|
|
1917
|
+
_defineProperty(this, "SeVw", function (campaignId) {
|
|
1569
1918
|
try {
|
|
1570
|
-
if (_this.
|
|
1571
|
-
var configItem = _this.
|
|
1572
|
-
if (configItem && configItem.
|
|
1573
|
-
return configItem.
|
|
1919
|
+
if (_this.Uyzu) {
|
|
1920
|
+
var configItem = _this.Uyzu[campaignId];
|
|
1921
|
+
if (configItem && configItem.liLD) {
|
|
1922
|
+
return configItem.liLD;
|
|
1574
1923
|
}
|
|
1575
1924
|
}
|
|
1576
1925
|
} catch (e) {
|
|
@@ -1582,46 +1931,46 @@
|
|
|
1582
1931
|
|
|
1583
1932
|
var APP_EVENT = "APP_EVENT";
|
|
1584
1933
|
var CLIENT_EVENT = "CLIENT_EVENT";
|
|
1585
|
-
var Logger$
|
|
1934
|
+
var Logger$a = window.ApxorLogger;
|
|
1586
1935
|
var EventsListener = /*#__PURE__*/_createClass(function EventsListener() {
|
|
1587
1936
|
var _this = this;
|
|
1588
1937
|
_classCallCheck(this, EventsListener);
|
|
1589
|
-
_defineProperty(this, "
|
|
1590
|
-
_defineProperty(this, "
|
|
1591
|
-
_defineProperty(this, "
|
|
1938
|
+
_defineProperty(this, "fSbL", {});
|
|
1939
|
+
_defineProperty(this, "IMYI", []);
|
|
1940
|
+
_defineProperty(this, "kSMC", false);
|
|
1592
1941
|
_defineProperty(this, "initialize", function () {
|
|
1593
1942
|
var controller = Apxor.getController();
|
|
1594
1943
|
controller.registerForEvent(APP_EVENT, function (event) {
|
|
1595
|
-
return _this.
|
|
1944
|
+
return _this.rJYj(event, "AE");
|
|
1596
1945
|
});
|
|
1597
1946
|
controller.registerForEvent(CLIENT_EVENT, function (event) {
|
|
1598
|
-
return _this.
|
|
1947
|
+
return _this.rJYj(event, "CE");
|
|
1599
1948
|
});
|
|
1600
1949
|
});
|
|
1601
|
-
_defineProperty(this, "
|
|
1950
|
+
_defineProperty(this, "DOxG", function () {
|
|
1602
1951
|
// Clear Buffer
|
|
1603
|
-
for (var item in _this.
|
|
1604
|
-
_this.
|
|
1952
|
+
for (var item in _this.IMYI) {
|
|
1953
|
+
_this.Ugjx(item.event, item.key, item.type);
|
|
1605
1954
|
}
|
|
1606
|
-
_this.
|
|
1955
|
+
_this.kSMC = true;
|
|
1607
1956
|
});
|
|
1608
|
-
_defineProperty(this, "
|
|
1957
|
+
_defineProperty(this, "KseZ", function (event, callback) {
|
|
1609
1958
|
if (!isFunction(callback)) {
|
|
1610
1959
|
return;
|
|
1611
1960
|
}
|
|
1612
1961
|
var listeners;
|
|
1613
|
-
if (_this.
|
|
1614
|
-
listeners = _this.
|
|
1962
|
+
if (_this.fSbL[event]) {
|
|
1963
|
+
listeners = _this.fSbL[event];
|
|
1615
1964
|
} else {
|
|
1616
1965
|
listeners = [];
|
|
1617
1966
|
}
|
|
1618
1967
|
listeners.push(callback);
|
|
1619
|
-
_this.
|
|
1620
|
-
Logger$
|
|
1968
|
+
_this.fSbL[event] = listeners;
|
|
1969
|
+
Logger$a.debug("Listeners list: ", _this.fSbL);
|
|
1621
1970
|
});
|
|
1622
1971
|
_defineProperty(this, "unregisterFromEvent", function (event, callback) {
|
|
1623
|
-
if (_this.
|
|
1624
|
-
var listeners = _this.
|
|
1972
|
+
if (_this.fSbL[event]) {
|
|
1973
|
+
var listeners = _this.fSbL[event];
|
|
1625
1974
|
var updatedListeners = [];
|
|
1626
1975
|
for (var index = 0; index < listeners.length; index++) {
|
|
1627
1976
|
var listener = listeners[index];
|
|
@@ -1629,25 +1978,25 @@
|
|
|
1629
1978
|
updatedListeners.push(listener);
|
|
1630
1979
|
}
|
|
1631
1980
|
}
|
|
1632
|
-
_this.
|
|
1981
|
+
_this.fSbL[event] = updatedListeners;
|
|
1633
1982
|
}
|
|
1634
1983
|
});
|
|
1635
|
-
_defineProperty(this, "
|
|
1984
|
+
_defineProperty(this, "rJYj", function (event) {
|
|
1636
1985
|
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "AE";
|
|
1637
1986
|
var key = type + "___" + event.name;
|
|
1638
|
-
_this.
|
|
1987
|
+
_this.Ugjx(event, key, type);
|
|
1639
1988
|
});
|
|
1640
|
-
_defineProperty(this, "
|
|
1641
|
-
if (!_this.
|
|
1642
|
-
_this.
|
|
1989
|
+
_defineProperty(this, "Ugjx", function (event, key, type) {
|
|
1990
|
+
if (!_this.kSMC) {
|
|
1991
|
+
_this.IMYI.push({
|
|
1643
1992
|
event: event,
|
|
1644
1993
|
key: key,
|
|
1645
1994
|
type: type
|
|
1646
1995
|
});
|
|
1647
1996
|
} else {
|
|
1648
|
-
Logger$
|
|
1649
|
-
if (_this.
|
|
1650
|
-
var listeners = _this.
|
|
1997
|
+
Logger$a.debug("Notifying listeners for event: " + event + ", " + key, _this.fSbL);
|
|
1998
|
+
if (_this.fSbL[key]) {
|
|
1999
|
+
var listeners = _this.fSbL[key];
|
|
1651
2000
|
var time = Apxor.getController().getSDKRunningTimeInSec();
|
|
1652
2001
|
for (var index = 0; index < listeners.length; index++) {
|
|
1653
2002
|
var listener = listeners[index];
|
|
@@ -1658,22 +2007,22 @@
|
|
|
1658
2007
|
});
|
|
1659
2008
|
});
|
|
1660
2009
|
|
|
1661
|
-
var Logger$
|
|
2010
|
+
var Logger$b = window.ApxorLogger;
|
|
1662
2011
|
var CE = /*#__PURE__*/function () {
|
|
1663
2012
|
function CE() {
|
|
1664
2013
|
var _this = this;
|
|
1665
2014
|
_classCallCheck(this, CE);
|
|
1666
|
-
_defineProperty(this, "
|
|
1667
|
-
_defineProperty(this, "
|
|
1668
|
-
_defineProperty(this, "
|
|
1669
|
-
_defineProperty(this, "
|
|
1670
|
-
_defineProperty(this, "
|
|
2015
|
+
_defineProperty(this, "VIBl", false);
|
|
2016
|
+
_defineProperty(this, "Bbtb", null);
|
|
2017
|
+
_defineProperty(this, "RhAp", getDateInDDMMYYYY());
|
|
2018
|
+
_defineProperty(this, "oHjc", new EventsListener());
|
|
2019
|
+
_defineProperty(this, "KoPV", Apxor.getSiteId());
|
|
1671
2020
|
_defineProperty(this, "_qeState", {});
|
|
1672
2021
|
_defineProperty(this, "getQeState", function () {
|
|
1673
2022
|
try {
|
|
1674
2023
|
var data = Apxor.getController().getFromStorage(QE_STATE);
|
|
1675
2024
|
if (data) {
|
|
1676
|
-
return JSON.parse(decode(_this.
|
|
2025
|
+
return JSON.parse(decode(_this.KoPV, data));
|
|
1677
2026
|
} else {
|
|
1678
2027
|
_this._qeState = {};
|
|
1679
2028
|
return _this.setQeState();
|
|
@@ -1702,12 +2051,12 @@
|
|
|
1702
2051
|
return _this._qeState;
|
|
1703
2052
|
});
|
|
1704
2053
|
_defineProperty(this, "initialize", function () {
|
|
1705
|
-
if (!_this.
|
|
1706
|
-
_this.
|
|
1707
|
-
_this.
|
|
1708
|
-
_this.
|
|
2054
|
+
if (!_this.VIBl) {
|
|
2055
|
+
_this.VIBl = true;
|
|
2056
|
+
_this.Bbtb = new ConfigLookup();
|
|
2057
|
+
_this.oHjc.initialize();
|
|
1709
2058
|
_this._qeState = _this.getQeState();
|
|
1710
|
-
Logger$
|
|
2059
|
+
Logger$b.info("QE Initialized..");
|
|
1711
2060
|
}
|
|
1712
2061
|
});
|
|
1713
2062
|
/**
|
|
@@ -1716,12 +2065,12 @@
|
|
|
1716
2065
|
* @param config
|
|
1717
2066
|
*/
|
|
1718
2067
|
_defineProperty(this, "parse", function (config) {
|
|
1719
|
-
if (!_this.
|
|
1720
|
-
Logger$
|
|
2068
|
+
if (!_this.ZTGF()) {
|
|
2069
|
+
Logger$b.warn("Must call init first. Unable to proceed");
|
|
1721
2070
|
return;
|
|
1722
2071
|
}
|
|
1723
|
-
_this.
|
|
1724
|
-
_this.
|
|
2072
|
+
_this.Bbtb.parse(config);
|
|
2073
|
+
_this.oHjc.DOxG();
|
|
1725
2074
|
});
|
|
1726
2075
|
/**
|
|
1727
2076
|
* Validates all conditions for given config ID
|
|
@@ -1730,22 +2079,22 @@
|
|
|
1730
2079
|
* @param index
|
|
1731
2080
|
*/
|
|
1732
2081
|
_defineProperty(this, "validate", function (id, index) {
|
|
1733
|
-
if (!_this.
|
|
2082
|
+
if (!_this.ZTGF()) {
|
|
1734
2083
|
return;
|
|
1735
2084
|
}
|
|
1736
|
-
_this.
|
|
2085
|
+
_this.Bbtb.validate(id, index);
|
|
1737
2086
|
});
|
|
1738
2087
|
_defineProperty(this, "getVariantCode", function (id) {
|
|
1739
|
-
return _this.
|
|
2088
|
+
return _this.Bbtb.getVariantCode(id);
|
|
1740
2089
|
});
|
|
1741
2090
|
_defineProperty(this, "validateForTermination", function (id, index) {
|
|
1742
|
-
if (!_this.
|
|
2091
|
+
if (!_this.ZTGF()) {
|
|
1743
2092
|
return;
|
|
1744
2093
|
}
|
|
1745
|
-
_this.
|
|
2094
|
+
_this.Bbtb.validateForTermination(id, index);
|
|
1746
2095
|
});
|
|
1747
2096
|
_defineProperty(this, "validateForTerminationAttributes", function (user, session) {
|
|
1748
|
-
return _this.
|
|
2097
|
+
return _this.Bbtb.validateForTerminationAttributes(user, session);
|
|
1749
2098
|
});
|
|
1750
2099
|
_defineProperty(this, "updateCount", function (id) {
|
|
1751
2100
|
try {
|
|
@@ -1754,25 +2103,25 @@
|
|
|
1754
2103
|
}
|
|
1755
2104
|
_this.incrementFrequencies(id);
|
|
1756
2105
|
_this.setQeState(id);
|
|
1757
|
-
_this.
|
|
2106
|
+
_this.Bbtb.GDwW(id);
|
|
1758
2107
|
} catch (e) {
|
|
1759
2108
|
console.log("Could not update the count config:".concat(e));
|
|
1760
2109
|
}
|
|
1761
2110
|
});
|
|
1762
2111
|
_defineProperty(this, "resetFrequencyCounts", function () {
|
|
1763
|
-
_this.
|
|
2112
|
+
_this.Bbtb.resetFrequencyCounts();
|
|
1764
2113
|
});
|
|
1765
2114
|
_defineProperty(this, "getFrequencyCount", function (id) {
|
|
1766
|
-
return _this.
|
|
2115
|
+
return _this.Bbtb.getFrequencyCount(id);
|
|
1767
2116
|
});
|
|
1768
2117
|
_defineProperty(this, "registerForEvent", function (event, callback) {
|
|
1769
|
-
_this.
|
|
2118
|
+
_this.oHjc.KseZ(event, callback);
|
|
1770
2119
|
});
|
|
1771
2120
|
_defineProperty(this, "unregisterFromEvent", function (event, callback) {
|
|
1772
|
-
_this.
|
|
2121
|
+
_this.oHjc.unregisterFromEvent(event, callback);
|
|
1773
2122
|
});
|
|
1774
2123
|
_defineProperty(this, "notifyEventListener", function (event) {
|
|
1775
|
-
_this.
|
|
2124
|
+
_this.oHjc.rJYj(event);
|
|
1776
2125
|
});
|
|
1777
2126
|
/**
|
|
1778
2127
|
* Fetches the config from Server
|
|
@@ -1785,14 +2134,14 @@
|
|
|
1785
2134
|
_defineProperty(this, "fetch", function (type, validateUrl, apiUrl, callback) {
|
|
1786
2135
|
Apxor.getController().fetchConfiguration(type, validateUrl, apiUrl, callback);
|
|
1787
2136
|
});
|
|
1788
|
-
_defineProperty(this, "
|
|
1789
|
-
return _this.
|
|
2137
|
+
_defineProperty(this, "ZTGF", function () {
|
|
2138
|
+
return _this.VIBl;
|
|
1790
2139
|
});
|
|
1791
2140
|
_defineProperty(this, "getCampaignMetaFromQueryEngine", function (campaignId) {
|
|
1792
|
-
return _this.
|
|
2141
|
+
return _this.Bbtb.SeVw(campaignId);
|
|
1793
2142
|
});
|
|
1794
|
-
_defineProperty(this, "
|
|
1795
|
-
return _this.
|
|
2143
|
+
_defineProperty(this, "CoFi", function () {
|
|
2144
|
+
return _this.RhAp;
|
|
1796
2145
|
});
|
|
1797
2146
|
if (!CE.instance) {
|
|
1798
2147
|
CE.instance = this;
|
|
@@ -1816,11 +2165,11 @@
|
|
|
1816
2165
|
OVERALL: 0,
|
|
1817
2166
|
DATES: {}
|
|
1818
2167
|
};
|
|
1819
|
-
if (this.
|
|
2168
|
+
if (this.RhAp) this._qeState[id].DATES[this.RhAp] = 0;
|
|
1820
2169
|
this.setQeState(id);
|
|
1821
2170
|
}
|
|
1822
2171
|
} catch (e) {
|
|
1823
|
-
Logger$
|
|
2172
|
+
Logger$b.error("Can not create the frequency count object:" + e);
|
|
1824
2173
|
}
|
|
1825
2174
|
}
|
|
1826
2175
|
}, {
|
|
@@ -1835,12 +2184,12 @@
|
|
|
1835
2184
|
|
|
1836
2185
|
// Increment the DATES count for this particular date by 1. If the date changes reset.
|
|
1837
2186
|
var currentDate = getDateInDDMMYYYY();
|
|
1838
|
-
if (currentDate !== this.
|
|
1839
|
-
this.
|
|
2187
|
+
if (currentDate !== this.RhAp || !(configFrequency.DATES && configFrequency.DATES[currentDate])) {
|
|
2188
|
+
this.RhAp = currentDate;
|
|
1840
2189
|
configFrequency.DATES = {};
|
|
1841
|
-
configFrequency.DATES[this.
|
|
2190
|
+
configFrequency.DATES[this.RhAp] = 0;
|
|
1842
2191
|
}
|
|
1843
|
-
configFrequency.DATES[this.
|
|
2192
|
+
configFrequency.DATES[this.RhAp] = configFrequency.DATES[this.RhAp] + 1;
|
|
1844
2193
|
}
|
|
1845
2194
|
}], [{
|
|
1846
2195
|
key: "getInstance",
|
|
@@ -1859,7 +2208,7 @@
|
|
|
1859
2208
|
|
|
1860
2209
|
/* eslint-disable no-empty */
|
|
1861
2210
|
|
|
1862
|
-
window.ceVersion =
|
|
2211
|
+
window.ceVersion = 160;
|
|
1863
2212
|
try {
|
|
1864
2213
|
if (exports !== undefined || exports !== null) {
|
|
1865
2214
|
exports["default"] = CE;
|