apxor-qe 1.7.0 → 1.8.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 +504 -504
- package/dist/apxor.qe.min.js +1 -1
- package/package.json +25 -5
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 StAu = function StAu(actual, expected, operator) {
|
|
212
212
|
switch (operator) {
|
|
213
213
|
case "EQ":
|
|
214
214
|
return actual === expected;
|
|
@@ -423,7 +423,7 @@
|
|
|
423
423
|
path = path.substring(0, index) + "svg:svg";
|
|
424
424
|
}
|
|
425
425
|
try {
|
|
426
|
-
return document.
|
|
426
|
+
return document.WTJq(path, document, function (prefix) {
|
|
427
427
|
if (prefix === "svg") {
|
|
428
428
|
return "http://www.w3.org/2000/svg";
|
|
429
429
|
} else {
|
|
@@ -483,18 +483,18 @@
|
|
|
483
483
|
var Audience = /*#__PURE__*/_createClass(function Audience() {
|
|
484
484
|
var _this = this;
|
|
485
485
|
_classCallCheck(this, Audience);
|
|
486
|
-
_defineProperty(this, "
|
|
487
|
-
_defineProperty(this, "
|
|
488
|
-
_defineProperty(this, "
|
|
486
|
+
_defineProperty(this, "WBXT", "ALL");
|
|
487
|
+
_defineProperty(this, "fGzd", []);
|
|
488
|
+
_defineProperty(this, "eYdP", []);
|
|
489
489
|
_defineProperty(this, "userAttributesValidated", true);
|
|
490
490
|
_defineProperty(this, "sessionAttributeValidated", true);
|
|
491
491
|
_defineProperty(this, "parse", function () {
|
|
492
492
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
493
493
|
try {
|
|
494
|
-
_this.
|
|
495
|
-
_this.
|
|
496
|
-
_this.
|
|
497
|
-
if (!Array.isArray(_this.
|
|
494
|
+
_this.WBXT = config.audience.audience_type;
|
|
495
|
+
_this.fGzd = config.audience.attributes.user;
|
|
496
|
+
_this.eYdP = config.audience.attributes.session;
|
|
497
|
+
if (!Array.isArray(_this.fGzd) || !Array.isArray(_this.eYdP)) {
|
|
498
498
|
Logger$1.error("No attributes");
|
|
499
499
|
return false;
|
|
500
500
|
}
|
|
@@ -506,11 +506,11 @@
|
|
|
506
506
|
});
|
|
507
507
|
_defineProperty(this, "validate", function (user, session) {
|
|
508
508
|
var status = true;
|
|
509
|
-
if (_this.
|
|
509
|
+
if (_this.WBXT === "FTU") {
|
|
510
510
|
status = Apxor.getController().getSessionInfo().is_first_session;
|
|
511
511
|
}
|
|
512
|
-
var userAttributesCompare = _this.
|
|
513
|
-
var sessionAttributesCompare = _this.
|
|
512
|
+
var userAttributesCompare = _this.WJGy(user, _this.fGzd);
|
|
513
|
+
var sessionAttributesCompare = _this.WJGy(session, _this.eYdP);
|
|
514
514
|
if (!userAttributesCompare) {
|
|
515
515
|
_this.userAttributesValidated = false;
|
|
516
516
|
}
|
|
@@ -519,7 +519,7 @@
|
|
|
519
519
|
}
|
|
520
520
|
return status && userAttributesCompare && sessionAttributesCompare;
|
|
521
521
|
});
|
|
522
|
-
_defineProperty(this, "
|
|
522
|
+
_defineProperty(this, "WJGy", function (attributes, expected) {
|
|
523
523
|
var length = expected.length;
|
|
524
524
|
var status = true;
|
|
525
525
|
try {
|
|
@@ -567,7 +567,7 @@
|
|
|
567
567
|
} else if (type === "b") {
|
|
568
568
|
loggedValue = !!loggedValue;
|
|
569
569
|
}
|
|
570
|
-
return
|
|
570
|
+
return StAu(loggedValue, configValue, operator);
|
|
571
571
|
});
|
|
572
572
|
});
|
|
573
573
|
status = status && match;
|
|
@@ -595,41 +595,41 @@
|
|
|
595
595
|
var Frequency = /*#__PURE__*/_createClass(function Frequency() {
|
|
596
596
|
var _this = this;
|
|
597
597
|
_classCallCheck(this, Frequency);
|
|
598
|
-
_defineProperty(this, "
|
|
599
|
-
_defineProperty(this, "
|
|
600
|
-
_defineProperty(this, "
|
|
601
|
-
_defineProperty(this, "
|
|
602
|
-
_defineProperty(this, "
|
|
603
|
-
_defineProperty(this, "
|
|
598
|
+
_defineProperty(this, "MSzB", 0);
|
|
599
|
+
_defineProperty(this, "EOhX", 0);
|
|
600
|
+
_defineProperty(this, "kTyF", "SESSION");
|
|
601
|
+
_defineProperty(this, "JeZK", 0);
|
|
602
|
+
_defineProperty(this, "ubBd", 0);
|
|
603
|
+
_defineProperty(this, "ZJRP", 0);
|
|
604
604
|
_defineProperty(this, "parse", function () {
|
|
605
605
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
606
606
|
try {
|
|
607
|
-
_this.
|
|
608
|
-
_this.
|
|
609
|
-
_this.
|
|
610
|
-
if (_this.
|
|
611
|
-
_this.
|
|
612
|
-
}
|
|
613
|
-
_this.
|
|
614
|
-
_this.
|
|
615
|
-
_this.
|
|
616
|
-
_this.
|
|
607
|
+
_this.tkvH = config._id;
|
|
608
|
+
_this.FaOX = config.meta;
|
|
609
|
+
_this.MSzB = config.frequency.count;
|
|
610
|
+
if (_this.MSzB === -1) {
|
|
611
|
+
_this.MSzB = 1000;
|
|
612
|
+
}
|
|
613
|
+
_this.ZJRP = _this.MSzB;
|
|
614
|
+
_this.EOhX = config.frequency.time_interval;
|
|
615
|
+
_this.kTyF = config.frequency.validity;
|
|
616
|
+
_this.ubBd = config.frequency.ses_lmt;
|
|
617
617
|
_this._dayCount = config.frequency.day_lmt;
|
|
618
618
|
// let data = Apxor.getController().getFromStorage(QE_STATE);
|
|
619
619
|
// let qe_state = JSON.parse(decode(Apxor.getSiteId(), data));
|
|
620
620
|
var qe_state = CE.getInstance().getQeState();
|
|
621
621
|
if (!isDefined(qe_state) || !isDefined(qe_state[config._id])) return true;
|
|
622
|
-
if (_this.
|
|
623
|
-
_this.
|
|
624
|
-
if (_this.
|
|
625
|
-
_this.
|
|
622
|
+
if (_this.kTyF === "SESSION") {
|
|
623
|
+
_this.MSzB = parseInt(_this.MSzB) - parseInt(qe_state[config._id]["SESSION"]);
|
|
624
|
+
if (_this.MSzB <= 0) {
|
|
625
|
+
_this.vYAT("Session limit reached");
|
|
626
626
|
console.warn("Max count limit reached for session:" + config._id);
|
|
627
627
|
return false;
|
|
628
628
|
}
|
|
629
|
-
} else if (_this.
|
|
630
|
-
_this.
|
|
631
|
-
if (_this.
|
|
632
|
-
_this.
|
|
629
|
+
} else if (_this.kTyF === "OVERALL") {
|
|
630
|
+
_this.MSzB = parseInt(_this.MSzB) - parseInt(qe_state[config._id]["OVERALL"]);
|
|
631
|
+
if (_this.MSzB <= 0) {
|
|
632
|
+
_this.vYAT("Overall limit reached");
|
|
633
633
|
console.warn("Max count limit reached for overall:" + config._id);
|
|
634
634
|
return false;
|
|
635
635
|
}
|
|
@@ -643,32 +643,32 @@
|
|
|
643
643
|
}
|
|
644
644
|
return true;
|
|
645
645
|
});
|
|
646
|
-
_defineProperty(this, "
|
|
647
|
-
_this.
|
|
646
|
+
_defineProperty(this, "hJWa", function () {
|
|
647
|
+
_this.MSzB = _this.MSzB - 1;
|
|
648
648
|
});
|
|
649
649
|
_defineProperty(this, "getFrequencyCount", function () {
|
|
650
|
-
return _this.
|
|
650
|
+
return _this.MSzB;
|
|
651
651
|
});
|
|
652
|
-
_defineProperty(this, "
|
|
653
|
-
if (_this.
|
|
654
|
-
_this.
|
|
652
|
+
_defineProperty(this, "Hhtv", function () {
|
|
653
|
+
if (_this.kTyF === "SESSION") {
|
|
654
|
+
_this.MSzB = _this.ZJRP;
|
|
655
655
|
Logger$2.info("Campaign Limit reset");
|
|
656
656
|
}
|
|
657
657
|
});
|
|
658
658
|
/**
|
|
659
|
-
* @function
|
|
659
|
+
* @function tiom
|
|
660
660
|
* @description Validates if the campaign count is with in the limits set in the config.
|
|
661
661
|
* @param {string} Config id
|
|
662
662
|
* @returns {boolean} true - If the Campaign limits are not reached
|
|
663
663
|
* false - Otherwise
|
|
664
664
|
*/
|
|
665
|
-
_defineProperty(this, "
|
|
665
|
+
_defineProperty(this, "tiom", function (id) {
|
|
666
666
|
try {
|
|
667
|
-
if (_this.
|
|
668
|
-
if (_this.
|
|
669
|
-
_this.
|
|
670
|
-
} else if (_this.
|
|
671
|
-
_this.
|
|
667
|
+
if (_this.MSzB <= 0) {
|
|
668
|
+
if (_this.kTyF === "OVERALL") {
|
|
669
|
+
_this.vYAT("Overall limit reached");
|
|
670
|
+
} else if (_this.kTyF === "SESSION") {
|
|
671
|
+
_this.vYAT("Session limit reached");
|
|
672
672
|
}
|
|
673
673
|
return false;
|
|
674
674
|
}
|
|
@@ -680,11 +680,11 @@
|
|
|
680
680
|
if (!isDefined(qe_state) || !isDefined(qe_state[id])) return true;
|
|
681
681
|
|
|
682
682
|
//If the config has a session count limit set
|
|
683
|
-
if (_this.
|
|
684
|
-
var sessionCountInConfig = parseInt(_this.
|
|
683
|
+
if (_this.ubBd !== 0) {
|
|
684
|
+
var sessionCountInConfig = parseInt(_this.ubBd);
|
|
685
685
|
var thisSessionCount = parseInt(qe_state[id]["SESSION"]);
|
|
686
686
|
if (sessionCountInConfig - thisSessionCount <= 0) {
|
|
687
|
-
_this.
|
|
687
|
+
_this.vYAT("Session limit reached");
|
|
688
688
|
return false;
|
|
689
689
|
}
|
|
690
690
|
}
|
|
@@ -696,23 +696,23 @@
|
|
|
696
696
|
var dayCountInConfig = parseInt(_this._dayCount);
|
|
697
697
|
var thisDayCount = parseInt(((_qe_state$id = qe_state[id]) === null || _qe_state$id === void 0 ? void 0 : _qe_state$id.DATES[date]) || 0);
|
|
698
698
|
if (dayCountInConfig - thisDayCount <= 0) {
|
|
699
|
-
_this.
|
|
699
|
+
_this.vYAT("Day limit reached");
|
|
700
700
|
return false;
|
|
701
701
|
}
|
|
702
702
|
}
|
|
703
703
|
} catch (e) {
|
|
704
|
-
_this.
|
|
704
|
+
_this.vYAT("Error validating the frequency: ".concat(e));
|
|
705
705
|
Logger$2.error("Error validating the frequency:" + e);
|
|
706
706
|
}
|
|
707
707
|
return true;
|
|
708
708
|
});
|
|
709
|
-
_defineProperty(this, "
|
|
710
|
-
var _this$
|
|
709
|
+
_defineProperty(this, "vYAT", function (reason) {
|
|
710
|
+
var _this$FaOX$attr;
|
|
711
711
|
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
|
|
712
|
-
apx_nudge_type: _this.
|
|
713
|
-
apx_nudge_id: _this.
|
|
714
|
-
apx_nudge_name: _this.
|
|
715
|
-
apx_variant_code: _this.
|
|
712
|
+
apx_nudge_type: _this.FaOX.type === "SURVEY" ? "survey" : "campaign",
|
|
713
|
+
apx_nudge_id: _this.tkvH,
|
|
714
|
+
apx_nudge_name: _this.FaOX.name,
|
|
715
|
+
apx_variant_code: _this.FaOX.isExperiment || _this.FaOX.only_context ? (_this$FaOX$attr = _this.FaOX.attr) === null || _this$FaOX$attr === void 0 ? void 0 : _this$FaOX$attr[APX_VARIANT_CODE] : "TG",
|
|
716
716
|
apx_failure_type: "warn",
|
|
717
717
|
apx_reason: reason
|
|
718
718
|
});
|
|
@@ -722,14 +722,14 @@
|
|
|
722
722
|
var Meta = /*#__PURE__*/_createClass(function Meta() {
|
|
723
723
|
var _this = this;
|
|
724
724
|
_classCallCheck(this, Meta);
|
|
725
|
-
_defineProperty(this, "
|
|
726
|
-
_defineProperty(this, "
|
|
725
|
+
_defineProperty(this, "FiDT", "");
|
|
726
|
+
_defineProperty(this, "WBXT", "");
|
|
727
727
|
_defineProperty(this, "parse", function () {
|
|
728
728
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
729
729
|
try {
|
|
730
730
|
var _config$meta, _config$meta2;
|
|
731
|
-
_this.
|
|
732
|
-
_this.
|
|
731
|
+
_this.FiDT = config.meta.name;
|
|
732
|
+
_this.WBXT = config.meta.type;
|
|
733
733
|
_this._only_context = config.meta.only_context;
|
|
734
734
|
_this._attr = ((_config$meta = config.meta) === null || _config$meta === void 0 ? void 0 : _config$meta.attr) || {};
|
|
735
735
|
_this._isExperiment = (_config$meta2 = config.meta) === null || _config$meta2 === void 0 ? void 0 : _config$meta2.isExperiment;
|
|
@@ -745,11 +745,11 @@
|
|
|
745
745
|
var Validity = /*#__PURE__*/_createClass(function Validity() {
|
|
746
746
|
var _this = this;
|
|
747
747
|
_classCallCheck(this, Validity);
|
|
748
|
-
_defineProperty(this, "
|
|
749
|
-
_defineProperty(this, "
|
|
750
|
-
_defineProperty(this, "
|
|
751
|
-
_defineProperty(this, "
|
|
752
|
-
_defineProperty(this, "
|
|
748
|
+
_defineProperty(this, "QLwb", -1);
|
|
749
|
+
_defineProperty(this, "MNVx", -1);
|
|
750
|
+
_defineProperty(this, "ybQh", -1);
|
|
751
|
+
_defineProperty(this, "yFSG", -1);
|
|
752
|
+
_defineProperty(this, "GpDT", false);
|
|
753
753
|
_defineProperty(this, "_nudge_expired", false);
|
|
754
754
|
_defineProperty(this, "_not_yet_active", false);
|
|
755
755
|
_defineProperty(this, "_not_in_specified_time", false);
|
|
@@ -760,17 +760,17 @@
|
|
|
760
760
|
Logger$3.error("Not valid dates");
|
|
761
761
|
return false;
|
|
762
762
|
}
|
|
763
|
-
_this.
|
|
764
|
-
_this.
|
|
763
|
+
_this.QLwb = Date.parse(config.validity.start_date);
|
|
764
|
+
_this.MNVx = Date.parse(config.validity.end_date);
|
|
765
765
|
if (isDefined(config.at_specific_time)) {
|
|
766
|
-
_this.
|
|
767
|
-
if (_this.
|
|
766
|
+
_this.GpDT = config.at_specific_time;
|
|
767
|
+
if (_this.GpDT && isDefined(config.time_limits)) {
|
|
768
768
|
var currentDate = new Date().toISOString().split("T")[0];
|
|
769
|
-
_this.
|
|
770
|
-
_this.
|
|
769
|
+
_this.ybQh = Date.parse(currentDate + "T" + config.time_limits.start_time + ":00.000Z");
|
|
770
|
+
_this.yFSG = Date.parse(currentDate + "T" + config.time_limits.end_time + ":00.000Z");
|
|
771
771
|
|
|
772
772
|
// If invalid format is passed, return false
|
|
773
|
-
if (isNaN(_this.
|
|
773
|
+
if (isNaN(_this.ybQh) || isNaN(_this.yFSG)) {
|
|
774
774
|
Logger$3.error("Not valid times");
|
|
775
775
|
return false;
|
|
776
776
|
}
|
|
@@ -784,14 +784,14 @@
|
|
|
784
784
|
});
|
|
785
785
|
_defineProperty(this, "validate", function () {
|
|
786
786
|
var currentTime = Date.now();
|
|
787
|
-
if (currentTime > _this.
|
|
788
|
-
if (_this.
|
|
787
|
+
if (currentTime > _this.QLwb && currentTime < _this.MNVx) {
|
|
788
|
+
if (_this.GpDT && !(currentTime >= _this.ybQh && currentTime <= _this.yFSG)) {
|
|
789
789
|
_this._not_in_specified_time = true;
|
|
790
790
|
}
|
|
791
|
-
return !_this.
|
|
792
|
-
} else if (currentTime < _this.
|
|
791
|
+
return !_this.GpDT || currentTime >= _this.ybQh && currentTime <= _this.yFSG;
|
|
792
|
+
} else if (currentTime < _this.QLwb) {
|
|
793
793
|
_this._not_yet_active = true;
|
|
794
|
-
} else if (currentTime > _this.
|
|
794
|
+
} else if (currentTime > _this.MNVx) {
|
|
795
795
|
_this._nudge_expired = true;
|
|
796
796
|
}
|
|
797
797
|
return false;
|
|
@@ -801,13 +801,13 @@
|
|
|
801
801
|
var Details = /*#__PURE__*/_createClass(function Details() {
|
|
802
802
|
var _this = this;
|
|
803
803
|
_classCallCheck(this, Details);
|
|
804
|
-
_defineProperty(this, "
|
|
805
|
-
_defineProperty(this, "
|
|
804
|
+
_defineProperty(this, "FiDT", "");
|
|
805
|
+
_defineProperty(this, "bFur", {});
|
|
806
806
|
_defineProperty(this, "parse", function () {
|
|
807
807
|
var details = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
808
808
|
try {
|
|
809
|
-
_this.
|
|
810
|
-
_this.
|
|
809
|
+
_this.FiDT = details.name;
|
|
810
|
+
_this.bFur = details.additional_info;
|
|
811
811
|
} catch (error) {
|
|
812
812
|
return false;
|
|
813
813
|
}
|
|
@@ -818,14 +818,14 @@
|
|
|
818
818
|
var Timebounds = /*#__PURE__*/_createClass(function Timebounds() {
|
|
819
819
|
var _this = this;
|
|
820
820
|
_classCallCheck(this, Timebounds);
|
|
821
|
-
_defineProperty(this, "
|
|
822
|
-
_defineProperty(this, "
|
|
821
|
+
_defineProperty(this, "xTRO", 0);
|
|
822
|
+
_defineProperty(this, "qRLS", 0);
|
|
823
823
|
_defineProperty(this, "parse", function () {
|
|
824
824
|
var timeBounds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
825
825
|
try {
|
|
826
|
-
_this.
|
|
827
|
-
_this.
|
|
828
|
-
if (isNaN(_this.
|
|
826
|
+
_this.xTRO = Number(timeBounds.lower);
|
|
827
|
+
_this.qRLS = Number(timeBounds.upper);
|
|
828
|
+
if (isNaN(_this.xTRO) || isNaN(_this.qRLS)) {
|
|
829
829
|
return false;
|
|
830
830
|
}
|
|
831
831
|
} catch (error) {
|
|
@@ -838,17 +838,17 @@
|
|
|
838
838
|
var PreCondition = /*#__PURE__*/_createClass(function PreCondition() {
|
|
839
839
|
var _this = this;
|
|
840
840
|
_classCallCheck(this, PreCondition);
|
|
841
|
-
_defineProperty(this, "
|
|
842
|
-
_defineProperty(this, "
|
|
843
|
-
_defineProperty(this, "
|
|
844
|
-
_defineProperty(this, "
|
|
845
|
-
_defineProperty(this, "
|
|
841
|
+
_defineProperty(this, "XwIs", 0);
|
|
842
|
+
_defineProperty(this, "PTXF", "");
|
|
843
|
+
_defineProperty(this, "UDkI", "");
|
|
844
|
+
_defineProperty(this, "yHbl", new Details());
|
|
845
|
+
_defineProperty(this, "ECcI", new Timebounds());
|
|
846
846
|
_defineProperty(this, "parse", function () {
|
|
847
847
|
var precondition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
848
848
|
try {
|
|
849
|
-
_this.
|
|
850
|
-
_this.
|
|
851
|
-
return _this.
|
|
849
|
+
_this.PTXF = precondition.event_type;
|
|
850
|
+
_this.UDkI = precondition.activity;
|
|
851
|
+
return _this.yHbl.parse(precondition.details) && _this.ECcI.parse(precondition.time_bounds);
|
|
852
852
|
} catch (error) {
|
|
853
853
|
return false;
|
|
854
854
|
}
|
|
@@ -859,29 +859,29 @@
|
|
|
859
859
|
var Condition = /*#__PURE__*/_createClass(function Condition() {
|
|
860
860
|
var _this = this;
|
|
861
861
|
_classCallCheck(this, Condition);
|
|
862
|
-
_defineProperty(this, "
|
|
863
|
-
_defineProperty(this, "
|
|
864
|
-
_defineProperty(this, "
|
|
865
|
-
_defineProperty(this, "
|
|
866
|
-
_defineProperty(this, "
|
|
867
|
-
_defineProperty(this, "
|
|
868
|
-
_defineProperty(this, "
|
|
869
|
-
_defineProperty(this, "
|
|
870
|
-
_defineProperty(this, "
|
|
871
|
-
_defineProperty(this, "
|
|
872
|
-
_defineProperty(this, "
|
|
873
|
-
_defineProperty(this, "
|
|
862
|
+
_defineProperty(this, "XwIs", 0);
|
|
863
|
+
_defineProperty(this, "CcMq", -1);
|
|
864
|
+
_defineProperty(this, "MSzB", 0);
|
|
865
|
+
_defineProperty(this, "jxcB", "");
|
|
866
|
+
_defineProperty(this, "UDkI", "");
|
|
867
|
+
_defineProperty(this, "PTXF", "");
|
|
868
|
+
_defineProperty(this, "ECcI", new Timebounds());
|
|
869
|
+
_defineProperty(this, "yHbl", new Details());
|
|
870
|
+
_defineProperty(this, "koaL", new PreCondition());
|
|
871
|
+
_defineProperty(this, "ZdyA", "AND");
|
|
872
|
+
_defineProperty(this, "cUqy", false);
|
|
873
|
+
_defineProperty(this, "WBXT", void 0);
|
|
874
874
|
_defineProperty(this, "parse", function () {
|
|
875
875
|
var condition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
876
876
|
try {
|
|
877
|
-
_this.
|
|
878
|
-
_this.
|
|
879
|
-
_this.
|
|
880
|
-
_this.
|
|
881
|
-
_this.
|
|
882
|
-
_this.
|
|
883
|
-
_this.
|
|
884
|
-
return _this.
|
|
877
|
+
_this.CcMq = condition.sequence;
|
|
878
|
+
_this.MSzB = condition.count_config.count;
|
|
879
|
+
_this.jxcB = condition.count_config.operator;
|
|
880
|
+
_this.UDkI = condition.activity;
|
|
881
|
+
_this.PTXF = condition.event_type;
|
|
882
|
+
_this.ZdyA = condition.combine_operator;
|
|
883
|
+
_this.WBXT = condition.type;
|
|
884
|
+
return _this.yHbl.parse(condition.details) && _this.koaL.parse(condition.trigger) && _this.ECcI.parse(condition.time_bounds);
|
|
885
885
|
} catch (error) {
|
|
886
886
|
Logger$4.error(error);
|
|
887
887
|
return false;
|
|
@@ -893,19 +893,19 @@
|
|
|
893
893
|
var GoalEvent = /*#__PURE__*/_createClass(function GoalEvent() {
|
|
894
894
|
var _this = this;
|
|
895
895
|
_classCallCheck(this, GoalEvent);
|
|
896
|
-
_defineProperty(this, "
|
|
897
|
-
_defineProperty(this, "
|
|
898
|
-
_defineProperty(this, "
|
|
899
|
-
_defineProperty(this, "
|
|
900
|
-
_defineProperty(this, "
|
|
901
|
-
_defineProperty(this, "
|
|
896
|
+
_defineProperty(this, "MSzB", 0);
|
|
897
|
+
_defineProperty(this, "jxcB", "");
|
|
898
|
+
_defineProperty(this, "PTXF", "");
|
|
899
|
+
_defineProperty(this, "ECcI", new Timebounds());
|
|
900
|
+
_defineProperty(this, "yHbl", new Details());
|
|
901
|
+
_defineProperty(this, "ZdyA", "AND");
|
|
902
902
|
_defineProperty(this, "parse", function (data) {
|
|
903
903
|
try {
|
|
904
|
-
_this.
|
|
905
|
-
_this.
|
|
906
|
-
_this.
|
|
907
|
-
_this.
|
|
908
|
-
return _this.
|
|
904
|
+
_this.MSzB = data.count_config.count;
|
|
905
|
+
_this.jxcB = data.count_config.operator;
|
|
906
|
+
_this.PTXF = data.event_type;
|
|
907
|
+
_this.ZdyA = data.combine_operator;
|
|
908
|
+
return _this.yHbl.parse(data.details) && _this.ECcI.parse(data.time_bounds);
|
|
909
909
|
} catch (error) {
|
|
910
910
|
Logger$5.error(error);
|
|
911
911
|
return false;
|
|
@@ -919,21 +919,21 @@
|
|
|
919
919
|
function ConditionValidator() {
|
|
920
920
|
var _this = this;
|
|
921
921
|
_classCallCheck(this, ConditionValidator);
|
|
922
|
-
_defineProperty(this, "
|
|
923
|
-
_defineProperty(this, "
|
|
924
|
-
_defineProperty(this, "
|
|
925
|
-
_defineProperty(this, "
|
|
926
|
-
_defineProperty(this, "
|
|
927
|
-
_defineProperty(this, "
|
|
928
|
-
_defineProperty(this, "
|
|
929
|
-
_defineProperty(this, "
|
|
930
|
-
_defineProperty(this, "
|
|
931
|
-
_defineProperty(this, "
|
|
932
|
-
_defineProperty(this, "
|
|
933
|
-
_defineProperty(this, "
|
|
934
|
-
_defineProperty(this, "
|
|
922
|
+
_defineProperty(this, "HUFK", 0);
|
|
923
|
+
_defineProperty(this, "tkvH", "");
|
|
924
|
+
_defineProperty(this, "HBDN", new Condition());
|
|
925
|
+
_defineProperty(this, "vGYK", new GoalEvent());
|
|
926
|
+
_defineProperty(this, "ZDcP", false);
|
|
927
|
+
_defineProperty(this, "KUlF", false);
|
|
928
|
+
_defineProperty(this, "SgFM", 0);
|
|
929
|
+
_defineProperty(this, "ZdyA", "AND");
|
|
930
|
+
_defineProperty(this, "seqy", "OR");
|
|
931
|
+
_defineProperty(this, "TPiO", -1);
|
|
932
|
+
_defineProperty(this, "sHgA", []);
|
|
933
|
+
_defineProperty(this, "HTsU", {});
|
|
934
|
+
_defineProperty(this, "qHPA", false);
|
|
935
935
|
/**
|
|
936
|
-
* If respectSequence is true, don't auto-
|
|
936
|
+
* If respectSequence is true, don't auto-IyAK to events except for the condition whose index is 0
|
|
937
937
|
*
|
|
938
938
|
* @param condition
|
|
939
939
|
* @param type
|
|
@@ -949,191 +949,191 @@
|
|
|
949
949
|
var respectSequence = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
950
950
|
var noKpiArray = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
951
951
|
var flag = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : "";
|
|
952
|
-
_this.
|
|
953
|
-
_this.
|
|
954
|
-
_this.
|
|
952
|
+
_this.tkvH = id;
|
|
953
|
+
_this.SgFM = index;
|
|
954
|
+
_this.sHgA = noKpiArray;
|
|
955
955
|
if (flag !== "termination" || flag === "") {
|
|
956
|
-
var result = _this.
|
|
956
|
+
var result = _this.HBDN.parse(condition);
|
|
957
957
|
if (result) {
|
|
958
|
-
_this.
|
|
958
|
+
_this.ZdyA = _this.HBDN.ZdyA;
|
|
959
959
|
|
|
960
960
|
// FIXME: Why this code is written? Don't see any usecase
|
|
961
|
-
if (_this.
|
|
962
|
-
var eventName = _this.
|
|
961
|
+
if (_this.HBDN.cUqy) {
|
|
962
|
+
var eventName = _this.HBDN.yHbl.FiDT;
|
|
963
963
|
if (eventName === "APX_PAGE_OPENED") {
|
|
964
|
-
eventName = _this.
|
|
965
|
-
eventName = isDefined(eventName) ? eventName : _this.
|
|
964
|
+
eventName = _this.HBDN.yHbl.bFur["navigation_id"];
|
|
965
|
+
eventName = isDefined(eventName) ? eventName : _this.HBDN.yHbl.FiDT;
|
|
966
966
|
}
|
|
967
|
-
_this.
|
|
968
|
-
var count = _this.
|
|
969
|
-
var operator = _this.
|
|
970
|
-
_this.
|
|
971
|
-
_this.
|
|
972
|
-
// If the condition is already satisfied and if it is page view, no need to
|
|
967
|
+
_this.TPiO = Apxor.getController().getEventCount(eventName);
|
|
968
|
+
var count = _this.HBDN.MSzB;
|
|
969
|
+
var operator = _this.HBDN.jxcB;
|
|
970
|
+
_this.KUlF = _this.tZfA(_this.TPiO - 1, count, operator, false);
|
|
971
|
+
_this.ZDcP = _this.KUlF;
|
|
972
|
+
// If the condition is already satisfied and if it is page view, no need to IyAK
|
|
973
973
|
// This only applies for NAVIGATION_EVENTS
|
|
974
|
-
if (_this.
|
|
974
|
+
if (_this.KUlF && _this.HBDN.yHbl.FiDT === "APX_PAGE_OPENED") {
|
|
975
975
|
return true;
|
|
976
976
|
}
|
|
977
977
|
}
|
|
978
978
|
if (!respectSequence || index === 0) {
|
|
979
|
-
_this.
|
|
979
|
+
_this.IyAK();
|
|
980
980
|
}
|
|
981
981
|
return true;
|
|
982
982
|
}
|
|
983
983
|
} else {
|
|
984
|
-
var _result = _this.
|
|
985
|
-
_this.
|
|
986
|
-
_this.
|
|
984
|
+
var _result = _this.vGYK.parse(condition);
|
|
985
|
+
_this.seqy = _this.vGYK.ZdyA;
|
|
986
|
+
_this.BUIy();
|
|
987
987
|
return true;
|
|
988
988
|
}
|
|
989
989
|
return false;
|
|
990
990
|
});
|
|
991
|
-
_defineProperty(this, "
|
|
991
|
+
_defineProperty(this, "IyAK", function () {
|
|
992
992
|
var _window$ApxorRTM;
|
|
993
|
-
var condition = _this.
|
|
994
|
-
var precondition = condition.
|
|
993
|
+
var condition = _this.HBDN;
|
|
994
|
+
var precondition = condition.koaL;
|
|
995
995
|
var ceInstance = CE.getInstance();
|
|
996
|
-
if (precondition.
|
|
997
|
-
_this.
|
|
998
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
996
|
+
if (precondition.PTXF === "app_start") {
|
|
997
|
+
_this.ZDcP = true;
|
|
998
|
+
ceInstance.registerForEvent(generateKey(condition.PTXF) + "___" + condition.yHbl.FiDT, _this.SeWP);
|
|
999
999
|
} else {
|
|
1000
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
1000
|
+
ceInstance.registerForEvent(generateKey(condition.PTXF) + "___" + precondition.yHbl.FiDT, _this.SeWP);
|
|
1001
1001
|
}
|
|
1002
|
-
if ((_window$ApxorRTM = window.ApxorRTM) !== null && _window$ApxorRTM !== void 0 && _window$ApxorRTM.badgesLists.includes(_this.
|
|
1003
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
1002
|
+
if ((_window$ApxorRTM = window.ApxorRTM) !== null && _window$ApxorRTM !== void 0 && _window$ApxorRTM.badgesLists.includes(_this.tkvH)) {
|
|
1003
|
+
ceInstance.registerForEvent(generateKey(condition.PTXF) + "___" + "apxor-badge-container-".concat("-".concat(_this.tkvH).replaceAll(" ", "").replace(/[^\w\s]/gi, "")), _this.SeWP);
|
|
1004
1004
|
}
|
|
1005
1005
|
});
|
|
1006
|
-
_defineProperty(this, "
|
|
1007
|
-
var condition = _this.
|
|
1006
|
+
_defineProperty(this, "BUIy", function () {
|
|
1007
|
+
var condition = _this.vGYK;
|
|
1008
1008
|
var ceInstance = CE.getInstance();
|
|
1009
|
-
_this.
|
|
1010
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
1009
|
+
_this.ZDcP = true;
|
|
1010
|
+
ceInstance.registerForEvent(generateKey(condition.PTXF) + "___" + condition.yHbl.FiDT, _this.wgNe);
|
|
1011
1011
|
});
|
|
1012
|
-
_defineProperty(this, "
|
|
1013
|
-
var _this$
|
|
1012
|
+
_defineProperty(this, "owSn", function (type, name, time, additionalInfo) {
|
|
1013
|
+
var _this$HBDN;
|
|
1014
1014
|
var eventTime = Date.now();
|
|
1015
|
-
var time_differnce = (eventTime - _this.
|
|
1016
|
-
var time_fromConfig = ((_this$
|
|
1015
|
+
var time_differnce = (eventTime - _this.HTsU[name]) / 1000;
|
|
1016
|
+
var time_fromConfig = ((_this$HBDN = _this.HBDN) === null || _this$HBDN === void 0 || (_this$HBDN = _this$HBDN.yHbl) === null || _this$HBDN === void 0 || (_this$HBDN = _this$HBDN.bFur) === null || _this$HBDN === void 0 ? void 0 : _this$HBDN.time) / 1000;
|
|
1017
1017
|
if (time_fromConfig > time_differnce) {
|
|
1018
1018
|
_this._displayCampaign(time);
|
|
1019
1019
|
}
|
|
1020
1020
|
});
|
|
1021
|
-
_defineProperty(this, "
|
|
1021
|
+
_defineProperty(this, "jrrY", function (type, name, time, additionalInfo) {
|
|
1022
1022
|
var _this$_condition2, _this$_condition3;
|
|
1023
|
-
_this.
|
|
1023
|
+
_this.qHPA = true;
|
|
1024
1024
|
var currentTime = Date.now();
|
|
1025
|
-
var eventName = (_this$_condition2 = _this.
|
|
1026
|
-
var eventTime = _this.
|
|
1025
|
+
var eventName = (_this$_condition2 = _this.HBDN) === null || _this$_condition2 === void 0 || (_this$_condition2 = _this$_condition2.koaL) === null || _this$_condition2 === void 0 ? void 0 : _this$_condition2.yHbl.FiDT;
|
|
1026
|
+
var eventTime = _this.HTsU[eventName];
|
|
1027
1027
|
var time_differnce = (currentTime - eventTime) / 1000;
|
|
1028
|
-
var time_fromConfig = (_this$_condition3 = _this.
|
|
1028
|
+
var time_fromConfig = (_this$_condition3 = _this.HBDN) === null || _this$_condition3 === void 0 || (_this$_condition3 = _this$_condition3.yHbl) === null || _this$_condition3 === void 0 || (_this$_condition3 = _this$_condition3.bFur) === null || _this$_condition3 === void 0 ? void 0 : _this$_condition3.time;
|
|
1029
1029
|
time_fromConfig = time_fromConfig / 1000;
|
|
1030
1030
|
if (time_fromConfig > time_differnce) {
|
|
1031
1031
|
_this._displayCampaign(time);
|
|
1032
1032
|
}
|
|
1033
1033
|
//unregister the event
|
|
1034
1034
|
});
|
|
1035
|
-
_defineProperty(this, "
|
|
1035
|
+
_defineProperty(this, "SeWP", function (type, name, time, additionalInfo) {
|
|
1036
1036
|
var _window$ApxorRTM2, _window$ApxorRTM3;
|
|
1037
1037
|
var ceInstance = CE.getInstance();
|
|
1038
|
-
if (!_this.
|
|
1038
|
+
if (!_this.ZDcP) {
|
|
1039
1039
|
// Validate Precondition
|
|
1040
|
-
_this.
|
|
1041
|
-
if (_this.
|
|
1042
|
-
var condition = _this.
|
|
1043
|
-
var precondition = condition.
|
|
1044
|
-
precondition.
|
|
1040
|
+
_this.ZDcP = _this.KRhD(type, name, time, additionalInfo);
|
|
1041
|
+
if (_this.ZDcP) {
|
|
1042
|
+
var condition = _this.HBDN;
|
|
1043
|
+
var precondition = condition.koaL;
|
|
1044
|
+
precondition.XwIs = time;
|
|
1045
1045
|
//events will be registred by its type activity event_type: "activity_time"
|
|
1046
|
-
if ((condition === null || condition === void 0 ? void 0 : condition.
|
|
1047
|
-
var
|
|
1048
|
-
var event_time = condition === null || condition === void 0 || (
|
|
1049
|
-
if ((condition === null || condition === void 0 || (
|
|
1046
|
+
if ((condition === null || condition === void 0 ? void 0 : condition.PTXF) === "activity_time") {
|
|
1047
|
+
var HBDN$yHbl, HBDN$_details2, HBDN$_details3;
|
|
1048
|
+
var event_time = condition === null || condition === void 0 || (HBDN$yHbl = condition.yHbl) === null || HBDN$yHbl === void 0 || (HBDN$yHbl = HBDN$yHbl.bFur) === null || HBDN$yHbl === void 0 ? void 0 : HBDN$yHbl.time;
|
|
1049
|
+
if ((condition === null || condition === void 0 || (HBDN$_details2 = condition.yHbl) === null || HBDN$_details2 === void 0 || (HBDN$_details2 = HBDN$_details2.bFur) === null || HBDN$_details2 === void 0 ? void 0 : HBDN$_details2.nkpi.length) > 0) {
|
|
1050
1050
|
setTimeout(function () {
|
|
1051
|
-
if (!_this.
|
|
1052
|
-
_this.
|
|
1053
|
-
if (_this.
|
|
1054
|
-
_this.
|
|
1055
|
-
_this.
|
|
1056
|
-
if (_this.
|
|
1057
|
-
_this.
|
|
1058
|
-
ceInstance.validate(_this.
|
|
1051
|
+
if (!_this.qHPA) {
|
|
1052
|
+
_this.KUlF = true;
|
|
1053
|
+
if (_this.KUlF) {
|
|
1054
|
+
_this.HUFK += 1;
|
|
1055
|
+
_this.KUlF = _this.tZfA(_this.HUFK, _this.HBDN.MSzB, _this.HBDN.jxcB);
|
|
1056
|
+
if (_this.KUlF) {
|
|
1057
|
+
_this.HBDN.XwIs = time;
|
|
1058
|
+
ceInstance.validate(_this.tkvH, _this.SgFM);
|
|
1059
1059
|
}
|
|
1060
1060
|
}
|
|
1061
1061
|
}
|
|
1062
|
-
condition.
|
|
1063
|
-
ceInstance.unregisterFromEvent(toUpperCase(condition.
|
|
1062
|
+
condition.yHbl.bFur.nkpi.map(function (nokpi) {
|
|
1063
|
+
ceInstance.unregisterFromEvent(toUpperCase(condition.yHbl.bFur.et) + "___" + nokpi, _this);
|
|
1064
1064
|
});
|
|
1065
1065
|
}, event_time);
|
|
1066
|
-
condition.
|
|
1067
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
1066
|
+
condition.yHbl.bFur.nkpi.map(function (nokpi) {
|
|
1067
|
+
ceInstance.registerForEvent(toUpperCase(condition.yHbl.bFur.et) + "___" + nokpi, _this.jrrY);
|
|
1068
1068
|
});
|
|
1069
1069
|
}
|
|
1070
1070
|
//it is for unregistering the events did case after completing the time imit
|
|
1071
|
-
if ((condition === null || condition === void 0 || (
|
|
1071
|
+
if ((condition === null || condition === void 0 || (HBDN$_details3 = condition.yHbl) === null || HBDN$_details3 === void 0 || (HBDN$_details3 = HBDN$_details3.bFur) === null || HBDN$_details3 === void 0 ? void 0 : HBDN$_details3.kpi.length) > 0) {
|
|
1072
1072
|
setTimeout(function () {
|
|
1073
|
-
condition.
|
|
1074
|
-
ceInstance.unregisterFromEvent(toUpperCase(condition.
|
|
1073
|
+
condition.yHbl.bFur.kpi.map(function (kpi) {
|
|
1074
|
+
ceInstance.unregisterFromEvent(toUpperCase(condition.yHbl.bFur.et) + "___" + kpi, _this);
|
|
1075
1075
|
});
|
|
1076
1076
|
}, event_time);
|
|
1077
|
-
condition.
|
|
1078
|
-
if (kpi === condition.
|
|
1077
|
+
condition.yHbl.bFur.kpi.map(function (kpi) {
|
|
1078
|
+
if (kpi === condition.koaL.yHbl.FiDT) {
|
|
1079
1079
|
//unregister the previous event
|
|
1080
|
-
ceInstance.unregisterFromEvent(generateKey(precondition.
|
|
1081
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
1080
|
+
ceInstance.unregisterFromEvent(generateKey(precondition.PTXF) + "___" + precondition.yHbl.FiDT, _this);
|
|
1081
|
+
ceInstance.registerForEvent(toUpperCase(condition.yHbl.bFur.et) + "___" + kpi, _this.owSn);
|
|
1082
1082
|
} else {
|
|
1083
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
1083
|
+
ceInstance.registerForEvent(toUpperCase(condition.yHbl.bFur.et) + "___" + kpi, _this.jrrY);
|
|
1084
1084
|
}
|
|
1085
1085
|
});
|
|
1086
1086
|
}
|
|
1087
1087
|
} else {
|
|
1088
|
-
ceInstance.unregisterFromEvent(generateKey(precondition.
|
|
1089
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
1088
|
+
ceInstance.unregisterFromEvent(generateKey(precondition.PTXF) + "___" + precondition.yHbl.FiDT, _this);
|
|
1089
|
+
ceInstance.registerForEvent(generateKey(condition.PTXF) + "___" + condition.yHbl.FiDT, _this);
|
|
1090
1090
|
}
|
|
1091
|
-
_this.
|
|
1091
|
+
_this.HTsU[name] = Date.now();
|
|
1092
1092
|
}
|
|
1093
1093
|
return;
|
|
1094
1094
|
}
|
|
1095
|
-
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.
|
|
1096
|
-
_this.
|
|
1097
|
-
_this.
|
|
1098
|
-
ceInstance.validate(_this.
|
|
1095
|
+
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.tkvH) && Apxor.getController().isBadgeTriggerSatisfied(_this.tkvH)) {
|
|
1096
|
+
_this.KUlF = true;
|
|
1097
|
+
_this.HBDN.XwIs = time;
|
|
1098
|
+
ceInstance.validate(_this.tkvH, _this.SgFM);
|
|
1099
1099
|
return;
|
|
1100
1100
|
}
|
|
1101
1101
|
|
|
1102
1102
|
// Validate Condition
|
|
1103
|
-
var validationStatus = generateKey(_this.
|
|
1103
|
+
var validationStatus = generateKey(_this.HBDN.PTXF) === type && _this.AYJW(time - _this.HBDN.koaL.XwIs, _this.HBDN.ECcI) && _this.HBDN.yHbl.FiDT === name && _this.bscd(_this.HBDN.yHbl.bFur, additionalInfo);
|
|
1104
1104
|
if (validationStatus) {
|
|
1105
|
-
_this.
|
|
1106
|
-
_this.
|
|
1107
|
-
if (_this.
|
|
1108
|
-
_this.
|
|
1109
|
-
ceInstance.validate(_this.
|
|
1105
|
+
_this.HUFK += 1;
|
|
1106
|
+
_this.KUlF = _this.tZfA(_this.HUFK, _this.HBDN.MSzB, _this.HBDN.jxcB);
|
|
1107
|
+
if (_this.KUlF) {
|
|
1108
|
+
_this.HBDN.XwIs = time;
|
|
1109
|
+
ceInstance.validate(_this.tkvH, _this.SgFM);
|
|
1110
1110
|
}
|
|
1111
1111
|
}
|
|
1112
1112
|
});
|
|
1113
|
-
_defineProperty(this, "
|
|
1113
|
+
_defineProperty(this, "wgNe", function (type, name, time, additionalInfo) {
|
|
1114
1114
|
var ceInstance = CE.getInstance();
|
|
1115
|
-
var validationStatus = generateKey(_this.
|
|
1115
|
+
var validationStatus = generateKey(_this.vGYK.PTXF) === type && _this.AYJW(time, _this.vGYK.ECcI) && _this.vGYK.yHbl.FiDT === name && _this.bscd(_this.vGYK.yHbl.bFur, additionalInfo);
|
|
1116
1116
|
if (validationStatus) {
|
|
1117
|
-
_this.
|
|
1118
|
-
_this.
|
|
1119
|
-
if (_this.
|
|
1120
|
-
_this.
|
|
1121
|
-
ceInstance.validateForTermination(_this.
|
|
1117
|
+
_this.HUFK += 1;
|
|
1118
|
+
_this.KUlF = _this.tZfA(_this.HUFK, _this.vGYK.MSzB, _this.vGYK.jxcB);
|
|
1119
|
+
if (_this.KUlF) {
|
|
1120
|
+
_this.vGYK.XwIs = time;
|
|
1121
|
+
ceInstance.validateForTermination(_this.tkvH, _this.SgFM);
|
|
1122
1122
|
}
|
|
1123
1123
|
}
|
|
1124
1124
|
});
|
|
1125
|
-
_defineProperty(this, "
|
|
1126
|
-
var precondition = _this.
|
|
1127
|
-
return generateKey(precondition.
|
|
1125
|
+
_defineProperty(this, "KRhD", function (type, name, time, additionalInfo) {
|
|
1126
|
+
var precondition = _this.HBDN.koaL;
|
|
1127
|
+
return generateKey(precondition.PTXF) === type && precondition.yHbl.FiDT === name && _this.AYJW(time, precondition.ECcI) && _this.bscd(precondition.yHbl.bFur, additionalInfo);
|
|
1128
1128
|
});
|
|
1129
|
-
_defineProperty(this, "
|
|
1129
|
+
_defineProperty(this, "AYJW", function (time, timeBounds) {
|
|
1130
1130
|
var currentTime = Math.ceil(time);
|
|
1131
|
-
return currentTime > timeBounds.
|
|
1131
|
+
return currentTime > timeBounds.xTRO && currentTime < timeBounds.qRLS;
|
|
1132
1132
|
});
|
|
1133
|
-
_defineProperty(this, "
|
|
1133
|
+
_defineProperty(this, "tZfA", function (current, required, operator) {
|
|
1134
1134
|
var checkOld = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
1135
|
-
if (checkOld && _this.
|
|
1136
|
-
current = current + _this.
|
|
1135
|
+
if (checkOld && _this.HBDN.cUqy) {
|
|
1136
|
+
current = current + _this.TPiO;
|
|
1137
1137
|
}
|
|
1138
1138
|
switch (operator) {
|
|
1139
1139
|
case "EQ":
|
|
@@ -1150,7 +1150,7 @@
|
|
|
1150
1150
|
return false;
|
|
1151
1151
|
}
|
|
1152
1152
|
});
|
|
1153
|
-
_defineProperty(this, "
|
|
1153
|
+
_defineProperty(this, "bscd", function (expected, received) {
|
|
1154
1154
|
var status = true;
|
|
1155
1155
|
try {
|
|
1156
1156
|
var _loop = function _loop() {
|
|
@@ -1195,14 +1195,14 @@
|
|
|
1195
1195
|
} else if (type === "b") {
|
|
1196
1196
|
loggedValue = !!loggedValue;
|
|
1197
1197
|
}
|
|
1198
|
-
return
|
|
1198
|
+
return StAu(loggedValue, expectedValue, operator);
|
|
1199
1199
|
}
|
|
1200
|
-
//
|
|
1200
|
+
// StAu(loggedValue, expectedValue, operator)
|
|
1201
1201
|
);
|
|
1202
1202
|
|
|
1203
1203
|
status = status && match;
|
|
1204
1204
|
} else {
|
|
1205
|
-
status = status &&
|
|
1205
|
+
status = status && StAu(received[item], expected[item], "EQ");
|
|
1206
1206
|
}
|
|
1207
1207
|
},
|
|
1208
1208
|
_ret;
|
|
@@ -1221,13 +1221,13 @@
|
|
|
1221
1221
|
key: "_displayCampaign",
|
|
1222
1222
|
value: function _displayCampaign(time) {
|
|
1223
1223
|
var ceInstance = CE.getInstance();
|
|
1224
|
-
this.
|
|
1225
|
-
if (this.
|
|
1226
|
-
this.
|
|
1227
|
-
this.
|
|
1228
|
-
if (this.
|
|
1229
|
-
this.
|
|
1230
|
-
ceInstance.validate(this.
|
|
1224
|
+
this.KUlF = true;
|
|
1225
|
+
if (this.KUlF) {
|
|
1226
|
+
this.HUFK += 1;
|
|
1227
|
+
this.KUlF = this.tZfA(this.HUFK, this.HBDN.MSzB, this.HBDN.jxcB);
|
|
1228
|
+
if (this.KUlF) {
|
|
1229
|
+
this.HBDN.XwIs = time;
|
|
1230
|
+
ceInstance.validate(this.tkvH, this.SgFM);
|
|
1231
1231
|
}
|
|
1232
1232
|
}
|
|
1233
1233
|
}
|
|
@@ -1239,11 +1239,11 @@
|
|
|
1239
1239
|
var OverallConfig = /*#__PURE__*/_createClass(function OverallConfig() {
|
|
1240
1240
|
var _this = this;
|
|
1241
1241
|
_classCallCheck(this, OverallConfig);
|
|
1242
|
-
_defineProperty(this, "
|
|
1242
|
+
_defineProperty(this, "yTgw", []);
|
|
1243
1243
|
_defineProperty(this, "_ret_day", {});
|
|
1244
|
-
_defineProperty(this, "
|
|
1245
|
-
_defineProperty(this, "
|
|
1246
|
-
_defineProperty(this, "
|
|
1244
|
+
_defineProperty(this, "jJTV", {});
|
|
1245
|
+
_defineProperty(this, "oZvY", false);
|
|
1246
|
+
_defineProperty(this, "laSF", false);
|
|
1247
1247
|
_defineProperty(this, "retainedDaysValidated", true);
|
|
1248
1248
|
_defineProperty(this, "retainedSessionValidated", true);
|
|
1249
1249
|
_defineProperty(this, "eventDoneInLT", false);
|
|
@@ -1251,11 +1251,11 @@
|
|
|
1251
1251
|
_defineProperty(this, "parse", function () {
|
|
1252
1252
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1253
1253
|
try {
|
|
1254
|
-
_this.
|
|
1254
|
+
_this.yTgw = config.overall_cfg.events;
|
|
1255
1255
|
_this._ret_day = config.overall_cfg.ret_day;
|
|
1256
|
-
_this.
|
|
1257
|
-
_this.
|
|
1258
|
-
_this.
|
|
1256
|
+
_this.jJTV = config.overall_cfg.session;
|
|
1257
|
+
_this.oZvY = config.overall_cfg.toggleRetDay;
|
|
1258
|
+
_this.laSF = config.overall_cfg.toggleSession;
|
|
1259
1259
|
} catch (error) {
|
|
1260
1260
|
Logger$7.error(error);
|
|
1261
1261
|
return false;
|
|
@@ -1265,11 +1265,11 @@
|
|
|
1265
1265
|
_defineProperty(this, "validate", function () {
|
|
1266
1266
|
var retainedDays = parseInt(Apxor.getController().getFromStorage(APX_RETAINED_DAYS));
|
|
1267
1267
|
var retainedSession = parseInt(Apxor.getController().getFromStorage(APX_RETAINED_SESSIONS));
|
|
1268
|
-
if (_this.
|
|
1268
|
+
if (_this.oZvY && !isNaN(retainedDays) && !(retainedDays >= _this._ret_day.from && retainedDays <= _this._ret_day.to)) {
|
|
1269
1269
|
_this.retainedDaysValidated = false;
|
|
1270
1270
|
return false;
|
|
1271
1271
|
}
|
|
1272
|
-
if (_this.
|
|
1272
|
+
if (_this.laSF && !isNaN(retainedSession) && !(retainedSession >= _this.jJTV.from && retainedSession <= _this.jJTV.to)) {
|
|
1273
1273
|
_this.retainedSessionValidated = false;
|
|
1274
1274
|
return false;
|
|
1275
1275
|
}
|
|
@@ -1278,8 +1278,8 @@
|
|
|
1278
1278
|
var data = Apxor.getController().getFromStorage("_apx_lt_count");
|
|
1279
1279
|
var siteid = Apxor.getSiteId();
|
|
1280
1280
|
var LtCountObjDecoded = JSON.parse(new TextDecoder().decode(stringToArrayBuffer(decode(siteid, data))));
|
|
1281
|
-
for (var i = 0; i < _this.
|
|
1282
|
-
var evName = _this.
|
|
1281
|
+
for (var i = 0; i < _this.yTgw.length; i++) {
|
|
1282
|
+
var evName = _this.yTgw[i].name.replace("'", "").replace("’", "");
|
|
1283
1283
|
if (LtCountObjDecoded[evName]) {
|
|
1284
1284
|
_this.eventDoneInLT = true;
|
|
1285
1285
|
return false;
|
|
@@ -1296,14 +1296,14 @@
|
|
|
1296
1296
|
var Attributes = /*#__PURE__*/_createClass(function Attributes() {
|
|
1297
1297
|
var _this = this;
|
|
1298
1298
|
_classCallCheck(this, Attributes);
|
|
1299
|
-
_defineProperty(this, "
|
|
1300
|
-
_defineProperty(this, "
|
|
1299
|
+
_defineProperty(this, "fGzd", []);
|
|
1300
|
+
_defineProperty(this, "eYdP", []);
|
|
1301
1301
|
_defineProperty(this, "parse", function () {
|
|
1302
1302
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1303
1303
|
try {
|
|
1304
|
-
_this.
|
|
1305
|
-
_this.
|
|
1306
|
-
if (!Array.isArray(_this.
|
|
1304
|
+
_this.fGzd = config.attributes.user;
|
|
1305
|
+
_this.eYdP = config.attributes.session;
|
|
1306
|
+
if (!Array.isArray(_this.fGzd) || !Array.isArray(_this.eYdP)) {
|
|
1307
1307
|
Logger$8.error("No attributes");
|
|
1308
1308
|
return false;
|
|
1309
1309
|
}
|
|
@@ -1314,9 +1314,9 @@
|
|
|
1314
1314
|
return true;
|
|
1315
1315
|
});
|
|
1316
1316
|
_defineProperty(this, "validate", function (user, session) {
|
|
1317
|
-
return _this.
|
|
1317
|
+
return _this.WJGy(user, _this.fGzd) && _this.WJGy(session, _this.eYdP);
|
|
1318
1318
|
});
|
|
1319
|
-
_defineProperty(this, "
|
|
1319
|
+
_defineProperty(this, "WJGy", function (attributes, expected) {
|
|
1320
1320
|
var length = expected.length;
|
|
1321
1321
|
var status = true;
|
|
1322
1322
|
try {
|
|
@@ -1346,7 +1346,7 @@
|
|
|
1346
1346
|
}
|
|
1347
1347
|
var match = loggedValues.some(function (loggedValue) {
|
|
1348
1348
|
return values.some(function (configValue) {
|
|
1349
|
-
return
|
|
1349
|
+
return StAu(loggedValue, configValue, operator);
|
|
1350
1350
|
});
|
|
1351
1351
|
});
|
|
1352
1352
|
status = status && match;
|
|
@@ -1370,18 +1370,18 @@
|
|
|
1370
1370
|
var TimeBasedTermination = /*#__PURE__*/_createClass(function TimeBasedTermination() {
|
|
1371
1371
|
var _this = this;
|
|
1372
1372
|
_classCallCheck(this, TimeBasedTermination);
|
|
1373
|
-
_defineProperty(this, "
|
|
1373
|
+
_defineProperty(this, "lSAU", Apxor.getController());
|
|
1374
1374
|
_defineProperty(this, "type", "");
|
|
1375
1375
|
_defineProperty(this, "_duration_seconds", 0);
|
|
1376
|
-
_defineProperty(this, "
|
|
1376
|
+
_defineProperty(this, "UCQR", 1);
|
|
1377
1377
|
_defineProperty(this, "parse", function (config) {
|
|
1378
1378
|
try {
|
|
1379
1379
|
var _config$terminate_inf, _config$terminate_inf2, _config$terminate_inf3;
|
|
1380
|
-
_this.
|
|
1380
|
+
_this.WBXT = (_config$terminate_inf = config.terminate_info.time_based) === null || _config$terminate_inf === void 0 ? void 0 : _config$terminate_inf.type;
|
|
1381
1381
|
_this._duration_seconds = (_config$terminate_inf2 = config.terminate_info) === null || _config$terminate_inf2 === void 0 ? void 0 : _config$terminate_inf2.time_based.duration_seconds;
|
|
1382
|
-
_this.
|
|
1383
|
-
if (_this.
|
|
1384
|
-
_this.
|
|
1382
|
+
_this.UCQR = (_config$terminate_inf3 = config.terminate_info.time_based) === null || _config$terminate_inf3 === void 0 ? void 0 : _config$terminate_inf3.days;
|
|
1383
|
+
if (_this.StAu(config._id)) {
|
|
1384
|
+
_this.lSAU.persistTerminationInfoLocally(config._id);
|
|
1385
1385
|
return false;
|
|
1386
1386
|
}
|
|
1387
1387
|
} catch (_unused) {
|
|
@@ -1389,16 +1389,16 @@
|
|
|
1389
1389
|
}
|
|
1390
1390
|
return true;
|
|
1391
1391
|
});
|
|
1392
|
-
_defineProperty(this, "
|
|
1392
|
+
_defineProperty(this, "StAu", function (id) {
|
|
1393
1393
|
var _Data$id;
|
|
1394
|
-
var Data = JSON.parse(_this.
|
|
1394
|
+
var Data = JSON.parse(_this.lSAU.getFromStorage(APX_TERMINATION_ID));
|
|
1395
1395
|
if (!Data[id] || !((_Data$id = Data[id]) !== null && _Data$id !== void 0 && _Data$id.startDate)) return false;
|
|
1396
1396
|
var startDate = new Date(Data[id].startDate);
|
|
1397
1397
|
var presentDate = new Date(getDateInMMDDYYYY());
|
|
1398
1398
|
var diff = parseInt((presentDate - startDate) / (1000 * 60 * 60 * 24), 10);
|
|
1399
1399
|
var currentTime = _getTime();
|
|
1400
|
-
var
|
|
1401
|
-
return diff === _this.
|
|
1400
|
+
var ybQh = Data[id].ybQh;
|
|
1401
|
+
return diff === _this.UCQR && currentTime.hours >= ybQh.hours || diff > _this.UCQR || Data[id].goalAcheived;
|
|
1402
1402
|
});
|
|
1403
1403
|
});
|
|
1404
1404
|
|
|
@@ -1407,19 +1407,19 @@
|
|
|
1407
1407
|
_classCallCheck(this, TerminationInfo);
|
|
1408
1408
|
_defineProperty(this, "enable_goal_events", false);
|
|
1409
1409
|
_defineProperty(this, "attributes", {});
|
|
1410
|
-
_defineProperty(this, "
|
|
1411
|
-
_defineProperty(this, "
|
|
1410
|
+
_defineProperty(this, "MEqZ", new Attributes());
|
|
1411
|
+
_defineProperty(this, "ujNH", new TimeBasedTermination());
|
|
1412
1412
|
_defineProperty(this, "parse", function () {
|
|
1413
1413
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1414
1414
|
try {
|
|
1415
1415
|
var _config$terminate_inf, _config$terminate_inf2, _config$terminate_inf3;
|
|
1416
1416
|
_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;
|
|
1417
|
-
if (_this.enable_time_based && !_this.
|
|
1417
|
+
if (_this.enable_time_based && !_this.ujNH.parse(config)) {
|
|
1418
1418
|
return false;
|
|
1419
1419
|
}
|
|
1420
1420
|
_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;
|
|
1421
1421
|
_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;
|
|
1422
|
-
if (_this.enable_attributes && !_this.
|
|
1422
|
+
if (_this.enable_attributes && !_this.MEqZ.parse(config.terminate_info)) {
|
|
1423
1423
|
return false;
|
|
1424
1424
|
}
|
|
1425
1425
|
} catch (error) {
|
|
@@ -1429,27 +1429,27 @@
|
|
|
1429
1429
|
return true;
|
|
1430
1430
|
});
|
|
1431
1431
|
_defineProperty(this, "validate", function (user, session) {
|
|
1432
|
-
return _this.
|
|
1432
|
+
return _this.MEqZ.validate(user, session);
|
|
1433
1433
|
});
|
|
1434
1434
|
});
|
|
1435
1435
|
|
|
1436
1436
|
var Binding = /*#__PURE__*/_createClass(function Binding() {
|
|
1437
1437
|
var _this = this;
|
|
1438
1438
|
_classCallCheck(this, Binding);
|
|
1439
|
-
_defineProperty(this, "
|
|
1440
|
-
_defineProperty(this, "
|
|
1441
|
-
_defineProperty(this, "
|
|
1442
|
-
_defineProperty(this, "
|
|
1439
|
+
_defineProperty(this, "KdxM", "");
|
|
1440
|
+
_defineProperty(this, "BOkL", "");
|
|
1441
|
+
_defineProperty(this, "Trrq", "");
|
|
1442
|
+
_defineProperty(this, "fqdK", "");
|
|
1443
1443
|
_defineProperty(this, "parse", function () {
|
|
1444
1444
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1445
1445
|
try {
|
|
1446
|
-
_this.
|
|
1447
|
-
if (!_this.
|
|
1446
|
+
_this.KdxM = config === null || config === void 0 ? void 0 : config.screen_binding;
|
|
1447
|
+
if (!_this.KdxM) {
|
|
1448
1448
|
return true;
|
|
1449
1449
|
} else {
|
|
1450
|
-
_this.
|
|
1451
|
-
_this.
|
|
1452
|
-
_this.
|
|
1450
|
+
_this.BOkL = config === null || config === void 0 ? void 0 : config.binding.url;
|
|
1451
|
+
_this.Trrq = config === null || config === void 0 ? void 0 : config.binding["var"];
|
|
1452
|
+
_this.fqdK = config === null || config === void 0 ? void 0 : config.binding.operator;
|
|
1453
1453
|
return true;
|
|
1454
1454
|
}
|
|
1455
1455
|
} catch (error) {
|
|
@@ -1464,11 +1464,11 @@
|
|
|
1464
1464
|
* operator :operator can be either "EQ" used for equality comparision or "SW" used for startswith comparision
|
|
1465
1465
|
*/
|
|
1466
1466
|
_defineProperty(this, "validate", function () {
|
|
1467
|
-
var url = _this.
|
|
1468
|
-
var variable = _this.
|
|
1469
|
-
var operator = _this.
|
|
1467
|
+
var url = _this.BOkL;
|
|
1468
|
+
var variable = _this.Trrq;
|
|
1469
|
+
var operator = _this.fqdK;
|
|
1470
1470
|
var currentUrl = window.location.href;
|
|
1471
|
-
if (!_this.
|
|
1471
|
+
if (!_this.KdxM) {
|
|
1472
1472
|
return true;
|
|
1473
1473
|
} else {
|
|
1474
1474
|
if (operator === "EQ") {
|
|
@@ -1510,23 +1510,23 @@
|
|
|
1510
1510
|
var ConfigItem = /*#__PURE__*/_createClass(function ConfigItem() {
|
|
1511
1511
|
var _this = this;
|
|
1512
1512
|
_classCallCheck(this, ConfigItem);
|
|
1513
|
-
_defineProperty(this, "
|
|
1514
|
-
_defineProperty(this, "
|
|
1515
|
-
_defineProperty(this, "
|
|
1516
|
-
_defineProperty(this, "
|
|
1517
|
-
_defineProperty(this, "
|
|
1518
|
-
_defineProperty(this, "
|
|
1519
|
-
_defineProperty(this, "
|
|
1520
|
-
_defineProperty(this, "
|
|
1521
|
-
_defineProperty(this, "
|
|
1522
|
-
_defineProperty(this, "
|
|
1523
|
-
_defineProperty(this, "
|
|
1524
|
-
_defineProperty(this, "
|
|
1513
|
+
_defineProperty(this, "TbxE", []);
|
|
1514
|
+
_defineProperty(this, "oJYY", []);
|
|
1515
|
+
_defineProperty(this, "tkvH", "");
|
|
1516
|
+
_defineProperty(this, "FaOX", new Meta());
|
|
1517
|
+
_defineProperty(this, "wdlK", new Audience());
|
|
1518
|
+
_defineProperty(this, "kTyF", new Validity());
|
|
1519
|
+
_defineProperty(this, "tsTs", new Frequency());
|
|
1520
|
+
_defineProperty(this, "aNwp", new OverallConfig());
|
|
1521
|
+
_defineProperty(this, "smLy", new TerminationInfo());
|
|
1522
|
+
_defineProperty(this, "VfRX", new Binding());
|
|
1523
|
+
_defineProperty(this, "RJwC", false);
|
|
1524
|
+
_defineProperty(this, "eGzd", []);
|
|
1525
1525
|
_defineProperty(this, "_variant_code", "");
|
|
1526
1526
|
_defineProperty(this, "parse", function () {
|
|
1527
1527
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1528
1528
|
try {
|
|
1529
|
-
var _this$
|
|
1529
|
+
var _this$FaOX$_attr;
|
|
1530
1530
|
// If ID is not present, throw it out
|
|
1531
1531
|
if (!isDefined(config._id)) {
|
|
1532
1532
|
Logger$9.error("No Id");
|
|
@@ -1540,18 +1540,18 @@
|
|
|
1540
1540
|
}
|
|
1541
1541
|
|
|
1542
1542
|
// If META, VALIDITY, FREQUENCY and AUDIENCE is not parsed properly, throw it out
|
|
1543
|
-
if (!(_this.
|
|
1543
|
+
if (!(_this.FaOX.parse(config) && _this.kTyF.parse(config) && _this.tsTs.parse(config) && _this.wdlK.parse(config) && _this.aNwp.parse(config) && _this.smLy.parse(config) && _this.VfRX.parse(config))) {
|
|
1544
1544
|
return false;
|
|
1545
1545
|
}
|
|
1546
|
-
_this._variant_code = _this.
|
|
1546
|
+
_this._variant_code = _this.FaOX._isExperiment || _this.FaOX._only_context ? (_this$FaOX$_attr = _this.FaOX._attr) === null || _this$FaOX$_attr === void 0 ? void 0 : _this$FaOX$_attr[APX_VARIANT_CODE] : "TG";
|
|
1547
1547
|
// If there are no conditions, throw it out
|
|
1548
1548
|
if (!isDefined(config.conditions) || !Array.isArray(config.conditions)) {
|
|
1549
1549
|
Logger$9.error("No valid conditions", config.conditions);
|
|
1550
1550
|
return false;
|
|
1551
1551
|
}
|
|
1552
|
-
_this.
|
|
1553
|
-
_this.
|
|
1554
|
-
if (_this.
|
|
1552
|
+
_this.tkvH = config._id;
|
|
1553
|
+
_this.RJwC = isDefined(config.sequence_enabled) ? config.sequence_enabled : false;
|
|
1554
|
+
if (_this.RJwC) {
|
|
1555
1555
|
// iff respectSequence is true, Sort the Conditions by their sequence order
|
|
1556
1556
|
// We need to sort, if server sends them in orderless manner
|
|
1557
1557
|
config.conditions.sort(function (prev, current) {
|
|
@@ -1565,21 +1565,21 @@
|
|
|
1565
1565
|
var no_context_enabled = config === null || config === void 0 ? void 0 : config.no_context_enabled;
|
|
1566
1566
|
if (length === 0 && no_context_enabled) {
|
|
1567
1567
|
setTimeout(function () {
|
|
1568
|
-
_this.
|
|
1568
|
+
_this.VHRs();
|
|
1569
1569
|
}, 10);
|
|
1570
1570
|
}
|
|
1571
1571
|
var _loop = function _loop() {
|
|
1572
|
-
_this.
|
|
1572
|
+
_this.eGzd = [];
|
|
1573
1573
|
var condition = conditions[index];
|
|
1574
1574
|
if (condition.type === "didn't") {
|
|
1575
|
-
var
|
|
1575
|
+
var HBDN$details;
|
|
1576
1576
|
var obj = {
|
|
1577
1577
|
trigger_key: condition.trigger.details.name,
|
|
1578
|
-
no_kpi_array: condition === null || condition === void 0 || (
|
|
1578
|
+
no_kpi_array: condition === null || condition === void 0 || (HBDN$details = condition.details) === null || HBDN$details === void 0 || (HBDN$details = HBDN$details.additional_info) === null || HBDN$details === void 0 ? void 0 : HBDN$details.nkpi,
|
|
1579
1579
|
condition_id: condition === null || condition === void 0 ? void 0 : condition._id,
|
|
1580
1580
|
time_bounds: condition.time_bounds.upper
|
|
1581
1581
|
};
|
|
1582
|
-
_this.
|
|
1582
|
+
_this.eGzd = [].concat(_toConsumableArray(_this.eGzd), [obj]);
|
|
1583
1583
|
//this will be the key
|
|
1584
1584
|
//when event occur check this array and then then check the time
|
|
1585
1585
|
//check the time diffrence
|
|
@@ -1588,16 +1588,16 @@
|
|
|
1588
1588
|
}
|
|
1589
1589
|
|
|
1590
1590
|
var conditionValidator = new ConditionValidator();
|
|
1591
|
-
if (conditionValidator.initialize(condition, _this.
|
|
1592
|
-
_this.
|
|
1591
|
+
if (conditionValidator.initialize(condition, _this.tkvH, index, _this.RJwC, _this.eGzd)) {
|
|
1592
|
+
_this.TbxE.push(conditionValidator);
|
|
1593
1593
|
var max_retries = (condition === null || condition === void 0 ? void 0 : condition.timeout) / (condition === null || condition === void 0 ? void 0 : condition.findinterval);
|
|
1594
1594
|
var frame_id = (condition === null || condition === void 0 ? void 0 : condition.frameid) || "";
|
|
1595
1595
|
var url = condition === null || condition === void 0 ? void 0 : condition.url;
|
|
1596
1596
|
if (window.location.href === url) {
|
|
1597
1597
|
if (condition.event_type === "view_visibility") {
|
|
1598
1598
|
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) {
|
|
1599
|
-
//this.
|
|
1600
|
-
_this.
|
|
1599
|
+
//this.IyAK();
|
|
1600
|
+
_this.VHRs(true);
|
|
1601
1601
|
}
|
|
1602
1602
|
}
|
|
1603
1603
|
}
|
|
@@ -1607,8 +1607,8 @@
|
|
|
1607
1607
|
if (window.location.href === url) {
|
|
1608
1608
|
if (condition.event_type === "view_visibility") {
|
|
1609
1609
|
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) {
|
|
1610
|
-
//this.
|
|
1611
|
-
_this.
|
|
1610
|
+
//this.IyAK();
|
|
1611
|
+
_this.VHRs(true);
|
|
1612
1612
|
}
|
|
1613
1613
|
}
|
|
1614
1614
|
}
|
|
@@ -1618,114 +1618,114 @@
|
|
|
1618
1618
|
for (var index = 0; index < length; index++) {
|
|
1619
1619
|
_loop();
|
|
1620
1620
|
}
|
|
1621
|
-
if (_this.
|
|
1621
|
+
if (_this.smLy.enable_goal_events) {
|
|
1622
1622
|
var goal_events = config.terminate_info.goal_events.events;
|
|
1623
1623
|
var goaleventslength = goal_events.length;
|
|
1624
1624
|
for (var i = 0; i < goaleventslength; i++) {
|
|
1625
1625
|
var conditionValidator = new ConditionValidator();
|
|
1626
|
-
if (conditionValidator.initialize(goal_events[i], _this.
|
|
1627
|
-
_this.
|
|
1626
|
+
if (conditionValidator.initialize(goal_events[i], _this.tkvH, i, true, [], "termination")) {
|
|
1627
|
+
_this.oJYY.push(conditionValidator);
|
|
1628
1628
|
}
|
|
1629
1629
|
}
|
|
1630
1630
|
}
|
|
1631
|
-
return _this.
|
|
1631
|
+
return _this.TbxE.length > 0;
|
|
1632
1632
|
} catch (error) {
|
|
1633
1633
|
Logger$9.error(error);
|
|
1634
1634
|
return false;
|
|
1635
1635
|
}
|
|
1636
1636
|
});
|
|
1637
|
-
_defineProperty(this, "
|
|
1637
|
+
_defineProperty(this, "WTJq", function (index) {
|
|
1638
1638
|
if (index < 0) {
|
|
1639
1639
|
return;
|
|
1640
1640
|
}
|
|
1641
|
-
if (_this.
|
|
1642
|
-
var conditionValidator = _this.
|
|
1643
|
-
if (isDefined(conditionValidator) && conditionValidator.
|
|
1641
|
+
if (_this.RJwC) {
|
|
1642
|
+
var conditionValidator = _this.TbxE[index];
|
|
1643
|
+
if (isDefined(conditionValidator) && conditionValidator.KUlF) {
|
|
1644
1644
|
// Check if previous validator is satisfied
|
|
1645
|
-
var prevValidator = _this.
|
|
1646
|
-
if (isDefined(prevValidator) && !prevValidator.
|
|
1645
|
+
var prevValidator = _this.TbxE[index - 1];
|
|
1646
|
+
if (isDefined(prevValidator) && !prevValidator.KUlF) {
|
|
1647
1647
|
// TODO: If current index is satisfied before previous one, do something
|
|
1648
1648
|
// either unregister all conditions or remove this item from ConfigLookup
|
|
1649
1649
|
return;
|
|
1650
1650
|
}
|
|
1651
|
-
var nextValidator = _this.
|
|
1651
|
+
var nextValidator = _this.TbxE[index + 1];
|
|
1652
1652
|
if (!isDefined(nextValidator)) {
|
|
1653
1653
|
// It means this is the last condition
|
|
1654
1654
|
// Validate all conditions
|
|
1655
|
-
_this.
|
|
1655
|
+
_this.VHRs();
|
|
1656
1656
|
} else {
|
|
1657
|
-
nextValidator.
|
|
1657
|
+
nextValidator.IyAK();
|
|
1658
1658
|
}
|
|
1659
1659
|
}
|
|
1660
1660
|
} else {
|
|
1661
1661
|
// Validate all conditions
|
|
1662
|
-
_this.
|
|
1662
|
+
_this.VHRs();
|
|
1663
1663
|
}
|
|
1664
1664
|
});
|
|
1665
|
-
_defineProperty(this, "
|
|
1665
|
+
_defineProperty(this, "zTfD", function (index) {
|
|
1666
1666
|
if (index < 0) {
|
|
1667
1667
|
return;
|
|
1668
1668
|
}
|
|
1669
|
-
_this.
|
|
1669
|
+
_this.PXuU();
|
|
1670
1670
|
});
|
|
1671
|
-
_defineProperty(this, "
|
|
1671
|
+
_defineProperty(this, "VHRs", function () {
|
|
1672
1672
|
var _window$ApxorRTM, _window$ApxorRTM2;
|
|
1673
1673
|
var view_visibility = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
1674
1674
|
// Check If Audience, Validity is satisfied or not
|
|
1675
1675
|
var userAttributes = Apxor.getController().getUserAttributes();
|
|
1676
1676
|
var sessionAttributes = Apxor.getController().getSessionAttributes();
|
|
1677
|
-
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.
|
|
1677
|
+
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.tkvH) && Apxor.getController().isBadgeTriggerSatisfied(_this.tkvH))) {
|
|
1678
1678
|
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_trigger_satisfied", {
|
|
1679
|
-
apx_nudge_type: _this.
|
|
1680
|
-
apx_nudge_id: _this.
|
|
1681
|
-
apx_nudge_name: _this.
|
|
1682
|
-
apx_variant_code: _this.
|
|
1679
|
+
apx_nudge_type: _this.FaOX.WBXT === "SURVEY" ? "survey" : "campaign",
|
|
1680
|
+
apx_nudge_id: _this.tkvH,
|
|
1681
|
+
apx_nudge_name: _this.FaOX.FiDT,
|
|
1682
|
+
apx_variant_code: _this.FaOX._isExperiment || _this.FaOX._only_context ? _this.FaOX._attr[APX_VARIANT_CODE] : "TG"
|
|
1683
1683
|
});
|
|
1684
1684
|
}
|
|
1685
|
-
if (!_this.
|
|
1686
|
-
if (!_this.
|
|
1687
|
-
_this.
|
|
1685
|
+
if (!_this.kTyF.validate() || !_this.wdlK.validate(userAttributes, sessionAttributes) || !_this.aNwp.validate() || !_this.VfRX.validate()) {
|
|
1686
|
+
if (!_this.aNwp.retainedDaysValidated) {
|
|
1687
|
+
_this.vYAT("Retained day criteria not met");
|
|
1688
1688
|
return;
|
|
1689
1689
|
}
|
|
1690
|
-
if (!_this.
|
|
1691
|
-
_this.
|
|
1690
|
+
if (!_this.aNwp.retainedSessionValidated) {
|
|
1691
|
+
_this.vYAT("User session criteria not met");
|
|
1692
1692
|
return;
|
|
1693
1693
|
}
|
|
1694
|
-
if (_this.
|
|
1695
|
-
_this.
|
|
1694
|
+
if (_this.aNwp.eventDoneInLT) {
|
|
1695
|
+
_this.vYAT("Event done in life time");
|
|
1696
1696
|
return;
|
|
1697
1697
|
}
|
|
1698
|
-
if (!_this.
|
|
1699
|
-
_this.
|
|
1698
|
+
if (!_this.wdlK.userAttributesValidated) {
|
|
1699
|
+
_this.vYAT("User property filter not met");
|
|
1700
1700
|
return;
|
|
1701
1701
|
}
|
|
1702
|
-
if (!_this.
|
|
1703
|
-
_this.
|
|
1702
|
+
if (!_this.wdlK.sessionAttributeValidated) {
|
|
1703
|
+
_this.vYAT("Session property filter not met");
|
|
1704
1704
|
return;
|
|
1705
1705
|
}
|
|
1706
|
-
if (_this.
|
|
1707
|
-
_this.
|
|
1706
|
+
if (_this.kTyF._not_in_specified_time) {
|
|
1707
|
+
_this.vYAT("Time limits check failed");
|
|
1708
1708
|
return;
|
|
1709
1709
|
}
|
|
1710
|
-
if (_this.
|
|
1711
|
-
_this.
|
|
1710
|
+
if (_this.kTyF._not_yet_active) {
|
|
1711
|
+
_this.vYAT("not in the scheduled time");
|
|
1712
1712
|
return;
|
|
1713
1713
|
}
|
|
1714
|
-
if (_this.
|
|
1715
|
-
_this.
|
|
1714
|
+
if (_this.kTyF._nudge_expired) {
|
|
1715
|
+
_this.vYAT("nudge expired");
|
|
1716
1716
|
return;
|
|
1717
1717
|
}
|
|
1718
1718
|
return;
|
|
1719
1719
|
}
|
|
1720
|
-
var length = _this.
|
|
1720
|
+
var length = _this.TbxE.length;
|
|
1721
1721
|
var isSatisfied = length < 1;
|
|
1722
1722
|
var combineOperator = "";
|
|
1723
1723
|
if (length === 0) {
|
|
1724
1724
|
isSatisfied = true;
|
|
1725
1725
|
}
|
|
1726
1726
|
for (var index = 0; index < length; index++) {
|
|
1727
|
-
var validator = _this.
|
|
1728
|
-
var currentResult = validator.
|
|
1727
|
+
var validator = _this.TbxE[index];
|
|
1728
|
+
var currentResult = validator.KUlF;
|
|
1729
1729
|
if (combineOperator.trim() === "") {
|
|
1730
1730
|
isSatisfied = currentResult;
|
|
1731
1731
|
} else {
|
|
@@ -1738,7 +1738,7 @@
|
|
|
1738
1738
|
break;
|
|
1739
1739
|
}
|
|
1740
1740
|
}
|
|
1741
|
-
combineOperator = validator.
|
|
1741
|
+
combineOperator = validator.ZdyA;
|
|
1742
1742
|
}
|
|
1743
1743
|
if (view_visibility === true) {
|
|
1744
1744
|
isSatisfied = true;
|
|
@@ -1746,10 +1746,10 @@
|
|
|
1746
1746
|
if (isSatisfied) {
|
|
1747
1747
|
console.debug("onCondition satisfied");
|
|
1748
1748
|
// Check if count reached it's maximum
|
|
1749
|
-
if (!_this.
|
|
1750
|
-
console.warn("Maximum limit reached", _this.
|
|
1749
|
+
if (!_this.tsTs.tiom(_this.tkvH)) {
|
|
1750
|
+
console.warn("Maximum limit reached", _this.tkvH);
|
|
1751
1751
|
if (Apxor.getController().isTestDevice()) {
|
|
1752
|
-
feedBackMessagePopUpCE("Maximum limit reached for campaign name ".concat(_this.
|
|
1752
|
+
feedBackMessagePopUpCE("Maximum limit reached for campaign name ".concat(_this.FaOX.FiDT));
|
|
1753
1753
|
var closeButton = document.getElementById("close-button");
|
|
1754
1754
|
var dismissCallback = function dismissCallback() {
|
|
1755
1755
|
var modal_popup_container = document.getElementById("apx-container");
|
|
@@ -1763,36 +1763,36 @@
|
|
|
1763
1763
|
|
|
1764
1764
|
//logging event for view not found for test device
|
|
1765
1765
|
|
|
1766
|
-
console.log("Dispatching event", _this.
|
|
1766
|
+
console.log("Dispatching event", _this.FaOX.WBXT);
|
|
1767
1767
|
|
|
1768
|
-
//if (this.
|
|
1768
|
+
//if (this.FaOX._only_context === true) {
|
|
1769
1769
|
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({
|
|
1770
|
-
apx_nudge_type: _this.
|
|
1771
|
-
apx_nudge_id: _this.
|
|
1772
|
-
apx_nudge_name: _this.
|
|
1773
|
-
apx_variant_code: _this.
|
|
1774
|
-
}, _this.
|
|
1775
|
-
message_name: _this.
|
|
1776
|
-
id: _this.
|
|
1770
|
+
apx_nudge_type: _this.FaOX.WBXT === "SURVEY" ? "survey" : "campaign",
|
|
1771
|
+
apx_nudge_id: _this.tkvH,
|
|
1772
|
+
apx_nudge_name: _this.FaOX.FiDT,
|
|
1773
|
+
apx_variant_code: _this.FaOX._isExperiment || _this.FaOX._only_context ? _this.FaOX._attr[APX_VARIANT_CODE] : "TG"
|
|
1774
|
+
}, _this.FaOX._attr), {}, {
|
|
1775
|
+
message_name: _this.FaOX.FiDT,
|
|
1776
|
+
id: _this.tkvH
|
|
1777
1777
|
}));
|
|
1778
1778
|
//}
|
|
1779
1779
|
// Emit event
|
|
1780
|
-
Apxor.getController().dispatchEvent(_this.
|
|
1781
|
-
name: _this.
|
|
1780
|
+
Apxor.getController().dispatchEvent(_this.FaOX.WBXT, {
|
|
1781
|
+
name: _this.FaOX.WBXT,
|
|
1782
1782
|
additional_info: {
|
|
1783
|
-
uuid: _this.
|
|
1784
|
-
name: _this.
|
|
1783
|
+
uuid: _this.tkvH,
|
|
1784
|
+
name: _this.FaOX.FiDT
|
|
1785
1785
|
}
|
|
1786
1786
|
});
|
|
1787
1787
|
}
|
|
1788
1788
|
});
|
|
1789
|
-
_defineProperty(this, "
|
|
1790
|
-
var length = _this.
|
|
1789
|
+
_defineProperty(this, "PXuU", function () {
|
|
1790
|
+
var length = _this.oJYY.length;
|
|
1791
1791
|
var isSatisfied = length < 1;
|
|
1792
1792
|
var combineOperator = "";
|
|
1793
1793
|
for (var index = 0; index < length; index++) {
|
|
1794
|
-
var validator = _this.
|
|
1795
|
-
var currentResult = validator.
|
|
1794
|
+
var validator = _this.oJYY[index];
|
|
1795
|
+
var currentResult = validator.KUlF;
|
|
1796
1796
|
if (combineOperator.trim() === "") {
|
|
1797
1797
|
isSatisfied = currentResult;
|
|
1798
1798
|
} else {
|
|
@@ -1805,23 +1805,23 @@
|
|
|
1805
1805
|
break;
|
|
1806
1806
|
}
|
|
1807
1807
|
}
|
|
1808
|
-
combineOperator = validator.
|
|
1808
|
+
combineOperator = validator.seqy;
|
|
1809
1809
|
}
|
|
1810
1810
|
if (isSatisfied) {
|
|
1811
|
-
console.log("Dispatching event", _this.
|
|
1812
|
-
Apxor.getController().persistTerminationInfoLocally(_this.
|
|
1813
|
-
if (_this.
|
|
1814
|
-
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.
|
|
1815
|
-
message_name: _this.
|
|
1816
|
-
id: _this.
|
|
1811
|
+
console.log("Dispatching event", _this.FaOX.WBXT);
|
|
1812
|
+
Apxor.getController().persistTerminationInfoLocally(_this.tkvH);
|
|
1813
|
+
if (_this.FaOX._only_context === true) {
|
|
1814
|
+
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.FaOX._attr), {}, {
|
|
1815
|
+
message_name: _this.FaOX.FiDT,
|
|
1816
|
+
id: _this.tkvH
|
|
1817
1817
|
}));
|
|
1818
1818
|
}
|
|
1819
1819
|
// Emit event
|
|
1820
|
-
Apxor.getController().dispatchEvent(_this.
|
|
1821
|
-
name: _this.
|
|
1820
|
+
Apxor.getController().dispatchEvent(_this.FaOX.WBXT, {
|
|
1821
|
+
name: _this.FaOX.WBXT,
|
|
1822
1822
|
additional_info: {
|
|
1823
|
-
uuid: _this.
|
|
1824
|
-
name: _this.
|
|
1823
|
+
uuid: _this.tkvH,
|
|
1824
|
+
name: _this.FaOX.FiDT
|
|
1825
1825
|
}
|
|
1826
1826
|
});
|
|
1827
1827
|
}
|
|
@@ -1829,24 +1829,24 @@
|
|
|
1829
1829
|
_defineProperty(this, "validateForTerminationAttributes", function () {
|
|
1830
1830
|
var userAttributes = Apxor.getController().getUserAttributes();
|
|
1831
1831
|
var sessionAttributes = Apxor.getController().getSessionAttributes();
|
|
1832
|
-
return _this.
|
|
1832
|
+
return _this.smLy.validate(userAttributes, sessionAttributes);
|
|
1833
1833
|
});
|
|
1834
|
-
_defineProperty(this, "
|
|
1835
|
-
_this.
|
|
1834
|
+
_defineProperty(this, "hJWa", function () {
|
|
1835
|
+
_this.tsTs.hJWa();
|
|
1836
1836
|
});
|
|
1837
1837
|
_defineProperty(this, "getFrequencyCount", function () {
|
|
1838
|
-
return _this.
|
|
1838
|
+
return _this.tsTs.getFrequencyCount();
|
|
1839
1839
|
});
|
|
1840
|
-
_defineProperty(this, "
|
|
1841
|
-
return _this.
|
|
1840
|
+
_defineProperty(this, "KlBp", function () {
|
|
1841
|
+
return _this.tsTs.Hhtv();
|
|
1842
1842
|
});
|
|
1843
|
-
_defineProperty(this, "
|
|
1844
|
-
var _this$
|
|
1843
|
+
_defineProperty(this, "vYAT", function (reason) {
|
|
1844
|
+
var _this$FaOX$_attr2;
|
|
1845
1845
|
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
|
|
1846
|
-
apx_nudge_type: _this.
|
|
1847
|
-
apx_nudge_id: _this.
|
|
1848
|
-
apx_nudge_name: _this.
|
|
1849
|
-
apx_variant_code: _this.
|
|
1846
|
+
apx_nudge_type: _this.FaOX.WBXT === "SURVEY" ? "survey" : "campaign",
|
|
1847
|
+
apx_nudge_id: _this.tkvH,
|
|
1848
|
+
apx_nudge_name: _this.FaOX.FiDT,
|
|
1849
|
+
apx_variant_code: _this.FaOX._isExperiment || _this.FaOX._only_context ? (_this$FaOX$_attr2 = _this.FaOX._attr) === null || _this$FaOX$_attr2 === void 0 ? void 0 : _this$FaOX$_attr2[APX_VARIANT_CODE] : "TG",
|
|
1850
1850
|
apx_failure_type: "warn",
|
|
1851
1851
|
apx_reason: reason
|
|
1852
1852
|
});
|
|
@@ -1856,7 +1856,7 @@
|
|
|
1856
1856
|
var ConfigLookup = /*#__PURE__*/_createClass(function ConfigLookup() {
|
|
1857
1857
|
var _this = this;
|
|
1858
1858
|
_classCallCheck(this, ConfigLookup);
|
|
1859
|
-
_defineProperty(this, "
|
|
1859
|
+
_defineProperty(this, "UGOI", {});
|
|
1860
1860
|
_defineProperty(this, "parse", function () {
|
|
1861
1861
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
1862
1862
|
configs: []
|
|
@@ -1879,7 +1879,7 @@
|
|
|
1879
1879
|
var configId = _config._id;
|
|
1880
1880
|
var configItem = new ConfigItem();
|
|
1881
1881
|
if (configItem.parse(_config)) {
|
|
1882
|
-
_this.
|
|
1882
|
+
_this.UGOI[configId] = configItem;
|
|
1883
1883
|
} else {
|
|
1884
1884
|
console.warn("Failed to parse cfg", configId);
|
|
1885
1885
|
}
|
|
@@ -1887,51 +1887,51 @@
|
|
|
1887
1887
|
}
|
|
1888
1888
|
});
|
|
1889
1889
|
_defineProperty(this, "validate", function (id, index) {
|
|
1890
|
-
if (_this.
|
|
1891
|
-
var configItem = _this.
|
|
1892
|
-
configItem.
|
|
1890
|
+
if (_this.UGOI[id]) {
|
|
1891
|
+
var configItem = _this.UGOI[id];
|
|
1892
|
+
configItem.WTJq(index);
|
|
1893
1893
|
}
|
|
1894
1894
|
});
|
|
1895
1895
|
_defineProperty(this, "getVariantCode", function (id) {
|
|
1896
|
-
if (_this.
|
|
1897
|
-
var configItem = _this.
|
|
1896
|
+
if (_this.UGOI[id]) {
|
|
1897
|
+
var configItem = _this.UGOI[id];
|
|
1898
1898
|
return configItem._variant_code;
|
|
1899
1899
|
}
|
|
1900
1900
|
return "";
|
|
1901
1901
|
});
|
|
1902
1902
|
_defineProperty(this, "validateForTermination", function (id, index) {
|
|
1903
|
-
if (_this.
|
|
1904
|
-
var configItem = _this.
|
|
1905
|
-
configItem.
|
|
1903
|
+
if (_this.UGOI[id]) {
|
|
1904
|
+
var configItem = _this.UGOI[id];
|
|
1905
|
+
configItem.zTfD(index);
|
|
1906
1906
|
}
|
|
1907
1907
|
});
|
|
1908
1908
|
_defineProperty(this, "validateForTerminationAttributes", function (id) {
|
|
1909
|
-
if (_this.
|
|
1910
|
-
var configItem = _this.
|
|
1909
|
+
if (_this.UGOI[id]) {
|
|
1910
|
+
var configItem = _this.UGOI[id];
|
|
1911
1911
|
return configItem.validateForTerminationAttributes();
|
|
1912
1912
|
}
|
|
1913
1913
|
return false;
|
|
1914
1914
|
});
|
|
1915
|
-
_defineProperty(this, "
|
|
1916
|
-
var campiagnConfig = _this.
|
|
1917
|
-
campiagnConfig.
|
|
1915
|
+
_defineProperty(this, "hJWa", function (id) {
|
|
1916
|
+
var campiagnConfig = _this.UGOI[id];
|
|
1917
|
+
campiagnConfig.hJWa();
|
|
1918
1918
|
});
|
|
1919
1919
|
_defineProperty(this, "getFrequencyCount", function (id) {
|
|
1920
|
-
var campiagnConfig = _this.
|
|
1920
|
+
var campiagnConfig = _this.UGOI[id];
|
|
1921
1921
|
if (campiagnConfig != undefined) return campiagnConfig.getFrequencyCount();
|
|
1922
1922
|
});
|
|
1923
1923
|
_defineProperty(this, "resetFrequencyCounts", function () {
|
|
1924
|
-
var configs = _this.
|
|
1924
|
+
var configs = _this.UGOI;
|
|
1925
1925
|
for (var configId in configs) {
|
|
1926
|
-
configs[configId].
|
|
1926
|
+
configs[configId].KlBp();
|
|
1927
1927
|
}
|
|
1928
1928
|
});
|
|
1929
|
-
_defineProperty(this, "
|
|
1929
|
+
_defineProperty(this, "ZNQa", function (campaignId) {
|
|
1930
1930
|
try {
|
|
1931
|
-
if (_this.
|
|
1932
|
-
var configItem = _this.
|
|
1933
|
-
if (configItem && configItem.
|
|
1934
|
-
return configItem.
|
|
1931
|
+
if (_this.UGOI) {
|
|
1932
|
+
var configItem = _this.UGOI[campaignId];
|
|
1933
|
+
if (configItem && configItem.FaOX) {
|
|
1934
|
+
return configItem.FaOX;
|
|
1935
1935
|
}
|
|
1936
1936
|
}
|
|
1937
1937
|
} catch (e) {
|
|
@@ -1947,42 +1947,42 @@
|
|
|
1947
1947
|
var EventsListener = /*#__PURE__*/_createClass(function EventsListener() {
|
|
1948
1948
|
var _this = this;
|
|
1949
1949
|
_classCallCheck(this, EventsListener);
|
|
1950
|
-
_defineProperty(this, "
|
|
1951
|
-
_defineProperty(this, "
|
|
1952
|
-
_defineProperty(this, "
|
|
1950
|
+
_defineProperty(this, "kUGk", {});
|
|
1951
|
+
_defineProperty(this, "OKHG", []);
|
|
1952
|
+
_defineProperty(this, "oTBy", false);
|
|
1953
1953
|
_defineProperty(this, "initialize", function () {
|
|
1954
1954
|
var controller = Apxor.getController();
|
|
1955
1955
|
controller.registerForEvent(APP_EVENT, function (event) {
|
|
1956
|
-
return _this.
|
|
1956
|
+
return _this.bhnD(event, "AE");
|
|
1957
1957
|
});
|
|
1958
1958
|
controller.registerForEvent(CLIENT_EVENT, function (event) {
|
|
1959
|
-
return _this.
|
|
1959
|
+
return _this.bhnD(event, "CE");
|
|
1960
1960
|
});
|
|
1961
1961
|
});
|
|
1962
|
-
_defineProperty(this, "
|
|
1962
|
+
_defineProperty(this, "JJQh", function () {
|
|
1963
1963
|
// Clear Buffer
|
|
1964
|
-
for (var item in _this.
|
|
1965
|
-
_this.
|
|
1964
|
+
for (var item in _this.OKHG) {
|
|
1965
|
+
_this.sFoD(item.event, item.key, item.type);
|
|
1966
1966
|
}
|
|
1967
|
-
_this.
|
|
1967
|
+
_this.oTBy = true;
|
|
1968
1968
|
});
|
|
1969
|
-
_defineProperty(this, "
|
|
1969
|
+
_defineProperty(this, "vWFx", function (event, callback) {
|
|
1970
1970
|
if (!isFunction(callback)) {
|
|
1971
1971
|
return;
|
|
1972
1972
|
}
|
|
1973
1973
|
var listeners;
|
|
1974
|
-
if (_this.
|
|
1975
|
-
listeners = _this.
|
|
1974
|
+
if (_this.kUGk[event]) {
|
|
1975
|
+
listeners = _this.kUGk[event];
|
|
1976
1976
|
} else {
|
|
1977
1977
|
listeners = [];
|
|
1978
1978
|
}
|
|
1979
1979
|
listeners.push(callback);
|
|
1980
|
-
_this.
|
|
1981
|
-
Logger$a.debug("Listeners list: ", _this.
|
|
1980
|
+
_this.kUGk[event] = listeners;
|
|
1981
|
+
Logger$a.debug("Listeners list: ", _this.kUGk);
|
|
1982
1982
|
});
|
|
1983
1983
|
_defineProperty(this, "unregisterFromEvent", function (event, callback) {
|
|
1984
|
-
if (_this.
|
|
1985
|
-
var listeners = _this.
|
|
1984
|
+
if (_this.kUGk[event]) {
|
|
1985
|
+
var listeners = _this.kUGk[event];
|
|
1986
1986
|
var updatedListeners = [];
|
|
1987
1987
|
for (var index = 0; index < listeners.length; index++) {
|
|
1988
1988
|
var listener = listeners[index];
|
|
@@ -1990,25 +1990,25 @@
|
|
|
1990
1990
|
updatedListeners.push(listener);
|
|
1991
1991
|
}
|
|
1992
1992
|
}
|
|
1993
|
-
_this.
|
|
1993
|
+
_this.kUGk[event] = updatedListeners;
|
|
1994
1994
|
}
|
|
1995
1995
|
});
|
|
1996
|
-
_defineProperty(this, "
|
|
1996
|
+
_defineProperty(this, "bhnD", function (event) {
|
|
1997
1997
|
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "AE";
|
|
1998
1998
|
var key = type + "___" + event.name;
|
|
1999
|
-
_this.
|
|
1999
|
+
_this.sFoD(event, key, type);
|
|
2000
2000
|
});
|
|
2001
|
-
_defineProperty(this, "
|
|
2002
|
-
if (!_this.
|
|
2003
|
-
_this.
|
|
2001
|
+
_defineProperty(this, "sFoD", function (event, key, type) {
|
|
2002
|
+
if (!_this.oTBy) {
|
|
2003
|
+
_this.OKHG.push({
|
|
2004
2004
|
event: event,
|
|
2005
2005
|
key: key,
|
|
2006
2006
|
type: type
|
|
2007
2007
|
});
|
|
2008
2008
|
} else {
|
|
2009
|
-
Logger$a.debug("Notifying listeners for event: " + event + ", " + key, _this.
|
|
2010
|
-
if (_this.
|
|
2011
|
-
var listeners = _this.
|
|
2009
|
+
Logger$a.debug("Notifying listeners for event: " + event + ", " + key, _this.kUGk);
|
|
2010
|
+
if (_this.kUGk[key]) {
|
|
2011
|
+
var listeners = _this.kUGk[key];
|
|
2012
2012
|
var time = Apxor.getController().getSDKRunningTimeInSec();
|
|
2013
2013
|
for (var index = 0; index < listeners.length; index++) {
|
|
2014
2014
|
var listener = listeners[index];
|
|
@@ -2024,17 +2024,17 @@
|
|
|
2024
2024
|
function CE() {
|
|
2025
2025
|
var _this = this;
|
|
2026
2026
|
_classCallCheck(this, CE);
|
|
2027
|
-
_defineProperty(this, "
|
|
2028
|
-
_defineProperty(this, "
|
|
2029
|
-
_defineProperty(this, "
|
|
2030
|
-
_defineProperty(this, "
|
|
2031
|
-
_defineProperty(this, "
|
|
2027
|
+
_defineProperty(this, "UnLY", false);
|
|
2028
|
+
_defineProperty(this, "sqeD", null);
|
|
2029
|
+
_defineProperty(this, "OmCk", getDateInDDMMYYYY());
|
|
2030
|
+
_defineProperty(this, "ymVO", new EventsListener());
|
|
2031
|
+
_defineProperty(this, "looJ", Apxor.getSiteId());
|
|
2032
2032
|
_defineProperty(this, "_qeState", {});
|
|
2033
2033
|
_defineProperty(this, "getQeState", function () {
|
|
2034
2034
|
try {
|
|
2035
2035
|
var data = Apxor.getController().getFromStorage(QE_STATE);
|
|
2036
2036
|
if (data) {
|
|
2037
|
-
return JSON.parse(decode(_this.
|
|
2037
|
+
return JSON.parse(decode(_this.looJ, data));
|
|
2038
2038
|
} else {
|
|
2039
2039
|
_this._qeState = {};
|
|
2040
2040
|
return _this.setQeState();
|
|
@@ -2063,10 +2063,10 @@
|
|
|
2063
2063
|
return _this._qeState;
|
|
2064
2064
|
});
|
|
2065
2065
|
_defineProperty(this, "initialize", function () {
|
|
2066
|
-
if (!_this.
|
|
2067
|
-
_this.
|
|
2068
|
-
_this.
|
|
2069
|
-
_this.
|
|
2066
|
+
if (!_this.UnLY) {
|
|
2067
|
+
_this.UnLY = true;
|
|
2068
|
+
_this.sqeD = new ConfigLookup();
|
|
2069
|
+
_this.ymVO.initialize();
|
|
2070
2070
|
_this._qeState = _this.getQeState();
|
|
2071
2071
|
Logger$b.info("QE Initialized..");
|
|
2072
2072
|
}
|
|
@@ -2077,12 +2077,12 @@
|
|
|
2077
2077
|
* @param config
|
|
2078
2078
|
*/
|
|
2079
2079
|
_defineProperty(this, "parse", function (config) {
|
|
2080
|
-
if (!_this.
|
|
2080
|
+
if (!_this.pHuQ()) {
|
|
2081
2081
|
Logger$b.warn("Must call init first. Unable to proceed");
|
|
2082
2082
|
return;
|
|
2083
2083
|
}
|
|
2084
|
-
_this.
|
|
2085
|
-
_this.
|
|
2084
|
+
_this.sqeD.parse(config);
|
|
2085
|
+
_this.ymVO.JJQh();
|
|
2086
2086
|
});
|
|
2087
2087
|
/**
|
|
2088
2088
|
* Validates all conditions for given config ID
|
|
@@ -2091,22 +2091,22 @@
|
|
|
2091
2091
|
* @param index
|
|
2092
2092
|
*/
|
|
2093
2093
|
_defineProperty(this, "validate", function (id, index) {
|
|
2094
|
-
if (!_this.
|
|
2094
|
+
if (!_this.pHuQ()) {
|
|
2095
2095
|
return;
|
|
2096
2096
|
}
|
|
2097
|
-
_this.
|
|
2097
|
+
_this.sqeD.validate(id, index);
|
|
2098
2098
|
});
|
|
2099
2099
|
_defineProperty(this, "getVariantCode", function (id) {
|
|
2100
|
-
return _this.
|
|
2100
|
+
return _this.sqeD.getVariantCode(id);
|
|
2101
2101
|
});
|
|
2102
2102
|
_defineProperty(this, "validateForTermination", function (id, index) {
|
|
2103
|
-
if (!_this.
|
|
2103
|
+
if (!_this.pHuQ()) {
|
|
2104
2104
|
return;
|
|
2105
2105
|
}
|
|
2106
|
-
_this.
|
|
2106
|
+
_this.sqeD.validateForTermination(id, index);
|
|
2107
2107
|
});
|
|
2108
2108
|
_defineProperty(this, "validateForTerminationAttributes", function (user, session) {
|
|
2109
|
-
return _this.
|
|
2109
|
+
return _this.sqeD.validateForTerminationAttributes(user, session);
|
|
2110
2110
|
});
|
|
2111
2111
|
_defineProperty(this, "updateCount", function (id) {
|
|
2112
2112
|
try {
|
|
@@ -2115,25 +2115,25 @@
|
|
|
2115
2115
|
}
|
|
2116
2116
|
_this.incrementFrequencies(id);
|
|
2117
2117
|
_this.setQeState(id);
|
|
2118
|
-
_this.
|
|
2118
|
+
_this.sqeD.hJWa(id);
|
|
2119
2119
|
} catch (e) {
|
|
2120
2120
|
console.log("Could not update the count config:".concat(e));
|
|
2121
2121
|
}
|
|
2122
2122
|
});
|
|
2123
2123
|
_defineProperty(this, "resetFrequencyCounts", function () {
|
|
2124
|
-
_this.
|
|
2124
|
+
_this.sqeD.resetFrequencyCounts();
|
|
2125
2125
|
});
|
|
2126
2126
|
_defineProperty(this, "getFrequencyCount", function (id) {
|
|
2127
|
-
return _this.
|
|
2127
|
+
return _this.sqeD.getFrequencyCount(id);
|
|
2128
2128
|
});
|
|
2129
2129
|
_defineProperty(this, "registerForEvent", function (event, callback) {
|
|
2130
|
-
_this.
|
|
2130
|
+
_this.ymVO.vWFx(event, callback);
|
|
2131
2131
|
});
|
|
2132
2132
|
_defineProperty(this, "unregisterFromEvent", function (event, callback) {
|
|
2133
|
-
_this.
|
|
2133
|
+
_this.ymVO.unregisterFromEvent(event, callback);
|
|
2134
2134
|
});
|
|
2135
2135
|
_defineProperty(this, "notifyEventListener", function (event) {
|
|
2136
|
-
_this.
|
|
2136
|
+
_this.ymVO.bhnD(event);
|
|
2137
2137
|
});
|
|
2138
2138
|
/**
|
|
2139
2139
|
* Fetches the config from Server
|
|
@@ -2146,14 +2146,14 @@
|
|
|
2146
2146
|
_defineProperty(this, "fetch", function (type, validateUrl, apiUrl, callback) {
|
|
2147
2147
|
Apxor.getController().fetchConfiguration(type, validateUrl, apiUrl, callback);
|
|
2148
2148
|
});
|
|
2149
|
-
_defineProperty(this, "
|
|
2150
|
-
return _this.
|
|
2149
|
+
_defineProperty(this, "pHuQ", function () {
|
|
2150
|
+
return _this.UnLY;
|
|
2151
2151
|
});
|
|
2152
2152
|
_defineProperty(this, "getCampaignMetaFromQueryEngine", function (campaignId) {
|
|
2153
|
-
return _this.
|
|
2153
|
+
return _this.sqeD.ZNQa(campaignId);
|
|
2154
2154
|
});
|
|
2155
|
-
_defineProperty(this, "
|
|
2156
|
-
return _this.
|
|
2155
|
+
_defineProperty(this, "cLOV", function () {
|
|
2156
|
+
return _this.OmCk;
|
|
2157
2157
|
});
|
|
2158
2158
|
if (!CE.instance) {
|
|
2159
2159
|
CE.instance = this;
|
|
@@ -2177,7 +2177,7 @@
|
|
|
2177
2177
|
OVERALL: 0,
|
|
2178
2178
|
DATES: {}
|
|
2179
2179
|
};
|
|
2180
|
-
if (this.
|
|
2180
|
+
if (this.OmCk) this._qeState[id].DATES[this.OmCk] = 0;
|
|
2181
2181
|
this.setQeState(id);
|
|
2182
2182
|
}
|
|
2183
2183
|
} catch (e) {
|
|
@@ -2196,12 +2196,12 @@
|
|
|
2196
2196
|
|
|
2197
2197
|
// Increment the DATES count for this particular date by 1. If the date changes reset.
|
|
2198
2198
|
var currentDate = getDateInDDMMYYYY();
|
|
2199
|
-
if (currentDate !== this.
|
|
2200
|
-
this.
|
|
2199
|
+
if (currentDate !== this.OmCk || !(configFrequency.DATES && configFrequency.DATES[currentDate])) {
|
|
2200
|
+
this.OmCk = currentDate;
|
|
2201
2201
|
configFrequency.DATES = {};
|
|
2202
|
-
configFrequency.DATES[this.
|
|
2202
|
+
configFrequency.DATES[this.OmCk] = 0;
|
|
2203
2203
|
}
|
|
2204
|
-
configFrequency.DATES[this.
|
|
2204
|
+
configFrequency.DATES[this.OmCk] = configFrequency.DATES[this.OmCk] + 1;
|
|
2205
2205
|
}
|
|
2206
2206
|
}], [{
|
|
2207
2207
|
key: "getInstance",
|
|
@@ -2220,7 +2220,7 @@
|
|
|
2220
2220
|
|
|
2221
2221
|
/* eslint-disable no-empty */
|
|
2222
2222
|
|
|
2223
|
-
window.ceVersion =
|
|
2223
|
+
window.ceVersion = 180;
|
|
2224
2224
|
try {
|
|
2225
2225
|
if (exports !== undefined || exports !== null) {
|
|
2226
2226
|
exports["default"] = CE;
|