(function (c) { function n() { var a = Array.prototype.slice.call(arguments); l.push({ call: String(a[0].callee.name), args: a[0] }) } var xeFramework; function p(a) { var b = c.document.createElement("script"); b.type = "text/javascript"; b.async = !0; b.onload = function () { "function" === typeof xe_bootstrap && xe_bootstrap(); var b = __xe.Framework.extend({ constructor: function (a) { __xe.Framework.call(this) }, init: function () { xe_core = this.layer; XE_EVENTS.vars.ready = xe_core.createEvent(XE_EVENTS.consts.READY, null, !0, !1); XE_EVENTS.vars.run = xe_core.createEvent(XE_EVENTS.consts.RUN, null, !0, !1); XE_EVENTS.vars.domready = xe_core.createEvent(XE_EVENTS.consts.DOM_READY, null, !0, !1) }, ready: function () { xeFramework = this; "undefined" === c.document.body || null == c.document.body ? c.document.addEventListener("DOMContentLoaded", function () { xeFramework.ready() }) : (xe_core.ready = !0, xe_core.fireEvent(XE_EVENTS.vars.ready), xeFramework.run()) }, run: function () { xe_core.fireEvent(XE_EVENTS.vars.run); xe_domready && xe_core.fireEvent(XE_EVENTS.vars.domready); xe_core.vm && xe_loadModule(!0, "xengine_viewmode") } }); c.xengine = new b; xengine.domainGUID = xe_config.GUID; xengine.domainKEY = xe_config.KEY; xengine = Object.freeze(xengine); if (0 < l.length) for (var q = 0, g = l.length; q < g; q++) { var f = l[0].call; "xe_loadExtension" == f && (xe_config.avoidProc = !0); f = c[f]; "function" === typeof f && f.apply(this, l[0].args) } r() }; b.src = "//conectiva.io/XEngine/core.js?ts=" + xe_getCacheTS(); (c.document.head || c.document.getElementsByTagName("head")[0]).appendChild(b) } c.xe_getCacheTS = function () { var args = Array.prototype.slice.call(arguments); var d = xe_isset(args[0], 'number') ? parseInt(args[0]) : 2; var b = localStorage.getItem("xe_cache_ts") || 0, a = new Date; a = (new Date(a.getFullYear(), a.getMonth(), a.getDate(), a.getHours() + d, 0, 0, 0)).getTime(); 0 > b - a && localStorage.setItem("xe_cache_ts", a); return String(0 == b ? a : b).slice(0,-3) } c.xe_pageViewHit = function (visitorID, ping) { return true; } function r() { var a = c.document.createElement("script"); a.type = "text/javascript"; a.async = !0; a.src = xeBuildSecureLink(xe_config.path + "/DGUID/" + xengine.domainGUID + xe_core.relpath + "load.js"); (c.document.head || c.document.getElementsByTagName("head")[0]).appendChild(a) } if ("function" !== typeof xe_domready) { c.xe_domready = function () { function a(a) { for (e = 1; a = d.shift();) a() } var b, d = [], c = document, g = c.documentElement, f = g.doScroll, e = /^loade|c/.test(c.readyState); return c.addEventListener && c.addEventListener("DOMContentLoaded", b = function () { c.removeEventListener("DOMContentLoaded", b, !1); a() }, !1), f && c.attachEvent("onreadystatechange", b = function () { /^c/.test(c.readyState) && (c.detachEvent("onreadystatechange", b), a()) }), f ? function (a) { self != top ? e ? a() : d.push(a) : function () { try { g.doScroll("left") } catch (t) { return setTimeout(function () { ready(a) }, 50) } a() }() } : function (a) { e ? a() : d.push(a) } }(); c.xe_isset = function () { var a = Array.prototype.slice.call(arguments), b = void 0 !== a[0] && null !== a[0] ? !0 : !1; void 0 !== a[1] && null !== a[1] && "string" === typeof a[1] && (b = !0 === b && typeof a[0] === String(a[1]) ? !0 : !1); return b }; c.xe_whref = c.location.href; c.xe_urlp = []; xe_whref.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (a, b, d) { xe_urlp[b] = d }); var l = []; c.xe_loadModule = function () { n(arguments) }; c.xe_loadExtension = function () { n(arguments) }; c.xe_include = function () { n(arguments) }; c.btoa = c.btoa || function (a) { for (var b = String(a), d, c, g = 0, f = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", e = ""; b.charAt(g | 0) || (f = "=", g % 1); e += f.charAt(63 & d >> 8 - g % 1 * 8)) { c = b.charCodeAt(g += .75); if (255 < c) return a; d = d << 8 | c } return e }; c.atob = c.atob || function (a) { var b = String(a).replace(/[=]+$/, ""); if (1 == b.length % 4) return a; a = 0; for (var c, e, g = 0, f = ""; e = b.charAt(g++); ~e && (c = a % 4 ? 64 * c + e : e, a++ % 4) ? f += String.fromCharCode(255 & c >> (-2 * a & 6)) : 0) e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(e); return f }; c.xe_b64encoded = function () { var a = Array.prototype.slice.call(arguments); var r = /^(?:[A-Z0-9+\/]{4})*(?:[A-Z0-9+\/]{2}==|[A-Z0-9+\/]{3}=|[A-Z0-9+\/]{4})$/i; return xe_isset(a[0], "string") && a[0].toLowerCase() != 'true' ? r.test(a[0]) || r.test(a[0]+'=') || r.test(a[0]+'==') ? !0 : !1 : !1 }; c.xe_createCookie = function () { var a = Array.prototype.slice.call(arguments),t=1; xe_isset(a[0], "boolean") && (t = a[0], a.splice(a, 1)); if (!xe_isset(a[0], "string") || !xe_isset(a[2], "number")) return !1; var b = new Date; b.setTime(b.getTime() + 864E5 * parseInt(a[2])); b = b.toUTCString(); a[1] = "object" === typeof a[1] ? JSON.stringify(a[1]) : a[1]; c.document.cookie = a[0] + "=" + ((t) ? c.btoa(a[1]) : String(a[1])) + ";expires=" + b + ((typeof xe_config == "object") ? ";domain=" + xe_config.DOMAIN : "") + ";path=/; SameSite=None; Secure"; return xe_isset(a[3]) && "object" === typeof xe_core && xe_core.requireExtension("datatunnel.js") ? xe_core.callService("dataTunnel", "set_cookie", a[0] + "|" + a[1] + "|" + a[2], a[3]) : !0 }; c.xe_readCookie = function () { var a = Array.prototype.slice.call(arguments),t=1; xe_isset(a[0], "boolean") && (t = a[0], a.splice(a, 1)); if (!xe_isset(a[0], "string")) return !1; for (var b = "", d, e = a[0] + "=", g = c.document.cookie.split(";"), f = g.length, h = 0; h < f; h++) if (d = g[h].trim(), 0 == d.indexOf(e)) { b = d.substring(e.length, d.length); break }(d = xe_isset(a[1]) ? !0 : !1) && "object" === typeof xe_core && xe_core.requireExtension("datatunnel.js") && xe_core.callService("dataTunnel", "get_cookie", a[0], a[1]); return "" == b ? d ? !0 : "" : (xe_b64encoded(b) && t) ? c.atob(b) : b }; c.xe_deleteCookie = function () { var a = Array.prototype.slice.call(arguments); if (!xe_isset(a[0], "string")) return !1; c.document.cookie = a[0] + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"; return xe_isset(a[1]) && "object" === typeof xe_core && xe_core.requireExtension("datatunnel.js") ? xe_core.callService("dataTunnel", "del_cookie", a[0], a[1]) : !0 }; c.xe_setLS = function () { var e=Array.prototype.slice.call(arguments),t=!0;if(xe_isset(e[0],"boolean")&&(t=e[0],e.splice(0,1)),!xe_isset(e[0],"string")||!xe_isset(e[2],"number"))return!1; var r=new Date;r.setDate(r.getDate()+e[2]);var i=e[1];t&&(i={value:e[1],expires:r.getTime()},i=window.btoa(JSON.stringify(i))),localStorage.setItem(e[0],i),xe_deleteCookie(e[0]); }; c.xe_getLS = function () { var e=Array.prototype.slice.call(arguments),t=!0;if(xe_isset(e[0],"boolean")&&(t=e[0],e.splice(0,1)),!xe_isset(e[0],"string"))return!1; var r=localStorage.getItem(e[0]);if(null===r)return"";if(t){if((r=JSON.parse(window.atob(r)))&&r.expires&&r.expires>new Date().getTime())return r.value;r=!1,xe_deleteLS(e[0])}return r }; c.xe_deleteLS = function () { var e=Array.prototype.slice.call(arguments); return!!xe_isset(e[0],"string")&&localStorage.removeItem(e[0]) }; c.xe_core = {}; //xe_core.cookieConsent = ''; xe_core.vm = xe_isset(xe_urlp.xe_vm) ? !0 : !1; xe_core.vm ? (xe_core.vm = xe_urlp.xe_vm, xe_isset(xe_core[xe_core.vm]) ? console.error("Invalid enviroment mode: " + xe_urlp.xe_env) : "false" === xe_core.vm.toLowerCase() ? (xe_core.vm = xe_readCookie("xe_vm"), "" != xe_core.vm && (xe_deleteCookie("xe_vm"), xe_deleteCookie("xe_vl"), delete xe_core[xe_core.vm], xe_core.vm = !1)) : (xe_core[xe_core.vm] = !0, xe_createCookie("xe_vm", xe_core.vm, 1))) : (xe_core.vm = xe_readCookie("xe_vm"), "" != xe_core.vm ? xe_core[xe_core.vm] = !0 : xe_core.vm = !1); xe_core.level = !1 !== xe_core.vm && xe_isset(xe_urlp.level) ? parseInt(xe_urlp.level) : -1; 0 < xe_core.level ? xe_createCookie("xe_vl", xe_core.level, 1) : 0 == xe_core.level ? xe_deleteCookie("xe_vl") : xe_core.vm ? (xe_core.level = xe_readCookie("xe_vl"), xe_core.level = "" == xe_core.level || isNaN(xe_core.level) ? 0 : parseInt(xe_core.level)) : xe_core.level = 0; xe_core.domready = xe_domready; c.xe_basicXMLHttpRequest = function () { function a(a) { var b = [], c; for (c in a) a[c] && "function" != typeof a[c] && "object" != typeof a[c] && (b[c] = a[c]); return b } var b = Array.prototype.slice.call(arguments); if (!xe_isset(b[0], "string") || !xe_isset(b[1], "string") || !xe_isset(b[2], "boolean")) return !1; var d = c.XDomainRequest ? new XDomainRequest : new XMLHttpRequest; d.open(b[0].toUpperCase(), b[1], b[2]); d.onload = xe_isset(b[3], "function") && b[3].call ? function () { c.XDomainRequest && (d.status = 200); b[3].apply(this, [a(d)]) } : function () {}; d.onerror = xe_isset(b[4], "function") && b[4].call ? function () { c.XDomainRequest && (d.status = 500); b[4].apply(this, [a(d)]) } : null; c.XDomainRequest || (d.onreadystatechange = xe_isset(b[5], "function") && b[5].call ? function () { b[5].apply(this, [a(d)]) } : null); d.onprogress = xe_isset(b[6], "function") && b[6].call ? function () { c.XDomainRequest && (d.status = 0); b[6].apply(this, [a(d)]) } : function () {}; d.ontimeout = xe_isset(b[7], "function") && b[7].call ? function () { c.XDomainRequest && (d.status = 504); b[7].apply(this, [a(d)]) } : null; d.send(); return !0 }; c.xe_dataTunnel = { ready: !1, namespace: "xe_xdmdt_", layer: null, insertLayer: function () { c.document.body.appendChild(xe_dataTunnel.layer); null === c.document.querySelector("#" + xe_dataTunnel.layer.id) ? console.error("XEngine - Failed to create the Data Tunnel.") : c.addEventListener("message", xe_dataTunnel.listenner, !1) }, createLayer: function () { xe_dataTunnel.layer = c.document.createElement("iframe"); xe_dataTunnel.layer.id = xe_dataTunnel.namespace + String(+new Date); xe_dataTunnel.layer.title = "XEngine Cross Domain Data Tunnel"; xe_dataTunnel.layer.style.display = "none"; xe_dataTunnel.layer.style.width = "0px"; xe_dataTunnel.layer.onload = function () { xe_dataTunnel.ready = !0 }; xe_dataTunnel.layer.src = "//api.sunset.systems/services/?type=dtnl"; "undefined" === c.document.body || null == c.document.body ? c.document.addEventListener("DOMContentLoaded", function () { xe_dataTunnel.insertLayer() }) : xe_dataTunnel.insertLayer() }, translateMsg: function (a) { var b = { action: "", data: "null", id: "" }; a = "string" === typeof a && "" != a && "{" == a[0] ? a : !1; !1 !== a && (b = JSON.parse(a)); return b }, listenner: function (a) { if (-1 < a.origin.indexOf("sunset.systems") && (a = xe_dataTunnel.translateMsg(a.data), "" != a.action)) { switch (a.action) { case "callback": var b = a.data; break; case "set_cookie": var d = a.data; d = d.split("|"); 3 == d.length && (xe_createCookie(String(d[0]), String(d[1]), parseInt(d[2])), b = String(d[1])) } null != b && (d = c["xe-cb_" + a.id], "function" === typeof d && (d(b), delete c["xe-cb_" + a.id])) } } }; //Performa.AI c.pfm_dataTunnel = { ready: !1, namespace: "pfm_xdmdt_", layer: null, insertLayer: function () { c.document.body.appendChild(pfm_dataTunnel.layer); null === c.document.querySelector("#" + pfm_dataTunnel.layer.id) ? console.error("Performa.AI - Failed to create the Data Tunnel.") : c.addEventListener("message", pfm_dataTunnel.listenner, !1) }, createLayer: function () { if (pfm_dataTunnel.ready) return false; pfm_dataTunnel.layer = c.document.createElement("iframe"); pfm_dataTunnel.layer.id = pfm_dataTunnel.namespace + String(+new Date); pfm_dataTunnel.layer.title = "XEngine Cross Domain Data Tunnel - Performa.AI"; pfm_dataTunnel.layer.style.display = "none"; pfm_dataTunnel.layer.style.width = "0px"; pfm_dataTunnel.layer.onload = function () { pfm_dataTunnel.ready = !0 }; pfm_dataTunnel.layer.src = "//" + ((xe_core.vm == "stage" && xe_core.level == 4) ? "stage" : "api") + ".performa.ai/v1/?type=datatunnel"; "undefined" === c.document.body || null == c.document.body ? c.document.addEventListener("DOMContentLoaded", function () { pfm_dataTunnel.insertLayer() }) : pfm_dataTunnel.insertLayer() }, translateMsg: function (a) { var b = { action: "", data: "null", id: "" }; a = "string" === typeof a && "" != a && "{" == a[0] ? a : !1; !1 !== a && (b = JSON.parse(a)); return b }, listenner: function (a) { if (-1 < a.origin.indexOf("performa.ai") && (a = pfm_dataTunnel.translateMsg(a.data), "" != a.action)) { switch (a.action) { case "callback": var b = a.data; break; case "set_cookie": var d = a.data; d = d.split("|"); 3 == d.length && (xe_createCookie(String(d[0]), String(d[1]), parseInt(d[2])), b = String(d[1])) } null != b && (d = c["xe-cb_" + a.id], "function" === typeof d && (d(b), delete c["xe-cb_" + a.id])) } } }; // xe_dataTunnel.createLayer(); c.xe_config = { GUID: "", KEY: "", DOMAIN: "", path: xe_core.vm ? "//vm.conectiva.io/XEngine" : "//conectiva.io/XEngine" }; var k = "-1", h = c.document.getElementById("xengine") || !1; !1 !== h && (k = h.getAttribute("src"), k = "undefined" === typeof k ? k : ((k && "string" === typeof k && k.length > 0 && k.indexOf("key=") > -1) ? k.split("key=")[1] : "-1")); h = xe_readCookie("xe_config"); if ("" == h) { var e = c.location.hostname.toLowerCase(); xe_basicXMLHttpRequest("GET", "//conectiva.io/XEngine/services/?type=domain_inf&inf=DKEY+DGUID+DOMAIN&ref=" + c.btoa(e) + "&v=1.2", !0, function (a) { 200 === a.status && (e = a.responseText, "" != e && -1 == e.indexOf("failed") && (e = JSON.parse(a.responseText), xe_config.KEY = e.KEY, xe_config.GUID = e.GUID, xe_config.DOMAIN = e.DOMAIN, xe_createCookie("xe_config", e.KEY + "," + e.GUID + "," + e.DOMAIN, 1))); p(k) }) } else xe_config.KEY = h.split(",")[0], xe_config.GUID = h.split(",")[1], xe_config.DOMAIN = h.split(",")[2], p(k) } })(window);