// ==UserScript==
// @name EventHelperPlain
// @version 16.0.1699793247
// @author achepta
// @description try to take over the world!
// @match https://www.heroeswm.ru/*
// @match https://my.lordswm.com/*
// @match https://www.lordswm.com/*
// @connect hwm.events
// @connect localhost
// @grant unsafeWindow
// @license GNU GPLv3
// @run-at document-end
// @namespace https://greasyfork.org/ru/scripts/399402-eventhelper
// ==/UserScript==
function start() {
let newScript = document.createElement('script');
newScript.innerHTML = "function $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\nvar $parcel$global =\ntypeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequire4808\"];\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequire4808\"] = parcelRequire;\n}\nparcelRequire.register(\"85UD7\", function(module, exports) {\n\nvar $aqxxv = parcelRequire(\"aqxxv\");\n\nvar $dIwPZ = parcelRequire(\"dIwPZ\");\n\nvar $gGPCy = parcelRequire(\"gGPCy\");\n\nvar $cLY7G = parcelRequire(\"cLY7G\");\n\nvar $86JDc = parcelRequire(\"86JDc\");\n\nvar $av1kA = parcelRequire(\"av1kA\");\n\nvar $jbjeJ = parcelRequire(\"jbjeJ\");\n\nvar $2jsww = parcelRequire(\"2jsww\");\n\nvar $cyF3r = parcelRequire(\"cyF3r\");\n\nvar $bUtSC = parcelRequire(\"bUtSC\");\n\nvar $d44k3 = parcelRequire(\"d44k3\");\n\nvar $aXIev = parcelRequire(\"aXIev\");\n\nvar $bKNGT = parcelRequire(\"bKNGT\");\n\nvar $lBuTJ = parcelRequire(\"lBuTJ\");\n\nvar $ag9Ot = parcelRequire(\"ag9Ot\");\n\nvar $2GRXP = parcelRequire(\"2GRXP\");\n\nvar $19fJa = parcelRequire(\"19fJa\");\n\nvar $1MCWa = parcelRequire(\"1MCWa\");\n\nvar $douos = parcelRequire(\"douos\");\n\nvar $gJdWA = parcelRequire(\"gJdWA\");\n\nvar $5Nw5f = parcelRequire(\"5Nw5f\");\n\nvar $028DL = parcelRequire(\"028DL\");\nasync function setup() {\n if (!(0, $dIwPZ.pl_lvl)) {\n let doc = await (0, $aqxxv.doGet)(`/pl_info.php?id=${(0, $dIwPZ.pl_id)}`, true);\n (0, $dIwPZ.set)(\"hero_combat_lvl\", doc.body.innerText.match(/(\u0411\u043e\u0435\u0432\u043e\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c|Combat level): (\\d{1,2})/)[2] - 0);\n location.reload();\n }\n if (!(0, $dIwPZ.my_sign)) {\n let doc = await (0, $aqxxv.doGet)(`/shop.php`, true);\n (0, $dIwPZ.set)(\"my_sign\", doc.body.innerHTML.match(/sign=([a-z0-9]+)/)[1]);\n location.reload();\n }\n if (location.href.includes(\"inventory\")) {\n (0, $dIwPZ.set)(\"my_sign\", window.sign);\n (0, $dIwPZ.set)(\"hero_combat_lvl\", window.pl_level);\n }\n}\nsetup();\nif (location.href.includes(\"skillwheel.php\") || location.href.includes(\"skillwheel_demo.php\")) return;\n(0, $gGPCy.setGlobalStyles)();\n// EVENTS\n(0, $cLY7G.default)();\n(0, $86JDc.default)();\n(0, $av1kA.default)();\n(0, $jbjeJ.default)();\n(0, $028DL.default)();\n(0, $2jsww.default)();\n(0, $lBuTJ.default)();\n(0, $cyF3r.default)();\n(0, $bUtSC.default)();\n(0, $d44k3.default)();\n(0, $aXIev.default)();\n(0, $1MCWa.default)();\n(0, $douos.default)();\n(0, $gJdWA.default)();\n(0, $bKNGT.default)();\n(0, $ag9Ot.default)();\n(0, $2GRXP.default)();\n(0, $19fJa.default)();\n(0, $5Nw5f.default)();\n\n});\nparcelRequire.register(\"aqxxv\", function(module, exports) {\n\n$parcel$export(module.exports, \"doGet\", () => $7976595477021521$export$9148a8a8d7b4fde3);\n$parcel$export(module.exports, \"doPost\", () => $7976595477021521$export$872f4f09fb3b16a3);\nconst $7976595477021521$var$HWM_EVENTS_SERVER = \"https://hwm.events\";\nfunction $7976595477021521$var$doRequest(url, method, body, html) {\n return new Promise((resolve)=>{\n let http = new XMLHttpRequest;\n if (html) {\n http.overrideMimeType(\"text/html; charset=windows-1251\");\n http.open(method, url, true);\n } else http.open(method, `${$7976595477021521$var$HWM_EVENTS_SERVER}/${url}`, true);\n http.send(body);\n http.onreadystatechange = function() {\n if (http.readyState === 4) {\n if (http.status === 200 || http.status === 201) {\n let response = null;\n if (html) response = new DOMParser().parseFromString(http.responseText, \"text/html\");\n else try {\n response = JSON.parse(http.responseText);\n } catch (e) {}\n resolve(response);\n } else resolve(http.responseText);\n }\n };\n });\n}\nasync function $7976595477021521$export$9148a8a8d7b4fde3(url, html = false) {\n return $7976595477021521$var$doRequest(url, \"GET\", null, html);\n}\nasync function $7976595477021521$export$872f4f09fb3b16a3(url, params, html = false) {\n return $7976595477021521$var$doRequest(url, \"POST\", params, html);\n}\n\n});\n\nparcelRequire.register(\"dIwPZ\", function(module, exports) {\n\n$parcel$export(module.exports, \"pl_id\", () => $9fc8db459327acdd$export$a98c729873a45942);\n$parcel$export(module.exports, \"pl_lvl\", () => $9fc8db459327acdd$export$b03bbb98cf6bc44e);\n$parcel$export(module.exports, \"get\", () => $9fc8db459327acdd$export$3988ae62b71be9a3);\n$parcel$export(module.exports, \"my_sign\", () => $9fc8db459327acdd$export$4bed35a78e58f1ce);\n$parcel$export(module.exports, \"cdnHost\", () => $9fc8db459327acdd$export$58f89a6e09e5c37e);\n$parcel$export(module.exports, \"heroCreatures\", () => $9fc8db459327acdd$export$8f5b8658ad4b3d86);\n$parcel$export(module.exports, \"$\", () => $9fc8db459327acdd$export$3d8c2f653ac9d0b9);\n$parcel$export(module.exports, \"set\", () => $9fc8db459327acdd$export$adaa4cf7ef1b65be);\n$parcel$export(module.exports, \"findAll\", () => $9fc8db459327acdd$export$18200ea6c8035394);\n$parcel$export(module.exports, \"sortByKey\", () => $9fc8db459327acdd$export$584200199479c807);\n$parcel$export(module.exports, \"mapToArray\", () => $9fc8db459327acdd$export$c24a744d5dd88a3b);\n$parcel$export(module.exports, \"arrayToMapByKey\", () => $9fc8db459327acdd$export$258f6bc574c98342);\n$parcel$export(module.exports, \"groupBy\", () => $9fc8db459327acdd$export$3f063810d7bf01bd);\n$parcel$export(module.exports, \"groupByKey\", () => $9fc8db459327acdd$export$1fe5b8f7d230ae22);\n$parcel$export(module.exports, \"encode\", () => $9fc8db459327acdd$export$c564cdbbe6da493);\n$parcel$export(module.exports, \"allClasses\", () => $9fc8db459327acdd$export$be70899818c5d318);\n$parcel$export(module.exports, \"allFactions\", () => $9fc8db459327acdd$export$cd6531c0958b6b1a);\nlet $9fc8db459327acdd$export$a98c729873a45942 = $9fc8db459327acdd$export$4be65e66cfa2648a(\"pl_id\");\nlet $9fc8db459327acdd$export$b03bbb98cf6bc44e = $9fc8db459327acdd$export$3988ae62b71be9a3(\"hero_combat_lvl\", 0);\nlet $9fc8db459327acdd$export$4bed35a78e58f1ce = $9fc8db459327acdd$export$3988ae62b71be9a3(\"my_sign\", null);\nlet $9fc8db459327acdd$export$5e032988b71f6158 = location.host;\nlet $9fc8db459327acdd$export$58f89a6e09e5c37e = $9fc8db459327acdd$export$5e032988b71f6158.includes(\"my.\") ? \"cfcdn.lordswm.com\" : \"dcdn.heroeswm.ru\";\nlet $9fc8db459327acdd$export$8f5b8658ad4b3d86 = {};\nfunction $9fc8db459327acdd$export$3d8c2f653ac9d0b9(id, where = document) {\n return where.getElementById(id);\n}\nfunction $9fc8db459327acdd$export$3988ae62b71be9a3(key, def) {\n let result = JSON.parse(typeof localStorage[key] === \"undefined\" || localStorage[key] === \"undefined\" ? null : localStorage[key]);\n return result == null ? def : result;\n}\nfunction $9fc8db459327acdd$export$adaa4cf7ef1b65be(key, val) {\n localStorage[key] = JSON.stringify(val);\n}\nfunction $9fc8db459327acdd$export$9002ed06e448de20() {\n return Math.max(document.documentElement.scrollHeight, document.body.scrollHeight);\n}\nfunction $9fc8db459327acdd$export$18200ea6c8035394(regexPattern, sourceString) {\n let output = [];\n let match;\n let regexPatternWithGlobal = RegExp(regexPattern, [\n ...new Set(\"g\" + regexPattern.flags)\n ].join(\"\"));\n while(match = regexPatternWithGlobal.exec(sourceString)){\n delete match.input;\n output.push(match);\n }\n return output;\n}\nfunction $9fc8db459327acdd$export$584200199479c807(array, key, asc = 1) {\n return array.sort((a, b)=>{\n let x = a[key];\n let y = b[key];\n return x < y ? -1 * asc : x > y ? 1 * asc : 0;\n });\n}\nfunction $9fc8db459327acdd$export$c24a744d5dd88a3b(map) {\n let result = [];\n for (const [key, value] of Object.entries(map))result.push([\n parseInt(key),\n value\n ]);\n return result;\n}\nfunction $9fc8db459327acdd$export$258f6bc574c98342(array, key) {\n let result = {};\n array.forEach((item)=>{\n result[item[key]] = item;\n });\n return result;\n}\nfunction $9fc8db459327acdd$export$3f063810d7bf01bd(collection, property) {\n var i = 0, val, index, values = [], result = [];\n for(; i < collection.length; i++){\n val = collection[i][property];\n index = values.indexOf(val);\n if (index > -1) result[index].push(collection[i]);\n else {\n values.push(val);\n result.push([\n collection[i]\n ]);\n }\n }\n return result;\n}\nfunction $9fc8db459327acdd$export$1fe5b8f7d230ae22(array, key) {\n return array.reduce((hash, obj)=>{\n if (obj[key] === undefined) return hash;\n return Object.assign(hash, {\n [obj[key]]: (hash[obj[key]] || []).concat(obj)\n });\n }, {});\n}\nfunction $9fc8db459327acdd$export$c564cdbbe6da493(str) {\n let customEncode = (e)=>{\n return \"%\" + (parseInt(e.charAt(1) + e.charAt(5), 16) + 16 * ((x)=>-(2 * x ** 3) / 3 + 20 * x ** 2 - 595 * x / 3 + 650)(parseInt(e.charAt(4), 16)).toFixed()).toString(16);\n };\n return Array.from(str).map((c)=>c.charCodeAt(0) >= 1040 && c.charCodeAt(0) <= 1103 ? customEncode(encodeURIComponent(c)) : encodeURIComponent(c)).join(\"\");\n}\nfunction $9fc8db459327acdd$export$4be65e66cfa2648a(name) {\n const value = `; ${document.cookie}`;\n const parts = value.split(`; ${name}=`);\n if (parts.length === 2) return parts.pop().split(\";\").shift();\n}\nlet $9fc8db459327acdd$export$be70899818c5d318 = [\n [\n 1,\n \"\u0420\u044b\u0446\u0430\u0440\u044c\",\n 0,\n \"r1.png\",\n 1\n ],\n [\n 1,\n \"\u0420\u044b\u0446\u0430\u0440\u044c \u0441\u0432\u0435\u0442\u0430\",\n 1,\n \"r101.png\",\n 101\n ],\n [\n 2,\n \"\u041d\u0435\u043a\u0440\u043e\u043c\u0430\u043d\u0442\",\n 0,\n \"r2.png\",\n 2\n ],\n [\n 2,\n \"\u041d\u0435\u043a\u0440\u043e\u043c\u0430\u043d\u0442 - \u043f\u043e\u0432\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u0441\u043c\u0435\u0440\u0442\u0438\",\n 1,\n \"r102.png\",\n 102\n ],\n [\n 3,\n \"\u041c\u0430\u0433\",\n 0,\n \"r3.png\",\n 3\n ],\n [\n 3,\n \"\u041c\u0430\u0433 - \u0440\u0430\u0437\u0440\u0443\u0448\u0438\u0442\u0435\u043b\u044c\",\n 1,\n \"r103.png\",\n 103\n ],\n [\n 4,\n \"\u042d\u043b\u044c\u0444\",\n 0,\n \"r4.png\",\n 4\n ],\n [\n 4,\n \"\u042d\u043b\u044c\u0444 - \u0437\u0430\u043a\u043b\u0438\u043d\u0430\u0442\u0435\u043b\u044c\",\n 1,\n \"r104.png\",\n 104\n ],\n [\n 5,\n \"\u0412\u0430\u0440\u0432\u0430\u0440\",\n 0,\n \"r5.png\",\n 5\n ],\n [\n 5,\n \"\u0412\u0430\u0440\u0432\u0430\u0440 \u043a\u0440\u043e\u0432\u0438\",\n 1,\n \"r105.png\",\n 105\n ],\n [\n 5,\n \"\u0412\u0430\u0440\u0432\u0430\u0440 - \u0448\u0430\u043c\u0430\u043d\",\n 2,\n \"r205.png\",\n 205\n ],\n [\n 6,\n \"\u0422\u0435\u043c\u043d\u044b\u0439 \u044d\u043b\u044c\u0444\",\n 0,\n \"r6.png\",\n 6\n ],\n [\n 6,\n \"\u0422\u0435\u043c\u043d\u044b\u0439 \u044d\u043b\u044c\u0444 - \u0443\u043a\u0440\u043e\u0442\u0438\u0442\u0435\u043b\u044c\",\n 1,\n \"r106.png\",\n 106\n ],\n [\n 7,\n \"\u0414\u0435\u043c\u043e\u043d\",\n 0,\n \"r7.png\",\n 7\n ],\n [\n 7,\n \"\u0414\u0435\u043c\u043e\u043d \u0442\u044c\u043c\u044b\",\n 1,\n \"r107.png\",\n 107\n ],\n [\n 8,\n \"\u0413\u043d\u043e\u043c\",\n 0,\n \"r8.png\",\n 8\n ],\n [\n 8,\n \"\u0413\u043d\u043e\u043c \u043e\u0433\u043d\u044f\",\n 1,\n \"r108.png\",\n 108\n ],\n [\n 9,\n \"\u0421\u0442\u0435\u043f\u043d\u043e\u0439 \u0432\u0430\u0440\u0432\u0430\u0440\",\n 0,\n \"r9.png\",\n 9\n ],\n [\n 10,\n \"\u0424\u0430\u0440\u0430\u043e\u043d\",\n 0,\n \"r10.png\",\n 10\n ]\n];\nlet $9fc8db459327acdd$export$cd6531c0958b6b1a = [\n [\n -1,\n \"All\",\n \"\"\n ],\n [\n 1,\n \"\u0420\u044b\u0446\u0430\u0440\u044c\",\n \"r1.png\"\n ],\n [\n 2,\n \"\u041d\u0435\u043a\u0440\u043e\u043c\u0430\u043d\u0442\",\n \"r2.png\"\n ],\n [\n 3,\n \"\u041c\u0430\u0433\",\n \"r3.png\"\n ],\n [\n 4,\n \"\u042d\u043b\u044c\u0444\",\n \"r4.png\"\n ],\n [\n 5,\n \"\u0412\u0430\u0440\u0432\u0430\u0440\",\n \"r5.png\"\n ],\n [\n 6,\n \"\u0422\u0435\u043c\u043d\u044b\u0439 \u044d\u043b\u044c\u0444\",\n \"r6.png\"\n ],\n [\n 7,\n \"\u0414\u0435\u043c\u043e\u043d\",\n \"r7.png\"\n ],\n [\n 8,\n \"\u0413\u043d\u043e\u043c\",\n \"r8.png\"\n ],\n [\n 9,\n \"\u0421\u0442\u0435\u043f\u043d\u043e\u0439 \u0432\u0430\u0440\u0432\u0430\u0440\",\n \"r9.png\"\n ],\n [\n 10,\n \"\u0424\u0430\u0440\u0430\u043e\u043d\",\n \"r10.png\"\n ],\n [\n 0,\n \"\u041d\u0435\u0439\u0442\u0440\u0430\u043b\",\n \"r_neut.png\"\n ]\n];\n\n});\n\nparcelRequire.register(\"gGPCy\", function(module, exports) {\n\n$parcel$export(module.exports, \"setGlobalStyles\", () => $c2689c6d2105100d$export$e30d03af76db9a2d);\nfunction $c2689c6d2105100d$export$e30d03af76db9a2d() {\n document.body.insertAdjacentHTML(\"beforeend\", `\n <style>\n .battle_examples_container {\n display: flex;\n width: 100%;\n justify-content: space-evenly;\n }\n @media (max-width: 800px) {\n .battle_examples_container {\n flex-direction: column;\n justify-content: center;\n }\n }\n @media (max-width: 1440px) {\n \n .records-container-body{\n grid-template-columns: 1fr 4fr !important;\n }\n \n .records-container-body > div:nth-child(n+5) {\n border-top: unset !important;\n }\n \n .records-container-body > div:nth-child(5n+6), .records-container-body > div:nth-child(5n+7) {\n border-top: 2px solid black !important;\n }\n \n .record-players-creatures, .special-creature, .special-creature-extended {\n grid-column-start: 1;\n grid-column-end: 3 !important; \n }\n }\n \n .btn_hover2{\n transition: -webkit-filter .3s;\n transition: filter .3s;\n }\n .btn_hover2:hover{\n cursor: pointer;\n -webkit-filter: brightness(125%) drop-shadow(0 0 5px #ffe4b3);\n filter: brightness(125%) drop-shadow(0 0 5px #ffe4b3);\n }\n .home_button2{\n padding: 2px 4px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n image-rendering: -webkit-optimize-contrast;\n image-rendering: optimizeQuality;\n color: #592C08;\n font-family: verdana,geneva,arial cyr;\n -webkit-user-select: none;\n position: relative;\n font-size: 100%;\n text-align: center;\n font-weight: bold;\n cursor: pointer;\n background: url(../i/homeico/art_btn_bg_gold.png) #DAB761;\n background-size: 100% 100%;\n border-radius: 5px;\n box-shadow: inset 0 0 0 1px #fce6b0,\n inset 0 0 0 2px #a78750,\n 0 0 0 1px rgba(0,0,0,.13);\n line-height: 25px;\n }\n input[id^=\"spoiler\"] {\n display: none;\n }\n \n input[id^=\"spoiler\"] + label {\n display: block;\n text-align: center;\n font-size: 14px;\n cursor: pointer;\n transition: all .6s;\n }\n \n input[id^=\"spoiler\"] ~ .spoiler {\n display: none;\n opacity: 0;\n transition: all .6s;\n }\n \n input[id^=\"spoiler\"]:checked + label + .spoiler {\n display: block;\n opacity: 1;\n width: 100%;\n }\n \n .roguesSpoilerWrapper{\n width: 100%;\n display: flex;\n flex-direction: column;\n }\n .roguesSpoilerLabel{\n width: 100%;\n display: flex !important;\n justify-content: center;\n }\n \n .record-wrapper{\n display: flex;\n flex-direction: column;\n }\n .record-container {\n display: flex;\n flex-wrap: nowrap;\n width: 100%;\n overflow: auto;\n margin-top: 4px;\n }\n \n .record-players, .record-number {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n \n .record-number {\n font-weight: bold;\n font-size: 18px;\n }\n \n .fav_player_button {\n cursor: pointer;\n filter: opacity(0.5);\n transition: transform 0.5s ease;\n }\n \n .fav_player_button svg {\n width: 24px;\n height: 24px;\n }\n \n .fav_player_button:hover {\n filter: opacity(1);\n transform: scale(1.2);\n }\n \n .record-players {\n flex-direction: column;\n padding: 4px;\n }\n \n .record-players-creatures {\n display: flex;\n flex-wrap: nowrap;\n }\n .record-players-arms {\n height: 40px; \n }\n .record-player-creatures {\n display: flex;\n }\n \n .player-creatures-row {\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: center;\n }\n .creatures-checkers {\n display: flex;\n justify-content: space-around;\n }\n .creatures-apply {\n display: flex;\n flex-direction: column-reverse;\n justify-content: space-evenly;\n padding: 4px;\n }\n .player-leadership {\n display: flex;\n align-items: center;\n }\n \n .records-container-header {\n /*background: url(\"https://media3.giphy.com/media/YFFG4W2MvihirVoSQU/giphy.gif\") repeat;*/\n background-size: 6%;\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: center;\n width: 100%;\n }\n \n .records-container-header > div {\n padding: 10px;\n background: #f8f8f2;\n border-radius: 20px;\n border: 2px solid rgb(26,55,86);\n }\n \n .records-container-body {\n margin-top: 10px;\n flex-wrap: unset; \n justify-content: unset; \n display: grid; \n grid-template-columns: 1fr 4fr 8fr 8fr; \n overflow: auto;\n width: 100%;\n padding: unset;\n }\n \n .records-container-body > div:nth-child(n+5) {\n border-top: 2px solid black;\n }\n \n .records-container-body > div:nth-child(5n) {\n border-top: unset;\n }\n \n .record-result {\n display: flex; \n justify-content: center; \n align-items: center\n }\n .record-result > div {\n margin: 5px 5px 5px 0;\n display: flex;\n align-items: center;\n }\n .record-result img {\n height: 24px; \n vertical-align: middle\n }\n .record-result span {\n font-weight: bold\n }\n .custom-creature {\n width: 40px;\n }\n .custom-creature > img {\n border-radius: 50%;\n border: 1px solid #747474;\n width: 50px;\n height: 50px;\n object-fit: cover;\n \n }\n .custom-amount {\n right: unset;\n left: calc(50% - (12px));\n bottom: -0.3em;\n width: 40px;\n text-align: center;\n }\n .good-creature {\n cursor: pointer;\n }\n .bad-creature {\n color: #ff5050;\n cursor: pointer;\n }\n \n .special-creature {\n display: flex;\n }\n .special-creature-info{\n display: flex;\n justify-content: space-between;\n }\n \n .special-creature-info-button{\n cursor:pointer;\n z-index: 1;\n }\n .special-creature-info-button:hover {\n filter: brightness(1.25);\n }\n .special-creature-stats {\n display: flex;\n flex-direction: column;\n margin-top: 2px;\n }\n .special-creature-stats > div {\n display: flex;\n justify-content: space-between;\n height: 25px;\n }\n .special-creature-stats > div > div {\n display: flex;\n }\n .special-creature-stat-icon{\n vertical-align: bottom;\n height: 20px;\n filter: drop-shadow(0.01rem 0.01rem 0 #747474) drop-shadow(-0.01rem -0.01rem 0 #747474);\n }\n .special-creature-stat-value {\n font-size: 14px;\n font-weight: bold;\n }\n .special-creature-extended {\n display: none;\n grid-column-start: 1;\n grid-column-end: 5;\n }\n .visible{\n display: block;\n }\n .failed-records-wrapper {\n display: flex;\n justify-content: center;\n }\n .failed-records-container {\n display: flex; \n flex-direction: column;\n width: fit-content;\n }\n \n \n .faction-hunt-data {\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n }\n .btn_hover2{\n transition: -webkit-filter .3s;\n transition: filter .3s;\n }\n .btn-gradient {\n text-decoration: none;\n color: white;\n padding: 5px;\n display: inline-block;\n cursor: pointer;\n position: relative;\n border: 1px solid rgba(0,0,0,0.21);\n border-bottom: 4px solid rgba(0,0,0,0.21);\n border-radius: 4px;\n text-shadow: 0 1px 0 rgba(0,0,0,0.15);\n user-select: none;\n }\n \n .btn-gradient.blue:active {background: #608FBF;}\n .btn-gradient.blue {\n background: rgba(102,152,203,1);\n background: linear-gradient(to bottom, rgba(102,152,203,1) 0%, rgba(92,138,184,1) 100%);\n filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6698cb', endColorstr='#5c8ab8', GradientType=0 );\n }\n \n \n .progress {\n font-size: 14px !important;\n text-shadow: none;\n }\n \n .wrapper {\n color: black;\n letter-spacing: 1px;\n display: flex;\n justify-content: center;\n }\n .wrapperStat {\n display: flex;\n flex-direction: column;\n justify-content: center;\n text-align: center;\n align-items: center;\n }\n .wrapperStat > div {\n margin-bottom: 5px;\n }\n \n /* custom scrollbar */\n .record-container::-webkit-scrollbar {\n width: 20px;\n }\n \n .record-container::-webkit-scrollbar-track {\n background-color: transparent;\n }\n \n .record-container::-webkit-scrollbar-thumb {\n background-color: #d6dee1;\n border-radius: 20px;\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n background-clip: content-box;\n }\n \n .record-container::-webkit-scrollbar-thumb:hover {\n background-color: #a8bbbf;\n }\n \n \n .battle_info_chip {\n padding: 4px;\n border: 2px solid #776c6c;\n margin: 2px;\n border-radius: 10px;\n font-size: 20px;\n background-color: #dbdad8;\n background-image: url(https://cfcdn.lordswm.com/i/art_fon_100x100.png);\n background-origin: border-box;\n }\n \n .battle_art_chip {\n \n position: relative; \n height: 50px; \n width: 50px\n }\n \n .art_img {\n width: 50px;\n height: 50px;\n position: absolute;\n top: 4px;\n left: 4px;\n }\n .art_mods_container {\n height: 10px;\n bottom: 0;\n position: absolute;\n z-index: 1;\n display: inline-block;\n white-space: nowrap;\n text-align: right;\n width: 50px\n }\n </style>\n `);\n}\n\n});\n\nparcelRequire.register(\"cLY7G\", function(module, exports) {\n\n$parcel$export(module.exports, \"default\", () => $94c882ff7c0aae5d$export$2e2bcd8739ae039);\n\nvar $dIwPZ = parcelRequire(\"dIwPZ\");\n\nvar $jWJKf = parcelRequire(\"jWJKf\");\n\nvar $ao0pt = parcelRequire(\"ao0pt\");\n\nvar $8l3id = parcelRequire(\"8l3id\");\n\nvar $aqxxv = parcelRequire(\"aqxxv\");\n\nvar $eTbLz = parcelRequire(\"eTbLz\");\n\nvar $8nxuZ = parcelRequire(\"8nxuZ\");\nasync function $94c882ff7c0aae5d$export$2e2bcd8739ae039() {\n let favourites = (0, $dIwPZ.get)(\"leader_favourites\", []);\n let isEvent = false;\n let lg_lvl = parseInt((0, $dIwPZ.get)(\"hero_leader_lvl\", 10));\n let battles = [];\n let isLostBattles = false;\n window.sendApplyArmy = sendApplyArmy;\n window.saveFav = saveFav;\n window.showSpecialCreatureData = showSpecialCreatureData;\n window.replaceCellListener = replaceCellListener;\n window.removeOverlay = removeOverlay;\n if (/(leader_rogues|leader_winter)/.test(location.href)) {\n if ((0, $dIwPZ.get)(\"show_event_timer\", true)) (0, $ao0pt.setTimer)(document.querySelector(\".global_container_block_header\"));\n isEvent = true;\n if (document.body.innerHTML.includes(\"leader_rogues.php?action=cancel_merc\")) {\n let filtersContainer = document.querySelector(\".Global\");\n let filtersPosition = \"afterend\";\n if (typeof hwm_mobile_view !== \"undefined\" && hwm_mobile_view === true) {\n filtersContainer = document.querySelector(\"#lre_merc_block\");\n filtersPosition = \"beforebegin\";\n }\n (0, $8nxuZ.addFilteringArea)(filtersContainer, filtersPosition);\n (0, $8nxuZ.processFilters)();\n return;\n }\n if (location.href.includes(\"?show_2x2_form=1\") || location.href.includes(\"?show_merc_dialog=1\")) return;\n let settingsContainer = document.querySelector(\".Global\");\n if (typeof hwm_mobile_view !== \"undefined\" && hwm_mobile_view === true) settingsContainer = document.querySelector(\".new_event_map\").querySelector(\".global_container_block:last-child > div\").getElementsByTagName(\"table\")[0];\n (0, $jWJKf.eventHelperSettings)(settingsContainer, (container)=>{\n (0, $jWJKf.setSettings)(\"auto_send_event_lg\", \"\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0431\u043e\u0438 \u0438\u0437 \u0413\u041b \u0438\u0432\u0435\u043d\u0442\u0430 \u0432 \u0441\u0435\u0440\u0432\u0438\u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\", container);\n (0, $jWJKf.setSettings)(\"only_clan_visibility\", \"\u041c\u043e\u0438 \u0431\u043e\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043a\u043b\u0430\u043d\u0430\", container, false);\n (0, $jWJKf.setSettings)(\"collapse_event_desc\", \"\u0412\u0441\u0435\u0433\u0434\u0430 \u0441\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0431\u043e\u0435\u0432\", container, false);\n (0, $jWJKf.setSettings)(\"lg_show_available\", \"\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u043d\u0430\u0431\u043e\u0440\u044b\", container, false);\n (0, $jWJKf.setSettings)(\"lg_hide_duplicates\", \"\u0421\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442\u044b \u043d\u0430\u0431\u043e\u0440\u043e\u0432\", container, false);\n }, \"afterend\");\n (0, $ao0pt.collapseEventDesc)();\n (0, $ao0pt.setClickableLevels)();\n let leaderBoardTarget = Array.from(document.querySelector(\".new_event_map\").querySelector(\".global_container_block:last-child > div\").getElementsByTagName(\"center\")).slice(-1)[0];\n (0, $8l3id.setLeaderboard)(leaderBoardTarget, \"beforebegin\");\n let examplesElem;\n if (typeof hwm_mobile_view !== \"undefined\" && hwm_mobile_view === true) examplesElem = document.querySelector(\".new_event_map\").querySelector(\".global_container_block:last-child > div\");\n else {\n examplesElem = (0, $dIwPZ.$)(`event_map`);\n (0, $dIwPZ.$)(`hwm_no_zoom`).style.width = \"unset\";\n (0, $dIwPZ.$)(`hwm_no_zoom`).style.maxWidth = \"80vw\";\n let mapContainer = document.querySelector(\".new_event_map\").children[0];\n mapContainer.style.flex = \"1 0 40%\";\n let mapHeight = mapContainer.style.height;\n mapContainer.style.height = \"unset\";\n (0, $dIwPZ.$)(`Global`).style.height = \"unset\";\n (0, $dIwPZ.$)(`Global`).style.width = \"unset\";\n mapContainer.querySelector(\".CampaignMapBorder\").style.width = \"-webkit-fill-available\";\n mapContainer.querySelector(\".CampaignMapBorder\").style.width = \"-moz-available\";\n mapContainer.querySelector(\".CampaignMapCorners\").style.width = \"-webkit-fill-available\";\n mapContainer.querySelector(\".CampaignMapCorners\").style.width = \"-moz-available\";\n (0, $dIwPZ.$)(`CampaignMapContainer`).style.height = mapHeight;\n (0, $dIwPZ.$)(`CampaignMapContainer`).style.width = \"unset\";\n document.querySelector(\".new_event_map\").children[1].style.flex = \"1 0 0%\";\n }\n setLoading(examplesElem);\n getResources(getWaveInfo, createLeaderTemplate, examplesElem).then((_)=>{\n if (typeof hwm_mobile_view !== \"undefined\" && hwm_mobile_view === true) {\n (0, $dIwPZ.$)(`main-data`).style.width = \"360px\";\n (0, $dIwPZ.$)(`event_helper_settings_container`).style.width = \"360px\";\n }\n });\n }\n function createLeaderTemplate() {\n return `\n <div class=\"records-container-body global_container_block\" id=\"main-data\"></div>\n `;\n }\n if (location.href.includes(\"leader_guild\")) {\n //createWelcomeTemplate()\n lg_lvl = document.body.innerHTML.match(/lev=(\\d{1,2})/)[1] - 0;\n (0, $dIwPZ.set)(\"hero_leader_lvl\", lg_lvl);\n (0, $jWJKf.eventHelperSettings)(Array.from(document.querySelectorAll('table[class=\"wb\"]')).slice(-1)[0], (container)=>{\n (0, $jWJKf.setSettings)(\"auto_send_lg\", \"\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0431\u043e\u0438 \u0441 \u043e\u043f\u0430\u0441\u043d\u044b\u043c\u0438 \u0431\u0430\u043d\u0434\u0438\u0442\u0430\u043c\u0438 \u0432 \u0441\u0435\u0440\u0432\u0438\u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\", container);\n (0, $jWJKf.setSettings)(\"only_clan_visibility\", \"\u041c\u043e\u0438 \u0431\u043e\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043a\u043b\u0430\u043d\u0430\", container, false);\n (0, $jWJKf.setSettings)(\"lg_show_available\", \"\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u043d\u0430\u0431\u043e\u0440\u044b\", container, false);\n (0, $jWJKf.setSettings)(\"lg_hide_duplicates\", \"\u0421\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442\u044b \u043d\u0430\u0431\u043e\u0440\u043e\u0432\", container, false);\n }, \"afterend\");\n if (!document.body.innerText.includes(\"\u041e\u043f\u0430\u0441\u043d\u0430\u044f \u0446\u0435\u043b\u044c \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0430\")) {\n setLoading(Array.from(document.querySelectorAll(`td[valign=\"top\"][align=\"left\"]`)).slice(-1)[0]);\n getResources(getTodayBandits, createBanditsTemplate, Array.from(document.querySelectorAll(`td[valign=\"top\"][align=\"left\"]`)).slice(-1)[0]);\n }\n }\n function createBanditsTemplate() {\n return `\n <div class=\"wrapper\">\n <div class=\"records-container-body\" id=\"main-data\"></div>\n </div>\n `;\n }\n function getResources(getExamples, showExamples, target) {\n return Promise.all([\n getHeroCreatures(),\n getExamples()\n ]).then(()=>{\n setExampleBattles(showExamples(), target);\n });\n }\n function setLoading(where = document.body) {\n where.insertAdjacentHTML(\"beforeend\", `\n <div style=\"display: flex; justify-content: center;\" id=\"loading\" >\n <img style=\"margin-top: 20px\" src=\"https://i.imgur.com/4RrPm82.gif\" width=\"400\" alt=\"\">\n </div>`);\n }\n async function getHeroCreatures() {\n let doc = await (0, $aqxxv.doGet)(\"/leader_army.php\", true);\n processLeaderArmyResponse(doc);\n }\n function processLeaderArmyResponse(doc) {\n let bodyHTML = doc.body.innerHTML.toString();\n let matchesId = (0, $dIwPZ.findAll)(/obj\\[\\d{1,3}]\\['monster_id'] = '([a-z0-9_-]+)'/g, bodyHTML);\n let matchesCount = (0, $dIwPZ.findAll)(/obj\\[\\d{1,3}]\\['count'] = (\\d+)/g, bodyHTML);\n let matchesCost = (0, $dIwPZ.findAll)(/obj\\[\\d{1,3}]\\['cost'] = (\\d+)/g, bodyHTML);\n let matchesName = (0, $dIwPZ.findAll)(/obj\\[\\d{1,3}]\\['name'] = '([\u0410-\u042f\u0430-\u044f\u0451\u0401a-zA-Z`_ -]+)'/g, bodyHTML);\n let matchesPortrait = (0, $dIwPZ.findAll)(/obj\\[\\d{1,3}]\\['lname'] = '([a-z0-9_-]+)'/g, bodyHTML);\n let matchesVersion = (0, $dIwPZ.findAll)(/obj\\[\\d{1,3}]\\['version'] = '(\\d{1,3})'/g, bodyHTML);\n let matchesRarity = (0, $dIwPZ.findAll)(/obj\\[\\d{1,3}]\\['rarity'] = (\\d{1,3})/g, bodyHTML);\n let matchesRace = (0, $dIwPZ.findAll)(/obj\\[\\d{1,3}]\\['race'] = (\\d{1,3})/g, bodyHTML);\n matchesPortrait.forEach((id, index)=>{\n (0, $dIwPZ.heroCreatures)[id[1]] = {\n \"count\": matchesCount[index][1],\n \"cost\": matchesCost[index][1],\n \"name\": matchesName[index][1],\n \"id\": matchesId[index][1],\n \"version\": matchesVersion[index][1],\n \"rarity\": matchesRarity[index][1],\n \"race\": matchesRace[index][1]\n };\n });\n }\n async function getWaveInfo() {\n battles = await (0, $aqxxv.doGet)(`getEventLeaderBattles?wave=${(0, $ao0pt.getCurrentLevel)()}&token=${(0, $dIwPZ.get)(\"hwm_events_token\", \"\")}`);\n if (battles.length > 0) battles.sort((a, b)=>{\n a = parseFloat(a.cost);\n b = parseFloat(b.cost);\n if (a < 0 || b < 0) return b - a;\n else return a - b;\n });\n else {\n battles = await (0, $aqxxv.doGet)(`getEventLeaderFailedBattles?wave=${(0, $ao0pt.getCurrentLevel)()}&token=${(0, $dIwPZ.get)(\"hwm_events_token\", \"\")}`);\n isLostBattles = true;\n }\n }\n async function getTodayBandits() {\n battles = await (0, $aqxxv.doGet)(`getDbBattles?lg_lvl=${lg_lvl}&token=${(0, $dIwPZ.get)(\"hwm_events_token\", \"\")}`);\n battles.sort((a, b)=>parseFloat(b.survived) - parseFloat(a.survived));\n }\n function setExampleBattles(template, where = document.body) {\n (0, $dIwPZ.$)(\"loading\").remove();\n where.insertAdjacentHTML(\"beforeend\", template);\n if (!isLostBattles) processRecords(battles);\n else processFailedRecords(battles);\n }\n function processFailedRecords(failedEventBattles) {\n let allRecords = failedEventBattles.reduce((prev, curr, index)=>{\n return prev + `\n <div style=\"display: flex; justify-content: space-between; padding: 1px;\">\n <div>${index + 1}.\u00a0</div>\n <div style=\"text-align: center\">${getRecordPlayersTemplate(curr.nicknames)}</div>\n <div>\u00a0<a target=\"_blank\" href=\"/warlog.php?warid=${curr[\"battle_id\"]}&show_for_all=${curr[\"battle_secret\"]}<=-1\">\u0411\u043e\u0439</a></div>\n </div>`;\n }, \"\");\n let result = `<div class=\"failed-records-wrapper\">\n <div class=\"failed-records-container\">\n <div style=\"text-align: center;\">\n <h3>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u043e\u0440\u0430\u0436\u0435\u043d\u0438\u0439</h3>\n </div>\n ${allRecords}\n </div>\n </div>`;\n (0, $dIwPZ.$)(\"main-data\").insertAdjacentHTML(\"beforeend\", result);\n }\n let processedBattleCreatures = [];\n let rowDatas = {};\n function processRecords(records) {\n let favRecords = records.filter((battle)=>favourites.includes(battle.nicknames[0]));\n let notFavRecords = records.filter((battle)=>!favourites.includes(battle.nicknames[0]));\n let allRecords = favRecords.concat(notFavRecords);\n let pageIndex = 0;\n let pageSize = 25;\n function addPage() {\n if (pageIndex * pageSize < allRecords.length) {\n let result = allRecords.slice(pageIndex * pageSize, pageIndex * pageSize + 25).reduce((prev, curr, index)=>{\n return prev + addRecord(curr, pageIndex * pageSize + index);\n }, \"\");\n (0, $dIwPZ.$)(\"main-data\").insertAdjacentHTML(\"beforeend\", result);\n pageIndex++;\n }\n }\n addPage();\n setInterval(()=>{\n if (!document.querySelector(\"#android_outside\") && window.innerHeight + window.scrollY >= document.body.offsetHeight - 100) addPage();\n else if (document.querySelector(\"#android_outside\") && document.querySelector(\"#android_outside\").clientHeight + document.querySelector(\"#android_outside\").scrollTop >= document.querySelector(\"#hwm_no_zoom\").offsetHeight - 100) addPage();\n }, 50);\n }\n let fav_icon = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" class=\"bi bi-bookmark-star-fill\" viewBox=\"0 0 16 16\" style=\"vertical-align: middle\">\n <path fill-rule=\"evenodd\" d=\"M2 15.5V2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v13.5a.5.5 0 0 1-.74.439L8 13.069l-5.26 2.87A.5.5 0 0 1 2 15.5zM8.16 4.1a.178.178 0 0 0-.32 0l-.634 1.285a.178.178 0 0 1-.134.098l-1.42.206a.178.178 0 0 0-.098.303L6.58 6.993c.042.041.061.1.051.158L6.39 8.565a.178.178 0 0 0 .258.187l1.27-.668a.178.178 0 0 1 .165 0l1.27.668a.178.178 0 0 0 .257-.187L9.368 7.15a.178.178 0 0 1 .05-.158l1.028-1.001a.178.178 0 0 0-.098-.303l-1.42-.206a.178.178 0 0 1-.134-.098L8.16 4.1z\"/>\n </svg>`;\n let not_fav_icon = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" class=\"bi bi-bookmark-star\" viewBox=\"0 0 16 16\" style=\"vertical-align: middle\">\n <path d=\"M7.84 4.1a.178.178 0 0 1 .32 0l.634 1.285a.178.178 0 0 0 .134.098l1.42.206c.145.021.204.2.098.303L9.42 6.993a.178.178 0 0 0-.051.158l.242 1.414a.178.178 0 0 1-.258.187l-1.27-.668a.178.178 0 0 0-.165 0l-1.27.668a.178.178 0 0 1-.257-.187l.242-1.414a.178.178 0 0 0-.05-.158l-1.03-1.001a.178.178 0 0 1 .098-.303l1.42-.206a.178.178 0 0 0 .134-.098L7.84 4.1z\"/>\n <path d=\"M2 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v13.5a.5.5 0 0 1-.777.416L8 13.101l-5.223 2.815A.5.5 0 0 1 2 15.5V2zm2-1a1 1 0 0 0-1 1v12.566l4.723-2.482a.5.5 0 0 1 .554 0L13 14.566V2a1 1 0 0 0-1-1H4z\"/>\n </svg>`;\n function addRecord(record, index) {\n let isFav = favourites.includes(record.nicknames[0]);\n let playersCreaturesInfo = [];\n record.creatures.forEach((playerCreatures, playerId)=>{\n let rowData = [];\n Object.entries(playerCreatures).forEach(([creaturePortrait, creatureAmount])=>{\n processRecordHeroCreatures(rowData, creatureAmount, creaturePortrait);\n });\n playersCreaturesInfo.push(rowData);\n rowDatas[`${index}:${playerId}`] = rowData;\n });\n let isAllCreaturesAvailable = isAllPresent(playersCreaturesInfo[0]);\n let recordLeadership = getLeadership(playersCreaturesInfo[0]);\n if (!(0, $dIwPZ.get)(\"lg_show_available\", false) || isAllCreaturesAvailable && recordLeadership > (lg_lvl + 9) * 1000 && recordLeadership <= (lg_lvl + 10) * 1000 || isFav) {\n let recordCreatureIds = Object.keys(record.creatures[0]);\n recordCreatureIds.sort((a, b)=>a.localeCompare(b));\n if (!(0, $dIwPZ.get)(\"lg_hide_duplicates\", false) || !processedBattleCreatures.includes(recordCreatureIds.join(\":\")) || isFav) {\n let playersCreatures = record.creatures.map((playerCreatures, playerId)=>{\n let playerCreaturesHTML = \"\";\n let rowData = [];\n Object.entries(playerCreatures).forEach(([creaturePortrait, creatureAmount], cellId)=>{\n let isGood = processRecordHeroCreatures(rowData, creatureAmount, creaturePortrait);\n playerCreaturesHTML += `<div id=\"creature-${index}-${playerId}-${cellId}\">${(0, $eTbLz.getNewCreatureIcon)(creaturePortrait, creatureAmount, isGood ? \"good-creature\" : \"bad-creature\")}</div>`;\n });\n return `\n <div class=\"record-player-creatures\" id=\"creatures-${index}-${playerId}\">\n <div id=\"creatures-${index}-${playerId}-apply\" class=\"creatures-apply\">\n <div id=\"creatures-${index}-${playerId}-apply-button\" class=\"home_button2 btn_hover2\" onclick=\"sendApplyArmy('${index}:${playerId}')\">\u041d\u0430\u0431\u0440\u0430\u0442\u044c</div>\n <div id=\"creatures-${index}-${playerId}-leadership\" class=\"player-leadership\">\n ${getRecordPlayerLeadershipTemplate(index, playerId, getLeadership(rowData), isAllCreaturesAvailable)}\n </div>\n </div>\n <div id=\"creatures-${index}-${playerId}-creatures\" class=\"player-creatures-row\">${playerCreaturesHTML}</div>\n </div>`;\n }).join(`<img src=\"https://i.imgur.com/Y3sbLcM.png\" alt=\"\" class=\"record-players-arms\">`);\n //onwheel=\"if(this.scrollWidth > this.clientWidth){ if (event.deltaY > 0) {this.scrollLeft += 100;} else {this.scrollLeft -= 100;}; event.preventDefault()}\"\n let recordContainer = `\n <div class=\"record-number\">\n ${record.is_clan ? `<img src=\"https://www.freeiconspng.com/thumbs/lock-icon/black-lock-icon-14.png\" style=\"height: 14px;\">` : \"\"}\n <div>${index + 1}</div>\n <div id=\"fav_${index}\" class=\"fav_player_button\" onclick=\"saveFav('${record.nicknames[0]}', this)\">\n ${isFav ? fav_icon : not_fav_icon}\n </div>\n </div>\n <div class=\"record-players\" id=\"record-${index}-players\">\n <div>${getRecordPlayersTemplate(record.nicknames)}</div>\n <div>${getRecordResultTemplate(record)}</div>\n </div>\n <div class=\"record-players-creatures\" id=\"record-${index}-creatures\">${playersCreatures}</div>\n ${record.special_creature ? getSpecialCreatureTemplate(record.special_creature, index) : `<div class=\"special-creature\"></div>`}\n <div class=\"special-creature-extended\" id=\"special-creature-extended-${index}\">\n ${record.special_creature ? getSpecialCreatureExtraData(record.special_creature) : \"\"}\n </div>`;\n processedBattleCreatures.push(recordCreatureIds.join(\":\"));\n return recordContainer;\n }\n }\n return \"\";\n }\n function saveFav(nickname, elem) {\n if (favourites.includes(nickname)) {\n elem.innerHTML = not_fav_icon;\n favourites = favourites.filter((v)=>v !== nickname);\n } else {\n elem.innerHTML = fav_icon;\n favourites.push(nickname);\n }\n (0, $dIwPZ.set)(\"leader_favourites\", favourites);\n }\n function processRecordHeroCreatures(rowData, creatureAmount, creaturePortrait) {\n let isGood = false;\n if ((0, $dIwPZ.heroCreatures).hasOwnProperty(creaturePortrait)) {\n if (creatureAmount - 0 <= (0, $dIwPZ.heroCreatures)[creaturePortrait][\"count\"] - 0) {\n rowData.push([\n creaturePortrait,\n creatureAmount,\n true\n ]);\n isGood = true;\n } else rowData.push([\n creaturePortrait,\n creatureAmount,\n false\n ]);\n } else rowData.push([\n creaturePortrait,\n creatureAmount,\n false\n ]);\n return isGood;\n }\n function getSpecialCreatureTemplate(creatureData, index) {\n return `\n <div class=\"special-creature\">\n <div class=\"special-creature-info\">\n ${(0, $eTbLz.getNewCreatureIcon)(creatureData.portrait, \"\")}\n <div class=\"special-creature-info-button\" onclick=\"showSpecialCreatureData('${index}')\">\n <img src=\"https://${0, $dIwPZ.cdnHost}/i/combat/btn_info.png\" alt=\"creature info\" height=\"50\">\n </div>\n </div>\n <div class=\"special-creature-stats\">\n <div>\n <div>\n <div><img class=\"special-creature-stat-icon\" src=\"https://${0, $dIwPZ.cdnHost}/i/icons/attr_attack.png?v=1\" alt=\"attack\"></div>\n <div class=\"special-creature-stat-value\">${creatureData.attack.toFixed()}</div>\n </div>\n <div>\n <div><img class=\"special-creature-stat-icon\" src=\"https://${0, $dIwPZ.cdnHost}/i/icons/attr_speed.png?v=1\" alt=\"attack\"></div>\n <div class=\"special-creature-stat-value\">${creatureData.speed.toFixed()}</div>\n </div>\n <div>\n <div><img class=\"special-creature-stat-icon\" src=\"https://${0, $dIwPZ.cdnHost}/i/icons/attr_initiative.png?v=1\" alt=\"attack\"></div>\n <div class=\"special-creature-stat-value\">${creatureData.maxinit}</div>\n </div>\n <div>\n <div><img class=\"special-creature-stat-icon\" src=\"https://${0, $dIwPZ.cdnHost}/i/icons/attr_hit_points.png?v=1\" alt=\"attack\"></div>\n <div class=\"special-creature-stat-value\">${creatureData.health.toFixed()}</div>\n </div>\n </div>\n <div>\n <div>\n <div><img class=\"special-creature-stat-icon\" src=\"https://${0, $dIwPZ.cdnHost}/i/icons/attr_defense.png?v=1\" alt=\"attack\"></div>\n <div class=\"special-creature-stat-value\">${creatureData.defence.toFixed()}</div>\n </div>\n <div>\n <div><img class=\"special-creature-stat-icon\" src=\"https://${0, $dIwPZ.cdnHost}/i/icons/attr_mana.png?v=1\" alt=\"mana\"></div>\n <div class=\"special-creature-stat-value\">${creatureData.maxmanna.toFixed()}</div>\n </div>\n <div>\n <div><img class=\"special-creature-stat-icon\" src=\"https://${0, $dIwPZ.cdnHost}/i/icons/attr_shoots.png?v=1\" alt=\"attack\"></div>\n <div class=\"special-creature-stat-value\">${creatureData.shots.toFixed()}</div>\n </div>\n <div>\n <div><img class=\"special-creature-stat-icon\" src=\"https://${0, $dIwPZ.cdnHost}/i/icons/attr_damage.png?v=1\" alt=\"attack\"></div>\n <div class=\"special-creature-stat-value\">${creatureData.mindam.toFixed()}-${creatureData.maxdam.toFixed()}</div>\n </div>\n </div>\n </div>\n </div>\n `;\n }\n function showSpecialCreatureData(index) {\n (0, $dIwPZ.$)(`special-creature-extended-${index}`).classList.toggle(\"visible\");\n }\n function getSpecialCreatureExtraData(creatureData) {\n return `\n <b>\u041d\u0430\u0432\u044b\u043a\u0438</b>: ${creatureData.skills.map((skill)=>skill.replace(\". \", \"\").replace(\".\", \"\")).join(\", \")}.<br>\n <b>\u0417\u0430\u043a\u043b\u0438\u043d\u0430\u043d\u0438\u044f</b>: ${creatureData.casts.map((cast, index)=>{\n if (creatureData.casts_effects) return `${cast} (${creatureData.casts_effects[index]})`;\n return cast;\n }).join(\", \")}.\n `;\n }\n function isAllPresent(rowData) {\n let isAllPresent = true;\n rowData.forEach((cre)=>{\n if (!cre[2]) isAllPresent = false;\n });\n return isAllPresent;\n }\n function getRecordPlayersTemplate(nicknames) {\n return nicknames.map((nickname)=>`<a href=\"/search.php?key=${nickname}\">${nickname}</a>`).join(\"<br>+<br>\");\n }\n function getRecordResultTemplate(record) {\n return `\n <div class=\"record-result\">\n <div><img src=\"https://${0, $dIwPZ.cdnHost}/i/r/48/gold.png?v=3.23de65\" title=\"\u041f\u043e\u0442\u0440\u0430\u0447\u0435\u043d\u043e \u043d\u0430 \u0432\u043e\u0441\u043a\u0440\u0435\u0448\u0435\u043d\u0438\u0435\" alt=\"gold\"><span>\u00a0${record.cost}</span></div>\n <div><a href=\"/war.php?lt=-1&warid=${record.battle_id}&show_for_all=${record.battle_secret}\" target=\"_blank\">\u0411\u043e\u0439</a></div>\n ${record.survived === undefined ? \"\" : `<div>${record.survived}%</div>`}\n </div>`;\n }\n function replaceCellListener(rowDataId, recordId, playerId, cellId) {\n let rowData = rowDatas[rowDataId];\n setSelectNewCreatureTemplate(rowData, recordId, playerId, cellId);\n }\n function setSelectNewCreatureTemplate(rowData, recordId, playerId, cellId) {\n let replaceCreatureTarget = (0, $dIwPZ.$)(`replace-creature-${recordId}-${playerId}-${cellId}`).parentElement;\n let newCreatureTemplate = `\n <div style=\"position: absolute; width: 100%; height: ${getScrollHeight() + 500}px; background: rgba(0,0,0,0.22); z-index: 1000000\" onclick=\"removeOverlay()\">\n <div id=\"select-new-creature\" style=\"position: absolute; background: #608FBF; border: 3px solid cyan; width: 300px; height: 400px; z-index: 4; display: flex; flex-direction: column\" onclick=\"event.stopPropagation()\">\n <div id=\"select-new-creature-faction\" style=\"display: flex; flex-direction: row; flex-wrap: wrap\"></div>\n <div id=\"new-creatures\" style=\"overflow-y: auto; display: flex; flex-direction: column\"></div>\n </div>\n </div>`;\n let android = (0, $dIwPZ.$)(`android_container`);\n let container = android ? android : document.body;\n container.insertAdjacentHTML(\"afterbegin\", newCreatureTemplate);\n let newCreatureElement = (0, $dIwPZ.$)(`select-new-creature`);\n newCreatureElement.style.left = replaceCreatureTarget.offsetLeft + 60;\n newCreatureElement.style.top = replaceCreatureTarget.offsetTop;\n fillNewCreatures(-1, rowData, recordId, playerId, cellId);\n (0, $dIwPZ.allFactions).forEach((faction)=>{\n (0, $dIwPZ.$)(`select-new-creature-faction`).insertAdjacentHTML(\"beforeend\", getHTMLFactionSelect(faction));\n (0, $dIwPZ.$)(`faction-select${faction[0]}`).addEventListener(\"click\", ()=>{\n (0, $dIwPZ.$)(`new-creatures`).innerHTML = \"\";\n fillNewCreatures(faction[0], rowData, recordId, playerId, cellId);\n });\n });\n }\n function fillNewCreatures(constraint, rowData, recordId, playerId, cellId) {\n let remainingLeadership = getRemainingLeadership(rowData, cellId);\n Object.entries((0, $dIwPZ.heroCreatures)).forEach(([key, value], index)=>{\n if (!checkExistingInRowData(key, rowData) && (constraint === -1 ? true : value[\"race\"] - 0 === constraint)) {\n let newAmount = Math.min(Math.floor(Math.min(remainingLeadership, (10 + lg_lvl) * 400) / (value[\"cost\"] - 0)), value[\"count\"] - 0);\n if (newAmount > 0) {\n (0, $dIwPZ.$)(\"new-creatures\").insertAdjacentHTML(\"beforeend\", `\n <div id=\"new-creature-${index}\" style=\"display: flex; flex-direction: row;\">\n ${(0, $eTbLz.getNewCreatureIcon)(key, newAmount)}\n <div style=\"margin: auto\">\n <p style=\"text-decoration: underline; cursor: pointer\">${value[\"name\"]}</p>\n </div>\n </div>`);\n (0, $dIwPZ.$)(`new-creature-${index}`).addEventListener(\"click\", ()=>{\n let replaceTarget = (0, $dIwPZ.$)(`creature-${recordId}-${playerId}-${cellId}`);\n replaceTarget.innerHTML = (0, $eTbLz.getNewCreatureIcon)(key, newAmount);\n rowData[cellId] = [\n key,\n newAmount,\n true\n ];\n setLeaderShip(recordId, playerId, rowData);\n removeOverlay();\n });\n }\n }\n });\n }\n function getHTMLFactionSelect(faction) {\n let factionSelectBody;\n if (faction[0] === -1) factionSelectBody = `<b>All</b>`;\n else factionSelectBody = `<img src=\"https://${0, $dIwPZ.cdnHost}/i/f/${faction[2]}\" alt=\"${faction[1]}\" title=\"${faction[1]}\" style=\"width: 30px; height: 30px\">`;\n return `\n <div id=\"faction-select${faction[0]}\" style=\"justify-content: center; display: flex; align-items: center; width: 50px; height: 50px; cursor: pointer\">\n ${factionSelectBody}\n </div>\n `;\n }\n function checkExistingInRowData(name, rowData) {\n let isExist = false;\n rowData.forEach((cre)=>{\n if (name === cre[0]) isExist = true;\n });\n return isExist;\n }\n function setLeaderShip(recordId, playerId, rowData) {\n let allPresent = isAllPresent(rowData);\n (0, $dIwPZ.$)(`creatures-${recordId}-${playerId}-apply-button`).innerText = \"\u041d\u0430\u0431\u0440\u0430\u0442\u044c\";\n (0, $dIwPZ.$)(`creatures-${recordId}-${playerId}-leadership`).innerHTML = getRecordPlayerLeadershipTemplate(recordId, playerId, getLeadership(rowData), allPresent);\n }\n function getRecordPlayerLeadershipTemplate(recordId, playerId, leadership, allPresent) {\n return `\n <img height=\"24\" src=\"https://${0, $dIwPZ.cdnHost}/i/icons/attr_leadership.png?v=1\" alt=\"\" title=\"\u041b\u0438\u0434\u0435\u0440\u0441\u0442\u0432\u043e \u0441\u0431\u043e\u0440\u043a\u0438\">\n <span id=\"leadership-number-${recordId}-${playerId}\" style=\"color: ${allPresent ? \"green\" : \"red\"}\">\n ${leadership}\n </span>`;\n }\n function getLeadership(rowData) {\n return rowData.filter((cre)=>cre[2]).reduce((leadership, cre)=>{\n return leadership + ((0, $dIwPZ.heroCreatures)[cre[0]][\"cost\"] - 0) * (cre[1] - 0);\n }, 0);\n }\n function getRemainingLeadership(rowData, cellId) {\n return (10 + lg_lvl) * 1000 - getLeadership(rowData) + (rowData[cellId][1] - 0) * ((0, $dIwPZ.heroCreatures).hasOwnProperty(rowData[cellId][0]) && (0, $dIwPZ.heroCreatures)[rowData[cellId][0]][\"count\"] >= rowData[cellId][1] - 0 ? (0, $dIwPZ.heroCreatures)[rowData[cellId][0]][\"cost\"] - 0 : 0);\n }\n async function sendApplyArmy(rowDataId) {\n await (0, $aqxxv.doPost)(`/leader_army_apply.php${isEvent ? \"?from_event=1\" : \"\"}`, getApplyArmyForm(rowDatas[rowDataId]), true);\n location.reload();\n }\n function getApplyArmyForm(rowData) {\n let formData = new FormData();\n formData.append(\"idx\", \"0\");\n rowData.filter((cre)=>cre[2]).forEach((creData, index)=>{\n formData.append(`countv${index + 1}`, creData[1]);\n formData.append(`mon_id${index + 1}`, (0, $dIwPZ.heroCreatures)[creData[0]][\"id\"]);\n });\n return formData;\n }\n function removeOverlay() {\n (0, $dIwPZ.$)(`select-new-creature`).parentElement.remove();\n }\n}\n\n});\nparcelRequire.register(\"jWJKf\", function(module, exports) {\n\n$parcel$export(module.exports, \"setSettings\", () => $e856eb178f3c6d9a$export$dc86d17a64679bc7);\n$parcel$export(module.exports, \"eventHelperSettings\", () => $e856eb178f3c6d9a$export$2d8715349e4d9139);\n\nvar $hPiir = parcelRequire(\"hPiir\");\n\nvar $dIwPZ = parcelRequire(\"dIwPZ\");\n\nvar $afXBq = parcelRequire(\"afXBq\");\nfunction $e856eb178f3c6d9a$var$getAllTexts() {\n let texts = new (0, $afXBq.LocalizedTextMap)();\n texts.addText(new (0, $afXBq.LocalizedText)(\"settings\", \"Settings\", \"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438\", \"\u041d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u043d\u044f\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"support_alert\", \"If you like this script, please consider supporting it.\", \"\u0415\u0441\u043b\u0438 \u0442\u0435\u0431\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u044d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442, \u043f\u0440\u043e\u0441\u044c\u0431\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c.\", \"\u042f\u043a\u0449\u043e \u0442\u043e\u0431\u0456 \u043f\u043e\u0434\u043e\u0431\u0430\u0454\u0442\u044c\u0441\u044f \u0446\u0435\u0439 \u0441\u043a\u0440\u0438\u043f\u0442, \u043f\u0440\u043e\u0445\u0430\u043d\u043d\u044f \u0440\u043e\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u0438 \u043c\u043e\u0436\u043b\u0438\u0432\u0456\u0441\u0442\u044c \u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u0439\u043e\u0433\u043e \u043f\u0440\u0430\u0446\u0435\u0437\u0434\u0430\u0442\u043d\u0456\u0441\u0442\u044c.\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"support\", \"Keep the services alive\", \"\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432\", \"\u041f\u0456\u0434\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u0456\u0441\u043d\u0443\u0432\u0430\u043d\u043d\u044f \u0441\u0435\u0440\u0432\u0456\u0441\u0456\u0432\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"patreon\", \"Patreon\", \"\u041f\u0430\u0442\u0440\u0435\u043e\u043d\", \"\u041f\u0430\u0442\u0440\u0435\u043e\u043d\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"boosty\", \"Boosty\", \"\u0411\u0443\u0441\u0442\u0438\", \"\u0411\u0443\u0441\u0442\u0456\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"ok\", \"X\", \"X\", \"X\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"reg_available\", \"Registration available!\", \"\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f!\", \"\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0440\u0435\u0454\u0441\u0442\u0440\u0430\u0446\u0456\u044f!\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"signup\", \"Sign up\", \"\u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f\", \"\u0417\u0430\u0440\u0435\u0454\u0441\u0442\u0440\u0443\u0432\u0430\u0442\u0438\u0441\u044c\"));\n return texts;\n}\nlet $e856eb178f3c6d9a$var$allTexts = $e856eb178f3c6d9a$var$getAllTexts();\nfunction $e856eb178f3c6d9a$export$dc86d17a64679bc7(key, text, where = document.body, enabled = true) {\n where.insertAdjacentHTML(\"beforeend\", `\n <div style=\"display: flex; color: green; font-size: 20px; cursor: pointer\" id=\"${key}\" >\n <input style=\"height: 24px; width: 24px;\" id=\"${key}_checkbox\" type=\"checkbox\" ${(0, $dIwPZ.get)(key, enabled) ? \" checked\" : \"\"}>\n <label for=\"${key}_checkbox\">${text}</label>\n </div>`);\n (0, $dIwPZ.$)(key).addEventListener(\"click\", ()=>{\n (0, $dIwPZ.set)(key, (0, $dIwPZ.$)(`${key}_checkbox`).checked);\n });\n}\nfunction $e856eb178f3c6d9a$export$2d8715349e4d9139(where, callback, position = \"beforeend\") {\n where.insertAdjacentHTML(position, `\n <div style=\"margin-top: 10px; display: flex; flex-direction: column;\" id=\"event_helper_settings_container\">\n <div id=\"event_helper_settings\" class=\"home_button2 btn_hover2\" style=\"width: fit-content;align-self: center\">${$e856eb178f3c6d9a$var$allTexts.get(\"settings\")} EventHelper</div>\n ${(()=>{\n if (!(0, $dIwPZ.get)(\"eh_patreon_notification_shown\", false)) return `<div style=\" align-self: center;\n display: flex;\n flex-direction: column;\n align-items: center;\"><div>${$e856eb178f3c6d9a$var$allTexts.get(\"support_alert\")}</div>\n<div style=\"display: flex;\"><div style=\" align-items: center;\n display: flex;\">${$e856eb178f3c6d9a$var$allTexts.get(\"support\")}\u00a0</div>\n<div id=\"patreon_link\" class=\"home_button2 btn_hover2\" style=\"padding: 2px 4px;\n margin-top: 4px;\n width: fit-content;\"><a href=\"https://www.patreon.com/user?u=58444506\" target=\"_blank\" style=\"display: flex; align-items: center\">${$e856eb178f3c6d9a$var$allTexts.get(\"patreon\")}<img src=\"https://cdn.icon-icons.com/icons2/2429/PNG/512/patreon_logo_icon_147253.png\" style=\"height: 24px;\"></a></div>\n<div id=\"boosty_link\" class=\"home_button2 btn_hover2\" style=\"padding: 2px 4px;\n margin-top: 4px;\n width: fit-content;\"><a href=\"https://boosty.to/thunder_hwm\" target=\"_blank\" style=\"display: flex; align-items: center\">${$e856eb178f3c6d9a$var$allTexts.get(\"boosty\")}<img src=\"https://mikulski.rocks/wp-content/uploads/2022/04/Color.png\" style=\"height: 24px;\"></a></div>\n<div id=\"patreon_accept\" class=\"home_button2 btn_hover2\" style=\"padding: 2px 4px;\n margin-top: 4px; margin-left: 10px;\n width: fit-content;\">${$e856eb178f3c6d9a$var$allTexts.get(\"ok\")}</div></div></div>`;\n else return ``;\n })()}\n </div>\n `);\n if (!(0, $dIwPZ.get)(\"eh_patreon_notification_shown\", false)) (0, $dIwPZ.$)(`patreon_accept`).addEventListener(\"click\", ()=>{\n (0, $dIwPZ.set)(\"eh_patreon_notification_shown\", true);\n });\n (0, $dIwPZ.$)(`event_helper_settings`).addEventListener(\"click\", (e)=>{\n e.target.remove();\n let container = (0, $dIwPZ.$)(`event_helper_settings_container`);\n callback(container);\n let regHTML;\n if (!(0, $dIwPZ.get)(\"hwm_events_token\", null)) regHTML = `\n <div style=\"width: 100%; text-align: center\"><b>${$e856eb178f3c6d9a$var$allTexts.get(\"reg_available\")}</b></div>\n <div id=\"start_registration\" class=\"home_button2 btn_hover2\" style=\"padding: 2px 4px; margin-top: 4px\">${$e856eb178f3c6d9a$var$allTexts.get(\"signup\")}</div>\n `;\n else regHTML = \"\";\n container.insertAdjacentHTML(\"beforeend\", `\n <div style=\"align-self: center\">\n ${regHTML}\n<!-- <br>-->\n<!-- <br>-->\n<!-- <br>-->\n<!-- <div style=\"width: 100%; text-align: center\"><b>\u0420\u0435\u043a\u043b\u0430\u043c\u0430!</b></div>-->\n<!-- <p>\u041a\u0440\u0430\u0444\u0442 \u044e\u0432\u0435\u043b\u0438\u0440\u043a\u0438 \u0441 \u043e\u0442\u043a\u0430\u0442\u043e\u043c 2 \u043f\u0430\u0440\u044b <a href=\"/pl_info.php?id=6722246\">Kerrigan</a></p>-->\n<div style=\"display: flex;\"><div style=\" align-items: center;\n display: flex;\">${$e856eb178f3c6d9a$var$allTexts.get(\"support\")}\u00a0</div>\n<div id=\"patreon_link\" class=\"home_button2 btn_hover2\" style=\"padding: 2px 4px;\n margin-top: 4px;\n width: fit-content;\"><a href=\"https://www.patreon.com/user?u=58444506\" target=\"_blank\" style=\"display: flex; align-items: center\">${$e856eb178f3c6d9a$var$allTexts.get(\"patreon\")}<img src=\"https://cdn.icon-icons.com/icons2/2429/PNG/512/patreon_logo_icon_147253.png\" style=\"height: 24px;\"></a></div>\n<div id=\"boosty_link\" class=\"home_button2 btn_hover2\" style=\"padding: 2px 4px;\n margin-top: 4px;\n width: fit-content;\"><a href=\"https://boosty.to/thunder_hwm\" target=\"_blank\" style=\"display: flex; align-items: center\">${$e856eb178f3c6d9a$var$allTexts.get(\"boosty\")}<img src=\"https://mikulski.rocks/wp-content/uploads/2022/04/Color.png\" style=\"height: 24px;\"></a></div>\n</div> </div>\n `);\n if (regHTML) (0, $dIwPZ.$)(`start_registration`).addEventListener(\"click\", (0, $hPiir.startRegistration));\n });\n}\n\n});\nparcelRequire.register(\"hPiir\", function(module, exports) {\n\n$parcel$export(module.exports, \"startRegistration\", () => $cfa5645e0adeda32$export$20d6f277a113c2ce);\n\nvar $aqxxv = parcelRequire(\"aqxxv\");\n\nvar $dIwPZ = parcelRequire(\"dIwPZ\");\nasync function $cfa5645e0adeda32$export$20d6f277a113c2ce(event) {\n event.target.outerHTML = `\n <div id=\"reg_progress\" style=\"text-align: center\">\u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0443\u0449\u0435\u043d...</div>\n `;\n let regStatus = (0, $dIwPZ.$)(`reg_progress`);\n let register = await (0, $aqxxv.doGet)(`register?pl_id=${(0, $dIwPZ.pl_id)}`);\n regStatus.innerHTML = \"\u0423\u0447\u0435\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0430...\";\n let formData = new FormData();\n formData.append(\"cdata\", Math.floor(Math.random() * 19001 + 1000).toFixed());\n formData.append(\"action\", \"\");\n formData.append(\"parent_id\", \"0\");\n formData.append(\"mailto\", register.receiver);\n formData.append(\"subject\", register.token);\n formData.append(\"msg\", \"\");\n formData.append(\"sign\", (0, $dIwPZ.my_sign));\n formData.append(\"subm\", \"%CE%F2%EF%F0%E0%E2%E8%F2%FC+%28CTRL%2BEnter%29\");\n await (0, $aqxxv.doPost)(`/sms-create.php`, formData, true);\n regStatus.innerHTML = \"\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u043b\u0438\u0447\u043d\u043e\u0441\u0442\u0438...\";\n let validate = await (0, $aqxxv.doGet)(`checkRegistration?pl_id=${(0, $dIwPZ.pl_id)}`);\n if (validate.status === \"good\") {\n regStatus.innerHTML = \"\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0448\u043b\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e!\";\n (0, $dIwPZ.set)(\"hwm_events_token\", register.token);\n } else regStatus.innerHTML = \"\u0427\u0442\u043e-\u0442\u043e \u043f\u043e\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a :(\";\n let smsOutDoc = await (0, $aqxxv.doGet)(\"/sms.php?box=out\", true);\n let smsId = smsOutDoc.querySelector('input[type=\"checkbox\"]').value;\n let smsDeleteFormData = new FormData();\n smsDeleteFormData.append(\"id1\", smsId);\n smsDeleteFormData.append(\"box\", \"out\");\n smsDeleteFormData.append(\"filter\", \"\");\n smsDeleteFormData.append(\"page\", \"0\");\n smsDeleteFormData.append(\"action\", \"mass_delete\");\n (0, $aqxxv.doPost)(\"/sms.php\", smsDeleteFormData, true);\n}\n\n});\n\nparcelRequire.register(\"afXBq\", function(module, exports) {\n\n$parcel$export(module.exports, \"LocalizedTextMap\", () => $777989ee19108b74$export$e2cdacd256e1e5e1);\n$parcel$export(module.exports, \"LocalizedText\", () => $777989ee19108b74$export$6806bb0283a0c326);\nlet $777989ee19108b74$var$locale = \"ru\";\nif (location.host === \"my.lordswm.com\" || navigator.language.includes(\"uk\")) $777989ee19108b74$var$locale = \"ua\";\nif (location.host === \"www.lordswm.com\") $777989ee19108b74$var$locale = \"en\";\nclass $777989ee19108b74$export$e2cdacd256e1e5e1 {\n constructor(){\n this.allTexts = new Map();\n }\n addText(localizedText) {\n this.allTexts[localizedText.id] = localizedText;\n }\n get(id) {\n return this.allTexts[id][$777989ee19108b74$var$locale];\n }\n}\nclass $777989ee19108b74$export$6806bb0283a0c326 {\n constructor(id, en = null, ru = null, ua = null){\n this.id = id;\n this.en = en;\n this.ru = ru;\n this.ua = ua;\n }\n}\n\n});\n\n\nparcelRequire.register(\"ao0pt\", function(module, exports) {\n\n$parcel$export(module.exports, \"collapseEventDesc\", () => $78fc76acb8006c44$export$74006e6f0c324459);\n$parcel$export(module.exports, \"getCurrentLevel\", () => $78fc76acb8006c44$export$7503ec8cf78f3211);\n$parcel$export(module.exports, \"setClickableLevels\", () => $78fc76acb8006c44$export$a12bccc8d3170544);\n$parcel$export(module.exports, \"setTimer\", () => $78fc76acb8006c44$export$7b3d6d4401c78312);\n\nvar $dIwPZ = parcelRequire(\"dIwPZ\");\n\nvar $afXBq = parcelRequire(\"afXBq\");\nfunction $78fc76acb8006c44$var$getAllTexts() {\n let texts = new (0, $afXBq.LocalizedTextMap)();\n texts.addText(new (0, $afXBq.LocalizedText)(\"time_d\", \"d\", \"\u0434\", \"\u0434\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"time_h\", \"h\", \"\u0447\", \"\u0433\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"time_m\", \"m\", \"\u043c\", \"\u0445\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"time_s\", \"s\", \"\u0441\", \"\u0441\"));\n return texts;\n}\nlet $78fc76acb8006c44$var$allTexts = $78fc76acb8006c44$var$getAllTexts();\nfunction $78fc76acb8006c44$export$74006e6f0c324459() {\n if ((0, $dIwPZ.get)(\"collapse_event_desc\", false)) {\n if (document.querySelector(\".event_desc_block_inside\") && document.querySelector(\".event_desc_block_inside\").getAttribute(\"style\") == null && document.querySelector(\"#event_desc_block\") !== null && document.querySelector(\"#event_desc_block\").style.display !== \"none\") document.querySelector(\".event_desc_open_btn\").click();\n }\n}\nfunction $78fc76acb8006c44$export$7503ec8cf78f3211() {\n let set_level = new URLSearchParams(window.location.search).get(\"sel_level\");\n if (set_level) return set_level;\n let match = document.body.innerText.match(/(\u0423\u0440\u043e\u0432\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438|Difficulty level): (\\d{1,3})/);\n if (match && match.length > 0) return match[2];\n if (document.getElementsByClassName(\"CheckpointCurrent\").length > 0) return document.getElementsByClassName(\"CheckpointCurrent\")[0].innerHTML.match(/\\d{1,3}/)[0];\n return \"100\";\n}\nfunction $78fc76acb8006c44$export$a12bccc8d3170544() {\n document.querySelectorAll(\".Checkpoints\").forEach((cp)=>{\n cp.style.zIndex = \"1\";\n });\n Array.from(document.querySelectorAll(\".Checkpoints\")).filter((elem)=>elem.classList.contains(\"CheckpointComplete\") || elem.classList.contains(\"CheckpointLocked\")).forEach((elem)=>{\n elem.style.pointerEvents = \"all\";\n elem.addEventListener(\"click\", ()=>{\n location.href = location.pathname + \"?sel_level=\" + elem.innerText.trim();\n });\n elem.style.cursor = \"pointer\";\n });\n}\nfunction $78fc76acb8006c44$export$7b3d6d4401c78312(where) {\n where.style.display = \"flex\";\n where.style.justifyContent = \"center\";\n where.insertAdjacentHTML(\"beforeend\", `\u00a0<span id=\"timer_container\"></span>`);\n let container = (0, $dIwPZ.$)(\"timer_container\");\n let countDownDate = new Date(1699736400000).getTime();\n function process() {\n let now = new Date().getTime();\n let distance = countDownDate - now;\n let days = Math.floor(distance / 86400000);\n let hours = Math.floor(distance % 86400000 / 3600000);\n let minutes = Math.floor(distance % 3600000 / 60000);\n let seconds = Math.floor(distance % 60000 / 1000);\n if (distance > 86400000) container.innerHTML = `${days}${$78fc76acb8006c44$var$allTexts.get(\"time_d\")} ${hours}${$78fc76acb8006c44$var$allTexts.get(\"time_h\")} ${minutes}${$78fc76acb8006c44$var$allTexts.get(\"time_m\")} ${seconds}${$78fc76acb8006c44$var$allTexts.get(\"time_s\")}`;\n else if (distance < 0) {\n clearInterval(timer);\n container.innerHTML = \"\";\n } else container.innerHTML = `<div style=\"color: red\">${days}${$78fc76acb8006c44$var$allTexts.get(\"time_d\")} ${hours}${$78fc76acb8006c44$var$allTexts.get(\"time_h\")} ${minutes}${$78fc76acb8006c44$var$allTexts.get(\"time_m\")} ${seconds}${$78fc76acb8006c44$var$allTexts.get(\"time_s\")}</div>`;\n }\n let timer = setInterval(process, 1000);\n process();\n}\n\n});\n\nparcelRequire.register(\"8l3id\", function(module, exports) {\n\n$parcel$export(module.exports, \"setLeaderboard\", () => $6122d6c588ef4b85$export$d01e4b19d1fd9b89);\n$parcel$export(module.exports, \"setTopClanAttempts\", () => $6122d6c588ef4b85$export$343e177ae088f8e2);\n\nvar $aqxxv = parcelRequire(\"aqxxv\");\n\nvar $dIwPZ = parcelRequire(\"dIwPZ\");\n\nvar $afXBq = parcelRequire(\"afXBq\");\nlet $6122d6c588ef4b85$var$TOP_CLANS = [\n \"1519\",\n \"928\",\n \"104\",\n \"1597\",\n \"1209\",\n \"18\",\n \"41\",\n \"5152\",\n \"88\",\n \"326\",\n \"8502\",\n \"73\",\n \"7777\",\n \"302\",\n \"823\",\n \"17\",\n \"997\",\n \"276\",\n \"249\",\n \"1512\",\n \"9426\",\n \"10557\",\n \"2304\",\n \"14\",\n \"11532\",\n \"10886\",\n \"846\",\n \"3305\",\n \"8433\",\n \"1488\"\n];\nfunction $6122d6c588ef4b85$var$getAllTexts() {\n let texts = new (0, $afXBq.LocalizedTextMap)();\n texts.addText(new (0, $afXBq.LocalizedText)(\"top_heroes\", \"Top heroes\", \"\u041b\u0443\u0447\u0448\u0438\u0435 \u0438\u0433\u0440\u043e\u043a\u0438\", \"\u041d\u0430\u0439\u043a\u0440\u0430\u0449\u0456 \u0433\u0440\u0430\u0432\u0446\u0456\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"top_clans\", \"Top clans\", \"\u041b\u0443\u0447\u0448\u0438\u0435 \u043a\u043b\u0430\u043d\u044b\", \"\u041d\u0430\u0439\u043a\u0440\u0430\u0449\u0456 \u043a\u043b\u0430\u043d\u0438\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"attempts_left\", \"Attempts left\", \"\u041e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0438\", \"\u0417\u0430\u043b\u0438\u0448\u0438\u043b\u043e\u0441\u044c \u0441\u043f\u0440\u043e\u0431\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"progression\", \"Score progression\", \"\u041f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0438\u044f \u043e\u0447\u043a\u043e\u0432\", \"\u041f\u0440\u043e\u0433\u0440\u0435\u0441\u0456\u044f \u043e\u0447\u043e\u043a\"));\n return texts;\n}\nlet $6122d6c588ef4b85$var$allTexts = $6122d6c588ef4b85$var$getAllTexts();\nasync function $6122d6c588ef4b85$export$d01e4b19d1fd9b89(where, position = \"afterbegin\", withClan = false, showStat = false) {\n window.showProgression = $6122d6c588ef4b85$var$showProgression;\n let isLeaderboardExpanded = false;\n let topHeroes = await (0, $aqxxv.doGet)(`getTopScoresV2`);\n where.insertAdjacentHTML(position, `<div style=\"display: flex; flex-direction: column\" id=\"top_heroes_container\"></div><br>`);\n resetLeaderboard(showStat);\n if (showStat) document.querySelectorAll(\".global_container_block\")[1].insertAdjacentHTML(\"afterend\", `\n <div id=\"chart_area\" class=\"global_container_block\" style=\"display: none\"></div>\n `);\n if (withClan) {\n let topClans = await (0, $aqxxv.doGet)(`getTopClanScores`);\n let result = topClans.reduce((prev, curr, index)=>{\n return prev + getTopClanTemplate(curr, index);\n }, \"\");\n where.insertAdjacentHTML(position, `<div style=\"display: flex; flex-direction: column\" id=\"top_clans_container\">\n <b style=\"user-select: none; text-align: center;\">${$6122d6c588ef4b85$var$allTexts.get(\"top_clans\")}</b>${result}\n </div><br>`);\n }\n function resetLeaderboard(showStat) {\n let result = topHeroes.slice(0, 15).reduce((prev, curr, index)=>{\n return prev + getTopHeroTemplate(curr, index, showStat);\n }, \"\");\n (0, $dIwPZ.$)(`top_heroes_container`).innerHTML = `\n <b style=\"user-select: none; text-align: center;\">${$6122d6c588ef4b85$var$allTexts.get(\"top_heroes\")} (<span id=\"expand_top_heroes\" style=\"cursor: pointer; text-decoration: underline\">+</span>)</b>${result}\n `;\n (0, $dIwPZ.$)(`expand_top_heroes`).addEventListener(\"click\", (e)=>{\n if (!isLeaderboardExpanded) {\n topHeroes.slice(15).forEach((curr, index)=>{\n (0, $dIwPZ.$)(`top_heroes_container`).insertAdjacentHTML(\"beforeend\", getTopHeroTemplate(curr, index + 15, showStat));\n });\n isLeaderboardExpanded = true;\n e.target.innerHTML = \"\u2014\";\n } else {\n resetLeaderboard(showStat);\n isLeaderboardExpanded = false;\n }\n });\n }\n function getTopHeroTemplate(hero, index, showStat) {\n let scoreElem = hero[\"member_score\"];\n if (showStat && $6122d6c588ef4b85$var$TOP_CLANS.includes(hero[\"clan_id\"])) scoreElem = `<b style=\"font-size: 10px; text-decoration: underline; cursor: pointer\" onclick=\"showProgression(${hero[\"member_id\"]}, '${hero[\"member_name\"]}')\">${hero[\"member_score\"]}</b>`;\n return `\n <div style=\"display: flex; justify-content: space-between; padding: 1px; font-size: smaller\">\n <span style=\"display: inline-block\">${index + 1}.</span>\n <span style=\"display: inline-block; text-align: center\">\n <a href=\"/clan_info.php?id=${hero[\"clan_id\"]}\">\n <img style=\"height: 15px; vertical-align: bottom\" src=\"https://${0, $dIwPZ.cdnHost}/i_clans/l_${hero[\"clan_id\"]}.gif?1805\" alt=\"\"></a>\n \u00a0\n <a href=\"/pl_info.php?id=${hero[\"member_id\"]}\" style=\"text-decoration: none; font-size: 9px\">${hero[\"member_name\"]}</a>\n [${hero[\"member_cl\"]}]\n </span>\n <span style=\"display: inline-block\">${scoreElem}${hero[\"attempts_left\"] ? `<span title=\"${$6122d6c588ef4b85$var$allTexts.get(\"attempts_left\")}\" style=\"cursor: help; font-size: 5pt\">(${hero[\"attempts_left\"]})</span>` : \"\"}</span>\n </div>`;\n }\n function getTopClanTemplate(hero, index) {\n return `\n <div style=\"display: flex; justify-content: space-between; padding: 1px; font-size: smaller\">\n <span style=\"display: inline-block\">${index + 1}.</span>\n <span style=\"display: inline-block; text-align: center\">\n <a href=\"/clan_info.php?id=${hero[0]}\">\n <img style=\"height: 15px; vertical-align: bottom\" src=\"https://${0, $dIwPZ.cdnHost}/i_clans/l_${hero[0]}.gif?1805\" alt=\"\"></a>\n \u00a0\n <a href=\"/clan_info.php?id=${hero[0]}\" style=\"text-decoration: none; font-size: 9px\">#${hero[0]}</a>\n </span>\n <span style=\"display: inline-block\">${hero[1]}</span>\n </div>`;\n }\n}\nasync function $6122d6c588ef4b85$var$showProgression(id, name) {\n let chartArea = (0, $dIwPZ.$)(`chart_area`);\n chartArea.style.display = \"flex\";\n chartArea.innerHTML = `\n <div style=\"height: 165px; overflow: hidden\">\n <div>${$6122d6c588ef4b85$var$allTexts.get(\"progression\")} <b>${name}</b></div>\n <canvas id=\"chart${id}\" style=\"width: 100%; height: 150px\"></canvas>\n </div>\n `;\n let heroData = await (0, $aqxxv.doGet)(`getDunHeroData?pl_id=${id}`);\n const cumulativeSum = ((sum)=>(value)=>sum += value)(0);\n const labels = heroData.map((entry)=>entry[0] + ` ${entry[1] > 0 ? \"+\" : \"\"}${entry[1]}`);\n const data = {\n labels: labels,\n datasets: [\n {\n label: \"\u041e\u0447\u043a\u0438\",\n data: heroData.map((entry)=>entry[1]).map(cumulativeSum),\n borderColor: \"blue\",\n backgroundColor: \"rgb(44,73,107)\",\n pointStyle: \"circle\",\n pointRadius: 3,\n pointHoverRadius: 4\n }\n ]\n };\n const config = {\n type: \"line\",\n data: data,\n options: {\n animation: false,\n responsive: false,\n plugins: {\n legend: {\n display: false\n },\n title: {\n display: false,\n text: \"Chart.js Line Chart\"\n }\n },\n elements: {\n line: {\n borderWidth: 1\n }\n },\n scales: {\n x: {\n ticks: {\n display: false\n }\n }\n },\n interaction: {\n mode: \"index\",\n intersect: false\n }\n }\n };\n const ctx = document.getElementById(`chart${id}`).getContext(\"2d\");\n const myChart = new Chart(ctx, config);\n}\nasync function $6122d6c588ef4b85$export$343e177ae088f8e2(where) {\n let topClanAttempts = await (0, $aqxxv.doGet)(`getTopClanTotalAttempts`);\n where.querySelectorAll(\"tr\").forEach((clanElem)=>{\n let clanId = clanElem.innerHTML.match(/id=(\\d{1,5})/)[1];\n let scoreElem = Array.from(clanElem.querySelectorAll(\"td\")).at(-1);\n let clanAttempts = topClanAttempts[clanId];\n if (clanAttempts) scoreElem.insertAdjacentHTML(\"beforeend\", `\n <span title=\"\u041e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0438\" style=\"cursor: help; font-size: 5pt\">(${clanAttempts})</span>\n `);\n });\n}\n\n});\n\nparcelRequire.register(\"eTbLz\", function(module, exports) {\n\n$parcel$export(module.exports, \"getSpoiler\", () => $ad6f5445145af1e6$export$ca0c33c349afe188);\n$parcel$export(module.exports, \"getNewCreatureIcon\", () => $ad6f5445145af1e6$export$b49d3c66fe569a18);\n\nvar $dIwPZ = parcelRequire(\"dIwPZ\");\nfunction $ad6f5445145af1e6$export$ca0c33c349afe188(type, index, spoilerHead, spoilerBody, spoilerWrapperClass = \"\", spoilerLabelClass = \"\") {\n return `\n <div class=\"${spoilerWrapperClass}\" style=\"display: flex;\n flex-direction: column;\n align-items: center;\">\n <input type=\"checkbox\" id=\"spoiler_${type}_${index}\"/>\n <label for=\"spoiler_${type}_${index}\" class=\"${spoilerLabelClass}\">\n ${spoilerHead}\n </label>\n <div class=\"spoiler\">\n ${spoilerBody}\n </div>\n </div>\n `;\n}\nfunction $ad6f5445145af1e6$export$b49d3c66fe569a18(creaturePortrait, newAmount, cre_amount_class = \"\") {\n return `\n <div class=\"cre_creature custom-creature\">\n <img src=\"https://${0, $dIwPZ.cdnHost}/i/army_html/fon_lvl${(0, $dIwPZ.heroCreatures)[creaturePortrait] ? (0, $dIwPZ.heroCreatures)[creaturePortrait].rarity : \"1\"}.png?v=1\" width=\"50\" height=\"50\" class=\"cre_mon_image2\" alt=\"\">\n <img src=\"https://${0, $dIwPZ.cdnHost}/i/portraits/${creaturePortrait}p33.png\" height=\"50\" alt=\"\" class=\"cre_mon_image1\">\n <div class=\"cre_amount custom-amount ${cre_amount_class}\" id=\"add_now_count\">${newAmount}</div>\n </div>`;\n}\n\n});\n\nparcelRequire.register(\"8nxuZ\", function(module, exports) {\n\n$parcel$export(module.exports, \"addFilteringArea\", () => $619a74dd35eb4e69$export$571dc493ff6b06fe);\n$parcel$export(module.exports, \"processFilters\", () => $619a74dd35eb4e69$export$a6dafd6bb972b970);\n\nvar $dIwPZ = parcelRequire(\"dIwPZ\");\nfunction $619a74dd35eb4e69$export$571dc493ff6b06fe(where, position) {\n where.insertAdjacentHTML(position, getFilteringAreaTemplate());\n setBlockedWavesListener();\n setAllowedWavesListener();\n setBlockedHeroesListener();\n setAllowedHeroesListener();\n setBlockedLeadershipListener();\n function setBlockedWavesListener() {\n (0, $dIwPZ.$)(\"blocked-waves-list\").addEventListener(\"input\", (event)=>{\n (0, $dIwPZ.set)(\"blocked_waves_1\", event.target.value.split(\",\").filter((item)=>item !== \"\").map((item)=>item.trim()));\n });\n }\n function setAllowedWavesListener() {\n (0, $dIwPZ.$)(\"allowed-waves-list\").addEventListener(\"input\", (event)=>{\n (0, $dIwPZ.set)(\"allowed_waves_1\", event.target.value.split(\",\").filter((item)=>item !== \"\").map((item)=>item.trim()));\n });\n }\n function setBlockedHeroesListener() {\n (0, $dIwPZ.$)(\"blocked-heroes-list\").addEventListener(\"input\", (event)=>{\n (0, $dIwPZ.set)(\"blocked_heroes_1\", event.target.value.split(\",\").filter((item)=>item !== \"\").map((item)=>item.trim()));\n });\n }\n function setAllowedHeroesListener() {\n (0, $dIwPZ.$)(\"allowed-heroes-list\").addEventListener(\"input\", (event)=>{\n (0, $dIwPZ.set)(\"allowed_heroes_1\", event.target.value.split(\",\").filter((item)=>item !== \"\").map((item)=>item.trim()));\n });\n }\n function setBlockedLeadershipListener() {\n (0, $dIwPZ.$)(\"blocked-leadership\").addEventListener(\"input\", (event)=>{\n (0, $dIwPZ.set)(\"blocked_leadership\", event.target.value.trim());\n });\n }\n function getFilteringAreaTemplate() {\n return `\n <style>\n .filters-container {\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n .filtering-item {\n width: 100%;\n }\n .filtering-item textarea {\n min-width: min(400px, 100%);\n resize: none;\n overflow-x: visible;\n border-radius: 5px;\n }\n .filtering-item:nth-child(n+1) {\n margin-top: 10px;\n }\n </style>\n <br/>\n <div class=\"filters-container\">\n <div><b>\u0424\u0438\u043b\u044c\u0442\u0440\u044b (\u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438):</b></div>\n <div class=\"filtering-item\">\n <textarea id=\"blocked-waves-list\" placeholder=\"\u041d\u0435\u0436\u0435\u043b\u0430\u043d\u043d\u044b\u0435 \u0432\u043e\u043b\u043d\u044b \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u043f\u044f\u0442\u0443\u044e\">${(0, $dIwPZ.get)(\"blocked_waves_1\", []).join(\",\")}</textarea>\n </div>\n <div class=\"filtering-item\">\n <textarea id=\"allowed-waves-list\" placeholder=\"\u0416\u0435\u043b\u0430\u043d\u043d\u044b\u0435 \u0432\u043e\u043b\u043d\u044b \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u043f\u044f\u0442\u0443\u044e\">${(0, $dIwPZ.get)(\"allowed_waves_1\", []).join(\",\")}</textarea>\n </div>\n <div class=\"filtering-item\">\n <textarea id=\"blocked-heroes-list\" placeholder=\"\u041d\u0435\u0436\u0435\u043b\u0430\u043d\u043d\u044b\u0435 \u043d\u0438\u043a\u043d\u0435\u0439\u043c\u044b \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u043f\u044f\u0442\u0443\u044e\">${(0, $dIwPZ.get)(\"blocked_heroes_1\", []).join(\",\")}</textarea>\n </div>\n <div class=\"filtering-item\">\n <textarea id=\"allowed-heroes-list\" placeholder=\"\u0416\u0435\u043b\u0430\u043d\u043d\u044b\u0435 \u043d\u0438\u043a\u043d\u0435\u0439\u043c\u044b \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u043f\u044f\u0442\u0443\u044e\">${(0, $dIwPZ.get)(\"allowed_heroes_1\", []).join(\",\")}</textarea>\n </div>\n <div class=\"filtering-item\">\n <textarea id=\"blocked-leadership\" placeholder=\"\u041d\u0438\u0436\u043d\u0438\u0439 \u043f\u043e\u0440\u043e\u0433 \u043f\u043e \u043b\u0438\u0434\u0435\u0440\u0441\u0442\u0432\u0443\">${(0, $dIwPZ.get)(\"blocked_leadership\", \"\")}</textarea>\n </div>\n </div>\n <br/>`;\n }\n}\nfunction $619a74dd35eb4e69$export$a6dafd6bb972b970() {\n if (document.querySelector(\"#lre_merc_block > div\")) {\n window.leader_rogues_event_state_handle = function() {\n if (this.readyState == 4) {\n var txt = this.responseText;\n var short_txt = txt.substring(0, 11);\n if (short_txt != \"|merc_stat|\") {\n window.location = \"leader_rogues.php\";\n return 0;\n }\n var data = txt.split(\"|merc_stat|\");\n if (data && data[1] && document.getElementById(\"lre_merc_block\")) {\n let doc = new DOMParser().parseFromString(data[1], \"text/html\");\n let trs = Array.from(doc.querySelector(\"div\").childNodes).filter((node)=>node.innerText.length > 0);\n processBlockedWaves(trs);\n processBlockedHeroes(trs);\n processBlockedLeadership(trs);\n document.getElementById(\"lre_merc_block\").innerHTML = doc.documentElement.innerHTML;\n if (typeof hwm_hints_init === \"function\") hwm_hints_init();\n }\n }\n };\n let trs = Array.from(document.querySelector(\"#lre_merc_block > div\").childNodes).filter((node)=>node.innerText.length > 0);\n processBlockedWaves(trs);\n processBlockedHeroes(trs);\n processBlockedLeadership(trs);\n }\n function processBlockedWaves(trs) {\n let blockedWaves = (0, $dIwPZ.get)(\"blocked_waves_1\", []).filter((item)=>item !== \"\").map((item)=>item.trim());\n let allowedWaves = (0, $dIwPZ.get)(\"allowed_waves_1\", []).filter((item)=>item !== \"\").map((item)=>item.trim());\n trs.forEach((tr)=>{\n let waveId = tr.textContent.match(/(\u0423\u0440\\.: |Lv\\.: )(\\d{1,3})/)[2];\n if (blockedWaves.includes(waveId) || allowedWaves.length > 0 && !allowedWaves.includes(waveId)) try {\n tr.previousSibling.remove();\n tr.remove();\n } catch (e) {}\n });\n }\n function processBlockedHeroes(trs) {\n let blockedHeroes = (0, $dIwPZ.get)(\"blocked_heroes_1\", []).filter((item)=>item !== \"\").map((item)=>item.trim());\n let allowedHeroes = (0, $dIwPZ.get)(\"allowed_heroes_1\", []).filter((item)=>item !== \"\").map((item)=>item.trim());\n trs.forEach((tr)=>{\n let heroName = tr.textContent.match(/([\u0410-\u042f\u0430-\u044f\u0451\u0401a-zA-Z0-9_* ()-]+) \\[\\d{1,2}]/)[1];\n if (blockedHeroes.includes(heroName) || allowedHeroes.length > 0 && !allowedHeroes.includes(heroName)) try {\n tr.previousSibling.remove();\n tr.remove();\n } catch (e) {}\n });\n }\n function processBlockedLeadership(trs) {\n let blockedLeadership = (0, $dIwPZ.get)(\"blocked_leadership\", \"0\").trim();\n trs.forEach((tr)=>{\n let leadership = tr.textContent.match(/\\d{1,2},\\d{3}/)[0].replaceAll(\",\", \"\");\n if (blockedLeadership - 0 > leadership - 0) try {\n tr.previousSibling.remove();\n tr.remove();\n } catch (e) {}\n });\n }\n}\n\n});\n\n\nparcelRequire.register(\"86JDc\", function(module, exports) {\n\n$parcel$export(module.exports, \"default\", () => $5e7247b2082ebe89$export$2e2bcd8739ae039);\n\nvar $dIwPZ = parcelRequire(\"dIwPZ\");\n\nvar $8l3id = parcelRequire(\"8l3id\");\n\nvar $ao0pt = parcelRequire(\"ao0pt\");\n\nvar $8l3id = parcelRequire(\"8l3id\");\nvar $5e7247b2082ebe89$require$setLeaderboard = $8l3id.setLeaderboard;\n\nvar $ao0pt = parcelRequire(\"ao0pt\");\nvar $5e7247b2082ebe89$require$collapseEventDesc = $ao0pt.collapseEventDesc;\n\nvar $jWJKf = parcelRequire(\"jWJKf\");\nvar $5e7247b2082ebe89$require$eventHelperSettings = $jWJKf.eventHelperSettings;\nvar $5e7247b2082ebe89$require$setSettings = $jWJKf.setSettings;\n\nvar $6rIzz = parcelRequire(\"6rIzz\");\nvar $5e7247b2082ebe89$require$getEventBattles = $6rIzz.getEventBattles;\nfunction $5e7247b2082ebe89$export$2e2bcd8739ae039() {\n if (/adventure_event\\.php$/.test(location.href)) {\n $5e7247b2082ebe89$require$setLeaderboard(document.querySelector('[style=\"min-width:250px;\"]').getElementsByTagName(\"center\")[0]);\n if ((0, $dIwPZ.get)(\"show_top_clan_attempts\", true)) (0, $8l3id.setTopClanAttempts)(document.querySelector('[style=\"min-width:250px;\"] > table'));\n if ((0, $dIwPZ.get)(\"show_event_timer\", true)) (0, $ao0pt.setTimer)(document.querySelector(\"h2\"));\n }\n if (location.href.includes(\"adventure_event.php?map=1\")) {\n $5e7247b2082ebe89$require$collapseEventDesc();\n $5e7247b2082ebe89$require$eventHelperSettings(document.querySelector(\".Global\"), (container)=>{\n $5e7247b2082ebe89$require$setSettings(\"auto_send_ffa_event\", \"\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0431\u043e\u0438 \u0438\u0437 \u041a\u0411\u041e \u0438\u0432\u0435\u043d\u0442\u0430 \u0432 \u0441\u0435\u0440\u0432\u0438\u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\", container);\n $5e7247b2082ebe89$require$setSettings(\"only_clan_visibility\", \"\u041c\u043e\u0438 \u0431\u043e\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043a\u043b\u0430\u043d\u0430\", container, false);\n $5e7247b2082ebe89$require$setSettings(\"collapse_event_desc\", \"\u0412\u0441\u0435\u0433\u0434\u0430 \u0441\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0431\u043e\u0435\u0432\", container, false);\n }, \"afterend\");\n $5e7247b2082ebe89$require$getEventBattles(document.querySelectorAll('[align=\"left\"][valign=\"top\"]')[1]);\n }\n}\n\n});\nparcelRequire.register(\"6rIzz\", function(module, exports) {\n\n$parcel$export(module.exports, \"sendBattle\", () => $4b17d6e8488eae62$export$fa6a22bf5c2892b6);\n$parcel$export(module.exports, \"getEventBattles\", () => $4b17d6e8488eae62$export$ee3c8d0c774798be);\n\nvar $aqxxv = parcelRequire(\"aqxxv\");\n\nvar $dIwPZ = parcelRequire(\"dIwPZ\");\n\nvar $ao0pt = parcelRequire(\"ao0pt\");\n\nvar $eTbLz = parcelRequire(\"eTbLz\");\n\nvar $afXBq = parcelRequire(\"afXBq\");\nfunction $4b17d6e8488eae62$var$getAllTexts() {\n let texts = new (0, $afXBq.LocalizedTextMap)();\n texts.addText(new (0, $afXBq.LocalizedText)(\"sent\", \"Sent\", \"\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e\", \"\u041d\u0430\u0434\u0456\u0441\u043b\u0430\u043d\u043e\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"examples\", \"Battle examples\", \"\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0431\u043e\u0451\u0432\", \"\u041f\u0440\u0438\u043a\u043b\u0430\u0434\u0438 \u0431\u043e\u0457\u0432\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"cl\", \"CL\", \"\u0411\u0423\", \"\u0411\u0420\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"afs\", \"AFS\", \"\u0410\u0438\u041c\", \"\u0410\u0437\u041c\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"ffa\", \"FFA\", \"\u041a\u0411\u041e\", \"\u041a\u0411\u041e\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"your_cl\", \"Your CL\", \"\u0422\u0432\u043e\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c\", \"\u0422\u0432\u0456\u0439 \u0440\u0456\u0432\u0435\u043d\u044c\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"another_cl\", \"Another CLs\", \"\u0414\u0440\u0443\u0433\u0438\u0435 \u0443\u0440\u043e\u0432\u043d\u0438\", \"\u0406\u043d\u0448\u0456 \u0440\u0456\u0432\u043d\u0456\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"another_cl_army\", \"Starting from the 51st wave, the opponents at all combat levels are the same. The difference is only in quantity.\", \"\u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 51\u0439 \u0432\u043e\u043b\u043d\u044b, \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u0438 \u043d\u0430 \u0432\u0441\u0435\u0445 \u0443\u0440\u043e\u0432\u043d\u044f\u0445 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435.\", \"\u041f\u043e\u0447\u0438\u043d\u0430\u044e\u0447\u0438 \u0437 51 \u0445\u0432\u0438\u043b\u0456, \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u0438 \u043d\u0430 \u0432\u0441\u0456\u0445 \u0431\u043e\u0439\u043e\u0432\u0438\u0445 \u0440\u0456\u0432\u043d\u044f\u0445 \u043e\u0434\u043d\u0430\u043a\u043e\u0432\u0456. \u0420\u0456\u0437\u043d\u0438\u0446\u044f \u043b\u0438\u0448\u0435 \u0443 \u043a\u0456\u043b\u044c\u043a\u043e\u0441\u0442\u0456.\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"battle\", \"Battle\", \"\u0411\u043e\u0439\", \"\u0411\u0456\u0439\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"empty\", \"empty\", \"\u043f\u0443\u0441\u0442\u043e\", \"\u043f\u043e\u0440\u043e\u0436\u043d\u044c\u043e\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"enemy\", \"Enemy\", \"\u0412\u0440\u0430\u0433\", \"\u0412\u043e\u0440\u043e\u0433\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"search\", \"Search\", \"\u041f\u043e\u0438\u0441\u043a\", \"\u041f\u043e\u0448\u0443\u043a\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"loses\", \"Loses\", \"\u041f\u043e\u0440\u0430\u0436\u0435\u043d\u0438\u044f\", \"\u041f\u043e\u0440\u0430\u0437\u043a\u0438\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"nickname\", \"nickname\", \"\u043d\u0438\u043a\u043d\u0435\u0439\u043c\", \"\u043d\u0456\u043a\u043d\u0435\u0439\u043c\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"search\", \"Search\", \"\u041f\u043e\u0438\u0441\u043a\", \"\u041f\u043e\u0448\u0443\u043a\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"hire\", \"Hire\", \"\u041d\u0430\u0431\u0440\u0430\u0442\u044c\", \"\u041d\u0430\u0439\u043d\u044f\u0442\u0438\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"hwmevents\", `Website with examples <a href=\"https://hwm.events/ffa\" target=\"_blank\">https://hwm.events/ffa</a> Share with friends!`, `\u041f\u0440\u043e\u0445\u043e\u0434\u043a\u0438 \u0435\u0441\u0442\u044c \u0438 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 <a href=\"https://hwm.events/ffa\" target=\"_blank\">https://hwm.events/ffa</a> \u041f\u043e\u0434\u0435\u043b\u0438\u0441\u044c \u0441 \u0434\u0440\u0443\u0433\u043e\u043c!`, `\u041f\u0440\u0438\u043a\u043b\u0430\u0434\u0438 \u0442\u0430\u043a\u043e\u0436 \u0454 \u0456 \u043d\u0430 \u0441\u0430\u0439\u0442\u0456 <a href=\"https://hwm.events/ffa\" target=\"_blank\">https://hwm.events/ffa</a> \u041f\u043e\u0434\u0456\u043b\u0438\u0441\u044f \u0437 \u0434\u0440\u0443\u0437\u044f\u043c\u0438!`));\n texts.addText(new (0, $afXBq.LocalizedText)(\"hwmevents_rogues\", `Website with examples <a href=\"https://hwm.events/rogues\" target=\"_blank\">https://hwm.events/rogues</a> Share with friends!`, `\u041f\u0440\u043e\u0445\u043e\u0434\u043a\u0438 \u0435\u0441\u0442\u044c \u0438 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 <a href=\"https://hwm.events/rogues\" target=\"_blank\">https://hwm.events/rogues</a> \u041f\u043e\u0434\u0435\u043b\u0438\u0441\u044c \u0441 \u0434\u0440\u0443\u0433\u043e\u043c!`, `\u041f\u0440\u0438\u043a\u043b\u0430\u0434\u0438 \u0442\u0430\u043a\u043e\u0436 \u0454 \u0456 \u043d\u0430 \u0441\u0430\u0439\u0442\u0456 <a href=\"https://hwm.events/rogues\" target=\"_blank\">https://hwm.events/rogues</a> \u041f\u043e\u0434\u0456\u043b\u0438\u0441\u044f \u0437 \u0434\u0440\u0443\u0437\u044f\u043c\u0438!`));\n return texts;\n}\nlet $4b17d6e8488eae62$var$allTexts = $4b17d6e8488eae62$var$getAllTexts();\nasync function $4b17d6e8488eae62$export$fa6a22bf5c2892b6(warid, secret, type, index = null, battle_side = -1) {\n let formData = new FormData();\n formData.append(\"battle_id\", warid);\n formData.append(\"battle_secret\", secret);\n formData.append(\"battle_side\", battle_side);\n formData.append(\"is_clan\", (0, $dIwPZ.get)(\"only_clan_visibility\", false));\n let types = {\n \"0\": \"uploadDbBattle\",\n \"1\": \"uploadEventLeaderBattle\",\n \"2\": \"uploadFFAEventBattle\",\n \"3\": \"uploadFactionEventBattle\",\n \"4\": \"uploadRoguesEventBattle\"\n };\n (0, $aqxxv.doPost)(types[type], formData).then(()=>{\n if (index != null) (0, $dIwPZ.$)(`send_battle_${index}`).outerHTML = $4b17d6e8488eae62$var$allTexts.get(\"sent\");\n });\n}\nasync function $4b17d6e8488eae62$export$ee3c8d0c774798be(target, from = \"getFFAEventBattles\", callback = 2, lost = false) {\n window.sendApplyArmy = sendApplyArmy;\n let creaturesInfo = (0, $dIwPZ.get)(\"eventCreaturesInfo\", {});\n let currentSilver = 0;\n try {\n currentSilver = 10000 + parseInt(document.body.innerText.match(/(\u0414\u043e\u0431\u044b\u0442\u043e \u0441\u0435\u0440\u0435\u0431\u0440\u0430|Silver gained): (\\d{0,3},?\\d{1,3})/)[2].replace(\",\", \"\"));\n } catch (e) {}\n document.body.insertAdjacentHTML(\"afterbegin\", `<style>.hwm_event_example_block {\n display: flex;\n flex-wrap: wrap;\n flex-direction: column;\n box-sizing: border-box;\n -moz-box-sizing: border-box;\n -webkit-box-sizing: border-box;\n border-radius: 5px;\n position: relative;\n align-items: center;\n justify-content: center;\n margin: 2px;\n padding: 6px;\n background-color: #fffef9;\n box-shadow: inset 0 0 0 1px #b19673, 0 2px 2px rgb(0 0 0 / 25%);\n }</style>`);\n let battles = await (0, $aqxxv.doGet)(`${from}?wave=${(0, $ao0pt.getCurrentLevel)()}&token=${(0, $dIwPZ.get)(\"hwm_events_token\", \"\")}`);\n processEventBattles(target, battles);\n function processEventBattles(where = document.body, battles) {\n switch(callback){\n case 1:\n if (battles.AFS.length === 0 && !lost) $4b17d6e8488eae62$export$ee3c8d0c774798be(target, from.replace(\"Battles\", \"FailedBattles\"), callback, true);\n else {\n where.insertAdjacentHTML(\"beforeend\", `<div style=\"text-align: center\"><b>${$4b17d6e8488eae62$var$allTexts.get(\"hwmevents_rogues\")}</b></div>` + getAFSEventBattlesTemplate(lost, battles));\n (0, $dIwPZ.$)(\"search_nickname\").addEventListener(\"keypress\", (e)=>{\n if (e.key === \"Enter\") (0, $dIwPZ.$)(\"process_search\").click();\n });\n (0, $dIwPZ.$)(\"process_search\").addEventListener(\"click\", async ()=>{\n let player_battles = await (0, $aqxxv.doGet)(`getRoguesPlayerBattles?nickname=${encodeURIComponent((0, $dIwPZ.$)(\"search_nickname\").value.trim())}&token=${(0, $dIwPZ.get)(\"hwm_events_token\", \"\")}`);\n (0, $dIwPZ.$)(\"player_battles\").innerHTML = (0, $dIwPZ.groupBy)((0, $dIwPZ.sortByKey)(player_battles[\"AFS\"], \"wave\", -1), \"wave\").map((currentWaveList)=>(0, $dIwPZ.sortByKey)(currentWaveList, \"battle_id\", -1)).flatMap((currentWaveList)=>currentWaveList).reduce((prev, curr, index)=>{\n return prev + `\n <div class=\"hwm_event_example_block\">\n <div style=\"width: 80%;display: flex;justify-content: space-evenly;\">\n <div style=\"text-align: center\"> <a href=\"/pl_info.php?nick=${(0, $dIwPZ.encode)(curr[\"nickname\"])}\" class=\"pi\" target=\"_blank\">${curr[\"nickname\"]}</a> ${\"class\" in curr && getClassById(curr[\"class\"]) ? `<img style=\"vertical-align: middle; height: 16px\" src=\"https://${0, $dIwPZ.cdnHost}/i/f/${getClassById(curr[\"class\"])[3]}?v=1.1\" alt=\"\">` : \"\"} [${curr[\"hero_lvl\"] ?? \"\"}]</div>\n <div style=\"display: flex;min-width: 120px;justify-content: space-between;\">\n <div>${curr[\"wave\"]}</div>\n <div>\u00a0<a target=\"_blank\" href=\"/warlog.php?warid=${curr[\"battle_id\"]}&show_for_all=${curr[\"battle_secret\"]}<=-1\" style=\"color:${curr[\"isLost\"] ?? false ? \"red\" : \"green\"}\">${getFFAEventBattleSide(curr)}</a></div>\n </div>\n </div>\n </div>\n `;\n }, \"\");\n });\n }\n break;\n case 2:\n if (battles.AFS.length === 0 && battles.FFA.length === 0 && !lost) $4b17d6e8488eae62$export$ee3c8d0c774798be(target, from.replace(\"Battles\", \"FailedBattles\"), callback, true);\n else where.insertAdjacentHTML(\"beforeend\", getFFAEventBattlesTemplate(lost, battles));\n }\n }\n function getAFSEventBattlesTemplate(lost, battles) {\n let result = getBattlesTemplate(battles[\"AFS\"]);\n return (0, $eTbLz.getSpoiler)(\"examples\", \"AFS\", `<div class=\"home_button2 btn_hover2\" style=\"margin: 3px 0; min-width: 100px;\">${$4b17d6e8488eae62$var$allTexts.get(\"examples\")} (${result[1]}/${result[2]})</div>`, `\n <div style=\"display: flex; flex-direction: column\">\n <div id=\"search_by_player\">\n <div id=\"search_container\" style=\"display: flex;justify-content: space-evenly;\">\n <input type=\"text\" name=\"search_nickname\" id=\"search_nickname\" placeholder=\"${$4b17d6e8488eae62$var$allTexts.get(\"nickname\")}...\">\n <div id=\"process_search\" class=\"btn_hover2 home_button2\" style=\"width: 100px\">${$4b17d6e8488eae62$var$allTexts.get(\"search\")}</div>\n </div>\n <div id=\"player_battles\"></div>\n </div>\n <div style=\"text-align: center;\">\n <h3>${$4b17d6e8488eae62$var$allTexts.get(\"afs\")}</h3>\n </div>\n <div style=\"text-align: center;\">${lost ? $4b17d6e8488eae62$var$allTexts.get(\"loses\") : \"\"}</div>\n ${result[0]}\n </div>`);\n }\n function getFFAEventBattlesTemplate(lost, battles) {\n return `\n <div style=\"text-align: center\"><b>${$4b17d6e8488eae62$var$allTexts.get(\"hwmevents\")}</b></div>\n <div class=\"battle_examples_container\">\n <div style=\"display: flex; flex-direction: column\">\n <div style=\"text-align: center;\">\n <h3>${$4b17d6e8488eae62$var$allTexts.get(\"afs\")}</h3>\n </div>\n <div style=\"text-align: center;\">${lost ? $4b17d6e8488eae62$var$allTexts.get(\"loses\") : \"\"}</div>\n ${getBattlesTemplate(battles[\"AFS\"])[0]}\n </div>\n <div style=\"display: flex; flex-direction: column\">\n <div style=\"text-align: center;\">\n <h3>${$4b17d6e8488eae62$var$allTexts.get(\"ffa\")}</h3>\n </div>\n <div style=\"text-align: center;\">${lost ? $4b17d6e8488eae62$var$allTexts.get(\"loses\") : \"\"}</div>\n ${getBattlesTemplate(battles[\"FFA\"], \"FFA\")[0]}\n </div>\n </div>`;\n }\n function getBattlesTemplate(battles, type = \"AFS\") {\n let result = \"\";\n result += `<div style=\"text-align: center;\"><h4>${$4b17d6e8488eae62$var$allTexts.get(\"your_cl\")}</h4></div>`;\n let my_lvl_battles = battles.filter((battle)=>battle[\"hero_lvl\"] === (0, $dIwPZ.pl_lvl));\n result += ffaBattlesToHTML(my_lvl_battles);\n result += `<div style=\"text-align: center;\"><h4>${$4b17d6e8488eae62$var$allTexts.get(\"another_cl\")}</h4><h6>${$4b17d6e8488eae62$var$allTexts.get(\"another_cl_army\")}</h6></div>`;\n let not_my_lvl_battles = battles.filter((battle)=>battle[\"hero_lvl\"] !== (0, $dIwPZ.pl_lvl));\n let cl_buckets = {};\n not_my_lvl_battles.forEach((battle)=>{\n if (cl_buckets.hasOwnProperty(battle.hero_lvl)) cl_buckets[battle.hero_lvl].push(battle);\n else cl_buckets[battle.hero_lvl] = [\n battle\n ];\n });\n let cl_battles = (0, $dIwPZ.mapToArray)(cl_buckets);\n cl_battles = (0, $dIwPZ.sortByKey)(cl_battles, 0).reverse();\n cl_battles.forEach((bucket, index)=>{\n result += (0, $eTbLz.getSpoiler)(type, index, `<div class=\"home_button2 btn_hover2\" style=\"margin: 3px 0; min-width: 100px;\">${bucket[0]}${$4b17d6e8488eae62$var$allTexts.get(\"cl\")} (${bucket[1].length})</div>`, ffaBattlesToHTML(bucket[1]));\n });\n return [\n result,\n my_lvl_battles.length,\n not_my_lvl_battles.length\n ];\n }\n function getCreaturesHTML(battle, index) {\n if (currentSilver === 0 || !(\"creatures\" in battle) || !location.href.includes(\"reaping_event\") || Object.keys(creaturesInfo).length === 0) return \"\";\n let creatures = battle.creatures[0];\n let totalPrice = Object.entries(creatures).reduce((prev, [portrait, amount])=>{\n return prev + creaturesInfo[portrait][1] * amount;\n }, 0);\n let playerCreaturesHTML = \"\";\n Object.entries(creatures).forEach(([creaturePortrait, creatureAmount], cellId)=>{\n playerCreaturesHTML += `<div id=\"creature-${index}-${cellId}\">${(0, $eTbLz.getNewCreatureIcon)(creaturePortrait, creatureAmount, \"good-creature\")}</div>`;\n });\n return `\n <div style=\"width: 80%;display: flex;justify-content: space-between;\">\n <div class=\"record-player-creatures\" id=\"creatures-${index}\">\n <div id=\"creatures-${index}-apply\" class=\"creatures-apply\">\n ${totalPrice <= currentSilver ? `<div id=\"creatures-${index}-apply-button\" class=\"home_button2 btn_hover2\" onclick=\"sendApplyArmy('${battle.battle_id}')\" >${$4b17d6e8488eae62$var$allTexts.get(\"hire\")}</div>` : \"\"}\n <div id=\"creatures-${index}-leadership\" class=\"player-leadership\">\n <img height=\"24\" src=\"https://${0, $dIwPZ.cdnHost}/i/adv_ev_silver48.png\" alt=\"\">\n <span id=\"leadership-number-${index}\" style=\"color: ${totalPrice <= currentSilver ? \"green\" : \"red\"}\">\n ${totalPrice}\n </span>\n </div>\n </div>\n <div id=\"creatures-${index}-creatures\" class=\"player-creatures-row\">${playerCreaturesHTML}</div>\n </div>\n </div>\n `;\n }\n let applyingArmy = false;\n async function sendApplyArmy(battleId) {\n if (applyingArmy) return;\n applyingArmy = true;\n document.body.style.cursor = \"wait\";\n let creatures = battles[\"AFS\"].find((battle)=>battle.battle_id === battleId).creatures[0];\n let doc = await (0, $aqxxv.doGet)(\"/reaping_event_set.php\", true);\n let creaturesToRemove = Array.from(doc.querySelectorAll(\"#ne_set_current_army .cre_creature\")).reduce((result, elem)=>{\n if (elem.children.length > 2) {\n let portrait = elem.innerHTML.match(/portraits\\/([a-zA-Z0-9_-]+)p33/)[1];\n let creatureId = creaturesInfo[portrait][0];\n let amount = elem.children[2].innerText - 0;\n let price = creaturesInfo[portrait][1];\n result[creatureId] = {\n portrait: portrait,\n amount: amount,\n price: price\n };\n }\n return result;\n }, {});\n for (const [creatureId, creatureInfo] of Object.entries(creaturesToRemove)){\n if (creatureInfo.portrait in creatures && creatures[creatureInfo.portrait] === creatureInfo.amount) continue;\n let url = new URL(`https://${location.host}/reaping_event_set.php`);\n url.searchParams.set(\"del\", creatureId);\n url.searchParams.set(\"sign\", (0, $dIwPZ.my_sign));\n url.searchParams.set(\"js\", \"1\");\n url.searchParams.set(\"rand\", (Math.random() * 1000000).toString());\n await (0, $aqxxv.doGet)(url.toString(), true);\n }\n doc = await (0, $aqxxv.doGet)(\"/reaping_event_set.php\", true);\n let creaturesToSell = Array.from(doc.querySelectorAll(\"#ne_set_available_troops .cre_creature\")).reduce((result, elem)=>{\n let portrait = elem.innerHTML.match(/portraits\\/([a-zA-Z0-9_-]+)p33/)[1];\n let creatureId = creaturesInfo[portrait][0];\n let amount = elem.children[2].innerText - 0;\n let price = creaturesInfo[portrait][1];\n result[creatureId] = {\n portrait: portrait,\n amount: amount,\n price: price\n };\n return result;\n }, {});\n for (const [creatureId, creatureInfo] of Object.entries(creaturesToSell)){\n if (creatureInfo.portrait in creatures && creatures[creatureInfo.portrait] === creatureInfo.amount) continue;\n let url = new URL(`https://${location.host}/reaping_event_set.php`);\n url.searchParams.set(\"act\", \"sell_unit\");\n url.searchParams.set(\"mid\", creatureId);\n url.searchParams.set(\"price\", creatureInfo.price);\n url.searchParams.set(\"sign\", (0, $dIwPZ.my_sign));\n url.searchParams.set(\"js\", \"1\");\n url.searchParams.set(\"rand\", (Math.random() * 1000000).toString());\n await (0, $aqxxv.doGet)(url.toString(), true);\n }\n for (const [portrait, amount] of Object.entries(creatures)){\n if (creaturesInfo[portrait][0] in creaturesToSell && creaturesToSell[creaturesInfo[portrait][0]].amount === amount) continue;\n let url = new URL(`https://${location.host}/reaping_event_set.php`);\n url.searchParams.set(\"act\", \"buy\");\n url.searchParams.set(\"mid\", creaturesInfo[portrait][0]);\n url.searchParams.set(\"price\", creaturesInfo[portrait][1]);\n url.searchParams.set(\"cnt\", amount.toString());\n url.searchParams.set(\"sign\", (0, $dIwPZ.my_sign));\n url.searchParams.set(\"js\", \"1\");\n url.searchParams.set(\"rand\", (Math.random() * 1000000).toString());\n await (0, $aqxxv.doGet)(url.toString(), true);\n }\n location.reload();\n // applyingArmy = false\n }\n function ffaBattlesToHTML(battles) {\n if (battles.length > 0) {\n battles.sort((a, b)=>a.nickname.localeCompare(b.nickname));\n return (0, $dIwPZ.groupBy)(battles, \"nickname\").reduce((prev, curr, index)=>{\n let creatures = getCreaturesHTML(curr[0], index);\n return prev + `\n <div class=\"hwm_event_example_block\">\n <div style=\"width: 80%;display: flex;justify-content: space-between;\">\n <div>${curr[0].is_clan ? `<img src=\"https://www.freeiconspng.com/thumbs/lock-icon/black-lock-icon-14.png\" style=\"height: 14px;\">` : \"\"}${index + 1}.\u00a0</div>\n <div style=\"text-align: center\"> <a href=\"/pl_info.php?nick=${(0, $dIwPZ.encode)(curr[0][\"nickname\"])}\" class=\"pi\" target=\"_blank\">${curr[0][\"nickname\"]}</a></div>\n <div style=\"display: flex;min-width: 120px;justify-content: space-between;\">\n ${(0, $dIwPZ.sortByKey)(curr, \"battle_side\").reduce((prev_entry, curr_entry)=>{\n return prev_entry + `\n <div>\u00a0<a target=\"_blank\" href=\"/warlog.php?warid=${curr_entry[\"battle_id\"]}&show_for_all=${curr_entry[\"battle_secret\"]}<=-1\">${getFFAEventBattleSide(curr_entry)}</a></div>\n `;\n }, \"\")}\n </div>\n </div>\n ${creatures}\n </div>\n `;\n }, \"\");\n } else return `<div style=\"text-align: center;\"><h5>${$4b17d6e8488eae62$var$allTexts.get(\"empty\")}</h5></div>`;\n }\n function getClassById(id) {\n for(let i = 0; i < (0, $dIwPZ.allClasses).length; i++){\n if (id === (0, $dIwPZ.allClasses)[i][4]) return (0, $dIwPZ.allClasses)[i];\n }\n return null;\n }\n function getFFAEventBattleSide(battle) {\n let class_img = \"class\" in battle && getClassById(battle[\"class\"]) ? `<img style=\"vertical-align: middle; height: 16px\" src=\"https://${0, $dIwPZ.cdnHost}/i/f/${getClassById(battle[\"class\"])[3]}?v=1.1\" alt=\"\">\u00a0` : \"\";\n if (\"battle_side\" in battle) {\n if (battle[\"battle_side\"] === 0) return `${class_img}${$4b17d6e8488eae62$var$allTexts.get(\"enemy\")}#1`;\n else if (battle[\"battle_side\"] === 1) return `${class_img}${$4b17d6e8488eae62$var$allTexts.get(\"enemy\")}#2`;\n else return `${class_img}${$4b17d6e8488eae62$var$allTexts.get(\"battle\")}`;\n } else return `${class_img}${$4b17d6e8488eae62$var$allTexts.get(\"battle\")}`;\n }\n return battles;\n}\n\n});\n\n\nparcelRequire.register(\"av1kA\", function(module, exports) {\n\n$parcel$export(module.exports, \"default\", () => $7a4dd4ee2fd4704c$export$2e2bcd8739ae039);\n\nvar $8l3id = parcelRequire(\"8l3id\");\n\nvar $jWJKf = parcelRequire(\"jWJKf\");\n\nvar $dIwPZ = parcelRequire(\"dIwPZ\");\n\nvar $afXBq = parcelRequire(\"afXBq\");\nfunction $7a4dd4ee2fd4704c$var$getAllTexts() {\n let texts = new (0, $afXBq.LocalizedTextMap)();\n texts.addText(new (0, $afXBq.LocalizedText)(\"hide_faction_event_enemies\", \"Show enemies with max power only\", \"\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u043e\u0432 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c\u044e\", \"\u041f\u043e\u043a\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u0441\u0443\u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u0456\u0432 \u043b\u0438\u0448\u0435 \u0437 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u044e \u043f\u043e\u0442\u0443\u0436\u043d\u0456\u0441\u0442\u044e\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"mana_warning\", \"Enemies are stealing mana!\", \"\u0412 \u0430\u0440\u043c\u0438\u0438 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u0430 \u043f\u043e\u0436\u0438\u0440\u0430\u0442\u0435\u043b\u0438 \u043c\u0430\u043d\u044b!\", \"\u0412 \u0430\u0440\u043c\u0456\u0457 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u0430 \u043a\u0440\u0430\u0434\u0456\u0457 \u043c\u0430\u043d\u0438!\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"faction_custom_ins\", `Enable unit placement saving \n <img src=\"https://hwm.events/battles/custom_ins.gif\" height=\"400px\" onclick='event.stopPropagation()'>\n (fields with different height require different saved placement)\n `, `\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0430\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \n <img src=\"https://hwm.events/battles/custom_ins.gif\" height=\"400px\" onclick='event.stopPropagation()'>\n (\u0434\u043b\u044f \u043f\u043e\u043b\u0435\u0439 \u0440\u0430\u0437\u043d\u043e\u0439 \u0432\u044b\u0441\u043e\u0442\u044b \u043d\u0443\u0436\u043d\u0430 \u0441\u0432\u043e\u044f \u0440\u0430\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430)\n `, `\u041c\u043e\u0436\u043b\u0438\u0432\u0456\u0441\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u043d\u043e\u0433\u043e \u0440\u043e\u0437\u043c\u0456\u0449\u0435\u043d\u043d\u044f \n <img src=\"https://hwm.events/battles/custom_ins.gif\" height=\"400px\" onclick='event.stopPropagation()'>\n (\u0434\u043b\u044f \u043f\u043e\u043b\u044f \u0440\u0456\u0437\u043d\u043e\u0457 \u0432\u0438\u0441\u043e\u0442\u0438 \u043f\u043e\u0442\u0440\u0456\u0431\u043d\u0435 \u0441\u0432\u043e\u0454 \u0440\u043e\u0437\u043c\u0456\u0449\u0435\u043d\u043d\u044f)\n `));\n texts.addText(new (0, $afXBq.LocalizedText)(\"custom_ins_auto\", \"Automatically apply saved placement\", `\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u0443\u044e \u0440\u0430\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443`, \"\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u043d\u043e \u0437\u0430\u0441\u0442\u043e\u0441\u043e\u0432\u0443\u0432\u0430\u0442\u0438 \u0437\u0431\u0435\u0440\u0435\u0436\u0435\u043d\u0435 \u0440\u043e\u0437\u043c\u0456\u0449\u0435\u043d\u043d\u044f\"));\n return texts;\n}\nlet $7a4dd4ee2fd4704c$var$allTexts = $7a4dd4ee2fd4704c$var$getAllTexts();\nfunction $7a4dd4ee2fd4704c$export$2e2bcd8739ae039() {\n function showManaWarning(enemies) {\n enemies.forEach((enemy)=>{\n let enemyHTML = enemy.innerHTML;\n if (enemyHTML.includes('name=imp\"') || enemyHTML.includes('name=familiar\"') || enemyHTML.includes('name=vermin\"') || enemyHTML.includes('name=spegasus\"')) enemy.children[3].insertAdjacentHTML(\"afterend\", `\n <div><b style=\"color: red\">${$7a4dd4ee2fd4704c$var$allTexts.get(\"mana_warning\")}</b></div>\n `);\n });\n }\n if (location.href.includes(\"faction_event\")) {\n (0, $8l3id.setLeaderboard)(document.querySelector(\"#hwm_for_zoom > div > div:nth-child(1) > div > div:nth-child(2) > center\"));\n (0, $jWJKf.eventHelperSettings)(document.querySelector(\"#hwm_for_zoom > div > div.frac_event_right_block > div > div:nth-child(2)\"), (container)=>{\n (0, $jWJKf.setSettings)(\"hide_faction_event_enemies\", $7a4dd4ee2fd4704c$var$allTexts.get(\"hide_faction_event_enemies\"), container, false);\n (0, $jWJKf.setSettings)(\"faction_custom_ins\", $7a4dd4ee2fd4704c$var$allTexts.get(\"faction_custom_ins\"), container, true);\n (0, $jWJKf.setSettings)(\"custom_ins_auto\", $7a4dd4ee2fd4704c$var$allTexts.get(\"custom_ins_auto\"), container, false);\n }, \"beforeend\");\n let enemies = getEnemies();\n let maxPower = getMaxPower(enemies);\n if ((0, $dIwPZ.get)(\"hide_faction_event_enemies\", false)) filterFactionEventEnemies(enemies, maxPower);\n showManaWarning(enemies);\n }\n function getEnemies() {\n return Array.from(document.getElementsByClassName(\"frac_enemy_block\"));\n }\n function getMaxPower(enemies) {\n return enemies.reduce((prev, curr)=>{\n let power = curr.children[3].innerText.split(\": \")[1] - 0;\n return power > prev ? power : prev;\n }, 0);\n }\n function filterFactionEventEnemies(enemies, maxPower) {\n enemies.forEach((enemy)=>{\n let power = enemy.children[3].innerText.split(\": \")[1] - 0;\n if (power < maxPower) enemy.remove();\n });\n }\n}\n\n});\n\nparcelRequire.register(\"jbjeJ\", function(module, exports) {\n\n$parcel$export(module.exports, \"default\", () => $df6df76886fa26a3$export$2e2bcd8739ae039);\n\nvar $8l3id = parcelRequire(\"8l3id\");\n\nvar $jWJKf = parcelRequire(\"jWJKf\");\n\nvar $dIwPZ = parcelRequire(\"dIwPZ\");\n\nvar $ao0pt = parcelRequire(\"ao0pt\");\n\nvar $6rIzz = parcelRequire(\"6rIzz\");\n\nvar $aqxxv = parcelRequire(\"aqxxv\");\n\nvar $afXBq = parcelRequire(\"afXBq\");\n\nvar $eTbLz = parcelRequire(\"eTbLz\");\nfunction $df6df76886fa26a3$var$getAllTexts() {\n let texts = new (0, $afXBq.LocalizedTextMap)();\n texts.addText(new (0, $afXBq.LocalizedText)(\"auto_send_rogues_event\", \"Send battles from the rogue event to the service automatically\", \"\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0431\u043e\u0438 \u0438\u0437 \u0440\u0430\u0437\u0431\u043e\u0439\u043d\u0438\u0447\u044c\u0435\u0433\u043e \u0438\u0432\u0435\u043d\u0442\u0430 \u0432 \u0441\u0435\u0440\u0432\u0438\u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\", \"\u0412\u0456\u0434\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u0438 \u0431\u043e\u0457 \u0437 \u0440\u043e\u0437\u0431\u0456\u0439\u043d\u0438\u0446\u044c\u043a\u043e\u0433\u043e \u0456\u0432\u0435\u043d\u0442\u0430 \u0443 \u0441\u0435\u0440\u0432\u0456\u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u043d\u043e\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"only_clan_visibility\", \"My battles are only available to the clan\", \"\u041c\u043e\u0438 \u0431\u043e\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043a\u043b\u0430\u043d\u0430\", \"\u041c\u043e\u0457 \u0431\u043e\u0457 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0456 \u043b\u0438\u0448\u0435 \u0434\u043b\u044f \u043a\u043b\u0430\u043d\u0443\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"collapse_event_desc\", \"Always collapse fight descriptions\", \"\u0412\u0441\u0435\u0433\u0434\u0430 \u0441\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0431\u043e\u0435\u0432\", \"\u0417\u0430\u0432\u0436\u0434\u0438 \u0437\u0433\u043e\u0440\u0442\u0430\u0442\u0438 \u043e\u043f\u0438\u0441\u0438 \u0431\u043e\u0457\u0432\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"hide_rogues_event_enemies\", \"Show price statistics\", \"\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0446\u0435\u043d\", \"\u041f\u043e\u043a\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0446\u0456\u043d\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"return_to_prev_level\", \"Return to an unfinished level\", \"\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043d\u0430 \u043d\u0435\u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c\", \"\u041f\u043e\u0432\u0435\u0440\u0442\u0430\u0442\u0438 \u043d\u0430 \u043d\u0435\u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0439 \u0440\u0456\u0432\u0435\u043d\u044c\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"bought\", \"bought\", \"\u043a\u0443\u043f\u043b\u0435\u043d\u043e\", \"\u043a\u0443\u043f\u043b\u0435\u043d\u043e\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"sold\", \"sold\", \"\u043f\u0440\u043e\u0434\u0430\u043d\u043e\", \"\u043f\u0440\u043e\u0434\u0430\u043d\u043e\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"trade_for\", \"for\", \"\u043f\u043e\", \"\u043f\u043e\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"trade_history\", \"Trade history\", \"\u0418\u0441\u0442\u043e\u0440\u0438\u044f \u043f\u043e\u043a\u0443\u043f\u043e\u043a \u0438 \u043f\u0440\u043e\u0434\u0430\u0436\", \"\u0406\u0441\u0442\u043e\u0440\u0456\u044f \u043f\u043e\u043a\u0443\u043f\u043e\u043a \u0442\u0430 \u043f\u0440\u043e\u0434\u0430\u0436\u0456\u0432\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"show_event_timer\", \"Show time until the end of the event\", \"\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u0438\u0432\u0435\u043d\u0442\u0430\", \"\u041f\u043e\u043a\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u0447\u0430\u0441 \u0434\u043e \u043a\u0456\u043d\u0446\u044f \u0456\u0432\u0435\u043d\u0442\u0430\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"show_top_clan_attempts\", \"Show remaining attempts for TOP3 clans\", \"\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u0443 \u0422\u041e\u041f3 \u043a\u043b\u0430\u043d\u043e\u0432\", \"\u041f\u043e\u043a\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u0441\u043f\u0440\u043e\u0431\u0438, \u0449\u043e \u0437\u0430\u043b\u0438\u0448\u0438\u043b\u0438\u0441\u044f, \u0443 \u0422\u041e\u041f3 \u043a\u043b\u0430\u043d\u0456\u0432\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"hire_hint\", \"Red means higher prices, while green means the opposite. At this event, the cost of a creature can only be within + -15% of the initial cost. Thus, if 115% is written next to the price, it will no longer rise upwards, and if the price is 85%, then it will no longer fall either.\", \"\u041a\u0440\u0430\u0441\u043d\u044b\u0439 \u0446\u0432\u0435\u0442 \u0437\u043d\u0430\u0447\u0438\u0442 \u043f\u043e\u0434\u043e\u0440\u043e\u0436\u0430\u043d\u0438\u0435, \u0430 \u0437\u0435\u043b\u0435\u043d\u044b\u0439 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442. \u041d\u0430 \u044d\u0442\u043e\u043c \u0438\u0432\u0435\u043d\u0442\u0435 \u0446\u0435\u043d\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 +-15% \u043e\u0442 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0435\u0441\u043b\u0438 \u0440\u044f\u0434\u043e\u043c \u0441 \u0446\u0435\u043d\u043e\u0439 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e 115%, \u043e\u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u0440\u0430\u0441\u0442\u0438 \u0432\u0432\u0435\u0440\u0445 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442, \u0430 \u0435\u0441\u043b\u0438 \u0446\u0435\u043d\u0430 85%, \u0442\u043e \u043f\u0430\u0434\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u0436\u0435.\", \"\u0427\u0435\u0440\u0432\u043e\u043d\u0438\u0439 \u043a\u043e\u043b\u0456\u0440 \u043e\u0437\u043d\u0430\u0447\u0430\u0454 \u043f\u043e\u0434\u043e\u0440\u043e\u0436\u0447\u0430\u043d\u043d\u044f, \u0430 \u0437\u0435\u043b\u0435\u043d\u0438\u0439 \u2013 \u043d\u0430\u0432\u043f\u0430\u043a\u0438. \u041d\u0430 \u0446\u044c\u043e\u043c\u0443 \u0456\u0432\u0435\u043d\u0442\u0456 \u0446\u0456\u043d\u0430 \u0456\u0441\u0442\u043e\u0442\u0438 \u043c\u043e\u0436\u0435 \u0431\u0443\u0442\u0438 \u043b\u0438\u0448\u0435 \u0432 \u043c\u0435\u0436\u0430\u0445 +-15% \u0432\u0456\u0434 \u043f\u043e\u0447\u0430\u0442\u043a\u043e\u0432\u043e\u0457 \u0432\u0430\u0440\u0442\u043e\u0441\u0442\u0456. \u0422\u0430\u043a\u0438\u043c \u0447\u0438\u043d\u043e\u043c, \u044f\u043a\u0449\u043e \u043f\u043e\u0440\u044f\u0434 \u0437 \u0446\u0456\u043d\u043e\u044e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e 115%, \u0432\u043e\u043d\u0430 \u0431\u0456\u043b\u044c\u0448\u0435 \u043d\u0435 \u0437\u0440\u043e\u0441\u0442\u0430\u0442\u0438\u043c\u0435, \u0430 \u044f\u043a\u0449\u043e \u0446\u0456\u043d\u0430 85%, \u0442\u043e \u043f\u0430\u0434\u0430\u0442\u0438 \u0431\u0456\u043b\u044c\u0448\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435 \u0442\u0435\u0436.\"));\n return texts;\n}\nlet $df6df76886fa26a3$var$allTexts = $df6df76886fa26a3$var$getAllTexts();\nfunction $df6df76886fa26a3$export$2e2bcd8739ae039() {\n if (location.href.includes(\"naym_event.\")) {\n // addFilteringArea()\n // processFilters()\n (0, $8l3id.setLeaderboard)(Array.from(Array.from(document.querySelectorAll(\".global_container_block\")).at(-1).getElementsByTagName(\"center\")).at(-1));\n if ((0, $dIwPZ.get)(\"show_top_clan_attempts\", true)) (0, $8l3id.setTopClanAttempts)(Array.from(Array.from(document.querySelectorAll(\".global_container_block\")).at(-1).getElementsByTagName(\"table\")).at(-1));\n (0, $jWJKf.eventHelperSettings)(Array.from(document.querySelectorAll(\".global_container_block\")).at(-1).firstChild, (container)=>{\n (0, $jWJKf.setSettings)(\"auto_send_rogues_event\", $df6df76886fa26a3$var$allTexts.get(\"auto_send_rogues_event\"), container);\n (0, $jWJKf.setSettings)(\"only_clan_visibility\", $df6df76886fa26a3$var$allTexts.get(\"only_clan_visibility\"), container, false);\n (0, $jWJKf.setSettings)(\"collapse_event_desc\", $df6df76886fa26a3$var$allTexts.get(\"collapse_event_desc\"), container, false);\n (0, $jWJKf.setSettings)(\"hide_rogues_event_enemies\", $df6df76886fa26a3$var$allTexts.get(\"hide_rogues_event_enemies\"), container);\n (0, $jWJKf.setSettings)(\"return_to_prev_level\", $df6df76886fa26a3$var$allTexts.get(\"return_to_prev_level\"), container, false);\n (0, $jWJKf.setSettings)(\"show_top_clan_attempts\", $df6df76886fa26a3$var$allTexts.get(\"show_top_clan_attempts\"), container);\n (0, $jWJKf.setSettings)(\"show_event_timer\", $df6df76886fa26a3$var$allTexts.get(\"show_event_timer\"), container);\n }, \"afterbegin\");\n (0, $dIwPZ.set)(\"eh_current_level\", null);\n if ((0, $dIwPZ.get)(\"show_event_timer\", true)) (0, $ao0pt.setTimer)(document.querySelector(\".global_container_block_header\"));\n (0, $ao0pt.collapseEventDesc)();\n (0, $ao0pt.setClickableLevels)();\n (0, $6rIzz.getEventBattles)(Array.from(document.querySelectorAll(\".global_container_block\")).at(-2), \"getRoguesEventBattles\", 1);\n interceptButtons();\n }\n if (location.href.includes(\"naym_event_set\")) {\n if ((0, $dIwPZ.get)(\"show_event_timer\", true)) (0, $ao0pt.setTimer)(document.querySelector(\".global_container_block_header\"));\n Array.from(document.querySelectorAll(\".hwm_event_block_header\")).at(-1).insertAdjacentHTML(\"beforeend\", `\n <div class=\"hwm_event_block_miniheader\">${$df6df76886fa26a3$var$allTexts.get(\"hire_hint\")}</div>\n `);\n let buy_history = (0, $dIwPZ.get)(\"buy_history\", []);\n if ((0, $dIwPZ.get)(\"hide_rogues_event_enemies\", true)) {\n let newScript = document.createElement(\"script\");\n newScript.setAttribute(\"src\", \"https://cdn.jsdelivr.net/npm/chart.js\");\n document.head.appendChild(newScript);\n newScript.onload = ()=>{\n showPriceChange();\n };\n } else showPriceChange();\n setTotalPrice();\n setListeners();\n showBuyHistory();\n setInterval(()=>{\n if (!(0, $dIwPZ.$)(\"set_check\")) {\n setListeners();\n showPriceChange();\n showBuyHistory();\n }\n }, 100);\n function drawChart(prices, index, elem) {\n elem.insertAdjacentHTML(\"afterend\", `\n <tr>\n <td colspan=\"3\">\n <div style=\"height: 165px; overflow: hidden\">\n <canvas id=\"chart${index}\" height=\"150\" style=\"width: 100%\"></canvas>\n </div>\n </td>\n </tr>`);\n function padTo2Digits(num) {\n return num.toString().padStart(2, \"0\");\n }\n function formatDate(date) {\n return [\n padTo2Digits(date.getHours()),\n \"00\"\n ].join(\":\") + \" \" + [\n padTo2Digits(date.getDate()),\n date.toLocaleString(\"default\", {\n month: \"long\"\n })\n ].join(\"-\");\n }\n let date = new Date(1681783201000);\n const labels = prices.map(()=>{\n let label = formatDate(date);\n date.setHours(date.getHours() + 1);\n return label;\n });\n const data = {\n labels: labels,\n datasets: [\n {\n label: \"Price\",\n data: prices.map((price)=>parseInt(price)),\n borderColor: \"rgb(100,100,100)\",\n backgroundColor: \"rgb(116,152,168)\",\n pointStyle: \"circle\",\n pointRadius: 1.5,\n pointHoverRadius: 5\n }\n ]\n };\n const config = {\n type: \"line\",\n data: data,\n options: {\n animation: false,\n responsive: false,\n plugins: {\n legend: {\n display: false\n },\n title: {\n display: false,\n text: \"Chart.js Line Chart\"\n }\n },\n elements: {\n line: {\n borderWidth: 1\n }\n },\n scales: {\n x: {\n ticks: {\n display: false\n },\n grid: {\n display: false\n }\n },\n y: {\n grid: {\n display: false\n }\n }\n },\n interaction: {\n mode: \"index\",\n intersect: false\n }\n }\n };\n const ctx = document.getElementById(`chart${index}`).getContext(\"2d\");\n const myChart = new Chart(ctx, config);\n }\n async function showPriceChange() {\n let doc = await (0, $aqxxv.doGet)(`getRoguesCreaturesPrices`, false);\n Array.from(document.querySelector(\"#ne_set_troops_on_market\").querySelectorAll(\".hwm_event_set_stack_block\")).filter((elem)=>elem.innerHTML.includes(\"cre_creature\")).forEach((elem, index)=>{\n let creatureName = elem.innerHTML.match(/name=([a-zA-Z0-9]+)/)[1];\n let prices = doc[creatureName].map((price)=>price - 0);\n let priceElem = elem.querySelectorAll(\".txt_with_icons\")[1];\n if (prices[prices.length - 1] - 0 > prices[prices.length - 2] - 0) elem.style.background = \"#ff9e9e\";\n else if (prices[prices.length - 1] - 0 < prices[prices.length - 2] - 0) elem.style.background = \"#9eff98\";\n priceElem.insertAdjacentHTML(\"beforeend\", ` (${Math.max(Math.min(Math.round(prices.at(-1) / prices[0] * 100), 115), 85)}%)`);\n Array.from(elem.querySelectorAll('input[type=\"submit\"]')).forEach((input)=>{\n input.classList.add(\"btn_hover2\", \"home_button2\");\n });\n if ((0, $dIwPZ.get)(\"hide_rogues_event_enemies\", true)) drawChart(prices, index, elem);\n });\n }\n function showBuyHistory() {\n if (buy_history.length > 0) {\n let rows = (0, $dIwPZ.groupBy)((0, $dIwPZ.sortByKey)(buy_history, \"time\").reverse(), \"name\").reduce((result, currCreatureList)=>{\n return result + `\n <div style=\"display: flex; justify-content: space-evenly;align-items: center;padding: 0\" class=\"hwm_event_set_stack_block\">\n ${(0, $eTbLz.getSpoiler)(currCreatureList[0].name, \"\", `\n <div style=\"width: 40px\">\n <img src=\"https://cfcdn.lordswm.com/i/portraits/${currCreatureList[0].name}anip33.png\" style=\"height: 48px; width: 48px; border-radius: 50%; object-fit: cover;\" alt=\"\">\n </div>\n `, currCreatureList.reduce((prev, curr)=>{\n return prev + `\n <div style=\"display: flex; justify-content: space-evenly;align-items: center;padding: 0\" class=\"hwm_event_set_stack_block\">\n <div>\n ${new Date(curr.time).toLocaleTimeString()}\n </div>\n <div>\n ${curr.action === \"buy\" ? `<p style='color: green'>${$df6df76886fa26a3$var$allTexts.get(\"bought\")}</p>` : `<p style='color: red'>${$df6df76886fa26a3$var$allTexts.get(\"sold\")}</p>`}\n </div>\n <div>\n ${curr.count}\n </div>\n <div>\n <div style=\"width: 40px\"><img src=\"https://cfcdn.lordswm.com/i/portraits/${curr.name}anip33.png\" style=\"height: 48px; width: 48px; border-radius: 50%; object-fit: cover;\" alt=\"\"></div>\n </div>\n <div>\n ${$df6df76886fa26a3$var$allTexts.get(\"trade_for\")} ${curr.price}\n </div>\n </div>\n `;\n }, \"\"), \"roguesSpoilerWrapper\", \"roguesSpoilerLabel\")}\n </div>\n `;\n }, \"\");\n document.querySelector(\"#ne_set_available_troops\").insertAdjacentHTML(\"beforeend\", `\n <div style=\"display: flex; flex-direction: column\">\n <div style=\"text-align: center\"><h3>${$df6df76886fa26a3$var$allTexts.get(\"trade_history\")}</h3></div>\n ${rows}\n </div>\n `);\n }\n }\n function setTotalPrice() {\n let totalPrice = Array.from(document.querySelector(\"#ne_set_available_troops\").querySelectorAll(\".hwm_event_set_stack_block\")).map((elem)=>{\n return parseInt(Array.from(elem.querySelectorAll(\".txt_with_icons.hwm_ne_event_img_q\")).at(-1).innerText.replace(\",\", \"\"));\n }).reduce((previousValue, currentValue)=>previousValue + currentValue, 0).toLocaleString();\n document.querySelector(\"#ne_set_now_power\").insertAdjacentHTML(\"afterend\", `\n \u00a0\u00a0<span id=\"ne_set_now_power\" class=\"txt_with_icons hwm_ne_event_img_q\" style=\"font-weight: bold; background-image: url('https://dcdn.heroeswm.ru/i/adv_ev_silver48.png')\">${totalPrice}</span>\n `);\n }\n function setListeners() {\n document.querySelector(\"#ne_set_available_troops\").insertAdjacentHTML(\"beforeend\", `<div id=\"set_check\"><div>`);\n Array.from(document.querySelector(\"#ne_set_available_troops\").children).filter((elem)=>elem.innerHTML.includes(\"cre_creature\")).forEach((elem, index)=>{\n let creatureName = elem.innerHTML.match(/\\?name=([a-zA-Z0-9_-]+)/)[1];\n let creatureCount = elem.querySelector(\".cre_amount\").innerText - 0;\n let creatureHistory = (0, $dIwPZ.groupByKey)((0, $dIwPZ.sortByKey)(buy_history, \"time\").reverse(), \"name\")[creatureName] ?? [];\n let recentPurchases = [];\n creatureHistory.some((item)=>{\n if (\"sell\" === item.action) return true;\n else recentPurchases.push(item);\n });\n let [totalCount, totalPrice] = recentPurchases.reduce(([resultCount, resultPrice], currentPurchase)=>{\n return [\n resultCount + currentPurchase[\"count\"],\n resultPrice + currentPurchase[\"count\"] * currentPurchase[\"price\"]\n ];\n }, [\n 0,\n 0\n ]);\n let target = Array.from(elem.querySelectorAll(\".txt_with_icons.hwm_ne_event_img_q\")).at(-1);\n if (totalPrice !== 0) {\n let currentPriceElement = target.firstChild;\n let currentPrice = currentPriceElement.innerText.replace(\",\", \"\") - 0;\n if (totalCount === creatureCount) {\n if (currentPrice > totalPrice) currentPriceElement.style.color = \"green\";\n else if (currentPrice < totalPrice) currentPriceElement.style.color = \"red\";\n }\n target.insertAdjacentHTML(\"beforeend\", `\n ${$df6df76886fa26a3$var$allTexts.get(\"bought\")} ${totalCount} ${$df6df76886fa26a3$var$allTexts.get(\"trade_for\")} ${totalPrice}\n `);\n }\n let submit = elem.querySelector(\"input[type=submit]\");\n if (submit) {\n let data = submit[\"onclick\"].toString();\n let findings = data.match(/(\\d{1,5}), '([a-zA-Z0-9_-]+)', '(\\d{0,3},?\\d{1,3})', (\\d{1,5})\\)/);\n let price = parseInt(findings[4].replace(\",\", \"\"));\n let count = parseInt(findings[1]);\n let name = findings[2];\n let time = Date.now();\n submit.addEventListener(\"click\", ()=>{\n buy_history.push({\n \"name\": name,\n \"price\": price,\n \"count\": count,\n \"time\": time,\n \"action\": \"sell\"\n });\n (0, $dIwPZ.set)(\"buy_history\", buy_history.filter((elem)=>Date.now() - elem.time < 1209600000));\n });\n }\n });\n Array.from(document.querySelector(\"#ne_set_troops_on_market\").querySelectorAll(\".hwm_event_set_stack_block\")).filter((elem)=>elem.innerHTML.includes(\"cre_creature\")).forEach((elem, index)=>{\n let submit = elem.querySelector(\"div[id^=ne_set_button]\");\n if (submit) {\n let submit_a = submit.querySelector(\"a\");\n submit.addEventListener(\"click\", ()=>{\n let data = submit_a[\"onclick\"].toString();\n let findings = data.match(/'([a-zA-Z0-9_-]+)', (\\d{1,5})\\)/);\n let price = parseInt(elem.querySelector(\"input[id^=ne_set_market_price]\").value);\n let count = parseInt(elem.querySelector(\"select[name=cnt]\").value);\n let name = findings[1];\n let time = Date.now();\n buy_history.push({\n \"name\": name,\n \"price\": price,\n \"count\": count,\n \"time\": time,\n \"action\": \"buy\"\n });\n (0, $dIwPZ.set)(\"buy_history\", buy_history.filter((elem)=>Date.now() - elem.time < 1209600000));\n });\n }\n });\n }\n }\n function interceptButtons() {\n let buttons = Array.from(document.querySelectorAll(\"input[id^=ne_attack_button]\"));\n if (buttons.length === 2) {\n let available = 2 - buttons.filter((x)=>x.disabled).length;\n buttons.forEach((button, index)=>{\n button.addEventListener(\"mousedown\", ()=>{\n (0, $dIwPZ.set)(\"event_battle_side\", index % 2);\n (0, $dIwPZ.set)(\"eh_current_level\", [\n (0, $ao0pt.getCurrentLevel)(),\n available\n ]);\n });\n });\n }\n }\n}\n\n});\n\nparcelRequire.register(\"2jsww\", function(module, exports) {\n\n$parcel$export(module.exports, \"default\", () => $1af37b4d2518eafd$export$2e2bcd8739ae039);\n\nvar $dIwPZ = parcelRequire(\"dIwPZ\");\n\nvar $8l3id = parcelRequire(\"8l3id\");\n\nvar $jWJKf = parcelRequire(\"jWJKf\");\n\nvar $aqxxv = parcelRequire(\"aqxxv\");\n\nvar $afXBq = parcelRequire(\"afXBq\");\n\nvar $ao0pt = parcelRequire(\"ao0pt\");\nfunction $1af37b4d2518eafd$var$getAllTexts() {\n let texts = new (0, $afXBq.LocalizedTextMap)();\n texts.addText(new (0, $afXBq.LocalizedText)(\"item\", \"Item\", \"\u0422\u043e\u0432\u0430\u0440\", \"\u0422\u043e\u0432\u0430\u0440\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"profit\", \"Profit per 1t.\", \"\u041f\u0440\u0438\u0431\u044b\u043b\u044c \u0437\u0430 1\u0442.\", \"\u041f\u0440\u0438\u0431\u0443\u0442\u043e\u043a \u0437\u0430 1\u0442.\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"weight\", \"Weight\", \"\u0412\u0435\u0441\", \"\u0412\u0430\u0433\u0430\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"prices\", \"Prices\", \"\u0426\u0435\u043d\u044b\", \"\u0426\u0456\u043d\u0438\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"buy\", \"Buy\", \"\u041a\u0443\u043f\u0438\u0442\u044c\", \"\u041f\u0440\u0438\u0434\u0431\u0430\u0442\u0438\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"fill_max\", \"Load maximum\", \"\u041d\u0430\u0431\u0440\u0430\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\", \"\u041d\u0430\u0431\u0440\u0430\u0442\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"hire_all\", \"Recruit all\", \"\u041d\u0430\u043d\u044f\u0442\u044c \u0432\u0441\u0435\u0445\", \"\u041d\u0430\u0439\u043d\u044f\u0442\u0438 \u0432\u0441\u0456\u0445\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"fill_maxoff5\", \"Load -5 from the maximum\", \"\u041d\u0430\u0431\u0440\u0430\u0442\u044c -5 \u043e\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0430\", \"\u041d\u0430\u0431\u0440\u0430\u0442\u0438 -5 \u0432\u0456\u0434 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0443\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"fill_process\", \"Loading in progress\", \"\u0418\u0434\u0435\u0442 \u043f\u043e\u0433\u0440\u0443\u0437\u043a\u0430\", \"\u0422\u0440\u0438\u0432\u0430\u0454 \u043d\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"auto_return_after_battle\", \"Auto return after battle\", \"\u0410\u0432\u0442\u043e\u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u043f\u043e\u0441\u043b\u0435 \u0431\u043e\u044f\", \"\u0410\u0432\u0442\u043e\u043f\u043e\u0432\u0435\u0440\u043d\u0435\u043d\u043d\u044f \u043f\u0456\u0441\u043b\u044f \u0431\u043e\u044e\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"show_autofill_options\", \"Buttons for fast loading\", \"\u041a\u043d\u043e\u043f\u043a\u0438 \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438\", \"\u041a\u043d\u043e\u043f\u043a\u0438 \u0434\u043b\u044f \u0448\u0432\u0438\u0434\u043a\u043e\u0433\u043e \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"sort_products\", \"Sort products by profit\", \"\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u0432\u0430\u0440\u044b \u043f\u043e \u043f\u0440\u0438\u0431\u044b\u043b\u0438\", \"\u0421\u043e\u0440\u0442\u0443\u0432\u0430\u0442\u0438 \u0442\u043e\u0432\u0430\u0440\u0438 \u0437\u0430 \u043f\u0440\u0438\u0431\u0443\u0442\u043a\u043e\u043c\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"show_event_timer\", \"Show time until the end of the event\", \"\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u0438\u0432\u0435\u043d\u0442\u0430\", \"\u041f\u043e\u043a\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u0447\u0430\u0441 \u0434\u043e \u043a\u0456\u043d\u0446\u044f \u0456\u0432\u0435\u043d\u0442\u0430\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"show_ship_available_alert\", \"Notify about new ship\", \"\u0423\u0432\u0435\u0434\u043e\u043c\u043b\u044f\u0442\u044c \u043e \u043d\u043e\u0432\u043e\u043c \u043a\u043e\u0440\u0430\u0431\u043b\u0435\", \"\u041f\u043e\u0432\u0456\u0434\u043e\u043c\u043b\u044f\u0442\u0438 \u043f\u0440\u043e \u043d\u043e\u0432\u0438\u0439 \u043a\u043e\u0440\u0430\u0431\u0435\u043b\u044c\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"ship_available_alert\", \"STOP! New ship is available\", \"\u0421\u0422\u041e\u0419! \u0414\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u0440\u0430\u0431\u043b\u044c\", \"\u0421\u0422\u0406\u0419! \u0414\u043e\u0441\u0442\u0443\u043f\u043d\u0438\u0439 \u043d\u043e\u0432\u0438\u0439 \u043a\u043e\u0440\u0430\u0431\u0435\u043b\u044c\"));\n return texts;\n}\nlet $1af37b4d2518eafd$var$allTexts = $1af37b4d2518eafd$var$getAllTexts();\nfunction $1af37b4d2518eafd$export$2e2bcd8739ae039() {\n if (location.href.includes(\"pirate_event.\")) {\n document.querySelector(\".pirate_event_blocks\").style.width = \"100%\";\n document.querySelector(\"#set_mobile_max_width\").style.justifyContent = \"center\";\n document.querySelector(\".global_inside_shadow.pirate_event_picture\").remove();\n Array.from(document.querySelectorAll(\"#tableDiv\")).forEach((tdiv)=>{\n tdiv.style.height = \"max-content\";\n tdiv.firstChild.style.position = \"unset\";\n });\n if ((0, $dIwPZ.get)(\"show_ship_available_alert\", true)) {\n let isNewShipAvailable = false;\n let newShipButton = Array.from(document.querySelectorAll(\"input[type='submit']\")).filter((input)=>input.nextElementSibling?.value === \"buy_new_ship\");\n if (newShipButton.length > 0) isNewShipAvailable = !newShipButton[0].disabled;\n let battleButton = Array.from(document.querySelectorAll(\"input[type='submit']\")).filter((input)=>input.parentElement.previousElementSibling?.value === \"go_go_go\")[0];\n let isBattleAvailable = !battleButton.disabled;\n if (isNewShipAvailable && isBattleAvailable) {\n battleButton.insertAdjacentHTML(\"beforebegin\", `<p><b style=\"color: red\">${$1af37b4d2518eafd$var$allTexts.get(\"ship_available_alert\")}</b></p>`);\n let wasPrank = false;\n battleButton.addEventListener(\"mouseover\", ()=>{\n if (!wasPrank) {\n battleButton.style.transform = \"translateX(100px)\";\n wasPrank = true;\n }\n });\n }\n }\n if ((0, $dIwPZ.get)(\"show_event_timer\", true)) (0, $ao0pt.setTimer)(document.querySelector(\".global_container_block_header\"));\n let tableDiv = document.querySelectorAll(\"#tableDiv\")[2];\n let trs = tableDiv.querySelector(\"table > tbody\").childNodes;\n let items = Array.from(trs).filter((item)=>item.querySelector(\"td:nth-child(5)\").innerHTML.length > 100).map((item)=>{\n let item_info = {};\n item_info.name = item.querySelector(\"td:nth-child(1) > img\").src;\n item_info.res_id = item.querySelector(`input[name=\"res_id\"]`).value;\n item_info.weight = item.querySelector(\"td:nth-child(2)\").innerText - 0;\n item_info.buy_price = item.querySelector(\"td:nth-child(3) table > tbody > tr > td:nth-child(2)\").innerText.replace(/,/g, \"\") - 0;\n item_info.sell_price = item.querySelector(\"td:nth-child(4) table > tbody > tr > td:nth-child(2)\").innerText.replace(/,/g, \"\") - 0;\n item_info.buy_form = item.querySelector(\"td:nth-child(5)\").innerHTML;\n item_info.profit = item_info.sell_price - item_info.buy_price;\n item_info.opt_price = item_info.profit / item_info.weight;\n return item_info;\n });\n let itemsMap = (0, $dIwPZ.arrayToMapByKey)(items, \"name\");\n items = (0, $dIwPZ.sortByKey)(items, \"opt_price\", -1);\n let template = getPirateEventTemplate(items);\n let target_td = document.querySelectorAll(\"#tableDiv\")[2];\n if ((0, $dIwPZ.get)(\"sort_products\", true)) {\n target_td.removeChild(target_td.childNodes[0]);\n target_td.insertAdjacentHTML(\"beforeend\", template);\n }\n let tonns = (0, $dIwPZ.findAll)(/[- ](\\d{1,3}) [t\u0442]\\.\\n[a-zA-Z\u0430-\u044f\u0410-\u042f]+: (\\d{1,3}) [t\u0442]/, document.querySelectorAll(\"#tableDiv\")[0].querySelector(\" table > tbody > tr:nth-child(2) > td\").innerText);\n let maxCapacity = tonns[0][1] - 0;\n let currentCapacity = tonns[0][2] - 0;\n if (currentCapacity === 0 && (0, $dIwPZ.get)(\"show_autofill_options\", true)) {\n target_td.insertAdjacentHTML(\"beforeend\", `\n <div id=\"fill_container\">\n <div id=\"fill_result\" style=\"display: none; flex-direction: column; align-items: center\">\n <div><img src=\"https://hwm.events/img/shiploading.gif\" width=\"300\"></div>\n <div><p><b>${$1af37b4d2518eafd$var$allTexts.get(\"fill_process\")}</b></p></div>\n </div>\n <div id=\"fill_options\" style=\"display: flex; flex-direction: column; align-items: center\">\n <div id=\"fill_max\" class=\"home_button2 btn_hover2\" style=\"width: 80%; margin-bottom: 10px\">${$1af37b4d2518eafd$var$allTexts.get(\"fill_max\")}</div>\n <div id=\"fill_maxOff5\" class=\"home_button2 btn_hover2\" style=\"width: 80%;\">${$1af37b4d2518eafd$var$allTexts.get(\"fill_maxoff5\")}</div>\n </div>\n </div>\n `);\n async function fillShip(itemsForCapacity) {\n (0, $dIwPZ.$)(`fill_result`).style.display = \"flex\";\n (0, $dIwPZ.$)(`fill_options`).remove();\n (0, $dIwPZ.$)(`items_container`)?.remove();\n for (const item of itemsForCapacity){\n let count = item[1];\n let res_id = itemsMap[item[0]].res_id;\n let formData = new FormData();\n formData.append(\"action\", \"load\");\n formData.append(\"buy_cnt\", count);\n formData.append(\"res_id\", res_id);\n formData.append(\"sign\", (0, $dIwPZ.my_sign));\n await (0, $aqxxv.doPost)(`/pirate_event.php`, formData, true);\n }\n }\n (0, $dIwPZ.$)(`fill_max`).addEventListener(\"click\", async ()=>{\n await fillShip(getItemsForCapacity(items, maxCapacity));\n setTimeout(()=>location.reload(), 500);\n });\n (0, $dIwPZ.$)(`fill_maxOff5`).addEventListener(\"click\", async ()=>{\n await fillShip(getItemsForCapacity(items, maxCapacity - 5));\n setTimeout(()=>location.reload(), 500);\n });\n }\n (0, $jWJKf.eventHelperSettings)(target_td, (container)=>{\n (0, $jWJKf.setSettings)(\"auto_return_after_battle\", $1af37b4d2518eafd$var$allTexts.get(\"auto_return_after_battle\"), container);\n (0, $jWJKf.setSettings)(\"show_autofill_options\", $1af37b4d2518eafd$var$allTexts.get(\"show_autofill_options\"), container);\n (0, $jWJKf.setSettings)(\"sort_products\", $1af37b4d2518eafd$var$allTexts.get(\"sort_products\"), container);\n (0, $jWJKf.setSettings)(\"show_event_timer\", $1af37b4d2518eafd$var$allTexts.get(\"show_event_timer\"), container);\n (0, $jWJKf.setSettings)(\"show_ship_available_alert\", $1af37b4d2518eafd$var$allTexts.get(\"show_ship_available_alert\"), container);\n });\n }\n function getItemsForCapacity(items, target) {\n const lookup = Array.apply(null, Array(target + 1)).map(()=>{\n return {\n items: [],\n totalProfit: 0\n };\n });\n for(let i = 0; i <= target; i++)for(let j = 0; j < items.length; j++){\n if (items[j].weight <= i) {\n if (lookup[i].totalProfit < lookup[i - items[j].weight].totalProfit + items[j].profit) {\n let newItems = JSON.parse(JSON.stringify(lookup[i - items[j].weight].items));\n newItems.push(items[j]);\n lookup[i].items = newItems;\n lookup[i].totalProfit = lookup[i - items[j].weight].totalProfit + items[j].profit;\n }\n }\n }\n return Object.entries((0, $dIwPZ.groupByKey)(lookup[target].items, \"name\")).map(([key, value])=>[\n key,\n value.length\n ]);\n }\n if (location.href.includes(\"pirate_land\")) {\n if ((0, $dIwPZ.get)(\"auto_return_after_battle\", true)) document.querySelector(\"input[type=submit]\").click();\n }\n function getPirateEventTemplate(items) {\n let final_str = `\n <style>\n .items-container {\n display: flex;\n flex-direction: column;\n }\n .items-row {\n display: flex;\n }\n .item-itself {\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .item-itself:nth-child(1) {\n width: 15%;\n }\n .item-itself:nth-child(2) {\n width: 20%;\n }\n .item-itself:nth-child(3) {\n width: 11%;\n }\n .item-itself:nth-child(4) {\n width: 27%;\n }\n .item-itself:nth-child(5) {\n width: 27%;\n }\n \n </style>\n <div class=\"items-container\" id=\"items_container\">\n <div class=\"items-row\">\n <div class=\"item-itself\">${$1af37b4d2518eafd$var$allTexts.get(\"item\")}</div>\n <div class=\"item-itself\">${$1af37b4d2518eafd$var$allTexts.get(\"profit\")}</div>\n <div class=\"item-itself\">${$1af37b4d2518eafd$var$allTexts.get(\"weight\")}</div>\n <div class=\"item-itself\">${$1af37b4d2518eafd$var$allTexts.get(\"prices\")}</div>\n <div class=\"item-itself\">${$1af37b4d2518eafd$var$allTexts.get(\"buy\")}</div>\n </div>`;\n items.forEach((item)=>{\n final_str += `\n <div class=\"items-row\">\n <div class=\"item-itself\"><img src=\"${item.name}\" height=\"48\" alt=\"icon\"></div>\n <div class=\"item-itself\">${item.opt_price.toFixed(2)}</div>\n <div class=\"item-itself\">${item.weight}</div>\n <div class=\"item-itself\">${item.buy_price}->${item.sell_price}</div>\n <div class=\"item-itself\">${item.buy_form.toString().replaceAll(\"\u041f\u043e\u0433\u0440\u0443\u0437\u0438\u0442\u044c\", \"\u041a\u0443\u043f\u0438\u0442\u044c\").replaceAll(\"Load\", \"Buy\")}</div>\n </div>`;\n });\n return final_str + `</div>`;\n }\n if (location.href.includes(\"pirate_self_event.\")) {\n (0, $8l3id.setLeaderboard)(Array.from(document.querySelectorAll('table[width=\"100%\"][align=\"left\"]')).slice(-1)[0].previousElementSibling, \"afterbegin\", false, true);\n if ((0, $dIwPZ.get)(\"show_event_timer\", true)) (0, $ao0pt.setTimer)(Array.from(document.querySelectorAll(\".global_container_block_header\")).at(1));\n if ((0, $dIwPZ.get)(\"show_top_clan_attempts\", true)) (0, $8l3id.setTopClanAttempts)(Array.from(document.querySelectorAll(\".global_container_block\")[0].getElementsByTagName(\"table\")).at(-1));\n let newScript = document.createElement(\"script\");\n newScript.setAttribute(\"src\", \"https://cdn.jsdelivr.net/npm/chart.js\");\n document.head.appendChild(newScript);\n }\n if (location.href.includes(\"pirate_self_event_set\")) {\n let availableSilver = parseInt(document.body.innerText.match(/(\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u0441\u0435\u0440\u0435\u0431\u0440\u0430|Silver available): (\\d{0,3},?\\d{1,3})/)[2].replace(\",\", \"\"));\n Array.from(document.getElementsByClassName(\"pirate_self_table_padding\")).forEach((table)=>{\n table.style.position = \"unset\";\n table.parentElement.style.height = \"\";\n });\n Array.from(document.getElementsByClassName(\"pirate_self_table_padding\")[1].getElementsByTagName(\"tr\")).filter((elem)=>elem.innerHTML.includes(\"cre_creature\")).forEach((elem, index)=>{\n let submit = elem.querySelector(\"div[id^=but]\");\n if (submit) {\n let name = submit.getAttribute(\"buystr\").match(/mid=([a-zA-Z0-9_-]+)/)[1];\n let price = parseInt(submit.getAttribute(\"buystr\").match(/price=(\\d{1,6})/)[1]);\n let maxAmount = parseInt(elem.innerHTML.match(/(\u041c\u0430\u043a\u0441|Max)\\. (\\d{1,3})/)[2]);\n let currentAmount = 0;\n let currentHire = Array.from(document.querySelector(\".pirate_self_recruit_block_outside\").children[0].getElementsByTagName(\"tr\")).filter((elem)=>elem.innerHTML.includes(\"cre_creature\")).filter((elem)=>elem.innerHTML.includes(`=${name}\"`));\n if (currentHire.length > 0) currentAmount = parseInt(currentHire[0].querySelector(\".cre_creature\").innerText);\n let possibleAmount = maxAmount - currentAmount;\n possibleAmount = Math.min(parseInt(availableSilver / price), possibleAmount);\n let allSubmit = submit.cloneNode(true);\n allSubmit.innerText = $1af37b4d2518eafd$var$allTexts.get(\"hire_all\");\n allSubmit.id = `hire_all_${index}`;\n allSubmit.setAttribute(\"style\", \"\");\n allSubmit.setAttribute(\"onclick\", `location=\"pirate_self_event_set.php?${submit.getAttribute(\"buystr\")}&cnt=${possibleAmount}\"`);\n submit.insertAdjacentHTML(\"afterend\", allSubmit.outerHTML);\n }\n });\n }\n}\n\n});\n\nparcelRequire.register(\"cyF3r\", function(module, exports) {\n\n$parcel$export(module.exports, \"default\", () => $92488199d9697845$export$2e2bcd8739ae039);\n\nvar $8l3id = parcelRequire(\"8l3id\");\n\nvar $dIwPZ = parcelRequire(\"dIwPZ\");\nfunction $92488199d9697845$export$2e2bcd8739ae039() {\n if (location.href.includes(\"tj_event2\")) {\n document.querySelector(\".tj_rating\").previousElementSibling.remove();\n (0, $8l3id.setLeaderboard)(document.querySelector(\".tj_rating\").parentElement);\n let myEventPosition = parseInt(Array.from(document.querySelectorAll('[width=\"50%\"]')[0].getElementsByTagName(\"tr\")).find((elem)=>elem.innerHTML.includes((0, $dIwPZ.pl_id))).firstElementChild.innerText);\n document.querySelectorAll('[width=\"400\"]')[0].insertAdjacentHTML(\"beforeend\", `<br><b>\u041c\u0435\u0441\u0442\u043e: ${myEventPosition}</b>`);\n }\n}\n\n});\n\nparcelRequire.register(\"bUtSC\", function(module, exports) {\n\n$parcel$export(module.exports, \"default\", () => $8abc1a37aa4fbccb$export$2e2bcd8739ae039);\n\nvar $dIwPZ = parcelRequire(\"dIwPZ\");\n\nvar $aqxxv = parcelRequire(\"aqxxv\");\n\nvar $8l3id = parcelRequire(\"8l3id\");\n\nvar $ao0pt = parcelRequire(\"ao0pt\");\nasync function $8abc1a37aa4fbccb$export$2e2bcd8739ae039() {\n let loadStarted = false;\n let maxPages = 50;\n let pageCount = 0;\n let battleCount = 0;\n if (location.href.includes(\"tj_single.\")) {\n (0, $ao0pt.setTimer)(document.querySelector(\".global_container_block_header\"));\n (0, $8l3id.setLeaderboard)(Array.from(document.querySelector(\".tj_left_div\").getElementsByTagName(\"center\")).at(-1));\n mainTJSolo();\n }\n if (location.href.includes(\"tj_single_set\")) {\n let megas = {};\n Array.from(document.querySelectorAll(\"a\")).filter((a)=>a.href.includes(\"name=mega\")).forEach((a)=>megas[a.href] = \"\");\n let all_megas = await (0, $aqxxv.doPost)(\"getPortalMegaCreatures\", JSON.stringify(megas));\n let filtered = {};\n Object.entries(all_megas).map((entry)=>[\n entry[0].split(\"/\").at(-1),\n entry[1]\n ]).forEach((entry)=>filtered[entry[0]] = entry[1]);\n Array.from(document.querySelectorAll(\".tj_block\")).at(-1).insertAdjacentHTML(\"afterend\", `<div class=\"tj_block\" style=\"width: 100%; margin-bottom: 1em;margin-top:1em;\">\n <div class=\"global_table_div_bg\"></div>\n <div class=\"tj_inside_div\">${Object.entries(filtered).sort((a, b)=>a[1].localeCompare(b[1])).reduce((prev, [href, text])=>{\n return prev + `<div style=\"font-size: 16px; text-align: center;\"><a href=\"/${href}\">${text}</a></div>`;\n }, \"\")}</div>\n </div>\n `);\n }\n function mainTJSolo() {\n Array.from(document.querySelectorAll(\".tj_inside_div\")).at(-1).insertAdjacentHTML(\"beforeend\", createTJSoloTemplate());\n (0, $dIwPZ.$)(`statbut`).addEventListener(\"click\", ()=>{\n processCollectBattles();\n });\n }\n function createTJSoloTemplate() {\n return `\n <div class=\"wrapperStat\">\n <div><div id=\"statbut\" class=\"home_button2 btn_hover2\">\u041f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0431\u043e\u0438 \u0441 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0430\u043c\u0438</div></div>\n <div id=\"progress\" class=\"progress\"></div>\n </div>\n `;\n }\n function processCollectBattles() {\n if (!loadStarted) {\n collectBattles();\n loadStarted = true;\n document.getElementById(\"statbut\").innerHTML = \"\u041f\u043e\u0438\u0441\u043a \u0431\u043e\u0435\u0432...\";\n }\n }\n async function collectBattles() {\n if (pageCount < maxPages) {\n let doc = await (0, $aqxxv.doGet)(`/pl_warlog.php?id=${(0, $dIwPZ.pl_id)}&page=${pageCount}`, true);\n pageCount++;\n processResponse(doc);\n }\n }\n function processResponse(doc) {\n let arr = Array.from(doc.querySelectorAll(\".global_a_hover\")).slice(-1)[0].innerHTML.toString().split(\"\\n\");\n arr = arr.slice(2, 42);\n for(let i = 0; i < arr.length; i++){\n let currwarid = arr[i].match(/warid=(\\d{10})/)[1] - 0;\n if (/--117--/.test(arr[i])) {\n if (/<b>/.test(arr[i].split(\"vs\")[1])) continue;\n battleCount++;\n document.getElementById(\"progress\").innerHTML = \"\u041d\u0430\u0439\u0434\u0435\u043d\u043e \u0431\u043e\u0435\u0432: \" + battleCount.toString();\n }\n if (currwarid <= 1387305701) {\n let wins = document.querySelector(\".tj_hide_top_div > div > b:nth-child(6)\").textContent - 0;\n document.getElementById(\"progress\").innerHTML = \"\u041d\u0430\u0439\u0434\u0435\u043d\u043e \u0431\u043e\u0435\u0432: \" + battleCount.toString() + \" \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0431\u043e\u0435\u0432:\" + (wins * 7 + 20 - battleCount).toString();\n document.getElementById(\"statbut\").remove();\n return;\n }\n }\n collectBattles();\n }\n}\n\n});\n\nparcelRequire.register(\"d44k3\", function(module, exports) {\n\n$parcel$export(module.exports, \"default\", () => $982f006e132d5185$export$2e2bcd8739ae039);\n\nvar $dIwPZ = parcelRequire(\"dIwPZ\");\n\nvar $ao0pt = parcelRequire(\"ao0pt\");\n\nvar $6rIzz = parcelRequire(\"6rIzz\");\n\nvar $8l3id = parcelRequire(\"8l3id\");\n\nvar $aqxxv = parcelRequire(\"aqxxv\");\n\nvar $eTbLz = parcelRequire(\"eTbLz\");\n\nvar $jWJKf = parcelRequire(\"jWJKf\");\n\nvar $afXBq = parcelRequire(\"afXBq\");\nfunction $982f006e132d5185$var$getAllTexts() {\n let texts = new (0, $afXBq.LocalizedTextMap)();\n texts.addText(new (0, $afXBq.LocalizedText)(\"auto_send_ffa_event\", \"Send battles from the FFA event to the service automatically\", \"\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0431\u043e\u0438 \u0438\u0437 \u041a\u0411\u041e \u0438\u0432\u0435\u043d\u0442\u0430 \u0432 \u0441\u0435\u0440\u0432\u0438\u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\", \"\u0412\u0456\u0434\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u0438 \u0431\u043e\u0457 \u0437 \u041a\u0411\u041e \u0406\u0432\u0435\u043d\u0442\u0443 \u0432 \u0441\u0435\u0440\u0432\u0456\u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u043d\u043e\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"only_clan_visibility\", \"My battles are only available to the clan\", \"\u041c\u043e\u0438 \u0431\u043e\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043a\u043b\u0430\u043d\u0430\", \"\u041c\u043e\u0457 \u0431\u043e\u0457 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0456 \u043b\u0438\u0448\u0435 \u0434\u043b\u044f \u043a\u043b\u0430\u043d\u0443\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"collapse_event_desc\", \"Always collapse battle descriptions\", \"\u0412\u0441\u0435\u0433\u0434\u0430 \u0441\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0431\u043e\u0435\u0432\", \"\u0417\u0430\u0432\u0436\u0434\u0438 \u0437\u0433\u043e\u0440\u0442\u0430\u0442\u0438 \u043e\u043f\u0438\u0441\u0438 \u0431\u043e\u0457\u0432\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"return_to_prev_level\", \"Return to an unfinished level\", \"\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043d\u0430 \u043d\u0435\u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c\", \"\u041f\u043e\u0432\u0435\u0440\u0442\u0430\u0442\u0438 \u043d\u0430 \u043d\u0435\u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0439 \u0440\u0456\u0432\u0435\u043d\u044c\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"show_creature_calculator\", \"Show recruit count calculator\", \"\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440 \u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u0438\", \"\u041f\u043e\u043a\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440 \u0447\u0438\u0441\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0456\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"current_amount\", \"Current number of creatures (including additional %)\", \"\u0422\u0435\u043a\u0443\u0449\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432 (\u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 % \u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u0438)\", \"\u041f\u043e\u0442\u043e\u0447\u043d\u0430 \u043a\u0456\u043b\u044c\u043a\u0456\u0441\u0442\u044c \u0456\u0441\u0442\u043e\u0442 (\u0437 \u0443\u0440\u0430\u0445\u0443\u0432\u0430\u043d\u043d\u044f\u043c \u0434\u043e\u0434\u0430\u0442\u043a\u043e\u0432\u0438\u0445 % \u0447\u0438\u0441\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0456)\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"new_amount\", \"Number of creatures when added\", \"\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432 \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438\", \"\u041a\u0456\u043b\u044c\u043a\u0456\u0441\u0442\u044c \u0456\u0441\u0442\u043e\u0442 \u043f\u0440\u0438 \u0434\u043e\u0434\u0430\u0432\u0430\u043d\u043d\u0456\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"show_event_timer\", \"Show time until the end of the event\", \"\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u0438\u0432\u0435\u043d\u0442\u0430\", \"\u041f\u043e\u043a\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u0447\u0430\u0441 \u0434\u043e \u043a\u0456\u043d\u0446\u044f \u0456\u0432\u0435\u043d\u0442\u0430\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"show_top_clan_attempts\", \"Show remaining attempts for TOP3 clans\", \"\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u0443 \u0422\u041e\u041f3 \u043a\u043b\u0430\u043d\u043e\u0432\", \"\u041f\u043e\u043a\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u0441\u043f\u0440\u043e\u0431\u0438, \u0449\u043e \u0437\u0430\u043b\u0438\u0448\u0438\u043b\u0438\u0441\u044f, \u0443 \u0422\u041e\u041f3 \u043a\u043b\u0430\u043d\u0456\u0432\"));\n return texts;\n}\nlet $982f006e132d5185$var$allTexts = $982f006e132d5185$var$getAllTexts();\nasync function $982f006e132d5185$export$2e2bcd8739ae039() {\n if (/(ambush_single_event|map_hero_event)/.test(location.href)) {\n (0, $jWJKf.eventHelperSettings)(document.querySelector(\"#map_event_stats\"), (container)=>{\n (0, $jWJKf.setSettings)(\"auto_send_ffa_event\", $982f006e132d5185$var$allTexts.get(\"auto_send_ffa_event\"), container);\n (0, $jWJKf.setSettings)(\"only_clan_visibility\", $982f006e132d5185$var$allTexts.get(\"only_clan_visibility\"), container, false);\n (0, $jWJKf.setSettings)(\"collapse_event_desc\", $982f006e132d5185$var$allTexts.get(\"collapse_event_desc\"), container, false);\n (0, $jWJKf.setSettings)(\"return_to_prev_level\", $982f006e132d5185$var$allTexts.get(\"return_to_prev_level\"), container, false);\n (0, $jWJKf.setSettings)(\"show_creature_calculator\", $982f006e132d5185$var$allTexts.get(\"show_creature_calculator\"), container);\n (0, $jWJKf.setSettings)(\"show_top_clan_attempts\", $982f006e132d5185$var$allTexts.get(\"show_top_clan_attempts\"), container);\n (0, $jWJKf.setSettings)(\"show_event_timer\", $982f006e132d5185$var$allTexts.get(\"show_event_timer\"), container);\n }, \"afterbegin\");\n (0, $dIwPZ.set)(\"eh_current_level\", null);\n if ((0, $dIwPZ.get)(\"show_event_timer\", true)) (0, $ao0pt.setTimer)(document.querySelector(\".global_container_block_header\"));\n (0, $ao0pt.collapseEventDesc)();\n interceptButtons();\n document.querySelector(\".new_event_map\").insertAdjacentHTML(\"afterend\", `<div id=\"battle_examples\"></div>`);\n (0, $6rIzz.getEventBattles)((0, $dIwPZ.$)(`battle_examples`)).then((battles)=>{\n trySetCreatureAmount(battles[\"AFS\"]);\n trySetCreatureAmount(battles[\"FFA\"]);\n });\n (0, $8l3id.setLeaderboard)(Array.from(Array.from(document.querySelectorAll(\".global_container_block\")).at(-1).children[0].getElementsByTagName(\"center\")).at(-1));\n if ((0, $dIwPZ.get)(\"show_top_clan_attempts\", true)) (0, $8l3id.setTopClanAttempts)(Array.from(Array.from(document.querySelectorAll(\".global_container_block\")).at(-1).getElementsByTagName(\"table\")).at(-1));\n showCalculator();\n }\n function interceptButtons() {\n let buttons = Array.from(document.querySelectorAll(\"input[id^=ne_attack_button]\"));\n let available = buttons.filter((x)=>!x.disabled).length;\n buttons.forEach((button, index)=>{\n button.addEventListener(\"mousedown\", ()=>{\n (0, $dIwPZ.set)(\"event_battle_side\", (button.parentElement.querySelector(\"[name='variant']\").value - 1) % 2);\n (0, $dIwPZ.set)(\"eh_current_level\", [\n (0, $ao0pt.getCurrentLevel)(),\n available\n ]);\n });\n });\n }\n async function showCalculator() {\n if ((0, $dIwPZ.get)(\"show_creature_calculator\", true)) {\n let doc = await (0, $aqxxv.doGet)(`/pl_info.php?id=${(0, $dIwPZ.pl_id)}`, true);\n let creaturesData = [];\n Array.from(doc.getElementsByClassName(\"cre_creature72\")).forEach((creature)=>{\n let creatureInfo = {\n \"rarity\": \"1\"\n };\n if (creature.getElementsByTagName(\"img\")[0].src.includes(\"empty\")) return;\n creatureInfo.portrait = creature.getElementsByTagName(\"img\")[0].src.match(/portraits\\/(\\w+)_?anip40/)[1] + \"ani\";\n creatureInfo.amount = creature.getElementsByClassName(\"cre_amount72\")[0].innerText;\n creaturesData.push(creatureInfo);\n });\n let creaturesMultiplier = Array.from(document.querySelectorAll(\"div.show_hint\")).at(-1).querySelector(\"div > div:nth-child(2) > b\").innerText;\n creaturesMultiplier = creaturesMultiplier.match(/\\d{1,3}/)[0] - 0;\n document.querySelector(\"#map_event_stats\").insertAdjacentHTML(\"beforeend\", `\n <div id=\"ambush-creatures\" style=\"display: flex; flex-direction: column; align-items: center\">\n <div>${$982f006e132d5185$var$allTexts.get(\"current_amount\")}</div><div id=\"current-ambush-creatures\"></div><br>\n <div>${$982f006e132d5185$var$allTexts.get(\"new_amount\")} +<input type=\"text\" id=\"your-creatures-multiplier\" style=\"width: 30px;\" value=\"1\">% <div class=\"btn-gradient blue\" id=\"add_percent\">+1%</div></div>\n <div id=\"future-ambush-creatures\"></div><br>\n </div>`);\n (0, $dIwPZ.$)(\"add_percent\").addEventListener(\"click\", ()=>{\n let currentMultiplierElement = (0, $dIwPZ.$)(`your-creatures-multiplier`);\n let currentMultiplier = currentMultiplierElement.value - 0;\n currentMultiplierElement.value = currentMultiplier + 1;\n applyMultiplier(creaturesData, creaturesMultiplier);\n });\n creaturesData.forEach((creature)=>{\n let defaultAmount = creature.amount;\n (0, $dIwPZ.$)(`current-ambush-creatures`).insertAdjacentHTML(\"beforeend\", (0, $eTbLz.getNewCreatureIcon)(creature.portrait, Math.round(defaultAmount * (1 + 0.01 * creaturesMultiplier))));\n (0, $dIwPZ.$)(`future-ambush-creatures`).insertAdjacentHTML(\"beforeend\", (0, $eTbLz.getNewCreatureIcon)(creature.portrait, Math.round(defaultAmount * (1 + 0.01 * (creaturesMultiplier + 1)))));\n });\n (0, $dIwPZ.$)(`your-creatures-multiplier`).addEventListener(\"input\", ()=>{\n applyMultiplier(creaturesData, creaturesMultiplier);\n });\n }\n }\n function applyMultiplier(creaturesData, creaturesMultiplier) {\n (0, $dIwPZ.$)(`future-ambush-creatures`).innerHTML = \"\";\n let newMultiplier = (0, $dIwPZ.$)(`your-creatures-multiplier`).value - 0;\n creaturesData.forEach((creature)=>{\n (0, $dIwPZ.$)(`future-ambush-creatures`).insertAdjacentHTML(\"beforeend\", (0, $eTbLz.getNewCreatureIcon)(creature.portrait, Math.round(creature.amount * (1 + 0.01 * (creaturesMultiplier + newMultiplier)))));\n });\n }\n function trySetCreatureAmount(battles) {}\n}\n\n});\n\nparcelRequire.register(\"aXIev\", function(module, exports) {\n\n$parcel$export(module.exports, \"default\", () => $7fb1b9d69ac2df62$export$2e2bcd8739ae039);\n\nvar $jWJKf = parcelRequire(\"jWJKf\");\n\nvar $ao0pt = parcelRequire(\"ao0pt\");\n\nvar $dIwPZ = parcelRequire(\"dIwPZ\");\n\nvar $aqxxv = parcelRequire(\"aqxxv\");\nfunction $7fb1b9d69ac2df62$export$2e2bcd8739ae039() {\n let battles = [];\n let currentHeroFaction;\n let classCounter = 0;\n let result = ``;\n let isForStat = true;\n if (location.href.includes(\"hunting_event\")) {\n (0, $jWJKf.eventHelperSettings)(document.querySelector(\".new_event_map\"), (container)=>{\n (0, $jWJKf.setSettings)(\"auto_send_hunt_event_battles\", \"\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0431\u043e\u0438 \u0438\u0437 \u0441\u0435\u0437\u043e\u043d\u0430 \u043e\u0445\u043e\u0442\u044b \u0432 \u0441\u0435\u0440\u0432\u0438\u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\", container);\n }, \"afterend\");\n // Array.from(document.querySelectorAll(`td[width=\"300\"]`)).slice(-1)[0].insertAdjacentHTML(\"beforeend\",\n // `<div style=\"max-width: 240px\">\u0410\u0432\u0442\u043e\u0440 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 <a href=\"/pl_info.php?id=7197821\"><b>\u0413\u0440\u043e\u0437\u0430_\u0413\u0412\u0414</b></a> \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0434 \u043f\u043e\u0434\u0430\u0440\u043a\u0443 \u0432 \u0432\u0438\u0434\u0435 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u0430 \u043b\u0435\u0441\u0430 \ud83d\ude0a</div>`)\n mainHuntEvent();\n getCurrentFaction();\n let huntlvlinfo = (0, $dIwPZ.get)(\"huntv2lvl\" + (0, $ao0pt.getCurrentLevel)(), {});\n if (huntlvlinfo && Date.now() - huntlvlinfo.time < 1209600000) {\n result = huntlvlinfo.info;\n updateHuntStatBody();\n setShowExampleListeners();\n (0, $dIwPZ.allClasses).forEach((clazz)=>{\n document.getElementById(`fc${clazz[0]}-${clazz[2]}`).getElementsByTagName(\"img\")[0].addEventListener(\"click\", async ()=>{\n isForStat = false;\n await changeFactionAndClass(clazz[4]);\n location.reload();\n });\n });\n }\n }\n function setShowExampleListeners() {\n Array.from(document.getElementsByClassName(\"faction-hunt-data\")).forEach((enemy, index)=>{\n let portraits = (0, $dIwPZ.findAll)(/portraits\\/([a-zA-Z0-9_-]+)p33/, enemy.innerHTML).map((item)=>item[1]);\n let amounts = Array.from(enemy.querySelectorAll(\"#add_now_count\")).map((elem)=>parseInt(elem.innerText));\n if (amounts.length < portraits.length) amounts.unshift(1);\n portraits.sort((a, b)=>a.localeCompare(b));\n amounts.sort((a, b)=>a - b);\n enemy.insertAdjacentHTML(\"beforeend\", `\n <div style=\"margin: 10px\"><div id=\"load_examples_${index}\" class=\"home_button2 btn_hover2\" style=\"padding: 2px 4px\">\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u044b</div></div>\n `);\n (0, $dIwPZ.$)(`load_examples_${index}`).addEventListener(\"click\", async (e)=>{\n e.target.remove();\n let request = [\n portraits.join(\"|\"),\n amounts.join(\"|\")\n ].join(\"~\");\n const eventBattlesURL = `getFactionEventBattles?enemy_id=${encodeURIComponent(request)}&token=${(0, $dIwPZ.get)(\"hwm_events_token\", \"\")}`;\n battles = await (0, $aqxxv.doGet)(eventBattlesURL, false);\n processFactionEventBattles(enemy);\n });\n });\n }\n function processFactionEventBattles(where = document.body) {\n where.insertAdjacentHTML(\"afterend\", `<div>${getBattlesTemplate(battles)}</div>`);\n }\n function getBattlesTemplate(battles) {\n let result = \"\";\n result += `<div style=\"text-align: center; font-size: 14px; margin-top: 10px\"><b>\u0422\u0432\u043e\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c</b></div>`;\n let my_lvl_battles = battles.filter((battle)=>battle[\"hero_lvl\"] === (0, $dIwPZ.pl_lvl));\n result += factionBattlesToHTML(my_lvl_battles);\n result += `<div style=\"text-align: center; font-size: 14px\"><b>\u0414\u0440\u0443\u0433\u0438\u0435 \u0443\u0440\u043e\u0432\u043d\u0438</b></div>`;\n let not_my_lvl_battles = battles.filter((battle)=>battle[\"hero_lvl\"] !== (0, $dIwPZ.pl_lvl));\n result += factionBattlesToHTML(not_my_lvl_battles);\n return result;\n }\n function factionBattlesToHTML(battles) {\n if (battles.length > 0) {\n battles.sort((a, b)=>a.nickname.localeCompare(b.nickname));\n return battles.reduce((prev, curr, index)=>{\n return prev + `\n <div style=\"display: flex; justify-content: center; padding: 1px;\">\n <div>${index + 1}.\u00a0</div>\n <div style=\"text-align: center\"> ${curr[\"nickname\"]} [${curr[\"hero_lvl\"]}]</div>\n <div>\u00a0<a target=\"_blank\" href=\"/warlog.php?warid=${curr[\"battle_id\"]}&show_for_all=${curr[\"battle_secret\"]}\">\u0411\u043e\u0439</a></div>\n <div>\u00a0\u00a0(${curr[\"enemy_id\"].split(\"~\")[1]})</div>\n </div>\n `;\n }, \"\");\n } else return `<div style=\"text-align: center;\"><b>\u043f\u0443\u0441\u0442\u043e</b></div>`;\n }\n async function getCurrentFaction() {\n let plResponse = await (0, $aqxxv.doGet)(`/pl_info.php?id=${(0, $dIwPZ.pl_id)}`, true);\n let temp = currentHeroFaction;\n let factionImg = null;\n Array.from(plResponse.getElementsByTagName(\"img\")).forEach((img)=>{\n if (img.src.includes(\"i/f/\")) factionImg = img.src;\n });\n for(let i = 0; i < (0, $dIwPZ.allClasses).length; i++)if (factionImg.indexOf((0, $dIwPZ.allClasses)[i][3]) > 0) {\n currentHeroFaction = (0, $dIwPZ.allClasses)[i][4];\n break;\n }\n if (!!temp) {\n if (temp !== currentHeroFaction) {\n currentHeroFaction = temp;\n await changeFactionAndClass(temp);\n getCurrentFaction();\n } else location.reload();\n }\n }\n function mainHuntEvent() {\n Array.from(document.getElementsByClassName(\"new_event_map\")).slice(-1)[0].insertAdjacentHTML(\"afterend\", `\n <div class=\"wrapper\">\n <div style=\"width: 75%\">\n <div class=\"wrapperStat\">\n <div id=\"show_current_class_examples\" class=\"home_button2 btn_hover2\" style=\"width: 200px;\">\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u044b<br>\u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430</div>\n <div id=\"current_class_examples\"></div>\n <div id=\"statbut\" class=\"home_button2 btn_hover2\" style=\"width: 200px;\">\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043e\u0445\u043e\u0442\u044b<br>\u0434\u0440\u0443\u0433\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432</div>\n <div id=\"progress\" class=\"progress\"></div>\n </div>\n <div id=\"statbody\">\n </div>\n </div>\n </div>\n `);\n (0, $dIwPZ.$)(`statbut`).addEventListener(\"click\", ()=>{\n processCollectHunts();\n });\n (0, $dIwPZ.$)(`show_current_class_examples`).addEventListener(\"click\", async (e)=>{\n let enemy = document.querySelector(\".hunt_result_attack > div:nth-child(2) > div > div > div:last-child > div:nth-child(4)\");\n let portraits = (0, $dIwPZ.findAll)(/portraits\\/([a-zA-Z0-9_-]+)p33/, enemy.innerHTML).map((item)=>item[1]);\n let amounts = Array.from(enemy.querySelectorAll(\"#add_now_count\")).map((elem)=>parseInt(elem.innerText));\n if (amounts.length < portraits.length) amounts.unshift(1);\n portraits.sort((a, b)=>a.localeCompare(b));\n amounts.sort((a, b)=>a - b);\n e.target.remove();\n let request = [\n portraits.join(\"|\"),\n amounts.join(\"|\")\n ].join(\"~\");\n const eventBattlesURL = `getFactionEventBattles?enemy_id=${encodeURIComponent(request)}&token=${(0, $dIwPZ.get)(\"hwm_events_token\", \"\")}`;\n battles = await (0, $aqxxv.doGet)(eventBattlesURL);\n processFactionEventBattles((0, $dIwPZ.$)(`current_class_examples`));\n });\n }\n function getFactionName(fr) {\n for(let i = 0; i < (0, $dIwPZ.allClasses).length; i++){\n if ((0, $dIwPZ.allClasses)[i][4] === fr) return (0, $dIwPZ.allClasses)[i][1];\n }\n }\n async function changeFactionAndClass(fr) {\n await (0, $aqxxv.doGet)(`/castle.php?change_clr_to=${fr}&sign=${(0, $dIwPZ.my_sign)}`, true);\n }\n function processCollectHunts() {\n result = \"\";\n getClassHuntData();\n }\n async function getClassHuntData() {\n if (classCounter === (0, $dIwPZ.allClasses).length) {\n classCounter = 0;\n document.getElementById(\"statbut\").innerHTML = \"Done\";\n isForStat = false;\n (0, $dIwPZ.set)(\"huntv2lvl\" + (0, $ao0pt.getCurrentLevel)(), {\n \"time\": Date.now(),\n \"info\": result\n });\n await changeFactionAndClass(currentHeroFaction);\n getCurrentFaction();\n return;\n }\n document.getElementById(\"statbut\").innerHTML = \"Processing...\";\n document.getElementById(\"progress\").innerHTML = \"\u0422\u0435\u043a\u0443\u0449\u0430\u044f \u0444\u0440\u0430\u043a\u0446\u0438\u044f - \" + getFactionName((0, $dIwPZ.allClasses)[classCounter][4]);\n await changeFactionAndClass((0, $dIwPZ.allClasses)[classCounter][4]);\n let doc = await (0, $aqxxv.doGet)(`/hunting_event.php?sel_level=${(0, $ao0pt.getCurrentLevel)()}`, true);\n processHuntResponse(doc);\n }\n function processHuntResponse(doc) {\n result += `<div class=\"faction-hunt-data\">\n <div class=\"cre_creature\" id=\"fc${(0, $dIwPZ.allClasses)[classCounter][0]}-${(0, $dIwPZ.allClasses)[classCounter][2]}\">\n <img style=\"padding: 10px 0; cursor:pointer;\" src=\"https://${0, $dIwPZ.cdnHost}/i/f/${(0, $dIwPZ.allClasses)[classCounter][3]}?v=1.1\" alt=\"\">\n </div>` + Array.from(doc.querySelector(\".hunt_result_attack > div:nth-child(2) > div > div > div:last-child > div:nth-child(4)\").querySelectorAll(\"div.cre_creature\")).reduce((result, current)=>result + current.outerHTML, \"\") + `</div><br>`;\n updateHuntStatBody();\n window.scrollTo(0, document.body.scrollHeight);\n classCounter++;\n getClassHuntData();\n }\n function updateHuntStatBody() {\n document.getElementById(\"statbody\").innerHTML = result;\n }\n}\n\n});\n\nparcelRequire.register(\"bKNGT\", function(module, exports) {\n\n$parcel$export(module.exports, \"default\", () => $023554caf4f3eb55$export$2e2bcd8739ae039);\n\nvar $dIwPZ = parcelRequire(\"dIwPZ\");\nfunction $023554caf4f3eb55$export$2e2bcd8739ae039() {\n if (location.href.includes(\"war.\") && ((0, $dIwPZ.get)(\"pirate_hunt_custom_ins\", false) || (0, $dIwPZ.get)(\"village_custom_ins\", false) || (0, $dIwPZ.get)(\"faction_custom_ins\", false))) {\n let loadId = setInterval(waitForBattleLoad, 200);\n let startId;\n function waitForBattleLoad() {\n if (!stage[war_scr].setted_atb) return;\n else window.clearInterval(loadId);\n if (btype === 115 || btype === 119 || btype === 144) {\n let customInsertion = (0, $dIwPZ.get)(`insertionData_${btype}${btype === 144 ? defyn : \"\"}`, null);\n createSaveInsButton();\n if (customInsertion) {\n if ((0, $dIwPZ.get)(\"custom_ins_auto\", false)) makeIns(customInsertion);\n else createMakeInsButton(customInsertion);\n }\n startId = setInterval(waitForBattleStart, 200);\n }\n }\n function waitForBattleStart() {\n if (lastturn > -1) {\n window.clearInterval(startId);\n removeSaveInsButton();\n removeMakeInsButton();\n }\n }\n function createMakeInsButton(customInsertion) {\n (0, $dIwPZ.$)(\"right_button\").insertAdjacentHTML(\"beforeend\", `\n <div id=\"custom_make_ins\" class=\"toolbars_img\" style=\"width: 47px;\"><img src=\"https://${(0, $dIwPZ.cdnHost)}/i/combat/btn_autoalignment.png?v=6\" alt=\"\"></div>\n `);\n (0, $dIwPZ.$)(\"custom_make_ins\").addEventListener(\"click\", ()=>{\n makeIns(customInsertion);\n });\n }\n function makeIns(customInsertion) {\n let currentCreatures = stekid.slice(1, stackcount + 1).filter((cre)=>cre !== 0);\n let filteredInsertion = customInsertion.filter((cre)=>currentCreatures.includes(cre[0]));\n currentCreatures.forEach((cre, index)=>{\n if (!filteredInsertion.some((customInsCre)=>customInsCre[0] === cre)) filteredInsertion.push([\n cre,\n steknumber[index + 1],\n 1,\n 1\n ]);\n });\n let insStr = filteredInsertion.map((cre)=>cre.join(\"#\")).join(\"^\") + \"^\";\n stage[war_scr].useinsertion_cre(insStr);\n removeMakeInsButton();\n }\n function createSaveInsButton() {\n (0, $dIwPZ.$)(\"right_button\").insertAdjacentHTML(\"beforeend\", `\n <div id=\"custom_save_ins\" class=\"toolbars_img\" style=\"width: 47px; border-radius: 50%; background: #dcc287;\"><img src=\"https://i.imgur.com/08mNun9.png\" alt=\"\"></div>\n `);\n (0, $dIwPZ.$)(\"custom_save_ins\").addEventListener(\"click\", ()=>{\n let insertionData = [];\n for(let i = 1; i <= stackcount; i++)if (stekx[i] !== -10 && steknumber[i] > 0 && steknumber[i] !== undefined && stekid[i] !== 0 && stekid[i] !== undefined) insertionData.push([\n stekid[i],\n stage[war_scr].obj[i].nownumber,\n stekx[i],\n steky[i]\n ]);\n (0, $dIwPZ.set)(`insertionData_${btype}${btype === 144 ? defyn : \"\"}`, insertionData);\n (0, $dIwPZ.$)(\"custom_save_ins\").innerHTML = `<img src=\"https://cdn2.iconfinder.com/data/icons/flat-ui-icons-24-px/24/checkmark-24-512.png\" alt=\"\"></div>`;\n setTimeout(()=>{\n (0, $dIwPZ.$)(\"custom_save_ins\").innerHTML = `<img src=\"https://i.imgur.com/08mNun9.png\" alt=\"\"></div>`;\n }, 1000);\n });\n }\n function removeSaveInsButton() {\n let button = (0, $dIwPZ.$)(\"custom_save_ins\");\n if (button) button.remove();\n }\n function removeMakeInsButton() {\n let button = (0, $dIwPZ.$)(\"custom_make_ins\");\n if (button) button.remove();\n }\n }\n}\n\n});\n\nparcelRequire.register(\"lBuTJ\", function(module, exports) {\n\n$parcel$export(module.exports, \"default\", () => $fba50557318b4427$export$2e2bcd8739ae039);\n\nvar $jWJKf = parcelRequire(\"jWJKf\");\n\nvar $dIwPZ = parcelRequire(\"dIwPZ\");\nfunction $fba50557318b4427$export$2e2bcd8739ae039() {\n if (location.href.includes(\"pirate_hunt\")) {\n let globalTable = (0, $dIwPZ.$)(`global_table_div4`);\n (0, $jWJKf.eventHelperSettings)(globalTable, (container)=>{\n // setSettings(\"pirate_hunt_event_filter\", \"\u0422\u043e\u043b\u044c\u043a\u043e \u0441 \u043d\u0430\u043f\u0430\u0440\u043d\u0438\u043a\u043e\u043c\", container)\n (0, $jWJKf.setSettings)(\"pirate_hunt_custom_ins\", \"\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0430\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438\", container, false);\n (0, $jWJKf.setSettings)(\"custom_ins_auto\", `\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u0443\u044e \u0440\u0430\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443`, container, false);\n }, \"beforeend\");\n // let partner = get(\"partners\", null)\n // if (get(\"pirate_hunt_event_filter\", true) && partner != null) {\n // print_friends()\n // Array.from(Array.from(document.querySelectorAll(\"select\")).slice(-1)[0].getElementsByTagName(\"option\")).forEach(options => {\n // if (options.value === partner) {\n // options.selected = true\n // }\n // })\n // let inputs = Array.from(document.querySelectorAll(\"input[type=submit]\")).slice(-3)\n // inputs[0].disabled = true\n // Array.from(globalTable.getElementsByTagName(\"tr\")).forEach((tr) => {\n // if (!tr.innerHTML.includes(partner) && (tr.innerText.includes(\"[\u0412\u0441\u0442\u0443\u043f\u0438\u0442\u044c]\") || tr.innerText.includes(\"[\u0412\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043a \u043a\u043b\u0430\u043d\u0443]\"))) {\n // tr.remove()\n // }\n // })\n // }\n }\n}\n\n});\n\nparcelRequire.register(\"ag9Ot\", function(module, exports) {\n\n$parcel$export(module.exports, \"default\", () => $778302ae508a9a72$export$2e2bcd8739ae039);\nparcelRequire(\"dIwPZ\");\nfunction $778302ae508a9a72$export$2e2bcd8739ae039() {\n// let partners = get(\"partners\", null);\n//\n// if (location.href.includes(\"pl_info\")) {\n// let target = document.querySelectorAll(\"td[align=right]\")[1].parentElement;\n// let heroId = new URLSearchParams(window.location.search).get(\"id\");\n// target.insertAdjacentHTML('afterend', `<tr><td id=\"partner-target\" colspan=\"2\" style=\"text-align: center;\"></td></tr>`)\n// if (!partners || partners !== heroId) {\n// setPartner(heroId)\n// } else {\n// removePartner(heroId)\n// }\n// }\n//\n// function setPartner(heroId) {\n// $('partner-target').innerHTML = `\u00a0\u00a0<span id=\"partner-1\" style=\"cursor: pointer; text-decoration: underline\">\u041f\u043e\u043c\u0435\u0442\u0438\u0442\u044c \u043d\u0430\u043f\u0430\u0440\u043d\u0438\u043a\u043e\u043c</span>`\n// $('partner-1').addEventListener('click', () => {\n// partners = heroId\n// set('partners', partners)\n// removePartner(heroId)\n// })\n// }\n//\n// function removePartner(heroId) {\n// $('partner-target').innerHTML = `\u00a0\u00a0<span id=\"partner-1\" style=\"cursor: pointer; text-decoration: underline\">\u0423\u0431\u0440\u0430\u0442\u044c \u0438\u0437 \u043d\u0430\u043f\u0430\u0440\u043d\u0438\u043a\u043e\u0432</span>`\n// $('partner-1').addEventListener('click', () => {\n// partners = null\n// set('partners', partners)\n// setPartner(heroId)\n// })\n// }\n}\n\n});\n\nparcelRequire.register(\"2GRXP\", function(module, exports) {\n\n$parcel$export(module.exports, \"default\", () => $1f595d21b7013d0d$export$2e2bcd8739ae039);\n\nvar $dIwPZ = parcelRequire(\"dIwPZ\");\n\nvar $aqxxv = parcelRequire(\"aqxxv\");\n\nvar $6rIzz = parcelRequire(\"6rIzz\");\nasync function $1f595d21b7013d0d$export$2e2bcd8739ae039() {\n if (location.href.includes(\"war.php\") && ((0, $dIwPZ.get)(\"auto_send_lg\", true) || (0, $dIwPZ.get)(\"auto_send_event_lg\", true) || (0, $dIwPZ.get)(\"auto_send_ffa_event\", true) || (0, $dIwPZ.get)(\"auto_send_faction_event_battles\", true) || (0, $dIwPZ.get)(\"auto_send_rogues_event\", true) || (0, $dIwPZ.get)(\"auto_send_reaping_event\", true) || (0, $dIwPZ.get)(\"auto_send_hunt_event_battles\", true))) {\n let battleData = window.run_all.toString();\n let battleType = battleData.match(/btype\\|(\\d{1,10})/)[1];\n if ([\n \"133\",\n \"135\",\n \"138\",\n \"139\",\n \"140\",\n \"142\",\n \"143\",\n \"144\",\n \"147\",\n \"148\"\n ].includes(battleType)) {\n let battle_id = new URLSearchParams(window.location.search).get(\"warid\");\n let battle_secret = new URLSearchParams(window.location.search).get(\"show_for_all\");\n if (battle_secret == null) {\n let doc = await (0, $aqxxv.doGet)(`/pl_info.php?id=${(0, $dIwPZ.pl_id)}`, true);\n let match = doc.body.innerHTML.match(/show_for_all=(\\w[0-9a-f]{10})/);\n if (match) battle_secret = match[1];\n }\n let startId;\n startId = setInterval(main, 10);\n function main() {\n if (typeof finished !== \"undefined\" && finished || typeof battle_ended !== \"undefined\" && battle_ended) {\n window.clearInterval(startId);\n if ((0, $dIwPZ.get)(\"return_to_prev_level\")) {\n let eh_current_level = (0, $dIwPZ.get)(\"eh_current_level\");\n if (eh_current_level) {\n let leaveBattleButton = (0, $dIwPZ.$)(\"btn_continue_WatchBattle\");\n leaveBattleButton.removeEventListener(\"mouseup\", btn_continue_WatchBattle_onRelease);\n leaveBattleButton.addEventListener(\"mouseup\", ()=>{\n if (eh_current_level[1] === 2 && eh_current_level[0] < 51) location.href = `${document.referrer.split(\"?\")[0]}?sel_level=${eh_current_level[0]}`;\n else location.href = `${document.referrer.split(\"?\")[0]}`;\n });\n }\n }\n if (battleType === \"135\" && (0, $dIwPZ.get)(\"auto_send_lg\", true)) (0, $6rIzz.sendBattle)(battle_id, battle_secret, \"0\");\n else if ((battleType === \"142\" || battleType === \"143\" || battleType === \"138\" || battleType === \"148\") && (0, $dIwPZ.get)(\"auto_send_ffa_event\", true)) {\n let battle_side = (0, $dIwPZ.get)(\"event_battle_side\", -1);\n (0, $dIwPZ.set)(\"event_battle_side\", -1);\n (0, $6rIzz.sendBattle)(battle_id, battle_secret, \"2\", null, battle_side);\n } else if (battleType === \"139\" && (0, $dIwPZ.get)(\"auto_send_event_lg\", true)) (0, $6rIzz.sendBattle)(battle_id, battle_secret, \"1\");\n else if (battleType === \"144\" && (0, $dIwPZ.get)(\"auto_send_faction_event_battles\", true) || battleType === \"140\" && (0, $dIwPZ.get)(\"auto_send_hunt_event_battles\", true)) (0, $6rIzz.sendBattle)(battle_id, battle_secret, \"3\");\n else if (battleType === \"133\" && (0, $dIwPZ.get)(\"auto_send_rogues_event\", true) || battleType === \"147\" && (0, $dIwPZ.get)(\"auto_send_reaping_event\", true)) {\n let battle_side = (0, $dIwPZ.get)(\"event_battle_side\", -1);\n (0, $dIwPZ.set)(\"event_battle_side\", -1);\n (0, $6rIzz.sendBattle)(battle_id, battle_secret, \"4\", null, battle_side);\n }\n }\n }\n }\n }\n}\n\n});\n\nparcelRequire.register(\"19fJa\", function(module, exports) {\n\n$parcel$export(module.exports, \"default\", () => $0d62d4d9ed1699bb$export$2e2bcd8739ae039);\n\nvar $dIwPZ = parcelRequire(\"dIwPZ\");\n\nvar $jWJKf = parcelRequire(\"jWJKf\");\n\nvar $6rIzz = parcelRequire(\"6rIzz\");\n\nvar $aqxxv = parcelRequire(\"aqxxv\");\n\nvar $afXBq = parcelRequire(\"afXBq\");\nfunction $0d62d4d9ed1699bb$var$getAllTexts() {\n let texts = new (0, $afXBq.LocalizedTextMap)();\n texts.addText(new (0, $afXBq.LocalizedText)(\"send_to_service\", \"send to service\", \"\u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0432 \u0441\u0435\u0440\u0432\u0438\u0441\", \"\u0432\u0456\u0434\u043f\u0440\u0430\u0432\u0438\u0442\u0438 \u0443 \u0441\u0435\u0440\u0432\u0456\u0441\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"battle_info\", \"show battle info\", \"\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435\", \"\u0434\u0435\u0442\u0430\u043b\u044c\u043d\u0456\u0448\u0435\"));\n return texts;\n}\nlet $0d62d4d9ed1699bb$var$allTexts = $0d62d4d9ed1699bb$var$getAllTexts();\nfunction $0d62d4d9ed1699bb$export$2e2bcd8739ae039() {\n window.sendBattle = (0, $6rIzz.sendBattle);\n window.getBattleInfo = getBattleInfo;\n if (location.href.includes(`pl_warlog.php?id=`)) Array.from(document.getElementsByTagName(\"i\")).filter((tag)=>(tag.innerText.includes(\"\u0412\u0440\u0430\u0433\u0438 \u044d\u043a\u0441\u043f\u0435\u0434\u0438\u0446\u0438\u0438\") || tag.innerText.includes(\"Enemies of the expedition\")) && tag.innerText.match(/\\((\\d{1,3})/)[1] - 0 > 50 || (tag.innerText.includes(\"\u041f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a \u0410\u0440\u043c\u0438\u0438 \u0422\u044c\u043c\u044b\") || tag.innerText.includes(\"Opponent of the Army of Darkness\")) && tag.innerText.match(/\\((\\d{1,3})/)[1] - 0 > 50 || (tag.innerText.includes(\"\u041a\u043e\u043d\u0442\u0440\u0430\u0431\u0430\u043d\u0434\u0438\u0441\u0442\u044b\") || tag.innerText.includes(\"Smugglers\")) && tag.innerText.match(/\\((\\d{1,3})/)[1] - 0 > 70 || (tag.innerText.includes(\"\u0411\u0430\u043d\u0434\u0438\u0442\u044b \u043f\u0443\u0441\u0442\u043e\u0448\u0435\u0439\") || tag.innerText.includes(\"Wasteland bandits\")) && tag.innerText.match(/\\((\\d{1,3})/)[1] - 0 > 30).forEach((tag, index)=>{\n let params = new URLSearchParams(\"?\" + tag.previousElementSibling.previousElementSibling.href.split(\"?\")[1]);\n tag.insertAdjacentHTML(\"afterend\", `\u00a0\u00a0<span><a id=\"get_battle_info_${index}\" style=\"cursor: pointer; text-decoration: underline\" onclick=\"getBattleInfo('${params.get(\"warid\")}', '${index}')\">${$0d62d4d9ed1699bb$var$allTexts.get(\"battle_info\")}</a></span>`);\n });\n if (location.href.includes(`pl_warlog.php?id=${(0, $dIwPZ.pl_id)}`)) {\n (0, $jWJKf.eventHelperSettings)(document.querySelector(`[class=\"global_container_block\"]`), (container)=>{\n (0, $jWJKf.setSettings)(\"only_clan_visibility\", \"\u041c\u043e\u0438 \u0431\u043e\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043a\u043b\u0430\u043d\u0430\", container, false);\n (0, $jWJKf.setSettings)(\"auto_send_rogues_event\", \"\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0431\u043e\u0438 \u0438\u0437 \u0440\u0430\u0437\u0431\u043e\u0439\u043d\u0438\u0447\u044c\u0435\u0433\u043e \u0438\u0432\u0435\u043d\u0442\u0430 \u0432 \u0441\u0435\u0440\u0432\u0438\u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\", container);\n (0, $jWJKf.setSettings)(\"auto_send_reaping_event\", \"\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0431\u043e\u0438 \u0438\u0437 \u0438\u0432\u0435\u043d\u0442\u0430 \u0442\u044c\u043c\u044b \u0432 \u0441\u0435\u0440\u0432\u0438\u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\", container);\n (0, $jWJKf.setSettings)(\"auto_send_ffa_event\", \"\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0431\u043e\u0438 \u0438\u0437 \u041a\u0411\u041e \u0438\u0432\u0435\u043d\u0442\u0430 \u0432 \u0441\u0435\u0440\u0432\u0438\u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\", container);\n (0, $jWJKf.setSettings)(\"auto_send_event_lg\", \"\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0431\u043e\u0438 \u0438\u0437 \u0413\u041b \u0438\u0432\u0435\u043d\u0442\u0430 \u0432 \u0441\u0435\u0440\u0432\u0438\u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\", container);\n (0, $jWJKf.setSettings)(\"auto_send_lg\", \"\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0431\u043e\u0438 \u0441 \u043e\u043f\u0430\u0441\u043d\u044b\u043c\u0438 \u0431\u0430\u043d\u0434\u0438\u0442\u0430\u043c\u0438 \u0432 \u0441\u0435\u0440\u0432\u0438\u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\", container);\n (0, $jWJKf.setSettings)(\"auto_send_faction_event_battles\", \"\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0431\u043e\u0438 \u0438\u0437 \u0444\u0440\u0430\u043a. \u0438\u0432\u0435\u043d\u0442\u0430 \u0432 \u0441\u0435\u0440\u0432\u0438\u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\", container);\n (0, $jWJKf.setSettings)(\"auto_send_hunt_event_battles\", \"\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0431\u043e\u0438 \u0438\u0437 \u0441\u0435\u0437\u043e\u043d\u0430 \u043e\u0445\u043e\u0442\u044b \u0432 \u0441\u0435\u0440\u0432\u0438\u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\", container);\n });\n Array.from(document.getElementsByTagName(\"i\")).forEach((tag, index)=>{\n let type;\n let isOk;\n if (tag.innerText === \"\u041e\u043f\u0430\u0441\u043d\u044b\u0435 \u0431\u0430\u043d\u0434\u0438\u0442\u044b\" || tag.innerText === \"Dangerous bandits\") {\n type = \"0\";\n isOk = true;\n }\n if (tag.innerText.includes(\"\u0412\u0440\u0430\u0436\u0434\u0435\u0431\u043d\u044b\u0439 \u043e\u0442\u0440\u044f\u0434\") || tag.innerText.includes(\"Hostile squad\")) {\n type = \"1\";\n isOk = true;\n }\n if (tag.innerText.includes(\"\u041f\u043e\u0445\u0438\u0442\u0438\u0442\u0435\u043b\u0438 \u0437\u0438\u043c\u044b\") || tag.innerText.includes(\"Snatchers of winter\") || tag.innerText.includes(\"\u0412\u043e\u0435\u043d\u043d\u0430\u044f \u044d\u043a\u0441\u043f\u0435\u0434\u0438\u0446\u0438\u044f\") || tag.innerText.includes(\"Military expedition\") || tag.innerText.includes(\"\u0412\u0440\u0430\u0433\u0438 \u044d\u043a\u0441\u043f\u0435\u0434\u0438\u0446\u0438\u0438\") || tag.innerText.includes(\"Enemies of the expedition\") || tag.innerText.includes(\"\u0411\u0430\u043d\u0434\u0438\u0442\u044b \u043f\u0443\u0441\u0442\u043e\u0448\u0435\u0439\") || tag.innerText.includes(\"\u041e\u0431\u0438\u0442\u0430\u0442\u0435\u043b\u0438 \u043f\u0443\u0441\u0442\u043e\u0448\u0435\u0439\") || tag.innerText.includes(\"Wasteland bandits\") || tag.innerText.includes(\"Wasteland dwellers\") || tag.innerText.includes(\"\u041a\u043e\u043d\u0442\u0440\u0430\u0431\u0430\u043d\u0434\u0438\u0441\u0442\u044b\") || tag.innerText.includes(\"Smugglers\")) {\n type = \"2\";\n isOk = true;\n }\n if (tag.innerText.includes(\"\u041e\u0442\u0440\u044f\u0434\u044b \u0431\u0430\u043d\u0434\u0438\u0442\u043e\u0432\") || tag.innerText.includes(\"Bandits squads\") || tag.innerText.includes(\"\u0426\u0435\u043b\u044c\") || tag.innerText.includes(\"Target\")) {\n type = \"3\";\n isOk = true;\n }\n if (tag.innerText.includes(\"\u041e\u0442\u0440\u044f\u0434 \u0432\u0440\u0430\u0433\u0430\") || tag.innerText.includes(\"Enemy squad\") || tag.innerText.includes(\"\u041f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a \u0410\u0440\u043c\u0438\u0438 \u0422\u044c\u043c\u044b\") || tag.innerText.includes(\"Opponent of the Army of Darkness\")) {\n type = \"4\";\n isOk = true;\n }\n if (isOk) {\n let maxTries = 5;\n let sibling = tag.previousElementSibling;\n for(let i = 0; i < maxTries; i++)if (sibling.tagName === \"A\" && sibling.href.includes(\"show_for_all\")) {\n let params = new URLSearchParams(\"?\" + sibling.href.split(\"?\")[1]);\n if (!tag.innerHTML.includes(\"<b>\")) tag.insertAdjacentHTML(\"afterend\", `\u00a0\u00a0<span><a id=\"send_battle_${index}\" style=\"cursor: pointer; text-decoration: underline\" onclick=\"sendBattle('${params.get(\"warid\")}', '${params.get(\"show_for_all\")}', '${type}', '${index}')\">${$0d62d4d9ed1699bb$var$allTexts.get(\"send_to_service\")}</a></span>`);\n break;\n } else sibling = sibling.previousElementSibling;\n }\n });\n }\n async function getBattleInfo(battle_id, target_index) {\n let response = await (0, $aqxxv.doGet)(`getEventBattleInfo?battle_id=${battle_id}`);\n let battleInfo = response.battle_info;\n let data = battleInfo.split(\"|\");\n let result = \"\";\n if (data.length > 1) {\n let heroClassRaw = data[0];\n let heroStatsRaw = data[1];\n let heroArtsRaw = data[2];\n let heroCreaturesRaw = data[3];\n let heroPerksRaw = data[4];\n let heroClassHTML = `\n <div class=\"battle_info_chip\">\n <img style=\"vertical-align: middle; height: 24px\" src=\"https://${(0, $dIwPZ.cdnHost)}/i/f/r${heroClassRaw}.png?v=1.1\" alt=\"\">\n </div>\n `;\n let heroStatsValues = heroStatsRaw.split(\",\");\n let heroStatsHTML = `\n <div class=\"battle_info_chip\">\n <img alt=\"\" src=\"https://${(0, $dIwPZ.cdnHost)}/i/icons/attr_attack.png?v=1\" style=\"vertical-align: middle; height: 24px\">\u00a0${heroStatsValues[0]}\n </div>\n <div class=\"battle_info_chip\">\n <img alt=\"\" src=\"https://${(0, $dIwPZ.cdnHost)}/i/icons/attr_defense.png?v=1\" style=\"vertical-align: middle; height: 24px\">\u00a0${heroStatsValues[1]}\n </div>\n <div class=\"battle_info_chip\">\n <img alt=\"\" src=\"https://${(0, $dIwPZ.cdnHost)}/i/icons/attr_magicpower.png?v=1\" style=\"vertical-align: middle; height: 24px\">\u00a0${heroStatsValues[2]}\n </div>\n <div class=\"battle_info_chip\">\n <img alt=\"\" src=\"https://${(0, $dIwPZ.cdnHost)}/i/icons/attr_knowledge.png?v=1\" style=\"vertical-align: middle; height: 24px\">\u00a0${heroStatsValues[3]}\n </div>\n <div class=\"battle_info_chip\">\n <img alt=\"\" src=\"https://${(0, $dIwPZ.cdnHost)}/i/icons/attr_fortune.png?v=1\" style=\"vertical-align: middle; height: 24px\">\u00a0${heroStatsValues[4]}\n </div>\n <div class=\"battle_info_chip\">\n <img alt=\"\" src=\"https://${(0, $dIwPZ.cdnHost)}/i/icons/attr_morale.png?v=1\" style=\"vertical-align: middle; height: 24px\">\u00a0${heroStatsValues[5]}\n </div>\n <div class=\"battle_info_chip\">\n <img alt=\"\" src=\"https://${(0, $dIwPZ.cdnHost)}/i/icons/attr_initiative.png?v=1\" style=\"vertical-align: middle; height: 24px\">\u00a0${heroStatsValues[6]}\n </div>\n \n `;\n let heroArtsHTML = heroArtsRaw.split(\",\").reduce((prev, curr)=>{\n let artInfoRaw = curr.split(\"~\");\n let artImgLink = artInfoRaw[0];\n let artModsRaw = artInfoRaw[1];\n // let artModsRaw = \"D10:E10:A10:W10:F10\"\n let artModsValues = artModsRaw.split(\":\");\n return prev + `\n <div class=\"battle_info_chip battle_art_chip\">\n \n <img src=\"https://${0, $dIwPZ.cdnHost}/i/artifacts/${artImgLink}\" class=\"art_img\">\n ${artModsRaw === \"\" ? \"\" : `\n <div class=\"art_mods_container\">\n ${artModsValues.reduce((modResult, currMod)=>{\n return modResult + `\n <img src=\"https://${0, $dIwPZ.cdnHost}/i/mods_png/${currMod}.png\" style=\"height: 100%; float: left;\" title=\"${currMod}\">\n `;\n }, \"\")}\n </div>\n `}\n </div>\n `;\n }, \"\");\n let heroCreaturesHTML = heroCreaturesRaw.split(\",\").reduce((prev, curr)=>{\n let creatureInfoRaw = curr.split(\":\");\n let creatureId = creatureInfoRaw[0];\n let creatureAmount = creatureInfoRaw[1];\n return prev + `\n <div class=\"cre_creature battle_info_chip\">\n <img src=\"https://${0, $dIwPZ.cdnHost}/i/portraits/${creatureId}\" style=\"border-radius: 10px; width: 60px;height: 50px;\">\n <div class=\"cre_amount\" style=\"bottom: -3px;text-align: center;right: 3px;\" id=\"add_now_count\">${creatureAmount}</div>\n </div>\n `;\n }, \"\");\n let heroPerksHTML = heroPerksRaw.split(\",\").reduce((prev, curr)=>{\n return prev + `\n <div class=\"\">\n <img src=\"https://${0, $dIwPZ.cdnHost}/i/perks/2x${curr}.png\" class=\"\" style=\"height: 50px\">\n </div>\n `;\n }, \"\");\n result = `\n <div style=\"display: flex; flex-wrap: wrap\">\n ${heroClassHTML}\n ${heroStatsHTML}\n </div>\n <div style=\"display: flex; flex-wrap: wrap\">\n ${heroArtsHTML}\n </div>\n <div style=\"display: flex; flex-wrap: wrap\">\n ${heroCreaturesHTML}\n </div>\n <div style=\"display: flex; flex-wrap: wrap\">\n ${heroPerksHTML}\n </div>\n \n `;\n } else if (data[0] !== \"\") result = `\n <div style=\"display: flex;\">\n <div class=\"battle_info_chip\">\n <img style=\"vertical-align: middle; height: 24px\" src=\"https://${0, $dIwPZ.cdnHost}/i/f/r${data[0]}.png?v=1.1\" alt=\"\">\n </div>\n </div>\n `;\n let target = (0, $dIwPZ.$)(`get_battle_info_${target_index}`);\n target.parentElement.insertAdjacentHTML(\"afterend\", `\n <div>\n ${result}\n </div>`);\n target.remove();\n }\n}\n\n});\n\nparcelRequire.register(\"1MCWa\", function(module, exports) {\n\n$parcel$export(module.exports, \"default\", () => $14c87a41ecbb7270$export$2e2bcd8739ae039);\n\nvar $dIwPZ = parcelRequire(\"dIwPZ\");\n\nvar $8l3id = parcelRequire(\"8l3id\");\n\nvar $jWJKf = parcelRequire(\"jWJKf\");\nfunction $14c87a41ecbb7270$export$2e2bcd8739ae039() {\n if (/(village_def)/.test(location.href)) {\n let villageElem = (0, $dIwPZ.$)(`set_mobile_max_width`);\n villageElem.style.flexWrap = \"nowrap\";\n if ((0, $dIwPZ.get)(\"village_remove_confirm\", true)) Array.from(document.querySelectorAll(\"input[type=submit]\")).forEach((input)=>input.onclick = ()=>{\n return true;\n });\n if ((0, $dIwPZ.get)(\"village_auto_repair\", false)) Array.from(document.querySelectorAll(\"input[type=submit]\")).forEach((input)=>{\n if (input.value.includes(\"\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\") || input.value.includes(\"\u0420\u0435\u043c\u043e\u043d\u0442\")) input.click();\n });\n // document.querySelector('#global_table_div3').parentElement.firstElementChild.remove()\n (0, $8l3id.setLeaderboard)(document.querySelector(\"#global_table_div3\"), \"beforebegin\");\n (0, $jWJKf.eventHelperSettings)(document.querySelector(\"#global_table_div4\"), (container)=>{\n (0, $jWJKf.setSettings)(\"village_custom_ins\", `\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0430\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \n <img src=\"https://hwm.events/battles/custom_ins.gif\" height=\"400px\" onclick='event.stopPropagation()'>\n (\u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \"\u0437\u0430\u043a\u0440\u0435\u043f\u043b\u0435\u043d\u0438\u044f\" \u043a\u0440\u0435\u0441\u0442\u044c\u044f\u043d \u0431\u0430\u0448\u043d\u044f\u043c\u0438)\n `, container, false);\n (0, $jWJKf.setSettings)(\"village_remove_confirm\", `\u0423\u0431\u0440\u0430\u0442\u044c \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u0442\u0440\u043e\u0439\u043a\u0438/\u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0439`, container);\n (0, $jWJKf.setSettings)(\"custom_ins_auto\", `\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u0443\u044e \u0440\u0430\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443`, container, false);\n (0, $jWJKf.setSettings)(\"village_auto_repair\", `\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0435\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u0442\u0440\u043e\u0439\u043a\u0438`, container, false);\n }, \"afterend\");\n }\n}\n\n});\n\nparcelRequire.register(\"douos\", function(module, exports) {\n\n$parcel$export(module.exports, \"default\", () => $9c0517c0824ec283$export$2e2bcd8739ae039);\n\nvar $aqxxv = parcelRequire(\"aqxxv\");\n\nvar $dIwPZ = parcelRequire(\"dIwPZ\");\n\nvar $ao0pt = parcelRequire(\"ao0pt\");\nasync function $9c0517c0824ec283$export$2e2bcd8739ae039() {\n if (/recruit_event/.test(location.href)) {\n (0, $ao0pt.setTimer)(document.querySelector(\".global_container_block_header\"));\n let annoyingPicture = document.querySelector(\".global_inside_shadow\");\n if (annoyingPicture) annoyingPicture.remove();\n let enemies = Array.from(document.querySelectorAll(\".recruit_event_enemy_block\"));\n enemies.forEach((enemy)=>{\n if (enemy.innerText.includes(\"\u043e\u0431\u043e\u0440\u043e\u043d\u044f\u044e\u0449\u0438\u0445\u0441\u044f\")) {\n let powerElem = enemy.querySelector(\"div:nth-child(3)>div:nth-child(3)\");\n let powerRaw = powerElem.innerText;\n let powerParsedTransformed = Math.floor(parseInt(powerRaw.replaceAll(\",\", \"\")) * 0.8).toLocaleString();\n powerElem.innerHTML = `${powerRaw} (<i style=\"cursor: pointer\" title=\"\u041f\u0440\u0438 \u043f\u043e\u0442\u0435\u0440\u0435 \u0432 \u0431\u043e\u044e\">${powerParsedTransformed}</i>)`;\n }\n });\n let topHeroes = await (0, $aqxxv.doGet)(`heroes/dun_scores.json`);\n let heroesTable = document.querySelector(\".recruit_event_loot_rating_inside\").querySelector(\"table\");\n let heroesTableInfo = document.querySelector(\".recruit_event_loot_rating_inside\").querySelector(\"center\");\n heroesTableInfo.innerHTML = `\u041a\u043b\u0438\u043a\u043d\u0438 \u043d\u0430 \u0436\u0438\u0440\u043d\u044b\u0435 \u043e\u0447\u043a\u0438, \u0447\u0442\u043e\u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u043a \u0441 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0438\u0435\u0439<br><br><br>\u041e\u0431\u0449\u0438\u0439 \u0440\u0435\u0439\u0442\u0438\u043d\u0433`;\n let firstTr = heroesTable.querySelector(\"tr\");\n let highestPlace = parseInt(firstTr.querySelector(\"td\").innerText);\n let heroesToRenderCount = Math.min(20, highestPlace - 1);\n let heroesToRender = topHeroes.slice(0, heroesToRenderCount);\n firstTr.insertAdjacentHTML(\"beforebegin\", heroesToRender.join(\"\"));\n let newScript = document.createElement(\"script\");\n newScript.setAttribute(\"src\", \"https://cdn.jsdelivr.net/npm/chart.js\");\n document.head.appendChild(newScript);\n let CLANS = [\n \"1519\",\n \"928\",\n \"104\",\n \"1597\",\n \"1209\",\n \"18\",\n \"41\",\n \"5152\",\n \"88\",\n \"326\",\n \"8502\",\n \"73\",\n \"7777\",\n \"302\",\n \"823\",\n \"17\",\n \"997\",\n \"276\",\n \"249\",\n \"1512\",\n \"9426\",\n \"10557\",\n \"2304\",\n \"14\",\n \"11532\",\n \"10886\",\n \"846\",\n \"3305\",\n \"8433\",\n \"1488\"\n ];\n document.querySelector(\".recruit_event_army_attack_inside\").insertAdjacentHTML(\"beforeend\", `\n <div id=\"chart_area\"></div>\n `);\n Array.from(heroesTable.querySelectorAll(\"tr\")).forEach((tr, index)=>{\n let clanMatch = tr.innerHTML.match(/clan_info\\.php\\?id=(\\d{1,5})/);\n if (clanMatch) {\n let clanId = clanMatch[1];\n if (CLANS.includes(clanId)) {\n let hero_id = tr.innerHTML.match(/pl_info\\.php\\?id=(\\d{1,10})/)[1];\n let hero_nick = tr.querySelector(\"td:nth-child(2)\").innerText;\n let scoreTd = tr.querySelector(\"td:nth-child(3)\");\n scoreTd.innerHTML = `\n <b style=\"font-size: 10px; text-decoration: underline; cursor: pointer\" id=\"top_hero${index}\">\n ${scoreTd.innerText}\n </b>\n `;\n (0, $dIwPZ.$)(`top_hero${index}`).addEventListener(\"click\", async ()=>{\n (0, $dIwPZ.$)(`chart_area`).innerHTML = `\n <div style=\"height: 165px; overflow: hidden\">\n <div>\u041f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0438\u044f \u043e\u0447\u043a\u043e\u0432 <b>${hero_nick}</b></div>\n <canvas id=\"chart${index}\" height=\"150\" style=\"width: 100%\"></canvas>\n </div>\n `;\n let heroData = await (0, $aqxxv.doGet)(`getDunHeroData?pl_id=${hero_id}`);\n const cumulativeSum = ((sum)=>(value)=>sum += value)(0);\n const labels = heroData.map((entry)=>entry[0] + ` ${entry[1] > 0 ? \"+\" : \"\"}${entry[1]}`);\n const data = {\n labels: labels,\n datasets: [\n {\n label: \"\u041e\u0447\u043a\u0438\",\n data: heroData.map((entry)=>entry[1]).map(cumulativeSum),\n borderColor: \"blue\",\n backgroundColor: \"rgb(44,73,107)\",\n pointStyle: \"circle\",\n pointRadius: 3,\n pointHoverRadius: 4\n }\n ]\n };\n const config = {\n type: \"line\",\n data: data,\n options: {\n animation: false,\n responsive: false,\n plugins: {\n legend: {\n display: false\n },\n title: {\n display: false,\n text: \"Chart.js Line Chart\"\n }\n },\n elements: {\n line: {\n borderWidth: 1\n }\n },\n scales: {\n x: {\n ticks: {\n display: false\n }\n }\n },\n interaction: {\n mode: \"index\",\n intersect: false\n }\n }\n };\n const ctx = document.getElementById(`chart${index}`).getContext(\"2d\");\n const myChart = new Chart(ctx, config);\n });\n }\n }\n });\n }\n}\n\n});\n\nparcelRequire.register(\"gJdWA\", function(module, exports) {\n\n$parcel$export(module.exports, \"default\", () => $c2dbaa4674b93b4f$export$2e2bcd8739ae039);\n\nvar $ao0pt = parcelRequire(\"ao0pt\");\n\nvar $8l3id = parcelRequire(\"8l3id\");\nvar $c2dbaa4674b93b4f$require$setLeaderboard = $8l3id.setLeaderboard;\nfunction $c2dbaa4674b93b4f$export$2e2bcd8739ae039() {\n if (/rogue_like_event\\.php$/.test(location.href)) {\n (0, $ao0pt.setTimer)(document.querySelector(\".global_container_block_header\"));\n $c2dbaa4674b93b4f$require$setLeaderboard(Array.from(Array.from(document.querySelectorAll(\".global_container_block\")).at(-1).getElementsByTagName(\"center\")).at(-1));\n }\n}\n\n});\n\nparcelRequire.register(\"5Nw5f\", function(module, exports) {\n\n$parcel$export(module.exports, \"default\", () => $438a6a7a63069f00$export$2e2bcd8739ae039);\n\nvar $aqxxv = parcelRequire(\"aqxxv\");\n\nvar $dIwPZ = parcelRequire(\"dIwPZ\");\n\nvar $afXBq = parcelRequire(\"afXBq\");\n\nvar $jWJKf = parcelRequire(\"jWJKf\");\nvar $438a6a7a63069f00$require$eventHelperSettings = $jWJKf.eventHelperSettings;\nvar $438a6a7a63069f00$require$setSettings = $jWJKf.setSettings;\nfunction $438a6a7a63069f00$var$getAllTexts() {\n let texts = new (0, $afXBq.LocalizedTextMap)();\n texts.addText(new (0, $afXBq.LocalizedText)(\"show_event_attempts_left\", \"Show remaining attempts for players\", \"\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u0443 \u0438\u0433\u0440\u043e\u043a\u043e\u0432\", \"\u041f\u043e\u043a\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u0441\u043f\u0440\u043e\u0431\u0438, \u044f\u043a\u0456 \u0437\u0430\u043b\u0438\u0448\u0438\u043b\u0438\u0441\u044f \u0443 \u0433\u0440\u0430\u0432\u0446\u0456\u0432\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"show_sort\", \"Show buttons to sort players\", \"\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0438 \u0434\u043b\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0438\u0433\u0440\u043e\u043a\u043e\u0432\", \"\u041f\u043e\u043a\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u043a\u043d\u043e\u043f\u043a\u0438 \u0434\u043b\u044f \u0441\u043e\u0440\u0442\u0443\u0432\u0430\u043d\u043d\u044f \u0433\u0440\u0430\u0432\u0446\u0456\u0432\"));\n return texts;\n}\nlet $438a6a7a63069f00$var$allTexts = $438a6a7a63069f00$var$getAllTexts();\nasync function $438a6a7a63069f00$export$2e2bcd8739ae039() {\n if (/clan_info\\.php/.test(location.href)) {\n let heroesTable = Array.from(document.getElementsByTagName(\"table\")).at(-1);\n $438a6a7a63069f00$require$eventHelperSettings(heroesTable, (container)=>{\n $438a6a7a63069f00$require$setSettings(\"show_event_attempts_left\", $438a6a7a63069f00$var$allTexts.get(\"show_event_attempts_left\"), container, false);\n $438a6a7a63069f00$require$setSettings(\"show_sort\", $438a6a7a63069f00$var$allTexts.get(\"show_sort\"), container);\n }, \"beforebegin\");\n if ((0, $dIwPZ.get)(\"show_event_attempts_left\", false)) {\n let clanId = new URLSearchParams(window.location.search).get(\"id\");\n let heroesAttempts = await (0, $aqxxv.doGet)(`getTopClanDetailedAttempts?clan_id=${clanId}`);\n let heroes = heroesTable.querySelectorAll(\"tr\");\n if (heroes.length - 20 < Object.keys(heroesAttempts).length) heroes.forEach((heroElem)=>{\n let heroId = heroElem.innerHTML.match(/id=(\\d{1,8})/)[1];\n let heroAttempts = heroesAttempts[heroId];\n heroElem.insertAdjacentHTML(\"beforeend\", `\n <td class=\"wbwhite\">${heroAttempts ? heroAttempts : 0}</td>\n `);\n });\n }\n if ((0, $dIwPZ.get)(\"show_event_attempts_left\", false) || (0, $dIwPZ.get)(\"show_sort\", true)) $438a6a7a63069f00$var$replaceWithSortableTable(heroesTable);\n }\n}\nfunction $438a6a7a63069f00$var$replaceWithSortableTable(heroesTable) {\n let heroesData = [];\n heroesTable.querySelectorAll(\"tr\").forEach((heroTr, index)=>{\n let tds = heroTr.querySelectorAll(\"td\");\n let heroData = {};\n let tdIndex = 1;\n heroData.order = index + 1;\n if (tds[tdIndex].innerHTML.includes(\"i/clans/\") || tds[tdIndex].innerText === \"\\xa0\") {\n let onlineMatch = tds[tdIndex++].innerHTML.match(/clans\\/(.+)\\.gif/);\n if (onlineMatch) heroData.status = onlineMatch[1];\n else heroData.status = \"offline\";\n }\n heroData.info = tds[tdIndex++].innerHTML;\n heroData.cl = tds[tdIndex++].innerText - 0;\n heroData.description = tds[tdIndex++].innerHTML;\n if (tdIndex < tds.length) heroData.score = tds[tdIndex++].innerText.replaceAll(\"\\xa0\", \"\").match(/(\\d{0,3},?\\d{0,3},?\\d{0,3})/)[1].replaceAll(\",\", \"\") - 0;\n if (tdIndex === tds.length - 1) heroData.attemptsLeft = tds[tdIndex].innerText - 0;\n heroesData.push(heroData);\n });\n let sortedHeroes = (0, $dIwPZ.sortByKey)([\n ...heroesData\n ], \"score\", -1);\n let threshold = sortedHeroes.length > 100 ? (0, $dIwPZ.sortByKey)([\n ...heroesData\n ], \"score\", -1)[99].score : 0;\n heroesTable.outerHTML = `\n <table class=\"wb\" width=\"100%\">\n <thead>\n <tr style=\"background-color: white\">\n ${Object.keys(heroesData[0]).reduce((prev, columnName)=>{\n return prev + `<th style=\"border: 1px solid\"><div class=\"home_button2 btn_hover2\" id=\"sort_${columnName}\" style=\"margin: 2px\"><img height=\"20px\" src=\"https://static.thenounproject.com/png/2509814-200.png\" style=\"pointer-events: none\"></div></th>`;\n }, \"\")}\n </tr>\n </thead>\n <tbody id=\"table-content\"></tbody>\n </table>\n `;\n const tableContent = document.getElementById(\"table-content\");\n const tableButtons = document.querySelectorAll(\"th div\");\n const getTableContent = (data)=>{\n let tableHtml = data.reduce((prev, hero, index)=>{\n let tdClass = hero.status === \"offline\" ? \"wbwhite\" : \"wblight\";\n let result = `<td class=\"${tdClass}\" width=\"${hero.order === index + 1 ? 30 : 70}\" style=\"text-align: center;\">${index + 1} ${hero.order === index + 1 ? \"\" : `(${hero.order})`}</td>`;\n if (hero.hasOwnProperty(\"status\")) result += `<td class=\"${tdClass}\" width=\"15\" style=\"text-align: center;\"><img align=\"absmiddle\" src=\"https://dcdn.heroeswm.ru/i/clans/${hero.status}.gif\" width=\"15\" height=\"15\" border=\"0\"></td>`;\n result += `<td class=\"${tdClass}\" width=\"150\">${hero.info}</td>`;\n result += `<td class=\"${tdClass}\" width=\"10\" align=\"center\">${hero.cl}</td>`;\n result += `<td class=\"${tdClass}\">${hero.description}</td>`;\n if (hero.hasOwnProperty(\"score\")) result += `<td class=\"${tdClass}\" width=\"30\" style=\"text-align: center;\">${hero.score >= threshold ? `<b style=\"color: blue\">${hero.score}</b>` : hero.score}</td>`;\n if (hero.hasOwnProperty(\"attemptsLeft\")) result += `<td class=\"${tdClass}\" width=\"30\" style=\"text-align: center;\">${hero.attemptsLeft}</td>`;\n return prev + `<tr>${result}</tr>`;\n }, \"\");\n tableContent.insertAdjacentHTML(\"beforeend\", tableHtml);\n };\n const sortData = (data, param, direction = \"asc\")=>{\n tableContent.innerHTML = \"\";\n const sortedData = direction === \"asc\" ? (0, $dIwPZ.sortByKey)([\n ...data\n ], param, -1) : (0, $dIwPZ.sortByKey)([\n ...data\n ], param);\n getTableContent(sortedData);\n };\n const resetButtons = (event)=>{\n [\n ...tableButtons\n ].map((button)=>{\n if (button !== event.target) button.removeAttribute(\"data-dir\");\n });\n };\n getTableContent(heroesData);\n [\n ...tableButtons\n ].map((button)=>{\n button.addEventListener(\"click\", (e)=>{\n resetButtons(e);\n if (e.target.getAttribute(\"data-dir\") === \"desc\") {\n sortData(heroesData, e.target.id.split(\"_\")[1], \"desc\");\n e.target.setAttribute(\"data-dir\", \"asc\");\n } else {\n sortData(heroesData, e.target.id.split(\"_\")[1], \"asc\");\n e.target.setAttribute(\"data-dir\", \"desc\");\n }\n });\n });\n}\n\n});\n\nparcelRequire.register(\"028DL\", function(module, exports) {\n\n$parcel$export(module.exports, \"default\", () => $0066e3d04e0e43e4$export$2e2bcd8739ae039);\n\nvar $8l3id = parcelRequire(\"8l3id\");\n\nvar $dIwPZ = parcelRequire(\"dIwPZ\");\n\nvar $jWJKf = parcelRequire(\"jWJKf\");\n\nvar $ao0pt = parcelRequire(\"ao0pt\");\n\nvar $6rIzz = parcelRequire(\"6rIzz\");\n\nvar $afXBq = parcelRequire(\"afXBq\");\n\nvar $aqxxv = parcelRequire(\"aqxxv\");\nfunction $0066e3d04e0e43e4$var$getAllTexts() {\n let texts = new (0, $afXBq.LocalizedTextMap)();\n texts.addText(new (0, $afXBq.LocalizedText)(\"auto_send_reaping_event\", \"Send battles from the event to the service automatically\", \"\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0431\u043e\u0438 \u0438\u0437 \u0438\u0432\u0435\u043d\u0442\u0430 \u0432 \u0441\u0435\u0440\u0432\u0438\u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\", \"\u0412\u0456\u0434\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u0438 \u0431\u043e\u0457 \u0437 \u0456\u0432\u0435\u043d\u0442\u0430 \u0443 \u0441\u0435\u0440\u0432\u0456\u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u043d\u043e\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"only_clan_visibility\", \"My battles are only available to the clan\", \"\u041c\u043e\u0438 \u0431\u043e\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043a\u043b\u0430\u043d\u0430\", \"\u041c\u043e\u0457 \u0431\u043e\u0457 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0456 \u043b\u0438\u0448\u0435 \u0434\u043b\u044f \u043a\u043b\u0430\u043d\u0443\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"collapse_event_desc\", \"Always collapse fight descriptions\", \"\u0412\u0441\u0435\u0433\u0434\u0430 \u0441\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0431\u043e\u0435\u0432\", \"\u0417\u0430\u0432\u0436\u0434\u0438 \u0437\u0433\u043e\u0440\u0442\u0430\u0442\u0438 \u043e\u043f\u0438\u0441\u0438 \u0431\u043e\u0457\u0432\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"hide_rogues_event_enemies\", \"Show price statistics\", \"\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0446\u0435\u043d\", \"\u041f\u043e\u043a\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0446\u0456\u043d\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"bought\", \"bought\", \"\u043a\u0443\u043f\u043b\u0435\u043d\u043e\", \"\u043a\u0443\u043f\u043b\u0435\u043d\u043e\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"sold\", \"sold\", \"\u043f\u0440\u043e\u0434\u0430\u043d\u043e\", \"\u043f\u0440\u043e\u0434\u0430\u043d\u043e\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"trade_for\", \"for\", \"\u043f\u043e\", \"\u043f\u043e\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"trade_history\", \"Trade history\", \"\u0418\u0441\u0442\u043e\u0440\u0438\u044f \u043f\u043e\u043a\u0443\u043f\u043e\u043a \u0438 \u043f\u0440\u043e\u0434\u0430\u0436\", \"\u0406\u0441\u0442\u043e\u0440\u0456\u044f \u043f\u043e\u043a\u0443\u043f\u043e\u043a \u0442\u0430 \u043f\u0440\u043e\u0434\u0430\u0436\u0456\u0432\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"show_event_timer\", \"Show time until the end of the event\", \"\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u0438\u0432\u0435\u043d\u0442\u0430\", \"\u041f\u043e\u043a\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u0447\u0430\u0441 \u0434\u043e \u043a\u0456\u043d\u0446\u044f \u0456\u0432\u0435\u043d\u0442\u0430\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"show_top_clan_attempts\", \"Show remaining attempts for TOP3 clans\", \"\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u0443 \u0422\u041e\u041f3 \u043a\u043b\u0430\u043d\u043e\u0432\", \"\u041f\u043e\u043a\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u0441\u043f\u0440\u043e\u0431\u0438, \u0449\u043e \u0437\u0430\u043b\u0438\u0448\u0438\u043b\u0438\u0441\u044f, \u0443 \u0422\u041e\u041f3 \u043a\u043b\u0430\u043d\u0456\u0432\"));\n texts.addText(new (0, $afXBq.LocalizedText)(\"hire_hint\", \"Red means higher prices, while green means the opposite. At this event, the cost of a creature can only be within + -15% of the initial cost. Thus, if 115% is written next to the price, it will no longer rise upwards, and if the price is 85%, then it will no longer fall either.\", \"\u041a\u0440\u0430\u0441\u043d\u044b\u0439 \u0446\u0432\u0435\u0442 \u0437\u043d\u0430\u0447\u0438\u0442 \u043f\u043e\u0434\u043e\u0440\u043e\u0436\u0430\u043d\u0438\u0435, \u0430 \u0437\u0435\u043b\u0435\u043d\u044b\u0439 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442. \u041d\u0430 \u044d\u0442\u043e\u043c \u0438\u0432\u0435\u043d\u0442\u0435 \u0446\u0435\u043d\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 +-15% \u043e\u0442 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0435\u0441\u043b\u0438 \u0440\u044f\u0434\u043e\u043c \u0441 \u0446\u0435\u043d\u043e\u0439 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e 115%, \u043e\u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u0440\u0430\u0441\u0442\u0438 \u0432\u0432\u0435\u0440\u0445 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442, \u0430 \u0435\u0441\u043b\u0438 \u0446\u0435\u043d\u0430 85%, \u0442\u043e \u043f\u0430\u0434\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u0436\u0435.\", \"\u0427\u0435\u0440\u0432\u043e\u043d\u0438\u0439 \u043a\u043e\u043b\u0456\u0440 \u043e\u0437\u043d\u0430\u0447\u0430\u0454 \u043f\u043e\u0434\u043e\u0440\u043e\u0436\u0447\u0430\u043d\u043d\u044f, \u0430 \u0437\u0435\u043b\u0435\u043d\u0438\u0439 \u2013 \u043d\u0430\u0432\u043f\u0430\u043a\u0438. \u041d\u0430 \u0446\u044c\u043e\u043c\u0443 \u0456\u0432\u0435\u043d\u0442\u0456 \u0446\u0456\u043d\u0430 \u0456\u0441\u0442\u043e\u0442\u0438 \u043c\u043e\u0436\u0435 \u0431\u0443\u0442\u0438 \u043b\u0438\u0448\u0435 \u0432 \u043c\u0435\u0436\u0430\u0445 +-15% \u0432\u0456\u0434 \u043f\u043e\u0447\u0430\u0442\u043a\u043e\u0432\u043e\u0457 \u0432\u0430\u0440\u0442\u043e\u0441\u0442\u0456. \u0422\u0430\u043a\u0438\u043c \u0447\u0438\u043d\u043e\u043c, \u044f\u043a\u0449\u043e \u043f\u043e\u0440\u044f\u0434 \u0437 \u0446\u0456\u043d\u043e\u044e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e 115%, \u0432\u043e\u043d\u0430 \u0431\u0456\u043b\u044c\u0448\u0435 \u043d\u0435 \u0437\u0440\u043e\u0441\u0442\u0430\u0442\u0438\u043c\u0435, \u0430 \u044f\u043a\u0449\u043e \u0446\u0456\u043d\u0430 85%, \u0442\u043e \u043f\u0430\u0434\u0430\u0442\u0438 \u0431\u0456\u043b\u044c\u0448\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435 \u0442\u0435\u0436.\"));\n return texts;\n}\nlet $0066e3d04e0e43e4$var$allTexts = $0066e3d04e0e43e4$var$getAllTexts();\nasync function $0066e3d04e0e43e4$export$2e2bcd8739ae039() {\n if (location.href.includes(\"reaping_event.\")) {\n (0, $8l3id.setLeaderboard)(Array.from(Array.from(document.querySelectorAll(\".global_container_block\")).at(-1).getElementsByTagName(\"center\")).at(-1));\n if ((0, $dIwPZ.get)(\"show_top_clan_attempts\", true)) (0, $8l3id.setTopClanAttempts)(Array.from(Array.from(document.querySelectorAll(\".global_container_block\")).at(-1).getElementsByTagName(\"table\")).at(-1));\n (0, $jWJKf.eventHelperSettings)(Array.from(document.querySelectorAll(\".global_container_block\")).at(-1).firstChild, (container)=>{\n (0, $jWJKf.setSettings)(\"auto_send_reaping_event\", $0066e3d04e0e43e4$var$allTexts.get(\"auto_send_reaping_event\"), container);\n (0, $jWJKf.setSettings)(\"only_clan_visibility\", $0066e3d04e0e43e4$var$allTexts.get(\"only_clan_visibility\"), container, false);\n (0, $jWJKf.setSettings)(\"collapse_event_desc\", $0066e3d04e0e43e4$var$allTexts.get(\"collapse_event_desc\"), container, false);\n (0, $jWJKf.setSettings)(\"hide_rogues_event_enemies\", $0066e3d04e0e43e4$var$allTexts.get(\"hide_rogues_event_enemies\"), container);\n (0, $jWJKf.setSettings)(\"show_top_clan_attempts\", $0066e3d04e0e43e4$var$allTexts.get(\"show_top_clan_attempts\"), container);\n (0, $jWJKf.setSettings)(\"show_event_timer\", $0066e3d04e0e43e4$var$allTexts.get(\"show_event_timer\"), container);\n }, \"afterbegin\");\n (0, $dIwPZ.set)(\"eh_current_level\", null);\n if ((0, $dIwPZ.get)(\"show_event_timer\", true)) (0, $ao0pt.setTimer)(document.querySelector(\".global_container_block_header\"));\n (0, $ao0pt.collapseEventDesc)();\n (0, $ao0pt.setClickableLevels)();\n (0, $6rIzz.getEventBattles)(Array.from(document.querySelectorAll(\".global_container_block\")).at(-2), \"getRoguesEventBattles\", 1);\n let currentLevel = (0, $ao0pt.getCurrentLevel)();\n let storedLevel = (0, $dIwPZ.get)(\"currentEventLevel\", \"0\");\n if (storedLevel !== currentLevel) {\n await setEventCreaturesInfo();\n (0, $dIwPZ.set)(\"currentEventLevel\", currentLevel);\n }\n interceptButtons();\n }\n async function setEventCreaturesInfo() {\n let doc = await (0, $aqxxv.doGet)(\"/reaping_event_set.php\", true);\n let creatureBlocks = doc.querySelectorAll(\"#ne_set_troops_on_market .hwm_event_set_stack_pic\");\n let creaturesInfo = {};\n creatureBlocks.forEach((block)=>{\n let creaturePriceMatch = block.innerHTML.match(/silver48\\.png'\\)\"><b>(\\d{0,3},?\\d{0,3})/);\n if (creaturePriceMatch) {\n let price = creaturePriceMatch[1].replace(\",\", \"\") - 0;\n let portrait = block.innerHTML.match(/portraits\\/([a-zA-Z0-9_-]+)p33/)[1];\n let id = block.querySelector(\"a\").href.split(\"=\")[1];\n creaturesInfo[portrait] = [\n id,\n price\n ];\n }\n });\n (0, $dIwPZ.set)(\"eventCreaturesInfo\", creaturesInfo);\n }\n function interceptButtons() {\n let buttons = Array.from(document.querySelectorAll(\"input[id^=ne_attack_button]\"));\n if (buttons.length === 2) {\n let available = 2 - buttons.filter((x)=>x.disabled).length;\n buttons.forEach((button, index)=>{\n button.addEventListener(\"mousedown\", ()=>{\n (0, $dIwPZ.set)(\"event_battle_side\", index % 2);\n (0, $dIwPZ.set)(\"eh_current_level\", [\n (0, $ao0pt.getCurrentLevel)(),\n available\n ]);\n });\n });\n }\n }\n}\n\n});\n\n\n\nparcelRequire(\"85UD7\");\n\n//# sourceMappingURL=EventHelperV2.user.js.map\n"
document.head.appendChild(newScript);
}
start()