apxor-qe 1.6.2-qa.0 → 1.6.3-qa.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apxor.qe.js.bak +503 -503
- package/dist/apxor.qe.min.js +1 -1
- package/package.json +2 -2
package/dist/apxor.qe.js.bak
CHANGED
|
@@ -208,7 +208,7 @@
|
|
|
208
208
|
var toUpperCase = function toUpperCase(key) {
|
|
209
209
|
return key.toUpperCase();
|
|
210
210
|
};
|
|
211
|
-
var
|
|
211
|
+
var LbJy = function LbJy(actual, expected, operator) {
|
|
212
212
|
switch (operator) {
|
|
213
213
|
case "EQ":
|
|
214
214
|
return actual === expected;
|
|
@@ -413,7 +413,7 @@
|
|
|
413
413
|
path = path.substring(0, index) + "svg:svg";
|
|
414
414
|
}
|
|
415
415
|
try {
|
|
416
|
-
return document.
|
|
416
|
+
return document.fZkd(path, document, function (prefix) {
|
|
417
417
|
if (prefix === "svg") {
|
|
418
418
|
return "http://www.w3.org/2000/svg";
|
|
419
419
|
} else {
|
|
@@ -473,18 +473,18 @@
|
|
|
473
473
|
var Audience = /*#__PURE__*/_createClass(function Audience() {
|
|
474
474
|
var _this = this;
|
|
475
475
|
_classCallCheck(this, Audience);
|
|
476
|
-
_defineProperty(this, "
|
|
477
|
-
_defineProperty(this, "
|
|
478
|
-
_defineProperty(this, "
|
|
476
|
+
_defineProperty(this, "kcPk", "ALL");
|
|
477
|
+
_defineProperty(this, "zAFt", []);
|
|
478
|
+
_defineProperty(this, "VvGB", []);
|
|
479
479
|
_defineProperty(this, "userAttributesValidated", true);
|
|
480
480
|
_defineProperty(this, "sessionAttributeValidated", true);
|
|
481
481
|
_defineProperty(this, "parse", function () {
|
|
482
482
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
483
483
|
try {
|
|
484
|
-
_this.
|
|
485
|
-
_this.
|
|
486
|
-
_this.
|
|
487
|
-
if (!Array.isArray(_this.
|
|
484
|
+
_this.kcPk = config.audience.audience_type;
|
|
485
|
+
_this.zAFt = config.audience.attributes.user;
|
|
486
|
+
_this.VvGB = config.audience.attributes.session;
|
|
487
|
+
if (!Array.isArray(_this.zAFt) || !Array.isArray(_this.VvGB)) {
|
|
488
488
|
Logger$1.error("No attributes");
|
|
489
489
|
return false;
|
|
490
490
|
}
|
|
@@ -496,11 +496,11 @@
|
|
|
496
496
|
});
|
|
497
497
|
_defineProperty(this, "validate", function (user, session) {
|
|
498
498
|
var status = true;
|
|
499
|
-
if (_this.
|
|
499
|
+
if (_this.kcPk === "FTU") {
|
|
500
500
|
status = Apxor.getController().getSessionInfo().is_first_session;
|
|
501
501
|
}
|
|
502
|
-
var userAttributesCompare = _this.
|
|
503
|
-
var sessionAttributesCompare = _this.
|
|
502
|
+
var userAttributesCompare = _this.IJgZ(user, _this.zAFt);
|
|
503
|
+
var sessionAttributesCompare = _this.IJgZ(session, _this.VvGB);
|
|
504
504
|
if (!userAttributesCompare) {
|
|
505
505
|
_this.userAttributesValidated = false;
|
|
506
506
|
}
|
|
@@ -509,7 +509,7 @@
|
|
|
509
509
|
}
|
|
510
510
|
return status && userAttributesCompare && sessionAttributesCompare;
|
|
511
511
|
});
|
|
512
|
-
_defineProperty(this, "
|
|
512
|
+
_defineProperty(this, "IJgZ", function (attributes, expected) {
|
|
513
513
|
var length = expected.length;
|
|
514
514
|
var status = true;
|
|
515
515
|
try {
|
|
@@ -557,7 +557,7 @@
|
|
|
557
557
|
} else if (type === "b") {
|
|
558
558
|
loggedValue = !!loggedValue;
|
|
559
559
|
}
|
|
560
|
-
return
|
|
560
|
+
return LbJy(loggedValue, configValue, operator);
|
|
561
561
|
});
|
|
562
562
|
});
|
|
563
563
|
status = status && match;
|
|
@@ -585,41 +585,41 @@
|
|
|
585
585
|
var Frequency = /*#__PURE__*/_createClass(function Frequency() {
|
|
586
586
|
var _this = this;
|
|
587
587
|
_classCallCheck(this, Frequency);
|
|
588
|
-
_defineProperty(this, "
|
|
589
|
-
_defineProperty(this, "
|
|
590
|
-
_defineProperty(this, "
|
|
591
|
-
_defineProperty(this, "
|
|
592
|
-
_defineProperty(this, "
|
|
593
|
-
_defineProperty(this, "
|
|
588
|
+
_defineProperty(this, "ZIqy", 0);
|
|
589
|
+
_defineProperty(this, "GmGj", 0);
|
|
590
|
+
_defineProperty(this, "MnIa", "SESSION");
|
|
591
|
+
_defineProperty(this, "mKem", 0);
|
|
592
|
+
_defineProperty(this, "RQPp", 0);
|
|
593
|
+
_defineProperty(this, "lVnA", 0);
|
|
594
594
|
_defineProperty(this, "parse", function () {
|
|
595
595
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
596
596
|
try {
|
|
597
|
-
_this.
|
|
598
|
-
_this.
|
|
599
|
-
_this.
|
|
600
|
-
if (_this.
|
|
601
|
-
_this.
|
|
602
|
-
}
|
|
603
|
-
_this.
|
|
604
|
-
_this.
|
|
605
|
-
_this.
|
|
606
|
-
_this.
|
|
597
|
+
_this.ZPwC = config._id;
|
|
598
|
+
_this.WkEQ = config.meta;
|
|
599
|
+
_this.ZIqy = config.frequency.count;
|
|
600
|
+
if (_this.ZIqy === -1) {
|
|
601
|
+
_this.ZIqy = 1000;
|
|
602
|
+
}
|
|
603
|
+
_this.lVnA = _this.ZIqy;
|
|
604
|
+
_this.GmGj = config.frequency.time_interval;
|
|
605
|
+
_this.MnIa = config.frequency.validity;
|
|
606
|
+
_this.RQPp = config.frequency.ses_lmt;
|
|
607
607
|
_this._dayCount = config.frequency.day_lmt;
|
|
608
608
|
// let data = Apxor.getController().getFromStorage(QE_STATE);
|
|
609
609
|
// let qe_state = JSON.parse(decode(Apxor.getSiteId(), data));
|
|
610
610
|
var qe_state = CE.getInstance().getQeState();
|
|
611
611
|
if (!isDefined(qe_state) || !isDefined(qe_state[config._id])) return true;
|
|
612
|
-
if (_this.
|
|
613
|
-
_this.
|
|
614
|
-
if (_this.
|
|
615
|
-
_this.
|
|
612
|
+
if (_this.MnIa === "SESSION") {
|
|
613
|
+
_this.ZIqy = parseInt(_this.ZIqy) - parseInt(qe_state[config._id]["SESSION"]);
|
|
614
|
+
if (_this.ZIqy <= 0) {
|
|
615
|
+
_this.xZni("Session limit reached");
|
|
616
616
|
console.warn("Max count limit reached for session:" + config._id);
|
|
617
617
|
return false;
|
|
618
618
|
}
|
|
619
|
-
} else if (_this.
|
|
620
|
-
_this.
|
|
621
|
-
if (_this.
|
|
622
|
-
_this.
|
|
619
|
+
} else if (_this.MnIa === "OVERALL") {
|
|
620
|
+
_this.ZIqy = parseInt(_this.ZIqy) - parseInt(qe_state[config._id]["OVERALL"]);
|
|
621
|
+
if (_this.ZIqy <= 0) {
|
|
622
|
+
_this.xZni("Overall limit reached");
|
|
623
623
|
console.warn("Max count limit reached for overall:" + config._id);
|
|
624
624
|
return false;
|
|
625
625
|
}
|
|
@@ -633,32 +633,32 @@
|
|
|
633
633
|
}
|
|
634
634
|
return true;
|
|
635
635
|
});
|
|
636
|
-
_defineProperty(this, "
|
|
637
|
-
_this.
|
|
636
|
+
_defineProperty(this, "dRwe", function () {
|
|
637
|
+
_this.ZIqy = _this.ZIqy - 1;
|
|
638
638
|
});
|
|
639
639
|
_defineProperty(this, "getFrequencyCount", function () {
|
|
640
|
-
return _this.
|
|
640
|
+
return _this.ZIqy;
|
|
641
641
|
});
|
|
642
|
-
_defineProperty(this, "
|
|
643
|
-
if (_this.
|
|
644
|
-
_this.
|
|
642
|
+
_defineProperty(this, "UcJn", function () {
|
|
643
|
+
if (_this.MnIa === "SESSION") {
|
|
644
|
+
_this.ZIqy = _this.lVnA;
|
|
645
645
|
Logger$2.info("Campaign Limit reset");
|
|
646
646
|
}
|
|
647
647
|
});
|
|
648
648
|
/**
|
|
649
|
-
* @function
|
|
649
|
+
* @function atfr
|
|
650
650
|
* @description Validates if the campaign count is with in the limits set in the config.
|
|
651
651
|
* @param {string} Config id
|
|
652
652
|
* @returns {boolean} true - If the Campaign limits are not reached
|
|
653
653
|
* false - Otherwise
|
|
654
654
|
*/
|
|
655
|
-
_defineProperty(this, "
|
|
655
|
+
_defineProperty(this, "atfr", function (id) {
|
|
656
656
|
try {
|
|
657
|
-
if (_this.
|
|
658
|
-
if (_this.
|
|
659
|
-
_this.
|
|
660
|
-
} else if (_this.
|
|
661
|
-
_this.
|
|
657
|
+
if (_this.ZIqy <= 0) {
|
|
658
|
+
if (_this.MnIa === "OVERALL") {
|
|
659
|
+
_this.xZni("Overall limit reached");
|
|
660
|
+
} else if (_this.MnIa === "SESSION") {
|
|
661
|
+
_this.xZni("Session limit reached");
|
|
662
662
|
}
|
|
663
663
|
return false;
|
|
664
664
|
}
|
|
@@ -670,11 +670,11 @@
|
|
|
670
670
|
if (!isDefined(qe_state) || !isDefined(qe_state[id])) return true;
|
|
671
671
|
|
|
672
672
|
//If the config has a session count limit set
|
|
673
|
-
if (_this.
|
|
674
|
-
var sessionCountInConfig = parseInt(_this.
|
|
673
|
+
if (_this.RQPp !== 0) {
|
|
674
|
+
var sessionCountInConfig = parseInt(_this.RQPp);
|
|
675
675
|
var thisSessionCount = parseInt(qe_state[id]["SESSION"]);
|
|
676
676
|
if (sessionCountInConfig - thisSessionCount <= 0) {
|
|
677
|
-
_this.
|
|
677
|
+
_this.xZni("Session limit reached");
|
|
678
678
|
return false;
|
|
679
679
|
}
|
|
680
680
|
}
|
|
@@ -686,23 +686,23 @@
|
|
|
686
686
|
var dayCountInConfig = parseInt(_this._dayCount);
|
|
687
687
|
var thisDayCount = parseInt(((_qe_state$id = qe_state[id]) === null || _qe_state$id === void 0 ? void 0 : _qe_state$id.DATES[date]) || 0);
|
|
688
688
|
if (dayCountInConfig - thisDayCount <= 0) {
|
|
689
|
-
_this.
|
|
689
|
+
_this.xZni("Day limit reached");
|
|
690
690
|
return false;
|
|
691
691
|
}
|
|
692
692
|
}
|
|
693
693
|
} catch (e) {
|
|
694
|
-
_this.
|
|
694
|
+
_this.xZni("Error validating the frequency: ".concat(e));
|
|
695
695
|
Logger$2.error("Error validating the frequency:" + e);
|
|
696
696
|
}
|
|
697
697
|
return true;
|
|
698
698
|
});
|
|
699
|
-
_defineProperty(this, "
|
|
700
|
-
var _this$
|
|
699
|
+
_defineProperty(this, "xZni", function (reason) {
|
|
700
|
+
var _this$WkEQ$attr;
|
|
701
701
|
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
|
|
702
|
-
apx_nudge_type: _this.
|
|
703
|
-
apx_nudge_id: _this.
|
|
704
|
-
apx_nudge_name: _this.
|
|
705
|
-
apx_variant_code: _this.
|
|
702
|
+
apx_nudge_type: _this.WkEQ.type === "SURVEY" ? "survey" : "campaign",
|
|
703
|
+
apx_nudge_id: _this.ZPwC,
|
|
704
|
+
apx_nudge_name: _this.WkEQ.name,
|
|
705
|
+
apx_variant_code: _this.WkEQ.isExperiment || _this.WkEQ.only_context ? (_this$WkEQ$attr = _this.WkEQ.attr) === null || _this$WkEQ$attr === void 0 ? void 0 : _this$WkEQ$attr[APX_VARIANT_CODE] : "TG",
|
|
706
706
|
apx_failure_type: "warn",
|
|
707
707
|
apx_reason: reason
|
|
708
708
|
});
|
|
@@ -712,14 +712,14 @@
|
|
|
712
712
|
var Meta = /*#__PURE__*/_createClass(function Meta() {
|
|
713
713
|
var _this = this;
|
|
714
714
|
_classCallCheck(this, Meta);
|
|
715
|
-
_defineProperty(this, "
|
|
716
|
-
_defineProperty(this, "
|
|
715
|
+
_defineProperty(this, "lkvT", "");
|
|
716
|
+
_defineProperty(this, "kcPk", "");
|
|
717
717
|
_defineProperty(this, "parse", function () {
|
|
718
718
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
719
719
|
try {
|
|
720
720
|
var _config$meta, _config$meta2;
|
|
721
|
-
_this.
|
|
722
|
-
_this.
|
|
721
|
+
_this.lkvT = config.meta.name;
|
|
722
|
+
_this.kcPk = config.meta.type;
|
|
723
723
|
_this._only_context = config.meta.only_context;
|
|
724
724
|
_this._attr = ((_config$meta = config.meta) === null || _config$meta === void 0 ? void 0 : _config$meta.attr) || {};
|
|
725
725
|
_this._isExperiment = (_config$meta2 = config.meta) === null || _config$meta2 === void 0 ? void 0 : _config$meta2.isExperiment;
|
|
@@ -735,11 +735,11 @@
|
|
|
735
735
|
var Validity = /*#__PURE__*/_createClass(function Validity() {
|
|
736
736
|
var _this = this;
|
|
737
737
|
_classCallCheck(this, Validity);
|
|
738
|
-
_defineProperty(this, "
|
|
739
|
-
_defineProperty(this, "
|
|
740
|
-
_defineProperty(this, "
|
|
741
|
-
_defineProperty(this, "
|
|
742
|
-
_defineProperty(this, "
|
|
738
|
+
_defineProperty(this, "twTf", -1);
|
|
739
|
+
_defineProperty(this, "Zkxl", -1);
|
|
740
|
+
_defineProperty(this, "tTTW", -1);
|
|
741
|
+
_defineProperty(this, "qBOQ", -1);
|
|
742
|
+
_defineProperty(this, "GLHi", false);
|
|
743
743
|
_defineProperty(this, "_nudge_expired", false);
|
|
744
744
|
_defineProperty(this, "_not_yet_active", false);
|
|
745
745
|
_defineProperty(this, "_not_in_specified_time", false);
|
|
@@ -750,17 +750,17 @@
|
|
|
750
750
|
Logger$3.error("Not valid dates");
|
|
751
751
|
return false;
|
|
752
752
|
}
|
|
753
|
-
_this.
|
|
754
|
-
_this.
|
|
753
|
+
_this.twTf = Date.parse(config.validity.start_date);
|
|
754
|
+
_this.Zkxl = Date.parse(config.validity.end_date);
|
|
755
755
|
if (isDefined(config.at_specific_time)) {
|
|
756
|
-
_this.
|
|
757
|
-
if (_this.
|
|
756
|
+
_this.GLHi = config.at_specific_time;
|
|
757
|
+
if (_this.GLHi && isDefined(config.time_limits)) {
|
|
758
758
|
var currentDate = new Date().toISOString().split("T")[0];
|
|
759
|
-
_this.
|
|
760
|
-
_this.
|
|
759
|
+
_this.tTTW = Date.parse(currentDate + "T" + config.time_limits.start_time + ":00.000Z");
|
|
760
|
+
_this.qBOQ = Date.parse(currentDate + "T" + config.time_limits.end_time + ":00.000Z");
|
|
761
761
|
|
|
762
762
|
// If invalid format is passed, return false
|
|
763
|
-
if (isNaN(_this.
|
|
763
|
+
if (isNaN(_this.tTTW) || isNaN(_this.qBOQ)) {
|
|
764
764
|
Logger$3.error("Not valid times");
|
|
765
765
|
return false;
|
|
766
766
|
}
|
|
@@ -774,14 +774,14 @@
|
|
|
774
774
|
});
|
|
775
775
|
_defineProperty(this, "validate", function () {
|
|
776
776
|
var currentTime = Date.now();
|
|
777
|
-
if (currentTime > _this.
|
|
778
|
-
if (_this.
|
|
777
|
+
if (currentTime > _this.twTf && currentTime < _this.Zkxl) {
|
|
778
|
+
if (_this.GLHi && !(currentTime >= _this.tTTW && currentTime <= _this.qBOQ)) {
|
|
779
779
|
_this._not_in_specified_time = true;
|
|
780
780
|
}
|
|
781
|
-
return !_this.
|
|
782
|
-
} else if (currentTime < _this.
|
|
781
|
+
return !_this.GLHi || currentTime >= _this.tTTW && currentTime <= _this.qBOQ;
|
|
782
|
+
} else if (currentTime < _this.twTf) {
|
|
783
783
|
_this._not_yet_active = true;
|
|
784
|
-
} else if (currentTime > _this.
|
|
784
|
+
} else if (currentTime > _this.Zkxl) {
|
|
785
785
|
_this._nudge_expired = true;
|
|
786
786
|
}
|
|
787
787
|
return false;
|
|
@@ -791,13 +791,13 @@
|
|
|
791
791
|
var Details = /*#__PURE__*/_createClass(function Details() {
|
|
792
792
|
var _this = this;
|
|
793
793
|
_classCallCheck(this, Details);
|
|
794
|
-
_defineProperty(this, "
|
|
795
|
-
_defineProperty(this, "
|
|
794
|
+
_defineProperty(this, "lkvT", "");
|
|
795
|
+
_defineProperty(this, "aoOe", {});
|
|
796
796
|
_defineProperty(this, "parse", function () {
|
|
797
797
|
var details = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
798
798
|
try {
|
|
799
|
-
_this.
|
|
800
|
-
_this.
|
|
799
|
+
_this.lkvT = details.name;
|
|
800
|
+
_this.aoOe = details.additional_info;
|
|
801
801
|
} catch (error) {
|
|
802
802
|
return false;
|
|
803
803
|
}
|
|
@@ -808,14 +808,14 @@
|
|
|
808
808
|
var Timebounds = /*#__PURE__*/_createClass(function Timebounds() {
|
|
809
809
|
var _this = this;
|
|
810
810
|
_classCallCheck(this, Timebounds);
|
|
811
|
-
_defineProperty(this, "
|
|
812
|
-
_defineProperty(this, "
|
|
811
|
+
_defineProperty(this, "HWOm", 0);
|
|
812
|
+
_defineProperty(this, "xcvA", 0);
|
|
813
813
|
_defineProperty(this, "parse", function () {
|
|
814
814
|
var timeBounds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
815
815
|
try {
|
|
816
|
-
_this.
|
|
817
|
-
_this.
|
|
818
|
-
if (isNaN(_this.
|
|
816
|
+
_this.HWOm = Number(timeBounds.lower);
|
|
817
|
+
_this.xcvA = Number(timeBounds.upper);
|
|
818
|
+
if (isNaN(_this.HWOm) || isNaN(_this.xcvA)) {
|
|
819
819
|
return false;
|
|
820
820
|
}
|
|
821
821
|
} catch (error) {
|
|
@@ -828,17 +828,17 @@
|
|
|
828
828
|
var PreCondition = /*#__PURE__*/_createClass(function PreCondition() {
|
|
829
829
|
var _this = this;
|
|
830
830
|
_classCallCheck(this, PreCondition);
|
|
831
|
-
_defineProperty(this, "
|
|
832
|
-
_defineProperty(this, "
|
|
833
|
-
_defineProperty(this, "
|
|
834
|
-
_defineProperty(this, "
|
|
835
|
-
_defineProperty(this, "
|
|
831
|
+
_defineProperty(this, "RgIj", 0);
|
|
832
|
+
_defineProperty(this, "ufVL", "");
|
|
833
|
+
_defineProperty(this, "Nrox", "");
|
|
834
|
+
_defineProperty(this, "OXAP", new Details());
|
|
835
|
+
_defineProperty(this, "PwzV", new Timebounds());
|
|
836
836
|
_defineProperty(this, "parse", function () {
|
|
837
837
|
var precondition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
838
838
|
try {
|
|
839
|
-
_this.
|
|
840
|
-
_this.
|
|
841
|
-
return _this.
|
|
839
|
+
_this.ufVL = precondition.event_type;
|
|
840
|
+
_this.Nrox = precondition.activity;
|
|
841
|
+
return _this.OXAP.parse(precondition.details) && _this.PwzV.parse(precondition.time_bounds);
|
|
842
842
|
} catch (error) {
|
|
843
843
|
return false;
|
|
844
844
|
}
|
|
@@ -849,29 +849,29 @@
|
|
|
849
849
|
var Condition = /*#__PURE__*/_createClass(function Condition() {
|
|
850
850
|
var _this = this;
|
|
851
851
|
_classCallCheck(this, Condition);
|
|
852
|
-
_defineProperty(this, "
|
|
853
|
-
_defineProperty(this, "
|
|
854
|
-
_defineProperty(this, "
|
|
855
|
-
_defineProperty(this, "
|
|
856
|
-
_defineProperty(this, "
|
|
857
|
-
_defineProperty(this, "
|
|
858
|
-
_defineProperty(this, "
|
|
859
|
-
_defineProperty(this, "
|
|
860
|
-
_defineProperty(this, "
|
|
861
|
-
_defineProperty(this, "
|
|
862
|
-
_defineProperty(this, "
|
|
863
|
-
_defineProperty(this, "
|
|
852
|
+
_defineProperty(this, "RgIj", 0);
|
|
853
|
+
_defineProperty(this, "MGiL", -1);
|
|
854
|
+
_defineProperty(this, "ZIqy", 0);
|
|
855
|
+
_defineProperty(this, "KHXB", "");
|
|
856
|
+
_defineProperty(this, "Nrox", "");
|
|
857
|
+
_defineProperty(this, "ufVL", "");
|
|
858
|
+
_defineProperty(this, "PwzV", new Timebounds());
|
|
859
|
+
_defineProperty(this, "OXAP", new Details());
|
|
860
|
+
_defineProperty(this, "zbHV", new PreCondition());
|
|
861
|
+
_defineProperty(this, "PGZU", "AND");
|
|
862
|
+
_defineProperty(this, "PTjs", false);
|
|
863
|
+
_defineProperty(this, "kcPk", void 0);
|
|
864
864
|
_defineProperty(this, "parse", function () {
|
|
865
865
|
var condition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
866
866
|
try {
|
|
867
|
-
_this.
|
|
868
|
-
_this.
|
|
869
|
-
_this.
|
|
870
|
-
_this.
|
|
871
|
-
_this.
|
|
872
|
-
_this.
|
|
873
|
-
_this.
|
|
874
|
-
return _this.
|
|
867
|
+
_this.MGiL = condition.sequence;
|
|
868
|
+
_this.ZIqy = condition.count_config.count;
|
|
869
|
+
_this.KHXB = condition.count_config.operator;
|
|
870
|
+
_this.Nrox = condition.activity;
|
|
871
|
+
_this.ufVL = condition.event_type;
|
|
872
|
+
_this.PGZU = condition.combine_operator;
|
|
873
|
+
_this.kcPk = condition.type;
|
|
874
|
+
return _this.OXAP.parse(condition.details) && _this.zbHV.parse(condition.trigger) && _this.PwzV.parse(condition.time_bounds);
|
|
875
875
|
} catch (error) {
|
|
876
876
|
Logger$4.error(error);
|
|
877
877
|
return false;
|
|
@@ -883,19 +883,19 @@
|
|
|
883
883
|
var GoalEvent = /*#__PURE__*/_createClass(function GoalEvent() {
|
|
884
884
|
var _this = this;
|
|
885
885
|
_classCallCheck(this, GoalEvent);
|
|
886
|
-
_defineProperty(this, "
|
|
887
|
-
_defineProperty(this, "
|
|
888
|
-
_defineProperty(this, "
|
|
889
|
-
_defineProperty(this, "
|
|
890
|
-
_defineProperty(this, "
|
|
891
|
-
_defineProperty(this, "
|
|
886
|
+
_defineProperty(this, "ZIqy", 0);
|
|
887
|
+
_defineProperty(this, "KHXB", "");
|
|
888
|
+
_defineProperty(this, "ufVL", "");
|
|
889
|
+
_defineProperty(this, "PwzV", new Timebounds());
|
|
890
|
+
_defineProperty(this, "OXAP", new Details());
|
|
891
|
+
_defineProperty(this, "PGZU", "AND");
|
|
892
892
|
_defineProperty(this, "parse", function (data) {
|
|
893
893
|
try {
|
|
894
|
-
_this.
|
|
895
|
-
_this.
|
|
896
|
-
_this.
|
|
897
|
-
_this.
|
|
898
|
-
return _this.
|
|
894
|
+
_this.ZIqy = data.count_config.count;
|
|
895
|
+
_this.KHXB = data.count_config.operator;
|
|
896
|
+
_this.ufVL = data.event_type;
|
|
897
|
+
_this.PGZU = data.combine_operator;
|
|
898
|
+
return _this.OXAP.parse(data.details) && _this.PwzV.parse(data.time_bounds);
|
|
899
899
|
} catch (error) {
|
|
900
900
|
Logger$5.error(error);
|
|
901
901
|
return false;
|
|
@@ -909,21 +909,21 @@
|
|
|
909
909
|
function ConditionValidator() {
|
|
910
910
|
var _this = this;
|
|
911
911
|
_classCallCheck(this, ConditionValidator);
|
|
912
|
-
_defineProperty(this, "
|
|
913
|
-
_defineProperty(this, "
|
|
914
|
-
_defineProperty(this, "
|
|
915
|
-
_defineProperty(this, "
|
|
916
|
-
_defineProperty(this, "
|
|
917
|
-
_defineProperty(this, "
|
|
918
|
-
_defineProperty(this, "
|
|
919
|
-
_defineProperty(this, "
|
|
920
|
-
_defineProperty(this, "
|
|
921
|
-
_defineProperty(this, "
|
|
922
|
-
_defineProperty(this, "
|
|
923
|
-
_defineProperty(this, "
|
|
924
|
-
_defineProperty(this, "
|
|
912
|
+
_defineProperty(this, "OZwB", 0);
|
|
913
|
+
_defineProperty(this, "ZPwC", "");
|
|
914
|
+
_defineProperty(this, "Accr", new Condition());
|
|
915
|
+
_defineProperty(this, "qZyN", new GoalEvent());
|
|
916
|
+
_defineProperty(this, "VtGp", false);
|
|
917
|
+
_defineProperty(this, "ossY", false);
|
|
918
|
+
_defineProperty(this, "DdYx", 0);
|
|
919
|
+
_defineProperty(this, "PGZU", "AND");
|
|
920
|
+
_defineProperty(this, "OfmW", "OR");
|
|
921
|
+
_defineProperty(this, "bfSR", -1);
|
|
922
|
+
_defineProperty(this, "nWaf", []);
|
|
923
|
+
_defineProperty(this, "GKyo", {});
|
|
924
|
+
_defineProperty(this, "VVVx", false);
|
|
925
925
|
/**
|
|
926
|
-
* If respectSequence is true, don't auto-
|
|
926
|
+
* If respectSequence is true, don't auto-vlES to events except for the condition whose index is 0
|
|
927
927
|
*
|
|
928
928
|
* @param condition
|
|
929
929
|
* @param type
|
|
@@ -939,191 +939,191 @@
|
|
|
939
939
|
var respectSequence = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
940
940
|
var noKpiArray = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
941
941
|
var flag = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : "";
|
|
942
|
-
_this.
|
|
943
|
-
_this.
|
|
944
|
-
_this.
|
|
942
|
+
_this.ZPwC = id;
|
|
943
|
+
_this.DdYx = index;
|
|
944
|
+
_this.nWaf = noKpiArray;
|
|
945
945
|
if (flag !== "termination" || flag === "") {
|
|
946
|
-
var result = _this.
|
|
946
|
+
var result = _this.Accr.parse(condition);
|
|
947
947
|
if (result) {
|
|
948
|
-
_this.
|
|
948
|
+
_this.PGZU = _this.Accr.PGZU;
|
|
949
949
|
|
|
950
950
|
// FIXME: Why this code is written? Don't see any usecase
|
|
951
|
-
if (_this.
|
|
952
|
-
var eventName = _this.
|
|
951
|
+
if (_this.Accr.PTjs) {
|
|
952
|
+
var eventName = _this.Accr.OXAP.lkvT;
|
|
953
953
|
if (eventName === "APX_PAGE_OPENED") {
|
|
954
|
-
eventName = _this.
|
|
955
|
-
eventName = isDefined(eventName) ? eventName : _this.
|
|
954
|
+
eventName = _this.Accr.OXAP.aoOe["navigation_id"];
|
|
955
|
+
eventName = isDefined(eventName) ? eventName : _this.Accr.OXAP.lkvT;
|
|
956
956
|
}
|
|
957
|
-
_this.
|
|
958
|
-
var count = _this.
|
|
959
|
-
var operator = _this.
|
|
960
|
-
_this.
|
|
961
|
-
_this.
|
|
962
|
-
// If the condition is already satisfied and if it is page view, no need to
|
|
957
|
+
_this.bfSR = Apxor.getController().getEventCount(eventName);
|
|
958
|
+
var count = _this.Accr.ZIqy;
|
|
959
|
+
var operator = _this.Accr.KHXB;
|
|
960
|
+
_this.ossY = _this.Ujwy(_this.bfSR - 1, count, operator, false);
|
|
961
|
+
_this.VtGp = _this.ossY;
|
|
962
|
+
// If the condition is already satisfied and if it is page view, no need to vlES
|
|
963
963
|
// This only applies for NAVIGATION_EVENTS
|
|
964
|
-
if (_this.
|
|
964
|
+
if (_this.ossY && _this.Accr.OXAP.lkvT === "APX_PAGE_OPENED") {
|
|
965
965
|
return true;
|
|
966
966
|
}
|
|
967
967
|
}
|
|
968
968
|
if (!respectSequence || index === 0) {
|
|
969
|
-
_this.
|
|
969
|
+
_this.vlES();
|
|
970
970
|
}
|
|
971
971
|
return true;
|
|
972
972
|
}
|
|
973
973
|
} else {
|
|
974
|
-
var _result = _this.
|
|
975
|
-
_this.
|
|
976
|
-
_this.
|
|
974
|
+
var _result = _this.qZyN.parse(condition);
|
|
975
|
+
_this.OfmW = _this.qZyN.PGZU;
|
|
976
|
+
_this.jOBW();
|
|
977
977
|
return true;
|
|
978
978
|
}
|
|
979
979
|
return false;
|
|
980
980
|
});
|
|
981
|
-
_defineProperty(this, "
|
|
981
|
+
_defineProperty(this, "vlES", function () {
|
|
982
982
|
var _window$ApxorRTM;
|
|
983
|
-
var condition = _this.
|
|
984
|
-
var precondition = condition.
|
|
983
|
+
var condition = _this.Accr;
|
|
984
|
+
var precondition = condition.zbHV;
|
|
985
985
|
var ceInstance = CE.getInstance();
|
|
986
|
-
if (precondition.
|
|
987
|
-
_this.
|
|
988
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
986
|
+
if (precondition.ufVL === "app_start") {
|
|
987
|
+
_this.VtGp = true;
|
|
988
|
+
ceInstance.registerForEvent(generateKey(condition.ufVL) + "___" + condition.OXAP.lkvT, _this.shbH);
|
|
989
989
|
} else {
|
|
990
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
990
|
+
ceInstance.registerForEvent(generateKey(condition.ufVL) + "___" + precondition.OXAP.lkvT, _this.shbH);
|
|
991
991
|
}
|
|
992
|
-
if ((_window$ApxorRTM = window.ApxorRTM) !== null && _window$ApxorRTM !== void 0 && _window$ApxorRTM.badgesLists.includes(_this.
|
|
993
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
992
|
+
if ((_window$ApxorRTM = window.ApxorRTM) !== null && _window$ApxorRTM !== void 0 && _window$ApxorRTM.badgesLists.includes(_this.ZPwC)) {
|
|
993
|
+
ceInstance.registerForEvent(generateKey(condition.ufVL) + "___" + "apxor-badge-container-".concat("-".concat(_this.ZPwC).replaceAll(" ", "").replace(/[^\w\s]/gi, "")), _this.shbH);
|
|
994
994
|
}
|
|
995
995
|
});
|
|
996
|
-
_defineProperty(this, "
|
|
997
|
-
var condition = _this.
|
|
996
|
+
_defineProperty(this, "jOBW", function () {
|
|
997
|
+
var condition = _this.qZyN;
|
|
998
998
|
var ceInstance = CE.getInstance();
|
|
999
|
-
_this.
|
|
1000
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
999
|
+
_this.VtGp = true;
|
|
1000
|
+
ceInstance.registerForEvent(generateKey(condition.ufVL) + "___" + condition.OXAP.lkvT, _this.xlta);
|
|
1001
1001
|
});
|
|
1002
|
-
_defineProperty(this, "
|
|
1003
|
-
var _this$
|
|
1002
|
+
_defineProperty(this, "UNmM", function (type, name, time, additionalInfo) {
|
|
1003
|
+
var _this$Accr;
|
|
1004
1004
|
var eventTime = Date.now();
|
|
1005
|
-
var time_differnce = (eventTime - _this.
|
|
1006
|
-
var time_fromConfig = ((_this$
|
|
1005
|
+
var time_differnce = (eventTime - _this.GKyo[name]) / 1000;
|
|
1006
|
+
var time_fromConfig = ((_this$Accr = _this.Accr) === null || _this$Accr === void 0 || (_this$Accr = _this$Accr.OXAP) === null || _this$Accr === void 0 || (_this$Accr = _this$Accr.aoOe) === null || _this$Accr === void 0 ? void 0 : _this$Accr.time) / 1000;
|
|
1007
1007
|
if (time_fromConfig > time_differnce) {
|
|
1008
1008
|
_this._displayCampaign(time);
|
|
1009
1009
|
}
|
|
1010
1010
|
});
|
|
1011
|
-
_defineProperty(this, "
|
|
1011
|
+
_defineProperty(this, "NskH", function (type, name, time, additionalInfo) {
|
|
1012
1012
|
var _this$_condition2, _this$_condition3;
|
|
1013
|
-
_this.
|
|
1013
|
+
_this.VVVx = true;
|
|
1014
1014
|
var currentTime = Date.now();
|
|
1015
|
-
var eventName = (_this$_condition2 = _this.
|
|
1016
|
-
var eventTime = _this.
|
|
1015
|
+
var eventName = (_this$_condition2 = _this.Accr) === null || _this$_condition2 === void 0 || (_this$_condition2 = _this$_condition2.zbHV) === null || _this$_condition2 === void 0 ? void 0 : _this$_condition2.OXAP.lkvT;
|
|
1016
|
+
var eventTime = _this.GKyo[eventName];
|
|
1017
1017
|
var time_differnce = (currentTime - eventTime) / 1000;
|
|
1018
|
-
var time_fromConfig = (_this$_condition3 = _this.
|
|
1018
|
+
var time_fromConfig = (_this$_condition3 = _this.Accr) === null || _this$_condition3 === void 0 || (_this$_condition3 = _this$_condition3.OXAP) === null || _this$_condition3 === void 0 || (_this$_condition3 = _this$_condition3.aoOe) === null || _this$_condition3 === void 0 ? void 0 : _this$_condition3.time;
|
|
1019
1019
|
time_fromConfig = time_fromConfig / 1000;
|
|
1020
1020
|
if (time_fromConfig > time_differnce) {
|
|
1021
1021
|
_this._displayCampaign(time);
|
|
1022
1022
|
}
|
|
1023
1023
|
//unregister the event
|
|
1024
1024
|
});
|
|
1025
|
-
_defineProperty(this, "
|
|
1025
|
+
_defineProperty(this, "shbH", function (type, name, time, additionalInfo) {
|
|
1026
1026
|
var _window$ApxorRTM2, _window$ApxorRTM3;
|
|
1027
1027
|
var ceInstance = CE.getInstance();
|
|
1028
|
-
if (!_this.
|
|
1028
|
+
if (!_this.VtGp) {
|
|
1029
1029
|
// Validate Precondition
|
|
1030
|
-
_this.
|
|
1031
|
-
if (_this.
|
|
1032
|
-
var condition = _this.
|
|
1033
|
-
var precondition = condition.
|
|
1034
|
-
precondition.
|
|
1030
|
+
_this.VtGp = _this.LCMw(type, name, time, additionalInfo);
|
|
1031
|
+
if (_this.VtGp) {
|
|
1032
|
+
var condition = _this.Accr;
|
|
1033
|
+
var precondition = condition.zbHV;
|
|
1034
|
+
precondition.RgIj = time;
|
|
1035
1035
|
//events will be registred by its type activity event_type: "activity_time"
|
|
1036
|
-
if ((condition === null || condition === void 0 ? void 0 : condition.
|
|
1037
|
-
var
|
|
1038
|
-
var event_time = condition === null || condition === void 0 || (
|
|
1039
|
-
if ((condition === null || condition === void 0 || (
|
|
1036
|
+
if ((condition === null || condition === void 0 ? void 0 : condition.ufVL) === "activity_time") {
|
|
1037
|
+
var Accr$OXAP, Accr$_details2, Accr$_details3;
|
|
1038
|
+
var event_time = condition === null || condition === void 0 || (Accr$OXAP = condition.OXAP) === null || Accr$OXAP === void 0 || (Accr$OXAP = Accr$OXAP.aoOe) === null || Accr$OXAP === void 0 ? void 0 : Accr$OXAP.time;
|
|
1039
|
+
if ((condition === null || condition === void 0 || (Accr$_details2 = condition.OXAP) === null || Accr$_details2 === void 0 || (Accr$_details2 = Accr$_details2.aoOe) === null || Accr$_details2 === void 0 ? void 0 : Accr$_details2.nkpi.length) > 0) {
|
|
1040
1040
|
setTimeout(function () {
|
|
1041
|
-
if (!_this.
|
|
1042
|
-
_this.
|
|
1043
|
-
if (_this.
|
|
1044
|
-
_this.
|
|
1045
|
-
_this.
|
|
1046
|
-
if (_this.
|
|
1047
|
-
_this.
|
|
1048
|
-
ceInstance.validate(_this.
|
|
1041
|
+
if (!_this.VVVx) {
|
|
1042
|
+
_this.ossY = true;
|
|
1043
|
+
if (_this.ossY) {
|
|
1044
|
+
_this.OZwB += 1;
|
|
1045
|
+
_this.ossY = _this.Ujwy(_this.OZwB, _this.Accr.ZIqy, _this.Accr.KHXB);
|
|
1046
|
+
if (_this.ossY) {
|
|
1047
|
+
_this.Accr.RgIj = time;
|
|
1048
|
+
ceInstance.validate(_this.ZPwC, _this.DdYx);
|
|
1049
1049
|
}
|
|
1050
1050
|
}
|
|
1051
1051
|
}
|
|
1052
|
-
condition.
|
|
1053
|
-
ceInstance.unregisterFromEvent(toUpperCase(condition.
|
|
1052
|
+
condition.OXAP.aoOe.nkpi.map(function (nokpi) {
|
|
1053
|
+
ceInstance.unregisterFromEvent(toUpperCase(condition.OXAP.aoOe.et) + "___" + nokpi, _this);
|
|
1054
1054
|
});
|
|
1055
1055
|
}, event_time);
|
|
1056
|
-
condition.
|
|
1057
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
1056
|
+
condition.OXAP.aoOe.nkpi.map(function (nokpi) {
|
|
1057
|
+
ceInstance.registerForEvent(toUpperCase(condition.OXAP.aoOe.et) + "___" + nokpi, _this.NskH);
|
|
1058
1058
|
});
|
|
1059
1059
|
}
|
|
1060
1060
|
//it is for unregistering the events did case after completing the time imit
|
|
1061
|
-
if ((condition === null || condition === void 0 || (
|
|
1061
|
+
if ((condition === null || condition === void 0 || (Accr$_details3 = condition.OXAP) === null || Accr$_details3 === void 0 || (Accr$_details3 = Accr$_details3.aoOe) === null || Accr$_details3 === void 0 ? void 0 : Accr$_details3.kpi.length) > 0) {
|
|
1062
1062
|
setTimeout(function () {
|
|
1063
|
-
condition.
|
|
1064
|
-
ceInstance.unregisterFromEvent(toUpperCase(condition.
|
|
1063
|
+
condition.OXAP.aoOe.kpi.map(function (kpi) {
|
|
1064
|
+
ceInstance.unregisterFromEvent(toUpperCase(condition.OXAP.aoOe.et) + "___" + kpi, _this);
|
|
1065
1065
|
});
|
|
1066
1066
|
}, event_time);
|
|
1067
|
-
condition.
|
|
1068
|
-
if (kpi === condition.
|
|
1067
|
+
condition.OXAP.aoOe.kpi.map(function (kpi) {
|
|
1068
|
+
if (kpi === condition.zbHV.OXAP.lkvT) {
|
|
1069
1069
|
//unregister the previous event
|
|
1070
|
-
ceInstance.unregisterFromEvent(generateKey(precondition.
|
|
1071
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
1070
|
+
ceInstance.unregisterFromEvent(generateKey(precondition.ufVL) + "___" + precondition.OXAP.lkvT, _this);
|
|
1071
|
+
ceInstance.registerForEvent(toUpperCase(condition.OXAP.aoOe.et) + "___" + kpi, _this.UNmM);
|
|
1072
1072
|
} else {
|
|
1073
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
1073
|
+
ceInstance.registerForEvent(toUpperCase(condition.OXAP.aoOe.et) + "___" + kpi, _this.NskH);
|
|
1074
1074
|
}
|
|
1075
1075
|
});
|
|
1076
1076
|
}
|
|
1077
1077
|
} else {
|
|
1078
|
-
ceInstance.unregisterFromEvent(generateKey(precondition.
|
|
1079
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
1078
|
+
ceInstance.unregisterFromEvent(generateKey(precondition.ufVL) + "___" + precondition.OXAP.lkvT, _this);
|
|
1079
|
+
ceInstance.registerForEvent(generateKey(condition.ufVL) + "___" + condition.OXAP.lkvT, _this);
|
|
1080
1080
|
}
|
|
1081
|
-
_this.
|
|
1081
|
+
_this.GKyo[name] = Date.now();
|
|
1082
1082
|
}
|
|
1083
1083
|
return;
|
|
1084
1084
|
}
|
|
1085
|
-
if ((_window$ApxorRTM2 = window.ApxorRTM) !== null && _window$ApxorRTM2 !== void 0 && _window$ApxorRTM2.isBadgePresent && (_window$ApxorRTM3 = window.ApxorRTM) !== null && _window$ApxorRTM3 !== void 0 && _window$ApxorRTM3.badgesLists.includes(_this.
|
|
1086
|
-
_this.
|
|
1087
|
-
_this.
|
|
1088
|
-
ceInstance.validate(_this.
|
|
1085
|
+
if ((_window$ApxorRTM2 = window.ApxorRTM) !== null && _window$ApxorRTM2 !== void 0 && _window$ApxorRTM2.isBadgePresent && (_window$ApxorRTM3 = window.ApxorRTM) !== null && _window$ApxorRTM3 !== void 0 && _window$ApxorRTM3.badgesLists.includes(_this.ZPwC) && Apxor.getController().isBadgeTriggerSatisfied(_this.ZPwC)) {
|
|
1086
|
+
_this.ossY = true;
|
|
1087
|
+
_this.Accr.RgIj = time;
|
|
1088
|
+
ceInstance.validate(_this.ZPwC, _this.DdYx);
|
|
1089
1089
|
return;
|
|
1090
1090
|
}
|
|
1091
1091
|
|
|
1092
1092
|
// Validate Condition
|
|
1093
|
-
var validationStatus = generateKey(_this.
|
|
1093
|
+
var validationStatus = generateKey(_this.Accr.ufVL) === type && _this.PIhj(time - _this.Accr.zbHV.RgIj, _this.Accr.PwzV) && _this.Accr.OXAP.lkvT === name && _this.rBGh(_this.Accr.OXAP.aoOe, additionalInfo);
|
|
1094
1094
|
if (validationStatus) {
|
|
1095
|
-
_this.
|
|
1096
|
-
_this.
|
|
1097
|
-
if (_this.
|
|
1098
|
-
_this.
|
|
1099
|
-
ceInstance.validate(_this.
|
|
1095
|
+
_this.OZwB += 1;
|
|
1096
|
+
_this.ossY = _this.Ujwy(_this.OZwB, _this.Accr.ZIqy, _this.Accr.KHXB);
|
|
1097
|
+
if (_this.ossY) {
|
|
1098
|
+
_this.Accr.RgIj = time;
|
|
1099
|
+
ceInstance.validate(_this.ZPwC, _this.DdYx);
|
|
1100
1100
|
}
|
|
1101
1101
|
}
|
|
1102
1102
|
});
|
|
1103
|
-
_defineProperty(this, "
|
|
1103
|
+
_defineProperty(this, "xlta", function (type, name, time, additionalInfo) {
|
|
1104
1104
|
var ceInstance = CE.getInstance();
|
|
1105
|
-
var validationStatus = generateKey(_this.
|
|
1105
|
+
var validationStatus = generateKey(_this.qZyN.ufVL) === type && _this.PIhj(time, _this.qZyN.PwzV) && _this.qZyN.OXAP.lkvT === name && _this.rBGh(_this.qZyN.OXAP.aoOe, additionalInfo);
|
|
1106
1106
|
if (validationStatus) {
|
|
1107
|
-
_this.
|
|
1108
|
-
_this.
|
|
1109
|
-
if (_this.
|
|
1110
|
-
_this.
|
|
1111
|
-
ceInstance.validateForTermination(_this.
|
|
1107
|
+
_this.OZwB += 1;
|
|
1108
|
+
_this.ossY = _this.Ujwy(_this.OZwB, _this.qZyN.ZIqy, _this.qZyN.KHXB);
|
|
1109
|
+
if (_this.ossY) {
|
|
1110
|
+
_this.qZyN.RgIj = time;
|
|
1111
|
+
ceInstance.validateForTermination(_this.ZPwC, _this.DdYx);
|
|
1112
1112
|
}
|
|
1113
1113
|
}
|
|
1114
1114
|
});
|
|
1115
|
-
_defineProperty(this, "
|
|
1116
|
-
var precondition = _this.
|
|
1117
|
-
return generateKey(precondition.
|
|
1115
|
+
_defineProperty(this, "LCMw", function (type, name, time, additionalInfo) {
|
|
1116
|
+
var precondition = _this.Accr.zbHV;
|
|
1117
|
+
return generateKey(precondition.ufVL) === type && precondition.OXAP.lkvT === name && _this.PIhj(time, precondition.PwzV) && _this.rBGh(precondition.OXAP.aoOe, additionalInfo);
|
|
1118
1118
|
});
|
|
1119
|
-
_defineProperty(this, "
|
|
1119
|
+
_defineProperty(this, "PIhj", function (time, timeBounds) {
|
|
1120
1120
|
var currentTime = Math.ceil(time);
|
|
1121
|
-
return currentTime > timeBounds.
|
|
1121
|
+
return currentTime > timeBounds.HWOm && currentTime < timeBounds.xcvA;
|
|
1122
1122
|
});
|
|
1123
|
-
_defineProperty(this, "
|
|
1123
|
+
_defineProperty(this, "Ujwy", function (current, required, operator) {
|
|
1124
1124
|
var checkOld = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
1125
|
-
if (checkOld && _this.
|
|
1126
|
-
current = current + _this.
|
|
1125
|
+
if (checkOld && _this.Accr.PTjs) {
|
|
1126
|
+
current = current + _this.bfSR;
|
|
1127
1127
|
}
|
|
1128
1128
|
switch (operator) {
|
|
1129
1129
|
case "EQ":
|
|
@@ -1140,7 +1140,7 @@
|
|
|
1140
1140
|
return false;
|
|
1141
1141
|
}
|
|
1142
1142
|
});
|
|
1143
|
-
_defineProperty(this, "
|
|
1143
|
+
_defineProperty(this, "rBGh", function (expected, received) {
|
|
1144
1144
|
var status = true;
|
|
1145
1145
|
try {
|
|
1146
1146
|
var _loop = function _loop() {
|
|
@@ -1185,14 +1185,14 @@
|
|
|
1185
1185
|
} else if (type === "b") {
|
|
1186
1186
|
loggedValue = !!loggedValue;
|
|
1187
1187
|
}
|
|
1188
|
-
return
|
|
1188
|
+
return LbJy(loggedValue, expectedValue, operator);
|
|
1189
1189
|
}
|
|
1190
|
-
//
|
|
1190
|
+
// LbJy(loggedValue, expectedValue, operator)
|
|
1191
1191
|
);
|
|
1192
1192
|
|
|
1193
1193
|
status = status && match;
|
|
1194
1194
|
} else {
|
|
1195
|
-
status = status &&
|
|
1195
|
+
status = status && LbJy(received[item], expected[item], "EQ");
|
|
1196
1196
|
}
|
|
1197
1197
|
},
|
|
1198
1198
|
_ret;
|
|
@@ -1211,13 +1211,13 @@
|
|
|
1211
1211
|
key: "_displayCampaign",
|
|
1212
1212
|
value: function _displayCampaign(time) {
|
|
1213
1213
|
var ceInstance = CE.getInstance();
|
|
1214
|
-
this.
|
|
1215
|
-
if (this.
|
|
1216
|
-
this.
|
|
1217
|
-
this.
|
|
1218
|
-
if (this.
|
|
1219
|
-
this.
|
|
1220
|
-
ceInstance.validate(this.
|
|
1214
|
+
this.ossY = true;
|
|
1215
|
+
if (this.ossY) {
|
|
1216
|
+
this.OZwB += 1;
|
|
1217
|
+
this.ossY = this.Ujwy(this.OZwB, this.Accr.ZIqy, this.Accr.KHXB);
|
|
1218
|
+
if (this.ossY) {
|
|
1219
|
+
this.Accr.RgIj = time;
|
|
1220
|
+
ceInstance.validate(this.ZPwC, this.DdYx);
|
|
1221
1221
|
}
|
|
1222
1222
|
}
|
|
1223
1223
|
}
|
|
@@ -1229,11 +1229,11 @@
|
|
|
1229
1229
|
var OverallConfig = /*#__PURE__*/_createClass(function OverallConfig() {
|
|
1230
1230
|
var _this = this;
|
|
1231
1231
|
_classCallCheck(this, OverallConfig);
|
|
1232
|
-
_defineProperty(this, "
|
|
1232
|
+
_defineProperty(this, "XuaJ", []);
|
|
1233
1233
|
_defineProperty(this, "_ret_day", {});
|
|
1234
|
-
_defineProperty(this, "
|
|
1235
|
-
_defineProperty(this, "
|
|
1236
|
-
_defineProperty(this, "
|
|
1234
|
+
_defineProperty(this, "Spio", {});
|
|
1235
|
+
_defineProperty(this, "ufhL", false);
|
|
1236
|
+
_defineProperty(this, "ZqTC", false);
|
|
1237
1237
|
_defineProperty(this, "retainedDaysValidated", true);
|
|
1238
1238
|
_defineProperty(this, "retainedSessionValidated", true);
|
|
1239
1239
|
_defineProperty(this, "eventDoneInLT", false);
|
|
@@ -1241,11 +1241,11 @@
|
|
|
1241
1241
|
_defineProperty(this, "parse", function () {
|
|
1242
1242
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1243
1243
|
try {
|
|
1244
|
-
_this.
|
|
1244
|
+
_this.XuaJ = config.overall_cfg.events;
|
|
1245
1245
|
_this._ret_day = config.overall_cfg.ret_day;
|
|
1246
|
-
_this.
|
|
1247
|
-
_this.
|
|
1248
|
-
_this.
|
|
1246
|
+
_this.Spio = config.overall_cfg.session;
|
|
1247
|
+
_this.ufhL = config.overall_cfg.toggleRetDay;
|
|
1248
|
+
_this.ZqTC = config.overall_cfg.toggleSession;
|
|
1249
1249
|
} catch (error) {
|
|
1250
1250
|
Logger$7.error(error);
|
|
1251
1251
|
return false;
|
|
@@ -1255,11 +1255,11 @@
|
|
|
1255
1255
|
_defineProperty(this, "validate", function () {
|
|
1256
1256
|
var retainedDays = parseInt(Apxor.getController().getFromStorage(APX_RETAINED_DAYS));
|
|
1257
1257
|
var retainedSession = parseInt(Apxor.getController().getFromStorage(APX_RETAINED_SESSIONS));
|
|
1258
|
-
if (_this.
|
|
1258
|
+
if (_this.ufhL && !isNaN(retainedDays) && !(retainedDays >= _this._ret_day.from && retainedDays <= _this._ret_day.to)) {
|
|
1259
1259
|
_this.retainedDaysValidated = false;
|
|
1260
1260
|
return false;
|
|
1261
1261
|
}
|
|
1262
|
-
if (_this.
|
|
1262
|
+
if (_this.ZqTC && !isNaN(retainedSession) && !(retainedSession >= _this.Spio.from && retainedSession <= _this.Spio.to)) {
|
|
1263
1263
|
_this.retainedSessionValidated = false;
|
|
1264
1264
|
return false;
|
|
1265
1265
|
}
|
|
@@ -1268,8 +1268,8 @@
|
|
|
1268
1268
|
var data = Apxor.getController().getFromStorage("_apx_lt_count");
|
|
1269
1269
|
var siteid = Apxor.getSiteId();
|
|
1270
1270
|
var LtCountObjDecoded = JSON.parse(new TextDecoder().decode(stringToArrayBuffer(decode(siteid, data))));
|
|
1271
|
-
for (var i = 0; i < _this.
|
|
1272
|
-
var evName = _this.
|
|
1271
|
+
for (var i = 0; i < _this.XuaJ.length; i++) {
|
|
1272
|
+
var evName = _this.XuaJ[i].name.replace("'", "").replace("’", "");
|
|
1273
1273
|
if (LtCountObjDecoded[evName]) {
|
|
1274
1274
|
_this.eventDoneInLT = true;
|
|
1275
1275
|
return false;
|
|
@@ -1286,14 +1286,14 @@
|
|
|
1286
1286
|
var Attributes = /*#__PURE__*/_createClass(function Attributes() {
|
|
1287
1287
|
var _this = this;
|
|
1288
1288
|
_classCallCheck(this, Attributes);
|
|
1289
|
-
_defineProperty(this, "
|
|
1290
|
-
_defineProperty(this, "
|
|
1289
|
+
_defineProperty(this, "zAFt", []);
|
|
1290
|
+
_defineProperty(this, "VvGB", []);
|
|
1291
1291
|
_defineProperty(this, "parse", function () {
|
|
1292
1292
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1293
1293
|
try {
|
|
1294
|
-
_this.
|
|
1295
|
-
_this.
|
|
1296
|
-
if (!Array.isArray(_this.
|
|
1294
|
+
_this.zAFt = config.attributes.user;
|
|
1295
|
+
_this.VvGB = config.attributes.session;
|
|
1296
|
+
if (!Array.isArray(_this.zAFt) || !Array.isArray(_this.VvGB)) {
|
|
1297
1297
|
Logger$8.error("No attributes");
|
|
1298
1298
|
return false;
|
|
1299
1299
|
}
|
|
@@ -1304,9 +1304,9 @@
|
|
|
1304
1304
|
return true;
|
|
1305
1305
|
});
|
|
1306
1306
|
_defineProperty(this, "validate", function (user, session) {
|
|
1307
|
-
return _this.
|
|
1307
|
+
return _this.IJgZ(user, _this.zAFt) && _this.IJgZ(session, _this.VvGB);
|
|
1308
1308
|
});
|
|
1309
|
-
_defineProperty(this, "
|
|
1309
|
+
_defineProperty(this, "IJgZ", function (attributes, expected) {
|
|
1310
1310
|
var length = expected.length;
|
|
1311
1311
|
var status = true;
|
|
1312
1312
|
try {
|
|
@@ -1336,7 +1336,7 @@
|
|
|
1336
1336
|
}
|
|
1337
1337
|
var match = loggedValues.some(function (loggedValue) {
|
|
1338
1338
|
return values.some(function (configValue) {
|
|
1339
|
-
return
|
|
1339
|
+
return LbJy(loggedValue, configValue, operator);
|
|
1340
1340
|
});
|
|
1341
1341
|
});
|
|
1342
1342
|
status = status && match;
|
|
@@ -1360,18 +1360,18 @@
|
|
|
1360
1360
|
var TimeBasedTermination = /*#__PURE__*/_createClass(function TimeBasedTermination() {
|
|
1361
1361
|
var _this = this;
|
|
1362
1362
|
_classCallCheck(this, TimeBasedTermination);
|
|
1363
|
-
_defineProperty(this, "
|
|
1363
|
+
_defineProperty(this, "LWBN", Apxor.getController());
|
|
1364
1364
|
_defineProperty(this, "type", "");
|
|
1365
1365
|
_defineProperty(this, "_duration_seconds", 0);
|
|
1366
|
-
_defineProperty(this, "
|
|
1366
|
+
_defineProperty(this, "NaUZ", 1);
|
|
1367
1367
|
_defineProperty(this, "parse", function (config) {
|
|
1368
1368
|
try {
|
|
1369
1369
|
var _config$terminate_inf, _config$terminate_inf2, _config$terminate_inf3;
|
|
1370
|
-
_this.
|
|
1370
|
+
_this.kcPk = (_config$terminate_inf = config.terminate_info.time_based) === null || _config$terminate_inf === void 0 ? void 0 : _config$terminate_inf.type;
|
|
1371
1371
|
_this._duration_seconds = (_config$terminate_inf2 = config.terminate_info) === null || _config$terminate_inf2 === void 0 ? void 0 : _config$terminate_inf2.time_based.duration_seconds;
|
|
1372
|
-
_this.
|
|
1373
|
-
if (_this.
|
|
1374
|
-
_this.
|
|
1372
|
+
_this.NaUZ = (_config$terminate_inf3 = config.terminate_info.time_based) === null || _config$terminate_inf3 === void 0 ? void 0 : _config$terminate_inf3.days;
|
|
1373
|
+
if (_this.LbJy(config._id)) {
|
|
1374
|
+
_this.LWBN.persistTerminationInfoLocally(config._id);
|
|
1375
1375
|
return false;
|
|
1376
1376
|
}
|
|
1377
1377
|
} catch (_unused) {
|
|
@@ -1379,16 +1379,16 @@
|
|
|
1379
1379
|
}
|
|
1380
1380
|
return true;
|
|
1381
1381
|
});
|
|
1382
|
-
_defineProperty(this, "
|
|
1382
|
+
_defineProperty(this, "LbJy", function (id) {
|
|
1383
1383
|
var _Data$id;
|
|
1384
|
-
var Data = JSON.parse(_this.
|
|
1384
|
+
var Data = JSON.parse(_this.LWBN.getFromStorage(APX_TERMINATION_ID));
|
|
1385
1385
|
if (!Data[id] || !((_Data$id = Data[id]) !== null && _Data$id !== void 0 && _Data$id.startDate)) return false;
|
|
1386
1386
|
var startDate = new Date(Data[id].startDate);
|
|
1387
1387
|
var presentDate = new Date(getDateInMMDDYYYY());
|
|
1388
1388
|
var diff = parseInt((presentDate - startDate) / (1000 * 60 * 60 * 24), 10);
|
|
1389
1389
|
var currentTime = _getTime();
|
|
1390
|
-
var
|
|
1391
|
-
return diff === _this.
|
|
1390
|
+
var tTTW = Data[id].tTTW;
|
|
1391
|
+
return diff === _this.NaUZ && currentTime.hours >= tTTW.hours || diff > _this.NaUZ || Data[id].goalAcheived;
|
|
1392
1392
|
});
|
|
1393
1393
|
});
|
|
1394
1394
|
|
|
@@ -1397,19 +1397,19 @@
|
|
|
1397
1397
|
_classCallCheck(this, TerminationInfo);
|
|
1398
1398
|
_defineProperty(this, "enable_goal_events", false);
|
|
1399
1399
|
_defineProperty(this, "attributes", {});
|
|
1400
|
-
_defineProperty(this, "
|
|
1401
|
-
_defineProperty(this, "
|
|
1400
|
+
_defineProperty(this, "ahQs", new Attributes());
|
|
1401
|
+
_defineProperty(this, "Cgue", new TimeBasedTermination());
|
|
1402
1402
|
_defineProperty(this, "parse", function () {
|
|
1403
1403
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1404
1404
|
try {
|
|
1405
1405
|
var _config$terminate_inf, _config$terminate_inf2, _config$terminate_inf3;
|
|
1406
1406
|
_this.enable_time_based = config === null || config === void 0 || (_config$terminate_inf = config.terminate_info) === null || _config$terminate_inf === void 0 ? void 0 : _config$terminate_inf.enable_time_based;
|
|
1407
|
-
if (_this.enable_time_based && !_this.
|
|
1407
|
+
if (_this.enable_time_based && !_this.Cgue.parse(config)) {
|
|
1408
1408
|
return false;
|
|
1409
1409
|
}
|
|
1410
1410
|
_this.enable_goal_events = config === null || config === void 0 || (_config$terminate_inf2 = config.terminate_info) === null || _config$terminate_inf2 === void 0 ? void 0 : _config$terminate_inf2.enable_goal_events;
|
|
1411
1411
|
_this.enable_attributes = config === null || config === void 0 || (_config$terminate_inf3 = config.terminate_info) === null || _config$terminate_inf3 === void 0 ? void 0 : _config$terminate_inf3.enable_attributes;
|
|
1412
|
-
if (_this.enable_attributes && !_this.
|
|
1412
|
+
if (_this.enable_attributes && !_this.ahQs.parse(config.terminate_info)) {
|
|
1413
1413
|
return false;
|
|
1414
1414
|
}
|
|
1415
1415
|
} catch (error) {
|
|
@@ -1419,27 +1419,27 @@
|
|
|
1419
1419
|
return true;
|
|
1420
1420
|
});
|
|
1421
1421
|
_defineProperty(this, "validate", function (user, session) {
|
|
1422
|
-
return _this.
|
|
1422
|
+
return _this.ahQs.validate(user, session);
|
|
1423
1423
|
});
|
|
1424
1424
|
});
|
|
1425
1425
|
|
|
1426
1426
|
var Binding = /*#__PURE__*/_createClass(function Binding() {
|
|
1427
1427
|
var _this = this;
|
|
1428
1428
|
_classCallCheck(this, Binding);
|
|
1429
|
-
_defineProperty(this, "
|
|
1430
|
-
_defineProperty(this, "
|
|
1431
|
-
_defineProperty(this, "
|
|
1432
|
-
_defineProperty(this, "
|
|
1429
|
+
_defineProperty(this, "FgUq", "");
|
|
1430
|
+
_defineProperty(this, "hQfM", "");
|
|
1431
|
+
_defineProperty(this, "ZnGX", "");
|
|
1432
|
+
_defineProperty(this, "zVUj", "");
|
|
1433
1433
|
_defineProperty(this, "parse", function () {
|
|
1434
1434
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1435
1435
|
try {
|
|
1436
|
-
_this.
|
|
1437
|
-
if (!_this.
|
|
1436
|
+
_this.FgUq = config === null || config === void 0 ? void 0 : config.screen_binding;
|
|
1437
|
+
if (!_this.FgUq) {
|
|
1438
1438
|
return true;
|
|
1439
1439
|
} else {
|
|
1440
|
-
_this.
|
|
1441
|
-
_this.
|
|
1442
|
-
_this.
|
|
1440
|
+
_this.hQfM = config === null || config === void 0 ? void 0 : config.binding.url;
|
|
1441
|
+
_this.ZnGX = config === null || config === void 0 ? void 0 : config.binding["var"];
|
|
1442
|
+
_this.zVUj = config === null || config === void 0 ? void 0 : config.binding.operator;
|
|
1443
1443
|
return true;
|
|
1444
1444
|
}
|
|
1445
1445
|
} catch (error) {
|
|
@@ -1454,11 +1454,11 @@
|
|
|
1454
1454
|
* operator :operator can be either "EQ" used for equality comparision or "SW" used for startswith comparision
|
|
1455
1455
|
*/
|
|
1456
1456
|
_defineProperty(this, "validate", function () {
|
|
1457
|
-
var url = _this.
|
|
1458
|
-
var variable = _this.
|
|
1459
|
-
var operator = _this.
|
|
1457
|
+
var url = _this.hQfM;
|
|
1458
|
+
var variable = _this.ZnGX;
|
|
1459
|
+
var operator = _this.zVUj;
|
|
1460
1460
|
var currentUrl = window.location.href;
|
|
1461
|
-
if (!_this.
|
|
1461
|
+
if (!_this.FgUq) {
|
|
1462
1462
|
return true;
|
|
1463
1463
|
} else {
|
|
1464
1464
|
if (operator === "EQ") {
|
|
@@ -1500,23 +1500,23 @@
|
|
|
1500
1500
|
var ConfigItem = /*#__PURE__*/_createClass(function ConfigItem() {
|
|
1501
1501
|
var _this = this;
|
|
1502
1502
|
_classCallCheck(this, ConfigItem);
|
|
1503
|
-
_defineProperty(this, "
|
|
1504
|
-
_defineProperty(this, "
|
|
1505
|
-
_defineProperty(this, "
|
|
1506
|
-
_defineProperty(this, "
|
|
1507
|
-
_defineProperty(this, "
|
|
1508
|
-
_defineProperty(this, "
|
|
1509
|
-
_defineProperty(this, "
|
|
1510
|
-
_defineProperty(this, "
|
|
1511
|
-
_defineProperty(this, "
|
|
1512
|
-
_defineProperty(this, "
|
|
1513
|
-
_defineProperty(this, "
|
|
1514
|
-
_defineProperty(this, "
|
|
1503
|
+
_defineProperty(this, "dUpZ", []);
|
|
1504
|
+
_defineProperty(this, "jZdL", []);
|
|
1505
|
+
_defineProperty(this, "ZPwC", "");
|
|
1506
|
+
_defineProperty(this, "WkEQ", new Meta());
|
|
1507
|
+
_defineProperty(this, "Vdjb", new Audience());
|
|
1508
|
+
_defineProperty(this, "MnIa", new Validity());
|
|
1509
|
+
_defineProperty(this, "wmft", new Frequency());
|
|
1510
|
+
_defineProperty(this, "ufwV", new OverallConfig());
|
|
1511
|
+
_defineProperty(this, "erWN", new TerminationInfo());
|
|
1512
|
+
_defineProperty(this, "zFMC", new Binding());
|
|
1513
|
+
_defineProperty(this, "LaSX", false);
|
|
1514
|
+
_defineProperty(this, "SYtP", []);
|
|
1515
1515
|
_defineProperty(this, "_variant_code", "");
|
|
1516
1516
|
_defineProperty(this, "parse", function () {
|
|
1517
1517
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1518
1518
|
try {
|
|
1519
|
-
var _this$
|
|
1519
|
+
var _this$WkEQ$_attr;
|
|
1520
1520
|
// If ID is not present, throw it out
|
|
1521
1521
|
if (!isDefined(config._id)) {
|
|
1522
1522
|
Logger$9.error("No Id");
|
|
@@ -1530,18 +1530,18 @@
|
|
|
1530
1530
|
}
|
|
1531
1531
|
|
|
1532
1532
|
// If META, VALIDITY, FREQUENCY and AUDIENCE is not parsed properly, throw it out
|
|
1533
|
-
if (!(_this.
|
|
1533
|
+
if (!(_this.WkEQ.parse(config) && _this.MnIa.parse(config) && _this.wmft.parse(config) && _this.Vdjb.parse(config) && _this.ufwV.parse(config) && _this.erWN.parse(config) && _this.zFMC.parse(config))) {
|
|
1534
1534
|
return false;
|
|
1535
1535
|
}
|
|
1536
|
-
_this._variant_code = _this.
|
|
1536
|
+
_this._variant_code = _this.WkEQ._isExperiment || _this.WkEQ._only_context ? (_this$WkEQ$_attr = _this.WkEQ._attr) === null || _this$WkEQ$_attr === void 0 ? void 0 : _this$WkEQ$_attr[APX_VARIANT_CODE] : "TG";
|
|
1537
1537
|
// If there are no conditions, throw it out
|
|
1538
1538
|
if (!isDefined(config.conditions) || !Array.isArray(config.conditions)) {
|
|
1539
1539
|
Logger$9.error("No valid conditions", config.conditions);
|
|
1540
1540
|
return false;
|
|
1541
1541
|
}
|
|
1542
|
-
_this.
|
|
1543
|
-
_this.
|
|
1544
|
-
if (_this.
|
|
1542
|
+
_this.ZPwC = config._id;
|
|
1543
|
+
_this.LaSX = isDefined(config.sequence_enabled) ? config.sequence_enabled : false;
|
|
1544
|
+
if (_this.LaSX) {
|
|
1545
1545
|
// iff respectSequence is true, Sort the Conditions by their sequence order
|
|
1546
1546
|
// We need to sort, if server sends them in orderless manner
|
|
1547
1547
|
config.conditions.sort(function (prev, current) {
|
|
@@ -1554,20 +1554,20 @@
|
|
|
1554
1554
|
var length = conditions.length;
|
|
1555
1555
|
var no_context_enabled = config === null || config === void 0 ? void 0 : config.no_context_enabled;
|
|
1556
1556
|
if (length === 0 && no_context_enabled) {
|
|
1557
|
-
_this.
|
|
1557
|
+
_this.UvBk();
|
|
1558
1558
|
}
|
|
1559
1559
|
var _loop = function _loop() {
|
|
1560
|
-
_this.
|
|
1560
|
+
_this.SYtP = [];
|
|
1561
1561
|
var condition = conditions[index];
|
|
1562
1562
|
if (condition.type === "didn't") {
|
|
1563
|
-
var
|
|
1563
|
+
var Accr$details;
|
|
1564
1564
|
var obj = {
|
|
1565
1565
|
trigger_key: condition.trigger.details.name,
|
|
1566
|
-
no_kpi_array: condition === null || condition === void 0 || (
|
|
1566
|
+
no_kpi_array: condition === null || condition === void 0 || (Accr$details = condition.details) === null || Accr$details === void 0 || (Accr$details = Accr$details.additional_info) === null || Accr$details === void 0 ? void 0 : Accr$details.nkpi,
|
|
1567
1567
|
condition_id: condition === null || condition === void 0 ? void 0 : condition._id,
|
|
1568
1568
|
time_bounds: condition.time_bounds.upper
|
|
1569
1569
|
};
|
|
1570
|
-
_this.
|
|
1570
|
+
_this.SYtP = [].concat(_toConsumableArray(_this.SYtP), [obj]);
|
|
1571
1571
|
//this will be the key
|
|
1572
1572
|
//when event occur check this array and then then check the time
|
|
1573
1573
|
//check the time diffrence
|
|
@@ -1576,16 +1576,16 @@
|
|
|
1576
1576
|
}
|
|
1577
1577
|
|
|
1578
1578
|
var conditionValidator = new ConditionValidator();
|
|
1579
|
-
if (conditionValidator.initialize(condition, _this.
|
|
1580
|
-
_this.
|
|
1579
|
+
if (conditionValidator.initialize(condition, _this.ZPwC, index, _this.LaSX, _this.SYtP)) {
|
|
1580
|
+
_this.dUpZ.push(conditionValidator);
|
|
1581
1581
|
var max_retries = (condition === null || condition === void 0 ? void 0 : condition.timeout) / (condition === null || condition === void 0 ? void 0 : condition.findinterval);
|
|
1582
1582
|
var frame_id = (condition === null || condition === void 0 ? void 0 : condition.frameid) || "";
|
|
1583
1583
|
var url = condition === null || condition === void 0 ? void 0 : condition.url;
|
|
1584
1584
|
if (window.location.href === url) {
|
|
1585
1585
|
if (condition.event_type === "view_visibility") {
|
|
1586
1586
|
if (_findTargetElement(condition.view_id, frame_id, condition === null || condition === void 0 ? void 0 : condition.enable_retry, condition === null || condition === void 0 ? void 0 : condition.findinterval, max_retries) === true) {
|
|
1587
|
-
//this.
|
|
1588
|
-
_this.
|
|
1587
|
+
//this.vlES();
|
|
1588
|
+
_this.UvBk(true);
|
|
1589
1589
|
}
|
|
1590
1590
|
}
|
|
1591
1591
|
}
|
|
@@ -1595,8 +1595,8 @@
|
|
|
1595
1595
|
if (window.location.href === url) {
|
|
1596
1596
|
if (condition.event_type === "view_visibility") {
|
|
1597
1597
|
if (_findTargetElement(condition.view_id, frame_id, condition === null || condition === void 0 ? void 0 : condition.enable_retry, condition === null || condition === void 0 ? void 0 : condition.findinterval, max_retries) === true) {
|
|
1598
|
-
//this.
|
|
1599
|
-
_this.
|
|
1598
|
+
//this.vlES();
|
|
1599
|
+
_this.UvBk(true);
|
|
1600
1600
|
}
|
|
1601
1601
|
}
|
|
1602
1602
|
}
|
|
@@ -1606,114 +1606,114 @@
|
|
|
1606
1606
|
for (var index = 0; index < length; index++) {
|
|
1607
1607
|
_loop();
|
|
1608
1608
|
}
|
|
1609
|
-
if (_this.
|
|
1609
|
+
if (_this.erWN.enable_goal_events) {
|
|
1610
1610
|
var goal_events = config.terminate_info.goal_events.events;
|
|
1611
1611
|
var goaleventslength = goal_events.length;
|
|
1612
1612
|
for (var i = 0; i < goaleventslength; i++) {
|
|
1613
1613
|
var conditionValidator = new ConditionValidator();
|
|
1614
|
-
if (conditionValidator.initialize(goal_events[i], _this.
|
|
1615
|
-
_this.
|
|
1614
|
+
if (conditionValidator.initialize(goal_events[i], _this.ZPwC, i, true, [], "termination")) {
|
|
1615
|
+
_this.jZdL.push(conditionValidator);
|
|
1616
1616
|
}
|
|
1617
1617
|
}
|
|
1618
1618
|
}
|
|
1619
|
-
return _this.
|
|
1619
|
+
return _this.dUpZ.length > 0;
|
|
1620
1620
|
} catch (error) {
|
|
1621
1621
|
Logger$9.error(error);
|
|
1622
1622
|
return false;
|
|
1623
1623
|
}
|
|
1624
1624
|
});
|
|
1625
|
-
_defineProperty(this, "
|
|
1625
|
+
_defineProperty(this, "fZkd", function (index) {
|
|
1626
1626
|
if (index < 0) {
|
|
1627
1627
|
return;
|
|
1628
1628
|
}
|
|
1629
|
-
if (_this.
|
|
1630
|
-
var conditionValidator = _this.
|
|
1631
|
-
if (isDefined(conditionValidator) && conditionValidator.
|
|
1629
|
+
if (_this.LaSX) {
|
|
1630
|
+
var conditionValidator = _this.dUpZ[index];
|
|
1631
|
+
if (isDefined(conditionValidator) && conditionValidator.ossY) {
|
|
1632
1632
|
// Check if previous validator is satisfied
|
|
1633
|
-
var prevValidator = _this.
|
|
1634
|
-
if (isDefined(prevValidator) && !prevValidator.
|
|
1633
|
+
var prevValidator = _this.dUpZ[index - 1];
|
|
1634
|
+
if (isDefined(prevValidator) && !prevValidator.ossY) {
|
|
1635
1635
|
// TODO: If current index is satisfied before previous one, do something
|
|
1636
1636
|
// either unregister all conditions or remove this item from ConfigLookup
|
|
1637
1637
|
return;
|
|
1638
1638
|
}
|
|
1639
|
-
var nextValidator = _this.
|
|
1639
|
+
var nextValidator = _this.dUpZ[index + 1];
|
|
1640
1640
|
if (!isDefined(nextValidator)) {
|
|
1641
1641
|
// It means this is the last condition
|
|
1642
1642
|
// Validate all conditions
|
|
1643
|
-
_this.
|
|
1643
|
+
_this.UvBk();
|
|
1644
1644
|
} else {
|
|
1645
|
-
nextValidator.
|
|
1645
|
+
nextValidator.vlES();
|
|
1646
1646
|
}
|
|
1647
1647
|
}
|
|
1648
1648
|
} else {
|
|
1649
1649
|
// Validate all conditions
|
|
1650
|
-
_this.
|
|
1650
|
+
_this.UvBk();
|
|
1651
1651
|
}
|
|
1652
1652
|
});
|
|
1653
|
-
_defineProperty(this, "
|
|
1653
|
+
_defineProperty(this, "CWHG", function (index) {
|
|
1654
1654
|
if (index < 0) {
|
|
1655
1655
|
return;
|
|
1656
1656
|
}
|
|
1657
|
-
_this.
|
|
1657
|
+
_this.ZoLa();
|
|
1658
1658
|
});
|
|
1659
|
-
_defineProperty(this, "
|
|
1659
|
+
_defineProperty(this, "UvBk", function () {
|
|
1660
1660
|
var _window$ApxorRTM, _window$ApxorRTM2;
|
|
1661
1661
|
var view_visibility = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
1662
1662
|
// Check If Audience, Validity is satisfied or not
|
|
1663
1663
|
var userAttributes = Apxor.getController().getUserAttributes();
|
|
1664
1664
|
var sessionAttributes = Apxor.getController().getSessionAttributes();
|
|
1665
|
-
if (!((_window$ApxorRTM = window.ApxorRTM) !== null && _window$ApxorRTM !== void 0 && _window$ApxorRTM.isBadgePresent && (_window$ApxorRTM2 = window.ApxorRTM) !== null && _window$ApxorRTM2 !== void 0 && _window$ApxorRTM2.badgesLists.includes(_this.
|
|
1665
|
+
if (!((_window$ApxorRTM = window.ApxorRTM) !== null && _window$ApxorRTM !== void 0 && _window$ApxorRTM.isBadgePresent && (_window$ApxorRTM2 = window.ApxorRTM) !== null && _window$ApxorRTM2 !== void 0 && _window$ApxorRTM2.badgesLists.includes(_this.ZPwC) && Apxor.getController().isBadgeTriggerSatisfied(_this.ZPwC))) {
|
|
1666
1666
|
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_trigger_satisfied", {
|
|
1667
|
-
apx_nudge_type: _this.
|
|
1668
|
-
apx_nudge_id: _this.
|
|
1669
|
-
apx_nudge_name: _this.
|
|
1670
|
-
apx_variant_code: _this.
|
|
1667
|
+
apx_nudge_type: _this.WkEQ.kcPk === "SURVEY" ? "survey" : "campaign",
|
|
1668
|
+
apx_nudge_id: _this.ZPwC,
|
|
1669
|
+
apx_nudge_name: _this.WkEQ.lkvT,
|
|
1670
|
+
apx_variant_code: _this.WkEQ._isExperiment || _this.WkEQ._only_context ? _this.WkEQ._attr[APX_VARIANT_CODE] : "TG"
|
|
1671
1671
|
});
|
|
1672
1672
|
}
|
|
1673
|
-
if (!_this.
|
|
1674
|
-
if (!_this.
|
|
1675
|
-
_this.
|
|
1673
|
+
if (!_this.MnIa.validate() || !_this.Vdjb.validate(userAttributes, sessionAttributes) || !_this.ufwV.validate() || !_this.zFMC.validate()) {
|
|
1674
|
+
if (!_this.ufwV.retainedDaysValidated) {
|
|
1675
|
+
_this.xZni("Retained day criteria not met");
|
|
1676
1676
|
return;
|
|
1677
1677
|
}
|
|
1678
|
-
if (!_this.
|
|
1679
|
-
_this.
|
|
1678
|
+
if (!_this.ufwV.retainedSessionValidated) {
|
|
1679
|
+
_this.xZni("User session criteria not met");
|
|
1680
1680
|
return;
|
|
1681
1681
|
}
|
|
1682
|
-
if (_this.
|
|
1683
|
-
_this.
|
|
1682
|
+
if (_this.ufwV.eventDoneInLT) {
|
|
1683
|
+
_this.xZni("Event done in life time");
|
|
1684
1684
|
return;
|
|
1685
1685
|
}
|
|
1686
|
-
if (!_this.
|
|
1687
|
-
_this.
|
|
1686
|
+
if (!_this.Vdjb.userAttributesValidated) {
|
|
1687
|
+
_this.xZni("User property filter not met");
|
|
1688
1688
|
return;
|
|
1689
1689
|
}
|
|
1690
|
-
if (!_this.
|
|
1691
|
-
_this.
|
|
1690
|
+
if (!_this.Vdjb.sessionAttributeValidated) {
|
|
1691
|
+
_this.xZni("Session property filter not met");
|
|
1692
1692
|
return;
|
|
1693
1693
|
}
|
|
1694
|
-
if (_this.
|
|
1695
|
-
_this.
|
|
1694
|
+
if (_this.MnIa._not_in_specified_time) {
|
|
1695
|
+
_this.xZni("Time limits check failed");
|
|
1696
1696
|
return;
|
|
1697
1697
|
}
|
|
1698
|
-
if (_this.
|
|
1699
|
-
_this.
|
|
1698
|
+
if (_this.MnIa._not_yet_active) {
|
|
1699
|
+
_this.xZni("not in the scheduled time");
|
|
1700
1700
|
return;
|
|
1701
1701
|
}
|
|
1702
|
-
if (_this.
|
|
1703
|
-
_this.
|
|
1702
|
+
if (_this.MnIa._nudge_expired) {
|
|
1703
|
+
_this.xZni("nudge expired");
|
|
1704
1704
|
return;
|
|
1705
1705
|
}
|
|
1706
1706
|
return;
|
|
1707
1707
|
}
|
|
1708
|
-
var length = _this.
|
|
1708
|
+
var length = _this.dUpZ.length;
|
|
1709
1709
|
var isSatisfied = length < 1;
|
|
1710
1710
|
var combineOperator = "";
|
|
1711
1711
|
if (length === 0) {
|
|
1712
1712
|
isSatisfied = true;
|
|
1713
1713
|
}
|
|
1714
1714
|
for (var index = 0; index < length; index++) {
|
|
1715
|
-
var validator = _this.
|
|
1716
|
-
var currentResult = validator.
|
|
1715
|
+
var validator = _this.dUpZ[index];
|
|
1716
|
+
var currentResult = validator.ossY;
|
|
1717
1717
|
if (combineOperator.trim() === "") {
|
|
1718
1718
|
isSatisfied = currentResult;
|
|
1719
1719
|
} else {
|
|
@@ -1726,7 +1726,7 @@
|
|
|
1726
1726
|
break;
|
|
1727
1727
|
}
|
|
1728
1728
|
}
|
|
1729
|
-
combineOperator = validator.
|
|
1729
|
+
combineOperator = validator.PGZU;
|
|
1730
1730
|
}
|
|
1731
1731
|
if (view_visibility === true) {
|
|
1732
1732
|
isSatisfied = true;
|
|
@@ -1734,10 +1734,10 @@
|
|
|
1734
1734
|
if (isSatisfied) {
|
|
1735
1735
|
console.debug("onCondition satisfied");
|
|
1736
1736
|
// Check if count reached it's maximum
|
|
1737
|
-
if (!_this.
|
|
1738
|
-
console.warn("Maximum limit reached", _this.
|
|
1737
|
+
if (!_this.wmft.atfr(_this.ZPwC)) {
|
|
1738
|
+
console.warn("Maximum limit reached", _this.ZPwC);
|
|
1739
1739
|
if (Apxor.getController().isTestDevice()) {
|
|
1740
|
-
feedBackMessagePopUpCE("Maximum limit reached for campaign name ".concat(_this.
|
|
1740
|
+
feedBackMessagePopUpCE("Maximum limit reached for campaign name ".concat(_this.WkEQ.lkvT));
|
|
1741
1741
|
var closeButton = document.getElementById("close-button");
|
|
1742
1742
|
var dismissCallback = function dismissCallback() {
|
|
1743
1743
|
var modal_popup_container = document.getElementById("apx-container");
|
|
@@ -1751,36 +1751,36 @@
|
|
|
1751
1751
|
|
|
1752
1752
|
//logging event for view not found for test device
|
|
1753
1753
|
|
|
1754
|
-
console.log("Dispatching event", _this.
|
|
1754
|
+
console.log("Dispatching event", _this.WkEQ.kcPk);
|
|
1755
1755
|
|
|
1756
|
-
//if (this.
|
|
1756
|
+
//if (this.WkEQ._only_context === true) {
|
|
1757
1757
|
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({
|
|
1758
|
-
apx_nudge_type: _this.
|
|
1759
|
-
apx_nudge_id: _this.
|
|
1760
|
-
apx_nudge_name: _this.
|
|
1761
|
-
apx_variant_code: _this.
|
|
1762
|
-
}, _this.
|
|
1763
|
-
message_name: _this.
|
|
1764
|
-
id: _this.
|
|
1758
|
+
apx_nudge_type: _this.WkEQ.kcPk === "SURVEY" ? "survey" : "campaign",
|
|
1759
|
+
apx_nudge_id: _this.ZPwC,
|
|
1760
|
+
apx_nudge_name: _this.WkEQ.lkvT,
|
|
1761
|
+
apx_variant_code: _this.WkEQ._isExperiment || _this.WkEQ._only_context ? _this.WkEQ._attr[APX_VARIANT_CODE] : "TG"
|
|
1762
|
+
}, _this.WkEQ._attr), {}, {
|
|
1763
|
+
message_name: _this.WkEQ.lkvT,
|
|
1764
|
+
id: _this.ZPwC
|
|
1765
1765
|
}));
|
|
1766
1766
|
//}
|
|
1767
1767
|
// Emit event
|
|
1768
|
-
Apxor.getController().dispatchEvent(_this.
|
|
1769
|
-
name: _this.
|
|
1768
|
+
Apxor.getController().dispatchEvent(_this.WkEQ.kcPk, {
|
|
1769
|
+
name: _this.WkEQ.kcPk,
|
|
1770
1770
|
additional_info: {
|
|
1771
|
-
uuid: _this.
|
|
1772
|
-
name: _this.
|
|
1771
|
+
uuid: _this.ZPwC,
|
|
1772
|
+
name: _this.WkEQ.lkvT
|
|
1773
1773
|
}
|
|
1774
1774
|
});
|
|
1775
1775
|
}
|
|
1776
1776
|
});
|
|
1777
|
-
_defineProperty(this, "
|
|
1778
|
-
var length = _this.
|
|
1777
|
+
_defineProperty(this, "ZoLa", function () {
|
|
1778
|
+
var length = _this.jZdL.length;
|
|
1779
1779
|
var isSatisfied = length < 1;
|
|
1780
1780
|
var combineOperator = "";
|
|
1781
1781
|
for (var index = 0; index < length; index++) {
|
|
1782
|
-
var validator = _this.
|
|
1783
|
-
var currentResult = validator.
|
|
1782
|
+
var validator = _this.jZdL[index];
|
|
1783
|
+
var currentResult = validator.ossY;
|
|
1784
1784
|
if (combineOperator.trim() === "") {
|
|
1785
1785
|
isSatisfied = currentResult;
|
|
1786
1786
|
} else {
|
|
@@ -1793,23 +1793,23 @@
|
|
|
1793
1793
|
break;
|
|
1794
1794
|
}
|
|
1795
1795
|
}
|
|
1796
|
-
combineOperator = validator.
|
|
1796
|
+
combineOperator = validator.OfmW;
|
|
1797
1797
|
}
|
|
1798
1798
|
if (isSatisfied) {
|
|
1799
|
-
console.log("Dispatching event", _this.
|
|
1800
|
-
Apxor.getController().persistTerminationInfoLocally(_this.
|
|
1801
|
-
if (_this.
|
|
1802
|
-
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.
|
|
1803
|
-
message_name: _this.
|
|
1804
|
-
id: _this.
|
|
1799
|
+
console.log("Dispatching event", _this.WkEQ.kcPk);
|
|
1800
|
+
Apxor.getController().persistTerminationInfoLocally(_this.ZPwC);
|
|
1801
|
+
if (_this.WkEQ._only_context === true) {
|
|
1802
|
+
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.WkEQ._attr), {}, {
|
|
1803
|
+
message_name: _this.WkEQ.lkvT,
|
|
1804
|
+
id: _this.ZPwC
|
|
1805
1805
|
}));
|
|
1806
1806
|
}
|
|
1807
1807
|
// Emit event
|
|
1808
|
-
Apxor.getController().dispatchEvent(_this.
|
|
1809
|
-
name: _this.
|
|
1808
|
+
Apxor.getController().dispatchEvent(_this.WkEQ.kcPk, {
|
|
1809
|
+
name: _this.WkEQ.kcPk,
|
|
1810
1810
|
additional_info: {
|
|
1811
|
-
uuid: _this.
|
|
1812
|
-
name: _this.
|
|
1811
|
+
uuid: _this.ZPwC,
|
|
1812
|
+
name: _this.WkEQ.lkvT
|
|
1813
1813
|
}
|
|
1814
1814
|
});
|
|
1815
1815
|
}
|
|
@@ -1817,24 +1817,24 @@
|
|
|
1817
1817
|
_defineProperty(this, "validateForTerminationAttributes", function () {
|
|
1818
1818
|
var userAttributes = Apxor.getController().getUserAttributes();
|
|
1819
1819
|
var sessionAttributes = Apxor.getController().getSessionAttributes();
|
|
1820
|
-
return _this.
|
|
1820
|
+
return _this.erWN.validate(userAttributes, sessionAttributes);
|
|
1821
1821
|
});
|
|
1822
|
-
_defineProperty(this, "
|
|
1823
|
-
_this.
|
|
1822
|
+
_defineProperty(this, "dRwe", function () {
|
|
1823
|
+
_this.wmft.dRwe();
|
|
1824
1824
|
});
|
|
1825
1825
|
_defineProperty(this, "getFrequencyCount", function () {
|
|
1826
|
-
return _this.
|
|
1826
|
+
return _this.wmft.getFrequencyCount();
|
|
1827
1827
|
});
|
|
1828
|
-
_defineProperty(this, "
|
|
1829
|
-
return _this.
|
|
1828
|
+
_defineProperty(this, "fucO", function () {
|
|
1829
|
+
return _this.wmft.UcJn();
|
|
1830
1830
|
});
|
|
1831
|
-
_defineProperty(this, "
|
|
1832
|
-
var _this$
|
|
1831
|
+
_defineProperty(this, "xZni", function (reason) {
|
|
1832
|
+
var _this$WkEQ$_attr2;
|
|
1833
1833
|
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
|
|
1834
|
-
apx_nudge_type: _this.
|
|
1835
|
-
apx_nudge_id: _this.
|
|
1836
|
-
apx_nudge_name: _this.
|
|
1837
|
-
apx_variant_code: _this.
|
|
1834
|
+
apx_nudge_type: _this.WkEQ.kcPk === "SURVEY" ? "survey" : "campaign",
|
|
1835
|
+
apx_nudge_id: _this.ZPwC,
|
|
1836
|
+
apx_nudge_name: _this.WkEQ.lkvT,
|
|
1837
|
+
apx_variant_code: _this.WkEQ._isExperiment || _this.WkEQ._only_context ? (_this$WkEQ$_attr2 = _this.WkEQ._attr) === null || _this$WkEQ$_attr2 === void 0 ? void 0 : _this$WkEQ$_attr2[APX_VARIANT_CODE] : "TG",
|
|
1838
1838
|
apx_failure_type: "warn",
|
|
1839
1839
|
apx_reason: reason
|
|
1840
1840
|
});
|
|
@@ -1844,7 +1844,7 @@
|
|
|
1844
1844
|
var ConfigLookup = /*#__PURE__*/_createClass(function ConfigLookup() {
|
|
1845
1845
|
var _this = this;
|
|
1846
1846
|
_classCallCheck(this, ConfigLookup);
|
|
1847
|
-
_defineProperty(this, "
|
|
1847
|
+
_defineProperty(this, "RmJl", {});
|
|
1848
1848
|
_defineProperty(this, "parse", function () {
|
|
1849
1849
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
1850
1850
|
configs: []
|
|
@@ -1867,7 +1867,7 @@
|
|
|
1867
1867
|
var configId = _config._id;
|
|
1868
1868
|
var configItem = new ConfigItem();
|
|
1869
1869
|
if (configItem.parse(_config)) {
|
|
1870
|
-
_this.
|
|
1870
|
+
_this.RmJl[configId] = configItem;
|
|
1871
1871
|
} else {
|
|
1872
1872
|
console.warn("Failed to parse cfg", configId);
|
|
1873
1873
|
}
|
|
@@ -1875,51 +1875,51 @@
|
|
|
1875
1875
|
}
|
|
1876
1876
|
});
|
|
1877
1877
|
_defineProperty(this, "validate", function (id, index) {
|
|
1878
|
-
if (_this.
|
|
1879
|
-
var configItem = _this.
|
|
1880
|
-
configItem.
|
|
1878
|
+
if (_this.RmJl[id]) {
|
|
1879
|
+
var configItem = _this.RmJl[id];
|
|
1880
|
+
configItem.fZkd(index);
|
|
1881
1881
|
}
|
|
1882
1882
|
});
|
|
1883
1883
|
_defineProperty(this, "getVariantCode", function (id) {
|
|
1884
|
-
if (_this.
|
|
1885
|
-
var configItem = _this.
|
|
1884
|
+
if (_this.RmJl[id]) {
|
|
1885
|
+
var configItem = _this.RmJl[id];
|
|
1886
1886
|
return configItem._variant_code;
|
|
1887
1887
|
}
|
|
1888
1888
|
return "";
|
|
1889
1889
|
});
|
|
1890
1890
|
_defineProperty(this, "validateForTermination", function (id, index) {
|
|
1891
|
-
if (_this.
|
|
1892
|
-
var configItem = _this.
|
|
1893
|
-
configItem.
|
|
1891
|
+
if (_this.RmJl[id]) {
|
|
1892
|
+
var configItem = _this.RmJl[id];
|
|
1893
|
+
configItem.CWHG(index);
|
|
1894
1894
|
}
|
|
1895
1895
|
});
|
|
1896
1896
|
_defineProperty(this, "validateForTerminationAttributes", function (id) {
|
|
1897
|
-
if (_this.
|
|
1898
|
-
var configItem = _this.
|
|
1897
|
+
if (_this.RmJl[id]) {
|
|
1898
|
+
var configItem = _this.RmJl[id];
|
|
1899
1899
|
return configItem.validateForTerminationAttributes();
|
|
1900
1900
|
}
|
|
1901
1901
|
return false;
|
|
1902
1902
|
});
|
|
1903
|
-
_defineProperty(this, "
|
|
1904
|
-
var campiagnConfig = _this.
|
|
1905
|
-
campiagnConfig.
|
|
1903
|
+
_defineProperty(this, "dRwe", function (id) {
|
|
1904
|
+
var campiagnConfig = _this.RmJl[id];
|
|
1905
|
+
campiagnConfig.dRwe();
|
|
1906
1906
|
});
|
|
1907
1907
|
_defineProperty(this, "getFrequencyCount", function (id) {
|
|
1908
|
-
var campiagnConfig = _this.
|
|
1908
|
+
var campiagnConfig = _this.RmJl[id];
|
|
1909
1909
|
if (campiagnConfig != undefined) return campiagnConfig.getFrequencyCount();
|
|
1910
1910
|
});
|
|
1911
1911
|
_defineProperty(this, "resetFrequencyCounts", function () {
|
|
1912
|
-
var configs = _this.
|
|
1912
|
+
var configs = _this.RmJl;
|
|
1913
1913
|
for (var configId in configs) {
|
|
1914
|
-
configs[configId].
|
|
1914
|
+
configs[configId].fucO();
|
|
1915
1915
|
}
|
|
1916
1916
|
});
|
|
1917
|
-
_defineProperty(this, "
|
|
1917
|
+
_defineProperty(this, "cPnL", function (campaignId) {
|
|
1918
1918
|
try {
|
|
1919
|
-
if (_this.
|
|
1920
|
-
var configItem = _this.
|
|
1921
|
-
if (configItem && configItem.
|
|
1922
|
-
return configItem.
|
|
1919
|
+
if (_this.RmJl) {
|
|
1920
|
+
var configItem = _this.RmJl[campaignId];
|
|
1921
|
+
if (configItem && configItem.WkEQ) {
|
|
1922
|
+
return configItem.WkEQ;
|
|
1923
1923
|
}
|
|
1924
1924
|
}
|
|
1925
1925
|
} catch (e) {
|
|
@@ -1935,42 +1935,42 @@
|
|
|
1935
1935
|
var EventsListener = /*#__PURE__*/_createClass(function EventsListener() {
|
|
1936
1936
|
var _this = this;
|
|
1937
1937
|
_classCallCheck(this, EventsListener);
|
|
1938
|
-
_defineProperty(this, "
|
|
1939
|
-
_defineProperty(this, "
|
|
1940
|
-
_defineProperty(this, "
|
|
1938
|
+
_defineProperty(this, "nHSF", {});
|
|
1939
|
+
_defineProperty(this, "AeBT", []);
|
|
1940
|
+
_defineProperty(this, "TMJG", false);
|
|
1941
1941
|
_defineProperty(this, "initialize", function () {
|
|
1942
1942
|
var controller = Apxor.getController();
|
|
1943
1943
|
controller.registerForEvent(APP_EVENT, function (event) {
|
|
1944
|
-
return _this.
|
|
1944
|
+
return _this.krnL(event, "AE");
|
|
1945
1945
|
});
|
|
1946
1946
|
controller.registerForEvent(CLIENT_EVENT, function (event) {
|
|
1947
|
-
return _this.
|
|
1947
|
+
return _this.krnL(event, "CE");
|
|
1948
1948
|
});
|
|
1949
1949
|
});
|
|
1950
|
-
_defineProperty(this, "
|
|
1950
|
+
_defineProperty(this, "BIyR", function () {
|
|
1951
1951
|
// Clear Buffer
|
|
1952
|
-
for (var item in _this.
|
|
1953
|
-
_this.
|
|
1952
|
+
for (var item in _this.AeBT) {
|
|
1953
|
+
_this.uTCD(item.event, item.key, item.type);
|
|
1954
1954
|
}
|
|
1955
|
-
_this.
|
|
1955
|
+
_this.TMJG = true;
|
|
1956
1956
|
});
|
|
1957
|
-
_defineProperty(this, "
|
|
1957
|
+
_defineProperty(this, "Lwdg", function (event, callback) {
|
|
1958
1958
|
if (!isFunction(callback)) {
|
|
1959
1959
|
return;
|
|
1960
1960
|
}
|
|
1961
1961
|
var listeners;
|
|
1962
|
-
if (_this.
|
|
1963
|
-
listeners = _this.
|
|
1962
|
+
if (_this.nHSF[event]) {
|
|
1963
|
+
listeners = _this.nHSF[event];
|
|
1964
1964
|
} else {
|
|
1965
1965
|
listeners = [];
|
|
1966
1966
|
}
|
|
1967
1967
|
listeners.push(callback);
|
|
1968
|
-
_this.
|
|
1969
|
-
Logger$a.debug("Listeners list: ", _this.
|
|
1968
|
+
_this.nHSF[event] = listeners;
|
|
1969
|
+
Logger$a.debug("Listeners list: ", _this.nHSF);
|
|
1970
1970
|
});
|
|
1971
1971
|
_defineProperty(this, "unregisterFromEvent", function (event, callback) {
|
|
1972
|
-
if (_this.
|
|
1973
|
-
var listeners = _this.
|
|
1972
|
+
if (_this.nHSF[event]) {
|
|
1973
|
+
var listeners = _this.nHSF[event];
|
|
1974
1974
|
var updatedListeners = [];
|
|
1975
1975
|
for (var index = 0; index < listeners.length; index++) {
|
|
1976
1976
|
var listener = listeners[index];
|
|
@@ -1978,25 +1978,25 @@
|
|
|
1978
1978
|
updatedListeners.push(listener);
|
|
1979
1979
|
}
|
|
1980
1980
|
}
|
|
1981
|
-
_this.
|
|
1981
|
+
_this.nHSF[event] = updatedListeners;
|
|
1982
1982
|
}
|
|
1983
1983
|
});
|
|
1984
|
-
_defineProperty(this, "
|
|
1984
|
+
_defineProperty(this, "krnL", function (event) {
|
|
1985
1985
|
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "AE";
|
|
1986
1986
|
var key = type + "___" + event.name;
|
|
1987
|
-
_this.
|
|
1987
|
+
_this.uTCD(event, key, type);
|
|
1988
1988
|
});
|
|
1989
|
-
_defineProperty(this, "
|
|
1990
|
-
if (!_this.
|
|
1991
|
-
_this.
|
|
1989
|
+
_defineProperty(this, "uTCD", function (event, key, type) {
|
|
1990
|
+
if (!_this.TMJG) {
|
|
1991
|
+
_this.AeBT.push({
|
|
1992
1992
|
event: event,
|
|
1993
1993
|
key: key,
|
|
1994
1994
|
type: type
|
|
1995
1995
|
});
|
|
1996
1996
|
} else {
|
|
1997
|
-
Logger$a.debug("Notifying listeners for event: " + event + ", " + key, _this.
|
|
1998
|
-
if (_this.
|
|
1999
|
-
var listeners = _this.
|
|
1997
|
+
Logger$a.debug("Notifying listeners for event: " + event + ", " + key, _this.nHSF);
|
|
1998
|
+
if (_this.nHSF[key]) {
|
|
1999
|
+
var listeners = _this.nHSF[key];
|
|
2000
2000
|
var time = Apxor.getController().getSDKRunningTimeInSec();
|
|
2001
2001
|
for (var index = 0; index < listeners.length; index++) {
|
|
2002
2002
|
var listener = listeners[index];
|
|
@@ -2012,17 +2012,17 @@
|
|
|
2012
2012
|
function CE() {
|
|
2013
2013
|
var _this = this;
|
|
2014
2014
|
_classCallCheck(this, CE);
|
|
2015
|
-
_defineProperty(this, "
|
|
2016
|
-
_defineProperty(this, "
|
|
2017
|
-
_defineProperty(this, "
|
|
2018
|
-
_defineProperty(this, "
|
|
2019
|
-
_defineProperty(this, "
|
|
2015
|
+
_defineProperty(this, "eMkE", false);
|
|
2016
|
+
_defineProperty(this, "xjsP", null);
|
|
2017
|
+
_defineProperty(this, "xydZ", getDateInDDMMYYYY());
|
|
2018
|
+
_defineProperty(this, "NWRx", new EventsListener());
|
|
2019
|
+
_defineProperty(this, "BDFf", Apxor.getSiteId());
|
|
2020
2020
|
_defineProperty(this, "_qeState", {});
|
|
2021
2021
|
_defineProperty(this, "getQeState", function () {
|
|
2022
2022
|
try {
|
|
2023
2023
|
var data = Apxor.getController().getFromStorage(QE_STATE);
|
|
2024
2024
|
if (data) {
|
|
2025
|
-
return JSON.parse(decode(_this.
|
|
2025
|
+
return JSON.parse(decode(_this.BDFf, data));
|
|
2026
2026
|
} else {
|
|
2027
2027
|
_this._qeState = {};
|
|
2028
2028
|
return _this.setQeState();
|
|
@@ -2051,10 +2051,10 @@
|
|
|
2051
2051
|
return _this._qeState;
|
|
2052
2052
|
});
|
|
2053
2053
|
_defineProperty(this, "initialize", function () {
|
|
2054
|
-
if (!_this.
|
|
2055
|
-
_this.
|
|
2056
|
-
_this.
|
|
2057
|
-
_this.
|
|
2054
|
+
if (!_this.eMkE) {
|
|
2055
|
+
_this.eMkE = true;
|
|
2056
|
+
_this.xjsP = new ConfigLookup();
|
|
2057
|
+
_this.NWRx.initialize();
|
|
2058
2058
|
_this._qeState = _this.getQeState();
|
|
2059
2059
|
Logger$b.info("QE Initialized..");
|
|
2060
2060
|
}
|
|
@@ -2065,12 +2065,12 @@
|
|
|
2065
2065
|
* @param config
|
|
2066
2066
|
*/
|
|
2067
2067
|
_defineProperty(this, "parse", function (config) {
|
|
2068
|
-
if (!_this.
|
|
2068
|
+
if (!_this.Rify()) {
|
|
2069
2069
|
Logger$b.warn("Must call init first. Unable to proceed");
|
|
2070
2070
|
return;
|
|
2071
2071
|
}
|
|
2072
|
-
_this.
|
|
2073
|
-
_this.
|
|
2072
|
+
_this.xjsP.parse(config);
|
|
2073
|
+
_this.NWRx.BIyR();
|
|
2074
2074
|
});
|
|
2075
2075
|
/**
|
|
2076
2076
|
* Validates all conditions for given config ID
|
|
@@ -2079,22 +2079,22 @@
|
|
|
2079
2079
|
* @param index
|
|
2080
2080
|
*/
|
|
2081
2081
|
_defineProperty(this, "validate", function (id, index) {
|
|
2082
|
-
if (!_this.
|
|
2082
|
+
if (!_this.Rify()) {
|
|
2083
2083
|
return;
|
|
2084
2084
|
}
|
|
2085
|
-
_this.
|
|
2085
|
+
_this.xjsP.validate(id, index);
|
|
2086
2086
|
});
|
|
2087
2087
|
_defineProperty(this, "getVariantCode", function (id) {
|
|
2088
|
-
return _this.
|
|
2088
|
+
return _this.xjsP.getVariantCode(id);
|
|
2089
2089
|
});
|
|
2090
2090
|
_defineProperty(this, "validateForTermination", function (id, index) {
|
|
2091
|
-
if (!_this.
|
|
2091
|
+
if (!_this.Rify()) {
|
|
2092
2092
|
return;
|
|
2093
2093
|
}
|
|
2094
|
-
_this.
|
|
2094
|
+
_this.xjsP.validateForTermination(id, index);
|
|
2095
2095
|
});
|
|
2096
2096
|
_defineProperty(this, "validateForTerminationAttributes", function (user, session) {
|
|
2097
|
-
return _this.
|
|
2097
|
+
return _this.xjsP.validateForTerminationAttributes(user, session);
|
|
2098
2098
|
});
|
|
2099
2099
|
_defineProperty(this, "updateCount", function (id) {
|
|
2100
2100
|
try {
|
|
@@ -2103,25 +2103,25 @@
|
|
|
2103
2103
|
}
|
|
2104
2104
|
_this.incrementFrequencies(id);
|
|
2105
2105
|
_this.setQeState(id);
|
|
2106
|
-
_this.
|
|
2106
|
+
_this.xjsP.dRwe(id);
|
|
2107
2107
|
} catch (e) {
|
|
2108
2108
|
console.log("Could not update the count config:".concat(e));
|
|
2109
2109
|
}
|
|
2110
2110
|
});
|
|
2111
2111
|
_defineProperty(this, "resetFrequencyCounts", function () {
|
|
2112
|
-
_this.
|
|
2112
|
+
_this.xjsP.resetFrequencyCounts();
|
|
2113
2113
|
});
|
|
2114
2114
|
_defineProperty(this, "getFrequencyCount", function (id) {
|
|
2115
|
-
return _this.
|
|
2115
|
+
return _this.xjsP.getFrequencyCount(id);
|
|
2116
2116
|
});
|
|
2117
2117
|
_defineProperty(this, "registerForEvent", function (event, callback) {
|
|
2118
|
-
_this.
|
|
2118
|
+
_this.NWRx.Lwdg(event, callback);
|
|
2119
2119
|
});
|
|
2120
2120
|
_defineProperty(this, "unregisterFromEvent", function (event, callback) {
|
|
2121
|
-
_this.
|
|
2121
|
+
_this.NWRx.unregisterFromEvent(event, callback);
|
|
2122
2122
|
});
|
|
2123
2123
|
_defineProperty(this, "notifyEventListener", function (event) {
|
|
2124
|
-
_this.
|
|
2124
|
+
_this.NWRx.krnL(event);
|
|
2125
2125
|
});
|
|
2126
2126
|
/**
|
|
2127
2127
|
* Fetches the config from Server
|
|
@@ -2134,14 +2134,14 @@
|
|
|
2134
2134
|
_defineProperty(this, "fetch", function (type, validateUrl, apiUrl, callback) {
|
|
2135
2135
|
Apxor.getController().fetchConfiguration(type, validateUrl, apiUrl, callback);
|
|
2136
2136
|
});
|
|
2137
|
-
_defineProperty(this, "
|
|
2138
|
-
return _this.
|
|
2137
|
+
_defineProperty(this, "Rify", function () {
|
|
2138
|
+
return _this.eMkE;
|
|
2139
2139
|
});
|
|
2140
2140
|
_defineProperty(this, "getCampaignMetaFromQueryEngine", function (campaignId) {
|
|
2141
|
-
return _this.
|
|
2141
|
+
return _this.xjsP.cPnL(campaignId);
|
|
2142
2142
|
});
|
|
2143
|
-
_defineProperty(this, "
|
|
2144
|
-
return _this.
|
|
2143
|
+
_defineProperty(this, "wETq", function () {
|
|
2144
|
+
return _this.xydZ;
|
|
2145
2145
|
});
|
|
2146
2146
|
if (!CE.instance) {
|
|
2147
2147
|
CE.instance = this;
|
|
@@ -2165,7 +2165,7 @@
|
|
|
2165
2165
|
OVERALL: 0,
|
|
2166
2166
|
DATES: {}
|
|
2167
2167
|
};
|
|
2168
|
-
if (this.
|
|
2168
|
+
if (this.xydZ) this._qeState[id].DATES[this.xydZ] = 0;
|
|
2169
2169
|
this.setQeState(id);
|
|
2170
2170
|
}
|
|
2171
2171
|
} catch (e) {
|
|
@@ -2184,12 +2184,12 @@
|
|
|
2184
2184
|
|
|
2185
2185
|
// Increment the DATES count for this particular date by 1. If the date changes reset.
|
|
2186
2186
|
var currentDate = getDateInDDMMYYYY();
|
|
2187
|
-
if (currentDate !== this.
|
|
2188
|
-
this.
|
|
2187
|
+
if (currentDate !== this.xydZ || !(configFrequency.DATES && configFrequency.DATES[currentDate])) {
|
|
2188
|
+
this.xydZ = currentDate;
|
|
2189
2189
|
configFrequency.DATES = {};
|
|
2190
|
-
configFrequency.DATES[this.
|
|
2190
|
+
configFrequency.DATES[this.xydZ] = 0;
|
|
2191
2191
|
}
|
|
2192
|
-
configFrequency.DATES[this.
|
|
2192
|
+
configFrequency.DATES[this.xydZ] = configFrequency.DATES[this.xydZ] + 1;
|
|
2193
2193
|
}
|
|
2194
2194
|
}], [{
|
|
2195
2195
|
key: "getInstance",
|