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