!function (t) { "use strict"; var e, n = Object.prototype, r = n.hasOwnProperty, i = "function" == typeof Symbol ? Symbol : {}, o = i.iterator || "@@iterator", s = i.asyncIterator || "@@asyncIterator", a = i.toStringTag || "@@toStringTag", u = "object" == typeof module, l = t.regeneratorRuntime; if (l) u && (module.exports = l); else { (l = t.regeneratorRuntime = u ? module.exports : {}).wrap = k; var c = "suspendedStart", h = "suspendedYield", f = "executing", p = "completed", d = {}, v = {}; v[o] = function () { return this }; var m = Object.getPrototypeOf, y = m && m(m(S([]))); y && y !== n && r.call(y, o) && (v = y); var g = x.prototype = _.prototype = Object.create(v); b.prototype = g.constructor = x, x.constructor = b, x[a] = b.displayName = "GeneratorFunction", l.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === b || "GeneratorFunction" === (e.displayName || e.name)) }, l.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, x) : (t.__proto__ = x, a in t || (t[a] = "GeneratorFunction")), t.prototype = Object.create(g), t }, l.awrap = function (t) { return {__await: t} }, O(L.prototype), L.prototype[s] = function () { return this }, l.AsyncIterator = L, l.async = function (t, e, n, r) { var i = new L(k(t, e, n, r)); return l.isGeneratorFunction(e) ? i : i.next().then(function (t) { return t.done ? t.value : i.next() }) }, O(g), g[a] = "Generator", g[o] = function () { return this }, g.toString = function () { return "[object Generator]" }, l.keys = function (t) { var e = []; for (var n in t) e.push(n); return e.reverse(), function n() { for (; e.length;) { var r = e.pop(); if (r in t) return n.value = r, n.done = !1, n } return n.done = !0, n } }, l.values = S, C.prototype = { constructor: C, reset: function (t) { if (this.prev = 0, this.next = 0, this.sent = this._sent = e, this.done = !1, this.delegate = null, this.method = "next", this.arg = e, this.tryEntries.forEach(E), !t) for (var n in this) "t" === n.charAt(0) && r.call(this, n) && !isNaN(+n.slice(1)) && (this[n] = e) }, stop: function () { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval }, dispatchException: function (t) { if (this.done) throw t; var n = this; function i(r, i) { return a.type = "throw", a.arg = t, n.next = r, i && (n.method = "next", n.arg = e), !!i } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var s = this.tryEntries[o], a = s.completion; if ("root" === s.tryLoc) return i("end"); if (s.tryLoc <= this.prev) { var u = r.call(s, "catchLoc"), l = r.call(s, "finallyLoc"); if (u && l) { if (this.prev < s.catchLoc) return i(s.catchLoc, !0); if (this.prev < s.finallyLoc) return i(s.finallyLoc) } else if (u) { if (this.prev < s.catchLoc) return i(s.catchLoc, !0) } else { if (!l) throw new Error("try statement without catch or finally"); if (this.prev < s.finallyLoc) return i(s.finallyLoc) } } } }, abrupt: function (t, e) { for (var n = this.tryEntries.length - 1; n >= 0; --n) { var i = this.tryEntries[n]; if (i.tryLoc <= this.prev && r.call(i, "finallyLoc") && this.prev < i.finallyLoc) { var o = i; break } } o && ("break" === t || "continue" === t) && o.tryLoc <= e && e <= o.finallyLoc && (o = null); var s = o ? o.completion : {}; return s.type = t, s.arg = e, o ? (this.method = "next", this.next = o.finallyLoc, d) : this.complete(s) }, complete: function (t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), d }, finish: function (t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var n = this.tryEntries[e]; if (n.finallyLoc === t) return this.complete(n.completion, n.afterLoc), E(n), d } }, catch: function (t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var n = this.tryEntries[e]; if (n.tryLoc === t) { var r = n.completion; if ("throw" === r.type) { var i = r.arg; E(n) } return i } } throw new Error("illegal catch attempt") }, delegateYield: function (t, n, r) { return this.delegate = { iterator: S(t), resultName: n, nextLoc: r }, "next" === this.method && (this.arg = e), d } } } function k(t, e, n, r) { var i = e && e.prototype instanceof _ ? e : _, o = Object.create(i.prototype), s = new C(r || []); return o._invoke = function (t, e, n) { var r = c; return function (i, o) { if (r === f) throw new Error("Generator is already running"); if (r === p) { if ("throw" === i) throw o; return j() } for (n.method = i, n.arg = o; ;) { var s = n.delegate; if (s) { var a = P(s, n); if (a) { if (a === d) continue; return a } } if ("next" === n.method) n.sent = n._sent = n.arg; else if ("throw" === n.method) { if (r === c) throw r = p, n.arg; n.dispatchException(n.arg) } else "return" === n.method && n.abrupt("return", n.arg); r = f; var u = w(t, e, n); if ("normal" === u.type) { if (r = n.done ? p : h, u.arg === d) continue; return {value: u.arg, done: n.done} } "throw" === u.type && (r = p, n.method = "throw", n.arg = u.arg) } } }(t, n, s), o } function w(t, e, n) { try { return {type: "normal", arg: t.call(e, n)} } catch (t) { return {type: "throw", arg: t} } } function _() { } function b() { } function x() { } function O(t) { ["next", "throw", "return"].forEach(function (e) { t[e] = function (t) { return this._invoke(e, t) } }) } function L(t) { var e; this._invoke = function (n, i) { function o() { return new Promise(function (e, o) { !function e(n, i, o, s) { var a = w(t[n], t, i); if ("throw" !== a.type) { var u = a.arg, l = u.value; return l && "object" == typeof l && r.call(l, "__await") ? Promise.resolve(l.__await).then(function (t) { e("next", t, o, s) }, function (t) { e("throw", t, o, s) }) : Promise.resolve(l).then(function (t) { u.value = t, o(u) }, function (t) { return e("throw", t, o, s) }) } s(a.arg) }(n, i, e, o) }) } return e = e ? e.then(o, o) : o() } } function P(t, n) { var r = t.iterator[n.method]; if (r === e) { if (n.delegate = null, "throw" === n.method) { if (t.iterator.return && (n.method = "return", n.arg = e, P(t, n), "throw" === n.method)) return d; n.method = "throw", n.arg = new TypeError("The iterator does not provide a 'throw' method") } return d } var i = w(r, t.iterator, n.arg); if ("throw" === i.type) return n.method = "throw", n.arg = i.arg, n.delegate = null, d; var o = i.arg; return o ? o.done ? (n[t.resultName] = o.value, n.next = t.nextLoc, "return" !== n.method && (n.method = "next", n.arg = e), n.delegate = null, d) : o : (n.method = "throw", n.arg = new TypeError("iterator result is not an object"), n.delegate = null, d) } function R(t) { var e = {tryLoc: t[0]}; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e) } function E(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e } function C(t) { this.tryEntries = [{tryLoc: "root"}], t.forEach(R, this), this.reset(!0) } function S(t) { if (t) { var n = t[o]; if (n) return n.call(t); if ("function" == typeof t.next) return t; if (!isNaN(t.length)) { var i = -1, s = function n() { for (; ++i < t.length;) if (r.call(t, i)) return n.value = t[i], n.done = !1, n; return n.value = e, n.done = !0, n }; return s.next = s } } return {next: j} } function j() { return {value: e, done: !0} } }(function () { return this || "object" == typeof self && self }() || Function("return this")()); var t = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t }, e = function t(e, n, r) { null === e && (e = Function.prototype); var i = Object.getOwnPropertyDescriptor(e, n); if (void 0 === i) { var o = Object.getPrototypeOf(e); return null === o ? void 0 : t(o, n, r) } if ("value" in i) return i.value; var s = i.get; return void 0 !== s ? s.call(r) : void 0 }, n = function () { function t(t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r) } } return function (e, n, r) { return n && t(e.prototype, n), r && t(e, r), e } }(); function r(t) { return function () { var e = t.apply(this, arguments); return new Promise(function (t, n) { return function r(i, o) { try { var s = e[i](o), a = s.value } catch (t) { return void n(t) } if (!s.done) return Promise.resolve(a).then(function (t) { r("next", t) }, function (t) { r("throw", t) }); t(a) }("next") }) } } function i(t, e) { if (!t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return !e || "object" != typeof e && "function" != typeof e ? t : e } function o(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function, not " + typeof e); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e) } function s(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") } var a = function () { function t() { s(this, t) } return n(t, null, [{ key: "t", value: function (e) { if ("function" == typeof e) { var n = e; e = t.s.then(function (t) { return n(t) }) } t.i.push(e) } }, { key: "resolve", value: function (e) { return t.o(e), t.s.then(function () { return Promise.all(t.i) }) } }]), t }(); a.i = [], a.s = new Promise(function (t) { a.o = t }); var u = function () { function t() { s(this, t) } return n(t, null, [{ key: "l", value: function (e, n) { if ("function" != typeof e) { if ("string" == typeof e) { for (var r = e.split("."), i = r.length - 1; i >= 1; i--) { var o = {}; o[r[i]] = n, n = o } e = r[0] } var s = e; e = function () { window[s] = n } } t.h.push(e) } }, { key: "u", value: function () { for (var e = 0; e < t.h.length; e++) t.h[e](); return Promise.resolve() } }]), t }(); u.h = [], u.l("InitPromise.addPromise", a.t); var l = function () { function t(e, n, r, i) { s(this, t), this.title = v.m(e, null), this.g = n, this.p = v.m(r, t.S), this.order = v.m(i, 1e3), this.M = "", this.H = null, this.v = !0, this.P = !0, this.id = t.T++, this.L = null, this.A = !0, this.C = [] } return n(t, [{ key: "k", value: function (t) { this.title = t } }, { key: "F", value: function (t) { this.A = t } }, { key: "B", value: function () { return this.p } }, { key: "D", value: function () { return this.title } }, { key: "I", value: function () { return this.A } }, { key: "remove", value: function (t) { if (t = v.m(t, !1), v.R(this.H) && (console.log(this.H), this.H.U(this), this.H = null), t) for (var e = 0; e < this.C.length; e++) this.C[e].remove() } }, { key: "W", value: function () { return this.H } }, { key: "N", value: function (t) { this.H = t } }, { key: "O", value: function () { return this.P } }, { key: "_", value: function (t) { t !== this.P && (this.P = t, this.j()) } }, { key: "V", value: function () { return this.v } }, { key: "J", value: function () { return this.L } }, { key: "q", value: function (t) { this.L = t } }, { key: "$", value: function () { return this.id } }, { key: "j", value: function () { v.R(this.H) && this.H.G(this) } }, { key: "K", value: function (e) { var n = v.m(e, new t); return n.title = this.title, n.g = this.g, n.p = this.p, n.order = this.order, n.M = this.M, n.v = this.v, n.P = this.P, n.L = this.L, n.A = this.A, n.H = null, n.id = t.T++, this.C.push(n), n } }, { key: "X", value: function () { v.R(this.H) && this.H.j() } }]), t }(); l.T = 0, l.Y = "always", l.S = "medium", l.Z = "large", l.tt = "never"; var c = function () { function t(e, n, r, o) { var a; return s(this, t), (a = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, function (t) { t.et().toggle(), t.j() }, r, o))).nt = n, n.st(a), a } return o(t, l), n(t, [{ key: "et", value: function () { return this.nt } }, { key: "K", value: function (n) { return e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "K", this).call(this, v.m(n, new t(null, this.nt.K()))) } }]), t }(), h = function () { function t(e) { s(this, t), this.it = [], this.rt = [], "string" == typeof e ? this.ot = document.querySelectorAll(e) : Array.isArray(e) ? this.ot = e : this.ot = [e] } return n(t, [{ key: "K", value: function (e) { (e = v.m(e, new t([]))).it = []; for (var n = 0, r = this.it.length; n < r; n++) e.it.push(this.it[n].K()); e.rt = []; for (var i = 0, o = this.rt.length; i < o; i++) e.rt.push(this.rt[i].K()); return e } }, { key: "at", value: function (t) { v.lt(this.it, t) && (this.it.push(t), this.j(), t.N(this), t instanceof c && this.rt.push(t.et())) } }, { key: "ht", value: function () { if (v.R(this.ot)) { this.ut(); for (var t = [], e = 0; e < this.it.length; e++) { var n = this.ct(this.it[e]); this.it[e].dt = n, t.push(n) } for (var r = 0, i = this.ot.length; r < i; r++) { this.ot[r].removeAllChildren(); for (var o = 0, s = t.length; o < s; o++) this.ot[r].appendChild(v.cloneNode(t[o])); this.ot[r].onclick = this.gt() } } } }, { key: "gt", value: function () { var t = this; return function (e) { var n = e.target; if (n.matches(".action") || n.matches(".action *")) { n = n.closest(".action"); for (var r = parseInt(n.dataset.id), i = 0, o = t.it.length; i < o; i++) if (t.it[i].id === r) return "function" == typeof t.it[i].g && t.it[i].V() && t.it[i].g(t.it[i], e), t.it[i]; for (var s = 0, a = t.rt.length; s < a; s++) if (t.rt[s].click(r, e)) return t.rt[s] } return null } } }, { key: "ct", value: function (t) { var e = document.createElement("a"); if ("string" == typeof t.g && (e.href = t.g), v.R(t.J())) { var n = document.createElement("img"); n.src = t.J(), n.classList.add("action-image"), t.I() && (n.dataset.translationTitle = t.title), e.appendChild(n) } var r = t.D(); return r = t.I() ? d.pt(r) : document.createTextNode(r), e.appendChild(r), this.ft(e, t) } }, { key: "ft", value: function (t, e) { var n = document.createElement("li"); return n.classList.add("action"), "" !== e.M.trim() && n.classList.add(e.M), n.appendChild(t), n.dataset.id = e.id, v.R(e.J()) && n.classList.add("img"), e.O() || n.classList.add("hidden"), e instanceof c && (e.et().ht(), n.appendChild(e.et().St()), n.classList.add("is-dropdown-submenu-parent"), n.classList.add("opens-right")), n } }, { key: "ut", value: function () { this.it = this.it.sort(function (t, e) { return t.order - e.order }) } }, { key: "wt", value: function (t) { for (var e = [], n = 0; n < this.ot.length; n++) { var r = this.ot[n].querySelector('[data-id="' + t.$() + '"]'); v.Mt(r) || e.push(r) } return e } }, { key: "G", value: function (t) { var e = this.wt(t); if (0 !== e.length) { var n = this.ct(t); t.dt = n; for (var r = 0; r < e.length; r++) e[r].replaceWith(v.cloneNode(n)) } } }, { key: "U", value: function (t) { var e = this.it.indexOf(t); if (e > 0) { this.it.splice(e, 1); for (var n = this.wt(t), r = 0, i = n.length; r < i; r++) n[r].remove(); if (t instanceof c) { var o = this.rt.indexOf(t.et()); this.rt.splice(o, 1) } } } }, { key: "j", value: function () { this.ht() } }]), t }(); h.Y = "always", h.S = "medium", h.Ht = "smedium", h.Z = "large", h.tt = "never"; var f = function () { function t() { var e; s(this, t); var n = document.createElement("ul"); return n.classList.add("menu"), n.classList.add("vertical"), n.classList.add("submenu"), n.classList.add("is-dropdown-submenu"), n.classList.add("first-sub"), (e = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, n))).yt = null, e.isOpen = !1, e } return o(t, h), n(t, [{ key: "K", value: function (n) { (n = e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "K", this).call(this, v.m(n, new t))).ot = []; for (var r = 0, i = this.ot.length; r < i; r++) n.ot.push(v.cloneNode(this.ot[r])); return n.yt = this.yt, n.isOpen = this.isOpen, n } }, { key: "st", value: function (t) { this.yt = t } }, { key: "ht", value: function () { var n = this; e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "ht", this).call(this), v.R(this.ot) && function () { for (var t = n, e = 0; e < n.ot.length; e++) { var r = document.createElement("div"); r.classList.add("close-listener"), r.onclick = function (e) { console.log(e), t.close() }, n.ot[e].insertBefore(r, n.ot[e].firstElementChild) } }() } }, { key: "St", value: function () { return this.ot[0] } }, { key: "gt", value: function () { return function () { } } }, { key: "click", value: function (t, e) { for (var n = 0, r = this.it.length; n < r; n++) if (this.it[n].id === t) return "function" == typeof this.it[n].g && this.it[n].V() && this.it[n].g(this.it[n], e), this.close(), !0; return !1 } }, { key: "toggle", value: function () { this.isOpen ? this.close() : this.open() } }, { key: "open", value: function () { this.isOpen = !0; for (var t = 0, e = this.ot.length; t < e; t++) this.ot[t].classList.add("js-dropdown-active"); v.R(this.yt) && this.yt.j() } }, { key: "close", value: function () { this.isOpen = !1; for (var t = 0, e = this.ot.length; t < e; t++) this.ot[t].classList.remove("js-dropdown-active"); v.R(this.yt) && this.yt.j() } }]), t }(), p = function () { function t() { s(this, t), this.vt = indexedDB || mozIndexedDB || webkitIndexedDB || msIndexedDB, this.Pt = 3; var e = this; this.Tt = new Promise(function (t, n) { var r = e.vt.open("Translator", e.Pt); r.onupgradeneeded = function (t) { var n = t.target.result; e.Lt(n) }, r.onsuccess = function (e) { var n = e.target.result; t(n) }, r.onerror = function (t) { n(t) } }).catch(function (t) { console.error(t) }) } return n(t, [{ key: "Lt", value: function (t) { try { t.deleteObjectStore("currentLang"), t.deleteObjectStore("translations") } catch (t) { console.warn(t) } t.createObjectStore("currentLang", {keyPath: "id"}), t.createObjectStore("translations", {keyPath: ["lang", "key"]}).createIndex("lang", "lang", {unique: !1}) } }, { key: "bt", value: function (e) { this.Tt.then(function (n) { t.At(["currentLang"], "readwrite", n).objectStore("currentLang").put({id: 1, lang: e}) }).catch(function (t) { console.error(t) }) } }, { key: "Ct", value: function (e, n) { return this.Tt.then(function (r) { return new Promise(function (i) { var o = t.At(["translations"], "readwrite", r), s = o.objectStore("translations"); for (var a in n) s.put({lang: e, key: a, translation: n[a]}); o.oncomplete = function () { i() } }) }).catch(function () { }) } }, { key: "kt", value: function (e) { return this.Tt.then(function (n) { return new Promise(function (r) { var i = t.At(["translations"], "readonly", n), o = {}; i.objectStore("translations").index("lang").openCursor(IDBKeyRange.only(e)).onsuccess = function (t) { var e = t.target.result; if (e) { var n = e.value; o[n.key] = n.translation, e.continue() } }, i.oncomplete = function () { r(o) } }) }).catch(function (t) { return console.error(t), {} }) } }, { key: "Ft", value: function () { return this.Tt.then(function (e) { return new Promise(function (n) { var r = t.At(["currentLang"], "readonly", e).objectStore("currentLang").get(1); r.onsuccess = function (t) { var e = t.currentTarget.result; n(e ? e.lang : null) }, r.onerror = function () { n(null) } }) }).catch(function () { }) } }], [{ key: "At", value: function (t, e, n) { var r = null; try { r = n.transaction(t, e) } catch (e) { console.warn(e), r = n.transaction(t) } return r } }]), t }(), d = function () { function e() { s(this, e), this.xt = [], this.Bt = new p, this.Dt = null, this.It = e.Rt, this.Ut = e.Et, this.Wt = e.Nt, this.Ot = e._t, this.jt = e.Vt; var t = this; this.Jt = this.qt().then(function () { return t.zt() }) } return n(e, [{ key: "$t", value: function (t) { var e = this; return fetch(v.Gt(this.Wt + t + ".json")).then(function (t) { return t.json() }).then(function (n) { e.xt[t] = Object.assign(n, e.xt[t]), e.Bt.Ct(t, e.xt[t]) }).catch(function (e) { console.error("could not load lang " + t + " because of error: ", e) }) } }, { key: "qt", value: function () { var t = this; return this.$t(this.Ut).then(function () { t.Dt = t.Ut, "undefined" != typeof document && document.getElementsByTagName("html")[0].setAttribute("lang", t.Ut) }) } }, { key: "bt", value: function (t) { if (this.Dt === t) return this.Xt(), Promise.resolve(); if (-1 === this.It.indexOf(t)) return Promise.resolve(); this.Dt = t, "undefined" != typeof localStorage && localStorage.setItem("language", t), this.Bt.bt(t); var e = this; return this.$t(t).then(function () { "undefined" != typeof document && document.getElementsByTagName("html")[0].setAttribute("lang", t), e.Xt() }) } }, { key: "translate", value: function (n, r) { "object" == (void 0 === n ? "undefined" : t(n)) && v.R(n) && (n = this.Qt(n)); var i = null; return v.R(this.xt[this.Dt]) && v.R(this.xt[this.Dt][n]) && (i = this.xt[this.Dt][n]), v.Mt(i) && (e.Yt && console.warn("missing translation for language " + this.Dt + " and key " + n), v.R(this.xt[this.Ut]) && (i = this.xt[this.Ut][n]), v.Mt(i) && (e.Yt && console.error("missing base translation for key " + n + ". FIX IT"), i = n), this.Ot && (i = ">>" + i + "<<")), this.jt && (i = "$" + i + "$"), void 0 !== r && (i = i.format(r)), i } }, { key: "Qt", value: function (t) { var e = t.key; for (var n in delete t.key, t) t.hasOwnProperty(n) && (v.Mt(this.xt[n]) && (this.xt[n] = {}), this.xt[n][e] = t[n]); return e } }, { key: "Xt", value: function () { if ("undefined" != typeof document) for (var t = document.querySelectorAll("[data-translation]"), e = 0, n = t.length; e < n; e++) { if ("" != t[e].dataset.translation) try { t[e].innerHTML = this.translate(t[e].dataset.translation, void 0 !== t[e].dataset.translationArgs ? JSON.parse(t[e].dataset.translationArgs) : void 0) } catch (t) { console.error("wrong configured translation: " + t) } for (var r in t[e].dataset) if (r.startsWith("translation") && !r.endsWith("Args")) try { t[e][r.substr(11).toLowerCase()] = this.translate(t[e].dataset[r], void 0 !== t[e].dataset[r + "Args"] ? JSON.parse(t[e].dataset[r + "Args"]) : void 0) } catch (t) { console.error("wrong configured translation: " + t) } } } }, { key: "zt", value: function () { var t = localStorage.getItem("language"); if (v.Mt(t) || -1 === this.It.indexOf(t)) { var e = []; if (v.R(navigator.languages) && (e = navigator.languages.slice(0)), void 0 !== navigator.language && e.push(navigator.language), e.push(this.Ut), void 0 !== e) for (var n = 0, r = e.length; n < r; n++) if (-1 !== this.It.indexOf(e[n])) { t = e[n]; break } } return this.bt(t.toLowerCase()) } }], [{ key: "bt", value: function (t) { var n = e.Kt(); if (n) return n.bt(t) } }, { key: "translate", value: function (t, n) { var r = e.Kt(); return r ? r.translate(t, n) : "" } }, { key: "Qt", value: function (t) { var n = e.Kt(); if (n) return n.Qt(t) } }, { key: "pt", value: function (n, r, i) { if (i = v.m(i, "span"), "object" == (void 0 === n ? "undefined" : t(n)) && (n = e.Qt(n)), "undefined" != typeof document) { var o = document.createElement(i); return o.dataset.translation = n, void 0 !== r && (o.dataset.translationArgs = JSON.stringify(r)), o.innerHTML = e.translate(n, r), o } } }, { key: "Zt", value: function () { var t = new f; return t.at(new l("en", function () { e.Kt().bt("en") })), t.at(new l("de", function () { e.Kt().bt("de") })), new c("current-lang", t, h.Y) } }, { key: "init", value: function () { e.te = new e } }, { key: "Kt", value: function () { return e.te } }]), e }(); d.Yt = !1, d.te = null, d.Et = "en", d.Rt = ["de", "en"], d._t = !0, d.Vt = !1, d.Nt = "js/lang/", d.ee = null, d.ne = {}, u.l("Translator.setLanguage", d.bt); var v = function () { function e() { s(this, e) } return n(e, null, [{ key: "init", value: function () { e.se = null, e.ie = null } }, { key: "lt", value: function (t, e, n) { return -1 === t.indexOf(e, n) } }, { key: "includes", value: function (t, n, r) { return !e.lt(t, n, r) } }, { key: "re", value: function () { if (arguments.length > 0) { var t = arguments[0], n = Array.prototype.slice.call(arguments, 1); return e.R(t) && (0 === n.length || e.re.apply(null, [t[n[0]]].concat(n.slice(1)))) } return !1 } }, { key: "Mt", value: function (t) { return null === t || void 0 === t } }, { key: "R", value: function (t) { return !e.Mt(t) } }, { key: "m", value: function () { for (var t = 0; t < arguments.length; t++) if (e.R(arguments[t])) return arguments[t]; return null } }, { key: "oe", value: function (t) { return !e.empty(t) } }, { key: "ae", value: function (t) { var e = []; for (var n in t) e.push(encodeURIComponent(n) + "=" + encodeURIComponent(t[n])); return "?" + e.join("&") } }, { key: "empty", value: function (t) { return e.Mt(t) || "string" == typeof t && "" === t.trim() } }, { key: "le", value: function (t) { var e = document.createElement("template"); return e.innerHTML = t, e.content.childNodes } }, { key: "he", value: function () { var t = "http://www.w3.org/2000/svg", e = document.createElement("div"); e.className = "loader"; var n = document.createElementNS(t, "svg"); n.setAttribute("viewBox", "0 0 32 32"), n.setAttribute("widh", "32"), n.setAttribute("height", "32"); var r = document.createElementNS(t, "circle"); return r.setAttribute("id", "spinner"), r.setAttribute("cx", "16"), r.setAttribute("cy", "16"), r.setAttribute("r", "14"), r.setAttribute("fill", "none"), n.appendChild(r), e.appendChild(n), e } }, { key: "Gt", value: function (t) { return m.ue() + t } }, { key: "ce", value: function () { return navigator.userAgent.match(/iPhone|iPad|iPod/i) } }, { key: "de", value: function () { return null !== navigator.userAgent.match(/Android|BlackBerry|Opera Mini|IEMobile/i) || e.ce() || void 0 !== window.orientation || !1 === window.orientation || null === window.orientation } }, { key: "select", value: function (t) { var e = document.createRange(); e.selectNodeContents(t); var n = window.getSelection(); n.removeAllRanges(), n.addRange(e) } }, { key: "format", value: function (t, e) { for (t = "" + t; t.length < e;) t = "0" + t; return t } }, { key: "cloneNode", value: function (t) { var e = t.cloneNode(!0); return e.onclick = t.onclick, e } }, { key: "me", value: function (t, e) { for (var n = "", r = Math.floor(Math.log(265) / Math.log(e)), i = 0; i < t.length; i++) { var o = t.charCodeAt(i).toString(e), s = o.length % r; s > 0 && (o = new Array(r + 1 - s).join("0") + o), n += o } return n } }, { key: "ge", value: function (t, e) { for (var n = Math.floor(Math.log(265) / Math.log(e)), r = t.match(new RegExp(".{1," + n + "}", "g")) || [], i = "", o = 0, s = r.length; o < s; o++) i += String.fromCharCode(parseInt(r[o], e)); return i } }, { key: "pe", value: function (t) { return "none" === t.style.display ? (t.style.display = "", !0) : (t.style.display = "none", !1) } }, { key: "print", value: function (t) { var e = document.getElementById("print-content"); t instanceof Element ? (e.removeAllChildren(), e.appendChild(t)) : e.innerHTML = t, window.print() } }, { key: "fe", value: function (t, n, r) { n instanceof Date || (n = new Date(n)); var i = (r = e.m(r, !1)) ? n.getUTCDay() : n.getDay(), o = r ? n.getUTCDate() : n.getDate(), s = r ? n.getUTCMonth() : n.getMonth(), a = r ? n.getUTCFullYear() : n.getFullYear(), u = r ? n.getUTCHours() : n.getHours(), l = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], c = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], h = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], f = function () { var t = new Date(n); return t.setDate(o - (i + 6) % 7 + 3), t }, p = function (t, e) { return ("" + (Math.pow(10, e) + t)).slice(1) }; return t.replace(/%[a-z]/gi, function (t) { return { "%a": d.pt(l[i].slice(0, 3)).outerHTML, "%A": d.pt(l[i]).outerHTML, "%b": d.pt(c[s].slice(0, 3)).outerHTML, "%B": d.pt(c[s]).outerHTML, "%c": n.toUTCString(), "%C": Math.floor(a / 100), "%d": p(o, 2), "%e": o, "%f": p(n.getTime() % 1e3, 4), "%F": n.toISOString().slice(0, 10), "%G": f().getFullYear(), "%g": ("" + f().getFullYear()).slice(2), "%H": p(u, 2), "%I": p((u + 11) % 12 + 1, 2), "%j": p(h[s] + o + (s > 1 && 0 == (3 & a) && (a % 100 != 0 || a % 400 == 0) ? 1 : 0), 3), "%k": "" + u, "%l": (u + 11) % 12 + 1, "%m": p(s + 1, 2), "%M": p(n.getMinutes(), 2), "%p": u < 12 ? "AM" : "PM", "%P": u < 12 ? "am" : "pm", "%s": Math.round(n.getTime() / 1e3), "%S": p(n.getSeconds(), 2), "%u": i || 7, "%V": function () { var t = f(), e = t.valueOf(); t.setMonth(0, 1); var n = t.getDay(); return 4 !== n && t.setMonth(0, 1 + (4 - n + 7) % 7), p(1 + Math.ceil((e - t) / 6048e5), 2) }(), "%w": "" + i, "%x": n.toLocaleDateString(), "%X": n.toLocaleTimeString(), "%y": ("" + a).slice(2), "%Y": a, "%z": n.toTimeString().replace(/.+GMT([+-]\d+).+/, "$1"), "%Z": n.toTimeString().replace(/.+\((.+?)\)$/, "$1") }[t] || t }) } }, { key: "Se", value: function (n) { var r = void 0; if (e.Mt(n) || "object" != (void 0 === n ? "undefined" : t(n))) return n; if (n instanceof Array) { var i = []; for (r = 0; r < n.length; ++r) i[r] = e.Se(n[r]); return i } if (n instanceof Date) return new Date(n.getTime()); var o = {}; for (r in n) o[r] = e.Se(n[r]); return o } }, { key: "we", value: function (t) { var n = { "&": "&", "&": "&", "<": "<", ">": ">", """: '"', "'": "'", "’": "’", "‘": "‘", "–": "–", "—": "—", "…": "…", "”": "”" }; return e.R(t) && "function" == typeof t.replace ? t.replace(/\&[\w\d\#]{2,5}\;/g, function (t) { return n[t] }) : t } }, { key: "Me", value: function (t) { var e = new FormData; for (var n in t) e.set(n, t[n]); return e } }, { key: "He", value: function (t, n) { var r = window.getComputedStyle(t), i = window.getComputedStyle(n); if (i.height > r.height || i.width > r.width) return e.ye(t, n) } }, { key: "ye", value: function (t, n) { e.ve(t); for (var r = window.getComputedStyle(t), i = window.getComputedStyle(n), o = 0, s = parseFloat(i.getPropertyValue("font-size")), a = i.width, u = i.height; i.height > r.height || i.width > r.width;) if (s *= .95, u > r.height && (u *= .95), a > i.width && (a *= .95), n.style["font-size"] = s + "px", n.style["max-height"] = u + "px", n.style["max-width"] = a + "px", ++o > 2e3) { console.log("breaked"); break } e.Pe(n), i = window.getComputedStyle(n), n.style["font-size"] = parseFloat(i.getPropertyValue("font-size")) / parseFloat(document.documentElement.clientHeight) * 100 + "vh" } }, { key: "ve", value: function (t) { for (var n = t.childNodes, r = 0, i = n.length; r < i; r++) n[r] instanceof Element && (e.Pe(n[r]), e.ve(n[r])) } }, { key: "Pe", value: function (t) { var e = t.classList.contains("no-transtition"); t.classList.add("no-transition"); var n = t.parentNode; console.log(t); var r = window.getComputedStyle(t), i = window.getComputedStyle(n), o = parseFloat(r.getPropertyValue("font-size")) / parseFloat(i.getPropertyValue("font-size")), s = r.height, a = r.width, u = i.height, l = i.width, c = t.style; c["max-height"] = Math.floor(s / u * 100) + "%", c["margin-left"] = Math.floor(parseFloat(r.getPropertyValue("margin-left")) / l * 100) + "%", c["margin-right"] = Math.floor(parseFloat(r.getPropertyValue("margin-right")) / l * 100) + "%", c["margin-top"] = Math.floor(parseFloat(r.getPropertyValue("margin-top")) / u * 100) + "%", c["margin-bottom"] = Math.floor(parseFloat(r.getPropertyValue("margin-bottom")) / u * 100) + "%", c["max-width"] = Math.floor(a / l * 100) + "%", c["font-size"] = o + "em", e || t.classList.remove("no-transition") } }, { key: "Te", value: function () { var t = window.chrome, e = window.navigator, n = e.vendor, r = e.userAgent.indexOf("OPR") > -1, i = e.userAgent.indexOf("Edge") > -1; return !!e.userAgent.match("CriOS") || null !== t && void 0 !== t && "Google Inc." === n && !1 === r && !1 === i } }, { key: "Le", value: function (t, e) { for (var n = {}, r = 0, i = t.length; r < i; r++) n[t[r][e]] = t[r]; return n } }, { key: "be", value: function (t) { var e = {}; for (var n in t) t.hasOwnProperty(n) && (e[t[n]] = n); return e } }, { key: "toArray", value: function (t) { var e = []; for (var n in t) e.push(t[n]); return e } }]), e }(); v.init(); var m = function () { function t() { s(this, t) } return n(t, null, [{ key: "Ae", value: function (e) { t.Ce = e } }, { key: "ue", value: function () { return t.Ce } }, { key: "set", value: function (e, n) { t.ke[e] = n } }, { key: "get", value: function (e, n) { return v.m(t.ke[e], n) } }, { key: "has", value: function (e) { return v.m(t.ke[e]) } }]), t }(); m.Ae("/"), m.ke = {}; var y = function () { function t() { s(this, t) } return n(t, null, [{ key: "init", value: function () { t.Fe() } }, { key: "xe", value: function (e) { var n = null; if ("string" == typeof e) { var r = t.Be.filter(function (t) { return t.De === e }); r.length > 0 && (n = r[0]) } else -1 !== t.Be.indexOf(e) && (n = e); if (v.R(n)) { localStorage.setItem("currentTheme", n.De); var i = new Promise(function (t) { document.querySelector("nav.top-bar").addEventListener("transitionend", function () { t() }) }); document.body.className = n.Ie, t.Re = n; for (var o = 0, s = t.Ue.length; o < s; o++) t.Ue[o](t.Re, i) } } }, { key: "Ee", value: function (e) { t.Be.push(e) } }, { key: "Fe", value: function () { if (t.xe(localStorage.getItem("currentTheme")), v.Mt(t.Re)) { var e = document.body.className, n = t.Be.filter(function (t) { return t.Ie === e }); n.length > 0 ? t.xe(n[0]) : t.Be.length > 0 && t.xe(t.Be[0]) } } }, { key: "We", value: function () { return new l(t.Re.De, function (e) { var n = (t.Be.indexOf(t.Re) + 1) % t.Be.length; t.xe(t.Be[n]), e.title = t.Re.De, e.H.j() }, h.Y) } }, { key: "addChangeListener", value: function (e) { t.Ue.push(e) } }, { key: "getCurrentTheme", value: function () { return t.Re } }]), t }(); y.Re = null, y.Be = [], y.Ue = [], u.l("ThemeManager", { addChangeListener: y.addChangeListener, getCurrentTheme: y.getCurrentTheme }); var g = function () { function t(e) { s(this, t), this.Oe = e, this._e = !0, this.je = 3650, this.Ve = "complianceCookie", this.Je = "true" } return n(t, null, [{ key: "Ne", value: function () { var e = r(regeneratorRuntime.mark(function e(n) { return regeneratorRuntime.wrap(function (e) { for (; ;) switch (e.prev = e.next) { case 0: return e.abrupt("return", new t(n).Ne()); case 1: case"end": return e.stop() } }, e, this) })); return function () { return e.apply(this, arguments) } }() }]), n(t, [{ key: "Ne", value: function () { var e = r(regeneratorRuntime.mark(function e() { return regeneratorRuntime.wrap(function (e) { for (; ;) switch (e.prev = e.next) { case 0: return e.abrupt("return", t.qe(this.Ve) !== this.Je ? this.show() : Promise.resolve()); case 1: case"end": return e.stop() } }, e, this) })); return function () { return e.apply(this, arguments) } }() }, { key: "ze", value: function () { this.$e(this.Ve, this.Je, this.je) } }, { key: "$e", value: function (t, e, n) { var r = void 0; if (v.R(n)) { var i = new Date; i.setTime(i.getTime() + 24 * n * 60 * 60 * 1e3), r = "; expires=" + i.toGMTString() } else r = ""; this._e && (document.cookie = t + "=" + e + r + "; path=/") } }, { key: "Ge", value: function (t) { this.$e(t, "", -1) } }, { key: "show", value: function () { var t = this, e = document.getElementById(this.Oe); return e.style.display = "block", new Promise(function (n) { e.querySelector("#close-cookie-msg").onclick = function () { t.ze(), e.remove(), n() } }) } }], [{ key: "qe", value: function (t) { for (var e = t + "=", n = document.cookie.split(";"), r = 0; r < n.length; r++) { for (var i = n[r]; " " === i.charAt(0);) i = i.substring(1, i.length); if (0 === i.indexOf(e)) return i.substring(e.length, i.length) } return null } }]), t }(), k = function () { function r() { return s(this, r), i(this, (r.__proto__ || Object.getPrototypeOf(r)).apply(this, arguments)) } return o(r, h), n(r, [{ key: "ft", value: function (t, n) { var i = e(r.prototype.__proto__ || Object.getPrototypeOf(r.prototype), "ft", this).call(this, t, n); return i.classList.add(n.B()), i } }, { key: "Xe", value: function () { var t = r.Ye(), e = this.ot[0]; ("medium" === t || "smedium" === t || "small" === t) && r.Ze(e.getElementsByClassName(h.Z)).length > 0 || ("smedium" === t || "small" === t) && r.Ze(e.getElementsByClassName(h.S)).length > 0 || "small" === t && r.Ze(e.getElementsByClassName(h.Ht)).length > 0 || r.Ze(e.getElementsByClassName(h.tt)).length > 0 ? document.getElementById("responsive-menu-toggle").style.display = "block" : (document.getElementById("responsive-menu-toggle").style.display = "none", v.R(r.Ke) && r.Ke.close()) } }, { key: "gt", value: function () { var t = e(r.prototype.__proto__ || Object.getPrototypeOf(r.prototype), "gt", this).call(this); return function (e) { t(e) instanceof c || !v.R(r.Ke) || r.Ke.close() } } }, { key: "ht", value: function (t) { var n = e(r.prototype.__proto__ || Object.getPrototypeOf(r.prototype), "ht", this).call(this, t); return this.Xe(), r.Ke = this, n } }, { key: "close", value: function () { document.getElementById("responsive-menu").style.display = "none"; for (var t = 0, e = this.rt.length; t < e; t++) this.rt[t].close() } }, { key: "U", value: function (t) { var n = e(r.prototype.__proto__ || Object.getPrototypeOf(r.prototype), "U", this).call(this, t); return this.Xe(), n } }], [{ key: "init", value: function () { var t = document.getElementsByClassName("foundation-mq"); if (0 !== t.length) { var e = []; for (var n in t = function (t) { var e = {}; return "string" != typeof t ? e : (t = t.trim().slice(1, -1)) ? e = t.split("&").reduce(function (t, e) { var n = e.replace(/\+/g, " ").split("="), r = n[0], i = n[1]; return r = decodeURIComponent(r), i = void 0 === i ? null : decodeURIComponent(i), t.hasOwnProperty(r) ? Array.isArray(t[r]) ? t[r].push(i) : t[r] = [t[r], i] : t[r] = i, t }, {}) : e }(window.getComputedStyle(t[0]).getPropertyValue("font-family"))) t.hasOwnProperty(n) && e.push({ De: n, value: "only screen and (min-width: " + t[n] + ")" }); window.addEventListener("resize", function () { v.R(r.Ke) && r.Ke.Xe() }); var i = document.getElementById("responsive-menu"); document.getElementById("responsive-menu-toggle").onclick = function () { "none" === window.getComputedStyle(i).getPropertyValue("display") ? i.style.display = "block" : v.R(r.Ke) && r.Ke.close() }, i.firstElementChild.addEventListener("click", function (t) { t.target === i.firstElementChild && v.R(r.Ke) && r.Ke.close() }), r.Qe = e } } }, { key: "Ye", value: function () { for (var e = void 0, n = 0; n < r.Qe.length; n++) { var i = r.Qe[n]; matchMedia(i.value).matches && (e = i) } return "object" == (void 0 === e ? "undefined" : t(e)) ? e.De : e } }, { key: "Ze", value: function (t) { for (var e = [], n = 0, r = t.length; n < r; n++) t[n].classList.contains("hidden") || e.push(t[n]); return e } }]), r }(); k.Qe = [], k.Ke = null, k.init(); var w = function () { function t() { s(this, t) } return n(t, null, [{ key: "tn", value: function (e, n) { n = v.m(n, []).slice(0); var r = Promise.resolve(); if (e instanceof Element) r = Promise.resolve(e); else { if (-1 !== n.indexOf(e)) return Promise.reject("views are in a circuit! cannot resolve view for url " + n[0] + "! url " + e + " is in stack before!"); n.push(e), r = fetch(v.Gt(e), {credentials: "same-origin"}).then(function (t) { return t.text() }).then(function (t) { var e = (new DOMParser).parseFromString(t, "text/html"); return v.Mt(e) && ((e = document.implementation.createHTMLDocument("")).body.innerHTML = t), e.body.firstChild }) } return r.then(function (e) { for (var r = [], i = e.querySelectorAll("[data-view]"), o = function (e, o) { r.push(t.tn(i[o].dataset.view, n).then(function (t) { i[o].replaceWith(t) })) }, s = 0, a = i.length; s < a; s++) o(0, s); return Promise.all(r).then(function () { return e }) }) } }]), t }(), _ = function () { function t(e) { s(this, t); var n = this; this.en = null, this.nn = !0, this.sn = new Promise(function (t) { n.in = t }), this.rn = {}, v.R(e) && this.on(e) } return n(t, [{ key: "an", value: function () { var t = []; for (var e in this.rn) t.push(this.rn[e].an.apply(this.rn[e], arguments)), t.push(this.rn[e].sn); return Promise.all(t) } }, { key: "ln", value: function () { var t = this, e = arguments; this.nn && (this.hn(), this.nn = !1); var n = function (n) { var r = t.rn[n]; r.ln.apply(t.rn[n], e), t.rn[n].sn.then(function (t) { r.un() ? t.classList.remove("hidden") : t.classList.add("hidden") }) }; for (var r in this.rn) n(r) } }, { key: "hn", value: function () { } }, { key: "cn", value: function () { for (var t in this.rn) this.rn[t].cn.apply(this.rn[t], arguments) } }, { key: "dn", value: function () { for (var t in this.rn) this.rn[t].dn.apply(this.rn[t], arguments) } }, { key: "mn", value: function (t, e) { this.rn[t] = e, this.sn = this.sn.then(function (n) { return e.sn.then(function (e) { return n.querySelector(t).appendChild(e), n }) }) } }, { key: "on", value: function (t) { var e = this; return this.in(w.tn(t).then(function (t) { return e.en = t, t })), this.sn } }, { key: "gn", value: function (t, e, n) { e = v.m(e, !1); var r = function (n) { var r = null; return e ? (r = n.querySelectorAll(t), n.matches(t) && r.push(n)) : r = n.matches(t) ? n : n.querySelector(t), r }; return (n = v.m(n, !1)) ? this.sn.then(function (t) { return r(t) }) : r(this.en) } }]), t }(), b = function () { function t(e, n, r) { var o; return s(this, t), (o = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, n))).pn = !1, o.fn = e, o.Sn = !1, o.wn = null, o.url = "", o.Mn = r, o.Hn = {}, o.title = e.yn(), o } return o(t, _), n(t, [{ key: "k", value: function (t, e) { "string" == typeof t && (e = t, t = document.createTextNode(t)), this.title = {vn: t}, this.title.title = v.m(e, this.title.title), this.pn && this.fn.Pn() } }, { key: "Tn", value: function () { return this.Ln(this.fn.bn()) } }, { key: "on", value: function (n) { var r = this; return e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "on", this).call(this, n).then(function (t) { for (var e = [], n = 0, i = r.rn.length; n < i; n++) e.push(r.rn[n].sn); return Promise.all(e).then(function () { return t }) }) } }, { key: "an", value: function (n) { return this.Hn = n, v.R(this.Mn) && this.An(n), e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "an", this).call(this, n) } }, { key: "ln", value: function (n) { this.pn = !0; var r = e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "ln", this).call(this, n); return this.wn.j(), r } }, { key: "cn", value: function (n) { e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "cn", this).call(this, n), this.pn = !1 } }, { key: "finish", value: function (t) { this.Sn || (this.Sn = !0, this.fn.Cn(this, t)) } }, { key: "Ln", value: function (t, e) { return this.fn.Ln(t, e) } }, { key: "kn", value: function () { this.fn.kn(this) } }, { key: "Fn", value: function (t, e, n) { this.Ln(t, e), this.finish(n) } }, { key: "xn", value: function (t) { for (var e = this.fn.Bn(), n = 0, r = e.length; n < r; n++) t.at(e[n].K()); return t } }, { key: "Dn", value: function (t) { this.url = t, this.fn.In(this) } }, { key: "An", value: function (t) { this.Dn(this.Mn + v.ae(t)) } }, { key: "Rn", value: function (t) { this.Hn = Object.assign(this.Hn, t), this.An(this.Hn) } }, { key: "Un", value: function () { return this.url } }, { key: "En", value: function () { return v.Gt(this.url) } }, { key: "Wn", value: function () { } }, { key: "addListener", value: function (t, e, n) { this.fn.addListener(this, t, e, n) } }, { key: "Nn", value: function (t, e) { this.fn.Nn(this, t, e) } }, { key: "On", value: function (t, e, n, r) { this.fn.On(this, t, e, n, r) } }]), t }(), x = function () { function t(e, n) { s(this, t), this._n = e, this.en = null, this.jn = {}, this.Vn = {}, this.Jn = n } return n(t, [{ key: "qn", value: function () { return this._n } }, { key: "zn", value: function (t) { t instanceof b && (this._n = t) } }, { key: "$n", value: function () { return this.en } }, { key: "Gn", value: function (t) { this.en = t } }, { key: "Kn", value: function () { return this.jn } }, { key: "Xn", value: function (t) { this.jn = t } }, { key: "Qn", value: function () { return this.Vn } }, { key: "Yn", value: function (t) { this.Vn = t } }, { key: "Zn", value: function () { return this.Jn } }, { key: "ts", value: function (t) { this.Jn = t } }]), t }(), O = function () { function t(e, n, r) { s(this, t), this.es = document.getElementById(e), this.ns = [], this.ss = null, this.rs = v.m(n, ".action-bar"), this.os = Promise.resolve(), this.as = [], this.ls = null, this.app = r, this.hs = document.querySelector(".top-bar-title"); for (var i = document.createElement("span"); this.hs.childNodes.length > 0;) { var o = this.hs.firstChild; o.remove(), i.appendChild(o) } this.us = {vn: i, title: document.title}; var a = this; window.onpopstate = function () { if (a.ns.length >= 1) { var t = a.ns[a.ns.length - 1].qn(); !1 !== t.Wn() && a.Cn(t) } } } return n(t, [{ key: "yn", value: function () { return this.us } }, { key: "cs", value: function (t) { this.ls = t } }, { key: "bn", value: function () { return this.ls } }, { key: "ds", value: function (t) { this.as.push(t) } }, { key: "Bn", value: function () { return this.as } }, { key: "ms", value: function () { return v.R(this.ss) ? this.ss.qn() : null } }, { key: "gs", value: function () { var t = r(regeneratorRuntime.mark(function t(e) { var n; return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: n = this.ns.length - 1; case 1: if (!(n >= 0)) { t.next = 9; break } return t.next = 4, e(this.ns[n].qn()); case 4: if (!t.sent) { t.next = 6; break } return t.abrupt("return", this.ns[n].qn()); case 6: n--, t.next = 1; break; case 9: return t.abrupt("return", null); case 10: case"end": return t.stop() } }, t, this) })); return function () { return t.apply(this, arguments) } }() }, { key: "Ln", value: function () { var t = r(regeneratorRuntime.mark(function t(e, n) { var i, o, s, a, u = this; return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: if (e.prototype instanceof b) { t.next = 2; break } throw{error: "wrong class given! Expected AbstractSite, given " + e.name}; case 2: return i = new e(this), o = {}, s = new Promise(function (t, e) { o.resolve = t, o.reject = e }), a = new x(i, o), t.abrupt("return", (this.es.removeAllChildren().appendChild(v.he()), this.os = Promise.resolve(n).then(function () { var t = r(regeneratorRuntime.mark(function t(e) { return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: return a.Yn(e), t.next = 3, Promise.all([i.an(e), i.sn]); case 3: return i.wn = i.xn(u.ps()), t.abrupt("return", u.show(a)); case 5: case"end": return t.stop() } }, t, u) })); return function () { return t.apply(this, arguments) } }()).catch(function (t) { console.error("site start error for site ", e.name, t) }), s)); case 4: case"end": return t.stop() } }, t, this) })); return function () { return t.apply(this, arguments) } }() }, { key: "Cn", value: function (t, e) { var n = this; this.os.then(function () { var r = n.fs(t), i = n.ns.splice(r, 1), o = null; if ((i = i[0]) === n.ss) { n.ss.qn().cn(), n.ss = null; var s = n.ns.length - 1; if (s < 0) return n.Ss(), void app.ws(); n.es.removeAllChildren().appendChild(v.he()), o = n.ns[s] } i.qn().dn(), Promise.resolve(e).then(function (t) { i.Zn().resolve(t), v.R(o) && n.show(o) }) }) } }, { key: "addListener", value: function (t, e, n, r) { this.es.addEventListener(e, function (e) { var i = e.target; t.pn && i.matches(n) && r(i, e) }) } }, { key: "On", value: function (t, e, n, r, i) { this.addListener(t, n, r, i), this.Nn(t, e, i) } }, { key: "Nn", value: function (t, e, n) { window.addEventListener("keydown", function (r) { t.pn && r.which === e && n(this, r) }) } }, { key: "kn", value: function (t) { var e = this.fs(t), n = this.ns.splice(e, 1); n = n[0], this.show(n) } }, { key: "Ms", value: function () { return this.show(this.ss) } }, { key: "show", value: function (t) { v.R(this.ss) && (this.ss.Xn(this.ss.qn().cn()), this.ss.Gn(this.es.innerHTML)), this.es.removeAllChildren().appendChild(v.he()); var e = this; return this.ss = t, -1 === this.ns.indexOf(t) && this.ns.push(t), t.qn().sn.then(function (n) { return t.qn().wn.j(), e.es.removeAllChildren().appendChild(n), e.Pn(), d.Kt().Xt(), n }).then(function (n) { t.qn().ln(t.Kn()), history.pushState({ siteName: t.qn().constructor.name, siteData: n.outerHTML, stackPosition: e.ns.length - 1 }, t.qn().constructor.name, t.qn().En()) }) } }, { key: "In", value: function (t) { if (v.R(this.ss) && this.ss.qn() === t) { history.replaceState({ siteName: t.constructor.name, siteData: t.en.outerHTML, stackPosition: this.ns.length - 1 }, t.constructor.name, t.En()) } } }, { key: "ms", value: function () { if (null != this.ss) return this.ss.qn() } }, { key: "Hs", value: function () { null != this.ss && this.ss.qn().wn.j() } }, { key: "Pn", value: function () { var t = this.ms().title; this.hs.removeAllChildren().appendChild(t.vn), document.title = v.m(t.title, this.us.title) } }, { key: "fs", value: function (t) { for (var e = 0, n = this.ns.length; e < n; e++) if (this.ns[e].qn() === t) return e; return -1 } }, { key: "ys", value: function (t) { var e = this.fs(t); return -1 === e ? null : this.ns[e] } }, { key: "Ss", value: function () { this.es.removeAllChildren().appendChild(d.pt("The app has ended! Please close the window.")) } }, { key: "ps", value: function () { return new k(this.rs) } }]), t }(), L = function () { function t() { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments)) } return o(t, b), n(t, [{ key: "an", value: function (t) { var e = null; v.re(t, "url") ? e = t.url : (e = document.createElement("div")).innerHTML = "Paused...", this.on(e) } }, { key: "cn", value: function () { console.log("onPause"); for (var n = 0; n < t.vs.length; n++) "function" == typeof t.vs[n] && t.vs[n](); return e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "cn", this).call(this) } }, { key: "ln", value: function () { console.log("onStart"); for (var n = 0; n < t.Ps.length; n++) "function" == typeof t.Ps[n] && t.Ps[n](); return e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "cn", this).call(this) } }]), t }(); L.Ps = [], L.vs = []; var P = function () { function t() { var e = this; s(this, t), this.Ts = null, this.Ls = ".action-bar", this.Ce = m.ue(), this.bs = "site-content", this.As = new Map, this.Cs = [], this.ks = !1, this.Fs = !0, this.xs = null, this.Bs = function () { return e.Ln(e.xs) } } return n(t, [{ key: "Ds", value: function () { return this.Ts } }, { key: "ds", value: function (t) { this.Cs.push(t) } }, { key: "Is", value: function (t) { this.ks = t } }, { key: "Rs", value: function () { return this.bs } }, { key: "Us", value: function (t) { this.bs = t } }, { key: "Es", value: function () { return this.Ls } }, { key: "Ws", value: function (t) { this.Ls = t } }, { key: "ue", value: function () { return this.Ce } }, { key: "Ae", value: function (t) { this.Ce = t } }, { key: "Ns", value: function (t, e) { this.As.set(t.toLowerCase(), e) } }, { key: "Os", value: function (t) { this.Fs = t } }, { key: "Ms", value: function () { this.Ts.Ms() } }, { key: "pause", value: function (t) { this.Ln(L, {url: t}) } }, { key: "resume", value: function () { var t = this.Ts.ms(); t instanceof L && t.finish() } }, { key: "_s", value: function (t) { return t = t.toLowerCase(), this.As.has(t) ? this.As.get(t) : null } }, { key: "js", value: function () { var t = ""; return 0 === window.location.pathname.search(this.Ce) && (t = window.location.pathname.substr(this.Ce.length).trim()), "/" === t.charAt(0) && (t = t.substr(1).trim()), "/" === t.charAt(t.length - 1) && (t = t.substr(0, t.length - 2).trim()), 0 === t.length && window.location.hash && (t = window.location.hash.substr(1).trim()), this._s(t) } }, { key: "Vs", value: function () { for (var e = this, n = document.getElementsByClassName("deep-link"), r = 0, i = n.length; r < i; r++) n[r].addEventListener("click", function (n) { return n.preventDefault(), e.Ts.Ln(v.m(e._s(this.dataset.siteName), e.xs), t.Js(this.dataset.siteArgs)), !0 }) } }, { key: "qs", value: function (t) { var e = this.Cs.indexOf(t); e >= 0 && (this.Cs[e].remove(!0), this.Cs.splice(e, 1)) } }, { key: "Ln", value: function (t, e) { return this.Ts.Ln(t, e) } }, { key: "start", value: function (e) { m.Ae(this.Ce); var n = v.m(this.js(), e), r = t.zs(); this.xs = e, d.init(), y.init(), this.ks && this.ds(y.We()), this.Ts = new O(this.bs, this.Ls), this.Ts.as = this.Cs, this.Ts.cs(e), this.Ts.Ln(n, r), this.Vs(), this.Fs && (this.$s = g.Ne("cookie-compliance")) } }, { key: "ms", value: function () { return this.Ts.ms() } }, { key: "ws", value: function () { var t = r(regeneratorRuntime.mark(function t() { return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: "function" == typeof this.Bs && this.Bs(); case 1: case"end": return t.stop() } }, t, this) })); return function () { return t.apply(this, arguments) } }() }, { key: "setAppEndListener", value: function (t) { this.Bs = t } }, { key: "gs", value: function () { var t = r(regeneratorRuntime.mark(function t(e) { return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: return t.abrupt("return", this.Ts.gs(e)); case 1: case"end": return t.stop() } }, t, this) })); return function () { return t.apply(this, arguments) } }() }], [{ key: "Js", value: function (t) { if (v.Mt(t)) return null; for (var e = {}, n = [], r = t.split("&"), i = 0; i < r.length; i++) (n = r[i].split("="))[0].trim().length > 0 && (e[n[0]] = decodeURIComponent(n[1])); return e } }, { key: "zs", value: function () { return t.Js(window.location.search.substr(1)) } }]), t }(), R = function () { function t(e, n) { s(this, t), this.Gs = null, this.content = null, this.Ks = null, this.cancelable = !0, this.title = v.m(n, ""), this.Xs = !0, this.Qs = "", this.buttons = [], this.result = null, v.R(e) && this.Ys(e) } return n(t, [{ key: "k", value: function (t) { return this.title = t, this } }, { key: "Zs", value: function (t) { this.Xs = t } }, { key: "ti", value: function (t) { this.Qs = t } }, { key: "D", value: function () { return this.title } }, { key: "ei", value: function (t) { return this.cancelable = !0 === t, this } }, { key: "Ys", value: function () { var t = r(regeneratorRuntime.mark(function t(e) { return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: return this.ni = Promise.resolve(e), t.next = 3, this.ni; case 3: return this.content = t.sent, t.abrupt("return", this); case 5: case"end": return t.stop() } }, t, this) })); return function () { return t.apply(this, arguments) } }() }, { key: "si", value: function (t, e, n) { n = v.m(n, !0); var r = null; "string" == typeof t ? ((r = document.createElement("button")).classList.add("button"), r.classList.add("right"), r.appendChild(d.pt(t))) : r = t; var i = this; if ("function" != typeof e) { var o = e; e = function () { i.result = o } } var s; s = n ? function (t) { v.R(e) && e(t), i.close() } : e, v.R(s) && r.addEventListener("click", s), this.buttons.push(r) } }, { key: "show", value: function () { var t = r(regeneratorRuntime.mark(function t() { var e, n, r, i, o, s, a, u, l; return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: for ((e = document.createElement("span")).classList.add("title"), this.Xs && "" !== this.title ? e.appendChild(d.pt(this.title)) : e.innerHTML = this.title, (n = document.createElement("div")).appendChild(e), (r = document.createElement("div")).classList.add("content-container"), (i = document.createElement("div")).className = this.Qs, i.classList.add("modal"), i.appendChild(n), i.appendChild(r), (o = document.createElement("div")).classList.add("modal-button-container"), s = 0, a = this.buttons.length; s < a; s++) o.appendChild(this.buttons[s]); return t.next = 13, this.ni; case 13: return this.content instanceof Node || (this.content = this.Xs ? d.pt(this.content) : document.createTextNode(this.content)), r.appendChild(this.content), this.Ks = document.createElement("div"), this.Ks.classList.add("background"), this.Ks.appendChild(i), this.Ks.querySelector(".modal").appendChild(o), this.Ks.style.display = "block", u = this, this.cancelable && ((l = document.createElement("span")).classList.add("close"), l.innerHTML = "×", n.appendChild(l), l.addEventListener("click", function () { u.close() }), window.addEventListener("click", function (t) { t.target === u.Ks && u.close() })), t.abrupt("return", (document.body.appendChild(this.Ks), d.Kt().Xt(), new Promise(function (t) { u.Gs = t }))); case 23: case"end": return t.stop() } }, t, this) })); return function () { return t.apply(this, arguments) } }() }, { key: "close", value: function () { v.R(this.Ks) && (this.Ks.style.display = "none", this.Ks.remove(), this.Ks = null), v.R(this.Gs) && this.Gs(this.result) } }, { key: "ii", value: function () { this.si("confirm-button") } }]), t }(), E = function () { function e() { s(this, e) } return n(e, null, [{ key: "ri", value: function (t, e) { e = v.m(e, 0), setTimeout(function () { var e = document.getElementById("flashMessage" + t); e.fadeOut(.2).then(function () { e.remove() }) }, e) } }, { key: "oi", value: function (n, r, i, o) { var s = null; (v.Mt(r) || "object" == (void 0 === r ? "undefined" : t(r))) && (s = r, r = n, n = e.ai, o = !0), o = v.m(o, !1); var a = e.li, u = document.createElement("div"), l = document.createElement("div"); l.className = "flashMessage " + n, l.id = "flashMessage" + a, l.style.opacity = "0", l.addEventListener("click", function () { e.ri(a) }), l.appendChild(o ? d.pt(r, s, "span") : document.createTextNode(r)), u.appendChild(l), document.getElementById("flashMessageContainer").appendChild(u), l.fadeIn(), (i = v.m(i, e.hi)) > 0 && e.ri(e.li, i), e.li++ } }]), e }(); E.li = 0, E.hi = 3500, E.ui = 1e3, E.ai = "success", E.ci = "error", E.di = "default", E.mi = "info", E.gi = "warning"; var C = function () { function t(e, n) { s(this, t); var r = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB || window.pi; this.fi = r.open(e, n); var i = this; this.fi.onupgradeneeded = function (t) { i.Si(i.fi.result, t.oldVersion, t.newVersion, t) }, this.wi = new Promise(function (t) { i.fi.onsuccess = function (e) { i.Bt = i.fi.result, t(e) } }) } return n(t, [{ key: "Mi", value: function (t, e, n) { var r = this; return "function" == typeof e && v.Mt(n) && (n = e, e = "read"), this.wi.then(function () { var i = null; try { i = r.fi.result.transaction(t, e) } catch (e) { console.warn(e), i = r.fi.result.transaction(t) } n(i) }) } }, { key: "Hi", value: function (t, e, n) { return "function" == typeof e && v.Mt(n) && (n = e, e = "readonly"), this.Mi(t, e, function (e) { n(e.objectStore(t)) }) } }, { key: "yi", value: function (t, e) { var n = this; return new Promise(function (r) { n.Hi(e, "readwrite", function (e) { var n = e.put(t); n.onsuccess = r, n.onerror = function (t) { throw{type: "indexed-db-error", event: t} } }) }) } }, { key: "vi", value: function (t, e) { var n = this; return new Promise(function (r) { n.Hi(e, "readwrite", function (e) { for (var n = [], i = function (r, i) { n.push(new Promise(function (n) { var r = e.put(t[i]); r.onsuccess = n, r.onerror = function (t) { throw{type: "indexed-db-error", event: t} } })) }, o = 0, s = t.length; o < s; o++) i(0, o); r(Promise.all(n)) }) }) } }, { key: "load", value: function (t, e) { var n = this; return new Promise(function (r, i) { n.Hi(e, function (e) { var n = e.get(t); n.onsuccess = function (t) { r(t.currentTarget.result) }, n.onerror = function (t) { throw console.warn(t), {type: "indexed-db-load-error", event: t} } }).catch(function (t) { console.warn(t), i(t) }) }) } }, { key: "Pi", value: function (t, e, n) { var r = this; return new Promise(function (i, o) { r.Hi(t, function (t) { var r = t.getAll(e, n); r.onsuccess = function (t) { i(t.currentTarget.result) }, r.onerror = function (t) { throw console.warn(t), {type: "indexed-db-load-error", event: t} } }).catch(function (t) { console.warn(t), o(t) }) }) } }, { key: "Ti", value: function (t, e, n, r, i) { var o = this; return new Promise(function (s) { o.Hi(n, function (n) { var o = n.index(t); o.onerror = function (t) { throw{type: "indexed-db-index-error", event: t} }; var a = o.openCursor(e, i); a.onerror = function (t) { throw{type: "indexed-db-index-error", event: t} }; var u = [], l = 0; a.onsuccess = function (t) { var e = t.target.result; e && (u.push(e.value), l++, v.Mt(r) || l < r) ? e.continue() : s(u) } }) }) } }, { key: "remove", value: function (t, e) { var n = this; return new Promise(function (r) { n.Hi(e, "readwrite", function (e) { var n = e.delete(t); n.onerror = function (t) { throw{type: "indexed-db-delete-error", event: t} }, n.onsuccess = function () { r() } }) }) } }, { key: "Li", value: function (t, e) { var n = this; return new Promise(function (r) { n.Hi(e, "readwrite", function (e) { for (var n = [], i = function (r, i) { (r = e.delete(t[i])).onerror = function (t) { throw{type: "indexed-db-delete-error", event: t} }, n.push(new Promise(function (t) { r.onsuccess = function () { t() } })) }, o = 0, s = t.length; o < s; o++) i(s, o); r(Promise.all(n)) }) }) } }, { key: "bi", value: function (t, e, n) { var r = this; return new Promise(function (i) { r.Hi(n, "readwrite", function (n) { var r = n.index(t); r.onerror = function (t) { throw{type: "indexed-db-index-error", event: t} }; var o = r.openCursor(e); o.onerror = function (t) { throw{type: "indexed-db-index-error", event: t} }, o.onsuccess = function (t) { var e = t.target.result; e ? (e.delete(), e.continue()) : i() } }) }) } }, { key: "Ai", value: function (t) { var e = this; return new Promise(function (n) { e.Hi(t, "readwrite", function (t) { var e = t.clear(); e.onerror = function (t) { throw{type: "indexed-db-index-error", event: t} }, e.onsuccess = n }) }) } }, { key: "Si", value: function () { } }]), t }(), S = function () { function t() { s(this, t) } return n(t, null, [{ key: "Ci", value: function (e) { if (v.R(t.ki[e])) return t.ki[e]; var n = new Promise(function (t) { var n = document.createElement("script"); n.src = v.Gt(e), n.onload = t, document.body.appendChild(n) }); return t.ki[e] = n, n } }, { key: "Fi", value: function (e, n) { if (v.R(t.xi[e])) return t.xi[e]; n = v.m(n, "all"); var r = new Promise(function (t) { var r = document.createElement("link"); r.rel = "stylesheet", r.type = "text/css", r.href = v.Gt(e), r.media = n, r.onload = t, document.head.appendChild(r) }); return t.xi[e] = r, r } }]), t }(); S.ki = {}, S.xi = {}; var j = function () { function t(e, n, r, i) { s(this, t), this.Bi = e, this.L = n, this.Di = r, v.m(i, !1) && (this.L = w.tn(this.L)) } return n(t, [{ key: "Ii", value: function (t) { return t === (t & this.Bi) } }, { key: "J", value: function () { return this.L } }, { key: "Ri", value: function () { return this.Di } }]), t }(); j.Ui = 1, j.Ei = 2, j.Wi = 4, j.Ni = j.Ei + j.Wi, j.TYPE_ALL = j.Ui + j.Ni, u.l(function () { window.ShareButton = j, window.ShareButton.TYPE_ALL = j.TYPE_ALL }); var T = function () { function t(e, n, r, o) { if (s(this, t), Array.isArray(e) && e[0] instanceof j) { var a = e[0]; r = e, e = a.Bi, n = a.L, o = v.m(o, n) } return i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n, function (t, e, n) { Array.isArray(r) || (r = [r]); for (var i = 0; i < r.length; i++) r[i] instanceof j ? r[i].Ri()(t, e, n) : (console.log(r, i), r[i](t, e, n)) }, o)) } return o(t, j), t }(), M = function () { function t() { s(this, t) } return n(t, null, [{ key: "init", value: function () { t.Oi = [] } }, { key: "_i", value: function (e) { t.Oi.push(e) } }, { key: "ji", value: function (e) { return t.Vi(e, t.Ji()) } }, { key: "qi", value: function (e, n) { return t.zi(e, n, t.Ji()) } }, { key: "Vi", value: function (e, n) { return t.zi(e, t.Oi, n) } }, { key: "zi", value: function (e, n, r) { for (var i = document.createElement("div"), o = t.$i(), s = function (t) { if (n[t].Ii(o)) { var s = r(n[t], e); s.onclick = function (r) { n[t].Ri()(e, this, r) }, i.appendChild(s) } }, a = 0, u = n.length; a < u; a++) s(a); return i } }, { key: "$i", value: function () { return navigator.userAgent.match(/iPhone|iPad|iPod/i) ? j.Ei : null !== navigator.userAgent.match(/Android|BlackBerry|Opera Mini|IEMobile/i) || void 0 !== window.orientation ? j.Wi : j.Ui } }, { key: "Ji", value: function () { return function (t) { var e = document.createElement("a"); e.classList.add("share-icon"); var n = t.J(); if ("string" == typeof n) { var r = document.createElement("img"); r.src = v.Gt(t.J()), r.classList.add("share-icon"), e.appendChild(r) } else Promise.resolve(n).then(function (t) { e.appendChild(t) }); return e } } }]), t }(); M.init(), u.l("ShareManager.addShareButton", M._i); var A = function () { function t(e, n) { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, j.Ni, e, function (t) { var e; e = M.$i() === j.Ei ? "sms:&body=" + encodeURIComponent(t) : "sms:?&body=" + encodeURIComponent(t), window.open(e, "_blank", "noopener") }, n)) } return o(t, j), t }(), N = function () { function t(e, n) { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, j.TYPE_ALL, e, function (t) { var e = "https://t.me/share/url?url=" + encodeURIComponent(t); window.open(e, "_blank", "noopener") }, n)) } return o(t, j), t }(), I = function () { function t(e, n) { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, j.TYPE_ALL, e, function (t) { var e; e = M.$i() === j.Ui ? "https://web.whatsapp.com/send?text=" + encodeURIComponent(t) : "whatsapp://send?text=" + encodeURIComponent(t), window.open(e, "_blank", "noopener") }, n)) } return o(t, j), t }(), D = function () { function t(e, n) { var r; return s(this, t), (r = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, n))).Gi = e, r.active = !0, r } return o(t, _), n(t, [{ key: "qn", value: function () { return this.Gi } }, { key: "un", value: function () { return this.active } }]), t }(), B = function t(e, n, r) { s(this, t), this.De = e, this.Ie = n, this.L = r }; var q = function t() { s(this, t) }; q.Xi = {Qi: "version/2/ckeditor/ckeditor.js", Yi: "version/1/listjs/list.min.js"}; var K = function () { function t() { s(this, t) } return n(t, null, [{ key: "load", value: function () { var e = r(regeneratorRuntime.mark(function e(n, r, i) { var o; return regeneratorRuntime.wrap(function (e) { for (; ;) switch (e.prev = e.next) { case 0: return r = v.m(r, !1), i = v.m(i, !1), o = r ? v.Gt(t.Zi + n) : v.Gt(t.tr + n), e.abrupt("return", this.er(o, i)); case 3: case"end": return e.stop() } }, e, this) })); return function () { return e.apply(this, arguments) } }() }, { key: "er", value: function () { var t = r(regeneratorRuntime.mark(function t(e, n) { return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: return t.abrupt("return", fetch(e, {credentials: "same-origin"}).then(function (t) { return n ? t.text() : t.json() }).catch(function () { if (!n) return {success: !1, errors: ["not-online"]} })); case 1: case"end": return t.stop() } }, t, this) })); return function () { return t.apply(this, arguments) } }() }, { key: "nr", value: function () { var t = r(regeneratorRuntime.mark(function t(e, n) { var r; return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: return n = v.m(n, !1), r = v.Gt(e), t.abrupt("return", this.er(r, n)); case 3: case"end": return t.stop() } }, t, this) })); return function () { return t.apply(this, arguments) } }() }, { key: "send", value: function () { var e = r(regeneratorRuntime.mark(function e(n, r) { var i, o, s; return regeneratorRuntime.wrap(function (e) { for (; ;) switch (e.prev = e.next) { case 0: if (i = v.Gt(t.tr + n), !(r instanceof FormData)) { for (s in o = new FormData, r) o.append(s, r[s]); r = o } return e.abrupt("return", fetch(i, { credentials: "same-origin", method: "POST", body: r }).then(function (t) { return t.json() }).catch(function (t) { return console.error("error", t), {success: !1, errors: ["not-online"]} })); case 3: case"end": return e.stop() } }, e, this) })); return function () { return e.apply(this, arguments) } }() }, { key: "ae", value: function (t) { return v.ae(t) } }]), t }(); K.tr = "data/", K.Zi = "cached/"; var H = function () { function t(e, n, i, o) { s(this, t), this.sr = e, this.method = v.m(i, v.m(e.method, "POST")), this.ir = !0 === v.m(o, "get" === this.method.toLowerCase()), this.rr = !1, this.or = "string" == typeof n ? function (t) { return "get" === l.method.toLowerCase() ? K.load(n + K.ae(t), l.ir) : K.send(n, t) } : n; var a, u, l = this; this.ar = null, this.lr = (u = r(regeneratorRuntime.mark(function t(e) { return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: return t.next = 2, l.hr(e); case 2: case"end": return t.stop() } }, t, this) })), function () { return u.apply(this, arguments) }), e.addEventListener("submit", (a = r(regeneratorRuntime.mark(function t(e) { return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: return console.log("submitting!", e), e.preventDefault(), t.next = 4, l.ur(e); case 4: case"end": return t.stop() } }, t, this) })), function () { return a.apply(this, arguments) })); for (var c = 0, h = e.elements.length; c < h; c++) { var f = e.elements[c]; f.addEventListener("change", function () { "" !== this.value.trim() ? this.classList.add("notEmpty") : this.classList.remove("notEmpty"), this.setCustomValidity("") }), f.addEventListener("keydown", function () { this.setCustomValidity("") }) } } return n(t, [{ key: "cr", value: function (t, e) { var n; n = (e = v.m(e, !0)) ? function (e) { if (Array.isArray(e) && e.indexOf("optimistic-locking-exception") >= 0) { var n = new R("optimistic-locking-dialog", "optimistic-locking-dialog-title"); n.ii(), n.show() } else t(e) } : t, this.lr = n } }, { key: "ur", value: function () { if (!this.rr) { var t = this; return this.submit().then(function (e) { if (e.success) { if (null !== t.ar) return t.ar(e.result) } else if (v.R(t.lr)) return t.lr(e.errors) }) } } }, { key: "load", value: function (t, e) { return this.dr(K.load(t, e).then(function (t) { return t.success ? t.result : {} })), this } }, { key: "dr", value: function (t) { this.mr(!0); var e = this; return Promise.resolve(t).then(function (t) { for (var n in e.mr(!1), t) if (v.R(e.sr.elements[n])) { if (v.R(e.sr.elements[n].options) && v.R(t[n + "Options"])) { var r = e.sr.elements[n].options; for (var i in t[n + "Options"]) { var o = document.createElement("option"); o.value = i, o.innerText = t[n + "Options"][i], r.add(o) } } e.sr.elements[n].value = v.we(t[n]), v.R(t[n]) && "" !== ("" + t[n]).trim() ? e.sr.elements[n].classList.add("notEmpty") : e.sr.elements[n].classList.remove("notEmpty") } return e }) } }, { key: "hr", value: function () { var t = r(regeneratorRuntime.mark(function t(e) { var n, r, i, o; return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: for (i in n = !1, r = null, e) v.R(this.sr.elements[i]) && "hidden" !== this.sr.elements[i].type && v.Mt(this.sr.elements[i].gr) && (v.Mt(this.sr.elements[i].disabled) || !this.sr.elements[i].disabled) && (this.sr.elements[i].setCustomValidity(d.translate(v.m(e[i], "form-default-error"))), n = !0), v.Mt(r) && (r = v.m(e[i], "form-default-error")); if (n || !v.R(r)) { t.next = 11; break } t.t0 = regeneratorRuntime.keys(this.sr.elements); case 4: if ((t.t1 = t.t0()).done) { t.next = 11; break } if (o = t.t1.value, "hidden" === this.sr.elements[o].type) { t.next = 9; break } return this.sr.elements[o].setCustomValidity(d.translate(r)), n = !0, t.abrupt("break", 11); case 9: t.next = 4; break; case 11: n && this.sr.querySelector("input[type=submit]").click(); case 12: case"end": return t.stop() } }, t, this) })); return function () { return t.apply(this, arguments) } }() }, { key: "mr", value: function (t) { this.rr = t, this.rr ? this.sr.classList.add("sending") : this.sr.classList.remove("sending") } }, { key: "submit", value: function () { var t = this; return new Promise(function (e) { t.mr(!0); var n = new FormData(t.sr); e(t.or(n)) }).then(function (e) { return t.mr(!1), e }) } }, { key: "pr", value: function (t) { this.ar = t } }]), t }(), F = function () { function t() { s(this, t), this.ke = null, this.wr = "settings" } return n(t, null, [{ key: "Kt", value: function () { return null === t.Sr && (t.Sr = new t), t.Sr } }]), n(t, [{ key: "Mr", value: function () { return v.Mt(this.ke) && this.Hr(), this.ke } }, { key: "yr", value: function (t, e) { var n = this.Mr(); return v.R(n[t]) ? n[t].value : e } }, { key: "vr", value: function (t) { this.Mr(), delete this.ke[t], this.Pr() } }, { key: "Tr", value: function (t, e) { this.Mr(), this.ke[t] = {Lr: (new Date).getTime(), value: e}, this.Pr() } }, { key: "br", value: function (t) { for (var e in this.Mr(), t) this.ke[e] = t[e]; this.Pr() } }, { key: "Ar", value: function (t) { return v.m(this.ke[t]) } }, { key: "Hr", value: function () { this.ke = localStorage.getItem(this.wr), null === this.ke ? this.ke = {} : this.ke = JSON.parse(this.ke) } }, { key: "Pr", value: function () { null !== this.ke && localStorage.setItem(this.wr, JSON.stringify(this.ke)) } }]), t }(); F.Sr = null; var V = function () { function t() { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments)) } return o(t, D), n(t, [{ key: "hn", value: function () { for (var n = e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "hn", this).call(this), r = this.gn(".setting", !0), i = F.Kt(), o = function (t) { var e = r[t], n = e.name, o = void 0; o = e.dataset.raw ? localStorage.getItem(n) : i.yr(n); var s = !1; e instanceof HTMLInputElement && ("checkbox" === e.type || "radio" === e.type) && (s = !0), (!e.dataset.raw && !i.Ar(n) || e.dataset.raw && null === o) && v.R(r[t].dataset.default) && (o = e.dataset.default, v.R(e.dataset.defaultTranslateable) && (e.dataset.translation = "", e.dataset.translationValue = o, o = d.translate(o))), v.R(o) && (s ? e.checked = o === e.value : e.value = o, "" !== o && e.classList.add("notEmpty")), e.addEventListener("change", function () { var t = this.value; s && !this.checked && (t = null), e.dataset.raw ? localStorage.setItem(n, t) : i.Tr(n, t), delete e.dataset.translationValue, delete e.dataset.translation }) }, s = 0; s < r.length; s++) o(s); return n } }, { key: "ln", value: function () { for (var n = e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "ln", this).call(this), r = this.gn(".setting", !0), i = F.Kt(), o = 0; o < r.length; o++) { var s, a = r[o], u = a.name; s = a.dataset.raw ? localStorage.getItem(u) : i.yr(u); var l = !1; a instanceof HTMLInputElement && ("checkbox" === a.type || "radio" === a.type) && (l = !0), v.R(s) && (l ? a.checked = s === a.value : a.value = s, "" !== s && a.classList.add("notEmpty")) } return n } }]), t }(), U = function () { function t(e, n, r) { s(this, t), this.De = e, this.Cr = n, this.kr = v.m(r, !0), this.Fr = !0, this.xr = -1, this.Br = null } return n(t, [{ key: "Dr", value: function (t) { return this.Br = t, this } }, { key: "Ir", value: function (t) { this.xr = t } }, { key: "Rr", value: function () { return this.De } }, { key: "Ur", value: function () { return this.Cr } }, { key: "Er", value: function () { var t = document.createElement("th"); return t.appendChild(this.kr ? d.pt(this.Cr) : document.createTextNode(this.Cr)), this.Fr && (t.classList.add("sort"), t.dataset.sort = this.De), t.dataset.column = this.xr, this.Wr = t, this.Wr } }, { key: "Nr", value: function () { return this.De } }, { key: "Or", value: function (t) { return t } }, { key: "_r", value: function () { var t = document.createElement("td"); return t.classList.add(this.De), t.dataset.column = this.xr, v.R(this.Br) && t.classList.add("clickable"), t } }, { key: "click", value: function (t, e, n) { v.R(this.Br) && this.Br(t, e, n) } }]), t }(), z = function () { function t(e, n, r, o) { var a; return s(this, t), (a = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n, r))).Fr = !1, a.jr = v.m(o, !1), a } return o(t, U), n(t, [{ key: "Nr", value: function () { return null } }, { key: "_r", value: function () { var n = e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "_r", this).call(this); return n.classList.remove(this.De), n.appendChild(this.jr ? d.pt(this.De) : document.createTextNode(this.De)), n } }]), t }(), Y = function () { function t(e, n, r) { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n, r = v.m(r, !1))) } return o(t, U), n(t, [{ key: "Er", value: function () { return document.createTextNode("") } }, { key: "Nr", value: function () { return {data: [this.De]} } }, { key: "_r", value: function () { return document.createTextNode("") } }]), t }(), W = function () { function t(e, n, r) { var o; return s(this, t), (o = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n, r))).jr = !1, o } return o(t, z), n(t, [{ key: "_r", value: function () { var n = e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "_r", this).call(this), r = document.createElement("img"); return r.src = this.De, n.removeAllChildren().appendChild(r), n } }]), t }(), X = function () { function t(e, n, r) { s(this, t), this.Vr = e, this.Jr = v.m(n, {}), this.qr = r, "string" == typeof this.Vr && (this.Vr = document.getElementById(this.Vr)), this.zr = [], Array.isArray(n) ? this.zr = n : v.R(n.columns) && (this.zr = n.columns) } return n(t, [{ key: "Or", value: function (t) { if (console.log("prepareData", t), v.R(t)) for (var e = 0, n = t.length; e < n; e++) t[e] = this.$r(t[e]); return t } }, { key: "$r", value: function (t) { console.log("prepareDataset", t); for (var e = 0, n = this.zr.length; e < n; e++) v.R(t[this.zr[e].Rr()]) && (t[this.zr[e].Rr()] = this.zr[e].Or(t[this.zr[e].Rr()], t)); return t } }, { key: "Gr", value: function () { v.R(this.zr) && this.Kr(); var t = this.Vr, e = this.Jr, n = this.qr; e.item = v.m(e.item, t.id + "-template-item"), e.page = v.m(e.page, 5), e.pagination = v.m(e.pagination, { outerWindow: 1, innerWindow: 1 }); var r = document.getElementById(e.item); r && (e.item = r.outerHTML, r.remove()), n = this.Or(n); var i = new List(t, e, n), o = this; return t.querySelector("." + v.m(e.listClass, "list")).addEventListener("click", function (t) { var e = t.target.closest("td[data-column]"), n = parseInt(e.dataset.column); o.zr.length > n && o.zr[n].click(e, i, t) }), this.list = i, i } }, { key: "Kr", value: function () { for (var t = document.createElement("tr"), e = document.createElement("tr"), n = [], r = 0, i = this.zr.length; r < i; r++) { this.zr[r].Ir(r), t.appendChild(this.zr[r].Er()), e.appendChild(this.zr[r]._r()); var o = this.zr[r].Nr(); v.R(o) && n.push(o) } var s = this.Vr.querySelector("thead"), a = this.Vr.querySelector("tfoot"); v.R(s) && s.removeAllChildren().appendChild(t), v.R(a) && a.removeAllChildren().appendChild(v.cloneNode(t)), this.Jr.item = e.outerHTML, this.Jr.valueNames = n } }, { key: "Xr", value: function () { return this.list } }, { key: "Qr", value: function (t, e, n) { var r = this.list.get(t, e); v.R(r) && r.length >= 1 && (n = this.$r(n), r[0].values(n)) } }, { key: "Yr", value: function (t) { t ? this.Vr.classList.add("sending") : this.Vr.classList.remove("sending") } }]), t }(), J = function () { function t(e) { s(this, t); var n = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, t.Zr, "settings")); for (var r in t.to) n.eo(r, new t.to[r](n)); return n.active = null, n } return o(t, b), n(t, [{ key: "eo", value: function (t, e) { this.mn("#settings-fragments", e), delete this.rn["#settings-fragments"], this.rn[t] = e } }, { key: "ln", value: function () { var n = e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "ln", this).call(this); return v.R(this.active) && !this.rn[this.active].un() && this.setActive(null), this.no(), n } }, { key: "setActive", value: function (t) { v.R(this.active) && (this.rn[this.active].sn.then(function (t) { t.classList.remove("active") }), this.gn("#show-fragment-" + this.active).classList.remove("active")), this.active = t, v.R(this.active) && (this.rn[this.active].sn.then(function (t) { t.classList.add("active") }), this.gn("#show-fragment-" + this.active).classList.add("active")) } }, { key: "no", value: function () { var t = this, e = this.gn("#settings-fragment-list"); e.removeAllChildren(); var n = this, r = function (r) { if (t.rn[r].un()) { var i = document.createElement("li"); i.id = "show-fragment-" + r, i.appendChild(d.pt(r, null, "a")), i.addEventListener("click", function () { n.setActive(r) }), e.appendChild(i), v.Mt(t.active) && t.setActive(r) } }; for (var i in this.rn) r(i) } }], [{ key: "eo", value: function (e, n) { t.to[e] = n } }, { key: "so", value: function (e) { t.io = e } }, { key: "ro", value: function (e) { t.Zr = e } }]), t }(); J.Zr = "core/html/settings.html", J.to = {}, J.io = !0, J.oo = null, J.ao = !0, a.t(function (t) { var e = this; if (J.io) { if (t.Ns("settings", J), v.Mt(J.oo)) { var n = new l("settings", r(regeneratorRuntime.mark(function n() { var r, i; return regeneratorRuntime.wrap(function (e) { for (; ;) switch (e.prev = e.next) { case 0: if (!((r = t.ms()) instanceof J)) { e.next = 5; break } r.finish(), e.next = 9; break; case 5: return e.next = 7, t.gs(function (t) { return t instanceof J }); case 7: i = e.sent, v.R(i) ? i.kn() : t.Ln(J); case 9: case"end": return e.stop() } }, n, e) })), l.Z, 1e4); n.q("img/settings.png"), J.oo = n } J.ao && t.ds(J.oo) } }); var G = function () { function t() { s(this, t) } return n(t, null, [{ key: "init", value: function (e) { t.lo = null, t.ho = {uo: !1, id: null, accesses: ["default"]}, t.app = e, t.co = new Promise(function (e) { t.do = e }) } }, { key: "setData", value: function (e) { t.ho = Object.assign(t.ho, e); var n = t.app.Ds(); n && n.Hs() } }, { key: "mo", value: function (e) { return t.lo = v.m(e, t.lo), K.load(t.lo).then(function (e) { e.success && t.setData(e.result), t.do() }) } }, { key: "po", value: function () { return K.load("u/logout").then(function (e) { if (e.success) { t.setData(e.result); var n = t.app.Ds(); n && n.Ms(), E.oi(E.ai, d.translate("logged-out-successfully")) } }) } }, { key: "fo", value: function (e) { return t.ho.accesses.indexOf(e) >= 0 } }, { key: "So", value: function (e, n) { t.wo(function (r) { n(r && t.Mo(e)) }) } }, { key: "wo", value: function (e) { this.co.then(function () { e(t.Ho()) }) } }, { key: "Mo", value: function (e) { return t.ho.id === e } }, { key: "Ho", value: function () { return v.R(t.ho) && v.R(t.ho.id) } }]), t }(); a.t(function (t) { return G.init(t), G.mo("u/me").then(function () { G.wo(function (t) { if (t) { var e = F.Kt(), n = v.Se(e.Mr()); for (var r in n) n[r].value = JSON.stringify(n[r].value); K.send("u/syncSettings", n).then(function (t) { if (t.success) { for (var n in t.result) t.result[n].value = JSON.parse(t.result[n].value); e.br(t.result) } }) } }) }) }); var $ = function () { function t(e, n, r, o, a) { var u; return s(this, t), (u = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n, r, o))).yo = v.m(a, "default"), u } return o(t, l), n(t, [{ key: "O", value: function () { return e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "O", this).call(this) && G.fo(this.yo) } }, { key: "vo", value: function () { return this.yo } }, { key: "K", value: function (n) { var r = e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "K", this).call(this, v.m(n, new t)); return r.yo = this.yo, r } }]), t }(), Q = function () { function t(e) { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, "userManagement/html/403.html")) } return o(t, b), t }(), Z = function () { function t(e, n, r, o) { var a; return s(this, t), (a = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n, r))).yo = o, a } return o(t, b), n(t, [{ key: "an", value: function (n) { return G.fo(this.yo) ? e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "an", this).call(this, n) : (this.Ln(Q), void this.finish({error: 403})) } }, { key: "ln", value: function (n) { return G.fo(this.yo) ? e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "ln", this).call(this, n) : (this.Ln(Q), void this.finish({error: 403})) } }]), t }(), tt = function () { function t(e, n, r, o) { s(this, t); var a = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n, r, o)), u = e.querySelector("#email"), l = e.querySelector("#password"), c = function () { u.setCustomValidity(""), l.setCustomValidity("") }; return u.addEventListener("keydown", c), l.addEventListener("keydown", c), a } return o(t, H), t }(), et = function () { function t(e, n, r, o) { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n, r, o)) } return o(t, H), n(t, [{ key: "Po", value: function () { } }]), t }(), nt = function () { function t(e, n, r) { var o; return s(this, t), (o = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, n))).yo = r, o } return o(t, D), n(t, [{ key: "un", value: function () { return e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "un", this).call(this) && G.fo(this.yo) } }]), t }(), rt = function () { function t(e) { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, "userManagement/html/fragments/passwordSettings.html", "online")) } return o(t, nt), n(t, [{ key: "hn", value: function () { var n = e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "hn", this).call(this), r = new H(document.getElementById("change-password-form"), "u/passwordSettings/set", "post"); return r.pr(function (t) { for (var e = 0, n = t.length; e < n; e++) E.oi(t[e]); r.dr({oldPassword: "", newPassword1: "", newPassword2: ""}) }), n } }]), t }(); a.t(function () { J.eo("password-settings", rt) }); var it = function () { function t(e) { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, "userManagement/html/fragments/userSettings.html", "online")) } return o(t, nt), n(t, [{ key: "hn", value: function () { var n = e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "hn", this).call(this); return new H(document.getElementById("user-settings-form"), "u/userSettings/set", "post").load("u/userSettings").pr(function (t) { for (var e = 0, n = t.length; e < n; e++) E.oi(t[e]) }), n } }]), t }(); a.t(function () { J.eo("user-settings", it) }); var ot = function () { function t(e) { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, "userManagement/html/editUserRoles.html", "userRoles", "admin")) } return o(t, Z), n(t, [{ key: "an", value: function (n) { var r = e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "an", this).call(this, n); this.userId = n.id; var i = this; return Promise.all([S.Ci(q.Xi.Yi), K.load("u/userRoles" + K.ae({id: i.userId})).then(function (t) { t.success ? (i.To(t.result.userRoles), i.Lo(t.result.availableRoles), i.bo(t.result.username)) : (E.oi(t.errors[0]), i.finish()) })]).then(function () { return r }) } }, { key: "hn", value: function () { this.gn("#username").innerHTML = this.username; var t = this.gn("#userRoles"), e = this.gn("#availableRoles"), n = new W("img/minus.png", "", !1), r = new W("img/plus.png", "", !1), i = [new Y("id"), new U("name", "name"), new U("description", "description"), n], o = [new Y("id"), new U("name", "name"), new U("description", "description"), r], s = new X(t, i, this.userRoles), a = new X(e, o, this.availableRoles), u = s.Gr(), l = a.Gr(), c = this, h = function (t, e) { return s.Yr(!0), a.Yr(!0), K.send("u/changeUserRole", { id: t, userId: c.userId, add: e }).then(function (e) { if (s.Yr(!1), a.Yr(!1), !e.success) return E.oi(e.errors[0]), e; var n = null, r = null; e.result.hasRole ? (n = l, r = u) : (r = l, n = u); var i = n.get("id", t); return 1 === i.length && (r.add(i[0].values()), n.remove("id", t)), e }) }; n.Dr(function (t) { var e = t.closest("tr").dataset.id; h(e, !1) }), r.Dr(function (t) { var e = t.closest("tr").dataset.id; h(e, !0) }) } }, { key: "To", value: function (t) { this.userRoles = t } }, { key: "Lo", value: function (t) { this.availableRoles = t } }, { key: "bo", value: function (t) { this.username = t } }]), t }(); a.t(function (t) { t.Ns("userRoles", ot), t.ds(new $("userRoles", function () { t.Ln(ot) }, null, 1100, "admin")) }); var st = function () { function t(e) { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, "userManagement/html/forgotPassword.html", "forgotPassword", "offline")) } return o(t, Z), n(t, [{ key: "hn", value: function () { var t = this; new H(document.getElementById("forgot-password-form"), "u/newPassword", "post").pr(function () { E.oi(E.ai, d.translate("new-password-code-send")), t.finish() }) } }]), t }(); a.t(function (t) { t.Ns("forgotPassword", st) }); var at = function () { function t(e) { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, "userManagement/html/login.html", "login", "offline")) } return o(t, Z), n(t, [{ key: "hn", value: function () { var t = this; new tt(document.getElementById("login-form"), "u/login", "post").pr(function (e) { G.setData(e), t.Tn(), E.oi(E.ai, d.translate("login-success")), t.finish() }), this.gn("#forgot-password-link").addEventListener("click", function () { t.Ln(st), t.finish() }) } }]), t }(); at.Ao = null, at.Co = null, at.ko = !0, at.Fo = !0, a.t(function (t) { t.Ns("login", at), v.Mt(at.Ao) && (at.Ao = new $("login", function () { t.Ln(at) }, h.tt, 1100, "offline")), v.Mt(at.Co) && (at.Co = new $("logout", function () { G.po() }, h.tt, 1100, "online")), at.ko && t.ds(at.Ao), at.Fo && t.ds(at.Co) }); var ut = function () { function t(e) { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, "userManagement/html/registration.html", "registration", "offline")) } return o(t, Z), n(t, [{ key: "hn", value: function () { new et(document.getElementById("registration-form"), "u/registration", "post").pr(function () { E.oi(E.ai, d.translate("registration-success")) }) } }]), t }(); ut.action = null, ut.at = !0, a.t(function (t) { t.Ns("registration", ut), v.Mt(ut.action) && (ut.action = new $("registration", function () { t.Ln(ut) }, null, 1100, "offline")), ut.at && t.ds(ut.action) }); var lt = function () { function t(e) { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, "userManagement/html/setNewPassword.html", "newPassword", "offline")) } return o(t, Z), n(t, [{ key: "an", value: function (n) { return this.code = n.code, e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "an", this).call(this, n) } }, { key: "hn", value: function () { var t = document.getElementById("new-password-form"); document.getElementById("code").value = this.code; var e = this; new H(t, "c/code", "post").pr(function () { E.oi(E.ai, d.translate("password-updated")), e.Ln(at), e.finish() }) } }]), t }(); a.t(function (t) { t.Ns("newPassword", lt) }); var ct = function () { function t() { s(this, t) } return n(t, [{ key: "estimate", value: function () { var t = r(regeneratorRuntime.mark(function t() { return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: return t.abrupt("return", "storage" in navigator && "estimate" in navigator.storage ? navigator.storage.estimate() : "webkitTemporaryStorage" in navigator && "queryUsageAndQuota" in navigator.webkitTemporaryStorage ? new Promise(function (t) { navigator.webkitTemporaryStorage.queryUsageAndQuota(function (e, n) { t({usage: e, quota: n}) }) }) : Promise.resolve({usage: NaN, quota: NaN})); case 1: case"end": return t.stop() } }, t, this) })); return function () { return t.apply(this, arguments) } }() }, { key: "xo", value: function () { var t = r(regeneratorRuntime.mark(function t() { return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: return t.abrupt("return", this.Bo() ? navigator.storage.persisted() : Promise.resolve(!1)); case 1: case"end": return t.stop() } }, t, this) })); return function () { return t.apply(this, arguments) } }() }, { key: "Do", value: function () { return "storage" in navigator && "estimate" in navigator.storage || "webkitTemporaryStorage" in navigator && "queryUsageAndQuota" in navigator.webkitTemporaryStorage } }, { key: "Bo", value: function () { return navigator.storage && navigator.storage.persist } }, { key: "persist", value: function () { return this.Bo() ? navigator.storage.persist() : Promise.resolve(!1) } }], [{ key: "Kt", value: function () { return v.Mt(t.te) && (t.te = new t), t.te } }]), t }(); ct.te = null; var ht = function () { function t() { s(this, t) } return n(t, null, [{ key: "init", value: function () { var t = this; window.addEventListener("beforeinstallprompt", function (e) { e.preventDefault(), t.Io(e) }) } }, { key: "Io", value: function (t) { this.Ro = t, this.Uo && this.Uo(this.Ro) } }, { key: "prompt", value: function () { var t = r(regeneratorRuntime.mark(function t() { return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: return t.abrupt("return", v.R(this.Ro) ? (this.Ro.prompt(), this.Ro.userChoice.then(function (t) { return ct.Kt().persist(), t })) : Promise.resolve({outcome: "dismissed", platform: ""})); case 1: case"end": return t.stop() } }, t, this) })); return function () { return t.apply(this, arguments) } }() }, { key: "Eo", value: function () { return matchMedia("(display-mode: standalone)").matches } }, { key: "Wo", value: function (t, e) { this.Uo = t, (e = v.m(e, !0)) && v.m(this.Ro) && this.Uo(this.Ro) } }]), t }(); ht.init(); var ft = function () { function t() { s(this, t) } return n(t, null, [{ key: "init", value: function () { var e, n = this; t.No = new Promise((e = r(regeneratorRuntime.mark(function e(r) { var i; return regeneratorRuntime.wrap(function (e) { for (; ;) switch (e.prev = e.next) { case 0: if (i = v.m(localStorage.getItem(t.Oo), "1"), !v.Mt(i)) { e.next = 8; break } return e.next = 4, t._o(); case 4: i = e.sent, localStorage.setItem(t.Oo, i), e.next = 9; break; case 8: i = "1" === i, t.jo(i); case 9: r(i); case 10: case"end": return e.stop() } }, e, n) })), function () { return e.apply(this, arguments) })), t.No.then(function () { t.push(["trackPageView"], !0), t.push(["enableLinkTracking"], !0), t.push(["setTrackerUrl", t.Vo + "/piwik.php"], !0), t.push(["setSiteId", t.Jo + ""], !0); var e = document, n = e.createElement("script"), r = e.getElementsByTagName("head")[0]; n.type = "text/javascript", n.async = !0, n.defer = !0, n.src = t.Vo + "/piwik.js", r.appendChild(n) }) } }, { key: "update", value: function (e) { v.m(t.qo) && t.push(["setReferrerUrl", t.qo]), t.qo = window.location.pathname + window.location.search, t.push(["setCustomUrl", t.qo]), t.push(["setDocumentTitle", e]), t.push(["deleteCustomVariables", "page"]), t.push(["setGenerationTimeMs", 0]), t.push(["trackPageView"]); var n = document.getElementById("site-content"); t.push(["MediaAnalytics::scanForMedia", n]), t.push(["FormAnalytics::scanForForms", n]), t.push(["trackContentImpressionsWithinNode", n]), t.push(["enableLinkTracking"]) } }, { key: "_o", value: function () { var e = r(regeneratorRuntime.mark(function e() { return regeneratorRuntime.wrap(function (e) { for (; ;) switch (e.prev = e.next) { case 0: return e.abrupt("return", (t.No = new Promise(function (e) { t.push([function () { e(!this.isUserOptedOut()) }]), t.push([function () { e(!this.isUserOptedOut()) }]) }), t.No)); case 1: case"end": return e.stop() } }, e, this) })); return function () { return e.apply(this, arguments) } }() }, { key: "zo", value: function () { var e = r(regeneratorRuntime.mark(function e(n) { return regeneratorRuntime.wrap(function (e) { for (; ;) switch (e.prev = e.next) { case 0: return e.abrupt("return", fetch(t.Vo + t.$o + n, { mode: "cors", credentials: "include" }).then(function (t) { return t.text() }).then(function (t) { return (new window.DOMParser).parseFromString(t, "text/xml") })); case 1: case"end": return e.stop() } }, e, this) })); return function () { return e.apply(this, arguments) } }() }, { key: "Go", value: function () { return t.No } }, { key: "jo", value: function () { var e = r(regeneratorRuntime.mark(function e(n) { return regeneratorRuntime.wrap(function (e) { for (; ;) switch (e.prev = e.next) { case 0: t.No = Promise.resolve(n), localStorage.setItem(t.Oo, !0 === n ? "1" : "0"), n ? t.push(["forgetUserOptOut"], !0) : t.push(["optUserOut"], !0); case 1: case"end": return e.stop() } }, e, this) })); return function () { return e.apply(this, arguments) } }() }, { key: "Ko", value: function () { var t = r(regeneratorRuntime.mark(function t(e, n, r, i) { var o; return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: return o = ["trackEvent", e, n], t.abrupt("return", (v.R(r) && o.push(r), v.R(i) && !isNaN(parseFloat(i)) && isFinite(i) && o.push(i), this.push(o))); case 2: case"end": return t.stop() } }, t, this) })); return function () { return t.apply(this, arguments) } }() }, { key: "push", value: function () { var t = r(regeneratorRuntime.mark(function t(e) { return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: Array.isArray(e) || (e = [e]), window._paq.push(e); case 1: case"end": return t.stop() } }, t, this) })); return function () { return t.apply(this, arguments) } }() }]), t }(); ft.qo = null, ft.Oo = "matomoShouldTrack", ft.Vo = "//matomo.silas.link", ft.$o = "/index.php?module=API&method=AjaxOptOut.", ft.Jo = "1", a.t(function () { window._paq = window._paq || [], ft.init() }); var pt = function () { function t(e, n, r) { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, [e, function (t) { ft.Ko("shared", t, n) }], r)) } return o(t, T), t }(); u.l("MatomoShareButton", pt); var dt = function () { function t() { s(this, t) } return n(t, [{ key: "Xo", value: function () { var t = r(regeneratorRuntime.mark(function t(e, n, r, i, o, s, a, u, l) { var c, h, f; return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: return l = v.m(l, !0), u = v.m(u, 0), t.next = 3, this.Qo(e, n, r, i, o, s, a, 0 === u); case 3: if (c = t.sent, t.t0 = u > 0, !t.t0) { t.next = 8; break } return t.next = 8, new Promise(function (t) { setTimeout(t, u), n.style.fontSize = c + "px" }); case 8: return h = this, f = function () { return new Promise(function (t) { setTimeout(function () { t(h.Xo(e, n, r, i, o, s, a, u, !1)) }, "number" == typeof l ? l : 255) }) }, t.abrupt("return", (!1 !== l && window.addEventListener("resize", f), f)); case 10: case"end": return t.stop() } }, t, this) })); return function () { return t.apply(this, arguments) } }() }, { key: "Yo", value: function () { var t = r(regeneratorRuntime.mark(function t(e, n, r, i, o, s, a, u) { return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: return t.abrupt("return", this.Xo(1, e, n, r, i, o, s, a, u)); case 1: case"end": return t.stop() } }, t, this) })); return function () { return t.apply(this, arguments) } }() }, { key: "Qo", value: function () { var t = r(regeneratorRuntime.mark(function t(e, n, r, i, o, s, a, u) { var l, c, h, f, p, d, m, y, g, k, w, _; return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: for (s = v.m(s, 10), i = v.m(i, !1), o = v.m(o, !1), a = v.m(a, n.innerHTML.length), u = v.m(u, !0), (l = r.classList.contains("no-transition")) || r.classList.add("no-transition"), c = 0, h = [], f = 0; f < 5; f++) h.push(0); p = n.style.fontSize, d = 1, m = 0, y = 0, g = 0, k = 0; case 6: if (d += h[c] / (a + 1), n.style.fontSize = d + "px", w = window.getComputedStyle(r), g = w.getPropertyValue("width").replace("px", ""), k = w.getPropertyValue("height").replace("px", ""), m = g - n.offsetWidth, y = k - n.offsetHeight, c = (c + 1) % 5, (_ = o ? y : i ? m : Math.min(m, y)) !== h[(c + 1) % 5]) { t.next = 12; break } return t.abrupt("break", 14); case 12: h[c] = _; case 13: if ((m > (1 - e) * g || o) && (y > (1 - e) * k || i)) { t.next = 6; break } case 14: if (d -= s, n.style.fontSize = u ? d + "px" : p, t.t0 = l, t.t0) { t.next = 21; break } return t.next = 20, new Promise(function (t) { setTimeout(t, 50) }); case 20: r.classList.remove("no-transition"); case 21: return t.abrupt("return", d); case 22: case"end": return t.stop() } }, t, this) })); return function () { return t.apply(this, arguments) } }() }]), t }(), vt = function () { function t(e, n, r) { s(this, t), this.buffer = n, this.Zo = !1, this.loopStart = null, this.loopEnd = null, this.ta = r, this.context = e, this.startTime = null, this.ea = null, this.source = null, this.na = !1 } return n(t, [{ key: "sa", value: function (t) { this.buffer = t } }, { key: "ia", value: function (t, e, n) { this.Zo = t, v.R(e) && (this.loopStart = e), v.R(n) && (this.loopEnd = n) } }, { key: "start", value: function () { var t = r(regeneratorRuntime.mark(function t(e, n, r) { var i; return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: return e = v.m(e, 0), n = v.m(n, 0), (i = this.context.createBufferSource()).loop = this.Zo, v.R(this.loopStart) && (i.loopStart = this.loopStart), v.R(this.loopEnd) && (i.loopEnd = this.loopEnd), i.buffer = this.buffer, t.next = 8, this.ta(i); case 8: v.Mt(r) ? i.start(e, n) : i.start(e, n, r), this.startTime = (new Date).getTime() - 1e3 * v.m(n, 0), this.source = i, this.na = !0; case 12: case"end": return t.stop() } }, t, this) })); return function () { return t.apply(this, arguments) } }() }, { key: "stop", value: function () { var t = r(regeneratorRuntime.mark(function t(e) { return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: return t.abrupt("return", v.R(this.source) ? (e = v.m(e, 0), this.ea = (new Date).getTime() - this.startTime, this.na = !1, this.source.stop(e)) : null); case 1: case"end": return t.stop() } }, t, this) })); return function () { return t.apply(this, arguments) } }() }, { key: "resume", value: function () { var t = r(regeneratorRuntime.mark(function t() { return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: if (this.na) { t.next = 2; break } return t.abrupt("return", this.start(null, v.m(this.ea, 0) / 1e3)); case 2: case"end": return t.stop() } }, t, this) })); return function () { return t.apply(this, arguments) } }() }]), t }(), mt = function () { function e() { var t = this; s(this, e), this.ra = {}, this.context = new AudioContext, this.context.onstatechange = function () { console.log("stateChange from context", arguments) }, this.context.oncomplete = function () { console.log("onComplete from context", arguments) }, window.addEventListener("visibilitychange", function () { t.oa() }) } return n(e, null, [{ key: "Kt", value: function () { return v.Mt(e.te) && (e.te = new e), e.te } }]), n(e, [{ key: "aa", value: function () { return "suspended" !== this.context.state } }, { key: "set", value: function (t, n) { var r = this; n = v.m(n, e.ha.la); var i = v.m(this.ra[n], {}); "string" == typeof t && (t = {ua: t}); var o = t.ua; return v.R(o) && (i.ca = fetch(o).then(function (t) { return t.arrayBuffer() }).then(function (t) { return new Promise(function (e) { return r.context.decodeAudioData(t, e) }) }).catch(function (t) { return console.error(t) }), this.stop(n)), i.muted = v.m(t.muted, i.muted, !1), i.volume = v.m(t.volume, i.volume, 1), i.loop = v.m(t.loop, i.loop, !1), i.da = v.m(t.da, i.da, 0), this.ra[n] = i, i.muted && this.stop(n), this.ra[n] } }, { key: "ma", value: function () { var t = r(regeneratorRuntime.mark(function t() { return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: if ("function" != typeof this.context.resume) { t.next = 2; break } return t.abrupt("return", this.context.resume()); case 2: case"end": return t.stop() } }, t, this) })); return function () { return t.apply(this, arguments) } }() }, { key: "play", value: function () { var n = r(regeneratorRuntime.mark(function n(r, i) { var o, s, a = this; return regeneratorRuntime.wrap(function (n) { for (; ;) switch (n.prev = n.next) { case 0: if (this.ma(), r = v.m(r, e.ha.la), v.Mt(i) ? i = {} : "object" != (void 0 === i ? "undefined" : t(i)) && (i = {ua: i}), i.da = v.m(i.da, 0), this.stop(r), this.set(i, r), this.ra[r].muted) { n.next = 10; break } return n.next = 3, this.ra[r].ca; case 3: return o = n.sent, (s = new vt(this.context, o, function (t) { var e = a.context.createGain(); e.gain.value = a.ra[r].volume, t.connect(e), e.connect(a.context.destination) })).sa(o), s.ia(this.ra[r].loop, .3, o.duration - .3), this.ra[r].source = s, n.next = 10, s.start(); case 10: return n.abrupt("return", this.ra[r]); case 11: case"end": return n.stop() } }, n, this) })); return function () { return n.apply(this, arguments) } }() }, { key: "stop", value: function (t) { t = v.m(t, e.ha.la); var n = this.ra[t]; v.R(n) && v.R(n.source) && n.source.stop() } }, { key: "get", value: function (t) { return t = v.m(t, e.ha.la), this.ra[t] } }, { key: "resume", value: function () { var t = r(regeneratorRuntime.mark(function t(n) { return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: if (n = v.m(n, e.ha.la), !v.R(this.ra[n]) || this.ra[n].muted || !v.R(this.ra[n].source)) { t.next = 2; break } return t.abrupt("return", this.ra[n].source.resume()); case 2: case"end": return t.stop() } }, t, this) })); return function () { return t.apply(this, arguments) } }() }, { key: "ga", value: function () { for (var t in this.ra) v.R(this.ra[t].source) && this.ra[t].source.stop() } }, { key: "pa", value: function () { for (var t in this.ra) v.R(this.ra[t]) && !this.ra[t].muted && v.R(this.ra[t].source) && this.ra[t].source.resume() } }, { key: "oa", value: function () { document.hidden ? this.ga() : this.pa() } }]), e }(); mt.ha = {fa: "music", Sa: "sound", la: "default"}, a.t(function () { L.Ps.push(function () { mt.Kt().ga() }), L.vs.push(function () { mt.Kt().pa() }) }); var yt = function () { function t(e) { s(this, t), "string" == typeof e && (e = {code: e}), this.wa = e, this.Ma = !1 } return n(t, [{ key: "Ha", value: function (t) { this.Ma = t } }, { key: "ya", value: function () { return this.Ma } }, { key: "va", value: function () { return K.send("c/code", this.wa) } }]), t }(), gt = function () { function t(e) { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, "core/html/load.html", "code")) } return o(t, b), n(t, [{ key: "an", value: function (n) { e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "an", this).call(this, n), console.log(n); Promise.resolve(); if (v.R(n.code)) { var r = n.code, i = v.m(n.cachable, !1), o = new yt(r); o.Ha(i); var s = this; o.va().then(function (t) { t.success ? E.oi(E.ai, d.translate(v.m(t.result.successMessage, "code-activated"))) : E.oi(E.ai, d.translate(t.errors[0])), s.finish() }) } } }]), t }(); a.t(function (t) { t.Ns("code", gt) }); var kt = function () { function t(e) { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, "contact/html/contact.html", t.Pa)) } return o(t, b), n(t, [{ key: "hn", value: function () { var n = this; new H(this.gn("#contact-form"), "contact", "post").pr(function () { E.oi("contact-message-sent"), n.finish() }), e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "hn", this).call(this) } }]), t }(); kt.Pa = "contactMe", a.t(function (t) { kt.Pa && t.Ns(kt.Pa, kt) }); var wt = function () { function t() { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments)) } return o(t, b), t }(), _t = function () { function t(e, n, r, i) { s(this, t), this.Ta = e, this.La = n, this.ba = r, this.Aa = i } return n(t, [{ key: "Ca", value: function () { return v.cloneNode(this.Ta) } }, { key: "ka", value: function () { return v.cloneNode(this.La) } }, { key: "Fa", value: function () { return v.cloneNode(this.ba) } }, { key: "xa", value: function () { return v.cloneNode(this.Aa) } }]), t }(), bt = function () { function t(e) { s(this, t), this.rotation = 0, this.vn = e, this.parent = null } return n(t, [{ key: "Ba", value: function (t) { return t } }, { key: "Da", value: function () { return !1 } }, { key: "Ia", value: function (t) { this.parent = t } }, { key: "Ra", value: function () { if (null !== this.parent) return this.parent.Ra() } }, { key: "Ua", value: function () { return !1 } }, { key: "Ea", value: function () { return 0 === this.rotation } }, { key: "rotate", value: function () { var t = r(regeneratorRuntime.mark(function t() { return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: return t.abrupt("return", Promise.resolve()); case 1: case"end": return t.stop() } }, t, this) })); return function () { return t.apply(this, arguments) } }() }, { key: "Wa", value: function () { } }, { key: "Na", value: function (t) { return t } }, { key: "Oa", value: function (t) { return t } }, { key: "_a", value: function (t) { return t } }, { key: "ja", value: function () { return this.vn } }]), t }(), xt = function () { function t(e, n) { var r; return s(this, t), (r = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e))).Va = "A", v.R(n) && r.Ja(n), r } return o(t, bt), n(t, [{ key: "Da", value: function (e) { return e instanceof t && e.Va === this.Va } }, { key: "Ja", value: function (t) { this.Va = t } }, { key: "Wa", value: function () { this.vn.querySelector(".leaf-element").removeAllChildren().appendChild(document.createTextNode(this.Va)) } }]), t }(), Ot = function () { function t(e) { var n; s(this, t), (n = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e))).children = [], n.Xa = "rotate-0", n.Ka = !0, n.Qa = 100, n.Ya = 0; var r = n; return n.Za = function (e) { var n = (new Date).getTime(), i = null, o = null; if (e.changedTouches.length >= 1 && (i = document.elementFromPoint(e.changedTouches[0].pageX, e.changedTouches[0].pageY), o = { x: e.changedTouches[0].pageX, y: e.changedTouches[0].pageY }), null != i && 0 === e.targetTouches.length && r.vn.contains(t.za) && r.vn.contains(i)) { if (e.stopPropagation(), e.preventDefault(), r.Ya + r.Qa > n) return; r.Ra().tl(r), r.rotate(t.za, i, t.$a, o), r.Ya = (new Date).getTime() } }, n.el = function (e) { var n = (new Date).getTime(); if (null !== t.za && r.vn.contains(t.za) && r.vn.contains(e.target)) { var i = {x: e.pageX, y: e.pageY}; if (e.stopPropagation(), e.preventDefault(), r.Ya + r.Qa > n) return; r.Ra().tl(r), r.rotate(t.za, e.target, t.$a, i), r.Ya = (new Date).getTime() } }, n } return o(t, bt), n(t, [{ key: "Ga", value: function (t) { this.Ka = t, this.Wa() } }], [{ key: "qa", value: function () { window.addEventListener("mousedown", function (e) { t.za = e.target, t.$a = {x: e.pageX, y: e.pageY} }), window.addEventListener("mouseup", function () { t.za = null, t.$a = {} }), window.addEventListener("touchstart", function (e) { 1 === e.targetTouches.length && (t.za = e.targetTouches[0].target, t.$a = { x: e.targetTouches[0].pageX, y: e.targetTouches[0].pageY }) }), window.addEventListener("touchend", function () { t.za = null, t.$a = {} }) } }]), n(t, [{ key: "Ua", value: function () { return this.Ka && !this.Ra().nl() } }, { key: "rotate", value: function () { var t = r(regeneratorRuntime.mark(function t(e, n, r, i) { var o, s, a, u, l, c, h, f = this; return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: if (o = 1, v.R(n) && v.R(e) && (v.Mt(r) || v.Mt(i) || Math.abs(r.x - i.x) > 5 || Math.abs(r.y - i.y) > 5)) { for (s = -1, a = -1, u = [0, 1, 3, 2], l = 0; l < this.children.length; l++) (this.children[u[l]].vn === e || this.children[u[l]].vn.contains(e)) && (s = (l + this.rotation / 90) % 4), (this.children[u[l]].vn === n || this.children[u[l]].vn.contains(n)) && (a = (l + this.rotation / 90) % 4); s >= 0 && a >= 0 && (2 === s && (0 === a || 1 === a) || 1 === s && (0 === a || 3 === a) || 0 === s && 3 === a || 3 === s && 2 === a) && (o = -1) } if (!this.Ua()) { t.next = 8; break } return this.rotation += 360 + 90 * o, this.rotation %= 360, c = this.rotation, this.sl(), this.vn.classList.add("rotating"), -1 === o && this.vn.classList.add("reverse"), h = new Promise(function (t) { setTimeout(t, 250) }).then(function () { f.rotation === c && (f.vn.classList.remove("rotating"), f.vn.classList.remove("reverse")) }), t.abrupt("return", (this.Ra().il(h), h)); case 8: case"end": return t.stop() } }, t, this) })); return function () { return t.apply(this, arguments) } }() }, { key: "Da", value: function (e) { if (!(e instanceof t) || e.children.length !== this.children.length) return !1; for (var n = 0; n < this.children.length; n++) if (!this.children[n].Da(e.children[n])) return !1; return !0 } }, { key: "Na", value: function (t) { this.rotation = t[0], isNaN(this.rotation) && (this.rotation = 0), t.splice(0, 1); for (var e = 0, n = this.children.length; e < n; e++) t = this.children[e].Na(t); return t } }, { key: "Oa", value: function (t) { this.Ka = t[0], t.splice(0, 1); for (var e = 0, n = this.children.length; e < n; e++) t = this.children[e].Oa(t); return t } }, { key: "Ba", value: function (t) { t.push(this.rotation); for (var e = 0, n = this.children.length; e < n; e++) t = this.children[e].Ba(t); return t } }, { key: "_a", value: function (t) { t.push(this.Ka); for (var e = 0, n = this.children.length; e < n; e++) t = this.children[e]._a(t); return t } }, { key: "Ea", value: function (t) { if (t = v.m(t, !0)) for (var e = 0, n = this.children.length; e < n; e++) if (!this.children[e].Ea()) return !1; return 0 === this.rotation || this.children[0].Da(this.children[3]) && this.children[1].Da(this.children[2]) && (180 === this.rotation || this.children[0].Da(this.children[1])) } }, { key: "rl", value: function (t) { this.children = []; for (var e = 0, n = t.length; e < n; e++) this.ol(t[e]) } }, { key: "ol", value: function (t) { this.children.push(t), t.Ia(this), this.Wa() } }, { key: "sl", value: function () { this.vn.classList.remove(this.Xa), this.Xa = "rotate-" + this.rotation, "rotate-0" === this.Xa && (this.Xa = "rotate-360"), this.vn.classList.add(this.Xa) } }, { key: "Wa", value: function () { var t = this.al(); t >= 2 && this.vn.classList.add("layer-" + t), this.Ka || this.vn.classList.add("locked"); var e = this.vn.querySelector(".child-container"); e.removeAllChildren(), this.sl(), this.vn.removeEventListener("mouseup", this.el), this.vn.removeEventListener("touchend", this.Za), this.vn.addEventListener("mouseup", this.el), this.vn.addEventListener("touchend", this.Za); for (var n = 0, r = this.children.length; n < r; n++) this.children[n].Wa(), e.appendChild(this.children[n].ja()), n % 2 == 1 && this.children.length - 1 !== n && e.appendChild(document.createElement("br")) } }, { key: "al", value: function () { return this.children.length >= 1 && this.children[0] && this.children[0] instanceof t ? this.children[0].al() + 1 : 1 } }]), t }(); Ot.qa(); var Lt = function () { function t(e) { s(this, t), this.ll = null, this.words = [], this.hl = [], this.ul = e, this.cl = !1, this.id = null, this.dl = null, this.ml = null; var n = this; this.gl = new Promise(function (t, e) { n.dl = t, n.ml = e }), this.tl = function () { } } return n(t, [{ key: "pl", value: function () { var t = this.Ba(), e = this._a(); localStorage.setItem("currentLevel", JSON.stringify({id: this.id, rotations: t, locks: e})) } }, { key: "_a", value: function () { return null !== this.ll ? this.ll._a([]) : [] } }, { key: "Ba", value: function () { return null !== this.ll ? this.ll.Ba([]) : [] } }, { key: "fl", value: function (t) { null !== this.ll && this.ll.Oa(t) } }, { key: "Sl", value: function (t) { this.id = t } }, { key: "$", value: function () { return this.id } }, { key: "Ra", value: function () { return this } }, { key: "wl", value: function (t) { this.ll = t, this.ll.Ia(this), this.hl && this.Na() } }, { key: "Ml", value: function (t) { this.words = []; for (var e = 0, n = t.length; e < n; e++) this.words.push(t[e].toUpperCase()) } }, { key: "Hl", value: function (t) { this.hl = t } }, { key: "Na", value: function (t) { this.ll && (t = v.m(t, this.hl), this.ll.Na(t)) } }, { key: "nl", value: function () { return this.cl } }, { key: "il", value: function (t) { if (this.ll.Ea()) { this.cl = !0; var e = this; return Promise.resolve(t).then(function () { e.dl(!0) }), !0 } return this.pl(), !1 } }, { key: "yl", value: function () { return this.gl } }, { key: "vl", value: function () { return this.ll } }, { key: "Pl", value: function () { } }, { key: "Tl", value: function () { return t.Ll(this.ll) } }, { key: "bl", value: function (t) { this.tl = t } }], [{ key: "Ll", value: function (e) { var n = []; if (e.Ua() && n.push(e), e instanceof Ot) for (var r = 0; r < e.children.length; r++) n.push.apply(n, t.Ll(e.children[r])); return n } }, { key: "Al", value: function (t, e) { for (var n = [], r = 0, i = t.length; r < i; r++) n.push(new xt(v.cloneNode(e), t.charAt(r))); return n } }]), t }(), Pt = function () { function t(e) { var n; return s(this, t), (n = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e))).Ka = !1, n } return o(t, Ot), n(t, [{ key: "Na", value: function (t) { for (var e = 0, n = this.children.length; e < n; e++) t = this.children[e].Na(t); return t } }, { key: "Ba", value: function (t) { for (var e = 0, n = this.children.length; e < n; e++) t = this.children[e].Ba(t); return t } }, { key: "_a", value: function (t) { for (var e = 0, n = this.children.length; e < n; e++) t = this.children[e]._a(t); return t } }, { key: "Oa", value: function (t) { for (var e = 0, n = this.children.length; e < n; e++) t = this.children[e].Oa(t); return t } }, { key: "Wa", value: function () { var t = this.vn.querySelector(".child-container"); t.removeAllChildren(), this.sl(); var e = this; this.vn.onclick = function (t) { e.rotate(), t.stopPropagation() }; for (var n = 0, r = this.children.length; n < r; n++) this.children[n].Wa(), t.appendChild(this.children[n].ja()) } }]), t }(), Rt = function () { function t(e, n) { var r; return s(this, t), (r = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e))).Cl = n, r } return o(t, Lt), n(t, [{ key: "Pl", value: function () { if (this.words.length >= 2 && this.words[0].length >= this.Cl && this.words[1].length >= this.Cl) { for (var t = Lt.Al(this.words[0], this.ul.Ca()), e = Lt.Al(this.words[1], this.ul.Ca()), n = new Pt(this.ul.Fa()), r = 0, i = this.Cl / 2; r < i; r++) { var o = new Ot(this.ul.ka()); o.ol(t[2 * r]), o.ol(t[2 * r + 1]), o.ol(e[2 * r]), o.ol(e[2 * r + 1]), n.ol(o) } this.wl(n) } } }]), t }(), Et = function () { function t(e) { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, 6)) } return o(t, Rt), t }(), Ct = function () { function t(e) { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, 8)) } return o(t, Rt), t }(), St = function () { function t(e) { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, 10)) } return o(t, Rt), t }(), jt = function () { function t() { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments)) } return o(t, Pt), t }(), Tt = function () { function t(e, n) { var r; return s(this, t), (r = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e))).Cl = n, r } return o(t, Lt), n(t, [{ key: "Pl", value: function () { if (this.words.length >= 6 && this.words[0].length >= this.Cl && this.words[1].length >= this.Cl && this.words[2].length >= this.Cl && this.words[3].length >= this.Cl && this.words[4].length >= this.Cl && this.words[5].length >= this.Cl) { var t = []; t[0] = Lt.Al(this.words[0], this.ul.Ca()), t[1] = Lt.Al(this.words[1], this.ul.Ca()), t[2] = Lt.Al(this.words[2], this.ul.Ca()), t[3] = Lt.Al(this.words[3], this.ul.Ca()), t[4] = Lt.Al(this.words[4], this.ul.Ca()), t[5] = Lt.Al(this.words[5], this.ul.Ca()); for (var e = new Pt(this.ul.Fa()), n = 0; n < this.Cl / 4; n++) { var r = []; r[0] = new Ot(this.ul.ka()), r[1] = new Ot(this.ul.ka()), r[2] = new Ot(this.ul.ka()), r[3] = new Ot(this.ul.ka()), r[4] = new Ot(this.ul.ka()), r[5] = new Ot(this.ul.ka()), r[0].ol(t[0][4 * n]), r[0].ol(t[0][4 * n + 1]), r[0].ol(t[1][4 * n]), r[0].ol(t[1][4 * n + 1]), r[1].ol(t[0][4 * n + 2]), r[1].ol(t[0][4 * n + 3]), r[1].ol(t[1][4 * n + 2]), r[1].ol(t[1][4 * n + 3]), r[2].ol(t[2][4 * n]), r[2].ol(t[2][4 * n + 1]), r[2].ol(t[3][4 * n]), r[2].ol(t[3][4 * n + 1]), r[3].ol(t[2][4 * n + 2]), r[3].ol(t[2][4 * n + 3]), r[3].ol(t[3][4 * n + 2]), r[3].ol(t[3][4 * n + 3]), r[4].ol(t[4][4 * n]), r[4].ol(t[4][4 * n + 1]), r[4].ol(t[5][4 * n]), r[4].ol(t[5][4 * n + 1]), r[5].ol(t[4][4 * n + 2]), r[5].ol(t[4][4 * n + 3]), r[5].ol(t[5][4 * n + 2]), r[5].ol(t[5][4 * n + 3]); var i = new Ot(this.ul.ka()), o = new jt(this.ul.xa()); if (n % 2 == 0) { i.ol(r[0]), i.ol(r[1]), i.ol(r[2]), i.ol(r[3]); var s = new Pt(this.ul.Fa()); s.ol(r[4]), s.ol(r[5]), o.ol(i), o.ol(s), o.ja().classList.add("type-1") } else { var a = new Pt(this.ul.Fa()); a.ol(r[0]), a.ol(r[1]), o.ol(a), o.ol(i), i.ol(r[2]), i.ol(r[3]), i.ol(r[4]), i.ol(r[5]), o.ja().classList.add("type-2") } e.ol(o) } this.wl(e) } } }]), t }(), Mt = function () { function t(e) { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, 8)) } return o(t, Tt), t }(), At = function () { function t(e) { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, 12)) } return o(t, Tt), t }(), Nt = function () { function t(e, n) { var r; return s(this, t), (r = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e))).Cl = n, r } return o(t, Lt), n(t, [{ key: "Pl", value: function () { if (this.words.length >= 4 && this.words[0].length >= this.Cl && this.words[1].length >= this.Cl && this.words[2].length >= this.Cl && this.words[3].length >= this.Cl) { var t = []; t[0] = Lt.Al(this.words[0], this.ul.Ca()), t[1] = Lt.Al(this.words[1], this.ul.Ca()), t[2] = Lt.Al(this.words[2], this.ul.Ca()), t[3] = Lt.Al(this.words[3], this.ul.Ca()); for (var e = new Pt(this.ul.Fa()), n = 0; n < this.Cl / 4; n++) { var r = []; r[0] = new Ot(this.ul.ka()), r[1] = new Ot(this.ul.ka()), r[2] = new Ot(this.ul.ka()), r[3] = new Ot(this.ul.ka()), r[0].ol(t[0][4 * n]), r[0].ol(t[0][4 * n + 1]), r[0].ol(t[1][4 * n]), r[0].ol(t[1][4 * n + 1]), r[1].ol(t[0][4 * n + 2]), r[1].ol(t[0][4 * n + 3]), r[1].ol(t[1][4 * n + 2]), r[1].ol(t[1][4 * n + 3]), r[2].ol(t[2][4 * n]), r[2].ol(t[2][4 * n + 1]), r[2].ol(t[3][4 * n]), r[2].ol(t[3][4 * n + 1]), r[3].ol(t[2][4 * n + 2]), r[3].ol(t[2][4 * n + 3]), r[3].ol(t[3][4 * n + 2]), r[3].ol(t[3][4 * n + 3]); var i = new Ot(this.ul.ka()); i.ol(r[0]), i.ol(r[1]), i.ol(r[2]), i.ol(r[3]), e.ol(i) } this.wl(e) } } }]), t }(), It = function () { function t(e) { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, 8)) } return o(t, Nt), t }(), Dt = function () { function t(e) { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, 12)) } return o(t, Nt), t }(), Bt = function () { function t() { s(this, t) } return n(t, null, [{ key: "kl", value: function (e, n) { t.types[e] = n } }, { key: "Fl", value: function (e) { return t.types[e] } }, { key: "xl", value: function (e, n) { var r = new t.types[e.rendererType](n); r.Ml(e.words), r.Sl(e.id); for (var i = 0, o = e.rotations.length; i < o; i++) e.rotations[i] <= 4 && (e.rotations[i] = 90 * e.rotations[i]); return r.Hl(e.rotations), r } }]), t }(); Bt.types = {20: Et, 40: Ct, 60: St, 100: Mt, 120: It, 140: At, 160: Dt}; var qt = function () { function t() { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, "wordRotator", 3)) } return o(t, C), n(t, null, [{ key: "Kt", value: function () { return v.Mt(t.te) && (t.te = new t), t.te } }]), n(t, [{ key: "Si", value: function (e, n, r, i) { console.log("upgrading!"), (v.Mt(n) || n < 1 && r >= 1) && e.createObjectStore(t.Dl.Bl, {keyPath: "id"}), (v.Mt(n) || n < 2 && r >= 2) && i.target.transaction.objectStore(t.Dl.Bl).createIndex("played", ["deleted", "played", "difficulty", "id"], {unique: !1}), (v.Mt(n) || n < 3 && r >= 3) && i.target.transaction.objectStore(t.Dl.Bl).createIndex("difficulty", "difficulty", {unique: !1}) } }, { key: "Il", value: function () { var e = r(regeneratorRuntime.mark(function e(n) { return regeneratorRuntime.wrap(function (e) { for (; ;) switch (e.prev = e.next) { case 0: return e.abrupt("return", this.vi(n, t.Dl.Bl).catch(function (t) { console.error("insert error!", t) })); case 1: case"end": return e.stop() } }, e, this) })); return function () { return e.apply(this, arguments) } }() }, { key: "Rl", value: function () { var e = r(regeneratorRuntime.mark(function e(n) { return regeneratorRuntime.wrap(function (e) { for (; ;) switch (e.prev = e.next) { case 0: return e.abrupt("return", this.load(n, t.Dl.Bl)); case 1: case"end": return e.stop() } }, e, this) })); return function () { return e.apply(this, arguments) } }() }, { key: "Ul", value: function () { var e = r(regeneratorRuntime.mark(function e(n) { var r, i, o, s, a, u; return regeneratorRuntime.wrap(function (e) { for (; ;) switch (e.prev = e.next) { case 0: return e.next = 2, this.Pi(t.Dl.Bl); case 2: for (r = e.sent, i = [], o = [], s = -1, a = 0, u = (r = r.sort(function (t, e) { return t.difficulty - e.difficulty })).length; a < u; a++) !(s < 0 || s === r[a].difficulty) || r[a].deleted || r[a].played || -1 === n.indexOf(r[a].rendererType) ? 0 === r[a].difficulty || r[a].deleted || r[a].played || i.push(r[a]) : (o.push(r[a]), s = r[a].difficulty); return e.abrupt("return", 0 === o.length ? null : o[Math.round(Math.random() * o.length) % o.length]); case 8: case"end": return e.stop() } }, e, this) })); return function () { return e.apply(this, arguments) } }() }, { key: "El", value: function () { var e = r(regeneratorRuntime.mark(function e(n) { var r; return regeneratorRuntime.wrap(function (e) { for (; ;) switch (e.prev = e.next) { case 0: return e.next = 2, this.Rl(n); case 2: return (r = e.sent).played = !0, e.next = 6, this.yi(r, t.Dl.Bl); case 6: return e.abrupt("return", e.sent); case 7: case"end": return e.stop() } }, e, this) })); return function () { return e.apply(this, arguments) } }() }, { key: "Wl", value: function () { var t = r(regeneratorRuntime.mark(function t() { return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: case"end": return t.stop() } }, t, this) })); return function () { return t.apply(this, arguments) } }() }]), t }(); qt.Dl = {Bl: "level"}, qt.te = null; var Kt = function () { function t(e) { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, "html/application/end.html")) } return o(t, wt), n(t, [{ key: "ln", value: function (n) { return ft.update("End Site"), e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "ln", this).call(this, n) } }]), t }(), Ht = function () { function t(e) { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, "html/application/level.html")) } return o(t, wt), n(t, [{ key: "xn", value: function (n) { n = e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "xn", this).call(this, n); var r = new l(v.m(localStorage.getItem("coins"), "0"), function () { }, l.Y, 900); return r.F(!1), r.M = "coin-counter", n.at(r), this.Nl = r, n } }, { key: "an", value: function (n) { this.Ol = v.m(localStorage.getItem("levelCounter"), 1), this._l = function () { }, this.jl = {Vl: !1, Jl: null}, this.ql = Promise.resolve(); var r = F.Kt(), i = mt.Kt(); return i.set({ ua: "sound/single_coin_fall_on_concrete_.mp3", muted: "1" !== r.yr("play-sound", "1"), volume: .7 }, mt.ha.Sa), i.resume(mt.ha.fa), e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "an", this).call(this, n) } }, { key: "hn", value: function () { var n = r(regeneratorRuntime.mark(function n() { var r, i, o, s, a, u, l, c, h = this; return regeneratorRuntime.wrap(function (n) { for (; ;) switch (n.prev = n.next) { case 0: return e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "hn", this).call(this), r = this.gn("#segment-leaf-template"), i = this.gn("#segment-parent-template"), o = this.gn("#segment-row-template"), s = this.gn("#segment-triangle-template"), r.id = null, i.id = null, o.id = null, s.id = null, r.remove(), i.remove(), o.remove(), s.remove(), a = this, (u = this.gn("#continue-button")).addEventListener("click", function () { a.zl() }), l = this.gn("#won-text"), c = new dt, n.next = 8, c.Yo(u, u.parentElement, !1, !0, 2); case 8: return this.$l = n.sent, n.next = 11, c.Yo(l, l.parentElement, !1, !1, 2, null, 5); case 11: return this.Gl = n.sent, this.Kl = l, this.Kl.style.fontSize = "0", this.Xl = document.getElementById("level-number-container"), this.Ql = document.getElementById("level-number"), this.Ql.innerText = this.Ol, n.next = 19, c.Yo(this.Ql, this.Xl, !1, !1, 4); case 19: return this.Yl = n.sent, this.Xl.classList.add("visible"), this.ul = new _t(r, i, o, s), this.Zl = this.gn("#coin-template"), this.th = this.gn("#coin-container"), this.Zl.id = null, this.th.removeAllChildren(), this.gn("#help-button").addEventListener("click", function () { h.eh() }), n.next = 29, this.nh(); case 29: case"end": return n.stop() } }, n, this) })); return function () { return n.apply(this, arguments) } }() }, { key: "nh", value: function () { var t = r(regeneratorRuntime.mark(function t() { var e, n, r, i, o, s, a, u; return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: if (t.prev = 0, e = localStorage.getItem("currentLevel"), !v.R(e)) { t.next = 23; break } return e = JSON.parse(e), n = qt.Kt(), t.next = 7, n.Rl(e.id); case 7: if (null !== (r = t.sent)) { t.next = 10; break } return t.abrupt("return", this.zl()); case 10: return (i = Bt.xl(r, this.ul)).Hl(e.rotations), o = this, i.yl().then(function () { o.sh(i) }), i.Pl(), i.fl(e.locks), i.vl().Wa(), i.pl(), (s = this.gn("#level")).removeAllChildren().appendChild(i.vl().ja()), a = new dt, t.next = 19, a.Yo(s, s.parentElement, !1, !1, 1, 1.5 * i.words[0].length, null, 0); case 19: return this._l = t.sent, this.level = i, u = this.ih(), t.abrupt("return", (ft.push(["trackEvent", "LevelSite", "LoadLastLevel"]), this.level.il(), u)); case 23: t.next = 28; break; case 25: t.prev = 25, t.t0 = t.catch(0), console.error(t.t0); case 28: return t.abrupt("return", this.zl()); case 29: case"end": return t.stop() } }, t, this, [[0, 25]]) })); return function () { return t.apply(this, arguments) } }() }, { key: "zl", value: function () { var e = r(regeneratorRuntime.mark(function e() { var n, r, i, o, s, a; return regeneratorRuntime.wrap(function (e) { for (; ;) switch (e.prev = e.next) { case 0: return e.prev = 0, this.en.classList.remove("won"), this.Kl.style.fontSize = "0", n = qt.Kt(), e.next = 5, n.Ul(t.rh); case 5: if (r = e.sent, console.log("nextLevelJson", r), null !== r) { e.next = 8; break } return e.abrupt("return", (this.Ln(Kt), void this.finish())); case 8: return i = Bt.xl(r, this.ul), o = this, i.yl().then(function () { o.sh(i) }), i.Pl(), i.vl().Wa(), i.pl(), (s = this.gn("#level")).removeAllChildren().appendChild(i.vl().ja()), a = new dt, e.next = 15, a.Yo(s, s.parentElement, !1, !1, 1, 1.5 * i.words[0].length, null, 0); case 15: return this._l = e.sent, this.level = i, this.Ql.innerText = this.Ol, this.Yl(), this.Nl.k(v.m(localStorage.getItem("coins"), "0")), this.Nl.j(), this.jl.Vl = !0, clearTimeout(this.jl.Jl), ft.push(["trackEvent", "LevelSite", "NextLevel", "Level Number Normal", this.Ol]), this.level.il(), e.abrupt("return", this.ih()); case 28: e.prev = 28, e.t0 = e.catch(0), console.log("Fehler!"), console.error(e.t0); case 31: case"end": return e.stop() } }, e, this, [[0, 28]]) })); return function () { return e.apply(this, arguments) } }() }, { key: "ln", value: function (n) { ft.update("Level Site"); var r = e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "ln", this).call(this, n); this.Ql && (this.Ql.innerText = this.Ol, this.Xl.classList.add("visible")), this._l(); var i = F.Kt(); return mt.Kt().set({ ua: "sound/single_coin_fall_on_concrete_.mp3", muted: "1" !== i.yr("play-sound", "1"), volume: .7 }, mt.ha.Sa), r } }, { key: "cn", value: function (n) { e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "cn", this).call(this, n), this.Xl.classList.remove("visible") } }, { key: "sh", value: function () { var t = r(regeneratorRuntime.mark(function t(e) { var n = this; return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: return t.prev = 0, t.delegateYield(regeneratorRuntime.mark(function t() { var r, i, o, s, a, u, l, c; return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: for (r = qt.Kt().El(e.$()), n.Ol++, localStorage.setItem("levelCounter", n.Ol), n.en.classList.add("won"), localStorage.removeItem("currentLevel"), (i = n.gn("#continue-button")).style.transition = "none", i.style.opacity = 0, n.th.removeAllChildren(), o = m.get("coinsPerLevel", 5), s = 0, a = mt.Kt(), u = a.get(mt.ha.Sa), n.ql = n.ql.then(function () { s = parseInt(v.m(localStorage.getItem("coins"), "0")), localStorage.setItem("coins", s + parseInt(o)) }).then(function () { return Promise.all([new Promise(function (t) { setTimeout(function () { t(i.fadeIn()) }, 500) }), u.ca.catch(function (t) { console.error(t) })]) }), n.jl.Vl = !1, l = function () { var t = v.cloneNode(n.Zl); n.th.appendChild(t), n.ql = n.ql.then(function () { return new Promise(function (e) { n.jl.Vl ? e() : (t.fadeIn(.35), a.play(mt.ha.Sa), n.jl.Jl = setTimeout(function () { n.jl.Vl || (n.Nl.k(++s), n.Nl.j()) }, 175)), setTimeout(e, 350) }) }) }, c = 0; c < o; c++) l(c); return n.ql = n.ql.catch(function (t) { console.error(t) }), n.Gl(), n.$l(), n._l(), ft.push(["trackEvent", "LevelSite", "LevelWon", "Coins", parseInt(v.m(localStorage.getItem("coins"), "0"))]), t.next = 15, r; case 15: case"end": return t.stop() } }, t, n) })(), "t0", 2); case 2: t.next = 7; break; case 4: t.prev = 4, t.t1 = t.catch(0), console.error(t.t1); case 7: case"end": return t.stop() } }, t, this, [[0, 4]]) })); return function () { return t.apply(this, arguments) } }() }, { key: "eh", value: function () { var t = m.get("costForHelp", 25), e = parseInt(v.m(localStorage.getItem("coins"), 0)); if (e >= t) { e -= t, localStorage.setItem("coins", e), this.Nl.title = e, this.Nl.j(); for (var n = this.level.Tl(), r = (n = n.filter(function (t) { return !t.Ea(!1) }))[Math.floor(Math.random() * n.length)]; 0 !== r.rotation;) r.rotate(); r.Ga(!1), this.level.pl(), ft.push(["trackEvent", "LevelSite", "Help", "Coins", parseInt(v.m(localStorage.getItem("coins"), "0"))]) } else E.oi("not-enough-coins"), ft.push(["trackEvent", "LevelSite", "Help", "Not enough Coins", parseInt(v.m(localStorage.getItem("coins"), "0"))]) } }, { key: "ih", value: function () { var e = r(regeneratorRuntime.mark(function e() { var n, r, i, o, s, a, u, l, c, h, f, p, d, m = this; return regeneratorRuntime.wrap(function (e) { for (; ;) switch (e.prev = e.next) { case 0: if (this.level.id !== t.ah.oh) { e.next = 20; break } n = v.m(localStorage.getItem("tutorial-step"), "1"), r = new dt, e.t0 = (this.en.classList.add("tutorial"), this.en.classList.add("step-" + n), n), e.next = "1" === e.t0 ? 5 : "2" === e.t0 ? 11 : 17; break; case 5: return this.level.bl(function () { m.en.classList.remove("step-1"), localStorage.setItem("tutorial-step", "2"), m.ih() }), i = this.gn(".tutorial-text .step-1"), e.next = 9, this._l(); case 9: return r.Yo(i, i.parentElement, null, !0, 1, 2), e.abrupt("break", 18); case 11: return this.level.bl(function () { }), this.level.yl().then(function () { m.en.classList.remove("tutorial"), m.en.classList.remove("step-2"), localStorage.removeItem("tutorial-step"), m.ql = m.ql.then(function () { E.oi("extra-coins-after-first-level"), localStorage.setItem("coins", parseInt(v.m(localStorage.getItem("coins"), "0")) + 50), m.Nl.k(v.m(localStorage.getItem("coins"), "0")), m.Nl.j() }) }), o = this.gn(".tutorial-text .step-2"), e.next = 15, this._l(); case 15: return r.Yo(o, o.parentElement, null, !0, 1, 2), e.abrupt("break", 18); case 17: this.en.classList.remove("tutorial"); case 18: e.next = 52; break; case 20: if (this.level.id !== t.ah.lh) { e.next = 37; break } s = v.m(localStorage.getItem("tutorial-step"), "3"), e.t1 = s, e.next = "3" === e.t1 ? 25 : 34; break; case 25: return a = new dt, this.en.classList.add("tutorial"), this.en.classList.add("step-" + s), u = function t() { m.en.classList.remove("tutorial"), m.en.classList.remove("step-3"), localStorage.setItem("tutorial-step", "4"), m.gn("#help-button").removeEventListener("click", t), m._l() }, this.gn("#help-button").addEventListener("click", u), l = this.gn(".tutorial-text .step-3"), e.next = 32, this._l(); case 32: return a.Yo(l, l.parentElement, null, !0, 1, 2), e.abrupt("break", 35); case 34: this.en.classList.remove("tutorial"); case 35: e.next = 52; break; case 37: if (this.level.id !== t.ah.hh) { e.next = 52; break } c = v.m(localStorage.getItem("tutorial-step"), "4"), e.t2 = c, e.next = "4" === e.t2 ? 42 : 51; break; case 42: return h = new dt, this.en.classList.add("tutorial"), this.en.classList.add("step-" + c), f = this.level.Tl()[0], (p = this.gn("#tutorial-pointer")).remove(), f.vn.appendChild(p), this.level.bl(function (t) { f === t && (m.en.classList.remove("tutorial"), m.en.classList.remove("step-4"), localStorage.setItem("tutorial-step", "5"), m._l()) }), d = this.gn(".tutorial-text .step-4"), e.next = 49, this._l(); case 49: return h.Yo(d, d.parentElement, null, !0, 1, 2), e.abrupt("break", 52); case 51: this.en.classList.remove("tutorial"); case 52: case"end": return e.stop() } }, e, this) })); return function () { return e.apply(this, arguments) } }() }]), t }(); Ht.rh = [20, 40, 60, 100, 120, 140, 160], Ht.ah = {oh: 67, lh: 15, hh: 341}; var Ft = function () { function t(e) { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, 4)) } return o(t, Nt), n(t, [{ key: "pl", value: function () { } }]), t }(), Vt = function () { function t() { var e; return s(this, t), e = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, w.tn("html/application/dialog/share.html").then(function (t) { t.appendChild(M.ji(window.location.hostname + v.Gt(""))); var n = function () { e.close() }; return t.querySelectorAll("a").forEach(function (t) { t.addEventListener("click", n) }), t }), "share-dialog")) } return o(t, R), t }(), Ut = function () { function t(e) { var n; return s(this, t), (n = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, "html/application/menu.html"))).uh = n.dh(), n.listener = null, n } return o(t, wt), n(t, [{ key: "ln", value: function (n) { var i = this; ft.update("Menu Site"); var o = e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "ln", this).call(this, n), s = new Ft(this.ul); s.Ml(["WORD", "ROTA", "TORW", "ORDR"]), s.Pl(), s.yl().then(function () { ft.push(["trackEvent", "MainMenu", "levelSolved"]), i.mh() }); var a = s.vl(); a.Wa(), this.gn("#level").removeAllChildren().appendChild(a.ja()); var u = s.Tl(); (function t() { var e = 4500 * Math.random() + 1500; i.gh = setTimeout(function () { for (var e = -1, n = [], r = 0; r < u.length && !(0 !== u[r].rotation && (n.push(r), n.length >= 2)); r++) ; 1 === n.length && (e = n[0]); var i = Math.floor(Math.random() * u.length); i === e && (i = (i + 1) % u.length), u[i].rotate(), t() }, e) })(), this.listener = r(regeneratorRuntime.mark(function t() { var e, n, r, o, s; return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: return e = i.gn("#play-button"), (n = i.gn("#level-number")).innerText = v.m(localStorage.getItem("levelCounter"), 1), r = i.gn("#level"), o = new dt, t.next = 5, o.Yo(r, r.parentElement, !1, !1, 2, 8, null, !1); case 5: return s = getComputedStyle(r), e.style.width = s.getPropertyValue("width"), o.Yo(e.children[0], e, null, null, null, 4, null, !1), t.next = 10, o.Xo(.2, n.parentElement, n.parentElement.parentElement, null, null, null, 10, null, !1); case 10: o.Yo(n, n.parentElement, !1, !1, 8, null, null, !1); case 11: case"end": return t.stop() } }, t, i) })), this.listener(), window.addEventListener("resize", this.listener); var l = F.Kt(); return this.gn("#play-sound").checked = "1" === l.yr("play-sound", "1"), this.gn("#play-music").checked = "1" === l.yr("play-music", "1"), o } }, { key: "mh", value: function () { var t = r(regeneratorRuntime.mark(function t() { var e = this; return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: mt.Kt().ma(), this.Ln(Ht, Promise.race([this.uh, new Promise(function () { var t = r(regeneratorRuntime.mark(function t(n) { var r; return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: return r = qt.Kt(), t.next = 3, r.Ul(Ht.rh); case 3: if (t.t0 = t.sent, t.t1 = null !== t.t0, !t.t1) { t.next = 7; break } n(); case 7: case"end": return t.stop() } }, t, e) })); return function () { return t.apply(this, arguments) } }())])); case 1: case"end": return t.stop() } }, t, this) })); return function () { return t.apply(this, arguments) } }() }, { key: "hn", value: function () { var n = r(regeneratorRuntime.mark(function n() { var r, i, o, s, a, u, l, c, h = this; return regeneratorRuntime.wrap(function (n) { for (; ;) switch (n.prev = n.next) { case 0: e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "hn", this).call(this), this.gn("#play-button").addEventListener("click", function () { ft.push(["trackEvent", "MainMenu", "startButton"]), h.mh() }), r = this.gn("#segment-leaf-template"), i = this.gn("#segment-parent-template"), o = this.gn("#segment-row-template"), s = this.gn("#segment-triangle-template"), r.id = null, i.id = null, o.id = null, s.id = null, r.remove(), i.remove(), o.remove(), s.remove(), this.ul = new _t(r, i, o, s), v.m(t.app.$s) && t.app.$s.then(function () { h.listener && h.listener() }), a = F.Kt(), u = mt.Kt(), (l = this.gn("#play-music")).checked = "1" === a.yr("play-music", "1"), l.addEventListener("change", function () { a.Tr("play-music", l.checked ? "1" : "0"), u.set({muted: !l.checked}, mt.ha.fa), l.checked && u.play(mt.ha.fa), ft.push(["trackEvent", "MainMenu", "PlayMusic", "Play Music", l.checked ? 1 : 0]) }), (c = this.gn("#play-sound")).checked = "1" === a.yr("play-sound", "1"), c.addEventListener("change", function () { a.Tr("play-sound", c.checked ? "1" : "0"), u.set({muted: !c.checked}, mt.ha.Sa), ft.push(["trackEvent", "MainMenu", "PlaySound", "Play Sound", c.checked ? 1 : 0]) }), this.gn("#share-button").addEventListener("click", function () { (new Vt).show() }); case 7: case"end": return n.stop() } }, n, this) })); return function () { return n.apply(this, arguments) } }() }, { key: "cn", value: function (n) { clearTimeout(this.gh), window.removeEventListener("resize", this.listener), e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "cn", this).call(this, n) } }, { key: "dh", value: function () { var t = r(regeneratorRuntime.mark(function t() { var e, n, r, i, o, s, a, u, l, c, h; return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: e = v.m(localStorage.getItem("date-last-sync"), 0), n = qt.Kt(), r = null, i = 1, o = [], s = 0; case 3: if (!(s < i)) { t.next = 23; break } return t.next = 6, K.load("wordRotator/levels" + K.ae({currentRun: s, dateLastSync: e})); case 6: if ((a = t.sent).success) { t.next = 16; break } return t.next = 10, n.Ul(Ht.rh); case 10: if (t.t0 = t.sent, t.t1 = null === t.t0, !t.t1) { t.next = 14; break } E.oi("sync-error", null, 6e3); case 14: return r = null, t.abrupt("break", 23); case 16: for (a = a.result, r = v.m(r, a.currentSyncDate), i = a.maxRuns, u = a.levels, l = function (t) { var e = u[t]; o.push(n.Rl(u[t].id).then(function (t) { return e.played = v.m(v.m(t, {}).played, !1), e })) }, c = 0; c < u.length; c++) l(c); case 20: s++, t.next = 3; break; case 23: return t.next = 25, Promise.all(o); case 25: return h = t.sent, console.log("levels to save", h), t.next = 29, n.Il(h); case 29: null != r && "null" !== r && localStorage.setItem("date-last-sync", r); case 30: case"end": return t.stop() } }, t, this) })); return function () { return t.apply(this, arguments) } }() }]), t }(); Ut.app = null, a.t(function (t) { Ut.app = t }); var zt = function () { function t(e) { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, "html/application/privacyPolicy.html", "privacyPolicy")) } return o(t, wt), n(t, [{ key: "hn", value: function () { this.gn("#track-switch").addEventListener("change", function (t) { ft.jo(!0 === this.checked), t.stopPropagation(), t.preventDefault() }), e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "hn", this).call(this) } }, { key: "ln", value: function (n) { var r = this.gn("#track-switch"), i = "1" === v.m(localStorage.getItem("matomoShouldTrack"), "1"); return r.checked = i, ft.update("Privacy Policy Site"), e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "ln", this).call(this, n) } }]), t }(); a.t(function (t) { t.Ns("privacyPolicy", zt) }); var Yt = function () { function t(e) { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, "html/application/credits.html", "credits")) } return o(t, wt), n(t, [{ key: "ln", value: function (n) { return ft.update("Credits Site"), e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "ln", this).call(this, n) } }]), t }(); a.t(function (t) { t.Ns("credits", Yt) }); var Wt = function () { function t() { var e; return s(this, t), e = i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, w.tn("html/application/dialog/chooseTheme.html").then(function (t) { var n = t.querySelector("#choose-theme-template"); n.remove(), n.id = null; for (var r = t.querySelector("#theme-choose-container"), i = function (t) { var i = v.cloneNode(n), o = y.Be[t]; i.querySelector(".name").appendChild(d.pt(o.De)), i.dataset.theme = o.De, i.addEventListener("click", function () { e.result = i.dataset.theme, e.close() }), r.appendChild(i) }, o = 0; o < y.Be.length; o++) i(o); return t }), "choose-theme-dialog-title")) } return o(t, R), t }(), Xt = function () { function t(e) { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, "html/application/impressum.html", "impressum")) } return o(t, wt), t }(); a.t(function (t) { t.Ns("impressum", Xt) }); var Jt = function () { function t(e) { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, "html/application/fragment/settings.html")) } return o(t, V), n(t, [{ key: "hn", value: function () { var n = this, i = y.Re.De; F.Kt().Tr("theme", i); var o = this.gn("#theme-name"); o.removeAllChildren().appendChild(d.pt(i)), this.gn("#theme-chooser").addEventListener("click", r(regeneratorRuntime.mark(function t() { var e; return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: return t.next = 2, (new Wt).show(); case 2: e = t.sent, v.R(e) && (F.Kt().Tr("theme", e), y.xe(e), o.removeAllChildren().appendChild(d.pt(e))); case 4: case"end": return t.stop() } }, t, n) }))), this.gn("#reset-levels").addEventListener("click", function () { localStorage.removeItem("currentLevel"), localStorage.removeItem("date-last-sync"), localStorage.removeItem("levelCounter"), localStorage.removeItem("tutorial-step"), qt.Kt().Ai(qt.Dl.Bl) }), (location.hostname.includes("beta") || location.hostname.includes("127.0.0.1")) && this.gn("#reset-levels").classList.remove("hidden"); var s = this.gn("#play-music"); s.addEventListener("change", function () { var t = mt.Kt(); t.set({muted: !s.checked}, mt.ha.fa), s.checked && t.play(mt.ha.fa) }), this.gn("#track-switch").addEventListener("change", function (t) { ft.jo(!0 === this.checked), t.stopPropagation(), t.preventDefault() }), this.gn("#credits-button").addEventListener("click", function () { n.qn().Ln(Yt) }), this.gn("#privacy-policy-button").addEventListener("click", function () { n.qn().Ln(zt) }), this.gn("#contact-button").addEventListener("click", function () { n.qn().Ln(kt) }), this.gn("#impressum-button").addEventListener("click", function () { n.qn().Ln(Xt) }), ht.Wo(function () { var t = n.gn("#install-button"); t.addEventListener("click", function () { t.classList.add("hidden"), ht.prompt().then(function (t) { console.log("clicked", t), "accepted" === t.outcome && ft.Ko("installed", "installed") }) }), t.classList.remove("hidden") }); var a = ct.Kt(); return a.Do() && (console.log("can estimate storage!"), Promise.all([a.estimate(), a.xo()]).then(function (t) { var e = t[0], r = t[1], i = n.gn("#storage-info"); console.log(r), i.appendChild(d.pt("storage-info", [Math.round(e.usage / 1048576 * 100) / 100, Math.round(e.quota / 1048576 * 100) / 100, Math.round(e.usage / e.quota * 1e4) / 100, r ? "" : "nicht"])), i.parentElement.classList.remove("hidden"), i.parentElement.addEventListener("click", function () { a.persist().then(function (t) { console.log(t), i.removeAllChildren().appendChild(d.pt("storage-info", [Math.round(e.usage / 1048576 * 100) / 100, Math.round(e.quota / 1048576 * 100) / 100, Math.round(e.usage / e.quota * 1e4) / 100, t ? "" : "nicht"])) }) }) })), e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "hn", this).call(this) } }, { key: "ln", value: function () { ft.update("Settings Site"), e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "ln", this).call(this) } }]), t }(); a.t(function () { J.eo("settings", Jt) }); var Gt = function () { function t(e) { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, "version/2/html/selectWords.html", null, "select-words")) } return o(t, Z), n(t, [{ key: "an", value: function () { var n = r(regeneratorRuntime.mark(function n(r) { var i; return regeneratorRuntime.wrap(function (n) { for (; ;) switch (n.prev = n.next) { case 0: return n.next = 2, e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "an", this).call(this, r); case 2: return i = n.sent, n.next = 5, K.load("words"); case 5: return this.ph = n.sent.result, this.words = this.ph.wordsToCheck, console.log(this.ph), n.abrupt("return", i); case 9: case"end": return n.stop() } }, n, this) })); return function () { return n.apply(this, arguments) } }() }, { key: "hn", value: function () { var n = this; e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "hn", this).call(this), this.gn("#not-checked").appendChild(document.createTextNode(this.ph.wordsNotChecked)), this.gn("#checked").appendChild(document.createTextNode(this.ph.wordsChecked)), this.gn("#not-sure").appendChild(document.createTextNode(this.ph.wordsUnsure)), this.gn("#deleted").appendChild(document.createTextNode(this.ph.wordsDeleted)), this.gn("#unused").appendChild(document.createTextNode(this.ph.wordsNotUsed)); var i = this.gn("#word-template"); i.id = null, i.remove(); for (var o = this.gn("#word-container"), s = this.words.length, a = function (t) { var e = v.cloneNode(i); e.dataset.id = -1, n.fh(e, n.words[t]), o.appendChild(e), e.querySelector(".button-ok").addEventListener("click", r(regeneratorRuntime.mark(function t() { var r; return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: return t.next = 2, K.send("checkWord", {wordId: e.dataset.id, action: "1"}); case 2: r = t.sent.result, n.fh(e, r[0]); case 4: case"end": return t.stop() } }, t, n) }))), e.querySelector(".button-unsure").addEventListener("click", r(regeneratorRuntime.mark(function t() { var r; return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: return t.next = 2, K.send("checkWord", {wordId: e.dataset.id, action: "2"}); case 2: r = t.sent.result, n.fh(e, r[0]); case 4: case"end": return t.stop() } }, t, n) }))), e.querySelector(".button-delete").addEventListener("click", r(regeneratorRuntime.mark(function t() { var r; return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: return t.next = 2, K.send("checkWord", {wordId: e.dataset.id, action: "3"}); case 2: r = t.sent.result, n.fh(e, r[0]); case 4: case"end": return t.stop() } }, t, n) }))) }, u = 0; u < s; u++) a(u) } }, { key: "fh", value: function (t, e) { t.querySelector(".word").removeAllChildren().appendChild(document.createTextNode(e.word)), t.dataset.id = e.id } }]), t }(); a.t(function (t) { t.ds(new $("select-words", function () { t.Ln(Gt) }, null, null, "select-words")) }); var $t = function () { function t(e) { return s(this, t), i(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, "version/2/html/deleteLevels.html", null, "admin")) } return o(t, Z), n(t, [{ key: "an", value: function () { var n = r(regeneratorRuntime.mark(function n(r) { var i; return regeneratorRuntime.wrap(function (n) { for (; ;) switch (n.prev = n.next) { case 0: return i = e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "an", this).call(this, r), n.next = 3, K.load("getDoubleUsedWordsAction"); case 3: return this.words = n.sent.result, n.abrupt("return", i); case 5: case"end": return n.stop() } }, n, this) })); return function () { return n.apply(this, arguments) } }() }, { key: "hn", value: function () { var n = this; e(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "hn", this).call(this); var i = this.gn("#level-template"), o = this.gn("#word-template"), s = this.gn("#word-container"); for (var a in i.id = null, i.remove(), o.id = null, o.remove(), this.words) { var u = v.cloneNode(o); u.querySelector(".name").appendChild(document.createTextNode(a)); for (var l = u.querySelector(".level-container"), c = function (t) { var e = n.words[a][t], o = v.cloneNode(i); o.querySelector(".id").appendChild(document.createTextNode(e.id)), o.querySelector(".words").appendChild(document.createTextNode(e.words)), o.querySelector(".positions").appendChild(document.createTextNode(e.rotations)), o.querySelector(".delete-button").addEventListener("click", r(regeneratorRuntime.mark(function t() { return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: return t.next = 2, K.send("deleteLevel", {levelId: e.id}); case 2: if (t.t0 = t.sent.success, !t.t0) { t.next = 5; break } o.remove(); case 5: case"end": return t.stop() } }, t, n) }))), l.appendChild(o) }, h = 0; h < this.words[a].length; h++) c(h); s.appendChild(u) } } }]), t }(); a.t(function (t) { t.ds(new $("delete-levels", function () { t.Ln($t) }, null, null, "admin")) }); var Qt = "/pwa/wordRotator/public/"; window.location.pathname.indexOf("publicTest/") >= 0 && (Qt = "/pwa/wordRotator/publicTest/"), m.Ae(Qt), d.Rt = ["de"], d.Vt = !1, ft.Jo = "2", window.onerror = function (t, e, n) { console.error(t, e, n) }, String.prototype.format || (String.prototype.format = function (t) { return this.replace(/{(\d+)}/g, function (e, n) { return void 0 !== t[n] ? t[n] : e }) }), Object.assign = v.m(Object.assign, function (e, n) { if (e = v.m(e, {}), null === n || "object" != (void 0 === n ? "undefined" : t(n)) || "isActiveClone" in n) return e; for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (n.isActiveClone = null, e[r] = n[r], delete n.isActiveClone); return e }), "undefined" != typeof window && (v.R(window.Node) && !window.Node.prototype.removeAllChildren && (Node.prototype.removeAllChildren = function () { for (; this.firstChild;) this.removeChild(this.firstChild); return this }), HTMLElement && (HTMLElement.prototype.fadeOut = v.m(HTMLElement.prototype.fadeOut, function (t, e, n) { t = v.m(t, .5), e = v.m(e, "ease-in-out"), n = v.m(n, 0), this.style.transition = "opacity " + t + "s " + e + " " + n + "s"; var r = this, i = new Promise(function (e) { var i = function t(n) { r.removeEventListener("transitionend", t), r.removeEventListener("transitioncancel", o), r.style.opacity = null, r.style.transition = null, e(!0, n) }, o = function t(n) { r.removeEventListener("transitionend", i), r.removeEventListener("transitioncancel", t), r.style.opacity = null, r.style.transition = null, e(!1, n) }; r.addEventListener("transitionend", i), r.addEventListener("transitioncancel", o), setTimeout(function () { e(!1) }, 1e3 * (t + n)) }); return requestAnimationFrame(function () { requestAnimationFrame(function () { r.style.opacity = 0 }) }), i }), HTMLElement.prototype.fadeIn = v.m(HTMLElement.prototype.fadeIn, function (t, e, n) { t = v.m(t, .5), e = v.m(e, "ease-in-out"), n = v.m(n, 0), this.style.transition = "opacity " + t + "s " + e + " " + n + "s"; var r = this; return new Promise(function (e) { var i = function t(n) { r.removeEventListener("transitionend", t), r.removeEventListener("transitioncancel", o), r.style.opacity = null, r.style.transition = null, e(!0, n) }, o = function t(n) { r.removeEventListener("transitionend", i), r.removeEventListener("transitioncancel", t), r.style.opacity = null, r.style.transition = null, e(!1, n) }; r.addEventListener("transitionend", i), r.addEventListener("transitioncancel", o), "1" === getComputedStyle(r).getPropertyValue("opacity") && e(!1), setTimeout(function () { e(!1) }, 1e3 * (t + n)), requestAnimationFrame(function () { requestAnimationFrame(function () { r.style.opacity = 1 }) }) }) })), Node && (Node.prototype.replaceWith = v.m(Node.prototype.replaceWith, function (t) { this.parentElement.replaceChild(t, this) }), Node.prototype.remove = v.m(Node.prototype.remove, function () { this.parentElement.removeChild(this) })), Element && (Element.prototype.matches = v.m(Element.prototype.matches, v.m(Element.prototype.matchesSelector, Element.prototype.webkitMatchesSelector)), window.Element.prototype.closest = v.m(window.Element.prototype.getAll, function (t) { var e = this; if (!document.documentElement.contains(e)) return null; do { if (e.matches(t)) return e; e = e.parentElement } while (null !== e); return null })), window.IDBObjectStore.prototype.getAll = v.m(window.IDBObjectStore.prototype.getAll, function () { var t = {}, e = []; return this.openCursor().onsuccess = function (n) { var r = n.target.result; v.R(r) ? (e.push(r.value), r.continue()) : v.R(t.onsuccess) && t.onsuccess({currentTarget: {result: e}}) }, t })), String.prototype.startsWith = v.m(String.prototype.startsWith, function (t, e) { return e = e || 0, this.indexOf(t, e) === e }), String.prototype.includes = v.m(String.prototype.includes, function (t) { return this.indexOf(t) >= 0 }), String.prototype.endsWith = v.m(String.prototype.endsWith, function (t, e) { var n = this.toString(); ("number" != typeof e || !isFinite(e) || Math.floor(e) !== e || e > n.length) && (e = n.length), e -= t.length; var r = n.indexOf(t, e); return -1 !== r && r === e }), window.fetch = v.m(window.fetch, function (t) { console.log("customFetch", t); var e = null; if (window.XMLHttpRequest) e = new XMLHttpRequest; else if (window.Ki) try { e = new ActiveXObject("Msxml2.XMLHTTP") } catch (t) { try { e = new ActiveXObject("Microsoft.XMLHTTP") } catch (t) { } } var n = new Promise(function (t) { e.onload = t, e.onerror = function (e) { t(Promise.reject(e)) } }), r = new Promise(function (t) { t({ json: function () { return e.send(), n.then(function () { return JSON.parse(e.responseText) }) }, text: function () { return e.send(), n.then(function () { return e.responseText }) }, arrayBuffer: function () { return e.responseType = "arraybuffer", e.send(), n.then(function () { return e.response }) } }) }); return e.open("get", t, !0), r }), y.Ee(new B("red", "red")), y.Ee(new B("blue", "blue")), y.Ee(new B("black", "black")), y.Ee(new B("green", "green")), y.Ee(new B("pink", "pink")), y.Ee(new B("dark", "dark")), M._i(new pt(new I("img/whatsapp.svg"), "whatsapp", !0)), M._i(new pt(new A("img/sms.svg"), "sms", !0)), M._i(new pt(new N("img/telegram.svg"), "telegram", !0)); var Zt = new P; u.l(function () { window.app = Zt, window.app.pause = Zt.pause, window.app.resume = Zt.resume, window.app.setAppEndListener = Zt.setAppEndListener }), J.ro("html/application/setting-template.html"), ut.at = !1, at.ko = !1, a.resolve(Zt).then(r(regeneratorRuntime.mark(function t() { var e; return regeneratorRuntime.wrap(function (t) { for (; ;) switch (t.prev = t.next) { case 0: J.oo.p = l.Y, e = F.Kt(), mt.Kt().play(mt.ha.fa, { ua: "sound/brightAndBeautifull__.mp3", loop: !0, volume: .6, muted: "1" !== e.yr("play-music", "1") }).catch(function (t) { return console.error(t) }), Zt.start(Ut), d.bt("de"), ht.Wo(function () { }), ht.Eo() && ct.Kt().persist(), window.applyAndroidBridge = u.u; case 3: case"end": return t.stop() } }, t, this) })));