apxor-qe 1.5.0 → 1.5.1
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 +497 -477
- package/dist/apxor.qe.min.js +1 -1
- package/package.json +1 -1
package/dist/apxor.qe.js.bak
CHANGED
|
@@ -112,6 +112,10 @@
|
|
|
112
112
|
return typeof key === "symbol" ? key : String(key);
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
+
var isUndefined = function isUndefined(term) {
|
|
116
|
+
return typeof term === "undefined";
|
|
117
|
+
};
|
|
118
|
+
|
|
115
119
|
/**
|
|
116
120
|
*
|
|
117
121
|
* @param term
|
|
@@ -203,7 +207,7 @@
|
|
|
203
207
|
var toUpperCase = function toUpperCase(key) {
|
|
204
208
|
return key.toUpperCase();
|
|
205
209
|
};
|
|
206
|
-
var
|
|
210
|
+
var Pflq = function Pflq(actual, expected, operator) {
|
|
207
211
|
switch (operator) {
|
|
208
212
|
case "EQ":
|
|
209
213
|
return actual === expected;
|
|
@@ -264,18 +268,18 @@
|
|
|
264
268
|
var Audience = /*#__PURE__*/_createClass(function Audience() {
|
|
265
269
|
var _this = this;
|
|
266
270
|
_classCallCheck(this, Audience);
|
|
267
|
-
_defineProperty(this, "
|
|
268
|
-
_defineProperty(this, "
|
|
269
|
-
_defineProperty(this, "
|
|
271
|
+
_defineProperty(this, "Lecg", "ALL");
|
|
272
|
+
_defineProperty(this, "KWLx", []);
|
|
273
|
+
_defineProperty(this, "YkGb", []);
|
|
270
274
|
_defineProperty(this, "userAttributesValidated", true);
|
|
271
275
|
_defineProperty(this, "sessionAttributeValidated", true);
|
|
272
276
|
_defineProperty(this, "parse", function () {
|
|
273
277
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
274
278
|
try {
|
|
275
|
-
_this.
|
|
276
|
-
_this.
|
|
277
|
-
_this.
|
|
278
|
-
if (!Array.isArray(_this.
|
|
279
|
+
_this.Lecg = config.audience.audience_type;
|
|
280
|
+
_this.KWLx = config.audience.attributes.user;
|
|
281
|
+
_this.YkGb = config.audience.attributes.session;
|
|
282
|
+
if (!Array.isArray(_this.KWLx) || !Array.isArray(_this.YkGb)) {
|
|
279
283
|
Logger.error("No attributes");
|
|
280
284
|
return false;
|
|
281
285
|
}
|
|
@@ -287,11 +291,11 @@
|
|
|
287
291
|
});
|
|
288
292
|
_defineProperty(this, "validate", function (user, session) {
|
|
289
293
|
var status = true;
|
|
290
|
-
if (_this.
|
|
294
|
+
if (_this.Lecg === "FTU") {
|
|
291
295
|
status = Apxor.getController().getSessionInfo().is_first_session;
|
|
292
296
|
}
|
|
293
|
-
var userAttributesCompare = _this.
|
|
294
|
-
var sessionAttributesCompare = _this.
|
|
297
|
+
var userAttributesCompare = _this.hTqd(user, _this.KWLx);
|
|
298
|
+
var sessionAttributesCompare = _this.hTqd(session, _this.YkGb);
|
|
295
299
|
if (!userAttributesCompare) {
|
|
296
300
|
_this.userAttributesValidated = false;
|
|
297
301
|
}
|
|
@@ -300,13 +304,13 @@
|
|
|
300
304
|
}
|
|
301
305
|
return status && userAttributesCompare && sessionAttributesCompare;
|
|
302
306
|
});
|
|
303
|
-
_defineProperty(this, "
|
|
307
|
+
_defineProperty(this, "hTqd", function (attributes, expected) {
|
|
304
308
|
var length = expected.length;
|
|
305
309
|
var status = true;
|
|
306
310
|
try {
|
|
307
311
|
var _loop = function _loop() {
|
|
308
312
|
var item = expected[index];
|
|
309
|
-
if (
|
|
313
|
+
if (isUndefined(attributes[item.name]) || status === false) {
|
|
310
314
|
return {
|
|
311
315
|
v: false
|
|
312
316
|
};
|
|
@@ -320,6 +324,13 @@
|
|
|
320
324
|
return parseInt(value);
|
|
321
325
|
} else if (type === "f") {
|
|
322
326
|
return parseFloat(value);
|
|
327
|
+
} else if (type === "b") {
|
|
328
|
+
switch (value) {
|
|
329
|
+
case "true":
|
|
330
|
+
return true;
|
|
331
|
+
case "false":
|
|
332
|
+
return false;
|
|
333
|
+
}
|
|
323
334
|
}
|
|
324
335
|
});
|
|
325
336
|
var loggedValues = [];
|
|
@@ -330,7 +341,16 @@
|
|
|
330
341
|
}
|
|
331
342
|
var match = loggedValues.some(function (loggedValue) {
|
|
332
343
|
return values.some(function (configValue) {
|
|
333
|
-
|
|
344
|
+
if (type === "s") {
|
|
345
|
+
loggedValue = "".concat(loggedValue);
|
|
346
|
+
} else if (type === "l") {
|
|
347
|
+
loggedValue = parseInt(loggedValue);
|
|
348
|
+
} else if (type === "f") {
|
|
349
|
+
loggedValue = parseFloat(loggedValue);
|
|
350
|
+
} else if (type === "b") {
|
|
351
|
+
loggedValue = !!loggedValue;
|
|
352
|
+
}
|
|
353
|
+
return Pflq(loggedValue, configValue, operator);
|
|
334
354
|
});
|
|
335
355
|
});
|
|
336
356
|
status = status && match;
|
|
@@ -352,37 +372,37 @@
|
|
|
352
372
|
var Frequency = /*#__PURE__*/_createClass(function Frequency() {
|
|
353
373
|
var _this = this;
|
|
354
374
|
_classCallCheck(this, Frequency);
|
|
355
|
-
_defineProperty(this, "
|
|
356
|
-
_defineProperty(this, "
|
|
357
|
-
_defineProperty(this, "
|
|
358
|
-
_defineProperty(this, "
|
|
359
|
-
_defineProperty(this, "
|
|
360
|
-
_defineProperty(this, "
|
|
375
|
+
_defineProperty(this, "eeAf", 0);
|
|
376
|
+
_defineProperty(this, "lEEo", 0);
|
|
377
|
+
_defineProperty(this, "xdhp", "SESSION");
|
|
378
|
+
_defineProperty(this, "TIcR", 0);
|
|
379
|
+
_defineProperty(this, "kcoq", 0);
|
|
380
|
+
_defineProperty(this, "dtUE", 0);
|
|
361
381
|
_defineProperty(this, "parse", function () {
|
|
362
382
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
363
383
|
try {
|
|
364
|
-
_this.
|
|
365
|
-
if (_this.
|
|
366
|
-
_this.
|
|
367
|
-
}
|
|
368
|
-
_this.
|
|
369
|
-
_this.
|
|
370
|
-
_this.
|
|
371
|
-
_this.
|
|
384
|
+
_this.eeAf = config.frequency.count;
|
|
385
|
+
if (_this.eeAf === -1) {
|
|
386
|
+
_this.eeAf = 1000;
|
|
387
|
+
}
|
|
388
|
+
_this.dtUE = _this.eeAf;
|
|
389
|
+
_this.lEEo = config.frequency.time_interval;
|
|
390
|
+
_this.xdhp = config.frequency.validity;
|
|
391
|
+
_this.kcoq = config.frequency.ses_lmt;
|
|
372
392
|
_this._dayCount = config.frequency.day_lmt;
|
|
373
393
|
// let data = Apxor.getController().getFromStorage(QE_STATE);
|
|
374
394
|
// let qe_state = JSON.parse(decode(Apxor.getSiteId(), data));
|
|
375
395
|
var qe_state = CE.getInstance().getQeState();
|
|
376
396
|
if (!isDefined(qe_state) || !isDefined(qe_state[config._id])) return true;
|
|
377
|
-
if (_this.
|
|
378
|
-
_this.
|
|
379
|
-
if (_this.
|
|
397
|
+
if (_this.xdhp === "SESSION") {
|
|
398
|
+
_this.eeAf = parseInt(_this.eeAf) - parseInt(qe_state[config._id]["SESSION"]);
|
|
399
|
+
if (_this.eeAf <= 0) {
|
|
380
400
|
console.warn("Max count limit reached for session:" + config._id);
|
|
381
401
|
return false;
|
|
382
402
|
}
|
|
383
|
-
} else if (_this.
|
|
384
|
-
_this.
|
|
385
|
-
if (_this.
|
|
403
|
+
} else if (_this.xdhp === "OVERALL") {
|
|
404
|
+
_this.eeAf = parseInt(_this.eeAf) - parseInt(qe_state[config._id]["OVERALL"]);
|
|
405
|
+
if (_this.eeAf <= 0) {
|
|
386
406
|
console.warn("Max count limit reached for overall:" + config._id);
|
|
387
407
|
return false;
|
|
388
408
|
}
|
|
@@ -396,28 +416,28 @@
|
|
|
396
416
|
}
|
|
397
417
|
return true;
|
|
398
418
|
});
|
|
399
|
-
_defineProperty(this, "
|
|
400
|
-
_this.
|
|
419
|
+
_defineProperty(this, "ikdS", function () {
|
|
420
|
+
_this.eeAf = _this.eeAf - 1;
|
|
401
421
|
});
|
|
402
422
|
_defineProperty(this, "getFrequencyCount", function () {
|
|
403
|
-
return _this.
|
|
423
|
+
return _this.eeAf;
|
|
404
424
|
});
|
|
405
|
-
_defineProperty(this, "
|
|
406
|
-
if (_this.
|
|
407
|
-
_this.
|
|
425
|
+
_defineProperty(this, "MdUm", function () {
|
|
426
|
+
if (_this.xdhp === "SESSION") {
|
|
427
|
+
_this.eeAf = _this.dtUE;
|
|
408
428
|
Logger$1.info("Campaign Limit reset");
|
|
409
429
|
}
|
|
410
430
|
});
|
|
411
431
|
/**
|
|
412
|
-
* @function
|
|
432
|
+
* @function iOMM
|
|
413
433
|
* @description Validates if the campaign count is with in the limits set in the config.
|
|
414
434
|
* @param {string} Config id
|
|
415
435
|
* @returns {boolean} true - If the Campaign limits are not reached
|
|
416
436
|
* false - Otherwise
|
|
417
437
|
*/
|
|
418
|
-
_defineProperty(this, "
|
|
438
|
+
_defineProperty(this, "iOMM", function (id) {
|
|
419
439
|
try {
|
|
420
|
-
if (_this.
|
|
440
|
+
if (_this.eeAf <= 0) {
|
|
421
441
|
return false;
|
|
422
442
|
}
|
|
423
443
|
|
|
@@ -428,8 +448,8 @@
|
|
|
428
448
|
if (!isDefined(qe_state) || !isDefined(qe_state[id])) return true;
|
|
429
449
|
|
|
430
450
|
//If the config has a session count limit set
|
|
431
|
-
if (_this.
|
|
432
|
-
var sessionCountInConfig = parseInt(_this.
|
|
451
|
+
if (_this.kcoq !== 0) {
|
|
452
|
+
var sessionCountInConfig = parseInt(_this.kcoq);
|
|
433
453
|
var thisSessionCount = parseInt(qe_state[id]["SESSION"]);
|
|
434
454
|
if (sessionCountInConfig - thisSessionCount <= 0) {
|
|
435
455
|
return false;
|
|
@@ -456,14 +476,14 @@
|
|
|
456
476
|
var Meta = /*#__PURE__*/_createClass(function Meta() {
|
|
457
477
|
var _this = this;
|
|
458
478
|
_classCallCheck(this, Meta);
|
|
459
|
-
_defineProperty(this, "
|
|
460
|
-
_defineProperty(this, "
|
|
479
|
+
_defineProperty(this, "figp", "");
|
|
480
|
+
_defineProperty(this, "Lecg", "");
|
|
461
481
|
_defineProperty(this, "parse", function () {
|
|
462
482
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
463
483
|
try {
|
|
464
484
|
var _config$meta, _config$meta2;
|
|
465
|
-
_this.
|
|
466
|
-
_this.
|
|
485
|
+
_this.figp = config.meta.name;
|
|
486
|
+
_this.Lecg = config.meta.type;
|
|
467
487
|
_this._only_context = config.meta.only_context;
|
|
468
488
|
_this._attr = ((_config$meta = config.meta) === null || _config$meta === void 0 ? void 0 : _config$meta.attr) || {};
|
|
469
489
|
_this._isExperiment = (_config$meta2 = config.meta) === null || _config$meta2 === void 0 ? void 0 : _config$meta2.isExperiment;
|
|
@@ -479,11 +499,11 @@
|
|
|
479
499
|
var Validity = /*#__PURE__*/_createClass(function Validity() {
|
|
480
500
|
var _this = this;
|
|
481
501
|
_classCallCheck(this, Validity);
|
|
482
|
-
_defineProperty(this, "
|
|
483
|
-
_defineProperty(this, "
|
|
484
|
-
_defineProperty(this, "
|
|
485
|
-
_defineProperty(this, "
|
|
486
|
-
_defineProperty(this, "
|
|
502
|
+
_defineProperty(this, "qbZE", -1);
|
|
503
|
+
_defineProperty(this, "RbKz", -1);
|
|
504
|
+
_defineProperty(this, "tgyZ", -1);
|
|
505
|
+
_defineProperty(this, "cWdN", -1);
|
|
506
|
+
_defineProperty(this, "cidg", false);
|
|
487
507
|
_defineProperty(this, "_nudge_expired", false);
|
|
488
508
|
_defineProperty(this, "_not_yet_active", false);
|
|
489
509
|
_defineProperty(this, "parse", function () {
|
|
@@ -493,17 +513,17 @@
|
|
|
493
513
|
Logger$2.error("Not valid dates");
|
|
494
514
|
return false;
|
|
495
515
|
}
|
|
496
|
-
_this.
|
|
497
|
-
_this.
|
|
516
|
+
_this.qbZE = Date.parse(config.validity.start_date);
|
|
517
|
+
_this.RbKz = Date.parse(config.validity.end_date);
|
|
498
518
|
if (isDefined(config.time_limits_in_day)) {
|
|
499
|
-
_this.
|
|
500
|
-
if (_this.
|
|
519
|
+
_this.cidg = config.time_limits_in_day;
|
|
520
|
+
if (_this.cidg && isDefined(config.time_limits)) {
|
|
501
521
|
var currentDate = new Date().toISOString().split("T")[0];
|
|
502
|
-
_this.
|
|
503
|
-
_this.
|
|
522
|
+
_this.tgyZ = Date.parse(currentDate + "T" + config.time_limits.start_time + ".000Z");
|
|
523
|
+
_this.cWdN = Date.parse(currentDate + "T" + config.time_limits.end_time + ".000Z");
|
|
504
524
|
|
|
505
525
|
// If invalid format is passed, return false
|
|
506
|
-
if (isNaN(_this.
|
|
526
|
+
if (isNaN(_this.tgyZ) || isNaN(_this.cWdN)) {
|
|
507
527
|
Logger$2.error("Not valid times");
|
|
508
528
|
return false;
|
|
509
529
|
}
|
|
@@ -517,11 +537,11 @@
|
|
|
517
537
|
});
|
|
518
538
|
_defineProperty(this, "validate", function () {
|
|
519
539
|
var currentTime = Date.now();
|
|
520
|
-
if (currentTime > _this.
|
|
521
|
-
return !_this.
|
|
522
|
-
} else if (currentTime < _this.
|
|
540
|
+
if (currentTime > _this.qbZE && currentTime < _this.RbKz) {
|
|
541
|
+
return !_this.cidg || currentTime >= _this.tgyZ && currentTime <= _this.cWdN;
|
|
542
|
+
} else if (currentTime < _this.qbZE) {
|
|
523
543
|
_this._not_yet_active = true;
|
|
524
|
-
} else if (currentTime > _this.
|
|
544
|
+
} else if (currentTime > _this.RbKz) {
|
|
525
545
|
_this._nudge_expired = true;
|
|
526
546
|
}
|
|
527
547
|
return false;
|
|
@@ -531,13 +551,13 @@
|
|
|
531
551
|
var Details = /*#__PURE__*/_createClass(function Details() {
|
|
532
552
|
var _this = this;
|
|
533
553
|
_classCallCheck(this, Details);
|
|
534
|
-
_defineProperty(this, "
|
|
535
|
-
_defineProperty(this, "
|
|
554
|
+
_defineProperty(this, "figp", "");
|
|
555
|
+
_defineProperty(this, "rXDy", {});
|
|
536
556
|
_defineProperty(this, "parse", function () {
|
|
537
557
|
var details = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
538
558
|
try {
|
|
539
|
-
_this.
|
|
540
|
-
_this.
|
|
559
|
+
_this.figp = details.name;
|
|
560
|
+
_this.rXDy = details.additional_info;
|
|
541
561
|
} catch (error) {
|
|
542
562
|
return false;
|
|
543
563
|
}
|
|
@@ -548,14 +568,14 @@
|
|
|
548
568
|
var Timebounds = /*#__PURE__*/_createClass(function Timebounds() {
|
|
549
569
|
var _this = this;
|
|
550
570
|
_classCallCheck(this, Timebounds);
|
|
551
|
-
_defineProperty(this, "
|
|
552
|
-
_defineProperty(this, "
|
|
571
|
+
_defineProperty(this, "serE", 0);
|
|
572
|
+
_defineProperty(this, "DOnR", 0);
|
|
553
573
|
_defineProperty(this, "parse", function () {
|
|
554
574
|
var timeBounds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
555
575
|
try {
|
|
556
|
-
_this.
|
|
557
|
-
_this.
|
|
558
|
-
if (isNaN(_this.
|
|
576
|
+
_this.serE = Number(timeBounds.lower);
|
|
577
|
+
_this.DOnR = Number(timeBounds.upper);
|
|
578
|
+
if (isNaN(_this.serE) || isNaN(_this.DOnR)) {
|
|
559
579
|
return false;
|
|
560
580
|
}
|
|
561
581
|
} catch (error) {
|
|
@@ -568,17 +588,17 @@
|
|
|
568
588
|
var PreCondition = /*#__PURE__*/_createClass(function PreCondition() {
|
|
569
589
|
var _this = this;
|
|
570
590
|
_classCallCheck(this, PreCondition);
|
|
571
|
-
_defineProperty(this, "
|
|
572
|
-
_defineProperty(this, "
|
|
573
|
-
_defineProperty(this, "
|
|
574
|
-
_defineProperty(this, "
|
|
575
|
-
_defineProperty(this, "
|
|
591
|
+
_defineProperty(this, "wxRT", 0);
|
|
592
|
+
_defineProperty(this, "tlgv", "");
|
|
593
|
+
_defineProperty(this, "kimo", "");
|
|
594
|
+
_defineProperty(this, "xCDb", new Details());
|
|
595
|
+
_defineProperty(this, "uvCn", new Timebounds());
|
|
576
596
|
_defineProperty(this, "parse", function () {
|
|
577
597
|
var precondition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
578
598
|
try {
|
|
579
|
-
_this.
|
|
580
|
-
_this.
|
|
581
|
-
return _this.
|
|
599
|
+
_this.tlgv = precondition.event_type;
|
|
600
|
+
_this.kimo = precondition.activity;
|
|
601
|
+
return _this.xCDb.parse(precondition.details) && _this.uvCn.parse(precondition.time_bounds);
|
|
582
602
|
} catch (error) {
|
|
583
603
|
return false;
|
|
584
604
|
}
|
|
@@ -589,29 +609,29 @@
|
|
|
589
609
|
var Condition = /*#__PURE__*/_createClass(function Condition() {
|
|
590
610
|
var _this = this;
|
|
591
611
|
_classCallCheck(this, Condition);
|
|
592
|
-
_defineProperty(this, "
|
|
593
|
-
_defineProperty(this, "
|
|
594
|
-
_defineProperty(this, "
|
|
595
|
-
_defineProperty(this, "
|
|
596
|
-
_defineProperty(this, "
|
|
597
|
-
_defineProperty(this, "
|
|
598
|
-
_defineProperty(this, "
|
|
599
|
-
_defineProperty(this, "
|
|
600
|
-
_defineProperty(this, "
|
|
601
|
-
_defineProperty(this, "
|
|
602
|
-
_defineProperty(this, "
|
|
603
|
-
_defineProperty(this, "
|
|
612
|
+
_defineProperty(this, "wxRT", 0);
|
|
613
|
+
_defineProperty(this, "eAoS", -1);
|
|
614
|
+
_defineProperty(this, "eeAf", 0);
|
|
615
|
+
_defineProperty(this, "FOfl", "");
|
|
616
|
+
_defineProperty(this, "kimo", "");
|
|
617
|
+
_defineProperty(this, "tlgv", "");
|
|
618
|
+
_defineProperty(this, "uvCn", new Timebounds());
|
|
619
|
+
_defineProperty(this, "xCDb", new Details());
|
|
620
|
+
_defineProperty(this, "woYX", new PreCondition());
|
|
621
|
+
_defineProperty(this, "zzXl", "AND");
|
|
622
|
+
_defineProperty(this, "Ziyx", false);
|
|
623
|
+
_defineProperty(this, "Lecg", void 0);
|
|
604
624
|
_defineProperty(this, "parse", function () {
|
|
605
625
|
var condition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
606
626
|
try {
|
|
607
|
-
_this.
|
|
608
|
-
_this.
|
|
609
|
-
_this.
|
|
610
|
-
_this.
|
|
611
|
-
_this.
|
|
612
|
-
_this.
|
|
613
|
-
_this.
|
|
614
|
-
return _this.
|
|
627
|
+
_this.eAoS = condition.sequence;
|
|
628
|
+
_this.eeAf = condition.count_config.count;
|
|
629
|
+
_this.FOfl = condition.count_config.operator;
|
|
630
|
+
_this.kimo = condition.activity;
|
|
631
|
+
_this.tlgv = condition.event_type;
|
|
632
|
+
_this.zzXl = condition.combine_operator;
|
|
633
|
+
_this.Lecg = condition.type;
|
|
634
|
+
return _this.xCDb.parse(condition.details) && _this.woYX.parse(condition.trigger) && _this.uvCn.parse(condition.time_bounds);
|
|
615
635
|
} catch (error) {
|
|
616
636
|
Logger$3.error(error);
|
|
617
637
|
return false;
|
|
@@ -623,19 +643,19 @@
|
|
|
623
643
|
var GoalEvent = /*#__PURE__*/_createClass(function GoalEvent() {
|
|
624
644
|
var _this = this;
|
|
625
645
|
_classCallCheck(this, GoalEvent);
|
|
626
|
-
_defineProperty(this, "
|
|
627
|
-
_defineProperty(this, "
|
|
628
|
-
_defineProperty(this, "
|
|
629
|
-
_defineProperty(this, "
|
|
630
|
-
_defineProperty(this, "
|
|
631
|
-
_defineProperty(this, "
|
|
646
|
+
_defineProperty(this, "eeAf", 0);
|
|
647
|
+
_defineProperty(this, "FOfl", "");
|
|
648
|
+
_defineProperty(this, "tlgv", "");
|
|
649
|
+
_defineProperty(this, "uvCn", new Timebounds());
|
|
650
|
+
_defineProperty(this, "xCDb", new Details());
|
|
651
|
+
_defineProperty(this, "zzXl", "AND");
|
|
632
652
|
_defineProperty(this, "parse", function (data) {
|
|
633
653
|
try {
|
|
634
|
-
_this.
|
|
635
|
-
_this.
|
|
636
|
-
_this.
|
|
637
|
-
_this.
|
|
638
|
-
return _this.
|
|
654
|
+
_this.eeAf = data.count_config.count;
|
|
655
|
+
_this.FOfl = data.count_config.operator;
|
|
656
|
+
_this.tlgv = data.event_type;
|
|
657
|
+
_this.zzXl = data.combine_operator;
|
|
658
|
+
return _this.xCDb.parse(data.details) && _this.uvCn.parse(data.time_bounds);
|
|
639
659
|
} catch (error) {
|
|
640
660
|
Logger$4.error(error);
|
|
641
661
|
return false;
|
|
@@ -649,21 +669,21 @@
|
|
|
649
669
|
function ConditionValidator() {
|
|
650
670
|
var _this = this;
|
|
651
671
|
_classCallCheck(this, ConditionValidator);
|
|
652
|
-
_defineProperty(this, "
|
|
653
|
-
_defineProperty(this, "
|
|
654
|
-
_defineProperty(this, "
|
|
655
|
-
_defineProperty(this, "
|
|
656
|
-
_defineProperty(this, "
|
|
657
|
-
_defineProperty(this, "
|
|
658
|
-
_defineProperty(this, "
|
|
659
|
-
_defineProperty(this, "
|
|
660
|
-
_defineProperty(this, "
|
|
661
|
-
_defineProperty(this, "
|
|
662
|
-
_defineProperty(this, "
|
|
663
|
-
_defineProperty(this, "
|
|
664
|
-
_defineProperty(this, "
|
|
672
|
+
_defineProperty(this, "Purf", 0);
|
|
673
|
+
_defineProperty(this, "jUXZ", "");
|
|
674
|
+
_defineProperty(this, "UHEM", new Condition());
|
|
675
|
+
_defineProperty(this, "VHgA", new GoalEvent());
|
|
676
|
+
_defineProperty(this, "dwoA", false);
|
|
677
|
+
_defineProperty(this, "KWyt", false);
|
|
678
|
+
_defineProperty(this, "OOsw", 0);
|
|
679
|
+
_defineProperty(this, "zzXl", "AND");
|
|
680
|
+
_defineProperty(this, "bXqj", "OR");
|
|
681
|
+
_defineProperty(this, "aJVI", -1);
|
|
682
|
+
_defineProperty(this, "moyq", []);
|
|
683
|
+
_defineProperty(this, "FJhx", {});
|
|
684
|
+
_defineProperty(this, "bNNf", false);
|
|
665
685
|
/**
|
|
666
|
-
* If respectSequence is true, don't auto-
|
|
686
|
+
* If respectSequence is true, don't auto-PaJS to events except for the condition whose index is 0
|
|
667
687
|
*
|
|
668
688
|
* @param condition
|
|
669
689
|
* @param type
|
|
@@ -679,191 +699,191 @@
|
|
|
679
699
|
var respectSequence = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
680
700
|
var noKpiArray = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
681
701
|
var flag = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : "";
|
|
682
|
-
_this.
|
|
683
|
-
_this.
|
|
684
|
-
_this.
|
|
702
|
+
_this.jUXZ = id;
|
|
703
|
+
_this.OOsw = index;
|
|
704
|
+
_this.moyq = noKpiArray;
|
|
685
705
|
if (flag !== "termination" || flag === "") {
|
|
686
|
-
var result = _this.
|
|
706
|
+
var result = _this.UHEM.parse(condition);
|
|
687
707
|
if (result) {
|
|
688
|
-
_this.
|
|
708
|
+
_this.zzXl = _this.UHEM.zzXl;
|
|
689
709
|
|
|
690
710
|
// FIXME: Why this code is written? Don't see any usecase
|
|
691
|
-
if (_this.
|
|
692
|
-
var eventName = _this.
|
|
711
|
+
if (_this.UHEM.Ziyx) {
|
|
712
|
+
var eventName = _this.UHEM.xCDb.figp;
|
|
693
713
|
if (eventName === "APX_PAGE_OPENED") {
|
|
694
|
-
eventName = _this.
|
|
695
|
-
eventName = isDefined(eventName) ? eventName : _this.
|
|
714
|
+
eventName = _this.UHEM.xCDb.rXDy["navigation_id"];
|
|
715
|
+
eventName = isDefined(eventName) ? eventName : _this.UHEM.xCDb.figp;
|
|
696
716
|
}
|
|
697
|
-
_this.
|
|
698
|
-
var count = _this.
|
|
699
|
-
var operator = _this.
|
|
700
|
-
_this.
|
|
701
|
-
_this.
|
|
702
|
-
// If the condition is already satisfied and if it is page view, no need to
|
|
717
|
+
_this.aJVI = Apxor.getController().getEventCount(eventName);
|
|
718
|
+
var count = _this.UHEM.eeAf;
|
|
719
|
+
var operator = _this.UHEM.FOfl;
|
|
720
|
+
_this.KWyt = _this.ZQVH(_this.aJVI - 1, count, operator, false);
|
|
721
|
+
_this.dwoA = _this.KWyt;
|
|
722
|
+
// If the condition is already satisfied and if it is page view, no need to PaJS
|
|
703
723
|
// This only applies for NAVIGATION_EVENTS
|
|
704
|
-
if (_this.
|
|
724
|
+
if (_this.KWyt && _this.UHEM.xCDb.figp === "APX_PAGE_OPENED") {
|
|
705
725
|
return true;
|
|
706
726
|
}
|
|
707
727
|
}
|
|
708
728
|
if (!respectSequence || index === 0) {
|
|
709
|
-
_this.
|
|
729
|
+
_this.PaJS();
|
|
710
730
|
}
|
|
711
731
|
return true;
|
|
712
732
|
}
|
|
713
733
|
} else {
|
|
714
|
-
var _result = _this.
|
|
715
|
-
_this.
|
|
716
|
-
_this.
|
|
734
|
+
var _result = _this.VHgA.parse(condition);
|
|
735
|
+
_this.bXqj = _this.VHgA.zzXl;
|
|
736
|
+
_this.gUva();
|
|
717
737
|
return true;
|
|
718
738
|
}
|
|
719
739
|
return false;
|
|
720
740
|
});
|
|
721
|
-
_defineProperty(this, "
|
|
741
|
+
_defineProperty(this, "PaJS", function () {
|
|
722
742
|
var _window$ApxorRTM;
|
|
723
|
-
var condition = _this.
|
|
724
|
-
var precondition = condition.
|
|
743
|
+
var condition = _this.UHEM;
|
|
744
|
+
var precondition = condition.woYX;
|
|
725
745
|
var ceInstance = CE.getInstance();
|
|
726
|
-
if (precondition.
|
|
727
|
-
_this.
|
|
728
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
746
|
+
if (precondition.tlgv === "app_start") {
|
|
747
|
+
_this.dwoA = true;
|
|
748
|
+
ceInstance.registerForEvent(generateKey(condition.tlgv) + "___" + condition.xCDb.figp, _this.YgWO);
|
|
729
749
|
} else {
|
|
730
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
750
|
+
ceInstance.registerForEvent(generateKey(condition.tlgv) + "___" + precondition.xCDb.figp, _this.YgWO);
|
|
731
751
|
}
|
|
732
|
-
if ((_window$ApxorRTM = window.ApxorRTM) !== null && _window$ApxorRTM !== void 0 && _window$ApxorRTM.badgesLists.includes(_this.
|
|
733
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
752
|
+
if ((_window$ApxorRTM = window.ApxorRTM) !== null && _window$ApxorRTM !== void 0 && _window$ApxorRTM.badgesLists.includes(_this.jUXZ)) {
|
|
753
|
+
ceInstance.registerForEvent(generateKey(condition.tlgv) + "___" + "apxor-badge-container-".concat("-".concat(_this.jUXZ).replaceAll(" ", "").replace(/[^\w\s]/gi, "")), _this.YgWO);
|
|
734
754
|
}
|
|
735
755
|
});
|
|
736
|
-
_defineProperty(this, "
|
|
737
|
-
var condition = _this.
|
|
756
|
+
_defineProperty(this, "gUva", function () {
|
|
757
|
+
var condition = _this.VHgA;
|
|
738
758
|
var ceInstance = CE.getInstance();
|
|
739
|
-
_this.
|
|
740
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
759
|
+
_this.dwoA = true;
|
|
760
|
+
ceInstance.registerForEvent(generateKey(condition.tlgv) + "___" + condition.xCDb.figp, _this.cQYJ);
|
|
741
761
|
});
|
|
742
|
-
_defineProperty(this, "
|
|
743
|
-
var _this$
|
|
762
|
+
_defineProperty(this, "LcXc", function (type, name, time, additionalInfo) {
|
|
763
|
+
var _this$UHEM;
|
|
744
764
|
var eventTime = Date.now();
|
|
745
|
-
var time_differnce = (eventTime - _this.
|
|
746
|
-
var time_fromConfig = ((_this$
|
|
765
|
+
var time_differnce = (eventTime - _this.FJhx[name]) / 1000;
|
|
766
|
+
var time_fromConfig = ((_this$UHEM = _this.UHEM) === null || _this$UHEM === void 0 || (_this$UHEM = _this$UHEM.xCDb) === null || _this$UHEM === void 0 || (_this$UHEM = _this$UHEM.rXDy) === null || _this$UHEM === void 0 ? void 0 : _this$UHEM.time) / 1000;
|
|
747
767
|
if (time_fromConfig > time_differnce) {
|
|
748
768
|
_this._displayCampaign(time);
|
|
749
769
|
}
|
|
750
770
|
});
|
|
751
|
-
_defineProperty(this, "
|
|
771
|
+
_defineProperty(this, "gLck", function (type, name, time, additionalInfo) {
|
|
752
772
|
var _this$_condition2, _this$_condition3;
|
|
753
|
-
_this.
|
|
773
|
+
_this.bNNf = true;
|
|
754
774
|
var currentTime = Date.now();
|
|
755
|
-
var eventName = (_this$_condition2 = _this.
|
|
756
|
-
var eventTime = _this.
|
|
775
|
+
var eventName = (_this$_condition2 = _this.UHEM) === null || _this$_condition2 === void 0 || (_this$_condition2 = _this$_condition2.woYX) === null || _this$_condition2 === void 0 ? void 0 : _this$_condition2.xCDb.figp;
|
|
776
|
+
var eventTime = _this.FJhx[eventName];
|
|
757
777
|
var time_differnce = (currentTime - eventTime) / 1000;
|
|
758
|
-
var time_fromConfig = (_this$_condition3 = _this.
|
|
778
|
+
var time_fromConfig = (_this$_condition3 = _this.UHEM) === null || _this$_condition3 === void 0 || (_this$_condition3 = _this$_condition3.xCDb) === null || _this$_condition3 === void 0 || (_this$_condition3 = _this$_condition3.rXDy) === null || _this$_condition3 === void 0 ? void 0 : _this$_condition3.time;
|
|
759
779
|
time_fromConfig = time_fromConfig / 1000;
|
|
760
780
|
if (time_fromConfig > time_differnce) {
|
|
761
781
|
_this._displayCampaign(time);
|
|
762
782
|
}
|
|
763
783
|
//unregister the event
|
|
764
784
|
});
|
|
765
|
-
_defineProperty(this, "
|
|
785
|
+
_defineProperty(this, "YgWO", function (type, name, time, additionalInfo) {
|
|
766
786
|
var _window$ApxorRTM2, _window$ApxorRTM3;
|
|
767
787
|
var ceInstance = CE.getInstance();
|
|
768
|
-
if (!_this.
|
|
788
|
+
if (!_this.dwoA) {
|
|
769
789
|
// Validate Precondition
|
|
770
|
-
_this.
|
|
771
|
-
if (_this.
|
|
772
|
-
var condition = _this.
|
|
773
|
-
var precondition = condition.
|
|
774
|
-
precondition.
|
|
790
|
+
_this.dwoA = _this.uXGd(type, name, time, additionalInfo);
|
|
791
|
+
if (_this.dwoA) {
|
|
792
|
+
var condition = _this.UHEM;
|
|
793
|
+
var precondition = condition.woYX;
|
|
794
|
+
precondition.wxRT = time;
|
|
775
795
|
//events will be registred by its type activity event_type: "activity_time"
|
|
776
|
-
if ((condition === null || condition === void 0 ? void 0 : condition.
|
|
777
|
-
var
|
|
778
|
-
var event_time = condition === null || condition === void 0 || (
|
|
779
|
-
if ((condition === null || condition === void 0 || (
|
|
796
|
+
if ((condition === null || condition === void 0 ? void 0 : condition.tlgv) === "activity_time") {
|
|
797
|
+
var UHEM$xCDb, UHEM$_details2, UHEM$_details3;
|
|
798
|
+
var event_time = condition === null || condition === void 0 || (UHEM$xCDb = condition.xCDb) === null || UHEM$xCDb === void 0 || (UHEM$xCDb = UHEM$xCDb.rXDy) === null || UHEM$xCDb === void 0 ? void 0 : UHEM$xCDb.time;
|
|
799
|
+
if ((condition === null || condition === void 0 || (UHEM$_details2 = condition.xCDb) === null || UHEM$_details2 === void 0 || (UHEM$_details2 = UHEM$_details2.rXDy) === null || UHEM$_details2 === void 0 ? void 0 : UHEM$_details2.nkpi.length) > 0) {
|
|
780
800
|
setTimeout(function () {
|
|
781
|
-
if (!_this.
|
|
782
|
-
_this.
|
|
783
|
-
if (_this.
|
|
784
|
-
_this.
|
|
785
|
-
_this.
|
|
786
|
-
if (_this.
|
|
787
|
-
_this.
|
|
788
|
-
ceInstance.validate(_this.
|
|
801
|
+
if (!_this.bNNf) {
|
|
802
|
+
_this.KWyt = true;
|
|
803
|
+
if (_this.KWyt) {
|
|
804
|
+
_this.Purf += 1;
|
|
805
|
+
_this.KWyt = _this.ZQVH(_this.Purf, _this.UHEM.eeAf, _this.UHEM.FOfl);
|
|
806
|
+
if (_this.KWyt) {
|
|
807
|
+
_this.UHEM.wxRT = time;
|
|
808
|
+
ceInstance.validate(_this.jUXZ, _this.OOsw);
|
|
789
809
|
}
|
|
790
810
|
}
|
|
791
811
|
}
|
|
792
|
-
condition.
|
|
793
|
-
ceInstance.unregisterFromEvent(toUpperCase(condition.
|
|
812
|
+
condition.xCDb.rXDy.nkpi.map(function (nokpi) {
|
|
813
|
+
ceInstance.unregisterFromEvent(toUpperCase(condition.xCDb.rXDy.et) + "___" + nokpi, _this);
|
|
794
814
|
});
|
|
795
815
|
}, event_time);
|
|
796
|
-
condition.
|
|
797
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
816
|
+
condition.xCDb.rXDy.nkpi.map(function (nokpi) {
|
|
817
|
+
ceInstance.registerForEvent(toUpperCase(condition.xCDb.rXDy.et) + "___" + nokpi, _this.gLck);
|
|
798
818
|
});
|
|
799
819
|
}
|
|
800
820
|
//it is for unregistering the events did case after completing the time imit
|
|
801
|
-
if ((condition === null || condition === void 0 || (
|
|
821
|
+
if ((condition === null || condition === void 0 || (UHEM$_details3 = condition.xCDb) === null || UHEM$_details3 === void 0 || (UHEM$_details3 = UHEM$_details3.rXDy) === null || UHEM$_details3 === void 0 ? void 0 : UHEM$_details3.kpi.length) > 0) {
|
|
802
822
|
setTimeout(function () {
|
|
803
|
-
condition.
|
|
804
|
-
ceInstance.unregisterFromEvent(toUpperCase(condition.
|
|
823
|
+
condition.xCDb.rXDy.kpi.map(function (kpi) {
|
|
824
|
+
ceInstance.unregisterFromEvent(toUpperCase(condition.xCDb.rXDy.et) + "___" + kpi, _this);
|
|
805
825
|
});
|
|
806
826
|
}, event_time);
|
|
807
|
-
condition.
|
|
808
|
-
if (kpi === condition.
|
|
827
|
+
condition.xCDb.rXDy.kpi.map(function (kpi) {
|
|
828
|
+
if (kpi === condition.woYX.xCDb.figp) {
|
|
809
829
|
//unregister the previous event
|
|
810
|
-
ceInstance.unregisterFromEvent(generateKey(precondition.
|
|
811
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
830
|
+
ceInstance.unregisterFromEvent(generateKey(precondition.tlgv) + "___" + precondition.xCDb.figp, _this);
|
|
831
|
+
ceInstance.registerForEvent(toUpperCase(condition.xCDb.rXDy.et) + "___" + kpi, _this.LcXc);
|
|
812
832
|
} else {
|
|
813
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
833
|
+
ceInstance.registerForEvent(toUpperCase(condition.xCDb.rXDy.et) + "___" + kpi, _this.gLck);
|
|
814
834
|
}
|
|
815
835
|
});
|
|
816
836
|
}
|
|
817
837
|
} else {
|
|
818
|
-
ceInstance.unregisterFromEvent(generateKey(precondition.
|
|
819
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
838
|
+
ceInstance.unregisterFromEvent(generateKey(precondition.tlgv) + "___" + precondition.xCDb.figp, _this);
|
|
839
|
+
ceInstance.registerForEvent(generateKey(condition.tlgv) + "___" + condition.xCDb.figp, _this);
|
|
820
840
|
}
|
|
821
|
-
_this.
|
|
841
|
+
_this.FJhx[name] = Date.now();
|
|
822
842
|
}
|
|
823
843
|
return;
|
|
824
844
|
}
|
|
825
|
-
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.
|
|
826
|
-
_this.
|
|
827
|
-
_this.
|
|
828
|
-
ceInstance.validate(_this.
|
|
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.jUXZ) && Apxor.getController().isBadgeTriggerSatisfied(_this.jUXZ)) {
|
|
846
|
+
_this.KWyt = true;
|
|
847
|
+
_this.UHEM.wxRT = time;
|
|
848
|
+
ceInstance.validate(_this.jUXZ, _this.OOsw);
|
|
829
849
|
return;
|
|
830
850
|
}
|
|
831
851
|
|
|
832
852
|
// Validate Condition
|
|
833
|
-
var validationStatus = generateKey(_this.
|
|
853
|
+
var validationStatus = generateKey(_this.UHEM.tlgv) === type && _this.tBEr(time - _this.UHEM.woYX.wxRT, _this.UHEM.uvCn) && _this.UHEM.xCDb.figp === name && _this.BSUO(_this.UHEM.xCDb.rXDy, additionalInfo);
|
|
834
854
|
if (validationStatus) {
|
|
835
|
-
_this.
|
|
836
|
-
_this.
|
|
837
|
-
if (_this.
|
|
838
|
-
_this.
|
|
839
|
-
ceInstance.validate(_this.
|
|
855
|
+
_this.Purf += 1;
|
|
856
|
+
_this.KWyt = _this.ZQVH(_this.Purf, _this.UHEM.eeAf, _this.UHEM.FOfl);
|
|
857
|
+
if (_this.KWyt) {
|
|
858
|
+
_this.UHEM.wxRT = time;
|
|
859
|
+
ceInstance.validate(_this.jUXZ, _this.OOsw);
|
|
840
860
|
}
|
|
841
861
|
}
|
|
842
862
|
});
|
|
843
|
-
_defineProperty(this, "
|
|
863
|
+
_defineProperty(this, "cQYJ", function (type, name, time, additionalInfo) {
|
|
844
864
|
var ceInstance = CE.getInstance();
|
|
845
|
-
var validationStatus = generateKey(_this.
|
|
865
|
+
var validationStatus = generateKey(_this.VHgA.tlgv) === type && _this.tBEr(time, _this.VHgA.uvCn) && _this.VHgA.xCDb.figp === name && _this.BSUO(_this.VHgA.xCDb.rXDy, additionalInfo);
|
|
846
866
|
if (validationStatus) {
|
|
847
|
-
_this.
|
|
848
|
-
_this.
|
|
849
|
-
if (_this.
|
|
850
|
-
_this.
|
|
851
|
-
ceInstance.validateForTermination(_this.
|
|
867
|
+
_this.Purf += 1;
|
|
868
|
+
_this.KWyt = _this.ZQVH(_this.Purf, _this.VHgA.eeAf, _this.VHgA.FOfl);
|
|
869
|
+
if (_this.KWyt) {
|
|
870
|
+
_this.VHgA.wxRT = time;
|
|
871
|
+
ceInstance.validateForTermination(_this.jUXZ, _this.OOsw);
|
|
852
872
|
}
|
|
853
873
|
}
|
|
854
874
|
});
|
|
855
|
-
_defineProperty(this, "
|
|
856
|
-
var precondition = _this.
|
|
857
|
-
return generateKey(precondition.
|
|
875
|
+
_defineProperty(this, "uXGd", function (type, name, time, additionalInfo) {
|
|
876
|
+
var precondition = _this.UHEM.woYX;
|
|
877
|
+
return generateKey(precondition.tlgv) === type && precondition.xCDb.figp === name && _this.tBEr(time, precondition.uvCn) && _this.BSUO(precondition.xCDb.rXDy, additionalInfo);
|
|
858
878
|
});
|
|
859
|
-
_defineProperty(this, "
|
|
879
|
+
_defineProperty(this, "tBEr", function (time, timeBounds) {
|
|
860
880
|
var currentTime = Math.ceil(time);
|
|
861
|
-
return currentTime > timeBounds.
|
|
881
|
+
return currentTime > timeBounds.serE && currentTime < timeBounds.DOnR;
|
|
862
882
|
});
|
|
863
|
-
_defineProperty(this, "
|
|
883
|
+
_defineProperty(this, "ZQVH", function (current, required, operator) {
|
|
864
884
|
var checkOld = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
865
|
-
if (checkOld && _this.
|
|
866
|
-
current = current + _this.
|
|
885
|
+
if (checkOld && _this.UHEM.Ziyx) {
|
|
886
|
+
current = current + _this.aJVI;
|
|
867
887
|
}
|
|
868
888
|
switch (operator) {
|
|
869
889
|
case "EQ":
|
|
@@ -880,7 +900,7 @@
|
|
|
880
900
|
return false;
|
|
881
901
|
}
|
|
882
902
|
});
|
|
883
|
-
_defineProperty(this, "
|
|
903
|
+
_defineProperty(this, "BSUO", function (expected, received) {
|
|
884
904
|
var status = true;
|
|
885
905
|
try {
|
|
886
906
|
var _loop = function _loop() {
|
|
@@ -905,11 +925,11 @@
|
|
|
905
925
|
loggedValues = [received[item]];
|
|
906
926
|
}
|
|
907
927
|
var match = loggedValues.some(function (loggedValue) {
|
|
908
|
-
return
|
|
928
|
+
return Pflq(loggedValue, expectedValue, operator);
|
|
909
929
|
});
|
|
910
930
|
status = status && match;
|
|
911
931
|
} else {
|
|
912
|
-
status = status &&
|
|
932
|
+
status = status && Pflq(received[item], expected[item], "EQ");
|
|
913
933
|
}
|
|
914
934
|
},
|
|
915
935
|
_ret;
|
|
@@ -928,13 +948,13 @@
|
|
|
928
948
|
key: "_displayCampaign",
|
|
929
949
|
value: function _displayCampaign(time) {
|
|
930
950
|
var ceInstance = CE.getInstance();
|
|
931
|
-
this.
|
|
932
|
-
if (this.
|
|
933
|
-
this.
|
|
934
|
-
this.
|
|
935
|
-
if (this.
|
|
936
|
-
this.
|
|
937
|
-
ceInstance.validate(this.
|
|
951
|
+
this.KWyt = true;
|
|
952
|
+
if (this.KWyt) {
|
|
953
|
+
this.Purf += 1;
|
|
954
|
+
this.KWyt = this.ZQVH(this.Purf, this.UHEM.eeAf, this.UHEM.FOfl);
|
|
955
|
+
if (this.KWyt) {
|
|
956
|
+
this.UHEM.wxRT = time;
|
|
957
|
+
ceInstance.validate(this.jUXZ, this.OOsw);
|
|
938
958
|
}
|
|
939
959
|
}
|
|
940
960
|
}
|
|
@@ -952,11 +972,11 @@
|
|
|
952
972
|
var OverallConfig = /*#__PURE__*/_createClass(function OverallConfig() {
|
|
953
973
|
var _this = this;
|
|
954
974
|
_classCallCheck(this, OverallConfig);
|
|
955
|
-
_defineProperty(this, "
|
|
975
|
+
_defineProperty(this, "zlRP", []);
|
|
956
976
|
_defineProperty(this, "_ret_day", {});
|
|
957
|
-
_defineProperty(this, "
|
|
958
|
-
_defineProperty(this, "
|
|
959
|
-
_defineProperty(this, "
|
|
977
|
+
_defineProperty(this, "UUEf", {});
|
|
978
|
+
_defineProperty(this, "jxTr", false);
|
|
979
|
+
_defineProperty(this, "kPcF", false);
|
|
960
980
|
_defineProperty(this, "retainedDaysValidated", true);
|
|
961
981
|
_defineProperty(this, "retainedSessionValidated", true);
|
|
962
982
|
_defineProperty(this, "eventDoneInLT", false);
|
|
@@ -964,11 +984,11 @@
|
|
|
964
984
|
_defineProperty(this, "parse", function () {
|
|
965
985
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
966
986
|
try {
|
|
967
|
-
_this.
|
|
987
|
+
_this.zlRP = config.overall_cfg.events;
|
|
968
988
|
_this._ret_day = config.overall_cfg.ret_day;
|
|
969
|
-
_this.
|
|
970
|
-
_this.
|
|
971
|
-
_this.
|
|
989
|
+
_this.UUEf = config.overall_cfg.session;
|
|
990
|
+
_this.jxTr = config.overall_cfg.toggleRetDay;
|
|
991
|
+
_this.kPcF = config.overall_cfg.toggleSession;
|
|
972
992
|
} catch (error) {
|
|
973
993
|
Logger$6.error(error);
|
|
974
994
|
return false;
|
|
@@ -978,11 +998,11 @@
|
|
|
978
998
|
_defineProperty(this, "validate", function () {
|
|
979
999
|
var retainedDays = parseInt(Apxor.getController().getFromStorage(APX_RETAINED_DAYS));
|
|
980
1000
|
var retainedSession = parseInt(Apxor.getController().getFromStorage(APX_RETAINED_SESSIONS));
|
|
981
|
-
if (_this.
|
|
1001
|
+
if (_this.jxTr && !isNaN(retainedDays) && !(retainedDays >= _this._ret_day.from && retainedDays <= _this._ret_day.to)) {
|
|
982
1002
|
_this.retainedDaysValidated = false;
|
|
983
1003
|
return false;
|
|
984
1004
|
}
|
|
985
|
-
if (_this.
|
|
1005
|
+
if (_this.kPcF && !isNaN(retainedSession) && !(retainedSession >= _this.UUEf.from && retainedSession <= _this.UUEf.to)) {
|
|
986
1006
|
_this.retainedSessionValidated = false;
|
|
987
1007
|
return false;
|
|
988
1008
|
}
|
|
@@ -991,8 +1011,8 @@
|
|
|
991
1011
|
var data = Apxor.getController().getFromStorage("_apx_lt_count");
|
|
992
1012
|
var siteid = Apxor.getSiteId();
|
|
993
1013
|
var LtCountObjDecoded = JSON.parse(new TextDecoder().decode(stringToArrayBuffer(decode(siteid, data))));
|
|
994
|
-
for (var i = 0; i < _this.
|
|
995
|
-
var evName = _this.
|
|
1014
|
+
for (var i = 0; i < _this.zlRP.length; i++) {
|
|
1015
|
+
var evName = _this.zlRP[i].name.replace("'", "").replace("’", "");
|
|
996
1016
|
if (LtCountObjDecoded[evName]) {
|
|
997
1017
|
_this.eventDoneInLT = true;
|
|
998
1018
|
return false;
|
|
@@ -1009,14 +1029,14 @@
|
|
|
1009
1029
|
var Attributes = /*#__PURE__*/_createClass(function Attributes() {
|
|
1010
1030
|
var _this = this;
|
|
1011
1031
|
_classCallCheck(this, Attributes);
|
|
1012
|
-
_defineProperty(this, "
|
|
1013
|
-
_defineProperty(this, "
|
|
1032
|
+
_defineProperty(this, "KWLx", []);
|
|
1033
|
+
_defineProperty(this, "YkGb", []);
|
|
1014
1034
|
_defineProperty(this, "parse", function () {
|
|
1015
1035
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1016
1036
|
try {
|
|
1017
|
-
_this.
|
|
1018
|
-
_this.
|
|
1019
|
-
if (!Array.isArray(_this.
|
|
1037
|
+
_this.KWLx = config.attributes.user;
|
|
1038
|
+
_this.YkGb = config.attributes.session;
|
|
1039
|
+
if (!Array.isArray(_this.KWLx) || !Array.isArray(_this.YkGb)) {
|
|
1020
1040
|
Logger$7.error("No attributes");
|
|
1021
1041
|
return false;
|
|
1022
1042
|
}
|
|
@@ -1027,9 +1047,9 @@
|
|
|
1027
1047
|
return true;
|
|
1028
1048
|
});
|
|
1029
1049
|
_defineProperty(this, "validate", function (user, session) {
|
|
1030
|
-
return _this.
|
|
1050
|
+
return _this.hTqd(user, _this.KWLx) && _this.hTqd(session, _this.YkGb);
|
|
1031
1051
|
});
|
|
1032
|
-
_defineProperty(this, "
|
|
1052
|
+
_defineProperty(this, "hTqd", function (attributes, expected) {
|
|
1033
1053
|
var length = expected.length;
|
|
1034
1054
|
var status = true;
|
|
1035
1055
|
try {
|
|
@@ -1059,7 +1079,7 @@
|
|
|
1059
1079
|
}
|
|
1060
1080
|
var match = loggedValues.some(function (loggedValue) {
|
|
1061
1081
|
return values.some(function (configValue) {
|
|
1062
|
-
return
|
|
1082
|
+
return Pflq(loggedValue, configValue, operator);
|
|
1063
1083
|
});
|
|
1064
1084
|
});
|
|
1065
1085
|
status = status && match;
|
|
@@ -1083,18 +1103,18 @@
|
|
|
1083
1103
|
var TimeBasedTermination = /*#__PURE__*/_createClass(function TimeBasedTermination() {
|
|
1084
1104
|
var _this = this;
|
|
1085
1105
|
_classCallCheck(this, TimeBasedTermination);
|
|
1086
|
-
_defineProperty(this, "
|
|
1106
|
+
_defineProperty(this, "sKMB", Apxor.getController());
|
|
1087
1107
|
_defineProperty(this, "type", "");
|
|
1088
1108
|
_defineProperty(this, "_duration_seconds", 0);
|
|
1089
|
-
_defineProperty(this, "
|
|
1109
|
+
_defineProperty(this, "EUqu", 1);
|
|
1090
1110
|
_defineProperty(this, "parse", function (config) {
|
|
1091
1111
|
try {
|
|
1092
1112
|
var _config$terminate_inf, _config$terminate_inf2, _config$terminate_inf3;
|
|
1093
|
-
_this.
|
|
1113
|
+
_this.Lecg = (_config$terminate_inf = config.terminate_info.time_based) === null || _config$terminate_inf === void 0 ? void 0 : _config$terminate_inf.type;
|
|
1094
1114
|
_this._duration_seconds = (_config$terminate_inf2 = config.terminate_info) === null || _config$terminate_inf2 === void 0 ? void 0 : _config$terminate_inf2.time_based.duration_seconds;
|
|
1095
|
-
_this.
|
|
1096
|
-
if (_this.
|
|
1097
|
-
_this.
|
|
1115
|
+
_this.EUqu = (_config$terminate_inf3 = config.terminate_info.time_based) === null || _config$terminate_inf3 === void 0 ? void 0 : _config$terminate_inf3.days;
|
|
1116
|
+
if (_this.Pflq(config._id)) {
|
|
1117
|
+
_this.sKMB.persistTerminationInfoLocally(config._id);
|
|
1098
1118
|
return false;
|
|
1099
1119
|
}
|
|
1100
1120
|
} catch (_unused) {
|
|
@@ -1102,16 +1122,16 @@
|
|
|
1102
1122
|
}
|
|
1103
1123
|
return true;
|
|
1104
1124
|
});
|
|
1105
|
-
_defineProperty(this, "
|
|
1125
|
+
_defineProperty(this, "Pflq", function (id) {
|
|
1106
1126
|
var _Data$id;
|
|
1107
|
-
var Data = JSON.parse(_this.
|
|
1127
|
+
var Data = JSON.parse(_this.sKMB.getFromStorage(APX_TERMINATION_ID));
|
|
1108
1128
|
if (!Data[id] || !((_Data$id = Data[id]) !== null && _Data$id !== void 0 && _Data$id.startDate)) return false;
|
|
1109
1129
|
var startDate = new Date(Data[id].startDate);
|
|
1110
1130
|
var presentDate = new Date(getDateInMMDDYYYY());
|
|
1111
1131
|
var diff = parseInt((presentDate - startDate) / (1000 * 60 * 60 * 24), 10);
|
|
1112
1132
|
var currentTime = _getTime();
|
|
1113
|
-
var
|
|
1114
|
-
return diff === _this.
|
|
1133
|
+
var tgyZ = Data[id].tgyZ;
|
|
1134
|
+
return diff === _this.EUqu && currentTime.hours >= tgyZ.hours || diff > _this.EUqu || Data[id].goalAcheived;
|
|
1115
1135
|
});
|
|
1116
1136
|
});
|
|
1117
1137
|
|
|
@@ -1120,19 +1140,19 @@
|
|
|
1120
1140
|
_classCallCheck(this, TerminationInfo);
|
|
1121
1141
|
_defineProperty(this, "enable_goal_events", false);
|
|
1122
1142
|
_defineProperty(this, "attributes", {});
|
|
1123
|
-
_defineProperty(this, "
|
|
1124
|
-
_defineProperty(this, "
|
|
1143
|
+
_defineProperty(this, "GeVn", new Attributes());
|
|
1144
|
+
_defineProperty(this, "YOHg", new TimeBasedTermination());
|
|
1125
1145
|
_defineProperty(this, "parse", function () {
|
|
1126
1146
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1127
1147
|
try {
|
|
1128
1148
|
var _config$terminate_inf, _config$terminate_inf2, _config$terminate_inf3;
|
|
1129
1149
|
_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;
|
|
1130
|
-
if (_this.enable_time_based && !_this.
|
|
1150
|
+
if (_this.enable_time_based && !_this.YOHg.parse(config)) {
|
|
1131
1151
|
return false;
|
|
1132
1152
|
}
|
|
1133
1153
|
_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;
|
|
1134
1154
|
_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;
|
|
1135
|
-
if (_this.enable_attributes && !_this.
|
|
1155
|
+
if (_this.enable_attributes && !_this.GeVn.parse(config.terminate_info)) {
|
|
1136
1156
|
return false;
|
|
1137
1157
|
}
|
|
1138
1158
|
} catch (error) {
|
|
@@ -1142,7 +1162,7 @@
|
|
|
1142
1162
|
return true;
|
|
1143
1163
|
});
|
|
1144
1164
|
_defineProperty(this, "validate", function (user, session) {
|
|
1145
|
-
return _this.
|
|
1165
|
+
return _this.GeVn.validate(user, session);
|
|
1146
1166
|
});
|
|
1147
1167
|
});
|
|
1148
1168
|
|
|
@@ -1150,22 +1170,22 @@
|
|
|
1150
1170
|
var ConfigItem = /*#__PURE__*/_createClass(function ConfigItem() {
|
|
1151
1171
|
var _this = this;
|
|
1152
1172
|
_classCallCheck(this, ConfigItem);
|
|
1153
|
-
_defineProperty(this, "
|
|
1154
|
-
_defineProperty(this, "
|
|
1155
|
-
_defineProperty(this, "
|
|
1156
|
-
_defineProperty(this, "
|
|
1157
|
-
_defineProperty(this, "
|
|
1158
|
-
_defineProperty(this, "
|
|
1159
|
-
_defineProperty(this, "
|
|
1160
|
-
_defineProperty(this, "
|
|
1161
|
-
_defineProperty(this, "
|
|
1162
|
-
_defineProperty(this, "
|
|
1163
|
-
_defineProperty(this, "
|
|
1173
|
+
_defineProperty(this, "CVRh", []);
|
|
1174
|
+
_defineProperty(this, "AHwj", []);
|
|
1175
|
+
_defineProperty(this, "jUXZ", "");
|
|
1176
|
+
_defineProperty(this, "ByBE", new Meta());
|
|
1177
|
+
_defineProperty(this, "bgGW", new Audience());
|
|
1178
|
+
_defineProperty(this, "xdhp", new Validity());
|
|
1179
|
+
_defineProperty(this, "AIgt", new Frequency());
|
|
1180
|
+
_defineProperty(this, "IQFR", new OverallConfig());
|
|
1181
|
+
_defineProperty(this, "fgQe", new TerminationInfo());
|
|
1182
|
+
_defineProperty(this, "DAMl", false);
|
|
1183
|
+
_defineProperty(this, "iODJ", []);
|
|
1164
1184
|
_defineProperty(this, "_variant_code", "");
|
|
1165
1185
|
_defineProperty(this, "parse", function () {
|
|
1166
1186
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1167
1187
|
try {
|
|
1168
|
-
var _this$
|
|
1188
|
+
var _this$ByBE$_attr;
|
|
1169
1189
|
// If ID is not present, throw it out
|
|
1170
1190
|
if (!isDefined(config._id)) {
|
|
1171
1191
|
Logger$8.error("No Id");
|
|
@@ -1179,18 +1199,18 @@
|
|
|
1179
1199
|
}
|
|
1180
1200
|
|
|
1181
1201
|
// If META, VALIDITY, FREQUENCY and AUDIENCE is not parsed properly, throw it out
|
|
1182
|
-
if (!(_this.
|
|
1202
|
+
if (!(_this.ByBE.parse(config) && _this.xdhp.parse(config) && _this.AIgt.parse(config) && _this.bgGW.parse(config) && _this.IQFR.parse(config) && _this.fgQe.parse(config))) {
|
|
1183
1203
|
return false;
|
|
1184
1204
|
}
|
|
1185
|
-
_this._variant_code = _this.
|
|
1205
|
+
_this._variant_code = _this.ByBE._isExperiment || _this.ByBE._only_context ? (_this$ByBE$_attr = _this.ByBE._attr) === null || _this$ByBE$_attr === void 0 ? void 0 : _this$ByBE$_attr[APX_VARIANT_CODE] : "TG";
|
|
1186
1206
|
// If there are no conditions, throw it out
|
|
1187
1207
|
if (!isDefined(config.conditions) || !Array.isArray(config.conditions)) {
|
|
1188
1208
|
Logger$8.error("No valid conditions", config.conditions);
|
|
1189
1209
|
return false;
|
|
1190
1210
|
}
|
|
1191
|
-
_this.
|
|
1192
|
-
_this.
|
|
1193
|
-
if (_this.
|
|
1211
|
+
_this.jUXZ = config._id;
|
|
1212
|
+
_this.DAMl = isDefined(config.sequence_enabled) ? config.sequence_enabled : false;
|
|
1213
|
+
if (_this.DAMl) {
|
|
1194
1214
|
// iff respectSequence is true, Sort the Conditions by their sequence order
|
|
1195
1215
|
// We need to sort, if server sends them in orderless manner
|
|
1196
1216
|
config.conditions.sort(function (prev, current) {
|
|
@@ -1202,17 +1222,17 @@
|
|
|
1202
1222
|
var conditions = config.conditions;
|
|
1203
1223
|
var length = conditions.length;
|
|
1204
1224
|
for (var index = 0; index < length; index++) {
|
|
1205
|
-
_this.
|
|
1225
|
+
_this.iODJ = [];
|
|
1206
1226
|
var condition = conditions[index];
|
|
1207
1227
|
if (condition.type === "didn't") {
|
|
1208
|
-
var
|
|
1228
|
+
var UHEM$details;
|
|
1209
1229
|
var obj = {
|
|
1210
1230
|
trigger_key: condition.trigger.details.name,
|
|
1211
|
-
no_kpi_array: condition === null || condition === void 0 || (
|
|
1231
|
+
no_kpi_array: condition === null || condition === void 0 || (UHEM$details = condition.details) === null || UHEM$details === void 0 || (UHEM$details = UHEM$details.additional_info) === null || UHEM$details === void 0 ? void 0 : UHEM$details.nkpi,
|
|
1212
1232
|
condition_id: condition === null || condition === void 0 ? void 0 : condition._id,
|
|
1213
1233
|
time_bounds: condition.time_bounds.upper
|
|
1214
1234
|
};
|
|
1215
|
-
_this.
|
|
1235
|
+
_this.iODJ = [].concat(_toConsumableArray(_this.iODJ), [obj]);
|
|
1216
1236
|
//this will be the key
|
|
1217
1237
|
//when event occur check this array and then then check the time
|
|
1218
1238
|
//check the time diffrence
|
|
@@ -1221,143 +1241,143 @@
|
|
|
1221
1241
|
}
|
|
1222
1242
|
|
|
1223
1243
|
var conditionValidator = new ConditionValidator();
|
|
1224
|
-
if (conditionValidator.initialize(condition, _this.
|
|
1225
|
-
_this.
|
|
1244
|
+
if (conditionValidator.initialize(condition, _this.jUXZ, index, _this.DAMl, _this.iODJ)) {
|
|
1245
|
+
_this.CVRh.push(conditionValidator);
|
|
1226
1246
|
}
|
|
1227
1247
|
}
|
|
1228
|
-
if (_this.
|
|
1248
|
+
if (_this.fgQe.enable_goal_events) {
|
|
1229
1249
|
var goal_events = config.terminate_info.goal_events.events;
|
|
1230
1250
|
var goaleventslength = goal_events.length;
|
|
1231
1251
|
for (var i = 0; i < goaleventslength; i++) {
|
|
1232
1252
|
var _conditionValidator = new ConditionValidator();
|
|
1233
|
-
if (_conditionValidator.initialize(goal_events[i], _this.
|
|
1234
|
-
_this.
|
|
1253
|
+
if (_conditionValidator.initialize(goal_events[i], _this.jUXZ, i, true, [], "termination")) {
|
|
1254
|
+
_this.AHwj.push(_conditionValidator);
|
|
1235
1255
|
}
|
|
1236
1256
|
}
|
|
1237
1257
|
}
|
|
1238
|
-
return _this.
|
|
1258
|
+
return _this.CVRh.length > 0;
|
|
1239
1259
|
} catch (error) {
|
|
1240
1260
|
Logger$8.error(error);
|
|
1241
1261
|
return false;
|
|
1242
1262
|
}
|
|
1243
1263
|
});
|
|
1244
|
-
_defineProperty(this, "
|
|
1264
|
+
_defineProperty(this, "uhJX", function (index) {
|
|
1245
1265
|
if (index < 0) {
|
|
1246
1266
|
return;
|
|
1247
1267
|
}
|
|
1248
|
-
if (_this.
|
|
1249
|
-
var conditionValidator = _this.
|
|
1250
|
-
if (isDefined(conditionValidator) && conditionValidator.
|
|
1268
|
+
if (_this.DAMl) {
|
|
1269
|
+
var conditionValidator = _this.CVRh[index];
|
|
1270
|
+
if (isDefined(conditionValidator) && conditionValidator.KWyt) {
|
|
1251
1271
|
// Check if previous validator is satisfied
|
|
1252
|
-
var prevValidator = _this.
|
|
1253
|
-
if (isDefined(prevValidator) && !prevValidator.
|
|
1272
|
+
var prevValidator = _this.CVRh[index - 1];
|
|
1273
|
+
if (isDefined(prevValidator) && !prevValidator.KWyt) {
|
|
1254
1274
|
// TODO: If current index is satisfied before previous one, do something
|
|
1255
1275
|
// either unregister all conditions or remove this item from ConfigLookup
|
|
1256
1276
|
return;
|
|
1257
1277
|
}
|
|
1258
|
-
var nextValidator = _this.
|
|
1278
|
+
var nextValidator = _this.CVRh[index + 1];
|
|
1259
1279
|
if (!isDefined(nextValidator)) {
|
|
1260
1280
|
// It means this is the last condition
|
|
1261
1281
|
// Validate all conditions
|
|
1262
|
-
_this.
|
|
1282
|
+
_this.CdpR();
|
|
1263
1283
|
} else {
|
|
1264
|
-
nextValidator.
|
|
1284
|
+
nextValidator.PaJS();
|
|
1265
1285
|
}
|
|
1266
1286
|
}
|
|
1267
1287
|
} else {
|
|
1268
1288
|
// Validate all conditions
|
|
1269
|
-
_this.
|
|
1289
|
+
_this.CdpR();
|
|
1270
1290
|
}
|
|
1271
1291
|
});
|
|
1272
|
-
_defineProperty(this, "
|
|
1292
|
+
_defineProperty(this, "gtHb", function (index) {
|
|
1273
1293
|
if (index < 0) {
|
|
1274
1294
|
return;
|
|
1275
1295
|
}
|
|
1276
|
-
_this.
|
|
1296
|
+
_this.MQhs();
|
|
1277
1297
|
});
|
|
1278
|
-
_defineProperty(this, "
|
|
1298
|
+
_defineProperty(this, "CdpR", function () {
|
|
1279
1299
|
// Check If Audience, Validity is satisfied or not
|
|
1280
1300
|
var userAttributes = Apxor.getController().getUserAttributes();
|
|
1281
1301
|
var sessionAttributes = Apxor.getController().getSessionAttributes();
|
|
1282
|
-
if (!_this.
|
|
1283
|
-
if (!_this.
|
|
1302
|
+
if (!_this.xdhp.validate() || !_this.bgGW.validate(userAttributes, sessionAttributes) || !_this.IQFR.validate()) {
|
|
1303
|
+
if (!_this.IQFR.retainedDaysValidated) {
|
|
1284
1304
|
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
|
|
1285
|
-
apx_nudge_type: _this.
|
|
1286
|
-
apx_nudge_id: _this.
|
|
1287
|
-
apx_nudge_name: _this.
|
|
1288
|
-
apx_variant_code: _this.
|
|
1305
|
+
apx_nudge_type: _this.ByBE.Lecg === "SURVEY" ? "survey" : "campaign",
|
|
1306
|
+
apx_nudge_id: _this.jUXZ,
|
|
1307
|
+
apx_nudge_name: _this.ByBE.figp,
|
|
1308
|
+
apx_variant_code: _this.ByBE._isExperiment || _this.ByBE._only_context ? _this.ByBE._attr[APX_VARIANT_CODE] : "TG",
|
|
1289
1309
|
apx_failure_type: "warn",
|
|
1290
1310
|
apx_reason: "Retained day criteria not met"
|
|
1291
1311
|
});
|
|
1292
1312
|
}
|
|
1293
|
-
if (!_this.
|
|
1313
|
+
if (!_this.IQFR.retainedSessionValidated) {
|
|
1294
1314
|
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
|
|
1295
|
-
apx_nudge_type: _this.
|
|
1296
|
-
apx_nudge_id: _this.
|
|
1297
|
-
apx_nudge_name: _this.
|
|
1298
|
-
apx_variant_code: _this.
|
|
1315
|
+
apx_nudge_type: _this.ByBE.Lecg === "SURVEY" ? "survey" : "campaign",
|
|
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",
|
|
1299
1319
|
apx_failure_type: "warn",
|
|
1300
1320
|
apx_reason: "User session criteria not met"
|
|
1301
1321
|
});
|
|
1302
1322
|
}
|
|
1303
|
-
if (_this.
|
|
1323
|
+
if (_this.IQFR.eventDoneInLT) {
|
|
1304
1324
|
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
|
|
1305
|
-
apx_nudge_type: _this.
|
|
1306
|
-
apx_nudge_id: _this.
|
|
1307
|
-
apx_nudge_name: _this.
|
|
1308
|
-
apx_variant_code: _this.
|
|
1325
|
+
apx_nudge_type: _this.ByBE.Lecg === "SURVEY" ? "survey" : "campaign",
|
|
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",
|
|
1309
1329
|
apx_failure_type: "warn",
|
|
1310
1330
|
apx_reason: "Event done in life time"
|
|
1311
1331
|
});
|
|
1312
1332
|
}
|
|
1313
|
-
if (!_this.
|
|
1333
|
+
if (!_this.bgGW.userAttributesValidated) {
|
|
1314
1334
|
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
|
|
1315
|
-
apx_nudge_type: _this.
|
|
1316
|
-
apx_nudge_id: _this.
|
|
1317
|
-
apx_nudge_name: _this.
|
|
1318
|
-
apx_variant_code: _this.
|
|
1335
|
+
apx_nudge_type: _this.ByBE.Lecg === "SURVEY" ? "survey" : "campaign",
|
|
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",
|
|
1319
1339
|
apx_failure_type: "warn",
|
|
1320
1340
|
apx_reason: "User property filter not met"
|
|
1321
1341
|
});
|
|
1322
1342
|
}
|
|
1323
|
-
if (!_this.
|
|
1343
|
+
if (!_this.bgGW.sessionAttributeValidated) {
|
|
1324
1344
|
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
|
|
1325
|
-
apx_nudge_type: _this.
|
|
1326
|
-
apx_nudge_id: _this.
|
|
1327
|
-
apx_nudge_name: _this.
|
|
1328
|
-
apx_variant_code: _this.
|
|
1345
|
+
apx_nudge_type: _this.ByBE.Lecg === "SURVEY" ? "survey" : "campaign",
|
|
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",
|
|
1329
1349
|
apx_failure_type: "warn",
|
|
1330
1350
|
apx_reason: "Session property filter not met"
|
|
1331
1351
|
});
|
|
1332
1352
|
}
|
|
1333
|
-
if (_this.
|
|
1353
|
+
if (_this.xdhp._not_yet_active) {
|
|
1334
1354
|
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
|
|
1335
|
-
apx_nudge_type: _this.
|
|
1336
|
-
apx_nudge_id: _this.
|
|
1337
|
-
apx_nudge_name: _this.
|
|
1338
|
-
apx_variant_code: _this.
|
|
1355
|
+
apx_nudge_type: _this.ByBE.Lecg === "SURVEY" ? "survey" : "campaign",
|
|
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",
|
|
1339
1359
|
apx_failure_type: "warn",
|
|
1340
1360
|
apx_reason: "nudge not yet active"
|
|
1341
1361
|
});
|
|
1342
1362
|
}
|
|
1343
|
-
if (_this.
|
|
1363
|
+
if (_this.xdhp._nudge_expired) {
|
|
1344
1364
|
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
|
|
1345
|
-
apx_nudge_type: _this.
|
|
1346
|
-
apx_nudge_id: _this.
|
|
1347
|
-
apx_nudge_name: _this.
|
|
1348
|
-
apx_variant_code: _this.
|
|
1365
|
+
apx_nudge_type: _this.ByBE.Lecg === "SURVEY" ? "survey" : "campaign",
|
|
1366
|
+
apx_nudge_id: _this.jUXZ,
|
|
1367
|
+
apx_nudge_name: _this.ByBE.figp,
|
|
1368
|
+
apx_variant_code: _this.ByBE._isExperiment || _this.ByBE._only_context ? _this.ByBE._attr[APX_VARIANT_CODE] : "TG",
|
|
1349
1369
|
apx_failure_type: "warn",
|
|
1350
1370
|
apx_reason: "nudge expired"
|
|
1351
1371
|
});
|
|
1352
1372
|
}
|
|
1353
1373
|
return;
|
|
1354
1374
|
}
|
|
1355
|
-
var length = _this.
|
|
1375
|
+
var length = _this.CVRh.length;
|
|
1356
1376
|
var isSatisfied = length < 1;
|
|
1357
1377
|
var combineOperator = "";
|
|
1358
1378
|
for (var index = 0; index < length; index++) {
|
|
1359
|
-
var validator = _this.
|
|
1360
|
-
var currentResult = validator.
|
|
1379
|
+
var validator = _this.CVRh[index];
|
|
1380
|
+
var currentResult = validator.KWyt;
|
|
1361
1381
|
if (combineOperator.trim() === "") {
|
|
1362
1382
|
isSatisfied = currentResult;
|
|
1363
1383
|
} else {
|
|
@@ -1370,20 +1390,20 @@
|
|
|
1370
1390
|
break;
|
|
1371
1391
|
}
|
|
1372
1392
|
}
|
|
1373
|
-
combineOperator = validator.
|
|
1393
|
+
combineOperator = validator.zzXl;
|
|
1374
1394
|
}
|
|
1375
1395
|
if (isSatisfied) {
|
|
1376
1396
|
var _window$ApxorRTM, _window$ApxorRTM2;
|
|
1377
1397
|
console.debug("onCondition satisfied");
|
|
1378
1398
|
// Check if count reached it's maximum
|
|
1379
|
-
if (!_this.
|
|
1380
|
-
console.warn("Maximum limit reached", _this.
|
|
1399
|
+
if (!_this.AIgt.iOMM(_this.jUXZ)) {
|
|
1400
|
+
console.warn("Maximum limit reached", _this.jUXZ);
|
|
1381
1401
|
//logging event for view not found for test device
|
|
1382
1402
|
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
|
|
1383
1403
|
apx_nudge_type: "campaign",
|
|
1384
|
-
apx_nudge_id: _this.
|
|
1385
|
-
apx_nudge_name: _this.
|
|
1386
|
-
apx_variant_code: _this.
|
|
1404
|
+
apx_nudge_id: _this.jUXZ,
|
|
1405
|
+
apx_nudge_name: _this.ByBE.figp,
|
|
1406
|
+
apx_variant_code: _this.ByBE._isExperiment || _this.ByBE._only_context ? _this.ByBE._attr[APX_VARIANT_CODE] : "TG",
|
|
1387
1407
|
apx_failure_type: "warn",
|
|
1388
1408
|
apx_reason: "Campaign limit reached"
|
|
1389
1409
|
});
|
|
@@ -1391,38 +1411,38 @@
|
|
|
1391
1411
|
}
|
|
1392
1412
|
|
|
1393
1413
|
//logging event for view not found for test device
|
|
1394
|
-
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.
|
|
1414
|
+
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.jUXZ) && Apxor.getController().isBadgeTriggerSatisfied(_this.jUXZ))) {
|
|
1395
1415
|
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_trigger_satisfied", {
|
|
1396
|
-
apx_nudge_type: _this.
|
|
1397
|
-
apx_nudge_id: _this.
|
|
1398
|
-
apx_nudge_name: _this.
|
|
1399
|
-
apx_variant_code: _this.
|
|
1416
|
+
apx_nudge_type: _this.ByBE.Lecg === "SURVEY" ? "survey" : "campaign",
|
|
1417
|
+
apx_nudge_id: _this.jUXZ,
|
|
1418
|
+
apx_nudge_name: _this.ByBE.figp,
|
|
1419
|
+
apx_variant_code: _this.ByBE._isExperiment || _this.ByBE._only_context ? _this.ByBE._attr[APX_VARIANT_CODE] : "TG"
|
|
1400
1420
|
});
|
|
1401
1421
|
}
|
|
1402
|
-
console.log("Dispatching event", _this.
|
|
1403
|
-
if (_this.
|
|
1404
|
-
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.
|
|
1405
|
-
message_name: _this.
|
|
1406
|
-
id: _this.
|
|
1422
|
+
console.log("Dispatching event", _this.ByBE.Lecg);
|
|
1423
|
+
if (_this.ByBE._only_context === true) {
|
|
1424
|
+
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.ByBE._attr), {}, {
|
|
1425
|
+
message_name: _this.ByBE.figp,
|
|
1426
|
+
id: _this.jUXZ
|
|
1407
1427
|
}));
|
|
1408
1428
|
}
|
|
1409
1429
|
// Emit event
|
|
1410
|
-
Apxor.getController().dispatchEvent(_this.
|
|
1411
|
-
name: _this.
|
|
1430
|
+
Apxor.getController().dispatchEvent(_this.ByBE.Lecg, {
|
|
1431
|
+
name: _this.ByBE.Lecg,
|
|
1412
1432
|
additional_info: {
|
|
1413
|
-
uuid: _this.
|
|
1414
|
-
name: _this.
|
|
1433
|
+
uuid: _this.jUXZ,
|
|
1434
|
+
name: _this.ByBE.figp
|
|
1415
1435
|
}
|
|
1416
1436
|
});
|
|
1417
1437
|
}
|
|
1418
1438
|
});
|
|
1419
|
-
_defineProperty(this, "
|
|
1420
|
-
var length = _this.
|
|
1439
|
+
_defineProperty(this, "MQhs", function () {
|
|
1440
|
+
var length = _this.AHwj.length;
|
|
1421
1441
|
var isSatisfied = length < 1;
|
|
1422
1442
|
var combineOperator = "";
|
|
1423
1443
|
for (var index = 0; index < length; index++) {
|
|
1424
|
-
var validator = _this.
|
|
1425
|
-
var currentResult = validator.
|
|
1444
|
+
var validator = _this.AHwj[index];
|
|
1445
|
+
var currentResult = validator.KWyt;
|
|
1426
1446
|
if (combineOperator.trim() === "") {
|
|
1427
1447
|
isSatisfied = currentResult;
|
|
1428
1448
|
} else {
|
|
@@ -1435,23 +1455,23 @@
|
|
|
1435
1455
|
break;
|
|
1436
1456
|
}
|
|
1437
1457
|
}
|
|
1438
|
-
combineOperator = validator.
|
|
1458
|
+
combineOperator = validator.bXqj;
|
|
1439
1459
|
}
|
|
1440
1460
|
if (isSatisfied) {
|
|
1441
|
-
console.log("Dispatching event", _this.
|
|
1442
|
-
Apxor.getController().persistTerminationInfoLocally(_this.
|
|
1443
|
-
if (_this.
|
|
1444
|
-
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.
|
|
1445
|
-
message_name: _this.
|
|
1446
|
-
id: _this.
|
|
1461
|
+
console.log("Dispatching event", _this.ByBE.Lecg);
|
|
1462
|
+
Apxor.getController().persistTerminationInfoLocally(_this.jUXZ);
|
|
1463
|
+
if (_this.ByBE._only_context === true) {
|
|
1464
|
+
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.ByBE._attr), {}, {
|
|
1465
|
+
message_name: _this.ByBE.figp,
|
|
1466
|
+
id: _this.jUXZ
|
|
1447
1467
|
}));
|
|
1448
1468
|
}
|
|
1449
1469
|
// Emit event
|
|
1450
|
-
Apxor.getController().dispatchEvent(_this.
|
|
1451
|
-
name: _this.
|
|
1470
|
+
Apxor.getController().dispatchEvent(_this.ByBE.Lecg, {
|
|
1471
|
+
name: _this.ByBE.Lecg,
|
|
1452
1472
|
additional_info: {
|
|
1453
|
-
uuid: _this.
|
|
1454
|
-
name: _this.
|
|
1473
|
+
uuid: _this.jUXZ,
|
|
1474
|
+
name: _this.ByBE.figp
|
|
1455
1475
|
}
|
|
1456
1476
|
});
|
|
1457
1477
|
}
|
|
@@ -1459,23 +1479,23 @@
|
|
|
1459
1479
|
_defineProperty(this, "validateForTerminationAttributes", function () {
|
|
1460
1480
|
var userAttributes = Apxor.getController().getUserAttributes();
|
|
1461
1481
|
var sessionAttributes = Apxor.getController().getSessionAttributes();
|
|
1462
|
-
return _this.
|
|
1482
|
+
return _this.fgQe.validate(userAttributes, sessionAttributes);
|
|
1463
1483
|
});
|
|
1464
|
-
_defineProperty(this, "
|
|
1465
|
-
_this.
|
|
1484
|
+
_defineProperty(this, "ikdS", function () {
|
|
1485
|
+
_this.AIgt.ikdS();
|
|
1466
1486
|
});
|
|
1467
1487
|
_defineProperty(this, "getFrequencyCount", function () {
|
|
1468
|
-
return _this.
|
|
1488
|
+
return _this.AIgt.getFrequencyCount();
|
|
1469
1489
|
});
|
|
1470
|
-
_defineProperty(this, "
|
|
1471
|
-
return _this.
|
|
1490
|
+
_defineProperty(this, "trLO", function () {
|
|
1491
|
+
return _this.AIgt.MdUm();
|
|
1472
1492
|
});
|
|
1473
1493
|
});
|
|
1474
1494
|
|
|
1475
1495
|
var ConfigLookup = /*#__PURE__*/_createClass(function ConfigLookup() {
|
|
1476
1496
|
var _this = this;
|
|
1477
1497
|
_classCallCheck(this, ConfigLookup);
|
|
1478
|
-
_defineProperty(this, "
|
|
1498
|
+
_defineProperty(this, "XDsl", {});
|
|
1479
1499
|
_defineProperty(this, "parse", function () {
|
|
1480
1500
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
1481
1501
|
configs: []
|
|
@@ -1498,7 +1518,7 @@
|
|
|
1498
1518
|
var configId = _config._id;
|
|
1499
1519
|
var configItem = new ConfigItem();
|
|
1500
1520
|
if (configItem.parse(_config)) {
|
|
1501
|
-
_this.
|
|
1521
|
+
_this.XDsl[configId] = configItem;
|
|
1502
1522
|
} else {
|
|
1503
1523
|
console.warn("Failed to parse cfg", configId);
|
|
1504
1524
|
}
|
|
@@ -1506,51 +1526,51 @@
|
|
|
1506
1526
|
}
|
|
1507
1527
|
});
|
|
1508
1528
|
_defineProperty(this, "validate", function (id, index) {
|
|
1509
|
-
if (_this.
|
|
1510
|
-
var configItem = _this.
|
|
1511
|
-
configItem.
|
|
1529
|
+
if (_this.XDsl[id]) {
|
|
1530
|
+
var configItem = _this.XDsl[id];
|
|
1531
|
+
configItem.uhJX(index);
|
|
1512
1532
|
}
|
|
1513
1533
|
});
|
|
1514
1534
|
_defineProperty(this, "getVariantCode", function (id) {
|
|
1515
|
-
if (_this.
|
|
1516
|
-
var configItem = _this.
|
|
1535
|
+
if (_this.XDsl[id]) {
|
|
1536
|
+
var configItem = _this.XDsl[id];
|
|
1517
1537
|
return configItem._variant_code;
|
|
1518
1538
|
}
|
|
1519
1539
|
return "";
|
|
1520
1540
|
});
|
|
1521
1541
|
_defineProperty(this, "validateForTermination", function (id, index) {
|
|
1522
|
-
if (_this.
|
|
1523
|
-
var configItem = _this.
|
|
1524
|
-
configItem.
|
|
1542
|
+
if (_this.XDsl[id]) {
|
|
1543
|
+
var configItem = _this.XDsl[id];
|
|
1544
|
+
configItem.gtHb(index);
|
|
1525
1545
|
}
|
|
1526
1546
|
});
|
|
1527
1547
|
_defineProperty(this, "validateForTerminationAttributes", function (id) {
|
|
1528
|
-
if (_this.
|
|
1529
|
-
var configItem = _this.
|
|
1548
|
+
if (_this.XDsl[id]) {
|
|
1549
|
+
var configItem = _this.XDsl[id];
|
|
1530
1550
|
return configItem.validateForTerminationAttributes();
|
|
1531
1551
|
}
|
|
1532
1552
|
return false;
|
|
1533
1553
|
});
|
|
1534
|
-
_defineProperty(this, "
|
|
1535
|
-
var campiagnConfig = _this.
|
|
1536
|
-
campiagnConfig.
|
|
1554
|
+
_defineProperty(this, "ikdS", function (id) {
|
|
1555
|
+
var campiagnConfig = _this.XDsl[id];
|
|
1556
|
+
campiagnConfig.ikdS();
|
|
1537
1557
|
});
|
|
1538
1558
|
_defineProperty(this, "getFrequencyCount", function (id) {
|
|
1539
|
-
var campiagnConfig = _this.
|
|
1559
|
+
var campiagnConfig = _this.XDsl[id];
|
|
1540
1560
|
return campiagnConfig.getFrequencyCount();
|
|
1541
1561
|
});
|
|
1542
1562
|
_defineProperty(this, "resetFrequencyCounts", function () {
|
|
1543
|
-
var configs = _this.
|
|
1563
|
+
var configs = _this.XDsl;
|
|
1544
1564
|
for (var configId in configs) {
|
|
1545
|
-
configs[configId].
|
|
1565
|
+
configs[configId].trLO();
|
|
1546
1566
|
}
|
|
1547
1567
|
});
|
|
1548
|
-
_defineProperty(this, "
|
|
1568
|
+
_defineProperty(this, "jMAH", function (campaignId) {
|
|
1549
1569
|
try {
|
|
1550
|
-
if (_this.
|
|
1551
|
-
var configItem = _this.
|
|
1552
|
-
if (configItem && configItem.
|
|
1553
|
-
return configItem.
|
|
1570
|
+
if (_this.XDsl) {
|
|
1571
|
+
var configItem = _this.XDsl[campaignId];
|
|
1572
|
+
if (configItem && configItem.ByBE) {
|
|
1573
|
+
return configItem.ByBE;
|
|
1554
1574
|
}
|
|
1555
1575
|
}
|
|
1556
1576
|
} catch (e) {
|
|
@@ -1566,42 +1586,42 @@
|
|
|
1566
1586
|
var EventsListener = /*#__PURE__*/_createClass(function EventsListener() {
|
|
1567
1587
|
var _this = this;
|
|
1568
1588
|
_classCallCheck(this, EventsListener);
|
|
1569
|
-
_defineProperty(this, "
|
|
1570
|
-
_defineProperty(this, "
|
|
1571
|
-
_defineProperty(this, "
|
|
1589
|
+
_defineProperty(this, "rnqO", {});
|
|
1590
|
+
_defineProperty(this, "jgKf", []);
|
|
1591
|
+
_defineProperty(this, "isEr", false);
|
|
1572
1592
|
_defineProperty(this, "initialize", function () {
|
|
1573
1593
|
var controller = Apxor.getController();
|
|
1574
1594
|
controller.registerForEvent(APP_EVENT, function (event) {
|
|
1575
|
-
return _this.
|
|
1595
|
+
return _this.OmRD(event, "AE");
|
|
1576
1596
|
});
|
|
1577
1597
|
controller.registerForEvent(CLIENT_EVENT, function (event) {
|
|
1578
|
-
return _this.
|
|
1598
|
+
return _this.OmRD(event, "CE");
|
|
1579
1599
|
});
|
|
1580
1600
|
});
|
|
1581
|
-
_defineProperty(this, "
|
|
1601
|
+
_defineProperty(this, "uHZe", function () {
|
|
1582
1602
|
// Clear Buffer
|
|
1583
|
-
for (var item in _this.
|
|
1584
|
-
_this.
|
|
1603
|
+
for (var item in _this.jgKf) {
|
|
1604
|
+
_this.gOcO(item.event, item.key, item.type);
|
|
1585
1605
|
}
|
|
1586
|
-
_this.
|
|
1606
|
+
_this.isEr = true;
|
|
1587
1607
|
});
|
|
1588
|
-
_defineProperty(this, "
|
|
1608
|
+
_defineProperty(this, "dgAX", function (event, callback) {
|
|
1589
1609
|
if (!isFunction(callback)) {
|
|
1590
1610
|
return;
|
|
1591
1611
|
}
|
|
1592
1612
|
var listeners;
|
|
1593
|
-
if (_this.
|
|
1594
|
-
listeners = _this.
|
|
1613
|
+
if (_this.rnqO[event]) {
|
|
1614
|
+
listeners = _this.rnqO[event];
|
|
1595
1615
|
} else {
|
|
1596
1616
|
listeners = [];
|
|
1597
1617
|
}
|
|
1598
1618
|
listeners.push(callback);
|
|
1599
|
-
_this.
|
|
1600
|
-
Logger$9.debug("Listeners list: ", _this.
|
|
1619
|
+
_this.rnqO[event] = listeners;
|
|
1620
|
+
Logger$9.debug("Listeners list: ", _this.rnqO);
|
|
1601
1621
|
});
|
|
1602
1622
|
_defineProperty(this, "unregisterFromEvent", function (event, callback) {
|
|
1603
|
-
if (_this.
|
|
1604
|
-
var listeners = _this.
|
|
1623
|
+
if (_this.rnqO[event]) {
|
|
1624
|
+
var listeners = _this.rnqO[event];
|
|
1605
1625
|
var updatedListeners = [];
|
|
1606
1626
|
for (var index = 0; index < listeners.length; index++) {
|
|
1607
1627
|
var listener = listeners[index];
|
|
@@ -1609,25 +1629,25 @@
|
|
|
1609
1629
|
updatedListeners.push(listener);
|
|
1610
1630
|
}
|
|
1611
1631
|
}
|
|
1612
|
-
_this.
|
|
1632
|
+
_this.rnqO[event] = updatedListeners;
|
|
1613
1633
|
}
|
|
1614
1634
|
});
|
|
1615
|
-
_defineProperty(this, "
|
|
1635
|
+
_defineProperty(this, "OmRD", function (event) {
|
|
1616
1636
|
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "AE";
|
|
1617
1637
|
var key = type + "___" + event.name;
|
|
1618
|
-
_this.
|
|
1638
|
+
_this.gOcO(event, key, type);
|
|
1619
1639
|
});
|
|
1620
|
-
_defineProperty(this, "
|
|
1621
|
-
if (!_this.
|
|
1622
|
-
_this.
|
|
1640
|
+
_defineProperty(this, "gOcO", function (event, key, type) {
|
|
1641
|
+
if (!_this.isEr) {
|
|
1642
|
+
_this.jgKf.push({
|
|
1623
1643
|
event: event,
|
|
1624
1644
|
key: key,
|
|
1625
1645
|
type: type
|
|
1626
1646
|
});
|
|
1627
1647
|
} else {
|
|
1628
|
-
Logger$9.debug("Notifying listeners for event: " + event + ", " + key, _this.
|
|
1629
|
-
if (_this.
|
|
1630
|
-
var listeners = _this.
|
|
1648
|
+
Logger$9.debug("Notifying listeners for event: " + event + ", " + key, _this.rnqO);
|
|
1649
|
+
if (_this.rnqO[key]) {
|
|
1650
|
+
var listeners = _this.rnqO[key];
|
|
1631
1651
|
var time = Apxor.getController().getSDKRunningTimeInSec();
|
|
1632
1652
|
for (var index = 0; index < listeners.length; index++) {
|
|
1633
1653
|
var listener = listeners[index];
|
|
@@ -1643,17 +1663,17 @@
|
|
|
1643
1663
|
function CE() {
|
|
1644
1664
|
var _this = this;
|
|
1645
1665
|
_classCallCheck(this, CE);
|
|
1646
|
-
_defineProperty(this, "
|
|
1647
|
-
_defineProperty(this, "
|
|
1648
|
-
_defineProperty(this, "
|
|
1649
|
-
_defineProperty(this, "
|
|
1650
|
-
_defineProperty(this, "
|
|
1666
|
+
_defineProperty(this, "qwnH", false);
|
|
1667
|
+
_defineProperty(this, "MWAY", null);
|
|
1668
|
+
_defineProperty(this, "dOSQ", getDateInDDMMYYYY());
|
|
1669
|
+
_defineProperty(this, "aXRJ", new EventsListener());
|
|
1670
|
+
_defineProperty(this, "yjQV", Apxor.getSiteId());
|
|
1651
1671
|
_defineProperty(this, "_qeState", {});
|
|
1652
1672
|
_defineProperty(this, "getQeState", function () {
|
|
1653
1673
|
try {
|
|
1654
1674
|
var data = Apxor.getController().getFromStorage(QE_STATE);
|
|
1655
1675
|
if (data) {
|
|
1656
|
-
return JSON.parse(decode(_this.
|
|
1676
|
+
return JSON.parse(decode(_this.yjQV, data));
|
|
1657
1677
|
} else {
|
|
1658
1678
|
_this._qeState = {};
|
|
1659
1679
|
return _this.setQeState();
|
|
@@ -1682,10 +1702,10 @@
|
|
|
1682
1702
|
return _this._qeState;
|
|
1683
1703
|
});
|
|
1684
1704
|
_defineProperty(this, "initialize", function () {
|
|
1685
|
-
if (!_this.
|
|
1686
|
-
_this.
|
|
1687
|
-
_this.
|
|
1688
|
-
_this.
|
|
1705
|
+
if (!_this.qwnH) {
|
|
1706
|
+
_this.qwnH = true;
|
|
1707
|
+
_this.MWAY = new ConfigLookup();
|
|
1708
|
+
_this.aXRJ.initialize();
|
|
1689
1709
|
_this._qeState = _this.getQeState();
|
|
1690
1710
|
Logger$a.info("QE Initialized..");
|
|
1691
1711
|
}
|
|
@@ -1696,12 +1716,12 @@
|
|
|
1696
1716
|
* @param config
|
|
1697
1717
|
*/
|
|
1698
1718
|
_defineProperty(this, "parse", function (config) {
|
|
1699
|
-
if (!_this.
|
|
1719
|
+
if (!_this.lGLs()) {
|
|
1700
1720
|
Logger$a.warn("Must call init first. Unable to proceed");
|
|
1701
1721
|
return;
|
|
1702
1722
|
}
|
|
1703
|
-
_this.
|
|
1704
|
-
_this.
|
|
1723
|
+
_this.MWAY.parse(config);
|
|
1724
|
+
_this.aXRJ.uHZe();
|
|
1705
1725
|
});
|
|
1706
1726
|
/**
|
|
1707
1727
|
* Validates all conditions for given config ID
|
|
@@ -1710,22 +1730,22 @@
|
|
|
1710
1730
|
* @param index
|
|
1711
1731
|
*/
|
|
1712
1732
|
_defineProperty(this, "validate", function (id, index) {
|
|
1713
|
-
if (!_this.
|
|
1733
|
+
if (!_this.lGLs()) {
|
|
1714
1734
|
return;
|
|
1715
1735
|
}
|
|
1716
|
-
_this.
|
|
1736
|
+
_this.MWAY.validate(id, index);
|
|
1717
1737
|
});
|
|
1718
1738
|
_defineProperty(this, "getVariantCode", function (id) {
|
|
1719
|
-
return _this.
|
|
1739
|
+
return _this.MWAY.getVariantCode(id);
|
|
1720
1740
|
});
|
|
1721
1741
|
_defineProperty(this, "validateForTermination", function (id, index) {
|
|
1722
|
-
if (!_this.
|
|
1742
|
+
if (!_this.lGLs()) {
|
|
1723
1743
|
return;
|
|
1724
1744
|
}
|
|
1725
|
-
_this.
|
|
1745
|
+
_this.MWAY.validateForTermination(id, index);
|
|
1726
1746
|
});
|
|
1727
1747
|
_defineProperty(this, "validateForTerminationAttributes", function (user, session) {
|
|
1728
|
-
return _this.
|
|
1748
|
+
return _this.MWAY.validateForTerminationAttributes(user, session);
|
|
1729
1749
|
});
|
|
1730
1750
|
_defineProperty(this, "updateCount", function (id) {
|
|
1731
1751
|
try {
|
|
@@ -1734,25 +1754,25 @@
|
|
|
1734
1754
|
}
|
|
1735
1755
|
_this.incrementFrequencies(id);
|
|
1736
1756
|
_this.setQeState(id);
|
|
1737
|
-
_this.
|
|
1757
|
+
_this.MWAY.ikdS(id);
|
|
1738
1758
|
} catch (e) {
|
|
1739
1759
|
console.log("Could not update the count config:".concat(e));
|
|
1740
1760
|
}
|
|
1741
1761
|
});
|
|
1742
1762
|
_defineProperty(this, "resetFrequencyCounts", function () {
|
|
1743
|
-
_this.
|
|
1763
|
+
_this.MWAY.resetFrequencyCounts();
|
|
1744
1764
|
});
|
|
1745
1765
|
_defineProperty(this, "getFrequencyCount", function (id) {
|
|
1746
|
-
return _this.
|
|
1766
|
+
return _this.MWAY.getFrequencyCount(id);
|
|
1747
1767
|
});
|
|
1748
1768
|
_defineProperty(this, "registerForEvent", function (event, callback) {
|
|
1749
|
-
_this.
|
|
1769
|
+
_this.aXRJ.dgAX(event, callback);
|
|
1750
1770
|
});
|
|
1751
1771
|
_defineProperty(this, "unregisterFromEvent", function (event, callback) {
|
|
1752
|
-
_this.
|
|
1772
|
+
_this.aXRJ.unregisterFromEvent(event, callback);
|
|
1753
1773
|
});
|
|
1754
1774
|
_defineProperty(this, "notifyEventListener", function (event) {
|
|
1755
|
-
_this.
|
|
1775
|
+
_this.aXRJ.OmRD(event);
|
|
1756
1776
|
});
|
|
1757
1777
|
/**
|
|
1758
1778
|
* Fetches the config from Server
|
|
@@ -1765,14 +1785,14 @@
|
|
|
1765
1785
|
_defineProperty(this, "fetch", function (type, validateUrl, apiUrl, callback) {
|
|
1766
1786
|
Apxor.getController().fetchConfiguration(type, validateUrl, apiUrl, callback);
|
|
1767
1787
|
});
|
|
1768
|
-
_defineProperty(this, "
|
|
1769
|
-
return _this.
|
|
1788
|
+
_defineProperty(this, "lGLs", function () {
|
|
1789
|
+
return _this.qwnH;
|
|
1770
1790
|
});
|
|
1771
1791
|
_defineProperty(this, "getCampaignMetaFromQueryEngine", function (campaignId) {
|
|
1772
|
-
return _this.
|
|
1792
|
+
return _this.MWAY.jMAH(campaignId);
|
|
1773
1793
|
});
|
|
1774
|
-
_defineProperty(this, "
|
|
1775
|
-
return _this.
|
|
1794
|
+
_defineProperty(this, "hUQY", function () {
|
|
1795
|
+
return _this.dOSQ;
|
|
1776
1796
|
});
|
|
1777
1797
|
if (!CE.instance) {
|
|
1778
1798
|
CE.instance = this;
|
|
@@ -1796,7 +1816,7 @@
|
|
|
1796
1816
|
OVERALL: 0,
|
|
1797
1817
|
DATES: {}
|
|
1798
1818
|
};
|
|
1799
|
-
if (this.
|
|
1819
|
+
if (this.dOSQ) this._qeState[id].DATES[this.dOSQ] = 0;
|
|
1800
1820
|
this.setQeState(id);
|
|
1801
1821
|
}
|
|
1802
1822
|
} catch (e) {
|
|
@@ -1815,12 +1835,12 @@
|
|
|
1815
1835
|
|
|
1816
1836
|
// Increment the DATES count for this particular date by 1. If the date changes reset.
|
|
1817
1837
|
var currentDate = getDateInDDMMYYYY();
|
|
1818
|
-
if (currentDate !== this.
|
|
1819
|
-
this.
|
|
1838
|
+
if (currentDate !== this.dOSQ || !(configFrequency.DATES && configFrequency.DATES[currentDate])) {
|
|
1839
|
+
this.dOSQ = currentDate;
|
|
1820
1840
|
configFrequency.DATES = {};
|
|
1821
|
-
configFrequency.DATES[this.
|
|
1841
|
+
configFrequency.DATES[this.dOSQ] = 0;
|
|
1822
1842
|
}
|
|
1823
|
-
configFrequency.DATES[this.
|
|
1843
|
+
configFrequency.DATES[this.dOSQ] = configFrequency.DATES[this.dOSQ] + 1;
|
|
1824
1844
|
}
|
|
1825
1845
|
}], [{
|
|
1826
1846
|
key: "getInstance",
|
|
@@ -1839,7 +1859,7 @@
|
|
|
1839
1859
|
|
|
1840
1860
|
/* eslint-disable no-empty */
|
|
1841
1861
|
|
|
1842
|
-
window.ceVersion =
|
|
1862
|
+
window.ceVersion = 151;
|
|
1843
1863
|
try {
|
|
1844
1864
|
if (exports !== undefined || exports !== null) {
|
|
1845
1865
|
exports["default"] = CE;
|