2020-07-30 10:47:11 +00:00
parcelRequire = function ( e , r , t , n ) { var i , o = "function" == typeof parcelRequire && parcelRequire , u = "function" == typeof require && require ; function f ( t , n ) { if ( ! r [ t ] ) { if ( ! e [ t ] ) { var i = "function" == typeof parcelRequire && parcelRequire ; if ( ! n && i ) return i ( t , ! 0 ) ; if ( o ) return o ( t , ! 0 ) ; if ( u && "string" == typeof t ) return u ( t ) ; var c = new Error ( "Cannot find module '" + t + "'" ) ; throw c . code = "MODULE_NOT_FOUND" , c } p . resolve = function ( r ) { return e [ t ] [ 1 ] [ r ] || r } , p . cache = { } ; var l = r [ t ] = new f . Module ( t ) ; e [ t ] [ 0 ] . call ( l . exports , p , l , l . exports , this ) } return r [ t ] . exports ; function p ( e ) { return f ( p . resolve ( e ) ) } } f . isParcelRequire = ! 0 , f . Module = function ( e ) { this . id = e , this . bundle = f , this . exports = { } } , f . modules = e , f . cache = r , f . parent = o , f . register = function ( r , t ) { e [ r ] = [ function ( e , r ) { r . exports = t } , { } ] } ; for ( var c = 0 ; c < t . length ; c ++ ) try { f ( t [ c ] ) } catch ( e ) { i || ( i = e ) } if ( t . length ) { var l = f ( t [ t . length - 1 ] ) ; "object" == typeof exports && "undefined" != typeof module ? module . exports = l : "function" == typeof define && define . amd ? define ( function ( ) { return l } ) : n && ( this [ n ] = l ) } if ( parcelRequire = f , i ) throw i ; return f } ( { "Ph2E" : [ function ( require , module , exports ) {
"use strict" ; Object . defineProperty ( exports , "__esModule" , { value : ! 0 } ) , exports . default = exports . API _URI = void 0 ; const e = "https://api.tribalwarshelp.com/graphql" ; exports . API _URI = e ; var r = function ( ) { let { query : r , variables : t = { } } = arguments . length > 0 && void 0 !== arguments [ 0 ] ? arguments [ 0 ] : { } ; return fetch ( e , { method : "POST" , body : JSON . stringify ( { query : r , variables : t } ) , headers : { "Content-Type" : "application/json" } } ) . then ( e => e . json ( ) ) . then ( e => { let { data : r , errors : t } = e ; if ( t && Array . isArray ( t ) && t . length > 0 ) throw new Error ( t [ 0 ] . message ) ; return new Promise ( e => e ( r ) ) } ) } ; exports . default = r ;
} , { } ] , "LNef" : [ function ( require , module , exports ) {
2020-08-13 15:25:22 +00:00
"use strict" ; Object . defineProperty ( exports , "__esModule" , { value : ! 0 } ) , exports . default = void 0 ; const o = { pl _PL : { loaded : "Załadowano" , pop : "Populacja" , mySupport : "Moje wsparcie" , allySupport : "Wsparcie plemienia" , total : "Łącznie" , possibleLoyalty : "Prawdopodobne poparcie" , ennobledAt : "Podbita o" , never : "Nigdy" , action : { showEnnoblements : "Pokaż przejęcia" , countIncomingSupport : "Policz nadchodzące wsparcie" } } , en _DK : { loaded : "Loaded" , pop : "Pop" , mySupport : "My support" , allySupport : "Ally support" , total : "Total" , possibleLoyalty : "Possible loyalty" , never : "Never" , ennobledAt : "Ennobled at" , action : { showEnnoblements : "Show ennoblements" , countIncomingSupport : "Count incoming support" } } } ; var e = ( ) => o [ window . game _data . locale ] || o . en _DK ; exports . default = e ;
2020-07-30 10:47:11 +00:00
} , { } ] , "fCHX" : [ function ( require , module , exports ) {
"use strict" ; Object . defineProperty ( exports , "__esModule" , { value : ! 0 } ) , exports . generatePaginationItems = exports . calcNumberOfPages = exports . getPage = exports . setPage = exports . getContainerStyles = void 0 ; const e = "data-page" , t = ( ) => "display: flex; flex-direction: row; flex-wrap: wrap;" ; exports . getContainerStyles = t ; const r = function ( t ) { let r = arguments . length > 1 && void 0 !== arguments [ 1 ] ? arguments [ 1 ] : 1 ; if ( ! t instanceof HTMLElement ) throw new Error ( "Expected HTMLElement as the first argument" ) ; if ( "number" != typeof ( r = parseInt ( r ) ) || isNaN ( r ) ) throw new Error ( "Expected number or string as the second argument" ) ; t . setAttribute ( e , r + "" ) } ; exports . setPage = r ; const n = t => ! t instanceof HTMLElement ? 0 : parseInt ( t . getAttribute ( e ) ) ; exports . getPage = n ; const o = ( e , t ) => { if ( "number" != typeof e ) throw new Error ( "Expected number as the first argument" ) ; if ( "number" != typeof t ) throw new Error ( "Expected number as the second argument" ) ; return e > 0 ? Math . ceil ( e / t ) : 1 } ; exports . calcNumberOfPages = o ; const a = function ( ) { let { total : t , limit : r , marginRight : n = 3 , currentPage : a = 0 } = arguments . length > 0 && void 0 !== arguments [ 0 ] ? arguments [ 0 ] : { } ; const s = o ( t , r ) , c = [ ] ; for ( let o = 1 ; o <= s ; o ++ ) o === a ? c . push ( '<strong style="margin-right: ' . concat ( n , 'px">>' ) . concat ( o , "<</strong>" ) ) : c . push ( '<a style="margin-right: ' . concat ( n , 'px" href="#" ' ) . concat ( e , '="' ) . concat ( o , '">' ) . concat ( o , "</a>" ) ) ; return c } ; exports . generatePaginationItems = a ;
} , { } ] , "DMkL" : [ function ( require , module , exports ) {
"use strict" ; Object . defineProperty ( exports , "__esModule" , { value : ! 0 } ) , exports . default = void 0 ; var e = ( ) => window . location . host . split ( "." ) [ 0 ] ; exports . default = e ;
} , { } ] , "tQUs" : [ function ( require , module , exports ) {
"use strict" ; Object . defineProperty ( exports , "__esModule" , { value : ! 0 } ) , exports . default = void 0 ; var e = e => parseInt ( new URLSearchParams ( e ) . get ( "id" ) ) ; exports . default = e ;
2020-08-07 13:50:26 +00:00
} , { } ] , "fHHP" : [ function ( require , module , exports ) {
"use strict" ; Object . defineProperty ( exports , "__esModule" , { value : ! 0 } ) , exports . buildImgURL = exports . calcAttackDuration = exports . formatVillageName = exports . formatVillageURL = exports . formatPlayerURL = exports . formatTribeURL = void 0 ; const o = o => window . location . origin + TribalWars . buildURL ( "" , { screen : "info_ally" , id : o } ) ; exports . formatTribeURL = o ; const t = o => window . location . origin + TribalWars . buildURL ( "" , { screen : "info_player" , id : o } ) ; exports . formatPlayerURL = t ; const r = o => window . location . origin + TribalWars . buildURL ( "" , { screen : "info_village" , id : o } ) ; exports . formatVillageURL = r ; const e = function ( ) { let o = arguments . length > 0 && void 0 !== arguments [ 0 ] ? arguments [ 0 ] : "" , t = arguments . length > 1 && void 0 !== arguments [ 1 ] ? arguments [ 1 ] : 500 , r = arguments . length > 2 && void 0 !== arguments [ 2 ] ? arguments [ 2 ] : 500 ; const e = "K" + String ( r ) [ 0 ] + String ( t ) [ 0 ] ; return "" . concat ( o , " (" ) . concat ( t , "|" ) . concat ( r , ") " ) . concat ( e ) } ; exports . formatVillageName = e ; const i = ( o , t , r ) => Math . round ( o * r / t ) ; exports . calcAttackDuration = i ; const a = o => image _base + o ; exports . buildImgURL = a ;
} , { } ] , "KX6P" : [ function ( require , module , exports ) {
"use strict" ; Object . defineProperty ( exports , "__esModule" , { value : ! 0 } ) , exports . default = void 0 ; var e = require ( "./tribalwars" ) , t = t => ( 0 , e . buildImgURL ) ( "unit/unit_" . concat ( t , ".png" ) ) ; exports . default = t ;
2020-08-13 07:47:25 +00:00
} , { "./tribalwars" : "fHHP" } ] , "V6Mf" : [ function ( require , module , exports ) {
"use strict" ; Object . defineProperty ( exports , "__esModule" , { value : ! 0 } ) , exports . default = void 0 ; var e = ( e , t ) => new Date ( e ) . toLocaleDateString ( window . game _data . locale . replace ( "_" , "-" ) , t || { year : "numeric" , month : "2-digit" , day : "2-digit" , hour : "2-digit" , minute : "2-digit" , second : "2-digit" } ) ; exports . default = e ;
} , { } ] , "oUdd" : [ function ( require , module , exports ) {
2020-08-07 13:50:26 +00:00
"use strict" ; Object . defineProperty ( exports , "__esModule" , { value : ! 0 } ) , exports . default = void 0 ; var e = e => new Promise ( t => setTimeout ( t , e ) ) ; exports . default = e ;
} , { } ] , "KWxH" : [ function ( require , module , exports ) {
"use strict" ; Object . defineProperty ( exports , "__esModule" , { value : ! 0 } ) , exports . setItem = exports . getItem = void 0 ; const e = function ( e ) { let t = arguments . length > 1 && void 0 !== arguments [ 1 ] ? arguments [ 1 ] : { } ; const o = localStorage . getItem ( e ) ; let s = t ; return o && ( s = JSON . parse ( o ) ) , s } ; exports . getItem = e ; const t = ( e , t ) => { localStorage . setItem ( e , JSON . stringify ( t ) ) } ; exports . setItem = t ;
2020-08-13 07:47:25 +00:00
} , { } ] , "kK6Q" : [ function ( require , module , exports ) {
"use strict" ; function e ( e , t ) { if ( t . length < e ) throw new TypeError ( e + " argument" + ( e > 1 ? "s" : "" ) + " required, but only " + t . length + " present" ) } Object . defineProperty ( exports , "__esModule" , { value : ! 0 } ) , exports . default = e ;
} , { } ] , "KYJg" : [ function ( require , module , exports ) {
"use strict" ; Object . defineProperty ( exports , "__esModule" , { value : ! 0 } ) , exports . default = r ; var e = t ( require ( "../_lib/requiredArgs/index.js" ) ) ; function t ( e ) { return e && e . _ _esModule ? e : { default : e } } function r ( t ) { ( 0 , e . default ) ( 1 , arguments ) ; var r = Object . prototype . toString . call ( t ) ; return t instanceof Date || "object" == typeof t && "[object Date]" === r ? new Date ( t . getTime ( ) ) : "number" == typeof t || "[object Number]" === r ? new Date ( t ) : ( "string" != typeof t && "[object String]" !== r || "undefined" == typeof console || ( console . warn ( "Starting with v2.0.0-beta.1 date-fns doesn't accept strings as arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule" ) , console . warn ( ( new Error ) . stack ) ) , new Date ( NaN ) ) }
} , { "../_lib/requiredArgs/index.js" : "kK6Q" } ] , "H70G" : [ function ( require , module , exports ) {
"use strict" ; Object . defineProperty ( exports , "__esModule" , { value : ! 0 } ) , exports . default = u ; var e = r ( require ( "../toDate/index.js" ) ) , t = r ( require ( "../_lib/requiredArgs/index.js" ) ) ; function r ( e ) { return e && e . _ _esModule ? e : { default : e } } function u ( r , u ) { ( 0 , t . default ) ( 2 , arguments ) ; var i = ( 0 , e . default ) ( r ) , d = ( 0 , e . default ) ( u ) ; return i . getTime ( ) - d . getTime ( ) }
} , { "../toDate/index.js" : "KYJg" , "../_lib/requiredArgs/index.js" : "kK6Q" } ] , "oGJj" : [ function ( require , module , exports ) {
"use strict" ; Object . defineProperty ( exports , "__esModule" , { value : ! 0 } ) , exports . default = i ; var e = t ( require ( "../differenceInMilliseconds/index.js" ) ) , r = t ( require ( "../_lib/requiredArgs/index.js" ) ) ; function t ( e ) { return e && e . _ _esModule ? e : { default : e } } var u = 6e4 ; function i ( t , i ) { ( 0 , r . default ) ( 2 , arguments ) ; var d = ( 0 , e . default ) ( t , i ) / u ; return d > 0 ? Math . floor ( d ) : Math . ceil ( d ) }
} , { "../differenceInMilliseconds/index.js" : "H70G" , "../_lib/requiredArgs/index.js" : "kK6Q" } ] , "ATOB" : [ function ( require , module , exports ) {
"use strict" ; Object . defineProperty ( exports , "__esModule" , { value : ! 0 } ) , exports . default = void 0 ; var e = t ( require ( "date-fns/differenceInMinutes" ) ) ; function t ( e ) { return e && e . _ _esModule ? e : { default : e } } var r = ( t , r ) => { let u = 25 + Math . abs ( ( 0 , e . default ) ( t , new Date ) ) * ( r / 60 ) ; return u > 100 && ( u = 100 ) , Math . floor ( u ) } ; exports . default = r ;
} , { "date-fns/differenceInMinutes" : "oGJj" } ] , "tKRp" : [ function ( require , module , exports ) {
2020-09-17 10:26:43 +00:00
"use strict" ; Object . defineProperty ( exports , "__esModule" , { value : ! 0 } ) , exports . default = void 0 ; const e = { pl _PL : { date : "Data" , newOwner : "Nowy właściciel" , oldOwner : "Poprzedni właściciel" , village : "Wioska" , title : "Przejęcia" } , en _DK : { date : "Date" , newOwner : "New owner" , oldOwner : "Old owner" , village : "Village" , title : "Ennoblements" } } ; var l = ( ) => e [ window . game _data . locale ] || e . en _DK ; exports . default = l ;
2020-07-30 10:47:11 +00:00
} , { } ] , "chDM" : [ function ( require , module , exports ) {
2020-08-14 11:34:14 +00:00
"use strict" ; Object . defineProperty ( exports , "__esModule" , { value : ! 0 } ) , exports . default = exports . POPUP _SELECTOR = void 0 ; const e = ".popup_helper" , t = "#inline_popup" ; exports . POPUP _SELECTOR = t ; var o = function ( ) { let { e : e , title : o , html : n , id : l } = arguments . length > 0 && void 0 !== arguments [ 0 ] ? arguments [ 0 ] : { } ; const p = document . querySelector ( t ) ; p && ( p . style . width = "auto" , p . style . maxWidth = "1000px" ) , p . classList . contains ( "show" ) ? ( p . querySelector ( "#inline_popup_title" ) . innerHTML = o , p . querySelector ( "#inline_popup_content" ) . innerHTML = n ) : inlinePopup ( e , l , null , { offset _x : 0 , offset _y : 0 } , n , o ) ; const i = document . querySelector ( ".popup_helper" ) ; i && ( i . style . width = "auto" , i . style . position = "fixed" , i . style . zIndex = "50001" ) } ; exports . default = o ;
2020-08-05 19:10:42 +00:00
} , { } ] , "vNT1" : [ function ( require , module , exports ) {
2020-07-30 10:47:11 +00:00
"use strict" ; Object . defineProperty ( exports , "__esModule" , { value : ! 0 } ) , exports . default = void 0 ; var t = l ( require ( "../i18n/showEnnoblementsPopup" ) ) , e = require ( "../utils/pagination" ) , n = l ( require ( "../utils/showPopup" ) ) , a = l ( require ( "../utils/formatDate" ) ) , o = require ( "../utils/tribalwars" ) ; function l ( t ) { return t && t . _ _esModule ? t : { default : t } } const r = "ennoblementsPagination" , i = ( 0 , t . default ) ( ) , c = ( t , e ) => t ? '<td><a href="' . concat ( ( 0 , o . formatPlayerURL ) ( t . id ) , '">' ) . concat ( t . name , " (" ) . concat ( e ? '<a href="' . concat ( ( 0 , o . formatTribeURL ) ( e . id ) , '">' ) . concat ( e . tag , "</a>" ) : "-" , ")</a></td>" ) : "<td>-</td>" ; var d = function ( t , l ) { let { limit : d = 0 , currentPage : s = 1 , onPageChange : u = ( ( ) => { } ) } = arguments . length > 2 && void 0 !== arguments [ 2 ] ? arguments [ 2 ] : { } ; const g = ( 0 , e . generatePaginationItems ) ( { total : l . total , limit : d , currentPage : s } ) , m = '\n <div style="' . concat ( ( 0 , e . getContainerStyles ) ( ) , '" id="' ) . concat ( r , '">\n ' ) . concat ( g . join ( "" ) , '\n </div>\n <table class="vis" style="border-collapse: separate; border-spacing: 2px; width: 100%;">\n <tbody>\n <tr>\n <th>\n ' ) . concat ( i . date , "\n </th>\n <th>\n " ) . concat ( i . village , "\n </th>\n <th>\n " ) . concat ( i . newOwner , "\n </th>\n <th>\n " ) . concat ( i . oldOwner , "\n </th>\n </tr>\n " ) . concat ( l . items . map ( t => { let e = "<tr>" + "<td>" . concat ( ( 0 , a . default ) ( t . ennobledAt ) , "</td>" ) ; return t . village ? e += '<td><a href="' . concat ( ( 0 , o . formatVillageURL ) ( t . village . id ) , '">' ) . concat ( ( 0 , o . formatVillageName ) ( t . village . name , t . village . x , t . village . y ) , "</a></td>" ) : e += "<td>-</td>" , e += c ( t . newOwner , t . newOwnerTribe ) , ( e += c ( t . oldOwner , t . oldOwnerTribe ) ) + "</tr>" } ) . join ( "" ) , "\n </tbody>\n </table>\n " ) ; ( 0 , n . default ) ( { e : t , title : i . title , id : "ennoblements" , html : m } ) , document . querySelectorAll ( "#ennoblementsPagination a" ) . forEach ( t => { t . addEventListener ( "click" , u ) } ) } ; exports . default = d ;
} , { "../i18n/showEnnoblementsPopup" : "tKRp" , "../utils/pagination" : "fCHX" , "../utils/showPopup" : "chDM" , "../utils/formatDate" : "V6Mf" , "../utils/tribalwars" : "fHHP" } ] , "UdfQ" : [ function ( require , module , exports ) {
2020-08-16 14:33:40 +00:00
"use strict" ; var e = u ( require ( "./libs/requestCreator" ) ) , t = u ( require ( "./i18n/extendedVillageProfile" ) ) , n = require ( "./utils/pagination" ) , r = u ( require ( "./utils/getCurrentServer" ) ) , o = u ( require ( "./utils/getIDFromURL" ) ) , a = u ( require ( "./utils/buildUnitImgURL" ) ) , i = u ( require ( "./utils/formatDate" ) ) , l = u ( require ( "./utils/wait" ) ) , c = require ( "./utils/localStorage" ) , s = u ( require ( "./utils/countLoyalty" ) ) , d = u ( require ( "./common/showEnnoblementsPopup" ) ) ; function u ( e ) { return e && e . _ _esModule ? e : { default : e } } function p ( e , t ) { var n = Object . keys ( e ) ; if ( Object . getOwnPropertySymbols ) { var r = Object . getOwnPropertySymbols ( e ) ; t && ( r = r . filter ( function ( t ) { return Object . getOwnPropertyDescriptor ( e , t ) . enumerable } ) ) , n . push . apply ( n , r ) } return n } function m ( e ) { for ( var t = 1 ; t < arguments . length ; t ++ ) { var n = null != arguments [ t ] ? arguments [ t ] : { } ; t % 2 ? p ( Object ( n ) , ! 0 ) . forEach ( function ( t ) { h ( e , t , n [ t ] ) } ) : Object . getOwnPropertyDescriptors ? Object . defineProperties ( e , Object . getOwnPropertyDescriptors ( n ) ) : p ( Object ( n ) ) . forEach ( function ( t ) { Object . defineProperty ( e , t , Object . getOwnPropertyDescriptor ( n , t ) ) } ) } return e } function h ( e , t , n ) { return t in e ? Object . defineProperty ( e , t , { value : n , enumerable : ! 0 , configurable : ! 0 , writable : ! 0 } ) : e [ t ] = n , e } const f = ( 0 , r . default ) ( ) , g = ( 0 , o . default ) ( window . location . search ) , y = "\n query ennoblements($server: String!, $filter: EnnoblementFilter!) {\n ennoblements(server: $server, filter: $filter) {\n items {\n ennobledAt\n village {\n id\n }\n }\n }\n }\n" , b = "\n query ennoblements($server: String!, $filter: EnnoblementFilter!) {\n ennoblements(server: $server, filter: $filter) {\n total\n items {\n village {\n id\n name\n x\n y\n }\n oldOwner {\n id\n name\n }\n oldOwnerTribe {\n id\n tag\n }\n newOwner {\n id\n name\n }\n newOwnerTribe {\n id\n tag\n }\n ennobledAt\n }\n }\n }\n" , v = 15 , w = "\n query server($key: String!) {\n server(key: $key) {\n config {\n speed\n }\n unitConfig {\n spear {\n pop\n }\n sword {\n pop\n }\n axe {\n pop\n }\n archer {\n pop\n }\n spy {\n pop\n }\n light {\n pop\n }\n marcher {\n pop\n }\n heavy {\n pop\n }\n ram {\n pop\n }\n catapult {\n pop\n }\n knight {\n pop\n }\n snob {\n pop\n }\n }\n }\n }\n" , q = "kiszkowaty_extended_village_profile_server_cfg" , S = document . querySelector ( "#content_value > table > tbody > tr > td:nth-child(1) > table:nth-child(2) > tbody" ) , E = document . querySelector ( "#content_value table.vis tbody" ) ; let O = { } ; const j = ( 0 , t . default ) ( ) , A = ( ) => ( 0 , c . getItem ) ( q ) , D = function ( ) { let e = arguments . length > 0 && void 0 !== arguments [ 0 ] ? arguments [ 0 ] : { } ; ( 0 , c . setItem ) ( q , e ) } , C = e => Math . abs ( e . getTime ( ) - ( new Date ) . getTime ( ) ) > 864e5 , L = async ( ) => { let t = A ( ) ; return t . server && ! C ( new Date ( t . loadedAt ) ) && t . server . unitConfig && t . server . config || ( ( t = await ( 0 , e . default ) ( { query : w , variables : { key : f } } ) ) . loadedAt = new Date , D ( t ) ) , t . server } , _ = async ( ) => { return await ( 0 , e . default ) ( { query : y , variables : { server : f , filter : { villageID : [ g ] , sort : "ennobledAt DESC" , limit : 1 } } } ) } , P = async t => { t . preventDefault ( ) ; const r = ( 0 , n . getPage ) ( t . target ) ; if ( ! isNaN ( r ) ) { const n = await ( 0 , e . default ) ( { query : b , variables : { filter : { villageID : [ g ] , offset : 15 * ( r - 1 ) , limit : 15 , sort : "ennobledAt DESC" } , server : f } } ) ; ( 0 , d . default ) ( t , n . ennoblements , { currentPage : r , limit : 15 , onPageChange : P } ) } } , k = e => { const t = [ ] ; let
2020-08-13 07:47:25 +00:00
} , { "./libs/requestCreator" : "Ph2E" , "./i18n/extendedVillageProfile" : "LNef" , "./utils/pagination" : "fCHX" , "./utils/getCurrentServer" : "DMkL" , "./utils/getIDFromURL" : "tQUs" , "./utils/buildUnitImgURL" : "KX6P" , "./utils/formatDate" : "V6Mf" , "./utils/wait" : "oUdd" , "./utils/localStorage" : "KWxH" , "./utils/countLoyalty" : "ATOB" , "./common/showEnnoblementsPopup" : "vNT1" } ] } , { } , [ "UdfQ" ] , null )