apxor-rtm-ui 0.1.0-qa.2 → 0.2.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.rtm.js.bak +536 -259
- package/dist/apxor.rtm.min.js +42 -1
- package/package.json +1 -1
package/dist/apxor.rtm.js.bak
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
3
3
|
typeof define === 'function' && define.amd ? define(factory) :
|
|
4
4
|
(global = global || self, global['apxor-rtm'] = factory());
|
|
5
|
-
}(this, function () { 'use strict';
|
|
5
|
+
}(this, (function () { 'use strict';
|
|
6
6
|
|
|
7
|
-
function _typeof(
|
|
7
|
+
function _typeof(o) {
|
|
8
8
|
"@babel/helpers - typeof";
|
|
9
9
|
|
|
10
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (
|
|
11
|
-
return typeof
|
|
12
|
-
} : function (
|
|
13
|
-
return
|
|
14
|
-
}, _typeof(
|
|
10
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
11
|
+
return typeof o;
|
|
12
|
+
} : function (o) {
|
|
13
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
14
|
+
}, _typeof(o);
|
|
15
15
|
}
|
|
16
16
|
function _classCallCheck(instance, Constructor) {
|
|
17
17
|
if (!(instance instanceof Constructor)) {
|
|
@@ -573,8 +573,9 @@
|
|
|
573
573
|
function getValue(value, index, defaultValue) {
|
|
574
574
|
if (Array.isArray(value)) {
|
|
575
575
|
var v = value[index];
|
|
576
|
-
return v == null ? defaultValue :
|
|
576
|
+
return v == null ? defaultValue : 0;
|
|
577
577
|
}
|
|
578
|
+
value = 0;
|
|
578
579
|
return value;
|
|
579
580
|
}
|
|
580
581
|
/**
|
|
@@ -5104,8 +5105,6 @@
|
|
|
5104
5105
|
case RIGHT_ARROW:
|
|
5105
5106
|
_this3.tour.next();
|
|
5106
5107
|
break;
|
|
5107
|
-
default:
|
|
5108
|
-
break;
|
|
5109
5108
|
}
|
|
5110
5109
|
});
|
|
5111
5110
|
}
|
|
@@ -6329,7 +6328,7 @@
|
|
|
6329
6328
|
var CENTER = "center";
|
|
6330
6329
|
var CLOSE_BUTTON_STYLE = {
|
|
6331
6330
|
NORMAL: "normal",
|
|
6332
|
-
FILL: "
|
|
6331
|
+
FILL: "filled"
|
|
6333
6332
|
};
|
|
6334
6333
|
var INAPP_POSITION = {
|
|
6335
6334
|
TOP_LEFT: "top-left",
|
|
@@ -6410,12 +6409,12 @@
|
|
|
6410
6409
|
var content = (_viewportMetaTag$getA = (_viewportMetaTag$getA2 = viewportMetaTag.getAttribute("content")) === null || _viewportMetaTag$getA2 === void 0 ? void 0 : _viewportMetaTag$getA2.split(",")) !== null && _viewportMetaTag$getA !== void 0 ? _viewportMetaTag$getA : [];
|
|
6411
6410
|
var initial_scale = 1;
|
|
6412
6411
|
content.forEach(function (currentValue, index, arr) {
|
|
6413
|
-
if (currentValue.indexOf("initial-scale") === 0) {
|
|
6412
|
+
if (currentValue.trimStart().indexOf("initial-scale") === 0) {
|
|
6414
6413
|
initial_scale = parseFloat(currentValue.split("=")[1]);
|
|
6415
6414
|
}
|
|
6416
6415
|
});
|
|
6417
6416
|
if (initial_scale) {
|
|
6418
|
-
return
|
|
6417
|
+
return 1 / initial_scale;
|
|
6419
6418
|
}
|
|
6420
6419
|
}
|
|
6421
6420
|
return 1;
|
|
@@ -6432,6 +6431,31 @@
|
|
|
6432
6431
|
return deepGet(foundSoFar, remainingProps, defaultValue);
|
|
6433
6432
|
}
|
|
6434
6433
|
|
|
6434
|
+
/**
|
|
6435
|
+
* @function _setFontFaceAtRule
|
|
6436
|
+
* @description generates a font face at rule for custom fonts
|
|
6437
|
+
* @param {object} fontconfig
|
|
6438
|
+
* @returns
|
|
6439
|
+
*/
|
|
6440
|
+
var _setFontFaceAtRule = function _setFontFaceAtRule(font) {
|
|
6441
|
+
if (!font.source || font.source === "url") {
|
|
6442
|
+
return [font.family, ""];
|
|
6443
|
+
}
|
|
6444
|
+
var src;
|
|
6445
|
+
var font_family = font.family;
|
|
6446
|
+
if (font.source === "res") {
|
|
6447
|
+
src = "file:///android_res/".concat(font_family);
|
|
6448
|
+
} else if (font.source === "asset") {
|
|
6449
|
+
src = "file:///android_asset/".concat(font_family);
|
|
6450
|
+
} else if (font.source === "path") {
|
|
6451
|
+
src = font.family;
|
|
6452
|
+
}
|
|
6453
|
+
font_family = font.family.split("/").pop().replace(/[^A-Za-z]/g, "");
|
|
6454
|
+
var fallbackFont = "sans-serif";
|
|
6455
|
+
var font_face = "\n @font-face {\n font-family: ".concat(font_family, ";\n src: url(").concat(src, ");\n }");
|
|
6456
|
+
return ["".concat(font_family, ", ").concat(fallbackFont), font_face];
|
|
6457
|
+
};
|
|
6458
|
+
|
|
6435
6459
|
/**
|
|
6436
6460
|
* @function createNewTextElement
|
|
6437
6461
|
* @description Creates a text element for the given text config. It could either be a title or a description.
|
|
@@ -6446,7 +6470,8 @@
|
|
|
6446
6470
|
element.setAttribute("id", currentId + "-" + type);
|
|
6447
6471
|
element.className = "apx-class-".concat(currentId, "-").concat(type);
|
|
6448
6472
|
var styleTag = document.createElement("style");
|
|
6449
|
-
|
|
6473
|
+
var custom_font = _setFontFaceAtRule(textConfig.font);
|
|
6474
|
+
styleTag.innerHTML = "\n ".concat(custom_font[1], "\n\n .apx-class-").concat(currentId, "-").concat(type, " {\n z-index:99999;\n color:").concat(textConfig.color, " !important;\n font-family:").concat(custom_font[0], " !important;\n font-size:").concat(textConfig.font.size, "px !important;\n font-weight:").concat(textConfig.font.weight, " !important;\n font-style:").concat(textConfig.font.style === "normal" || textConfig.font.style === "italic" ? textConfig.font.style + " !important" : "unset", ";\n }\n ");
|
|
6450
6475
|
// max-width:400px;
|
|
6451
6476
|
|
|
6452
6477
|
element.appendChild(styleTag);
|
|
@@ -6750,7 +6775,9 @@
|
|
|
6750
6775
|
text_padding_top = _button_css$text_padd.top,
|
|
6751
6776
|
enable_gradient = button_css.enable_gradient,
|
|
6752
6777
|
_button_css$gradient = button_css.gradient,
|
|
6753
|
-
gradient = _button_css$gradient === void 0 ? {} : _button_css$gradient
|
|
6778
|
+
gradient = _button_css$gradient === void 0 ? {} : _button_css$gradient,
|
|
6779
|
+
_button_css$custom_fo = button_css.custom_font,
|
|
6780
|
+
custom_font = _button_css$custom_fo === void 0 ? '' : _button_css$custom_fo;
|
|
6754
6781
|
var gradient_direction, gradient_c1, gradient_c2;
|
|
6755
6782
|
if (enable_gradient) {
|
|
6756
6783
|
gradient_direction = gradient.direction || "to right";
|
|
@@ -6808,7 +6835,7 @@
|
|
|
6808
6835
|
if (enable_gradient) {
|
|
6809
6836
|
gradientStyles = "background-image:linear-gradient(".concat(gradient_direction, ", ").concat(gradient_c1, ", ").concat(gradient_c2, ");");
|
|
6810
6837
|
}
|
|
6811
|
-
buttons += type !== "stepper" ? "\n div .button-div.".concat(position, "-button-").concat(slot, "{\n width:auto;\n height:auto;\n cursor: pointer;\n background-color: ").concat(bg_color === "#" ? "transparent" : bg_color, ";\n ").concat(borderStyles, "\n ").concat(marginStyles, "\n ").concat(paddingStyles, "\n ").concat(marginLeft ? "margin-left:auto;" : "", "\n ").concat(marginRight ? "margin-right:auto;" : "margin-right:12px;", "\n ").concat(gradientStyles, "\n }\n .").concat(position, "-button-").concat(slot, "{\n cursor: pointer;\n color: ").concat(text_color, ";\n background-color: transparent;\n font-size: ").concat(size, "px;\n border:none;\n font-family: ").concat(font_family, ";\n font-weight: ").concat(weight, ";\n font-style: ").concat(style, ";\n margin: ").concat(text_margin_top, "px ").concat(text_margin_right, "px ").concat(text_margin_bottom, "px ").concat(text_margin_left, "px;\n padding: ").concat(text_padding_top, "px ").concat(text_padding_right, "px ").concat(text_padding_bottom, "px ").concat(text_padding_left, "px;\n }\n ") : "\n div .button-div.".concat(position, "-button-").concat(slot, "{\n width:auto;\n height:auto;\n cursor: pointer;\n background-color: transparent;\n ").concat(marginLeft ? "margin-left:auto;" : "", "\n ").concat(marginRight ? "margin-right:auto;" : "margin-right:12px;", "\n ").concat(gradientStyles, "\n }\n ").concat(sub_type === CAROUSEL_TYPE.NUMBER ? "div .stepper-".concat(sub_type, "{\n font-family:").concat(numberedfont.family, ";\n font-size: ").concat(numberedfont.size, "px;\n font-style:").concat(numberedfont.style, ";\n font-width:").concat(numberedfont.width, ";\n color:").concat(numbered.color, ";\n }") : "", "\n\n ").concat(sub_type === CAROUSEL_TYPE.CAROUSAL ? "div .stepper-".concat(sub_type, "{\n font-size:\"20px\";\n }") : "", "\n ");
|
|
6838
|
+
buttons += type !== "stepper" ? "\n ".concat(custom_font, "\n div .button-div.").concat(position, "-button-").concat(slot, "{\n width:auto;\n height:auto;\n cursor: pointer;\n background-color: ").concat(bg_color === "#" ? "transparent" : bg_color, ";\n ").concat(borderStyles, "\n ").concat(marginStyles, "\n ").concat(paddingStyles, "\n ").concat(marginLeft ? "margin-left:auto;" : "", "\n ").concat(marginRight ? "margin-right:auto;" : "margin-right:12px;", "\n ").concat(gradientStyles, "\n }\n .").concat(position, "-button-").concat(slot, "{\n cursor: pointer;\n color: ").concat(text_color, ";\n background-color: transparent;\n font-size: ").concat(size, "px;\n border:none;\n font-family: ").concat(font_family, ";\n font-weight: ").concat(weight, ";\n font-style: ").concat(style, ";\n margin: ").concat(text_margin_top, "px ").concat(text_margin_right, "px ").concat(text_margin_bottom, "px ").concat(text_margin_left, "px;\n padding: ").concat(text_padding_top, "px ").concat(text_padding_right, "px ").concat(text_padding_bottom, "px ").concat(text_padding_left, "px;\n }\n ") : "\n ".concat(custom_font, "\n div .button-div.").concat(position, "-button-").concat(slot, "{\n width:auto;\n height:auto;\n cursor: pointer;\n background-color: transparent;\n ").concat(marginLeft ? "margin-left:auto;" : "", "\n ").concat(marginRight ? "margin-right:auto;" : "margin-right:12px;", "\n ").concat(gradientStyles, "\n }\n ").concat(sub_type === CAROUSEL_TYPE.NUMBER ? "div .stepper-".concat(sub_type, "{\n font-family:").concat(numberedfont.family, ";\n font-size: ").concat(numberedfont.size, "px;\n font-style:").concat(numberedfont.style, ";\n font-width:").concat(numberedfont.width, ";\n color:").concat(numbered.color, ";\n }") : "", "\n\n ").concat(sub_type === CAROUSEL_TYPE.CAROUSAL ? "div .stepper-".concat(sub_type, "{\n font-size:\"20px\";\n }") : "", "\n ");
|
|
6812
6839
|
});
|
|
6813
6840
|
return "\n div .".concat(position, "-buttons-container {\n width:100%;\n display: flex;\n flex-direction:").concat(button_direction === DIRECTION.VERTICAL && position === BUTTON_CONTAINER_POSITION.BOTTOM ? "column" : "row", ";\n justify-content:").concat(justifyContent, ";\n align-items:center;\n flex-wrap:wrap;\n }\n ").concat(buttons, "\n ");
|
|
6814
6841
|
};
|
|
@@ -6822,31 +6849,34 @@
|
|
|
6822
6849
|
var isWalkthrough = arguments.length > 6 ? arguments[6] : undefined;
|
|
6823
6850
|
var uis = arguments.length > 7 ? arguments[7] : undefined;
|
|
6824
6851
|
var ind = arguments.length > 8 ? arguments[8] : undefined;
|
|
6825
|
-
var rtmInstance = window.ApxorRTM;
|
|
6826
6852
|
var buttons_array = [];
|
|
6827
6853
|
var buttons_css = [];
|
|
6828
6854
|
buttons_config.sort(function (a, b) {
|
|
6829
6855
|
return a.slot - b.slot;
|
|
6830
6856
|
});
|
|
6831
6857
|
buttons_config.forEach(function (button_config) {
|
|
6832
|
-
var
|
|
6833
|
-
|
|
6834
|
-
|
|
6835
|
-
|
|
6836
|
-
|
|
6837
|
-
|
|
6838
|
-
|
|
6839
|
-
|
|
6840
|
-
|
|
6841
|
-
|
|
6842
|
-
|
|
6843
|
-
|
|
6844
|
-
|
|
6845
|
-
}
|
|
6858
|
+
var _button_config$action;
|
|
6859
|
+
// let _action = "end";
|
|
6860
|
+
// let url = "";
|
|
6861
|
+
// let isExternal = "";
|
|
6862
|
+
// let redirectWithin = "";
|
|
6863
|
+
// let callbackFunction = () => {};
|
|
6864
|
+
|
|
6865
|
+
// if (button_config.enable_action) {
|
|
6866
|
+
// const action = button_config.action;
|
|
6867
|
+
// _action = action.type;
|
|
6868
|
+
// url = action.url;
|
|
6869
|
+
// isExternal = action.is_external;
|
|
6870
|
+
// redirectWithin = action.is_within ?? false;
|
|
6871
|
+
// callbackFunction = action.callback ?? (() => {});
|
|
6872
|
+
// }
|
|
6873
|
+
|
|
6874
|
+
var action_config = (_button_config$action = button_config === null || button_config === void 0 ? void 0 : button_config.action) !== null && _button_config$action !== void 0 ? _button_config$action : {};
|
|
6875
|
+
var _action = action_config === null || action_config === void 0 ? void 0 : action_config.action;
|
|
6846
6876
|
var vMap = {};
|
|
6847
6877
|
if (button_config.enable_text) {
|
|
6848
|
-
var _button_config$text$s, _button_config$text
|
|
6849
|
-
vMap = (_button_config$text$s = (_button_config$text = button_config.text) === null || _button_config$text === void 0
|
|
6878
|
+
var _button_config$text$s, _button_config$text;
|
|
6879
|
+
vMap = (_button_config$text$s = (_button_config$text = button_config.text) === null || _button_config$text === void 0 || (_button_config$text = _button_config$text.script) === null || _button_config$text === void 0 ? void 0 : _button_config$text.vmap) !== null && _button_config$text$s !== void 0 ? _button_config$text$s : {};
|
|
6850
6880
|
}
|
|
6851
6881
|
var slot = button_config.slot,
|
|
6852
6882
|
type = button_config.type,
|
|
@@ -6864,7 +6894,7 @@
|
|
|
6864
6894
|
_button_config$text2$ = _button_config$text2.font,
|
|
6865
6895
|
size = _button_config$text2$.size,
|
|
6866
6896
|
style = _button_config$text2$.style,
|
|
6867
|
-
|
|
6897
|
+
fontfamily = _button_config$text2$.family,
|
|
6868
6898
|
weight = _button_config$text2$.weight,
|
|
6869
6899
|
text_margin = _button_config$text2.margin,
|
|
6870
6900
|
text_padding = _button_config$text2.padding,
|
|
@@ -6877,8 +6907,8 @@
|
|
|
6877
6907
|
case "done":
|
|
6878
6908
|
case "dismiss":
|
|
6879
6909
|
action = function action() {
|
|
6880
|
-
window.Apxor.logActionEvent(configType + text + "_Clicked", uuid, name);
|
|
6881
6910
|
ActionHandler.complete(false, "dismiss");
|
|
6911
|
+
window.Apxor.logActionEvent(configType + text + "_Clicked", uuid, name);
|
|
6882
6912
|
};
|
|
6883
6913
|
break;
|
|
6884
6914
|
case "next":
|
|
@@ -6901,22 +6931,22 @@
|
|
|
6901
6931
|
break;
|
|
6902
6932
|
case "redirect":
|
|
6903
6933
|
action = function action() {
|
|
6904
|
-
|
|
6905
|
-
|
|
6906
|
-
|
|
6907
|
-
|
|
6908
|
-
|
|
6909
|
-
|
|
6910
|
-
|
|
6911
|
-
}
|
|
6912
|
-
ActionHandler.next(false, "redirect");
|
|
6934
|
+
ActionHandler.complete(false, "redirect");
|
|
6935
|
+
window.Apxor.redirectTo("IN_APP", uuid, name, text, JSON.stringify(action_config));
|
|
6936
|
+
// if (redirectWithin || isExternal) {
|
|
6937
|
+
// window.open(url, redirectWithin ? "_self" : "_blank");
|
|
6938
|
+
// } else {
|
|
6939
|
+
// rtmInstance.logClientEvent("REDIRECT", { url });
|
|
6940
|
+
// }
|
|
6913
6941
|
};
|
|
6942
|
+
|
|
6914
6943
|
break;
|
|
6915
6944
|
case "cancel":
|
|
6916
6945
|
action = function action() {
|
|
6917
|
-
ActionHandler._isCancelled = true;
|
|
6918
6946
|
ActionHandler.cancel(true, "cancel");
|
|
6947
|
+
ActionHandler._isCancelled = true;
|
|
6919
6948
|
window.Apxor.logActionEvent(configType + text + "_Clicked", uuid, name);
|
|
6949
|
+
window.Apxor.logActionEvent("walk_through_cancelled", uuid, name);
|
|
6920
6950
|
};
|
|
6921
6951
|
break;
|
|
6922
6952
|
case "submit":
|
|
@@ -6933,13 +6963,15 @@
|
|
|
6933
6963
|
break;
|
|
6934
6964
|
default:
|
|
6935
6965
|
action = function action() {
|
|
6936
|
-
window.Apxor.logActionEvent(configType + text + "_Clicked", uuid, name);
|
|
6937
6966
|
ActionHandler.cancel(false, "cancel");
|
|
6967
|
+
window.Apxor.logActionEvent(configType + text + "_Clicked", uuid, name);
|
|
6938
6968
|
};
|
|
6939
6969
|
}
|
|
6940
6970
|
} catch (e) {
|
|
6941
|
-
|
|
6971
|
+
console.error("Error setting actions on the buttons:" + e);
|
|
6942
6972
|
}
|
|
6973
|
+
var custom_font = _setFontFaceAtRule(button_config.text.font);
|
|
6974
|
+
var font_family = custom_font[0];
|
|
6943
6975
|
buttons_css.push({
|
|
6944
6976
|
slot: slot,
|
|
6945
6977
|
type: type,
|
|
@@ -6959,7 +6991,8 @@
|
|
|
6959
6991
|
enable_padding: enable_padding,
|
|
6960
6992
|
padding: padding,
|
|
6961
6993
|
enable_gradient: enable_gradient,
|
|
6962
|
-
gradient: gradient
|
|
6994
|
+
gradient: gradient,
|
|
6995
|
+
"custom_font": custom_font[1]
|
|
6963
6996
|
});
|
|
6964
6997
|
buttons_array.push({
|
|
6965
6998
|
type: "".concat(type ? type : "button"),
|
|
@@ -7016,7 +7049,7 @@
|
|
|
7016
7049
|
var _form_element$name$, _form_element$name, _form_element$placeho, _form_element$placeho2, _form_element$name$2, _form_element$name2, _form_element$placeho3, _form_element$placeho4, _form_element$name3, _form_element$placeho5, _form_element$name4, _form_element$placeho6, _form_element$name5, _form_element$placeho7, _form_element$name6, _form_element$name7, _form_element$placeho8, _form_element$value;
|
|
7017
7050
|
switch (form_element.type) {
|
|
7018
7051
|
case "fullname":
|
|
7019
|
-
return "\n <div class=\"mainName\" style=\"padding: 8px; display: flex;gap :8px\" >\n <div class=\"first\" style=\"width:50%\">\n ".concat(form_element.name ? "<label for=\"fname\" style=\"line-height:1.5;\">".concat((_form_element$name$ = form_element === null || form_element === void 0
|
|
7052
|
+
return "\n <div class=\"mainName\" style=\"padding: 8px; display: flex;gap :8px\" >\n <div class=\"first\" style=\"width:50%\">\n ".concat(form_element.name ? "<label for=\"fname\" style=\"line-height:1.5;\">".concat((_form_element$name$ = form_element === null || form_element === void 0 || (_form_element$name = form_element.name) === null || _form_element$name === void 0 ? void 0 : _form_element$name[0]) !== null && _form_element$name$ !== void 0 ? _form_element$name$ : " ", "</label><br />") : "", "\n <input type=\"text\" id=\"fname\" placeholder=\"").concat((_form_element$placeho = form_element === null || form_element === void 0 || (_form_element$placeho2 = form_element.placeholder) === null || _form_element$placeho2 === void 0 ? void 0 : _form_element$placeho2[0]) !== null && _form_element$placeho !== void 0 ? _form_element$placeho : " ", "\" style=\"width: 90%;border-radius: 5px;padding: 8px;\"/>\n </div>\n <div class=\"first\" style=\"width:50%\">\n ").concat(form_element.name ? "<label for=\"fname\" style=\"line-height:1.5;\">".concat((_form_element$name$2 = form_element === null || form_element === void 0 || (_form_element$name2 = form_element.name) === null || _form_element$name2 === void 0 ? void 0 : _form_element$name2[1]) !== null && _form_element$name$2 !== void 0 ? _form_element$name$2 : " ", "</label><br />") : "", "\n <input type=\"text\" id=\"lname\" placeholder=\"").concat((_form_element$placeho3 = form_element === null || form_element === void 0 || (_form_element$placeho4 = form_element.placeholder) === null || _form_element$placeho4 === void 0 ? void 0 : _form_element$placeho4[1]) !== null && _form_element$placeho3 !== void 0 ? _form_element$placeho3 : " ", "\" style=\"width: 90%;border-radius: 5px;padding: 8px;\"/>\n </div>\n </div>");
|
|
7020
7053
|
case "name":
|
|
7021
7054
|
return "\n <div class=\"mainFullName\" style=\"width:100%;padding: 8px;box-sizing: border-box;\">\n ".concat(form_element.name ? "<label for=\"name\" style=\"line-height:1.5;\">".concat((_form_element$name3 = form_element === null || form_element === void 0 ? void 0 : form_element.name) !== null && _form_element$name3 !== void 0 ? _form_element$name3 : " ", "</label><br />") : "", "\n <input type=\"text\" id=\"name\" placeholder=\"").concat((_form_element$placeho5 = form_element === null || form_element === void 0 ? void 0 : form_element.placeholder) !== null && _form_element$placeho5 !== void 0 ? _form_element$placeho5 : " ", "\" style=\"width: 95%;border-radius: 5px;padding: 8px;\"/>\n </div>");
|
|
7022
7055
|
case "email":
|
|
@@ -7196,7 +7229,7 @@
|
|
|
7196
7229
|
element = document.querySelector(selector);
|
|
7197
7230
|
} catch (e) {
|
|
7198
7231
|
//If there is an exception, it means it is not a valid selector.
|
|
7199
|
-
|
|
7232
|
+
console.error("Error finding element in DOM:" + e);
|
|
7200
7233
|
}
|
|
7201
7234
|
}
|
|
7202
7235
|
// If no element is found till now, it means it is neither an ID nor a valid css selector. It could be an XPath.
|
|
@@ -7206,8 +7239,8 @@
|
|
|
7206
7239
|
|
|
7207
7240
|
// If no element is found, it means the selector is not an ID. It could be a css selector
|
|
7208
7241
|
if (!element && iframe_id.length > 0) {
|
|
7209
|
-
var _document$getElementB
|
|
7210
|
-
element = (_document$getElementB = document.getElementById(iframe_id)) === null || _document$getElementB === void 0
|
|
7242
|
+
var _document$getElementB;
|
|
7243
|
+
element = (_document$getElementB = document.getElementById(iframe_id)) === null || _document$getElementB === void 0 || (_document$getElementB = _document$getElementB.contentWindow) === null || _document$getElementB === void 0 || (_document$getElementB = _document$getElementB.document) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.querySelector(selector);
|
|
7211
7244
|
}
|
|
7212
7245
|
return element;
|
|
7213
7246
|
};
|
|
@@ -7225,7 +7258,7 @@
|
|
|
7225
7258
|
}
|
|
7226
7259
|
}, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
|
|
7227
7260
|
} catch (e) {
|
|
7228
|
-
|
|
7261
|
+
console.error("Error finding element in DOM:" + e);
|
|
7229
7262
|
}
|
|
7230
7263
|
return null;
|
|
7231
7264
|
};
|
|
@@ -7235,17 +7268,16 @@
|
|
|
7235
7268
|
var uuid = arguments.length > 2 ? arguments[2] : undefined;
|
|
7236
7269
|
var name = arguments.length > 3 ? arguments[3] : undefined;
|
|
7237
7270
|
var configType = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : "Inline_";
|
|
7238
|
-
var rtmInstance = window.ApxorRTM;
|
|
7239
7271
|
var buttons_array = [];
|
|
7240
7272
|
var buttons_css = [];
|
|
7241
7273
|
buttons_config.forEach(function (button_config, index) {
|
|
7242
|
-
var _button_config$
|
|
7243
|
-
var _action = (_button_config$
|
|
7244
|
-
var vMap = (_button_config$
|
|
7245
|
-
var url = (_button_config$
|
|
7246
|
-
var isExternal = (_button_config$
|
|
7247
|
-
var redirectWithin = (_button_config$
|
|
7248
|
-
var callbackFunction = (_button_config$
|
|
7274
|
+
var _button_config$action2, _button_config$action3, _button_config$action4, _button_config$action5, _button_config$action6, _button_config$action7, _button_config$action8, _button_config$action9, _button_config$action10, _button_config$action11, _button_config$action12, _button_config$action13;
|
|
7275
|
+
var _action = (_button_config$action2 = button_config === null || button_config === void 0 || (_button_config$action3 = button_config.action_config) === null || _button_config$action3 === void 0 ? void 0 : _button_config$action3.action) !== null && _button_config$action2 !== void 0 ? _button_config$action2 : "end";
|
|
7276
|
+
var vMap = (_button_config$action4 = button_config === null || button_config === void 0 || (_button_config$action5 = button_config.action_config) === null || _button_config$action5 === void 0 ? void 0 : _button_config$action5.vmap) !== null && _button_config$action4 !== void 0 ? _button_config$action4 : {};
|
|
7277
|
+
var url = (_button_config$action6 = button_config === null || button_config === void 0 || (_button_config$action7 = button_config.action_config) === null || _button_config$action7 === void 0 ? void 0 : _button_config$action7.url) !== null && _button_config$action6 !== void 0 ? _button_config$action6 : "";
|
|
7278
|
+
var isExternal = (_button_config$action8 = button_config === null || button_config === void 0 || (_button_config$action9 = button_config.action_config) === null || _button_config$action9 === void 0 ? void 0 : _button_config$action9.is_external) !== null && _button_config$action8 !== void 0 ? _button_config$action8 : true;
|
|
7279
|
+
var redirectWithin = (_button_config$action10 = button_config === null || button_config === void 0 || (_button_config$action11 = button_config.action_config) === null || _button_config$action11 === void 0 ? void 0 : _button_config$action11.is_within) !== null && _button_config$action10 !== void 0 ? _button_config$action10 : false;
|
|
7280
|
+
var callbackFunction = (_button_config$action12 = button_config === null || button_config === void 0 || (_button_config$action13 = button_config.action_config) === null || _button_config$action13 === void 0 ? void 0 : _button_config$action13.callback_func) !== null && _button_config$action12 !== void 0 ? _button_config$action12 : "";
|
|
7249
7281
|
var action_config_str = JSON.stringify(button_config === null || button_config === void 0 ? void 0 : button_config.action_config);
|
|
7250
7282
|
_action = _action.toLowerCase();
|
|
7251
7283
|
var borders = button_config.borders,
|
|
@@ -7264,30 +7296,33 @@
|
|
|
7264
7296
|
case "done":
|
|
7265
7297
|
case "dismiss":
|
|
7266
7298
|
action = function action() {
|
|
7299
|
+
window.Apxor.logActionEvent(configType + text + "_Clicked", uuid, name);
|
|
7267
7300
|
ActionHandler.complete();
|
|
7268
7301
|
};
|
|
7269
7302
|
break;
|
|
7270
7303
|
case "next":
|
|
7271
7304
|
action = function action() {
|
|
7272
|
-
ActionHandler.next();
|
|
7273
7305
|
window.Apxor.logActionEvent(configType + text + "_Clicked", uuid, name);
|
|
7306
|
+
ActionHandler.next();
|
|
7274
7307
|
};
|
|
7275
7308
|
break;
|
|
7276
7309
|
case "prev":
|
|
7277
7310
|
action = function action() {
|
|
7278
|
-
ActionHandler.prev();
|
|
7279
7311
|
window.Apxor.logActionEvent(configType + text + "_Clicked", uuid, name);
|
|
7312
|
+
ActionHandler.prev();
|
|
7280
7313
|
};
|
|
7281
7314
|
break;
|
|
7282
7315
|
case "redirect":
|
|
7283
7316
|
action = function action() {
|
|
7284
|
-
ActionHandler.complete();
|
|
7285
7317
|
window.Apxor.redirectTo(uuid, name, text, action_config_str);
|
|
7318
|
+
ActionHandler.complete(_action);
|
|
7286
7319
|
};
|
|
7287
7320
|
break;
|
|
7288
7321
|
case "cancel":
|
|
7289
7322
|
action = function action() {
|
|
7290
|
-
|
|
7323
|
+
window.Apxor.logActionEvent(configType + text + "_Clicked", uuid, name);
|
|
7324
|
+
ActionHandler.cancel(_action);
|
|
7325
|
+
window.Apxor.logActionEvent("walk_through_cancelled", uuid, name);
|
|
7291
7326
|
};
|
|
7292
7327
|
break;
|
|
7293
7328
|
default:
|
|
@@ -7297,7 +7332,7 @@
|
|
|
7297
7332
|
};
|
|
7298
7333
|
}
|
|
7299
7334
|
} catch (e) {
|
|
7300
|
-
|
|
7335
|
+
console.error("Error setting actions on the buttons:" + e);
|
|
7301
7336
|
}
|
|
7302
7337
|
buttons_css.push({
|
|
7303
7338
|
borders: borders,
|
|
@@ -7343,6 +7378,7 @@
|
|
|
7343
7378
|
bg_color = _buttons_css$.bg_color,
|
|
7344
7379
|
text_color = _buttons_css$.text_color,
|
|
7345
7380
|
size = _buttons_css$.size,
|
|
7381
|
+
style = _buttons_css$.style,
|
|
7346
7382
|
font_family = _buttons_css$.font_family,
|
|
7347
7383
|
_buttons_css$$borders = _buttons_css$.borders,
|
|
7348
7384
|
stroke_color = _buttons_css$$borders.stroke_color,
|
|
@@ -7356,7 +7392,7 @@
|
|
|
7356
7392
|
gradient_c1 = gradient.gradient_c1 || COLORS.BLACK;
|
|
7357
7393
|
gradient_c2 = gradient.gradient_c2 || COLORS.WHITE;
|
|
7358
7394
|
}
|
|
7359
|
-
buttons = "\n ".concat(prefix, " footer .shepherd-button.button-o {\n cursor: pointer;\n background-color: ").concat(bg_color === "#" ? "transparent" : bg_color, ";\n color: ").concat(text_color, ";font-size: ").concat(size, "px;font-family: ").concat(font_family, ";\n font-weight: ").concat(font_family !== "bold" ? "normal" : font_family, ";\n font-style: ").concat(
|
|
7395
|
+
buttons = "\n ".concat(prefix, " footer .shepherd-button.button-o {\n cursor: pointer;\n background-color: ").concat(bg_color === "#" ? "transparent" : bg_color, ";\n color: ").concat(text_color, ";font-size: ").concat(size, "px;font-family: ").concat(font_family, ";\n font-weight: ").concat(font_family !== "bold" ? "normal" : font_family, ";\n font-style: ").concat(style === "italic" ? "italic" : "unset", ";\n border: 0px solid ").concat(stroke_color, ";border-radius: ").concat(radius, "px;\n ").concat(enable_gradient ? "background-image:linear-gradient(".concat(gradient_direction, ", ").concat(gradient_c1, ", ").concat(gradient_c2, ");") : "", "\n margin-right:").concat(bg_color === "#" ? 0 : "12px", "\n }\n ");
|
|
7360
7396
|
}
|
|
7361
7397
|
if (buttons_css.length > 1) {
|
|
7362
7398
|
var _buttons_css$2 = buttons_css[1],
|
|
@@ -7419,6 +7455,7 @@
|
|
|
7419
7455
|
|
|
7420
7456
|
/* eslint-disable no-unused-vars */
|
|
7421
7457
|
var ApxorWalkthroughTour;
|
|
7458
|
+
var buttonAction = null;
|
|
7422
7459
|
var onClickCallback = function onClickCallback(configId, configName) {
|
|
7423
7460
|
var isHitTheTarget = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
7424
7461
|
var dismiss_target_touch = arguments.length > 3 ? arguments[3] : undefined;
|
|
@@ -7435,6 +7472,7 @@
|
|
|
7435
7472
|
}
|
|
7436
7473
|
};
|
|
7437
7474
|
function addTourStep(uiConfig, terminationConfig, messageConfig, rtmInstance) {
|
|
7475
|
+
var _text_config$segments;
|
|
7438
7476
|
var index = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
7439
7477
|
var _uiConfig$animation = uiConfig.animation,
|
|
7440
7478
|
animation = _uiConfig$animation === void 0 ? {} : _uiConfig$animation,
|
|
@@ -7444,6 +7482,10 @@
|
|
|
7444
7482
|
border = _uiConfig$border === void 0 ? {} : _uiConfig$border,
|
|
7445
7483
|
_uiConfig$buttons_con = uiConfig.buttons_config,
|
|
7446
7484
|
buttons_config = _uiConfig$buttons_con === void 0 ? [] : _uiConfig$buttons_con,
|
|
7485
|
+
_uiConfig$button_posi = uiConfig.button_position,
|
|
7486
|
+
button_position = _uiConfig$button_posi === void 0 ? "right" : _uiConfig$button_posi,
|
|
7487
|
+
_uiConfig$button_dire = uiConfig.button_direction,
|
|
7488
|
+
button_direction = _uiConfig$button_dire === void 0 ? DIRECTION.HORIZONTAL : _uiConfig$button_dire,
|
|
7447
7489
|
_uiConfig$corners = uiConfig.corners,
|
|
7448
7490
|
corners = _uiConfig$corners === void 0 ? {} : _uiConfig$corners,
|
|
7449
7491
|
_uiConfig$shadow = uiConfig.shadow,
|
|
@@ -7454,6 +7496,8 @@
|
|
|
7454
7496
|
dismiss_outside_touch = _uiConfig$dismiss_out === void 0 ? false : _uiConfig$dismiss_out,
|
|
7455
7497
|
_uiConfig$dismiss_tar = uiConfig.dismiss_target_touch,
|
|
7456
7498
|
dismiss_target_touch = _uiConfig$dismiss_tar === void 0 ? true : _uiConfig$dismiss_tar,
|
|
7499
|
+
_uiConfig$escapeWithR = uiConfig.escapeWithReference,
|
|
7500
|
+
escapeWithReference = _uiConfig$escapeWithR === void 0 ? false : _uiConfig$escapeWithR,
|
|
7457
7501
|
_uiConfig$position = uiConfig.position,
|
|
7458
7502
|
position = _uiConfig$position === void 0 ? "TOP" : _uiConfig$position,
|
|
7459
7503
|
_uiConfig$text_config = uiConfig.text_config,
|
|
@@ -7472,70 +7516,122 @@
|
|
|
7472
7516
|
show_close_icon = _uiConfig$show_close_ === void 0 ? false : _uiConfig$show_close_,
|
|
7473
7517
|
_uiConfig$set_font_to = uiConfig.set_font_to_scale,
|
|
7474
7518
|
set_font_to_scale = _uiConfig$set_font_to === void 0 ? false : _uiConfig$set_font_to;
|
|
7519
|
+
var dismissOnScroll;
|
|
7475
7520
|
var configId = messageConfig.configId,
|
|
7476
7521
|
configName = messageConfig.configName;
|
|
7477
7522
|
var fontMultiplier = set_font_to_scale ? getFontMultiplier() : 1;
|
|
7478
7523
|
fontMultiplier = fontMultiplier > 1 ? fontMultiplier : 1;
|
|
7479
7524
|
var buttons_array = [];
|
|
7480
|
-
var
|
|
7481
|
-
|
|
7482
|
-
|
|
7483
|
-
|
|
7484
|
-
|
|
7525
|
+
var buttons_css = [];
|
|
7526
|
+
var text_alignment = (text_config === null || text_config === void 0 ? void 0 : text_config.alignment) || "left";
|
|
7527
|
+
var title_alignment = (title_config === null || title_config === void 0 ? void 0 : title_config.alignment) || "left";
|
|
7528
|
+
|
|
7529
|
+
// let primary_button_bg_color = "#3288e6",
|
|
7530
|
+
// secondary_button_bg_color = "#f1f2f3",
|
|
7531
|
+
// primary_button_font_color = "rgba(0, 0, 0, .75)",
|
|
7532
|
+
// secondary_button_font_color = "rgba(0, 0, 0, .75)";
|
|
7533
|
+
|
|
7534
|
+
buttons_config.forEach(function (button_config, index) {
|
|
7485
7535
|
var _button_config$action, _button_config$action2, _button_config$action3, _button_config$action4;
|
|
7486
|
-
var button_classes,
|
|
7487
|
-
|
|
7488
|
-
action;
|
|
7536
|
+
var button_classes, button_text, action;
|
|
7537
|
+
// color = ""
|
|
7489
7538
|
button_text = deepGet(button_config, ["text_config", "text"], null);
|
|
7490
|
-
var _action = (_button_config$action = button_config === null || button_config === void 0
|
|
7539
|
+
var _action = (_button_config$action = button_config === null || button_config === void 0 || (_button_config$action2 = button_config.action_config) === null || _button_config$action2 === void 0 ? void 0 : _button_config$action2.action) !== null && _button_config$action !== void 0 ? _button_config$action : "end";
|
|
7491
7540
|
var action_config = (button_config === null || button_config === void 0 ? void 0 : button_config.action_config) || {};
|
|
7492
7541
|
var action_config_str = JSON.stringify(action_config);
|
|
7493
|
-
var url = (_button_config$action3 = button_config === null || button_config === void 0
|
|
7542
|
+
var url = (_button_config$action3 = button_config === null || button_config === void 0 || (_button_config$action4 = button_config.action_config) === null || _button_config$action4 === void 0 ? void 0 : _button_config$action4.url) !== null && _button_config$action3 !== void 0 ? _button_config$action3 : "";
|
|
7494
7543
|
switch (_action) {
|
|
7495
7544
|
case "done":
|
|
7496
7545
|
case "dismiss":
|
|
7497
|
-
action =
|
|
7546
|
+
action = function action() {
|
|
7547
|
+
window.Apxor.logActionEvent("inline_".concat(button_text, "_Clicked"), configId, configName);
|
|
7548
|
+
ApxorWalkthroughTour.complete();
|
|
7549
|
+
};
|
|
7498
7550
|
break;
|
|
7499
7551
|
case "next":
|
|
7500
7552
|
action = function action() {
|
|
7501
|
-
ApxorWalkthroughTour.complete();
|
|
7502
7553
|
window.Apxor.logActionEvent("inline_".concat(button_text, "_Clicked"), configId, configName);
|
|
7554
|
+
ApxorWalkthroughTour.complete();
|
|
7503
7555
|
};
|
|
7504
7556
|
break;
|
|
7505
7557
|
case "prev":
|
|
7506
7558
|
action = function action() {
|
|
7507
|
-
ApxorWalkthroughTour.complete();
|
|
7508
7559
|
window.Apxor.logActionEvent("inline_".concat(button_text, "_Clicked"), configId, configName);
|
|
7560
|
+
ApxorWalkthroughTour.complete();
|
|
7509
7561
|
};
|
|
7510
7562
|
break;
|
|
7511
7563
|
case "redirect":
|
|
7512
7564
|
action = function action() {
|
|
7565
|
+
buttonAction = "redirect";
|
|
7513
7566
|
ApxorWalkthroughTour.complete();
|
|
7514
7567
|
window.Apxor.redirectTo(configId, configName, button_text, action_config_str);
|
|
7515
7568
|
};
|
|
7516
7569
|
break;
|
|
7570
|
+
case "cancel":
|
|
7571
|
+
action = function action() {
|
|
7572
|
+
buttonAction = "cancel";
|
|
7573
|
+
window.Apxor.logActionEvent("inline_".concat(button_text, "_Clicked"), configId, configName);
|
|
7574
|
+
ApxorWalkthroughTour.complete();
|
|
7575
|
+
window.Apxor.logActionEvent("walk_through_cancelled", configId, configName);
|
|
7576
|
+
};
|
|
7577
|
+
break;
|
|
7517
7578
|
default:
|
|
7518
|
-
action =
|
|
7519
|
-
|
|
7520
|
-
|
|
7521
|
-
|
|
7522
|
-
if (["end", "dismiss"].includes(_action)) {
|
|
7523
|
-
primary_button_font_color = deepGet(button_config, ["text_config", "color"], "#ccc");
|
|
7524
|
-
primary_button_bg_color = button_config.color;
|
|
7525
|
-
} else {
|
|
7526
|
-
secondary_button_font_color = deepGet(button_config, ["text_config", "color"], "#ccc");
|
|
7527
|
-
secondary_button_bg_color = button_config.color;
|
|
7579
|
+
action = function action() {
|
|
7580
|
+
window.Apxor.logActionEvent("inline_" + text + "_Clicked", configId, configName);
|
|
7581
|
+
ApxorWalkthroughTour.cancel();
|
|
7582
|
+
};
|
|
7528
7583
|
}
|
|
7584
|
+
button_classes = "shepherd-button ";
|
|
7585
|
+
// button_classes += button_config.id === "okButton" ? "-secondary" : "";
|
|
7586
|
+
|
|
7587
|
+
// if (["end", "dismiss"].includes(_action)) {
|
|
7588
|
+
// primary_button_font_color = deepGet(
|
|
7589
|
+
// button_config,
|
|
7590
|
+
// ["text_config", "color"],
|
|
7591
|
+
// "#ccc"
|
|
7592
|
+
// );
|
|
7593
|
+
// primary_button_bg_color = button_config.color;
|
|
7594
|
+
// } else {
|
|
7595
|
+
// secondary_button_font_color = deepGet(
|
|
7596
|
+
// button_config,
|
|
7597
|
+
// ["text_config", "color"],
|
|
7598
|
+
// "#ccc"
|
|
7599
|
+
// );
|
|
7600
|
+
// secondary_button_bg_color = button_config.color;
|
|
7601
|
+
// }
|
|
7529
7602
|
buttons_array.push({
|
|
7530
|
-
classes: button_classes,
|
|
7603
|
+
classes: button_classes + (index === 0 ? "button-o" : "button-t"),
|
|
7531
7604
|
text: button_text,
|
|
7532
7605
|
action: action
|
|
7533
7606
|
});
|
|
7607
|
+
var borders = button_config.borders,
|
|
7608
|
+
color = button_config.color,
|
|
7609
|
+
_button_config$text_c = button_config.text_config,
|
|
7610
|
+
text = _button_config$text_c.text,
|
|
7611
|
+
text_color = _button_config$text_c.color,
|
|
7612
|
+
size = _button_config$text_c.size,
|
|
7613
|
+
style = _button_config$text_c.style,
|
|
7614
|
+
font_family = _button_config$text_c.font_family,
|
|
7615
|
+
_button_config$gradie = button_config.gradient_config,
|
|
7616
|
+
gradient_config = _button_config$gradie === void 0 ? {} : _button_config$gradie;
|
|
7617
|
+
buttons_css.push({
|
|
7618
|
+
borders: borders,
|
|
7619
|
+
bg_color: color,
|
|
7620
|
+
text_color: text_color,
|
|
7621
|
+
size: size,
|
|
7622
|
+
style: style,
|
|
7623
|
+
font_family: font_family,
|
|
7624
|
+
gradient_config: gradient_config
|
|
7625
|
+
});
|
|
7534
7626
|
});
|
|
7535
|
-
|
|
7627
|
+
|
|
7628
|
+
// let showingCloseIcon = show_close_icon
|
|
7629
|
+
// ? !(buttons_config.length >= 1)
|
|
7630
|
+
// : false;
|
|
7631
|
+
|
|
7536
7632
|
var textContentCSS = {
|
|
7537
7633
|
color: text_config.color,
|
|
7538
|
-
fontSize: text_config.size * fontMultiplier,
|
|
7634
|
+
fontSize: Math.ceil(text_config.size * fontMultiplier),
|
|
7539
7635
|
fontFamily: text_config.font_family,
|
|
7540
7636
|
fontStyle: text_config.style
|
|
7541
7637
|
};
|
|
@@ -7548,16 +7644,16 @@
|
|
|
7548
7644
|
textContentCSS.fontWeight = style;
|
|
7549
7645
|
}
|
|
7550
7646
|
var titleContentCSS = {
|
|
7551
|
-
color: title_config.color,
|
|
7552
|
-
fontSize: title_config.size * fontMultiplier,
|
|
7553
|
-
fontFamily: title_config.font_family,
|
|
7554
|
-
fontStyle: title_config.style
|
|
7647
|
+
color: title_config === null || title_config === void 0 ? void 0 : title_config.color,
|
|
7648
|
+
fontSize: Math.ceil((title_config === null || title_config === void 0 ? void 0 : title_config.size) * fontMultiplier),
|
|
7649
|
+
fontFamily: title_config === null || title_config === void 0 ? void 0 : title_config.font_family,
|
|
7650
|
+
fontStyle: title_config === null || title_config === void 0 ? void 0 : title_config.style
|
|
7555
7651
|
};
|
|
7556
|
-
if (title_config.margin_config && Object.keys(title_config.margin_config).length > 0) {
|
|
7557
|
-
var _margin = title_config.margin_config;
|
|
7652
|
+
if (title_config !== null && title_config !== void 0 && title_config.margin_config && Object.keys(title_config === null || title_config === void 0 ? void 0 : title_config.margin_config).length > 0) {
|
|
7653
|
+
var _margin = title_config === null || title_config === void 0 ? void 0 : title_config.margin_config;
|
|
7558
7654
|
titleContentCSS.margin = "".concat(_margin.top, "px ").concat(_margin.right, "px ").concat(_margin.bottom, "px ").concat(_margin.left, "px");
|
|
7559
7655
|
}
|
|
7560
|
-
style = title_config.style;
|
|
7656
|
+
style = title_config === null || title_config === void 0 ? void 0 : title_config.style;
|
|
7561
7657
|
if (style === "bold") {
|
|
7562
7658
|
textContentCSS.fontWeight = style;
|
|
7563
7659
|
}
|
|
@@ -7567,7 +7663,11 @@
|
|
|
7567
7663
|
"border-color": border["color"],
|
|
7568
7664
|
"border-width": border["width"]
|
|
7569
7665
|
};
|
|
7570
|
-
var button =
|
|
7666
|
+
var button = getElementFromSelector(view_id);
|
|
7667
|
+
if (!button) {
|
|
7668
|
+
var _window;
|
|
7669
|
+
(_window = window) === null || _window === void 0 || (_window = _window.Apxor) === null || _window === void 0 || _window.updateFlag(false);
|
|
7670
|
+
}
|
|
7571
7671
|
function getAnimationValue(percent) {
|
|
7572
7672
|
if (percent === 50) {
|
|
7573
7673
|
return 0;
|
|
@@ -7602,19 +7702,86 @@
|
|
|
7602
7702
|
}
|
|
7603
7703
|
}
|
|
7604
7704
|
function applyCSS() {
|
|
7605
|
-
|
|
7606
|
-
dummySpan.setAttribute("id", "apxor-style-" + configId + "-step-" + index);
|
|
7607
|
-
// Fix for HeadDigital issue
|
|
7608
|
-
// This has to done for cases where the parent element that
|
|
7609
|
-
// we add this span applies the display flex and justify content space between
|
|
7610
|
-
// will moving the target element left or right. So, we have to make our span
|
|
7611
|
-
// display -> none
|
|
7612
|
-
dummySpan.style.display = "none";
|
|
7705
|
+
// let dummySpan = document.createElement("span");
|
|
7706
|
+
// dummySpan.setAttribute("id", "apxor-style-" + configId + "-step-" + index);
|
|
7707
|
+
// // Fix for HeadDigital issue
|
|
7708
|
+
// // This has to done for cases where the parent element that
|
|
7709
|
+
// // we add this span applies the display flex and justify content space between
|
|
7710
|
+
// // will moving the target element left or right. So, we have to make our span
|
|
7711
|
+
// // display -> none
|
|
7712
|
+
// dummySpan.style.display = "none";
|
|
7613
7713
|
var styleElement = document.createElement("style");
|
|
7614
|
-
styleElement.innerHTML = "\n #shepherdModalOverlayContainer {\n -ms-filter: \"progid:dximagetransform.microsoft.gradient.alpha(Opacity=50)\";\n filter: alpha(opacity=50);\n height: 100vh;\n left: 0;\n opacity: ".concat(dim_background_opacity !== null && dim_background_opacity !== void 0 ? dim_background_opacity : 0.5, ";\n position: fixed;\n top: 0;\n transition: all .3s ease-out;\n width: 100vw;\n z-index: 9997;\n fill:").concat(dim_background_color !== null && dim_background_color !== void 0 ? dim_background_color : "transparent", "\n }\n \n #shepherdModalOverlayContainer #shepherdModalMask, #shepherdModalOverlayContainer #shepherdModalMaskRect {\n height: 100vh;\n width: 100vw\n }\n \n .shepherd-modal.shepherd-enabled {\n position: relative;\n z-index: 9998\n }\n \n .shepherd-active.shepherd-modal-is-visible :not(.shepherd-target) {\n pointer-events: none\n }\n \n .shepherd-active.shepherd-modal-is-visible .shepherd-button, .shepherd-active.shepherd-modal-is-visible .shepherd-button *, .shepherd-active.shepherd-modal-is-visible .shepherd-cancel-link, .shepherd-active.shepherd-modal-is-visible .shepherd-cancel-link *, .shepherd-active.shepherd-modal-is-visible .shepherd-element, .shepherd-active.shepherd-modal-is-visible .shepherd-element *, .shepherd-active.shepherd-modal-is-visible .shepherd-target, .shepherd-active.shepherd-modal-is-visible .shepherd-target * {\n pointer-events: auto\n }\n \n .tippy-popper.shepherd {\n z-index: 9999\n }\n \n .tippy-popper.shepherd[x-placement^=top] {\n margin-bottom: 0px\n }\n \n .tippy-popper.shepherd[x-placement^=bottom] {\n margin-top: 8px\n }\n \n .tippy-popper.shepherd[x-placement^=left] {\n margin-right: 0px\n }\n \n .tippy-popper.shepherd[x-placement^=right] {\n margin-left: 0px\n }\n \n .tippy-popper.shepherd .tippy-tooltip .tippy-content {\n max-height: 100%;\n padding-top:0px;\n padding-bottom:0px;\n text-align: left;\n max-width: calc(").concat(fontMultiplier, "*400px);\n }\n \n .shepherd-element, .shepherd-element *, .shepherd-element:after, .shepherd-element :after, .shepherd-element:before, .shepherd-element :before {\n box-sizing: border-box\n }\n \n .shepherd-element {\n outline: none;\n }\n \n .shepherd-element .shepherd-content header {\n *zoom: 1;\n align-items: left;\n border-top-left-radius: 5px;\n border-top-right-radius: 5px;\n display: flex;\n justify-content: left;\n line-height: 2em;\n ").concat(showingCloseIcon ? "padding: .75em;" : "", "\n }\n \n .shepherd-element .shepherd-content header:after {\n clear: both;\n content: \"\";\n display: table\n }\n \n .shepherd-element .shepherd-content header .shepherd-cancel-link, .shepherd-element .shepherd-content header .shepherd-title {\n margin: 0;\n padding: 0;\n position: relative;\n vertical-align: middle\n }\n \n .shepherd-element .shepherd-content header .shepherd-title {\n color: ").concat(titleContentCSS["color"], ";\n display: flex;\n flex: 1 0 auto;\n font-size: ").concat(titleContentCSS["fontSize"], "px;\n font-family: ").concat(titleContentCSS["fontFamily"], "; \n font-weight: ").concat(titleContentCSS["fontStyle"] !== "bold" ? "normal" : titleContentCSS["fontStyle"], ";\n font-style: ").concat(titleContentCSS["fontStyle"] === "italic" ? "italic" : "unset", ";\n line-height: 1em;\n padding: .5em;\n padding-bottom: 0px;\n }\n\n .shepherd-content > .shepherd-header > .shepherd-title {\n color: ").concat(titleContentCSS["color"], ";\n display: flex;\n flex: 1 0 auto;\n font-size: ").concat(titleContentCSS["fontSize"], "px;\n font-family: ").concat(titleContentCSS["fontFamily"], "; \n font-weight: ").concat(titleContentCSS["fontStyle"] !== "bold" ? "normal" : titleContentCSS["fontStyle"], ";\n font-style: ").concat(titleContentCSS["fontStyle"] === "italic" ? "italic" : "unset", ";\n }\n \n .shepherd-element .shepherd-content header .shepherd-cancel-link {\n color: hsla(0, 0%, 70.2%, .75);\n font-size: 2em;\n margin-left: auto;\n text-decoration: none;\n transition: color .5s ease\n }\n \n .shepherd-element .shepherd-content header .shepherd-cancel-link:before {\n mix-blend-mode: screen;\n content: \"\xD7\"\n }\n \n .shepherd-element .shepherd-content header .shepherd-cancel-link:hover {\n mix-blend-mode: difference;\n }\n \n .shepherd-element .shepherd-content .shepherd-text {\n color: ").concat(textContentCSS["color"], ";\n line-height: 1em;\n padding: .5em;\n }\n \n .shepherd-element .shepherd-content .shepherd-text a,\n .shepherd-element .shepherd-content .shepherd-text a:active,\n .shepherd-element .shepherd-content .shepherd-text a:visited {\n border-bottom: 1px dotted rgba(0, 0, 0, .75);\n color: ").concat(textContentCSS["color"], ";\n opacity: 0.75;\n text-decoration: none\n }\n \n .shepherd-element .shepherd-content .shepherd-text a:active:hover, \n .shepherd-element .shepherd-content .shepherd-text a:hover,\n .shepherd-element .shepherd-content .shepherd-text a:visited:hover {\n border-bottom-style: solid\n }\n \n .shepherd-element .shepherd-content .shepherd-text p {\n margin-top: 0\n }\n \n .shepherd-element .shepherd-content .shepherd-text p:last-child {\n margin-bottom: 0\n }\n \n .shepherd-element .shepherd-content footer {\n border-bottom-left-radius: 5px;\n border-bottom-right-radius: 5px;\n display: flex;\n justify-content: flex-end;\n padding: 0 .75em .75em\n }\n \n .shepherd-content .shepherd-text {\n font-size: ").concat(textContentCSS["fontSize"], "px;\n font-family: ").concat(textContentCSS["fontFamily"], "; \n font-weight: ").concat(textContentCSS["fontStyle"] !== "bold" ? "normal" : textContentCSS["fontStyle"], ";\n font-style: ").concat(textContentCSS["fontStyle"] === "italic" ? "italic" : "unset", ";\n }\n\n .shepherd-content > .shepherd-text > p {\n font-size: ").concat(textContentCSS["fontSize"], "px;\n font-family: ").concat(textContentCSS["fontFamily"], "; \n font-weight: ").concat(textContentCSS["fontStyle"] !== "bold" ? "normal" : textContentCSS["fontStyle"], ";\n font-style: ").concat(textContentCSS["fontStyle"] === "italic" ? "italic" : "unset", ";\n color: ").concat(textContentCSS["color"], ";\n }\n \n .shepherd-element .shepherd-content footer .shepherd-button {\n display: inline-block;\n *display: inline;\n vertical-align: middle;\n *vertical-align: auto;\n *zoom: 1;\n background: ").concat(primary_button_bg_color, ";\n border: 0;\n border-radius: 3px;\n color: ").concat(primary_button_font_color, ";\n cursor: pointer;\n display: inline;\n font-family: inherit;\n font-size: .8em;\n letter-spacing: .1em;\n line-height: 1em;\n margin-right: .5em;\n padding: .75em 2em;\n text-transform: uppercase;\n transition: all .5s ease\n }\n \n .shepherd-element .shepherd-content footer .shepherd-button:hover {\n background: ").concat(primary_button_bg_color, "77;\n }\n \n .shepherd-element .shepherd-content footer .shepherd-button.shepherd-button-secondary {\n background: ").concat(secondary_button_bg_color, ";\n color: ").concat(secondary_button_font_color, ";\n }\n \n .shepherd-element .shepherd-content footer .shepherd-button.shepherd-button-secondary:hover {\n background: ").concat(secondary_button_bg_color, "88;\n }\n \n .shepherd-element .shepherd-content footer .shepherd-button:last-child {\n margin-right: 0\n }\n \n @-webkit-keyframes cycle {\n 0% { transform: ").concat(translateDir(position, 0), "; }\n 50% { transform: ").concat(translateDir(position, 50), "; }\n 100% { transform: ").concat(translateDir(position, 100), "; }\n }\n \n @keyframes cycle {\n 0% { transform: ").concat(translateDir(position, 0), "; }\n 50% { transform: ").concat(translateDir(position, 50), "; }\n 100% { transform: ").concat(translateDir(position, 100), "; }\n }\n \n .tippy-tooltip.apxor-").concat(configId, "-step-").concat(index, "-theme {\n animation: ").concat(animation["enabled"] ? animation["type"] + " " + animation["duration"] + "ms" : "none", ";\n animation-timing-function: ease-in-out;\n animation-iteration-count: infinite;\n box-shadow: ").concat(show_shadow ? shadow : "none", ";\n color: ").concat(textContentCSS["color"], ";\n opacity: ").concat(opacity, ";\n border-radius: ").concat(tooltipCSS["border-radius"] + "px", ";\n background-color: ").concat(tooltipCSS["background"], ";\n ").concat(getPropertyFrom(position), ";\n }\n \n .apxor-").concat(configId, "-step-").concat(index, "-theme .tippy-roundarrow {\n fill: ").concat(tooltipCSS["background"], ";\n }\n\n .tippy-tooltip[data-placement^='top'] .tippy-arrow {\n border-top-color: ").concat(tooltipCSS["background"], ";\n }\n .tippy-tooltip[data-placement^='bottom'] .tippy-arrow {\n border-bottom-color: ").concat(tooltipCSS["background"], ";\n }\n .tippy-tooltip[data-placement^='left'] .tippy-arrow {\n border-left-color: ").concat(tooltipCSS["background"], ";\n }\n .tippy-tooltip[data-placement^='right'] .tippy-arrow {\n border-right-color: ").concat(tooltipCSS["background"], ";\n }\n ");
|
|
7615
|
-
|
|
7616
|
-
|
|
7617
|
-
|
|
7714
|
+
styleElement.setAttribute("id", "apxor-style-" + configId + "-step-" + index);
|
|
7715
|
+
styleElement.innerHTML = "\n #shepherdModalOverlayContainer {\n -ms-filter: \"progid:dximagetransform.microsoft.gradient.alpha(Opacity=50)\";\n filter: alpha(opacity=50);height: 100vh;left: 0;opacity: ".concat(dim_background_opacity !== null && dim_background_opacity !== void 0 ? dim_background_opacity : 0.5, ";position: fixed;\n top: 0;transition: all .3s ease-out;width: 100vw;z-index: 9997;fill: ").concat(dim_background_color !== null && dim_background_color !== void 0 ? dim_background_color : "transparent", "\n }\n #shepherdModalOverlayContainer #shepherdModalMask, #shepherdModalOverlayContainer #shepherdModalMaskRect {\n height: 100vh;width: 100vw\n }\n .shepherd-modal.shepherd-enabled {\n position: relative;z-index: 9998\n }\n .shepherd-active.shepherd-modal-is-visible :not(.shepherd-target) {\n pointer-events: none\n }\n .shepherd-active.shepherd-modal-is-visible .shepherd-button, .shepherd-active.shepherd-modal-is-visible .shepherd-button *, .shepherd-active.shepherd-modal-is-visible .shepherd-cancel-link, .shepherd-active.shepherd-modal-is-visible .shepherd-cancel-link *, .shepherd-active.shepherd-modal-is-visible .shepherd-element, .shepherd-active.shepherd-modal-is-visible .shepherd-element *, .shepherd-active.shepherd-modal-is-visible .shepherd-target, .shepherd-active.shepherd-modal-is-visible .shepherd-target * {\n pointer-events: auto\n }\n .tippy-popper.shepherd {\n z-index: 999999\n }\n .tippy-popper.shepherd[x-placement^=top] {\n margin-top: 0px\n }\n .tippy-popper.shepherd[x-placement^=bottom] {\n margin-top: 8px\n }\n .tippy-popper.shepherd[x-placement^=left] {\n margin-right: 0px\n }\n .tippy-popper.shepherd[x-placement^=right] {\n margin-left: 0px\n }\n .tippy-popper.shepherd .tippy-tooltip .tippy-content {\n max-height: 100%;padding-top:0px;padding-bottom:0px;text-align: left;max-width: calc(").concat(Math.ceil(fontMultiplier * 400), "px); overflow-wrap: break-word;\n }\n .shepherd-element, .shepherd-element *, .shepherd-element:after, .shepherd-element :after, .shepherd-element:before, .shepherd-element :before {\n box-sizing: border-box\n }\n .shepherd-element {\n outline: none;\n }\n .shepherd-element .shepherd-content header {\n border-top-left-radius: 5px;border-top-right-radius: 5px;\n line-height: 2em;").concat(show_close_icon ? "padding: .75em;" : "", "\n }\n .shepherd-element .shepherd-content header:after {\n clear: both;content: \"\";display: table\n }\n .shepherd-element .shepherd-content header .shepherd-cancel-link, .shepherd-element .shepherd-content header .shepherd-title {\n margin: 0;padding: 0;position: relative;vertical-align: middle\n }\n\n .shepherd-element .shepherd-content header .shepherd-cancel-link {\n color: hsla(0, 0%, 70.2%, .75);font-size: 2em;margin-left: auto;\n text-decoration: none;transition: color .5s ease\n }\n .shepherd-element .shepherd-content header .shepherd-cancel-link:before {\n mix-blend-mode: screen;content: \"\xD7\"\n }\n .shepherd-element .shepherd-content header .shepherd-cancel-link:hover {\n mix-blend-mode: difference;\n }\n .shepherd-element .shepherd-content .shepherd-text {\n text-align:").concat(text_alignment, ";\n line-height: 1em;\n padding:14px\n }\n .shepherd-element .shepherd-content .shepherd-text a,\n .shepherd-element .shepherd-content .shepherd-text a:active,\n .shepherd-element .shepherd-content .shepherd-text a:visited {\n border-bottom: 1px dotted rgba(0, 0, 0, .75);color: ").concat(textContentCSS["color"], ";\n opacity: 0.75;text-decoration: none\n }\n .shepherd-element .shepherd-content .shepherd-text a:active:hover, \n .shepherd-element .shepherd-content .shepherd-text a:hover,\n .shepherd-element .shepherd-content .shepherd-text a:visited:hover {\n border-bottom-style: solid\n }\n .shepherd-element .shepherd-content .shepherd-text p {\n margin-top: 0\n }\n .shepherd-element .shepherd-content .shepherd-text p:last-child {\n margin-bottom: 0\n }\n .shepherd-content > .shepherd-text p {\n font-size: ").concat(textContentCSS["fontSize"], "px;font-family: ").concat(textContentCSS["fontFamily"], "; \n font-weight: ").concat(textContentCSS["fontStyle"] !== "bold" ? "normal" : textContentCSS["fontStyle"], ";\n font-style: ").concat(textContentCSS["fontStyle"] === "italic" ? "italic" : "unset", ";\n color: ").concat(textContentCSS["color"], ";line-height:\n ").concat(textContentCSS["fontSize"], "px;letter-spacing:0.01em;\n }\n\n @-webkit-keyframes cycle {\n 0% { transform: ").concat(translateDir(position, 0), "; }\n 50% { transform: ").concat(translateDir(position, 50), "; }\n 100% { transform: ").concat(translateDir(position, 100), "; }\n }\n @keyframes cycle {\n 0% { transform: ").concat(translateDir(position, 0), "; }\n 50% { transform: ").concat(translateDir(position, 50), "; }\n 100% { transform: ").concat(translateDir(position, 100), "; }\n }\n .tippy-tooltip.apxor-").concat(configId, "-step-").concat(index, "-theme {\n animation: ").concat(animation["enabled"] ? animation["type"] + " 1000ms" : "none", ";\n animation-timing-function: ease-in-out;animation-iteration-count: infinite;\n box-shadow: ").concat(show_shadow ? shadow : "none", ";color: ").concat(textContentCSS["color"], ";\n opacity: ").concat(opacity, ";border-radius: ").concat(tooltipCSS["border-radius"] + "px", ";\n background-color: ").concat(tooltipCSS["background"], ";").concat(getPropertyFrom(position), ";\n }\n .apxor-").concat(configId, "-step-").concat(index, "-theme .tippy-roundarrow {\n fill: ").concat(tooltipCSS["background"], ";\n }\n .tippy-tooltip[data-placement^='top'] .tippy-arrow {\n border-top-color: ").concat(tooltipCSS["background"], ";\n }\n .tippy-tooltip[data-placement^='bottom'] .tippy-arrow {\n border-bottom-color: ").concat(tooltipCSS["background"], ";\n }\n .tippy-tooltip[data-placement^='left'] .tippy-arrow {\n border-left-color: ").concat(tooltipCSS["background"], ";\n }\n .tippy-tooltip[data-placement^='right'] .tippy-arrow {\n border-right-color: ").concat(tooltipCSS["background"], ";\n }\n .shepherd-element .shepherd-content footer .shepherd-button {\n display: inline-block;\n vertical-align: middle;\n border: 0;border-radius: 3px;cursor: pointer;font-family: inherit;\n font-size: .8em;letter-spacing: .01em;line-height: 18px;margin-right: 12px;\n padding: 8px 16px;text-transform: none;transition: all .5s ease\n }\n .shepherd-element .shepherd-content footer {\n border-bottom-left-radius: 5px;\n border-bottom-right-radius: 5px;\n display: flex;\n flex-direction:").concat(button_direction === DIRECTION.HORIZONTAL ? "row" : "column", ";\n \n align-items:center;\n justify-content: ").concat(button_direction === DIRECTION.HORIZONTAL ? getButtonPosition(button_position) : "space-evenly", ";\n padding: 0 .8em .8em;\n }\n ");
|
|
7716
|
+
if (Object.keys(title_config).length > 0) {
|
|
7717
|
+
//display: flex;
|
|
7718
|
+
//padding: .7em;
|
|
7719
|
+
styleElement.innerHTML += "\n .shepherd-element .shepherd-content header .shepherd-title {\n text-align:".concat(title_alignment, ";\n color: ").concat(titleContentCSS["color"], ";display: block;flex: 1 0 auto;\n font-size: ").concat(titleContentCSS["fontSize"], "px;font-family: ").concat(titleContentCSS["fontFamily"], ";\n font-weight: ").concat(titleContentCSS["fontStyle"] !== "bold" ? "normal" : titleContentCSS["fontStyle"], ";font-style: ").concat(titleContentCSS["fontStyle"] === "italic" ? "italic" : "unset", ";\n line-height: ").concat(titleContentCSS["fontSize"], "px;letter-spacing:0.01em;padding: 14px;padding-bottom: 0px;max-width: calc(").concat(Math.ceil(fontMultiplier * 400), "px);\n }\n .shepherd-element .shepherd-content .shepherd-text {\n padding-top:4px;\n }\n ");
|
|
7720
|
+
}
|
|
7721
|
+
if (buttons_css.length > 0) {
|
|
7722
|
+
var _buttons_css$ = buttons_css[0],
|
|
7723
|
+
_bg_color = _buttons_css$.bg_color,
|
|
7724
|
+
text_color = _buttons_css$.text_color,
|
|
7725
|
+
size = _buttons_css$.size,
|
|
7726
|
+
_style = _buttons_css$.style,
|
|
7727
|
+
font_family = _buttons_css$.font_family,
|
|
7728
|
+
_buttons_css$$borders = _buttons_css$.borders,
|
|
7729
|
+
stroke_color = _buttons_css$$borders.stroke_color,
|
|
7730
|
+
radius = _buttons_css$$borders.radius,
|
|
7731
|
+
_buttons_css$$gradien = _buttons_css$.gradient_config,
|
|
7732
|
+
gradient_config = _buttons_css$$gradien === void 0 ? {} : _buttons_css$$gradien;
|
|
7733
|
+
var gradient_direction, gradient_c1, gradient_c2;
|
|
7734
|
+
var enable_gradient = gradient_config.enable_gradient || false;
|
|
7735
|
+
if (enable_gradient) {
|
|
7736
|
+
gradient_direction = gradient_config.gradient_direction || "to right";
|
|
7737
|
+
gradient_c1 = (gradient_config === null || gradient_config === void 0 ? void 0 : gradient_config.colors[0]) || COLORS.BLACK;
|
|
7738
|
+
gradient_c2 = (gradient_config === null || gradient_config === void 0 ? void 0 : gradient_config.colors[1]) || COLORS.WHITE;
|
|
7739
|
+
}
|
|
7740
|
+
styleElement.innerHTML += "\n .shepherd-element .shepherd-content footer .shepherd-button.button-o {\n cursor: pointer;\n background-color: ".concat(_bg_color === "#" ? "transparent" : _bg_color, ";\n color: ").concat(text_color, ";font-size: ").concat(size, "px;font-family: ").concat(font_family, ";\n font-weight: ").concat(_style !== "bold" ? "normal" : _style, ";\n font-style: ").concat(_style === "italic" ? "italic" : "unset", ";\n border: 0px solid ").concat(stroke_color, ";border-radius: ").concat(radius, "px;\n ").concat(enable_gradient ? "background-image:linear-gradient(".concat(gradient_direction, ", ").concat(gradient_c1, ", ").concat(gradient_c2, ");") : "", "\n margin-right:").concat(_bg_color === "#" ? 0 : "12px", ";\n }\n ");
|
|
7741
|
+
}
|
|
7742
|
+
if (buttons_css.length > 1) {
|
|
7743
|
+
var _buttons_css$2 = buttons_css[1],
|
|
7744
|
+
_bg_color2 = _buttons_css$2.bg_color,
|
|
7745
|
+
_text_color = _buttons_css$2.text_color,
|
|
7746
|
+
_size = _buttons_css$2.size,
|
|
7747
|
+
_style2 = _buttons_css$2.style,
|
|
7748
|
+
_font_family = _buttons_css$2.font_family,
|
|
7749
|
+
_buttons_css$2$border = _buttons_css$2.borders,
|
|
7750
|
+
_stroke_color = _buttons_css$2$border.stroke_color,
|
|
7751
|
+
_radius = _buttons_css$2$border.radius,
|
|
7752
|
+
_buttons_css$2$gradie = _buttons_css$2.gradient_config,
|
|
7753
|
+
_gradient_config = _buttons_css$2$gradie === void 0 ? {} : _buttons_css$2$gradie;
|
|
7754
|
+
var _gradient_direction, _gradient_c, _gradient_c2;
|
|
7755
|
+
var _enable_gradient = _gradient_config.enable_gradient || false;
|
|
7756
|
+
if (_enable_gradient) {
|
|
7757
|
+
_gradient_direction = _gradient_config.gradient_direction || "to right";
|
|
7758
|
+
_gradient_c = (_gradient_config === null || _gradient_config === void 0 ? void 0 : _gradient_config.colors[0]) || COLORS.BLACK;
|
|
7759
|
+
_gradient_c2 = (_gradient_config === null || _gradient_config === void 0 ? void 0 : _gradient_config.colors[1]) || COLORS.WHITE;
|
|
7760
|
+
}
|
|
7761
|
+
styleElement.innerHTML += "\n .shepherd-element .shepherd-content footer .shepherd-button.button-t {\n cursor: pointer;\n background-color: ".concat(_bg_color2 === "#" ? "transparent" : _bg_color2, ";\n color: ").concat(_text_color, ";font-size: ").concat(_size, "px;font-family: ").concat(_font_family, ";\n font-weight: ").concat(_style2 !== "bold" ? "normal" : _style2, ";\n font-style: ").concat(_style2 === "italic" ? "italic" : "unset", ";\n ").concat(_enable_gradient ? "background-image:linear-gradient(".concat(_gradient_direction, ", ").concat(_gradient_c, ", ").concat(_gradient_c2, ");") : "", "\n border: 0px solid ").concat(_stroke_color, ";border-radius: ").concat(_radius, "px;\n }\n ");
|
|
7762
|
+
}
|
|
7763
|
+
|
|
7764
|
+
// dummySpan.appendChild(styleElement);
|
|
7765
|
+
// button.parentNode.insertBefore(dummySpan, button);
|
|
7766
|
+
document.head.appendChild(styleElement);
|
|
7767
|
+
|
|
7768
|
+
// .shepherd-element .shepherd-content footer .shepherd-button:hover {
|
|
7769
|
+
// background: ${primary_button_bg_color}77;
|
|
7770
|
+
// }
|
|
7771
|
+
|
|
7772
|
+
// .shepherd-element .shepherd-content footer .shepherd-button.shepherd-button-secondary {
|
|
7773
|
+
// background: ${secondary_button_bg_color};
|
|
7774
|
+
// color: ${secondary_button_font_color};
|
|
7775
|
+
// }
|
|
7776
|
+
|
|
7777
|
+
// .shepherd-element .shepherd-content footer .shepherd-button.shepherd-button-secondary:hover {
|
|
7778
|
+
// background: ${secondary_button_bg_color}88;
|
|
7779
|
+
// }
|
|
7780
|
+
|
|
7781
|
+
// .shepherd-element .shepherd-content footer .shepherd-button:last-child {
|
|
7782
|
+
// margin-right: 0
|
|
7783
|
+
// }
|
|
7784
|
+
return styleElement;
|
|
7618
7785
|
}
|
|
7619
7786
|
var styleSpan = applyCSS();
|
|
7620
7787
|
var targetElement = getElementFromSelector(view_id); //document.getElementById(view_id);
|
|
@@ -7623,22 +7790,32 @@
|
|
|
7623
7790
|
onClickCallback(configId, configName, false, dismiss_target_touch);
|
|
7624
7791
|
};
|
|
7625
7792
|
var onHidden = function onHidden() {
|
|
7626
|
-
var _document$getElementB,
|
|
7793
|
+
var _document$getElementB, _document$getElementB2, _styleDiv$parentNode, _window2;
|
|
7627
7794
|
try {
|
|
7628
7795
|
var _ApxorWalkthroughTour;
|
|
7629
|
-
(_ApxorWalkthroughTour = ApxorWalkthroughTour) === null || _ApxorWalkthroughTour === void 0
|
|
7796
|
+
(_ApxorWalkthroughTour = ApxorWalkthroughTour) === null || _ApxorWalkthroughTour === void 0 || _ApxorWalkthroughTour.complete();
|
|
7630
7797
|
} catch (e) {
|
|
7631
7798
|
console.error(e);
|
|
7632
7799
|
}
|
|
7800
|
+
if (dismiss_outside_touch === true) {
|
|
7801
|
+
document.body.removeEventListener("touchmove", dismissOnScroll);
|
|
7802
|
+
}
|
|
7633
7803
|
// Detach the observer
|
|
7634
7804
|
targetDeletionObserver.disconnect();
|
|
7635
7805
|
viewPortObservor.disconnect();
|
|
7636
|
-
(_document$getElementB = document.getElementById("shepherdModalOverlayContainer")) === null || _document$getElementB === void 0
|
|
7637
|
-
|
|
7638
|
-
|
|
7639
|
-
|
|
7640
|
-
|
|
7806
|
+
(_document$getElementB = document.getElementById("shepherdModalOverlayContainer")) === null || _document$getElementB === void 0 || _document$getElementB.remove();
|
|
7807
|
+
(_document$getElementB2 = document.getElementById("apxor-style-" + configId + "-step-" + index)) === null || _document$getElementB2 === void 0 || _document$getElementB2.remove();
|
|
7808
|
+
var tippy_styles = document.querySelector("style[data-tippy-stylesheet]");
|
|
7809
|
+
if (tippy_styles) {
|
|
7810
|
+
tippy_styles.remove();
|
|
7811
|
+
}
|
|
7812
|
+
styleDiv === null || styleDiv === void 0 || (_styleDiv$parentNode = styleDiv.parentNode) === null || _styleDiv$parentNode === void 0 || _styleDiv$parentNode.removeChild(styleDiv);
|
|
7813
|
+
(_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.Apxor) === null || _window2 === void 0 || _window2.updateFlag(false);
|
|
7814
|
+
if (!(buttonAction !== null && (buttonAction === "redirect" || buttonAction === "cancel"))) {
|
|
7815
|
+
window.Apxor.logActionEvent("inline_dismissed", configId, configName);
|
|
7816
|
+
}
|
|
7641
7817
|
rtmInstance.isShowingAction = false;
|
|
7818
|
+
rtmInstance.currentAction = null;
|
|
7642
7819
|
targetElement.removeEventListener("click", clickListener);
|
|
7643
7820
|
};
|
|
7644
7821
|
var scrolledToView = false;
|
|
@@ -7670,15 +7847,34 @@
|
|
|
7670
7847
|
scrolledToView = true;
|
|
7671
7848
|
}
|
|
7672
7849
|
});
|
|
7850
|
+
if (dismiss_outside_touch === true) {
|
|
7851
|
+
dismissOnScroll = function dismissOnScroll() {
|
|
7852
|
+
var _document$getElementB3;
|
|
7853
|
+
(_document$getElementB3 = document.getElementById("shepherdModalOverlayContainer")) === null || _document$getElementB3 === void 0 || _document$getElementB3.remove();
|
|
7854
|
+
var nodes = document.getElementsByClassName("apxor-".concat(configId, "-step-").concat(index, "-theme"));
|
|
7855
|
+
if (nodes.length > 0 && nodes[0] && nodes[0].parentNode) {
|
|
7856
|
+
nodes[0].parentNode.remove();
|
|
7857
|
+
}
|
|
7858
|
+
onHidden();
|
|
7859
|
+
};
|
|
7860
|
+
document.body.addEventListener("touchmove", dismissOnScroll);
|
|
7861
|
+
}
|
|
7862
|
+
var textContent;
|
|
7863
|
+
if ((text_config === null || text_config === void 0 || (_text_config$segments = text_config.segments) === null || _text_config$segments === void 0 ? void 0 : _text_config$segments.length) > 0) {
|
|
7864
|
+
textContent = getStylisedText(text_config === null || text_config === void 0 ? void 0 : text_config.text, text_config === null || text_config === void 0 ? void 0 : text_config.segments, text_config === null || text_config === void 0 ? void 0 : text_config.quote, text_config === null || text_config === void 0 ? void 0 : text_config.link_config);
|
|
7865
|
+
} else {
|
|
7866
|
+
textContent = [text_config && text_config.text ? text_config.text : "Tap here"];
|
|
7867
|
+
}
|
|
7868
|
+
var titleContent = getStylisedText(title_config === null || title_config === void 0 ? void 0 : title_config.text, title_config === null || title_config === void 0 ? void 0 : title_config.segments, title_config === null || title_config === void 0 ? void 0 : title_config.quote, title_config === null || title_config === void 0 ? void 0 : title_config.link_config);
|
|
7673
7869
|
ApxorWalkthroughTour.addStep("apxor-step-" + index, {
|
|
7674
|
-
title:
|
|
7675
|
-
text:
|
|
7870
|
+
title: titleContent === "" ? null : titleContent.outerHTML,
|
|
7871
|
+
text: textContent,
|
|
7676
7872
|
classes: "apxor-".concat(configId, "-step-").concat(index, "-theme"),
|
|
7677
7873
|
attachTo: {
|
|
7678
|
-
element:
|
|
7874
|
+
element: button,
|
|
7679
7875
|
on: position.toLowerCase()
|
|
7680
7876
|
},
|
|
7681
|
-
showCancelLink:
|
|
7877
|
+
showCancelLink: show_close_icon,
|
|
7682
7878
|
buttons: buttons_array,
|
|
7683
7879
|
tippyOptions: {
|
|
7684
7880
|
allowHTML: true,
|
|
@@ -7687,10 +7883,11 @@
|
|
|
7687
7883
|
interactive: true,
|
|
7688
7884
|
maxWidth: "100%",
|
|
7689
7885
|
hideOnClick: dismiss_outside_touch,
|
|
7886
|
+
escapeWithReference: escapeWithReference,
|
|
7690
7887
|
theme: "apxor-".concat(configId, "-step-").concat(index),
|
|
7691
7888
|
onShow: function onShow() {
|
|
7692
|
-
var
|
|
7693
|
-
(
|
|
7889
|
+
var _window3;
|
|
7890
|
+
(_window3 = window) === null || _window3 === void 0 || (_window3 = _window3.Apxor) === null || _window3 === void 0 || _window3.updateFlag(true);
|
|
7694
7891
|
window.Apxor.logActionEvent("inline_shown", configId, configName);
|
|
7695
7892
|
window.Apxor.updateCount(configId);
|
|
7696
7893
|
rtmInstance.isShowingAction = true;
|
|
@@ -7732,7 +7929,7 @@
|
|
|
7732
7929
|
useModalOverlay: isWalkthrough || dim_background
|
|
7733
7930
|
});
|
|
7734
7931
|
var getViewElement = function getViewElement() {
|
|
7735
|
-
var element =
|
|
7932
|
+
var element = getElementFromSelector(view_id);
|
|
7736
7933
|
return element;
|
|
7737
7934
|
};
|
|
7738
7935
|
var checkViewPortAndAddStep = function checkViewPortAndAddStep(element) {
|
|
@@ -7742,10 +7939,6 @@
|
|
|
7742
7939
|
console.warn("Width and height are 0 for: ", view_id, ". Can't show");
|
|
7743
7940
|
return;
|
|
7744
7941
|
}
|
|
7745
|
-
if (rect.top >= window.innerHeight) {
|
|
7746
|
-
console.warn("Element ", view_id, " not in viewport. Can't show");
|
|
7747
|
-
return;
|
|
7748
|
-
}
|
|
7749
7942
|
} catch (e) {
|
|
7750
7943
|
console.error(e);
|
|
7751
7944
|
}
|
|
@@ -7775,7 +7968,7 @@
|
|
|
7775
7968
|
var recheckStartedAt = new Date();
|
|
7776
7969
|
//For every find_interval
|
|
7777
7970
|
var elementRecheckIntervalId = setInterval(function () {
|
|
7778
|
-
var element = getViewElement(
|
|
7971
|
+
var element = getViewElement();
|
|
7779
7972
|
//If the element is found, stop checking and create a step
|
|
7780
7973
|
if (element) {
|
|
7781
7974
|
clearInterval(elementRecheckIntervalId);
|
|
@@ -7791,7 +7984,7 @@
|
|
|
7791
7984
|
}, find_interval);
|
|
7792
7985
|
};
|
|
7793
7986
|
setTimeout(function () {
|
|
7794
|
-
var element = getViewElement(
|
|
7987
|
+
var element = getViewElement();
|
|
7795
7988
|
if (!element) {
|
|
7796
7989
|
console.warn("Element with id:".concat(view_id, " not found."));
|
|
7797
7990
|
if (find_interval) {
|
|
@@ -7873,8 +8066,8 @@
|
|
|
7873
8066
|
buttons.style.zIndex = 99999;
|
|
7874
8067
|
buttons.style.margin = "8px";
|
|
7875
8068
|
buttons.style.padding = "0";
|
|
7876
|
-
var hideCallback = function hideCallback() {
|
|
7877
|
-
if (on_dismiss) on_dismiss();
|
|
8069
|
+
var hideCallback = function hideCallback(action) {
|
|
8070
|
+
if (on_dismiss) on_dismiss(action);
|
|
7878
8071
|
};
|
|
7879
8072
|
var _generateButtons = generateButtons(buttons_config, {
|
|
7880
8073
|
prev: hideCallback,
|
|
@@ -8062,25 +8255,26 @@
|
|
|
8062
8255
|
console.warn("Can't show on an invisible element: ", view_id);
|
|
8063
8256
|
return;
|
|
8064
8257
|
}
|
|
8065
|
-
var will_dismiss = function will_dismiss() {
|
|
8258
|
+
var will_dismiss = function will_dismiss(action) {
|
|
8066
8259
|
// Detach the observer
|
|
8067
8260
|
targetDeletionObserver.disconnect();
|
|
8068
8261
|
viewPortObservor.disconnect();
|
|
8069
8262
|
svgElement.parentNode.removeChild(svgElement);
|
|
8070
8263
|
textElement.parentNode.removeChild(textElement);
|
|
8071
8264
|
transparentCircle.parentNode.removeChild(transparentCircle);
|
|
8072
|
-
if (on_dismissed) on_dismissed();
|
|
8265
|
+
if (on_dismissed) on_dismissed(action);
|
|
8073
8266
|
if (autoDismissCallback) clearTimeout(autoDismissCallback);
|
|
8074
8267
|
};
|
|
8075
8268
|
var textElement = createTitleDescriptionButtons(text_config, title_config, buttons_config, button_position, button_direction, configId, configName, will_dismiss);
|
|
8076
8269
|
var textElemOffsetWidth = textElement.offsetWidth;
|
|
8077
8270
|
var textElemOffsetHeight = textElement.offsetHeight;
|
|
8078
|
-
|
|
8079
|
-
|
|
8080
|
-
if (text_config && text_config.margin_config) {
|
|
8081
|
-
|
|
8082
|
-
|
|
8083
|
-
}
|
|
8271
|
+
// let marginLeft = 0;
|
|
8272
|
+
// let marginRight = 0;
|
|
8273
|
+
// if (text_config && text_config.margin_config) {
|
|
8274
|
+
// marginLeft = Number(text_config.margin_config.left) || 0;
|
|
8275
|
+
// marginRight = Number(text_config.margin_config.right) || 0;
|
|
8276
|
+
// }
|
|
8277
|
+
|
|
8084
8278
|
var transparentCircle = createInnerCircle(targetElementWidth, targetElementHeight, targetElementLeft, targetElementTop, type, has_ripple);
|
|
8085
8279
|
var innerCenterX = targetElementLeft + targetElementWidth / 2;
|
|
8086
8280
|
var innerCenterY = targetElementTop + targetElementHeight / 2;
|
|
@@ -8117,9 +8311,6 @@
|
|
|
8117
8311
|
}
|
|
8118
8312
|
outerCircleCenterY = innerCircleTop + (textElementOffsetTop + textElemOffsetHeight - innerCircleTop) / 2;
|
|
8119
8313
|
break;
|
|
8120
|
-
default:
|
|
8121
|
-
// We won't support LEFT and RIGHT positions
|
|
8122
|
-
break;
|
|
8123
8314
|
}
|
|
8124
8315
|
if (textElementOffsetLeft === -1 || textElementOffsetTop === -1 || outerCircleCenterY === -1) {
|
|
8125
8316
|
console.warn("Failed to identify the right place for text");
|
|
@@ -8128,7 +8319,9 @@
|
|
|
8128
8319
|
|
|
8129
8320
|
// Position Text element
|
|
8130
8321
|
if (!isFirstHalf && textElementOffsetLeft + textElemOffsetWidth > window.innerWidth) {
|
|
8131
|
-
textElementOffsetLeft =
|
|
8322
|
+
// textElementOffsetLeft =
|
|
8323
|
+
// window.innerWidth - textElemOffsetWidth - marginLeft - marginRight - 10;
|
|
8324
|
+
textElementOffsetLeft = window.innerWidth - textElemOffsetWidth - 10;
|
|
8132
8325
|
}
|
|
8133
8326
|
textElement.style.left = "".concat(textElementOffsetLeft, "px");
|
|
8134
8327
|
textElement.style.top = "".concat(textElementOffsetTop, "px");
|
|
@@ -8720,9 +8913,10 @@
|
|
|
8720
8913
|
var Font = /*#__PURE__*/_createClass(function Font() {
|
|
8721
8914
|
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
8722
8915
|
_classCallCheck(this, Font);
|
|
8723
|
-
this.family = getStringOrDefault(data.family, "sans-serif")
|
|
8916
|
+
this.family = getStringOrDefault(data.family, "sans-serif");
|
|
8724
8917
|
this.size = getNumberOrDefault(data.size, "14");
|
|
8725
8918
|
this.style = getStringOrDefault(data.style, "bold").toLowerCase();
|
|
8919
|
+
this.source = data === null || data === void 0 ? void 0 : data.source;
|
|
8726
8920
|
this.weight = data.weight;
|
|
8727
8921
|
});
|
|
8728
8922
|
|
|
@@ -9179,31 +9373,6 @@
|
|
|
9179
9373
|
return Gradient;
|
|
9180
9374
|
}();
|
|
9181
9375
|
|
|
9182
|
-
/**
|
|
9183
|
-
* @constructor Action
|
|
9184
|
-
* @example
|
|
9185
|
-
* Example of a Action model is
|
|
9186
|
-
*
|
|
9187
|
-
* action: {
|
|
9188
|
-
* type: "dismiss",
|
|
9189
|
-
* url : "",
|
|
9190
|
-
* is_external : false,
|
|
9191
|
-
* is_ir:false,
|
|
9192
|
-
* is_within:true,
|
|
9193
|
-
* callback:(()=>{})
|
|
9194
|
-
* }
|
|
9195
|
-
*/
|
|
9196
|
-
var Action = /*#__PURE__*/_createClass(function Action() {
|
|
9197
|
-
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
9198
|
-
_classCallCheck(this, Action);
|
|
9199
|
-
this.type = getStringOrDefault(data.type, "dismiss").toLowerCase();
|
|
9200
|
-
this.url = getStringOrDefault(data.url, "");
|
|
9201
|
-
this.is_external = Boolean(data.is_external);
|
|
9202
|
-
this.is_ir = Boolean(data.is_ir);
|
|
9203
|
-
this.callback = data.callback || function () {};
|
|
9204
|
-
this.is_within = Boolean(data.is_within);
|
|
9205
|
-
});
|
|
9206
|
-
|
|
9207
9376
|
/**
|
|
9208
9377
|
* @constructor Button
|
|
9209
9378
|
* @example
|
|
@@ -9322,7 +9491,7 @@
|
|
|
9322
9491
|
this.sub_type = getStringOrDefault(data.sub_type, "");
|
|
9323
9492
|
this.color = getColorOrDefault(data.color, "#FFF");
|
|
9324
9493
|
this.enable_action = data.enable_action;
|
|
9325
|
-
this.action =
|
|
9494
|
+
this.action = data.action;
|
|
9326
9495
|
this.enable_margin = data.enable_margin;
|
|
9327
9496
|
this.margin = new Margin(data.margin);
|
|
9328
9497
|
this.enable_padding = data.enable_padding;
|
|
@@ -9645,6 +9814,30 @@
|
|
|
9645
9814
|
return Stepper;
|
|
9646
9815
|
}();
|
|
9647
9816
|
|
|
9817
|
+
/**
|
|
9818
|
+
* @constructor CustomFont
|
|
9819
|
+
*/
|
|
9820
|
+
var CustomFont = /*#__PURE__*/_createClass(function CustomFont() {
|
|
9821
|
+
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
9822
|
+
_classCallCheck(this, CustomFont);
|
|
9823
|
+
this.name = data.name;
|
|
9824
|
+
this.url = data.url;
|
|
9825
|
+
});
|
|
9826
|
+
|
|
9827
|
+
/**
|
|
9828
|
+
* @constructor Theme
|
|
9829
|
+
*/
|
|
9830
|
+
var Theme = /*#__PURE__*/_createClass(function Theme() {
|
|
9831
|
+
var _this = this;
|
|
9832
|
+
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
9833
|
+
_classCallCheck(this, Theme);
|
|
9834
|
+
this.custom_fonts = [];
|
|
9835
|
+
var customFonts = getArrayOrDefault(data.custom_fonts, []);
|
|
9836
|
+
customFonts.forEach(function (customFont) {
|
|
9837
|
+
_this.custom_fonts.push(new CustomFont(customFont));
|
|
9838
|
+
});
|
|
9839
|
+
});
|
|
9840
|
+
|
|
9648
9841
|
var ModalInApp = /*#__PURE__*/function () {
|
|
9649
9842
|
/**
|
|
9650
9843
|
* @class ModalInApp
|
|
@@ -9666,7 +9859,7 @@
|
|
|
9666
9859
|
* @description Creates the styles for Marketing message.
|
|
9667
9860
|
* @returns {string} css styles
|
|
9668
9861
|
*/
|
|
9669
|
-
_defineProperty(this, "
|
|
9862
|
+
_defineProperty(this, "BawS", function () {
|
|
9670
9863
|
if (!_this.enable_marketing) {
|
|
9671
9864
|
return "";
|
|
9672
9865
|
}
|
|
@@ -9680,20 +9873,47 @@
|
|
|
9680
9873
|
var marketingStyles = "\n .apx-inapp-marketing".concat(_this.cssPostFix, " {\n align-self:").concat(alignment, ";\n text-align:").concat(message.alignment, ";\n }\n ");
|
|
9681
9874
|
return marketingStyles;
|
|
9682
9875
|
});
|
|
9876
|
+
// _setFontFaceAtRule(font) {
|
|
9877
|
+
// if (!font.source || font.source === "url") {
|
|
9878
|
+
// return font.family;
|
|
9879
|
+
// }
|
|
9880
|
+
// if (this.customFontList.includes(font.family.split("/").pop().replace(/[^A-Za-z]/g, ""))) {
|
|
9881
|
+
// return font.family.split("/").pop().replace(/[^A-Za-z]/g, "");
|
|
9882
|
+
// }
|
|
9883
|
+
// let src;
|
|
9884
|
+
// let font_family = font.family;
|
|
9885
|
+
// if (font.source === "res") {
|
|
9886
|
+
// src = `file:///android_res/${font_family}`;
|
|
9887
|
+
// } else if (font.source === "asset") {
|
|
9888
|
+
// src = `file:///android_asset/${font_family}`;
|
|
9889
|
+
// } else if (font.source === "path") {
|
|
9890
|
+
// src = font.family;
|
|
9891
|
+
// }
|
|
9892
|
+
// font_family = font.family.split("/").pop().replace(/[^A-Za-z]/g, "");
|
|
9893
|
+
// this.customFontList.push(font_family);
|
|
9894
|
+
// const fallbackFont = "sans-serif";
|
|
9895
|
+
// const font_face = `
|
|
9896
|
+
// @font-face {
|
|
9897
|
+
// font-family: ${font_family};
|
|
9898
|
+
// src: url(${src});
|
|
9899
|
+
// }`
|
|
9900
|
+
// document.getElementById("apxor-style-" + this.configId).innerHTML += font_face;
|
|
9901
|
+
// return `${font_family}, ${fallbackFont}`;
|
|
9902
|
+
// }
|
|
9683
9903
|
/**
|
|
9684
9904
|
* @funciton generateResponse
|
|
9685
9905
|
* @private
|
|
9686
9906
|
* @description Get the response for Form content in the InApp modal.
|
|
9687
9907
|
*/
|
|
9688
|
-
_defineProperty(this, "
|
|
9908
|
+
_defineProperty(this, "ZKNy", function (form_elements) {
|
|
9689
9909
|
var obj = {};
|
|
9690
9910
|
var callback = "";
|
|
9691
9911
|
form_elements.forEach(function (element) {
|
|
9692
9912
|
var _element$name$, _element$name, _element$name$2, _element$name2, _element$name3, _element$name4, _element$name5, _element$name6, _element$name7, _element$callback;
|
|
9693
9913
|
switch (element.type) {
|
|
9694
9914
|
case "fullname":
|
|
9695
|
-
document.getElementById("fname") ? obj["".concat((_element$name$ = element === null || element === void 0
|
|
9696
|
-
document.getElementById("lname") ? obj["".concat((_element$name$2 = element === null || element === void 0
|
|
9915
|
+
document.getElementById("fname") ? obj["".concat((_element$name$ = element === null || element === void 0 || (_element$name = element.name) === null || _element$name === void 0 ? void 0 : _element$name[0]) !== null && _element$name$ !== void 0 ? _element$name$ : "firstname")] = document.getElementById("fname").value : "";
|
|
9916
|
+
document.getElementById("lname") ? obj["".concat((_element$name$2 = element === null || element === void 0 || (_element$name2 = element.name) === null || _element$name2 === void 0 ? void 0 : _element$name2[1]) !== null && _element$name$2 !== void 0 ? _element$name$2 : "lastname")] = document.getElementById("lname").value : "";
|
|
9697
9917
|
break;
|
|
9698
9918
|
case "name":
|
|
9699
9919
|
document.getElementById("name") ? obj["".concat((_element$name3 = element === null || element === void 0 ? void 0 : element.name) !== null && _element$name3 !== void 0 ? _element$name3 : "name")] = document.getElementById("name").value : "";
|
|
@@ -9713,8 +9933,6 @@
|
|
|
9713
9933
|
case "button":
|
|
9714
9934
|
callback = (_element$callback = element === null || element === void 0 ? void 0 : element.callback) !== null && _element$callback !== void 0 ? _element$callback : "";
|
|
9715
9935
|
break;
|
|
9716
|
-
default:
|
|
9717
|
-
break;
|
|
9718
9936
|
}
|
|
9719
9937
|
});
|
|
9720
9938
|
return {
|
|
@@ -9727,7 +9945,7 @@
|
|
|
9727
9945
|
* @private
|
|
9728
9946
|
* @description Sets the marketing content at the end of the InApp
|
|
9729
9947
|
*/
|
|
9730
|
-
_defineProperty(this, "
|
|
9948
|
+
_defineProperty(this, "FcXQ", function () {
|
|
9731
9949
|
if (_this.enable_marketing) {
|
|
9732
9950
|
var marketingContainer = document.createElement("div");
|
|
9733
9951
|
marketingContainer.classList.add("apx-inapp-marketing".concat(_this.cssPostFix));
|
|
@@ -9739,6 +9957,7 @@
|
|
|
9739
9957
|
this.index = index;
|
|
9740
9958
|
this.uis = uis;
|
|
9741
9959
|
this.terminationConfig = terminationConfig;
|
|
9960
|
+
this.terminationTimeoutId = null;
|
|
9742
9961
|
this.isWalkthrough = isWalkthrough;
|
|
9743
9962
|
this.cssPostFix = "-".concat(configId, "-").concat(name).replaceAll(" ", "").replace(/[^\w\s]/gi, "");
|
|
9744
9963
|
this.delay = config.delay || 0;
|
|
@@ -9748,6 +9967,7 @@
|
|
|
9748
9967
|
|
|
9749
9968
|
this.direction = new Direction(config.direction);
|
|
9750
9969
|
this.position = new Position(config.position);
|
|
9970
|
+
this.theme = new Theme(config.theme);
|
|
9751
9971
|
this.enable_dismiss_actions = config.enable_dismiss_actions;
|
|
9752
9972
|
if (this.enable_dismiss_actions) this.dismiss_actions = new DismissActions(config.dismiss_actions);
|
|
9753
9973
|
this.enable_dimbackground = config.enable_dimbackground;
|
|
@@ -9785,6 +10005,7 @@
|
|
|
9785
10005
|
this.enable_marketing = config.enable_marketing;
|
|
9786
10006
|
if (this.enable_marketing) this.marketing = new Marketing(config.marketing);
|
|
9787
10007
|
this.min_width = "";
|
|
10008
|
+
this.max_width = "";
|
|
9788
10009
|
this.inapp_width = "auto";
|
|
9789
10010
|
this.inapp_height = "auto";
|
|
9790
10011
|
this.media_container_height = 0;
|
|
@@ -9799,6 +10020,7 @@
|
|
|
9799
10020
|
this.dimBackgroundElement = null;
|
|
9800
10021
|
this.overlayElement = null;
|
|
9801
10022
|
this.inAppContainer = null;
|
|
10023
|
+
//this.customFontList = [];
|
|
9802
10024
|
}
|
|
9803
10025
|
|
|
9804
10026
|
/**
|
|
@@ -9872,6 +10094,8 @@
|
|
|
9872
10094
|
} else {
|
|
9873
10095
|
if (this.direction.nudge === DIRECTION.VERTICAL) {
|
|
9874
10096
|
this.inapp_width = "".concat(this.width, "%");
|
|
10097
|
+
} else {
|
|
10098
|
+
this.max_width = "".concat(this.width, "%");
|
|
9875
10099
|
}
|
|
9876
10100
|
}
|
|
9877
10101
|
}
|
|
@@ -9929,7 +10153,8 @@
|
|
|
9929
10153
|
// With dim background, it becomes the element to add the listener.
|
|
9930
10154
|
// With out dim background, ideally dismiss out side touch should not be used. If used, set the listener on the overlay.
|
|
9931
10155
|
if (this.enable_dismiss_actions && this.dismiss_actions.outside_touch) {
|
|
9932
|
-
dismissableElement.
|
|
10156
|
+
dismissableElement.ontouchstart = function () {
|
|
10157
|
+
clearTimeout(_this2.terminationTimeoutId);
|
|
9933
10158
|
_this2.closeCallback(_this2.overlayElement, "dismiss", ".apx-inapp-container".concat(_this2.cssPostFix));
|
|
9934
10159
|
};
|
|
9935
10160
|
}
|
|
@@ -9945,12 +10170,33 @@
|
|
|
9945
10170
|
}, {
|
|
9946
10171
|
key: "_setStyles",
|
|
9947
10172
|
value: function _setStyles() {
|
|
9948
|
-
var styles = " \n ".concat(this._getBackgroundContainerStyles(), " \n ").concat(this._getInAppContainerStyles(), " \n ").concat(this._getScrollStyles(), " \n ").concat(this._getControlsStyles(), " \n ").concat(this._getInAppMediaContainerStyles(), "\n ").concat(this._getInAppNonMediaContainerStyles(), "\n ").concat(this._getTextConatinerStyles(), "\n ").concat(this._getTitleStyles(), " \n ").concat(this._getDescriptionStyles(), " \n ").concat(this._getFormStyles(), "\n ").concat(this._getInAppButtonContainerStyles(), "\n ").concat(this._getIconStyles(), " \n ").concat(this._getImageStyles(), " \n ").concat(this._getVideoStyles(), " \n ").concat(this.
|
|
10173
|
+
var styles = "\n ".concat(this._getCustomFonts(), " \n ").concat(this._getBackgroundContainerStyles(), " \n ").concat(this._getInAppContainerStyles(), " \n ").concat(this._getScrollStyles(), " \n ").concat(this._getControlsStyles(), " \n ").concat(this._getInAppMediaContainerStyles(), "\n ").concat(this._getInAppNonMediaContainerStyles(), "\n ").concat(this._getTextConatinerStyles(), "\n ").concat(this._getTitleStyles(), " \n ").concat(this._getDescriptionStyles(), " \n ").concat(this._getFormStyles(), "\n ").concat(this._getInAppButtonContainerStyles(), "\n ").concat(this._getIconStyles(), " \n ").concat(this._getImageStyles(), " \n ").concat(this._getVideoStyles(), " \n ").concat(this.BawS(), " \n ").concat(this._getProgressBarStyles(), "\n ").concat(this._getBootstrapiconsStyles(), " \n ").replaceAll("\n", "").replace(/[\s]{2,999}/g, "");
|
|
9949
10174
|
var styleNode = document.createElement("style");
|
|
10175
|
+
styleNode.setAttribute("id", "apxor-style-" + this.configId);
|
|
9950
10176
|
styleNode.innerHTML = styles;
|
|
9951
10177
|
this.overlayElement.appendChild(styleNode);
|
|
9952
10178
|
}
|
|
9953
10179
|
|
|
10180
|
+
/**
|
|
10181
|
+
* @function _getCustomFonts
|
|
10182
|
+
* @private
|
|
10183
|
+
* @description Creates the font-face at rule if there are custom fonts
|
|
10184
|
+
* @returns {string} css styles
|
|
10185
|
+
*/
|
|
10186
|
+
}, {
|
|
10187
|
+
key: "_getCustomFonts",
|
|
10188
|
+
value: function _getCustomFonts() {
|
|
10189
|
+
var _this3 = this;
|
|
10190
|
+
var font_face = "";
|
|
10191
|
+
if (this.theme.custom_fonts.length > 0) {
|
|
10192
|
+
this.theme.custom_fonts.forEach(function (customFont) {
|
|
10193
|
+
_this3.customFontList.push(customFont.name);
|
|
10194
|
+
font_face += "\n @font-face {\n font-family: ".concat(customFont.name, ";\n src: url(").concat(customFont.url, ")\n }");
|
|
10195
|
+
});
|
|
10196
|
+
}
|
|
10197
|
+
return font_face;
|
|
10198
|
+
}
|
|
10199
|
+
|
|
9954
10200
|
/**
|
|
9955
10201
|
* @function _getBackgroundContainerStyles
|
|
9956
10202
|
* @private
|
|
@@ -10041,14 +10287,26 @@
|
|
|
10041
10287
|
var flexStylesForContainer = this.direction.nudge !== DIRECTION.VERTICAL ? "flex-direction:row;" : "flex-direction:column;";
|
|
10042
10288
|
flexStylesForContainer = " ".concat(flexStylesForContainer, "\n justify-content:space-evenly;\n align-items:center;\n display:flex;\n ");
|
|
10043
10289
|
var maxWidth = "",
|
|
10044
|
-
maxHeight = ""
|
|
10290
|
+
maxHeight = "",
|
|
10291
|
+
margin = "margin: auto";
|
|
10292
|
+
if (this.direction.nudge === DIRECTION.HORIZONTAL) {
|
|
10293
|
+
if (!(this.enable_image || this.enable_video || this.enable_icon)) {
|
|
10294
|
+
maxWidth = "max-width: ".concat(this.max_width);
|
|
10295
|
+
} else {
|
|
10296
|
+
if (this.position.position === INAPP_POSITION.TOP_LEFT || this.position.position === INAPP_POSITION.BOTTOM_LEFT) {
|
|
10297
|
+
margin = "margin-right: 20%; margin-block:auto";
|
|
10298
|
+
} else if (this.position.position === INAPP_POSITION.TOP_RIGHT || this.position.position === INAPP_POSITION.BOTTOM_RIGHT) {
|
|
10299
|
+
margin = "margin-left: 20%; margin-block:auto";
|
|
10300
|
+
}
|
|
10301
|
+
}
|
|
10302
|
+
}
|
|
10045
10303
|
if (this.enable_video && this.video.enable_embed) {
|
|
10046
10304
|
maxWidth = "max-width:100%;";
|
|
10047
10305
|
maxHeight = "max-height:100%;";
|
|
10048
10306
|
}
|
|
10049
10307
|
//justify-content: space-evenly;
|
|
10050
10308
|
//align-items:stretch
|
|
10051
|
-
var inappContainerStyles = "\n .apx-inapp-container".concat(this.cssPostFix, " {\n height:").concat(this.inapp_height, ";\n width:").concat(this.inapp_width, ";\n
|
|
10309
|
+
var inappContainerStyles = "\n .apx-inapp-container".concat(this.cssPostFix, " {\n height:").concat(this.inapp_height, ";\n width:").concat(this.inapp_width, ";\n background-color:").concat(this.background_color, ";\n z-index:9999;\n opacity:0;\n transition:all .5s cubic-bezier(.96,.23,.07,.8);\n position:fixed;\n visibility:hidden;\n\n ").concat(minWidthStyle, "\n ").concat(flexStylesForContainer, "\n ").concat(paddingStylesForContainer, "\n ").concat(borderStylesForContainer, "\n ").concat(gradientStylesForContainer, "\n ").concat(shadowStylesForContainer, "\n ").concat(positionStylesForContainer, "\n ").concat(maxWidth, "\n ").concat(maxHeight, "\n ").concat(margin, "\n }\n \n .apx-inapp-container").concat(this.cssPostFix, ".open{\n opacity:1;\n visibility:visible;\n }\n ");
|
|
10052
10310
|
return inappContainerStyles;
|
|
10053
10311
|
}
|
|
10054
10312
|
|
|
@@ -10085,9 +10343,9 @@
|
|
|
10085
10343
|
}
|
|
10086
10344
|
var controlsStyles = "";
|
|
10087
10345
|
if (this.direction.non_media === DIRECTION.VERTICAL || this.direction.nudge === DIRECTION.VERTICAL) {
|
|
10088
|
-
controlsStyles = "\n .apx-inapp-close".concat(this.cssPostFix, " {\n position: absolute;\n z-index:
|
|
10346
|
+
controlsStyles = "\n .apx-inapp-close".concat(this.cssPostFix, " {\n position: absolute;\n z-index:99999;\n top: ").concat(this.close_button.offset_top, "px;\n right: ").concat(this.close_button.offset_right, "px;\n width: ").concat(this.close_button.width, "px;\n height: ").concat(this.close_button.height, "px;\n cursor: pointer;\n }\n ");
|
|
10089
10347
|
} else {
|
|
10090
|
-
controlsStyles = "\n .apx-inapp-close".concat(this.cssPostFix, " {\n display:flex;\n flex-direction:row;\n justify-content:center;\n align-items:center;\n width: ").concat(this.close_button.width, "px;\n height: ").concat(this.close_button.height, "px;\n cursor: pointer;\n }\n ");
|
|
10348
|
+
controlsStyles = "\n .apx-inapp-close".concat(this.cssPostFix, " {\n display:flex;\n flex-direction:row;\n justify-content:center;\n align-items:center;\n width: ").concat(this.close_button.width, "px;\n height: ").concat(this.close_button.height, "px;\n cursor: pointer;\n z-index:99999;\n }\n ");
|
|
10091
10349
|
}
|
|
10092
10350
|
return controlsStyles;
|
|
10093
10351
|
}
|
|
@@ -10140,7 +10398,7 @@
|
|
|
10140
10398
|
}, {
|
|
10141
10399
|
key: "_getTextConatinerStyles",
|
|
10142
10400
|
value: function _getTextConatinerStyles() {
|
|
10143
|
-
var contentStyling = "\n .apx-inapp-text-container".concat(this.cssPostFix, "{\n width:
|
|
10401
|
+
var contentStyling = "\n .apx-inapp-text-container".concat(this.cssPostFix, "{\n width:auto;\n display:flex;\n flex-direction:column;\n justify-content: center;\n overflow: hidden;\n align-items:center;\n cursor:text;\n }\n ");
|
|
10144
10402
|
return contentStyling;
|
|
10145
10403
|
}
|
|
10146
10404
|
|
|
@@ -10162,7 +10420,7 @@
|
|
|
10162
10420
|
if (this.title.icon.enable_border) {
|
|
10163
10421
|
iconBorderStyles = "border-radius:".concat(this.title.icon.border.radius, "%;\n border:").concat(this.title.icon.border.width, "px ").concat(this.title.icon.border.style, " ").concat(this.title.icon.border.color, ";");
|
|
10164
10422
|
}
|
|
10165
|
-
titleIconStyles = "\n height: ".concat(this.title.icon.height, "px;\n width: ").concat(this.title.icon.width, "px;\n margin-right:
|
|
10423
|
+
titleIconStyles = "\n height: ".concat(this.title.icon.height, "px;\n width: ").concat(this.title.icon.width, "px;\n margin-right: 10px;\n ").concat(iconBorderStyles, "\n ");
|
|
10166
10424
|
}
|
|
10167
10425
|
var titleMarginStyles = "";
|
|
10168
10426
|
if (this.title.enable_margin) {
|
|
@@ -10172,7 +10430,7 @@
|
|
|
10172
10430
|
if (this.title.enable_padding) {
|
|
10173
10431
|
titlePaddingStyles = " \n padding-top:".concat(this.title.padding.top, "px;\n padding-bottom:").concat(this.title.padding.bottom, "px;\n padding-left:").concat(this.title.padding.left, "px;\n padding-right:").concat(this.title.padding.right, "px;\n ");
|
|
10174
10432
|
}
|
|
10175
|
-
var titeStyles = "\n .apx-inapp-title-div".concat(this.cssPostFix, " {\n width:100%;\n display:flex;\n justify-content:").concat(this.title.alignment, ";\n text-align:").concat(this.title.alignment, ";\n ").concat(titleMarginStyles, "\n ").concat(titlePaddingStyles, "\n }\n .apx-inapp-title-icon").concat(this.cssPostFix, " {\n ").concat(titleIconStyles, "\n }\n ");
|
|
10433
|
+
var titeStyles = "\n .apx-inapp-title-div".concat(this.cssPostFix, " {\n width:100%;\n display:flex;\n justify-content:").concat(this.title.alignment, ";\n align-items: center;\n text-align:").concat(this.title.alignment, ";\n pointer-events:none;\n ").concat(titleMarginStyles, "\n ").concat(titlePaddingStyles, "\n }\n .apx-inapp-title-icon").concat(this.cssPostFix, " {\n ").concat(titleIconStyles, "\n }\n ");
|
|
10176
10434
|
return titeStyles;
|
|
10177
10435
|
}
|
|
10178
10436
|
|
|
@@ -10209,6 +10467,7 @@
|
|
|
10209
10467
|
if (this.form.enable_padding) {
|
|
10210
10468
|
formPaddingStyles = "padding:".concat(this.form.padding.top, "px ").concat(this.form.padding.right, "px ").concat(this.form.padding.bottom, "px ").concat(this.form.padding.left, "px;");
|
|
10211
10469
|
}
|
|
10470
|
+
this.form.font.family = this._setFontFaceAtRule(this.form.font);
|
|
10212
10471
|
var formContainerstyle = "\n .apx-inapp-form-container".concat(this.cssPostFix, "{\n ").concat(formPaddingStyles, "\n font-size:").concat(this.form.font.size, "px;\n font-family:").concat(this.form.font.family, ";\n display:flex;\n flex-direction:column;\n }");
|
|
10213
10472
|
return formContainerstyle;
|
|
10214
10473
|
}
|
|
@@ -10314,7 +10573,7 @@
|
|
|
10314
10573
|
function _getProgressBarStyles() {
|
|
10315
10574
|
var progressBarStyles = "";
|
|
10316
10575
|
if (this.has_progress_bar) {
|
|
10317
|
-
progressBarStyles = "\n .apx-inapp-progress-bar".concat(this.cssPostFix, "{\n position: absolute;\n width:100%;\n height:").concat(this.progressbar.width, ";\n ").concat(this.progressbar.position === "top" ? "top:0px;" : "bottom:0px;", "\n left:0px;\n z-index:999999;\n overflow:hidden;\n cursor: pointer;\n background:").concat(this.progressbar.reamining_color, ";\n }\n .apx-inapp-bar").concat(this.cssPostFix, "{\n width:100%;\n height:100%;\n background:").concat(this.progressbar.progress_color, ";\n }");
|
|
10576
|
+
progressBarStyles = "\n .apx-inapp-progress-bar".concat(this.cssPostFix, "{\n position: absolute;\n width:100%;\n height:").concat(this.progressbar.width, "px;\n ").concat(this.progressbar.position === "top" ? "top:0px;" : "bottom:0px;", "\n left:0px;\n z-index:999999;\n overflow:hidden;\n cursor: pointer;\n background:").concat(this.progressbar.reamining_color, ";\n }\n .apx-inapp-bar").concat(this.cssPostFix, "{\n width:100%;\n height:100%;\n background:").concat(this.progressbar.progress_color, ";\n }");
|
|
10318
10577
|
}
|
|
10319
10578
|
return progressBarStyles;
|
|
10320
10579
|
}
|
|
@@ -10388,7 +10647,7 @@
|
|
|
10388
10647
|
this._setCloseButton();
|
|
10389
10648
|
|
|
10390
10649
|
//Set the Marketing content
|
|
10391
|
-
this.
|
|
10650
|
+
this.FcXQ();
|
|
10392
10651
|
}
|
|
10393
10652
|
|
|
10394
10653
|
/**
|
|
@@ -10534,6 +10793,7 @@
|
|
|
10534
10793
|
titleIconElement.classList.add("apx-inapp-title-icon".concat(this.cssPostFix));
|
|
10535
10794
|
titleElement.appendChild(titleIconElement);
|
|
10536
10795
|
}
|
|
10796
|
+
//this.title.font.family = this._setFontFaceAtRule(this.title.font);
|
|
10537
10797
|
titleElement.appendChild(createNewTextElement(this.title, this.currentId, "title"));
|
|
10538
10798
|
this.textContainer.appendChild(titleElement);
|
|
10539
10799
|
}
|
|
@@ -10551,6 +10811,7 @@
|
|
|
10551
10811
|
if (this.enable_description) {
|
|
10552
10812
|
var textElement = document.createElement("div");
|
|
10553
10813
|
textElement.classList.add("apx-inapp-description".concat(this.cssPostFix));
|
|
10814
|
+
//this.description.font.family = this._setFontFaceAtRule(this.description.font);
|
|
10554
10815
|
textElement.appendChild(createNewTextElement(this.description, this.currentId, "description"));
|
|
10555
10816
|
textElement.classList.add("apx-inapp-scroll".concat(this.cssPostFix));
|
|
10556
10817
|
|
|
@@ -10567,13 +10828,13 @@
|
|
|
10567
10828
|
* @description Sets the form content in the InApp modal.
|
|
10568
10829
|
*/
|
|
10569
10830
|
function _setFormContent() {
|
|
10570
|
-
var
|
|
10831
|
+
var _this4 = this;
|
|
10571
10832
|
if (this.enable_form) {
|
|
10572
10833
|
var _this$form$elements;
|
|
10573
10834
|
var formContainer = document.createElement("form");
|
|
10574
10835
|
formContainer.classList.add("apx-inapp-form-container".concat(this.cssPostFix));
|
|
10575
10836
|
var dummy = "";
|
|
10576
|
-
(_this$form$elements = this.form.elements) === null || _this$form$elements === void 0
|
|
10837
|
+
(_this$form$elements = this.form.elements) === null || _this$form$elements === void 0 || _this$form$elements.forEach(function (element) {
|
|
10577
10838
|
dummy += generateFormField(element);
|
|
10578
10839
|
});
|
|
10579
10840
|
formContainer.innerHTML = dummy;
|
|
@@ -10581,13 +10842,14 @@
|
|
|
10581
10842
|
var form = document.querySelector(".apx-inapp-form-container".concat(this.cssPostFix));
|
|
10582
10843
|
form.addEventListener("submit", function (e) {
|
|
10583
10844
|
e.preventDefault();
|
|
10584
|
-
var
|
|
10585
|
-
obj =
|
|
10586
|
-
callback =
|
|
10845
|
+
var _this4$generateRespon = _this4.ZKNy(_this4.form.elements),
|
|
10846
|
+
obj = _this4$generateRespon.obj,
|
|
10847
|
+
callback = _this4$generateRespon.callback;
|
|
10587
10848
|
var evalString = "(obj)=>" + callback + "(obj)";
|
|
10588
10849
|
var evalFunction = eval(evalString);
|
|
10589
10850
|
evalFunction(obj);
|
|
10590
|
-
|
|
10851
|
+
clearTimeout(_this4.terminationTimeoutId);
|
|
10852
|
+
_this4.closeCallback(_this4.overlayElement, "dismiss", ".apx-inapp-container".concat(_this4.cssPostFix));
|
|
10591
10853
|
});
|
|
10592
10854
|
}
|
|
10593
10855
|
}
|
|
@@ -10687,22 +10949,23 @@
|
|
|
10687
10949
|
}, {
|
|
10688
10950
|
key: "_setButtons",
|
|
10689
10951
|
value: function _setButtons(position) {
|
|
10690
|
-
var
|
|
10952
|
+
var _this5 = this;
|
|
10691
10953
|
if (!this.enable_buttons) {
|
|
10692
10954
|
return;
|
|
10693
10955
|
}
|
|
10694
10956
|
if (position === BUTTON_CONTAINER_POSITION.TOP && this.buttons.enable_top || position === BUTTON_CONTAINER_POSITION.CENTER && this.buttons.enable_center || position === BUTTON_CONTAINER_POSITION.BOTTOM && this.buttons.enable_bottom) {
|
|
10695
10957
|
var overlay = this.overlayElement;
|
|
10696
10958
|
var actionCallback = function actionCallback(isCancelled, action) {
|
|
10697
|
-
|
|
10959
|
+
clearTimeout(_this5.terminationTimeoutId);
|
|
10960
|
+
_this5.closeCallback(overlay, action, ".apx-inapp-container".concat(_this5.cssPostFix));
|
|
10698
10961
|
};
|
|
10699
10962
|
var next_Callback = function next_Callback(id, action) {
|
|
10700
10963
|
actionCallback(false, "next");
|
|
10701
|
-
|
|
10964
|
+
_this5.stepperCallBack(id, action);
|
|
10702
10965
|
};
|
|
10703
10966
|
var prev_Callback = function prev_Callback(id, action) {
|
|
10704
10967
|
actionCallback(false, "prev");
|
|
10705
|
-
|
|
10968
|
+
_this5.stepperCallBack(id, action);
|
|
10706
10969
|
};
|
|
10707
10970
|
var actionHandler = {
|
|
10708
10971
|
next: next_Callback,
|
|
@@ -10720,6 +10983,11 @@
|
|
|
10720
10983
|
} else {
|
|
10721
10984
|
buttons_config = this.buttons.bottom;
|
|
10722
10985
|
}
|
|
10986
|
+
|
|
10987
|
+
// buttons_config.forEach((button_config) => {
|
|
10988
|
+
// button_config.text.font.family = this._setFontFaceAtRule(button_config.text.font);
|
|
10989
|
+
// return button_config;
|
|
10990
|
+
// })
|
|
10723
10991
|
var _Buttons = generateButtonsBlock(this.configId, this.name, this.stepper, EVENT_PREFIX.INAPP, buttons_config, this.direction.buttons, position, actionHandler, this.isWalkthrough, this.uis, this.index);
|
|
10724
10992
|
if (position === BUTTON_CONTAINER_POSITION.TOP) {
|
|
10725
10993
|
this.topButtonContainer.appendChild(_Buttons);
|
|
@@ -10739,7 +11007,7 @@
|
|
|
10739
11007
|
}, {
|
|
10740
11008
|
key: "_setCloseButton",
|
|
10741
11009
|
value: function _setCloseButton() {
|
|
10742
|
-
var
|
|
11010
|
+
var _this6 = this;
|
|
10743
11011
|
if (this.enable_close_button) {
|
|
10744
11012
|
var closeButton = document.createElement("span");
|
|
10745
11013
|
// Close button SVG is decided based on the type of the button in the config.
|
|
@@ -10756,7 +11024,13 @@
|
|
|
10756
11024
|
}
|
|
10757
11025
|
closeButton.classList.add("apx-inapp-close".concat(this.cssPostFix));
|
|
10758
11026
|
closeButton.addEventListener("click", function () {
|
|
10759
|
-
|
|
11027
|
+
if (_this6.close_button.action === "dismiss") {
|
|
11028
|
+
window.Apxor.logActionEvent(EVENT_PREFIX.INAPP + "InAppXIconClicked" + "_Clicked", _this6.configId, _this6.name);
|
|
11029
|
+
} else if (_this6.close_button.action === "cancel") {
|
|
11030
|
+
window.Apxor.logActionEvent("walk_through_cancelled", _this6.configId, _this6.name);
|
|
11031
|
+
}
|
|
11032
|
+
clearTimeout(_this6.terminationTimeoutId);
|
|
11033
|
+
_this6.closeCallback(_this6.overlayElement, _this6.close_button.action, ".apx-inapp-container".concat(_this6.cssPostFix));
|
|
10760
11034
|
});
|
|
10761
11035
|
this.direction.non_media === DIRECTION.VERTICAL || this.direction.nudge === DIRECTION.VERTICAL ? this.inAppContainer.appendChild(closeButton) : this.buttonContainer.appendChild(closeButton);
|
|
10762
11036
|
}
|
|
@@ -10770,11 +11044,11 @@
|
|
|
10770
11044
|
* @description If the auto dismiss is enabled, sets the timeout to call the InApp close.
|
|
10771
11045
|
*/
|
|
10772
11046
|
function _setAutoTerminate() {
|
|
10773
|
-
var
|
|
11047
|
+
var _this7 = this;
|
|
10774
11048
|
if (this.terminationConfig.auto_dismiss === true) {
|
|
10775
|
-
window.setTimeout(function () {
|
|
10776
|
-
|
|
10777
|
-
}, this.
|
|
11049
|
+
this.terminationTimeoutId = window.setTimeout(function () {
|
|
11050
|
+
_this7.closeCallback(_this7.overlayElement, "dismiss", ".apx-inapp-container".concat(_this7.cssPostFix));
|
|
11051
|
+
}, this.terminationConfig.duration);
|
|
10778
11052
|
}
|
|
10779
11053
|
}
|
|
10780
11054
|
|
|
@@ -10866,7 +11140,7 @@
|
|
|
10866
11140
|
return PIP;
|
|
10867
11141
|
}();
|
|
10868
11142
|
|
|
10869
|
-
var Logger =
|
|
11143
|
+
var Logger = console;
|
|
10870
11144
|
var VideoInApp = /*#__PURE__*/function () {
|
|
10871
11145
|
/**
|
|
10872
11146
|
* @class VideoInApp
|
|
@@ -10881,7 +11155,7 @@
|
|
|
10881
11155
|
* @function showVideoInApp
|
|
10882
11156
|
* @description Shows the video InApp with the configured mode.
|
|
10883
11157
|
*/
|
|
10884
|
-
_defineProperty(this, "
|
|
11158
|
+
_defineProperty(this, "ShKw", function () {
|
|
10885
11159
|
_this.createPlayer();
|
|
10886
11160
|
try {
|
|
10887
11161
|
// In PIP mode, only after the video metadata is loaded, show the PIP.
|
|
@@ -10899,7 +11173,7 @@
|
|
|
10899
11173
|
};
|
|
10900
11174
|
} else {
|
|
10901
11175
|
// As the video player is hidden by default, unhide if the mode is not PIP.
|
|
10902
|
-
_this.
|
|
11176
|
+
_this.DZzb();
|
|
10903
11177
|
}
|
|
10904
11178
|
_this.showCallback();
|
|
10905
11179
|
} catch (e) {
|
|
@@ -10919,7 +11193,7 @@
|
|
|
10919
11193
|
* For portrait - width is set to 50% of the screen and height is auto adjusted based on resolution.
|
|
10920
11194
|
* For landscape - height is set to 50% of the screen and width is auto adjusted based on resolution.
|
|
10921
11195
|
*/
|
|
10922
|
-
_defineProperty(this, "
|
|
11196
|
+
_defineProperty(this, "IQly", function () {
|
|
10923
11197
|
var _getHeightWidthFromRe = getHeightWidthFromResolution(_this.video),
|
|
10924
11198
|
width = _getHeightWidthFromRe.width,
|
|
10925
11199
|
height = _getHeightWidthFromRe.height;
|
|
@@ -10931,7 +11205,7 @@
|
|
|
10931
11205
|
* @private
|
|
10932
11206
|
* @description Removes the video player style element.
|
|
10933
11207
|
*/
|
|
10934
|
-
_defineProperty(this, "
|
|
11208
|
+
_defineProperty(this, "kWtF", function () {
|
|
10935
11209
|
var playerStyles = document.getElementById("apx-mpl-styles");
|
|
10936
11210
|
if (playerStyles) {
|
|
10937
11211
|
playerStyles.remove();
|
|
@@ -10942,7 +11216,7 @@
|
|
|
10942
11216
|
* @private
|
|
10943
11217
|
* @description Attach listeners on the video controls
|
|
10944
11218
|
*/
|
|
10945
|
-
_defineProperty(this, "
|
|
11219
|
+
_defineProperty(this, "Ugij", function () {
|
|
10946
11220
|
// Listener for the video end. Display the CTA's when the video ends.
|
|
10947
11221
|
_this.videoElement.addEventListener("ended", function () {
|
|
10948
11222
|
var ctaButtons = document.getElementById("apx-cta-btn");
|
|
@@ -11049,7 +11323,7 @@
|
|
|
11049
11323
|
* @private
|
|
11050
11324
|
* @description Attach listeners for the PIP toggle. i.e. for the PIP enter and PIP exit
|
|
11051
11325
|
*/
|
|
11052
|
-
_defineProperty(this, "
|
|
11326
|
+
_defineProperty(this, "EevJ", function () {
|
|
11053
11327
|
var _this$terminationConf;
|
|
11054
11328
|
if (_this.mode === "PIP" && !((_this$terminationConf = _this.terminationConfig) !== null && _this$terminationConf !== void 0 && _this$terminationConf.auto_dismiss)) {
|
|
11055
11329
|
// On Exit of the PIP,
|
|
@@ -11089,7 +11363,7 @@
|
|
|
11089
11363
|
* @private Sets the custom controls on the video player.
|
|
11090
11364
|
* PIP and close are the custom controls that are created and positions on the video.
|
|
11091
11365
|
*/
|
|
11092
|
-
_defineProperty(this, "
|
|
11366
|
+
_defineProperty(this, "APIa", function () {
|
|
11093
11367
|
_this.enable_close_button;
|
|
11094
11368
|
if (_this.enable_close_button) {
|
|
11095
11369
|
var closeButton = document.createElement("span");
|
|
@@ -11136,21 +11410,21 @@
|
|
|
11136
11410
|
* @function hideVideoPlayer
|
|
11137
11411
|
* @description Sets the visibility of the video player to hidden.
|
|
11138
11412
|
*/
|
|
11139
|
-
_defineProperty(this, "
|
|
11413
|
+
_defineProperty(this, "Dumw", function () {
|
|
11140
11414
|
_this.videoPlayer.classList.add("apx-video-hide-elmt".concat(_this.cssPostFix));
|
|
11141
11415
|
});
|
|
11142
11416
|
/**
|
|
11143
11417
|
* @function unhideVideoPlayer
|
|
11144
11418
|
* @description Unhides video player.
|
|
11145
11419
|
*/
|
|
11146
|
-
_defineProperty(this, "
|
|
11420
|
+
_defineProperty(this, "DZzb", function () {
|
|
11147
11421
|
_this.videoPlayer.classList.remove("apx-video-hide-elmt".concat(_this.cssPostFix));
|
|
11148
11422
|
});
|
|
11149
11423
|
/**
|
|
11150
11424
|
* @function getVideoElement
|
|
11151
11425
|
* @returns {HTMLElement} Video ekement
|
|
11152
11426
|
*/
|
|
11153
|
-
_defineProperty(this, "
|
|
11427
|
+
_defineProperty(this, "ROcP", function () {
|
|
11154
11428
|
return _this.videoElement;
|
|
11155
11429
|
});
|
|
11156
11430
|
this.videoPlayer = null;
|
|
@@ -11202,7 +11476,7 @@
|
|
|
11202
11476
|
this.videoPlayer.style.backgroundColor = this.bg_color;
|
|
11203
11477
|
|
|
11204
11478
|
// Video has a resolution, not deviating from the resolution set the height and width.
|
|
11205
|
-
this.
|
|
11479
|
+
this.IQly();
|
|
11206
11480
|
//Generate the styles and add them to the document head.
|
|
11207
11481
|
this._setVideoPlayerStyles();
|
|
11208
11482
|
//Set the position of the video player with in the 5 possible positions.
|
|
@@ -11210,16 +11484,16 @@
|
|
|
11210
11484
|
//Create a video element,set the source and add to the container.
|
|
11211
11485
|
this._setPlayerContent();
|
|
11212
11486
|
//Set the listeners on the video control buttons.
|
|
11213
|
-
this.
|
|
11487
|
+
this.Ugij();
|
|
11214
11488
|
//Attach listeners for the PIP toggle. i.e. for the PIP enter and PIP exit
|
|
11215
|
-
this.
|
|
11489
|
+
this.EevJ();
|
|
11216
11490
|
//Set the custom close and PIP controls. Not using the defaults from the html video element.
|
|
11217
11491
|
//Reason - We want to position them at the top right and left positions.
|
|
11218
|
-
this.
|
|
11492
|
+
this.APIa();
|
|
11219
11493
|
//Generate and postion the CTA buttons on the video. By default hidden, visible only when video is completed
|
|
11220
11494
|
this._setButtons(BUTTON_CONTAINER_POSITION.CENTER);
|
|
11221
11495
|
//Hide the video player. Display it based on the video mode. Videoplayer for "video" mode and a direct PIP for "PIP" mode.
|
|
11222
|
-
this.
|
|
11496
|
+
this.Dumw();
|
|
11223
11497
|
//If the auto dismiss is enabled, sets the timeout to call the InApp close.
|
|
11224
11498
|
this._setAutoTerminate();
|
|
11225
11499
|
document.body.appendChild(this.videoPlayer);
|
|
@@ -11319,15 +11593,17 @@
|
|
|
11319
11593
|
function _onClose() {
|
|
11320
11594
|
var closeButtonName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "web_minimise_x_clicked";
|
|
11321
11595
|
try {
|
|
11322
|
-
if (
|
|
11323
|
-
|
|
11324
|
-
|
|
11325
|
-
|
|
11326
|
-
|
|
11327
|
-
|
|
11596
|
+
if (this.inAppShown) {
|
|
11597
|
+
if (!document.fullscreenElement) {
|
|
11598
|
+
this.totalDurationMinimised += Math.round(this.videoElement.currentTime) - Math.round(this.slotStartTime);
|
|
11599
|
+
this.durationMinimisedSlots.push("".concat(Math.round(this.videoElement.currentTime), "-").concat(Math.round(this.slotStartTime)));
|
|
11600
|
+
} else {
|
|
11601
|
+
this.totalDurationMaximised += Math.round(this.videoElement.currentTime) - Math.round(this.slotStartTime);
|
|
11602
|
+
this.durationMaximisedSlots.push("".concat(Math.round(this.videoElement.currentTime), "-").concat(Math.round(this.slotStartTime)));
|
|
11603
|
+
}
|
|
11328
11604
|
}
|
|
11329
11605
|
this.videoPlayer.remove();
|
|
11330
|
-
this.
|
|
11606
|
+
this.kWtF();
|
|
11331
11607
|
if (closeButtonName !== "auto_dismiss") {
|
|
11332
11608
|
window.Apxor.logAppEvent("apx_video_inapp_close_button_clicked", {
|
|
11333
11609
|
message_name: this.name,
|
|
@@ -11381,10 +11657,11 @@
|
|
|
11381
11657
|
totalDurationWatched: Math.round(_this2.videoElement.currentTime),
|
|
11382
11658
|
message_name: _this2.name,
|
|
11383
11659
|
id: _this2.configId,
|
|
11384
|
-
totalDurationWatchedSlot: "0-".concat(Math.round(_this2.videoElement.currentTime))
|
|
11660
|
+
totalDurationWatchedSlot: "0-".concat(Math.round(_this2.videoElement.currentTime)),
|
|
11661
|
+
replayCount: _this2.replayCount
|
|
11385
11662
|
});
|
|
11386
11663
|
_this2.videoPlayer.remove();
|
|
11387
|
-
_this2.
|
|
11664
|
+
_this2.kWtF();
|
|
11388
11665
|
_this2.hideCallback();
|
|
11389
11666
|
} catch (e) {
|
|
11390
11667
|
console.log("Can't close the video player\n".concat(e));
|
|
@@ -11472,13 +11749,13 @@
|
|
|
11472
11749
|
var RTM = /*#__PURE__*/_createClass(function RTM() {
|
|
11473
11750
|
var _this = this;
|
|
11474
11751
|
_classCallCheck(this, RTM);
|
|
11475
|
-
_defineProperty(this, "
|
|
11752
|
+
_defineProperty(this, "jgtt", {});
|
|
11476
11753
|
_defineProperty(this, "isShowingAction", false);
|
|
11477
11754
|
_defineProperty(this, "currentAction", null);
|
|
11478
|
-
_defineProperty(this, "version",
|
|
11755
|
+
_defineProperty(this, "version", 20);
|
|
11479
11756
|
_defineProperty(this, "isInitialised", false);
|
|
11480
11757
|
_defineProperty(this, "_eventsInDynamicText", {});
|
|
11481
|
-
_defineProperty(this, "
|
|
11758
|
+
_defineProperty(this, "zCiN", function () {
|
|
11482
11759
|
_this.isInitialised = true;
|
|
11483
11760
|
var oldPushState = history.pushState;
|
|
11484
11761
|
history.pushState = function pushState() {
|
|
@@ -11503,7 +11780,7 @@
|
|
|
11503
11780
|
});
|
|
11504
11781
|
_defineProperty(this, "show", function (uiJson, duration, uuid, name) {
|
|
11505
11782
|
if (!_this.isInitialised) {
|
|
11506
|
-
_this.
|
|
11783
|
+
_this.zCiN();
|
|
11507
11784
|
}
|
|
11508
11785
|
try {
|
|
11509
11786
|
// console.log("Showing action for uuid:", uuid, uiJson, this.currentAction);
|
|
@@ -11527,16 +11804,16 @@
|
|
|
11527
11804
|
}, terminationConfig, function () {
|
|
11528
11805
|
_this.isShowingAction = true;
|
|
11529
11806
|
if (window.Apxor && window.Apxor.logActionEvent) {
|
|
11530
|
-
var _window
|
|
11531
|
-
(_window = window) === null || _window === void 0
|
|
11807
|
+
var _window;
|
|
11808
|
+
(_window = window) === null || _window === void 0 || (_window = _window.Apxor) === null || _window === void 0 || _window.updateFlag(true);
|
|
11532
11809
|
window.Apxor.logActionEvent("inline_shown", uuid, name);
|
|
11533
11810
|
}
|
|
11534
|
-
}, function () {
|
|
11535
|
-
var _window2
|
|
11811
|
+
}, function (action) {
|
|
11812
|
+
var _window2;
|
|
11536
11813
|
_this.isShowingAction = false;
|
|
11537
|
-
(_window2 = window) === null || _window2 === void 0
|
|
11814
|
+
(_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.Apxor) === null || _window2 === void 0 || _window2.updateFlag(false);
|
|
11538
11815
|
_this.currentAction = null;
|
|
11539
|
-
if (window.Apxor && window.Apxor.logActionEvent) {
|
|
11816
|
+
if (window.Apxor && window.Apxor.logActionEvent && !(isDefined(action) && (action === "redirect" || action === "cancel"))) {
|
|
11540
11817
|
window.Apxor.logActionEvent("inline_dismissed", uuid, name);
|
|
11541
11818
|
}
|
|
11542
11819
|
}, function (callback) {
|
|
@@ -11544,15 +11821,15 @@
|
|
|
11544
11821
|
});
|
|
11545
11822
|
}
|
|
11546
11823
|
} catch (e) {
|
|
11547
|
-
var _window3
|
|
11824
|
+
var _window3;
|
|
11548
11825
|
_this.isShowingAction = false;
|
|
11549
|
-
(_window3 = window) === null || _window3 === void 0
|
|
11826
|
+
(_window3 = window) === null || _window3 === void 0 || (_window3 = _window3.Apxor) === null || _window3 === void 0 || _window3.updateFlag(false);
|
|
11550
11827
|
console.error(e);
|
|
11551
11828
|
}
|
|
11552
11829
|
});
|
|
11553
11830
|
_defineProperty(this, "removeAll", function () {
|
|
11554
|
-
var _window4
|
|
11555
|
-
(_window4 = window) === null || _window4 === void 0
|
|
11831
|
+
var _window4;
|
|
11832
|
+
(_window4 = window) === null || _window4 === void 0 || (_window4 = _window4.Apxor) === null || _window4 === void 0 || _window4.updateFlag(false);
|
|
11556
11833
|
if (_this.currentAction !== null && _this.currentAction !== undefined) {
|
|
11557
11834
|
_this.isShowingAction = false;
|
|
11558
11835
|
try {
|
|
@@ -11576,20 +11853,20 @@
|
|
|
11576
11853
|
var VideoInAppInstance = new VideoInApp(videoConfig, terminationConfig, configId, name, function () {
|
|
11577
11854
|
_this.isShowingAction = true;
|
|
11578
11855
|
if (window.Apxor && window.Apxor.logActionEvent) {
|
|
11579
|
-
var _window5
|
|
11580
|
-
(_window5 = window) === null || _window5 === void 0
|
|
11856
|
+
var _window5;
|
|
11857
|
+
(_window5 = window) === null || _window5 === void 0 || (_window5 = _window5.Apxor) === null || _window5 === void 0 || _window5.updateFlag(true);
|
|
11581
11858
|
window.Apxor.logActionEvent("inapp_shown", configId, name);
|
|
11582
11859
|
}
|
|
11583
11860
|
}, function () {
|
|
11584
|
-
var _window6
|
|
11861
|
+
var _window6;
|
|
11585
11862
|
_this.isShowingAction = false;
|
|
11586
11863
|
_this.currentAction = null;
|
|
11587
|
-
(_window6 = window) === null || _window6 === void 0
|
|
11864
|
+
(_window6 = window) === null || _window6 === void 0 || (_window6 = _window6.Apxor) === null || _window6 === void 0 || _window6.updateFlag(false);
|
|
11588
11865
|
if (window.Apxor && window.Apxor.logActionEvent) {
|
|
11589
11866
|
window.Apxor.logActionEvent("inapp_dismissed", configId, name);
|
|
11590
11867
|
}
|
|
11591
11868
|
});
|
|
11592
|
-
VideoInAppInstance.
|
|
11869
|
+
VideoInAppInstance.ShKw();
|
|
11593
11870
|
});
|
|
11594
11871
|
/**
|
|
11595
11872
|
* Creates a modal for the given config and displays it.
|
|
@@ -11608,21 +11885,21 @@
|
|
|
11608
11885
|
var inappModal = new ModalInApp(config, terminationConfig, configId, name, function () {
|
|
11609
11886
|
_this.isShowingAction = true;
|
|
11610
11887
|
if (window.Apxor && window.Apxor.logActionEvent) {
|
|
11611
|
-
var _window7
|
|
11612
|
-
(_window7 = window) === null || _window7 === void 0
|
|
11888
|
+
var _window7;
|
|
11889
|
+
(_window7 = window) === null || _window7 === void 0 || (_window7 = _window7.Apxor) === null || _window7 === void 0 || _window7.updateFlag("IN_APP", true);
|
|
11613
11890
|
window.Apxor.logActionEvent("inapp_shown", configId, name);
|
|
11614
11891
|
}
|
|
11615
11892
|
}, function (backgroundDiv, action) {
|
|
11616
|
-
var _dialogContent$classL, _window8
|
|
11893
|
+
var _dialogContent$classL, _window8;
|
|
11617
11894
|
var cssClass = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ".apx-dlg-c";
|
|
11618
11895
|
var dialogContent = document.querySelector(cssClass);
|
|
11619
|
-
dialogContent === null || dialogContent === void 0
|
|
11896
|
+
dialogContent === null || dialogContent === void 0 || (_dialogContent$classL = dialogContent.classList) === null || _dialogContent$classL === void 0 || _dialogContent$classL.toggle("open");
|
|
11620
11897
|
// setTimeout(() => {
|
|
11621
11898
|
backgroundDiv.remove();
|
|
11622
11899
|
_this.isShowingAction = false;
|
|
11623
|
-
(_window8 = window) === null || _window8 === void 0
|
|
11900
|
+
(_window8 = window) === null || _window8 === void 0 || (_window8 = _window8.Apxor) === null || _window8 === void 0 || _window8.updateFlag("IN_APP", false);
|
|
11624
11901
|
_this.currentAction = null;
|
|
11625
|
-
if (window.Apxor && window.Apxor.logActionEvent) {
|
|
11902
|
+
if (window.Apxor && window.Apxor.logActionEvent && !(action == "cancel" || action == "redirect")) {
|
|
11626
11903
|
window.Apxor.logActionEvent("inapp_dismissed", configId, name);
|
|
11627
11904
|
}
|
|
11628
11905
|
}, function () {}, false, [], 0);
|
|
@@ -11646,4 +11923,4 @@
|
|
|
11646
11923
|
|
|
11647
11924
|
return rtm;
|
|
11648
11925
|
|
|
11649
|
-
}));
|
|
11926
|
+
})));
|