! function() { "use strict"; const e = () => void 0 !== window.Engine, t = (e, t, i, s) => { var n; n = e[t], e[t] = function(...e) { "function" == typeof i && i.apply(this, e); let t = n.apply(this, arguments); return "function" == typeof s && s.call(this, e, t), t } }, i = t => { const i = e() ? window.Engine.map.d.visibility : window.map.visibility; if (0 === i) return !0; const { x: s, y: n } = e() ? window.Engine.hero.d : window.hero; return Math.abs(s - t.x) <= i && Math.abs(n - t.y) <= i }, s = e => e > 19 && e < 30, n = e => { if (e < 1) return "0:00"; let t = Math.floor(e / 3600), i = Math.floor(e / 60) % 60; return t > 0 && i < 10 && (i = "0" + i), (t > 0 ? t + ":" : "") + i + ":" + ("0" + e % 60).substr(-2) }, o = () => { document.title = "Margonem MMORPG" }, r = ({ cid: t, aid: i, world: s }) => { if (c() === t && l() === i && d() === s) return window.message("Jesteś już na tej postaci"); const n = () => { const e = new Date; e.setTime(e.getTime() + 2592e6), setCookie("mchar_id", t, e, "/", "margonem.pl"), i !== l() && window.setCookie("user_id", i, e, "/", "margonem.pl"), s !== d() ? window.location.replace(`https://${s}.margonem.pl`) : window.location.reload() }, o = (e() ? Engine.hero.d.guest : hero.guest) ? "logout" : "loginSubstitute"; if (i !== l()) { const e = window.getCookie("hs3"); fetch("https://www.margonem.pl/ajax/" + o, { method: "POST", mode: "no-cors", body: `h2=${e}&security=true`, headers: { "content-type": "application/x-www-form-urlencoded; charset=UTF-8" }, credentials: "include" }).then(n) } else n() }, a = ({ id: e = "", name: t = "", world: i }) => e + t + i, d = () => e() ? Engine.worldConfig.getWorldName() : g.worldname, l = () => e() ? window.getCookie("user_id") : g.aid, c = () => e() ? Engine.hero.d.id : hero.id, m = () => e() ? Engine.lock : g.lock, h = (t, i) => { e() ? (i = i.map((e, t) => ({ txt: 0 === t ? "Tak" : "Nie", callback: () => (e(), !0) })), window.mAlert(t, i)) : window.mAlert(t, 2, i) }; function p(e, t) { void 0 === t && (t = {}); var i = t.insertAt; if (e && "undefined" != typeof document) { var s = document.head || document.getElementsByTagName("head")[0], n = document.createElement("style"); n.type = "text/css", "top" === i && s.firstChild ? s.insertBefore(n, s.firstChild) : s.appendChild(n), n.styleSheet ? n.styleSheet.cssText = e : n.appendChild(document.createTextNode(e)) } } var u = { multiplier: 1, opacity: .6, size: 14, title: !0, floating: !1, floatingPos: { x: 0, y: 0 }, alwaysActive: !1, moveBookmarks: !0, highlight: !0, highlightTime: 30, deleteTime: 90, volume: .2, alertRespawn: !1, alertRespawnUrl: "https://cronus.margonem.com/sounds/elite2_here.mp3", alertHighlight: !1, alertHighlightUrl: "https://cronus.margonem.com/sounds/abbys.mp3", elitesFirst: !0, firstRun: !0 }; var w = new class { constructor() { this.storage = e() ? API.Storage : window.margoStorage, this.settings = this.storage.get("timer2/settings", u), this.emitter = (() => { const e = {}; return { on(t, i) { e[t] || (e[t] = []), e[t].push(i) }, emit(t, i) { let s = e[t]; s && s.forEach(e => e(i)) } } })() } get(e) { return window.isset(this.settings[e]) ? this.settings[e] : this.getDefault(e) } set(e, t) { this.settings[e] = t, this.storage.set("timer2/settings", this.settings), this.emitter.emit(e, t) } getDefault(e) { return window.isset(u[e]) ? u[e] : null } reset(e) { this.set(e, this.getDefault(e)) } resetAll() { Object.entries(u).forEach(([e, t]) => { this.set(e, t) }) } }, A = [{ key: "multiplier", type: "text", label: "MnoĚźnik czasu odrodzenia" }, { key: "opacity", type: "slider", label: "Przezroczystość", min: .3, max: .9, step: .01 }, { key: "size", type: "slider", label: "Wielkość tekstu", min: 8, max: 16, step: 1 }, { key: "title", type: "checkbox", label: "Wyświetlaj ostatni wpis w tytule karty" }, { key: "floating", type: "checkbox", label: "Pływający minutnik" }, { key: "alwaysActive", type: "checkbox", label: "Interfejs minutnika zawsze aktywny" }, { key: "moveBookmarks", type: "checkbox", label: "Przesuń zakładki (np. druĚźyny, konsoli)", interface: "old" }, { key: "highlight", type: "checkbox", label: "Podświetlaj wpis zbliĚźający się do końca" }, { key: "highlightTime", type: "text", label: "Czas podświetlenia wpisu [s]" }, { key: "deleteTime", type: "text", label: "Czas do usunięcia wpisu [s]" }, { key: "alertRespawn", type: "checkbox", label: "Alert dĹşwiękowy po odrodzeniu" }, { key: "alertHighlight", type: "checkbox", label: "Alert dĹşwiękowy po podświetleniu" }, { key: "alertRespawnUrl", type: "text", label: "ŚcieĚźka do alertu odrodzenia", audio: !0 }, { key: "alertHighlightUrl", type: "text", label: "ŚcieĚźka do alertu podświetlenia", audio: !0 }, { key: "volume", type: "slider", label: "Głośność alertĂłw", min: .05, max: 1, step: .01 }]; var b = new class { constructor() { this.sounds = {}, this.block = !1 } load(e) { this.sounds[e] = new Audio(e) } unload(e) { this.sounds[e] && delete this.sounds[e] } play(e) { if (this.block) return; this.block = !0, this.sounds[e] || this.load(e); const t = this.sounds[e]; t.pause(), t.currentTime = 0, t.volume = w.get("volume"), t.play().then(() => { this.block = !1 }).catch(() => { this.block = !1 }) } }, f = ["Czarna Wilczyca", "Karhu", "Vulk", "MrĂłwcza KrĂłlowa", "Astratus", "Kotołak Tropiciel", "Paladyński Apostata", "Cerber", "Herszt rozbĂłjnikĂłw", "Wilkołak", "Tollok Shimger", "DowĂłdca Ghuli", "Wilcza Jagoda", "Thowar", "Gnom Figlid", "Wilcza Paszcza", "Krogor", "Nocny Puff", "Vonaros", "Lisz", "Kraken", "Tarrol Agze", "Brzeginia", "Topielica Nelumbo", "MrĂłwka KrĂłlowa", "́owca SkĂłr", "Zarządca Magazynu", "Duchowy PoĚźeracz", "Berog Astron", "Mnich Czarnego Uroku", "Selder", "Centaur Zyfryd", "Henry Kaprawe Oko", "Cheperu", "Pomylony Miś", "Zabalsamowany wyznawca Seta", "Marid", "Szkielet bosmana", "Zarządca KazamatĂłw", "Moloch Klucznik", "Demiurg cretula", "Demoniczny StraĚźnik", "StraĚźnik MaddokĂłw", "Szafirowa Bolita", "Potężny Furbol"]; var y = new class { constructor() { this.storage = e() ? API.Storage : window.margoStorage, this.disabled = this.storage.get("timer2/disabledElites", {}), this.userElites = this.storage.get("timer2/userElites", []) } check(e) { return this.isElite(e) && !this.isDisabled(e) } isElite(e) { return f.includes(e) || this.userElites.includes(e) } isDisabled(e) { return e in this.disabled } add(e) { if (!e || this.isElite(e)) throw new Error("Elite is already on the list"); return this.userElites.push(e), this.storage.set("timer2/userElites", this.userElites), !0 } remove(e) { const t = this.userElites.indexOf(e); if (t < 0) throw new Error("Elite is not on the user list"); return this.userElites.splice(t, 1), this.storage.set("timer2/userElites", this.userElites), !0 } setState(e, t) { if (!this.isElite(e)) throw new Error("Elite is not on the list"); return !0 === t ? this.disabled[e] = !0 : this.isDisabled(e) && delete this.disabled[e], this.storage.set("timer2/disabledElites", this.disabled), !0 } }; class x { constructor() { this.lock = m() } toggle() { this.$wnd ? e() ? this.newWnd.isShow() ? this.newWnd.hide() : this.newWnd.show() : this.$wnd ? this.$wnd.toggle() : this.init() : this.init(), this.toggleLock() } toggleLock() { this.lock.check("timer-settings") ? this.lock.remove("timer-settings") : this.lock.add("timer-settings") } init() { this.$wnd = $('
'), this.$content = this.$wnd.find(".timer-settings__content"), this.initTabs([ ["Ustawienia", this.loadSettingsTab], ["Elity", this.loadElitesTab], ["Informacje", this.loadInfoTab] ]), p('.timer-elites{width:70%;height:90%;display:flex;flex-direction:column;box-sizing:border-box}.timer-elites__list{height:100%;overflow-y:scroll;border:1px solid #555}.timer-elites__elite{display:flex;padding:4px;align-items:center}.timer-elites__elite:hover{background:rgba(0,0,0,.2)}.timer-elites__header{margin-bottom:1em}.timer-elites__controls{margin-top:.5em;padding:10px;display:flex}.timer-elites__input{width:100%;margin-right:10px;border:0;background:none;border:1px solid hsla(0,0%,100%,.3);color:#fff;padding:5px}.timer-elites__remove{cursor:pointer;position:relative;width:1em;height:1em;margin-left:auto;margin-right:4px}.timer-elites__remove:before{transform:rotate(45deg)}.timer-elites__remove:after{transform:rotate(-45deg)}.timer-elites__remove:after,.timer-elites__remove:before{position:absolute;left:.5em;content:" ";height:1em;width:2px;background-color:#888}.timer-elites__elite input{margin-right:.5em}.timer-settings{position:absolute;width:512px;height:512px;background:rgba(0,0,0,.7);z-index:398;font-family:sans-serif;font-size:14px;backdrop-filter:blur(5px);display:flex;flex-direction:column;color:#fff}.timer-settings--ni{font-family:Aleo;position:relative;background:none}.timer-settings__header{display:flex;justify-content:space-between;background:hsla(0,0%,39.2%,.3)}.timer-settings__close{background:#000;padding:10px 12px;border:none;color:#aaa;cursor:pointer}.timer-settings__tabs{display:flex}.timer-settings__tab{padding:10px 12px;cursor:pointer}.timer-settings__tab--active{background:hsla(0,0%,100%,.3);box-shadow:0 0 10px #222}.timer-settings__tab:not(.timer-settings__tab--active):hover{background:hsla(0,0%,39.2%,.2)}.timer-settings__content{display:flex;flex-direction:column;justify-content:space-around;align-items:center;height:100%;overflow:hidden;width:100%;padding:10px;box-sizing:border-box}.timer-settings__label{width:100%;height:1.5em}.timer-settings__label--input{display:flex;justify-content:space-between;align-items:center}.timer-settings__label--input span{margin-right:auto}.timer-settings__button{cursor:pointer;margin-right:.2em;padding:2px}.timer-settings__label--input input[type=text]{border:0;background:none;border:1px solid hsla(0,0%,100%,.3);color:#fff;padding:5px;width:120px}.timer-settings__checkbox{margin-right:10px}.timer-info{width:80%}.timer-info p{text-align:center;margin:2em 0}.timer-settings__ni-bg{position:absolute;top:-2px;left:-10px;right:-10px;bottom:-5px;border-style:solid;border-width:10px;border-image:url(../img/gui/quests/quest_middle.png) 10 fill round}'), e() ? (this.$wnd.addClass("timer-settings--ni"), Engine.windowManager.add({ content: this.$wnd, title: "Minutnik", nameWindow: "minutnik-ni-si", objParent: this, nameRefInParent: "newWnd", onclose: () => { this.toggle() } }), this.$wnd.find(".timer-settings__close").hide(), this.newWnd.$.append('
').find(".content").css("padding", 0), this.newWnd.addToAlertLayer(), this.newWnd.setWndOnPeak(!0), this.newWnd.center()) : (this.$wnd.appendTo("#centerbox"), this.$wnd.find(".timer-settings__close").click(() => this.toggle())) } initTabs(e) { const t = this.$wnd.find(".timer-settings__tabs"); e.forEach(e => { t.append(this.createTabElem(e)) }), this.changeActiveTab(this.$wnd.find(".timer-settings__tab:first-child").first()), e[0][1].call(this) } createTabElem(e) { return $('
').text(e[0]).click(t => { this.changeActiveTab($(t.target)), e[1].call(this) }) } changeActiveTab(e) { e.toggleClass("timer-settings__tab--active", !0).siblings().toggleClass("timer-settings__tab--active", !1) } loadSettingsTab() { this.$content.html(""), A.forEach(t => { if (e() && "old" === t.interface) return; let i; "checkbox" === t.type ? i = this.createCheckbox(t) : "text" === t.type ? i = this.createInput(t) : "slider" === t.type && (i = this.createSlider(t)), this.$content.append(i) }) } loadInfoTab() { this.$content.html('

Przytrzymaj przycisk CTRL, aby uaktywnić interfejs Minutnika.

Użyj przycisku Âť lub naciśnij PPM na wpis, aby się przelogować.

') } createCheckbox({ key: e, label: t }) { const i = $('