(function (document, window) { var tests = [ function () { // WebSockets return "WebSocket" in window && window.WebSocket.CLOSING === 2; }, function () { // Promises return ( "Promise" in window && "resolve" in window.Promise && "reject" in window.Promise && "all" in window.Promise && "race" in window.Promise && (function () { var resolve; new window.Promise(function (r) { resolve = r; }); return typeof resolve === "function"; })() ); }, function () { // querySelector return "querySelector" in document && "querySelectorAll" in document; }, function () { // JSON return "JSON" in window && "parse" in JSON && "stringify" in JSON; }, function () { // history return window.history && "pushState" in window.history; }, function () { // atob - btoa return "atob" in window && "btoa" in window; }, function () { // localStorage try { localStorage.setItem("test", "test"); localStorage.removeItem("test"); return true; } catch (e) { return false; } }, ]; var checks = []; for (var i = 0; i < tests.length; i++) { checks.push(tests[i]()); } if (checks.indexOf(false) !== -1) { alert("Please update your browser. Essential features not supported by your browser, and the functionality of the webpage is not guaranteed."); } })(document, window);var __Translator = (function(GLOBAL_DATA) { var languageCode = GLOBAL_DATA.LANG.CODE; var languageTranslations = GLOBAL_DATA.LANG.TRANSLATIONS; return { Translate: function(key) { var _this = this; var ret = String(key).trim(); if (typeof languageTranslations[key] !== 'undefined' && String(languageTranslations[key]).trim() != "") { ret = languageTranslations[key]; } return ret; }, }; })(GLOBAL_DATA);var __AjaxManager = (function (window, StrongCustomerAuthentication, StrongCustomerAuthenticationApp) { var pendingAjax = {}; function Insert(name, xhrObject) { if (typeof xhrObject.abort === "function") { pendingAjax[name] = xhrObject; } } function Remove(name) { delete pendingAjax[name]; } function SerializeURL(obj, prefix) { var str = [], p; for (p in obj) { if (obj.hasOwnProperty(p)) { var k = prefix ? prefix + "[" + p + "]" : p, v = obj[p]; str.push(v !== null && typeof v === "object" ? SerializeURL(v, k) : encodeURIComponent(k) + "=" + encodeURIComponent(v)); } } return str.join("&"); } function msgpackDecode(string) { try { var ishex = string.search(/\[.*\]/) < 0; var array = ishex ? hexToBuffer(string) : arrayToBuffer(string); var buffer = new Uint8Array(array); var data = msgpack.decode(buffer); return data; } catch (e) { console.log(e); } } function hexToBuffer(string) { return string .split(/\s+/) .filter(function (chr) { return chr !== ""; }) .map(function (chr) { return parseInt(chr, 16); }); } function arrayToBuffer(string) { return JSON.parse(string); } window.addEventListener("beforeunload", function (e) { try { __AjaxManager.CancelPending(); } catch (err) { console.log(err); } }); return { MakeRequest: function (opts) { return new window.Promise(function (resolve, reject) { var transportMethod = typeof window.GLOBAL_DATA.TRANSPORT_PROTOCOL === "undefined" ? "JSON" : window.GLOBAL_DATA.TRANSPORT_PROTOCOL; var xhr = new window.XMLHttpRequest(); switch (transportMethod) { case "MSG_PACK": xhr.responseType = "text"; break; case "JSON": default: xhr.responseType = "json"; break; } if (opts.responseType) { xhr.responseType = opts.responseType; } var query = opts.query; if (query && typeof query === "object") { query = Object.keys(query) .map(function (key) { return window.encodeURIComponent(key) + "=" + window.encodeURIComponent(query[key]); }) .join("&"); opts.url = opts.url + "?" + query; } xhr.open(opts.method, opts.url); xhr.onload = function () { if (xhr.status >= 200 && xhr.status < 300) { var retResp = xhr.response; switch (transportMethod) { case "MSG_PACK": retResp = msgpackDecode(retResp); break; } if (typeof retResp.ERR !== "undefined" && retResp.ERR != null && retResp.ERR === true && typeof retResp.RESP !== "undefined" && typeof retResp.RESP["__sca__"] !== "undefined") { switch (true) { case StrongCustomerAuthenticationApp !== null: StrongCustomerAuthenticationApp.postMessage(retResp.RESP["__sca__"]); window.addEventListener( "sca-app-response", function (retRespCheck) { resolve(retRespCheck.detail); }, false ); break; case StrongCustomerAuthentication !== null: StrongCustomerAuthentication.Check(retResp.RESP["__sca__"], function (retRespCheck) { resolve(retRespCheck); }); break; default: resolve(retResp); break; } } else { resolve(retResp); } } else { reject({ status: xhr.status, statusText: xhr.statusText, }); } }; xhr.onerror = function () { reject({ status: xhr.status, statusText: xhr.statusText, }); }; var headers = { Accept: "application/json; application/x-msgpack; charset=utf-8", "Content-Type": null, }; switch (transportMethod) { case "MSG_PACK": headers.Accept = "text/plain"; break; case "JSON": default: headers.Accept = "application/json; application/x-msgpack; charset=utf-8"; break; } if (opts.method == "POST") { headers["Content-Type"] = "application/x-www-form-urlencoded; charset=utf-8"; } if (opts.headers) { Object.keys(opts.headers).forEach(function (key) { headers[key] = opts.headers[key]; }); } Object.keys(headers).forEach(function (key) { if (headers[key] !== null && String(headers[key]).trim() != "") { xhr.setRequestHeader(key, headers[key]); } }); var params = null; if (opts.params) { switch (true) { case opts.params instanceof FormData: params = opts.params; break; case typeof opts.params === "object": params = SerializeURL(opts.params); break; } } xhr.send(params); }); }, MakeBackgroundRequest: function (name, opts, callback) { var xhr = new window.XMLHttpRequest(); Insert(name, xhr); xhr.responseType = "json"; if (opts.responseType) { xhr.responseType = opts.responseType; } var query = opts.query; if (query && typeof query === "object") { query = Object.keys(query) .map(function (key) { return window.encodeURIComponent(key) + "=" + window.encodeURIComponent(query[key]); }) .join("&"); opts.url = opts.url + "?" + query; } xhr.open(opts.method, opts.url); xhr.onload = function () { if (xhr.status >= 200 && xhr.status < 300) { Remove(name); if (typeof callback == "function") { return callback(xhr.response); } } else { Remove(name); if (typeof callback == "function") { return callback(null); } } }; xhr.onerror = function () { Remove(name); if (typeof callback == "function") { return callback(null); } }; var headers = { Accept: "application/json; charset=utf-8", "Content-Type": null, }; if (opts.method == "POST") { headers["Content-Type"] = "application/x-www-form-urlencoded; charset=utf-8"; } if (opts.headers) { Object.keys(opts.headers).forEach(function (key) { headers[key] = opts.headers[key]; }); } Object.keys(headers).forEach(function (key) { if (headers[key] !== null && String(headers[key]).trim() != "") { xhr.setRequestHeader(key, headers[key]); } }); var params = null; if (opts.params) { switch (true) { case opts.params instanceof FormData: params = opts.params; break; case typeof opts.params === "object": params = SerializeURL(opts.params); break; } } xhr.send(params); }, CancelPending: function () { for (var k in pendingAjax) { pendingAjax[k].abort(); Remove(k); } }, }; })(window, typeof StrongCustomerAuthentication !== "undefined" ? StrongCustomerAuthentication : null, typeof StrongCustomerAuthenticationApp !== "undefined" ? StrongCustomerAuthenticationApp : null); var __WebSocketManager = (function (window) { var _socket = null; var _callbacks = {}; var _reconnectTimeoutId = null; var _supportsWebSockets = "WebSocket" in window && window.WebSocket.CLOSING === 2; function uuidv4() { return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) { var r = (Math.random() * 16) | 0, v = c == "x" ? r : (r & 0x3) | 0x8; return v.toString(16); }); } function waitForSocketConnection(cb) { setTimeout(function () { if (_socket !== null && _socket.readyState === 1) { if (cb != null) { cb(); } } else { waitForSocketConnection(cb); } }, 5); } return { socket: function () { return _socket; }, init: function (url) { return new Promise(function (resolve, reject) { if (!_supportsWebSockets) { return reject("Websockets not supported"); } if (_socket instanceof window.WebSocket) { resolve(true); } clearTimeout(_reconnectTimeoutId); _socket = new window.WebSocket(url, ["json"]); _socket.addEventListener("close", function (event) { _socket = null; _reconnectTimeoutId = setTimeout(function () { __WebSocketManager.init(url); }, 1000); }); _socket.addEventListener("message", function (event) { var data = JSON.parse(event.data); if (typeof data.a === "undefined") { return; } switch (data.a) { case "ping": _socket.send(JSON.stringify({ a: "pong" })); _socket.send(JSON.stringify({ a: "client_info", data: { path: window.location.href, user_agent: navigator.userAgent } })); break; } if (typeof data.rmid !== "undefined" && typeof _callbacks[data.rmid] === "function") { _callbacks[data.rmid](data.data); delete _callbacks[data.rmid]; } }); waitForSocketConnection(function () { resolve(true); }); }); }, send: function (obj, cb) { if (typeof cb === "function") { obj.mid = uuidv4(); _callbacks[obj.mid] = cb; } waitForSocketConnection(function () { _socket.send(JSON.stringify(obj)); }); }, }; })(window); var __Router = (function () { var _state = { currentRoute: null, url: null, fullUrl: null, hash: null, params: {}, query: {}, history: [], }; var routes = []; var listener = null; function checkRoute() { var hash = window.location.hash.substring(2).replace(/\//gi, "/"); var route = routes[0]; var qp = null; for (var routeIndex = 1; routeIndex < routes.length; routeIndex++) { var routeToTest = routes[routeIndex]; var pathToTest = routeToTest.url; var patternToTest = pathToTest.split("?")[0].replace(/{([^}]+)}/g, "([^/]+)"); var check1 = hash.match(new RegExp("^" + patternToTest)); var check2 = patternToTest.charAt(patternToTest.length - 1) === "/" && hash.match(new RegExp("^" + patternToTest.slice(0, -1))); var check3 = String(hash) === pathToTest; var check4 = patternToTest.charAt(patternToTest.length - 1) === "/" && String(hash) === pathToTest.slice(0, -1); if (check1 || check2 || check3 || check4) { if (pathToTest.match(/{([^}]+)}/g)) { qp = getParameters(pathToTest, hash); } route = routeToTest; break; } } var _currentState = _state; _state.currentRoute = route; _state.url = window.location.href.substring(0, window.location.href.indexOf("#")); _state.fullUrl = window.location.href; _state.hash = hash.split("?")[0].charAt(hash.split("?")[0].length - 1) === "/" ? "#/" + hash.split("?")[0] : "#/" + hash.split("?")[0] + "/"; if (qp !== null) { _state.params = qp.params; _state.query = qp.query; } _state.history.push(_state.fullUrl); if (typeof route !== "undefined" && typeof route.callback === "function") { route.callback.call(window, qp); } } function extractSearch(search) { var result = {}; search = search || window.location.search; if (search.length) { search = search.substring(1).split("&"); for (var i = 0; i < search.length; i++) { search[i] = search[i].split(/=(.*)/g, 2); result[decodeURIComponent(search[i][0])] = decodeURIComponent(search[i][1]); } } return result; } function extractFromPath(pattern, url) { var keys = [], result = {}; url = url || window.location.pathname; pattern = pattern.replace(/{([^}]+)}/g, function ($0, $1) { keys.push($1); return "([^/]+)"; }); pattern = url.match(new RegExp("^" + pattern)); if (pattern !== null) { for (var i = 0; i < keys.length; i++) { result[keys[i]] = pattern[i + 1]; } } return result; } function getParameters(pattern, path) { var result = { query: {}, params: {} }; path = path.split("?"); pattern = pattern.split("?"); if (pattern[0].match(/{([^}]+)}/g)) { result.params = extractFromPath(pattern[0], path[0]); } if (path[1] !== void 0) { var tmp = extractSearch("?" + path[1]); for (var param in tmp) { result.query[param] = tmp[param]; } } return result; } function updateQueryStringParameter(url, param, paramVal) { var TheAnchor = null; var newAdditionalURL = ""; var tempArray = url.split("?"); var baseURL = tempArray[0]; var additionalURL = tempArray[1]; var temp = ""; if (additionalURL) { var tmpAnchor = additionalURL.split("#"); var TheParams = tmpAnchor[0]; TheAnchor = tmpAnchor[1]; if (TheAnchor) additionalURL = TheParams; tempArray = additionalURL.split("&"); for (var i = 0; i < tempArray.length; i++) { if (tempArray[i].split("=")[0] != param) { newAdditionalURL += temp + tempArray[i]; temp = "&"; } } } else { var tmpAnchor = baseURL.split("#"); var TheParams = tmpAnchor[0]; TheAnchor = tmpAnchor[1]; if (TheParams) baseURL = TheParams; } var rows_txt = temp + "" + param + "=" + paramVal; return baseURL + "?" + newAdditionalURL + rows_txt; } function removeEmptyQueryStringParameter(url) { var newURL = ""; var tempArray = url.split("?"); var baseURL = tempArray[0]; var additionalURL = tempArray[1]; if (additionalURL) { tempArray = additionalURL.split("&"); var newTempArr = []; for (var i = 0; i < tempArray.length; i++) { var q = tempArray[i].split(/=(.*)/g, 2); if (String(q[1]).trim() === "") { continue; } newTempArr.push(q[0] + "=" + String(q[1]).trim()); } if (newTempArr.length > 0) { newURL = baseURL + "?" + newTempArr.join("&"); } else { newURL = baseURL; } } else { newURL = baseURL; } return newURL; } return { state: function () { return _state; }, init: function () { if (listener !== null) { window.removeEventListener("popstate", listener); listener = null; } listener = window.addEventListener( "popstate", function () { checkRoute.call(this); }.bind(this) ); setTimeout( function () { checkRoute.call(this); }.bind(this), 0 ); return this; }, addRoute: function (name, alias, url, cb) { var route = routes.find(function (r) { return r.name === name; }); url = url.replace(/\//gi, "/"); if (route === void 0) { routes.push({ callback: cb, name: name.toString().toLowerCase(), alias: alias.toString().toLowerCase(), url: url, }); } else { route.callback = cb; route.url = url; } return this; }, addRoutes: function (routes) { var _this = this; if (routes === void 0) { routes = []; } routes.forEach(function (route) { if (typeof route.alias === "undefined") { route.alias = route.name; } _this.addRoute(route.name, route.alias, route.url, route.callback); }); return this; }, removeRoute: function (name) { name = name.toString().toLowerCase(); routes = routes.filter(function (route) { return route.name != name; }); return this; }, updateQueryStringParameter: function (defaultHash, paramsObj) { var tmpCurrentHash = window.location.hash.split("?"); var currentHash = tmpCurrentHash[1] !== void 0 ? defaultHash + "?" + tmpCurrentHash[1] : defaultHash; var newHash = currentHash; if (paramsObj !== null) { for (var param in paramsObj) { if (Object.hasOwnProperty.call(paramsObj, param)) { var value = String(paramsObj[param]).trim(); newHash = removeEmptyQueryStringParameter(updateQueryStringParameter(newHash, param, value)); } } } else { newHash = defaultHash; } var baseUrl = window.location.href.substring(0, window.location.href.indexOf("#")); if (_state.url !== null) { baseUrl = _state.url; } return baseUrl + newHash; }, windowRefresh: function () { var baseFullUrl = window.location.href; if (_state.fullUrl !== null) { baseFullUrl = _state.fullUrl; } window.location = baseFullUrl; }, windowReload: function () { window.location.reload(); }, goBack: function () { var lastUrl = _state.url; _state.history.pop(); if (_state.history.length > 0) { lastUrl = _state.history[_state.history.length - 1]; _state.history.pop(); } window.location = lastUrl; }, }; })(); var __Utils = (function (moment) { return { is: { String: function (value) { return typeof value === "string" || value instanceof String; }, Number: function (value) { return typeof value === "number" && isFinite(value); }, Array: function (value) { return value && typeof value === "object" && value.constructor === Array; }, Function: function (value) { return typeof value === "function"; }, Object: function (value) { return value && typeof value === "object" && value.constructor === Object; }, Null: function (value) { return value === null; }, Undefined: function (value) { return typeof value === "undefined"; }, Boolean: function (value) { return typeof value === "boolean"; }, RegExp: function (value) { return value && typeof value === "object" && value.constructor === RegExp; }, Error: function (value) { return value instanceof Error && typeof value.message !== "undefined"; }, Date: function (value) { return value instanceof Date; }, Symbol: function (value) { return typeof value === "symbol"; }, HtmlElement: function (value) { return value instanceof Element || value instanceof Document; }, ValidJSON: function (value) { try { JSON.parse(value); } catch (e) { return false; } return true; }, Promise: function (value) { if (value !== null && typeof value === "object" && typeof value.then === "function" && typeof value.catch === "function") { return true; } return false; }, }, Forms: { serializeForm: function (form) { var obj = {}; var formData = new FormData(form); for (var key of formData.keys()) { obj[key] = formData.get(key); } return obj; }, validateInput: function (data) { var retVal = null; if (typeof data.value === "undefined" || data.value === null) { return retVal; } if (typeof data.validation === "undefined" || data.validation === null) { return retVal; } if (typeof data.validation.type === "undefined" || data.validation.type === "") { return retVal; } if (typeof data.validation.value === "undefined" || data.validation.value === null) { return retVal; } if (data.validation.type.charAt(0) === "_") { if (String(data.value).trim() === "") { retVal = true; return retVal; } else { data.validation.type = data.validation.type.substring(1); } } switch (data.validation.type) { case "enum": if (String(data.value).trim() === "") { return retVal; } retVal = data.validation.value.indexOf(data.value) !== -1 ? true : false; break; case "regex": if (String(data.value).trim() === "") { return retVal; } retVal = new RegExp(data.validation.value).test(data.value) ? true : false; break; case "array": retVal = Array.isArray(data.value); break; case "*": if (String(data.value).trim() === "") { return retVal; } retVal = true; break; } return retVal; }, getBase64File: function (file) { return new Promise(function (resolve, reject) { var ret = { filename: file.name, data: "", type: file.type, }; var reader = new FileReader(); reader.readAsDataURL(file); reader.onload = function () { ret.data = reader.result; resolve(ret); }; reader.onerror = function (error) { reject(error); }; }); }, }, Dates: { toUnixTimestamp: function (date) { return date instanceof Date ? Math.floor(date.getTime()) / 1000 : null; }, formatSeconds: function (secs, format) { var ret = ""; var minutes = Math.floor(secs / 60); secs = secs % 60; var hours = Math.floor(minutes / 60); minutes = minutes % 60; function padding(num) { return ("0" + num).slice(-2); } switch (format) { case "mmss": ret = padding(minutes) + ":" + padding(secs); break; case "hhmmss": ret = padding(hours) + ":" + padding(minutes) + ":" + padding(secs); break; } return ret; }, formatDate: function (datestring, in_format, out_format) { return new moment(datestring, in_format).format(out_format); }, formatDateFromUnixTimestamp: function (unix_timestamp, out_format) { return new moment(unix_timestamp * 1000).format(out_format); }, convertDateFromUnixTimestamp: function (unix_timestamp, out_format, language_code, timezone) { return new moment(unix_timestamp * 1000).locale(language_code).tz(timezone).format(out_format); }, getRange: { day: function (timezone) { return { start: parseInt(new moment().tz(timezone).startOf("day").format("X")), end: parseInt(new moment().tz(timezone).endOf("day").format("X")), }; }, range: function (unix_timestamp_from, unix_timestamp_to, timezone) { return { start: parseInt(new moment(unix_timestamp_from * 1000).tz(timezone).startOf("day").format("X")), end: parseInt(new moment(unix_timestamp_to * 1000).tz(timezone).endOf("day").format("X")), }; }, }, }, Strings: { capitalize: function (s) { if (typeof s !== "string") return ""; return s.charAt(0).toUpperCase() + s.slice(1); }, titleCase: function (s) { s = s.toLowerCase().split(" "); for (var i = 0; i < s.length; i++) { s[i] = s[i].charAt(0).toUpperCase() + s[i].slice(1); } return s.join(" "); }, truncate: function (s, maxLength = 50) { return s.length > maxLength ? `${s.substring(0, maxLength)}…` : s; }, base64Encode: function (str) { return Base64.encode(str); }, base64Decode: function (str) { return Base64.decode(str); }, }, Numbers: { FormatMoney: function (amount, currencyObj = null, decPlaces = 2, decSep = ",", thouSep = ".") { if (amount === null) { return; } var currencyObject = currencyObj === null || typeof currencyObj.unicode_decimal === "undefined" || typeof currencyObj.place === "undefined" ? null : currencyObj; (decPlaces = isNaN((decPlaces = Math.abs(decPlaces))) ? 2 : decPlaces), (decSep = typeof decSep === "undefined" ? "." : decSep); thouSep = typeof thouSep === "undefined" ? "," : thouSep; var sign = amount < 0 ? "-" : ""; amount = Math.abs(Number(amount) || 0).toFixed(decPlaces); var currencySymbol = ""; if (currencyObj !== null) { if (typeof currencyObj.code !== "undefined" && currencyObj.code !== null) { currencySymbol = currencyObj.code; } if (typeof currencyObj.unicode_decimal !== "undefined" && currencyObj.unicode_decimal !== null) { var currencySymbol = ""; var unicode_decimal_split = currencyObj.unicode_decimal.split(","); for (var i in unicode_decimal_split) { currencySymbol += "&#" + unicode_decimal_split[i] + ";" } //currencySymbol = "&#" + currencyObj.unicode_decimal + ";"; } } var amountChunks = amount.match(/^(\d+)((?:\.\d+)?)$/); var ret = sign + amountChunks[1].replace(/(\d)(?=(?:\d{3})+$)/g, "$1" + thouSep) + decSep + amountChunks[2].substring(1); if (currencyObj !== null) { if (currencyObject.place === "start") { ret = currencySymbol +' '+ ret; } if (currencyObject.place === "end") { ret = ret + ' ' + currencySymbol; } } return ret; }, countDecimals: function (value, limit) { if (Math.floor(value) === value) return 0; return (value.toString().split(".")[1].length > limit ? limit : value.toString().split(".")[1].length) || 0; }, getRandomInt: function (min, max) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min + 1)) + min; }, DecimalPadding: function (value, decPlaces = 2) { return (Math.round(value * Math.pow(10, decPlaces)) / Math.pow(10, decPlaces)).toFixed(decPlaces); }, IntegerPadding: function (value, places = 2) { var zero = places - value.toString().length + 1; return Array(+(zero > 0 && zero)).join("0") + value; }, }, Http: { windowReload: function () { window.location = window.location.href.substring(0, window.location.href.indexOf("#")); }, urlQueryParameter: function (name, url) { if (!url) url = window.location.href; name = name.replace(/[\[\]]/g, "\\$&"); var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), results = regex.exec(url); if (!results) return null; if (!results[2]) return ""; return decodeURIComponent(results[2].replace(/\+/g, " ")); }, updateQueryStringParameter: function (url, param, paramVal) { var TheAnchor = null; var newAdditionalURL = ""; var tempArray = url.split("?"); var baseURL = tempArray[0]; var additionalURL = tempArray[1]; var temp = ""; if (additionalURL) { var tmpAnchor = additionalURL.split("#"); var TheParams = tmpAnchor[0]; TheAnchor = tmpAnchor[1]; if (TheAnchor) additionalURL = TheParams; tempArray = additionalURL.split("&"); for (var i = 0; i < tempArray.length; i++) { if (tempArray[i].split("=")[0] != param) { newAdditionalURL += temp + tempArray[i]; temp = "&"; } } } else { var tmpAnchor = baseURL.split("#"); var TheParams = tmpAnchor[0]; TheAnchor = tmpAnchor[1]; if (TheParams) baseURL = TheParams; } var rows_txt = temp + "" + param + "=" + paramVal; return baseURL + "?" + newAdditionalURL + rows_txt; }, removeEmptyQueryStringParameter: function (url) { var newURL = ""; var tempArray = url.split("?"); var baseURL = tempArray[0]; var additionalURL = tempArray[1]; if (additionalURL) { tempArray = additionalURL.split("&"); var newTempArr = []; for (var i = 0; i < tempArray.length; i++) { var q = tempArray[i].split(/=(.*)/g, 2); if (String(q[1]).trim() === "") { continue; } newTempArr.push(q[0] + "=" + String(q[1]).trim()); } if (newTempArr.length > 0) { newURL = baseURL + "?" + newTempArr.join("&"); } else { newURL = baseURL; } } else { newURL = baseURL; } return newURL; }, }, Html: { getScroll: function () { var winHeight = window.innerHeight || (document.documentElement || document.body).clientHeight; var docHeight = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight); var scrollTop = window.pageYOffset || (document.documentElement || document.body.parentNode || document.body).scrollTop; var trackYLength = docHeight - winHeight; var pctYScrolled = Math.floor((scrollTop / trackYLength) * 100); var winWidth = window.innerWidth || (document.documentElement || document.body).clientWidth; var docWidth = Math.max(document.body.scrollWidth, document.documentElement.scrollWidth, document.body.offsetWidth, document.documentElement.offsetWidth, document.body.clientHeight, document.documentElement.clientHeight); var scrollLeft = window.pageXOffset || (document.documentElement || document.body.parentNode || document.body).scrollLeft; var trackXLength = docWidth - winWidth; var pctXScrolled = Math.floor((scrollLeft / trackXLength) * 100); return { pixels: { y: scrollTop, x: scrollLeft, }, percentage: { y: pctYScrolled, x: pctXScrolled, }, }; }, getBreakpoint: function () { return window.getComputedStyle(document.body, ":before").content.replace(/\"/g, ""); }, }, Objects: { getDataFromObjectByPath(obj, routeArr) { var currentDataSet = obj; for (var index = 0; index < routeArr.length; index++) { if (typeof currentDataSet[routeArr[index]] === "undefined") { currentDataSet = null; break; } currentDataSet = currentDataSet[routeArr[index]]; } return currentDataSet; }, }, replaceArray: function (replaceString, find, replace) { var regex; for (var i = 0; i < find.length; i++) { var text = String(find[i]).replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); regex = new RegExp(text, "g"); replaceString = replaceString.replace(regex, String(replace[i])); } return replaceString; }, regexRange: function (from, to) { if (from < 0 || to < 0) { return; } if (from > to) { return; } var ranges = [from]; var increment = 1; var next = from; var higher = true; while (true) { next += increment; if (next + increment > to) { if (next <= to) { ranges.push(next); } increment /= 10; higher = false; } else if (next % (increment * 10) === 0) { ranges.push(next); increment = higher ? increment * 10 : increment / 10; } if (!higher && increment < 10) { break; } } ranges.push(to + 1); var regex = "^(?:"; for (var index = 0; index < ranges.length - 1; index++) { var str_from = String(ranges[index]); var str_to = String(ranges[index + 1] - 1); for (var index2 = 0; index2 < str_from.length; index2++) { if (str_from[index2] == str_to[index2]) { regex += str_from[index2]; } else { regex += "[" + str_from[index2] + "-" + str_to[index2] + "]"; } } regex += "|"; } return regex.slice(0, -1) + ")$"; }, }; })(moment); /** base64 with unicode chars * Minified by jsDelivr using Terser v5.19.2. * Original file: /npm/js-base64@3.7.7/base64.js * * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files */ !function (t, n) { var r, e; "object" == typeof exports && "undefined" != typeof module ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : (r = t.Base64, (e = n()).noConflict = function () { return t.Base64 = r, e }, t.Meteor && (Base64 = e), t.Base64 = e) }("undefined" != typeof self ? self : "undefined" != typeof window ? window : "undefined" != typeof global ? global : this, (function () { "use strict"; var t, n = "3.7.7", r = n, e = "function" == typeof Buffer, o = "function" == typeof TextDecoder ? new TextDecoder : void 0, u = "function" == typeof TextEncoder ? new TextEncoder : void 0, i = Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="), f = (t = {}, i.forEach((function (n, r) { return t[n] = r })), t), c = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/, a = String.fromCharCode.bind(String), d = "function" == typeof Uint8Array.from ? Uint8Array.from.bind(Uint8Array) : function (t) { return new Uint8Array(Array.prototype.slice.call(t, 0)) }, s = function (t) { return t.replace(/=/g, "").replace(/[+\/]/g, (function (t) { return "+" == t ? "-" : "_" })) }, l = function (t) { return t.replace(/[^A-Za-z0-9\+\/]/g, "") }, h = function (t) { for (var n, r, e, o, u = "", f = t.length % 3, c = 0; c < t.length;) { if ((r = t.charCodeAt(c++)) > 255 || (e = t.charCodeAt(c++)) > 255 || (o = t.charCodeAt(c++)) > 255) throw new TypeError("invalid character found"); u += i[(n = r << 16 | e << 8 | o) >> 18 & 63] + i[n >> 12 & 63] + i[n >> 6 & 63] + i[63 & n] } return f ? u.slice(0, f - 3) + "===".substring(f) : u }, p = "function" == typeof btoa ? function (t) { return btoa(t) } : e ? function (t) { return Buffer.from(t, "binary").toString("base64") } : h, y = e ? function (t) { return Buffer.from(t).toString("base64") } : function (t) { for (var n = [], r = 0, e = t.length; r < e; r += 4096)n.push(a.apply(null, t.subarray(r, r + 4096))); return p(n.join("")) }, A = function (t, n) { return void 0 === n && (n = !1), n ? s(y(t)) : y(t) }, b = function (t) { if (t.length < 2) return (n = t.charCodeAt(0)) < 128 ? t : n < 2048 ? a(192 | n >>> 6) + a(128 | 63 & n) : a(224 | n >>> 12 & 15) + a(128 | n >>> 6 & 63) + a(128 | 63 & n); var n = 65536 + 1024 * (t.charCodeAt(0) - 55296) + (t.charCodeAt(1) - 56320); return a(240 | n >>> 18 & 7) + a(128 | n >>> 12 & 63) + a(128 | n >>> 6 & 63) + a(128 | 63 & n) }, g = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g, B = function (t) { return t.replace(g, b) }, x = e ? function (t) { return Buffer.from(t, "utf8").toString("base64") } : u ? function (t) { return y(u.encode(t)) } : function (t) { return p(B(t)) }, C = function (t, n) { return void 0 === n && (n = !1), n ? s(x(t)) : x(t) }, m = function (t) { return C(t, !0) }, v = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g, U = function (t) { switch (t.length) { case 4: var n = ((7 & t.charCodeAt(0)) << 18 | (63 & t.charCodeAt(1)) << 12 | (63 & t.charCodeAt(2)) << 6 | 63 & t.charCodeAt(3)) - 65536; return a(55296 + (n >>> 10)) + a(56320 + (1023 & n)); case 3: return a((15 & t.charCodeAt(0)) << 12 | (63 & t.charCodeAt(1)) << 6 | 63 & t.charCodeAt(2)); default: return a((31 & t.charCodeAt(0)) << 6 | 63 & t.charCodeAt(1)) } }, F = function (t) { return t.replace(v, U) }, w = function (t) { if (t = t.replace(/\s+/g, ""), !c.test(t)) throw new TypeError("malformed base64."); t += "==".slice(2 - (3 & t.length)); for (var n, r, e, o = "", u = 0; u < t.length;)n = f[t.charAt(u++)] << 18 | f[t.charAt(u++)] << 12 | (r = f[t.charAt(u++)]) << 6 | (e = f[t.charAt(u++)]), o += 64 === r ? a(n >> 16 & 255) : 64 === e ? a(n >> 16 & 255, n >> 8 & 255) : a(n >> 16 & 255, n >> 8 & 255, 255 & n); return o }, S = "function" == typeof atob ? function (t) { return atob(l(t)) } : e ? function (t) { return Buffer.from(t, "base64").toString("binary") } : w, E = e ? function (t) { return d(Buffer.from(t, "base64")) } : function (t) { return d(S(t).split("").map((function (t) { return t.charCodeAt(0) }))) }, D = function (t) { return E(z(t)) }, R = e ? function (t) { return Buffer.from(t, "base64").toString("utf8") } : o ? function (t) { return o.decode(E(t)) } : function (t) { return F(S(t)) }, z = function (t) { return l(t.replace(/[-_]/g, (function (t) { return "-" == t ? "+" : "/" }))) }, T = function (t) { return R(z(t)) }, Z = function (t) { return { value: t, enumerable: !1, writable: !0, configurable: !0 } }, j = function () { var t = function (t, n) { return Object.defineProperty(String.prototype, t, Z(n)) }; t("fromBase64", (function () { return T(this) })), t("toBase64", (function (t) { return C(this, t) })), t("toBase64URI", (function () { return C(this, !0) })), t("toBase64URL", (function () { return C(this, !0) })), t("toUint8Array", (function () { return D(this) })) }, I = function () { var t = function (t, n) { return Object.defineProperty(Uint8Array.prototype, t, Z(n)) }; t("toBase64", (function (t) { return A(this, t) })), t("toBase64URI", (function () { return A(this, !0) })), t("toBase64URL", (function () { return A(this, !0) })) }, O = { version: n, VERSION: r, atob: S, atobPolyfill: w, btoa: p, btoaPolyfill: h, fromBase64: T, toBase64: C, encode: C, encodeURI: m, encodeURL: m, utob: B, btou: F, decode: T, isValid: function (t) { if ("string" != typeof t) return !1; var n = t.replace(/\s+/g, "").replace(/={0,2}$/, ""); return !/[^\s0-9a-zA-Z\+/]/.test(n) || !/[^\s0-9a-zA-Z\-_]/.test(n) }, fromUint8Array: A, toUint8Array: D, extendString: j, extendUint8Array: I, extendBuiltins: function () { j(), I() }, Base64: {} }; return Object.keys(O).forEach((function (t) { return O.Base64[t] = O[t] })), O })); //# sourceMappingURL=/sm/b3f991b414b0fa1b0799af2a7f930299e529ee04d4e0dc56fb33a5bfd532f984.map