var Base = function () { "use strict"; !function () { var e = document.documentElement, t = setInterval((function () { "complete" === document.readyState ? (clearInterval(t), e.classList.remove("loading"), e.classList.add("loaded")) : e.classList.add("loading") }), 100), n = document.querySelectorAll("a:not(.border) > img, a:not(.no-border) > img"); n.length && n.forEach((function (e, t) { e.parentElement.classList.add("no-border") })); var o = document.querySelectorAll(".sync-hover, .double-hover"); o.length && o.forEach((function (e, t) { try { e.addEventListener("mouseover", (function (t) { var n = document.querySelectorAll('[href="' + e.getAttribute("href") + '"]'); n.length && n.forEach((function (e, t) { e.classList.add("hover") })) })), e.addEventListener("mouseout", (function (t) { var n = document.querySelectorAll('[href="' + e.getAttribute("href") + '"]'); n.length && n.forEach((function (e, t) { e.classList.remove("hover") })) })) } catch (e) { console.error(e) } })) }(); var e = { xsmall: 420, small: 720, medium: 1080, large: 1440 }; function t() { return window.innerWidth <= e.small } var n = Object.freeze({ __proto__: null, breakpoints: e, xsmall: function () { return window.innerWidth <= e.xsmall }, small: t, medium: function () { return window.innerWidth <= e.medium }, large: function () { return window.innerWidth <= e.large }, xlarge: function () { return window.innerWidth > e.large } }), o = function () { var e, t = document.documentElement, n = window.navigator.userAgent.toLowerCase(), o = window.navigator.platform.toLowerCase(), r = [], a = t.className; if ("" !== a && (r = a.split(/\s+/)), !/msie/.test(n) && !/trident/.test(n) || /opera/.test(n)) /mozilla/.test(n) && !/(compatible|webkit)/.test(n) ? r.push("firefox") : /safari/.test(n) && !/chrome/.test(n) ? (r.push("safari", "webkit"), (e = n.match(/version\/([0-9.]+)/)) && r.push("safari" + parseInt(e[1], 10))) : /chrome/.test(n) ? r.push("chrome", "webkit") : /opera/.test(n) && r.push("opera"); else if (r.push("ie"), e = n.match(/msie ([0-9.]+)/)) { var i = parseInt(e[1], 10); r.push("ie" + i), 7 !== i && 8 !== i || r.push("ie7-8") } /win/.test(o) ? r.push("windows") : /mac/.test(o) ? r.push("macos") : /linux/.test(o) ? r.push("linux") : /iphone|ipad|ipod/.test(n) && r.push("ios"), /mobile/.test(n) ? r.push("mobile") : r.push("desktop"), /ipad/.test(n) ? r.push("ipad") : /ipod/.test(n) ? r.push("ipod") : /iphone/.test(n) ? r.push("iphone") : /android/.test(n) && r.push("android"), r.push("js"); for (var s = 0, c = r.length; s < c; s++)if ("no-js" === r[s]) { r.splice(s, 1); break } t.className = r.join(" "); for (var l = {}, d = 0, u = r.length; d < u; d++)l[r[d]] = !0; return l.width = window.innerWidth, l.height = window.innerHeight, l }(), r = (function () { var e = document.querySelectorAll(".blocks.blocks-flex, .inline-blocks.inline-blocks-flex"); function t(e) { var t = Math.floor(e.blocks.clientWidth / e.width), n = t * e.rows, o = e.blocks.children; 0 == t && (t = 1), n < e.rows && (n = e.rows), o.length && Object.keys(o).forEach((function (e) { e < n ? (o[e].style.width = 100 / t + "%", o[e].classList.remove("hidden")) : o[e].classList.add("hidden") })) } e.length && e.forEach((function (e, n) { if (e.children.length) { var o = {}; o.blocks = e, o.width = o.blocks.firstElementChild.offsetWidth || 200, o.rows = e.getAttribute("data-rows") || 9999, t(o), window.addEventListener("resize", (function (e) { t(o) })), e.removeAttribute("data-rows") } })) }(), function () { var e = document.querySelectorAll("[data-animate]"); if (e.length) { var t = {}; e.forEach((function (e, n) { try { var o = JSON.parse(e.dataset.animate); if (o.hasOwnProperty("Start")) { var r = {}; o.hasOwnProperty("TriggerID") && document.getElementById(o.TriggerID) ? r.Trigger = document.getElementById(o.TriggerID) : r.Trigger = e, r.Element = e, r.Start = o.Start, r.End = o.End, r.Class = o.Class, r.ClassRemove = o.ClassRemove, r.FunctionName = o.FunctionName, t[n] = r } else Object.keys(o).forEach((function (r) { var a = {}; o[r].hasOwnProperty("TriggerID") && document.getElementById(o[r].TriggerID) ? a.Trigger = document.getElementById(o[r].TriggerID) : a.Trigger = e, a.Element = e, a.Start = o[r].Start, a.End = o[r].End, a.Class = o[r].Class, a.ClassRemove = o[r].ClassRemove, a.FunctionName = o[r].FunctionName, t[n + r] = a })); e.removeAttribute("data-animate") } catch (e) { console.log(e) } })), Object.keys(t).length && (n(t), document.addEventListener("scroll", (function () { n(t) })), document.querySelector(".animate-scrollarea") && document.querySelector(".animate-scrollarea").addEventListener("scroll", (function () { n(t) }))) } function n(e) { Object.keys(e).forEach((function (t) { var n, r, a = e[t], i = a.Trigger.getBoundingClientRect(); a.Start.match(/px/) && (n = a.Start.replace("px", "")), a.Start.match(/vh/) && (n = o(a.Start.replace("vh", ""))), a.Start.match(/%/) && (n = o(a.Start.replace("%", ""))), a.End.match(/px/) && (r = a.End.replace("px", "")), a.End.match(/vh/) && (r = o(a.End.replace("vh", ""))), a.End.match(/%/) && (r = o(a.End.replace("%", ""))), a.Duration = n - r, i.top <= n && i.top >= r ? (null != a.Class && a.Element.classList.add(a.Class), "function" == typeof window[a.FunctionName] && (a.Progress = (n - i.top) / a.Duration, a.Progress = a.Progress.toFixed(4), window[a.FunctionName](a))) : (null != a.Class && 1 == a.ClassRemove && a.Element.classList.contains(a.Class) && a.Element.classList.remove(a.Class), "function" == typeof window[a.FunctionName] && (i.top > n && a.Progress > 0 && (a.Progress = 0, window[a.FunctionName](a)), i.top < r && a.Progress < 1 && (a.Progress = 1, window[a.FunctionName](a)))) })) } function o(e) { var t = window, n = document, o = n.documentElement, r = n.getElementsByTagName("body")[0]; t.innerWidth || o.clientWidth || r.clientWidth; return (t.innerHeight || o.clientHeight || r.clientHeight) * e / 100 } }(), function () { var e = document.querySelectorAll(".is-appeared"); if (e.length) { var t = {}; e.forEach((function (e, n) { try { var o = {}; o.Element = e, o.ClassAppeared = "appeared", o.ClassVisible = "visible", t[n] = o, o.Element.classList.contains("is-appeared") && o.Element.classList.remove("is-appeared") } catch (e) { console.log(e) } })), Object.keys(t).length && (n(t), document.addEventListener("scroll", (function () { n(t) }))) } function n(e) { Object.keys(e).forEach((function (t) { var n = e[t], o = n.Element.getBoundingClientRect(); o.top < window.innerHeight && o.bottom > 0 ? (null != n.ClassAppeared && n.Element.classList.add(n.ClassAppeared), null != n.ClassVisible && n.Element.classList.add(n.ClassVisible)) : null != n.ClassVisible && n.Element.classList.contains(n.ClassVisible) && n.Element.classList.remove(n.ClassVisible) })) } }(), function () { var e, n = document.querySelectorAll(".modal-content"), r = 0, a = 0; n.length && n.forEach((function (e, t) { var n, o = document.querySelector(".modal-here"), r = document.querySelector("body"); o && (r = o), n = '", r.insertAdjacentHTML("beforeend", n), e.remove() })); var i = document.querySelectorAll("[data-modal]"); i.length && i.forEach((function (e, t) { e.addEventListener("click", (function (t) { t.preventDefault(), d(e.dataset.modal) })) })), document.addEventListener("click", (function (e) { document.querySelector(".modal.active") && e.target.matches(".modal.active, .modal.active *") && (e.target.classList.contains("modal-close") || e.target.classList.contains("modal-custom-close") || !e.target.matches(".modal-window, .modal-window *")) && (e.preventDefault(), u(e.target.closest(".modal").getAttribute("id"))) })), document.addEventListener("keydown", (function (e) { var t = document.querySelectorAll(".modal.active"), n = t[t.length - 1]; n && 27 == e.keyCode && (e.preventDefault(), u(n.getAttribute("id"))) })); var s = new CustomEvent("modal:ready"), c = new CustomEvent("modal:open"), l = new CustomEvent("modal:close"); function d(t) { var n = document.documentElement, i = document.getElementById(t); if (i) { document.querySelectorAll(".modal.active"); setTimeout((function () { m(t), window.addEventListener("resize", e = function (e) { m(t) }), n.classList.add("modal-active"), n.classList.add(t + "-active"), i.dispatchEvent(s), r++ , i.classList.add("top", "active", "level-" + r), setTimeout((function () { i.dispatchEvent(c) }), 400), (o.iphone || o.ipad || o.android) && (a = window.scrollY, document.body.style.position = "fixed", document.body.style.top = "-" + a + "px") }), 0) } } function u(t) { var n = document.getElementById(t); window.removeEventListener("resize", e), n.classList.remove("active"), setTimeout((function () { document.documentElement.classList.remove(t + "-active"), n.classList.remove("top", "level-" + r), 0 == --r && document.documentElement.classList.remove("modal-active"), n.dispatchEvent(l) }), 400), (o.iphone || o.ipad || o.android) && (document.body.style.position = null, document.body.style.top = null, window.scrollTo(0, a)) } function m(e) { var n, o = document.getElementById(e); t() && o.querySelector(".modal-window").scrollHeight >= window.innerHeight ? (n = document.querySelector("#" + e + " .modal-window .modal-close")) && o.appendChild(n) : (n = document.querySelector("#" + e + " > .modal-close")) && document.querySelector("#" + e + " .modal-window").appendChild(n) } return { show: d, hide: u } }()), a = (function () { if ("IntersectionObserver" in window) { var e = document.querySelectorAll(".lazyload"), t = function (e) { var t = e.dataset.srcset, n = e.dataset.src; (function (e, t) { return new Promise((function (n, o) { var r = new Image; t && (r.srcset = t), e && (r.src = e), r.onload = n, r.onerror = o })) })(n, t).then((function () { t && (e.srcset = t, e.removeAttribute("data-srcset")), n && (e.src = n, e.removeAttribute("data-src")), (t || n) && (e.className += " loaded") })).catch((function () { return !1 })) }, n = new IntersectionObserver((function (e, n) { e.forEach((function (e) { e.intersectionRatio > 0 && (t(e.target), n.unobserve(e.target)) })) }), { root: null, rootMargin: "25% 0px", threshold: .1 }); e.forEach((function (e) { n.observe(e) })) } else { document.querySelectorAll(".lazyload").forEach((function (e) { var t = e.dataset.srcset, n = e.dataset.src; t && (e.srcset = t), n && (e.src = n), (t || n) && (e.className += " loaded"), e.className += " loaded" })) } }(), function () { var e = document.querySelectorAll("[data-loadmore]"); if (e.length) { var t = {}; e.forEach((function (e, n) { try { if (function (e) { try { JSON.parse(e) } catch (e) { return !1 } }(e.dataset.loadmore)) { var o = JSON.parse(e.dataset.loadmore); if (o.hasOwnProperty("FunctionName")) { var r = {}; r.Block = e, r.Offset = o.Offset || 0, r.FunctionName = o.FunctionName } else console.log("FunctionName required in JSON " + o) } else console.log("Invalid JSON in data-loadmore"); item && (t[n] = item, e.removeAttribute("data-loadmore")) } catch (e) { console.error(e) } })), Object.keys(t).length && (n(t), document.addEventListener("scroll", (function () { n(t) }))) } function n(e) { Object.keys(e).forEach((function (t) { var n = e[t]; n.FunctionName; parseInt(window.scrollY + document.documentElement.clientHeight) >= parseInt(n.Block.offsetTop + n.Block.clientHeight - n.Offset) ? watch && ("function" == typeof window[n.FunctionName] && (window[n.FunctionName](page), page++), watch = !1) : watch = !0 })) } }(), function () { var e, t, n = document.documentElement, o = 0; window.onscroll = function () { e = window.scrollY, t = document.body.scrollHeight - document.documentElement.clientHeight, e < o ? e < t && (n.classList.remove("scroll-down"), n.classList.add("scroll-up")) : e > 0 && (n.classList.remove("scroll-up"), n.classList.add("scroll-down")), o = e }; var r = document.querySelectorAll("[data-scrollto]"); if (r.length) { var a = {}; r.forEach((function (e, t) { try { if (function (e) { try { return JSON.parse(e), !0 } catch (e) { return !1 } }(e.dataset.scrollto)) { var n = JSON.parse(e.dataset.scrollto); if (n.hasOwnProperty("Target") && document.getElementById(n.Target)) (o = {}).Link = e, o.Target = document.getElementById(n.Target), o.Speed = n.Speed || 500, o.Offset = n.Offset || 0, o.ClassActive = n.ClassActive || "active"; else console.log("Target required in JSON " + n + " or element not exist.") } else { var o; if (document.getElementById(e.dataset.scrollto)) (o = {}).Link = e, o.Target = document.getElementById(e.dataset.scrollto), o.Speed = 500, o.Offset = 0, o.ClassActive = "active"; else console.log("Target '" + e.dataset.scrollto + "' not exist.") } o && (a[t] = o, e.removeAttribute("data-scrollto"), e.addEventListener("click", (function (e) { e.preventDefault(), i(o.Target, o.Offset, o.Speed) }))) } catch (e) { console.error(e) } })), Object.keys(a).length && (s(a), document.addEventListener("scroll", (function () { s(a) }))) } function i(e, t, n) { n = n || 500, t = t || 0; var o, r = window.pageYOffset, a = window.pageYOffset + e.getBoundingClientRect().top, i = (document.body.scrollHeight - a < window.innerHeight ? document.body.scrollHeight - window.innerHeight : a) - r; i && window.requestAnimationFrame((function e(a) { o || (o = a); var s, c = a - o, l = n > 0 ? Math.min(c / n, 1) : 1; l = (s = l) < .5 ? 2 * s * s : (4 - 2 * s) * s - 1, window.scrollTo(0, r + (i - t) * l), c < n && window.requestAnimationFrame(e) })) } function s(e) { Object.keys(e).forEach((function (t) { var n = e[t], o = n.Target.getBoundingClientRect(), r = (n.Speed, n.Offset); o.top <= r + 5 && o.bottom > r + 5 ? null != n.ClassActive && n.Link.classList.add(n.ClassActive) : null != n.ClassActive && n.Link.classList.contains(n.ClassActive) && n.Link.classList.remove(n.ClassActive) })) } return { scrollTo: i } }()); function i() { location.reload() } function s(e) { return window.location = e, !1 } function c(e, t) { void 0 !== history.pushState ? history.pushState(null, t, e) : location.href = e } var l = Object.freeze({ __proto__: null, reload: i, reloadWithHash: function (e) { s(location.href.replace(location.hash, "#" + e)), i() }, redirectTo: s, updateURL: c, changeURL: function (e, t) { c(t, e) } }); var d = []; var u = Object.freeze({ __proto__: null, random: function (e, t) { return Math.floor(Math.random() * (t - e + 1)) + e }, price: function (e) { return parseFloat(e).toFixed(2).replace(/\d(?=(\d{3})+\.)/g, "$& ").replace(".", ",") }, numberFormat: function (e) { for (var t = (e += "").split("."), n = t[0], o = t.length > 1 ? "." + t[1] : "", r = /(\d+)(\d{3})/; r.test(n);)n = n.replace(r, "$1 $2"); return n + o }, numberDecline: function (e, t, n, o) { var r = ""; if (e > 10 && 1 == parseInt(e % 100 / 10)) r = t; else switch (e % 10) { case 1: r = t; break; case 2: case 3: case 4: r = n; break; case 5: case 6: case 7: case 8: case 9: case 0: r = o }return r }, toggleActive: function (e, t, n, o) { var r = document.querySelector(e); if (r) { t = void 0 !== t ? t : "ready", n = void 0 !== n ? n : "active", o = void 0 !== o ? o : "inactive"; r.classList.contains(n) ? (r.classList.remove(n), r.classList.add(o), setTimeout((function () { r.classList.remove(t) }), 200)) : (r.classList.add(t), setTimeout((function () { r.classList.remove(o), r.classList.add(n) }), 50)) } }, loadScript: function (e, t, n) { if (-1 == d.indexOf(e)) { var o = document.createElement("script"); o.onload = function () { "function" == typeof t && t() }, o.src = e, n && o.setAttribute(n, ""), document.body.appendChild(o), d.push(e) } else "function" == typeof t && t() }, isEmail: function (e) { return /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(e) } }); function m(e) { return (m = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { return typeof e } : function (e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e })(e) } /**! * ajax - v3.0.4 * Ajax module in Vanilla JS * https://github.com/fdaciuk/ajax * Thu Oct 25 2018 15:30:50 GMT-0300 (-03) * MIT (c) Fernando Daciuk */function f(e) { return (e = e || {}).baseUrl = e.baseUrl || "", e.method && e.url ? v(e.method, e.baseUrl + e.url, p(e.data), e) : ["get", "post", "put", "delete"].reduce((function (t, n) { return t[n] = function (t, o) { return v(n, e.baseUrl + t, p(o), e) }, t }), {}) } function p(e) { return e || null } function v(e, t, n, o) { var r = ["then", "catch", "always"].reduce((function (e, t) { return e[t] = function (n) { return e[t] = n, e }, e }), {}), a = new XMLHttpRequest, i = function (e, t, n) { if ("get" !== n.toLowerCase() || !t) return e; var o = function (e) { return g(e) ? function e(t, n) { return Object.keys(t).map((function (o) { if (t.hasOwnProperty(o) && void 0 !== t[o]) { var r = t[o]; return o = n ? n + "[" + o + "]" : o, null !== r && "object" === m(r) ? e(r, o) : w(o) + "=" + w(r) } })).filter(Boolean).join("&") }(e) : e }(t), r = e.indexOf("?") > -1 ? "&" : "?"; return e + r + o }(t, n, e); return a.open(e, i, !0), a.withCredentials = o.hasOwnProperty("withCredentials"), function (e, t, n) { (function (e) { return Object.keys(e).some((function (e) { return "content-type" === e.toLowerCase() })) })(t = t || {}) || (t["Content-Type"] = g(n) ? "application/json" : "application/x-www-form-urlencoded"); Object.keys(t).forEach((function (n) { t[n] && e.setRequestHeader(n, t[n]) })) }(a, o.headers, n), a.addEventListener("readystatechange", function (e, t) { return function n() { t.readyState === t.DONE && (t.removeEventListener("readystatechange", n, !1), e.always.apply(e, h(t)), t.status >= 200 && t.status < 300 ? e.then.apply(e, h(t)) : e.catch.apply(e, h(t))) } }(r, a), !1), a.send(g(n) ? JSON.stringify(n) : n), r.abort = function () { return a.abort() }, r } function h(e) { var t; try { t = JSON.parse(e.responseText) } catch (n) { t = e.responseText } return [t, e] } function g(e) { return "[object Object]" === Object.prototype.toString.call(e) } function w(e) { return encodeURIComponent(e) } !function () { try { new CustomEvent("IE has CustomEvent, but doesn't support constructor") } catch (e) { window.CustomEvent = function (e, t) { var n; t = t || { bubbles: !1, cancelable: !1, detail: void 0 }; return (n = document.createEvent("CustomEvent")).initCustomEvent(e, t.bubbles, t.cancelable, t.detail), n }, CustomEvent.prototype = Object.create(window.Event.prototype) } }(); /*! js-cookie v3.0.0-rc.1 | MIT */function y(e) { for (var t = 1; t < arguments.length; t++) { var n = arguments[t]; for (var o in n) e[o] = n[o] } return e } var b = { read: function (e) { return e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent) }, write: function (e) { return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, decodeURIComponent) } }; var E = function e(t, n) { function o(e, o, r) { if ("undefined" != typeof document) { "number" == typeof (r = y({}, n, r)).expires && (r.expires = new Date(Date.now() + 864e5 * r.expires)), r.expires && (r.expires = r.expires.toUTCString()), e = encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape), o = t.write(o, e); var a = ""; for (var i in r) r[i] && (a += "; " + i, !0 !== r[i] && (a += "=" + r[i].split(";")[0])); return document.cookie = e + "=" + o + a } } return Object.create({ set: o, get: function (e) { if ("undefined" != typeof document && (!arguments.length || e)) { for (var n = document.cookie ? document.cookie.split("; ") : [], o = {}, r = 0; r < n.length; r++) { var a = n[r].split("="), i = a.slice(1).join("="); '"' === i[0] && (i = i.slice(1, -1)); try { var s = b.read(a[0]); if (o[s] = t.read(i, s), e === s) break } catch (e) { } } return e ? o[e] : o } }, remove: function (e, t) { o(e, "", y({}, t, { expires: -1 })) }, withAttributes: function (t) { return e(this.converter, y({}, this.attributes, t)) }, withConverter: function (t) { return e(y({}, this.converter, t), this.attributes) } }, { attributes: { value: Object.freeze(n) }, converter: { value: Object.freeze(t) } }) }(b, { path: "/" }); return { version: "1.0.0", adaptive: n, device: o, modal: r, scrollTo: a.scrollTo, url: l, utils: u, ajax: f, cookies: E } }();