apxor-qe 1.4.1 → 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 zuMV = function zuMV(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, "upBe", "ALL");
268
- _defineProperty(this, "qHve", []);
269
- _defineProperty(this, "hfXD", []);
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.upBe = config.audience.audience_type;
274
- _this.qHve = config.audience.attributes.user;
275
- _this.hfXD = config.audience.attributes.session;
276
- if (!Array.isArray(_this.qHve) || !Array.isArray(_this.hfXD)) {
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.upBe === "FTU") {
290
+ if (_this.owVv === "FTU") {
289
291
  status = Apxor.getController().getSessionInfo().is_first_session;
290
292
  }
291
- return status && _this.AYgA(user, _this.qHve) && _this.AYgA(session, _this.hfXD);
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, "AYgA", 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 zuMV(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, "cyan", 0);
346
- _defineProperty(this, "xUCG", 0);
347
- _defineProperty(this, "TTrx", "SESSION");
348
- _defineProperty(this, "dBjB", 0);
349
- _defineProperty(this, "QeCL", 0);
350
- _defineProperty(this, "voNY", 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.cyan = config.frequency.count;
355
- if (_this.cyan === -1) {
356
- _this.cyan = 1000;
357
- }
358
- _this.voNY = _this.cyan;
359
- _this.xUCG = config.frequency.time_interval;
360
- _this.TTrx = config.frequency.validity;
361
- _this.QeCL = 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.TTrx === "SESSION") {
368
- _this.cyan = parseInt(_this.cyan) - parseInt(qe_state[config._id]["SESSION"]);
369
- if (_this.cyan <= 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.TTrx === "OVERALL") {
374
- _this.cyan = parseInt(_this.cyan) - parseInt(qe_state[config._id]["OVERALL"]);
375
- if (_this.cyan <= 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, "yGJs", function () {
390
- _this.cyan = _this.cyan - 1;
399
+ _defineProperty(this, "aokP", function () {
400
+ _this.YpuZ = _this.YpuZ - 1;
391
401
  });
392
402
  _defineProperty(this, "getFrequencyCount", function () {
393
- return _this.cyan;
403
+ return _this.YpuZ;
394
404
  });
395
- _defineProperty(this, "NSSU", function () {
396
- if (_this.TTrx === "SESSION") {
397
- _this.cyan = _this.voNY;
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 HBeu
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, "HBeu", function (id) {
418
+ _defineProperty(this, "XinH", function (id) {
409
419
  try {
410
- if (_this.cyan <= 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.QeCL !== 0) {
422
- var sessionCountInConfig = parseInt(_this.QeCL);
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, "dXou", "");
450
- _defineProperty(this, "upBe", "");
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.dXou = config.meta.name;
456
- _this.upBe = 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, "ZXIv", -1);
472
- _defineProperty(this, "PYEw", -1);
473
- _defineProperty(this, "gDYY", -1);
474
- _defineProperty(this, "JWWv", -1);
475
- _defineProperty(this, "WVbP", 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.ZXIv = Date.parse(config.validity.start_date);
484
- _this.PYEw = 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.WVbP = config.time_limits_in_day;
487
- if (_this.WVbP && 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.gDYY = Date.parse(currentDate + "T" + config.time_limits.start_time + ".000Z");
490
- _this.JWWv = 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.gDYY) || isNaN(_this.JWWv)) {
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.ZXIv && currentTime < _this.PYEw) {
508
- return !_this.WVbP || currentTime >= _this.gDYY && currentTime <= _this.JWWv;
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, "dXou", "");
518
- _defineProperty(this, "PjLw", {});
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.dXou = details.name;
523
- _this.PjLw = 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, "ubix", 0);
535
- _defineProperty(this, "xTww", 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.ubix = Number(timeBounds.lower);
540
- _this.xTww = Number(timeBounds.upper);
541
- if (isNaN(_this.ubix) || isNaN(_this.xTww)) {
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, "wLrd", 0);
555
- _defineProperty(this, "GwDz", "");
556
- _defineProperty(this, "HJIQ", "");
557
- _defineProperty(this, "LHnZ", new Details());
558
- _defineProperty(this, "pZbN", 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.GwDz = precondition.event_type;
563
- _this.HJIQ = precondition.activity;
564
- return _this.LHnZ.parse(precondition.details) && _this.pZbN.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, "wLrd", 0);
576
- _defineProperty(this, "BvTW", -1);
577
- _defineProperty(this, "cyan", 0);
578
- _defineProperty(this, "FdOF", "");
579
- _defineProperty(this, "HJIQ", "");
580
- _defineProperty(this, "GwDz", "");
581
- _defineProperty(this, "pZbN", new Timebounds());
582
- _defineProperty(this, "LHnZ", new Details());
583
- _defineProperty(this, "idDI", new PreCondition());
584
- _defineProperty(this, "Sdoc", "AND");
585
- _defineProperty(this, "LnGT", false);
586
- _defineProperty(this, "upBe", 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.BvTW = condition.sequence;
591
- _this.cyan = condition.count_config.count;
592
- _this.FdOF = condition.count_config.operator;
593
- _this.HJIQ = condition.activity;
594
- _this.GwDz = condition.event_type;
595
- _this.Sdoc = condition.combine_operator;
596
- _this.upBe = condition.type;
597
- return _this.LHnZ.parse(condition.details) && _this.idDI.parse(condition.trigger) && _this.pZbN.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, "cyan", 0);
610
- _defineProperty(this, "FdOF", "");
611
- _defineProperty(this, "GwDz", "");
612
- _defineProperty(this, "pZbN", new Timebounds());
613
- _defineProperty(this, "LHnZ", new Details());
614
- _defineProperty(this, "Sdoc", "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.cyan = data.count_config.count;
618
- _this.FdOF = data.count_config.operator;
619
- _this.GwDz = data.event_type;
620
- _this.Sdoc = data.combine_operator;
621
- return _this.LHnZ.parse(data.details) && _this.pZbN.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, "AFha", 0);
636
- _defineProperty(this, "xWwF", "");
637
- _defineProperty(this, "ZXgH", new Condition());
638
- _defineProperty(this, "AwpM", new GoalEvent());
639
- _defineProperty(this, "CTgi", false);
640
- _defineProperty(this, "dzHG", false);
641
- _defineProperty(this, "ewWl", 0);
642
- _defineProperty(this, "Sdoc", "AND");
643
- _defineProperty(this, "gzxI", "OR");
644
- _defineProperty(this, "Swao", -1);
645
- _defineProperty(this, "SKdF", []);
646
- _defineProperty(this, "ATJy", {});
647
- _defineProperty(this, "qFlV", 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-DGaq 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,180 +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.xWwF = id;
666
- _this.ewWl = index;
667
- _this.SKdF = noKpiArray;
682
+ _this.tTqB = id;
683
+ _this.nODh = index;
684
+ _this.rjRg = noKpiArray;
668
685
  if (flag !== "termination" || flag === "") {
669
- var result = _this.ZXgH.parse(condition);
686
+ var result = _this.Pwgu.parse(condition);
670
687
  if (result) {
671
- _this.Sdoc = _this.ZXgH.Sdoc;
688
+ _this.ndXU = _this.Pwgu.ndXU;
672
689
 
673
690
  // FIXME: Why this code is written? Don't see any usecase
674
- if (_this.ZXgH.LnGT) {
675
- var eventName = _this.ZXgH.LHnZ.dXou;
691
+ if (_this.Pwgu.cmkQ) {
692
+ var eventName = _this.Pwgu.KdUl.CTVX;
676
693
  if (eventName === "APX_PAGE_OPENED") {
677
- eventName = _this.ZXgH.LHnZ.PjLw["navigation_id"];
678
- eventName = isDefined(eventName) ? eventName : _this.ZXgH.LHnZ.dXou;
694
+ eventName = _this.Pwgu.KdUl.orON["navigation_id"];
695
+ eventName = isDefined(eventName) ? eventName : _this.Pwgu.KdUl.CTVX;
679
696
  }
680
- _this.Swao = Apxor.getController().getEventCount(eventName);
681
- var count = _this.ZXgH.cyan;
682
- var operator = _this.ZXgH.FdOF;
683
- _this.dzHG = _this.TfGM(_this.Swao - 1, count, operator, false);
684
- _this.CTgi = _this.dzHG;
685
- // If the condition is already satisfied and if it is page view, no need to DGaq
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.dzHG && _this.ZXgH.LHnZ.dXou === "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.DGaq();
709
+ _this.zSnG();
693
710
  }
694
711
  return true;
695
712
  }
696
713
  } else {
697
- var _result = _this.AwpM.parse(condition);
698
- _this.gzxI = _this.AwpM.Sdoc;
699
- _this.cvYj();
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, "DGaq", function () {
705
- var condition = _this.ZXgH;
706
- var precondition = condition.idDI;
721
+ _defineProperty(this, "zSnG", function () {
722
+ var _window$ApxorRTM;
723
+ var condition = _this.Pwgu;
724
+ var precondition = condition.rFlu;
707
725
  var ceInstance = CE.getInstance();
708
- if (precondition.GwDz === "app_start") {
709
- _this.CTgi = true;
710
- ceInstance.registerForEvent(generateKey(condition.GwDz) + "___" + condition.LHnZ.dXou, _this.ZNEJ);
726
+ if (precondition.KJQk === "app_start") {
727
+ _this.LpHt = true;
728
+ ceInstance.registerForEvent(generateKey(condition.KJQk) + "___" + condition.KdUl.CTVX, _this.hjRG);
711
729
  } else {
712
- ceInstance.registerForEvent(generateKey(condition.GwDz) + "___" + precondition.LHnZ.dXou, _this.ZNEJ);
730
+ ceInstance.registerForEvent(generateKey(condition.KJQk) + "___" + precondition.KdUl.CTVX, _this.hjRG);
731
+ }
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);
713
734
  }
714
735
  });
715
- _defineProperty(this, "cvYj", function () {
716
- var condition = _this.AwpM;
736
+ _defineProperty(this, "vfXG", function () {
737
+ var condition = _this.PACz;
717
738
  var ceInstance = CE.getInstance();
718
- _this.CTgi = true;
719
- ceInstance.registerForEvent(generateKey(condition.GwDz) + "___" + condition.LHnZ.dXou, _this.YBSM);
739
+ _this.LpHt = true;
740
+ ceInstance.registerForEvent(generateKey(condition.KJQk) + "___" + condition.KdUl.CTVX, _this.oueL);
720
741
  });
721
- _defineProperty(this, "Ijls", function (type, name, time, additionalInfo) {
722
- var _this$ZXgH;
742
+ _defineProperty(this, "RlTL", function (type, name, time, additionalInfo) {
743
+ var _this$Pwgu;
723
744
  var eventTime = Date.now();
724
- var time_differnce = (eventTime - _this.ATJy[name]) / 1000;
725
- var time_fromConfig = ((_this$ZXgH = _this.ZXgH) === null || _this$ZXgH === void 0 || (_this$ZXgH = _this$ZXgH.LHnZ) === null || _this$ZXgH === void 0 || (_this$ZXgH = _this$ZXgH.PjLw) === null || _this$ZXgH === void 0 ? void 0 : _this$ZXgH.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;
726
747
  if (time_fromConfig > time_differnce) {
727
748
  _this._displayCampaign(time);
728
749
  }
729
750
  });
730
- _defineProperty(this, "MKnM", function (type, name, time, additionalInfo) {
751
+ _defineProperty(this, "lwFR", function (type, name, time, additionalInfo) {
731
752
  var _this$_condition2, _this$_condition3;
732
- _this.qFlV = true;
753
+ _this.WFwv = true;
733
754
  var currentTime = Date.now();
734
- var eventName = (_this$_condition2 = _this.ZXgH) === null || _this$_condition2 === void 0 || (_this$_condition2 = _this$_condition2.idDI) === null || _this$_condition2 === void 0 ? void 0 : _this$_condition2.LHnZ.dXou;
735
- var eventTime = _this.ATJy[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];
736
757
  var time_differnce = (currentTime - eventTime) / 1000;
737
- var time_fromConfig = (_this$_condition3 = _this.ZXgH) === null || _this$_condition3 === void 0 || (_this$_condition3 = _this$_condition3.LHnZ) === null || _this$_condition3 === void 0 || (_this$_condition3 = _this$_condition3.PjLw) === 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;
738
759
  time_fromConfig = time_fromConfig / 1000;
739
760
  if (time_fromConfig > time_differnce) {
740
761
  _this._displayCampaign(time);
741
762
  }
742
763
  //unregister the event
743
764
  });
744
- _defineProperty(this, "ZNEJ", function (type, name, time, additionalInfo) {
765
+ _defineProperty(this, "hjRG", function (type, name, time, additionalInfo) {
766
+ var _window$ApxorRTM2, _window$ApxorRTM3;
745
767
  var ceInstance = CE.getInstance();
746
- if (!_this.CTgi) {
768
+ if (!_this.LpHt) {
747
769
  // Validate Precondition
748
- _this.CTgi = _this.cAeN(type, name, time, additionalInfo);
749
- if (_this.CTgi) {
750
- var condition = _this.ZXgH;
751
- var precondition = condition.idDI;
752
- precondition.wLrd = 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;
753
775
  //events will be registred by its type activity event_type: "activity_time"
754
- if ((condition === null || condition === void 0 ? void 0 : condition.GwDz) === "activity_time") {
755
- var ZXgH$LHnZ, ZXgH$_details2, ZXgH$_details3;
756
- var event_time = condition === null || condition === void 0 || (ZXgH$LHnZ = condition.LHnZ) === null || ZXgH$LHnZ === void 0 || (ZXgH$LHnZ = ZXgH$LHnZ.PjLw) === null || ZXgH$LHnZ === void 0 ? void 0 : ZXgH$LHnZ.time;
757
- if ((condition === null || condition === void 0 || (ZXgH$_details2 = condition.LHnZ) === null || ZXgH$_details2 === void 0 || (ZXgH$_details2 = ZXgH$_details2.PjLw) === null || ZXgH$_details2 === void 0 ? void 0 : ZXgH$_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) {
758
780
  setTimeout(function () {
759
- if (!_this.qFlV) {
760
- _this.dzHG = true;
761
- if (_this.dzHG) {
762
- _this.AFha += 1;
763
- _this.dzHG = _this.TfGM(_this.AFha, _this.ZXgH.cyan, _this.ZXgH.FdOF);
764
- if (_this.dzHG) {
765
- _this.ZXgH.wLrd = time;
766
- ceInstance.validate(_this.xWwF, _this.ewWl);
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);
767
789
  }
768
790
  }
769
791
  }
770
- condition.LHnZ.PjLw.nkpi.map(function (nokpi) {
771
- ceInstance.unregisterFromEvent(toUpperCase(condition.LHnZ.PjLw.et) + "___" + nokpi, _this);
792
+ condition.KdUl.orON.nkpi.map(function (nokpi) {
793
+ ceInstance.unregisterFromEvent(toUpperCase(condition.KdUl.orON.et) + "___" + nokpi, _this);
772
794
  });
773
795
  }, event_time);
774
- condition.LHnZ.PjLw.nkpi.map(function (nokpi) {
775
- ceInstance.registerForEvent(toUpperCase(condition.LHnZ.PjLw.et) + "___" + nokpi, _this.MKnM);
796
+ condition.KdUl.orON.nkpi.map(function (nokpi) {
797
+ ceInstance.registerForEvent(toUpperCase(condition.KdUl.orON.et) + "___" + nokpi, _this.lwFR);
776
798
  });
777
799
  }
778
800
  //it is for unregistering the events did case after completing the time imit
779
- if ((condition === null || condition === void 0 || (ZXgH$_details3 = condition.LHnZ) === null || ZXgH$_details3 === void 0 || (ZXgH$_details3 = ZXgH$_details3.PjLw) === null || ZXgH$_details3 === void 0 ? void 0 : ZXgH$_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) {
780
802
  setTimeout(function () {
781
- condition.LHnZ.PjLw.kpi.map(function (kpi) {
782
- ceInstance.unregisterFromEvent(toUpperCase(condition.LHnZ.PjLw.et) + "___" + kpi, _this);
803
+ condition.KdUl.orON.kpi.map(function (kpi) {
804
+ ceInstance.unregisterFromEvent(toUpperCase(condition.KdUl.orON.et) + "___" + kpi, _this);
783
805
  });
784
806
  }, event_time);
785
- condition.LHnZ.PjLw.kpi.map(function (kpi) {
786
- if (kpi === condition.idDI.LHnZ.dXou) {
807
+ condition.KdUl.orON.kpi.map(function (kpi) {
808
+ if (kpi === condition.rFlu.KdUl.CTVX) {
787
809
  //unregister the previous event
788
- ceInstance.unregisterFromEvent(generateKey(precondition.GwDz) + "___" + precondition.LHnZ.dXou, _this);
789
- ceInstance.registerForEvent(toUpperCase(condition.LHnZ.PjLw.et) + "___" + kpi, _this.Ijls);
810
+ ceInstance.unregisterFromEvent(generateKey(precondition.KJQk) + "___" + precondition.KdUl.CTVX, _this);
811
+ ceInstance.registerForEvent(toUpperCase(condition.KdUl.orON.et) + "___" + kpi, _this.RlTL);
790
812
  } else {
791
- ceInstance.registerForEvent(toUpperCase(condition.LHnZ.PjLw.et) + "___" + kpi, _this.MKnM);
813
+ ceInstance.registerForEvent(toUpperCase(condition.KdUl.orON.et) + "___" + kpi, _this.lwFR);
792
814
  }
793
815
  });
794
816
  }
795
817
  } else {
796
- ceInstance.unregisterFromEvent(generateKey(precondition.GwDz) + "___" + precondition.LHnZ.dXou, _this);
797
- ceInstance.registerForEvent(generateKey(condition.GwDz) + "___" + condition.LHnZ.dXou, _this);
818
+ ceInstance.unregisterFromEvent(generateKey(precondition.KJQk) + "___" + precondition.KdUl.CTVX, _this);
819
+ ceInstance.registerForEvent(generateKey(condition.KJQk) + "___" + condition.KdUl.CTVX, _this);
798
820
  }
799
- _this.ATJy[name] = Date.now();
821
+ _this.vBOh[name] = Date.now();
800
822
  }
801
823
  return;
802
824
  }
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);
829
+ return;
830
+ }
803
831
 
804
832
  // Validate Condition
805
- var validationStatus = generateKey(_this.ZXgH.GwDz) === type && _this.gVIC(time - _this.ZXgH.idDI.wLrd, _this.ZXgH.pZbN) && _this.ZXgH.LHnZ.dXou === name && _this.XxaE(_this.ZXgH.LHnZ.PjLw, 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);
806
834
  if (validationStatus) {
807
- _this.AFha += 1;
808
- _this.dzHG = _this.TfGM(_this.AFha, _this.ZXgH.cyan, _this.ZXgH.FdOF);
809
- if (_this.dzHG) {
810
- _this.ZXgH.wLrd = time;
811
- ceInstance.validate(_this.xWwF, _this.ewWl);
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);
812
840
  }
813
841
  }
814
842
  });
815
- _defineProperty(this, "YBSM", function (type, name, time, additionalInfo) {
843
+ _defineProperty(this, "oueL", function (type, name, time, additionalInfo) {
816
844
  var ceInstance = CE.getInstance();
817
- var validationStatus = generateKey(_this.AwpM.GwDz) === type && _this.gVIC(time, _this.AwpM.pZbN) && _this.AwpM.LHnZ.dXou === name && _this.XxaE(_this.AwpM.LHnZ.PjLw, 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);
818
846
  if (validationStatus) {
819
- _this.AFha += 1;
820
- _this.dzHG = _this.TfGM(_this.AFha, _this.AwpM.cyan, _this.AwpM.FdOF);
821
- if (_this.dzHG) {
822
- _this.AwpM.wLrd = time;
823
- ceInstance.validateForTermination(_this.xWwF, _this.ewWl);
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);
824
852
  }
825
853
  }
826
854
  });
827
- _defineProperty(this, "cAeN", function (type, name, time, additionalInfo) {
828
- var precondition = _this.ZXgH.idDI;
829
- return generateKey(precondition.GwDz) === type && precondition.LHnZ.dXou === name && _this.gVIC(time, precondition.pZbN) && _this.XxaE(precondition.LHnZ.PjLw, 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);
830
858
  });
831
- _defineProperty(this, "gVIC", function (time, timeBounds) {
859
+ _defineProperty(this, "CFTa", function (time, timeBounds) {
832
860
  var currentTime = Math.ceil(time);
833
- return currentTime > timeBounds.ubix && currentTime < timeBounds.xTww;
861
+ return currentTime > timeBounds.oxbV && currentTime < timeBounds.QyjH;
834
862
  });
835
- _defineProperty(this, "TfGM", function (current, required, operator) {
863
+ _defineProperty(this, "tKdV", function (current, required, operator) {
836
864
  var checkOld = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
837
- if (checkOld && _this.ZXgH.LnGT) {
838
- current = current + _this.Swao;
865
+ if (checkOld && _this.Pwgu.cmkQ) {
866
+ current = current + _this.BNbu;
839
867
  }
840
868
  switch (operator) {
841
869
  case "EQ":
@@ -852,7 +880,7 @@
852
880
  return false;
853
881
  }
854
882
  });
855
- _defineProperty(this, "XxaE", function (expected, received) {
883
+ _defineProperty(this, "iGQO", function (expected, received) {
856
884
  var status = true;
857
885
  try {
858
886
  var _loop = function _loop() {
@@ -877,11 +905,11 @@
877
905
  loggedValues = [received[item]];
878
906
  }
879
907
  var match = loggedValues.some(function (loggedValue) {
880
- return zuMV(loggedValue, expectedValue, operator);
908
+ return cJes(loggedValue, expectedValue, operator);
881
909
  });
882
910
  status = status && match;
883
911
  } else {
884
- status = status && zuMV(received[item], expected[item], "EQ");
912
+ status = status && cJes(received[item], expected[item], "EQ");
885
913
  }
886
914
  },
887
915
  _ret;
@@ -900,13 +928,13 @@
900
928
  key: "_displayCampaign",
901
929
  value: function _displayCampaign(time) {
902
930
  var ceInstance = CE.getInstance();
903
- this.dzHG = true;
904
- if (this.dzHG) {
905
- this.AFha += 1;
906
- this.dzHG = this.TfGM(this.AFha, this.ZXgH.cyan, this.ZXgH.FdOF);
907
- if (this.dzHG) {
908
- this.ZXgH.wLrd = time;
909
- ceInstance.validate(this.xWwF, this.ewWl);
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);
910
938
  }
911
939
  }
912
940
  }
@@ -918,25 +946,29 @@
918
946
  var APX_RETAINED_SESSIONS = "apx_retained_session";
919
947
  var APX_RETAINED_DAYS = "apx_retained_days";
920
948
  var APX_CONTEXT_EVALUATED = "apx_context_evaluated";
949
+ var APX_VARIANT_CODE = "apx_variant_code";
921
950
 
922
951
  var Logger$6 = window.ApxorLogger;
923
952
  var OverallConfig = /*#__PURE__*/_createClass(function OverallConfig() {
924
953
  var _this = this;
925
954
  _classCallCheck(this, OverallConfig);
926
- _defineProperty(this, "PuiS", []);
955
+ _defineProperty(this, "OuRa", []);
927
956
  _defineProperty(this, "_ret_day", {});
928
- _defineProperty(this, "KMnE", {});
929
- _defineProperty(this, "TIdq", false);
930
- _defineProperty(this, "BItf", 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
931
964
  _defineProperty(this, "parse", function () {
932
965
  var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
933
966
  try {
934
- _this.PuiS = config.overall_cfg.events;
967
+ _this.OuRa = config.overall_cfg.events;
935
968
  _this._ret_day = config.overall_cfg.ret_day;
936
- _this.KMnE = config.overall_cfg.session;
937
- _this.TIdq = config.overall_cfg.toggleRetDay;
938
- _this.PuiS = config.overall_cfg.events;
939
- _this.BItf = 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;
940
972
  } catch (error) {
941
973
  Logger$6.error(error);
942
974
  return false;
@@ -946,10 +978,12 @@
946
978
  _defineProperty(this, "validate", function () {
947
979
  var retainedDays = parseInt(Apxor.getController().getFromStorage(APX_RETAINED_DAYS));
948
980
  var retainedSession = parseInt(Apxor.getController().getFromStorage(APX_RETAINED_SESSIONS));
949
- if (_this.TIdq && !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;
950
983
  return false;
951
984
  }
952
- if (_this.BItf && !isNaN(retainedSession) && !(retainedSession >= _this.KMnE.from && retainedSession <= _this.KMnE.to)) {
985
+ if (_this.rpSj && !isNaN(retainedSession) && !(retainedSession >= _this.ErWu.from && retainedSession <= _this.ErWu.to)) {
986
+ _this.retainedSessionValidated = false;
953
987
  return false;
954
988
  }
955
989
  try {
@@ -957,9 +991,10 @@
957
991
  var data = Apxor.getController().getFromStorage("_apx_lt_count");
958
992
  var siteid = Apxor.getSiteId();
959
993
  var LtCountObjDecoded = JSON.parse(new TextDecoder().decode(stringToArrayBuffer(decode(siteid, data))));
960
- for (var i = 0; i < _this.PuiS.length; i++) {
961
- var evName = _this.PuiS[i].name.replace("'", "").replace("’", "");
994
+ for (var i = 0; i < _this.OuRa.length; i++) {
995
+ var evName = _this.OuRa[i].name.replace("'", "").replace("’", "");
962
996
  if (LtCountObjDecoded[evName]) {
997
+ _this.eventDoneInLT = true;
963
998
  return false;
964
999
  }
965
1000
  }
@@ -974,14 +1009,14 @@
974
1009
  var Attributes = /*#__PURE__*/_createClass(function Attributes() {
975
1010
  var _this = this;
976
1011
  _classCallCheck(this, Attributes);
977
- _defineProperty(this, "qHve", []);
978
- _defineProperty(this, "hfXD", []);
1012
+ _defineProperty(this, "ZfAX", []);
1013
+ _defineProperty(this, "kLZG", []);
979
1014
  _defineProperty(this, "parse", function () {
980
1015
  var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
981
1016
  try {
982
- _this.qHve = config.attributes.user;
983
- _this.hfXD = config.attributes.session;
984
- if (!Array.isArray(_this.qHve) || !Array.isArray(_this.hfXD)) {
1017
+ _this.ZfAX = config.attributes.user;
1018
+ _this.kLZG = config.attributes.session;
1019
+ if (!Array.isArray(_this.ZfAX) || !Array.isArray(_this.kLZG)) {
985
1020
  Logger$7.error("No attributes");
986
1021
  return false;
987
1022
  }
@@ -992,9 +1027,9 @@
992
1027
  return true;
993
1028
  });
994
1029
  _defineProperty(this, "validate", function (user, session) {
995
- return _this.AYgA(user, _this.qHve) && _this.AYgA(session, _this.hfXD);
1030
+ return _this.KPjz(user, _this.ZfAX) && _this.KPjz(session, _this.kLZG);
996
1031
  });
997
- _defineProperty(this, "AYgA", function (attributes, expected) {
1032
+ _defineProperty(this, "KPjz", function (attributes, expected) {
998
1033
  var length = expected.length;
999
1034
  var status = true;
1000
1035
  try {
@@ -1024,7 +1059,7 @@
1024
1059
  }
1025
1060
  var match = loggedValues.some(function (loggedValue) {
1026
1061
  return values.some(function (configValue) {
1027
- return zuMV(loggedValue, configValue, operator);
1062
+ return cJes(loggedValue, configValue, operator);
1028
1063
  });
1029
1064
  });
1030
1065
  status = status && match;
@@ -1048,18 +1083,18 @@
1048
1083
  var TimeBasedTermination = /*#__PURE__*/_createClass(function TimeBasedTermination() {
1049
1084
  var _this = this;
1050
1085
  _classCallCheck(this, TimeBasedTermination);
1051
- _defineProperty(this, "mmqX", Apxor.getController());
1086
+ _defineProperty(this, "FOrk", Apxor.getController());
1052
1087
  _defineProperty(this, "type", "");
1053
1088
  _defineProperty(this, "_duration_seconds", 0);
1054
- _defineProperty(this, "ebrV", 1);
1089
+ _defineProperty(this, "qKfs", 1);
1055
1090
  _defineProperty(this, "parse", function (config) {
1056
1091
  try {
1057
1092
  var _config$terminate_inf, _config$terminate_inf2, _config$terminate_inf3;
1058
- _this.upBe = (_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;
1059
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;
1060
- _this.ebrV = (_config$terminate_inf3 = config.terminate_info.time_based) === null || _config$terminate_inf3 === void 0 ? void 0 : _config$terminate_inf3.days;
1061
- if (_this.zuMV(config._id)) {
1062
- _this.mmqX.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);
1063
1098
  return false;
1064
1099
  }
1065
1100
  } catch (_unused) {
@@ -1067,16 +1102,16 @@
1067
1102
  }
1068
1103
  return true;
1069
1104
  });
1070
- _defineProperty(this, "zuMV", function (id) {
1105
+ _defineProperty(this, "cJes", function (id) {
1071
1106
  var _Data$id;
1072
- var Data = JSON.parse(_this.mmqX.getFromStorage(APX_TERMINATION_ID));
1107
+ var Data = JSON.parse(_this.FOrk.getFromStorage(APX_TERMINATION_ID));
1073
1108
  if (!Data[id] || !((_Data$id = Data[id]) !== null && _Data$id !== void 0 && _Data$id.startDate)) return false;
1074
1109
  var startDate = new Date(Data[id].startDate);
1075
1110
  var presentDate = new Date(getDateInMMDDYYYY());
1076
1111
  var diff = parseInt((presentDate - startDate) / (1000 * 60 * 60 * 24), 10);
1077
1112
  var currentTime = _getTime();
1078
- var gDYY = Data[id].gDYY;
1079
- return diff === _this.ebrV && currentTime.hours >= gDYY.hours || diff > _this.ebrV || Data[id].goalAcheived;
1113
+ var ysVa = Data[id].ysVa;
1114
+ return diff === _this.qKfs && currentTime.hours >= ysVa.hours || diff > _this.qKfs || Data[id].goalAcheived;
1080
1115
  });
1081
1116
  });
1082
1117
 
@@ -1085,19 +1120,19 @@
1085
1120
  _classCallCheck(this, TerminationInfo);
1086
1121
  _defineProperty(this, "enable_goal_events", false);
1087
1122
  _defineProperty(this, "attributes", {});
1088
- _defineProperty(this, "KDkd", new Attributes());
1089
- _defineProperty(this, "uNVj", new TimeBasedTermination());
1123
+ _defineProperty(this, "NYIx", new Attributes());
1124
+ _defineProperty(this, "yGMZ", new TimeBasedTermination());
1090
1125
  _defineProperty(this, "parse", function () {
1091
1126
  var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1092
1127
  try {
1093
1128
  var _config$terminate_inf, _config$terminate_inf2, _config$terminate_inf3;
1094
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;
1095
- if (_this.enable_time_based && !_this.uNVj.parse(config)) {
1130
+ if (_this.enable_time_based && !_this.yGMZ.parse(config)) {
1096
1131
  return false;
1097
1132
  }
1098
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;
1099
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;
1100
- if (_this.enable_attributes && !_this.KDkd.parse(config.terminate_info)) {
1135
+ if (_this.enable_attributes && !_this.NYIx.parse(config.terminate_info)) {
1101
1136
  return false;
1102
1137
  }
1103
1138
  } catch (error) {
@@ -1107,7 +1142,7 @@
1107
1142
  return true;
1108
1143
  });
1109
1144
  _defineProperty(this, "validate", function (user, session) {
1110
- return _this.KDkd.validate(user, session);
1145
+ return _this.NYIx.validate(user, session);
1111
1146
  });
1112
1147
  });
1113
1148
 
@@ -1115,20 +1150,22 @@
1115
1150
  var ConfigItem = /*#__PURE__*/_createClass(function ConfigItem() {
1116
1151
  var _this = this;
1117
1152
  _classCallCheck(this, ConfigItem);
1118
- _defineProperty(this, "hmOw", []);
1119
- _defineProperty(this, "mlaS", []);
1120
- _defineProperty(this, "xWwF", "");
1121
- _defineProperty(this, "axSA", new Meta());
1122
- _defineProperty(this, "oypC", new Audience());
1123
- _defineProperty(this, "TTrx", new Validity());
1124
- _defineProperty(this, "ihSD", new Frequency());
1125
- _defineProperty(this, "KUHf", new OverallConfig());
1126
- _defineProperty(this, "qNqv", new TerminationInfo());
1127
- _defineProperty(this, "AKqc", false);
1128
- _defineProperty(this, "NIKc", []);
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", "");
1129
1165
  _defineProperty(this, "parse", function () {
1130
1166
  var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1131
1167
  try {
1168
+ var _this$YTKa$_attr;
1132
1169
  // If ID is not present, throw it out
1133
1170
  if (!isDefined(config._id)) {
1134
1171
  Logger$8.error("No Id");
@@ -1142,18 +1179,18 @@
1142
1179
  }
1143
1180
 
1144
1181
  // If META, VALIDITY, FREQUENCY and AUDIENCE is not parsed properly, throw it out
1145
- if (!(_this.axSA.parse(config) && _this.TTrx.parse(config) && _this.ihSD.parse(config) && _this.oypC.parse(config) && _this.KUHf.parse(config) && _this.qNqv.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))) {
1146
1183
  return false;
1147
1184
  }
1148
-
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";
1149
1186
  // If there are no conditions, throw it out
1150
1187
  if (!isDefined(config.conditions) || !Array.isArray(config.conditions)) {
1151
1188
  Logger$8.error("No valid conditions", config.conditions);
1152
1189
  return false;
1153
1190
  }
1154
- _this.xWwF = config._id;
1155
- _this.AKqc = isDefined(config.sequence_enabled) ? config.sequence_enabled : false;
1156
- if (_this.AKqc) {
1191
+ _this.tTqB = config._id;
1192
+ _this.scuX = isDefined(config.sequence_enabled) ? config.sequence_enabled : false;
1193
+ if (_this.scuX) {
1157
1194
  // iff respectSequence is true, Sort the Conditions by their sequence order
1158
1195
  // We need to sort, if server sends them in orderless manner
1159
1196
  config.conditions.sort(function (prev, current) {
@@ -1165,17 +1202,17 @@
1165
1202
  var conditions = config.conditions;
1166
1203
  var length = conditions.length;
1167
1204
  for (var index = 0; index < length; index++) {
1168
- _this.NIKc = [];
1205
+ _this.KHpv = [];
1169
1206
  var condition = conditions[index];
1170
1207
  if (condition.type === "didn't") {
1171
- var ZXgH$details;
1208
+ var Pwgu$details;
1172
1209
  var obj = {
1173
1210
  trigger_key: condition.trigger.details.name,
1174
- no_kpi_array: condition === null || condition === void 0 || (ZXgH$details = condition.details) === null || ZXgH$details === void 0 || (ZXgH$details = ZXgH$details.additional_info) === null || ZXgH$details === void 0 ? void 0 : ZXgH$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,
1175
1212
  condition_id: condition === null || condition === void 0 ? void 0 : condition._id,
1176
1213
  time_bounds: condition.time_bounds.upper
1177
1214
  };
1178
- _this.NIKc = [].concat(_toConsumableArray(_this.NIKc), [obj]);
1215
+ _this.KHpv = [].concat(_toConsumableArray(_this.KHpv), [obj]);
1179
1216
  //this will be the key
1180
1217
  //when event occur check this array and then then check the time
1181
1218
  //check the time diffrence
@@ -1184,73 +1221,143 @@
1184
1221
  }
1185
1222
 
1186
1223
  var conditionValidator = new ConditionValidator();
1187
- if (conditionValidator.initialize(condition, _this.xWwF, index, _this.AKqc, _this.NIKc)) {
1188
- _this.hmOw.push(conditionValidator);
1224
+ if (conditionValidator.initialize(condition, _this.tTqB, index, _this.scuX, _this.KHpv)) {
1225
+ _this.Qyfu.push(conditionValidator);
1189
1226
  }
1190
1227
  }
1191
- if (_this.qNqv.enable_goal_events) {
1228
+ if (_this.OyjG.enable_goal_events) {
1192
1229
  var goal_events = config.terminate_info.goal_events.events;
1193
1230
  var goaleventslength = goal_events.length;
1194
1231
  for (var i = 0; i < goaleventslength; i++) {
1195
1232
  var _conditionValidator = new ConditionValidator();
1196
- if (_conditionValidator.initialize(goal_events[i], _this.xWwF, i, true, [], "termination")) {
1197
- _this.mlaS.push(_conditionValidator);
1233
+ if (_conditionValidator.initialize(goal_events[i], _this.tTqB, i, true, [], "termination")) {
1234
+ _this.BCZU.push(_conditionValidator);
1198
1235
  }
1199
1236
  }
1200
1237
  }
1201
- return _this.hmOw.length > 0;
1238
+ return _this.Qyfu.length > 0;
1202
1239
  } catch (error) {
1203
1240
  Logger$8.error(error);
1204
1241
  return false;
1205
1242
  }
1206
1243
  });
1207
- _defineProperty(this, "SslG", function (index) {
1244
+ _defineProperty(this, "jKQM", function (index) {
1208
1245
  if (index < 0) {
1209
1246
  return;
1210
1247
  }
1211
- if (_this.AKqc) {
1212
- var conditionValidator = _this.hmOw[index];
1213
- if (isDefined(conditionValidator) && conditionValidator.dzHG) {
1248
+ if (_this.scuX) {
1249
+ var conditionValidator = _this.Qyfu[index];
1250
+ if (isDefined(conditionValidator) && conditionValidator.HLiN) {
1214
1251
  // Check if previous validator is satisfied
1215
- var prevValidator = _this.hmOw[index - 1];
1216
- if (isDefined(prevValidator) && !prevValidator.dzHG) {
1252
+ var prevValidator = _this.Qyfu[index - 1];
1253
+ if (isDefined(prevValidator) && !prevValidator.HLiN) {
1217
1254
  // TODO: If current index is satisfied before previous one, do something
1218
1255
  // either unregister all conditions or remove this item from ConfigLookup
1219
1256
  return;
1220
1257
  }
1221
- var nextValidator = _this.hmOw[index + 1];
1258
+ var nextValidator = _this.Qyfu[index + 1];
1222
1259
  if (!isDefined(nextValidator)) {
1223
1260
  // It means this is the last condition
1224
1261
  // Validate all conditions
1225
- _this.wUEZ();
1262
+ _this.zWDC();
1226
1263
  } else {
1227
- nextValidator.DGaq();
1264
+ nextValidator.zSnG();
1228
1265
  }
1229
1266
  }
1230
1267
  } else {
1231
1268
  // Validate all conditions
1232
- _this.wUEZ();
1269
+ _this.zWDC();
1233
1270
  }
1234
1271
  });
1235
- _defineProperty(this, "uDmd", function (index) {
1272
+ _defineProperty(this, "VcYO", function (index) {
1236
1273
  if (index < 0) {
1237
1274
  return;
1238
1275
  }
1239
- _this.Fkcf();
1276
+ _this.srDl();
1240
1277
  });
1241
- _defineProperty(this, "wUEZ", function () {
1278
+ _defineProperty(this, "zWDC", function () {
1242
1279
  // Check If Audience, Validity is satisfied or not
1243
1280
  var userAttributes = Apxor.getController().getUserAttributes();
1244
1281
  var sessionAttributes = Apxor.getController().getSessionAttributes();
1245
- if (!_this.TTrx.validate() || !_this.oypC.validate(userAttributes, sessionAttributes) || !_this.KUHf.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
+ }
1246
1353
  return;
1247
1354
  }
1248
- var length = _this.hmOw.length;
1355
+ var length = _this.Qyfu.length;
1249
1356
  var isSatisfied = length < 1;
1250
1357
  var combineOperator = "";
1251
1358
  for (var index = 0; index < length; index++) {
1252
- var validator = _this.hmOw[index];
1253
- var currentResult = validator.dzHG;
1359
+ var validator = _this.Qyfu[index];
1360
+ var currentResult = validator.HLiN;
1254
1361
  if (combineOperator.trim() === "") {
1255
1362
  isSatisfied = currentResult;
1256
1363
  } else {
@@ -1263,39 +1370,59 @@
1263
1370
  break;
1264
1371
  }
1265
1372
  }
1266
- combineOperator = validator.Sdoc;
1373
+ combineOperator = validator.ndXU;
1267
1374
  }
1268
1375
  if (isSatisfied) {
1376
+ var _window$ApxorRTM, _window$ApxorRTM2;
1269
1377
  console.debug("onCondition satisfied");
1270
1378
  // Check if count reached it's maximum
1271
- if (!_this.ihSD.HBeu(_this.xWwF)) {
1272
- console.warn("Maximum limit reached", _this.xWwF);
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
+ });
1273
1390
  return;
1274
1391
  }
1275
- console.log("Dispatching event", _this.axSA.upBe);
1276
- if (_this.axSA._only_context === true) {
1277
- Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.axSA._attr), {}, {
1278
- message_name: _this.axSA.dXou,
1279
- id: _this.xWwF
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
1280
1407
  }));
1281
1408
  }
1282
1409
  // Emit event
1283
- Apxor.getController().dispatchEvent(_this.axSA.upBe, {
1284
- name: _this.axSA.upBe,
1410
+ Apxor.getController().dispatchEvent(_this.YTKa.owVv, {
1411
+ name: _this.YTKa.owVv,
1285
1412
  additional_info: {
1286
- uuid: _this.xWwF,
1287
- name: _this.axSA.dXou
1413
+ uuid: _this.tTqB,
1414
+ name: _this.YTKa.CTVX
1288
1415
  }
1289
1416
  });
1290
1417
  }
1291
1418
  });
1292
- _defineProperty(this, "Fkcf", function () {
1293
- var length = _this.mlaS.length;
1419
+ _defineProperty(this, "srDl", function () {
1420
+ var length = _this.BCZU.length;
1294
1421
  var isSatisfied = length < 1;
1295
1422
  var combineOperator = "";
1296
1423
  for (var index = 0; index < length; index++) {
1297
- var validator = _this.mlaS[index];
1298
- var currentResult = validator.dzHG;
1424
+ var validator = _this.BCZU[index];
1425
+ var currentResult = validator.HLiN;
1299
1426
  if (combineOperator.trim() === "") {
1300
1427
  isSatisfied = currentResult;
1301
1428
  } else {
@@ -1308,23 +1435,23 @@
1308
1435
  break;
1309
1436
  }
1310
1437
  }
1311
- combineOperator = validator.gzxI;
1438
+ combineOperator = validator.Pxjw;
1312
1439
  }
1313
1440
  if (isSatisfied) {
1314
- console.log("Dispatching event", _this.axSA.upBe);
1315
- Apxor.getController().persistTerminationInfoLocally(_this.xWwF);
1316
- if (_this.axSA._only_context === true) {
1317
- Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.axSA._attr), {}, {
1318
- message_name: _this.axSA.dXou,
1319
- id: _this.xWwF
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
1320
1447
  }));
1321
1448
  }
1322
1449
  // Emit event
1323
- Apxor.getController().dispatchEvent(_this.axSA.upBe, {
1324
- name: _this.axSA.upBe,
1450
+ Apxor.getController().dispatchEvent(_this.YTKa.owVv, {
1451
+ name: _this.YTKa.owVv,
1325
1452
  additional_info: {
1326
- uuid: _this.xWwF,
1327
- name: _this.axSA.dXou
1453
+ uuid: _this.tTqB,
1454
+ name: _this.YTKa.CTVX
1328
1455
  }
1329
1456
  });
1330
1457
  }
@@ -1332,23 +1459,23 @@
1332
1459
  _defineProperty(this, "validateForTerminationAttributes", function () {
1333
1460
  var userAttributes = Apxor.getController().getUserAttributes();
1334
1461
  var sessionAttributes = Apxor.getController().getSessionAttributes();
1335
- return _this.qNqv.validate(userAttributes, sessionAttributes);
1462
+ return _this.OyjG.validate(userAttributes, sessionAttributes);
1336
1463
  });
1337
- _defineProperty(this, "yGJs", function () {
1338
- _this.ihSD.yGJs();
1464
+ _defineProperty(this, "aokP", function () {
1465
+ _this.wXgl.aokP();
1339
1466
  });
1340
1467
  _defineProperty(this, "getFrequencyCount", function () {
1341
- return _this.ihSD.getFrequencyCount();
1468
+ return _this.wXgl.getFrequencyCount();
1342
1469
  });
1343
- _defineProperty(this, "vtVj", function () {
1344
- return _this.ihSD.NSSU();
1470
+ _defineProperty(this, "unSR", function () {
1471
+ return _this.wXgl.mtuI();
1345
1472
  });
1346
1473
  });
1347
1474
 
1348
1475
  var ConfigLookup = /*#__PURE__*/_createClass(function ConfigLookup() {
1349
1476
  var _this = this;
1350
1477
  _classCallCheck(this, ConfigLookup);
1351
- _defineProperty(this, "aSMs", {});
1478
+ _defineProperty(this, "Nxlp", {});
1352
1479
  _defineProperty(this, "parse", function () {
1353
1480
  var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
1354
1481
  configs: []
@@ -1371,7 +1498,7 @@
1371
1498
  var configId = _config._id;
1372
1499
  var configItem = new ConfigItem();
1373
1500
  if (configItem.parse(_config)) {
1374
- _this.aSMs[configId] = configItem;
1501
+ _this.Nxlp[configId] = configItem;
1375
1502
  } else {
1376
1503
  console.warn("Failed to parse cfg", configId);
1377
1504
  }
@@ -1379,44 +1506,51 @@
1379
1506
  }
1380
1507
  });
1381
1508
  _defineProperty(this, "validate", function (id, index) {
1382
- if (_this.aSMs[id]) {
1383
- var configItem = _this.aSMs[id];
1384
- configItem.SslG(index);
1509
+ if (_this.Nxlp[id]) {
1510
+ var configItem = _this.Nxlp[id];
1511
+ configItem.jKQM(index);
1385
1512
  }
1386
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
+ });
1387
1521
  _defineProperty(this, "validateForTermination", function (id, index) {
1388
- if (_this.aSMs[id]) {
1389
- var configItem = _this.aSMs[id];
1390
- configItem.uDmd(index);
1522
+ if (_this.Nxlp[id]) {
1523
+ var configItem = _this.Nxlp[id];
1524
+ configItem.VcYO(index);
1391
1525
  }
1392
1526
  });
1393
1527
  _defineProperty(this, "validateForTerminationAttributes", function (id) {
1394
- if (_this.aSMs[id]) {
1395
- var configItem = _this.aSMs[id];
1528
+ if (_this.Nxlp[id]) {
1529
+ var configItem = _this.Nxlp[id];
1396
1530
  return configItem.validateForTerminationAttributes();
1397
1531
  }
1398
1532
  return false;
1399
1533
  });
1400
- _defineProperty(this, "yGJs", function (id) {
1401
- var campiagnConfig = _this.aSMs[id];
1402
- campiagnConfig.yGJs();
1534
+ _defineProperty(this, "aokP", function (id) {
1535
+ var campiagnConfig = _this.Nxlp[id];
1536
+ campiagnConfig.aokP();
1403
1537
  });
1404
1538
  _defineProperty(this, "getFrequencyCount", function (id) {
1405
- var campiagnConfig = _this.aSMs[id];
1539
+ var campiagnConfig = _this.Nxlp[id];
1406
1540
  return campiagnConfig.getFrequencyCount();
1407
1541
  });
1408
1542
  _defineProperty(this, "resetFrequencyCounts", function () {
1409
- var configs = _this.aSMs;
1543
+ var configs = _this.Nxlp;
1410
1544
  for (var configId in configs) {
1411
- configs[configId].vtVj();
1545
+ configs[configId].unSR();
1412
1546
  }
1413
1547
  });
1414
- _defineProperty(this, "iSci", function (campaignId) {
1548
+ _defineProperty(this, "MRwp", function (campaignId) {
1415
1549
  try {
1416
- if (_this.aSMs) {
1417
- var configItem = _this.aSMs[campaignId];
1418
- if (configItem && configItem.axSA) {
1419
- return configItem.axSA;
1550
+ if (_this.Nxlp) {
1551
+ var configItem = _this.Nxlp[campaignId];
1552
+ if (configItem && configItem.YTKa) {
1553
+ return configItem.YTKa;
1420
1554
  }
1421
1555
  }
1422
1556
  } catch (e) {
@@ -1432,42 +1566,42 @@
1432
1566
  var EventsListener = /*#__PURE__*/_createClass(function EventsListener() {
1433
1567
  var _this = this;
1434
1568
  _classCallCheck(this, EventsListener);
1435
- _defineProperty(this, "MqKW", {});
1436
- _defineProperty(this, "PZUh", []);
1437
- _defineProperty(this, "CrNj", false);
1569
+ _defineProperty(this, "Cwvl", {});
1570
+ _defineProperty(this, "LCmY", []);
1571
+ _defineProperty(this, "TBZE", false);
1438
1572
  _defineProperty(this, "initialize", function () {
1439
1573
  var controller = Apxor.getController();
1440
1574
  controller.registerForEvent(APP_EVENT, function (event) {
1441
- return _this.Snah(event, "AE");
1575
+ return _this.uTFw(event, "AE");
1442
1576
  });
1443
1577
  controller.registerForEvent(CLIENT_EVENT, function (event) {
1444
- return _this.Snah(event, "CE");
1578
+ return _this.uTFw(event, "CE");
1445
1579
  });
1446
1580
  });
1447
- _defineProperty(this, "hUlQ", function () {
1581
+ _defineProperty(this, "PseG", function () {
1448
1582
  // Clear Buffer
1449
- for (var item in _this.PZUh) {
1450
- _this.lMiM(item.event, item.key, item.type);
1583
+ for (var item in _this.LCmY) {
1584
+ _this.AqCu(item.event, item.key, item.type);
1451
1585
  }
1452
- _this.CrNj = true;
1586
+ _this.TBZE = true;
1453
1587
  });
1454
- _defineProperty(this, "colh", function (event, callback) {
1588
+ _defineProperty(this, "OVFP", function (event, callback) {
1455
1589
  if (!isFunction(callback)) {
1456
1590
  return;
1457
1591
  }
1458
1592
  var listeners;
1459
- if (_this.MqKW[event]) {
1460
- listeners = _this.MqKW[event];
1593
+ if (_this.Cwvl[event]) {
1594
+ listeners = _this.Cwvl[event];
1461
1595
  } else {
1462
1596
  listeners = [];
1463
1597
  }
1464
1598
  listeners.push(callback);
1465
- _this.MqKW[event] = listeners;
1466
- Logger$9.debug("Listeners list: ", _this.MqKW);
1599
+ _this.Cwvl[event] = listeners;
1600
+ Logger$9.debug("Listeners list: ", _this.Cwvl);
1467
1601
  });
1468
1602
  _defineProperty(this, "unregisterFromEvent", function (event, callback) {
1469
- if (_this.MqKW[event]) {
1470
- var listeners = _this.MqKW[event];
1603
+ if (_this.Cwvl[event]) {
1604
+ var listeners = _this.Cwvl[event];
1471
1605
  var updatedListeners = [];
1472
1606
  for (var index = 0; index < listeners.length; index++) {
1473
1607
  var listener = listeners[index];
@@ -1475,25 +1609,25 @@
1475
1609
  updatedListeners.push(listener);
1476
1610
  }
1477
1611
  }
1478
- _this.MqKW[event] = updatedListeners;
1612
+ _this.Cwvl[event] = updatedListeners;
1479
1613
  }
1480
1614
  });
1481
- _defineProperty(this, "Snah", function (event) {
1615
+ _defineProperty(this, "uTFw", function (event) {
1482
1616
  var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "AE";
1483
1617
  var key = type + "___" + event.name;
1484
- _this.lMiM(event, key, type);
1618
+ _this.AqCu(event, key, type);
1485
1619
  });
1486
- _defineProperty(this, "lMiM", function (event, key, type) {
1487
- if (!_this.CrNj) {
1488
- _this.PZUh.push({
1620
+ _defineProperty(this, "AqCu", function (event, key, type) {
1621
+ if (!_this.TBZE) {
1622
+ _this.LCmY.push({
1489
1623
  event: event,
1490
1624
  key: key,
1491
1625
  type: type
1492
1626
  });
1493
1627
  } else {
1494
- Logger$9.debug("Notifying listeners for event: " + event + ", " + key, _this.MqKW);
1495
- if (_this.MqKW[key]) {
1496
- var listeners = _this.MqKW[key];
1628
+ Logger$9.debug("Notifying listeners for event: " + event + ", " + key, _this.Cwvl);
1629
+ if (_this.Cwvl[key]) {
1630
+ var listeners = _this.Cwvl[key];
1497
1631
  var time = Apxor.getController().getSDKRunningTimeInSec();
1498
1632
  for (var index = 0; index < listeners.length; index++) {
1499
1633
  var listener = listeners[index];
@@ -1509,17 +1643,17 @@
1509
1643
  function CE() {
1510
1644
  var _this = this;
1511
1645
  _classCallCheck(this, CE);
1512
- _defineProperty(this, "FyrB", false);
1513
- _defineProperty(this, "EGlR", null);
1514
- _defineProperty(this, "Emjp", getDateInDDMMYYYY());
1515
- _defineProperty(this, "WpgE", new EventsListener());
1516
- _defineProperty(this, "kKtz", 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());
1517
1651
  _defineProperty(this, "_qeState", {});
1518
1652
  _defineProperty(this, "getQeState", function () {
1519
1653
  try {
1520
1654
  var data = Apxor.getController().getFromStorage(QE_STATE);
1521
1655
  if (data) {
1522
- return JSON.parse(decode(_this.kKtz, data));
1656
+ return JSON.parse(decode(_this.DtLZ, data));
1523
1657
  } else {
1524
1658
  _this._qeState = {};
1525
1659
  return _this.setQeState();
@@ -1548,10 +1682,10 @@
1548
1682
  return _this._qeState;
1549
1683
  });
1550
1684
  _defineProperty(this, "initialize", function () {
1551
- if (!_this.FyrB) {
1552
- _this.FyrB = true;
1553
- _this.EGlR = new ConfigLookup();
1554
- _this.WpgE.initialize();
1685
+ if (!_this.jnoF) {
1686
+ _this.jnoF = true;
1687
+ _this.dXeZ = new ConfigLookup();
1688
+ _this.mBNE.initialize();
1555
1689
  _this._qeState = _this.getQeState();
1556
1690
  Logger$a.info("QE Initialized..");
1557
1691
  }
@@ -1562,12 +1696,12 @@
1562
1696
  * @param config
1563
1697
  */
1564
1698
  _defineProperty(this, "parse", function (config) {
1565
- if (!_this.lHre()) {
1699
+ if (!_this.JpIa()) {
1566
1700
  Logger$a.warn("Must call init first. Unable to proceed");
1567
1701
  return;
1568
1702
  }
1569
- _this.EGlR.parse(config);
1570
- _this.WpgE.hUlQ();
1703
+ _this.dXeZ.parse(config);
1704
+ _this.mBNE.PseG();
1571
1705
  });
1572
1706
  /**
1573
1707
  * Validates all conditions for given config ID
@@ -1576,19 +1710,22 @@
1576
1710
  * @param index
1577
1711
  */
1578
1712
  _defineProperty(this, "validate", function (id, index) {
1579
- if (!_this.lHre()) {
1713
+ if (!_this.JpIa()) {
1580
1714
  return;
1581
1715
  }
1582
- _this.EGlR.validate(id, index);
1716
+ _this.dXeZ.validate(id, index);
1717
+ });
1718
+ _defineProperty(this, "getVariantCode", function (id) {
1719
+ return _this.dXeZ.getVariantCode(id);
1583
1720
  });
1584
1721
  _defineProperty(this, "validateForTermination", function (id, index) {
1585
- if (!_this.lHre()) {
1722
+ if (!_this.JpIa()) {
1586
1723
  return;
1587
1724
  }
1588
- _this.EGlR.validateForTermination(id, index);
1725
+ _this.dXeZ.validateForTermination(id, index);
1589
1726
  });
1590
1727
  _defineProperty(this, "validateForTerminationAttributes", function (user, session) {
1591
- return _this.EGlR.validateForTerminationAttributes(user, session);
1728
+ return _this.dXeZ.validateForTerminationAttributes(user, session);
1592
1729
  });
1593
1730
  _defineProperty(this, "updateCount", function (id) {
1594
1731
  try {
@@ -1597,22 +1734,25 @@
1597
1734
  }
1598
1735
  _this.incrementFrequencies(id);
1599
1736
  _this.setQeState(id);
1600
- _this.EGlR.yGJs(id);
1737
+ _this.dXeZ.aokP(id);
1601
1738
  } catch (e) {
1602
1739
  console.log("Could not update the count config:".concat(e));
1603
1740
  }
1604
1741
  });
1605
1742
  _defineProperty(this, "resetFrequencyCounts", function () {
1606
- _this.EGlR.resetFrequencyCounts();
1743
+ _this.dXeZ.resetFrequencyCounts();
1607
1744
  });
1608
1745
  _defineProperty(this, "getFrequencyCount", function (id) {
1609
- return _this.EGlR.getFrequencyCount(id);
1746
+ return _this.dXeZ.getFrequencyCount(id);
1610
1747
  });
1611
1748
  _defineProperty(this, "registerForEvent", function (event, callback) {
1612
- _this.WpgE.colh(event, callback);
1749
+ _this.mBNE.OVFP(event, callback);
1613
1750
  });
1614
1751
  _defineProperty(this, "unregisterFromEvent", function (event, callback) {
1615
- _this.WpgE.unregisterFromEvent(event, callback);
1752
+ _this.mBNE.unregisterFromEvent(event, callback);
1753
+ });
1754
+ _defineProperty(this, "notifyEventListener", function (event) {
1755
+ _this.mBNE.uTFw(event);
1616
1756
  });
1617
1757
  /**
1618
1758
  * Fetches the config from Server
@@ -1625,14 +1765,14 @@
1625
1765
  _defineProperty(this, "fetch", function (type, validateUrl, apiUrl, callback) {
1626
1766
  Apxor.getController().fetchConfiguration(type, validateUrl, apiUrl, callback);
1627
1767
  });
1628
- _defineProperty(this, "lHre", function () {
1629
- return _this.FyrB;
1768
+ _defineProperty(this, "JpIa", function () {
1769
+ return _this.jnoF;
1630
1770
  });
1631
1771
  _defineProperty(this, "getCampaignMetaFromQueryEngine", function (campaignId) {
1632
- return _this.EGlR.iSci(campaignId);
1772
+ return _this.dXeZ.MRwp(campaignId);
1633
1773
  });
1634
- _defineProperty(this, "rvWz", function () {
1635
- return _this.Emjp;
1774
+ _defineProperty(this, "lXby", function () {
1775
+ return _this.yqdw;
1636
1776
  });
1637
1777
  if (!CE.instance) {
1638
1778
  CE.instance = this;
@@ -1656,7 +1796,7 @@
1656
1796
  OVERALL: 0,
1657
1797
  DATES: {}
1658
1798
  };
1659
- if (this.Emjp) this._qeState[id].DATES[this.Emjp] = 0;
1799
+ if (this.yqdw) this._qeState[id].DATES[this.yqdw] = 0;
1660
1800
  this.setQeState(id);
1661
1801
  }
1662
1802
  } catch (e) {
@@ -1675,12 +1815,12 @@
1675
1815
 
1676
1816
  // Increment the DATES count for this particular date by 1. If the date changes reset.
1677
1817
  var currentDate = getDateInDDMMYYYY();
1678
- if (currentDate !== this.Emjp || !(configFrequency.DATES && configFrequency.DATES[currentDate])) {
1679
- this.Emjp = currentDate;
1818
+ if (currentDate !== this.yqdw || !(configFrequency.DATES && configFrequency.DATES[currentDate])) {
1819
+ this.yqdw = currentDate;
1680
1820
  configFrequency.DATES = {};
1681
- configFrequency.DATES[this.Emjp] = 0;
1821
+ configFrequency.DATES[this.yqdw] = 0;
1682
1822
  }
1683
- configFrequency.DATES[this.Emjp] = configFrequency.DATES[this.Emjp] + 1;
1823
+ configFrequency.DATES[this.yqdw] = configFrequency.DATES[this.yqdw] + 1;
1684
1824
  }
1685
1825
  }], [{
1686
1826
  key: "getInstance",
@@ -1699,7 +1839,7 @@
1699
1839
 
1700
1840
  /* eslint-disable no-empty */
1701
1841
 
1702
- window.ceVersion = 141;
1842
+ window.ceVersion = 150;
1703
1843
  try {
1704
1844
  if (exports !== undefined || exports !== null) {
1705
1845
  exports["default"] = CE;