apxor-qe 1.4.2 → 1.5.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.
@@ -203,7 +203,7 @@
203
203
  var toUpperCase = function toUpperCase(key) {
204
204
  return key.toUpperCase();
205
205
  };
206
- var OjHn = function OjHn(actual, expected, operator) {
206
+ var cJes = function cJes(actual, expected, operator) {
207
207
  switch (operator) {
208
208
  case "EQ":
209
209
  return actual === expected;
@@ -264,16 +264,18 @@
264
264
  var Audience = /*#__PURE__*/_createClass(function Audience() {
265
265
  var _this = this;
266
266
  _classCallCheck(this, Audience);
267
- _defineProperty(this, "KSOj", "ALL");
268
- _defineProperty(this, "MSCc", []);
269
- _defineProperty(this, "HuDN", []);
267
+ _defineProperty(this, "owVv", "ALL");
268
+ _defineProperty(this, "ZfAX", []);
269
+ _defineProperty(this, "kLZG", []);
270
+ _defineProperty(this, "userAttributesValidated", true);
271
+ _defineProperty(this, "sessionAttributeValidated", true);
270
272
  _defineProperty(this, "parse", function () {
271
273
  var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
272
274
  try {
273
- _this.KSOj = config.audience.audience_type;
274
- _this.MSCc = config.audience.attributes.user;
275
- _this.HuDN = config.audience.attributes.session;
276
- if (!Array.isArray(_this.MSCc) || !Array.isArray(_this.HuDN)) {
275
+ _this.owVv = config.audience.audience_type;
276
+ _this.ZfAX = config.audience.attributes.user;
277
+ _this.kLZG = config.audience.attributes.session;
278
+ if (!Array.isArray(_this.ZfAX) || !Array.isArray(_this.kLZG)) {
277
279
  Logger.error("No attributes");
278
280
  return false;
279
281
  }
@@ -285,12 +287,20 @@
285
287
  });
286
288
  _defineProperty(this, "validate", function (user, session) {
287
289
  var status = true;
288
- if (_this.KSOj === "FTU") {
290
+ if (_this.owVv === "FTU") {
289
291
  status = Apxor.getController().getSessionInfo().is_first_session;
290
292
  }
291
- return status && _this.zQwl(user, _this.MSCc) && _this.zQwl(session, _this.HuDN);
293
+ var userAttributesCompare = _this.KPjz(user, _this.ZfAX);
294
+ var sessionAttributesCompare = _this.KPjz(session, _this.kLZG);
295
+ if (!userAttributesCompare) {
296
+ _this.userAttributesValidated = false;
297
+ }
298
+ if (!sessionAttributesCompare) {
299
+ _this.sessionAttributeValidated = false;
300
+ }
301
+ return status && userAttributesCompare && sessionAttributesCompare;
292
302
  });
293
- _defineProperty(this, "zQwl", function (attributes, expected) {
303
+ _defineProperty(this, "KPjz", function (attributes, expected) {
294
304
  var length = expected.length;
295
305
  var status = true;
296
306
  try {
@@ -320,7 +330,7 @@
320
330
  }
321
331
  var match = loggedValues.some(function (loggedValue) {
322
332
  return values.some(function (configValue) {
323
- return OjHn(loggedValue, configValue, operator);
333
+ return cJes(loggedValue, configValue, operator);
324
334
  });
325
335
  });
326
336
  status = status && match;
@@ -342,37 +352,37 @@
342
352
  var Frequency = /*#__PURE__*/_createClass(function Frequency() {
343
353
  var _this = this;
344
354
  _classCallCheck(this, Frequency);
345
- _defineProperty(this, "oKkN", 0);
346
- _defineProperty(this, "uzZi", 0);
347
- _defineProperty(this, "Avzx", "SESSION");
348
- _defineProperty(this, "CqAl", 0);
349
- _defineProperty(this, "ivKN", 0);
350
- _defineProperty(this, "cOKY", 0);
355
+ _defineProperty(this, "YpuZ", 0);
356
+ _defineProperty(this, "CaWP", 0);
357
+ _defineProperty(this, "HdbP", "SESSION");
358
+ _defineProperty(this, "QrLx", 0);
359
+ _defineProperty(this, "WUjI", 0);
360
+ _defineProperty(this, "Gnyd", 0);
351
361
  _defineProperty(this, "parse", function () {
352
362
  var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
353
363
  try {
354
- _this.oKkN = config.frequency.count;
355
- if (_this.oKkN === -1) {
356
- _this.oKkN = 1000;
357
- }
358
- _this.cOKY = _this.oKkN;
359
- _this.uzZi = config.frequency.time_interval;
360
- _this.Avzx = config.frequency.validity;
361
- _this.ivKN = config.frequency.ses_lmt;
364
+ _this.YpuZ = config.frequency.count;
365
+ if (_this.YpuZ === -1) {
366
+ _this.YpuZ = 1000;
367
+ }
368
+ _this.Gnyd = _this.YpuZ;
369
+ _this.CaWP = config.frequency.time_interval;
370
+ _this.HdbP = config.frequency.validity;
371
+ _this.WUjI = config.frequency.ses_lmt;
362
372
  _this._dayCount = config.frequency.day_lmt;
363
373
  // let data = Apxor.getController().getFromStorage(QE_STATE);
364
374
  // let qe_state = JSON.parse(decode(Apxor.getSiteId(), data));
365
375
  var qe_state = CE.getInstance().getQeState();
366
376
  if (!isDefined(qe_state) || !isDefined(qe_state[config._id])) return true;
367
- if (_this.Avzx === "SESSION") {
368
- _this.oKkN = parseInt(_this.oKkN) - parseInt(qe_state[config._id]["SESSION"]);
369
- if (_this.oKkN <= 0) {
377
+ if (_this.HdbP === "SESSION") {
378
+ _this.YpuZ = parseInt(_this.YpuZ) - parseInt(qe_state[config._id]["SESSION"]);
379
+ if (_this.YpuZ <= 0) {
370
380
  console.warn("Max count limit reached for session:" + config._id);
371
381
  return false;
372
382
  }
373
- } else if (_this.Avzx === "OVERALL") {
374
- _this.oKkN = parseInt(_this.oKkN) - parseInt(qe_state[config._id]["OVERALL"]);
375
- if (_this.oKkN <= 0) {
383
+ } else if (_this.HdbP === "OVERALL") {
384
+ _this.YpuZ = parseInt(_this.YpuZ) - parseInt(qe_state[config._id]["OVERALL"]);
385
+ if (_this.YpuZ <= 0) {
376
386
  console.warn("Max count limit reached for overall:" + config._id);
377
387
  return false;
378
388
  }
@@ -386,28 +396,28 @@
386
396
  }
387
397
  return true;
388
398
  });
389
- _defineProperty(this, "ErGD", function () {
390
- _this.oKkN = _this.oKkN - 1;
399
+ _defineProperty(this, "aokP", function () {
400
+ _this.YpuZ = _this.YpuZ - 1;
391
401
  });
392
402
  _defineProperty(this, "getFrequencyCount", function () {
393
- return _this.oKkN;
403
+ return _this.YpuZ;
394
404
  });
395
- _defineProperty(this, "Kbwh", function () {
396
- if (_this.Avzx === "SESSION") {
397
- _this.oKkN = _this.cOKY;
405
+ _defineProperty(this, "mtuI", function () {
406
+ if (_this.HdbP === "SESSION") {
407
+ _this.YpuZ = _this.Gnyd;
398
408
  Logger$1.info("Campaign Limit reset");
399
409
  }
400
410
  });
401
411
  /**
402
- * @function TzLe
412
+ * @function XinH
403
413
  * @description Validates if the campaign count is with in the limits set in the config.
404
414
  * @param {string} Config id
405
415
  * @returns {boolean} true - If the Campaign limits are not reached
406
416
  * false - Otherwise
407
417
  */
408
- _defineProperty(this, "TzLe", function (id) {
418
+ _defineProperty(this, "XinH", function (id) {
409
419
  try {
410
- if (_this.oKkN <= 0) {
420
+ if (_this.YpuZ <= 0) {
411
421
  return false;
412
422
  }
413
423
 
@@ -418,8 +428,8 @@
418
428
  if (!isDefined(qe_state) || !isDefined(qe_state[id])) return true;
419
429
 
420
430
  //If the config has a session count limit set
421
- if (_this.ivKN !== 0) {
422
- var sessionCountInConfig = parseInt(_this.ivKN);
431
+ if (_this.WUjI !== 0) {
432
+ var sessionCountInConfig = parseInt(_this.WUjI);
423
433
  var thisSessionCount = parseInt(qe_state[id]["SESSION"]);
424
434
  if (sessionCountInConfig - thisSessionCount <= 0) {
425
435
  return false;
@@ -446,16 +456,17 @@
446
456
  var Meta = /*#__PURE__*/_createClass(function Meta() {
447
457
  var _this = this;
448
458
  _classCallCheck(this, Meta);
449
- _defineProperty(this, "lKfZ", "");
450
- _defineProperty(this, "KSOj", "");
459
+ _defineProperty(this, "CTVX", "");
460
+ _defineProperty(this, "owVv", "");
451
461
  _defineProperty(this, "parse", function () {
452
462
  var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
453
463
  try {
454
- var _config$meta;
455
- _this.lKfZ = config.meta.name;
456
- _this.KSOj = config.meta.type;
464
+ var _config$meta, _config$meta2;
465
+ _this.CTVX = config.meta.name;
466
+ _this.owVv = config.meta.type;
457
467
  _this._only_context = config.meta.only_context;
458
468
  _this._attr = ((_config$meta = config.meta) === null || _config$meta === void 0 ? void 0 : _config$meta.attr) || {};
469
+ _this._isExperiment = (_config$meta2 = config.meta) === null || _config$meta2 === void 0 ? void 0 : _config$meta2.isExperiment;
459
470
  } catch (error) {
460
471
  window.ApxorLogger.error(error);
461
472
  return false;
@@ -468,11 +479,13 @@
468
479
  var Validity = /*#__PURE__*/_createClass(function Validity() {
469
480
  var _this = this;
470
481
  _classCallCheck(this, Validity);
471
- _defineProperty(this, "TVeC", -1);
472
- _defineProperty(this, "AsSy", -1);
473
- _defineProperty(this, "Hztt", -1);
474
- _defineProperty(this, "ZTNT", -1);
475
- _defineProperty(this, "eGYo", false);
482
+ _defineProperty(this, "zmJs", -1);
483
+ _defineProperty(this, "kepU", -1);
484
+ _defineProperty(this, "ysVa", -1);
485
+ _defineProperty(this, "ocLU", -1);
486
+ _defineProperty(this, "hxyS", false);
487
+ _defineProperty(this, "_nudge_expired", false);
488
+ _defineProperty(this, "_not_yet_active", false);
476
489
  _defineProperty(this, "parse", function () {
477
490
  var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
478
491
  try {
@@ -480,17 +493,17 @@
480
493
  Logger$2.error("Not valid dates");
481
494
  return false;
482
495
  }
483
- _this.TVeC = Date.parse(config.validity.start_date);
484
- _this.AsSy = Date.parse(config.validity.end_date);
496
+ _this.zmJs = Date.parse(config.validity.start_date);
497
+ _this.kepU = Date.parse(config.validity.end_date);
485
498
  if (isDefined(config.time_limits_in_day)) {
486
- _this.eGYo = config.time_limits_in_day;
487
- if (_this.eGYo && isDefined(config.time_limits)) {
499
+ _this.hxyS = config.time_limits_in_day;
500
+ if (_this.hxyS && isDefined(config.time_limits)) {
488
501
  var currentDate = new Date().toISOString().split("T")[0];
489
- _this.Hztt = Date.parse(currentDate + "T" + config.time_limits.start_time + ".000Z");
490
- _this.ZTNT = Date.parse(currentDate + "T" + config.time_limits.end_time + ".000Z");
502
+ _this.ysVa = Date.parse(currentDate + "T" + config.time_limits.start_time + ".000Z");
503
+ _this.ocLU = Date.parse(currentDate + "T" + config.time_limits.end_time + ".000Z");
491
504
 
492
505
  // If invalid format is passed, return false
493
- if (isNaN(_this.Hztt) || isNaN(_this.ZTNT)) {
506
+ if (isNaN(_this.ysVa) || isNaN(_this.ocLU)) {
494
507
  Logger$2.error("Not valid times");
495
508
  return false;
496
509
  }
@@ -504,8 +517,12 @@
504
517
  });
505
518
  _defineProperty(this, "validate", function () {
506
519
  var currentTime = Date.now();
507
- if (currentTime > _this.TVeC && currentTime < _this.AsSy) {
508
- return !_this.eGYo || currentTime >= _this.Hztt && currentTime <= _this.ZTNT;
520
+ if (currentTime > _this.zmJs && currentTime < _this.kepU) {
521
+ return !_this.hxyS || currentTime >= _this.ysVa && currentTime <= _this.ocLU;
522
+ } else if (currentTime < _this.zmJs) {
523
+ _this._not_yet_active = true;
524
+ } else if (currentTime > _this.kepU) {
525
+ _this._nudge_expired = true;
509
526
  }
510
527
  return false;
511
528
  });
@@ -514,13 +531,13 @@
514
531
  var Details = /*#__PURE__*/_createClass(function Details() {
515
532
  var _this = this;
516
533
  _classCallCheck(this, Details);
517
- _defineProperty(this, "lKfZ", "");
518
- _defineProperty(this, "xDaw", {});
534
+ _defineProperty(this, "CTVX", "");
535
+ _defineProperty(this, "orON", {});
519
536
  _defineProperty(this, "parse", function () {
520
537
  var details = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
521
538
  try {
522
- _this.lKfZ = details.name;
523
- _this.xDaw = details.additional_info;
539
+ _this.CTVX = details.name;
540
+ _this.orON = details.additional_info;
524
541
  } catch (error) {
525
542
  return false;
526
543
  }
@@ -531,14 +548,14 @@
531
548
  var Timebounds = /*#__PURE__*/_createClass(function Timebounds() {
532
549
  var _this = this;
533
550
  _classCallCheck(this, Timebounds);
534
- _defineProperty(this, "MZxZ", 0);
535
- _defineProperty(this, "gheX", 0);
551
+ _defineProperty(this, "oxbV", 0);
552
+ _defineProperty(this, "QyjH", 0);
536
553
  _defineProperty(this, "parse", function () {
537
554
  var timeBounds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
538
555
  try {
539
- _this.MZxZ = Number(timeBounds.lower);
540
- _this.gheX = Number(timeBounds.upper);
541
- if (isNaN(_this.MZxZ) || isNaN(_this.gheX)) {
556
+ _this.oxbV = Number(timeBounds.lower);
557
+ _this.QyjH = Number(timeBounds.upper);
558
+ if (isNaN(_this.oxbV) || isNaN(_this.QyjH)) {
542
559
  return false;
543
560
  }
544
561
  } catch (error) {
@@ -551,17 +568,17 @@
551
568
  var PreCondition = /*#__PURE__*/_createClass(function PreCondition() {
552
569
  var _this = this;
553
570
  _classCallCheck(this, PreCondition);
554
- _defineProperty(this, "SHrN", 0);
555
- _defineProperty(this, "rXTM", "");
556
- _defineProperty(this, "bgoZ", "");
557
- _defineProperty(this, "kuZn", new Details());
558
- _defineProperty(this, "tzep", new Timebounds());
571
+ _defineProperty(this, "VAxM", 0);
572
+ _defineProperty(this, "KJQk", "");
573
+ _defineProperty(this, "Nckt", "");
574
+ _defineProperty(this, "KdUl", new Details());
575
+ _defineProperty(this, "Bfpr", new Timebounds());
559
576
  _defineProperty(this, "parse", function () {
560
577
  var precondition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
561
578
  try {
562
- _this.rXTM = precondition.event_type;
563
- _this.bgoZ = precondition.activity;
564
- return _this.kuZn.parse(precondition.details) && _this.tzep.parse(precondition.time_bounds);
579
+ _this.KJQk = precondition.event_type;
580
+ _this.Nckt = precondition.activity;
581
+ return _this.KdUl.parse(precondition.details) && _this.Bfpr.parse(precondition.time_bounds);
565
582
  } catch (error) {
566
583
  return false;
567
584
  }
@@ -572,29 +589,29 @@
572
589
  var Condition = /*#__PURE__*/_createClass(function Condition() {
573
590
  var _this = this;
574
591
  _classCallCheck(this, Condition);
575
- _defineProperty(this, "SHrN", 0);
576
- _defineProperty(this, "eGRJ", -1);
577
- _defineProperty(this, "oKkN", 0);
578
- _defineProperty(this, "CKgT", "");
579
- _defineProperty(this, "bgoZ", "");
580
- _defineProperty(this, "rXTM", "");
581
- _defineProperty(this, "tzep", new Timebounds());
582
- _defineProperty(this, "kuZn", new Details());
583
- _defineProperty(this, "xiSw", new PreCondition());
584
- _defineProperty(this, "LNgq", "AND");
585
- _defineProperty(this, "dWSg", false);
586
- _defineProperty(this, "KSOj", void 0);
592
+ _defineProperty(this, "VAxM", 0);
593
+ _defineProperty(this, "mCnB", -1);
594
+ _defineProperty(this, "YpuZ", 0);
595
+ _defineProperty(this, "SvML", "");
596
+ _defineProperty(this, "Nckt", "");
597
+ _defineProperty(this, "KJQk", "");
598
+ _defineProperty(this, "Bfpr", new Timebounds());
599
+ _defineProperty(this, "KdUl", new Details());
600
+ _defineProperty(this, "rFlu", new PreCondition());
601
+ _defineProperty(this, "ndXU", "AND");
602
+ _defineProperty(this, "cmkQ", false);
603
+ _defineProperty(this, "owVv", void 0);
587
604
  _defineProperty(this, "parse", function () {
588
605
  var condition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
589
606
  try {
590
- _this.eGRJ = condition.sequence;
591
- _this.oKkN = condition.count_config.count;
592
- _this.CKgT = condition.count_config.operator;
593
- _this.bgoZ = condition.activity;
594
- _this.rXTM = condition.event_type;
595
- _this.LNgq = condition.combine_operator;
596
- _this.KSOj = condition.type;
597
- return _this.kuZn.parse(condition.details) && _this.xiSw.parse(condition.trigger) && _this.tzep.parse(condition.time_bounds);
607
+ _this.mCnB = condition.sequence;
608
+ _this.YpuZ = condition.count_config.count;
609
+ _this.SvML = condition.count_config.operator;
610
+ _this.Nckt = condition.activity;
611
+ _this.KJQk = condition.event_type;
612
+ _this.ndXU = condition.combine_operator;
613
+ _this.owVv = condition.type;
614
+ return _this.KdUl.parse(condition.details) && _this.rFlu.parse(condition.trigger) && _this.Bfpr.parse(condition.time_bounds);
598
615
  } catch (error) {
599
616
  Logger$3.error(error);
600
617
  return false;
@@ -606,19 +623,19 @@
606
623
  var GoalEvent = /*#__PURE__*/_createClass(function GoalEvent() {
607
624
  var _this = this;
608
625
  _classCallCheck(this, GoalEvent);
609
- _defineProperty(this, "oKkN", 0);
610
- _defineProperty(this, "CKgT", "");
611
- _defineProperty(this, "rXTM", "");
612
- _defineProperty(this, "tzep", new Timebounds());
613
- _defineProperty(this, "kuZn", new Details());
614
- _defineProperty(this, "LNgq", "AND");
626
+ _defineProperty(this, "YpuZ", 0);
627
+ _defineProperty(this, "SvML", "");
628
+ _defineProperty(this, "KJQk", "");
629
+ _defineProperty(this, "Bfpr", new Timebounds());
630
+ _defineProperty(this, "KdUl", new Details());
631
+ _defineProperty(this, "ndXU", "AND");
615
632
  _defineProperty(this, "parse", function (data) {
616
633
  try {
617
- _this.oKkN = data.count_config.count;
618
- _this.CKgT = data.count_config.operator;
619
- _this.rXTM = data.event_type;
620
- _this.LNgq = data.combine_operator;
621
- return _this.kuZn.parse(data.details) && _this.tzep.parse(data.time_bounds);
634
+ _this.YpuZ = data.count_config.count;
635
+ _this.SvML = data.count_config.operator;
636
+ _this.KJQk = data.event_type;
637
+ _this.ndXU = data.combine_operator;
638
+ return _this.KdUl.parse(data.details) && _this.Bfpr.parse(data.time_bounds);
622
639
  } catch (error) {
623
640
  Logger$4.error(error);
624
641
  return false;
@@ -632,21 +649,21 @@
632
649
  function ConditionValidator() {
633
650
  var _this = this;
634
651
  _classCallCheck(this, ConditionValidator);
635
- _defineProperty(this, "akXD", 0);
636
- _defineProperty(this, "FqJf", "");
637
- _defineProperty(this, "ehaO", new Condition());
638
- _defineProperty(this, "rkRi", new GoalEvent());
639
- _defineProperty(this, "RlJN", false);
640
- _defineProperty(this, "GJsb", false);
641
- _defineProperty(this, "WLVW", 0);
642
- _defineProperty(this, "LNgq", "AND");
643
- _defineProperty(this, "WFrp", "OR");
644
- _defineProperty(this, "sVTX", -1);
645
- _defineProperty(this, "GzsF", []);
646
- _defineProperty(this, "HATm", {});
647
- _defineProperty(this, "bqgA", false);
652
+ _defineProperty(this, "iqYa", 0);
653
+ _defineProperty(this, "tTqB", "");
654
+ _defineProperty(this, "Pwgu", new Condition());
655
+ _defineProperty(this, "PACz", new GoalEvent());
656
+ _defineProperty(this, "LpHt", false);
657
+ _defineProperty(this, "HLiN", false);
658
+ _defineProperty(this, "nODh", 0);
659
+ _defineProperty(this, "ndXU", "AND");
660
+ _defineProperty(this, "Pxjw", "OR");
661
+ _defineProperty(this, "BNbu", -1);
662
+ _defineProperty(this, "rjRg", []);
663
+ _defineProperty(this, "vBOh", {});
664
+ _defineProperty(this, "WFwv", false);
648
665
  /**
649
- * If respectSequence is true, don't auto-hian to events except for the condition whose index is 0
666
+ * If respectSequence is true, don't auto-zSnG to events except for the condition whose index is 0
650
667
  *
651
668
  * @param condition
652
669
  * @param type
@@ -662,191 +679,191 @@
662
679
  var respectSequence = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
663
680
  var noKpiArray = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
664
681
  var flag = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : "";
665
- _this.FqJf = id;
666
- _this.WLVW = index;
667
- _this.GzsF = noKpiArray;
682
+ _this.tTqB = id;
683
+ _this.nODh = index;
684
+ _this.rjRg = noKpiArray;
668
685
  if (flag !== "termination" || flag === "") {
669
- var result = _this.ehaO.parse(condition);
686
+ var result = _this.Pwgu.parse(condition);
670
687
  if (result) {
671
- _this.LNgq = _this.ehaO.LNgq;
688
+ _this.ndXU = _this.Pwgu.ndXU;
672
689
 
673
690
  // FIXME: Why this code is written? Don't see any usecase
674
- if (_this.ehaO.dWSg) {
675
- var eventName = _this.ehaO.kuZn.lKfZ;
691
+ if (_this.Pwgu.cmkQ) {
692
+ var eventName = _this.Pwgu.KdUl.CTVX;
676
693
  if (eventName === "APX_PAGE_OPENED") {
677
- eventName = _this.ehaO.kuZn.xDaw["navigation_id"];
678
- eventName = isDefined(eventName) ? eventName : _this.ehaO.kuZn.lKfZ;
694
+ eventName = _this.Pwgu.KdUl.orON["navigation_id"];
695
+ eventName = isDefined(eventName) ? eventName : _this.Pwgu.KdUl.CTVX;
679
696
  }
680
- _this.sVTX = Apxor.getController().getEventCount(eventName);
681
- var count = _this.ehaO.oKkN;
682
- var operator = _this.ehaO.CKgT;
683
- _this.GJsb = _this.BcDf(_this.sVTX - 1, count, operator, false);
684
- _this.RlJN = _this.GJsb;
685
- // If the condition is already satisfied and if it is page view, no need to hian
697
+ _this.BNbu = Apxor.getController().getEventCount(eventName);
698
+ var count = _this.Pwgu.YpuZ;
699
+ var operator = _this.Pwgu.SvML;
700
+ _this.HLiN = _this.tKdV(_this.BNbu - 1, count, operator, false);
701
+ _this.LpHt = _this.HLiN;
702
+ // If the condition is already satisfied and if it is page view, no need to zSnG
686
703
  // This only applies for NAVIGATION_EVENTS
687
- if (_this.GJsb && _this.ehaO.kuZn.lKfZ === "APX_PAGE_OPENED") {
704
+ if (_this.HLiN && _this.Pwgu.KdUl.CTVX === "APX_PAGE_OPENED") {
688
705
  return true;
689
706
  }
690
707
  }
691
708
  if (!respectSequence || index === 0) {
692
- _this.hian();
709
+ _this.zSnG();
693
710
  }
694
711
  return true;
695
712
  }
696
713
  } else {
697
- var _result = _this.rkRi.parse(condition);
698
- _this.WFrp = _this.rkRi.LNgq;
699
- _this.FoZP();
714
+ var _result = _this.PACz.parse(condition);
715
+ _this.Pxjw = _this.PACz.ndXU;
716
+ _this.vfXG();
700
717
  return true;
701
718
  }
702
719
  return false;
703
720
  });
704
- _defineProperty(this, "hian", function () {
721
+ _defineProperty(this, "zSnG", function () {
705
722
  var _window$ApxorRTM;
706
- var condition = _this.ehaO;
707
- var precondition = condition.xiSw;
723
+ var condition = _this.Pwgu;
724
+ var precondition = condition.rFlu;
708
725
  var ceInstance = CE.getInstance();
709
- if (precondition.rXTM === "app_start") {
710
- _this.RlJN = true;
711
- ceInstance.registerForEvent(generateKey(condition.rXTM) + "___" + condition.kuZn.lKfZ, _this.LkAU);
726
+ if (precondition.KJQk === "app_start") {
727
+ _this.LpHt = true;
728
+ ceInstance.registerForEvent(generateKey(condition.KJQk) + "___" + condition.KdUl.CTVX, _this.hjRG);
712
729
  } else {
713
- ceInstance.registerForEvent(generateKey(condition.rXTM) + "___" + precondition.kuZn.lKfZ, _this.LkAU);
730
+ ceInstance.registerForEvent(generateKey(condition.KJQk) + "___" + precondition.KdUl.CTVX, _this.hjRG);
714
731
  }
715
- if ((_window$ApxorRTM = window.ApxorRTM) !== null && _window$ApxorRTM !== void 0 && _window$ApxorRTM.badgesLists.includes(_this.FqJf)) {
716
- ceInstance.registerForEvent(generateKey(condition.rXTM) + "___" + "apxor-badge-container-".concat("-".concat(_this.FqJf).replaceAll(" ", "").replace(/[^\w\s]/gi, "")), _this.LkAU);
732
+ if ((_window$ApxorRTM = window.ApxorRTM) !== null && _window$ApxorRTM !== void 0 && _window$ApxorRTM.badgesLists.includes(_this.tTqB)) {
733
+ ceInstance.registerForEvent(generateKey(condition.KJQk) + "___" + "apxor-badge-container-".concat("-".concat(_this.tTqB).replaceAll(" ", "").replace(/[^\w\s]/gi, "")), _this.hjRG);
717
734
  }
718
735
  });
719
- _defineProperty(this, "FoZP", function () {
720
- var condition = _this.rkRi;
736
+ _defineProperty(this, "vfXG", function () {
737
+ var condition = _this.PACz;
721
738
  var ceInstance = CE.getInstance();
722
- _this.RlJN = true;
723
- ceInstance.registerForEvent(generateKey(condition.rXTM) + "___" + condition.kuZn.lKfZ, _this.xsmN);
739
+ _this.LpHt = true;
740
+ ceInstance.registerForEvent(generateKey(condition.KJQk) + "___" + condition.KdUl.CTVX, _this.oueL);
724
741
  });
725
- _defineProperty(this, "JTwT", function (type, name, time, additionalInfo) {
726
- var _this$ehaO;
742
+ _defineProperty(this, "RlTL", function (type, name, time, additionalInfo) {
743
+ var _this$Pwgu;
727
744
  var eventTime = Date.now();
728
- var time_differnce = (eventTime - _this.HATm[name]) / 1000;
729
- var time_fromConfig = ((_this$ehaO = _this.ehaO) === null || _this$ehaO === void 0 || (_this$ehaO = _this$ehaO.kuZn) === null || _this$ehaO === void 0 || (_this$ehaO = _this$ehaO.xDaw) === null || _this$ehaO === void 0 ? void 0 : _this$ehaO.time) / 1000;
745
+ var time_differnce = (eventTime - _this.vBOh[name]) / 1000;
746
+ var time_fromConfig = ((_this$Pwgu = _this.Pwgu) === null || _this$Pwgu === void 0 || (_this$Pwgu = _this$Pwgu.KdUl) === null || _this$Pwgu === void 0 || (_this$Pwgu = _this$Pwgu.orON) === null || _this$Pwgu === void 0 ? void 0 : _this$Pwgu.time) / 1000;
730
747
  if (time_fromConfig > time_differnce) {
731
748
  _this._displayCampaign(time);
732
749
  }
733
750
  });
734
- _defineProperty(this, "sSky", function (type, name, time, additionalInfo) {
751
+ _defineProperty(this, "lwFR", function (type, name, time, additionalInfo) {
735
752
  var _this$_condition2, _this$_condition3;
736
- _this.bqgA = true;
753
+ _this.WFwv = true;
737
754
  var currentTime = Date.now();
738
- var eventName = (_this$_condition2 = _this.ehaO) === null || _this$_condition2 === void 0 || (_this$_condition2 = _this$_condition2.xiSw) === null || _this$_condition2 === void 0 ? void 0 : _this$_condition2.kuZn.lKfZ;
739
- var eventTime = _this.HATm[eventName];
755
+ var eventName = (_this$_condition2 = _this.Pwgu) === null || _this$_condition2 === void 0 || (_this$_condition2 = _this$_condition2.rFlu) === null || _this$_condition2 === void 0 ? void 0 : _this$_condition2.KdUl.CTVX;
756
+ var eventTime = _this.vBOh[eventName];
740
757
  var time_differnce = (currentTime - eventTime) / 1000;
741
- var time_fromConfig = (_this$_condition3 = _this.ehaO) === null || _this$_condition3 === void 0 || (_this$_condition3 = _this$_condition3.kuZn) === null || _this$_condition3 === void 0 || (_this$_condition3 = _this$_condition3.xDaw) === null || _this$_condition3 === void 0 ? void 0 : _this$_condition3.time;
758
+ var time_fromConfig = (_this$_condition3 = _this.Pwgu) === null || _this$_condition3 === void 0 || (_this$_condition3 = _this$_condition3.KdUl) === null || _this$_condition3 === void 0 || (_this$_condition3 = _this$_condition3.orON) === null || _this$_condition3 === void 0 ? void 0 : _this$_condition3.time;
742
759
  time_fromConfig = time_fromConfig / 1000;
743
760
  if (time_fromConfig > time_differnce) {
744
761
  _this._displayCampaign(time);
745
762
  }
746
763
  //unregister the event
747
764
  });
748
- _defineProperty(this, "LkAU", function (type, name, time, additionalInfo) {
749
- var _window$ApxorRTM2;
765
+ _defineProperty(this, "hjRG", function (type, name, time, additionalInfo) {
766
+ var _window$ApxorRTM2, _window$ApxorRTM3;
750
767
  var ceInstance = CE.getInstance();
751
- if (!_this.RlJN) {
768
+ if (!_this.LpHt) {
752
769
  // Validate Precondition
753
- _this.RlJN = _this.PCkN(type, name, time, additionalInfo);
754
- if (_this.RlJN) {
755
- var condition = _this.ehaO;
756
- var precondition = condition.xiSw;
757
- precondition.SHrN = time;
770
+ _this.LpHt = _this.gwDR(type, name, time, additionalInfo);
771
+ if (_this.LpHt) {
772
+ var condition = _this.Pwgu;
773
+ var precondition = condition.rFlu;
774
+ precondition.VAxM = time;
758
775
  //events will be registred by its type activity event_type: "activity_time"
759
- if ((condition === null || condition === void 0 ? void 0 : condition.rXTM) === "activity_time") {
760
- var ehaO$kuZn, ehaO$_details2, ehaO$_details3;
761
- var event_time = condition === null || condition === void 0 || (ehaO$kuZn = condition.kuZn) === null || ehaO$kuZn === void 0 || (ehaO$kuZn = ehaO$kuZn.xDaw) === null || ehaO$kuZn === void 0 ? void 0 : ehaO$kuZn.time;
762
- if ((condition === null || condition === void 0 || (ehaO$_details2 = condition.kuZn) === null || ehaO$_details2 === void 0 || (ehaO$_details2 = ehaO$_details2.xDaw) === null || ehaO$_details2 === void 0 ? void 0 : ehaO$_details2.nkpi.length) > 0) {
776
+ if ((condition === null || condition === void 0 ? void 0 : condition.KJQk) === "activity_time") {
777
+ var Pwgu$KdUl, Pwgu$_details2, Pwgu$_details3;
778
+ var event_time = condition === null || condition === void 0 || (Pwgu$KdUl = condition.KdUl) === null || Pwgu$KdUl === void 0 || (Pwgu$KdUl = Pwgu$KdUl.orON) === null || Pwgu$KdUl === void 0 ? void 0 : Pwgu$KdUl.time;
779
+ if ((condition === null || condition === void 0 || (Pwgu$_details2 = condition.KdUl) === null || Pwgu$_details2 === void 0 || (Pwgu$_details2 = Pwgu$_details2.orON) === null || Pwgu$_details2 === void 0 ? void 0 : Pwgu$_details2.nkpi.length) > 0) {
763
780
  setTimeout(function () {
764
- if (!_this.bqgA) {
765
- _this.GJsb = true;
766
- if (_this.GJsb) {
767
- _this.akXD += 1;
768
- _this.GJsb = _this.BcDf(_this.akXD, _this.ehaO.oKkN, _this.ehaO.CKgT);
769
- if (_this.GJsb) {
770
- _this.ehaO.SHrN = time;
771
- ceInstance.validate(_this.FqJf, _this.WLVW);
781
+ if (!_this.WFwv) {
782
+ _this.HLiN = true;
783
+ if (_this.HLiN) {
784
+ _this.iqYa += 1;
785
+ _this.HLiN = _this.tKdV(_this.iqYa, _this.Pwgu.YpuZ, _this.Pwgu.SvML);
786
+ if (_this.HLiN) {
787
+ _this.Pwgu.VAxM = time;
788
+ ceInstance.validate(_this.tTqB, _this.nODh);
772
789
  }
773
790
  }
774
791
  }
775
- condition.kuZn.xDaw.nkpi.map(function (nokpi) {
776
- ceInstance.unregisterFromEvent(toUpperCase(condition.kuZn.xDaw.et) + "___" + nokpi, _this);
792
+ condition.KdUl.orON.nkpi.map(function (nokpi) {
793
+ ceInstance.unregisterFromEvent(toUpperCase(condition.KdUl.orON.et) + "___" + nokpi, _this);
777
794
  });
778
795
  }, event_time);
779
- condition.kuZn.xDaw.nkpi.map(function (nokpi) {
780
- ceInstance.registerForEvent(toUpperCase(condition.kuZn.xDaw.et) + "___" + nokpi, _this.sSky);
796
+ condition.KdUl.orON.nkpi.map(function (nokpi) {
797
+ ceInstance.registerForEvent(toUpperCase(condition.KdUl.orON.et) + "___" + nokpi, _this.lwFR);
781
798
  });
782
799
  }
783
800
  //it is for unregistering the events did case after completing the time imit
784
- if ((condition === null || condition === void 0 || (ehaO$_details3 = condition.kuZn) === null || ehaO$_details3 === void 0 || (ehaO$_details3 = ehaO$_details3.xDaw) === null || ehaO$_details3 === void 0 ? void 0 : ehaO$_details3.kpi.length) > 0) {
801
+ if ((condition === null || condition === void 0 || (Pwgu$_details3 = condition.KdUl) === null || Pwgu$_details3 === void 0 || (Pwgu$_details3 = Pwgu$_details3.orON) === null || Pwgu$_details3 === void 0 ? void 0 : Pwgu$_details3.kpi.length) > 0) {
785
802
  setTimeout(function () {
786
- condition.kuZn.xDaw.kpi.map(function (kpi) {
787
- ceInstance.unregisterFromEvent(toUpperCase(condition.kuZn.xDaw.et) + "___" + kpi, _this);
803
+ condition.KdUl.orON.kpi.map(function (kpi) {
804
+ ceInstance.unregisterFromEvent(toUpperCase(condition.KdUl.orON.et) + "___" + kpi, _this);
788
805
  });
789
806
  }, event_time);
790
- condition.kuZn.xDaw.kpi.map(function (kpi) {
791
- if (kpi === condition.xiSw.kuZn.lKfZ) {
807
+ condition.KdUl.orON.kpi.map(function (kpi) {
808
+ if (kpi === condition.rFlu.KdUl.CTVX) {
792
809
  //unregister the previous event
793
- ceInstance.unregisterFromEvent(generateKey(precondition.rXTM) + "___" + precondition.kuZn.lKfZ, _this);
794
- ceInstance.registerForEvent(toUpperCase(condition.kuZn.xDaw.et) + "___" + kpi, _this.JTwT);
810
+ ceInstance.unregisterFromEvent(generateKey(precondition.KJQk) + "___" + precondition.KdUl.CTVX, _this);
811
+ ceInstance.registerForEvent(toUpperCase(condition.KdUl.orON.et) + "___" + kpi, _this.RlTL);
795
812
  } else {
796
- ceInstance.registerForEvent(toUpperCase(condition.kuZn.xDaw.et) + "___" + kpi, _this.sSky);
813
+ ceInstance.registerForEvent(toUpperCase(condition.KdUl.orON.et) + "___" + kpi, _this.lwFR);
797
814
  }
798
815
  });
799
816
  }
800
817
  } else {
801
- ceInstance.unregisterFromEvent(generateKey(precondition.rXTM) + "___" + precondition.kuZn.lKfZ, _this);
802
- ceInstance.registerForEvent(generateKey(condition.rXTM) + "___" + condition.kuZn.lKfZ, _this);
818
+ ceInstance.unregisterFromEvent(generateKey(precondition.KJQk) + "___" + precondition.KdUl.CTVX, _this);
819
+ ceInstance.registerForEvent(generateKey(condition.KJQk) + "___" + condition.KdUl.CTVX, _this);
803
820
  }
804
- _this.HATm[name] = Date.now();
821
+ _this.vBOh[name] = Date.now();
805
822
  }
806
823
  return;
807
824
  }
808
- if ((_window$ApxorRTM2 = window.ApxorRTM) !== null && _window$ApxorRTM2 !== void 0 && _window$ApxorRTM2.isBadgePresent && Apxor.getController().isBadgeTriggerSatisfied(_this.FqJf)) {
809
- _this.GJsb = true;
810
- _this.ehaO.SHrN = time;
811
- ceInstance.validate(_this.FqJf, _this.WLVW);
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.tTqB) && Apxor.getController().isBadgeTriggerSatisfied(_this.tTqB)) {
826
+ _this.HLiN = true;
827
+ _this.Pwgu.VAxM = time;
828
+ ceInstance.validate(_this.tTqB, _this.nODh);
812
829
  return;
813
830
  }
814
831
 
815
832
  // Validate Condition
816
- var validationStatus = generateKey(_this.ehaO.rXTM) === type && _this.IHQA(time - _this.ehaO.xiSw.SHrN, _this.ehaO.tzep) && _this.ehaO.kuZn.lKfZ === name && _this.YnRU(_this.ehaO.kuZn.xDaw, additionalInfo);
833
+ var validationStatus = generateKey(_this.Pwgu.KJQk) === type && _this.CFTa(time - _this.Pwgu.rFlu.VAxM, _this.Pwgu.Bfpr) && _this.Pwgu.KdUl.CTVX === name && _this.iGQO(_this.Pwgu.KdUl.orON, additionalInfo);
817
834
  if (validationStatus) {
818
- _this.akXD += 1;
819
- _this.GJsb = _this.BcDf(_this.akXD, _this.ehaO.oKkN, _this.ehaO.CKgT);
820
- if (_this.GJsb) {
821
- _this.ehaO.SHrN = time;
822
- ceInstance.validate(_this.FqJf, _this.WLVW);
835
+ _this.iqYa += 1;
836
+ _this.HLiN = _this.tKdV(_this.iqYa, _this.Pwgu.YpuZ, _this.Pwgu.SvML);
837
+ if (_this.HLiN) {
838
+ _this.Pwgu.VAxM = time;
839
+ ceInstance.validate(_this.tTqB, _this.nODh);
823
840
  }
824
841
  }
825
842
  });
826
- _defineProperty(this, "xsmN", function (type, name, time, additionalInfo) {
843
+ _defineProperty(this, "oueL", function (type, name, time, additionalInfo) {
827
844
  var ceInstance = CE.getInstance();
828
- var validationStatus = generateKey(_this.rkRi.rXTM) === type && _this.IHQA(time, _this.rkRi.tzep) && _this.rkRi.kuZn.lKfZ === name && _this.YnRU(_this.rkRi.kuZn.xDaw, additionalInfo);
845
+ var validationStatus = generateKey(_this.PACz.KJQk) === type && _this.CFTa(time, _this.PACz.Bfpr) && _this.PACz.KdUl.CTVX === name && _this.iGQO(_this.PACz.KdUl.orON, additionalInfo);
829
846
  if (validationStatus) {
830
- _this.akXD += 1;
831
- _this.GJsb = _this.BcDf(_this.akXD, _this.rkRi.oKkN, _this.rkRi.CKgT);
832
- if (_this.GJsb) {
833
- _this.rkRi.SHrN = time;
834
- ceInstance.validateForTermination(_this.FqJf, _this.WLVW);
847
+ _this.iqYa += 1;
848
+ _this.HLiN = _this.tKdV(_this.iqYa, _this.PACz.YpuZ, _this.PACz.SvML);
849
+ if (_this.HLiN) {
850
+ _this.PACz.VAxM = time;
851
+ ceInstance.validateForTermination(_this.tTqB, _this.nODh);
835
852
  }
836
853
  }
837
854
  });
838
- _defineProperty(this, "PCkN", function (type, name, time, additionalInfo) {
839
- var precondition = _this.ehaO.xiSw;
840
- return generateKey(precondition.rXTM) === type && precondition.kuZn.lKfZ === name && _this.IHQA(time, precondition.tzep) && _this.YnRU(precondition.kuZn.xDaw, additionalInfo);
855
+ _defineProperty(this, "gwDR", function (type, name, time, additionalInfo) {
856
+ var precondition = _this.Pwgu.rFlu;
857
+ return generateKey(precondition.KJQk) === type && precondition.KdUl.CTVX === name && _this.CFTa(time, precondition.Bfpr) && _this.iGQO(precondition.KdUl.orON, additionalInfo);
841
858
  });
842
- _defineProperty(this, "IHQA", function (time, timeBounds) {
859
+ _defineProperty(this, "CFTa", function (time, timeBounds) {
843
860
  var currentTime = Math.ceil(time);
844
- return currentTime > timeBounds.MZxZ && currentTime < timeBounds.gheX;
861
+ return currentTime > timeBounds.oxbV && currentTime < timeBounds.QyjH;
845
862
  });
846
- _defineProperty(this, "BcDf", function (current, required, operator) {
863
+ _defineProperty(this, "tKdV", function (current, required, operator) {
847
864
  var checkOld = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
848
- if (checkOld && _this.ehaO.dWSg) {
849
- current = current + _this.sVTX;
865
+ if (checkOld && _this.Pwgu.cmkQ) {
866
+ current = current + _this.BNbu;
850
867
  }
851
868
  switch (operator) {
852
869
  case "EQ":
@@ -863,7 +880,7 @@
863
880
  return false;
864
881
  }
865
882
  });
866
- _defineProperty(this, "YnRU", function (expected, received) {
883
+ _defineProperty(this, "iGQO", function (expected, received) {
867
884
  var status = true;
868
885
  try {
869
886
  var _loop = function _loop() {
@@ -888,11 +905,11 @@
888
905
  loggedValues = [received[item]];
889
906
  }
890
907
  var match = loggedValues.some(function (loggedValue) {
891
- return OjHn(loggedValue, expectedValue, operator);
908
+ return cJes(loggedValue, expectedValue, operator);
892
909
  });
893
910
  status = status && match;
894
911
  } else {
895
- status = status && OjHn(received[item], expected[item], "EQ");
912
+ status = status && cJes(received[item], expected[item], "EQ");
896
913
  }
897
914
  },
898
915
  _ret;
@@ -911,13 +928,13 @@
911
928
  key: "_displayCampaign",
912
929
  value: function _displayCampaign(time) {
913
930
  var ceInstance = CE.getInstance();
914
- this.GJsb = true;
915
- if (this.GJsb) {
916
- this.akXD += 1;
917
- this.GJsb = this.BcDf(this.akXD, this.ehaO.oKkN, this.ehaO.CKgT);
918
- if (this.GJsb) {
919
- this.ehaO.SHrN = time;
920
- ceInstance.validate(this.FqJf, this.WLVW);
931
+ this.HLiN = true;
932
+ if (this.HLiN) {
933
+ this.iqYa += 1;
934
+ this.HLiN = this.tKdV(this.iqYa, this.Pwgu.YpuZ, this.Pwgu.SvML);
935
+ if (this.HLiN) {
936
+ this.Pwgu.VAxM = time;
937
+ ceInstance.validate(this.tTqB, this.nODh);
921
938
  }
922
939
  }
923
940
  }
@@ -929,25 +946,29 @@
929
946
  var APX_RETAINED_SESSIONS = "apx_retained_session";
930
947
  var APX_RETAINED_DAYS = "apx_retained_days";
931
948
  var APX_CONTEXT_EVALUATED = "apx_context_evaluated";
949
+ var APX_VARIANT_CODE = "apx_variant_code";
932
950
 
933
951
  var Logger$6 = window.ApxorLogger;
934
952
  var OverallConfig = /*#__PURE__*/_createClass(function OverallConfig() {
935
953
  var _this = this;
936
954
  _classCallCheck(this, OverallConfig);
937
- _defineProperty(this, "NpXz", []);
955
+ _defineProperty(this, "OuRa", []);
938
956
  _defineProperty(this, "_ret_day", {});
939
- _defineProperty(this, "MiYE", {});
940
- _defineProperty(this, "FLiS", false);
941
- _defineProperty(this, "DdTA", false);
957
+ _defineProperty(this, "ErWu", {});
958
+ _defineProperty(this, "dqnh", false);
959
+ _defineProperty(this, "rpSj", false);
960
+ _defineProperty(this, "retainedDaysValidated", true);
961
+ _defineProperty(this, "retainedSessionValidated", true);
962
+ _defineProperty(this, "eventDoneInLT", false);
963
+ // event done in life time, if event(like "purchase_event") already done in life time then campaign will not be shown
942
964
  _defineProperty(this, "parse", function () {
943
965
  var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
944
966
  try {
945
- _this.NpXz = config.overall_cfg.events;
967
+ _this.OuRa = config.overall_cfg.events;
946
968
  _this._ret_day = config.overall_cfg.ret_day;
947
- _this.MiYE = config.overall_cfg.session;
948
- _this.FLiS = config.overall_cfg.toggleRetDay;
949
- _this.NpXz = config.overall_cfg.events;
950
- _this.DdTA = config.overall_cfg.toggleSession;
969
+ _this.ErWu = config.overall_cfg.session;
970
+ _this.dqnh = config.overall_cfg.toggleRetDay;
971
+ _this.rpSj = config.overall_cfg.toggleSession;
951
972
  } catch (error) {
952
973
  Logger$6.error(error);
953
974
  return false;
@@ -957,10 +978,12 @@
957
978
  _defineProperty(this, "validate", function () {
958
979
  var retainedDays = parseInt(Apxor.getController().getFromStorage(APX_RETAINED_DAYS));
959
980
  var retainedSession = parseInt(Apxor.getController().getFromStorage(APX_RETAINED_SESSIONS));
960
- if (_this.FLiS && !isNaN(retainedDays) && !(retainedDays >= _this._ret_day.from && retainedDays <= _this._ret_day.to)) {
981
+ if (_this.dqnh && !isNaN(retainedDays) && !(retainedDays >= _this._ret_day.from && retainedDays <= _this._ret_day.to)) {
982
+ _this.retainedDaysValidated = false;
961
983
  return false;
962
984
  }
963
- if (_this.DdTA && !isNaN(retainedSession) && !(retainedSession >= _this.MiYE.from && retainedSession <= _this.MiYE.to)) {
985
+ if (_this.rpSj && !isNaN(retainedSession) && !(retainedSession >= _this.ErWu.from && retainedSession <= _this.ErWu.to)) {
986
+ _this.retainedSessionValidated = false;
964
987
  return false;
965
988
  }
966
989
  try {
@@ -968,9 +991,10 @@
968
991
  var data = Apxor.getController().getFromStorage("_apx_lt_count");
969
992
  var siteid = Apxor.getSiteId();
970
993
  var LtCountObjDecoded = JSON.parse(new TextDecoder().decode(stringToArrayBuffer(decode(siteid, data))));
971
- for (var i = 0; i < _this.NpXz.length; i++) {
972
- var evName = _this.NpXz[i].name.replace("'", "").replace("’", "");
994
+ for (var i = 0; i < _this.OuRa.length; i++) {
995
+ var evName = _this.OuRa[i].name.replace("'", "").replace("’", "");
973
996
  if (LtCountObjDecoded[evName]) {
997
+ _this.eventDoneInLT = true;
974
998
  return false;
975
999
  }
976
1000
  }
@@ -985,14 +1009,14 @@
985
1009
  var Attributes = /*#__PURE__*/_createClass(function Attributes() {
986
1010
  var _this = this;
987
1011
  _classCallCheck(this, Attributes);
988
- _defineProperty(this, "MSCc", []);
989
- _defineProperty(this, "HuDN", []);
1012
+ _defineProperty(this, "ZfAX", []);
1013
+ _defineProperty(this, "kLZG", []);
990
1014
  _defineProperty(this, "parse", function () {
991
1015
  var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
992
1016
  try {
993
- _this.MSCc = config.attributes.user;
994
- _this.HuDN = config.attributes.session;
995
- if (!Array.isArray(_this.MSCc) || !Array.isArray(_this.HuDN)) {
1017
+ _this.ZfAX = config.attributes.user;
1018
+ _this.kLZG = config.attributes.session;
1019
+ if (!Array.isArray(_this.ZfAX) || !Array.isArray(_this.kLZG)) {
996
1020
  Logger$7.error("No attributes");
997
1021
  return false;
998
1022
  }
@@ -1003,9 +1027,9 @@
1003
1027
  return true;
1004
1028
  });
1005
1029
  _defineProperty(this, "validate", function (user, session) {
1006
- return _this.zQwl(user, _this.MSCc) && _this.zQwl(session, _this.HuDN);
1030
+ return _this.KPjz(user, _this.ZfAX) && _this.KPjz(session, _this.kLZG);
1007
1031
  });
1008
- _defineProperty(this, "zQwl", function (attributes, expected) {
1032
+ _defineProperty(this, "KPjz", function (attributes, expected) {
1009
1033
  var length = expected.length;
1010
1034
  var status = true;
1011
1035
  try {
@@ -1035,7 +1059,7 @@
1035
1059
  }
1036
1060
  var match = loggedValues.some(function (loggedValue) {
1037
1061
  return values.some(function (configValue) {
1038
- return OjHn(loggedValue, configValue, operator);
1062
+ return cJes(loggedValue, configValue, operator);
1039
1063
  });
1040
1064
  });
1041
1065
  status = status && match;
@@ -1059,18 +1083,18 @@
1059
1083
  var TimeBasedTermination = /*#__PURE__*/_createClass(function TimeBasedTermination() {
1060
1084
  var _this = this;
1061
1085
  _classCallCheck(this, TimeBasedTermination);
1062
- _defineProperty(this, "OCNT", Apxor.getController());
1086
+ _defineProperty(this, "FOrk", Apxor.getController());
1063
1087
  _defineProperty(this, "type", "");
1064
1088
  _defineProperty(this, "_duration_seconds", 0);
1065
- _defineProperty(this, "dXMg", 1);
1089
+ _defineProperty(this, "qKfs", 1);
1066
1090
  _defineProperty(this, "parse", function (config) {
1067
1091
  try {
1068
1092
  var _config$terminate_inf, _config$terminate_inf2, _config$terminate_inf3;
1069
- _this.KSOj = (_config$terminate_inf = config.terminate_info.time_based) === null || _config$terminate_inf === void 0 ? void 0 : _config$terminate_inf.type;
1093
+ _this.owVv = (_config$terminate_inf = config.terminate_info.time_based) === null || _config$terminate_inf === void 0 ? void 0 : _config$terminate_inf.type;
1070
1094
  _this._duration_seconds = (_config$terminate_inf2 = config.terminate_info) === null || _config$terminate_inf2 === void 0 ? void 0 : _config$terminate_inf2.time_based.duration_seconds;
1071
- _this.dXMg = (_config$terminate_inf3 = config.terminate_info.time_based) === null || _config$terminate_inf3 === void 0 ? void 0 : _config$terminate_inf3.days;
1072
- if (_this.OjHn(config._id)) {
1073
- _this.OCNT.persistTerminationInfoLocally(config._id);
1095
+ _this.qKfs = (_config$terminate_inf3 = config.terminate_info.time_based) === null || _config$terminate_inf3 === void 0 ? void 0 : _config$terminate_inf3.days;
1096
+ if (_this.cJes(config._id)) {
1097
+ _this.FOrk.persistTerminationInfoLocally(config._id);
1074
1098
  return false;
1075
1099
  }
1076
1100
  } catch (_unused) {
@@ -1078,16 +1102,16 @@
1078
1102
  }
1079
1103
  return true;
1080
1104
  });
1081
- _defineProperty(this, "OjHn", function (id) {
1105
+ _defineProperty(this, "cJes", function (id) {
1082
1106
  var _Data$id;
1083
- var Data = JSON.parse(_this.OCNT.getFromStorage(APX_TERMINATION_ID));
1107
+ var Data = JSON.parse(_this.FOrk.getFromStorage(APX_TERMINATION_ID));
1084
1108
  if (!Data[id] || !((_Data$id = Data[id]) !== null && _Data$id !== void 0 && _Data$id.startDate)) return false;
1085
1109
  var startDate = new Date(Data[id].startDate);
1086
1110
  var presentDate = new Date(getDateInMMDDYYYY());
1087
1111
  var diff = parseInt((presentDate - startDate) / (1000 * 60 * 60 * 24), 10);
1088
1112
  var currentTime = _getTime();
1089
- var Hztt = Data[id].Hztt;
1090
- return diff === _this.dXMg && currentTime.hours >= Hztt.hours || diff > _this.dXMg || Data[id].goalAcheived;
1113
+ var ysVa = Data[id].ysVa;
1114
+ return diff === _this.qKfs && currentTime.hours >= ysVa.hours || diff > _this.qKfs || Data[id].goalAcheived;
1091
1115
  });
1092
1116
  });
1093
1117
 
@@ -1096,19 +1120,19 @@
1096
1120
  _classCallCheck(this, TerminationInfo);
1097
1121
  _defineProperty(this, "enable_goal_events", false);
1098
1122
  _defineProperty(this, "attributes", {});
1099
- _defineProperty(this, "hQNV", new Attributes());
1100
- _defineProperty(this, "NQJh", new TimeBasedTermination());
1123
+ _defineProperty(this, "NYIx", new Attributes());
1124
+ _defineProperty(this, "yGMZ", new TimeBasedTermination());
1101
1125
  _defineProperty(this, "parse", function () {
1102
1126
  var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1103
1127
  try {
1104
1128
  var _config$terminate_inf, _config$terminate_inf2, _config$terminate_inf3;
1105
1129
  _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;
1106
- if (_this.enable_time_based && !_this.NQJh.parse(config)) {
1130
+ if (_this.enable_time_based && !_this.yGMZ.parse(config)) {
1107
1131
  return false;
1108
1132
  }
1109
1133
  _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;
1110
1134
  _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;
1111
- if (_this.enable_attributes && !_this.hQNV.parse(config.terminate_info)) {
1135
+ if (_this.enable_attributes && !_this.NYIx.parse(config.terminate_info)) {
1112
1136
  return false;
1113
1137
  }
1114
1138
  } catch (error) {
@@ -1118,7 +1142,7 @@
1118
1142
  return true;
1119
1143
  });
1120
1144
  _defineProperty(this, "validate", function (user, session) {
1121
- return _this.hQNV.validate(user, session);
1145
+ return _this.NYIx.validate(user, session);
1122
1146
  });
1123
1147
  });
1124
1148
 
@@ -1126,20 +1150,22 @@
1126
1150
  var ConfigItem = /*#__PURE__*/_createClass(function ConfigItem() {
1127
1151
  var _this = this;
1128
1152
  _classCallCheck(this, ConfigItem);
1129
- _defineProperty(this, "xJBM", []);
1130
- _defineProperty(this, "vlff", []);
1131
- _defineProperty(this, "FqJf", "");
1132
- _defineProperty(this, "nWdU", new Meta());
1133
- _defineProperty(this, "NGHV", new Audience());
1134
- _defineProperty(this, "Avzx", new Validity());
1135
- _defineProperty(this, "znWc", new Frequency());
1136
- _defineProperty(this, "TaRN", new OverallConfig());
1137
- _defineProperty(this, "QowM", new TerminationInfo());
1138
- _defineProperty(this, "sajn", false);
1139
- _defineProperty(this, "pzra", []);
1153
+ _defineProperty(this, "Qyfu", []);
1154
+ _defineProperty(this, "BCZU", []);
1155
+ _defineProperty(this, "tTqB", "");
1156
+ _defineProperty(this, "YTKa", new Meta());
1157
+ _defineProperty(this, "EHOf", new Audience());
1158
+ _defineProperty(this, "HdbP", new Validity());
1159
+ _defineProperty(this, "wXgl", new Frequency());
1160
+ _defineProperty(this, "qUBE", new OverallConfig());
1161
+ _defineProperty(this, "OyjG", new TerminationInfo());
1162
+ _defineProperty(this, "scuX", false);
1163
+ _defineProperty(this, "KHpv", []);
1164
+ _defineProperty(this, "_variant_code", "");
1140
1165
  _defineProperty(this, "parse", function () {
1141
1166
  var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1142
1167
  try {
1168
+ var _this$YTKa$_attr;
1143
1169
  // If ID is not present, throw it out
1144
1170
  if (!isDefined(config._id)) {
1145
1171
  Logger$8.error("No Id");
@@ -1153,18 +1179,18 @@
1153
1179
  }
1154
1180
 
1155
1181
  // If META, VALIDITY, FREQUENCY and AUDIENCE is not parsed properly, throw it out
1156
- if (!(_this.nWdU.parse(config) && _this.Avzx.parse(config) && _this.znWc.parse(config) && _this.NGHV.parse(config) && _this.TaRN.parse(config) && _this.QowM.parse(config))) {
1182
+ if (!(_this.YTKa.parse(config) && _this.HdbP.parse(config) && _this.wXgl.parse(config) && _this.EHOf.parse(config) && _this.qUBE.parse(config) && _this.OyjG.parse(config))) {
1157
1183
  return false;
1158
1184
  }
1159
-
1185
+ _this._variant_code = _this.YTKa._isExperiment || _this.YTKa._only_context ? (_this$YTKa$_attr = _this.YTKa._attr) === null || _this$YTKa$_attr === void 0 ? void 0 : _this$YTKa$_attr[APX_VARIANT_CODE] : "TG";
1160
1186
  // If there are no conditions, throw it out
1161
1187
  if (!isDefined(config.conditions) || !Array.isArray(config.conditions)) {
1162
1188
  Logger$8.error("No valid conditions", config.conditions);
1163
1189
  return false;
1164
1190
  }
1165
- _this.FqJf = config._id;
1166
- _this.sajn = isDefined(config.sequence_enabled) ? config.sequence_enabled : false;
1167
- if (_this.sajn) {
1191
+ _this.tTqB = config._id;
1192
+ _this.scuX = isDefined(config.sequence_enabled) ? config.sequence_enabled : false;
1193
+ if (_this.scuX) {
1168
1194
  // iff respectSequence is true, Sort the Conditions by their sequence order
1169
1195
  // We need to sort, if server sends them in orderless manner
1170
1196
  config.conditions.sort(function (prev, current) {
@@ -1176,17 +1202,17 @@
1176
1202
  var conditions = config.conditions;
1177
1203
  var length = conditions.length;
1178
1204
  for (var index = 0; index < length; index++) {
1179
- _this.pzra = [];
1205
+ _this.KHpv = [];
1180
1206
  var condition = conditions[index];
1181
1207
  if (condition.type === "didn't") {
1182
- var ehaO$details;
1208
+ var Pwgu$details;
1183
1209
  var obj = {
1184
1210
  trigger_key: condition.trigger.details.name,
1185
- no_kpi_array: condition === null || condition === void 0 || (ehaO$details = condition.details) === null || ehaO$details === void 0 || (ehaO$details = ehaO$details.additional_info) === null || ehaO$details === void 0 ? void 0 : ehaO$details.nkpi,
1211
+ no_kpi_array: condition === null || condition === void 0 || (Pwgu$details = condition.details) === null || Pwgu$details === void 0 || (Pwgu$details = Pwgu$details.additional_info) === null || Pwgu$details === void 0 ? void 0 : Pwgu$details.nkpi,
1186
1212
  condition_id: condition === null || condition === void 0 ? void 0 : condition._id,
1187
1213
  time_bounds: condition.time_bounds.upper
1188
1214
  };
1189
- _this.pzra = [].concat(_toConsumableArray(_this.pzra), [obj]);
1215
+ _this.KHpv = [].concat(_toConsumableArray(_this.KHpv), [obj]);
1190
1216
  //this will be the key
1191
1217
  //when event occur check this array and then then check the time
1192
1218
  //check the time diffrence
@@ -1195,73 +1221,143 @@
1195
1221
  }
1196
1222
 
1197
1223
  var conditionValidator = new ConditionValidator();
1198
- if (conditionValidator.initialize(condition, _this.FqJf, index, _this.sajn, _this.pzra)) {
1199
- _this.xJBM.push(conditionValidator);
1224
+ if (conditionValidator.initialize(condition, _this.tTqB, index, _this.scuX, _this.KHpv)) {
1225
+ _this.Qyfu.push(conditionValidator);
1200
1226
  }
1201
1227
  }
1202
- if (_this.QowM.enable_goal_events) {
1228
+ if (_this.OyjG.enable_goal_events) {
1203
1229
  var goal_events = config.terminate_info.goal_events.events;
1204
1230
  var goaleventslength = goal_events.length;
1205
1231
  for (var i = 0; i < goaleventslength; i++) {
1206
1232
  var _conditionValidator = new ConditionValidator();
1207
- if (_conditionValidator.initialize(goal_events[i], _this.FqJf, i, true, [], "termination")) {
1208
- _this.vlff.push(_conditionValidator);
1233
+ if (_conditionValidator.initialize(goal_events[i], _this.tTqB, i, true, [], "termination")) {
1234
+ _this.BCZU.push(_conditionValidator);
1209
1235
  }
1210
1236
  }
1211
1237
  }
1212
- return _this.xJBM.length > 0;
1238
+ return _this.Qyfu.length > 0;
1213
1239
  } catch (error) {
1214
1240
  Logger$8.error(error);
1215
1241
  return false;
1216
1242
  }
1217
1243
  });
1218
- _defineProperty(this, "GjfG", function (index) {
1244
+ _defineProperty(this, "jKQM", function (index) {
1219
1245
  if (index < 0) {
1220
1246
  return;
1221
1247
  }
1222
- if (_this.sajn) {
1223
- var conditionValidator = _this.xJBM[index];
1224
- if (isDefined(conditionValidator) && conditionValidator.GJsb) {
1248
+ if (_this.scuX) {
1249
+ var conditionValidator = _this.Qyfu[index];
1250
+ if (isDefined(conditionValidator) && conditionValidator.HLiN) {
1225
1251
  // Check if previous validator is satisfied
1226
- var prevValidator = _this.xJBM[index - 1];
1227
- if (isDefined(prevValidator) && !prevValidator.GJsb) {
1252
+ var prevValidator = _this.Qyfu[index - 1];
1253
+ if (isDefined(prevValidator) && !prevValidator.HLiN) {
1228
1254
  // TODO: If current index is satisfied before previous one, do something
1229
1255
  // either unregister all conditions or remove this item from ConfigLookup
1230
1256
  return;
1231
1257
  }
1232
- var nextValidator = _this.xJBM[index + 1];
1258
+ var nextValidator = _this.Qyfu[index + 1];
1233
1259
  if (!isDefined(nextValidator)) {
1234
1260
  // It means this is the last condition
1235
1261
  // Validate all conditions
1236
- _this.FnDf();
1262
+ _this.zWDC();
1237
1263
  } else {
1238
- nextValidator.hian();
1264
+ nextValidator.zSnG();
1239
1265
  }
1240
1266
  }
1241
1267
  } else {
1242
1268
  // Validate all conditions
1243
- _this.FnDf();
1269
+ _this.zWDC();
1244
1270
  }
1245
1271
  });
1246
- _defineProperty(this, "pYOs", function (index) {
1272
+ _defineProperty(this, "VcYO", function (index) {
1247
1273
  if (index < 0) {
1248
1274
  return;
1249
1275
  }
1250
- _this.YpOv();
1276
+ _this.srDl();
1251
1277
  });
1252
- _defineProperty(this, "FnDf", function () {
1278
+ _defineProperty(this, "zWDC", function () {
1253
1279
  // Check If Audience, Validity is satisfied or not
1254
1280
  var userAttributes = Apxor.getController().getUserAttributes();
1255
1281
  var sessionAttributes = Apxor.getController().getSessionAttributes();
1256
- if (!_this.Avzx.validate() || !_this.NGHV.validate(userAttributes, sessionAttributes) || !_this.TaRN.validate()) {
1282
+ if (!_this.HdbP.validate() || !_this.EHOf.validate(userAttributes, sessionAttributes) || !_this.qUBE.validate()) {
1283
+ if (!_this.qUBE.retainedDaysValidated) {
1284
+ Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
1285
+ apx_nudge_type: _this.YTKa.owVv === "SURVEY" ? "survey" : "campaign",
1286
+ apx_nudge_id: _this.tTqB,
1287
+ apx_nudge_name: _this.YTKa.CTVX,
1288
+ apx_variant_code: _this.YTKa._isExperiment || _this.YTKa._only_context ? _this.YTKa._attr[APX_VARIANT_CODE] : "TG",
1289
+ apx_failure_type: "warn",
1290
+ apx_reason: "Retained day criteria not met"
1291
+ });
1292
+ }
1293
+ if (!_this.qUBE.retainedSessionValidated) {
1294
+ Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
1295
+ apx_nudge_type: _this.YTKa.owVv === "SURVEY" ? "survey" : "campaign",
1296
+ apx_nudge_id: _this.tTqB,
1297
+ apx_nudge_name: _this.YTKa.CTVX,
1298
+ apx_variant_code: _this.YTKa._isExperiment || _this.YTKa._only_context ? _this.YTKa._attr[APX_VARIANT_CODE] : "TG",
1299
+ apx_failure_type: "warn",
1300
+ apx_reason: "User session criteria not met"
1301
+ });
1302
+ }
1303
+ if (_this.qUBE.eventDoneInLT) {
1304
+ Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
1305
+ apx_nudge_type: _this.YTKa.owVv === "SURVEY" ? "survey" : "campaign",
1306
+ apx_nudge_id: _this.tTqB,
1307
+ apx_nudge_name: _this.YTKa.CTVX,
1308
+ apx_variant_code: _this.YTKa._isExperiment || _this.YTKa._only_context ? _this.YTKa._attr[APX_VARIANT_CODE] : "TG",
1309
+ apx_failure_type: "warn",
1310
+ apx_reason: "Event done in life time"
1311
+ });
1312
+ }
1313
+ if (!_this.EHOf.userAttributesValidated) {
1314
+ Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
1315
+ apx_nudge_type: _this.YTKa.owVv === "SURVEY" ? "survey" : "campaign",
1316
+ apx_nudge_id: _this.tTqB,
1317
+ apx_nudge_name: _this.YTKa.CTVX,
1318
+ apx_variant_code: _this.YTKa._isExperiment || _this.YTKa._only_context ? _this.YTKa._attr[APX_VARIANT_CODE] : "TG",
1319
+ apx_failure_type: "warn",
1320
+ apx_reason: "User property filter not met"
1321
+ });
1322
+ }
1323
+ if (!_this.EHOf.sessionAttributeValidated) {
1324
+ Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
1325
+ apx_nudge_type: _this.YTKa.owVv === "SURVEY" ? "survey" : "campaign",
1326
+ apx_nudge_id: _this.tTqB,
1327
+ apx_nudge_name: _this.YTKa.CTVX,
1328
+ apx_variant_code: _this.YTKa._isExperiment || _this.YTKa._only_context ? _this.YTKa._attr[APX_VARIANT_CODE] : "TG",
1329
+ apx_failure_type: "warn",
1330
+ apx_reason: "Session property filter not met"
1331
+ });
1332
+ }
1333
+ if (_this.HdbP._not_yet_active) {
1334
+ Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
1335
+ apx_nudge_type: _this.YTKa.owVv === "SURVEY" ? "survey" : "campaign",
1336
+ apx_nudge_id: _this.tTqB,
1337
+ apx_nudge_name: _this.YTKa.CTVX,
1338
+ apx_variant_code: _this.YTKa._isExperiment || _this.YTKa._only_context ? _this.YTKa._attr[APX_VARIANT_CODE] : "TG",
1339
+ apx_failure_type: "warn",
1340
+ apx_reason: "nudge not yet active"
1341
+ });
1342
+ }
1343
+ if (_this.HdbP._nudge_expired) {
1344
+ Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
1345
+ apx_nudge_type: _this.YTKa.owVv === "SURVEY" ? "survey" : "campaign",
1346
+ apx_nudge_id: _this.tTqB,
1347
+ apx_nudge_name: _this.YTKa.CTVX,
1348
+ apx_variant_code: _this.YTKa._isExperiment || _this.YTKa._only_context ? _this.YTKa._attr[APX_VARIANT_CODE] : "TG",
1349
+ apx_failure_type: "warn",
1350
+ apx_reason: "nudge expired"
1351
+ });
1352
+ }
1257
1353
  return;
1258
1354
  }
1259
- var length = _this.xJBM.length;
1355
+ var length = _this.Qyfu.length;
1260
1356
  var isSatisfied = length < 1;
1261
1357
  var combineOperator = "";
1262
1358
  for (var index = 0; index < length; index++) {
1263
- var validator = _this.xJBM[index];
1264
- var currentResult = validator.GJsb;
1359
+ var validator = _this.Qyfu[index];
1360
+ var currentResult = validator.HLiN;
1265
1361
  if (combineOperator.trim() === "") {
1266
1362
  isSatisfied = currentResult;
1267
1363
  } else {
@@ -1274,39 +1370,59 @@
1274
1370
  break;
1275
1371
  }
1276
1372
  }
1277
- combineOperator = validator.LNgq;
1373
+ combineOperator = validator.ndXU;
1278
1374
  }
1279
1375
  if (isSatisfied) {
1376
+ var _window$ApxorRTM, _window$ApxorRTM2;
1280
1377
  console.debug("onCondition satisfied");
1281
1378
  // Check if count reached it's maximum
1282
- if (!_this.znWc.TzLe(_this.FqJf)) {
1283
- console.warn("Maximum limit reached", _this.FqJf);
1379
+ if (!_this.wXgl.XinH(_this.tTqB)) {
1380
+ console.warn("Maximum limit reached", _this.tTqB);
1381
+ //logging event for view not found for test device
1382
+ Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
1383
+ apx_nudge_type: "campaign",
1384
+ apx_nudge_id: _this.tTqB,
1385
+ apx_nudge_name: _this.YTKa.CTVX,
1386
+ apx_variant_code: _this.YTKa._isExperiment || _this.YTKa._only_context ? _this.YTKa._attr[APX_VARIANT_CODE] : "TG",
1387
+ apx_failure_type: "warn",
1388
+ apx_reason: "Campaign limit reached"
1389
+ });
1284
1390
  return;
1285
1391
  }
1286
- console.log("Dispatching event", _this.nWdU.KSOj);
1287
- if (_this.nWdU._only_context === true) {
1288
- Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.nWdU._attr), {}, {
1289
- message_name: _this.nWdU.lKfZ,
1290
- id: _this.FqJf
1392
+
1393
+ //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.tTqB) && Apxor.getController().isBadgeTriggerSatisfied(_this.tTqB))) {
1395
+ Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_trigger_satisfied", {
1396
+ apx_nudge_type: _this.YTKa.owVv === "SURVEY" ? "survey" : "campaign",
1397
+ apx_nudge_id: _this.tTqB,
1398
+ apx_nudge_name: _this.YTKa.CTVX,
1399
+ apx_variant_code: _this.YTKa._isExperiment || _this.YTKa._only_context ? _this.YTKa._attr[APX_VARIANT_CODE] : "TG"
1400
+ });
1401
+ }
1402
+ console.log("Dispatching event", _this.YTKa.owVv);
1403
+ if (_this.YTKa._only_context === true) {
1404
+ Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.YTKa._attr), {}, {
1405
+ message_name: _this.YTKa.CTVX,
1406
+ id: _this.tTqB
1291
1407
  }));
1292
1408
  }
1293
1409
  // Emit event
1294
- Apxor.getController().dispatchEvent(_this.nWdU.KSOj, {
1295
- name: _this.nWdU.KSOj,
1410
+ Apxor.getController().dispatchEvent(_this.YTKa.owVv, {
1411
+ name: _this.YTKa.owVv,
1296
1412
  additional_info: {
1297
- uuid: _this.FqJf,
1298
- name: _this.nWdU.lKfZ
1413
+ uuid: _this.tTqB,
1414
+ name: _this.YTKa.CTVX
1299
1415
  }
1300
1416
  });
1301
1417
  }
1302
1418
  });
1303
- _defineProperty(this, "YpOv", function () {
1304
- var length = _this.vlff.length;
1419
+ _defineProperty(this, "srDl", function () {
1420
+ var length = _this.BCZU.length;
1305
1421
  var isSatisfied = length < 1;
1306
1422
  var combineOperator = "";
1307
1423
  for (var index = 0; index < length; index++) {
1308
- var validator = _this.vlff[index];
1309
- var currentResult = validator.GJsb;
1424
+ var validator = _this.BCZU[index];
1425
+ var currentResult = validator.HLiN;
1310
1426
  if (combineOperator.trim() === "") {
1311
1427
  isSatisfied = currentResult;
1312
1428
  } else {
@@ -1319,23 +1435,23 @@
1319
1435
  break;
1320
1436
  }
1321
1437
  }
1322
- combineOperator = validator.WFrp;
1438
+ combineOperator = validator.Pxjw;
1323
1439
  }
1324
1440
  if (isSatisfied) {
1325
- console.log("Dispatching event", _this.nWdU.KSOj);
1326
- Apxor.getController().persistTerminationInfoLocally(_this.FqJf);
1327
- if (_this.nWdU._only_context === true) {
1328
- Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.nWdU._attr), {}, {
1329
- message_name: _this.nWdU.lKfZ,
1330
- id: _this.FqJf
1441
+ console.log("Dispatching event", _this.YTKa.owVv);
1442
+ Apxor.getController().persistTerminationInfoLocally(_this.tTqB);
1443
+ if (_this.YTKa._only_context === true) {
1444
+ Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.YTKa._attr), {}, {
1445
+ message_name: _this.YTKa.CTVX,
1446
+ id: _this.tTqB
1331
1447
  }));
1332
1448
  }
1333
1449
  // Emit event
1334
- Apxor.getController().dispatchEvent(_this.nWdU.KSOj, {
1335
- name: _this.nWdU.KSOj,
1450
+ Apxor.getController().dispatchEvent(_this.YTKa.owVv, {
1451
+ name: _this.YTKa.owVv,
1336
1452
  additional_info: {
1337
- uuid: _this.FqJf,
1338
- name: _this.nWdU.lKfZ
1453
+ uuid: _this.tTqB,
1454
+ name: _this.YTKa.CTVX
1339
1455
  }
1340
1456
  });
1341
1457
  }
@@ -1343,23 +1459,23 @@
1343
1459
  _defineProperty(this, "validateForTerminationAttributes", function () {
1344
1460
  var userAttributes = Apxor.getController().getUserAttributes();
1345
1461
  var sessionAttributes = Apxor.getController().getSessionAttributes();
1346
- return _this.QowM.validate(userAttributes, sessionAttributes);
1462
+ return _this.OyjG.validate(userAttributes, sessionAttributes);
1347
1463
  });
1348
- _defineProperty(this, "ErGD", function () {
1349
- _this.znWc.ErGD();
1464
+ _defineProperty(this, "aokP", function () {
1465
+ _this.wXgl.aokP();
1350
1466
  });
1351
1467
  _defineProperty(this, "getFrequencyCount", function () {
1352
- return _this.znWc.getFrequencyCount();
1468
+ return _this.wXgl.getFrequencyCount();
1353
1469
  });
1354
- _defineProperty(this, "KnFr", function () {
1355
- return _this.znWc.Kbwh();
1470
+ _defineProperty(this, "unSR", function () {
1471
+ return _this.wXgl.mtuI();
1356
1472
  });
1357
1473
  });
1358
1474
 
1359
1475
  var ConfigLookup = /*#__PURE__*/_createClass(function ConfigLookup() {
1360
1476
  var _this = this;
1361
1477
  _classCallCheck(this, ConfigLookup);
1362
- _defineProperty(this, "XvSv", {});
1478
+ _defineProperty(this, "Nxlp", {});
1363
1479
  _defineProperty(this, "parse", function () {
1364
1480
  var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
1365
1481
  configs: []
@@ -1382,7 +1498,7 @@
1382
1498
  var configId = _config._id;
1383
1499
  var configItem = new ConfigItem();
1384
1500
  if (configItem.parse(_config)) {
1385
- _this.XvSv[configId] = configItem;
1501
+ _this.Nxlp[configId] = configItem;
1386
1502
  } else {
1387
1503
  console.warn("Failed to parse cfg", configId);
1388
1504
  }
@@ -1390,44 +1506,51 @@
1390
1506
  }
1391
1507
  });
1392
1508
  _defineProperty(this, "validate", function (id, index) {
1393
- if (_this.XvSv[id]) {
1394
- var configItem = _this.XvSv[id];
1395
- configItem.GjfG(index);
1509
+ if (_this.Nxlp[id]) {
1510
+ var configItem = _this.Nxlp[id];
1511
+ configItem.jKQM(index);
1396
1512
  }
1397
1513
  });
1514
+ _defineProperty(this, "getVariantCode", function (id) {
1515
+ if (_this.Nxlp[id]) {
1516
+ var configItem = _this.Nxlp[id];
1517
+ return configItem._variant_code;
1518
+ }
1519
+ return "";
1520
+ });
1398
1521
  _defineProperty(this, "validateForTermination", function (id, index) {
1399
- if (_this.XvSv[id]) {
1400
- var configItem = _this.XvSv[id];
1401
- configItem.pYOs(index);
1522
+ if (_this.Nxlp[id]) {
1523
+ var configItem = _this.Nxlp[id];
1524
+ configItem.VcYO(index);
1402
1525
  }
1403
1526
  });
1404
1527
  _defineProperty(this, "validateForTerminationAttributes", function (id) {
1405
- if (_this.XvSv[id]) {
1406
- var configItem = _this.XvSv[id];
1528
+ if (_this.Nxlp[id]) {
1529
+ var configItem = _this.Nxlp[id];
1407
1530
  return configItem.validateForTerminationAttributes();
1408
1531
  }
1409
1532
  return false;
1410
1533
  });
1411
- _defineProperty(this, "ErGD", function (id) {
1412
- var campiagnConfig = _this.XvSv[id];
1413
- campiagnConfig.ErGD();
1534
+ _defineProperty(this, "aokP", function (id) {
1535
+ var campiagnConfig = _this.Nxlp[id];
1536
+ campiagnConfig.aokP();
1414
1537
  });
1415
1538
  _defineProperty(this, "getFrequencyCount", function (id) {
1416
- var campiagnConfig = _this.XvSv[id];
1539
+ var campiagnConfig = _this.Nxlp[id];
1417
1540
  return campiagnConfig.getFrequencyCount();
1418
1541
  });
1419
1542
  _defineProperty(this, "resetFrequencyCounts", function () {
1420
- var configs = _this.XvSv;
1543
+ var configs = _this.Nxlp;
1421
1544
  for (var configId in configs) {
1422
- configs[configId].KnFr();
1545
+ configs[configId].unSR();
1423
1546
  }
1424
1547
  });
1425
- _defineProperty(this, "Asov", function (campaignId) {
1548
+ _defineProperty(this, "MRwp", function (campaignId) {
1426
1549
  try {
1427
- if (_this.XvSv) {
1428
- var configItem = _this.XvSv[campaignId];
1429
- if (configItem && configItem.nWdU) {
1430
- return configItem.nWdU;
1550
+ if (_this.Nxlp) {
1551
+ var configItem = _this.Nxlp[campaignId];
1552
+ if (configItem && configItem.YTKa) {
1553
+ return configItem.YTKa;
1431
1554
  }
1432
1555
  }
1433
1556
  } catch (e) {
@@ -1443,42 +1566,42 @@
1443
1566
  var EventsListener = /*#__PURE__*/_createClass(function EventsListener() {
1444
1567
  var _this = this;
1445
1568
  _classCallCheck(this, EventsListener);
1446
- _defineProperty(this, "AZee", {});
1447
- _defineProperty(this, "GHrG", []);
1448
- _defineProperty(this, "HJfd", false);
1569
+ _defineProperty(this, "Cwvl", {});
1570
+ _defineProperty(this, "LCmY", []);
1571
+ _defineProperty(this, "TBZE", false);
1449
1572
  _defineProperty(this, "initialize", function () {
1450
1573
  var controller = Apxor.getController();
1451
1574
  controller.registerForEvent(APP_EVENT, function (event) {
1452
- return _this.gFEv(event, "AE");
1575
+ return _this.uTFw(event, "AE");
1453
1576
  });
1454
1577
  controller.registerForEvent(CLIENT_EVENT, function (event) {
1455
- return _this.gFEv(event, "CE");
1578
+ return _this.uTFw(event, "CE");
1456
1579
  });
1457
1580
  });
1458
- _defineProperty(this, "KqaR", function () {
1581
+ _defineProperty(this, "PseG", function () {
1459
1582
  // Clear Buffer
1460
- for (var item in _this.GHrG) {
1461
- _this.wTap(item.event, item.key, item.type);
1583
+ for (var item in _this.LCmY) {
1584
+ _this.AqCu(item.event, item.key, item.type);
1462
1585
  }
1463
- _this.HJfd = true;
1586
+ _this.TBZE = true;
1464
1587
  });
1465
- _defineProperty(this, "HaQv", function (event, callback) {
1588
+ _defineProperty(this, "OVFP", function (event, callback) {
1466
1589
  if (!isFunction(callback)) {
1467
1590
  return;
1468
1591
  }
1469
1592
  var listeners;
1470
- if (_this.AZee[event]) {
1471
- listeners = _this.AZee[event];
1593
+ if (_this.Cwvl[event]) {
1594
+ listeners = _this.Cwvl[event];
1472
1595
  } else {
1473
1596
  listeners = [];
1474
1597
  }
1475
1598
  listeners.push(callback);
1476
- _this.AZee[event] = listeners;
1477
- Logger$9.debug("Listeners list: ", _this.AZee);
1599
+ _this.Cwvl[event] = listeners;
1600
+ Logger$9.debug("Listeners list: ", _this.Cwvl);
1478
1601
  });
1479
1602
  _defineProperty(this, "unregisterFromEvent", function (event, callback) {
1480
- if (_this.AZee[event]) {
1481
- var listeners = _this.AZee[event];
1603
+ if (_this.Cwvl[event]) {
1604
+ var listeners = _this.Cwvl[event];
1482
1605
  var updatedListeners = [];
1483
1606
  for (var index = 0; index < listeners.length; index++) {
1484
1607
  var listener = listeners[index];
@@ -1486,25 +1609,25 @@
1486
1609
  updatedListeners.push(listener);
1487
1610
  }
1488
1611
  }
1489
- _this.AZee[event] = updatedListeners;
1612
+ _this.Cwvl[event] = updatedListeners;
1490
1613
  }
1491
1614
  });
1492
- _defineProperty(this, "gFEv", function (event) {
1615
+ _defineProperty(this, "uTFw", function (event) {
1493
1616
  var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "AE";
1494
1617
  var key = type + "___" + event.name;
1495
- _this.wTap(event, key, type);
1618
+ _this.AqCu(event, key, type);
1496
1619
  });
1497
- _defineProperty(this, "wTap", function (event, key, type) {
1498
- if (!_this.HJfd) {
1499
- _this.GHrG.push({
1620
+ _defineProperty(this, "AqCu", function (event, key, type) {
1621
+ if (!_this.TBZE) {
1622
+ _this.LCmY.push({
1500
1623
  event: event,
1501
1624
  key: key,
1502
1625
  type: type
1503
1626
  });
1504
1627
  } else {
1505
- Logger$9.debug("Notifying listeners for event: " + event + ", " + key, _this.AZee);
1506
- if (_this.AZee[key]) {
1507
- var listeners = _this.AZee[key];
1628
+ Logger$9.debug("Notifying listeners for event: " + event + ", " + key, _this.Cwvl);
1629
+ if (_this.Cwvl[key]) {
1630
+ var listeners = _this.Cwvl[key];
1508
1631
  var time = Apxor.getController().getSDKRunningTimeInSec();
1509
1632
  for (var index = 0; index < listeners.length; index++) {
1510
1633
  var listener = listeners[index];
@@ -1520,17 +1643,17 @@
1520
1643
  function CE() {
1521
1644
  var _this = this;
1522
1645
  _classCallCheck(this, CE);
1523
- _defineProperty(this, "RNCW", false);
1524
- _defineProperty(this, "vozs", null);
1525
- _defineProperty(this, "OpCt", getDateInDDMMYYYY());
1526
- _defineProperty(this, "HLag", new EventsListener());
1527
- _defineProperty(this, "mhlV", Apxor.getSiteId());
1646
+ _defineProperty(this, "jnoF", false);
1647
+ _defineProperty(this, "dXeZ", null);
1648
+ _defineProperty(this, "yqdw", getDateInDDMMYYYY());
1649
+ _defineProperty(this, "mBNE", new EventsListener());
1650
+ _defineProperty(this, "DtLZ", Apxor.getSiteId());
1528
1651
  _defineProperty(this, "_qeState", {});
1529
1652
  _defineProperty(this, "getQeState", function () {
1530
1653
  try {
1531
1654
  var data = Apxor.getController().getFromStorage(QE_STATE);
1532
1655
  if (data) {
1533
- return JSON.parse(decode(_this.mhlV, data));
1656
+ return JSON.parse(decode(_this.DtLZ, data));
1534
1657
  } else {
1535
1658
  _this._qeState = {};
1536
1659
  return _this.setQeState();
@@ -1559,10 +1682,10 @@
1559
1682
  return _this._qeState;
1560
1683
  });
1561
1684
  _defineProperty(this, "initialize", function () {
1562
- if (!_this.RNCW) {
1563
- _this.RNCW = true;
1564
- _this.vozs = new ConfigLookup();
1565
- _this.HLag.initialize();
1685
+ if (!_this.jnoF) {
1686
+ _this.jnoF = true;
1687
+ _this.dXeZ = new ConfigLookup();
1688
+ _this.mBNE.initialize();
1566
1689
  _this._qeState = _this.getQeState();
1567
1690
  Logger$a.info("QE Initialized..");
1568
1691
  }
@@ -1573,12 +1696,12 @@
1573
1696
  * @param config
1574
1697
  */
1575
1698
  _defineProperty(this, "parse", function (config) {
1576
- if (!_this.wVJP()) {
1699
+ if (!_this.JpIa()) {
1577
1700
  Logger$a.warn("Must call init first. Unable to proceed");
1578
1701
  return;
1579
1702
  }
1580
- _this.vozs.parse(config);
1581
- _this.HLag.KqaR();
1703
+ _this.dXeZ.parse(config);
1704
+ _this.mBNE.PseG();
1582
1705
  });
1583
1706
  /**
1584
1707
  * Validates all conditions for given config ID
@@ -1587,19 +1710,22 @@
1587
1710
  * @param index
1588
1711
  */
1589
1712
  _defineProperty(this, "validate", function (id, index) {
1590
- if (!_this.wVJP()) {
1713
+ if (!_this.JpIa()) {
1591
1714
  return;
1592
1715
  }
1593
- _this.vozs.validate(id, index);
1716
+ _this.dXeZ.validate(id, index);
1717
+ });
1718
+ _defineProperty(this, "getVariantCode", function (id) {
1719
+ return _this.dXeZ.getVariantCode(id);
1594
1720
  });
1595
1721
  _defineProperty(this, "validateForTermination", function (id, index) {
1596
- if (!_this.wVJP()) {
1722
+ if (!_this.JpIa()) {
1597
1723
  return;
1598
1724
  }
1599
- _this.vozs.validateForTermination(id, index);
1725
+ _this.dXeZ.validateForTermination(id, index);
1600
1726
  });
1601
1727
  _defineProperty(this, "validateForTerminationAttributes", function (user, session) {
1602
- return _this.vozs.validateForTerminationAttributes(user, session);
1728
+ return _this.dXeZ.validateForTerminationAttributes(user, session);
1603
1729
  });
1604
1730
  _defineProperty(this, "updateCount", function (id) {
1605
1731
  try {
@@ -1608,25 +1734,25 @@
1608
1734
  }
1609
1735
  _this.incrementFrequencies(id);
1610
1736
  _this.setQeState(id);
1611
- _this.vozs.ErGD(id);
1737
+ _this.dXeZ.aokP(id);
1612
1738
  } catch (e) {
1613
1739
  console.log("Could not update the count config:".concat(e));
1614
1740
  }
1615
1741
  });
1616
1742
  _defineProperty(this, "resetFrequencyCounts", function () {
1617
- _this.vozs.resetFrequencyCounts();
1743
+ _this.dXeZ.resetFrequencyCounts();
1618
1744
  });
1619
1745
  _defineProperty(this, "getFrequencyCount", function (id) {
1620
- return _this.vozs.getFrequencyCount(id);
1746
+ return _this.dXeZ.getFrequencyCount(id);
1621
1747
  });
1622
1748
  _defineProperty(this, "registerForEvent", function (event, callback) {
1623
- _this.HLag.HaQv(event, callback);
1749
+ _this.mBNE.OVFP(event, callback);
1624
1750
  });
1625
1751
  _defineProperty(this, "unregisterFromEvent", function (event, callback) {
1626
- _this.HLag.unregisterFromEvent(event, callback);
1752
+ _this.mBNE.unregisterFromEvent(event, callback);
1627
1753
  });
1628
1754
  _defineProperty(this, "notifyEventListener", function (event) {
1629
- _this.HLag.gFEv(event);
1755
+ _this.mBNE.uTFw(event);
1630
1756
  });
1631
1757
  /**
1632
1758
  * Fetches the config from Server
@@ -1639,14 +1765,14 @@
1639
1765
  _defineProperty(this, "fetch", function (type, validateUrl, apiUrl, callback) {
1640
1766
  Apxor.getController().fetchConfiguration(type, validateUrl, apiUrl, callback);
1641
1767
  });
1642
- _defineProperty(this, "wVJP", function () {
1643
- return _this.RNCW;
1768
+ _defineProperty(this, "JpIa", function () {
1769
+ return _this.jnoF;
1644
1770
  });
1645
1771
  _defineProperty(this, "getCampaignMetaFromQueryEngine", function (campaignId) {
1646
- return _this.vozs.Asov(campaignId);
1772
+ return _this.dXeZ.MRwp(campaignId);
1647
1773
  });
1648
- _defineProperty(this, "CmBi", function () {
1649
- return _this.OpCt;
1774
+ _defineProperty(this, "lXby", function () {
1775
+ return _this.yqdw;
1650
1776
  });
1651
1777
  if (!CE.instance) {
1652
1778
  CE.instance = this;
@@ -1670,7 +1796,7 @@
1670
1796
  OVERALL: 0,
1671
1797
  DATES: {}
1672
1798
  };
1673
- if (this.OpCt) this._qeState[id].DATES[this.OpCt] = 0;
1799
+ if (this.yqdw) this._qeState[id].DATES[this.yqdw] = 0;
1674
1800
  this.setQeState(id);
1675
1801
  }
1676
1802
  } catch (e) {
@@ -1689,12 +1815,12 @@
1689
1815
 
1690
1816
  // Increment the DATES count for this particular date by 1. If the date changes reset.
1691
1817
  var currentDate = getDateInDDMMYYYY();
1692
- if (currentDate !== this.OpCt || !(configFrequency.DATES && configFrequency.DATES[currentDate])) {
1693
- this.OpCt = currentDate;
1818
+ if (currentDate !== this.yqdw || !(configFrequency.DATES && configFrequency.DATES[currentDate])) {
1819
+ this.yqdw = currentDate;
1694
1820
  configFrequency.DATES = {};
1695
- configFrequency.DATES[this.OpCt] = 0;
1821
+ configFrequency.DATES[this.yqdw] = 0;
1696
1822
  }
1697
- configFrequency.DATES[this.OpCt] = configFrequency.DATES[this.OpCt] + 1;
1823
+ configFrequency.DATES[this.yqdw] = configFrequency.DATES[this.yqdw] + 1;
1698
1824
  }
1699
1825
  }], [{
1700
1826
  key: "getInstance",
@@ -1713,7 +1839,7 @@
1713
1839
 
1714
1840
  /* eslint-disable no-empty */
1715
1841
 
1716
- window.ceVersion = 142;
1842
+ window.ceVersion = 150;
1717
1843
  try {
1718
1844
  if (exports !== undefined || exports !== null) {
1719
1845
  exports["default"] = CE;