UNPKG

koishi-plugin-genshin

Version:

Genshin Impact player data fetcher and gacha simulator for Koishi.js

1,365 lines (1,364 loc) 156 kB
/*! Copyright © 2011 - 2021 miHoYo. All Rights Reserved */ !(function(t) { function e(e) { for ( var a, o, s = e[0], c = e[1], l = e[2], d = 0, p = []; d < s.length; d++ ) (o = s[d]), Object.prototype.hasOwnProperty.call(i, o) && i[o] && p.push(i[o][0]), (i[o] = 0) for (a in c) Object.prototype.hasOwnProperty.call(c, a) && (t[a] = c[a]) for (u && u(e); p.length; ) p.shift()() return r.push.apply(r, l || []), n() } function n() { for (var t, e = 0; e < r.length; e++) { for (var n = r[e], a = !0, s = 1; s < n.length; s++) { var c = n[s] 0 !== i[c] && (a = !1) } a && (r.splice(e--, 1), (t = o((o.s = n[0])))) } return t } var a = {}, i = { 0: 0 }, r = [] function o(e) { if (a[e]) return a[e].exports var n = (a[e] = { i: e, l: !1, exports: {} }) return t[e].call(n.exports, n, n.exports, o), (n.l = !0), n.exports } ;(o.m = t), (o.c = a), (o.d = function(t, e, n) { o.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: n }) }), (o.r = function(t) { 'undefined' != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: 'Module' }), Object.defineProperty(t, '__esModule', { value: !0 }) }), (o.t = function(t, e) { if ((1 & e && (t = o(t)), 8 & e)) return t if (4 & e && 'object' == typeof t && t && t.__esModule) return t var n = Object.create(null) if ( (o.r(n), Object.defineProperty(n, 'default', { enumerable: !0, value: t }), 2 & e && 'string' != typeof t) ) for (var a in t) o.d( n, a, function(e) { return t[e] }.bind(null, a) ) return n }), (o.n = function(t) { var e = t && t.__esModule ? function() { return t.default } : function() { return t } return o.d(e, 'a', e), e }), (o.o = function(t, e) { return Object.prototype.hasOwnProperty.call(t, e) }), (o.p = '') var s = (window.webpackJsonp = window.webpackJsonp || []), c = s.push.bind(s) ;(s.push = e), (s = s.slice()) for (var l = 0; l < s.length; l++) e(s[l]) var u = c r.push([207, 1]), n() })({ 124: function(t) { t.exports = JSON.parse('{"router":"./lib/router/index.js"}') }, 125: function(t, e, n) { 'use strict' Object.defineProperty(e, '__esModule', { value: !0 }) var a = n(126) e.default = { log: function() { var t ;(t = console)[a.Log].apply(t, arguments) }, info: function() { var t ;(t = console)[a.Info].apply(t, arguments) }, warn: function() { var t ;(t = console)[a.Warn].apply(t, arguments) }, error: function() { var t ;(t = console)[a.Error].apply(t, arguments) } } }, 126: function(t, e, n) { 'use strict' Object.defineProperty(e, '__esModule', { value: !0 }) ;(e.Log = 'log'), (e.Info = 'info'), (e.Warn = 'warn'), (e.Error = 'error') }, 127: function(t, e, n) { 'use strict' Object.defineProperty(e, '__esModule', { value: !0 }) var a = l(n(413)), i = l(n(479)), r = Object.assign || function(t) { for (var e = 1; e < arguments.length; e++) { var n = arguments[e] for (var a in n) Object.prototype.hasOwnProperty.call(n, a) && (t[a] = n[a]) } return t }, o = l(n(133)), s = n(507), c = l(n(508)) function l(t) { return t && t.__esModule ? t : { default: t } } function u(t, e, n) { var a = this, o = s.dealConfigsBeforeRequest ? s.dealConfigsBeforeRequest.bind(this)(t) : t, c = o.url, l = o.data, u = o.query, d = o.onSuccess, p = void 0 === d ? function() {} : d, f = o.onError, m = void 0 === f ? function() {} : f, g = (function(t, e) { var n = {} for (var a in t) e.indexOf(a) >= 0 || (Object.prototype.hasOwnProperty.call(t, a) && (n[a] = t[a])) return n })(o, ['url', 'data', 'query', 'onSuccess', 'onError']), h = [ l, r( { params: u }, g ) ] return ( 'get' === n ? (h = [ r( { params: l }, g ) ]) : 'delete' === n && (h = [ r( { params: u, data: l }, g ) ]), e[n] .apply( e, [c].concat( (function(t) { if (Array.isArray(t)) { for (var e = 0, n = Array(t.length); e < t.length; e++) n[e] = t[e] return n } return Array.from(t) })(h) ) ) .then( function(e) { return s.requestComplete.bind(a)(e, t) ? null : (p.bind(a)((0, i.default)(e, 'data')), e) }, function(e) { var n = (0, i.default)(e, 'response') return s.requestComplete.bind(a)(n, t, e) ? null : (m.bind(a)(n), Promise.reject(e)) } ) ) } function d(t) { var e = this return { get: function(n) { return u.bind(e)(n, t, 'get') }, post: function(n) { return u.bind(e)(n, t, 'post') }, put: function(n) { return u.bind(e)(n, t, 'put') }, delete: function(n) { return u.bind(e)(n, t, 'delete') } } } e.default = function(t) { var e = t ;(0, a.default)(o.default.defaults, c.default), Object.defineProperty(e.prototype, '$http', { get: function() { return d.bind(this)(o.default) } }) } }, 137: function(t, e, n) {}, 138: function(t, e, n) { 'use strict' n.d(e, 'a', function() { return a }), n.d(e, 'b', function() { return i }) var a = function() { var t = this.$createElement return (this._self._c || t)('router-view') }, i = [] a._withStripped = !0 }, 139: function(t, e, n) { 'use strict' n.d(e, 'a', function() { return a }), n.d(e, 'b', function() { return i }) var a = function() { var t = this, e = t.$createElement, n = t._self._c || e return n( 'div', { staticClass: 'home' }, [ n( 'div', { staticClass: 'content-container' }, [ n( 'div', { staticClass: 'title' }, [ n( 'span', { staticClass: 'start' }, [t._v('|')] ), t._v(' '), n('span', { domProps: { innerHTML: t._s( t.getStyleContent(t.$MI18N.WORD.novice_title) ) } }) ] ), t._v(' '), n( 'div', { staticClass: 'block-container' }, [ n( 'p', { staticClass: 'tips' }, [t._v(t._s(t.$MI18N.WORD.gacha_activity_desc))] ), t._v(' '), n('span', { staticClass: 'line' }) ] ), t._v(' '), n( 'div', { staticClass: 'act-info' }, [ n( 'p', { staticClass: 'date' }, [t._v(t._s(t.$MI18N.WORD.novice_time))] ), t._v(' '), n('div', { staticClass: 'content', domProps: { innerHTML: t._s( t.getStyleContent(t.$MI18N.WORD.novice_content) ) } }) ] ), t._v(' '), n( 'div', { staticClass: 'up-detail' }, [ n( 'p', { staticClass: 'up-title' }, [t._v(t._s(t.$MI18N.WORD.gacha_prob_desc))] ), t._v(' '), t._l(t.itemUpList, function(e) { return n( 'div', { key: e.rank, staticClass: 'star-table-container' }, [ e.list.length > 1 ? n( 'div', { class: ['up-desc-line', 'desc' + e.rank] }, [ n( 'div', { staticClass: 'star-area' }, t._l(e.star, function(t, e) { return n('span', { key: e, staticClass: 'star-img' }) }), 0 ), t._v(' '), n( 'p', { staticClass: 'up-prob-text' }, [ t._v( t._s(e.item_text) + ' ' + t._s(e.prob) ) ] ) ] ) : t._e(), t._v(' '), n( 'div', { staticClass: 'up-table' }, [ n( 'div', { staticClass: 'table-th' }, [ n( 'span', { staticClass: 'type cell' }, [t._v(t._s(t.$MI18N.WORD.gacha_item_type))] ), t._v(' '), n( 'span', { staticClass: 'name cell' }, [t._v(t._s(t.$MI18N.WORD.gacha_item_name))] ), t._v(' '), n( 'span', { staticClass: 'type cell' }, [t._v(t._s(t.$MI18N.WORD.gacha_item_type))] ), t._v(' '), n( 'span', { staticClass: 'name cell' }, [t._v(t._s(t.$MI18N.WORD.gacha_item_name))] ) ] ), t._v(' '), e.list && e.list.length > 1 ? n( 'div', { class: [ 'table-data-container', e.list && e.list.length % 2 == 1 ? 'odd-length-table-container' : '' ] }, t._l(e.list, function(e) { return n( 'div', { key: e.item_id, staticClass: 'each-prob-item' }, [ n( 'span', { staticClass: 'type cell' }, [ t._v( t._s( e.item_type ? t.$MI18N.WORD.gacha_role : t.$MI18N.WORD.gacha_weapon ) ) ] ), t._v(' '), n( 'span', { staticClass: 'name cell' }, [ n('span', [ t._v( t._s( t.$MI18N.WORD[ 'novice_item_' + e.item_id ] ) ) ]) ] ) ] ) }), 0 ) : n( 'div', { staticClass: 'empty-row' }, [t._v(t._s(t.$MI18N.WORD.gacha_log_empty))] ) ] ), t._v(' '), n( 'div', { staticClass: 'gacha-tips' }, [ t._v( '\n ' + t._s( t.$MI18N.WORD.guarantee_tips ? t.$MI18N.WORD.guarantee_tips : '' ) + '\n ' ) ] ) ] ) }) ], 2 ) ] ) ] ) }, i = [] a._withStripped = !0 }, 140: function(t, e, n) { 'use strict' n.d(e, 'a', function() { return a }), n.d(e, 'b', function() { return i }) var a = function() { var t = this, e = t.$createElement, n = t._self._c || e return n( 'div', { staticClass: 'log' }, [ n( 'div', { staticClass: 'content-container' }, [ n( 'div', { staticClass: 'type-select-container' }, [ n( 'span', { staticClass: 'title' }, [t._v(t._s(t.$MI18N.WORD.gacha_item_type_desc))] ), t._v(' '), n('div', [ n( 'div', { staticClass: 'select-container', on: { click: function(e) { return e.stopPropagation(), t.changeStatus(e) } } }, [ n( 'p', { staticClass: 'selected-val' }, [ t._v( '\n ' + t._s( t.gachaTypeList.find(function(e) { return e.key === t.typeId }) ? t.gachaTypeList.find(function(e) { return e.key === t.typeId }).name : '' ) + '\n ' ) ] ), t._v(' '), n('div', { class: ['visible-icon', t.visible ? 'up' : 'down'] }) ] ), t._v(' '), n( 'div', { directives: [ { name: 'show', rawName: 'v-show', value: t.visible, expression: 'visible' } ], staticClass: 'scroll-list' }, [ n( 'ul', { staticClass: 'ul-list', on: { click: t.setVal } }, t._l(t.gachaTypeList, function(e) { return n( 'li', { key: e.key, class: [ 'item', t.typeId === e.key ? 'selected' : '' ], attrs: { 'data-id': e.key } }, [ t._v( '\n ' + t._s(e.name) + '\n ' ) ] ) }), 0 ) ] ) ]) ] ), t._v(' '), n( 'div', { staticClass: 'tips' }, [t._v(t._s(t.$MI18N.WORD.gacha_type_tips))] ), t._v(' '), n( 'div', { staticClass: 'table-container' }, [ n( 'div', { staticClass: 'table-content' }, [ n( 'div', { staticClass: 'th-container' }, [ n( 'span', { staticClass: 'cell type' }, [t._v(t._s(t.$MI18N.WORD.gacha_item_type))] ), t._v(' '), n( 'span', { staticClass: 'cell name' }, [t._v(t._s(t.$MI18N.WORD.gacha_item_name))] ), t._v(' '), n( 'span', { staticClass: 'cell time' }, [t._v(t._s(t.$MI18N.WORD.gacha_item_get_time))] ) ] ), t._v(' '), t.list.length > 0 ? n( 'div', t._l(t.list, function(e, a) { return n( 'div', { key: a + '_logitem', staticClass: 'log-item-row' }, [ n( 'span', { staticClass: 'cell type' }, [t._v(t._s(t.getTypeName(e)))] ), t._v(' '), n( 'span', { class: ['cell name', t.getRankClass(e)] }, [ t._v( '\n ' + t._s(t.getToolName(e)) + '\n ' + t._s(t.getToolRank(e)) + '\n ' ) ] ), t._v(' '), n( 'span', { staticClass: 'cell time' }, [t._v(t._s(e.time))] ) ] ) }), 0 ) : n( 'div', { staticClass: 'empty-row' }, [t._v(t._s(t.$MI18N.WORD.gacha_log_empty))] ) ] ), t._v(' '), n( 'div', { staticClass: 'page-container', attrs: { id: 'J_page_wrapper' } }, [ t.showArrow ? n('span', { staticClass: 'page-item to-start selected' }) : t._e(), t._v(' '), t.showArrow ? n( 'span', { staticClass: 'page-item' }, [t._v(t._s(t.currentPage))] ) : t._e(), t._v(' '), t.showArrow ? n('span', { staticClass: 'page-item to-next selected' }) : t._e() ] ) ] ) ] ) ] ) }, i = [] a._withStripped = !0 }, 141: function(t, e, n) { 'use strict' n.d(e, 'a', function() { return a }), n.d(e, 'b', function() { return i }) var a = function() { var t = this, e = t.$createElement, n = t._self._c || e return n( 'div', { staticClass: 'home' }, [ n( 'div', { staticClass: 'content-container' }, [ n( 'div', { staticClass: 'title' }, [ n( 'span', { staticClass: 'start' }, [t._v('|')] ), t._v(' '), n('span', { domProps: { innerHTML: t._s(t.getStyleContent(t.gachaInfo.title)) } }) ] ), t._v(' '), t.gachaInfo.banner ? n( 'div', { staticClass: 'banner' }, [ n('img', { attrs: { src: t.gachaInfo.banner } }) ] ) : t._e(), t._v(' '), t.isActivity && t.hasUp ? n( 'div', { staticClass: 'block-container' }, [ n( 'p', { staticClass: 'tips' }, [t._v(t._s(t.$MI18N.WORD.gacha_up_desc))] ), t._v(' '), n('span', { staticClass: 'line' }) ] ) : t._e(), t._v(' '), t.isActivity ? n( 'div', t._l(t.upList, function(e, a) { return n( 'div', { key: a, staticClass: 'rank-up-container' }, [ e.list.length > 0 ? n( 'div', { class: ['up-desc-line', 'desc' + e.rank] }, [ n( 'div', { staticClass: 'star-area' }, t._l(e.star, function(t, e) { return n('span', { key: e, staticClass: 'star-img' }) }), 0 ), t._v(' '), n( 'p', { staticClass: 'up-prob-text' }, [t._v(t._s(e.text) + t._s(e.prob))] ) ] ) : t._e(), t._v(' '), e.list.length > 0 ? n( 'div', { class: [ 'item-list-container', 1 === e.list.length || 2 === e.list.length ? 'length2-center' : '', 3 === e.list.length ? 'length3between' : '', e.list.length > 3 ? 'lengthmore' : '' ] }, t._l(e.list, function(e, a) { return n( 'div', { key: a, staticClass: 'item-content' }, [ n('img', { directives: [ { name: 'img-load', rawName: 'v-img-load:background', value: e, expression: 'item', arg: 'background' } ], staticClass: 'background-img' }), t._v(' '), n( 'div', { staticClass: 'card-info' }, [ n( 'div', { staticClass: 'item-icon-container' }, [ n('img', { directives: [ { name: 'img-load', rawName: 'v-img-load:role', value: e, expression: 'item', arg: 'role' } ], staticClass: 'item-icon-img' }) ] ), t._v(' '), n( 'div', { staticClass: 'item-desc' }, [ n( 'p', { staticClass: 'item-name' }, [t._v(t._s(e.item_name))] ) ] ) ] ) ] ) }), 0 ) : t._e() ] ) }), 0 ) : t._e(), t._v(' '), n( 'div', { staticClass: 'block-container' }, [ n( 'p', { staticClass: 'tips' }, [t._v(t._s(t.$MI18N.WORD.gacha_activity_desc))] ), t._v(' '), n('span', { staticClass: 'line' }) ] ), t._v(' '), n( 'div', { staticClass: 'act-info' }, [ t.gachaInfo.date_range ? n( 'p', { staticClass: 'date' }, [t._v(t._s(t.gachaInfo.date_range))] ) : t._e(), t._v(' '), n('div', { staticClass: 'content', domProps: { innerHTML: t._s(t.getStyleContent(t.gachaInfo.content)) } }) ] ), t._v(' '), n( 'div', { staticClass: 'up-detail' }, [ n( 'p', { staticClass: 'up-title' }, [t._v(t._s(t.$MI18N.WORD.gacha_prob_desc))] ), t._v(' '), t._l(t.itemUpList, function(e) { return n( 'div', { key: e.rank, staticClass: 'star-table-container' }, [ e.list.length > 0 ? n( 'div', { class: ['up-desc-line', 'desc' + e.rank] }, [ n( 'div', { staticClass: 'star-area' }, t._l(e.star, function(t, e) { return n('span', { key: e, staticClass: 'star-img' }) }), 0 ), t._v(' '), n( 'p', { staticClass: 'up-prob-text' }, [ t._v( t._s(e.item_text) + ' ' + t._s(e.prob) + '\n (' + t._s(t.$MI18N.WORD.guarantee_prob) + ': ' + t._s(e.baodi_prob) + ')' ) ] ) ] ) : t._e(), t._v(' '), n( 'div', { staticClass: 'up-table' }, [ n( 'div', { staticClass: 'table-th' }, [ n( 'span', { staticClass: 'type cell' }, [t._v(t._s(t.$MI18N.WORD.gacha_item_type))] ), t._v(' '), n( 'span', { staticClass: 'name cell' }, [t._v(t._s(t.$MI18N.WORD.gacha_item_name))] ), t._v(' '), n( 'span', { staticClass: 'type cell' }, [t._v(t._s(t.$MI18N.WORD.gacha_item_type))] ), t._v(' '), n( 'span', { staticClass: 'name cell' }, [t._v(t._s(t.$MI18N.WORD.gacha_item_name))] ) ] ), t._v(' '), e.list && e.list.length > 0 ? n( 'div', { class: [ 'table-data-container', e.list && e.list.length % 2 == 1 ? 'odd-length-table-container' : '' ] }, t._l(e.list, function(e, a) { return n( 'div', { key: a, staticClass: 'each-prob-item' }, [ n( 'span', { staticClass: 'type cell' }, [t._v(t._s(e.item_type))] ), t._v(' '), n( 'span', { class: [ 'name cell', t.isActivity && Number(e.is_up) ? 'name-up' : '' ] }, [ n('span', [ t.isActivity && Number(e.is_up) ? n('span', { staticClass: 'icon' }) : t._e(), t._v( '\n ' + t._s(e.item_name) + '\n ' ) ]) ] ) ] ) }), 0 ) : n( 'div', { staticClass: 'empty-row' }, [t._v(t._s(t.$MI18N.WORD.gacha_log_empty))] ) ] ), t._v(' '), n( 'div', { staticClass: 'gacha-tips' }, [ t._v( '\n ' + t._s( t.$MI18N.WORD.guarantee_tips ? t.$MI18N.WORD.guarantee_tips : '' ) + '\n ' ) ] ) ] ) }) ], 2 ) ] ) ] ) }, i = [] a._withStripped = !0 }, 142: function(t, e, n) { 'use strict' n.d(e, 'a', function() { return a }), n.d(e, 'b', function() { return i }) var a = function() { var t = this, e = t.$createElement, n = t._self._c || e return n( 'div', { staticClass: 'home' }, [ n( 'div', { staticClass: 'content-container' }, [ n( 'div', { staticClass: 'title' },