|
var global = self; |
|
|
|
var Reflect = { |
|
global: global |
|
}; |
|
|
|
!function a(b, c, d) { |
|
function e(g, h) { |
|
if (!c[g]) { |
|
if (!b[g]) { |
|
var i = "function" == typeof require && require; |
|
if (!h && i) return i(g, !0); |
|
if (f) return f(g, !0); |
|
var j = new Error("Cannot find module '" + g + "'"); |
|
throw j.code = "MODULE_NOT_FOUND", j; |
|
} |
|
var k = c[g] = { |
|
exports: {} |
|
}; |
|
b[g][0].call(k.exports, function(a) { |
|
var c = b[g][1][a]; |
|
return e(c ? c : a); |
|
}, k, k.exports, a, b, c, d); |
|
} |
|
return c[g].exports; |
|
} |
|
for (var f = "function" == typeof require && require, g = 0; g < d.length; g++) e(d[g]); |
|
return e; |
|
}({ |
|
1: [ function(a, b) { |
|
b.exports = a("./src/PathFinding"); |
|
}, { |
|
"./src/PathFinding": 4 |
|
} ], |
|
2: [ function(a, b) { |
|
b.exports = a("./lib/heap"); |
|
}, { |
|
"./lib/heap": 3 |
|
} ], |
|
3: [ function(a, b) { |
|
(function() { |
|
var a, c, d, e, f, g, h, i, j, k, l, m, n, o, p; |
|
d = Math.floor, k = Math.min, c = function(a, b) { |
|
return b > a ? -1 : a > b ? 1 : 0; |
|
}, j = function(a, b, e, f, g) { |
|
var h; |
|
if (null == e && (e = 0), null == g && (g = c), 0 > e) throw new Error("lo must be non-negative"); |
|
for (null == f && (f = a.length); f > e; ) h = d((e + f) / 2), g(b, a[h]) < 0 ? f = h : e = h + 1; |
|
return [].splice.apply(a, [ e, e - e ].concat(b)), b; |
|
}, g = function(a, b, d) { |
|
return null == d && (d = c), a.push(b), o(a, 0, a.length - 1, d); |
|
}, f = function(a, b) { |
|
var d, e; |
|
return null == b && (b = c), d = a.pop(), a.length ? (e = a[0], a[0] = d, p(a, 0, b)) : e = d, |
|
e; |
|
}, i = function(a, b, d) { |
|
var e; |
|
return null == d && (d = c), e = a[0], a[0] = b, p(a, 0, d), e; |
|
}, h = function(a, b, d) { |
|
var e; |
|
return null == d && (d = c), a.length && d(a[0], b) < 0 && (e = [ a[0], b ], b = e[0], |
|
a[0] = e[1], p(a, 0, d)), b; |
|
}, e = function(a, b) { |
|
var e, f, g, h, i, j; |
|
for (null == b && (b = c), h = function() { |
|
j = []; |
|
for (var b = 0, c = d(a.length / 2); c >= 0 ? c > b : b > c; c >= 0 ? b++ : b--) j.push(b); |
|
return j; |
|
}.apply(this).reverse(), i = [], f = 0, g = h.length; g > f; f++) e = h[f], i.push(p(a, e, b)); |
|
return i; |
|
}, n = function(a, b, d) { |
|
var e; |
|
return null == d && (d = c), e = a.indexOf(b), -1 !== e ? (o(a, 0, e, d), p(a, e, d)) : void 0; |
|
}, l = function(a, b, d) { |
|
var f, g, i, j, k; |
|
if (null == d && (d = c), g = a.slice(0, b), !g.length) return g; |
|
for (e(g, d), k = a.slice(b), i = 0, j = k.length; j > i; i++) f = k[i], h(g, f, d); |
|
return g.sort(d).reverse(); |
|
}, m = function(a, b, d) { |
|
var g, h, i, l, m, n, o, p, q, r; |
|
if (null == d && (d = c), 10 * b <= a.length) { |
|
if (l = a.slice(0, b).sort(d), !l.length) return l; |
|
for (i = l[l.length - 1], p = a.slice(b), m = 0, o = p.length; o > m; m++) g = p[m], |
|
d(g, i) < 0 && (j(l, g, 0, null, d), l.pop(), i = l[l.length - 1]); |
|
return l; |
|
} |
|
for (e(a, d), r = [], h = n = 0, q = k(b, a.length); q >= 0 ? q > n : n > q; h = q >= 0 ? ++n : --n) r.push(f(a, d)); |
|
return r; |
|
}, o = function(a, b, d, e) { |
|
var f, g, h; |
|
for (null == e && (e = c), f = a[d]; d > b && (h = d - 1 >> 1, g = a[h], e(f, g) < 0); ) a[d] = g, |
|
d = h; |
|
return a[d] = f; |
|
}, p = function(a, b, d) { |
|
var e, f, g, h, i; |
|
for (null == d && (d = c), f = a.length, i = b, g = a[b], e = 2 * b + 1; f > e; ) h = e + 1, |
|
f > h && !(d(a[e], a[h]) < 0) && (e = h), a[b] = a[e], b = e, e = 2 * b + 1; |
|
return a[b] = g, o(a, i, b, d); |
|
}, a = function() { |
|
function a(a) { |
|
this.cmp = null != a ? a : c, this.nodes = []; |
|
} |
|
return a.push = g, a.pop = f, a.replace = i, a.pushpop = h, a.heapify = e, a.updateItem = n, |
|
a.nlargest = l, a.nsmallest = m, a.prototype.push = function(a) { |
|
return g(this.nodes, a, this.cmp); |
|
}, a.prototype.pop = function() { |
|
return f(this.nodes, this.cmp); |
|
}, a.prototype.peek = function() { |
|
return this.nodes[0]; |
|
}, a.prototype.contains = function(a) { |
|
return -1 !== this.nodes.indexOf(a); |
|
}, a.prototype.replace = function(a) { |
|
return i(this.nodes, a, this.cmp); |
|
}, a.prototype.pushpop = function(a) { |
|
return h(this.nodes, a, this.cmp); |
|
}, a.prototype.heapify = function() { |
|
return e(this.nodes, this.cmp); |
|
}, a.prototype.updateItem = function(a) { |
|
return n(this.nodes, a, this.cmp); |
|
}, a.prototype.clear = function() { |
|
return this.nodes = []; |
|
}, a.prototype.empty = function() { |
|
return 0 === this.nodes.length; |
|
}, a.prototype.size = function() { |
|
return this.nodes.length; |
|
}, a.prototype.clone = function() { |
|
var b; |
|
return b = new a(), b.nodes = this.nodes.slice(0), b; |
|
}, a.prototype.toArray = function() { |
|
return this.nodes.slice(0); |
|
}, a.prototype.insert = a.prototype.push, a.prototype.top = a.prototype.peek, a.prototype.front = a.prototype.peek, |
|
a.prototype.has = a.prototype.contains, a.prototype.copy = a.prototype.clone, a; |
|
}(), ("undefined" != typeof b && null !== b ? b.exports : void 0) ? b.exports = a : window.Heap = a; |
|
}).call(this); |
|
}, {} ], |
|
4: [ function(a, b) { |
|
b.exports = { |
|
Heap: a("heap"), |
|
Node: a("./core/Node"), |
|
Grid: a("./core/Grid"), |
|
Util: a("./core/Util"), |
|
DiagonalMovement: a("./core/DiagonalMovement"), |
|
Heuristic: a("./core/Heuristic"), |
|
AStarFinder: a("./finders/AStarFinder"), |
|
BestFirstFinder: a("./finders/BestFirstFinder"), |
|
BreadthFirstFinder: a("./finders/BreadthFirstFinder"), |
|
DijkstraFinder: a("./finders/DijkstraFinder"), |
|
BiAStarFinder: a("./finders/BiAStarFinder"), |
|
BiBestFirstFinder: a("./finders/BiBestFirstFinder"), |
|
BiBreadthFirstFinder: a("./finders/BiBreadthFirstFinder"), |
|
BiDijkstraFinder: a("./finders/BiDijkstraFinder"), |
|
IDAStarFinder: a("./finders/IDAStarFinder"), |
|
JumpPointFinder: a("./finders/JumpPointFinder") |
|
}; |
|
}, { |
|
"./core/DiagonalMovement": 5, |
|
"./core/Grid": 6, |
|
"./core/Heuristic": 7, |
|
"./core/Node": 8, |
|
"./core/Util": 9, |
|
"./finders/AStarFinder": 10, |
|
"./finders/BestFirstFinder": 11, |
|
"./finders/BiAStarFinder": 12, |
|
"./finders/BiBestFirstFinder": 13, |
|
"./finders/BiBreadthFirstFinder": 14, |
|
"./finders/BiDijkstraFinder": 15, |
|
"./finders/BreadthFirstFinder": 16, |
|
"./finders/DijkstraFinder": 17, |
|
"./finders/IDAStarFinder": 18, |
|
"./finders/JumpPointFinder": 23, |
|
heap: 2 |
|
} ], |
|
5: [ function(a, b) { |
|
var c = { |
|
Always: 1, |
|
Never: 2, |
|
IfAtMostOneObstacle: 3, |
|
OnlyWhenNoObstacles: 4 |
|
}; |
|
b.exports = c; |
|
}, {} ], |
|
6: [ function(a, b) { |
|
function c(a, b, c) { |
|
this.width = a, this.height = b, this.nodes = this._buildNodes(a, b, c); |
|
} |
|
var d = a("./Node"), e = a("./DiagonalMovement"); |
|
c.prototype._buildNodes = function(a, b, c) { |
|
var e, f, g = new Array(b); |
|
for (e = 0; b > e; ++e) for (g[e] = new Array(a), f = 0; a > f; ++f) g[e][f] = new d(f, e); |
|
if (void 0 === c) return g; |
|
if (c.length !== b || c[0].length !== a) throw new Error("Matrix size does not fit"); |
|
for (e = 0; b > e; ++e) for (f = 0; a > f; ++f) c[e][f] && (g[e][f].walkable = !1), |
|
g[e][f].weight = c[e][f]; |
|
return g; |
|
}, c.prototype.getNodeAt = function(a, b) { |
|
return this.nodes[b][a]; |
|
}, c.prototype.isWalkableAt = function(a, b) { |
|
return this.isInside(a, b) && this.nodes[b][a].weight > 0; |
|
}, c.prototype.isInside = function(a, b) { |
|
return a >= 0 && a < this.width && b >= 0 && b < this.height; |
|
}, c.prototype.setWalkableAt = function(a, b) { |
|
this.nodes[b][a].weight = 1; |
|
}, c.prototype.getNeighbors = function(a, b) { |
|
var c = a.x, d = a.y, f = [], g = !1, h = !1, i = !1, j = !1, k = !1, l = !1, m = !1, n = !1, o = this.nodes; |
|
if (this.isWalkableAt(c, d - 1) && (f.push(o[d - 1][c]), g = !0), this.isWalkableAt(c + 1, d) && (f.push(o[d][c + 1]), |
|
i = !0), this.isWalkableAt(c, d + 1) && (f.push(o[d + 1][c]), k = !0), this.isWalkableAt(c - 1, d) && (f.push(o[d][c - 1]), |
|
m = !0), b === e.Never) return f; |
|
if (b === e.OnlyWhenNoObstacles) h = m && g, j = g && i, l = i && k, n = k && m; else if (b === e.IfAtMostOneObstacle) h = m || g, |
|
j = g || i, l = i || k, n = k || m; else { |
|
if (b !== e.Always) throw new Error("Incorrect value of diagonalMovement"); |
|
h = !0, j = !0, l = !0, n = !0; |
|
} |
|
return h && this.isWalkableAt(c - 1, d - 1) && f.push(o[d - 1][c - 1]), j && this.isWalkableAt(c + 1, d - 1) && f.push(o[d - 1][c + 1]), |
|
l && this.isWalkableAt(c + 1, d + 1) && f.push(o[d + 1][c + 1]), n && this.isWalkableAt(c - 1, d + 1) && f.push(o[d + 1][c - 1]), |
|
f; |
|
}, c.prototype.clone = function() { |
|
var a, b, e = this.width, f = this.height, g = this.nodes, h = new c(e, f), i = new Array(f); |
|
for (a = 0; f > a; ++a) for (i[a] = new Array(e), b = 0; e > b; ++b) i[a][b] = new d(b, a, g[a][b].walkable, g[a][b].weight); |
|
return h.nodes = i, h; |
|
}, b.exports = c; |
|
}, { |
|
"./DiagonalMovement": 5, |
|
"./Node": 8 |
|
} ], |
|
7: [ function(a, b) { |
|
b.exports = { |
|
manhattan: function(a, b) { |
|
return a + b; |
|
}, |
|
euclidean: function(a, b) { |
|
return Math.sqrt(a * a + b * b); |
|
}, |
|
octile: function(a, b) { |
|
var c = Math.SQRT2 - 1; |
|
return b > a ? c * a + b : c * b + a; |
|
}, |
|
chebyshev: function(a, b) { |
|
return Math.max(a, b); |
|
} |
|
}; |
|
}, {} ], |
|
8: [ function(a, b) { |
|
function c(a, b, c, d) { |
|
this.x = a, this.y = b, this.walkable = void 0 === c ? !0 : c, this.weight = d; |
|
} |
|
b.exports = c; |
|
}, {} ], |
|
9: [ function(a, b, c) { |
|
function d(a) { |
|
for (var b = [ [ a.x, a.y ] ]; a.parent; ) a = a.parent, b.push([ a.x, a.y ]); |
|
return b.reverse(); |
|
} |
|
function e(a, b) { |
|
var c = d(a), e = d(b); |
|
return c.concat(e.reverse()); |
|
} |
|
function f(a) { |
|
var b, c, d, e, f, g = 0; |
|
for (b = 1; b < a.length; ++b) c = a[b - 1], d = a[b], e = c[0] - d[0], f = c[1] - d[1], |
|
g += Math.sqrt(e * e + f * f); |
|
return g; |
|
} |
|
function g(a, b, c, d) { |
|
var e, f, g, h, i, j, k = Math.abs, l = []; |
|
for (g = k(c - a), h = k(d - b), e = c > a ? 1 : -1, f = d > b ? 1 : -1, i = g - h; ;) { |
|
if (l.push([ a, b ]), a === c && b === d) break; |
|
j = 2 * i, j > -h && (i -= h, a += e), g > j && (i += g, b += f); |
|
} |
|
return l; |
|
} |
|
function h(a) { |
|
var b, c, d, e, f, h, i = [], j = a.length; |
|
if (2 > j) return i; |
|
for (f = 0; j - 1 > f; ++f) for (b = a[f], c = a[f + 1], d = g(b[0], b[1], c[0], c[1]), |
|
e = d.length, h = 0; e - 1 > h; ++h) i.push(d[h]); |
|
return i.push(a[j - 1]), i; |
|
} |
|
function i(a, b) { |
|
var c, d, e, f, h, i, j, k, l, m, n, o = b.length, p = b[0][0], q = b[0][1], r = b[o - 1][0], s = b[o - 1][1]; |
|
for (c = p, d = q, h = [ [ c, d ] ], i = 2; o > i; ++i) { |
|
for (k = b[i], e = k[0], f = k[1], l = g(c, d, e, f), n = !1, j = 1; j < l.length; ++j) if (m = l[j], |
|
!a.isWalkableAt(m[0], m[1])) { |
|
n = !0; |
|
break; |
|
} |
|
n && (lastValidCoord = b[i - 1], h.push(lastValidCoord), c = lastValidCoord[0], |
|
d = lastValidCoord[1]); |
|
} |
|
return h.push([ r, s ]), h; |
|
} |
|
function j(a) { |
|
if (a.length < 3) return a; |
|
var b, c, d, e, f, g, h = [], i = a[0][0], j = a[0][1], k = a[1][0], l = a[1][1], m = k - i, n = l - j; |
|
for (f = Math.sqrt(m * m + n * n), m /= f, n /= f, h.push([ i, j ]), g = 2; g < a.length; g++) b = k, |
|
c = l, d = m, e = n, k = a[g][0], l = a[g][1], m = k - b, n = l - c, f = Math.sqrt(m * m + n * n), |
|
m /= f, n /= f, (m !== d || n !== e) && h.push([ b, c ]); |
|
return h.push([ k, l ]), h; |
|
} |
|
c.backtrace = d, c.biBacktrace = e, c.pathLength = f, c.interpolate = g, c.expandPath = h, |
|
c.smoothenPath = i, c.compressPath = j; |
|
}, {} ], |
|
10: [ function(a, b) { |
|
function c(a) { |
|
a = a || {}, this.allowDiagonal = a.allowDiagonal, this.dontCrossCorners = a.dontCrossCorners, |
|
this.heuristic = a.heuristic || f.manhattan, this.weight = a.weight || 1, this.maxOpsLimit = a.maxOpsLimit, |
|
this.diagonalMovement = a.diagonalMovement, this.diagonalMovement || (this.diagonalMovement = this.allowDiagonal ? this.dontCrossCorners ? g.OnlyWhenNoObstacles : g.IfAtMostOneObstacle : g.Never), |
|
this.heuristic = this.diagonalMovement === g.Never ? a.heuristic || f.manhattan : a.heuristic || f.octile; |
|
} |
|
var d = a("heap"), e = a("../core/Util"), f = a("../core/Heuristic"), g = a("../core/DiagonalMovement"); |
|
c.prototype.findPath = function(a, b, c, f, g) { |
|
var h, i, j, k, l, m, n, o, p = new d(function(a, b) { |
|
return a.f - b.f; |
|
}), q = g.getNodeAt(a, b), r = -999 != c ? g.getNodeAt(c, f) : null, s = this.heuristic, t = this.diagonalMovement, u = this.weight, v = Math.abs, w = (Math.SQRT2, |
|
q), x = 0; |
|
for (q.g = 0, q.f = 0, q.h = r ? u * s(v(a - c), v(b - f)) : 0, p.push(q), q.opened = !0; !p.empty(); ) { |
|
if (h = p.pop(), h.closed = !0, h === r || 999 == h.weight) return e.backtrace(h); |
|
if (x++, this.maxOpsLimit && x > this.maxOpsLimit) break; |
|
for (i = g.getNeighbors(h, t), k = 0, l = i.length; l > k; ++k) j = i[k], j.closed || (m = j.x, |
|
n = j.y, o = h.g + j.weight, (!j.opened || o < j.g) && (j.g = o, j.h = j.h || u * s(v(m - c), v(n - f)), |
|
j.f = j.g + j.h, j.parent = h, (j.h < w.h || j.h === w.h && j.g < w.g) && (w = j), |
|
j.opened ? p.updateItem(j) : (p.push(j), j.opened = !0))); |
|
} |
|
return e.backtrace(w); |
|
}, b.exports = c; |
|
}, { |
|
"../core/DiagonalMovement": 5, |
|
"../core/Heuristic": 7, |
|
"../core/Util": 9, |
|
heap: 2 |
|
} ], |
|
11: [ function(a, b) { |
|
function c(a) { |
|
d.call(this, a); |
|
var b = this.heuristic; |
|
this.heuristic = function(a, c) { |
|
return 1e6 * b(a, c); |
|
}; |
|
} |
|
var d = a("./AStarFinder"); |
|
c.prototype = new d(), c.prototype.constructor = c, b.exports = c; |
|
}, { |
|
"./AStarFinder": 10 |
|
} ], |
|
12: [ function(a, b) { |
|
function c(a) { |
|
a = a || {}, this.allowDiagonal = a.allowDiagonal, this.dontCrossCorners = a.dontCrossCorners, |
|
this.diagonalMovement = a.diagonalMovement, this.heuristic = a.heuristic || f.manhattan, |
|
this.weight = a.weight || 1, this.diagonalMovement || (this.diagonalMovement = this.allowDiagonal ? this.dontCrossCorners ? g.OnlyWhenNoObstacles : g.IfAtMostOneObstacle : g.Never), |
|
this.heuristic = this.diagonalMovement === g.Never ? a.heuristic || f.manhattan : a.heuristic || f.octile; |
|
} |
|
var d = a("heap"), e = a("../core/Util"), f = a("../core/Heuristic"), g = a("../core/DiagonalMovement"); |
|
c.prototype.findPath = function(a, b, c, f, g) { |
|
var h, i, j, k, l, m, n, o, p = function(a, b) { |
|
return a.f - b.f; |
|
}, q = new d(p), r = new d(p), s = g.getNodeAt(a, b), t = g.getNodeAt(c, f), u = this.heuristic, v = this.diagonalMovement, w = this.weight, x = Math.abs, y = Math.SQRT2, z = 1, A = 2; |
|
for (s.g = 0, s.f = 0, q.push(s), s.opened = z, t.g = 0, t.f = 0, r.push(t), t.opened = A; !q.empty() && !r.empty(); ) { |
|
for (h = q.pop(), h.closed = !0, i = g.getNeighbors(h, v), k = 0, l = i.length; l > k; ++k) if (j = i[k], |
|
!j.closed) { |
|
if (j.opened === A) return e.biBacktrace(h, j); |
|
m = j.x, n = j.y, o = h.g + (m - h.x === 0 || n - h.y === 0 ? 1 : y), (!j.opened || o < j.g) && (j.g = o, |
|
j.h = j.h || w * u(x(m - c), x(n - f)), j.f = j.g + j.h, j.parent = h, j.opened ? q.updateItem(j) : (q.push(j), |
|
j.opened = z)); |
|
} |
|
for (h = r.pop(), h.closed = !0, i = g.getNeighbors(h, v), k = 0, l = i.length; l > k; ++k) if (j = i[k], |
|
!j.closed) { |
|
if (j.opened === z) return e.biBacktrace(j, h); |
|
m = j.x, n = j.y, o = h.g + (m - h.x === 0 || n - h.y === 0 ? 1 : y), (!j.opened || o < j.g) && (j.g = o, |
|
j.h = j.h || w * u(x(m - a), x(n - b)), j.f = j.g + j.h, j.parent = h, j.opened ? r.updateItem(j) : (r.push(j), |
|
j.opened = A)); |
|
} |
|
} |
|
return []; |
|
}, b.exports = c; |
|
}, { |
|
"../core/DiagonalMovement": 5, |
|
"../core/Heuristic": 7, |
|
"../core/Util": 9, |
|
heap: 2 |
|
} ], |
|
13: [ function(a, b) { |
|
function c(a) { |
|
d.call(this, a); |
|
var b = this.heuristic; |
|
this.heuristic = function(a, c) { |
|
return 1e6 * b(a, c); |
|
}; |
|
} |
|
var d = a("./BiAStarFinder"); |
|
c.prototype = new d(), c.prototype.constructor = c, b.exports = c; |
|
}, { |
|
"./BiAStarFinder": 12 |
|
} ], |
|
14: [ function(a, b) { |
|
function c(a) { |
|
a = a || {}, this.allowDiagonal = a.allowDiagonal, this.dontCrossCorners = a.dontCrossCorners, |
|
this.diagonalMovement = a.diagonalMovement, this.diagonalMovement || (this.diagonalMovement = this.allowDiagonal ? this.dontCrossCorners ? e.OnlyWhenNoObstacles : e.IfAtMostOneObstacle : e.Never); |
|
} |
|
var d = a("../core/Util"), e = a("../core/DiagonalMovement"); |
|
c.prototype.findPath = function(a, b, c, e, f) { |
|
var g, h, i, j, k, l = f.getNodeAt(a, b), m = f.getNodeAt(c, e), n = [], o = [], p = this.diagonalMovement, q = 0, r = 1; |
|
for (n.push(l), l.opened = !0, l.by = q, o.push(m), m.opened = !0, m.by = r; n.length && o.length; ) { |
|
for (i = n.shift(), i.closed = !0, g = f.getNeighbors(i, p), j = 0, k = g.length; k > j; ++j) if (h = g[j], |
|
!h.closed) if (h.opened) { |
|
if (h.by === r) return d.biBacktrace(i, h); |
|
} else n.push(h), h.parent = i, h.opened = !0, h.by = q; |
|
for (i = o.shift(), i.closed = !0, g = f.getNeighbors(i, p), j = 0, k = g.length; k > j; ++j) if (h = g[j], |
|
!h.closed) if (h.opened) { |
|
if (h.by === q) return d.biBacktrace(h, i); |
|
} else o.push(h), h.parent = i, h.opened = !0, h.by = r; |
|
} |
|
return []; |
|
}, b.exports = c; |
|
}, { |
|
"../core/DiagonalMovement": 5, |
|
"../core/Util": 9 |
|
} ], |
|
15: [ function(a, b) { |
|
function c(a) { |
|
d.call(this, a), this.heuristic = function() { |
|
return 0; |
|
}; |
|
} |
|
var d = a("./BiAStarFinder"); |
|
c.prototype = new d(), c.prototype.constructor = c, b.exports = c; |
|
}, { |
|
"./BiAStarFinder": 12 |
|
} ], |
|
16: [ function(a, b) { |
|
function c(a) { |
|
a = a || {}, this.allowDiagonal = a.allowDiagonal, this.dontCrossCorners = a.dontCrossCorners, |
|
this.diagonalMovement = a.diagonalMovement, this.diagonalMovement || (this.diagonalMovement = this.allowDiagonal ? this.dontCrossCorners ? e.OnlyWhenNoObstacles : e.IfAtMostOneObstacle : e.Never); |
|
} |
|
var d = a("../core/Util"), e = a("../core/DiagonalMovement"); |
|
c.prototype.findPath = function(a, b, c, e, f) { |
|
var g, h, i, j, k, l = [], m = this.diagonalMovement, n = f.getNodeAt(a, b), o = f.getNodeAt(c, e); |
|
for (l.push(n), n.opened = !0; l.length; ) { |
|
if (i = l.shift(), i.closed = !0, i === o) return d.backtrace(o); |
|
for (g = f.getNeighbors(i, m), j = 0, k = g.length; k > j; ++j) h = g[j], h.closed || h.opened || (l.push(h), |
|
h.opened = !0, h.parent = i); |
|
} |
|
return []; |
|
}, b.exports = c; |
|
}, { |
|
"../core/DiagonalMovement": 5, |
|
"../core/Util": 9 |
|
} ], |
|
17: [ function(a, b) { |
|
function c(a) { |
|
d.call(this, a), this.heuristic = function() { |
|
return 0; |
|
}; |
|
} |
|
var d = a("./AStarFinder"); |
|
c.prototype = new d(), c.prototype.constructor = c, b.exports = c; |
|
}, { |
|
"./AStarFinder": 10 |
|
} ], |
|
18: [ function(a, b) { |
|
function c(a) { |
|
a = a || {}, this.allowDiagonal = a.allowDiagonal, this.dontCrossCorners = a.dontCrossCorners, |
|
this.diagonalMovement = a.diagonalMovement, this.heuristic = a.heuristic || d.manhattan, |
|
this.weight = a.weight || 1, this.trackRecursion = a.trackRecursion || !1, this.timeLimit = a.timeLimit || 1 / 0, |
|
this.diagonalMovement || (this.diagonalMovement = this.allowDiagonal ? this.dontCrossCorners ? f.OnlyWhenNoObstacles : f.IfAtMostOneObstacle : f.Never), |
|
this.heuristic = this.diagonalMovement === f.Never ? a.heuristic || d.manhattan : a.heuristic || d.octile; |
|
} |
|
var d = (a("../core/Util"), a("../core/Heuristic")), e = a("../core/Node"), f = a("../core/DiagonalMovement"); |
|
c.prototype.findPath = function(a, b, c, d, f) { |
|
var g, h, i, j = 0, k = new Date().getTime(), l = function(a, b) { |
|
return this.heuristic(Math.abs(b.x - a.x), Math.abs(b.y - a.y)); |
|
}.bind(this), m = function(a, b) { |
|
return a.x === b.x || a.y === b.y ? 1 : Math.SQRT2; |
|
}, n = function(a, b, c, d, g) { |
|
if (j++, this.timeLimit > 0 && new Date().getTime() - k > 1e3 * this.timeLimit) return 1 / 0; |
|
var h = b + l(a, p) * this.weight; |
|
if (h > c) return h; |
|
if (a == p) return d[g] = [ a.x, a.y ], a; |
|
var i, o, q, r, s = f.getNeighbors(a, this.diagonalMovement); |
|
for (q = 0, i = 1 / 0; r = s[q]; ++q) { |
|
if (this.trackRecursion && (r.retainCount = r.retainCount + 1 || 1, r.tested !== !0 && (r.tested = !0)), |
|
o = n(r, b + m(a, r), c, d, g + 1), o instanceof e) return d[g] = [ a.x, a.y ], |
|
o; |
|
this.trackRecursion && 0 === --r.retainCount && (r.tested = !1), i > o && (i = o); |
|
} |
|
return i; |
|
}.bind(this), o = f.getNodeAt(a, b), p = f.getNodeAt(c, d), q = l(o, p); |
|
for (g = 0; !0; ++g) { |
|
if (h = [], i = n(o, 0, q, h, 0), 1 / 0 === i) return []; |
|
if (i instanceof e) return h; |
|
q = i; |
|
} |
|
return []; |
|
}, b.exports = c; |
|
}, { |
|
"../core/DiagonalMovement": 5, |
|
"../core/Heuristic": 7, |
|
"../core/Node": 8, |
|
"../core/Util": 9 |
|
} ], |
|
19: [ function(a, b) { |
|
function c(a) { |
|
d.call(this, a); |
|
} |
|
var d = a("./JumpPointFinderBase"), e = a("../core/DiagonalMovement"); |
|
c.prototype = new d(), c.prototype.constructor = c, c.prototype._jump = function(a, b, c, d) { |
|
var e = this.grid, f = a - c, g = b - d; |
|
if (!e.isWalkableAt(a, b)) return null; |
|
if (this.trackJumpRecursion === !0 && (e.getNodeAt(a, b).tested = !0), e.getNodeAt(a, b) === this.endNode) return [ a, b ]; |
|
if (0 !== f && 0 !== g) { |
|
if (e.isWalkableAt(a - f, b + g) && !e.isWalkableAt(a - f, b) || e.isWalkableAt(a + f, b - g) && !e.isWalkableAt(a, b - g)) return [ a, b ]; |
|
if (this._jump(a + f, b, a, b) || this._jump(a, b + g, a, b)) return [ a, b ]; |
|
} else if (0 !== f) { |
|
if (e.isWalkableAt(a + f, b + 1) && !e.isWalkableAt(a, b + 1) || e.isWalkableAt(a + f, b - 1) && !e.isWalkableAt(a, b - 1)) return [ a, b ]; |
|
} else if (e.isWalkableAt(a + 1, b + g) && !e.isWalkableAt(a + 1, b) || e.isWalkableAt(a - 1, b + g) && !e.isWalkableAt(a - 1, b)) return [ a, b ]; |
|
return this._jump(a + f, b + g, a, b); |
|
}, c.prototype._findNeighbors = function(a) { |
|
var b, c, d, f, g, h, i, j, k = a.parent, l = a.x, m = a.y, n = this.grid, o = []; |
|
if (k) b = k.x, c = k.y, d = (l - b) / Math.max(Math.abs(l - b), 1), f = (m - c) / Math.max(Math.abs(m - c), 1), |
|
0 !== d && 0 !== f ? (n.isWalkableAt(l, m + f) && o.push([ l, m + f ]), n.isWalkableAt(l + d, m) && o.push([ l + d, m ]), |
|
n.isWalkableAt(l + d, m + f) && o.push([ l + d, m + f ]), n.isWalkableAt(l - d, m) || o.push([ l - d, m + f ]), |
|
n.isWalkableAt(l, m - f) || o.push([ l + d, m - f ])) : 0 === d ? (n.isWalkableAt(l, m + f) && o.push([ l, m + f ]), |
|
n.isWalkableAt(l + 1, m) || o.push([ l + 1, m + f ]), n.isWalkableAt(l - 1, m) || o.push([ l - 1, m + f ])) : (n.isWalkableAt(l + d, m) && o.push([ l + d, m ]), |
|
n.isWalkableAt(l, m + 1) || o.push([ l + d, m + 1 ]), n.isWalkableAt(l, m - 1) || o.push([ l + d, m - 1 ])); else for (g = n.getNeighbors(a, e.Always), |
|
i = 0, j = g.length; j > i; ++i) h = g[i], o.push([ h.x, h.y ]); |
|
return o; |
|
}, b.exports = c; |
|
}, { |
|
"../core/DiagonalMovement": 5, |
|
"./JumpPointFinderBase": 24 |
|
} ], |
|
20: [ function(a, b) { |
|
function c(a) { |
|
d.call(this, a); |
|
} |
|
var d = a("./JumpPointFinderBase"), e = a("../core/DiagonalMovement"); |
|
c.prototype = new d(), c.prototype.constructor = c, c.prototype._jump = function(a, b, c, d) { |
|
var e = this.grid, f = a - c, g = b - d; |
|
if (!e.isWalkableAt(a, b)) return null; |
|
if (this.trackJumpRecursion === !0 && (e.getNodeAt(a, b).tested = !0), e.getNodeAt(a, b) === this.endNode) return [ a, b ]; |
|
if (0 !== f && 0 !== g) { |
|
if (e.isWalkableAt(a - f, b + g) && !e.isWalkableAt(a - f, b) || e.isWalkableAt(a + f, b - g) && !e.isWalkableAt(a, b - g)) return [ a, b ]; |
|
if (this._jump(a + f, b, a, b) || this._jump(a, b + g, a, b)) return [ a, b ]; |
|
} else if (0 !== f) { |
|
if (e.isWalkableAt(a + f, b + 1) && !e.isWalkableAt(a, b + 1) || e.isWalkableAt(a + f, b - 1) && !e.isWalkableAt(a, b - 1)) return [ a, b ]; |
|
} else if (e.isWalkableAt(a + 1, b + g) && !e.isWalkableAt(a + 1, b) || e.isWalkableAt(a - 1, b + g) && !e.isWalkableAt(a - 1, b)) return [ a, b ]; |
|
return e.isWalkableAt(a + f, b) || e.isWalkableAt(a, b + g) ? this._jump(a + f, b + g, a, b) : null; |
|
}, c.prototype._findNeighbors = function(a) { |
|
var b, c, d, f, g, h, i, j, k = a.parent, l = a.x, m = a.y, n = this.grid, o = []; |
|
if (k) b = k.x, c = k.y, d = (l - b) / Math.max(Math.abs(l - b), 1), f = (m - c) / Math.max(Math.abs(m - c), 1), |
|
0 !== d && 0 !== f ? (n.isWalkableAt(l, m + f) && o.push([ l, m + f ]), n.isWalkableAt(l + d, m) && o.push([ l + d, m ]), |
|
(n.isWalkableAt(l, m + f) || n.isWalkableAt(l + d, m)) && o.push([ l + d, m + f ]), |
|
!n.isWalkableAt(l - d, m) && n.isWalkableAt(l, m + f) && o.push([ l - d, m + f ]), |
|
!n.isWalkableAt(l, m - f) && n.isWalkableAt(l + d, m) && o.push([ l + d, m - f ])) : 0 === d ? n.isWalkableAt(l, m + f) && (o.push([ l, m + f ]), |
|
n.isWalkableAt(l + 1, m) || o.push([ l + 1, m + f ]), n.isWalkableAt(l - 1, m) || o.push([ l - 1, m + f ])) : n.isWalkableAt(l + d, m) && (o.push([ l + d, m ]), |
|
n.isWalkableAt(l, m + 1) || o.push([ l + d, m + 1 ]), n.isWalkableAt(l, m - 1) || o.push([ l + d, m - 1 ])); else for (g = n.getNeighbors(a, e.IfAtMostOneObstacle), |
|
i = 0, j = g.length; j > i; ++i) h = g[i], o.push([ h.x, h.y ]); |
|
return o; |
|
}, b.exports = c; |
|
}, { |
|
"../core/DiagonalMovement": 5, |
|
"./JumpPointFinderBase": 24 |
|
} ], |
|
21: [ function(a, b) { |
|
function c(a) { |
|
d.call(this, a); |
|
} |
|
var d = a("./JumpPointFinderBase"), e = a("../core/DiagonalMovement"); |
|
c.prototype = new d(), c.prototype.constructor = c, c.prototype._jump = function(a, b, c, d) { |
|
var e = this.grid, f = a - c, g = b - d; |
|
if (!e.isWalkableAt(a, b)) return null; |
|
if (this.trackJumpRecursion === !0 && (e.getNodeAt(a, b).tested = !0), e.getNodeAt(a, b) === this.endNode) return [ a, b ]; |
|
if (0 !== f && 0 !== g) { |
|
if (this._jump(a + f, b, a, b) || this._jump(a, b + g, a, b)) return [ a, b ]; |
|
} else if (0 !== f) { |
|
if (e.isWalkableAt(a, b - 1) && !e.isWalkableAt(a - f, b - 1) || e.isWalkableAt(a, b + 1) && !e.isWalkableAt(a - f, b + 1)) return [ a, b ]; |
|
} else if (0 !== g && (e.isWalkableAt(a - 1, b) && !e.isWalkableAt(a - 1, b - g) || e.isWalkableAt(a + 1, b) && !e.isWalkableAt(a + 1, b - g))) return [ a, b ]; |
|
return e.isWalkableAt(a + f, b) && e.isWalkableAt(a, b + g) ? this._jump(a + f, b + g, a, b) : null; |
|
}, c.prototype._findNeighbors = function(a) { |
|
var b, c, d, f, g, h, i, j, k = a.parent, l = a.x, m = a.y, n = this.grid, o = []; |
|
if (k) if (b = k.x, c = k.y, d = (l - b) / Math.max(Math.abs(l - b), 1), f = (m - c) / Math.max(Math.abs(m - c), 1), |
|
0 !== d && 0 !== f) n.isWalkableAt(l, m + f) && o.push([ l, m + f ]), n.isWalkableAt(l + d, m) && o.push([ l + d, m ]), |
|
n.isWalkableAt(l, m + f) && n.isWalkableAt(l + d, m) && o.push([ l + d, m + f ]); else { |
|
var p; |
|
if (0 !== d) { |
|
p = n.isWalkableAt(l + d, m); |
|
var q = n.isWalkableAt(l, m + 1), r = n.isWalkableAt(l, m - 1); |
|
p && (o.push([ l + d, m ]), q && o.push([ l + d, m + 1 ]), r && o.push([ l + d, m - 1 ])), |
|
q && o.push([ l, m + 1 ]), r && o.push([ l, m - 1 ]); |
|
} else if (0 !== f) { |
|
p = n.isWalkableAt(l, m + f); |
|
var s = n.isWalkableAt(l + 1, m), t = n.isWalkableAt(l - 1, m); |
|
p && (o.push([ l, m + f ]), s && o.push([ l + 1, m + f ]), t && o.push([ l - 1, m + f ])), |
|
s && o.push([ l + 1, m ]), t && o.push([ l - 1, m ]); |
|
} |
|
} else for (g = n.getNeighbors(a, e.OnlyWhenNoObstacles), i = 0, j = g.length; j > i; ++i) h = g[i], |
|
o.push([ h.x, h.y ]); |
|
return o; |
|
}, b.exports = c; |
|
}, { |
|
"../core/DiagonalMovement": 5, |
|
"./JumpPointFinderBase": 24 |
|
} ], |
|
22: [ function(a, b) { |
|
function c(a) { |
|
d.call(this, a); |
|
} |
|
var d = a("./JumpPointFinderBase"), e = a("../core/DiagonalMovement"); |
|
c.prototype = new d(), c.prototype.constructor = c, c.prototype._jump = function(a, b, c, d) { |
|
var e = this.grid, f = a - c, g = b - d; |
|
if (!e.isWalkableAt(a, b)) return null; |
|
if (this.trackJumpRecursion === !0 && (e.getNodeAt(a, b).tested = !0), e.getNodeAt(a, b) === this.endNode) return [ a, b ]; |
|
if (0 !== f) { |
|
if (e.isWalkableAt(a, b - 1) && !e.isWalkableAt(a - f, b - 1) || e.isWalkableAt(a, b + 1) && !e.isWalkableAt(a - f, b + 1)) return [ a, b ]; |
|
} else { |
|
if (0 === g) throw new Error("Only horizontal and vertical movements are allowed"); |
|
if (e.isWalkableAt(a - 1, b) && !e.isWalkableAt(a - 1, b - g) || e.isWalkableAt(a + 1, b) && !e.isWalkableAt(a + 1, b - g)) return [ a, b ]; |
|
if (this._jump(a + 1, b, a, b) || this._jump(a - 1, b, a, b)) return [ a, b ]; |
|
} |
|
return this._jump(a + f, b + g, a, b); |
|
}, c.prototype._findNeighbors = function(a) { |
|
var b, c, d, f, g, h, i, j, k = a.parent, l = a.x, m = a.y, n = this.grid, o = []; |
|
if (k) b = k.x, c = k.y, d = (l - b) / Math.max(Math.abs(l - b), 1), f = (m - c) / Math.max(Math.abs(m - c), 1), |
|
0 !== d ? (n.isWalkableAt(l, m - 1) && o.push([ l, m - 1 ]), n.isWalkableAt(l, m + 1) && o.push([ l, m + 1 ]), |
|
n.isWalkableAt(l + d, m) && o.push([ l + d, m ])) : 0 !== f && (n.isWalkableAt(l - 1, m) && o.push([ l - 1, m ]), |
|
n.isWalkableAt(l + 1, m) && o.push([ l + 1, m ]), n.isWalkableAt(l, m + f) && o.push([ l, m + f ])); else for (g = n.getNeighbors(a, e.Never), |
|
i = 0, j = g.length; j > i; ++i) h = g[i], o.push([ h.x, h.y ]); |
|
return o; |
|
}, b.exports = c; |
|
}, { |
|
"../core/DiagonalMovement": 5, |
|
"./JumpPointFinderBase": 24 |
|
} ], |
|
23: [ function(a, b) { |
|
function c(a) { |
|
return a = a || {}, a.diagonalMovement === d.Never ? new e(a) : a.diagonalMovement === d.Always ? new f(a) : a.diagonalMovement === d.OnlyWhenNoObstacles ? new g(a) : new h(a); |
|
} |
|
var d = a("../core/DiagonalMovement"), e = a("./JPFNeverMoveDiagonally"), f = a("./JPFAlwaysMoveDiagonally"), g = a("./JPFMoveDiagonallyIfNoObstacles"), h = a("./JPFMoveDiagonallyIfAtMostOneObstacle"); |
|
b.exports = c; |
|
}, { |
|
"../core/DiagonalMovement": 5, |
|
"./JPFAlwaysMoveDiagonally": 19, |
|
"./JPFMoveDiagonallyIfAtMostOneObstacle": 20, |
|
"./JPFMoveDiagonallyIfNoObstacles": 21, |
|
"./JPFNeverMoveDiagonally": 22 |
|
} ], |
|
24: [ function(a, b) { |
|
function c(a) { |
|
a = a || {}, this.heuristic = a.heuristic || f.manhattan, this.trackJumpRecursion = a.trackJumpRecursion || !1; |
|
} |
|
{ |
|
var d = a("heap"), e = a("../core/Util"), f = a("../core/Heuristic"); |
|
a("../core/DiagonalMovement"); |
|
} |
|
c.prototype.findPath = function(a, b, c, f, g) { |
|
var h, i = this.openList = new d(function(a, b) { |
|
return a.f - b.f; |
|
}), j = this.startNode = g.getNodeAt(a, b), k = this.endNode = g.getNodeAt(c, f); |
|
for (this.grid = g, j.g = 0, j.f = 0, i.push(j), j.opened = !0; !i.empty(); ) { |
|
if (h = i.pop(), h.closed = !0, h === k) return e.expandPath(e.backtrace(k)); |
|
this._identifySuccessors(h); |
|
} |
|
return []; |
|
}, c.prototype._identifySuccessors = function(a) { |
|
{ |
|
var b, c, d, e, g, h, i, j, k, l, m = this.grid, n = this.heuristic, o = this.openList, p = this.endNode.x, q = this.endNode.y, r = a.x, s = a.y, t = Math.abs; |
|
Math.max; |
|
} |
|
for (b = this._findNeighbors(a), e = 0, g = b.length; g > e; ++e) if (c = b[e], |
|
d = this._jump(c[0], c[1], r, s)) { |
|
if (h = d[0], i = d[1], l = m.getNodeAt(h, i), l.closed) continue; |
|
j = f.octile(t(h - r), t(i - s)), k = a.g + j, (!l.opened || k < l.g) && (l.g = k, |
|
l.h = l.h || n(t(h - p), t(i - q)), l.f = l.g + l.h, l.parent = a, l.opened ? o.updateItem(l) : (o.push(l), |
|
l.opened = !0)); |
|
} |
|
}, b.exports = c; |
|
}, { |
|
"../core/DiagonalMovement": 5, |
|
"../core/Heuristic": 7, |
|
"../core/Util": 9, |
|
heap: 2 |
|
} ], |
|
25: [ function(a, b) { |
|
!function() { |
|
"use strict"; |
|
function c(a) { |
|
for (var b in a) "_" != b[0] ? d.isArray(a[b]) ? a[b].forEach(c) : d.isObject(a[b]) && c(a[b]) : delete a[b]; |
|
} |
|
var d = (a("q"), a("./local-storage"), a("lodash")), e = a("./message-mux"); |
|
return b.exports = function() { |
|
var a = [], b = [], f = []; |
|
return { |
|
update: function(b, e) { |
|
e = d.cloneDeep(e), c(e), d.isObject(b) && (d.merge(b, e), b = b._id), a.push({ |
|
_id: b, |
|
data: e |
|
}); |
|
}, |
|
insert: function(a) { |
|
a = d.cloneDeep(a), c(a), b.push(a); |
|
}, |
|
remove: function(a) { |
|
f.push(a); |
|
}, |
|
execute: function() { |
|
return e.sendMessage({ |
|
type: "bulk", |
|
updates: a, |
|
inserts: b, |
|
removes: f |
|
}); |
|
} |
|
}; |
|
}, {}; |
|
}(); |
|
}, { |
|
"./local-storage": 29, |
|
"./message-mux": 30, |
|
lodash: 31, |
|
q: 32 |
|
} ], |
|
26: [ function(a, b) { |
|
!function() { |
|
"use strict"; |
|
return b.exports = { |
|
localStorage: { |
|
PENDING_QUEUE: "pendingQueue_", |
|
PROCESSING_QUEUE: "processingQueue_", |
|
USERS: "users", |
|
USERS_CODE: "users.code.activeSim", |
|
USERS_MEMORY: "users.memory", |
|
ROOMS: "rooms", |
|
ROOMS_OBJECTS: "rooms.objects", |
|
ROOMS_TERRAIN: "rooms.terrain", |
|
ROOMS_INTENTS: "rooms.intents", |
|
GAME_TIME: "gametime", |
|
RUN_TIMESTAMP: "runTimestamp", |
|
GAME_INFO: "gameinfo", |
|
REPLAY: "replay" |
|
} |
|
}, {}; |
|
}(); |
|
}, {} ], |
|
27: [ function(require, module, exports) { |
|
var $___46__46__95_simcore_47_src_47_core__ = function() { |
|
"use strict"; |
|
function EvalCodeError(a) { |
|
this.toString = function() { |
|
return a; |
|
}; |
|
} |
|
var __moduleName = ".._simcore/src/core"; |
|
return function() { |
|
var a = require("lodash"), b = require("q"), c = require("./config"), d = require("./local-storage"), e = require("./bulk"), f = require("./workers"), g = require("./message-mux"), h = { |
|
0: [], |
|
1: [], |
|
2: [] |
|
}, i = b.defer(), j = new Date().getTime(), k = require("../utils"); |
|
self.onmessage = function(a) { |
|
"setTickPeriod" == a.data.type ? i.resolve(a.data.period) : "worker" == a.data.type ? f.handleMessage(a.data) : a.data.consoleCommand ? h[a.data.userId].push({ |
|
expression: a.data.consoleCommand |
|
}) : g.handleMessage(a.data); |
|
}, setInterval(function() { |
|
d.get(c.localStorage.RUN_TIMESTAMP).then(function(a) { |
|
a > j && self.close(); |
|
}); |
|
}, 1e3), exports.queue = require("./queue"), exports.getTickPeriod = function() { |
|
return i.promise; |
|
}, exports.connect = function() { |
|
return b.all([ d.initArray(c.localStorage.USERS), d.initArray(c.localStorage.ROOMS, [ { |
|
_id: "sim" |
|
} ]), d.initArray(c.localStorage.ROOMS_OBJECTS), d.initArray(c.localStorage.ROOMS_INTENTS) ]); |
|
}, exports.setupRunner = function() {}, exports.setupProcessor = function() {}, |
|
exports.setupMain = function() {}, exports.getUserData = function(b) { |
|
return d.get(c.localStorage.USERS).then(function() { |
|
var c = new Object({ |
|
user: a.find(c[0], function(a) { |
|
return a._id == b; |
|
}), |
|
cpu: 1 / 0 |
|
}); |
|
return c; |
|
}); |
|
}, exports.getRuntimeData = function(e) { |
|
return b.all([ d.get(c.localStorage.USERS), d.get(c.localStorage.USERS_CODE).then(function(b) { |
|
return a.find(b, function(a) { |
|
return a._id == e; |
|
}); |
|
}), d.get(c.localStorage.ROOMS_OBJECTS), d.get(c.localStorage.ROOMS), d.get(c.localStorage.GAME_TIME), d.get(c.localStorage.ROOMS_TERRAIN), d.get(c.localStorage.USERS_MEMORY).then(function(b) { |
|
return a.find(b, function(a) { |
|
return a._id == e; |
|
}); |
|
}), d.get(c.localStorage.GAME_INFO) ]).then(function(b) { |
|
var b = new Object({ |
|
user: a.find(b[0], function(a) { |
|
return a._id == e; |
|
}), |
|
users: exports.mapById(b[0]), |
|
userCode: b[1] && b[1].modules, |
|
userCodeTimestamp: b[1] && b[1].timestamp || 0, |
|
userObjects: exports.mapById(a.filter(b[2], function(a) { |
|
return a.user == e; |
|
})), |
|
roomObjects: exports.mapById(b[2]), |
|
rooms: exports.mapById(b[3]), |
|
time: b[4], |
|
consoleCommands: h[e], |
|
roomTerrain: exports.mapById(b[5]), |
|
userMemory: b[6].memory, |
|
cpu: 1 / 0, |
|
games: { |
|
sim: b[7] |
|
} |
|
}); |
|
return h[e] = [], b; |
|
}); |
|
}, exports.getAllUsers = function() { |
|
return d.get(c.localStorage.USERS); |
|
}, exports.makeRuntime = function(a, c) { |
|
return exports.getRuntimeData(a, c).then(function(c) { |
|
var d = f.create("runtime"), e = b.defer(), h = !1, i = { |
|
type: "timeout", |
|
timeout: 5e3 |
|
}; |
|
return g.sendMessage(i).then(function() { |
|
h || (d.terminate(), e.reject("Script execution has been terminated")); |
|
}), d.onmessage = function(b) { |
|
"done" == b.data.type && (h = !0, g.sendMessage({ |
|
type: "clearTimeout", |
|
timeoutTransactionId: i.transactionId |
|
}), b.data.intents && (b.data.intents = k.storeIntents(a, b.data.intents, c)), e.resolve(b.data)), |
|
"error" == b.data.type && (h = !0, g.sendMessage({ |
|
type: "clearTimeout", |
|
timeoutTransactionId: i.transactionId |
|
}), b.data.intents && (b.data.intents = k.storeIntents(a, b.data.intents, c)), e.reject(b.data)); |
|
}, d.postMessage(c), e.promise; |
|
})["catch"](function(a) { |
|
return b.reject("error" == a.type ? a : { |
|
type: "reject" |
|
}); |
|
}); |
|
}, exports.saveUserMemory = function(b, e) { |
|
return d.get(c.localStorage.USERS_MEMORY).then(function(f) { |
|
var g = a.find(f, function(a) { |
|
return a._id == b; |
|
}); |
|
return g.memory = e, d.put(c.localStorage.USERS_MEMORY, f); |
|
}); |
|
}, exports.saveUserIntents = function(b, e) { |
|
return d.get(c.localStorage.ROOMS_INTENTS).then(function(f) { |
|
for (var g in e) if ("notify" != g) { |
|
var h = a.find(f, { |
|
room: g |
|
}); |
|
h || f.push(h = { |
|
room: g |
|
}), h.users = h.users || {}, h.users[b] = h.users[b] || { |
|
objects: {} |
|
}, a.merge(h.users[b].objects, e[g]); |
|
} |
|
return d.put(c.localStorage.ROOMS_INTENTS, f); |
|
}); |
|
}, exports.getAllRooms = function() { |
|
return d.get(c.localStorage.ROOMS); |
|
}, exports.getRoomIntents = function(b) { |
|
return d.get(c.localStorage.ROOMS_INTENTS).then(function(c) { |
|
return a.find(c, { |
|
room: b |
|
}); |
|
}); |
|
}, exports.getRoomObjects = function() { |
|
return d.get(c.localStorage.ROOMS_OBJECTS).then(function(a) { |
|
return exports.mapById(a); |
|
}); |
|
}, exports.getRoomTerrain = function() { |
|
return d.get(c.localStorage.ROOMS_TERRAIN).then(function(a) { |
|
return exports.mapById(a); |
|
}); |
|
}, exports.bulkObjectsWrite = function() { |
|
return e(c.localStorage.ROOMS_OBJECTS); |
|
}, exports.bulkUsersWrite = function() { |
|
return e(c.localStorage.USERS); |
|
}, exports.clearRoomIntents = function(b) { |
|
return d.get(c.localStorage.ROOMS_INTENTS).then(function(e) { |
|
return a.remove(e, { |
|
room: b |
|
}), d.put(c.localStorage.ROOMS_INTENTS, e); |
|
}); |
|
}, exports.mapById = function(b) { |
|
return a.reduce(b, function(a, b) { |
|
return a[b._id.toString()] = b, a; |
|
}, {}); |
|
}, exports.notifyRoomsDone = function() { |
|
return g.sendMessage({ |
|
type: "roomsDone" |
|
}); |
|
}, exports.sendConsoleMessages = function(a, b) { |
|
self.postMessage({ |
|
type: "console", |
|
userId: a, |
|
messages: b |
|
}); |
|
}, exports.sendConsoleError = function(a, b) { |
|
"undefined" != typeof self, self.postMessage({ |
|
type: "console", |
|
userId: a, |
|
error: "" + b |
|
}); |
|
}, exports.getGameTime = function() { |
|
return d.get(c.localStorage.GAME_TIME); |
|
}, exports.incrementGameTime = function() { |
|
return d.get(c.localStorage.GAME_TIME).then(function(a) { |
|
return a++, d.put(c.localStorage.GAME_TIME, a); |
|
}); |
|
}, exports.getGameInfo = function() { |
|
return d.get(c.localStorage.GAME_INFO); |
|
}, exports.saveGameInfo = function(a, b) { |
|
return d.get(c.localStorage.REPLAY).then(function(e) { |
|
return e.log[a.score] = k.getDiff(e.current, b), e.current = b, d.put(c.localStorage.REPLAY, e); |
|
}).then(function() { |
|
return d.put(c.localStorage.GAME_INFO, a); |
|
}); |
|
}, exports.finishGame = function() {}, exports.sendUsageMetrics = function() {}, |
|
exports.getInterRoom = function() { |
|
return b.when([]); |
|
}, exports.deactivateRoom = function() { |
|
return b.when(null); |
|
}, exports.saveAccessibleRoomsList = function() { |
|
return b.when(null); |
|
}, exports.sendNotification = function() { |
|
return b.when(null); |
|
}, exports.getRoomStatsUpdater = function() { |
|
return { |
|
inc: function() {}, |
|
save: function() { |
|
return b.when(null); |
|
} |
|
}; |
|
}, exports.roomsStatsSave = function() { |
|
return b.when(null); |
|
}, exports.saveIdleTime = function() { |
|
return b.when(null); |
|
}, exports.commitDbBulk = function() { |
|
return b.when(null); |
|
}, exports.notifyTickStarted = function() { |
|
return b.when(null); |
|
}, exports.flushTimelineStats = function() { |
|
return b.when(null); |
|
}, exports.cleanTimelineStats = function() { |
|
return b.when(null); |
|
}, exports.getMapGridData = function() { |
|
return {}; |
|
}, exports.mapViewSave = function() { |
|
return b.when(null); |
|
}, exports.history = require("./history"); |
|
}(), exports.evalCode = function(module, globals, returnValue) { |
|
var window, self, process, exports = module.exports, scopeInject = ""; |
|
for (var i in globals) scopeInject += i + " = __globals." + i + ", "; |
|
module.name = module.name.replace(/[^a-zA-Z0-9_]+/g, ""); |
|
try { |
|
if (returnValue) return eval("(function __run_" + module.name + "(__globals){ var " + scopeInject + "globals = undefined, __result = " + module.code + ";\n return __result; \n}).call(global, globals);"); |
|
"__mainLoop" != module.name && (module.code = "module.__initGlobals = function() { " + scopeInject.replace(/,/g, ";") + " }; " + module.code), |
|
eval("(function __run_" + module.name + "(__globals){ var " + scopeInject + "globals = undefined; " + module.code + " \n}).call(global, globals);"); |
|
} catch (e) { |
|
if (e instanceof EvalCodeError) throw e; |
|
var message = ""; |
|
if (/at Object\.exports\.evalCode /.test(e.stack)) { |
|
message = e.stack, message = message.replace(/at __run_([^ ]+) /g, "at $1 "), message = message.replace(/</g, "<"); |
|
var strip = [ "Object\\.eval", "Object\\.exports\\.evalCode", "Object\\.exports\\.runCode", "requireFn" ]; |
|
strip.forEach(function(a) { |
|
var b = new RegExp(" *at " + a + " [^\n]*?\n", "g"); |
|
message = message.replace(b, ""); |
|
}), message = message.replace(/ *at .*?$/, ""), message = message.replace(/ \([^\n]*\:(\d+)\:(\d+)\)\n/g, ":$1:$2\n"), |
|
message = message.replace(/_console\d+:\d+/g, "console"); |
|
} else message = e.message; |
|
throw new EvalCodeError(message); |
|
} |
|
}, {}; |
|
}(); |
|
}, { |
|
"../utils": 108, |
|
"./bulk": 25, |
|
"./config": 26, |
|
"./history": 28, |
|
"./local-storage": 29, |
|
"./message-mux": 30, |
|
"./queue": 33, |
|
"./workers": 36, |
|
lodash: 31, |
|
q: 32 |
|
} ], |
|
28: [ function(a, b, c) { |
|
!function() { |
|
"use strict"; |
|
var b = a("q"); |
|
return c.saveTick = function() { |
|
return b.when(); |
|
}, c.get = function() { |
|
return b.when(); |
|
}, c.upload = function() { |
|
return b.when(); |
|
}, c.del = function() { |
|
return b.when(); |
|
}, {}; |
|
}(); |
|
}, { |
|
q: 32 |
|
} ], |
|
29: [ function(a, b, c) { |
|
!function() { |
|
"use strict"; |
|
var b = (a("q"), a("./message-mux")); |
|
return c.put = function(a, c) { |
|
return b.sendMessage({ |
|
type: "localStorage", |
|
put: { |
|
key: a, |
|
value: c |
|
} |
|
}).then(function(a) { |
|
return a.put.value; |
|
}); |
|
}, c.get = function(a) { |
|
return b.sendMessage({ |
|
type: "localStorage", |
|
get: { |
|
key: a |
|
} |
|
}).then(function(a) { |
|
return a.get.value; |
|
}); |
|
}, c.initArray = function(a, b) { |
|
return c.get(a).then(function(d) { |
|
return d ? void 0 : c.put(a, b || []); |
|
}); |
|
}, {}; |
|
}(); |
|
}, { |
|
"./message-mux": 30, |
|
q: 32 |
|
} ], |
|
30: [ function(a, b, c) { |
|
!function() { |
|
"use strict"; |
|
var b = a("q"), d = {}, e = 0; |
|
return c.sendMessage = function(a) { |
|
return e++, d[e] = b.defer(), a.transactionId = e, self.postMessage(a), d[e].promise; |
|
}, c.handleMessage = function(a) { |
|
d[a.transactionId] && (a.reject ? d[a.transactionId].reject(a) : d[a.transactionId].resolve(a), |
|
delete d[a.transactionId]); |
|
}, {}; |
|
}(); |
|
}, { |
|
q: 32 |
|
} ], |
|
31: [ function(a, b, c) { |
|
(function(a) { |
|
(function() { |
|
function d(a, b) { |
|
if (a !== b) { |
|
var c = a === a, d = b === b; |
|
if (a > b || !c || a === z && d) return 1; |
|
if (b > a || !d || b === z && c) return -1; |
|
} |
|
return 0; |
|
} |
|
function e(a, b, c) { |
|
for (var d = a.length, e = c ? d : -1; c ? e-- : ++e < d; ) if (b(a[e], e, a)) return e; |
|
return -1; |
|
} |
|
function f(a, b, c) { |
|
if (b !== b) return q(a, c); |
|
for (var d = c - 1, e = a.length; ++d < e; ) if (a[d] === b) return d; |
|
return -1; |
|
} |
|
function g(a) { |
|
return "function" == typeof a || !1; |
|
} |
|
function h(a) { |
|
return "string" == typeof a ? a : null == a ? "" : a + ""; |
|
} |
|
function i(a) { |
|
return a.charCodeAt(0); |
|
} |
|
function j(a, b) { |
|
for (var c = -1, d = a.length; ++c < d && b.indexOf(a.charAt(c)) > -1; ) ; |
|
return c; |
|
} |
|
function k(a, b) { |
|
for (var c = a.length; c-- && b.indexOf(a.charAt(c)) > -1; ) ; |
|
return c; |
|
} |
|
function l(a, b) { |
|
return d(a.criteria, b.criteria) || a.index - b.index; |
|
} |
|
function m(a, b, c) { |
|
for (var e = -1, f = a.criteria, g = b.criteria, h = f.length, i = c.length; ++e < h; ) { |
|
var j = d(f[e], g[e]); |
|
if (j) return e >= i ? j : j * (c[e] ? 1 : -1); |
|
} |
|
return a.index - b.index; |
|
} |
|
function n(a) { |
|
return Tb[a]; |
|
} |
|
function o(a) { |
|
return Ub[a]; |
|
} |
|
function p(a) { |
|
return "\\" + Xb[a]; |
|
} |
|
function q(a, b, c) { |
|
for (var d = a.length, e = b + (c ? 0 : -1); c ? e-- : ++e < d; ) { |
|
var f = a[e]; |
|
if (f !== f) return e; |
|
} |
|
return -1; |
|
} |
|
function r(a) { |
|
return !!a && "object" == typeof a; |
|
} |
|
function s(a) { |
|
return 160 >= a && a >= 9 && 13 >= a || 32 == a || 160 == a || 5760 == a || 6158 == a || a >= 8192 && (8202 >= a || 8232 == a || 8233 == a || 8239 == a || 8287 == a || 12288 == a || 65279 == a); |
|
} |
|
function t(a, b) { |
|
for (var c = -1, d = a.length, e = -1, f = []; ++c < d; ) a[c] === b && (a[c] = S, |
|
f[++e] = c); |
|
return f; |
|
} |
|
function u(a, b) { |
|
for (var c, d = -1, e = a.length, f = -1, g = []; ++d < e; ) { |
|
var h = a[d], i = b ? b(h, d, a) : h; |
|
d && c === i || (c = i, g[++f] = h); |
|
} |
|
return g; |
|
} |
|
function v(a) { |
|
for (var b = -1, c = a.length; ++b < c && s(a.charCodeAt(b)); ) ; |
|
return b; |
|
} |
|
function w(a) { |
|
for (var b = a.length; b-- && s(a.charCodeAt(b)); ) ; |
|
return b; |
|
} |
|
function x(a) { |
|
return Vb[a]; |
|
} |
|
function y(a) { |
|
function b(a) { |
|
if (r(a) && !zi(a) && !(a instanceof Z)) { |
|
if (a instanceof s) return a; |
|
if (Qg.call(a, "__chain__") && Qg.call(a, "__wrapped__")) return fe(a); |
|
} |
|
return new s(a); |
|
} |
|
function c() {} |
|
function s(a, b, c) { |
|
this.__wrapped__ = a, this.__actions__ = c || [], this.__chain__ = !!b; |
|
} |
|
function Z(a) { |
|
this.__wrapped__ = a, this.__actions__ = null, this.__dir__ = 1, this.__dropCount__ = 0, |
|
this.__filtered__ = !1, this.__iteratees__ = null, this.__takeCount__ = vh, this.__views__ = null; |
|
} |
|
function bb() { |
|
var a = this.__actions__, b = this.__iteratees__, c = this.__views__, d = new Z(this.__wrapped__); |
|
return d.__actions__ = a ? ac(a) : null, d.__dir__ = this.__dir__, d.__filtered__ = this.__filtered__, |
|
d.__iteratees__ = b ? ac(b) : null, d.__takeCount__ = this.__takeCount__, d.__views__ = c ? ac(c) : null, |
|
d; |
|
} |
|
function db() { |
|
if (this.__filtered__) { |
|
var a = new Z(this); |
|
a.__dir__ = -1, a.__filtered__ = !0; |
|
} else a = this.clone(), a.__dir__ *= -1; |
|
return a; |
|
} |
|
function Tb() { |
|
var a = this.__wrapped__.value(); |
|
if (!zi(a)) return ad(a, this.__actions__); |
|
var b = this.__dir__, c = 0 > b, d = Md(0, a.length, this.__views__), e = d.start, f = d.end, g = f - e, h = c ? f : e - 1, i = ph(g, this.__takeCount__), j = this.__iteratees__, k = j ? j.length : 0, l = 0, m = []; |
|
a: for (;g-- && i > l; ) { |
|
h += b; |
|
for (var n = -1, o = a[h]; ++n < k; ) { |
|
var p = j[n], q = p.iteratee, r = p.type; |
|
if (r == O) { |
|
if (p.done && (c ? h > p.index : h < p.index) && (p.count = 0, p.done = !1), p.index = h, |
|
!p.done) { |
|
var s = p.limit; |
|
if (!(p.done = s > -1 ? p.count++ >= s : !q(o))) continue a; |
|
} |
|
} else { |
|
var t = q(o); |
|
if (r == Q) o = t; else if (!t) { |
|
if (r == P) continue a; |
|
break a; |
|
} |
|
} |
|
} |
|
m[l++] = o; |
|
} |
|
return m; |
|
} |
|
function Ub() { |
|
this.__data__ = {}; |
|
} |
|
function Vb(a) { |
|
return this.has(a) && delete this.__data__[a]; |
|
} |
|
function Wb(a) { |
|
return "__proto__" == a ? z : this.__data__[a]; |
|
} |
|
function Xb(a) { |
|
return "__proto__" != a && Qg.call(this.__data__, a); |
|
} |
|
function Yb(a, b) { |
|
return "__proto__" != a && (this.__data__[a] = b), this; |
|
} |
|
function Zb(a) { |
|
var b = a ? a.length : 0; |
|
for (this.data = { |
|
hash: lh(null), |
|
set: new dh() |
|
}; b--; ) this.push(a[b]); |
|
} |
|
function $b(a, b) { |
|
var c = a.data, d = "string" == typeof b || yf(b) ? c.set.has(b) : c.hash[b]; |
|
return d ? 0 : -1; |
|
} |
|
function _b(a) { |
|
var b = this.data; |
|
"string" == typeof a || yf(a) ? b.set.add(a) : b.hash[a] = !0; |
|
} |
|
function ac(a, b) { |
|
var c = -1, d = a.length; |
|
for (b || (b = Bg(d)); ++c < d; ) b[c] = a[c]; |
|
return b; |
|
} |
|
function bc(a, b) { |
|
for (var c = -1, d = a.length; ++c < d && b(a[c], c, a) !== !1; ) ; |
|
return a; |
|
} |
|
function ec(a, b) { |
|
for (var c = a.length; c-- && b(a[c], c, a) !== !1; ) ; |
|
return a; |
|
} |
|
function fc(a, b) { |
|
for (var c = -1, d = a.length; ++c < d; ) if (!b(a[c], c, a)) return !1; |
|
return !0; |
|
} |
|
function gc(a, b) { |
|
for (var c = -1, d = a.length, e = -1, f = []; ++c < d; ) { |
|
var g = a[c]; |
|
b(g, c, a) && (f[++e] = g); |
|
} |
|
return f; |
|
} |
|
function hc(a, b) { |
|
for (var c = -1, d = a.length, e = Bg(d); ++c < d; ) e[c] = b(a[c], c, a); |
|
return e; |
|
} |
|
function ic(a) { |
|
for (var b = -1, c = a.length, d = uh; ++b < c; ) { |
|
var e = a[b]; |
|
e > d && (d = e); |
|
} |
|
return d; |
|
} |
|
function jc(a) { |
|
for (var b = -1, c = a.length, d = vh; ++b < c; ) { |
|
var e = a[b]; |
|
d > e && (d = e); |
|
} |
|
return d; |
|
} |
|
function kc(a, b, c, d) { |
|
var e = -1, f = a.length; |
|
for (d && f && (c = a[++e]); ++e < f; ) c = b(c, a[e], e, a); |
|
return c; |
|
} |
|
function lc(a, b, c, d) { |
|
var e = a.length; |
|
for (d && e && (c = a[--e]); e--; ) c = b(c, a[e], e, a); |
|
return c; |
|
} |
|
function mc(a, b) { |
|
for (var c = -1, d = a.length; ++c < d; ) if (b(a[c], c, a)) return !0; |
|
return !1; |
|
} |
|
function nc(a) { |
|
for (var b = a.length, c = 0; b--; ) c += +a[b] || 0; |
|
return c; |
|
} |
|
function oc(a, b) { |
|
return a === z ? b : a; |
|
} |
|
function pc(a, b, c, d) { |
|
return a !== z && Qg.call(d, c) ? a : b; |
|
} |
|
function qc(a, b, c) { |
|
var d = Li(b); |
|
ah.apply(d, Ph(b)); |
|
for (var e = -1, f = d.length; ++e < f; ) { |
|
var g = d[e], h = a[g], i = c(h, b[g], g, a, b); |
|
(i === i ? i === h : h !== h) && (h !== z || g in a) || (a[g] = i); |
|
} |
|
return a; |
|
} |
|
function rc(a, b) { |
|
for (var c = -1, d = null == a, e = !d && Rd(a), f = e && a.length, g = b.length, h = Bg(g); ++c < g; ) { |
|
var i = b[c]; |
|
h[c] = e ? Sd(i, f) ? a[i] : z : d ? z : a[i]; |
|
} |
|
return h; |
|
} |
|
function sc(a, b, c) { |
|
c || (c = {}); |
|
for (var d = -1, e = b.length; ++d < e; ) { |
|
var f = b[d]; |
|
c[f] = a[f]; |
|
} |
|
return c; |
|
} |
|
function tc(a, b, c) { |
|
var d = typeof a; |
|
return "function" == d ? b === z ? a : dd(a, b, c) : null == a ? og : "object" == d ? Lc(a) : b === z ? ug(a) : Mc(a, b); |
|
} |
|
function uc(a, b, c, d, e, f, g) { |
|
var h; |
|
if (c && (h = e ? c(a, d, e) : c(a)), h !== z) return h; |
|
if (!yf(a)) return a; |
|
var i = zi(a); |
|
if (i) { |
|
if (h = Nd(a), !b) return ac(a, h); |
|
} else { |
|
var j = Sg.call(a), k = j == Y; |
|
if (j != _ && j != T && (!k || e)) return Rb[j] ? Pd(a, j, b) : e ? a : {}; |
|
if (h = Od(k ? {} : a), !b) return Eh(h, a); |
|
} |
|
f || (f = []), g || (g = []); |
|
for (var l = f.length; l--; ) if (f[l] == a) return g[l]; |
|
return f.push(a), g.push(h), (i ? bc : Dc)(a, function(d, e) { |
|
h[e] = uc(d, b, c, e, a, f, g); |
|
}), h; |
|
} |
|
function vc(a, b, c) { |
|
if ("function" != typeof a) throw new Kg(R); |
|
return eh(function() { |
|
a.apply(z, c); |
|
}, b); |
|
} |
|
function wc(a, b) { |
|
var c = a ? a.length : 0, d = []; |
|
if (!c) return d; |
|
var e = -1, g = Ld(), h = g == f, i = h && b.length >= 200 ? Lh(b) : null, j = b.length; |
|
i && (g = $b, h = !1, b = i); |
|
a: for (;++e < c; ) { |
|
var k = a[e]; |
|
if (h && k === k) { |
|
for (var l = j; l--; ) if (b[l] === k) continue a; |
|
d.push(k); |
|
} else g(b, k, 0) < 0 && d.push(k); |
|
} |
|
return d; |
|
} |
|
function xc(a, b) { |
|
var c = !0; |
|
return Gh(a, function(a, d, e) { |
|
return c = !!b(a, d, e); |
|
}), c; |
|
} |
|
function yc(a, b, c, d) { |
|
var e = a.length; |
|
for (c = null == c ? 0 : +c || 0, 0 > c && (c = -c > e ? 0 : e + c), d = d === z || d > e ? e : +d || 0, |
|
0 > d && (d += e), e = c > d ? 0 : d >>> 0, c >>>= 0; e > c; ) a[c++] = b; |
|
return a; |
|
} |
|
function zc(a, b) { |
|
var c = []; |
|
return Gh(a, function(a, d, e) { |
|
b(a, d, e) && c.push(a); |
|
}), c; |
|
} |
|
function Ac(a, b, c, d) { |
|
var e; |
|
return c(a, function(a, c, f) { |
|
return b(a, c, f) ? (e = d ? c : a, !1) : void 0; |
|
}), e; |
|
} |
|
function Bc(a, b, c) { |
|
for (var d = -1, e = a.length, f = -1, g = []; ++d < e; ) { |
|
var h = a[d]; |
|
if (r(h) && Rd(h) && (c || zi(h) || rf(h))) { |
|
b && (h = Bc(h, b, c)); |
|
for (var i = -1, j = h.length; ++i < j; ) g[++f] = h[i]; |
|
} else c || (g[++f] = h); |
|
} |
|
return g; |
|
} |
|
function Cc(a, b) { |
|
return Ih(a, b, Pf); |
|
} |
|
function Dc(a, b) { |
|
return Ih(a, b, Li); |
|
} |
|
function Ec(a, b) { |
|
return Jh(a, b, Li); |
|
} |
|
function Fc(a, b) { |
|
for (var c = -1, d = b.length, e = -1, f = []; ++c < d; ) { |
|
var g = b[c]; |
|
Bi(a[g]) && (f[++e] = g); |
|
} |
|
return f; |
|
} |
|
function Gc(a, b, c) { |
|
if (null != a) { |
|
c !== z && c in de(a) && (b = [ c ]); |
|
for (var d = -1, e = b.length; null != a && ++d < e; ) a = a[b[d]]; |
|
return d && d == e ? a : z; |
|
} |
|
} |
|
function Hc(a, b, c, d, e, f) { |
|
if (a === b) return !0; |
|
var g = typeof a, h = typeof b; |
|
return "function" != g && "object" != g && "function" != h && "object" != h || null == a || null == b ? a !== a && b !== b : Ic(a, b, Hc, c, d, e, f); |
|
} |
|
function Ic(a, b, c, d, e, f, g) { |
|
var h = zi(a), i = zi(b), j = U, k = U; |
|
h || (j = Sg.call(a), j == T ? j = _ : j != _ && (h = Gf(a))), i || (k = Sg.call(b), |
|
k == T ? k = _ : k != _ && (i = Gf(b))); |
|
var l = j == _, m = k == _, n = j == k; |
|
if (n && !h && !l) return Hd(a, b, j); |
|
if (!e) { |
|
var o = l && Qg.call(a, "__wrapped__"), p = m && Qg.call(b, "__wrapped__"); |
|
if (o || p) return c(o ? a.value() : a, p ? b.value() : b, d, e, f, g); |
|
} |
|
if (!n) return !1; |
|
f || (f = []), g || (g = []); |
|
for (var q = f.length; q--; ) if (f[q] == a) return g[q] == b; |
|
f.push(a), g.push(b); |
|
var r = (h ? Gd : Id)(a, b, c, d, e, f, g); |
|
return f.pop(), g.pop(), r; |
|
} |
|
function Jc(a, b, c, d, e) { |
|
for (var f = -1, g = b.length, h = !e; ++f < g; ) if (h && d[f] ? c[f] !== a[b[f]] : !(b[f] in a)) return !1; |
|
for (f = -1; ++f < g; ) { |
|
var i = b[f], j = a[i], k = c[f]; |
|
if (h && d[f]) var l = j !== z || i in a; else l = e ? e(j, k, i) : z, l === z && (l = Hc(k, j, e, !0)); |
|
if (!l) return !1; |
|
} |
|
return !0; |
|
} |
|
function Kc(a, b) { |
|
var c = -1, d = Rd(a) ? Bg(a.length) : []; |
|
return Gh(a, function(a, e, f) { |
|
d[++c] = b(a, e, f); |
|
}), d; |
|
} |
|
function Lc(a) { |
|
var b = Li(a), c = b.length; |
|
if (!c) return ng(!0); |
|
if (1 == c) { |
|
var d = b[0], e = a[d]; |
|
if (Xd(e)) return function(a) { |
|
return null == a ? !1 : a[d] === e && (e !== z || d in de(a)); |
|
}; |
|
} |
|
for (var f = Bg(c), g = Bg(c); c--; ) e = a[b[c]], f[c] = e, g[c] = Xd(e); |
|
return function(a) { |
|
return null != a && Jc(de(a), b, f, g); |
|
}; |
|
} |
|
function Mc(a, b) { |
|
var c = zi(a), d = Ud(a) && Xd(b), e = a + ""; |
|
return a = ee(a), function(f) { |
|
if (null == f) return !1; |
|
var g = e; |
|
if (f = de(f), !(!c && d || g in f)) { |
|
if (f = 1 == a.length ? f : Gc(f, Uc(a, 0, -1)), null == f) return !1; |
|
g = te(a), f = de(f); |
|
} |
|
return f[g] === b ? b !== z || g in f : Hc(b, f[g], null, !0); |
|
}; |
|
} |
|
function Nc(a, b, c, d, e) { |
|
if (!yf(a)) return a; |
|
var f = Rd(b) && (zi(b) || Gf(b)); |
|
if (!f) { |
|
var g = Li(b); |
|
ah.apply(g, Ph(b)); |
|
} |
|
return bc(g || b, function(h, i) { |
|
if (g && (i = h, h = b[i]), r(h)) d || (d = []), e || (e = []), Oc(a, b, i, Nc, c, d, e); else { |
|
var j = a[i], k = c ? c(j, h, i, a, b) : z, l = k === z; |
|
l && (k = h), !f && k === z || !l && (k === k ? k === j : j !== j) || (a[i] = k); |
|
} |
|
}), a; |
|
} |
|
function Oc(a, b, c, d, e, f, g) { |
|
for (var h = f.length, i = b[c]; h--; ) if (f[h] == i) return void (a[c] = g[h]); |
|
var j = a[c], k = e ? e(j, i, c, a, b) : z, l = k === z; |
|
l && (k = i, Rd(i) && (zi(i) || Gf(i)) ? k = zi(j) ? j : Rd(j) ? ac(j) : [] : Ci(i) || rf(i) ? k = rf(j) ? Jf(j) : Ci(j) ? j : {} : l = !1), |
|
f.push(i), g.push(k), l ? a[c] = d(k, i, e, f, g) : (k === k ? k !== j : j === j) && (a[c] = k); |
|
} |
|
function Pc(a) { |
|
return function(b) { |
|
return null == b ? z : b[a]; |
|
}; |
|
} |
|
function Qc(a) { |
|
var b = a + ""; |
|
return a = ee(a), function(c) { |
|
return Gc(c, a, b); |
|
}; |
|
} |
|
function Rc(a, b) { |
|
for (var c = a ? b.length : 0; c--; ) { |
|
var d = parseFloat(b[c]); |
|
if (d != e && Sd(d)) { |
|
var e = d; |
|
fh.call(a, d, 1); |
|
} |
|
} |
|
return a; |
|
} |
|
function Sc(a, b) { |
|
return a + Zg(th() * (b - a + 1)); |
|
} |
|
function Tc(a, b, c, d, e) { |
|
return e(a, function(a, e, f) { |
|
c = d ? (d = !1, a) : b(c, a, e, f); |
|
}), c; |
|
} |
|
function Uc(a, b, c) { |
|
var d = -1, e = a.length; |
|
b = null == b ? 0 : +b || 0, 0 > b && (b = -b > e ? 0 : e + b), c = c === z || c > e ? e : +c || 0, |
|
0 > c && (c += e), e = b > c ? 0 : c - b >>> 0, b >>>= 0; |
|
for (var f = Bg(e); ++d < e; ) f[d] = a[d + b]; |
|
return f; |
|
} |
|
function Vc(a, b) { |
|
var c; |
|
return Gh(a, function(a, d, e) { |
|
return c = b(a, d, e), !c; |
|
}), !!c; |
|
} |
|
function Wc(a, b) { |
|
var c = a.length; |
|
for (a.sort(b); c--; ) a[c] = a[c].value; |
|
return a; |
|
} |
|
function Xc(a, b, c) { |
|
var d = Kd(), e = -1; |
|
b = hc(b, function(a) { |
|
return d(a); |
|
}); |
|
var f = Kc(a, function(a) { |
|
var c = hc(b, function(b) { |
|
return b(a); |
|
}); |
|
return { |
|
criteria: c, |
|
index: ++e, |
|
value: a |
|
}; |
|
}); |
|
return Wc(f, function(a, b) { |
|
return m(a, b, c); |
|
}); |
|
} |
|
function Yc(a, b) { |
|
var c = 0; |
|
return Gh(a, function(a, d, e) { |
|
c += +b(a, d, e) || 0; |
|
}), c; |
|
} |
|
function Zc(a, b) { |
|
var c = -1, d = Ld(), e = a.length, g = d == f, h = g && e >= 200, i = h ? Lh() : null, j = []; |
|
i ? (d = $b, g = !1) : (h = !1, i = b ? [] : j); |
|
a: for (;++c < e; ) { |
|
var k = a[c], l = b ? b(k, c, a) : k; |
|
if (g && k === k) { |
|
for (var m = i.length; m--; ) if (i[m] === l) continue a; |
|
b && i.push(l), j.push(k); |
|
} else d(i, l, 0) < 0 && ((b || h) && i.push(l), j.push(k)); |
|
} |
|
return j; |
|
} |
|
function $c(a, b) { |
|
for (var c = -1, d = b.length, e = Bg(d); ++c < d; ) e[c] = a[b[c]]; |
|
return e; |
|
} |
|
function _c(a, b, c, d) { |
|
for (var e = a.length, f = d ? e : -1; (d ? f-- : ++f < e) && b(a[f], f, a); ) ; |
|
return c ? Uc(a, d ? 0 : f, d ? f + 1 : e) : Uc(a, d ? f + 1 : 0, d ? e : f); |
|
} |
|
function ad(a, b) { |
|
var c = a; |
|
c instanceof Z && (c = c.value()); |
|
for (var d = -1, e = b.length; ++d < e; ) { |
|
var f = [ c ], g = b[d]; |
|
ah.apply(f, g.args), c = g.func.apply(g.thisArg, f); |
|
} |
|
return c; |
|
} |
|
function bd(a, b, c) { |
|
var d = 0, e = a ? a.length : d; |
|
if ("number" == typeof b && b === b && yh >= e) { |
|
for (;e > d; ) { |
|
var f = d + e >>> 1, g = a[f]; |
|
(c ? b >= g : b > g) ? d = f + 1 : e = f; |
|
} |
|
return e; |
|
} |
|
return cd(a, b, og, c); |
|
} |
|
function cd(a, b, c, d) { |
|
b = c(b); |
|
for (var e = 0, f = a ? a.length : 0, g = b !== b, h = b === z; f > e; ) { |
|
var i = Zg((e + f) / 2), j = c(a[i]), k = j === j; |
|
if (g) var l = k || d; else l = h ? k && (d || j !== z) : d ? b >= j : b > j; |
|
l ? e = i + 1 : f = i; |
|
} |
|
return ph(f, xh); |
|
} |
|
function dd(a, b, c) { |
|
if ("function" != typeof a) return og; |
|
if (b === z) return a; |
|
switch (c) { |
|
case 1: |
|
return function(c) { |
|
return a.call(b, c); |
|
}; |
|
|
|
case 3: |
|
return function(c, d, e) { |
|
return a.call(b, c, d, e); |
|
}; |
|
|
|
case 4: |
|
return function(c, d, e, f) { |
|
return a.call(b, c, d, e, f); |
|
}; |
|
|
|
case 5: |
|
return function(c, d, e, f, g) { |
|
return a.call(b, c, d, e, f, g); |
|
}; |
|
} |
|
return function() { |
|
return a.apply(b, arguments); |
|
}; |
|
} |
|
function ed(a) { |
|
return Wg.call(a, 0); |
|
} |
|
function fd(a, b, c) { |
|
for (var d = c.length, e = -1, f = oh(a.length - d, 0), g = -1, h = b.length, i = Bg(f + h); ++g < h; ) i[g] = b[g]; |
|
for (;++e < d; ) i[c[e]] = a[e]; |
|
for (;f--; ) i[g++] = a[e++]; |
|
return i; |
|
} |
|
function gd(a, b, c) { |
|
for (var d = -1, e = c.length, f = -1, g = oh(a.length - e, 0), h = -1, i = b.length, j = Bg(g + i); ++f < g; ) j[f] = a[f]; |
|
for (var k = f; ++h < i; ) j[k + h] = b[h]; |
|
for (;++d < e; ) j[k + c[d]] = a[f++]; |
|
return j; |
|
} |
|
function hd(a, b) { |
|
return function(c, d, e) { |
|
var f = b ? b() : {}; |
|
if (d = Kd(d, e, 3), zi(c)) for (var g = -1, h = c.length; ++g < h; ) { |
|
var i = c[g]; |
|
a(f, i, d(i, g, c), c); |
|
} else Gh(c, function(b, c, e) { |
|
a(f, b, d(b, c, e), e); |
|
}); |
|
return f; |
|
}; |
|
} |
|
function id(a) { |
|
return lf(function(b, c) { |
|
var d = -1, e = null == b ? 0 : c.length, f = e > 2 && c[e - 2], g = e > 2 && c[2], h = e > 1 && c[e - 1]; |
|
for ("function" == typeof f ? (f = dd(f, h, 5), e -= 2) : (f = "function" == typeof h ? h : null, |
|
e -= f ? 1 : 0), g && Td(c[0], c[1], g) && (f = 3 > e ? null : f, e = 1); ++d < e; ) { |
|
var i = c[d]; |
|
i && a(b, i, f); |
|
} |
|
return b; |
|
}); |
|
} |
|
function jd(a, b) { |
|
return function(c, d) { |
|
var e = c ? Oh(c) : 0; |
|
if (!Wd(e)) return a(c, d); |
|
for (var f = b ? e : -1, g = de(c); (b ? f-- : ++f < e) && d(g[f], f, g) !== !1; ) ; |
|
return c; |
|
}; |
|
} |
|
function kd(a) { |
|
return function(b, c, d) { |
|
for (var e = de(b), f = d(b), g = f.length, h = a ? g : -1; a ? h-- : ++h < g; ) { |
|
var i = f[h]; |
|
if (c(e[i], i, e) === !1) break; |
|
} |
|
return b; |
|
}; |
|
} |
|
function ld(a, b) { |
|
function c() { |
|
var e = this && this !== cc && this instanceof c ? d : a; |
|
return e.apply(b, arguments); |
|
} |
|
var d = nd(a); |
|
return c; |
|
} |
|
function md(a) { |
|
return function(b) { |
|
for (var c = -1, d = lg(Zf(b)), e = d.length, f = ""; ++c < e; ) f = a(f, d[c], c); |
|
return f; |
|
}; |
|
} |
|
function nd(a) { |
|
return function() { |
|
var b = Fh(a.prototype), c = a.apply(b, arguments); |
|
return yf(c) ? c : b; |
|
}; |
|
} |
|
function od(a) { |
|
function b(c, d, e) { |
|
e && Td(c, d, e) && (d = null); |
|
var f = Fd(c, a, null, null, null, null, null, d); |
|
return f.placeholder = b.placeholder, f; |
|
} |
|
return b; |
|
} |
|
function pd(a, b) { |
|
return function(c, d, e) { |
|
e && Td(c, d, e) && (d = null); |
|
var f = Kd(), g = null == d; |
|
if (f === tc && g || (g = !1, d = f(d, e, 3)), g) { |
|
var h = zi(c); |
|
if (h || !Ff(c)) return a(h ? c : ce(c)); |
|
d = i; |
|
} |
|
return Jd(c, d, b); |
|
}; |
|
} |
|
function qd(a, b) { |
|
return function(c, d, f) { |
|
if (d = Kd(d, f, 3), zi(c)) { |
|
var g = e(c, d, b); |
|
return g > -1 ? c[g] : z; |
|
} |
|
return Ac(c, d, a); |
|
}; |
|
} |
|
function rd(a) { |
|
return function(b, c, d) { |
|
return b && b.length ? (c = Kd(c, d, 3), e(b, c, a)) : -1; |
|
}; |
|
} |
|
function sd(a) { |
|
return function(b, c, d) { |
|
return c = Kd(c, d, 3), Ac(b, c, a, !0); |
|
}; |
|
} |
|
function td(a) { |
|
return function() { |
|
var b = arguments.length; |
|
if (!b) return function() { |
|
return arguments[0]; |
|
}; |
|
for (var c, d = a ? b : -1, e = 0, f = Bg(b); a ? d-- : ++d < b; ) { |
|
var g = f[e++] = arguments[d]; |
|
if ("function" != typeof g) throw new Kg(R); |
|
var h = c ? "" : Nh(g); |
|
c = "wrapper" == h ? new s([]) : c; |
|
} |
|
for (d = c ? -1 : b; ++d < b; ) { |
|
g = f[d], h = Nh(g); |
|
var i = "wrapper" == h ? Mh(g) : null; |
|
c = i && Vd(i[0]) && i[1] == (I | E | G | J) && !i[4].length && 1 == i[9] ? c[Nh(i[0])].apply(c, i[3]) : 1 == g.length && Vd(g) ? c[h]() : c.thru(g); |
|
} |
|
return function() { |
|
var a = arguments; |
|
if (c && 1 == a.length && zi(a[0])) return c.plant(a[0]).value(); |
|
for (var d = 0, e = f[d].apply(this, a); ++d < b; ) e = f[d].call(this, e); |
|
return e; |
|
}; |
|
}; |
|
} |
|
function ud(a, b) { |
|
return function(c, d, e) { |
|
return "function" == typeof d && e === z && zi(c) ? a(c, d) : b(c, dd(d, e, 3)); |
|
}; |
|
} |
|
function vd(a) { |
|
return function(b, c, d) { |
|
return ("function" != typeof c || d !== z) && (c = dd(c, d, 3)), a(b, c, Pf); |
|
}; |
|
} |
|
function wd(a) { |
|
return function(b, c, d) { |
|
return ("function" != typeof c || d !== z) && (c = dd(c, d, 3)), a(b, c); |
|
}; |
|
} |
|
function xd(a) { |
|
return function(b, c, d) { |
|
var e = {}; |
|
return c = Kd(c, d, 3), Dc(b, function(b, d, f) { |
|
var g = c(b, d, f); |
|
d = a ? g : d, b = a ? b : g, e[d] = b; |
|
}), e; |
|
}; |
|
} |
|
function yd(a) { |
|
return function(b, c, d) { |
|
return b = h(b), (a ? b : "") + Cd(b, c, d) + (a ? "" : b); |
|
}; |
|
} |
|
function zd(a) { |
|
var b = lf(function(c, d) { |
|
var e = t(d, b.placeholder); |
|
return Fd(c, a, null, d, e); |
|
}); |
|
return b; |
|
} |
|
function Ad(a, b) { |
|
return function(c, d, e, f) { |
|
var g = arguments.length < 3; |
|
return "function" == typeof d && f === z && zi(c) ? a(c, d, e, g) : Tc(c, Kd(d, f, 4), e, g, b); |
|
}; |
|
} |
|
function Bd(a, b, c, d, e, f, g, h, i, j) { |
|
function k() { |
|
for (var u = arguments.length, v = u, w = Bg(u); v--; ) w[v] = arguments[v]; |
|
if (d && (w = fd(w, d, e)), f && (w = gd(w, f, g)), o || q) { |
|
var x = k.placeholder, y = t(w, x); |
|
if (u -= y.length, j > u) { |
|
var A = h ? ac(h) : null, D = oh(j - u, 0), E = o ? y : null, F = o ? null : y, I = o ? w : null, J = o ? null : w; |
|
b |= o ? G : H, b &= ~(o ? H : G), p || (b &= ~(B | C)); |
|
var K = [ a, b, c, I, E, J, F, A, i, D ], L = Bd.apply(z, K); |
|
return Vd(a) && Qh(L, K), L.placeholder = x, L; |
|
} |
|
} |
|
var M = m ? c : this; |
|
n && (a = M[s]), h && (w = _d(w, h)), l && i < w.length && (w.length = i); |
|
var N = this && this !== cc && this instanceof k ? r || nd(a) : a; |
|
return N.apply(M, w); |
|
} |
|
var l = b & I, m = b & B, n = b & C, o = b & E, p = b & D, q = b & F, r = !n && nd(a), s = a; |
|
return k; |
|
} |
|
function Cd(a, b, c) { |
|
var d = a.length; |
|
if (b = +b, d >= b || !mh(b)) return ""; |
|
var e = b - d; |
|
return c = null == c ? " " : c + "", dg(c, Xg(e / c.length)).slice(0, e); |
|
} |
|
function Dd(a, b, c, d) { |
|
function e() { |
|
for (var b = -1, h = arguments.length, i = -1, j = d.length, k = Bg(h + j); ++i < j; ) k[i] = d[i]; |
|
for (;h--; ) k[i++] = arguments[++b]; |
|
var l = this && this !== cc && this instanceof e ? g : a; |
|
return l.apply(f ? c : this, k); |
|
} |
|
var f = b & B, g = nd(a); |
|
return e; |
|
} |
|
function Ed(a) { |
|
return function(b, c, d, e) { |
|
var f = Kd(d); |
|
return f === tc && null == d ? bd(b, c, a) : cd(b, c, f(d, e, 1), a); |
|
}; |
|
} |
|
function Fd(a, b, c, d, e, f, g, h) { |
|
var i = b & C; |
|
if (!i && "function" != typeof a) throw new Kg(R); |
|
var j = d ? d.length : 0; |
|
if (j || (b &= ~(G | H), d = e = null), j -= e ? e.length : 0, b & H) { |
|
var k = d, l = e; |
|
d = e = null; |
|
} |
|
var m = i ? null : Mh(a), n = [ a, b, c, d, e, k, l, f, g, h ]; |
|
if (m && (Yd(n, m), b = n[1], h = n[9]), n[9] = null == h ? i ? 0 : a.length : oh(h - j, 0) || 0, |
|
b == B) var o = ld(n[0], n[2]); else o = b != G && b != (B | G) || n[4].length ? Bd.apply(z, n) : Dd.apply(z, n); |
|
var p = m ? Kh : Qh; |
|
return p(o, n); |
|
} |
|
function Gd(a, b, c, d, e, f, g) { |
|
var h = -1, i = a.length, j = b.length, k = !0; |
|
if (i != j && !(e && j > i)) return !1; |
|
for (;k && ++h < i; ) { |
|
var l = a[h], m = b[h]; |
|
if (k = z, d && (k = e ? d(m, l, h) : d(l, m, h)), k === z) if (e) for (var n = j; n-- && (m = b[n], |
|
!(k = l && l === m || c(l, m, d, e, f, g))); ) ; else k = l && l === m || c(l, m, d, e, f, g); |
|
} |
|
return !!k; |
|
} |
|
function Hd(a, b, c) { |
|
switch (c) { |
|
case V: |
|
case W: |
|
return +a == +b; |
|
|
|
case X: |
|
return a.name == b.name && a.message == b.message; |
|
|
|
case $: |
|
return a != +a ? b != +b : a == +b; |
|
|
|
case ab: |
|
case cb: |
|
return a == b + ""; |
|
} |
|
return !1; |
|
} |
|
function Id(a, b, c, d, e, f, g) { |
|
var h = Li(a), i = h.length, j = Li(b), k = j.length; |
|
if (i != k && !e) return !1; |
|
for (var l = e, m = -1; ++m < i; ) { |
|
var n = h[m], o = e ? n in b : Qg.call(b, n); |
|
if (o) { |
|
var p = a[n], q = b[n]; |
|
o = z, d && (o = e ? d(q, p, n) : d(p, q, n)), o === z && (o = p && p === q || c(p, q, d, e, f, g)); |
|
} |
|
if (!o) return !1; |
|
l || (l = "constructor" == n); |
|
} |
|
if (!l) { |
|
var r = a.constructor, s = b.constructor; |
|
if (r != s && "constructor" in a && "constructor" in b && !("function" == typeof r && r instanceof r && "function" == typeof s && s instanceof s)) return !1; |
|
} |
|
return !0; |
|
} |
|
function Jd(a, b, c) { |
|
var d = c ? vh : uh, e = d, f = e; |
|
return Gh(a, function(a, g, h) { |
|
var i = b(a, g, h); |
|
((c ? e > i : i > e) || i === d && i === f) && (e = i, f = a); |
|
}), f; |
|
} |
|
function Kd(a, c, d) { |
|
var e = b.callback || mg; |
|
return e = e === mg ? tc : e, d ? e(a, c, d) : e; |
|
} |
|
function Ld(a, c, d) { |
|
var e = b.indexOf || qe; |
|
return e = e === qe ? f : e, a ? e(a, c, d) : e; |
|
} |
|
function Md(a, b, c) { |
|
for (var d = -1, e = c ? c.length : 0; ++d < e; ) { |
|
var f = c[d], g = f.size; |
|
switch (f.type) { |
|
case "drop": |
|
a += g; |
|
break; |
|
|
|
case "dropRight": |
|
b -= g; |
|
break; |
|
|
|
case "take": |
|
b = ph(b, a + g); |
|
break; |
|
|
|
case "takeRight": |
|
a = oh(a, b - g); |
|
} |
|
} |
|
return { |
|
start: a, |
|
end: b |
|
}; |
|
} |
|
function Nd(a) { |
|
var b = a.length, c = new a.constructor(b); |
|
return b && "string" == typeof a[0] && Qg.call(a, "index") && (c.index = a.index, |
|
c.input = a.input), c; |
|
} |
|
function Od(a) { |
|
var b = a.constructor; |
|
return "function" == typeof b && b instanceof b || (b = Hg), new b(); |
|
} |
|
function Pd(a, b, c) { |
|
var d = a.constructor; |
|
switch (b) { |
|
case eb: |
|
return ed(a); |
|
|
|
case V: |
|
case W: |
|
return new d(+a); |
|
|
|
case fb: |
|
case gb: |
|
case hb: |
|
case ib: |
|
case jb: |
|
case kb: |
|
case lb: |
|
case mb: |
|
case nb: |
|
var e = a.buffer; |
|
return new d(c ? ed(e) : e, a.byteOffset, a.length); |
|
|
|
case $: |
|
case cb: |
|
return new d(a); |
|
|
|
case ab: |
|
var f = new d(a.source, Gb.exec(a)); |
|
f.lastIndex = a.lastIndex; |
|
} |
|
return f; |
|
} |
|
function Qd(a, b, c) { |
|
null == a || Ud(b, a) || (b = ee(b), a = 1 == b.length ? a : Gc(a, Uc(b, 0, -1)), |
|
b = te(b)); |
|
var d = null == a ? a : a[b]; |
|
return null == d ? z : d.apply(a, c); |
|
} |
|
function Rd(a) { |
|
return null != a && Wd(Oh(a)); |
|
} |
|
function Sd(a, b) { |
|
return a = +a, b = null == b ? Ah : b, a > -1 && a % 1 == 0 && b > a; |
|
} |
|
function Td(a, b, c) { |
|
if (!yf(c)) return !1; |
|
var d = typeof b; |
|
if ("number" == d ? Rd(c) && Sd(b, c.length) : "string" == d && b in c) { |
|
var e = c[b]; |
|
return a === a ? a === e : e !== e; |
|
} |
|
return !1; |
|
} |
|
function Ud(a, b) { |
|
var c = typeof a; |
|
if ("string" == c && zb.test(a) || "number" == c) return !0; |
|
if (zi(a)) return !1; |
|
var d = !yb.test(a); |
|
return d || null != b && a in de(b); |
|
} |
|
function Vd(a) { |
|
var c = Nh(a); |
|
return !!c && a === b[c] && c in Z.prototype; |
|
} |
|
function Wd(a) { |
|
return "number" == typeof a && a > -1 && a % 1 == 0 && Ah >= a; |
|
} |
|
function Xd(a) { |
|
return a === a && !yf(a); |
|
} |
|
function Yd(a, b) { |
|
var c = a[1], d = b[1], e = c | d, f = I > e, g = d == I && c == E || d == I && c == J && a[7].length <= b[8] || d == (I | J) && c == E; |
|
if (!f && !g) return a; |
|
d & B && (a[2] = b[2], e |= c & B ? 0 : D); |
|
var h = b[3]; |
|
if (h) { |
|
var i = a[3]; |
|
a[3] = i ? fd(i, h, b[4]) : ac(h), a[4] = i ? t(a[3], S) : ac(b[4]); |
|
} |
|
return h = b[5], h && (i = a[5], a[5] = i ? gd(i, h, b[6]) : ac(h), a[6] = i ? t(a[5], S) : ac(b[6])), |
|
h = b[7], h && (a[7] = ac(h)), d & I && (a[8] = null == a[8] ? b[8] : ph(a[8], b[8])), |
|
null == a[9] && (a[9] = b[9]), a[0] = b[0], a[1] = e, a; |
|
} |
|
function Zd(a, b) { |
|
a = de(a); |
|
for (var c = -1, d = b.length, e = {}; ++c < d; ) { |
|
var f = b[c]; |
|
f in a && (e[f] = a[f]); |
|
} |
|
return e; |
|
} |
|
function $d(a, b) { |
|
var c = {}; |
|
return Cc(a, function(a, d, e) { |
|
b(a, d, e) && (c[d] = a); |
|
}), c; |
|
} |
|
function _d(a, b) { |
|
for (var c = a.length, d = ph(b.length, c), e = ac(a); d--; ) { |
|
var f = b[d]; |
|
a[d] = Sd(f, c) ? e[f] : z; |
|
} |
|
return a; |
|
} |
|
function ae(a) { |
|
{ |
|
var c; |
|
b.support; |
|
} |
|
if (!r(a) || Sg.call(a) != _ || !Qg.call(a, "constructor") && (c = a.constructor, |
|
"function" == typeof c && !(c instanceof c))) return !1; |
|
var d; |
|
return Cc(a, function(a, b) { |
|
d = b; |
|
}), d === z || Qg.call(a, d); |
|
} |
|
function be(a) { |
|
for (var c = Pf(a), d = c.length, e = d && a.length, f = b.support, g = e && Wd(e) && (zi(a) || f.nonEnumArgs && rf(a)), h = -1, i = []; ++h < d; ) { |
|
var j = c[h]; |
|
(g && Sd(j, e) || Qg.call(a, j)) && i.push(j); |
|
} |
|
return i; |
|
} |
|
function ce(a) { |
|
return null == a ? [] : Rd(a) ? yf(a) ? a : Hg(a) : Uf(a); |
|
} |
|
function de(a) { |
|
return yf(a) ? a : Hg(a); |
|
} |
|
function ee(a) { |
|
if (zi(a)) return a; |
|
var b = []; |
|
return h(a).replace(Ab, function(a, c, d, e) { |
|
b.push(d ? e.replace(Eb, "$1") : c || a); |
|
}), b; |
|
} |
|
function fe(a) { |
|
return a instanceof Z ? a.clone() : new s(a.__wrapped__, a.__chain__, ac(a.__actions__)); |
|
} |
|
function ge(a, b, c) { |
|
b = (c ? Td(a, b, c) : null == b) ? 1 : oh(+b || 1, 1); |
|
for (var d = 0, e = a ? a.length : 0, f = -1, g = Bg(Xg(e / b)); e > d; ) g[++f] = Uc(a, d, d += b); |
|
return g; |
|
} |
|
function he(a) { |
|
for (var b = -1, c = a ? a.length : 0, d = -1, e = []; ++b < c; ) { |
|
var f = a[b]; |
|
f && (e[++d] = f); |
|
} |
|
return e; |
|
} |
|
function ie(a, b, c) { |
|
var d = a ? a.length : 0; |
|
return d ? ((c ? Td(a, b, c) : null == b) && (b = 1), Uc(a, 0 > b ? 0 : b)) : []; |
|
} |
|
function je(a, b, c) { |
|
var d = a ? a.length : 0; |
|
return d ? ((c ? Td(a, b, c) : null == b) && (b = 1), b = d - (+b || 0), Uc(a, 0, 0 > b ? 0 : b)) : []; |
|
} |
|
function ke(a, b, c) { |
|
return a && a.length ? _c(a, Kd(b, c, 3), !0, !0) : []; |
|
} |
|
function le(a, b, c) { |
|
return a && a.length ? _c(a, Kd(b, c, 3), !0) : []; |
|
} |
|
function me(a, b, c, d) { |
|
var e = a ? a.length : 0; |
|
return e ? (c && "number" != typeof c && Td(a, b, c) && (c = 0, d = e), yc(a, b, c, d)) : []; |
|
} |
|
function ne(a) { |
|
return a ? a[0] : z; |
|
} |
|
function oe(a, b, c) { |
|
var d = a ? a.length : 0; |
|
return c && Td(a, b, c) && (b = !1), d ? Bc(a, b) : []; |
|
} |
|
function pe(a) { |
|
var b = a ? a.length : 0; |
|
return b ? Bc(a, !0) : []; |
|
} |
|
function qe(a, b, c) { |
|
var d = a ? a.length : 0; |
|
if (!d) return -1; |
|
if ("number" == typeof c) c = 0 > c ? oh(d + c, 0) : c; else if (c) { |
|
var e = bd(a, b), g = a[e]; |
|
return (b === b ? b === g : g !== g) ? e : -1; |
|
} |
|
return f(a, b, c || 0); |
|
} |
|
function re(a) { |
|
return je(a, 1); |
|
} |
|
function se() { |
|
for (var a = [], b = -1, c = arguments.length, d = [], e = Ld(), g = e == f, h = []; ++b < c; ) { |
|
var i = arguments[b]; |
|
Rd(i) && (a.push(i), d.push(g && i.length >= 120 ? Lh(b && i) : null)); |
|
} |
|
if (c = a.length, 2 > c) return h; |
|
var j = a[0], k = -1, l = j ? j.length : 0, m = d[0]; |
|
a: for (;++k < l; ) if (i = j[k], (m ? $b(m, i) : e(h, i, 0)) < 0) { |
|
for (b = c; --b; ) { |
|
var n = d[b]; |
|
if ((n ? $b(n, i) : e(a[b], i, 0)) < 0) continue a; |
|
} |
|
m && m.push(i), h.push(i); |
|
} |
|
return h; |
|
} |
|
function te(a) { |
|
var b = a ? a.length : 0; |
|
return b ? a[b - 1] : z; |
|
} |
|
function ue(a, b, c) { |
|
var d = a ? a.length : 0; |
|
if (!d) return -1; |
|
var e = d; |
|
if ("number" == typeof c) e = (0 > c ? oh(d + c, 0) : ph(c || 0, d - 1)) + 1; else if (c) { |
|
e = bd(a, b, !0) - 1; |
|
var f = a[e]; |
|
return (b === b ? b === f : f !== f) ? e : -1; |
|
} |
|
if (b !== b) return q(a, e, !0); |
|
for (;e--; ) if (a[e] === b) return e; |
|
return -1; |
|
} |
|
function ve() { |
|
var a = arguments, b = a[0]; |
|
if (!b || !b.length) return b; |
|
for (var c = 0, d = Ld(), e = a.length; ++c < e; ) for (var f = 0, g = a[c]; (f = d(b, g, f)) > -1; ) fh.call(b, f, 1); |
|
return b; |
|
} |
|
function we(a, b, c) { |
|
var d = []; |
|
if (!a || !a.length) return d; |
|
var e = -1, f = [], g = a.length; |
|
for (b = Kd(b, c, 3); ++e < g; ) { |
|
var h = a[e]; |
|
b(h, e, a) && (d.push(h), f.push(e)); |
|
} |
|
return Rc(a, f), d; |
|
} |
|
function xe(a) { |
|
return ie(a, 1); |
|
} |
|
function ye(a, b, c) { |
|
var d = a ? a.length : 0; |
|
return d ? (c && "number" != typeof c && Td(a, b, c) && (b = 0, c = d), Uc(a, b, c)) : []; |
|
} |
|
function ze(a, b, c) { |
|
var d = a ? a.length : 0; |
|
return d ? ((c ? Td(a, b, c) : null == b) && (b = 1), Uc(a, 0, 0 > b ? 0 : b)) : []; |
|
} |
|
function Ae(a, b, c) { |
|
var d = a ? a.length : 0; |
|
return d ? ((c ? Td(a, b, c) : null == b) && (b = 1), b = d - (+b || 0), Uc(a, 0 > b ? 0 : b)) : []; |
|
} |
|
function Be(a, b, c) { |
|
return a && a.length ? _c(a, Kd(b, c, 3), !1, !0) : []; |
|
} |
|
function Ce(a, b, c) { |
|
return a && a.length ? _c(a, Kd(b, c, 3)) : []; |
|
} |
|
function De(a, b, c, d) { |
|
var e = a ? a.length : 0; |
|
if (!e) return []; |
|
null != b && "boolean" != typeof b && (d = c, c = Td(a, b, d) ? null : b, b = !1); |
|
var g = Kd(); |
|
return (g !== tc || null != c) && (c = g(c, d, 3)), b && Ld() == f ? u(a, c) : Zc(a, c); |
|
} |
|
function Ee(a) { |
|
if (!a || !a.length) return []; |
|
var b = -1, c = 0; |
|
a = gc(a, function(a) { |
|
return Rd(a) ? (c = oh(a.length, c), !0) : void 0; |
|
}); |
|
for (var d = Bg(c); ++b < c; ) d[b] = hc(a, Pc(b)); |
|
return d; |
|
} |
|
function Fe(a, b, c) { |
|
var d = a ? a.length : 0; |
|
if (!d) return []; |
|
var e = Ee(a); |
|
return null == b ? e : (b = dd(b, c, 4), hc(e, function(a) { |
|
return kc(a, b, z, !0); |
|
})); |
|
} |
|
function Ge() { |
|
for (var a = -1, b = arguments.length; ++a < b; ) { |
|
var c = arguments[a]; |
|
if (Rd(c)) var d = d ? wc(d, c).concat(wc(c, d)) : c; |
|
} |
|
return d ? Zc(d) : []; |
|
} |
|
function He(a, b) { |
|
var c = -1, d = a ? a.length : 0, e = {}; |
|
for (!d || b || zi(a[0]) || (b = []); ++c < d; ) { |
|
var f = a[c]; |
|
b ? e[f] = b[c] : f && (e[f[0]] = f[1]); |
|
} |
|
return e; |
|
} |
|
function Ie(a) { |
|
var c = b(a); |
|
return c.__chain__ = !0, c; |
|
} |
|
function Je(a, b, c) { |
|
return b.call(c, a), a; |
|
} |
|
function Ke(a, b, c) { |
|
return b.call(c, a); |
|
} |
|
function Le() { |
|
return Ie(this); |
|
} |
|
function Me() { |
|
return new s(this.value(), this.__chain__); |
|
} |
|
function Ne(a) { |
|
for (var b, d = this; d instanceof c; ) { |
|
var e = fe(d); |
|
b ? f.__wrapped__ = e : b = e; |
|
var f = e; |
|
d = d.__wrapped__; |
|
} |
|
return f.__wrapped__ = a, b; |
|
} |
|
function Oe() { |
|
var a = this.__wrapped__; |
|
return a instanceof Z ? (this.__actions__.length && (a = new Z(this)), new s(a.reverse(), this.__chain__)) : this.thru(function(a) { |
|
return a.reverse(); |
|
}); |
|
} |
|
function Pe() { |
|
return this.value() + ""; |
|
} |
|
function Qe() { |
|
return ad(this.__wrapped__, this.__actions__); |
|
} |
|
function Re(a, b, c) { |
|
var d = zi(a) ? fc : xc; |
|
return c && Td(a, b, c) && (b = null), ("function" != typeof b || c !== z) && (b = Kd(b, c, 3)), |
|
d(a, b); |
|
} |
|
function Se(a, b, c) { |
|
var d = zi(a) ? gc : zc; |
|
return b = Kd(b, c, 3), d(a, b); |
|
} |
|
function Te(a, b) { |
|
return bi(a, Lc(b)); |
|
} |
|
function Ue(a, b, c, d) { |
|
var e = a ? Oh(a) : 0; |
|
return Wd(e) || (a = Uf(a), e = a.length), e ? (c = "number" != typeof c || d && Td(b, c, d) ? 0 : 0 > c ? oh(e + c, 0) : c || 0, |
|
"string" == typeof a || !zi(a) && Ff(a) ? e > c && a.indexOf(b, c) > -1 : Ld(a, b, c) > -1) : !1; |
|
} |
|
function Ve(a, b, c) { |
|
var d = zi(a) ? hc : Kc; |
|
return b = Kd(b, c, 3), d(a, b); |
|
} |
|
function We(a, b) { |
|
return Ve(a, ug(b)); |
|
} |
|
function Xe(a, b, c) { |
|
var d = zi(a) ? gc : zc; |
|
return b = Kd(b, c, 3), d(a, function(a, c, d) { |
|
return !b(a, c, d); |
|
}); |
|
} |
|
function Ye(a, b, c) { |
|
if (c ? Td(a, b, c) : null == b) { |
|
a = ce(a); |
|
var d = a.length; |
|
return d > 0 ? a[Sc(0, d - 1)] : z; |
|
} |
|
var e = Ze(a); |
|
return e.length = ph(0 > b ? 0 : +b || 0, e.length), e; |
|
} |
|
function Ze(a) { |
|
a = ce(a); |
|
for (var b = -1, c = a.length, d = Bg(c); ++b < c; ) { |
|
var e = Sc(0, b); |
|
b != e && (d[b] = d[e]), d[e] = a[b]; |
|
} |
|
return d; |
|
} |
|
function $e(a) { |
|
var b = a ? Oh(a) : 0; |
|
return Wd(b) ? b : Li(a).length; |
|
} |
|
function _e(a, b, c) { |
|
var d = zi(a) ? mc : Vc; |
|
return c && Td(a, b, c) && (b = null), ("function" != typeof b || c !== z) && (b = Kd(b, c, 3)), |
|
d(a, b); |
|
} |
|
function af(a, b, c) { |
|
if (null == a) return []; |
|
c && Td(a, b, c) && (b = null); |
|
var d = -1; |
|
b = Kd(b, c, 3); |
|
var e = Kc(a, function(a, c, e) { |
|
return { |
|
criteria: b(a, c, e), |
|
index: ++d, |
|
value: a |
|
}; |
|
}); |
|
return Wc(e, l); |
|
} |
|
function bf(a, b, c, d) { |
|
return null == a ? [] : (d && Td(b, c, d) && (c = null), zi(b) || (b = null == b ? [] : [ b ]), |
|
zi(c) || (c = null == c ? [] : [ c ]), Xc(a, b, c)); |
|
} |
|
function cf(a, b) { |
|
return Se(a, Lc(b)); |
|
} |
|
function df(a, b) { |
|
if ("function" != typeof b) { |
|
if ("function" != typeof a) throw new Kg(R); |
|
var c = a; |
|
a = b, b = c; |
|
} |
|
return a = mh(a = +a) ? a : 0, function() { |
|
return --a < 1 ? b.apply(this, arguments) : void 0; |
|
}; |
|
} |
|
function ef(a, b, c) { |
|
return c && Td(a, b, c) && (b = null), b = a && null == b ? a.length : oh(+b || 0, 0), |
|
Fd(a, I, null, null, null, null, b); |
|
} |
|
function ff(a, b) { |
|
var c; |
|
if ("function" != typeof b) { |
|
if ("function" != typeof a) throw new Kg(R); |
|
var d = a; |
|
a = b, b = d; |
|
} |
|
return function() { |
|
return --a > 0 && (c = b.apply(this, arguments)), 1 >= a && (b = null), c; |
|
}; |
|
} |
|
function gf(a, b, c) { |
|
function d() { |
|
m && Yg(m), i && Yg(i), i = m = n = z; |
|
} |
|
function e() { |
|
var c = b - (mi() - k); |
|
if (0 >= c || c > b) { |
|
i && Yg(i); |
|
var d = n; |
|
i = m = n = z, d && (o = mi(), j = a.apply(l, h), m || i || (h = l = null)); |
|
} else m = eh(e, c); |
|
} |
|
function f() { |
|
m && Yg(m), i = m = n = z, (q || p !== b) && (o = mi(), j = a.apply(l, h), m || i || (h = l = null)); |
|
} |
|
function g() { |
|
if (h = arguments, k = mi(), l = this, n = q && (m || !r), p === !1) var c = r && !m; else { |
|
i || r || (o = k); |
|
var d = p - (k - o), g = 0 >= d || d > p; |
|
g ? (i && (i = Yg(i)), o = k, j = a.apply(l, h)) : i || (i = eh(f, d)); |
|
} |
|
return g && m ? m = Yg(m) : m || b === p || (m = eh(e, b)), c && (g = !0, j = a.apply(l, h)), |
|
!g || m || i || (h = l = null), j; |
|
} |
|
var h, i, j, k, l, m, n, o = 0, p = !1, q = !0; |
|
if ("function" != typeof a) throw new Kg(R); |
|
if (b = 0 > b ? 0 : +b || 0, c === !0) { |
|
var r = !0; |
|
q = !1; |
|
} else yf(c) && (r = c.leading, p = "maxWait" in c && oh(+c.maxWait || 0, b), q = "trailing" in c ? c.trailing : q); |
|
return g.cancel = d, g; |
|
} |
|
function hf(a, b) { |
|
if ("function" != typeof a || b && "function" != typeof b) throw new Kg(R); |
|
var c = function() { |
|
var d = arguments, e = c.cache, f = b ? b.apply(this, d) : d[0]; |
|
if (e.has(f)) return e.get(f); |
|
var g = a.apply(this, d); |
|
return e.set(f, g), g; |
|
}; |
|
return c.cache = new hf.Cache(), c; |
|
} |
|
function jf(a) { |
|
if ("function" != typeof a) throw new Kg(R); |
|
return function() { |
|
return !a.apply(this, arguments); |
|
}; |
|
} |
|
function kf(a) { |
|
return ff(2, a); |
|
} |
|
function lf(a, b) { |
|
if ("function" != typeof a) throw new Kg(R); |
|
return b = oh(b === z ? a.length - 1 : +b || 0, 0), function() { |
|
for (var c = arguments, d = -1, e = oh(c.length - b, 0), f = Bg(e); ++d < e; ) f[d] = c[b + d]; |
|
switch (b) { |
|
case 0: |
|
return a.call(this, f); |
|
|
|
case 1: |
|
return a.call(this, c[0], f); |
|
|
|
case 2: |
|
return a.call(this, c[0], c[1], f); |
|
} |
|
var g = Bg(b + 1); |
|
for (d = -1; ++d < b; ) g[d] = c[d]; |
|
return g[b] = f, a.apply(this, g); |
|
}; |
|
} |
|
function mf(a) { |
|
if ("function" != typeof a) throw new Kg(R); |
|
return function(b) { |
|
return a.apply(this, b); |
|
}; |
|
} |
|
function nf(a, b, c) { |
|
var d = !0, e = !0; |
|
if ("function" != typeof a) throw new Kg(R); |
|
return c === !1 ? d = !1 : yf(c) && (d = "leading" in c ? !!c.leading : d, e = "trailing" in c ? !!c.trailing : e), |
|
Sb.leading = d, Sb.maxWait = +b, Sb.trailing = e, gf(a, b, Sb); |
|
} |
|
function of(a, b) { |
|
return b = null == b ? og : b, Fd(b, G, null, [ a ], []); |
|
} |
|
function pf(a, b, c, d) { |
|
return b && "boolean" != typeof b && Td(a, b, c) ? b = !1 : "function" == typeof b && (d = c, |
|
c = b, b = !1), c = "function" == typeof c && dd(c, d, 1), uc(a, b, c); |
|
} |
|
function qf(a, b, c) { |
|
return b = "function" == typeof b && dd(b, c, 1), uc(a, !0, b); |
|
} |
|
function rf(a) { |
|
return r(a) && Rd(a) && Sg.call(a) == T; |
|
} |
|
function sf(a) { |
|
return a === !0 || a === !1 || r(a) && Sg.call(a) == V; |
|
} |
|
function tf(a) { |
|
return r(a) && Sg.call(a) == W; |
|
} |
|
function uf(a) { |
|
return !!a && 1 === a.nodeType && r(a) && Sg.call(a).indexOf("Element") > -1; |
|
} |
|
function vf(a) { |
|
return null == a ? !0 : Rd(a) && (zi(a) || Ff(a) || rf(a) || r(a) && Bi(a.splice)) ? !a.length : !Li(a).length; |
|
} |
|
function wf(a, b, c, d) { |
|
if (c = "function" == typeof c && dd(c, d, 3), !c && Xd(a) && Xd(b)) return a === b; |
|
var e = c ? c(a, b) : z; |
|
return e === z ? Hc(a, b, c) : !!e; |
|
} |
|
function xf(a) { |
|
return r(a) && "string" == typeof a.message && Sg.call(a) == X; |
|
} |
|
function yf(a) { |
|
var b = typeof a; |
|
return "function" == b || !!a && "object" == b; |
|
} |
|
function zf(a, b, c, d) { |
|
var e = Li(b), f = e.length; |
|
if (!f) return !0; |
|
if (null == a) return !1; |
|
if (c = "function" == typeof c && dd(c, d, 3), a = de(a), !c && 1 == f) { |
|
var g = e[0], h = b[g]; |
|
if (Xd(h)) return h === a[g] && (h !== z || g in a); |
|
} |
|
for (var i = Bg(f), j = Bg(f); f--; ) h = i[f] = b[e[f]], j[f] = Xd(h); |
|
return Jc(a, e, i, j, c); |
|
} |
|
function Af(a) { |
|
return Df(a) && a != +a; |
|
} |
|
function Bf(a) { |
|
return null == a ? !1 : Sg.call(a) == Y ? Ug.test(Pg.call(a)) : r(a) && Ib.test(a); |
|
} |
|
function Cf(a) { |
|
return null === a; |
|
} |
|
function Df(a) { |
|
return "number" == typeof a || r(a) && Sg.call(a) == $; |
|
} |
|
function Ef(a) { |
|
return r(a) && Sg.call(a) == ab; |
|
} |
|
function Ff(a) { |
|
return "string" == typeof a || r(a) && Sg.call(a) == cb; |
|
} |
|
function Gf(a) { |
|
return r(a) && Wd(a.length) && !!Qb[Sg.call(a)]; |
|
} |
|
function Hf(a) { |
|
return a === z; |
|
} |
|
function If(a) { |
|
var b = a ? Oh(a) : 0; |
|
return Wd(b) ? b ? ac(a) : [] : Uf(a); |
|
} |
|
function Jf(a) { |
|
return sc(a, Pf(a)); |
|
} |
|
function Kf(a, b, c) { |
|
var d = Fh(a); |
|
return c && Td(a, b, c) && (b = null), b ? Eh(d, b) : d; |
|
} |
|
function Lf(a) { |
|
return Fc(a, Pf(a)); |
|
} |
|
function Mf(a, b, c) { |
|
var d = null == a ? z : Gc(a, ee(b), b + ""); |
|
return d === z ? c : d; |
|
} |
|
function Nf(a, b) { |
|
if (null == a) return !1; |
|
var c = Qg.call(a, b); |
|
return c || Ud(b) || (b = ee(b), a = 1 == b.length ? a : Gc(a, Uc(b, 0, -1)), b = te(b), |
|
c = null != a && Qg.call(a, b)), c; |
|
} |
|
function Of(a, b, c) { |
|
c && Td(a, b, c) && (b = null); |
|
for (var d = -1, e = Li(a), f = e.length, g = {}; ++d < f; ) { |
|
var h = e[d], i = a[h]; |
|
b ? Qg.call(g, i) ? g[i].push(h) : g[i] = [ h ] : g[i] = h; |
|
} |
|
return g; |
|
} |
|
function Pf(a) { |
|
if (null == a) return []; |
|
yf(a) || (a = Hg(a)); |
|
var b = a.length; |
|
b = b && Wd(b) && (zi(a) || Dh.nonEnumArgs && rf(a)) && b || 0; |
|
for (var c = a.constructor, d = -1, e = "function" == typeof c && c.prototype === a, f = Bg(b), g = b > 0; ++d < b; ) f[d] = d + ""; |
|
for (var h in a) g && Sd(h, b) || "constructor" == h && (e || !Qg.call(a, h)) || f.push(h); |
|
return f; |
|
} |
|
function Qf(a) { |
|
for (var b = -1, c = Li(a), d = c.length, e = Bg(d); ++b < d; ) { |
|
var f = c[b]; |
|
e[b] = [ f, a[f] ]; |
|
} |
|
return e; |
|
} |
|
function Rf(a, b, c) { |
|
var d = null == a ? z : a[b]; |
|
return d === z && (null == a || Ud(b, a) || (b = ee(b), a = 1 == b.length ? a : Gc(a, Uc(b, 0, -1)), |
|
d = null == a ? z : a[te(b)]), d = d === z ? c : d), Bi(d) ? d.call(a) : d; |
|
} |
|
function Sf(a, b, c) { |
|
if (null == a) return a; |
|
var d = b + ""; |
|
b = null != a[d] || Ud(b, a) ? [ d ] : ee(b); |
|
for (var e = -1, f = b.length, g = f - 1, h = a; null != h && ++e < f; ) { |
|
var i = b[e]; |
|
yf(h) && (e == g ? h[i] = c : null == h[i] && (h[i] = Sd(b[e + 1]) ? [] : {})), |
|
h = h[i]; |
|
} |
|
return a; |
|
} |
|
function Tf(a, b, c, d) { |
|
var e = zi(a) || Gf(a); |
|
if (b = Kd(b, d, 4), null == c) if (e || yf(a)) { |
|
var f = a.constructor; |
|
c = e ? zi(a) ? new f() : [] : Fh(Bi(f) && f.prototype); |
|
} else c = {}; |
|
return (e ? bc : Dc)(a, function(a, d, e) { |
|
return b(c, a, d, e); |
|
}), c; |
|
} |
|
function Uf(a) { |
|
return $c(a, Li(a)); |
|
} |
|
function Vf(a) { |
|
return $c(a, Pf(a)); |
|
} |
|
function Wf(a, b, c) { |
|
return b = +b || 0, "undefined" == typeof c ? (c = b, b = 0) : c = +c || 0, a >= ph(b, c) && a < oh(b, c); |
|
} |
|
function Xf(a, b, c) { |
|
c && Td(a, b, c) && (b = c = null); |
|
var d = null == a, e = null == b; |
|
if (null == c && (e && "boolean" == typeof a ? (c = a, a = 1) : "boolean" == typeof b && (c = b, |
|
e = !0)), d && e && (b = 1, e = !1), a = +a || 0, e ? (b = a, a = 0) : b = +b || 0, |
|
c || a % 1 || b % 1) { |
|
var f = th(); |
|
return ph(a + f * (b - a + parseFloat("1e-" + ((f + "").length - 1))), b); |
|
} |
|
return Sc(a, b); |
|
} |
|
function Yf(a) { |
|
return a = h(a), a && a.charAt(0).toUpperCase() + a.slice(1); |
|
} |
|
function Zf(a) { |
|
return a = h(a), a && a.replace(Jb, n).replace(Db, ""); |
|
} |
|
function $f(a, b, c) { |
|
a = h(a), b += ""; |
|
var d = a.length; |
|
return c = c === z ? d : ph(0 > c ? 0 : +c || 0, d), c -= b.length, c >= 0 && a.indexOf(b, c) == c; |
|
} |
|
function _f(a) { |
|
return a = h(a), a && ub.test(a) ? a.replace(sb, o) : a; |
|
} |
|
function ag(a) { |
|
return a = h(a), a && Cb.test(a) ? a.replace(Bb, "\\$&") : a; |
|
} |
|
function bg(a, b, c) { |
|
a = h(a), b = +b; |
|
var d = a.length; |
|
if (d >= b || !mh(b)) return a; |
|
var e = (b - d) / 2, f = Zg(e), g = Xg(e); |
|
return c = Cd("", g, c), c.slice(0, f) + a + c; |
|
} |
|
function cg(a, b, c) { |
|
return c && Td(a, b, c) && (b = 0), sh(a, b); |
|
} |
|
function dg(a, b) { |
|
var c = ""; |
|
if (a = h(a), b = +b, 1 > b || !a || !mh(b)) return c; |
|
do b % 2 && (c += a), b = Zg(b / 2), a += a; while (b); |
|
return c; |
|
} |
|
function eg(a, b, c) { |
|
return a = h(a), c = null == c ? 0 : ph(0 > c ? 0 : +c || 0, a.length), a.lastIndexOf(b, c) == c; |
|
} |
|
function fg(a, c, d) { |
|
var e = b.templateSettings; |
|
d && Td(a, c, d) && (c = d = null), a = h(a), c = qc(Eh({}, d || c), e, pc); |
|
var f, g, i = qc(Eh({}, c.imports), e.imports, pc), j = Li(i), k = $c(i, j), l = 0, m = c.interpolate || Kb, n = "__p += '", o = Ig((c.escape || Kb).source + "|" + m.source + "|" + (m === xb ? Fb : Kb).source + "|" + (c.evaluate || Kb).source + "|$", "g"), q = "//# sourceURL=" + ("sourceURL" in c ? c.sourceURL : "lodash.templateSources[" + ++Pb + "]") + "\n"; |
|
a.replace(o, function(b, c, d, e, h, i) { |
|
return d || (d = e), n += a.slice(l, i).replace(Lb, p), c && (f = !0, n += "' +\n__e(" + c + ") +\n'"), |
|
h && (g = !0, n += "';\n" + h + ";\n__p += '"), d && (n += "' +\n((__t = (" + d + ")) == null ? '' : __t) +\n'"), |
|
l = i + b.length, b; |
|
}), n += "';\n"; |
|
var r = c.variable; |
|
r || (n = "with (obj) {\n" + n + "\n}\n"), n = (g ? n.replace(ob, "") : n).replace(pb, "$1").replace(qb, "$1;"), |
|
n = "function(" + (r || "obj") + ") {\n" + (r ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (f ? ", __e = _.escape" : "") + (g ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + n + "return __p\n}"; |
|
var s = Xi(function() { |
|
return Eg(j, q + "return " + n).apply(z, k); |
|
}); |
|
if (s.source = n, xf(s)) throw s; |
|
return s; |
|
} |
|
function gg(a, b, c) { |
|
var d = a; |
|
return (a = h(a)) ? (c ? Td(d, b, c) : null == b) ? a.slice(v(a), w(a) + 1) : (b += "", |
|
a.slice(j(a, b), k(a, b) + 1)) : a; |
|
} |
|
function hg(a, b, c) { |
|
var d = a; |
|
return a = h(a), a ? a.slice((c ? Td(d, b, c) : null == b) ? v(a) : j(a, b + "")) : a; |
|
} |
|
function ig(a, b, c) { |
|
var d = a; |
|
return a = h(a), a ? (c ? Td(d, b, c) : null == b) ? a.slice(0, w(a) + 1) : a.slice(0, k(a, b + "") + 1) : a; |
|
} |
|
function jg(a, b, c) { |
|
c && Td(a, b, c) && (b = null); |
|
var d = K, e = L; |
|
if (null != b) if (yf(b)) { |
|
var f = "separator" in b ? b.separator : f; |
|
d = "length" in b ? +b.length || 0 : d, e = "omission" in b ? h(b.omission) : e; |
|
} else d = +b || 0; |
|
if (a = h(a), d >= a.length) return a; |
|
var g = d - e.length; |
|
if (1 > g) return e; |
|
var i = a.slice(0, g); |
|
if (null == f) return i + e; |
|
if (Ef(f)) { |
|
if (a.slice(g).search(f)) { |
|
var j, k, l = a.slice(0, g); |
|
for (f.global || (f = Ig(f.source, (Gb.exec(f) || "") + "g")), f.lastIndex = 0; j = f.exec(l); ) k = j.index; |
|
i = i.slice(0, null == k ? g : k); |
|
} |
|
} else if (a.indexOf(f, g) != g) { |
|
var m = i.lastIndexOf(f); |
|
m > -1 && (i = i.slice(0, m)); |
|
} |
|
return i + e; |
|
} |
|
function kg(a) { |
|
return a = h(a), a && tb.test(a) ? a.replace(rb, x) : a; |
|
} |
|
function lg(a, b, c) { |
|
return c && Td(a, b, c) && (b = null), a = h(a), a.match(b || Mb) || []; |
|
} |
|
function mg(a, b, c) { |
|
return c && Td(a, b, c) && (b = null), r(a) ? pg(a) : tc(a, b); |
|
} |
|
function ng(a) { |
|
return function() { |
|
return a; |
|
}; |
|
} |
|
function og(a) { |
|
return a; |
|
} |
|
function pg(a) { |
|
return Lc(uc(a, !0)); |
|
} |
|
function qg(a, b) { |
|
return Mc(a, uc(b, !0)); |
|
} |
|
function rg(a, b, c) { |
|
if (null == c) { |
|
var d = yf(b), e = d && Li(b), f = e && e.length && Fc(b, e); |
|
(f ? f.length : d) || (f = !1, c = b, b = a, a = this); |
|
} |
|
f || (f = Fc(b, Li(b))); |
|
var g = !0, h = -1, i = Bi(a), j = f.length; |
|
c === !1 ? g = !1 : yf(c) && "chain" in c && (g = c.chain); |
|
for (;++h < j; ) { |
|
var k = f[h], l = b[k]; |
|
a[k] = l, i && (a.prototype[k] = function(b) { |
|
return function() { |
|
var c = this.__chain__; |
|
if (g || c) { |
|
var d = a(this.__wrapped__), e = d.__actions__ = ac(this.__actions__); |
|
return e.push({ |
|
func: b, |
|
args: arguments, |
|
thisArg: a |
|
}), d.__chain__ = c, d; |
|
} |
|
var f = [ this.value() ]; |
|
return ah.apply(f, arguments), b.apply(a, f); |
|
}; |
|
}(l)); |
|
} |
|
return a; |
|
} |
|
function sg() { |
|
return a._ = Tg, this; |
|
} |
|
function tg() {} |
|
function ug(a) { |
|
return Ud(a) ? Pc(a) : Qc(a); |
|
} |
|
function vg(a) { |
|
return function(b) { |
|
return Gc(a, ee(b), b + ""); |
|
}; |
|
} |
|
function wg(a, b, c) { |
|
c && Td(a, b, c) && (b = c = null), a = +a || 0, c = null == c ? 1 : +c || 0, null == b ? (b = a, |
|
a = 0) : b = +b || 0; |
|
for (var d = -1, e = oh(Xg((b - a) / (c || 1)), 0), f = Bg(e); ++d < e; ) f[d] = a, |
|
a += c; |
|
return f; |
|
} |
|
function xg(a, b, c) { |
|
if (a = Zg(a), 1 > a || !mh(a)) return []; |
|
var d = -1, e = Bg(ph(a, wh)); |
|
for (b = dd(b, c, 1); ++d < a; ) wh > d ? e[d] = b(d) : b(d); |
|
return e; |
|
} |
|
function yg(a) { |
|
var b = ++Rg; |
|
return h(a) + b; |
|
} |
|
function zg(a, b) { |
|
return (+a || 0) + (+b || 0); |
|
} |
|
function Ag(a, b, c) { |
|
c && Td(a, b, c) && (b = null); |
|
var d = Kd(), e = null == b; |
|
return d === tc && e || (e = !1, b = d(b, c, 3)), e ? nc(zi(a) ? a : ce(a)) : Yc(a, b); |
|
} |
|
a = a ? dc.defaults(cc.Object(), a, dc.pick(cc, Ob)) : cc; |
|
var Bg = a.Array, Cg = a.Date, Dg = a.Error, Eg = a.Function, Fg = a.Math, Gg = a.Number, Hg = a.Object, Ig = a.RegExp, Jg = a.String, Kg = a.TypeError, Lg = Bg.prototype, Mg = Hg.prototype, Ng = Jg.prototype, Og = (Og = a.window) && Og.document, Pg = Eg.prototype.toString, Qg = Mg.hasOwnProperty, Rg = 0, Sg = Mg.toString, Tg = a._, Ug = Ig("^" + ag(Sg).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"), Vg = Bf(Vg = a.ArrayBuffer) && Vg, Wg = Bf(Wg = Vg && new Vg(0).slice) && Wg, Xg = Fg.ceil, Yg = a.clearTimeout, Zg = Fg.floor, $g = Bf($g = Hg.getOwnPropertySymbols) && $g, _g = Bf(_g = Hg.getPrototypeOf) && _g, ah = Lg.push, bh = Bf(bh = Hg.preventExtensions) && bh, ch = Mg.propertyIsEnumerable, dh = Bf(dh = a.Set) && dh, eh = a.setTimeout, fh = Lg.splice, gh = Bf(gh = a.Uint8Array) && gh, hh = Bf(hh = a.WeakMap) && hh, ih = function() { |
|
try { |
|
var b = Bf(b = a.Float64Array) && b, c = new b(new Vg(10), 0, 1) && b; |
|
} catch (d) {} |
|
return c; |
|
}(), jh = function() { |
|
var a = bh && Bf(a = Hg.assign) && a; |
|
try { |
|
if (a) { |
|
var b = bh({ |
|
1: 0 |
|
}); |
|
b[0] = 1; |
|
} |
|
} catch (c) { |
|
try { |
|
a(b, "xo"); |
|
} catch (c) {} |
|
return !b[1] && a; |
|
} |
|
return !1; |
|
}(), kh = Bf(kh = Bg.isArray) && kh, lh = Bf(lh = Hg.create) && lh, mh = a.isFinite, nh = Bf(nh = Hg.keys) && nh, oh = Fg.max, ph = Fg.min, qh = Bf(qh = Cg.now) && qh, rh = Bf(rh = Gg.isFinite) && rh, sh = a.parseInt, th = Fg.random, uh = Gg.NEGATIVE_INFINITY, vh = Gg.POSITIVE_INFINITY, wh = Fg.pow(2, 32) - 1, xh = wh - 1, yh = wh >>> 1, zh = ih ? ih.BYTES_PER_ELEMENT : 0, Ah = Fg.pow(2, 53) - 1, Bh = hh && new hh(), Ch = {}, Dh = b.support = {}; |
|
!function(a) { |
|
var b = function() { |
|
this.x = a; |
|
}, c = arguments, d = []; |
|
b.prototype = { |
|
valueOf: a, |
|
y: a |
|
}; |
|
for (var e in new b()) d.push(e); |
|
Dh.funcDecomp = /\bthis\b/.test(function() { |
|
return this; |
|
}), Dh.funcNames = "string" == typeof Eg.name; |
|
try { |
|
Dh.dom = 11 === Og.createDocumentFragment().nodeType; |
|
} catch (f) { |
|
Dh.dom = !1; |
|
} |
|
try { |
|
Dh.nonEnumArgs = !ch.call(c, 1); |
|
} catch (f) { |
|
Dh.nonEnumArgs = !0; |
|
} |
|
}(1, 0), b.templateSettings = { |
|
escape: vb, |
|
evaluate: wb, |
|
interpolate: xb, |
|
variable: "", |
|
imports: { |
|
_: b |
|
} |
|
}; |
|
var Eh = jh || function(a, b) { |
|
return null == b ? a : sc(b, Ph(b), sc(b, Li(b), a)); |
|
}, Fh = function() { |
|
function b() {} |
|
return function(c) { |
|
if (yf(c)) { |
|
b.prototype = c; |
|
var d = new b(); |
|
b.prototype = null; |
|
} |
|
return d || a.Object(); |
|
}; |
|
}(), Gh = jd(Dc), Hh = jd(Ec, !0), Ih = kd(), Jh = kd(!0), Kh = Bh ? function(a, b) { |
|
return Bh.set(a, b), a; |
|
} : og; |
|
Wg || (ed = Vg && gh ? function(a) { |
|
var b = a.byteLength, c = ih ? Zg(b / zh) : 0, d = c * zh, e = new Vg(b); |
|
if (c) { |
|
var f = new ih(e, 0, c); |
|
f.set(new ih(a, 0, c)); |
|
} |
|
return b != d && (f = new gh(e, d), f.set(new gh(a, d))), e; |
|
} : ng(null)); |
|
var Lh = lh && dh ? function(a) { |
|
return new Zb(a); |
|
} : ng(null), Mh = Bh ? function(a) { |
|
return Bh.get(a); |
|
} : tg, Nh = function() { |
|
return Dh.funcNames ? "constant" == ng.name ? Pc("name") : function(a) { |
|
for (var b = a.name, c = Ch[b], d = c ? c.length : 0; d--; ) { |
|
var e = c[d], f = e.func; |
|
if (null == f || f == a) return e.name; |
|
} |
|
return b; |
|
} : ng(""); |
|
}(), Oh = Pc("length"), Ph = $g ? function(a) { |
|
return $g(de(a)); |
|
} : ng([]), Qh = function() { |
|
var a = 0, b = 0; |
|
return function(c, d) { |
|
var e = mi(), f = N - (e - b); |
|
if (b = e, f > 0) { |
|
if (++a >= M) return c; |
|
} else a = 0; |
|
return Kh(c, d); |
|
}; |
|
}(), Rh = lf(function(a, b) { |
|
return Rd(a) ? wc(a, Bc(b, !1, !0)) : []; |
|
}), Sh = rd(), Th = rd(!0), Uh = lf(function(a, b) { |
|
b = Bc(b); |
|
var c = rc(a, b); |
|
return Rc(a, b.sort(d)), c; |
|
}), Vh = Ed(), Wh = Ed(!0), Xh = lf(function(a) { |
|
return Zc(Bc(a, !1, !0)); |
|
}), Yh = lf(function(a, b) { |
|
return Rd(a) ? wc(a, b) : []; |
|
}), Zh = lf(Ee), $h = lf(function(a) { |
|
var b = a.length, c = a[b - 2], d = a[b - 1]; |
|
return b > 2 && "function" == typeof c ? b -= 2 : (c = b > 1 && "function" == typeof d ? (--b, |
|
d) : z, d = z), a.length = b, Fe(a, c, d); |
|
}), _h = lf(function(a, b) { |
|
return rc(a, Bc(b)); |
|
}), ai = hd(function(a, b, c) { |
|
Qg.call(a, c) ? ++a[c] : a[c] = 1; |
|
}), bi = qd(Gh), ci = qd(Hh, !0), di = ud(bc, Gh), ei = ud(ec, Hh), fi = hd(function(a, b, c) { |
|
Qg.call(a, c) ? a[c].push(b) : a[c] = [ b ]; |
|
}), gi = hd(function(a, b, c) { |
|
a[c] = b; |
|
}), hi = lf(function(a, b, c) { |
|
var d = -1, e = "function" == typeof b, f = Ud(b), g = Rd(a) ? Bg(a.length) : []; |
|
return Gh(a, function(a) { |
|
var h = e ? b : f && null != a && a[b]; |
|
g[++d] = h ? h.apply(a, c) : Qd(a, b, c); |
|
}), g; |
|
}), ii = hd(function(a, b, c) { |
|
a[c ? 0 : 1].push(b); |
|
}, function() { |
|
return [ [], [] ]; |
|
}), ji = Ad(kc, Gh), ki = Ad(lc, Hh), li = lf(function(a, b) { |
|
if (null == a) return []; |
|
var c = b[2]; |
|
return c && Td(b[0], b[1], c) && (b.length = 1), Xc(a, Bc(b), []); |
|
}), mi = qh || function() { |
|
return new Cg().getTime(); |
|
}, ni = lf(function(a, b, c) { |
|
var d = B; |
|
if (c.length) { |
|
var e = t(c, ni.placeholder); |
|
d |= G; |
|
} |
|
return Fd(a, d, b, c, e); |
|
}), oi = lf(function(a, b) { |
|
b = b.length ? Bc(b) : Lf(a); |
|
for (var c = -1, d = b.length; ++c < d; ) { |
|
var e = b[c]; |
|
a[e] = Fd(a[e], B, a); |
|
} |
|
return a; |
|
}), pi = lf(function(a, b, c) { |
|
var d = B | C; |
|
if (c.length) { |
|
var e = t(c, pi.placeholder); |
|
d |= G; |
|
} |
|
return Fd(b, d, a, c, e); |
|
}), qi = od(E), ri = od(F), si = lf(function(a, b) { |
|
return vc(a, 1, b); |
|
}), ti = lf(function(a, b, c) { |
|
return vc(a, b, c); |
|
}), ui = td(), vi = td(!0), wi = zd(G), xi = zd(H), yi = lf(function(a, b) { |
|
return Fd(a, J, null, null, null, Bc(b)); |
|
}), zi = kh || function(a) { |
|
return r(a) && Wd(a.length) && Sg.call(a) == U; |
|
}; |
|
Dh.dom || (uf = function(a) { |
|
return !!a && 1 === a.nodeType && r(a) && !Ci(a); |
|
}); |
|
var Ai = rh || function(a) { |
|
return "number" == typeof a && mh(a); |
|
}, Bi = g(/x/) || gh && !g(gh) ? function(a) { |
|
return Sg.call(a) == Y; |
|
} : g, Ci = _g ? function(a) { |
|
if (!a || Sg.call(a) != _) return !1; |
|
var b = a.valueOf, c = Bf(b) && (c = _g(b)) && _g(c); |
|
return c ? a == c || _g(a) == c : ae(a); |
|
} : ae, Di = id(function(a, b, c) { |
|
return c ? qc(a, b, c) : Eh(a, b); |
|
}), Ei = lf(function(a) { |
|
var b = a[0]; |
|
return null == b ? b : (a.push(oc), Di.apply(z, a)); |
|
}), Fi = sd(Dc), Gi = sd(Ec), Hi = vd(Ih), Ii = vd(Jh), Ji = wd(Dc), Ki = wd(Ec), Li = nh ? function(a) { |
|
var b = null != a && a.constructor; |
|
return "function" == typeof b && b.prototype === a || "function" != typeof a && Rd(a) ? be(a) : yf(a) ? nh(a) : []; |
|
} : be, Mi = xd(!0), Ni = xd(), Oi = id(Nc), Pi = lf(function(a, b) { |
|
if (null == a) return {}; |
|
if ("function" != typeof b[0]) { |
|
var b = hc(Bc(b), Jg); |
|
return Zd(a, wc(Pf(a), b)); |
|
} |
|
var c = dd(b[0], b[1], 3); |
|
return $d(a, function(a, b, d) { |
|
return !c(a, b, d); |
|
}); |
|
}), Qi = lf(function(a, b) { |
|
return null == a ? {} : "function" == typeof b[0] ? $d(a, dd(b[0], b[1], 3)) : Zd(a, Bc(b)); |
|
}), Ri = md(function(a, b, c) { |
|
return b = b.toLowerCase(), a + (c ? b.charAt(0).toUpperCase() + b.slice(1) : b); |
|
}), Si = md(function(a, b, c) { |
|
return a + (c ? "-" : "") + b.toLowerCase(); |
|
}), Ti = yd(), Ui = yd(!0); |
|
8 != sh(Nb + "08") && (cg = function(a, b, c) { |
|
return (c ? Td(a, b, c) : null == b) ? b = 0 : b && (b = +b), a = gg(a), sh(a, b || (Hb.test(a) ? 16 : 10)); |
|
}); |
|
var Vi = md(function(a, b, c) { |
|
return a + (c ? "_" : "") + b.toLowerCase(); |
|
}), Wi = md(function(a, b, c) { |
|
return a + (c ? " " : "") + (b.charAt(0).toUpperCase() + b.slice(1)); |
|
}), Xi = lf(function(a, b) { |
|
try { |
|
return a.apply(z, b); |
|
} catch (c) { |
|
return xf(c) ? c : new Dg(c); |
|
} |
|
}), Yi = lf(function(a, b) { |
|
return function(c) { |
|
return Qd(c, a, b); |
|
}; |
|
}), Zi = lf(function(a, b) { |
|
return function(c) { |
|
return Qd(a, c, b); |
|
}; |
|
}), $i = pd(ic), _i = pd(jc, !0); |
|
return b.prototype = c.prototype, s.prototype = Fh(c.prototype), s.prototype.constructor = s, |
|
Z.prototype = Fh(c.prototype), Z.prototype.constructor = Z, Ub.prototype["delete"] = Vb, |
|
Ub.prototype.get = Wb, Ub.prototype.has = Xb, Ub.prototype.set = Yb, Zb.prototype.push = _b, |
|
hf.Cache = Ub, b.after = df, b.ary = ef, b.assign = Di, b.at = _h, b.before = ff, |
|
b.bind = ni, b.bindAll = oi, b.bindKey = pi, b.callback = mg, b.chain = Ie, b.chunk = ge, |
|
b.compact = he, b.constant = ng, b.countBy = ai, b.create = Kf, b.curry = qi, b.curryRight = ri, |
|
b.debounce = gf, b.defaults = Ei, b.defer = si, b.delay = ti, b.difference = Rh, |
|
b.drop = ie, b.dropRight = je, b.dropRightWhile = ke, b.dropWhile = le, b.fill = me, |
|
b.filter = Se, b.flatten = oe, b.flattenDeep = pe, b.flow = ui, b.flowRight = vi, |
|
b.forEach = di, b.forEachRight = ei, b.forIn = Hi, b.forInRight = Ii, b.forOwn = Ji, |
|
b.forOwnRight = Ki, b.functions = Lf, b.groupBy = fi, b.indexBy = gi, b.initial = re, |
|
b.intersection = se, b.invert = Of, b.invoke = hi, b.keys = Li, b.keysIn = Pf, b.map = Ve, |
|
b.mapKeys = Mi, b.mapValues = Ni, b.matches = pg, b.matchesProperty = qg, b.memoize = hf, |
|
b.merge = Oi, b.method = Yi, b.methodOf = Zi, b.mixin = rg, b.negate = jf, b.omit = Pi, |
|
b.once = kf, b.pairs = Qf, b.partial = wi, b.partialRight = xi, b.partition = ii, |
|
b.pick = Qi, b.pluck = We, b.property = ug, b.propertyOf = vg, b.pull = ve, b.pullAt = Uh, |
|
b.range = wg, b.rearg = yi, b.reject = Xe, b.remove = we, b.rest = xe, b.restParam = lf, |
|
b.set = Sf, b.shuffle = Ze, b.slice = ye, b.sortBy = af, b.sortByAll = li, b.sortByOrder = bf, |
|
b.spread = mf, b.take = ze, b.takeRight = Ae, b.takeRightWhile = Be, b.takeWhile = Ce, |
|
b.tap = Je, b.throttle = nf, b.thru = Ke, b.times = xg, b.toArray = If, b.toPlainObject = Jf, |
|
b.transform = Tf, b.union = Xh, b.uniq = De, b.unzip = Ee, b.unzipWith = Fe, b.values = Uf, |
|
b.valuesIn = Vf, b.where = cf, b.without = Yh, b.wrap = of, b.xor = Ge, b.zip = Zh, |
|
b.zipObject = He, b.zipWith = $h, b.backflow = vi, b.collect = Ve, b.compose = vi, |
|
b.each = di, b.eachRight = ei, b.extend = Di, b.iteratee = mg, b.methods = Lf, b.object = He, |
|
b.select = Se, b.tail = xe, b.unique = De, rg(b, b), b.add = zg, b.attempt = Xi, |
|
b.camelCase = Ri, b.capitalize = Yf, b.clone = pf, b.cloneDeep = qf, b.deburr = Zf, |
|
b.endsWith = $f, b.escape = _f, b.escapeRegExp = ag, b.every = Re, b.find = bi, |
|
b.findIndex = Sh, b.findKey = Fi, b.findLast = ci, b.findLastIndex = Th, b.findLastKey = Gi, |
|
b.findWhere = Te, b.first = ne, b.get = Mf, b.has = Nf, b.identity = og, b.includes = Ue, |
|
b.indexOf = qe, b.inRange = Wf, b.isArguments = rf, b.isArray = zi, b.isBoolean = sf, |
|
b.isDate = tf, b.isElement = uf, b.isEmpty = vf, b.isEqual = wf, b.isError = xf, |
|
b.isFinite = Ai, b.isFunction = Bi, b.isMatch = zf, b.isNaN = Af, b.isNative = Bf, |
|
b.isNull = Cf, b.isNumber = Df, b.isObject = yf, b.isPlainObject = Ci, b.isRegExp = Ef, |
|
b.isString = Ff, b.isTypedArray = Gf, b.isUndefined = Hf, b.kebabCase = Si, b.last = te, |
|
b.lastIndexOf = ue, b.max = $i, b.min = _i, b.noConflict = sg, b.noop = tg, b.now = mi, |
|
b.pad = bg, b.padLeft = Ti, b.padRight = Ui, b.parseInt = cg, b.random = Xf, b.reduce = ji, |
|
b.reduceRight = ki, b.repeat = dg, b.result = Rf, b.runInContext = y, b.size = $e, |
|
b.snakeCase = Vi, b.some = _e, b.sortedIndex = Vh, b.sortedLastIndex = Wh, b.startCase = Wi, |
|
b.startsWith = eg, b.sum = Ag, b.template = fg, b.trim = gg, b.trimLeft = hg, b.trimRight = ig, |
|
b.trunc = jg, b.unescape = kg, b.uniqueId = yg, b.words = lg, b.all = Re, b.any = _e, |
|
b.contains = Ue, b.detect = bi, b.foldl = ji, b.foldr = ki, b.head = ne, b.include = Ue, |
|
b.inject = ji, rg(b, function() { |
|
var a = {}; |
|
return Dc(b, function(c, d) { |
|
b.prototype[d] || (a[d] = c); |
|
}), a; |
|
}(), !1), b.sample = Ye, b.prototype.sample = function(a) { |
|
return this.__chain__ || null != a ? this.thru(function(b) { |
|
return Ye(b, a); |
|
}) : Ye(this.value()); |
|
}, b.VERSION = A, bc([ "bind", "bindKey", "curry", "curryRight", "partial", "partialRight" ], function(a) { |
|
b[a].placeholder = b; |
|
}), bc([ "dropWhile", "filter", "map", "takeWhile" ], function(a, b) { |
|
var c = b != Q, d = b == O; |
|
Z.prototype[a] = function(a, e) { |
|
var f = this.__filtered__, g = f && d ? new Z(this) : this.clone(), h = g.__iteratees__ || (g.__iteratees__ = []); |
|
return h.push({ |
|
done: !1, |
|
count: 0, |
|
index: 0, |
|
iteratee: Kd(a, e, 1), |
|
limit: -1, |
|
type: b |
|
}), g.__filtered__ = f || c, g; |
|
}; |
|
}), bc([ "drop", "take" ], function(a, b) { |
|
var c = a + "While"; |
|
Z.prototype[a] = function(c) { |
|
var d = this.__filtered__, e = d && !b ? this.dropWhile() : this.clone(); |
|
if (c = null == c ? 1 : oh(Zg(c) || 0, 0), d) b ? e.__takeCount__ = ph(e.__takeCount__, c) : te(e.__iteratees__).limit = c; else { |
|
var f = e.__views__ || (e.__views__ = []); |
|
f.push({ |
|
size: c, |
|
type: a + (e.__dir__ < 0 ? "Right" : "") |
|
}); |
|
} |
|
return e; |
|
}, Z.prototype[a + "Right"] = function(b) { |
|
return this.reverse()[a](b).reverse(); |
|
}, Z.prototype[a + "RightWhile"] = function(a, b) { |
|
return this.reverse()[c](a, b).reverse(); |
|
}; |
|
}), bc([ "first", "last" ], function(a, b) { |
|
var c = "take" + (b ? "Right" : ""); |
|
Z.prototype[a] = function() { |
|
return this[c](1).value()[0]; |
|
}; |
|
}), bc([ "initial", "rest" ], function(a, b) { |
|
var c = "drop" + (b ? "" : "Right"); |
|
Z.prototype[a] = function() { |
|
return this[c](1); |
|
}; |
|
}), bc([ "pluck", "where" ], function(a, b) { |
|
var c = b ? "filter" : "map", d = b ? Lc : ug; |
|
Z.prototype[a] = function(a) { |
|
return this[c](d(a)); |
|
}; |
|
}), Z.prototype.compact = function() { |
|
return this.filter(og); |
|
}, Z.prototype.reject = function(a, b) { |
|
return a = Kd(a, b, 1), this.filter(function(b) { |
|
return !a(b); |
|
}); |
|
}, Z.prototype.slice = function(a, b) { |
|
a = null == a ? 0 : +a || 0; |
|
var c = this; |
|
return 0 > a ? c = this.takeRight(-a) : a && (c = this.drop(a)), b !== z && (b = +b || 0, |
|
c = 0 > b ? c.dropRight(-b) : c.take(b - a)), c; |
|
}, Z.prototype.toArray = function() { |
|
return this.drop(0); |
|
}, Dc(Z.prototype, function(a, c) { |
|
var d = b[c]; |
|
if (d) { |
|
var e = /^(?:filter|map|reject)|While$/.test(c), f = /^(?:first|last)$/.test(c); |
|
b.prototype[c] = function() { |
|
var c = arguments, g = this.__chain__, h = this.__wrapped__, i = !!this.__actions__.length, j = h instanceof Z, k = c[0], l = j || zi(h); |
|
l && e && "function" == typeof k && 1 != k.length && (j = l = !1); |
|
var m = j && !i; |
|
if (f && !g) return m ? a.call(h) : d.call(b, this.value()); |
|
var n = function(a) { |
|
var e = [ a ]; |
|
return ah.apply(e, c), d.apply(b, e); |
|
}; |
|
if (l) { |
|
var o = m ? h : new Z(this), p = a.apply(o, c); |
|
if (!f && (i || p.__actions__)) { |
|
var q = p.__actions__ || (p.__actions__ = []); |
|
q.push({ |
|
func: Ke, |
|
args: [ n ], |
|
thisArg: b |
|
}); |
|
} |
|
return new s(p, g); |
|
} |
|
return this.thru(n); |
|
}; |
|
} |
|
}), bc([ "concat", "join", "pop", "push", "replace", "shift", "sort", "splice", "split", "unshift" ], function(a) { |
|
var c = (/^(?:replace|split)$/.test(a) ? Ng : Lg)[a], d = /^(?:push|sort|unshift)$/.test(a) ? "tap" : "thru", e = /^(?:join|pop|replace|shift)$/.test(a); |
|
b.prototype[a] = function() { |
|
var a = arguments; |
|
return e && !this.__chain__ ? c.apply(this.value(), a) : this[d](function(b) { |
|
return c.apply(b, a); |
|
}); |
|
}; |
|
}), Dc(Z.prototype, function(a, c) { |
|
var d = b[c]; |
|
if (d) { |
|
var e = d.name, f = Ch[e] || (Ch[e] = []); |
|
f.push({ |
|
name: c, |
|
func: d |
|
}); |
|
} |
|
}), Ch[Bd(null, C).name] = [ { |
|
name: "wrapper", |
|
func: null |
|
} ], Z.prototype.clone = bb, Z.prototype.reverse = db, Z.prototype.value = Tb, b.prototype.chain = Le, |
|
b.prototype.commit = Me, b.prototype.plant = Ne, b.prototype.reverse = Oe, b.prototype.toString = Pe, |
|
b.prototype.run = b.prototype.toJSON = b.prototype.valueOf = b.prototype.value = Qe, |
|
b.prototype.collect = b.prototype.map, b.prototype.head = b.prototype.first, b.prototype.select = b.prototype.filter, |
|
b.prototype.tail = b.prototype.rest, b; |
|
} |
|
var z, A = "3.8.0", B = 1, C = 2, D = 4, E = 8, F = 16, G = 32, H = 64, I = 128, J = 256, K = 30, L = "...", M = 150, N = 16, O = 0, P = 1, Q = 2, R = "Expected a function", S = "__lodash_placeholder__", T = "[object Arguments]", U = "[object Array]", V = "[object Boolean]", W = "[object Date]", X = "[object Error]", Y = "[object Function]", Z = "[object Map]", $ = "[object Number]", _ = "[object Object]", ab = "[object RegExp]", bb = "[object Set]", cb = "[object String]", db = "[object WeakMap]", eb = "[object ArrayBuffer]", fb = "[object Float32Array]", gb = "[object Float64Array]", hb = "[object Int8Array]", ib = "[object Int16Array]", jb = "[object Int32Array]", kb = "[object Uint8Array]", lb = "[object Uint8ClampedArray]", mb = "[object Uint16Array]", nb = "[object Uint32Array]", ob = /\b__p \+= '';/g, pb = /\b(__p \+=) '' \+/g, qb = /(__e\(.*?\)|\b__t\)) \+\n'';/g, rb = /&(?:amp|lt|gt|quot|#39|#96);/g, sb = /[&<>"'`]/g, tb = RegExp(rb.source), ub = RegExp(sb.source), vb = /<%-([\s\S]+?)%>/g, wb = /<%([\s\S]+?)%>/g, xb = /<%=([\s\S]+?)%>/g, yb = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/, zb = /^\w*$/, Ab = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g, Bb = /[.*+?^${}()|[\]\/\\]/g, Cb = RegExp(Bb.source), Db = /[\u0300-\u036f\ufe20-\ufe23]/g, Eb = /\\(\\)?/g, Fb = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, Gb = /\w*$/, Hb = /^0[xX]/, Ib = /^\[object .+?Constructor\]$/, Jb = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g, Kb = /($^)/, Lb = /['\n\r\u2028\u2029\\]/g, Mb = function() { |
|
var a = "[A-Z\\xc0-\\xd6\\xd8-\\xde]", b = "[a-z\\xdf-\\xf6\\xf8-\\xff]+"; |
|
return RegExp(a + "+(?=" + a + b + ")|" + a + "?" + b + "|" + a + "+|[0-9]+", "g"); |
|
}(), Nb = " \f \ufeff\n\r\u2028\u2029 ", Ob = [ "Array", "ArrayBuffer", "Date", "Error", "Float32Array", "Float64Array", "Function", "Int8Array", "Int16Array", "Int32Array", "Math", "Number", "Object", "RegExp", "Set", "String", "_", "clearTimeout", "document", "isFinite", "parseInt", "setTimeout", "TypeError", "Uint8Array", "Uint8ClampedArray", "Uint16Array", "Uint32Array", "WeakMap", "window" ], Pb = -1, Qb = {}; |
|
Qb[fb] = Qb[gb] = Qb[hb] = Qb[ib] = Qb[jb] = Qb[kb] = Qb[lb] = Qb[mb] = Qb[nb] = !0, |
|
Qb[T] = Qb[U] = Qb[eb] = Qb[V] = Qb[W] = Qb[X] = Qb[Y] = Qb[Z] = Qb[$] = Qb[_] = Qb[ab] = Qb[bb] = Qb[cb] = Qb[db] = !1; |
|
var Rb = {}; |
|
Rb[T] = Rb[U] = Rb[eb] = Rb[V] = Rb[W] = Rb[fb] = Rb[gb] = Rb[hb] = Rb[ib] = Rb[jb] = Rb[$] = Rb[_] = Rb[ab] = Rb[cb] = Rb[kb] = Rb[lb] = Rb[mb] = Rb[nb] = !0, |
|
Rb[X] = Rb[Y] = Rb[Z] = Rb[bb] = Rb[db] = !1; |
|
var Sb = { |
|
leading: !1, |
|
maxWait: 0, |
|
trailing: !1 |
|
}, Tb = { |
|
"À": "A", |
|
"Á": "A", |
|
"Â": "A", |
|
"Ã": "A", |
|
"Ä": "A", |
|
"Å": "A", |
|
"à": "a", |
|
"á": "a", |
|
"â": "a", |
|
"ã": "a", |
|
"ä": "a", |
|
"å": "a", |
|
"Ç": "C", |
|
"ç": "c", |
|
"Ð": "D", |
|
"ð": "d", |
|
"È": "E", |
|
"É": "E", |
|
"Ê": "E", |
|
"Ë": "E", |
|
"è": "e", |
|
"é": "e", |
|
"ê": "e", |
|
"ë": "e", |
|
"Ì": "I", |
|
"Í": "I", |
|
"Î": "I", |
|
"Ï": "I", |
|
"ì": "i", |
|
"í": "i", |
|
"î": "i", |
|
"ï": "i", |
|
"Ñ": "N", |
|
"ñ": "n", |
|
"Ò": "O", |
|
"Ó": "O", |
|
"Ô": "O", |
|
"Õ": "O", |
|
"Ö": "O", |
|
"Ø": "O", |
|
"ò": "o", |
|
"ó": "o", |
|
"ô": "o", |
|
"õ": "o", |
|
"ö": "o", |
|
"ø": "o", |
|
"Ù": "U", |
|
"Ú": "U", |
|
"Û": "U", |
|
"Ü": "U", |
|
"ù": "u", |
|
"ú": "u", |
|
"û": "u", |
|
"ü": "u", |
|
"Ý": "Y", |
|
"ý": "y", |
|
"ÿ": "y", |
|
"Æ": "Ae", |
|
"æ": "ae", |
|
"Þ": "Th", |
|
"þ": "th", |
|
"ß": "ss" |
|
}, Ub = { |
|
"&": "&", |
|
"<": "<", |
|
">": ">", |
|
'"': """, |
|
"'": "'", |
|
"`": "`" |
|
}, Vb = { |
|
"&": "&", |
|
"<": "<", |
|
">": ">", |
|
""": '"', |
|
"'": "'", |
|
"`": "`" |
|
}, Wb = { |
|
"function": !0, |
|
object: !0 |
|
}, Xb = { |
|
"\\": "\\", |
|
"'": "'", |
|
"\n": "n", |
|
"\r": "r", |
|
"\u2028": "u2028", |
|
"\u2029": "u2029" |
|
}, Yb = Wb[typeof c] && c && !c.nodeType && c, Zb = Wb[typeof b] && b && !b.nodeType && b, $b = Yb && Zb && "object" == typeof a && a && a.Object && a, _b = Wb[typeof self] && self && self.Object && self, ac = Wb[typeof window] && window && window.Object && window, bc = Zb && Zb.exports === Yb && Yb, cc = $b || ac !== (this && this.window) && ac || _b || this, dc = y(); |
|
"function" == typeof define && "object" == typeof define.amd && define.amd ? (cc._ = dc, |
|
define(function() { |
|
return dc; |
|
})) : Yb && Zb ? bc ? (Zb.exports = dc)._ = dc : Yb._ = dc : cc._ = dc; |
|
}).call(this); |
|
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}); |
|
}, {} ], |
|
32: [ function(a, b, c) { |
|
(function(a) { |
|
!function(a) { |
|
"use strict"; |
|
if ("function" == typeof bootstrap) bootstrap("promise", a); else if ("object" == typeof c && "object" == typeof b) b.exports = a(); else if ("function" == typeof define && define.amd) define(a); else if ("undefined" != typeof ses) { |
|
if (!ses.ok()) return; |
|
ses.makeQ = a; |
|
} else { |
|
if ("undefined" == typeof self) throw new Error("This environment was not anticipated by Q. Please file a bug."); |
|
self.Q = a(); |
|
} |
|
}(function() { |
|
"use strict"; |
|
function b(a) { |
|
return function() { |
|
return X.apply(a, arguments); |
|
}; |
|
} |
|
function c(a) { |
|
return a === Object(a); |
|
} |
|
function d(a) { |
|
return "[object StopIteration]" === db(a) || a instanceof T; |
|
} |
|
function e(a, b) { |
|
if (Q && b.stack && "object" == typeof a && null !== a && a.stack && -1 === a.stack.indexOf(eb)) { |
|
for (var c = [], d = b; d; d = d.source) d.stack && c.unshift(d.stack); |
|
c.unshift(a.stack); |
|
var e = c.join("\n" + eb + "\n"); |
|
a.stack = f(e); |
|
} |
|
} |
|
function f(a) { |
|
for (var b = a.split("\n"), c = [], d = 0; d < b.length; ++d) { |
|
var e = b[d]; |
|
i(e) || g(e) || !e || c.push(e); |
|
} |
|
return c.join("\n"); |
|
} |
|
function g(a) { |
|
return -1 !== a.indexOf("(module.js:") || -1 !== a.indexOf("(node.js:"); |
|
} |
|
function h(a) { |
|
var b = /at .+ \((.+):(\d+):(?:\d+)\)$/.exec(a); |
|
if (b) return [ b[1], Number(b[2]) ]; |
|
var c = /at ([^ ]+):(\d+):(?:\d+)$/.exec(a); |
|
if (c) return [ c[1], Number(c[2]) ]; |
|
var d = /.*@(.+):(\d+)$/.exec(a); |
|
return d ? [ d[1], Number(d[2]) ] : void 0; |
|
} |
|
function i(a) { |
|
var b = h(a); |
|
if (!b) return !1; |
|
var c = b[0], d = b[1]; |
|
return c === S && d >= U && ib >= d; |
|
} |
|
function j() { |
|
if (Q) try { |
|
throw new Error(); |
|
} catch (a) { |
|
var b = a.stack.split("\n"), c = b[0].indexOf("@") > 0 ? b[1] : b[2], d = h(c); |
|
if (!d) return; |
|
return S = d[0], d[1]; |
|
} |
|
} |
|
function k(a, b, c) { |
|
return function() { |
|
return "undefined" != typeof console && "function" == typeof console.warn, a.apply(a, arguments); |
|
}; |
|
} |
|
function l(a) { |
|
return a instanceof p ? a : t(a) ? C(a) : B(a); |
|
} |
|
function m() { |
|
function a(a) { |
|
b = a, f.source = a, Z(c, function(b, c) { |
|
l.nextTick(function() { |
|
a.promiseDispatch.apply(a, c); |
|
}); |
|
}, void 0), c = void 0, d = void 0; |
|
} |
|
var b, c = [], d = [], e = ab(m.prototype), f = ab(p.prototype); |
|
if (f.promiseDispatch = function(a, e, f) { |
|
var g = Y(arguments); |
|
c ? (c.push(g), "when" === e && f[1] && d.push(f[1])) : l.nextTick(function() { |
|
b.promiseDispatch.apply(b, g); |
|
}); |
|
}, f.valueOf = function() { |
|
if (c) return f; |
|
var a = r(b); |
|
return s(a) && (b = a), a; |
|
}, f.inspect = function() { |
|
return b ? b.inspect() : { |
|
state: "pending" |
|
}; |
|
}, l.longStackSupport && Q) try { |
|
throw new Error(); |
|
} catch (g) { |
|
f.stack = g.stack.substring(g.stack.indexOf("\n") + 1); |
|
} |
|
return e.promise = f, e.resolve = function(c) { |
|
b || a(l(c)); |
|
}, e.fulfill = function(c) { |
|
b || a(B(c)); |
|
}, e.reject = function(c) { |
|
b || a(A(c)); |
|
}, e.notify = function(a) { |
|
b || Z(d, function(b, c) { |
|
l.nextTick(function() { |
|
c(a); |
|
}); |
|
}, void 0); |
|
}, e; |
|
} |
|
function n(a) { |
|
if ("function" != typeof a) throw new TypeError("resolver must be a function."); |
|
var b = m(); |
|
try { |
|
a(b.resolve, b.reject, b.notify); |
|
} catch (c) { |
|
b.reject(c); |
|
} |
|
return b.promise; |
|
} |
|
function o(a) { |
|
return n(function(b, c) { |
|
for (var d = 0, e = a.length; e > d; d++) l(a[d]).then(b, c); |
|
}); |
|
} |
|
function p(a, b, c) { |
|
void 0 === b && (b = function(a) { |
|
return A(new Error("Promise does not support operation: " + a)); |
|
}), void 0 === c && (c = function() { |
|
return { |
|
state: "unknown" |
|
}; |
|
}); |
|
var d = ab(p.prototype); |
|
if (d.promiseDispatch = function(c, e, f) { |
|
var g; |
|
try { |
|
g = a[e] ? a[e].apply(d, f) : b.call(d, e, f); |
|
} catch (h) { |
|
g = A(h); |
|
} |
|
c && c(g); |
|
}, d.inspect = c, c) { |
|
var e = c(); |
|
"rejected" === e.state && (d.exception = e.reason), d.valueOf = function() { |
|
var a = c(); |
|
return "pending" === a.state || "rejected" === a.state ? d : a.value; |
|
}; |
|
} |
|
return d; |
|
} |
|
function q(a, b, c, d) { |
|
return l(a).then(b, c, d); |
|
} |
|
function r(a) { |
|
if (s(a)) { |
|
var b = a.inspect(); |
|
if ("fulfilled" === b.state) return b.value; |
|
} |
|
return a; |
|
} |
|
function s(a) { |
|
return a instanceof p; |
|
} |
|
function t(a) { |
|
return c(a) && "function" == typeof a.then; |
|
} |
|
function u(a) { |
|
return s(a) && "pending" === a.inspect().state; |
|
} |
|
function v(a) { |
|
return !s(a) || "fulfilled" === a.inspect().state; |
|
} |
|
function w(a) { |
|
return s(a) && "rejected" === a.inspect().state; |
|
} |
|
function x() { |
|
fb.length = 0, gb.length = 0, hb || (hb = !0); |
|
} |
|
function y(a, b) { |
|
hb && (gb.push(a), fb.push(b && "undefined" != typeof b.stack ? b.stack : "(no stack) " + b)); |
|
} |
|
function z(a) { |
|
if (hb) { |
|
var b = $(gb, a); |
|
-1 !== b && (gb.splice(b, 1), fb.splice(b, 1)); |
|
} |
|
} |
|
function A(a) { |
|
var b = p({ |
|
when: function(b) { |
|
return b && z(this), b ? b(a) : this; |
|
} |
|
}, function() { |
|
return this; |
|
}, function() { |
|
return { |
|
state: "rejected", |
|
reason: a |
|
}; |
|
}); |
|
return y(b, a), b; |
|
} |
|
function B(a) { |
|
return p({ |
|
when: function() { |
|
return a; |
|
}, |
|
get: function(b) { |
|
return a[b]; |
|
}, |
|
set: function(b, c) { |
|
a[b] = c; |
|
}, |
|
"delete": function(b) { |
|
delete a[b]; |
|
}, |
|
post: function(b, c) { |
|
return null === b || void 0 === b ? a.apply(void 0, c) : a[b].apply(a, c); |
|
}, |
|
apply: function(b, c) { |
|
return a.apply(b, c); |
|
}, |
|
keys: function() { |
|
return cb(a); |
|
} |
|
}, void 0, function() { |
|
return { |
|
state: "fulfilled", |
|
value: a |
|
}; |
|
}); |
|
} |
|
function C(a) { |
|
var b = m(); |
|
return l.nextTick(function() { |
|
try { |
|
a.then(b.resolve, b.reject, b.notify); |
|
} catch (c) { |
|
b.reject(c); |
|
} |
|
}), b.promise; |
|
} |
|
function D(a) { |
|
return p({ |
|
isDef: function() {} |
|
}, function(b, c) { |
|
return J(a, b, c); |
|
}, function() { |
|
return l(a).inspect(); |
|
}); |
|
} |
|
function E(a, b, c) { |
|
return l(a).spread(b, c); |
|
} |
|
function F(a) { |
|
return function() { |
|
function b(a, b) { |
|
var g; |
|
if ("undefined" == typeof StopIteration) { |
|
try { |
|
g = c[a](b); |
|
} catch (h) { |
|
return A(h); |
|
} |
|
return g.done ? l(g.value) : q(g.value, e, f); |
|
} |
|
try { |
|
g = c[a](b); |
|
} catch (h) { |
|
return d(h) ? l(h.value) : A(h); |
|
} |
|
return q(g, e, f); |
|
} |
|
var c = a.apply(this, arguments), e = b.bind(b, "next"), f = b.bind(b, "throw"); |
|
return e(); |
|
}; |
|
} |
|
function G(a) { |
|
l.done(l.async(a)()); |
|
} |
|
function H(a) { |
|
throw new T(a); |
|
} |
|
function I(a) { |
|
return function() { |
|
return E([ this, K(arguments) ], function(b, c) { |
|
return a.apply(b, c); |
|
}); |
|
}; |
|
} |
|
function J(a, b, c) { |
|
return l(a).dispatch(b, c); |
|
} |
|
function K(a) { |
|
return q(a, function(a) { |
|
var b = 0, c = m(); |
|
return Z(a, function(d, e, f) { |
|
var g; |
|
s(e) && "fulfilled" === (g = e.inspect()).state ? a[f] = g.value : (++b, q(e, function(d) { |
|
a[f] = d, 0 === --b && c.resolve(a); |
|
}, c.reject, function(a) { |
|
c.notify({ |
|
index: f, |
|
value: a |
|
}); |
|
})); |
|
}, void 0), 0 === b && c.resolve(a), c.promise; |
|
}); |
|
} |
|
function L(a) { |
|
if (0 === a.length) return l.resolve(); |
|
var b = l.defer(), c = 0; |
|
return Z(a, function(d, e, f) { |
|
function g(a) { |
|
b.resolve(a); |
|
} |
|
function h() { |
|
c--, 0 === c && b.reject(new Error("Can't get fulfillment value from any promise, all promises were rejected.")); |
|
} |
|
function i(a) { |
|
b.notify({ |
|
index: f, |
|
value: a |
|
}); |
|
} |
|
var j = a[f]; |
|
c++, q(j, g, h, i); |
|
}, void 0), b.promise; |
|
} |
|
function M(a) { |
|
return q(a, function(a) { |
|
return a = _(a, l), q(K(_(a, function(a) { |
|
return q(a, V, V); |
|
})), function() { |
|
return a; |
|
}); |
|
}); |
|
} |
|
function N(a) { |
|
return l(a).allSettled(); |
|
} |
|
function O(a, b) { |
|
return l(a).then(void 0, void 0, b); |
|
} |
|
function P(a, b) { |
|
return l(a).nodeify(b); |
|
} |
|
var Q = !1; |
|
try { |
|
throw new Error(); |
|
} catch (R) { |
|
Q = !!R.stack; |
|
} |
|
var S, T, U = j(), V = function() {}, W = function() { |
|
function b() { |
|
for (;c.next; ) { |
|
c = c.next; |
|
var a = c.task; |
|
c.task = void 0; |
|
var d = c.domain; |
|
d && (c.domain = void 0, d.enter()); |
|
try { |
|
a(); |
|
} catch (f) { |
|
if (g) throw d && d.exit(), setTimeout(b, 0), d && d.enter(), f; |
|
setTimeout(function() { |
|
throw f; |
|
}, 0); |
|
} |
|
d && d.exit(); |
|
} |
|
e = !1; |
|
} |
|
var c = { |
|
task: void 0, |
|
next: null |
|
}, d = c, e = !1, f = void 0, g = !1; |
|
if (W = function(b) { |
|
d = d.next = { |
|
task: b, |
|
domain: g && a.domain, |
|
next: null |
|
}, e || (e = !0, f()); |
|
}, "undefined" != typeof a && a.nextTick) g = !0, f = function() { |
|
a.nextTick(b); |
|
}; else if ("function" == typeof setImmediate) f = "undefined" != typeof window ? setImmediate.bind(window, b) : function() { |
|
setImmediate(b); |
|
}; else if ("undefined" != typeof MessageChannel) { |
|
var h = new MessageChannel(); |
|
h.port1.onmessage = function() { |
|
f = i, h.port1.onmessage = b, b(); |
|
}; |
|
var i = function() { |
|
h.port2.postMessage(0); |
|
}; |
|
f = function() { |
|
setTimeout(b, 0), i(); |
|
}; |
|
} else f = function() { |
|
setTimeout(b, 0); |
|
}; |
|
return W; |
|
}(), X = Function.call, Y = b(Array.prototype.slice), Z = b(Array.prototype.reduce || function(a, b) { |
|
var c = 0, d = this.length; |
|
if (1 === arguments.length) for (;;) { |
|
if (c in this) { |
|
b = this[c++]; |
|
break; |
|
} |
|
if (++c >= d) throw new TypeError(); |
|
} |
|
for (;d > c; c++) c in this && (b = a(b, this[c], c)); |
|
return b; |
|
}), $ = b(Array.prototype.indexOf || function(a) { |
|
for (var b = 0; b < this.length; b++) if (this[b] === a) return b; |
|
return -1; |
|
}), _ = b(Array.prototype.map || function(a, b) { |
|
var c = this, d = []; |
|
return Z(c, function(e, f, g) { |
|
d.push(a.call(b, f, g, c)); |
|
}, void 0), d; |
|
}), ab = Object.create || function(a) { |
|
function b() {} |
|
return b.prototype = a, new b(); |
|
}, bb = b(Object.prototype.hasOwnProperty), cb = Object.keys || function(a) { |
|
var b = []; |
|
for (var c in a) bb(a, c) && b.push(c); |
|
return b; |
|
}, db = b(Object.prototype.toString); |
|
T = "undefined" != typeof ReturnValue ? ReturnValue : function(a) { |
|
this.value = a; |
|
}; |
|
var eb = "From previous event:"; |
|
l.resolve = l, l.nextTick = W, l.longStackSupport = !1, "object" == typeof a && a && a.env && a.env.Q_DEBUG && (l.longStackSupport = !0), |
|
l.defer = m, m.prototype.makeNodeResolver = function() { |
|
var a = this; |
|
return function(b, c) { |
|
b ? a.reject(b) : a.resolve(arguments.length > 2 ? Y(arguments, 1) : c); |
|
}; |
|
}, l.Promise = n, l.promise = n, n.race = o, n.all = K, n.reject = A, n.resolve = l, |
|
l.passByCopy = function(a) { |
|
return a; |
|
}, p.prototype.passByCopy = function() { |
|
return this; |
|
}, l.join = function(a, b) { |
|
return l(a).join(b); |
|
}, p.prototype.join = function(a) { |
|
return l([ this, a ]).spread(function(a, b) { |
|
if (a === b) return a; |
|
throw new Error("Can't join: not the same: " + a + " " + b); |
|
}); |
|
}, l.race = o, p.prototype.race = function() { |
|
return this.then(l.race); |
|
}, l.makePromise = p, p.prototype.toString = function() { |
|
return "[object Promise]"; |
|
}, p.prototype.then = function(a, b, c) { |
|
function d(b) { |
|
try { |
|
return "function" == typeof a ? a(b) : b; |
|
} catch (c) { |
|
return A(c); |
|
} |
|
} |
|
function f(a) { |
|
if ("function" == typeof b) { |
|
e(a, h); |
|
try { |
|
return b(a); |
|
} catch (c) { |
|
return A(c); |
|
} |
|
} |
|
return A(a); |
|
} |
|
function g(a) { |
|
return "function" == typeof c ? c(a) : a; |
|
} |
|
var h = this, i = m(), j = !1; |
|
return l.nextTick(function() { |
|
h.promiseDispatch(function(a) { |
|
j || (j = !0, i.resolve(d(a))); |
|
}, "when", [ function(a) { |
|
j || (j = !0, i.resolve(f(a))); |
|
} ]); |
|
}), h.promiseDispatch(void 0, "when", [ void 0, function(a) { |
|
var b, c = !1; |
|
try { |
|
b = g(a); |
|
} catch (d) { |
|
if (c = !0, !l.onerror) throw d; |
|
l.onerror(d); |
|
} |
|
c || i.notify(b); |
|
} ]), i.promise; |
|
}, l.tap = function(a, b) { |
|
return l(a).tap(b); |
|
}, p.prototype.tap = function(a) { |
|
return a = l(a), this.then(function(b) { |
|
return a.fcall(b).thenResolve(b); |
|
}); |
|
}, l.when = q, p.prototype.thenResolve = function(a) { |
|
return this.then(function() { |
|
return a; |
|
}); |
|
}, l.thenResolve = function(a, b) { |
|
return l(a).thenResolve(b); |
|
}, p.prototype.thenReject = function(a) { |
|
return this.then(function() { |
|
throw a; |
|
}); |
|
}, l.thenReject = function(a, b) { |
|
return l(a).thenReject(b); |
|
}, l.nearer = r, l.isPromise = s, l.isPromiseAlike = t, l.isPending = u, p.prototype.isPending = function() { |
|
return "pending" === this.inspect().state; |
|
}, l.isFulfilled = v, p.prototype.isFulfilled = function() { |
|
return "fulfilled" === this.inspect().state; |
|
}, l.isRejected = w, p.prototype.isRejected = function() { |
|
return "rejected" === this.inspect().state; |
|
}; |
|
var fb = [], gb = [], hb = !0; |
|
l.resetUnhandledRejections = x, l.getUnhandledReasons = function() { |
|
return fb.slice(); |
|
}, l.stopUnhandledRejectionTracking = function() { |
|
x(), hb = !1; |
|
}, x(), l.reject = A, l.fulfill = B, l.master = D, l.spread = E, p.prototype.spread = function(a, b) { |
|
return this.all().then(function(b) { |
|
return a.apply(void 0, b); |
|
}, b); |
|
}, l.async = F, l.spawn = G, l["return"] = H, l.promised = I, l.dispatch = J, p.prototype.dispatch = function(a, b) { |
|
var c = this, d = m(); |
|
return l.nextTick(function() { |
|
c.promiseDispatch(d.resolve, a, b); |
|
}), d.promise; |
|
}, l.get = function(a, b) { |
|
return l(a).dispatch("get", [ b ]); |
|
}, p.prototype.get = function(a) { |
|
return this.dispatch("get", [ a ]); |
|
}, l.set = function(a, b, c) { |
|
return l(a).dispatch("set", [ b, c ]); |
|
}, p.prototype.set = function(a, b) { |
|
return this.dispatch("set", [ a, b ]); |
|
}, l.del = l["delete"] = function(a, b) { |
|
return l(a).dispatch("delete", [ b ]); |
|
}, p.prototype.del = p.prototype["delete"] = function(a) { |
|
return this.dispatch("delete", [ a ]); |
|
}, l.mapply = l.post = function(a, b, c) { |
|
return l(a).dispatch("post", [ b, c ]); |
|
}, p.prototype.mapply = p.prototype.post = function(a, b) { |
|
return this.dispatch("post", [ a, b ]); |
|
}, l.send = l.mcall = l.invoke = function(a, b) { |
|
return l(a).dispatch("post", [ b, Y(arguments, 2) ]); |
|
}, p.prototype.send = p.prototype.mcall = p.prototype.invoke = function(a) { |
|
return this.dispatch("post", [ a, Y(arguments, 1) ]); |
|
}, l.fapply = function(a, b) { |
|
return l(a).dispatch("apply", [ void 0, b ]); |
|
}, p.prototype.fapply = function(a) { |
|
return this.dispatch("apply", [ void 0, a ]); |
|
}, l["try"] = l.fcall = function(a) { |
|
return l(a).dispatch("apply", [ void 0, Y(arguments, 1) ]); |
|
}, p.prototype.fcall = function() { |
|
return this.dispatch("apply", [ void 0, Y(arguments) ]); |
|
}, l.fbind = function(a) { |
|
var b = l(a), c = Y(arguments, 1); |
|
return function() { |
|
return b.dispatch("apply", [ this, c.concat(Y(arguments)) ]); |
|
}; |
|
}, p.prototype.fbind = function() { |
|
var a = this, b = Y(arguments); |
|
return function() { |
|
return a.dispatch("apply", [ this, b.concat(Y(arguments)) ]); |
|
}; |
|
}, l.keys = function(a) { |
|
return l(a).dispatch("keys", []); |
|
}, p.prototype.keys = function() { |
|
return this.dispatch("keys", []); |
|
}, l.all = K, p.prototype.all = function() { |
|
return K(this); |
|
}, l.any = L, p.prototype.any = function() { |
|
return L(this); |
|
}, l.allResolved = k(M, "allResolved", "allSettled"), p.prototype.allResolved = function() { |
|
return M(this); |
|
}, l.allSettled = N, p.prototype.allSettled = function() { |
|
return this.then(function(a) { |
|
return K(_(a, function(a) { |
|
function b() { |
|
return a.inspect(); |
|
} |
|
return a = l(a), a.then(b, b); |
|
})); |
|
}); |
|
}, l.fail = l["catch"] = function(a, b) { |
|
return l(a).then(void 0, b); |
|
}, p.prototype.fail = p.prototype["catch"] = function(a) { |
|
return this.then(void 0, a); |
|
}, l.progress = O, p.prototype.progress = function(a) { |
|
return this.then(void 0, void 0, a); |
|
}, l.fin = l["finally"] = function(a, b) { |
|
return l(a)["finally"](b); |
|
}, p.prototype.fin = p.prototype["finally"] = function(a) { |
|
return a = l(a), this.then(function(b) { |
|
return a.fcall().then(function() { |
|
return b; |
|
}); |
|
}, function(b) { |
|
return a.fcall().then(function() { |
|
throw b; |
|
}); |
|
}); |
|
}, l.done = function(a, b, c, d) { |
|
return l(a).done(b, c, d); |
|
}, p.prototype.done = function(b, c, d) { |
|
var f = function(a) { |
|
l.nextTick(function() { |
|
if (e(a, g), !l.onerror) throw a; |
|
l.onerror(a); |
|
}); |
|
}, g = b || c || d ? this.then(b, c, d) : this; |
|
"object" == typeof a && a && a.domain && (f = a.domain.bind(f)), g.then(void 0, f); |
|
}, l.timeout = function(a, b, c) { |
|
return l(a).timeout(b, c); |
|
}, p.prototype.timeout = function(a, b) { |
|
var c = m(), d = setTimeout(function() { |
|
b && "string" != typeof b || (b = new Error(b || "Timed out after " + a + " ms"), |
|
b.code = "ETIMEDOUT"), c.reject(b); |
|
}, a); |
|
return this.then(function(a) { |
|
clearTimeout(d), c.resolve(a); |
|
}, function(a) { |
|
clearTimeout(d), c.reject(a); |
|
}, c.notify), c.promise; |
|
}, l.delay = function(a, b) { |
|
return void 0 === b && (b = a, a = void 0), l(a).delay(b); |
|
}, p.prototype.delay = function(a) { |
|
return this.then(function(b) { |
|
var c = m(); |
|
return setTimeout(function() { |
|
c.resolve(b); |
|
}, a), c.promise; |
|
}); |
|
}, l.nfapply = function(a, b) { |
|
return l(a).nfapply(b); |
|
}, p.prototype.nfapply = function(a) { |
|
var b = m(), c = Y(a); |
|
return c.push(b.makeNodeResolver()), this.fapply(c).fail(b.reject), b.promise; |
|
}, l.nfcall = function(a) { |
|
var b = Y(arguments, 1); |
|
return l(a).nfapply(b); |
|
}, p.prototype.nfcall = function() { |
|
var a = Y(arguments), b = m(); |
|
return a.push(b.makeNodeResolver()), this.fapply(a).fail(b.reject), b.promise; |
|
}, l.nfbind = l.denodeify = function(a) { |
|
var b = Y(arguments, 1); |
|
return function() { |
|
var c = b.concat(Y(arguments)), d = m(); |
|
return c.push(d.makeNodeResolver()), l(a).fapply(c).fail(d.reject), d.promise; |
|
}; |
|
}, p.prototype.nfbind = p.prototype.denodeify = function() { |
|
var a = Y(arguments); |
|
return a.unshift(this), l.denodeify.apply(void 0, a); |
|
}, l.nbind = function(a, b) { |
|
var c = Y(arguments, 2); |
|
return function() { |
|
function d() { |
|
return a.apply(b, arguments); |
|
} |
|
var e = c.concat(Y(arguments)), f = m(); |
|
return e.push(f.makeNodeResolver()), l(d).fapply(e).fail(f.reject), f.promise; |
|
}; |
|
}, p.prototype.nbind = function() { |
|
var a = Y(arguments, 0); |
|
return a.unshift(this), l.nbind.apply(void 0, a); |
|
}, l.nmapply = l.npost = function(a, b, c) { |
|
return l(a).npost(b, c); |
|
}, p.prototype.nmapply = p.prototype.npost = function(a, b) { |
|
var c = Y(b || []), d = m(); |
|
return c.push(d.makeNodeResolver()), this.dispatch("post", [ a, c ]).fail(d.reject), |
|
d.promise; |
|
}, l.nsend = l.nmcall = l.ninvoke = function(a, b) { |
|
var c = Y(arguments, 2), d = m(); |
|
return c.push(d.makeNodeResolver()), l(a).dispatch("post", [ b, c ]).fail(d.reject), |
|
d.promise; |
|
}, p.prototype.nsend = p.prototype.nmcall = p.prototype.ninvoke = function(a) { |
|
var b = Y(arguments, 1), c = m(); |
|
return b.push(c.makeNodeResolver()), this.dispatch("post", [ a, b ]).fail(c.reject), |
|
c.promise; |
|
}, l.nodeify = P, p.prototype.nodeify = function(a) { |
|
return a ? void this.then(function(b) { |
|
l.nextTick(function() { |
|
a(null, b); |
|
}); |
|
}, function(b) { |
|
l.nextTick(function() { |
|
a(b); |
|
}); |
|
}) : this; |
|
}; |
|
var ib = j(); |
|
return l; |
|
}); |
|
}).call(this, a("_process")); |
|
}, { |
|
_process: 110 |
|
} ], |
|
33: [ function(a, b, c) { |
|
!function() { |
|
"use strict"; |
|
var b = a("q"), d = a("./local-storage"), e = a("./config"); |
|
return c.create = function(a) { |
|
return d.put(e.localStorage.PENDING_QUEUE + a, []), d.put(e.localStorage.PROCESSING_QUEUE + a, []), |
|
{ |
|
fetch: function() { |
|
function c() { |
|
var b; |
|
d.get(e.localStorage.PENDING_QUEUE + a).then(function(g) { |
|
return 0 == g.length ? void setTimeout(c, 50) : (b = g.pop(), void d.get(e.localStorage.PROCESSING_QUEUE + a).then(function(c) { |
|
return c.push(b), d.put(e.localStorage.PROCESSING_QUEUE + a, c); |
|
}).then(function() { |
|
return d.put(e.localStorage.PENDING_QUEUE + a, g); |
|
}).then(function() { |
|
return f.resolve(b); |
|
})); |
|
}); |
|
} |
|
var f = b.defer(); |
|
return c(), f.promise; |
|
}, |
|
markDone: function(b) { |
|
return d.get(e.localStorage.PROCESSING_QUEUE + a).then(function(c) { |
|
var f = c.indexOf(b); |
|
if (-1 != f) return c.splice(f, 1), d.put(e.localStorage.PROCESSING_QUEUE + a, c); |
|
}); |
|
}, |
|
add: function(b) { |
|
return d.get(e.localStorage.PENDING_QUEUE + a).then(function(c) { |
|
return c.push(b), d.put(e.localStorage.PENDING_QUEUE + a, c); |
|
}); |
|
}, |
|
addMulti: function(b) { |
|
return d.get(e.localStorage.PENDING_QUEUE + a).then(function(c) { |
|
return c = c.concat(b), d.put(e.localStorage.PENDING_QUEUE + a, c); |
|
}); |
|
}, |
|
whenAllDone: function() { |
|
var c = b.defer(), f = function() { |
|
b.all([ d.get(e.localStorage.PROCESSING_QUEUE + a), d.get(e.localStorage.PENDING_QUEUE + a) ]).then(function(a) { |
|
a[0].length > 0 || a[1].length > 0 ? setTimeout(f, 10) : c.resolve(); |
|
}); |
|
}; |
|
return f(), c.promise; |
|
} |
|
}; |
|
}, {}; |
|
}(); |
|
}, { |
|
"./config": 26, |
|
"./local-storage": 29, |
|
q: 32 |
|
} ], |
|
34: [ function(a, b, c) { |
|
!function() { |
|
"use strict"; |
|
var b = a("lodash"), d = {}, e = {}; |
|
return c.init = function(a, c) { |
|
a = "" + a, d[a] ? b.extend(d[a], c) : d[a] = c || {}; |
|
}, c.get = function(a) { |
|
return a = "" + a, d[a]; |
|
}, c.checkObsolete = function(a, b) { |
|
(!e[a] || b > e[a]) && (delete d[a], d[a] = null), e[a] = b; |
|
}, {}; |
|
}(); |
|
}, { |
|
lodash: 31 |
|
} ], |
|
35: [ function(a) { |
|
!function() { |
|
"use strict"; |
|
var b = a("../game/game"), c = a("../game/console"), d = a("lodash"), e = a("./runtime-user-globals"); |
|
return self.onmessage = function(a) { |
|
var f, g = a.data, h = { |
|
list: {}, |
|
set: function(a, b, c) { |
|
this.list[a] = this.list[a] || {}, this.list[a][b] = c; |
|
}, |
|
push: function(a, b, c) { |
|
return this.list[a] = this.list[a] || [], this.list[a].length >= c ? !1 : (this.list[a].push(b), |
|
!0); |
|
}, |
|
pushByName: function(a, b, c, d) { |
|
return this.list[a] = this.list[a] || {}, this.list[a][b] = this.list[a][b] || [], |
|
d && this.list[a][b].length >= d ? !1 : (this.list[a][b].push(c), !0); |
|
}, |
|
remove: function(a, b) { |
|
return this.list[a][b] ? (delete this.list[a][b], !0) : !1; |
|
} |
|
}; |
|
if (g.user) { |
|
e.checkObsolete(g.user._id, g.userCodeTimestamp), e.init(g.user._id); |
|
var i = { |
|
get: function() { |
|
return g.userMemory; |
|
}, |
|
set: function(a) { |
|
if (!d.isString(a)) throw new Error("Raw memory value is not a string"); |
|
this._parsed && delete this._parsed, g.userMemory = a; |
|
} |
|
}; |
|
try { |
|
b.runCode(e.get(g.user._id), g.userCode, g, h, i, c.makeConsole(g.user._id), g.consoleCommands, 1 / 0, function() { |
|
return 0; |
|
}, function() {}), f = { |
|
type: "done" |
|
}; |
|
} catch (a) { |
|
f = { |
|
type: "error", |
|
error: d.isObject(a) && a.stack || a.toString() |
|
}; |
|
} |
|
f.intents = h.list, i._parsed && (g.userMemory = JSON.stringify(i._parsed)), f.memory = g.userMemory, |
|
f.console = { |
|
log: c.getMessages(g.user._id), |
|
results: c.getCommandResults(g.user._id) |
|
}, self.postMessage(f); |
|
} |
|
}, {}; |
|
}(); |
|
}, { |
|
"../game/console": 37, |
|
"../game/game": 43, |
|
"./runtime-user-globals": 34, |
|
lodash: 31 |
|
} ], |
|
36: [ function(a, b, c) { |
|
!function() { |
|
"use strict"; |
|
var a = {}, b = 0; |
|
return c.create = function(c) { |
|
return self.postMessage({ |
|
type: "worker", |
|
workerId: b, |
|
startSrc: c |
|
}), a[b] = { |
|
postMessage: function(a) { |
|
self.postMessage({ |
|
type: "worker", |
|
workerId: b, |
|
message: a |
|
}); |
|
}, |
|
terminate: function() { |
|
self.postMessage({ |
|
type: "worker", |
|
workerId: b, |
|
terminate: !0 |
|
}); |
|
} |
|
}; |
|
}, c.handleMessage = function(b) { |
|
a[b.workerId] && a[b.workerId].onmessage({ |
|
target: a[b.workerId], |
|
data: b.message |
|
}); |
|
}, {}; |
|
}(); |
|
}, {} ], |
|
37: [ function(a, b, c) { |
|
"use strict"; |
|
var d = a("lodash"), e = {}, f = {}; |
|
c.makeConsole = function(a) { |
|
return e[a] = [], f[a] = [], { |
|
log: function() { |
|
"undefined" != typeof self && self.navigator.userAgent && console.log.apply(console, arguments), |
|
e[a].push(d.map(arguments, function(a) { |
|
return a && a.toString ? a.toString() : "undefined" == typeof a ? "undefined" : JSON.stringify(a); |
|
}).join(" ")); |
|
}, |
|
commandResult: function(b) { |
|
"undefined" != typeof self && self.navigator.userAgent && console.log.call(console, b), |
|
f[a].push(String(b)); |
|
} |
|
}; |
|
}, c.getMessages = function(a) { |
|
var b = e[a]; |
|
return e[a] = [], b; |
|
}, c.getCommandResults = function(a) { |
|
var b = f[a]; |
|
return f[a] = [], b; |
|
}; |
|
}, { |
|
lodash: 53 |
|
} ], |
|
38: [ function(a, b) { |
|
"use strict"; |
|
b.exports = { |
|
FIND_EXIT_TOP: 1, |
|
FIND_EXIT_RIGHT: 3, |
|
FIND_EXIT_BOTTOM: 5, |
|
FIND_EXIT_LEFT: 7, |
|
FIND_EXIT: 10, |
|
FIND_CREEPS: 101, |
|
FIND_MY_CREEPS: 102, |
|
FIND_HOSTILE_CREEPS: 103, |
|
FIND_SOURCES_ACTIVE: 104, |
|
FIND_SOURCES: 105, |
|
FIND_DROPPED_ENERGY: 106, |
|
FIND_STRUCTURES: 107, |
|
FIND_MY_STRUCTURES: 108, |
|
FIND_HOSTILE_STRUCTURES: 109, |
|
FIND_FLAGS: 110, |
|
FIND_CONSTRUCTION_SITES: 111, |
|
FIND_MY_SPAWNS: 112, |
|
FIND_HOSTILE_SPAWNS: 113, |
|
FIND_MY_CONSTRUCTION_SITES: 114, |
|
FIND_HOSTILE_CONSTRUCTION_SITES: 115, |
|
TOP: 1, |
|
TOP_RIGHT: 2, |
|
RIGHT: 3, |
|
BOTTOM_RIGHT: 4, |
|
BOTTOM: 5, |
|
BOTTOM_LEFT: 6, |
|
LEFT: 7, |
|
TOP_LEFT: 8, |
|
OK: 0, |
|
ERR_NOT_OWNER: -1, |
|
ERR_NO_PATH: -2, |
|
ERR_NAME_EXISTS: -3, |
|
ERR_BUSY: -4, |
|
ERR_NOT_FOUND: -5, |
|
ERR_NOT_ENOUGH_ENERGY: -6, |
|
ERR_INVALID_TARGET: -7, |
|
ERR_FULL: -8, |
|
ERR_NOT_IN_RANGE: -9, |
|
ERR_INVALID_ARGS: -10, |
|
ERR_TIRED: -11, |
|
ERR_NO_BODYPART: -12, |
|
ERR_NOT_ENOUGH_EXTENSIONS: -6, |
|
ERR_RCL_NOT_ENOUGH: -14, |
|
ERR_GCL_NOT_ENOUGH: -15, |
|
COLOR_RED: "red", |
|
COLOR_PURPLE: "purple", |
|
COLOR_BLUE: "blue", |
|
COLOR_CYAN: "cyan", |
|
COLOR_GREEN: "green", |
|
COLOR_YELLOW: "yellow", |
|
COLOR_ORANGE: "orange", |
|
COLOR_BROWN: "brown", |
|
COLOR_GREY: "grey", |
|
COLOR_WHITE: "white", |
|
CREEP_SPAWN_TIME: 3, |
|
CREEP_LIFE_TIME: 1500, |
|
OBSTACLE_OBJECT_TYPES: [ "spawn", "creep", "wall", "source", "constructedWall", "extension", "link", "storage" ], |
|
ENERGY_REGEN_TIME: 300, |
|
ENERGY_REGEN_AMOUNT: 3e3, |
|
ENERGY_DECAY: 1e3, |
|
CREEP_CORPSE_RATE: .2, |
|
REPAIR_COST: .01, |
|
RAMPART_DECAY_AMOUNT: 300, |
|
RAMPART_DECAY_TIME: 100, |
|
RAMPART_HITS: 1, |
|
RAMPART_HITS_MAX: { |
|
2: 3e5, |
|
3: 1e6, |
|
4: 3e6, |
|
5: 1e7, |
|
6: 3e7, |
|
7: 1e8, |
|
8: 3e8 |
|
}, |
|
SPAWN_HITS: 5e3, |
|
SPAWN_ENERGY_START: 300, |
|
SPAWN_ENERGY_CAPACITY: 300, |
|
SOURCE_ENERGY_CAPACITY: 3e3, |
|
ROAD_HITS: 5e3, |
|
WALL_HITS: 1, |
|
WALL_HITS_MAX: 3e8, |
|
EXTENSION_HITS: 1e3, |
|
EXTENSION_ENERGY_CAPACITY: 50, |
|
ROAD_WEAROUT: 1, |
|
ROAD_DECAY_AMOUNT: 100, |
|
ROAD_DECAY_TIME: 1e3, |
|
LINK_HITS: 1e3, |
|
LINK_HITS_MAX: 1e3, |
|
LINK_CAPACITY: 500, |
|
LINK_COOLDOWN: 1, |
|
LINK_LOSS_RATIO: .03, |
|
STORAGE_CAPACITY: 1e6, |
|
STORAGE_HITS: 1e4, |
|
BODYPART_COST: { |
|
move: 50, |
|
work: 100, |
|
attack: 80, |
|
carry: 50, |
|
heal: 250, |
|
ranged_attack: 150, |
|
tough: 10 |
|
}, |
|
CARRY_CAPACITY: 50, |
|
HARVEST_POWER: 2, |
|
REPAIR_POWER: 100, |
|
BUILD_POWER: 5, |
|
ATTACK_POWER: 30, |
|
UPGRADE_CONTROLLER_POWER: 1, |
|
RANGED_ATTACK_POWER: 10, |
|
HEAL_POWER: 12, |
|
RANGED_HEAL_POWER: 4, |
|
MOVE: "move", |
|
WORK: "work", |
|
CARRY: "carry", |
|
ATTACK: "attack", |
|
RANGED_ATTACK: "ranged_attack", |
|
TOUGH: "tough", |
|
HEAL: "heal", |
|
CONSTRUCTION_COST: { |
|
spawn: 15e3, |
|
extension: 3e3, |
|
road: 300, |
|
constructedWall: 1, |
|
rampart: 1, |
|
link: 5e3, |
|
storage: 3e4 |
|
}, |
|
CONSTRUCTION_COST_ROAD_SWAMP_RATIO: 5, |
|
STRUCTURE_SPAWN: "spawn", |
|
STRUCTURE_EXTENSION: "extension", |
|
STRUCTURE_ROAD: "road", |
|
STRUCTURE_WALL: "constructedWall", |
|
STRUCTURE_RAMPART: "rampart", |
|
STRUCTURE_KEEPER_LAIR: "keeperLair", |
|
STRUCTURE_PORTAL: "portal", |
|
STRUCTURE_CONTROLLER: "controller", |
|
STRUCTURE_LINK: "link", |
|
STRUCTURE_STORAGE: "storage", |
|
CONTROLLER_LEVELS: { |
|
1: 200, |
|
2: 45e3, |
|
3: 135e3, |
|
4: 405e3, |
|
5: 1215e3, |
|
6: 3645e3, |
|
7: 10935e3 |
|
}, |
|
CONTROLLER_STRUCTURES: { |
|
spawn: { |
|
1: 1, |
|
2: 1, |
|
3: 1, |
|
4: 1, |
|
5: 1, |
|
6: 1, |
|
7: 2, |
|
8: 3 |
|
}, |
|
extension: { |
|
1: 0, |
|
2: 5, |
|
3: 10, |
|
4: 20, |
|
5: 30, |
|
6: 40, |
|
7: 80, |
|
8: 200 |
|
}, |
|
link: { |
|
1: 0, |
|
2: 0, |
|
3: 0, |
|
4: 0, |
|
5: 2, |
|
6: 3, |
|
7: 4, |
|
8: 5 |
|
}, |
|
road: { |
|
0: 2500, |
|
1: 2500, |
|
2: 2500, |
|
3: 2500, |
|
4: 2500, |
|
5: 2500, |
|
6: 2500, |
|
7: 2500, |
|
8: 2500 |
|
}, |
|
constructedWall: { |
|
1: 0, |
|
2: 2500, |
|
3: 2500, |
|
4: 2500, |
|
5: 2500, |
|
6: 2500, |
|
7: 2500, |
|
8: 2500 |
|
}, |
|
rampart: { |
|
1: 0, |
|
2: 2500, |
|
3: 2500, |
|
4: 2500, |
|
5: 2500, |
|
6: 2500, |
|
7: 2500, |
|
8: 2500 |
|
}, |
|
storage: { |
|
1: 0, |
|
2: 0, |
|
3: 0, |
|
4: 1, |
|
5: 1, |
|
6: 1, |
|
7: 1, |
|
8: 1 |
|
} |
|
}, |
|
CONTROLLER_DOWNGRADE: { |
|
1: 2e4, |
|
2: 5e4, |
|
3: 5e4, |
|
4: 5e4, |
|
5: 5e4, |
|
6: 5e4, |
|
7: 5e4, |
|
8: 5e4 |
|
}, |
|
CONTROLLER_RESERVE: 6, |
|
CONTROLLER_RESERVE_MAX: 5e3, |
|
CONTROLLER_RESERVE_COST: 1, |
|
CONTROLLER_MAX_UPGRADE_PER_TICK: 15, |
|
GCL_POW: 2.4, |
|
GCL_MULTIPLY: 1e6, |
|
MODE_SIMULATION: "simulation", |
|
MODE_SURVIVAL: "survival", |
|
MODE_WORLD: "world", |
|
MODE_ARENA: "arena", |
|
TERRAIN_MASK_WALL: 1, |
|
TERRAIN_MASK_SWAMP: 2, |
|
TERRAIN_MASK_LAVA: 4, |
|
MAX_CONSTRUCTION_SITES: 100, |
|
MAX_CREEP_SIZE: 50 |
|
}, b.exports.BODYPARTS_ALL = [ b.exports.MOVE, b.exports.WORK, b.exports.CARRY, b.exports.ATTACK, b.exports.RANGED_ATTACK, b.exports.TOUGH, b.exports.HEAL ]; |
|
}, {} ], |
|
39: [ function(a, b, c) { |
|
"use strict"; |
|
var d, e, f, g, h = a("./../utils"), i = (a("./rooms"), a("./constants")), j = a("lodash"); |
|
c.make = function(a, b, c, k) { |
|
if (d = a, e = b, f = c, g = k, !g.ConstructionSite) { |
|
var l = function(a) { |
|
if (!d.roomObjects[a]) throw new Error("Could not find an object with ID " + a); |
|
return d.roomObjects[a]; |
|
}, m = function(a) { |
|
this.id = a; |
|
}; |
|
h.defineGameObjectProperties(m.prototype, l, { |
|
room: function(a) { |
|
return f.rooms[a.room]; |
|
}, |
|
pos: function(a) { |
|
return new g.RoomPosition(a.x, a.y, a.room); |
|
}, |
|
progress: function(a) { |
|
return a.progress; |
|
}, |
|
progressTotal: function(a) { |
|
return a.progressTotal; |
|
}, |
|
structureType: function(a) { |
|
return a.structureType; |
|
}, |
|
name: function(a) { |
|
return a.name; |
|
}, |
|
owner: function(a) { |
|
return new Object({ |
|
username: d.users[a.user].username |
|
}); |
|
}, |
|
my: function(a) { |
|
return j.isUndefined(a.user) ? void 0 : a.user == d.user._id; |
|
} |
|
}), m.prototype.toString = function() { |
|
return "[construction site (" + l(this.id).structureType + ") #" + this.id + "]"; |
|
}, m.prototype.remove = function() { |
|
return this.my ? (e.set(this.id, "remove", {}), i.OK) : i.ERR_NOT_OWNER; |
|
}, g.ConstructionSite = m; |
|
} |
|
}; |
|
}, { |
|
"./../utils": 108, |
|
"./constants": 38, |
|
"./rooms": 47, |
|
lodash: 53 |
|
} ], |
|
40: [ function(a, b, c) { |
|
"use strict"; |
|
function d(a, b) { |
|
return null != b && b[Symbol.hasInstance] ? b[Symbol.hasInstance](a) : a instanceof b; |
|
} |
|
var e, f, g, h, i = function() { |
|
function a(a, b) { |
|
var c = [], d = !0, e = !1, f = void 0; |
|
try { |
|
for (var g, h = a[Symbol.iterator](); !(d = (g = h.next()).done) && (c.push(g.value), |
|
!b || c.length !== b); d = !0) ; |
|
} catch (i) { |
|
e = !0, f = i; |
|
} finally { |
|
try { |
|
!d && h["return"] && h["return"](); |
|
} finally { |
|
if (e) throw f; |
|
} |
|
} |
|
return c; |
|
} |
|
return function(b, c) { |
|
if (Array.isArray(b)) return b; |
|
if (Symbol.iterator in Object(b)) return a(b, c); |
|
throw new TypeError("Invalid attempt to destructure non-iterable instance"); |
|
}; |
|
}(), j = a("./../utils"), k = (a("./rooms"), a("lodash")), l = a("./constants"); |
|
c.make = function(a, b, c, m) { |
|
if (e = a, f = b, g = c, h = m, !h.Creep) { |
|
var n = function(a) { |
|
if (!e.roomObjects[a]) throw new Error("Could not find an object with ID " + a); |
|
return e.roomObjects[a]; |
|
}, o = function(a) { |
|
this.id = a; |
|
}; |
|
j.defineGameObjectProperties(o.prototype, n, { |
|
room: function(a) { |
|
return g.rooms[a.room]; |
|
}, |
|
pos: function(a) { |
|
return new h.RoomPosition(a.x, a.y, a.room); |
|
}, |
|
name: function(a) { |
|
return a.user == e.user._id ? a.name : void 0; |
|
}, |
|
body: function(a) { |
|
return a.body; |
|
}, |
|
my: function(a) { |
|
return a.user == e.user._id; |
|
}, |
|
owner: function(a) { |
|
return new Object({ |
|
username: e.users[a.user].username |
|
}); |
|
}, |
|
spawning: function(a) { |
|
return a.spawning; |
|
}, |
|
ticksToLive: function(a) { |
|
return a.ageTime ? a.ageTime - e.time : void 0; |
|
}, |
|
carryCapacity: function(a) { |
|
return a.energyCapacity; |
|
}, |
|
carry: function(a) { |
|
return new Object({ |
|
energy: a.energy |
|
}); |
|
}, |
|
fatigue: function(a) { |
|
return a.fatigue; |
|
}, |
|
hits: function(a) { |
|
return a.hits; |
|
}, |
|
hitsMax: function(a) { |
|
return a.hitsMax; |
|
} |
|
}), Object.defineProperty(o.prototype, "memory", { |
|
get: function() { |
|
return this.my ? ((k.isUndefined(h.Memory.creeps) || "undefined" === h.Memory.creeps) && (h.Memory.creeps = {}), |
|
k.isObject(h.Memory.creeps) ? h.Memory.creeps[n(this.id).name] = h.Memory.creeps[n(this.id).name] || {} : void 0) : void 0; |
|
}, |
|
set: function(a) { |
|
if (!this.my) throw new Error("Could not set other player's creep memory"); |
|
if ((k.isUndefined(h.Memory.creeps) || "undefined" === h.Memory.creeps) && (h.Memory.creeps = {}), |
|
!k.isObject(h.Memory.creeps)) throw new Error("Could not set creep memory"); |
|
h.Memory.creeps[n(this.id).name] = a; |
|
} |
|
}), o.prototype.toString = function() { |
|
return "[creep " + (n(this.id).user == e.user._id ? n(this.id).name : "#" + this.id) + "]"; |
|
}, o.prototype.move = function(a) { |
|
return this.my ? n(this.id).spawning ? l.ERR_BUSY : n(this.id).fatigue > 0 ? l.ERR_TIRED : 0 == this.getActiveBodyparts(l.MOVE) ? l.ERR_NO_BODYPART : (f.set(this.id, "move", { |
|
direction: a |
|
}), l.OK) : l.ERR_NOT_OWNER; |
|
}, o.prototype.moveTo = function(a, b, c) { |
|
if (!this.my) return l.ERR_NOT_OWNER; |
|
if (n(this.id).spawning) return l.ERR_BUSY; |
|
if (n(this.id).fatigue > 0) return l.ERR_TIRED; |
|
if (0 == this.getActiveBodyparts(l.MOVE)) return l.ERR_NO_BODYPART; |
|
var d = j.fetchXYArguments(a, b, h), f = i(d, 3), g = f[0], m = f[1], o = f[2]; |
|
if (o = o || this.pos.roomName, k.isUndefined(g) || k.isUndefined(m)) return l.ERR_INVALID_TARGET; |
|
var p = new h.RoomPosition(g, m, o); |
|
if (k.isObject(a) && (c = k.clone(b)), c = c || {}, k.isUndefined(c.reusePath) && (c.reusePath = 5), |
|
k.isUndefined(c.serializeMemory) && (c.serializeMemory = !0), g == this.pos.x && m == this.pos.y && o == this.pos.roomName) return l.OK; |
|
if (c.reusePath && this.memory && k.isObject(this.memory) && this.memory._move) { |
|
var q = this.memory._move; |
|
if (e.time > q.time + parseInt(c.reusePath) || q.room != this.pos.roomName) delete this.memory._move; else if (q.dest.room == this.pos.roomName && q.dest.x == g && q.dest.y == m || q.dest.room != this.pos.roomName && q.dest.room == o) { |
|
var r = k.isString(q.path) ? j.deserializePath(q.path) : q.path, s = k.findIndex(r, { |
|
x: this.pos.x, |
|
y: this.pos.y |
|
}); |
|
if (-1 != s && (r.splice(0, s + 1), q.path = c.serializeMemory ? j.serializePath(r) : r), |
|
0 == r.length) return this.pos.isNearTo(p) ? l.OK : l.ERR_NO_PATH; |
|
var t = this.moveByPath(r); |
|
if (t == l.OK) return l.OK; |
|
} |
|
} |
|
if (c.noPathFinding) return l.ERR_NOT_FOUND; |
|
var r = this.pos.findPathTo(p, c); |
|
return c.reusePath && this.memory && k.isObject(this.memory) && (this.memory._move = { |
|
dest: { |
|
x: g, |
|
y: m, |
|
room: o |
|
}, |
|
time: e.time, |
|
path: c.serializeMemory ? j.serializePath(r) : k.clone(r), |
|
room: this.pos.roomName |
|
}), 0 == r.length ? l.ERR_NO_PATH : (this.move(r[0].direction), l.OK); |
|
}, o.prototype.moveByPath = function(a) { |
|
var b = this; |
|
if (k.isString(a) && (a = j.deserializePath(a)), !k.isArray(a)) return l.ERR_INVALID_ARGS; |
|
var c = k.find(a, function(a) { |
|
return a.x - a.dx == b.pos.x && a.y - a.dy == b.pos.y; |
|
}); |
|
return c ? this.move(c.direction) : l.ERR_NOT_FOUND; |
|
}, o.prototype.harvest = function(a) { |
|
return this.my ? n(this.id).spawning ? l.ERR_BUSY : 0 == this.getActiveBodyparts(l.WORK) ? l.ERR_NO_BODYPART : a && a.id && g.sources[a.id] && d(a, h.Source) ? a.energy ? a.pos.isNearTo(this.pos) ? (f.set(this.id, "harvest", { |
|
id: a.id |
|
}), l.OK) : l.ERR_NOT_IN_RANGE : l.ERR_NOT_ENOUGH_ENERGY : l.ERR_INVALID_TARGET : l.ERR_NOT_OWNER; |
|
}, o.prototype.transferEnergy = function(a, b) { |
|
return this.my ? n(this.id).spawning ? l.ERR_BUSY : 0 > b ? l.ERR_INVALID_ARGS : a && a.id && (g.spawns[a.id] || g.creeps[a.id] || g.structures[a.id]) && (d(a, h.Spawn) || d(a, h.Structure) || d(a, h.Creep)) && (!g.structures[a.id] || "extension" == g.structures[a.id].structureType || "spawn" == g.structures[a.id].structureType || "link" == g.structures[a.id].structureType || "storage" == g.structures[a.id].structureType || "portal" == g.structures[a.id].structureType && /^arena/.test(n(this.id).room)) ? a.pos.isNearTo(this.pos) ? n(this.id).energy ? !k.isUndefined(n(a.id).energyCapacity) && n(a.id).energy > n(a.id).energyCapacity ? l.ERR_FULL : (b || (b = k.isUndefined(n(a.id).energyCapacity) ? n(this.id).energy : Math.min(n(this.id).energy, n(a.id).energyCapacity - n(a.id).energy)), |
|
this.carry.energy < b ? l.ERR_NOT_ENOUGH_ENERGY : k.isUndefined(n(a.id).energyCapacity) || b && !(n(a.id).energy + b > n(a.id).energyCapacity) ? (f.set(this.id, "transferEnergy", { |
|
id: a.id, |
|
amount: b |
|
}), l.OK) : l.ERR_FULL) : l.ERR_NOT_ENOUGH_ENERGY : l.ERR_NOT_IN_RANGE : l.ERR_INVALID_TARGET : l.ERR_NOT_OWNER; |
|
}, o.prototype.pickup = function(a) { |
|
return this.my ? n(this.id).spawning ? l.ERR_BUSY : a && a.id && g.energy[a.id] && d(a, h.Energy) ? this.carry.energy >= this.carryCapacity ? l.ERR_FULL : a.pos.isNearTo(this.pos) ? (f.set(this.id, "pickup", { |
|
id: a.id |
|
}), l.OK) : l.ERR_NOT_IN_RANGE : l.ERR_INVALID_TARGET : l.ERR_NOT_OWNER; |
|
}, o.prototype.dropEnergy = function(a) { |
|
return this.my ? n(this.id).spawning ? l.ERR_BUSY : n(this.id).energy ? (a || (a = n(this.id).energy), |
|
this.carry.energy < a ? l.ERR_NOT_ENOUGH_ENERGY : (f.set(this.id, "dropEnergy", { |
|
amount: a |
|
}), l.OK)) : l.ERR_NOT_ENOUGH_ENERGY : l.ERR_NOT_OWNER; |
|
}, o.prototype.getActiveBodyparts = function(a) { |
|
return k.filter(this.body, function(b) { |
|
return b.hits > 0 && b.type == a; |
|
}).length; |
|
}, o.prototype.attack = function(a) { |
|
return this.my ? n(this.id).spawning ? l.ERR_BUSY : 0 == this.getActiveBodyparts(l.ATTACK) ? l.ERR_NO_BODYPART : a && a.id && (g.creeps[a.id] || g.structures[a.id]) && (d(a, h.Creep) || d(a, h.Spawn) || d(a, h.Structure)) ? a.pos.isNearTo(this.pos) ? (f.set(this.id, "attack", { |
|
id: a.id, |
|
x: a.pos.x, |
|
y: a.pos.y |
|
}), l.OK) : l.ERR_NOT_IN_RANGE : l.ERR_INVALID_TARGET : l.ERR_NOT_OWNER; |
|
}, o.prototype.rangedAttack = function(a) { |
|
return this.my ? n(this.id).spawning ? l.ERR_BUSY : 0 == this.getActiveBodyparts(l.RANGED_ATTACK) ? l.ERR_NO_BODYPART : a && a.id && (g.creeps[a.id] || g.structures[a.id]) && (d(a, h.Creep) || d(a, h.Spawn) || d(a, h.Structure)) ? Math.abs(a.pos.x - this.pos.x) > 3 || Math.abs(a.pos.y - this.pos.y) > 3 ? l.ERR_NOT_IN_RANGE : (f.set(this.id, "rangedAttack", { |
|
id: a.id |
|
}), l.OK) : l.ERR_INVALID_TARGET : l.ERR_NOT_OWNER; |
|
}, o.prototype.rangedMassAttack = function() { |
|
return this.my ? n(this.id).spawning ? l.ERR_BUSY : 0 == this.getActiveBodyparts(l.RANGED_ATTACK) ? l.ERR_NO_BODYPART : (f.set(this.id, "rangedMassAttack", {}), |
|
l.OK) : l.ERR_NOT_OWNER; |
|
}, o.prototype.heal = function(a) { |
|
return this.my ? n(this.id).spawning ? l.ERR_BUSY : 0 == this.getActiveBodyparts(l.HEAL) ? l.ERR_NO_BODYPART : a && a.id && g.creeps[a.id] && d(a, h.Creep) ? a.pos.isNearTo(this.pos) ? (f.set(this.id, "heal", { |
|
id: a.id, |
|
x: a.pos.x, |
|
y: a.pos.y |
|
}), l.OK) : l.ERR_NOT_IN_RANGE : l.ERR_INVALID_TARGET : l.ERR_NOT_OWNER; |
|
}, o.prototype.rangedHeal = function(a) { |
|
return this.my ? n(this.id).spawning ? l.ERR_BUSY : 0 == this.getActiveBodyparts(l.HEAL) ? l.ERR_NO_BODYPART : a && a.id && g.creeps[a.id] && d(a, h.Creep) ? Math.abs(a.pos.x - this.pos.x) > 3 || Math.abs(a.pos.y - this.pos.y) > 3 ? l.ERR_NOT_IN_RANGE : (f.set(this.id, "rangedHeal", { |
|
id: a.id |
|
}), l.OK) : l.ERR_INVALID_TARGET : l.ERR_NOT_OWNER; |
|
}, o.prototype.repair = function(a) { |
|
return this.my ? n(this.id).spawning ? l.ERR_BUSY : 0 == this.getActiveBodyparts(l.WORK) ? l.ERR_NO_BODYPART : this.carry.energy ? a && a.id && g.structures[a.id] && (d(a, h.Structure) || d(a, h.Spawn)) ? Math.abs(a.pos.x - this.pos.x) > 3 || Math.abs(a.pos.y - this.pos.y) > 3 ? l.ERR_NOT_IN_RANGE : (f.set(this.id, "repair", { |
|
id: a.id, |
|
x: a.pos.x, |
|
y: a.pos.y |
|
}), l.OK) : l.ERR_INVALID_TARGET : l.ERR_NOT_ENOUGH_ENERGY : l.ERR_NOT_OWNER; |
|
}, o.prototype.build = function(a) { |
|
if (!this.my) return l.ERR_NOT_OWNER; |
|
if (n(this.id).spawning) return l.ERR_BUSY; |
|
if (0 == this.getActiveBodyparts(l.WORK)) return l.ERR_NO_BODYPART; |
|
if (!this.carry.energy) return l.ERR_NOT_ENOUGH_ENERGY; |
|
if (!(a && a.id && g.constructionSites[a.id] && d(a, h.ConstructionSite))) return l.ERR_INVALID_TARGET; |
|
if (Math.abs(a.pos.x - this.pos.x) > 3 || Math.abs(a.pos.y - this.pos.y) > 3) return l.ERR_NOT_IN_RANGE; |
|
if (k.contains([ "spawn", "extension", "constructedWall" ], a.structureType) && k.any(g.objectsByRoom[n(this.id).room], function(b) { |
|
return b.x == a.pos.x && b.y == a.pos.y && k.contains(l.OBSTACLE_OBJECT_TYPES, b.type); |
|
})) return l.ERR_INVALID_TARGET; |
|
var b = this.getActiveBodyparts(l.WORK) * l.BUILD_POWER, c = a.progressTotal - a.progress, e = Math.min(b, c, this.carry.energy); |
|
return a.progress + e >= a.progressTotal && !j.checkControllerAvailability(a.structureType, g.objectsByRoom[n(this.id).room], this.room.controller, 1) ? l.ERR_RCL_NOT_ENOUGH : (f.set(this.id, "build", { |
|
id: a.id, |
|
x: a.pos.x, |
|
y: a.pos.y |
|
}), l.OK); |
|
}, o.prototype.suicide = function() { |
|
return this.my ? n(this.id).spawning ? l.ERR_BUSY : (f.set(this.id, "suicide", {}), |
|
l.OK) : l.ERR_NOT_OWNER; |
|
}, o.prototype.say = function(a) { |
|
return this.my ? n(this.id).spawning ? l.ERR_BUSY : (f.set(this.id, "say", { |
|
message: "" + a |
|
}), l.OK) : l.ERR_NOT_OWNER; |
|
}, o.prototype.claimController = function(a) { |
|
if (!this.my) return l.ERR_NOT_OWNER; |
|
if (n(this.id).spawning) return l.ERR_BUSY; |
|
if (this.room.mode == l.MODE_WORLD) { |
|
var b = k.filter(e.userObjects, { |
|
type: "controller" |
|
}).length; |
|
if (b && (!e.user.gcl || e.user.gcl < l.GCL_MULTIPLY * Math.pow(b, l.GCL_POW))) return l.ERR_GCL_NOT_ENOUGH; |
|
} |
|
return a && a.id && g.structures[a.id] && d(a, h.Structure) ? a.pos.isNearTo(this.pos) ? "controller" != a.structureType ? l.ERR_INVALID_TARGET : a.owner ? l.ERR_INVALID_TARGET : a.reservation && a.reservation.username != e.user.username ? l.ERR_INVALID_TARGET : (f.set(this.id, "claimController", { |
|
id: a.id |
|
}), l.OK) : l.ERR_NOT_IN_RANGE : l.ERR_INVALID_TARGET; |
|
}, o.prototype.unclaimController = function(a) { |
|
return this.my ? n(this.id).spawning ? l.ERR_BUSY : a && a.id && g.structures[a.id] && d(a, h.Structure) ? a.pos.isNearTo(this.pos) ? "controller" != a.structureType ? l.ERR_INVALID_TARGET : a.my ? (f.set(this.id, "unclaimController", { |
|
id: a.id |
|
}), l.OK) : l.ERR_INVALID_TARGET : l.ERR_NOT_IN_RANGE : l.ERR_INVALID_TARGET : l.ERR_NOT_OWNER; |
|
}, o.prototype.upgradeController = function(a) { |
|
return this.my ? n(this.id).spawning ? l.ERR_BUSY : 0 == this.getActiveBodyparts(l.WORK) ? l.ERR_NO_BODYPART : this.carry.energy ? a && a.id && g.structures[a.id] && d(a, h.Structure) ? a.pos.isNearTo(this.pos) ? "controller" != a.structureType ? l.ERR_INVALID_TARGET : a.level && a.owner ? (f.set(this.id, "upgradeController", { |
|
id: a.id |
|
}), l.OK) : l.ERR_INVALID_TARGET : l.ERR_NOT_IN_RANGE : l.ERR_INVALID_TARGET : l.ERR_NOT_ENOUGH_ENERGY : l.ERR_NOT_OWNER; |
|
}, o.prototype.reserveController = function(a) { |
|
return this.my ? n(this.id).spawning ? l.ERR_BUSY : a && a.id && g.structures[a.id] && d(a, h.Structure) ? a.pos.isNearTo(this.pos) ? "controller" != a.structureType ? l.ERR_INVALID_TARGET : a.owner ? l.ERR_INVALID_TARGET : a.reservation && a.reservation.username != e.user.username ? l.ERR_INVALID_TARGET : this.getActiveBodyparts(l.WORK) < 40 ? l.ERR_NO_BODYPART : this.carry.energy < 2 ? l.ERR_NOT_ENOUGH_ENERGY : (f.set(this.id, "reserveController", { |
|
id: a.id |
|
}), l.OK) : l.ERR_NOT_IN_RANGE : l.ERR_INVALID_TARGET : l.ERR_NOT_OWNER; |
|
}, o.prototype.notifyWhenAttacked = function(a) { |
|
return this.my ? k.isBoolean(a) ? (a != n(this.id).notifyWhenAttacked && f.set(this.id, "notifyWhenAttacked", { |
|
enabled: a |
|
}), l.OK) : l.ERR_INVALID_ARGS : l.ERR_NOT_OWNER; |
|
}, o.prototype.cancelOrder = function(a) { |
|
return f.remove(this.id, a) ? l.OK : l.ERR_NOT_FOUND; |
|
}, h.Creep = o; |
|
} |
|
}; |
|
}, { |
|
"./../utils": 108, |
|
"./constants": 38, |
|
"./rooms": 47, |
|
lodash: 53 |
|
} ], |
|
41: [ function(a, b, c) { |
|
"use strict"; |
|
{ |
|
var d, e, f, g, h = a("./../utils"); |
|
a("./rooms"), a("./constants"); |
|
} |
|
c.make = function(a, b, c, i) { |
|
if (d = a, e = b, f = c, g = i, !g.Energy) { |
|
var j = function(a) { |
|
if (!d.roomObjects[a]) throw new Error("Could not find an object with ID " + a); |
|
return d.roomObjects[a]; |
|
}, k = function(a) { |
|
this.id = a; |
|
}; |
|
h.defineGameObjectProperties(k.prototype, j, { |
|
room: function(a) { |
|
return f.rooms[a.room]; |
|
}, |
|
pos: function(a) { |
|
return new g.RoomPosition(a.x, a.y, a.room); |
|
}, |
|
energy: function(a) { |
|
return a.energy; |
|
} |
|
}), k.prototype.toString = function() { |
|
return "[energy #" + this.id + "]"; |
|
}, g.Energy = k; |
|
} |
|
}; |
|
}, { |
|
"./../utils": 108, |
|
"./constants": 38, |
|
"./rooms": 47 |
|
} ], |
|
42: [ function(a, b, c) { |
|
"use strict"; |
|
var d, e, f, g, h = function() { |
|
function a(a, b) { |
|
var c = [], d = !0, e = !1, f = void 0; |
|
try { |
|
for (var g, h = a[Symbol.iterator](); !(d = (g = h.next()).done) && (c.push(g.value), |
|
!b || c.length !== b); d = !0) ; |
|
} catch (i) { |
|
e = !0, f = i; |
|
} finally { |
|
try { |
|
!d && h["return"] && h["return"](); |
|
} finally { |
|
if (e) throw f; |
|
} |
|
} |
|
return c; |
|
} |
|
return function(b, c) { |
|
if (Array.isArray(b)) return b; |
|
if (Symbol.iterator in Object(b)) return a(b, c); |
|
throw new TypeError("Invalid attempt to destructure non-iterable instance"); |
|
}; |
|
}(), i = a("./../utils"), j = (a("./rooms"), a("./constants")), k = a("lodash"); |
|
c.make = function(a, b, c, l) { |
|
if (d = a, e = b, f = c, g = l, !g.Flag) { |
|
var m = function(a) { |
|
if (!d.roomObjects[a]) throw new Error("Could not find an object with ID " + a); |
|
return d.roomObjects[a]; |
|
}, n = function(a) { |
|
this.id = a; |
|
}; |
|
i.defineGameObjectProperties(n.prototype, m, { |
|
room: function(a) { |
|
return f.rooms[a.room]; |
|
}, |
|
pos: function(a) { |
|
return new g.RoomPosition(a.x, a.y, a.room); |
|
}, |
|
color: function(a) { |
|
return a.color; |
|
}, |
|
name: function(a) { |
|
return a.name; |
|
}, |
|
roomName: function(a) { |
|
return a.room; |
|
} |
|
}), Object.defineProperty(n.prototype, "memory", { |
|
get: function() { |
|
return (k.isUndefined(g.Memory.flags) || "undefined" === g.Memory.flags) && (g.Memory.flags = {}), |
|
k.isObject(g.Memory.flags) ? g.Memory.flags[m(this.id).name] = g.Memory.flags[m(this.id).name] || {} : void 0; |
|
}, |
|
set: function(a) { |
|
if ((k.isUndefined(g.Memory.flags) || "undefined" === g.Memory.flags) && (g.Memory.flags = {}), |
|
!k.isObject(g.Memory.flags)) throw new Error("Could not set flag memory"); |
|
g.Memory.flags[m(this.id).name] = a; |
|
} |
|
}), n.prototype.toString = function() { |
|
return "[flag " + m(this.id).name + "]"; |
|
}, n.prototype.remove = function() { |
|
return e.set(this.id, "remove", {}), j.OK; |
|
}, n.prototype.setPosition = function(a, b) { |
|
var c = i.fetchXYArguments(a, b, g), d = h(c, 3), f = d[0], l = d[1], m = d[2]; |
|
return m = m || this.roomName, k.isUndefined(f) || k.isUndefined(l) ? j.ERR_INVALID_TARGET : (e.set(this.id, "setPosition", { |
|
x: f, |
|
y: l, |
|
roomName: m |
|
}), j.OK); |
|
}, n.prototype.setColor = function(a) { |
|
return k.contains([ "white", "grey", "red", "purple", "blue", "cyan", "green", "yellow", "orange", "brown" ], a) ? (e.set(this.id, "setColor", { |
|
color: a |
|
}), j.OK) : j.ERR_INVALID_ARGS; |
|
}, g.Flag = n; |
|
} |
|
}; |
|
}, { |
|
"./../utils": 108, |
|
"./constants": 38, |
|
"./rooms": 47, |
|
lodash: 53 |
|
} ], |
|
43: [ function(a, b, c) { |
|
"use strict"; |
|
function d(a, b, c) { |
|
return b in a ? Object.defineProperty(a, b, { |
|
value: c, |
|
enumerable: !0, |
|
configurable: !0, |
|
writable: !0 |
|
}) : a[b] = c, a; |
|
} |
|
!function() { |
|
function b() {} |
|
function e(a, b) { |
|
if (k.extend(a, { |
|
creeps: {}, |
|
structures: {}, |
|
ownedStructures: {}, |
|
spawns: {}, |
|
sources: {}, |
|
energy: {}, |
|
flags: {}, |
|
constructionSites: {} |
|
}), b) { |
|
var c = Object.keys(a); |
|
a.spatial = {}, c.forEach(function(b) { |
|
a.spatial[b] = new Array(50); |
|
for (var c = 0; 50 > c; c++) a.spatial[b][c] = new Array(50); |
|
}); |
|
} |
|
} |
|
function f(a, b, c, d) { |
|
(!p[b] || p[b](c)) && (a.findCache[b] = a.findCache[b] || {}, a.findCache[b][d.room] = a.findCache[b][d.room] || [], |
|
a.findCache[b][d.room].push(c)); |
|
} |
|
function g(a, b, c, d) { |
|
a[b][c.id] = c, a.byRoom[d.room][b][c.id] = c, a.byRoom[d.room].spatial[b][d.y][d.x] = a.byRoom[d.room].spatial[b][d.y][d.x] || [], |
|
a.byRoom[d.room].spatial[b][d.y][d.x].push(c); |
|
} |
|
function h(c, d, h, i, j) { |
|
var m = { |
|
_objects: {}, |
|
byRoom: {}, |
|
findCache: {}, |
|
rooms: {} |
|
}, n = []; |
|
m.deprecated = function(a) { |
|
k.contains(n, a) || (n.push(a), j.console.log(a)); |
|
}, e(m); |
|
var p = Math.floor(Math.pow((c.user.gcl || 0) / l.GCL_MULTIPLY, 1 / l.GCL_POW)) + 1, q = Math.pow(p - 1, l.GCL_POW) * l.GCL_MULTIPLY, r = { |
|
creeps: {}, |
|
spawns: {}, |
|
structures: {}, |
|
flags: {}, |
|
rooms: {}, |
|
time: c.time, |
|
cpuLimit: c.cpu, |
|
map: {}, |
|
gcl: { |
|
level: p, |
|
progress: (c.user.gcl || 0) - q, |
|
progressTotal: Math.pow(p, l.GCL_POW) * l.GCL_MULTIPLY - q |
|
}, |
|
getObjectById: function(a) { |
|
return m._objects[a] || null; |
|
}, |
|
getUsedCpu: function() { |
|
return i(); |
|
}, |
|
notify: function(a, b) { |
|
return d.push("notify", { |
|
message: a, |
|
groupInterval: b |
|
}, 20) ? l.OK : l.ERR_FULL; |
|
} |
|
}; |
|
m.terrainByRoom = c.roomTerrain, b(c.user._id, "before objects by room"), m.objectsByRoom = {}, |
|
m.objectsByRoomKeys = {}, k.forEach(c.roomObjects, function(a, b) { |
|
a.temp || (m.objectsByRoom[a.room] = m.objectsByRoom[a.room] || {}, m.objectsByRoom[a.room][b] = a, |
|
m.objectsByRoomKeys[a.room] = m.objectsByRoomKeys[a.room] || [], m.objectsByRoomKeys[a.room].push(b), |
|
"wall" == a.type && (m.terrainByRoom[a.room][b] = a, m.terrainByRoom.spatial[a.room][a.y][a.x] |= l.TERRAIN_MASK_WALL), |
|
"swamp" == a.type && (m.terrainByRoom[a.room][b] = a, m.terrainByRoom.spatial[a.room][a.y][a.x] |= l.TERRAIN_MASK_SWAMP)); |
|
}), b(c.user._id, "after objects by room"); |
|
for (var s in c.rooms) m.byRoom[s] = {}, e(m.byRoom[s], !0); |
|
a("./rooms").make(c, d, m, j), a("./rooms").makePos(m, j), a("./creeps").make(c, d, m, j), |
|
a("./structures").make(c, d, m, j), a("./spawns").make(c, d, m, j), a("./sources").make(c, d, m, j), |
|
a("./energy").make(c, d, m, j), a("./flags").make(c, d, m, j), a("./construction-sites").make(c, d, m, j); |
|
for (var s in c.rooms) m.rooms[s] = new j.Room(s); |
|
r.rooms = k.clone(m.rooms); |
|
var t = { |
|
rampart: 1, |
|
road: 1, |
|
extension: 1, |
|
constructedWall: 1, |
|
keeperLair: 1, |
|
portal: 1, |
|
controller: 1, |
|
link: 1, |
|
storage: 1 |
|
}, u = { |
|
rampart: 1, |
|
extension: 1, |
|
controller: 1, |
|
link: 1, |
|
keeperLair: 1, |
|
storage: 1 |
|
}; |
|
b(c.user._id, "before objects"); |
|
var v = {}; |
|
for (var s in c.roomObjects) { |
|
var w = c.roomObjects[s]; |
|
w.temp || (v[w.type] = v[w.type] || 0, v[w.type]++, "creep" == w.type && (m._objects[s] = new j.Creep(s), |
|
g(m, "creeps", m._objects[s], w), c.userObjects[s] && (r.creeps[m.creeps[s].name] ? m.creeps[s].suicide() : r.creeps[m.creeps[s].name] = m.creeps[s]), |
|
f(m, l.FIND_CREEPS, m.creeps[s], w), f(m, l.FIND_MY_CREEPS, m.creeps[s], w), f(m, l.FIND_HOSTILE_CREEPS, m.creeps[s], w)), |
|
t[w.type] && (m._objects[s] = new j.Structure(s), g(m, "structures", m._objects[s], w), |
|
u[w.type] && (c.userObjects[s] && (r.structures[m.structures[s].id] = m.structures[s]), |
|
g(m, "ownedStructures", m._objects[s], w)), f(m, l.FIND_STRUCTURES, m.structures[s], w), |
|
f(m, l.FIND_MY_STRUCTURES, m.structures[s], w), f(m, l.FIND_HOSTILE_STRUCTURES, m.structures[s], w)), |
|
"spawn" == w.type && (m._objects[s] = new j.Spawn(s), g(m, "spawns", m._objects[s], w), |
|
g(m, "structures", m._objects[s], w), g(m, "ownedStructures", m._objects[s], w), |
|
c.userObjects[s] && (r.spawns[m.spawns[s].name] = m.spawns[s]), f(m, l.FIND_MY_SPAWNS, m.spawns[s], w), |
|
f(m, l.FIND_HOSTILE_SPAWNS, m.spawns[s], w), f(m, l.FIND_STRUCTURES, m.structures[s], w), |
|
f(m, l.FIND_MY_STRUCTURES, m.structures[s], w), f(m, l.FIND_HOSTILE_STRUCTURES, m.structures[s], w)), |
|
("extension" == w.type || "spawn" == w.type) && (m.rooms[w.room].energyAvailable += w.energy, |
|
m.rooms[w.room].energyCapacityAvailable += w.energyCapacity), "source" == w.type && (m._objects[s] = new j.Source(s), |
|
g(m, "sources", m._objects[s], w), f(m, l.FIND_SOURCES, m.sources[s], w), f(m, l.FIND_SOURCES_ACTIVE, m.sources[s], w)), |
|
"energy" == w.type && (m._objects[s] = new j.Energy(s), g(m, "energy", m._objects[s], w), |
|
f(m, l.FIND_DROPPED_ENERGY, m.energy[s], w)), "constructionSite" == w.type && c.rooms[w.room] && (m._objects[s] = new j.ConstructionSite(s), |
|
g(m, "constructionSites", m._objects[s], w), f(m, l.FIND_CONSTRUCTION_SITES, m.constructionSites[s], w), |
|
f(m, l.FIND_MY_CONSTRUCTION_SITES, m.constructionSites[s], w), f(m, l.FIND_HOSTILE_CONSTRUCTION_SITES, m.constructionSites[s], w))); |
|
} |
|
b(c.user._id, "after objects 1"); |
|
for (var s in c.userObjects) { |
|
var w = c.userObjects[s]; |
|
"flag" == w.type && w.user == c.user._id && (m._objects[s] = new j.Flag(s), m.byRoom[w.room] || (m.byRoom[w.room] = {}, |
|
e(m.byRoom[w.room], !0)), g(m, "flags", m._objects[s], w), r.flags[m.flags[s].name] = m.flags[s], |
|
f(m, l.FIND_FLAGS, m.flags[s], w)); |
|
} |
|
r.map = m.map = o.makeMap(c), k.extend(j, k.cloneDeep(l)), j.Game = r; |
|
} |
|
function i(a) { |
|
if (a in this.globals.require.cache) { |
|
if (-1 === this.globals.require.cache[a]) throw new Error("Circular reference to module '" + a + "'"); |
|
} else { |
|
if (k.isUndefined(this.codeModules[a])) throw new Error("Unknown module '" + a + "'"); |
|
this.globals.require.cache[a] = -1; |
|
var b = { |
|
exports: {}, |
|
user: this.runtimeData.user._id, |
|
timestamp: this.runtimeData.userCodeTimestamp, |
|
name: a, |
|
code: this.codeModules[a] |
|
}; |
|
try { |
|
m.evalCode(b, this.globals, !1, this.timeout); |
|
} catch (c) { |
|
throw delete this.globals.require.cache[a], c; |
|
} |
|
this.globals.require.cache[a] = b.exports, b.__initGlobals && (this.globals.require.initGlobals = this.globals.require.initGlobals || {}, |
|
this.globals.require.initGlobals[a] = b.__initGlobals); |
|
} |
|
return this.globals.require.cache[a]; |
|
} |
|
var j, k = a("lodash"), l = (a("../../../PathFinding.js/index"), a("./constants")), m = a("../core/core"), n = a("../utils"), o = a("./map"), p = (j = {}, |
|
d(j, l.FIND_CREEPS, function(a) { |
|
return !a.spawning; |
|
}), d(j, l.FIND_MY_CREEPS, function(a) { |
|
return !a.spawning && a.my; |
|
}), d(j, l.FIND_HOSTILE_CREEPS, function(a) { |
|
return !a.spawning && !a.my; |
|
}), d(j, l.FIND_MY_SPAWNS, function(a) { |
|
return a.my === !0; |
|
}), d(j, l.FIND_HOSTILE_SPAWNS, function(a) { |
|
return a.my === !1; |
|
}), d(j, l.FIND_SOURCES_ACTIVE, function(a) { |
|
return a.energy > 0; |
|
}), d(j, l.FIND_MY_STRUCTURES, function(a) { |
|
return a.my === !0; |
|
}), d(j, l.FIND_HOSTILE_STRUCTURES, function(a) { |
|
return a.my === !1 && a.owner; |
|
}), d(j, l.FIND_MY_CONSTRUCTION_SITES, function(a) { |
|
return a.my; |
|
}), d(j, l.FIND_HOSTILE_CONSTRUCTION_SITES, function(a) { |
|
return a.my === !1; |
|
}), j); |
|
!function() { |
|
var a = {}; |
|
c.runCode = function(c, d, e, f, g, j, l, o, p, q, r) { |
|
var s = e.user._id; |
|
a[s] = a[s] || {}, a[s].globals = c, a[s].codeModules = d, a[s].runtimeData = e, |
|
a[s].intents = f, a[s].memory = g, a[s].fakeConsole = j, a[s].consoleCommands = l, |
|
a[s].timeout = o, a[s].getUsedCpu = p, a[s].resetUsedCpu = q, a[s].markStats = r || function() {}; |
|
var t = a[s].runtimeData.roomTerrain[k.findKey(a[s].runtimeData.roomTerrain)]; |
|
t && "terrain" == t.type && (a[s].runtimeData.roomTerrain = n.decodeTerrainByRoom(a[s].runtimeData.roomTerrain)), |
|
b(s, "terrain"), k.extend(a[s].globals, { |
|
RawMemory: a[s].memory, |
|
console: a[s].fakeConsole, |
|
_: k |
|
}), Object.defineProperty(a[s].globals, "Memory", { |
|
configurable: !0, |
|
enumerable: !0, |
|
get: function() { |
|
try { |
|
a[s].memory._parsed = JSON.parse(a[s].memory.get()); |
|
} catch (b) { |
|
throw new Error("Could not parse raw memory"); |
|
} |
|
return Object.defineProperty(a[s].globals, "Memory", { |
|
configurable: !0, |
|
enumerable: !0, |
|
value: a[s].memory._parsed |
|
}), a[s].memory._parsed; |
|
} |
|
}), a[s].markStats("beforeMake"), h(a[s].runtimeData, a[s].intents, a[s].memory, a[s].getUsedCpu, a[s].globals), |
|
a[s].markStats("afterMake"), b(s, "markGameObject"), "2" == a[s].runtimeData.user._id && (a[s].codeModules = { |
|
main: "var _ = require('lodash'), healer = require('healer'), findAttack = require('findAttack'); for(var i in Game.creeps) { var creep = Game.creeps[i]; if(!creep.room) { continue; } if(creep.getActiveBodyparts('heal') > 0) { healer(creep); } else if(/Defend/.test(creep.name)) { findAttack(Game.creeps[i], false, true); } else if(/Siege/.test(creep.name)) { findAttack(Game.creeps[i], true); } else { findAttack(Game.creeps[i], false); } } for(var i in Memory.creeps) { if(!Game.creeps[i]) { delete Memory.creeps[i]; } } for(var i in Memory.creeps) { if(!Game.creeps[i]) { delete Memory.creeps[i]; } }", |
|
findAttack: "module.exports = function (creep, ignoreCreeps, defend) { function find(opts) { opts = opts || {}; var target, possibleTargets = creep.room.find(FIND_HOSTILE_SPAWNS); if (!ignoreCreeps) { possibleTargets = possibleTargets.concat(creep.room.find(FIND_HOSTILE_CREEPS, { filter: function (i) { return i.owner.username != 'Source Keeper' } })); } target = creep.pos.findClosest(possibleTargets, opts); if (target) { creep.moveTo(target, opts); } return target; } var target, healers = creep.room.find(FIND_MY_CREEPS, { filter: function (i) { return i.getActiveBodyparts('heal') > 0; } }); if (defend) { var siege = creep.room.find(FIND_MY_CREEPS, { filter: function (i) { return /Siege/.test(i.name); } }); if (siege.length > 0) { target = siege[0]; creep.moveTo(target); } } if (!target && creep.hits < creep.hitsMax / 2 && healers.length > 0) { target = creep.pos.findClosest(FIND_MY_CREEPS, { filter: function (i) { return i.getActiveBodyparts('heal') > 0; } }); if (!target || creep.moveTo(target) != OK) { target = null; } } var nearCreeps = creep.pos.findInRange(FIND_HOSTILE_CREEPS, 1, { filter: function (i) { return i.owner.username != 'Source Keeper' } }); if (nearCreeps) { creep.attack(nearCreeps[0]); } if (!target) { target = find(); if (!target && !ignoreCreeps) { target = find({ignoreDestructibleStructures: true}); } if (!target && ignoreCreeps) { target = find({ignoreDestructibleStructures: true}); if(!target) { target = find({ignoreDestructibleStructures: true, ignoreCreeps: true}); } } if (!target) { target = creep.pos.findClosest(FIND_HOSTILE_CREEPS, { filter: function (i) { return i.owner.username != 'Source Keeper' } }); if (target) { creep.moveTo(target); } } if (!target) { target = creep.pos.findClosest(FIND_HOSTILE_CREEPS, { ignoreDestructibleStructures: true, filter: function (i) { return i.owner.username != 'Source Keeper' } }); if (target) { creep.moveTo(target, {ignoreDestructibleStructures: true}); } } if (!target) { return; } creep.attack(target); } if (creep.getActiveBodyparts(RANGED_ATTACK)) { require('shootAtWill')(creep); } }", |
|
healer: "module.exports = function(creep) { var target = creep.pos.findClosest(FIND_MY_CREEPS, {filter: function(i) { return i.hits < i.hitsMax; }}); if(!target) { target = creep.pos.findClosest(FIND_MY_CREEPS, {filter: function(i) { return i != creep && i.getActiveBodyparts(HEAL) == 0; }}); } if(!target) { return; } if(creep.pos.isNearTo(target)) { creep.heal(target); } else { creep.rangedHeal(target); } creep.moveTo(target); if(creep.getActiveBodyparts(RANGED_ATTACK)) { require('shootAtWill')(creep); } }", |
|
shootAtWill: "module.exports = function (creep) { var targets = creep.pos.findInRange(FIND_HOSTILE_CREEPS, 3, {filter: function(i) {return i.owner.username != 'Source Keeper'}}).concat(creep.pos.findInRange(FIND_HOSTILE_SPAWNS, 3, {filter: function(i) {return i.owner.username != 'Source Keeper'}})); var massDmg = 0, distanceDmg = {1: 10, 2: 4, 3: 1}; for(var i in targets) { var distance = Math.max(Math.abs(targets[i].pos.x - creep.pos.x), Math.abs(targets[i].pos.y - creep.pos.y)); massDmg += distanceDmg[distance]; } if(massDmg > 13) { creep.rangedMassAttack(); } else { var min = -1, target; for (var i in targets) { if (min == -1 || min > targets[i].hits) { target = targets[i]; min = targets[i].hits; } } creep.rangedAttack(target); } }" |
|
}), "3" == a[s].runtimeData.user._id && (a[s].codeModules = { |
|
main: "for(var i in Game.creeps) { var creep = Game.creeps[i], source; if(!creep.room) { continue; } if(creep.memory.sourceId) { source = Game.getObjectById(creep.memory.sourceId); } else { source = creep.pos.findInRange(FIND_SOURCES, 5)[0]; if(source) { creep.memory.sourceId = source.id; } } if(source) { if(!creep.pos.isNearTo(source)) { if(creep.moveTo(source, {reusePath: 50}) == ERR_NO_PATH) { delete creep.memory._move; creep.moveTo(source, {reusePath: 50, ignoreDestructibleStructures: true}); } } } var enemies = creep.pos.findInRange(FIND_HOSTILE_CREEPS, 1, {filter: function(i) {return i.owner.username != 'Invader'}}); if(enemies.length) { enemies.sort(function(a,b) { return a.hits - b.hits; }); creep.attack(enemies[0]); } var enemies = creep.pos.findInRange(FIND_HOSTILE_CREEPS, 3, {filter: function(i) {return i.owner.username != 'Invader'}}); if(enemies.length) { var massDmg = 0, distanceDmg = {1: 10, 2: 4, 3: 1}; for(var i in enemies) { var distance = Math.max(Math.abs(enemies[i].pos.x - creep.pos.x), Math.abs(enemies[i].pos.y - creep.pos.y)); massDmg += distanceDmg[distance]; } if(massDmg > 13) { creep.rangedMassAttack(); } else { enemies.sort(function(a,b) { return a.hits - b.hits; }); creep.rangedAttack(enemies[0]); } } for(var i in Memory.creeps) { if(!Game.creeps[i]) { delete Memory.creeps[i]; } } }" |
|
}, a[s].runtimeData.userCodeTimestamp = 1), a[s].globals.require && a[s].runtimeData.userCodeTimestamp == a[s].globals.require.timestamp && k.isObject(a[s].globals.require.cache.main) && k.isFunction(a[s].globals.require.cache.main.loop) || (a[s].globals.require = i.bind(a[s]), |
|
a[s].globals.require.cache = { |
|
lodash: k |
|
}, a[s].globals.require.timestamp = a[s].runtimeData.userCodeTimestamp), a[s].resetUsedCpu(); |
|
var u = a[s].globals.require("main"); |
|
if (k.isObject(u) && k.isFunction(u.loop) && (a[s].globals.require.initGlobals && k.forEach(a[s].globals.require.initGlobals, function(a) { |
|
return a(); |
|
}), m.evalCode({ |
|
exports: u, |
|
user: a[s].runtimeData.user._id, |
|
timestamp: a[s].runtimeData.userCodeTimestamp, |
|
name: "__mainLoop", |
|
code: "module.exports.loop();" |
|
}, a[s].globals, !1, a[s].timeout)), a[s].consoleCommands) for (var v = 0; v < a[s].consoleCommands.length; v++) { |
|
var w = m.evalCode({ |
|
exports: {}, |
|
user: a[s].runtimeData.user._id, |
|
name: "_console" + new Date().getTime() + "_" + v, |
|
code: a[s].consoleCommands[v].expression |
|
}, a[s].globals, !0); |
|
a[s].consoleCommands[v].hidden || a[s].fakeConsole.commandResult(w); |
|
} |
|
}; |
|
}(); |
|
}(); |
|
}, { |
|
"../../../PathFinding.js/index": 1, |
|
"../core/core": 27, |
|
"../utils": 108, |
|
"./constants": 38, |
|
"./construction-sites": 39, |
|
"./creeps": 40, |
|
"./energy": 41, |
|
"./flags": 42, |
|
"./map": 44, |
|
"./rooms": 47, |
|
"./sources": 48, |
|
"./spawns": 49, |
|
"./structures": 50, |
|
lodash: 53 |
|
} ], |
|
44: [ function(a, b, c) { |
|
"use strict"; |
|
var d = function() { |
|
function a(a, b) { |
|
var c = [], d = !0, e = !1, f = void 0; |
|
try { |
|
for (var g, h = a[Symbol.iterator](); !(d = (g = h.next()).done) && (c.push(g.value), |
|
!b || c.length !== b); d = !0) ; |
|
} catch (i) { |
|
e = !0, f = i; |
|
} finally { |
|
try { |
|
!d && h["return"] && h["return"](); |
|
} finally { |
|
if (e) throw f; |
|
} |
|
} |
|
return c; |
|
} |
|
return function(b, c) { |
|
if (Array.isArray(b)) return b; |
|
if (Symbol.iterator in Object(b)) return a(b, c); |
|
throw new TypeError("Invalid attempt to destructure non-iterable instance"); |
|
}; |
|
}(), e = a("./constants"), f = a("lodash"), g = a("../../../PathFinding.js/index"), h = a("../utils"), i = (a("util"), |
|
a("./mapgrid")), j = [ "arena11", "arena12", "arena13", "arena21", "arena22", "arena23", "arena31", "arena32", "arena33" ]; |
|
c.makeMap = function(a) { |
|
function b() { |
|
if (!c) { |
|
if (!f.isFunction(i)) throw new Error("Could not load world map data"); |
|
c = new i(a.accessibleRooms); |
|
} |
|
} |
|
var c, k = new g.AStarFinder({ |
|
diagonalMovement: 1, |
|
maxOpsLimit: 1e3, |
|
heuristic: g.Heuristic.manhattan, |
|
weight: 1 |
|
}); |
|
return { |
|
findRoute: function(a, g) { |
|
if (f.isObject(a) && (a = a.name), f.isObject(g) && (g = g.name), a == g) return []; |
|
var i = [], l = a.match(/^arena(\d)(\d)$/), m = g.match(/^arena(\d)(\d)$/); |
|
if (l && m) { |
|
var n = d(l, 3), o = (n[0], n[1]), p = n[2], q = d(m, 3), r = (q[0], q[1]), s = q[2]; |
|
if (!f.contains(j, a) || !f.contains(j, g)) return e.ERR_NO_PATH; |
|
do { |
|
var t = {}; |
|
o > r ? (o--, t.exit = e.FIND_EXIT_LEFT) : r > o ? (o++, t.exit = e.FIND_EXIT_RIGHT) : p > s ? (p--, |
|
t.exit = e.FIND_EXIT_TOP) : s > p && (p++, t.exit = e.FIND_EXIT_BOTTOM), t.room = "arena" + o + p, |
|
i.push(t); |
|
} while (o != r || p != s); |
|
} else { |
|
if (!/(W|E)\d+(N|S)\d+$/.test(a) || !/(W|E)\d+(N|S)\d+$/.test(g)) return e.ERR_NO_PATH; |
|
var u = h.roomNameToXY(a), v = d(u, 2), w = v[0], x = v[1], y = h.roomNameToXY(g), z = d(y, 2), A = z[0], B = z[1]; |
|
if (w == A && x == B) return []; |
|
b(); |
|
var C = c.clone(); |
|
if (!C.isInside(w, x) || !C.isInside(A, B)) return e.ERR_NO_PATH; |
|
if (Math.abs(w - A) + Math.abs(x - B) > 30) return e.ERR_NO_PATH; |
|
var D = k.findPath(w, x, A, B, C); |
|
D.splice(0, 1); |
|
var E = w, F = x, i = f.map(D, function(a) { |
|
var b = { |
|
room: h.getRoomNameFromXY(a[0], a[1]), |
|
exit: a[0] > E ? e.FIND_EXIT_RIGHT : a[0] < E ? e.FIND_EXIT_LEFT : a[1] > F ? e.FIND_EXIT_BOTTOM : e.FIND_EXIT_TOP |
|
}; |
|
return E = a[0], F = a[1], b; |
|
}); |
|
if (E != A || F != B) return e.ERR_NO_PATH; |
|
} |
|
return i; |
|
}, |
|
findExit: function(a, b) { |
|
var c = this.findRoute(a, b); |
|
return f.isArray(c) ? c.length ? c[0].exit : e.ERR_INVALID_ARGS : c; |
|
}, |
|
describeExits: function(a) { |
|
if (!/^(W|E)\d+(N|S)\d+$/.test(a)) return null; |
|
b(); |
|
var c = h.roomNameToXY(a), f = d(c, 2), g = f[0], j = f[1], k = i.gridData[g + "," + j]; |
|
if (!k) return null; |
|
var l = {}; |
|
return k.t && (l[e.TOP] = h.getRoomNameFromXY(g, j - 1)), k.b && (l[e.BOTTOM] = h.getRoomNameFromXY(g, j + 1)), |
|
k.l && (l[e.LEFT] = h.getRoomNameFromXY(g - 1, j)), k.r && (l[e.RIGHT] = h.getRoomNameFromXY(g + 1, j)), |
|
l; |
|
}, |
|
isRoomProtected: function(b) { |
|
return /^(W|E)\d+(N|S)\d+$/.test(b) ? !f.contains(a.accessibleRooms, b) : null; |
|
} |
|
}; |
|
}; |
|
}, { |
|
"../../../PathFinding.js/index": 1, |
|
"../utils": 108, |
|
"./constants": 38, |
|
"./mapgrid": 45, |
|
lodash: 53, |
|
util: 112 |
|
} ], |
|
45: [ function(a, b) { |
|
"use strict"; |
|
function c(a) { |
|
this.width = 62, this.height = 62, this.nodes = this._buildNodes(this.width, this.height, a); |
|
} |
|
var d = function() { |
|
function a(a, b) { |
|
var c = [], d = !0, e = !1, f = void 0; |
|
try { |
|
for (var g, h = a[Symbol.iterator](); !(d = (g = h.next()).done) && (c.push(g.value), |
|
!b || c.length !== b); d = !0) ; |
|
} catch (i) { |
|
e = !0, f = i; |
|
} finally { |
|
try { |
|
!d && h["return"] && h["return"](); |
|
} finally { |
|
if (e) throw f; |
|
} |
|
} |
|
return c; |
|
} |
|
return function(b, c) { |
|
if (Array.isArray(b)) return b; |
|
if (Symbol.iterator in Object(b)) return a(b, c); |
|
throw new TypeError("Invalid attempt to destructure non-iterable instance"); |
|
}; |
|
}(), e = a("../../../PathFinding.js/index"), f = a("../core/core"), g = f.getMapGridData(), h = a("../utils"); |
|
c.gridData = g, c.prototype._buildNodes = function(a, b, c) { |
|
var f, g, i = {}; |
|
for (f = -b / 2; b / 2 > f; ++f) for (i[f] = {}, g = -a / 2; a / 2 > g; ++g) i[f][g] = new e.Node(g, f); |
|
return c && c.forEach(function(a) { |
|
var b = h.roomNameToXY(a), c = d(b, 2), e = c[0], f = c[1]; |
|
i[f] && i[f][e] && (i[f][e].weight = 1); |
|
}), i; |
|
}, c.prototype.getNodeAt = function(a, b) { |
|
return this.nodes[b][a]; |
|
}, c.prototype.isWalkableAt = function(a, b) { |
|
return this.isInside(a, b) && this.nodes[b][a].weight > 0; |
|
}, c.prototype.isInside = function(a, b) { |
|
return a >= -this.width / 2 && a < this.width / 2 && b >= -this.height / 2 && b < this.height / 2; |
|
}, c.prototype.setWalkableAt = function() {}, c.prototype.getNeighbors = function(a) { |
|
var b = a.x, c = a.y, d = [], e = this.nodes, f = g[b + "," + c]; |
|
return f ? (f.t && this.isWalkableAt(b, c - 1) && d.push(e[c - 1][b]), f.r && this.isWalkableAt(b + 1, c) && d.push(e[c][b + 1]), |
|
f.b && this.isWalkableAt(b, c + 1) && d.push(e[c + 1][b]), f.l && this.isWalkableAt(b - 1, c) && d.push(e[c][b - 1]), |
|
d) : []; |
|
}, c.prototype.clone = function() { |
|
var a, b, d = this.width, f = this.height, g = this.nodes, h = new c(), i = {}; |
|
for (a = -f / 2; f / 2 > a; ++a) for (i[a] = {}, b = -d / 2; d / 2 > b; ++b) i[a][b] = new e.Node(b, a, g[a][b].walkable, g[a][b].weight); |
|
return h.nodes = i, h; |
|
}, b.exports = c; |
|
}, { |
|
"../../../PathFinding.js/index": 1, |
|
"../core/core": 27, |
|
"../utils": 108 |
|
} ], |
|
46: [ function(a, b, c) { |
|
"use strict"; |
|
var d = [ "Jackson", "Aiden", "Liam", "Lucas", "Noah", "Mason", "Jayden", "Ethan", "Jacob", "Jack", "Caden", "Logan", "Benjamin", "Michael", "Caleb", "Ryan", "Alexander", "Elijah", "James", "William", "Oliver", "Connor", "Matthew", "Daniel", "Luke", "Brayden", "Jayce", "Henry", "Carter", "Dylan", "Gabriel", "Joshua", "Nicholas", "Isaac", "Owen", "Nathan", "Grayson", "Eli", "Landon", "Andrew", "Max", "Samuel", "Gavin", "Wyatt", "Christian", "Hunter", "Cameron", "Evan", "Charlie", "David", "Sebastian", "Joseph", "Dominic", "Anthony", "Colton", "John", "Tyler", "Zachary", "Thomas", "Julian", "Levi", "Adam", "Isaiah", "Alex", "Aaron", "Parker", "Cooper", "Miles", "Chase", "Muhammad", "Christopher", "Blake", "Austin", "Jordan", "Leo", "Jonathan", "Adrian", "Colin", "Hudson", "Ian", "Xavier", "Camden", "Tristan", "Carson", "Jason", "Nolan", "Riley", "Lincoln", "Brody", "Bentley", "Nathaniel", "Josiah", "Declan", "Jake", "Asher", "Jeremiah", "Cole", "Mateo", "Micah", "Elliot" ], e = [ "Sophia", "Emma", "Olivia", "Isabella", "Mia", "Ava", "Lily", "Zoe", "Emily", "Chloe", "Layla", "Madison", "Madelyn", "Abigail", "Aubrey", "Charlotte", "Amelia", "Ella", "Kaylee", "Avery", "Aaliyah", "Hailey", "Hannah", "Addison", "Riley", "Harper", "Aria", "Arianna", "Mackenzie", "Lila", "Evelyn", "Adalyn", "Grace", "Brooklyn", "Ellie", "Anna", "Kaitlyn", "Isabelle", "Sophie", "Scarlett", "Natalie", "Leah", "Sarah", "Nora", "Mila", "Elizabeth", "Lillian", "Kylie", "Audrey", "Lucy", "Maya", "Annabelle", "Makayla", "Gabriella", "Elena", "Victoria", "Claire", "Savannah", "Peyton", "Maria", "Alaina", "Kennedy", "Stella", "Liliana", "Allison", "Samantha", "Keira", "Alyssa", "Reagan", "Molly", "Alexandra", "Violet", "Charlie", "Julia", "Sadie", "Ruby", "Eva", "Alice", "Eliana", "Taylor", "Callie", "Penelope", "Camilla", "Bailey", "Kaelyn", "Alexis", "Kayla", "Katherine", "Sydney", "Lauren", "Jasmine", "London", "Bella", "Adeline", "Caroline", "Vivian", "Juliana", "Gianna", "Skyler", "Jordyn" ]; |
|
c.getUniqueName = function(a) { |
|
var b, c, f = 0; |
|
do { |
|
var g = Math.random() > .5 ? d : e; |
|
b = g[Math.floor(Math.random() * g.length)], f > 3 && (b += g[Math.floor(Math.random() * g.length)]), |
|
f++, c = a(b); |
|
} while (c); |
|
return b; |
|
}; |
|
}, {} ], |
|
47: [ function(a, b, c) { |
|
"use strict"; |
|
function d(a, b) { |
|
return null != b && b[Symbol.hasInstance] ? b[Symbol.hasInstance](a) : a instanceof b; |
|
} |
|
var e, f, g, h, i, j, k, l, m, n = function() { |
|
function a(a, b) { |
|
var c = [], d = !0, e = !1, f = void 0; |
|
try { |
|
for (var g, h = a[Symbol.iterator](); !(d = (g = h.next()).done) && (c.push(g.value), |
|
!b || c.length !== b); d = !0) ; |
|
} catch (i) { |
|
e = !0, f = i; |
|
} finally { |
|
try { |
|
!d && h["return"] && h["return"](); |
|
} finally { |
|
if (e) throw f; |
|
} |
|
} |
|
return c; |
|
} |
|
return function(b, c) { |
|
if (Array.isArray(b)) return b; |
|
if (Symbol.iterator in Object(b)) return a(b, c); |
|
throw new TypeError("Invalid attempt to destructure non-iterable instance"); |
|
}; |
|
}(), o = a("lodash"), p = a("./constants"), q = a("../../../PathFinding.js/index"), r = a("./../utils"), s = Math.abs, t = (Math.min, |
|
Math.max); |
|
c.make = function(a, b, c, t) { |
|
function u(a, b) { |
|
b = b || {}, o.defaults(b, { |
|
maxOps: 2e3, |
|
heuristicWeight: 1 |
|
}); |
|
var c = b.maxOps + "," + b.heuristicWeight; |
|
return l[a].pfFinders[c] || (l[a].pfFinders[c] = new q.AStarFinder({ |
|
diagonalMovement: 1, |
|
maxOpsLimit: b.maxOps, |
|
heuristic: q.Heuristic.chebyshev, |
|
weight: b.heuristicWeight |
|
})), l[a].pfFinders[c]; |
|
} |
|
function v(a, b, c) { |
|
b = b || {}; |
|
var f = new Array(50), i = o.clone(p.OBSTACLE_OBJECT_TYPES); |
|
b.ignoreDestructibleStructures && (i = o.without(i, "constructedWall", "spawn", "extension", "link", "storage")), |
|
b.ignoreCreeps && (i = o.without(i, "creep")); |
|
for (var j = 0; 50 > j; j++) { |
|
f[j] = new Array(50); |
|
for (var k = 0; 50 > k; k++) { |
|
f[j][k] = 0 == k || 0 == j || 49 == k || 49 == j ? 11 : 2; |
|
var m = g.terrainByRoom.spatial[a][j][k]; |
|
m & p.TERRAIN_MASK_WALL && (f[j][k] = 0), m & p.TERRAIN_MASK_SWAMP && 2 == f[j][k] && (f[j][k] = 10); |
|
} |
|
} |
|
if (g.objectsByRoomKeys[a].forEach(function(c) { |
|
var d = g.objectsByRoom[a][c]; |
|
(o.contains(i, d.type) || !b.ignoreDestructibleStructures && "rampart" == d.type && d.user != e.user._id || !b.ignoreDestructibleStructures && "constructionSite" == d.type && d.user == e.user._id && o.contains(p.OBSTACLE_OBJECT_TYPES, d.structureType)) && (f[d.y][d.x] = 0), |
|
"road" == d.type && f[d.y][d.x] > 0 && (f[d.y][d.x] = 1); |
|
}), b.ignore) { |
|
if (!o.isArray(b.ignore)) throw new Error("option `ignore` is not an array"); |
|
o.forEach(b.ignore, function(c, e) { |
|
c && (c.pos && (f[c.pos.y][c.pos.x] = f[c.pos.y][c.pos.x] > 2 ? 2 : f[c.pos.y][c.pos.x]), |
|
!o.isObject(c) || o.isUndefined(c.x) || d(c, h.RoomPosition) || (b.ignore[e] = new h.RoomPosition(c.x, c.y, a)), |
|
o.isUndefined(c.x) || (f[c.y][c.x] = f[c.y][c.x] > 2 ? 2 : f[c.y][c.x])); |
|
}); |
|
} |
|
if (b.avoid) { |
|
if (!o.isArray(b.avoid)) throw new Error("option `avoid` is not an array"); |
|
o.forEach(b.avoid, function(c, e) { |
|
c && (c.pos && (f[c.pos.y][c.pos.x] = 0), !o.isObject(c) || o.isUndefined(c.x) || d(c, h.RoomPosition) || (b.avoid[e] = new h.RoomPosition(c.x, c.y, a)), |
|
o.isUndefined(c.x) || (f[c.y][c.x] = 0)); |
|
}); |
|
} |
|
return c && o.forEach(l[a].pfEndNodes[c], function(a) { |
|
o.isUndefined(a.x) ? o.isUndefined(a.pos) || (f[a.pos.y][a.pos.x] = 999) : f[a.y][a.x] = 999; |
|
}), new q.Grid(50, 50, f); |
|
} |
|
function w(a, b, c) { |
|
var d = "grid"; |
|
return b = b || {}, b.ignoreCreeps && (d += "_ignoreCreeps"), b.ignoreDestructibleStructures && (d += "_ignoreDestructibleStructures"), |
|
o.isNumber(c) && (d += "_endNodes" + c), b.avoid && (d += "_avoid" + l[a].positionsSetCache.key(b.avoid)), |
|
b.ignore && (d += "_ignore" + l[a].positionsSetCache.key(b.ignore)), l[a].pfGrid[d] || (l[a].pfGrid[d] = v(a, b, c)), |
|
l[a].pfGrid[d].clone(); |
|
} |
|
function x(a) { |
|
var b, c = (A(a), a), f = a.match(/survival_(.*)$/); |
|
f && (c = f[1]), e.games && c in e.games && (b = e.games[c]), this.name = a, this.mode = "sim" == a ? p.MODE_SIMULATION : /^arena/.test(a) ? p.MODE_ARENA : /^survival/.test(a) ? p.MODE_SURVIVAL : p.MODE_WORLD, |
|
this.energyAvailable = 0, this.energyCapacityAvailable = 0, this.survivalInfo = b, |
|
l[a] = { |
|
pfGrid: {}, |
|
pfFinders: {}, |
|
pfEndNodes: {}, |
|
pfDijkstraFinder: new q.DijkstraFinder({ |
|
diagonalMovement: 1 |
|
}), |
|
pathCache: {}, |
|
positionsSetCache: { |
|
cache: {}, |
|
key: function j(b) { |
|
if (!o.isArray(b)) return 0; |
|
var c = o.map(b, function(b) { |
|
return b && b.pos ? b.pos : !o.isObject(b) || o.isUndefined(b.x) || d(b, h.RoomPosition) ? b : new h.RoomPosition(b.x, b.y, a); |
|
}), j = o.findKey(this.cache, function(a) { |
|
return c.length == a.length && o.every(c, function(b) { |
|
return o.any(a, function(a) { |
|
if (!o.isObject(b) || !b.isEqualTo) throw new Error("Invalid position " + b + ", check your `opts` property"); |
|
return b.isEqualTo(a); |
|
}); |
|
}); |
|
}); |
|
return void 0 === j ? (j = i++, this.cache[j] = o.clone(b)) : j = parseInt(j), j; |
|
} |
|
}, |
|
lookTypeRegisters: { |
|
creep: g.byRoom[a].creeps, |
|
energy: g.byRoom[a].energy, |
|
source: g.byRoom[a].sources, |
|
structure: g.byRoom[a].structures, |
|
flag: g.byRoom[a].flags, |
|
constructionSite: g.byRoom[a].constructionSites |
|
}, |
|
lookTypeSpatialRegisters: { |
|
creep: g.byRoom[a].spatial.creeps, |
|
energy: g.byRoom[a].spatial.energy, |
|
source: g.byRoom[a].spatial.sources, |
|
structure: g.byRoom[a].spatial.structures, |
|
flag: g.byRoom[a].spatial.flags, |
|
constructionSite: g.byRoom[a].spatial.constructionSites |
|
} |
|
}; |
|
} |
|
function y(a, b, c, d, e) { |
|
if ("terrain" == b) { |
|
var f = "plain", h = g.terrainByRoom.spatial[a][d][c]; |
|
return h & p.TERRAIN_MASK_SWAMP && (f = "swamp"), h & p.TERRAIN_MASK_WALL && (f = "wall"), |
|
e ? void e.push({ |
|
type: "terrain", |
|
terrain: f |
|
}) : [ f ]; |
|
} |
|
if (0 > c || 0 > d || c > 49 || d > 49) throw new Error("look coords are out of bounds"); |
|
var i, j = l[a].lookTypeSpatialRegisters[b][d][c]; |
|
return j ? e ? void j.forEach(function(a) { |
|
i = { |
|
type: b |
|
}, i[b] = a, e.push(i); |
|
}) : o.clone(j) : []; |
|
} |
|
function z(a, b, c, d, e, f, g) { |
|
var h = l[a].lookTypeRegisters[b], i = h && Object.keys(h); |
|
if ("terrain" != b && i.length < (e - c + 1) * (f - d + 1)) { |
|
var j, k = !g[c][d], m = function(b) { |
|
return (!b.pos && b.roomName == a || b.pos && b.pos.roomName == a) && b.pos && b.pos.y >= c && b.pos.y <= e && b.pos.x >= d && b.pos.x <= f || !b.pos && b.y >= c && b.y <= e && b.x >= d && b.x <= f; |
|
}; |
|
i.forEach(function(a) { |
|
var c = h[a]; |
|
m(c) && (k ? (g[c.y || c.pos.y][c.x || c.pos.x] = g[c.y || c.pos.y][c.x || c.pos.x] || [], |
|
g[c.y || c.pos.y][c.x || c.pos.x].push(c)) : (j = { |
|
type: b |
|
}, j[b] = c, g[c.y || c.pos.y][c.x || c.pos.x].push(j))); |
|
}); |
|
} else for (var n = c; e >= n; n++) for (var o = d; f >= o; o++) g[n][o] ? y(a, b, o, n, g[n][o]) : g[n][o] = y(a, b, o, n); |
|
} |
|
if (e = a, f = b, g = c, h = t, i = 1, j = [], k = [], l = {}, m = 0, !h.Room) { |
|
var A = function(a) { |
|
if (!e.rooms[a]) throw new Error("Could not find a room with name " + a); |
|
return e.rooms[a]; |
|
}; |
|
x.serializePath = function(a) { |
|
return r.serializePath(a); |
|
}, x.deserializePath = function(a) { |
|
return r.deserializePath(a); |
|
}, x.prototype.toString = function() { |
|
return "[room " + this.name + "]"; |
|
}, x.prototype.toJSON = function() { |
|
var a = {}; |
|
for (var b in this) "_" == b[0] || o.contains([ "toJSON", "toString", "controller", "storage" ], b) || (a[b] = this[b]); |
|
return a; |
|
}, Object.defineProperty(x.prototype, "memory", { |
|
get: function() { |
|
return (o.isUndefined(h.Memory.rooms) || "undefined" === h.Memory.rooms) && (h.Memory.rooms = {}), |
|
o.isObject(h.Memory.rooms) ? h.Memory.rooms[this.name] = h.Memory.rooms[this.name] || {} : void 0; |
|
}, |
|
set: function(a) { |
|
if ((o.isUndefined(h.Memory.rooms) || "undefined" === h.Memory.rooms) && (h.Memory.rooms = {}), |
|
!o.isObject(h.Memory.rooms)) throw new Error("Could not set room memory"); |
|
h.Memory.rooms[this.name] = a; |
|
} |
|
}), x.prototype.find = function(a, b) { |
|
var c = this, d = []; |
|
if (b = b || {}, g.findCache[a] && g.findCache[a][this.name]) d = g.findCache[a][this.name]; else switch (a) { |
|
case p.FIND_EXIT: |
|
return g.findCache[a] = g.findCache[a] || {}, g.findCache[a][this.name] = this.find(p.FIND_EXIT_TOP, b).concat(this.find(p.FIND_EXIT_BOTTOM, b)).concat(this.find(p.FIND_EXIT_RIGHT, b)).concat(this.find(p.FIND_EXIT_LEFT, b)), |
|
o.clone(g.findCache[a][this.name]); |
|
|
|
case p.FIND_EXIT_TOP: |
|
case p.FIND_EXIT_RIGHT: |
|
case p.FIND_EXIT_BOTTOM: |
|
case p.FIND_EXIT_LEFT: |
|
g.findCache[a] = g.findCache[a] || {}; |
|
for (var e = [], f = 0; 50 > f; f++) { |
|
var h = 0, i = 0; |
|
a == p.FIND_EXIT_LEFT || a == p.FIND_EXIT_RIGHT ? i = f : h = f, a == p.FIND_EXIT_RIGHT && (h = 49), |
|
a == p.FIND_EXIT_BOTTOM && (i = 49), e.push(!(g.terrainByRoom.spatial[this.name][i][h] & p.TERRAIN_MASK_WALL)); |
|
} |
|
[ "objectsByRoom", "terrainByRoom" ].forEach(function(b) { |
|
o.forEach(g[b][c.name], function(b) { |
|
"wall" == b.type && (a == p.FIND_EXIT_TOP && 0 == b.y && (e[b.x] = !1), a == p.FIND_EXIT_BOTTOM && 49 == b.y && (e[b.x] = !1), |
|
a == p.FIND_EXIT_LEFT && 0 == b.x && (e[b.y] = !1), a == p.FIND_EXIT_RIGHT && 49 == b.x && (e[b.y] = !1)); |
|
}); |
|
}), d = o.reduce(e, function(b, d, e) { |
|
return d && (a == p.FIND_EXIT_TOP && b.push(c.getPositionAt(e, 0)), a == p.FIND_EXIT_BOTTOM && b.push(c.getPositionAt(e, 49)), |
|
a == p.FIND_EXIT_LEFT && b.push(c.getPositionAt(0, e)), a == p.FIND_EXIT_RIGHT && b.push(c.getPositionAt(49, e))), |
|
b; |
|
}, []), g.findCache[a][this.name] = d; |
|
} |
|
return d = b.filter ? o.filter(d, b.filter) : o.clone(d); |
|
}, x.prototype.lookAt = function(a, b) { |
|
var c = r.fetchXYArguments(a, b, h), d = n(c, 2), e = d[0], f = d[1], g = []; |
|
return y(this.name, "creep", e, f, g), y(this.name, "energy", e, f, g), y(this.name, "source", e, f, g), |
|
y(this.name, "structure", e, f, g), y(this.name, "flag", e, f, g), y(this.name, "constructionSite", e, f, g), |
|
y(this.name, "terrain", e, f, g), g; |
|
}, x.prototype.lookForAt = function(a, b, c) { |
|
var d = r.fetchXYArguments(b, c, h), e = n(d, 2), f = e[0], g = e[1]; |
|
return "terrain" == a || a in l[this.name].lookTypeSpatialRegisters ? y(this.name, a, f, g) : p.ERR_INVALID_ARGS; |
|
}, x.prototype.lookAtArea = function(a, b, c, d) { |
|
for (var e = {}, f = a; c >= f; f++) { |
|
e[f] = {}; |
|
for (var g = b; d >= g; g++) e[f][g] = []; |
|
} |
|
return z(this.name, "creep", a, b, c, d, e), z(this.name, "energy", a, b, c, d, e), |
|
z(this.name, "source", a, b, c, d, e), z(this.name, "structure", a, b, c, d, e), |
|
z(this.name, "flag", a, b, c, d, e), z(this.name, "constructionSite", a, b, c, d, e), |
|
z(this.name, "terrain", a, b, c, d, e), e; |
|
}, x.prototype.lookForAtArea = function(a, b, c, d, e) { |
|
for (var f = {}, g = b; d >= g; g++) f[g] = {}; |
|
return z(this.name, a, b, c, d, e, f), f; |
|
}, x.prototype.findPath = function(a, b, c) { |
|
if (a.roomName != this.name) return c.serialize ? "" : []; |
|
var d, e = a.x, f = a.y, g = ""; |
|
if (c = o.clone(c || {}), c.ignoreCreeps && (g += "_ignoreCreeps"), c.ignoreDestructibleStructures && (g += "_ignoreDestructibleStructures"), |
|
c.avoid && (g += "_avoid" + l[this.name].positionsSetCache.key(c.avoid)), c.ignore && (g += "_ignore" + l[this.name].positionsSetCache.key(c.ignore)), |
|
o.isNumber(b)) { |
|
if (!l[this.name].pfEndNodes[b]) return c.serialize ? "" : []; |
|
var h = w(this.name, c, b); |
|
d = l[this.name].pfDijkstraFinder.findPath(e, f, -999, -999, h); |
|
} else { |
|
if (b.roomName != this.name) return c.serialize ? "" : []; |
|
var i = b.x, j = b.y, k = e + "," + f + "," + i + "," + j + g; |
|
if (l[this.name].pathCache[k]) return c.serialize ? r.serializePath(l[this.name].pathCache[k]) : o.cloneDeep(l[this.name].pathCache[k]); |
|
if (e == i && f == j) return c.serialize ? "" : []; |
|
if (0 > e || 0 > f || 0 > i || 0 > j || e >= 50 || f >= 50 || i >= 50 || j >= 50) return c.serialize ? "" : []; |
|
if (s(e - i) < 2 && s(f - j) < 2) { |
|
var m = [ { |
|
x: i, |
|
y: j, |
|
dx: i - e, |
|
dy: j - f, |
|
direction: r.getDirection(i - e, j - f) |
|
} ]; |
|
return c.serialize ? r.serializePath(m) : m; |
|
} |
|
var h = w(this.name, c), n = u(this.name, c); |
|
h.setWalkableAt(i, j, !0), d = n.findPath(e, f, i, j, h); |
|
} |
|
d.splice(0, 1); |
|
var p = e, q = f, t = o.map(d, function(a) { |
|
var b = { |
|
x: a[0], |
|
y: a[1], |
|
dx: a[0] - p, |
|
dy: a[1] - q, |
|
direction: r.getDirection(a[0] - p, a[1] - q) |
|
}; |
|
return p = b.x, q = b.y, b; |
|
}); |
|
if (t.length > 0) { |
|
var v = t[t.length - 1], k = e + "," + f + "," + v.x + "," + v.y + g; |
|
l[this.name].pathCache[k] = o.cloneDeep(t); |
|
} |
|
return c.serialize ? r.serializePath(t) : t; |
|
}, x.prototype.getPositionAt = function(a, b) { |
|
return 0 > a || a > 49 || 0 > b || b > 49 ? null : new h.RoomPosition(a, b, this.name); |
|
}, x.prototype.createFlag = function(a, b, c, d) { |
|
var e = r.fetchXYArguments(a, b, h), i = n(e, 2), k = i[0], l = i[1]; |
|
if (o.isUndefined(k) || o.isUndefined(l) || 0 > k || k > 49 || 0 > l || l > 49) return p.ERR_INVALID_ARGS; |
|
if (o.isObject(a) && (d = c, c = b), d || (d = "white"), !o.contains([ "white", "grey", "red", "purple", "blue", "cyan", "green", "yellow", "orange", "brown" ], d)) return p.ERR_INVALID_ARGS; |
|
if (!c) { |
|
var m = 1; |
|
do c = "Flag" + m, m++; while (o.any(g.flags, { |
|
name: c |
|
}) || -1 != j.indexOf(c)); |
|
} |
|
return o.any(g.flags, { |
|
name: c |
|
}) || -1 != j.indexOf(c) ? p.ERR_NAME_EXISTS : (j.push(c), f.pushByName("room", "createFlag", { |
|
roomName: this.name, |
|
x: k, |
|
y: l, |
|
name: c, |
|
color: d |
|
}), c); |
|
}, x.prototype.createConstructionSite = function(a, b, c) { |
|
var d = r.fetchXYArguments(a, b, h), i = n(d, 2), j = i[0], l = i[1]; |
|
if (o.isUndefined(j) || o.isUndefined(l) || 0 > j || j > 49 || 0 > l || l > 49) return p.ERR_INVALID_ARGS; |
|
if (o.isString(b) && o.isUndefined(c) && (c = b), !o.contains([ "spawn", "extension", "road", "rampart", "constructedWall", "link", "storage" ], c)) return p.ERR_INVALID_ARGS; |
|
if (this.controller && this.controller.level > 0 && !this.controller.my) return p.ERR_RCL_NOT_ENOUGH; |
|
if (!r.checkControllerAvailability(c, g.objectsByRoom[this.name], this.controller)) return p.ERR_RCL_NOT_ENOUGH; |
|
if (!r.checkConstructionSite(g.objectsByRoom[this.name], c, j, l) || !r.checkConstructionSite(g.terrainByRoom.spatial[this.name], c, j, l)) return p.ERR_INVALID_TARGET; |
|
if (this.mode == p.MODE_ARENA) return p.ERR_INVALID_TARGET; |
|
if (o(e.userObjects).filter({ |
|
type: "constructionSite" |
|
}).size() + m >= p.MAX_CONSTRUCTION_SITES) return p.ERR_FULL; |
|
var q = { |
|
roomName: this.name, |
|
x: j, |
|
y: l, |
|
structureType: c |
|
}; |
|
if ("spawn" == c) { |
|
var s, t = 1; |
|
do s = "Spawn" + t, t++; while (o.any(g.spawns, { |
|
name: s |
|
}) || o.any(g.constructionSites, { |
|
structureType: "spawn", |
|
name: s |
|
}) || -1 != k.indexOf(s)); |
|
k.push(s), q.name = s; |
|
} |
|
return m++, f.pushByName("room", "createConstructionSite", q), p.OK; |
|
}, x.prototype.getEndNodes = function(a, b) { |
|
var c; |
|
if (b = b || {}, o.isUndefined(a)) throw new Error("Find type cannot be undefined"); |
|
return !b.filter && o.isNumber(a) ? c = a : (o.isNumber(a) && (a = this.find(a, b)), |
|
c = l[this.name].positionsSetCache.key(a), l[this.name].pfEndNodes[c] = l[this.name].positionsSetCache.cache[c]), |
|
l[this.name].pfEndNodes[c] || (l[this.name].pfEndNodes[c] = o.clone(a), o.isNumber(a) && (l[this.name].pfEndNodes[c] = this.find(a, b))), |
|
{ |
|
key: c, |
|
objects: l[this.name].pfEndNodes[c] |
|
}; |
|
}, x.prototype.findExitTo = function(a) { |
|
return g.map.findExit(this.name, a); |
|
}, h.Room = x; |
|
} |
|
}; |
|
var g; |
|
c.makePos = function(a) { |
|
function b(a, b, c) { |
|
this.x = a, this.y = b, this.roomName = c; |
|
} |
|
g = a, h.RoomPosition || (b.prototype.toString = function() { |
|
return "[room " + this.roomName + " pos " + this.x + "," + this.y + "]"; |
|
}, b.prototype.inRangeTo = function(a, b) { |
|
return a.pos && (a = a.pos), s(a.x - this.x) <= b && s(a.y - this.y) <= b && a.roomName == this.roomName; |
|
}, b.prototype.isNearTo = function(a, b) { |
|
var c = r.fetchXYArguments(a, b, h), d = n(c, 3), e = d[0], f = d[1], g = d[2]; |
|
return s(e - this.x) <= 1 && s(f - this.y) <= 1 && (!g || g == this.roomName); |
|
}, b.prototype.getDirectionTo = function(a, b) { |
|
var c = r.fetchXYArguments(a, b, h), d = n(c, 2), e = d[0], f = d[1]; |
|
return r.getDirection(e - this.x, f - this.y); |
|
}, b.prototype.findPathTo = function(a, b, c) { |
|
var d = r.fetchXYArguments(a, b, h), e = n(d, 3), f = e[0], i = e[1], j = e[2], k = g.rooms[this.roomName]; |
|
if (o.isObject(b) && (c = o.clone(b)), c = c || {}, j = j || this.roomName, !k) throw new Error("Could not access room " + this.roomName); |
|
if (j == this.roomName) return k.findPath(this, new h.RoomPosition(f, i, j), c); |
|
var l = k.findExitTo(j); |
|
if (0 > l) return []; |
|
var m = this.findClosestByPath(l, c); |
|
return m ? k.findPath(this, m, c) : []; |
|
}, b.prototype.findClosest = function(a, b) { |
|
return g.deprecated("RoomPosition.findClosest method is deprecated. Please use either findClosestByRange or findClosestByPath instead."), |
|
this.findClosestByPath(a, b); |
|
}, b.prototype.findClosestByPath = function(a, b) { |
|
var c = this; |
|
b = o.clone(b || {}); |
|
var d = g.rooms[this.roomName]; |
|
if (!d) throw new Error("Could not access room " + this.roomName); |
|
if (o.isUndefined(a)) return null; |
|
b.serialize = !1; |
|
var e, f = null, h = d.getEndNodes(a, b); |
|
if (!b.algorithm) { |
|
var i, j = 0; |
|
h.objects.forEach(function(a) { |
|
var b = a.x, d = a.y, e = a.roomName; |
|
a.pos && (b = a.pos.x, d = a.pos.y, e = a.pos.roomName); |
|
var f = t(s(c.x - b), s(c.y - d)); |
|
(o.isUndefined(i) || i > f) && (i = f), j += f; |
|
}), b.algorithm = j > 10 * i ? "dijkstra" : "astar"; |
|
} |
|
if ("dijkstra" == b.algorithm && (e = 1, h.objects.forEach(function(a) { |
|
var b = c.isEqualTo(a) ? -1 : c.isNearTo(a) ? 0 : 1; |
|
e > b && (f = a, b = e); |
|
}), 1 == e)) { |
|
var k = d.findPath(this, h.key, b); |
|
if (k.length > 0) { |
|
var l = k[k.length - 1], m = d.getPositionAt(l.x, l.y); |
|
f = o.find(h.objects, function(a) { |
|
return m.isEqualTo(a); |
|
}); |
|
} |
|
} |
|
return "astar" == b.algorithm && h.objects.forEach(function(a) { |
|
var g, h = c.isEqualTo(a) ? -1 : c.isNearTo(a) ? 0 : (g = c.findPathTo(a, b)) && g.length > 0 && d.getPositionAt(g[g.length - 1].x, g[g.length - 1].y).isNearTo(a) ? g.length : void 0; |
|
(o.isUndefined(e) || e >= h) && !o.isUndefined(h) && (e = h, f = a); |
|
}), f; |
|
}, b.prototype.findInRange = function(a, b, c) { |
|
var d = this, e = g.rooms[this.roomName]; |
|
if (!e) throw new Error("Could not access room " + this.roomName); |
|
c = o.clone(c || {}); |
|
var f = [], h = []; |
|
return o.isNumber(a) && (f = e.find(a, c)), o.isArray(a) && (f = a), f.forEach(function(a) { |
|
d.inRangeTo(a, b) && h.push(a); |
|
}), h; |
|
}, b.prototype.findClosestByRange = function(a, b) { |
|
var c = this, d = g.rooms[this.roomName]; |
|
if (!d) throw new Error("Could not access room " + this.roomName); |
|
b = o.clone(b || {}); |
|
var e = []; |
|
o.isNumber(a) && (e = d.find(a, b)), o.isArray(a) && (e = a); |
|
var f = null, h = 1 / 0; |
|
return e.forEach(function(a) { |
|
var b = c.getRangeTo(a); |
|
h > b && (h = b, f = a); |
|
}), f; |
|
}, b.prototype.isEqualTo = function(a, b) { |
|
var c = r.fetchXYArguments(a, b, h), d = n(c, 3), e = d[0], f = d[1], g = d[2]; |
|
return e == this.x && f == this.y && (!g || g == this.roomName); |
|
}, b.prototype.getRangeTo = function(a, b) { |
|
var c = r.fetchXYArguments(a, b, h), d = n(c, 3), e = d[0], f = d[1], g = d[2]; |
|
return g && g != this.roomName ? 1 / 0 : t(s(this.x - e), s(this.y - f)); |
|
}, b.prototype.look = function() { |
|
var a = g.rooms[this.roomName]; |
|
if (!a) throw new Error("Could not access room " + this.roomName); |
|
return a.lookAt(this); |
|
}, b.prototype.lookFor = function(a) { |
|
var b = g.rooms[this.roomName]; |
|
if (!b) throw new Error("Could not access room " + this.roomName); |
|
return b.lookForAt(a, this); |
|
}, b.prototype.createFlag = function(a, b) { |
|
var c = g.rooms[this.roomName]; |
|
if (!c) throw new Error("Could not access room " + this.roomName); |
|
return c.createFlag(this, a, b); |
|
}, b.prototype.createConstructionSite = function(a) { |
|
var b = g.rooms[this.roomName]; |
|
if (!b) throw new Error("Could not access room " + this.roomName); |
|
return b.createConstructionSite(this, a); |
|
}, h.RoomPosition = b); |
|
}; |
|
}, { |
|
"../../../PathFinding.js/index": 1, |
|
"./../utils": 108, |
|
"./constants": 38, |
|
lodash: 53 |
|
} ], |
|
48: [ function(a, b, c) { |
|
"use strict"; |
|
{ |
|
var d, e, f, g, h = a("./../utils"); |
|
a("./rooms"), a("./constants"); |
|
} |
|
c.make = function(a, b, c, i) { |
|
if (d = a, e = b, f = c, g = i, !g.Source) { |
|
var j = function(a) { |
|
if (!d.roomObjects[a]) throw new Error("Could not find an object with ID " + a); |
|
return d.roomObjects[a]; |
|
}, k = function(a) { |
|
this.id = a; |
|
}; |
|
h.defineGameObjectProperties(k.prototype, j, { |
|
room: function(a) { |
|
return f.rooms[a.room]; |
|
}, |
|
pos: function(a) { |
|
return new g.RoomPosition(a.x, a.y, a.room); |
|
}, |
|
energy: function(a) { |
|
return a.energy; |
|
}, |
|
energyCapacity: function(a) { |
|
return a.energyCapacity; |
|
}, |
|
ticksToRegeneration: function(a) { |
|
return a.nextRegenerationTime ? a.nextRegenerationTime - d.time : void 0; |
|
} |
|
}), k.prototype.toString = function() { |
|
return "[source #" + this.id + "]"; |
|
}, g.Source = k; |
|
} |
|
}; |
|
}, { |
|
"./../utils": 108, |
|
"./constants": 38, |
|
"./rooms": 47 |
|
} ], |
|
49: [ function(a, b, c) { |
|
"use strict"; |
|
function d(a, b) { |
|
return null != b && b[Symbol.hasInstance] ? b[Symbol.hasInstance](a) : a instanceof b; |
|
} |
|
var e, f, g, h, i, j = a("./../utils"), k = (a("./rooms"), a("lodash")), l = a("./constants"); |
|
c.make = function(b, c, m, n) { |
|
if (e = b, f = c, g = m, h = n, i = [], !h.Spawn) { |
|
var o = function(a) { |
|
if (!e.roomObjects[a]) throw new Error("Could not find an object with ID " + a); |
|
return e.roomObjects[a]; |
|
}, p = function(a) { |
|
this.id = a; |
|
}; |
|
j.defineGameObjectProperties(p.prototype, o, { |
|
room: function(a) { |
|
return g.rooms[a.room]; |
|
}, |
|
pos: function(a) { |
|
return new h.RoomPosition(a.x, a.y, a.room); |
|
}, |
|
name: function(a) { |
|
return a.user == e.user._id ? a.name : void 0; |
|
}, |
|
hits: function(a) { |
|
return a.hits; |
|
}, |
|
hitsMax: function(a) { |
|
return a.hitsMax; |
|
}, |
|
owner: function(a) { |
|
return new Object({ |
|
username: e.users[a.user].username |
|
}); |
|
}, |
|
my: function(a) { |
|
return a.user == e.user._id; |
|
}, |
|
structureType: function() { |
|
return "spawn"; |
|
}, |
|
energy: function(a) { |
|
return a.energy; |
|
}, |
|
energyCapacity: function(a) { |
|
return a.energyCapacity; |
|
}, |
|
spawning: function(a) { |
|
return a.spawning; |
|
} |
|
}), Object.defineProperty(p.prototype, "memory", { |
|
get: function() { |
|
return this.my ? ((k.isUndefined(h.Memory.spawns) || "undefined" === h.Memory.spawns) && (h.Memory.spawns = {}), |
|
k.isObject(h.Memory.spawns) ? h.Memory.spawns[o(this.id).name] = h.Memory.spawns[o(this.id).name] || {} : void 0) : void 0; |
|
}, |
|
set: function(a) { |
|
if (!this.my) throw new Error("Could not set other player's spawn memory"); |
|
if ((k.isUndefined(h.Memory.spawns) || "undefined" === h.Memory.spawns) && (h.Memory.spawns = {}), |
|
!k.isObject(h.Memory.spawns)) throw new Error("Could not set spawn memory"); |
|
h.Memory.spawns[o(this.id).name] = a; |
|
} |
|
}), p.prototype.toString = function() { |
|
return "[spawn " + (o(this.id).user == e.user._id ? o(this.id).name : "#" + this.id) + "]"; |
|
}, p.prototype.canCreateCreep = function(a, b) { |
|
var c = this; |
|
if (!this.my) return l.ERR_NOT_OWNER; |
|
if (o(this.id).spawning) return l.ERR_BUSY; |
|
if (!a || !k.isArray(a) || 0 == a.length || a.length > l.MAX_CREEP_SIZE) return l.ERR_INVALID_ARGS; |
|
for (var d = 0; d < a.length; d++) if (!k.contains(l.BODYPARTS_ALL, a[d])) return l.ERR_INVALID_ARGS; |
|
var e = j.calcCreepCost(a), f = k.sum(this.room.find(l.FIND_MY_SPAWNS), "energy"), m = k.filter(g.objectsByRoom[o(this.id).room], function(a) { |
|
return "extension" == a.type && a.user == o(c.id).user && a.energy > 0; |
|
}); |
|
return this.room.controller && j.checkStructureAgainstController(o(this.id), g.objectsByRoom[o(this.id).room], o(this.room.controller.id)) ? (m.length > l.CONTROLLER_STRUCTURES.extension[this.room.controller.level] && (m.sort(j.comparatorDistance(this.room.controller)), |
|
m = k.take(m, l.CONTROLLER_STRUCTURES.extension[this.room.controller.level])), f += k.sum(m, "energy"), |
|
e > f ? l.ERR_NOT_ENOUGH_ENERGY : b && (h.Game.creeps[b] || -1 != i.indexOf(b)) ? l.ERR_NAME_EXISTS : l.OK) : l.ERR_RCL_NOT_ENOUGH; |
|
}, p.prototype.createCreep = function(b, c, d) { |
|
var g = this; |
|
k.isObject(c) && k.isUndefined(d) && (d = c, c = void 0); |
|
var j = this.canCreateCreep(b, c); |
|
return j != l.OK ? j : (c || (c = a("./names").getUniqueName(function(a) { |
|
return k.any(e.roomObjects, { |
|
type: "creep", |
|
user: o(g.id).user, |
|
name: a |
|
}) || -1 != i.indexOf(a); |
|
})), i.push(c), k.isUndefined(h.Memory.creeps) && (h.Memory.creeps = {}), k.isObject(h.Memory.creeps) && (h.Memory.creeps[c] = k.isUndefined(d) ? h.Memory.creeps[c] || {} : d), |
|
f.set(this.id, "createCreep", { |
|
name: c, |
|
body: b |
|
}), c); |
|
}, p.prototype.transferEnergy = function(a, b) { |
|
return this.my ? a && a.id && g.creeps[a.id] && d(a, h.Creep) ? o(this.id).energy ? (b || (b = o(a.id).energyCapacity ? Math.min(o(this.id).energy, o(a.id).energyCapacity - o(a.id).energy) : o(this.id).energy), |
|
this.energy < b || 0 > b ? l.ERR_NOT_ENOUGH_ENERGY : o(a.id).energy == o(a.id).energyCapacity ? l.ERR_FULL : a.pos.isNearTo(this.pos) ? (f.set(this.id, "transferEnergy", { |
|
id: a.id, |
|
amount: b |
|
}), l.OK) : l.ERR_NOT_IN_RANGE) : l.ERR_NOT_ENOUGH_ENERGY : l.ERR_INVALID_TARGET : l.ERR_NOT_OWNER; |
|
}, p.prototype.destroy = function() { |
|
return this.my ? (f.pushByName("room", "destroyStructure", { |
|
roomName: this.room.name, |
|
id: this.id |
|
}), l.OK) : l.ERR_NOT_OWNER; |
|
}, p.prototype.notifyWhenAttacked = function(a) { |
|
return this.my ? k.isBoolean(a) ? (a != o(this.id).notifyWhenAttacked && f.set(this.id, "notifyWhenAttacked", { |
|
enabled: a |
|
}), l.OK) : l.ERR_INVALID_ARGS : l.ERR_NOT_OWNER; |
|
}, h.Spawn = p; |
|
} |
|
}; |
|
}, { |
|
"./../utils": 108, |
|
"./constants": 38, |
|
"./names": 46, |
|
"./rooms": 47, |
|
lodash: 53 |
|
} ], |
|
50: [ function(a, b, c) { |
|
"use strict"; |
|
function d(a, b) { |
|
return null != b && b[Symbol.hasInstance] ? b[Symbol.hasInstance](a) : a instanceof b; |
|
} |
|
var e, f, g, h, i = a("./../utils"), j = (a("./rooms"), a("./constants")), k = a("lodash"); |
|
c.make = function(a, b, c, l) { |
|
if (e = a, f = b, g = c, h = l, !h.Structure) { |
|
var m = function(a) { |
|
if (!e.roomObjects[a]) throw new Error("Could not find an object with ID " + a); |
|
return e.roomObjects[a]; |
|
}, n = function(a) { |
|
var b = m(a); |
|
this.id = a, b.type == j.STRUCTURE_CONTROLLER && (g.rooms[b.room].controller = this), |
|
b.type == j.STRUCTURE_STORAGE && (g.rooms[b.room].storage = this); |
|
}; |
|
i.defineGameObjectProperties(n.prototype, m, { |
|
room: function(a) { |
|
return g.rooms[a.room]; |
|
}, |
|
pos: function(a) { |
|
return new h.RoomPosition(a.x, a.y, a.room); |
|
}, |
|
hits: function(a) { |
|
return a.hits; |
|
}, |
|
hitsMax: function(a) { |
|
return a.hitsMax; |
|
}, |
|
owner: function(a) { |
|
return a.type == j.STRUCTURE_KEEPER_LAIR ? { |
|
username: "Source Keeper" |
|
} : k.isUndefined(a.user) || null === a.user ? void 0 : { |
|
username: e.users[a.user].username |
|
}; |
|
}, |
|
my: function(a) { |
|
return a.type == j.STRUCTURE_KEEPER_LAIR ? !1 : k.isUndefined(a.user) ? void 0 : a.user == e.user._id; |
|
}, |
|
structureType: function(a) { |
|
return a.type; |
|
}, |
|
energy: function(a) { |
|
return a.type == j.STRUCTURE_EXTENSION || a.type == j.STRUCTURE_LINK ? a.energy : void 0; |
|
}, |
|
energyCapacity: function(a) { |
|
return a.type == j.STRUCTURE_EXTENSION || a.type == j.STRUCTURE_LINK ? a.energyCapacity : void 0; |
|
}, |
|
ticksToSpawn: function(a) { |
|
return a.type == j.STRUCTURE_KEEPER_LAIR && a.nextSpawnTime ? a.nextSpawnTime - e.time : void 0; |
|
}, |
|
ticksToLive: function(a) { |
|
return a.ticksToLive; |
|
}, |
|
ticksToDecay: function(a) { |
|
return a.nextDecayTime ? a.nextDecayTime - e.time : void 0; |
|
}, |
|
cooldown: function(a) { |
|
return a.type == j.STRUCTURE_LINK ? a.cooldown : void 0; |
|
}, |
|
ticksToDowngrade: function(a) { |
|
return a.type == j.STRUCTURE_CONTROLLER && a.downgradeTime ? a.downgradeTime - e.time : void 0; |
|
}, |
|
reservation: function(a) { |
|
return a.type == j.STRUCTURE_CONTROLLER && a.reservation ? { |
|
username: e.users[a.reservation.user].username, |
|
ticksToEnd: a.reservation.endTime - e.time |
|
} : void 0; |
|
}, |
|
level: function(a) { |
|
return a.type == j.STRUCTURE_CONTROLLER ? a.level : void 0; |
|
}, |
|
progress: function(a) { |
|
return a.level > 0 ? a.progress : void 0; |
|
}, |
|
progressTotal: function(a) { |
|
return a.level > 0 && a.level < 8 ? j.CONTROLLER_LEVELS[a.level] : void 0; |
|
}, |
|
store: function(a) { |
|
return a.type == j.STRUCTURE_STORAGE ? { |
|
energy: a.energy |
|
} : void 0; |
|
}, |
|
storeCapacity: function(a) { |
|
return a.type == j.STRUCTURE_STORAGE ? a.energyCapacity : void 0; |
|
} |
|
}), n.prototype.toString = function() { |
|
return "[structure (" + m(this.id).type + ") #" + this.id + "]"; |
|
}, n.prototype.transferEnergy = function(a, b) { |
|
if (this.structureType == j.STRUCTURE_LINK) { |
|
if (!this.my) return j.ERR_NOT_OWNER; |
|
if (m(this.id).spawning) return j.ERR_BUSY; |
|
if (0 > b) return j.ERR_INVALID_ARGS; |
|
if (!a || !a.id || !g.structures[a.id] && !g.creeps[a.id] || !d(a, h.Structure) && !d(a, h.Creep)) return j.ERR_INVALID_TARGET; |
|
if (d(a, h.Structure)) { |
|
if (a.structureType != j.STRUCTURE_LINK) return j.ERR_INVALID_TARGET; |
|
if (this.cooldown > 0) return j.ERR_TIRED; |
|
if (!this.room.controller) return j.ERR_RCL_NOT_ENOUGH; |
|
if (!i.checkStructureAgainstController(m(this.id), g.objectsByRoom[m(this.id).room], m(this.room.controller.id))) return j.ERR_RCL_NOT_ENOUGH; |
|
} |
|
return d(a, h.Creep) && !this.pos.isNearTo(a) ? j.ERR_NOT_IN_RANGE : m(this.id).energy ? (b || (b = m(a.id).energyCapacity ? Math.min(m(this.id).energy, m(a.id).energyCapacity - m(a.id).energy) : m(this.id).energy), |
|
this.energy < b ? j.ERR_NOT_ENOUGH_ENERGY : m(a.id).energyCapacity && (!b || m(a.id).energy + b > m(a.id).energyCapacity) ? j.ERR_FULL : a.pos.roomName != this.pos.roomName ? j.ERR_NOT_IN_RANGE : (f.set(this.id, "transferEnergy", { |
|
id: a.id, |
|
amount: b |
|
}), j.OK)) : j.ERR_NOT_ENOUGH_ENERGY; |
|
} |
|
if (this.structureType == j.STRUCTURE_EXTENSION || this.structureType == j.STRUCTURE_STORAGE) return this.my ? a && a.id && g.creeps[a.id] && d(a, h.Creep) ? m(this.id).energy ? (b || (b = m(a.id).energyCapacity ? Math.min(m(this.id).energy, m(a.id).energyCapacity - m(a.id).energy) : m(this.id).energy), |
|
this.energy < b || 0 > b ? j.ERR_NOT_ENOUGH_ENERGY : m(a.id).energyCapacity && (!b || m(a.id).energy + b > m(a.id).energyCapacity) ? j.ERR_FULL : a.pos.isNearTo(this.pos) ? (f.set(this.id, "transferEnergy", { |
|
id: a.id, |
|
amount: b |
|
}), j.OK) : j.ERR_NOT_IN_RANGE) : j.ERR_NOT_ENOUGH_ENERGY : j.ERR_INVALID_TARGET : j.ERR_NOT_OWNER; |
|
throw new Error(this + " can not execute `transferEnergy` method"); |
|
}, n.prototype.destroy = function() { |
|
return this.room.controller && this.room.controller.my ? (f.pushByName("room", "destroyStructure", { |
|
roomName: this.room.name, |
|
id: this.id |
|
}), j.OK) : j.ERR_NOT_OWNER; |
|
}, n.prototype.notifyWhenAttacked = function(a) { |
|
return this.my ? k.isBoolean(a) ? (a != m(this.id).notifyWhenAttacked && f.set(this.id, "notifyWhenAttacked", { |
|
enabled: a |
|
}), j.OK) : j.ERR_INVALID_ARGS : j.ERR_NOT_OWNER; |
|
}, h.Structure = n; |
|
} |
|
}; |
|
}, { |
|
"./../utils": 108, |
|
"./constants": 38, |
|
"./rooms": 47, |
|
lodash: 53 |
|
} ], |
|
51: [ function(a, b) { |
|
"use strict"; |
|
{ |
|
var c = function() { |
|
function a(a, b) { |
|
var c = [], d = !0, e = !1, f = void 0; |
|
try { |
|
for (var g, h = a[Symbol.iterator](); !(d = (g = h.next()).done) && (c.push(g.value), |
|
!b || c.length !== b); d = !0) ; |
|
} catch (i) { |
|
e = !0, f = i; |
|
} finally { |
|
try { |
|
!d && h["return"] && h["return"](); |
|
} finally { |
|
if (e) throw f; |
|
} |
|
} |
|
return c; |
|
} |
|
return function(b, c) { |
|
if (Array.isArray(b)) return b; |
|
if (Symbol.iterator in Object(b)) return a(b, c); |
|
throw new TypeError("Invalid attempt to destructure non-iterable instance"); |
|
}; |
|
}(), d = a("./core/core.js"), e = a("q"); |
|
a("lodash"), a("./game/constants"); |
|
} |
|
b.exports = function() { |
|
return d.getInterRoom().then(function(a) { |
|
var b = c(a, 2), f = b[0], g = b[1]; |
|
if (!f) return !0; |
|
var h = d.bulkObjectsWrite(), i = d.bulkRoomsWrite(), j = {}; |
|
return f.forEach(function(a) { |
|
g[a.interRoom.room] && (j[a.interRoom.room] || i.update(a.interRoom.room, { |
|
active: !0 |
|
}), j[a.interRoom.room] = !0, h.update(a, { |
|
room: a.interRoom.room, |
|
x: a.interRoom.x, |
|
y: a.interRoom.y, |
|
interRoom: null |
|
})); |
|
}), e.all([ h.execute(), i.execute() ]); |
|
}); |
|
}; |
|
}, { |
|
"./core/core.js": 27, |
|
"./game/constants": 38, |
|
lodash: 53, |
|
q: 54 |
|
} ], |
|
52: [ function(a) { |
|
(function(b) { |
|
"use strict"; |
|
function c() { |
|
var j, l = b.hrtime ? b.hrtime() : Date.now(), o = 1; |
|
"undefined" == typeof self && (j = setInterval(function() { |
|
i.queue.resetAll(); |
|
}, 1e4)), i.notifyTickStarted().then(function() { |
|
return o = 2, m.setNow(), i.getAllUsers(); |
|
}).then(function(a) { |
|
return o = 3, m.mark("getAllUsers"), d.addMulti(k.map(a, function(a) { |
|
return a._id.toString(); |
|
})); |
|
}).then(function() { |
|
return o = 31, d.whenAllDone(); |
|
}).then(function() { |
|
return o = 4, m.mark("whenAllUsersDone"), o = "rooms", i.getAllRooms(); |
|
}).then(function(a) { |
|
return o = 5, m.mark("getAllRooms"), e.addMulti(k.map(a, function(a) { |
|
return a._id.toString(); |
|
})); |
|
}).then(function() { |
|
return o = 6, e.whenAllDone(); |
|
}).then(function() { |
|
return o = 7, m.mark("whenAllRoomsDone"), i.commitDbBulk(); |
|
}).then(function() { |
|
return o = 8, m.mark("commitDbBulk1"), a("./inter-room")(); |
|
}).then(function() { |
|
return o = 9, m.mark("interRoom"), i.commitDbBulk(); |
|
}).then(function() { |
|
return o = 10, m.mark("commitDbBulk2"), i.incrementGameTime(); |
|
}).then(function() { |
|
return o = 11, i.notifyRoomsDone(); |
|
})["catch"](function(a) {})["finally"](function() { |
|
j && clearInterval(j); |
|
var a; |
|
if (b.hrtime ? (a = b.hrtime(l), a = 1e3 * a[0] + a[1] / 1e6) : a = Date.now() - l, |
|
!k.isUndefined(g)) { |
|
var d; |
|
b.hrtime ? (d = b.hrtime(g), d = 1e3 * d[0] + d[1] / 1e6) : d = Date.now() - g, |
|
n.push(d), 1 == n.length && i.getInterRoom().then(function(a) { |
|
var b = h(a, 2), c = (b[0], b[1]); |
|
i.saveAccessibleRoomsList(c); |
|
}), n.length >= 20 && (i.cleanTimelineStats(), i.sendUsageMetrics(n), n = []); |
|
} |
|
g = b.hrtime ? b.hrtime() : Date.now(), i.flushTimelineStats(m.getStats()), setTimeout(c, Math.max(f - a, 0)); |
|
}); |
|
} |
|
var d, e, f, g, h = function() { |
|
function a(a, b) { |
|
var c = [], d = !0, e = !1, f = void 0; |
|
try { |
|
for (var g, h = a[Symbol.iterator](); !(d = (g = h.next()).done) && (c.push(g.value), |
|
!b || c.length !== b); d = !0) ; |
|
} catch (i) { |
|
e = !0, f = i; |
|
} finally { |
|
try { |
|
!d && h["return"] && h["return"](); |
|
} finally { |
|
if (e) throw f; |
|
} |
|
} |
|
return c; |
|
} |
|
return function(b, c) { |
|
if (Array.isArray(b)) return b; |
|
if (Symbol.iterator in Object(b)) return a(b, c); |
|
throw new TypeError("Invalid attempt to destructure non-iterable instance"); |
|
}; |
|
}(), i = a("./core/core.js"), j = a("q"), k = a("lodash"), l = a("./utils"), m = l.getTimelineStats("main"), n = []; |
|
i.connect("main").then(function() { |
|
return d = i.queue.create("users"), e = i.queue.create("rooms"), i.getTickPeriod(); |
|
}).then(function(a) { |
|
f = a, c(); |
|
}), "undefined " == typeof self && setInterval(function() { |
|
var a = j.getUnhandledReasons(); |
|
a.forEach(function(a) { |
|
return void 0; |
|
}), j.resetUnhandledRejections(); |
|
}, 1e3); |
|
}).call(this, a("_process")); |
|
}, { |
|
"./core/core.js": 27, |
|
"./inter-room": 51, |
|
"./utils": 108, |
|
_process: 110, |
|
lodash: 53, |
|
q: 54 |
|
} ], |
|
53: [ function(a, b, c) { |
|
(function(a) { |
|
(function() { |
|
function d(a, b) { |
|
if (a !== b) { |
|
var c = null === a, d = a === z, e = a === a, f = null === b, g = b === z, h = b === b; |
|
if (a > b && !f || !e || c && !g && h || d && h) return 1; |
|
if (b > a && !c || !h || f && !d && e || g && e) return -1; |
|
} |
|
return 0; |
|
} |
|
function e(a, b, c) { |
|
for (var d = a.length, e = c ? d : -1; c ? e-- : ++e < d; ) if (b(a[e], e, a)) return e; |
|
return -1; |
|
} |
|
function f(a, b, c) { |
|
if (b !== b) return q(a, c); |
|
for (var d = c - 1, e = a.length; ++d < e; ) if (a[d] === b) return d; |
|
return -1; |
|
} |
|
function g(a) { |
|
return "function" == typeof a || !1; |
|
} |
|
function h(a) { |
|
return null == a ? "" : a + ""; |
|
} |
|
function i(a, b) { |
|
for (var c = -1, d = a.length; ++c < d && b.indexOf(a.charAt(c)) > -1; ) ; |
|
return c; |
|
} |
|
function j(a, b) { |
|
for (var c = a.length; c-- && b.indexOf(a.charAt(c)) > -1; ) ; |
|
return c; |
|
} |
|
function k(a, b) { |
|
return d(a.criteria, b.criteria) || a.index - b.index; |
|
} |
|
function l(a, b, c) { |
|
for (var e = -1, f = a.criteria, g = b.criteria, h = f.length, i = c.length; ++e < h; ) { |
|
var j = d(f[e], g[e]); |
|
if (j) { |
|
if (e >= i) return j; |
|
var k = c[e]; |
|
return j * ("asc" === k || k === !0 ? 1 : -1); |
|
} |
|
} |
|
return a.index - b.index; |
|
} |
|
function m(a) { |
|
return Sb[a]; |
|
} |
|
function n(a) { |
|
return Tb[a]; |
|
} |
|
function o(a, b, c) { |
|
return b ? a = Wb[a] : c && (a = Xb[a]), "\\" + a; |
|
} |
|
function p(a) { |
|
return "\\" + Xb[a]; |
|
} |
|
function q(a, b, c) { |
|
for (var d = a.length, e = b + (c ? 0 : -1); c ? e-- : ++e < d; ) { |
|
var f = a[e]; |
|
if (f !== f) return e; |
|
} |
|
return -1; |
|
} |
|
function r(a) { |
|
return !!a && "object" == typeof a; |
|
} |
|
function s(a) { |
|
return 160 >= a && a >= 9 && 13 >= a || 32 == a || 160 == a || 5760 == a || 6158 == a || a >= 8192 && (8202 >= a || 8232 == a || 8233 == a || 8239 == a || 8287 == a || 12288 == a || 65279 == a); |
|
} |
|
function t(a, b) { |
|
for (var c = -1, d = a.length, e = -1, f = []; ++c < d; ) a[c] === b && (a[c] = S, |
|
f[++e] = c); |
|
return f; |
|
} |
|
function u(a, b) { |
|
for (var c, d = -1, e = a.length, f = -1, g = []; ++d < e; ) { |
|
var h = a[d], i = b ? b(h, d, a) : h; |
|
d && c === i || (c = i, g[++f] = h); |
|
} |
|
return g; |
|
} |
|
function v(a) { |
|
for (var b = -1, c = a.length; ++b < c && s(a.charCodeAt(b)); ) ; |
|
return b; |
|
} |
|
function w(a) { |
|
for (var b = a.length; b-- && s(a.charCodeAt(b)); ) ; |
|
return b; |
|
} |
|
function x(a) { |
|
return Ub[a]; |
|
} |
|
function y(a) { |
|
function b(a) { |
|
if (r(a) && !Ci(a) && !(a instanceof Z)) { |
|
if (a instanceof s) return a; |
|
if (ah.call(a, "__chain__") && ah.call(a, "__wrapped__")) return me(a); |
|
} |
|
return new s(a); |
|
} |
|
function c() {} |
|
function s(a, b, c) { |
|
this.__wrapped__ = a, this.__actions__ = c || [], this.__chain__ = !!b; |
|
} |
|
function Z(a) { |
|
this.__wrapped__ = a, this.__actions__ = [], this.__dir__ = 1, this.__filtered__ = !1, |
|
this.__iteratees__ = [], this.__takeCount__ = Bh, this.__views__ = []; |
|
} |
|
function bb() { |
|
var a = new Z(this.__wrapped__); |
|
return a.__actions__ = ac(this.__actions__), a.__dir__ = this.__dir__, a.__filtered__ = this.__filtered__, |
|
a.__iteratees__ = ac(this.__iteratees__), a.__takeCount__ = this.__takeCount__, |
|
a.__views__ = ac(this.__views__), a; |
|
} |
|
function db() { |
|
if (this.__filtered__) { |
|
var a = new Z(this); |
|
a.__dir__ = -1, a.__filtered__ = !0; |
|
} else a = this.clone(), a.__dir__ *= -1; |
|
return a; |
|
} |
|
function Sb() { |
|
var a = this.__wrapped__.value(), b = this.__dir__, c = Ci(a), d = 0 > b, e = c ? a.length : 0, f = Td(0, e, this.__views__), g = f.start, h = f.end, i = h - g, j = d ? h : g - 1, k = this.__iteratees__, l = k.length, m = 0, n = wh(i, this.__takeCount__); |
|
if (!c || O > e || e == i && n == i) return cd(d && c ? a.reverse() : a, this.__actions__); |
|
var o = []; |
|
a: for (;i-- && n > m; ) { |
|
j += b; |
|
for (var p = -1, q = a[j]; ++p < l; ) { |
|
var r = k[p], s = r.iteratee, t = r.type, u = s(q); |
|
if (t == Q) q = u; else if (!u) { |
|
if (t == P) continue a; |
|
break a; |
|
} |
|
} |
|
o[m++] = q; |
|
} |
|
return o; |
|
} |
|
function Tb() { |
|
this.__data__ = {}; |
|
} |
|
function Ub(a) { |
|
return this.has(a) && delete this.__data__[a]; |
|
} |
|
function Vb(a) { |
|
return "__proto__" == a ? z : this.__data__[a]; |
|
} |
|
function Wb(a) { |
|
return "__proto__" != a && ah.call(this.__data__, a); |
|
} |
|
function Xb(a, b) { |
|
return "__proto__" != a && (this.__data__[a] = b), this; |
|
} |
|
function Yb(a) { |
|
var b = a ? a.length : 0; |
|
for (this.data = { |
|
hash: qh(null), |
|
set: new kh() |
|
}; b--; ) this.push(a[b]); |
|
} |
|
function Zb(a, b) { |
|
var c = a.data, d = "string" == typeof b || If(b) ? c.set.has(b) : c.hash[b]; |
|
return d ? 0 : -1; |
|
} |
|
function $b(a) { |
|
var b = this.data; |
|
"string" == typeof a || If(a) ? b.set.add(a) : b.hash[a] = !0; |
|
} |
|
function _b(a, b) { |
|
for (var c = -1, d = a.length, e = -1, f = b.length, g = Og(d + f); ++c < d; ) g[c] = a[c]; |
|
for (;++e < f; ) g[c++] = b[e]; |
|
return g; |
|
} |
|
function ac(a, b) { |
|
var c = -1, d = a.length; |
|
for (b || (b = Og(d)); ++c < d; ) b[c] = a[c]; |
|
return b; |
|
} |
|
function bc(a, b) { |
|
for (var c = -1, d = a.length; ++c < d && b(a[c], c, a) !== !1; ) ; |
|
return a; |
|
} |
|
function ec(a, b) { |
|
for (var c = a.length; c-- && b(a[c], c, a) !== !1; ) ; |
|
return a; |
|
} |
|
function fc(a, b) { |
|
for (var c = -1, d = a.length; ++c < d; ) if (!b(a[c], c, a)) return !1; |
|
return !0; |
|
} |
|
function gc(a, b, c, d) { |
|
for (var e = -1, f = a.length, g = d, h = g; ++e < f; ) { |
|
var i = a[e], j = +b(i); |
|
c(j, g) && (g = j, h = i); |
|
} |
|
return h; |
|
} |
|
function hc(a, b) { |
|
for (var c = -1, d = a.length, e = -1, f = []; ++c < d; ) { |
|
var g = a[c]; |
|
b(g, c, a) && (f[++e] = g); |
|
} |
|
return f; |
|
} |
|
function ic(a, b) { |
|
for (var c = -1, d = a.length, e = Og(d); ++c < d; ) e[c] = b(a[c], c, a); |
|
return e; |
|
} |
|
function jc(a, b) { |
|
for (var c = -1, d = b.length, e = a.length; ++c < d; ) a[e + c] = b[c]; |
|
return a; |
|
} |
|
function kc(a, b, c, d) { |
|
var e = -1, f = a.length; |
|
for (d && f && (c = a[++e]); ++e < f; ) c = b(c, a[e], e, a); |
|
return c; |
|
} |
|
function lc(a, b, c, d) { |
|
var e = a.length; |
|
for (d && e && (c = a[--e]); e--; ) c = b(c, a[e], e, a); |
|
return c; |
|
} |
|
function mc(a, b) { |
|
for (var c = -1, d = a.length; ++c < d; ) if (b(a[c], c, a)) return !0; |
|
return !1; |
|
} |
|
function nc(a, b) { |
|
for (var c = a.length, d = 0; c--; ) d += +b(a[c]) || 0; |
|
return d; |
|
} |
|
function oc(a, b) { |
|
return a === z ? b : a; |
|
} |
|
function pc(a, b, c, d) { |
|
return a !== z && ah.call(d, c) ? a : b; |
|
} |
|
function qc(a, b, c) { |
|
for (var d = -1, e = Ni(b), f = e.length; ++d < f; ) { |
|
var g = e[d], h = a[g], i = c(h, b[g], g, a, b); |
|
(i === i ? i === h : h !== h) && (h !== z || g in a) || (a[g] = i); |
|
} |
|
return a; |
|
} |
|
function rc(a, b) { |
|
return null == b ? a : tc(b, Ni(b), a); |
|
} |
|
function sc(a, b) { |
|
for (var c = -1, d = null == a, e = !d && Yd(a), f = e ? a.length : 0, g = b.length, h = Og(g); ++c < g; ) { |
|
var i = b[c]; |
|
h[c] = e ? Zd(i, f) ? a[i] : z : d ? z : a[i]; |
|
} |
|
return h; |
|
} |
|
function tc(a, b, c) { |
|
c || (c = {}); |
|
for (var d = -1, e = b.length; ++d < e; ) { |
|
var f = b[d]; |
|
c[f] = a[f]; |
|
} |
|
return c; |
|
} |
|
function uc(a, b, c) { |
|
var d = typeof a; |
|
return "function" == d ? b === z ? a : fd(a, b, c) : null == a ? Bg : "object" == d ? Nc(a) : b === z ? Hg(a) : Oc(a, b); |
|
} |
|
function vc(a, b, c, d, e, f, g) { |
|
var h; |
|
if (c && (h = e ? c(a, d, e) : c(a)), h !== z) return h; |
|
if (!If(a)) return a; |
|
var i = Ci(a); |
|
if (i) { |
|
if (h = Ud(a), !b) return ac(a, h); |
|
} else { |
|
var j = ch.call(a), k = j == Y; |
|
if (j != _ && j != T && (!k || e)) return Rb[j] ? Wd(a, j, b) : e ? a : {}; |
|
if (h = Vd(k ? {} : a), !b) return rc(h, a); |
|
} |
|
f || (f = []), g || (g = []); |
|
for (var l = f.length; l--; ) if (f[l] == a) return g[l]; |
|
return f.push(a), g.push(h), (i ? bc : Fc)(a, function(d, e) { |
|
h[e] = vc(d, b, c, e, a, f, g); |
|
}), h; |
|
} |
|
function wc(a, b, c) { |
|
if ("function" != typeof a) throw new Xg(R); |
|
return lh(function() { |
|
a.apply(z, c); |
|
}, b); |
|
} |
|
function xc(a, b) { |
|
var c = a ? a.length : 0, d = []; |
|
if (!c) return d; |
|
var e = -1, g = Qd(), h = g == f, i = h && b.length >= O ? od(b) : null, j = b.length; |
|
i && (g = Zb, h = !1, b = i); |
|
a: for (;++e < c; ) { |
|
var k = a[e]; |
|
if (h && k === k) { |
|
for (var l = j; l--; ) if (b[l] === k) continue a; |
|
d.push(k); |
|
} else g(b, k, 0) < 0 && d.push(k); |
|
} |
|
return d; |
|
} |
|
function yc(a, b) { |
|
var c = !0; |
|
return Jh(a, function(a, d, e) { |
|
return c = !!b(a, d, e); |
|
}), c; |
|
} |
|
function zc(a, b, c, d) { |
|
var e = d, f = e; |
|
return Jh(a, function(a, g, h) { |
|
var i = +b(a, g, h); |
|
(c(i, e) || i === d && i === f) && (e = i, f = a); |
|
}), f; |
|
} |
|
function Ac(a, b, c, d) { |
|
var e = a.length; |
|
for (c = null == c ? 0 : +c || 0, 0 > c && (c = -c > e ? 0 : e + c), d = d === z || d > e ? e : +d || 0, |
|
0 > d && (d += e), e = c > d ? 0 : d >>> 0, c >>>= 0; e > c; ) a[c++] = b; |
|
return a; |
|
} |
|
function Bc(a, b) { |
|
var c = []; |
|
return Jh(a, function(a, d, e) { |
|
b(a, d, e) && c.push(a); |
|
}), c; |
|
} |
|
function Cc(a, b, c, d) { |
|
var e; |
|
return c(a, function(a, c, f) { |
|
return b(a, c, f) ? (e = d ? c : a, !1) : void 0; |
|
}), e; |
|
} |
|
function Dc(a, b, c, d) { |
|
d || (d = []); |
|
for (var e = -1, f = a.length; ++e < f; ) { |
|
var g = a[e]; |
|
r(g) && Yd(g) && (c || Ci(g) || zf(g)) ? b ? Dc(g, b, c, d) : jc(d, g) : c || (d[d.length] = g); |
|
} |
|
return d; |
|
} |
|
function Ec(a, b) { |
|
return Lh(a, b, ag); |
|
} |
|
function Fc(a, b) { |
|
return Lh(a, b, Ni); |
|
} |
|
function Gc(a, b) { |
|
return Mh(a, b, Ni); |
|
} |
|
function Hc(a, b) { |
|
for (var c = -1, d = b.length, e = -1, f = []; ++c < d; ) { |
|
var g = b[c]; |
|
Hf(a[g]) && (f[++e] = g); |
|
} |
|
return f; |
|
} |
|
function Ic(a, b, c) { |
|
if (null != a) { |
|
c !== z && c in ke(a) && (b = [ c ]); |
|
for (var d = 0, e = b.length; null != a && e > d; ) a = a[b[d++]]; |
|
return d && d == e ? a : z; |
|
} |
|
} |
|
function Jc(a, b, c, d, e, f) { |
|
return a === b ? !0 : null == a || null == b || !If(a) && !r(b) ? a !== a && b !== b : Kc(a, b, Jc, c, d, e, f); |
|
} |
|
function Kc(a, b, c, d, e, f, g) { |
|
var h = Ci(a), i = Ci(b), j = U, k = U; |
|
h || (j = ch.call(a), j == T ? j = _ : j != _ && (h = Rf(a))), i || (k = ch.call(b), |
|
k == T ? k = _ : k != _ && (i = Rf(b))); |
|
var l = j == _, m = k == _, n = j == k; |
|
if (n && !h && !l) return Md(a, b, j); |
|
if (!e) { |
|
var o = l && ah.call(a, "__wrapped__"), p = m && ah.call(b, "__wrapped__"); |
|
if (o || p) return c(o ? a.value() : a, p ? b.value() : b, d, e, f, g); |
|
} |
|
if (!n) return !1; |
|
f || (f = []), g || (g = []); |
|
for (var q = f.length; q--; ) if (f[q] == a) return g[q] == b; |
|
f.push(a), g.push(b); |
|
var r = (h ? Ld : Nd)(a, b, c, d, e, f, g); |
|
return f.pop(), g.pop(), r; |
|
} |
|
function Lc(a, b, c) { |
|
var d = b.length, e = d, f = !c; |
|
if (null == a) return !e; |
|
for (a = ke(a); d--; ) { |
|
var g = b[d]; |
|
if (f && g[2] ? g[1] !== a[g[0]] : !(g[0] in a)) return !1; |
|
} |
|
for (;++d < e; ) { |
|
g = b[d]; |
|
var h = g[0], i = a[h], j = g[1]; |
|
if (f && g[2]) { |
|
if (i === z && !(h in a)) return !1; |
|
} else { |
|
var k = c ? c(i, j, h) : z; |
|
if (!(k === z ? Jc(j, i, c, !0) : k)) return !1; |
|
} |
|
} |
|
return !0; |
|
} |
|
function Mc(a, b) { |
|
var c = -1, d = Yd(a) ? Og(a.length) : []; |
|
return Jh(a, function(a, e, f) { |
|
d[++c] = b(a, e, f); |
|
}), d; |
|
} |
|
function Nc(a) { |
|
var b = Rd(a); |
|
if (1 == b.length && b[0][2]) { |
|
var c = b[0][0], d = b[0][1]; |
|
return function(a) { |
|
return null == a ? !1 : a[c] === d && (d !== z || c in ke(a)); |
|
}; |
|
} |
|
return function(a) { |
|
return Lc(a, b); |
|
}; |
|
} |
|
function Oc(a, b) { |
|
var c = Ci(a), d = _d(a) && ce(b), e = a + ""; |
|
return a = le(a), function(f) { |
|
if (null == f) return !1; |
|
var g = e; |
|
if (f = ke(f), !(!c && d || g in f)) { |
|
if (f = 1 == a.length ? f : Ic(f, Wc(a, 0, -1)), null == f) return !1; |
|
g = ze(a), f = ke(f); |
|
} |
|
return f[g] === b ? b !== z || g in f : Jc(b, f[g], z, !0); |
|
}; |
|
} |
|
function Pc(a, b, c, d, e) { |
|
if (!If(a)) return a; |
|
var f = Yd(b) && (Ci(b) || Rf(b)), g = f ? z : Ni(b); |
|
return bc(g || b, function(h, i) { |
|
if (g && (i = h, h = b[i]), r(h)) d || (d = []), e || (e = []), Qc(a, b, i, Pc, c, d, e); else { |
|
var j = a[i], k = c ? c(j, h, i, a, b) : z, l = k === z; |
|
l && (k = h), k === z && (!f || i in a) || !l && (k === k ? k === j : j !== j) || (a[i] = k); |
|
} |
|
}), a; |
|
} |
|
function Qc(a, b, c, d, e, f, g) { |
|
for (var h = f.length, i = b[c]; h--; ) if (f[h] == i) return void (a[c] = g[h]); |
|
var j = a[c], k = e ? e(j, i, c, a, b) : z, l = k === z; |
|
l && (k = i, Yd(i) && (Ci(i) || Rf(i)) ? k = Ci(j) ? j : Yd(j) ? ac(j) : [] : Of(i) || zf(i) ? k = zf(j) ? Wf(j) : Of(j) ? j : {} : l = !1), |
|
f.push(i), g.push(k), l ? a[c] = d(k, i, e, f, g) : (k === k ? k !== j : j === j) && (a[c] = k); |
|
} |
|
function Rc(a) { |
|
return function(b) { |
|
return null == b ? z : b[a]; |
|
}; |
|
} |
|
function Sc(a) { |
|
var b = a + ""; |
|
return a = le(a), function(c) { |
|
return Ic(c, a, b); |
|
}; |
|
} |
|
function Tc(a, b) { |
|
for (var c = a ? b.length : 0; c--; ) { |
|
var d = b[c]; |
|
if (d != e && Zd(d)) { |
|
var e = d; |
|
mh.call(a, d, 1); |
|
} |
|
} |
|
return a; |
|
} |
|
function Uc(a, b) { |
|
return a + rh(zh() * (b - a + 1)); |
|
} |
|
function Vc(a, b, c, d, e) { |
|
return e(a, function(a, e, f) { |
|
c = d ? (d = !1, a) : b(c, a, e, f); |
|
}), c; |
|
} |
|
function Wc(a, b, c) { |
|
var d = -1, e = a.length; |
|
b = null == b ? 0 : +b || 0, 0 > b && (b = -b > e ? 0 : e + b), c = c === z || c > e ? e : +c || 0, |
|
0 > c && (c += e), e = b > c ? 0 : c - b >>> 0, b >>>= 0; |
|
for (var f = Og(e); ++d < e; ) f[d] = a[d + b]; |
|
return f; |
|
} |
|
function Xc(a, b) { |
|
var c; |
|
return Jh(a, function(a, d, e) { |
|
return c = b(a, d, e), !c; |
|
}), !!c; |
|
} |
|
function Yc(a, b) { |
|
var c = a.length; |
|
for (a.sort(b); c--; ) a[c] = a[c].value; |
|
return a; |
|
} |
|
function Zc(a, b, c) { |
|
var d = Od(), e = -1; |
|
b = ic(b, function(a) { |
|
return d(a); |
|
}); |
|
var f = Mc(a, function(a) { |
|
var c = ic(b, function(b) { |
|
return b(a); |
|
}); |
|
return { |
|
criteria: c, |
|
index: ++e, |
|
value: a |
|
}; |
|
}); |
|
return Yc(f, function(a, b) { |
|
return l(a, b, c); |
|
}); |
|
} |
|
function $c(a, b) { |
|
var c = 0; |
|
return Jh(a, function(a, d, e) { |
|
c += +b(a, d, e) || 0; |
|
}), c; |
|
} |
|
function _c(a, b) { |
|
var c = -1, d = Qd(), e = a.length, g = d == f, h = g && e >= O, i = h ? od() : null, j = []; |
|
i ? (d = Zb, g = !1) : (h = !1, i = b ? [] : j); |
|
a: for (;++c < e; ) { |
|
var k = a[c], l = b ? b(k, c, a) : k; |
|
if (g && k === k) { |
|
for (var m = i.length; m--; ) if (i[m] === l) continue a; |
|
b && i.push(l), j.push(k); |
|
} else d(i, l, 0) < 0 && ((b || h) && i.push(l), j.push(k)); |
|
} |
|
return j; |
|
} |
|
function ad(a, b) { |
|
for (var c = -1, d = b.length, e = Og(d); ++c < d; ) e[c] = a[b[c]]; |
|
return e; |
|
} |
|
function bd(a, b, c, d) { |
|
for (var e = a.length, f = d ? e : -1; (d ? f-- : ++f < e) && b(a[f], f, a); ) ; |
|
return c ? Wc(a, d ? 0 : f, d ? f + 1 : e) : Wc(a, d ? f + 1 : 0, d ? e : f); |
|
} |
|
function cd(a, b) { |
|
var c = a; |
|
c instanceof Z && (c = c.value()); |
|
for (var d = -1, e = b.length; ++d < e; ) { |
|
var f = b[d]; |
|
c = f.func.apply(f.thisArg, jc([ c ], f.args)); |
|
} |
|
return c; |
|
} |
|
function dd(a, b, c) { |
|
var d = 0, e = a ? a.length : d; |
|
if ("number" == typeof b && b === b && Eh >= e) { |
|
for (;e > d; ) { |
|
var f = d + e >>> 1, g = a[f]; |
|
(c ? b >= g : b > g) && null !== g ? d = f + 1 : e = f; |
|
} |
|
return e; |
|
} |
|
return ed(a, b, Bg, c); |
|
} |
|
function ed(a, b, c, d) { |
|
b = c(b); |
|
for (var e = 0, f = a ? a.length : 0, g = b !== b, h = null === b, i = b === z; f > e; ) { |
|
var j = rh((e + f) / 2), k = c(a[j]), l = k !== z, m = k === k; |
|
if (g) var n = m || d; else n = h ? m && l && (d || null != k) : i ? m && (d || l) : null == k ? !1 : d ? b >= k : b > k; |
|
n ? e = j + 1 : f = j; |
|
} |
|
return wh(f, Dh); |
|
} |
|
function fd(a, b, c) { |
|
if ("function" != typeof a) return Bg; |
|
if (b === z) return a; |
|
switch (c) { |
|
case 1: |
|
return function(c) { |
|
return a.call(b, c); |
|
}; |
|
|
|
case 3: |
|
return function(c, d, e) { |
|
return a.call(b, c, d, e); |
|
}; |
|
|
|
case 4: |
|
return function(c, d, e, f) { |
|
return a.call(b, c, d, e, f); |
|
}; |
|
|
|
case 5: |
|
return function(c, d, e, f, g) { |
|
return a.call(b, c, d, e, f, g); |
|
}; |
|
} |
|
return function() { |
|
return a.apply(b, arguments); |
|
}; |
|
} |
|
function gd(a) { |
|
var b = new fh(a.byteLength), c = new nh(b); |
|
return c.set(new nh(a)), b; |
|
} |
|
function hd(a, b, c) { |
|
for (var d = c.length, e = -1, f = vh(a.length - d, 0), g = -1, h = b.length, i = Og(h + f); ++g < h; ) i[g] = b[g]; |
|
for (;++e < d; ) i[c[e]] = a[e]; |
|
for (;f--; ) i[g++] = a[e++]; |
|
return i; |
|
} |
|
function id(a, b, c) { |
|
for (var d = -1, e = c.length, f = -1, g = vh(a.length - e, 0), h = -1, i = b.length, j = Og(g + i); ++f < g; ) j[f] = a[f]; |
|
for (var k = f; ++h < i; ) j[k + h] = b[h]; |
|
for (;++d < e; ) j[k + c[d]] = a[f++]; |
|
return j; |
|
} |
|
function jd(a, b) { |
|
return function(c, d, e) { |
|
var f = b ? b() : {}; |
|
if (d = Od(d, e, 3), Ci(c)) for (var g = -1, h = c.length; ++g < h; ) { |
|
var i = c[g]; |
|
a(f, i, d(i, g, c), c); |
|
} else Jh(c, function(b, c, e) { |
|
a(f, b, d(b, c, e), e); |
|
}); |
|
return f; |
|
}; |
|
} |
|
function kd(a) { |
|
return rf(function(b, c) { |
|
var d = -1, e = null == b ? 0 : c.length, f = e > 2 ? c[e - 2] : z, g = e > 2 ? c[2] : z, h = e > 1 ? c[e - 1] : z; |
|
for ("function" == typeof f ? (f = fd(f, h, 5), e -= 2) : (f = "function" == typeof h ? h : z, |
|
e -= f ? 1 : 0), g && $d(c[0], c[1], g) && (f = 3 > e ? z : f, e = 1); ++d < e; ) { |
|
var i = c[d]; |
|
i && a(b, i, f); |
|
} |
|
return b; |
|
}); |
|
} |
|
function ld(a, b) { |
|
return function(c, d) { |
|
var e = c ? Ph(c) : 0; |
|
if (!be(e)) return a(c, d); |
|
for (var f = b ? e : -1, g = ke(c); (b ? f-- : ++f < e) && d(g[f], f, g) !== !1; ) ; |
|
return c; |
|
}; |
|
} |
|
function md(a) { |
|
return function(b, c, d) { |
|
for (var e = ke(b), f = d(b), g = f.length, h = a ? g : -1; a ? h-- : ++h < g; ) { |
|
var i = f[h]; |
|
if (c(e[i], i, e) === !1) break; |
|
} |
|
return b; |
|
}; |
|
} |
|
function nd(a, b) { |
|
function c() { |
|
var e = this && this !== cc && this instanceof c ? d : a; |
|
return e.apply(b, arguments); |
|
} |
|
var d = qd(a); |
|
return c; |
|
} |
|
function od(a) { |
|
return qh && kh ? new Yb(a) : null; |
|
} |
|
function pd(a) { |
|
return function(b) { |
|
for (var c = -1, d = yg(kg(b)), e = d.length, f = ""; ++c < e; ) f = a(f, d[c], c); |
|
return f; |
|
}; |
|
} |
|
function qd(a) { |
|
return function() { |
|
var b = arguments; |
|
switch (b.length) { |
|
case 0: |
|
return new a(); |
|
|
|
case 1: |
|
return new a(b[0]); |
|
|
|
case 2: |
|
return new a(b[0], b[1]); |
|
|
|
case 3: |
|
return new a(b[0], b[1], b[2]); |
|
|
|
case 4: |
|
return new a(b[0], b[1], b[2], b[3]); |
|
|
|
case 5: |
|
return new a(b[0], b[1], b[2], b[3], b[4]); |
|
|
|
case 6: |
|
return new a(b[0], b[1], b[2], b[3], b[4], b[5]); |
|
|
|
case 7: |
|
return new a(b[0], b[1], b[2], b[3], b[4], b[5], b[6]); |
|
} |
|
var c = Ih(a.prototype), d = a.apply(c, b); |
|
return If(d) ? d : c; |
|
}; |
|
} |
|
function rd(a) { |
|
function b(c, d, e) { |
|
e && $d(c, d, e) && (d = z); |
|
var f = Kd(c, a, z, z, z, z, z, d); |
|
return f.placeholder = b.placeholder, f; |
|
} |
|
return b; |
|
} |
|
function sd(a, b) { |
|
return rf(function(c) { |
|
var d = c[0]; |
|
return null == d ? d : (c.push(b), a.apply(z, c)); |
|
}); |
|
} |
|
function td(a, b) { |
|
return function(c, d, e) { |
|
if (e && $d(c, d, e) && (d = z), d = Od(d, e, 3), 1 == d.length) { |
|
c = Ci(c) ? c : je(c); |
|
var f = gc(c, d, a, b); |
|
if (!c.length || f !== b) return f; |
|
} |
|
return zc(c, d, a, b); |
|
}; |
|
} |
|
function ud(a, b) { |
|
return function(c, d, f) { |
|
if (d = Od(d, f, 3), Ci(c)) { |
|
var g = e(c, d, b); |
|
return g > -1 ? c[g] : z; |
|
} |
|
return Cc(c, d, a); |
|
}; |
|
} |
|
function vd(a) { |
|
return function(b, c, d) { |
|
return b && b.length ? (c = Od(c, d, 3), e(b, c, a)) : -1; |
|
}; |
|
} |
|
function wd(a) { |
|
return function(b, c, d) { |
|
return c = Od(c, d, 3), Cc(b, c, a, !0); |
|
}; |
|
} |
|
function xd(a) { |
|
return function() { |
|
for (var b, c = arguments.length, d = a ? c : -1, e = 0, f = Og(c); a ? d-- : ++d < c; ) { |
|
var g = f[e++] = arguments[d]; |
|
if ("function" != typeof g) throw new Xg(R); |
|
!b && s.prototype.thru && "wrapper" == Pd(g) && (b = new s([], !0)); |
|
} |
|
for (d = b ? -1 : c; ++d < c; ) { |
|
g = f[d]; |
|
var h = Pd(g), i = "wrapper" == h ? Oh(g) : z; |
|
b = i && ae(i[0]) && i[1] == (I | E | G | J) && !i[4].length && 1 == i[9] ? b[Pd(i[0])].apply(b, i[3]) : 1 == g.length && ae(g) ? b[h]() : b.thru(g); |
|
} |
|
return function() { |
|
var a = arguments, d = a[0]; |
|
if (b && 1 == a.length && Ci(d) && d.length >= O) return b.plant(d).value(); |
|
for (var e = 0, g = c ? f[e].apply(this, a) : d; ++e < c; ) g = f[e].call(this, g); |
|
return g; |
|
}; |
|
}; |
|
} |
|
function yd(a, b) { |
|
return function(c, d, e) { |
|
return "function" == typeof d && e === z && Ci(c) ? a(c, d) : b(c, fd(d, e, 3)); |
|
}; |
|
} |
|
function zd(a) { |
|
return function(b, c, d) { |
|
return ("function" != typeof c || d !== z) && (c = fd(c, d, 3)), a(b, c, ag); |
|
}; |
|
} |
|
function Ad(a) { |
|
return function(b, c, d) { |
|
return ("function" != typeof c || d !== z) && (c = fd(c, d, 3)), a(b, c); |
|
}; |
|
} |
|
function Bd(a) { |
|
return function(b, c, d) { |
|
var e = {}; |
|
return c = Od(c, d, 3), Fc(b, function(b, d, f) { |
|
var g = c(b, d, f); |
|
d = a ? g : d, b = a ? b : g, e[d] = b; |
|
}), e; |
|
}; |
|
} |
|
function Cd(a) { |
|
return function(b, c, d) { |
|
return b = h(b), (a ? b : "") + Gd(b, c, d) + (a ? "" : b); |
|
}; |
|
} |
|
function Dd(a) { |
|
var b = rf(function(c, d) { |
|
var e = t(d, b.placeholder); |
|
return Kd(c, a, z, d, e); |
|
}); |
|
return b; |
|
} |
|
function Ed(a, b) { |
|
return function(c, d, e, f) { |
|
var g = arguments.length < 3; |
|
return "function" == typeof d && f === z && Ci(c) ? a(c, d, e, g) : Vc(c, Od(d, f, 4), e, g, b); |
|
}; |
|
} |
|
function Fd(a, b, c, d, e, f, g, h, i, j) { |
|
function k() { |
|
for (var s = arguments.length, u = s, v = Og(s); u--; ) v[u] = arguments[u]; |
|
if (d && (v = hd(v, d, e)), f && (v = id(v, f, g)), o || q) { |
|
var w = k.placeholder, x = t(v, w); |
|
if (s -= x.length, j > s) { |
|
var y = h ? ac(h) : z, A = vh(j - s, 0), D = o ? x : z, E = o ? z : x, F = o ? v : z, I = o ? z : v; |
|
b |= o ? G : H, b &= ~(o ? H : G), p || (b &= ~(B | C)); |
|
var J = [ a, b, c, F, D, I, E, y, i, A ], K = Fd.apply(z, J); |
|
return ae(a) && Qh(K, J), K.placeholder = w, K; |
|
} |
|
} |
|
var L = m ? c : this, M = n ? L[a] : a; |
|
return h && (v = he(v, h)), l && i < v.length && (v.length = i), this && this !== cc && this instanceof k && (M = r || qd(a)), |
|
M.apply(L, v); |
|
} |
|
var l = b & I, m = b & B, n = b & C, o = b & E, p = b & D, q = b & F, r = n ? z : qd(a); |
|
return k; |
|
} |
|
function Gd(a, b, c) { |
|
var d = a.length; |
|
if (b = +b, d >= b || !th(b)) return ""; |
|
var e = b - d; |
|
return c = null == c ? " " : c + "", qg(c, ph(e / c.length)).slice(0, e); |
|
} |
|
function Hd(a, b, c, d) { |
|
function e() { |
|
for (var b = -1, h = arguments.length, i = -1, j = d.length, k = Og(j + h); ++i < j; ) k[i] = d[i]; |
|
for (;h--; ) k[i++] = arguments[++b]; |
|
var l = this && this !== cc && this instanceof e ? g : a; |
|
return l.apply(f ? c : this, k); |
|
} |
|
var f = b & B, g = qd(a); |
|
return e; |
|
} |
|
function Id(a) { |
|
var b = Sg[a]; |
|
return function(a, c) { |
|
return c = c === z ? 0 : +c || 0, c ? (c = ih(10, c), b(a * c) / c) : b(a); |
|
}; |
|
} |
|
function Jd(a) { |
|
return function(b, c, d, e) { |
|
var f = Od(d); |
|
return null == d && f === uc ? dd(b, c, a) : ed(b, c, f(d, e, 1), a); |
|
}; |
|
} |
|
function Kd(a, b, c, d, e, f, g, h) { |
|
var i = b & C; |
|
if (!i && "function" != typeof a) throw new Xg(R); |
|
var j = d ? d.length : 0; |
|
if (j || (b &= ~(G | H), d = e = z), j -= e ? e.length : 0, b & H) { |
|
var k = d, l = e; |
|
d = e = z; |
|
} |
|
var m = i ? z : Oh(a), n = [ a, b, c, d, e, k, l, f, g, h ]; |
|
if (m && (de(n, m), b = n[1], h = n[9]), n[9] = null == h ? i ? 0 : a.length : vh(h - j, 0) || 0, |
|
b == B) var o = nd(n[0], n[2]); else o = b != G && b != (B | G) || n[4].length ? Fd.apply(z, n) : Hd.apply(z, n); |
|
var p = m ? Nh : Qh; |
|
return p(o, n); |
|
} |
|
function Ld(a, b, c, d, e, f, g) { |
|
var h = -1, i = a.length, j = b.length; |
|
if (i != j && !(e && j > i)) return !1; |
|
for (;++h < i; ) { |
|
var k = a[h], l = b[h], m = d ? d(e ? l : k, e ? k : l, h) : z; |
|
if (m !== z) { |
|
if (m) continue; |
|
return !1; |
|
} |
|
if (e) { |
|
if (!mc(b, function(a) { |
|
return k === a || c(k, a, d, e, f, g); |
|
})) return !1; |
|
} else if (k !== l && !c(k, l, d, e, f, g)) return !1; |
|
} |
|
return !0; |
|
} |
|
function Md(a, b, c) { |
|
switch (c) { |
|
case V: |
|
case W: |
|
return +a == +b; |
|
|
|
case X: |
|
return a.name == b.name && a.message == b.message; |
|
|
|
case $: |
|
return a != +a ? b != +b : a == +b; |
|
|
|
case ab: |
|
case cb: |
|
return a == b + ""; |
|
} |
|
return !1; |
|
} |
|
function Nd(a, b, c, d, e, f, g) { |
|
var h = Ni(a), i = h.length, j = Ni(b), k = j.length; |
|
if (i != k && !e) return !1; |
|
for (var l = i; l--; ) { |
|
var m = h[l]; |
|
if (!(e ? m in b : ah.call(b, m))) return !1; |
|
} |
|
for (var n = e; ++l < i; ) { |
|
m = h[l]; |
|
var o = a[m], p = b[m], q = d ? d(e ? p : o, e ? o : p, m) : z; |
|
if (!(q === z ? c(o, p, d, e, f, g) : q)) return !1; |
|
n || (n = "constructor" == m); |
|
} |
|
if (!n) { |
|
var r = a.constructor, s = b.constructor; |
|
if (r != s && "constructor" in a && "constructor" in b && !("function" == typeof r && r instanceof r && "function" == typeof s && s instanceof s)) return !1; |
|
} |
|
return !0; |
|
} |
|
function Od(a, c, d) { |
|
var e = b.callback || zg; |
|
return e = e === zg ? uc : e, d ? e(a, c, d) : e; |
|
} |
|
function Pd(a) { |
|
for (var b = a.name, c = Hh[b], d = c ? c.length : 0; d--; ) { |
|
var e = c[d], f = e.func; |
|
if (null == f || f == a) return e.name; |
|
} |
|
return b; |
|
} |
|
function Qd(a, c, d) { |
|
var e = b.indexOf || xe; |
|
return e = e === xe ? f : e, a ? e(a, c, d) : e; |
|
} |
|
function Rd(a) { |
|
for (var b = bg(a), c = b.length; c--; ) b[c][2] = ce(b[c][1]); |
|
return b; |
|
} |
|
function Sd(a, b) { |
|
var c = null == a ? z : a[b]; |
|
return Lf(c) ? c : z; |
|
} |
|
function Td(a, b, c) { |
|
for (var d = -1, e = c.length; ++d < e; ) { |
|
var f = c[d], g = f.size; |
|
switch (f.type) { |
|
case "drop": |
|
a += g; |
|
break; |
|
|
|
case "dropRight": |
|
b -= g; |
|
break; |
|
|
|
case "take": |
|
b = wh(b, a + g); |
|
break; |
|
|
|
case "takeRight": |
|
a = vh(a, b - g); |
|
} |
|
} |
|
return { |
|
start: a, |
|
end: b |
|
}; |
|
} |
|
function Ud(a) { |
|
var b = a.length, c = new a.constructor(b); |
|
return b && "string" == typeof a[0] && ah.call(a, "index") && (c.index = a.index, |
|
c.input = a.input), c; |
|
} |
|
function Vd(a) { |
|
var b = a.constructor; |
|
return "function" == typeof b && b instanceof b || (b = Ug), new b(); |
|
} |
|
function Wd(a, b, c) { |
|
var d = a.constructor; |
|
switch (b) { |
|
case eb: |
|
return gd(a); |
|
|
|
case V: |
|
case W: |
|
return new d(+a); |
|
|
|
case fb: |
|
case gb: |
|
case hb: |
|
case ib: |
|
case jb: |
|
case kb: |
|
case lb: |
|
case mb: |
|
case nb: |
|
var e = a.buffer; |
|
return new d(c ? gd(e) : e, a.byteOffset, a.length); |
|
|
|
case $: |
|
case cb: |
|
return new d(a); |
|
|
|
case ab: |
|
var f = new d(a.source, Gb.exec(a)); |
|
f.lastIndex = a.lastIndex; |
|
} |
|
return f; |
|
} |
|
function Xd(a, b, c) { |
|
null == a || _d(b, a) || (b = le(b), a = 1 == b.length ? a : Ic(a, Wc(b, 0, -1)), |
|
b = ze(b)); |
|
var d = null == a ? a : a[b]; |
|
return null == d ? z : d.apply(a, c); |
|
} |
|
function Yd(a) { |
|
return null != a && be(Ph(a)); |
|
} |
|
function Zd(a, b) { |
|
return a = "number" == typeof a || Jb.test(a) ? +a : -1, b = null == b ? Fh : b, |
|
a > -1 && a % 1 == 0 && b > a; |
|
} |
|
function $d(a, b, c) { |
|
if (!If(c)) return !1; |
|
var d = typeof b; |
|
if ("number" == d ? Yd(c) && Zd(b, c.length) : "string" == d && b in c) { |
|
var e = c[b]; |
|
return a === a ? a === e : e !== e; |
|
} |
|
return !1; |
|
} |
|
function _d(a, b) { |
|
var c = typeof a; |
|
if ("string" == c && zb.test(a) || "number" == c) return !0; |
|
if (Ci(a)) return !1; |
|
var d = !yb.test(a); |
|
return d || null != b && a in ke(b); |
|
} |
|
function ae(a) { |
|
var c = Pd(a); |
|
if (!(c in Z.prototype)) return !1; |
|
var d = b[c]; |
|
if (a === d) return !0; |
|
var e = Oh(d); |
|
return !!e && a === e[0]; |
|
} |
|
function be(a) { |
|
return "number" == typeof a && a > -1 && a % 1 == 0 && Fh >= a; |
|
} |
|
function ce(a) { |
|
return a === a && !If(a); |
|
} |
|
function de(a, b) { |
|
var c = a[1], d = b[1], e = c | d, f = I > e, g = d == I && c == E || d == I && c == J && a[7].length <= b[8] || d == (I | J) && c == E; |
|
if (!f && !g) return a; |
|
d & B && (a[2] = b[2], e |= c & B ? 0 : D); |
|
var h = b[3]; |
|
if (h) { |
|
var i = a[3]; |
|
a[3] = i ? hd(i, h, b[4]) : ac(h), a[4] = i ? t(a[3], S) : ac(b[4]); |
|
} |
|
return h = b[5], h && (i = a[5], a[5] = i ? id(i, h, b[6]) : ac(h), a[6] = i ? t(a[5], S) : ac(b[6])), |
|
h = b[7], h && (a[7] = ac(h)), d & I && (a[8] = null == a[8] ? b[8] : wh(a[8], b[8])), |
|
null == a[9] && (a[9] = b[9]), a[0] = b[0], a[1] = e, a; |
|
} |
|
function ee(a, b) { |
|
return a === z ? b : Di(a, b, ee); |
|
} |
|
function fe(a, b) { |
|
a = ke(a); |
|
for (var c = -1, d = b.length, e = {}; ++c < d; ) { |
|
var f = b[c]; |
|
f in a && (e[f] = a[f]); |
|
} |
|
return e; |
|
} |
|
function ge(a, b) { |
|
var c = {}; |
|
return Ec(a, function(a, d, e) { |
|
b(a, d, e) && (c[d] = a); |
|
}), c; |
|
} |
|
function he(a, b) { |
|
for (var c = a.length, d = wh(b.length, c), e = ac(a); d--; ) { |
|
var f = b[d]; |
|
a[d] = Zd(f, c) ? e[f] : z; |
|
} |
|
return a; |
|
} |
|
function ie(a) { |
|
for (var b = ag(a), c = b.length, d = c && a.length, e = !!d && be(d) && (Ci(a) || zf(a)), f = -1, g = []; ++f < c; ) { |
|
var h = b[f]; |
|
(e && Zd(h, d) || ah.call(a, h)) && g.push(h); |
|
} |
|
return g; |
|
} |
|
function je(a) { |
|
return null == a ? [] : Yd(a) ? If(a) ? a : Ug(a) : fg(a); |
|
} |
|
function ke(a) { |
|
return If(a) ? a : Ug(a); |
|
} |
|
function le(a) { |
|
if (Ci(a)) return a; |
|
var b = []; |
|
return h(a).replace(Ab, function(a, c, d, e) { |
|
b.push(d ? e.replace(Eb, "$1") : c || a); |
|
}), b; |
|
} |
|
function me(a) { |
|
return a instanceof Z ? a.clone() : new s(a.__wrapped__, a.__chain__, ac(a.__actions__)); |
|
} |
|
function ne(a, b, c) { |
|
b = (c ? $d(a, b, c) : null == b) ? 1 : vh(rh(b) || 1, 1); |
|
for (var d = 0, e = a ? a.length : 0, f = -1, g = Og(ph(e / b)); e > d; ) g[++f] = Wc(a, d, d += b); |
|
return g; |
|
} |
|
function oe(a) { |
|
for (var b = -1, c = a ? a.length : 0, d = -1, e = []; ++b < c; ) { |
|
var f = a[b]; |
|
f && (e[++d] = f); |
|
} |
|
return e; |
|
} |
|
function pe(a, b, c) { |
|
var d = a ? a.length : 0; |
|
return d ? ((c ? $d(a, b, c) : null == b) && (b = 1), Wc(a, 0 > b ? 0 : b)) : []; |
|
} |
|
function qe(a, b, c) { |
|
var d = a ? a.length : 0; |
|
return d ? ((c ? $d(a, b, c) : null == b) && (b = 1), b = d - (+b || 0), Wc(a, 0, 0 > b ? 0 : b)) : []; |
|
} |
|
function re(a, b, c) { |
|
return a && a.length ? bd(a, Od(b, c, 3), !0, !0) : []; |
|
} |
|
function se(a, b, c) { |
|
return a && a.length ? bd(a, Od(b, c, 3), !0) : []; |
|
} |
|
function te(a, b, c, d) { |
|
var e = a ? a.length : 0; |
|
return e ? (c && "number" != typeof c && $d(a, b, c) && (c = 0, d = e), Ac(a, b, c, d)) : []; |
|
} |
|
function ue(a) { |
|
return a ? a[0] : z; |
|
} |
|
function ve(a, b, c) { |
|
var d = a ? a.length : 0; |
|
return c && $d(a, b, c) && (b = !1), d ? Dc(a, b) : []; |
|
} |
|
function we(a) { |
|
var b = a ? a.length : 0; |
|
return b ? Dc(a, !0) : []; |
|
} |
|
function xe(a, b, c) { |
|
var d = a ? a.length : 0; |
|
if (!d) return -1; |
|
if ("number" == typeof c) c = 0 > c ? vh(d + c, 0) : c; else if (c) { |
|
var e = dd(a, b); |
|
return d > e && (b === b ? b === a[e] : a[e] !== a[e]) ? e : -1; |
|
} |
|
return f(a, b, c || 0); |
|
} |
|
function ye(a) { |
|
return qe(a, 1); |
|
} |
|
function ze(a) { |
|
var b = a ? a.length : 0; |
|
return b ? a[b - 1] : z; |
|
} |
|
function Ae(a, b, c) { |
|
var d = a ? a.length : 0; |
|
if (!d) return -1; |
|
var e = d; |
|
if ("number" == typeof c) e = (0 > c ? vh(d + c, 0) : wh(c || 0, d - 1)) + 1; else if (c) { |
|
e = dd(a, b, !0) - 1; |
|
var f = a[e]; |
|
return (b === b ? b === f : f !== f) ? e : -1; |
|
} |
|
if (b !== b) return q(a, e, !0); |
|
for (;e--; ) if (a[e] === b) return e; |
|
return -1; |
|
} |
|
function Be() { |
|
var a = arguments, b = a[0]; |
|
if (!b || !b.length) return b; |
|
for (var c = 0, d = Qd(), e = a.length; ++c < e; ) for (var f = 0, g = a[c]; (f = d(b, g, f)) > -1; ) mh.call(b, f, 1); |
|
return b; |
|
} |
|
function Ce(a, b, c) { |
|
var d = []; |
|
if (!a || !a.length) return d; |
|
var e = -1, f = [], g = a.length; |
|
for (b = Od(b, c, 3); ++e < g; ) { |
|
var h = a[e]; |
|
b(h, e, a) && (d.push(h), f.push(e)); |
|
} |
|
return Tc(a, f), d; |
|
} |
|
function De(a) { |
|
return pe(a, 1); |
|
} |
|
function Ee(a, b, c) { |
|
var d = a ? a.length : 0; |
|
return d ? (c && "number" != typeof c && $d(a, b, c) && (b = 0, c = d), Wc(a, b, c)) : []; |
|
} |
|
function Fe(a, b, c) { |
|
var d = a ? a.length : 0; |
|
return d ? ((c ? $d(a, b, c) : null == b) && (b = 1), Wc(a, 0, 0 > b ? 0 : b)) : []; |
|
} |
|
function Ge(a, b, c) { |
|
var d = a ? a.length : 0; |
|
return d ? ((c ? $d(a, b, c) : null == b) && (b = 1), b = d - (+b || 0), Wc(a, 0 > b ? 0 : b)) : []; |
|
} |
|
function He(a, b, c) { |
|
return a && a.length ? bd(a, Od(b, c, 3), !1, !0) : []; |
|
} |
|
function Ie(a, b, c) { |
|
return a && a.length ? bd(a, Od(b, c, 3)) : []; |
|
} |
|
function Je(a, b, c, d) { |
|
var e = a ? a.length : 0; |
|
if (!e) return []; |
|
null != b && "boolean" != typeof b && (d = c, c = $d(a, b, d) ? z : b, b = !1); |
|
var g = Od(); |
|
return (null != c || g !== uc) && (c = g(c, d, 3)), b && Qd() == f ? u(a, c) : _c(a, c); |
|
} |
|
function Ke(a) { |
|
if (!a || !a.length) return []; |
|
var b = -1, c = 0; |
|
a = hc(a, function(a) { |
|
return Yd(a) ? (c = vh(a.length, c), !0) : void 0; |
|
}); |
|
for (var d = Og(c); ++b < c; ) d[b] = ic(a, Rc(b)); |
|
return d; |
|
} |
|
function Le(a, b, c) { |
|
var d = a ? a.length : 0; |
|
if (!d) return []; |
|
var e = Ke(a); |
|
return null == b ? e : (b = fd(b, c, 4), ic(e, function(a) { |
|
return kc(a, b, z, !0); |
|
})); |
|
} |
|
function Me() { |
|
for (var a = -1, b = arguments.length; ++a < b; ) { |
|
var c = arguments[a]; |
|
if (Yd(c)) var d = d ? jc(xc(d, c), xc(c, d)) : c; |
|
} |
|
return d ? _c(d) : []; |
|
} |
|
function Ne(a, b) { |
|
var c = -1, d = a ? a.length : 0, e = {}; |
|
for (!d || b || Ci(a[0]) || (b = []); ++c < d; ) { |
|
var f = a[c]; |
|
b ? e[f] = b[c] : f && (e[f[0]] = f[1]); |
|
} |
|
return e; |
|
} |
|
function Oe(a) { |
|
var c = b(a); |
|
return c.__chain__ = !0, c; |
|
} |
|
function Pe(a, b, c) { |
|
return b.call(c, a), a; |
|
} |
|
function Qe(a, b, c) { |
|
return b.call(c, a); |
|
} |
|
function Re() { |
|
return Oe(this); |
|
} |
|
function Se() { |
|
return new s(this.value(), this.__chain__); |
|
} |
|
function Te(a) { |
|
for (var b, d = this; d instanceof c; ) { |
|
var e = me(d); |
|
b ? f.__wrapped__ = e : b = e; |
|
var f = e; |
|
d = d.__wrapped__; |
|
} |
|
return f.__wrapped__ = a, b; |
|
} |
|
function Ue() { |
|
var a = this.__wrapped__, b = function(a) { |
|
return c && c.__dir__ < 0 ? a : a.reverse(); |
|
}; |
|
if (a instanceof Z) { |
|
var c = a; |
|
return this.__actions__.length && (c = new Z(this)), c = c.reverse(), c.__actions__.push({ |
|
func: Qe, |
|
args: [ b ], |
|
thisArg: z |
|
}), new s(c, this.__chain__); |
|
} |
|
return this.thru(b); |
|
} |
|
function Ve() { |
|
return this.value() + ""; |
|
} |
|
function We() { |
|
return cd(this.__wrapped__, this.__actions__); |
|
} |
|
function Xe(a, b, c) { |
|
var d = Ci(a) ? fc : yc; |
|
return c && $d(a, b, c) && (b = z), ("function" != typeof b || c !== z) && (b = Od(b, c, 3)), |
|
d(a, b); |
|
} |
|
function Ye(a, b, c) { |
|
var d = Ci(a) ? hc : Bc; |
|
return b = Od(b, c, 3), d(a, b); |
|
} |
|
function Ze(a, b) { |
|
return di(a, Nc(b)); |
|
} |
|
function $e(a, b, c, d) { |
|
var e = a ? Ph(a) : 0; |
|
return be(e) || (a = fg(a), e = a.length), c = "number" != typeof c || d && $d(b, c, d) ? 0 : 0 > c ? vh(e + c, 0) : c || 0, |
|
"string" == typeof a || !Ci(a) && Qf(a) ? e >= c && a.indexOf(b, c) > -1 : !!e && Qd(a, b, c) > -1; |
|
} |
|
function _e(a, b, c) { |
|
var d = Ci(a) ? ic : Mc; |
|
return b = Od(b, c, 3), d(a, b); |
|
} |
|
function af(a, b) { |
|
return _e(a, Hg(b)); |
|
} |
|
function bf(a, b, c) { |
|
var d = Ci(a) ? hc : Bc; |
|
return b = Od(b, c, 3), d(a, function(a, c, d) { |
|
return !b(a, c, d); |
|
}); |
|
} |
|
function cf(a, b, c) { |
|
if (c ? $d(a, b, c) : null == b) { |
|
a = je(a); |
|
var d = a.length; |
|
return d > 0 ? a[Uc(0, d - 1)] : z; |
|
} |
|
var e = -1, f = Vf(a), d = f.length, g = d - 1; |
|
for (b = wh(0 > b ? 0 : +b || 0, d); ++e < b; ) { |
|
var h = Uc(e, g), i = f[h]; |
|
f[h] = f[e], f[e] = i; |
|
} |
|
return f.length = b, f; |
|
} |
|
function df(a) { |
|
return cf(a, Bh); |
|
} |
|
function ef(a) { |
|
var b = a ? Ph(a) : 0; |
|
return be(b) ? b : Ni(a).length; |
|
} |
|
function ff(a, b, c) { |
|
var d = Ci(a) ? mc : Xc; |
|
return c && $d(a, b, c) && (b = z), ("function" != typeof b || c !== z) && (b = Od(b, c, 3)), |
|
d(a, b); |
|
} |
|
function gf(a, b, c) { |
|
if (null == a) return []; |
|
c && $d(a, b, c) && (b = z); |
|
var d = -1; |
|
b = Od(b, c, 3); |
|
var e = Mc(a, function(a, c, e) { |
|
return { |
|
criteria: b(a, c, e), |
|
index: ++d, |
|
value: a |
|
}; |
|
}); |
|
return Yc(e, k); |
|
} |
|
function hf(a, b, c, d) { |
|
return null == a ? [] : (d && $d(b, c, d) && (c = z), Ci(b) || (b = null == b ? [] : [ b ]), |
|
Ci(c) || (c = null == c ? [] : [ c ]), Zc(a, b, c)); |
|
} |
|
function jf(a, b) { |
|
return Ye(a, Nc(b)); |
|
} |
|
function kf(a, b) { |
|
if ("function" != typeof b) { |
|
if ("function" != typeof a) throw new Xg(R); |
|
var c = a; |
|
a = b, b = c; |
|
} |
|
return a = th(a = +a) ? a : 0, function() { |
|
return --a < 1 ? b.apply(this, arguments) : void 0; |
|
}; |
|
} |
|
function lf(a, b, c) { |
|
return c && $d(a, b, c) && (b = z), b = a && null == b ? a.length : vh(+b || 0, 0), |
|
Kd(a, I, z, z, z, z, b); |
|
} |
|
function mf(a, b) { |
|
var c; |
|
if ("function" != typeof b) { |
|
if ("function" != typeof a) throw new Xg(R); |
|
var d = a; |
|
a = b, b = d; |
|
} |
|
return function() { |
|
return --a > 0 && (c = b.apply(this, arguments)), 1 >= a && (b = z), c; |
|
}; |
|
} |
|
function nf(a, b, c) { |
|
function d() { |
|
n && gh(n), j && gh(j), p = 0, j = n = o = z; |
|
} |
|
function e(b, c) { |
|
c && gh(c), j = n = o = z, b && (p = oi(), k = a.apply(m, i), n || j || (i = m = z)); |
|
} |
|
function f() { |
|
var a = b - (oi() - l); |
|
0 >= a || a > b ? e(o, j) : n = lh(f, a); |
|
} |
|
function g() { |
|
e(r, n); |
|
} |
|
function h() { |
|
if (i = arguments, l = oi(), m = this, o = r && (n || !s), q === !1) var c = s && !n; else { |
|
j || s || (p = l); |
|
var d = q - (l - p), e = 0 >= d || d > q; |
|
e ? (j && (j = gh(j)), p = l, k = a.apply(m, i)) : j || (j = lh(g, d)); |
|
} |
|
return e && n ? n = gh(n) : n || b === q || (n = lh(f, b)), c && (e = !0, k = a.apply(m, i)), |
|
!e || n || j || (i = m = z), k; |
|
} |
|
var i, j, k, l, m, n, o, p = 0, q = !1, r = !0; |
|
if ("function" != typeof a) throw new Xg(R); |
|
if (b = 0 > b ? 0 : +b || 0, c === !0) { |
|
var s = !0; |
|
r = !1; |
|
} else If(c) && (s = !!c.leading, q = "maxWait" in c && vh(+c.maxWait || 0, b), |
|
r = "trailing" in c ? !!c.trailing : r); |
|
return h.cancel = d, h; |
|
} |
|
function of(a, b) { |
|
if ("function" != typeof a || b && "function" != typeof b) throw new Xg(R); |
|
var c = function() { |
|
var d = arguments, e = b ? b.apply(this, d) : d[0], f = c.cache; |
|
if (f.has(e)) return f.get(e); |
|
var g = a.apply(this, d); |
|
return c.cache = f.set(e, g), g; |
|
}; |
|
return c.cache = new of.Cache(), c; |
|
} |
|
function pf(a) { |
|
if ("function" != typeof a) throw new Xg(R); |
|
return function() { |
|
return !a.apply(this, arguments); |
|
}; |
|
} |
|
function qf(a) { |
|
return mf(2, a); |
|
} |
|
function rf(a, b) { |
|
if ("function" != typeof a) throw new Xg(R); |
|
return b = vh(b === z ? a.length - 1 : +b || 0, 0), function() { |
|
for (var c = arguments, d = -1, e = vh(c.length - b, 0), f = Og(e); ++d < e; ) f[d] = c[b + d]; |
|
switch (b) { |
|
case 0: |
|
return a.call(this, f); |
|
|
|
case 1: |
|
return a.call(this, c[0], f); |
|
|
|
case 2: |
|
return a.call(this, c[0], c[1], f); |
|
} |
|
var g = Og(b + 1); |
|
for (d = -1; ++d < b; ) g[d] = c[d]; |
|
return g[b] = f, a.apply(this, g); |
|
}; |
|
} |
|
function sf(a) { |
|
if ("function" != typeof a) throw new Xg(R); |
|
return function(b) { |
|
return a.apply(this, b); |
|
}; |
|
} |
|
function tf(a, b, c) { |
|
var d = !0, e = !0; |
|
if ("function" != typeof a) throw new Xg(R); |
|
return c === !1 ? d = !1 : If(c) && (d = "leading" in c ? !!c.leading : d, e = "trailing" in c ? !!c.trailing : e), |
|
nf(a, b, { |
|
leading: d, |
|
maxWait: +b, |
|
trailing: e |
|
}); |
|
} |
|
function uf(a, b) { |
|
return b = null == b ? Bg : b, Kd(b, G, z, [ a ], []); |
|
} |
|
function vf(a, b, c, d) { |
|
return b && "boolean" != typeof b && $d(a, b, c) ? b = !1 : "function" == typeof b && (d = c, |
|
c = b, b = !1), "function" == typeof c ? vc(a, b, fd(c, d, 1)) : vc(a, b); |
|
} |
|
function wf(a, b, c) { |
|
return "function" == typeof b ? vc(a, !0, fd(b, c, 1)) : vc(a, !0); |
|
} |
|
function xf(a, b) { |
|
return a > b; |
|
} |
|
function yf(a, b) { |
|
return a >= b; |
|
} |
|
function zf(a) { |
|
return r(a) && Yd(a) && ah.call(a, "callee") && !jh.call(a, "callee"); |
|
} |
|
function Af(a) { |
|
return a === !0 || a === !1 || r(a) && ch.call(a) == V; |
|
} |
|
function Bf(a) { |
|
return r(a) && ch.call(a) == W; |
|
} |
|
function Cf(a) { |
|
return !!a && 1 === a.nodeType && r(a) && !Of(a); |
|
} |
|
function Df(a) { |
|
return null == a ? !0 : Yd(a) && (Ci(a) || Qf(a) || zf(a) || r(a) && Hf(a.splice)) ? !a.length : !Ni(a).length; |
|
} |
|
function Ef(a, b, c, d) { |
|
c = "function" == typeof c ? fd(c, d, 3) : z; |
|
var e = c ? c(a, b) : z; |
|
return e === z ? Jc(a, b, c) : !!e; |
|
} |
|
function Ff(a) { |
|
return r(a) && "string" == typeof a.message && ch.call(a) == X; |
|
} |
|
function Gf(a) { |
|
return "number" == typeof a && th(a); |
|
} |
|
function Hf(a) { |
|
return If(a) && ch.call(a) == Y; |
|
} |
|
function If(a) { |
|
var b = typeof a; |
|
return !!a && ("object" == b || "function" == b); |
|
} |
|
function Jf(a, b, c, d) { |
|
return c = "function" == typeof c ? fd(c, d, 3) : z, Lc(a, Rd(b), c); |
|
} |
|
function Kf(a) { |
|
return Nf(a) && a != +a; |
|
} |
|
function Lf(a) { |
|
return null == a ? !1 : Hf(a) ? eh.test(_g.call(a)) : r(a) && Ib.test(a); |
|
} |
|
function Mf(a) { |
|
return null === a; |
|
} |
|
function Nf(a) { |
|
return "number" == typeof a || r(a) && ch.call(a) == $; |
|
} |
|
function Of(a) { |
|
var b; |
|
if (!r(a) || ch.call(a) != _ || zf(a) || !ah.call(a, "constructor") && (b = a.constructor, |
|
"function" == typeof b && !(b instanceof b))) return !1; |
|
var c; |
|
return Ec(a, function(a, b) { |
|
c = b; |
|
}), c === z || ah.call(a, c); |
|
} |
|
function Pf(a) { |
|
return If(a) && ch.call(a) == ab; |
|
} |
|
function Qf(a) { |
|
return "string" == typeof a || r(a) && ch.call(a) == cb; |
|
} |
|
function Rf(a) { |
|
return r(a) && be(a.length) && !!Qb[ch.call(a)]; |
|
} |
|
function Sf(a) { |
|
return a === z; |
|
} |
|
function Tf(a, b) { |
|
return b > a; |
|
} |
|
function Uf(a, b) { |
|
return b >= a; |
|
} |
|
function Vf(a) { |
|
var b = a ? Ph(a) : 0; |
|
return be(b) ? b ? ac(a) : [] : fg(a); |
|
} |
|
function Wf(a) { |
|
return tc(a, ag(a)); |
|
} |
|
function Xf(a, b, c) { |
|
var d = Ih(a); |
|
return c && $d(a, b, c) && (b = z), b ? rc(d, b) : d; |
|
} |
|
function Yf(a) { |
|
return Hc(a, ag(a)); |
|
} |
|
function Zf(a, b, c) { |
|
var d = null == a ? z : Ic(a, le(b), b + ""); |
|
return d === z ? c : d; |
|
} |
|
function $f(a, b) { |
|
if (null == a) return !1; |
|
var c = ah.call(a, b); |
|
if (!c && !_d(b)) { |
|
if (b = le(b), a = 1 == b.length ? a : Ic(a, Wc(b, 0, -1)), null == a) return !1; |
|
b = ze(b), c = ah.call(a, b); |
|
} |
|
return c || be(a.length) && Zd(b, a.length) && (Ci(a) || zf(a)); |
|
} |
|
function _f(a, b, c) { |
|
c && $d(a, b, c) && (b = z); |
|
for (var d = -1, e = Ni(a), f = e.length, g = {}; ++d < f; ) { |
|
var h = e[d], i = a[h]; |
|
b ? ah.call(g, i) ? g[i].push(h) : g[i] = [ h ] : g[i] = h; |
|
} |
|
return g; |
|
} |
|
function ag(a) { |
|
if (null == a) return []; |
|
If(a) || (a = Ug(a)); |
|
var b = a.length; |
|
b = b && be(b) && (Ci(a) || zf(a)) && b || 0; |
|
for (var c = a.constructor, d = -1, e = "function" == typeof c && c.prototype === a, f = Og(b), g = b > 0; ++d < b; ) f[d] = d + ""; |
|
for (var h in a) g && Zd(h, b) || "constructor" == h && (e || !ah.call(a, h)) || f.push(h); |
|
return f; |
|
} |
|
function bg(a) { |
|
a = ke(a); |
|
for (var b = -1, c = Ni(a), d = c.length, e = Og(d); ++b < d; ) { |
|
var f = c[b]; |
|
e[b] = [ f, a[f] ]; |
|
} |
|
return e; |
|
} |
|
function cg(a, b, c) { |
|
var d = null == a ? z : a[b]; |
|
return d === z && (null == a || _d(b, a) || (b = le(b), a = 1 == b.length ? a : Ic(a, Wc(b, 0, -1)), |
|
d = null == a ? z : a[ze(b)]), d = d === z ? c : d), Hf(d) ? d.call(a) : d; |
|
} |
|
function dg(a, b, c) { |
|
if (null == a) return a; |
|
var d = b + ""; |
|
b = null != a[d] || _d(b, a) ? [ d ] : le(b); |
|
for (var e = -1, f = b.length, g = f - 1, h = a; null != h && ++e < f; ) { |
|
var i = b[e]; |
|
If(h) && (e == g ? h[i] = c : null == h[i] && (h[i] = Zd(b[e + 1]) ? [] : {})), |
|
h = h[i]; |
|
} |
|
return a; |
|
} |
|
function eg(a, b, c, d) { |
|
var e = Ci(a) || Rf(a); |
|
if (b = Od(b, d, 4), null == c) if (e || If(a)) { |
|
var f = a.constructor; |
|
c = e ? Ci(a) ? new f() : [] : Ih(Hf(f) ? f.prototype : z); |
|
} else c = {}; |
|
return (e ? bc : Fc)(a, function(a, d, e) { |
|
return b(c, a, d, e); |
|
}), c; |
|
} |
|
function fg(a) { |
|
return ad(a, Ni(a)); |
|
} |
|
function gg(a) { |
|
return ad(a, ag(a)); |
|
} |
|
function hg(a, b, c) { |
|
return b = +b || 0, c === z ? (c = b, b = 0) : c = +c || 0, a >= wh(b, c) && a < vh(b, c); |
|
} |
|
function ig(a, b, c) { |
|
c && $d(a, b, c) && (b = c = z); |
|
var d = null == a, e = null == b; |
|
if (null == c && (e && "boolean" == typeof a ? (c = a, a = 1) : "boolean" == typeof b && (c = b, |
|
e = !0)), d && e && (b = 1, e = !1), a = +a || 0, e ? (b = a, a = 0) : b = +b || 0, |
|
c || a % 1 || b % 1) { |
|
var f = zh(); |
|
return wh(a + f * (b - a + hh("1e-" + ((f + "").length - 1))), b); |
|
} |
|
return Uc(a, b); |
|
} |
|
function jg(a) { |
|
return a = h(a), a && a.charAt(0).toUpperCase() + a.slice(1); |
|
} |
|
function kg(a) { |
|
return a = h(a), a && a.replace(Kb, m).replace(Db, ""); |
|
} |
|
function lg(a, b, c) { |
|
a = h(a), b += ""; |
|
var d = a.length; |
|
return c = c === z ? d : wh(0 > c ? 0 : +c || 0, d), c -= b.length, c >= 0 && a.indexOf(b, c) == c; |
|
} |
|
function mg(a) { |
|
return a = h(a), a && ub.test(a) ? a.replace(sb, n) : a; |
|
} |
|
function ng(a) { |
|
return a = h(a), a && Cb.test(a) ? a.replace(Bb, o) : a || "(?:)"; |
|
} |
|
function og(a, b, c) { |
|
a = h(a), b = +b; |
|
var d = a.length; |
|
if (d >= b || !th(b)) return a; |
|
var e = (b - d) / 2, f = rh(e), g = ph(e); |
|
return c = Gd("", g, c), c.slice(0, f) + a + c; |
|
} |
|
function pg(a, b, c) { |
|
return (c ? $d(a, b, c) : null == b) ? b = 0 : b && (b = +b), a = tg(a), yh(a, b || (Hb.test(a) ? 16 : 10)); |
|
} |
|
function qg(a, b) { |
|
var c = ""; |
|
if (a = h(a), b = +b, 1 > b || !a || !th(b)) return c; |
|
do b % 2 && (c += a), b = rh(b / 2), a += a; while (b); |
|
return c; |
|
} |
|
function rg(a, b, c) { |
|
return a = h(a), c = null == c ? 0 : wh(0 > c ? 0 : +c || 0, a.length), a.lastIndexOf(b, c) == c; |
|
} |
|
function sg(a, c, d) { |
|
var e = b.templateSettings; |
|
d && $d(a, c, d) && (c = d = z), a = h(a), c = qc(rc({}, d || c), e, pc); |
|
var f, g, i = qc(rc({}, c.imports), e.imports, pc), j = Ni(i), k = ad(i, j), l = 0, m = c.interpolate || Lb, n = "__p += '", o = Vg((c.escape || Lb).source + "|" + m.source + "|" + (m === xb ? Fb : Lb).source + "|" + (c.evaluate || Lb).source + "|$", "g"), q = "//# sourceURL=" + ("sourceURL" in c ? c.sourceURL : "lodash.templateSources[" + ++Pb + "]") + "\n"; |
|
a.replace(o, function(b, c, d, e, h, i) { |
|
return d || (d = e), n += a.slice(l, i).replace(Mb, p), c && (f = !0, n += "' +\n__e(" + c + ") +\n'"), |
|
h && (g = !0, n += "';\n" + h + ";\n__p += '"), d && (n += "' +\n((__t = (" + d + ")) == null ? '' : __t) +\n'"), |
|
l = i + b.length, b; |
|
}), n += "';\n"; |
|
var r = c.variable; |
|
r || (n = "with (obj) {\n" + n + "\n}\n"), n = (g ? n.replace(ob, "") : n).replace(pb, "$1").replace(qb, "$1;"), |
|
n = "function(" + (r || "obj") + ") {\n" + (r ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (f ? ", __e = _.escape" : "") + (g ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + n + "return __p\n}"; |
|
var s = Yi(function() { |
|
return Rg(j, q + "return " + n).apply(z, k); |
|
}); |
|
if (s.source = n, Ff(s)) throw s; |
|
return s; |
|
} |
|
function tg(a, b, c) { |
|
var d = a; |
|
return (a = h(a)) ? (c ? $d(d, b, c) : null == b) ? a.slice(v(a), w(a) + 1) : (b += "", |
|
a.slice(i(a, b), j(a, b) + 1)) : a; |
|
} |
|
function ug(a, b, c) { |
|
var d = a; |
|
return a = h(a), a ? a.slice((c ? $d(d, b, c) : null == b) ? v(a) : i(a, b + "")) : a; |
|
} |
|
function vg(a, b, c) { |
|
var d = a; |
|
return a = h(a), a ? (c ? $d(d, b, c) : null == b) ? a.slice(0, w(a) + 1) : a.slice(0, j(a, b + "") + 1) : a; |
|
} |
|
function wg(a, b, c) { |
|
c && $d(a, b, c) && (b = z); |
|
var d = K, e = L; |
|
if (null != b) if (If(b)) { |
|
var f = "separator" in b ? b.separator : f; |
|
d = "length" in b ? +b.length || 0 : d, e = "omission" in b ? h(b.omission) : e; |
|
} else d = +b || 0; |
|
if (a = h(a), d >= a.length) return a; |
|
var g = d - e.length; |
|
if (1 > g) return e; |
|
var i = a.slice(0, g); |
|
if (null == f) return i + e; |
|
if (Pf(f)) { |
|
if (a.slice(g).search(f)) { |
|
var j, k, l = a.slice(0, g); |
|
for (f.global || (f = Vg(f.source, (Gb.exec(f) || "") + "g")), f.lastIndex = 0; j = f.exec(l); ) k = j.index; |
|
i = i.slice(0, null == k ? g : k); |
|
} |
|
} else if (a.indexOf(f, g) != g) { |
|
var m = i.lastIndexOf(f); |
|
m > -1 && (i = i.slice(0, m)); |
|
} |
|
return i + e; |
|
} |
|
function xg(a) { |
|
return a = h(a), a && tb.test(a) ? a.replace(rb, x) : a; |
|
} |
|
function yg(a, b, c) { |
|
return c && $d(a, b, c) && (b = z), a = h(a), a.match(b || Nb) || []; |
|
} |
|
function zg(a, b, c) { |
|
return c && $d(a, b, c) && (b = z), r(a) ? Cg(a) : uc(a, b); |
|
} |
|
function Ag(a) { |
|
return function() { |
|
return a; |
|
}; |
|
} |
|
function Bg(a) { |
|
return a; |
|
} |
|
function Cg(a) { |
|
return Nc(vc(a, !0)); |
|
} |
|
function Dg(a, b) { |
|
return Oc(a, vc(b, !0)); |
|
} |
|
function Eg(a, b, c) { |
|
if (null == c) { |
|
var d = If(b), e = d ? Ni(b) : z, f = e && e.length ? Hc(b, e) : z; |
|
(f ? f.length : d) || (f = !1, c = b, b = a, a = this); |
|
} |
|
f || (f = Hc(b, Ni(b))); |
|
var g = !0, h = -1, i = Hf(a), j = f.length; |
|
c === !1 ? g = !1 : If(c) && "chain" in c && (g = c.chain); |
|
for (;++h < j; ) { |
|
var k = f[h], l = b[k]; |
|
a[k] = l, i && (a.prototype[k] = function(b) { |
|
return function() { |
|
var c = this.__chain__; |
|
if (g || c) { |
|
var d = a(this.__wrapped__), e = d.__actions__ = ac(this.__actions__); |
|
return e.push({ |
|
func: b, |
|
args: arguments, |
|
thisArg: a |
|
}), d.__chain__ = c, d; |
|
} |
|
return b.apply(a, jc([ this.value() ], arguments)); |
|
}; |
|
}(l)); |
|
} |
|
return a; |
|
} |
|
function Fg() { |
|
return cc._ = dh, this; |
|
} |
|
function Gg() {} |
|
function Hg(a) { |
|
return _d(a) ? Rc(a) : Sc(a); |
|
} |
|
function Ig(a) { |
|
return function(b) { |
|
return Ic(a, le(b), b + ""); |
|
}; |
|
} |
|
function Jg(a, b, c) { |
|
c && $d(a, b, c) && (b = c = z), a = +a || 0, c = null == c ? 1 : +c || 0, null == b ? (b = a, |
|
a = 0) : b = +b || 0; |
|
for (var d = -1, e = vh(ph((b - a) / (c || 1)), 0), f = Og(e); ++d < e; ) f[d] = a, |
|
a += c; |
|
return f; |
|
} |
|
function Kg(a, b, c) { |
|
if (a = rh(a), 1 > a || !th(a)) return []; |
|
var d = -1, e = Og(wh(a, Ch)); |
|
for (b = fd(b, c, 1); ++d < a; ) Ch > d ? e[d] = b(d) : b(d); |
|
return e; |
|
} |
|
function Lg(a) { |
|
var b = ++bh; |
|
return h(a) + b; |
|
} |
|
function Mg(a, b) { |
|
return (+a || 0) + (+b || 0); |
|
} |
|
function Ng(a, b, c) { |
|
return c && $d(a, b, c) && (b = z), b = Od(b, c, 3), 1 == b.length ? nc(Ci(a) ? a : je(a), b) : $c(a, b); |
|
} |
|
a = a ? dc.defaults(cc.Object(), a, dc.pick(cc, Ob)) : cc; |
|
{ |
|
var Og = a.Array, Pg = a.Date, Qg = a.Error, Rg = a.Function, Sg = a.Math, Tg = a.Number, Ug = a.Object, Vg = a.RegExp, Wg = a.String, Xg = a.TypeError, Yg = Og.prototype, Zg = Ug.prototype, $g = Wg.prototype, _g = Rg.prototype.toString, ah = Zg.hasOwnProperty, bh = 0, ch = Zg.toString, dh = cc._, eh = Vg("^" + _g.call(ah).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"), fh = a.ArrayBuffer, gh = a.clearTimeout, hh = a.parseFloat, ih = Sg.pow, jh = Zg.propertyIsEnumerable, kh = Sd(a, "Set"), lh = a.setTimeout, mh = Yg.splice, nh = a.Uint8Array, oh = Sd(a, "WeakMap"), ph = Sg.ceil, qh = Sd(Ug, "create"), rh = Sg.floor, sh = Sd(Og, "isArray"), th = a.isFinite, uh = Sd(Ug, "keys"), vh = Sg.max, wh = Sg.min, xh = Sd(Pg, "now"), yh = a.parseInt, zh = Sg.random, Ah = Tg.NEGATIVE_INFINITY, Bh = Tg.POSITIVE_INFINITY, Ch = 4294967295, Dh = Ch - 1, Eh = Ch >>> 1, Fh = 9007199254740991, Gh = oh && new oh(), Hh = {}; |
|
b.support = {}; |
|
} |
|
b.templateSettings = { |
|
escape: vb, |
|
evaluate: wb, |
|
interpolate: xb, |
|
variable: "", |
|
imports: { |
|
_: b |
|
} |
|
}; |
|
var Ih = function() { |
|
function a() {} |
|
return function(b) { |
|
if (If(b)) { |
|
a.prototype = b; |
|
var c = new a(); |
|
a.prototype = z; |
|
} |
|
return c || {}; |
|
}; |
|
}(), Jh = ld(Fc), Kh = ld(Gc, !0), Lh = md(), Mh = md(!0), Nh = Gh ? function(a, b) { |
|
return Gh.set(a, b), a; |
|
} : Bg, Oh = Gh ? function(a) { |
|
return Gh.get(a); |
|
} : Gg, Ph = Rc("length"), Qh = function() { |
|
var a = 0, b = 0; |
|
return function(c, d) { |
|
var e = oi(), f = N - (e - b); |
|
if (b = e, f > 0) { |
|
if (++a >= M) return c; |
|
} else a = 0; |
|
return Nh(c, d); |
|
}; |
|
}(), Rh = rf(function(a, b) { |
|
return r(a) && Yd(a) ? xc(a, Dc(b, !1, !0)) : []; |
|
}), Sh = vd(), Th = vd(!0), Uh = rf(function(a) { |
|
for (var b = a.length, c = b, d = Og(l), e = Qd(), g = e == f, h = []; c--; ) { |
|
var i = a[c] = Yd(i = a[c]) ? i : []; |
|
d[c] = g && i.length >= 120 ? od(c && i) : null; |
|
} |
|
var j = a[0], k = -1, l = j ? j.length : 0, m = d[0]; |
|
a: for (;++k < l; ) if (i = j[k], (m ? Zb(m, i) : e(h, i, 0)) < 0) { |
|
for (var c = b; --c; ) { |
|
var n = d[c]; |
|
if ((n ? Zb(n, i) : e(a[c], i, 0)) < 0) continue a; |
|
} |
|
m && m.push(i), h.push(i); |
|
} |
|
return h; |
|
}), Vh = rf(function(a, b) { |
|
b = Dc(b); |
|
var c = sc(a, b); |
|
return Tc(a, b.sort(d)), c; |
|
}), Wh = Jd(), Xh = Jd(!0), Yh = rf(function(a) { |
|
return _c(Dc(a, !1, !0)); |
|
}), Zh = rf(function(a, b) { |
|
return Yd(a) ? xc(a, b) : []; |
|
}), $h = rf(Ke), _h = rf(function(a) { |
|
var b = a.length, c = b > 2 ? a[b - 2] : z, d = b > 1 ? a[b - 1] : z; |
|
return b > 2 && "function" == typeof c ? b -= 2 : (c = b > 1 && "function" == typeof d ? (--b, |
|
d) : z, d = z), a.length = b, Le(a, c, d); |
|
}), ai = rf(function(a) { |
|
return a = Dc(a), this.thru(function(b) { |
|
return _b(Ci(b) ? b : [ ke(b) ], a); |
|
}); |
|
}), bi = rf(function(a, b) { |
|
return sc(a, Dc(b)); |
|
}), ci = jd(function(a, b, c) { |
|
ah.call(a, c) ? ++a[c] : a[c] = 1; |
|
}), di = ud(Jh), ei = ud(Kh, !0), fi = yd(bc, Jh), gi = yd(ec, Kh), hi = jd(function(a, b, c) { |
|
ah.call(a, c) ? a[c].push(b) : a[c] = [ b ]; |
|
}), ii = jd(function(a, b, c) { |
|
a[c] = b; |
|
}), ji = rf(function(a, b, c) { |
|
var d = -1, e = "function" == typeof b, f = _d(b), g = Yd(a) ? Og(a.length) : []; |
|
return Jh(a, function(a) { |
|
var h = e ? b : f && null != a ? a[b] : z; |
|
g[++d] = h ? h.apply(a, c) : Xd(a, b, c); |
|
}), g; |
|
}), ki = jd(function(a, b, c) { |
|
a[c ? 0 : 1].push(b); |
|
}, function() { |
|
return [ [], [] ]; |
|
}), li = Ed(kc, Jh), mi = Ed(lc, Kh), ni = rf(function(a, b) { |
|
if (null == a) return []; |
|
var c = b[2]; |
|
return c && $d(b[0], b[1], c) && (b.length = 1), Zc(a, Dc(b), []); |
|
}), oi = xh || function() { |
|
return new Pg().getTime(); |
|
}, pi = rf(function(a, b, c) { |
|
var d = B; |
|
if (c.length) { |
|
var e = t(c, pi.placeholder); |
|
d |= G; |
|
} |
|
return Kd(a, d, b, c, e); |
|
}), qi = rf(function(a, b) { |
|
b = b.length ? Dc(b) : Yf(a); |
|
for (var c = -1, d = b.length; ++c < d; ) { |
|
var e = b[c]; |
|
a[e] = Kd(a[e], B, a); |
|
} |
|
return a; |
|
}), ri = rf(function(a, b, c) { |
|
var d = B | C; |
|
if (c.length) { |
|
var e = t(c, ri.placeholder); |
|
d |= G; |
|
} |
|
return Kd(b, d, a, c, e); |
|
}), si = rd(E), ti = rd(F), ui = rf(function(a, b) { |
|
return wc(a, 1, b); |
|
}), vi = rf(function(a, b, c) { |
|
return wc(a, b, c); |
|
}), wi = xd(), xi = xd(!0), yi = rf(function(a, b) { |
|
if (b = Dc(b), "function" != typeof a || !fc(b, g)) throw new Xg(R); |
|
var c = b.length; |
|
return rf(function(d) { |
|
for (var e = wh(d.length, c); e--; ) d[e] = b[e](d[e]); |
|
return a.apply(this, d); |
|
}); |
|
}), zi = Dd(G), Ai = Dd(H), Bi = rf(function(a, b) { |
|
return Kd(a, J, z, z, z, Dc(b)); |
|
}), Ci = sh || function(a) { |
|
return r(a) && be(a.length) && ch.call(a) == U; |
|
}, Di = kd(Pc), Ei = kd(function(a, b, c) { |
|
return c ? qc(a, b, c) : rc(a, b); |
|
}), Fi = sd(Ei, oc), Gi = sd(Di, ee), Hi = wd(Fc), Ii = wd(Gc), Ji = zd(Lh), Ki = zd(Mh), Li = Ad(Fc), Mi = Ad(Gc), Ni = uh ? function(a) { |
|
var b = null == a ? z : a.constructor; |
|
return "function" == typeof b && b.prototype === a || "function" != typeof a && Yd(a) ? ie(a) : If(a) ? uh(a) : []; |
|
} : ie, Oi = Bd(!0), Pi = Bd(), Qi = rf(function(a, b) { |
|
if (null == a) return {}; |
|
if ("function" != typeof b[0]) { |
|
var b = ic(Dc(b), Wg); |
|
return fe(a, xc(ag(a), b)); |
|
} |
|
var c = fd(b[0], b[1], 3); |
|
return ge(a, function(a, b, d) { |
|
return !c(a, b, d); |
|
}); |
|
}), Ri = rf(function(a, b) { |
|
return null == a ? {} : "function" == typeof b[0] ? ge(a, fd(b[0], b[1], 3)) : fe(a, Dc(b)); |
|
}), Si = pd(function(a, b, c) { |
|
return b = b.toLowerCase(), a + (c ? b.charAt(0).toUpperCase() + b.slice(1) : b); |
|
}), Ti = pd(function(a, b, c) { |
|
return a + (c ? "-" : "") + b.toLowerCase(); |
|
}), Ui = Cd(), Vi = Cd(!0), Wi = pd(function(a, b, c) { |
|
return a + (c ? "_" : "") + b.toLowerCase(); |
|
}), Xi = pd(function(a, b, c) { |
|
return a + (c ? " " : "") + (b.charAt(0).toUpperCase() + b.slice(1)); |
|
}), Yi = rf(function(a, b) { |
|
try { |
|
return a.apply(z, b); |
|
} catch (c) { |
|
return Ff(c) ? c : new Qg(c); |
|
} |
|
}), Zi = rf(function(a, b) { |
|
return function(c) { |
|
return Xd(c, a, b); |
|
}; |
|
}), $i = rf(function(a, b) { |
|
return function(c) { |
|
return Xd(a, c, b); |
|
}; |
|
}), _i = Id("ceil"), aj = Id("floor"), bj = td(xf, Ah), cj = td(Tf, Bh), dj = Id("round"); |
|
return b.prototype = c.prototype, s.prototype = Ih(c.prototype), s.prototype.constructor = s, |
|
Z.prototype = Ih(c.prototype), Z.prototype.constructor = Z, Tb.prototype["delete"] = Ub, |
|
Tb.prototype.get = Vb, Tb.prototype.has = Wb, Tb.prototype.set = Xb, Yb.prototype.push = $b, |
|
of.Cache = Tb, b.after = kf, b.ary = lf, b.assign = Ei, b.at = bi, b.before = mf, |
|
b.bind = pi, b.bindAll = qi, b.bindKey = ri, b.callback = zg, b.chain = Oe, b.chunk = ne, |
|
b.compact = oe, b.constant = Ag, b.countBy = ci, b.create = Xf, b.curry = si, b.curryRight = ti, |
|
b.debounce = nf, b.defaults = Fi, b.defaultsDeep = Gi, b.defer = ui, b.delay = vi, |
|
b.difference = Rh, b.drop = pe, b.dropRight = qe, b.dropRightWhile = re, b.dropWhile = se, |
|
b.fill = te, b.filter = Ye, b.flatten = ve, b.flattenDeep = we, b.flow = wi, b.flowRight = xi, |
|
b.forEach = fi, b.forEachRight = gi, b.forIn = Ji, b.forInRight = Ki, b.forOwn = Li, |
|
b.forOwnRight = Mi, b.functions = Yf, b.groupBy = hi, b.indexBy = ii, b.initial = ye, |
|
b.intersection = Uh, b.invert = _f, b.invoke = ji, b.keys = Ni, b.keysIn = ag, b.map = _e, |
|
b.mapKeys = Oi, b.mapValues = Pi, b.matches = Cg, b.matchesProperty = Dg, b.memoize = of, |
|
b.merge = Di, b.method = Zi, b.methodOf = $i, b.mixin = Eg, b.modArgs = yi, b.negate = pf, |
|
b.omit = Qi, b.once = qf, b.pairs = bg, b.partial = zi, b.partialRight = Ai, b.partition = ki, |
|
b.pick = Ri, b.pluck = af, b.property = Hg, b.propertyOf = Ig, b.pull = Be, b.pullAt = Vh, |
|
b.range = Jg, b.rearg = Bi, b.reject = bf, b.remove = Ce, b.rest = De, b.restParam = rf, |
|
b.set = dg, b.shuffle = df, b.slice = Ee, b.sortBy = gf, b.sortByAll = ni, b.sortByOrder = hf, |
|
b.spread = sf, b.take = Fe, b.takeRight = Ge, b.takeRightWhile = He, b.takeWhile = Ie, |
|
b.tap = Pe, b.throttle = tf, b.thru = Qe, b.times = Kg, b.toArray = Vf, b.toPlainObject = Wf, |
|
b.transform = eg, b.union = Yh, b.uniq = Je, b.unzip = Ke, b.unzipWith = Le, b.values = fg, |
|
b.valuesIn = gg, b.where = jf, b.without = Zh, b.wrap = uf, b.xor = Me, b.zip = $h, |
|
b.zipObject = Ne, b.zipWith = _h, b.backflow = xi, b.collect = _e, b.compose = xi, |
|
b.each = fi, b.eachRight = gi, b.extend = Ei, b.iteratee = zg, b.methods = Yf, b.object = Ne, |
|
b.select = Ye, b.tail = De, b.unique = Je, Eg(b, b), b.add = Mg, b.attempt = Yi, |
|
b.camelCase = Si, b.capitalize = jg, b.ceil = _i, b.clone = vf, b.cloneDeep = wf, |
|
b.deburr = kg, b.endsWith = lg, b.escape = mg, b.escapeRegExp = ng, b.every = Xe, |
|
b.find = di, b.findIndex = Sh, b.findKey = Hi, b.findLast = ei, b.findLastIndex = Th, |
|
b.findLastKey = Ii, b.findWhere = Ze, b.first = ue, b.floor = aj, b.get = Zf, b.gt = xf, |
|
b.gte = yf, b.has = $f, b.identity = Bg, b.includes = $e, b.indexOf = xe, b.inRange = hg, |
|
b.isArguments = zf, b.isArray = Ci, b.isBoolean = Af, b.isDate = Bf, b.isElement = Cf, |
|
b.isEmpty = Df, b.isEqual = Ef, b.isError = Ff, b.isFinite = Gf, b.isFunction = Hf, |
|
b.isMatch = Jf, b.isNaN = Kf, b.isNative = Lf, b.isNull = Mf, b.isNumber = Nf, b.isObject = If, |
|
b.isPlainObject = Of, b.isRegExp = Pf, b.isString = Qf, b.isTypedArray = Rf, b.isUndefined = Sf, |
|
b.kebabCase = Ti, b.last = ze, b.lastIndexOf = Ae, b.lt = Tf, b.lte = Uf, b.max = bj, |
|
b.min = cj, b.noConflict = Fg, b.noop = Gg, b.now = oi, b.pad = og, b.padLeft = Ui, |
|
b.padRight = Vi, b.parseInt = pg, b.random = ig, b.reduce = li, b.reduceRight = mi, |
|
b.repeat = qg, b.result = cg, b.round = dj, b.runInContext = y, b.size = ef, b.snakeCase = Wi, |
|
b.some = ff, b.sortedIndex = Wh, b.sortedLastIndex = Xh, b.startCase = Xi, b.startsWith = rg, |
|
b.sum = Ng, b.template = sg, b.trim = tg, b.trimLeft = ug, b.trimRight = vg, b.trunc = wg, |
|
b.unescape = xg, b.uniqueId = Lg, b.words = yg, b.all = Xe, b.any = ff, b.contains = $e, |
|
b.eq = Ef, b.detect = di, b.foldl = li, b.foldr = mi, b.head = ue, b.include = $e, |
|
b.inject = li, Eg(b, function() { |
|
var a = {}; |
|
return Fc(b, function(c, d) { |
|
b.prototype[d] || (a[d] = c); |
|
}), a; |
|
}(), !1), b.sample = cf, b.prototype.sample = function(a) { |
|
return this.__chain__ || null != a ? this.thru(function(b) { |
|
return cf(b, a); |
|
}) : cf(this.value()); |
|
}, b.VERSION = A, bc([ "bind", "bindKey", "curry", "curryRight", "partial", "partialRight" ], function(a) { |
|
b[a].placeholder = b; |
|
}), bc([ "drop", "take" ], function(a, b) { |
|
Z.prototype[a] = function(c) { |
|
var d = this.__filtered__; |
|
if (d && !b) return new Z(this); |
|
c = null == c ? 1 : vh(rh(c) || 0, 0); |
|
var e = this.clone(); |
|
return d ? e.__takeCount__ = wh(e.__takeCount__, c) : e.__views__.push({ |
|
size: c, |
|
type: a + (e.__dir__ < 0 ? "Right" : "") |
|
}), e; |
|
}, Z.prototype[a + "Right"] = function(b) { |
|
return this.reverse()[a](b).reverse(); |
|
}; |
|
}), bc([ "filter", "map", "takeWhile" ], function(a, b) { |
|
var c = b + 1, d = c != Q; |
|
Z.prototype[a] = function(a, b) { |
|
var e = this.clone(); |
|
return e.__iteratees__.push({ |
|
iteratee: Od(a, b, 1), |
|
type: c |
|
}), e.__filtered__ = e.__filtered__ || d, e; |
|
}; |
|
}), bc([ "first", "last" ], function(a, b) { |
|
var c = "take" + (b ? "Right" : ""); |
|
Z.prototype[a] = function() { |
|
return this[c](1).value()[0]; |
|
}; |
|
}), bc([ "initial", "rest" ], function(a, b) { |
|
var c = "drop" + (b ? "" : "Right"); |
|
Z.prototype[a] = function() { |
|
return this.__filtered__ ? new Z(this) : this[c](1); |
|
}; |
|
}), bc([ "pluck", "where" ], function(a, b) { |
|
var c = b ? "filter" : "map", d = b ? Nc : Hg; |
|
Z.prototype[a] = function(a) { |
|
return this[c](d(a)); |
|
}; |
|
}), Z.prototype.compact = function() { |
|
return this.filter(Bg); |
|
}, Z.prototype.reject = function(a, b) { |
|
return a = Od(a, b, 1), this.filter(function(b) { |
|
return !a(b); |
|
}); |
|
}, Z.prototype.slice = function(a, b) { |
|
a = null == a ? 0 : +a || 0; |
|
var c = this; |
|
return c.__filtered__ && (a > 0 || 0 > b) ? new Z(c) : (0 > a ? c = c.takeRight(-a) : a && (c = c.drop(a)), |
|
b !== z && (b = +b || 0, c = 0 > b ? c.dropRight(-b) : c.take(b - a)), c); |
|
}, Z.prototype.takeRightWhile = function(a, b) { |
|
return this.reverse().takeWhile(a, b).reverse(); |
|
}, Z.prototype.toArray = function() { |
|
return this.take(Bh); |
|
}, Fc(Z.prototype, function(a, c) { |
|
var d = /^(?:filter|map|reject)|While$/.test(c), e = /^(?:first|last)$/.test(c), f = b[e ? "take" + ("last" == c ? "Right" : "") : c]; |
|
f && (b.prototype[c] = function() { |
|
var b = e ? [ 1 ] : arguments, c = this.__chain__, g = this.__wrapped__, h = !!this.__actions__.length, i = g instanceof Z, j = b[0], k = i || Ci(g); |
|
k && d && "function" == typeof j && 1 != j.length && (i = k = !1); |
|
var l = function(a) { |
|
return e && c ? f(a, 1)[0] : f.apply(z, jc([ a ], b)); |
|
}, m = { |
|
func: Qe, |
|
args: [ l ], |
|
thisArg: z |
|
}, n = i && !h; |
|
if (e && !c) return n ? (g = g.clone(), g.__actions__.push(m), a.call(g)) : f.call(z, this.value())[0]; |
|
if (!e && k) { |
|
g = n ? g : new Z(this); |
|
var o = a.apply(g, b); |
|
return o.__actions__.push(m), new s(o, c); |
|
} |
|
return this.thru(l); |
|
}); |
|
}), bc([ "join", "pop", "push", "replace", "shift", "sort", "splice", "split", "unshift" ], function(a) { |
|
var c = (/^(?:replace|split)$/.test(a) ? $g : Yg)[a], d = /^(?:push|sort|unshift)$/.test(a) ? "tap" : "thru", e = /^(?:join|pop|replace|shift)$/.test(a); |
|
b.prototype[a] = function() { |
|
var a = arguments; |
|
return e && !this.__chain__ ? c.apply(this.value(), a) : this[d](function(b) { |
|
return c.apply(b, a); |
|
}); |
|
}; |
|
}), Fc(Z.prototype, function(a, c) { |
|
var d = b[c]; |
|
if (d) { |
|
var e = d.name, f = Hh[e] || (Hh[e] = []); |
|
f.push({ |
|
name: c, |
|
func: d |
|
}); |
|
} |
|
}), Hh[Fd(z, C).name] = [ { |
|
name: "wrapper", |
|
func: z |
|
} ], Z.prototype.clone = bb, Z.prototype.reverse = db, Z.prototype.value = Sb, b.prototype.chain = Re, |
|
b.prototype.commit = Se, b.prototype.concat = ai, b.prototype.plant = Te, b.prototype.reverse = Ue, |
|
b.prototype.toString = Ve, b.prototype.run = b.prototype.toJSON = b.prototype.valueOf = b.prototype.value = We, |
|
b.prototype.collect = b.prototype.map, b.prototype.head = b.prototype.first, b.prototype.select = b.prototype.filter, |
|
b.prototype.tail = b.prototype.rest, b; |
|
} |
|
var z, A = "3.10.0", B = 1, C = 2, D = 4, E = 8, F = 16, G = 32, H = 64, I = 128, J = 256, K = 30, L = "...", M = 150, N = 16, O = 200, P = 1, Q = 2, R = "Expected a function", S = "__lodash_placeholder__", T = "[object Arguments]", U = "[object Array]", V = "[object Boolean]", W = "[object Date]", X = "[object Error]", Y = "[object Function]", Z = "[object Map]", $ = "[object Number]", _ = "[object Object]", ab = "[object RegExp]", bb = "[object Set]", cb = "[object String]", db = "[object WeakMap]", eb = "[object ArrayBuffer]", fb = "[object Float32Array]", gb = "[object Float64Array]", hb = "[object Int8Array]", ib = "[object Int16Array]", jb = "[object Int32Array]", kb = "[object Uint8Array]", lb = "[object Uint8ClampedArray]", mb = "[object Uint16Array]", nb = "[object Uint32Array]", ob = /\b__p \+= '';/g, pb = /\b(__p \+=) '' \+/g, qb = /(__e\(.*?\)|\b__t\)) \+\n'';/g, rb = /&(?:amp|lt|gt|quot|#39|#96);/g, sb = /[&<>"'`]/g, tb = RegExp(rb.source), ub = RegExp(sb.source), vb = /<%-([\s\S]+?)%>/g, wb = /<%([\s\S]+?)%>/g, xb = /<%=([\s\S]+?)%>/g, yb = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/, zb = /^\w*$/, Ab = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g, Bb = /^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g, Cb = RegExp(Bb.source), Db = /[\u0300-\u036f\ufe20-\ufe23]/g, Eb = /\\(\\)?/g, Fb = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, Gb = /\w*$/, Hb = /^0[xX]/, Ib = /^\[object .+?Constructor\]$/, Jb = /^\d+$/, Kb = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g, Lb = /($^)/, Mb = /['\n\r\u2028\u2029\\]/g, Nb = function() { |
|
var a = "[A-Z\\xc0-\\xd6\\xd8-\\xde]", b = "[a-z\\xdf-\\xf6\\xf8-\\xff]+"; |
|
return RegExp(a + "+(?=" + a + b + ")|" + a + "?" + b + "|" + a + "+|[0-9]+", "g"); |
|
}(), Ob = [ "Array", "ArrayBuffer", "Date", "Error", "Float32Array", "Float64Array", "Function", "Int8Array", "Int16Array", "Int32Array", "Math", "Number", "Object", "RegExp", "Set", "String", "_", "clearTimeout", "isFinite", "parseFloat", "parseInt", "setTimeout", "TypeError", "Uint8Array", "Uint8ClampedArray", "Uint16Array", "Uint32Array", "WeakMap" ], Pb = -1, Qb = {}; |
|
Qb[fb] = Qb[gb] = Qb[hb] = Qb[ib] = Qb[jb] = Qb[kb] = Qb[lb] = Qb[mb] = Qb[nb] = !0, |
|
Qb[T] = Qb[U] = Qb[eb] = Qb[V] = Qb[W] = Qb[X] = Qb[Y] = Qb[Z] = Qb[$] = Qb[_] = Qb[ab] = Qb[bb] = Qb[cb] = Qb[db] = !1; |
|
var Rb = {}; |
|
Rb[T] = Rb[U] = Rb[eb] = Rb[V] = Rb[W] = Rb[fb] = Rb[gb] = Rb[hb] = Rb[ib] = Rb[jb] = Rb[$] = Rb[_] = Rb[ab] = Rb[cb] = Rb[kb] = Rb[lb] = Rb[mb] = Rb[nb] = !0, |
|
Rb[X] = Rb[Y] = Rb[Z] = Rb[bb] = Rb[db] = !1; |
|
var Sb = { |
|
"À": "A", |
|
"Á": "A", |
|
"Â": "A", |
|
"Ã": "A", |
|
"Ä": "A", |
|
"Å": "A", |
|
"à": "a", |
|
"á": "a", |
|
"â": "a", |
|
"ã": "a", |
|
"ä": "a", |
|
"å": "a", |
|
"Ç": "C", |
|
"ç": "c", |
|
"Ð": "D", |
|
"ð": "d", |
|
"È": "E", |
|
"É": "E", |
|
"Ê": "E", |
|
"Ë": "E", |
|
"è": "e", |
|
"é": "e", |
|
"ê": "e", |
|
"ë": "e", |
|
"Ì": "I", |
|
"Í": "I", |
|
"Î": "I", |
|
"Ï": "I", |
|
"ì": "i", |
|
"í": "i", |
|
"î": "i", |
|
"ï": "i", |
|
"Ñ": "N", |
|
"ñ": "n", |
|
"Ò": "O", |
|
"Ó": "O", |
|
"Ô": "O", |
|
"Õ": "O", |
|
"Ö": "O", |
|
"Ø": "O", |
|
"ò": "o", |
|
"ó": "o", |
|
"ô": "o", |
|
"õ": "o", |
|
"ö": "o", |
|
"ø": "o", |
|
"Ù": "U", |
|
"Ú": "U", |
|
"Û": "U", |
|
"Ü": "U", |
|
"ù": "u", |
|
"ú": "u", |
|
"û": "u", |
|
"ü": "u", |
|
"Ý": "Y", |
|
"ý": "y", |
|
"ÿ": "y", |
|
"Æ": "Ae", |
|
"æ": "ae", |
|
"Þ": "Th", |
|
"þ": "th", |
|
"ß": "ss" |
|
}, Tb = { |
|
"&": "&", |
|
"<": "<", |
|
">": ">", |
|
'"': """, |
|
"'": "'", |
|
"`": "`" |
|
}, Ub = { |
|
"&": "&", |
|
"<": "<", |
|
">": ">", |
|
""": '"', |
|
"'": "'", |
|
"`": "`" |
|
}, Vb = { |
|
"function": !0, |
|
object: !0 |
|
}, Wb = { |
|
0: "x30", |
|
1: "x31", |
|
2: "x32", |
|
3: "x33", |
|
4: "x34", |
|
5: "x35", |
|
6: "x36", |
|
7: "x37", |
|
8: "x38", |
|
9: "x39", |
|
A: "x41", |
|
B: "x42", |
|
C: "x43", |
|
D: "x44", |
|
E: "x45", |
|
F: "x46", |
|
a: "x61", |
|
b: "x62", |
|
c: "x63", |
|
d: "x64", |
|
e: "x65", |
|
f: "x66", |
|
n: "x6e", |
|
r: "x72", |
|
t: "x74", |
|
u: "x75", |
|
v: "x76", |
|
x: "x78" |
|
}, Xb = { |
|
"\\": "\\", |
|
"'": "'", |
|
"\n": "n", |
|
"\r": "r", |
|
"\u2028": "u2028", |
|
"\u2029": "u2029" |
|
}, Yb = Vb[typeof c] && c && !c.nodeType && c, Zb = Vb[typeof b] && b && !b.nodeType && b, $b = Yb && Zb && "object" == typeof a && a && a.Object && a, _b = Vb[typeof self] && self && self.Object && self, ac = Vb[typeof window] && window && window.Object && window, bc = Zb && Zb.exports === Yb && Yb, cc = $b || ac !== (this && this.window) && ac || _b || this, dc = y(); |
|
"function" == typeof define && "object" == typeof define.amd && define.amd ? (cc._ = dc, |
|
define(function() { |
|
return dc; |
|
})) : Yb && Zb ? bc ? (Zb.exports = dc)._ = dc : Yb._ = dc : cc._ = dc; |
|
}).call(this); |
|
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}); |
|
}, {} ], |
|
54: [ function(a, b, c) { |
|
arguments[4][32][0].apply(c, arguments); |
|
}, { |
|
_process: 110, |
|
dup: 32 |
|
} ], |
|
55: [ function(a, b) { |
|
"use strict"; |
|
var c = (a("lodash"), a("../../../utils"), a("../../../game/constants"), a("../../../core/core")); |
|
b.exports = function(a, b, d, e, f, g, h) { |
|
a && "constructedWall" == a.type && (a.ticksToLive > 0 && e.update(a, { |
|
decayTime: h + a.ticksToLive, |
|
ticksToLive: null |
|
}), a.decayTime && (h >= a.decayTime - 1 && (e.remove(a._id), delete b[a._id]), |
|
a.user && h == a.decayTime - 5e3 && c.sendNotification(a.user, "Attention! Your room protection will be removed soon.\nLearn how to defend your room against intruders from <a href='http://support.screeps.com/hc/en-us/articles/203339002-Defending-your-room'>this article</a>."))); |
|
}; |
|
}, { |
|
"../../../core/core": 27, |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
lodash: 53 |
|
} ], |
|
56: [ function(a, b) { |
|
"use strict"; |
|
a("lodash"), a("../../../utils"), a("../../../game/constants"); |
|
b.exports = function(b, c, d) { |
|
b && "constructionSite" == b.type && (d.remove(b._id), b.progress > 1 && a("../creeps/_create-energy")(b.x, b.y, b.room, Math.floor(b.progress / 2), c, d)); |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
"../creeps/_create-energy": 60, |
|
lodash: 53 |
|
} ], |
|
57: [ function(a, b) { |
|
"use strict"; |
|
a("lodash"), a("../../../utils"), a("../../../game/constants"); |
|
b.exports = function(a) { |
|
!a || "constructionSite" != a.type; |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
lodash: 53 |
|
} ], |
|
58: [ function(a, b) { |
|
"use strict"; |
|
var c = (a("lodash"), a("../../../utils"), a("../../../game/constants")), d = a("../../../core/core"); |
|
b.exports = function(a, b, e, f, g, h, i) { |
|
if (a && "controller" == a.type && (a.reservation && (i >= a.reservation.endTime - 1 || a.user) && f.update(a, { |
|
reservation: null |
|
}), a.user)) { |
|
if (a._upgraded || !a.downgradeTime || a.tutorial) return void f.update(a, { |
|
downgradeTime: i + c.CONTROLLER_DOWNGRADE[a.level] + 1 |
|
}); |
|
i == a.downgradeTime - 5e3 && d.sendNotification(a.user, "Attention! Your Controller in room " + a.room + " will be downgraded to level " + (a.level - 1) + " in 5000 ticks (~3 hours)! Upgrade it to prevent losing of this room. <a href='http://support.screeps.com/hc/en-us/articles/203086021-Territory-control'>Learn more</a>"), |
|
i >= a.downgradeTime - 1 && (a.level--, d.sendNotification(a.user, "Your Controller in room " + a.room + " has been downgraded to level " + a.level + " due to absence of upgrading activity!"), |
|
0 == a.level ? (a.progress = 0, a.user = null, a.downgradeTime = null) : a.downgradeTime = i + c.CONTROLLER_DOWNGRADE[a.level] + 1, |
|
f.update(a, { |
|
downgradeTime: a.downgradeTime, |
|
level: a.level, |
|
progress: a.progress, |
|
user: a.user |
|
})); |
|
} |
|
}; |
|
}, { |
|
"../../../core/core": 27, |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
lodash: 53 |
|
} ], |
|
59: [ function(a, b) { |
|
"use strict"; |
|
{ |
|
var c = a("lodash"); |
|
a("../../../utils"), a("../../../game/constants"); |
|
} |
|
b.exports = function(a, b) { |
|
c.forEach(a, function(c) { |
|
"constructedWall" == c.type && c.decayTime && c.user && (b.remove(c._id), delete a[c._id]); |
|
}); |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
lodash: 53 |
|
} ], |
|
60: [ function(a, b) { |
|
"use strict"; |
|
{ |
|
var c = a("lodash"); |
|
a("../../../utils"), a("../../../game/constants"); |
|
} |
|
b.exports = function(a, b, d, e, f, g) { |
|
e = Math.round(e); |
|
var h = c.find(f, { |
|
type: "energy", |
|
x: a, |
|
y: b |
|
}); |
|
h ? g.update(h, { |
|
energy: h.energy + e |
|
}) : g.insert({ |
|
type: "energy", |
|
x: a, |
|
y: b, |
|
room: d, |
|
energy: e |
|
}); |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
lodash: 53 |
|
} ], |
|
61: [ function(a, b) { |
|
"use strict"; |
|
var c = a("lodash"), d = a("../../../utils"), e = a("../../../game/constants"); |
|
b.exports = function(b, f, g, h) { |
|
if (/^arena/.test(b.room)) if (b.energy > 0 && a("./_create-energy")(b.x, b.y, b.room, b.energy, f, g), |
|
b.arenaRespawn) { |
|
var i = c.filter(f, { |
|
type: "portal" |
|
}), j = i[Math.floor(Math.random() * i.length)]; |
|
b.body.forEach(function(a) { |
|
return a.hits = 100; |
|
}), g.update(b, { |
|
spawning: !0, |
|
ticksToSpawn: 150, |
|
x: j.x, |
|
y: j.y, |
|
hits: 100 * b.body.length, |
|
body: b.body, |
|
energy: 0, |
|
energyCapacity: 50, |
|
ticksToLive: 1e4 |
|
}); |
|
} else g.remove(b._id); else { |
|
g.remove(b._id), delete f[b._id]; |
|
var k = d.calcCreepCost(b.body) * e.CREEP_CORPSE_RATE * b._ticksToLive / e.CREEP_LIFE_TIME; |
|
b.energy > 0 && (k += b.energy), a("./_create-energy")(b.x, b.y, b.room, k, f, g), |
|
h && "3" != b.user && h.inc("creepsLost", b.user, b.body.length); |
|
} |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
"./_create-energy": 60, |
|
lodash: 53 |
|
} ], |
|
62: [ function(a, b) { |
|
"use strict"; |
|
var c = a("lodash"), d = a("../../../game/constants"); |
|
b.exports = function(a) { |
|
for (var b = a.hits, e = a.body.length - 1; e >= 0; e--) a.body[e]._oldHits = a.body[e]._oldHits || a.body[e].hits, |
|
a.body[e].hits = b > 100 ? 100 : b, b -= 100, 0 > b && (b = 0); |
|
a.energyCapacity = c.filter(a.body, function(a) { |
|
return a.hits > 0 && a.type == d.CARRY; |
|
}).length * d.CARRY_CAPACITY; |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
lodash: 53 |
|
} ], |
|
63: [ function(a, b) { |
|
"use strict"; |
|
{ |
|
var c = a("lodash"), d = a("../../../utils"), e = a("../../../game/constants"); |
|
a("../../../core/core"); |
|
} |
|
b.exports = function(b, f, g, h, i, j, k, l) { |
|
function m(b) { |
|
a("./_recalc-body")(b), b.energy > b.energyCapacity && (a("./drop-energy")(b, { |
|
amount: b.energy - b.energyCapacity |
|
}, g, h, i), b.energy = b.energyCapacity); |
|
} |
|
if ("creep" == b.type && !b.spawning) { |
|
var n = g[f.id]; |
|
if (n && c.contains([ "creep", "spawn", "rampart", "road", "constructedWall", "extension", "link", "storage" ], n.type) && n != b && !(Math.abs(n.x - b.x) > 1 || Math.abs(n.y - b.y) > 1 || "creep" == n.type && n.spawning || !n.hits)) { |
|
var o = c.find(g, { |
|
type: "rampart", |
|
x: n.x, |
|
y: n.y |
|
}); |
|
o && (n = o); |
|
var p = c.filter(b.body, function(a) { |
|
return (a.hits > 0 || a._oldHits > 0) && a.type == e.ATTACK; |
|
}).length * e.ATTACK_POWER || 0; |
|
if ("creep" == n.type) { |
|
if (!c.any(g, { |
|
type: "rampart", |
|
x: b.x, |
|
y: b.y |
|
})) { |
|
var q = c.filter(n.body, function(a) { |
|
return (a.hits > 0 || a._oldHits > 0) && a.type == e.ATTACK; |
|
}).length * e.ATTACK_POWER || 0; |
|
q > 0 && (b.hits -= q, m(b), b.actionLog.attacked = { |
|
x: n.x, |
|
y: n.y |
|
}); |
|
} |
|
m(n); |
|
} |
|
if (p > 0) { |
|
if (n.hits -= p, "constructedWall" == n.type && n.decayTime) a("./_clear-newbie-walls")(g, i); else if (n.hits <= 0) { |
|
if ("creep" == n.type ? a("./_die")(n, g, i, l) : (i.remove(n._id), delete g[n._id]), |
|
"spawn" == n.type && n.spawning) { |
|
var r = c.find(g, { |
|
user: n.user, |
|
name: n.spawning.name |
|
}); |
|
r && i.remove(r._id); |
|
} |
|
("spawn" == n.type || "extension" == n.type || "link" == n.type || "storage" == n.type) && n.energy > 0 && a("./_create-energy")(n.x, n.y, n.room, n.energy, g, i); |
|
} else "creep" == n.type ? i.update(n, { |
|
hits: n.hits, |
|
body: n.body, |
|
energy: n.energy, |
|
energyCapacity: n.energyCapacity |
|
}) : i.update(n, { |
|
hits: n.hits |
|
}); |
|
b.actionLog.attack = { |
|
x: n.x, |
|
y: n.y |
|
}, n.actionLog && (n.actionLog.attacked = { |
|
x: b.x, |
|
y: b.y |
|
}), n.notifyWhenAttacked && d.sendAttackingNotification(n, k); |
|
} |
|
"creep" == n.type && (b.hits <= 0 ? a("./_die")(b, g, i, l) : i.update(b, { |
|
hits: b.hits, |
|
body: b.body, |
|
energy: b.energy, |
|
energyCapacity: b.energyCapacity |
|
})); |
|
} |
|
} |
|
}; |
|
}, { |
|
"../../../core/core": 27, |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
"./_clear-newbie-walls": 59, |
|
"./_create-energy": 60, |
|
"./_die": 61, |
|
"./_recalc-body": 62, |
|
"./drop-energy": 66, |
|
lodash: 53 |
|
} ], |
|
64: [ function(a, b) { |
|
"use strict"; |
|
var c = a("lodash"), d = a("../../../utils"), e = a("../../../game/constants"), f = 0; |
|
b.exports = function(a, b, g, h, i, j, k, l, m) { |
|
if ("creep" == a.type && !(a.spawning || a.energy <= 0)) { |
|
var n = g[b.id]; |
|
if (n && "constructionSite" == n.type && c.contains([ "rampart", "spawn", "road", "extension", "constructedWall", "link", "storage" ], n.structureType) && !(Math.abs(n.x - a.x) > 3 || Math.abs(n.y - a.y) > 3 || c.any(g, { |
|
x: n.x, |
|
y: n.y, |
|
type: n.structureType |
|
}) || c.contains([ "spawn", "extension", "constructedWall", "link", "storage" ], n.structureType) && c.any(g, function(a) { |
|
return a.x == n.x && a.y == n.y && c.contains(e.OBSTACLE_OBJECT_TYPES, a.type); |
|
}) || d.checkTerrain(h, n.x, n.y, e.TERRAIN_MASK_WALL))) { |
|
var o = c.filter(a.body, function(a) { |
|
return (a.hits > 0 || a._oldHits > 0) && a.type == e.WORK; |
|
}).length * e.BUILD_POWER || 0, p = n.progressTotal - n.progress, q = Math.min(o, p, a.energy); |
|
if (!(n.progress + q >= n.progressTotal) || n.tutorial || d.checkControllerAvailability(n.structureType, g, k, 1)) if (n.progress += q, |
|
a.energy -= q, l.inc("energyConstruction", a.user, q), a.actionLog.build = { |
|
x: n.x, |
|
y: n.y |
|
}, i.update(a, { |
|
energy: a.energy |
|
}), n.progress < n.progressTotal) i.update(n, { |
|
progress: n.progress |
|
}); else { |
|
i.remove(n._id); |
|
var r = { |
|
type: n.structureType, |
|
x: n.x, |
|
y: n.y, |
|
room: n.room, |
|
notifyWhenAttacked: !0 |
|
}; |
|
if ("spawn" == n.structureType && c.extend(r, { |
|
name: n.name, |
|
user: n.user, |
|
energy: 0, |
|
energyCapacity: e.SPAWN_ENERGY_CAPACITY, |
|
hits: e.SPAWN_HITS, |
|
hitsMax: e.SPAWN_HITS |
|
}), "extension" == n.structureType && c.extend(r, { |
|
user: n.user, |
|
energy: 0, |
|
energyCapacity: e.EXTENSION_ENERGY_CAPACITY, |
|
hits: e.EXTENSION_HITS, |
|
hitsMax: e.EXTENSION_HITS |
|
}), "link" == n.structureType && c.extend(r, { |
|
user: n.user, |
|
energy: 0, |
|
energyCapacity: e.LINK_CAPACITY, |
|
cooldown: 0, |
|
hits: e.LINK_HITS, |
|
hitsMax: e.LINK_HITS_MAX |
|
}), "storage" == n.structureType && c.extend(r, { |
|
user: n.user, |
|
energy: 0, |
|
energyCapacity: e.STORAGE_CAPACITY, |
|
hits: e.STORAGE_HITS, |
|
hitsMax: e.STORAGE_HITS |
|
}), "rampart" == n.structureType && c.extend(r, { |
|
user: n.user, |
|
hits: e.RAMPART_HITS, |
|
hitsMax: e.RAMPART_HITS, |
|
nextDecayTime: m + e.RAMPART_DECAY_TIME |
|
}), "road" == n.structureType) { |
|
var s = e.ROAD_HITS; |
|
(c.any(g, { |
|
x: n.x, |
|
y: n.y, |
|
type: "swamp" |
|
}) || d.checkTerrain(h, n.x, n.y, e.TERRAIN_MASK_SWAMP)) && (s *= e.CONSTRUCTION_COST_ROAD_SWAMP_RATIO), |
|
c.extend(r, { |
|
hits: s, |
|
hitsMax: s |
|
}); |
|
} |
|
"constructedWall" == n.structureType && c.extend(r, { |
|
hits: e.WALL_HITS, |
|
hitsMax: e.WALL_HITS_MAX |
|
}), i.insert(r), g["createdStructure" + f] = r, f++, delete g[b.id]; |
|
} |
|
} |
|
} |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
lodash: 53 |
|
} ], |
|
65: [ function(a, b) { |
|
"use strict"; |
|
var c = (a("lodash"), a("../../../utils"), a("../../../game/constants")); |
|
b.exports = function(a, b, d, e, f, g, h, i, j) { |
|
if ("creep" == a.type && !a.spawning) { |
|
var k = d[b.id]; |
|
if (k && "controller" == k.type && !(Math.abs(k.x - a.x) > 1 || Math.abs(k.y - a.y) > 1 || k.user || k.reservation && k.reservation.user != a.user || k.bindUser && a.user != k.bindUser)) { |
|
var l = 1, m = 0; |
|
k.reservation && (m = k.reservation.endTime - j, m > c.CONTROLLER_LEVELS[1] && (m -= c.CONTROLLER_LEVELS[1], |
|
l = 2)), f.update(k, { |
|
user: a.user, |
|
level: l, |
|
progress: m, |
|
downgradeTime: null, |
|
reservation: null |
|
}); |
|
} |
|
} |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
lodash: 53 |
|
} ], |
|
66: [ function(a, b) { |
|
"use strict"; |
|
a("lodash"), a("../../../utils"), a("../../../game/constants"); |
|
b.exports = function(b, c, d, e, f) { |
|
"creep" == b.type && (b.spawning || b.energy < c.amount || (b.energy -= c.amount, |
|
f.update(b, { |
|
energy: b.energy |
|
}), a("./_create-energy")(b.x, b.y, b.room, c.amount, d, f))); |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
"./_create-energy": 60, |
|
lodash: 53 |
|
} ], |
|
67: [ function(a, b) { |
|
"use strict"; |
|
var c = a("lodash"), d = (a("../../../utils"), a("../../../game/constants")); |
|
b.exports = function(b, e, f, g, h, i, j, k) { |
|
if ("creep" == b.type && !b.spawning) { |
|
var l = f[e.id]; |
|
if (l && "source" == l.type && l.energy && !(Math.abs(l.x - b.x) > 1 || Math.abs(l.y - b.y) > 1)) { |
|
var m = c.filter(b.body, function(a) { |
|
return (a.hits > 0 || a._oldHits > 0) && a.type == d.WORK; |
|
}).length * d.HARVEST_POWER || 0; |
|
if (m) { |
|
var n = Math.min(l.energy, m); |
|
l.energy -= n, b.energy += n, h.update(b, { |
|
energy: b.energy |
|
}), h.update(l, { |
|
energy: l.energy |
|
}), b.energy > b.energyCapacity && a("./drop-energy")(b, { |
|
amount: b.energy - b.energyCapacity |
|
}, f, g, h), b.actionLog.harvest = { |
|
x: l.x, |
|
y: l.y |
|
}, k.inc("energyHarvested", b.user, n); |
|
} |
|
} |
|
} |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
"./drop-energy": 66, |
|
lodash: 53 |
|
} ], |
|
68: [ function(a, b) { |
|
"use strict"; |
|
var c = a("lodash"), d = (a("../../../utils"), a("../../../game/constants")); |
|
b.exports = function(b, e, f, g, h) { |
|
function i(b) { |
|
a("./_recalc-body")(b); |
|
} |
|
if ("creep" == b.type && !b.spawning) { |
|
var j = f[e.id]; |
|
if (!(!j || "creep" != j.type || j.spawning || j.hits >= j.hitsMax || Math.abs(j.x - b.x) > 1 || Math.abs(j.y - b.y) > 1)) { |
|
var k = c.filter(b.body, function(a) { |
|
return (a.hits > 0 || a._oldHits > 0) && a.type == d.HEAL; |
|
}).length * d.HEAL_POWER || 0; |
|
j.hits += k, j.hits > j.hitsMax && (j.hits = j.hitsMax), i(j), b.actionLog.heal = { |
|
x: j.x, |
|
y: j.y |
|
}, j.actionLog.healed = { |
|
x: b.x, |
|
y: b.y |
|
}, h.update(j, { |
|
hits: j.hits, |
|
body: j.body, |
|
energyCapacity: j.energyCapacity |
|
}); |
|
} |
|
} |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
"./_recalc-body": 62, |
|
lodash: 53 |
|
} ], |
|
69: [ function(a, b) { |
|
"use strict"; |
|
b.exports = function(b, c, d, e, f, g, h, i, j) { |
|
c.dropEnergy && a("./drop-energy")(b, c.dropEnergy, d, e, f, g, h, i), c.transferEnergy && a("./transfer-energy")(b, c.transferEnergy, d, e, f, g, h, i), |
|
c.pickup && a("./pickup")(b, c.pickup, d, e, f, g, h, i), c.heal ? a("./heal")(b, c.heal, d, e, f, g, h, i) : c.rangedHeal ? a("./rangedHeal")(b, c.rangedHeal, d, e, f, g, h, i) : c.attack ? a("./attack")(b, c.attack, d, e, f, g, h, i) : c.harvest && a("./harvest")(b, c.harvest, d, e, f, g, h, i), |
|
c.move && a("./move")(b, c.move, d, e, f, g, h, i), !c.rangedHeal && c.repair && a("./repair")(b, c.repair, d, e, f, g, h, i), |
|
c.rangedHeal || c.repair || !c.build || a("./build")(b, c.build, d, e, f, g, h, i, j), |
|
c.rangedHeal || c.repair || c.build || !c.rangedMassAttack || a("./rangedMassAttack")(b, c.rangedMassAttack, d, e, f, g, h, i), |
|
c.rangedHeal || c.repair || c.build || c.rangedMassAttack || !c.rangedAttack || a("./rangedAttack")(b, c.rangedAttack, d, e, f, g, h, i), |
|
c.suicide && a("./suicide")(b, c.suicide, d, e, f, g, h, i), c.say && a("./say")(b, c.say, d, e, f, g, h, i), |
|
c.claimController && a("./claimController")(b, c.claimController, d, e, f, g, h, i, j), |
|
c.unclaimController && a("./unclaimController")(b, c.unclaimController, d, e, f, g, h, i), |
|
c.upgradeController && a("./upgradeController")(b, c.upgradeController, d, e, f, g, h, i), |
|
c.reserveController && a("./reserveController")(b, c.reserveController, d, e, f, g, h, i, j); |
|
}; |
|
}, { |
|
"./attack": 63, |
|
"./build": 64, |
|
"./claimController": 65, |
|
"./drop-energy": 66, |
|
"./harvest": 67, |
|
"./heal": 68, |
|
"./move": 70, |
|
"./pickup": 71, |
|
"./rangedAttack": 72, |
|
"./rangedHeal": 73, |
|
"./rangedMassAttack": 74, |
|
"./repair": 75, |
|
"./reserveController": 76, |
|
"./say": 77, |
|
"./suicide": 78, |
|
"./transfer-energy": 80, |
|
"./unclaimController": 81, |
|
"./upgradeController": 82 |
|
} ], |
|
70: [ function(a, b) { |
|
"use strict"; |
|
var c = function() { |
|
function a(a, b) { |
|
var c = [], d = !0, e = !1, f = void 0; |
|
try { |
|
for (var g, h = a[Symbol.iterator](); !(d = (g = h.next()).done) && (c.push(g.value), |
|
!b || c.length !== b); d = !0) ; |
|
} catch (i) { |
|
e = !0, f = i; |
|
} finally { |
|
try { |
|
!d && h["return"] && h["return"](); |
|
} finally { |
|
if (e) throw f; |
|
} |
|
} |
|
return c; |
|
} |
|
return function(b, c) { |
|
if (Array.isArray(b)) return b; |
|
if (Symbol.iterator in Object(b)) return a(b, c); |
|
throw new TypeError("Invalid attempt to destructure non-iterable instance"); |
|
}; |
|
}(), d = a("lodash"), e = a("../../../utils"), f = a("../../../game/constants"), g = a("../movement"); |
|
b.exports = function(b, h, i, j, k) { |
|
if ("creep" == b.type && !(b.spawning || b.fatigue > 0) && 0 != d.filter(b.body, function(a) { |
|
return a.hits > 0 && a.type == f.MOVE; |
|
}).length) { |
|
var l = e.getOffsetsByDirection(h.direction), m = null; |
|
if (l) { |
|
var n = c(l, 2), o = n[0], p = n[1]; |
|
d.filter(b.body, function(a) { |
|
return a.hits > 0 && a.type == f.ATTACK; |
|
}).length > 0 && d.filter(i, { |
|
x: b.x + o, |
|
y: b.y + p |
|
}).forEach(function(a) { |
|
d.contains([ "rampart", "constructedWall", "spawn", "extension", "link", "storage" ], a.type) && b.user != a.user && (m = a); |
|
}), m ? a("./attack")(b, { |
|
id: m._id, |
|
x: m.x, |
|
y: m.y |
|
}, i, j, k) : g.add(b, o, p); |
|
} |
|
} |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
"../movement": 90, |
|
"./attack": 63, |
|
lodash: 53 |
|
} ], |
|
71: [ function(a, b) { |
|
"use strict"; |
|
a("lodash"), a("../../../utils"), a("../../../game/constants"); |
|
b.exports = function(a, b, c, d, e) { |
|
if ("creep" == a.type && !(a.spawning || a.energy >= a.energyCapacity)) { |
|
var f = c[b.id]; |
|
if (f && "energy" == f.type && f.energy && !(Math.abs(f.x - a.x) > 1 || Math.abs(f.y - a.y) > 1)) { |
|
var g = Math.min(a.energyCapacity - a.energy, f.energy); |
|
f.energy -= g, a.energy += g, f.energy ? e.update(f, { |
|
energy: f.energy |
|
}) : (e.remove(f._id), delete c[f._id]), e.update(a, { |
|
energy: a.energy |
|
}); |
|
} |
|
} |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
lodash: 53 |
|
} ], |
|
72: [ function(a, b) { |
|
"use strict"; |
|
{ |
|
var c = a("lodash"), d = a("../../../utils"), e = a("../../../game/constants"); |
|
a("../../../core/core"); |
|
} |
|
b.exports = function(b, f, g, h, i, j, k, l) { |
|
function m(b) { |
|
a("./_recalc-body")(b), b.energy > b.energyCapacity && (a("./drop-energy")(b, { |
|
amount: b.energy - b.energyCapacity |
|
}, g, h, i), b.energy = b.energyCapacity); |
|
} |
|
if ("creep" == b.type && !b.spawning) { |
|
var n = g[f.id]; |
|
if (n && c.contains([ "creep", "spawn", "rampart", "road", "constructedWall", "extension", "link", "storage" ], n.type) && n != b && !(Math.abs(n.x - b.x) > 3 || Math.abs(n.y - b.y) > 3 || "creep" == n.type && n.spawning || !n.hits)) { |
|
var o = c.find(g, { |
|
type: "rampart", |
|
x: n.x, |
|
y: n.y |
|
}); |
|
o && (n = o); |
|
var p = c.filter(b.body, function(a) { |
|
return (a.hits > 0 || a._oldHits > 0) && a.type == e.RANGED_ATTACK; |
|
}).length * e.RANGED_ATTACK_POWER || 0; |
|
if (p > 0) { |
|
if (n.hits -= p, "creep" == n.type && m(n), "constructedWall" == n.type && n.decayTime) a("./_clear-newbie-walls")(g, i); else if (n.hits <= 0) { |
|
if ("creep" == n.type ? a("./_die")(n, g, i, l) : (i.remove(n._id), delete g[n._id]), |
|
"spawn" == n.type && n.spawning) { |
|
var q = c.find(g, { |
|
user: n.user, |
|
name: n.spawning.name |
|
}); |
|
q && i.remove(q._id); |
|
} |
|
("spawn" == n.type || "extension" == n.type || "link" == n.type || "storage" == n.type) && n.energy > 0 && a("./_create-energy")(n.x, n.y, n.room, n.energy, g, i); |
|
} else "creep" == n.type ? i.update(n, { |
|
hits: n.hits, |
|
body: n.body, |
|
energy: n.energy, |
|
energyCapacity: n.energyCapacity |
|
}) : i.update(n, { |
|
hits: n.hits |
|
}); |
|
b.actionLog.rangedAttack = { |
|
x: n.x, |
|
y: n.y |
|
}, n.actionLog && (n.actionLog.attacked = { |
|
x: b.x, |
|
y: b.y |
|
}), n.notifyWhenAttacked && d.sendAttackingNotification(n, k); |
|
} |
|
} |
|
} |
|
}; |
|
}, { |
|
"../../../core/core": 27, |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
"./_clear-newbie-walls": 59, |
|
"./_create-energy": 60, |
|
"./_die": 61, |
|
"./_recalc-body": 62, |
|
"./drop-energy": 66, |
|
lodash: 53 |
|
} ], |
|
73: [ function(a, b) { |
|
"use strict"; |
|
var c = a("lodash"), d = (a("../../../utils"), a("../../../game/constants")); |
|
b.exports = function(a, b, e, f, g) { |
|
function h(a) { |
|
for (var b = a.hits, e = a.body.length - 1; e >= 0; e--) a.body[e].hits = b > 100 ? 100 : b, |
|
b -= 100, 0 > b && (b = 0); |
|
a.energyCapacity = c.filter(a.body, function(a) { |
|
return a.hits > 0 && a.type == d.CARRY; |
|
}).length * d.CARRY_CAPACITY; |
|
} |
|
if ("creep" == a.type && !a.spawning) { |
|
var i = e[b.id]; |
|
if (!(!i || "creep" != i.type || i.spawning || i.hits >= i.hitsMax || Math.abs(i.x - a.x) > 3 || Math.abs(i.y - a.y) > 3)) { |
|
var j = c.filter(a.body, function(a) { |
|
return (a.hits > 0 || a._oldHits > 0) && a.type == d.HEAL; |
|
}).length * d.RANGED_HEAL_POWER || 0; |
|
i.hits += j, i.hits > i.hitsMax && (i.hits = i.hitsMax), h(i), a.actionLog.rangedHeal = { |
|
x: i.x, |
|
y: i.y |
|
}, i.actionLog.healed = { |
|
x: a.x, |
|
y: a.y |
|
}, g.update(i, { |
|
hits: i.hits, |
|
body: i.body, |
|
energyCapacity: i.energyCapacity |
|
}); |
|
} |
|
} |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
lodash: 53 |
|
} ], |
|
74: [ function(a, b) { |
|
"use strict"; |
|
{ |
|
var c = a("lodash"), d = a("../../../utils"), e = a("../../../game/constants"); |
|
a("../../../core/core"); |
|
} |
|
b.exports = function(b, f, g, h, i, j, k, l) { |
|
function m(b) { |
|
a("./_recalc-body")(b), b.energy > b.energyCapacity && (a("./drop-energy")(b, { |
|
amount: b.energy - b.energyCapacity |
|
}, g, h, i), b.energy = b.energyCapacity); |
|
} |
|
if ("creep" == b.type && !b.spawning) { |
|
var n = c.filter(b.body, function(a) { |
|
return (a.hits > 0 || a._oldHits > 0) && a.type == e.RANGED_ATTACK; |
|
}).length * e.RANGED_ATTACK_POWER || 0; |
|
if (0 != n) { |
|
var o = c.filter(g, function(a) { |
|
return !c.isUndefined(a.user) && a.user != b.user && a.x >= b.x - 3 && a.x <= b.x + 3 && a.y >= b.y - 3 && a.y <= b.y + 3; |
|
}), p = { |
|
1: 1, |
|
2: .4, |
|
3: .1 |
|
}; |
|
for (var q in o) { |
|
var r = o[q]; |
|
if (("rampart" == r.type || !c.find(g, { |
|
type: "rampart", |
|
x: r.x, |
|
y: r.y |
|
})) && c.contains([ "creep", "spawn", "rampart", "road", "constructedWall", "extension", "link", "storage" ], r.type) && r.hits) { |
|
var s = Math.max(Math.abs(b.x - r.x), Math.abs(b.y - r.y)); |
|
if (r.hits -= Math.round(n * p[s]), "creep" == r.type && m(r), r.hits <= 0) { |
|
if ("creep" == r.type ? a("./_die")(r, g, i, l) : (i.remove(r._id), delete g[r._id]), |
|
"spawn" == r.type && r.spawning) { |
|
var t = c.find(g, { |
|
user: r.user, |
|
name: r.spawning.name |
|
}); |
|
t && i.remove(t._id); |
|
} |
|
("spawn" == r.type || "extension" == r.type || "link" == r.type || "storage" == r.type) && r.energy > 0 && a("./_create-energy")(r.x, r.y, r.room, r.energy, g, i); |
|
} else "creep" == r.type ? i.update(r, { |
|
hits: r.hits, |
|
body: r.body, |
|
energy: r.energy, |
|
energyCapacity: r.energyCapacity |
|
}) : i.update(r, { |
|
hits: r.hits |
|
}); |
|
r.actionLog && (r.actionLog.attacked = { |
|
x: b.x, |
|
y: b.y |
|
}), r.notifyWhenAttacked && d.sendAttackingNotification(r, k); |
|
} |
|
} |
|
b.actionLog.rangedMassAttack = {}; |
|
} |
|
} |
|
}; |
|
}, { |
|
"../../../core/core": 27, |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
"./_create-energy": 60, |
|
"./_die": 61, |
|
"./_recalc-body": 62, |
|
"./drop-energy": 66, |
|
lodash: 53 |
|
} ], |
|
75: [ function(a, b) { |
|
"use strict"; |
|
var c = a("lodash"), d = (a("../../../utils"), a("../../../game/constants")); |
|
b.exports = function(a, b, e, f, g, h, i, j) { |
|
if ("creep" == a.type && !(a.spawning || a.energy <= 0)) { |
|
var k = e[b.id]; |
|
if (k && c.contains([ "spawn", "extension", "road", "rampart", "constructedWall", "controller", "link", "storage" ], k.type) && !(k.hits >= k.hitsMax) && !(Math.abs(k.x - a.x) > 3 || Math.abs(k.y - a.y) > 3) && k.hitsMax) { |
|
var l = c.filter(a.body, function(a) { |
|
return (a.hits > 0 || a._oldHits > 0) && a.type == d.WORK; |
|
}).length * d.REPAIR_POWER, m = a.energy / d.REPAIR_COST, n = k.hitsMax - k.hits, o = Math.min(l, m, n), p = Math.min(a.energy, Math.ceil(o * d.REPAIR_COST)); |
|
o && (k.hits += o, a.energy -= p, j.inc("energyConstruction", a.user, p), k.hits > k.hitsMax && (k.hits = k.hitsMax), |
|
a.actionLog.repair = { |
|
x: k.x, |
|
y: k.y |
|
}, g.update(k, { |
|
hits: k.hits |
|
}), g.update(a, { |
|
energy: a.energy |
|
})); |
|
} |
|
} |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
lodash: 53 |
|
} ], |
|
76: [ function(a, b) { |
|
"use strict"; |
|
{ |
|
var c = (a("lodash"), a("../../../utils"), a("../../../game/constants")); |
|
a("../../../core/core"); |
|
} |
|
b.exports = function(a, b, d, e, f, g, h, i, j) { |
|
if ("creep" == a.type && !(a.spawning || a.energy < c.CONTROLLER_RESERVE_COST)) { |
|
var k = d[b.id]; |
|
k && "controller" == k.type && (Math.abs(k.x - a.x) > 1 || Math.abs(k.y - a.y) > 1 || k.user || k.reservation && k.reservation.user != a.user || (k.reservation || (k.reservation = { |
|
user: a.user, |
|
endTime: j |
|
}), k.reservation.endTime += c.CONTROLLER_RESERVE, k.reservation.endTime > j + c.CONTROLLER_RESERVE_MAX || (g.inc && g.inc(a.user, "gcl", c.CONTROLLER_RESERVE_COST), |
|
i.inc("energyControl", a.user, c.CONTROLLER_RESERVE_COST), a.energy -= c.CONTROLLER_RESERVE_COST, |
|
a.actionLog.reserveController = { |
|
x: k.x, |
|
y: k.y |
|
}, f.update(a, { |
|
energy: a.energy |
|
}), f.update(k, { |
|
reservation: k.reservation |
|
})))); |
|
} |
|
}; |
|
}, { |
|
"../../../core/core": 27, |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
lodash: 53 |
|
} ], |
|
77: [ function(a, b) { |
|
"use strict"; |
|
{ |
|
var c = a("lodash"); |
|
a("../../../utils"), a("../../../game/constants"); |
|
} |
|
b.exports = function(a, b) { |
|
"creep" == a.type && (a.spawning || c.isString(b.message) && (a.actionLog.say = b.message.substring(0, 10))); |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
lodash: 53 |
|
} ], |
|
78: [ function(a, b) { |
|
"use strict"; |
|
a("lodash"), a("../../../utils"), a("../../../game/constants"); |
|
b.exports = function(b, c, d, e, f) { |
|
"creep" == b.type && (b.spawning || a("./_die")(b, d, f)); |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
"./_die": 61, |
|
lodash: 53 |
|
} ], |
|
79: [ function(a, b) { |
|
"use strict"; |
|
var c = function() { |
|
function a(a, b) { |
|
var c = [], d = !0, e = !1, f = void 0; |
|
try { |
|
for (var g, h = a[Symbol.iterator](); !(d = (g = h.next()).done) && (c.push(g.value), |
|
!b || c.length !== b); d = !0) ; |
|
} catch (i) { |
|
e = !0, f = i; |
|
} finally { |
|
try { |
|
!d && h["return"] && h["return"](); |
|
} finally { |
|
if (e) throw f; |
|
} |
|
} |
|
return c; |
|
} |
|
return function(b, c) { |
|
if (Array.isArray(b)) return b; |
|
if (Symbol.iterator in Object(b)) return a(b, c); |
|
throw new TypeError("Invalid attempt to destructure non-iterable instance"); |
|
}; |
|
}(), d = a("lodash"), e = a("../../../utils"), f = a("../../../game/constants"), g = a("../movement"); |
|
b.exports = function(b, h, i, j, k, l, m, n) { |
|
if (b && "creep" == b.type) { |
|
if (b.spawning) { |
|
var o = d.find(h, { |
|
type: "spawn", |
|
x: b.x, |
|
y: b.y |
|
}); |
|
o ? o.spawning && o.spawning.name == b.name || a("../spawns/_born-creep")(o, b, h, i, j) : j.remove(b._id); |
|
} else { |
|
g.execute(b, j, l); |
|
var p = b.room.match(/^arena(\d)(\d)$/); |
|
if (p && (0 == b.x || 0 == b.y || 49 == b.x || 49 == b.y)) { |
|
var q = parseInt(p[1]), r = parseInt(p[2]), s = b.x, t = b.y, u = b.room; |
|
0 == b.x ? (s = 49, u = "arena" + (q - 1) + r) : 0 == b.y ? (t = 49, u = "arena" + q + (r - 1)) : 49 == b.x ? (s = 0, |
|
u = "arena" + (q + 1) + r) : 49 == b.y && (t = 0, u = "arena" + q + (r + 1)), j.update(b, { |
|
interRoom: { |
|
room: u, |
|
x: s, |
|
y: t |
|
} |
|
}); |
|
} |
|
if (p = b.room.match(/^(W|E)(\d+)(N|S)(\d+)$/), p && (0 == b.x || 0 == b.y || 49 == b.x || 49 == b.y)) { |
|
var v = e.roomNameToXY(b.room), w = c(v, 2), q = w[0], r = w[1], s = b.x, t = b.y, u = b.room; |
|
0 == b.x ? (s = 49, u = e.getRoomNameFromXY(q - 1, r)) : 0 == b.y ? (t = 49, u = e.getRoomNameFromXY(q, r - 1)) : 49 == b.x ? (s = 0, |
|
u = e.getRoomNameFromXY(q + 1, r)) : 49 == b.y && (t = 0, u = e.getRoomNameFromXY(q, r + 1)), |
|
j.update(b, { |
|
interRoom: { |
|
room: u, |
|
x: s, |
|
y: t |
|
} |
|
}); |
|
} |
|
b.tutorial || (b.ageTime || (b.ageTime = n + f.CREEP_LIFE_TIME, j.update(b, { |
|
ageTime: b.ageTime |
|
})), n >= b.ageTime - 1 && (b.energy > 0 && a("./_create-energy")(b.x, b.y, b.room, b.energy, h, j), |
|
j.remove(b._id), delete h[b._id])), d.isEqual(b.actionLog, b._actionLog) || j.update(b, { |
|
actionLog: b.actionLog |
|
}); |
|
} |
|
if (b.fatigue > 0) { |
|
var x = d.filter(b.body, function(a) { |
|
return a.hits > 0 && a.type == f.MOVE; |
|
}).length; |
|
b.fatigue -= 2 * x, b.fatigue < 0 && (b.fatigue = 0), j.update(b._id, { |
|
fatigue: b.fatigue |
|
}); |
|
} |
|
/^arena/.test(b.room) && b.ticksToSpawn > 0 && (b.ticksToSpawn--, j.update(b, { |
|
ticksToSpawn: b.ticksToSpawn |
|
})), d.isNaN(b.hits) && a("./_die")(b, h, j, m); |
|
} |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
"../movement": 90, |
|
"../spawns/_born-creep": 100, |
|
"./_create-energy": 60, |
|
"./_die": 61, |
|
lodash: 53 |
|
} ], |
|
80: [ function(a, b) { |
|
"use strict"; |
|
{ |
|
var c = a("lodash"); |
|
a("../../../utils"), a("../../../game/constants"); |
|
} |
|
b.exports = function(a, b, d, e, f, g) { |
|
if ("creep" == a.type && !(a.spawning || a.energy < b.amount || b.amount < 0)) { |
|
var h = d[b.id]; |
|
if (h && !(Math.abs(h.x - a.x) > 1 || Math.abs(h.y - a.y) > 1)) { |
|
if (/^arena/.test(h.room) && "portal" == h.type) return a.energy -= b.amount, f.update(a, { |
|
energy: a.energy |
|
}), void g.inc(a.user, "arena.score", b.amount); |
|
if (c.contains([ "spawn", "creep", "extension", "link", "storage" ], h.type) && !(h.energy >= h.energyCapacity)) { |
|
var i = b.amount; |
|
h.energy + i > h.energyCapacity && (i = h.energyCapacity - h.energy), h.energy += i, |
|
a.energy -= i, f.update(a, { |
|
energy: a.energy |
|
}), f.update(h, { |
|
energy: h.energy |
|
}); |
|
} |
|
} |
|
} |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
lodash: 53 |
|
} ], |
|
81: [ function(a, b) { |
|
"use strict"; |
|
{ |
|
var c = a("lodash"); |
|
a("../../../utils"), a("../../../game/constants"); |
|
} |
|
b.exports = function(a, b, d, e, f) { |
|
if ("creep" == a.type && !a.spawning) { |
|
var g = d[b.id]; |
|
g && "controller" == g.type && (Math.abs(g.x - a.x) > 1 || Math.abs(g.y - a.y) > 1 || g.user == a.user && (c.forEach(d, function(a) { |
|
"rampart" == a.type && f.update(a, { |
|
hitsMax: 0 |
|
}); |
|
}), f.update(g, { |
|
user: null, |
|
level: 0, |
|
progress: 0, |
|
downgradeTime: null |
|
}))); |
|
} |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
lodash: 53 |
|
} ], |
|
82: [ function(a, b) { |
|
"use strict"; |
|
var c = a("lodash"), d = (a("../../../utils"), a("../../../game/constants")), e = a("../../../core/core"); |
|
b.exports = function(a, b, f, g, h, i, j, k) { |
|
if ("creep" == a.type && !(a.spawning || a.energy <= 0)) { |
|
var l = f[b.id]; |
|
if (l && "controller" == l.type && !(Math.abs(l.x - a.x) > 1 || Math.abs(l.y - a.y) > 1) && 0 != l.level && l.user) { |
|
l._upgraded = l._upgraded || 0; |
|
var m = c.filter(a.body, function(a) { |
|
return (a.hits > 0 || a._oldHits > 0) && a.type == d.WORK; |
|
}).length * d.UPGRADE_CONTROLLER_POWER || 0, n = Math.min(m, a.energy); |
|
if (8 == l.level) { |
|
if (l._upgraded >= d.CONTROLLER_MAX_UPGRADE_PER_TICK) return; |
|
n = Math.min(n, d.CONTROLLER_MAX_UPGRADE_PER_TICK - l._upgraded); |
|
} else l.progress + n >= d.CONTROLLER_LEVELS[l.level] ? (l.progress = l.progress + n - d.CONTROLLER_LEVELS[l.level], |
|
l.level++, e.sendNotification(l.user, "Your Controller in room " + l.room + " has been upgraded to level " + l.level + "."), |
|
8 == l.level && (l.progress = 0)) : l.progress += n; |
|
i.inc && i.inc(l.user, "gcl", n), l._upgraded += n, k.inc("energyControl", a.user, n), |
|
a.energy -= n, a.actionLog.upgradeController = { |
|
x: l.x, |
|
y: l.y |
|
}, h.update(a, { |
|
energy: a.energy |
|
}), h.update(l, { |
|
level: l.level, |
|
progress: l.progress |
|
}); |
|
} |
|
} |
|
}; |
|
}, { |
|
"../../../core/core": 27, |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
lodash: 53 |
|
} ], |
|
83: [ function(a, b) { |
|
"use strict"; |
|
var c = a("lodash"), d = (a("../../../utils"), a("../../../game/constants")); |
|
b.exports = function(a, b, e, f) { |
|
a && "energy" == a.type && (a.energy -= Math.ceil(a.energy / d.ENERGY_DECAY), a.energy <= 0 || !a.energy ? (c.isNaN(a.energy), |
|
f.remove(a._id), delete b[a._id]) : f.update(a, { |
|
energy: a.energy |
|
})); |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
lodash: 53 |
|
} ], |
|
84: [ function(a, b) { |
|
"use strict"; |
|
a("lodash"), a("../../../utils"), a("../../../game/constants"); |
|
b.exports = function(a, b, c, d, e) { |
|
if ("extension" == a.type || "storage" == a.type) { |
|
var f = c[b.id]; |
|
if (!(!f || "creep" != f.type || f.energy >= f.energyCapacity || b.amount < 0 || Math.abs(f.x - a.x) > 1 || Math.abs(f.y - a.y) > 1)) { |
|
var g = b.amount; |
|
f.energy + g > f.energyCapacity && (g = f.energyCapacity - f.energy), a.energy < g || (f.energy += g, |
|
a.energy -= g, e.update(a, { |
|
energy: a.energy |
|
}), e.update(f, { |
|
energy: f.energy |
|
})); |
|
} |
|
} |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
lodash: 53 |
|
} ], |
|
85: [ function(a, b) { |
|
"use strict"; |
|
var c = a("lodash"); |
|
b.exports = function(a, b, d, e, f) { |
|
if (b.remove && f.remove(a._id), b.setColor && c.contains([ "white", "grey", "red", "purple", "blue", "cyan", "green", "yellow", "orange", "brown" ], b.setColor.color) && f.update(a, { |
|
color: b.setColor.color |
|
}), b.setPosition) { |
|
var g = b.setPosition; |
|
g.x >= 0 && g.y >= 0 && g.x <= 49 && g.y <= 49 && /^(W|E)\d+(S|N)\d+$/.test(g.roomName) && f.update(a, { |
|
x: g.x, |
|
y: g.y, |
|
room: g.roomName |
|
}); |
|
} |
|
}; |
|
}, { |
|
lodash: 53 |
|
} ], |
|
86: [ function(a, b) { |
|
"use strict"; |
|
var c = a("lodash"), d = (a("../../../utils"), a("../../../game/constants")); |
|
b.exports = function(a, b, e, f, g, h, i) { |
|
if (a && "keeperLair" == a.type && (a.nextSpawnTime || c.any(b, function(b) { |
|
return "creep" == b.type && "3" == b.user && b.name == "Keeper" + a._id; |
|
}) || f.update(a, { |
|
nextSpawnTime: i + d.ENERGY_REGEN_TIME |
|
}), a.nextSpawnTime && i >= a.nextSpawnTime - 1)) { |
|
for (var j = [], k = 0; 17 > k; k++) j.push({ |
|
type: d.TOUGH, |
|
hits: 100 |
|
}); |
|
for (var k = 0; 13 > k; k++) j.push({ |
|
type: d.MOVE, |
|
hits: 100 |
|
}); |
|
for (var k = 0; 10 > k; k++) j.push({ |
|
type: d.ATTACK, |
|
hits: 100 |
|
}), j.push({ |
|
type: d.RANGED_ATTACK, |
|
hits: 100 |
|
}); |
|
f.insert({ |
|
name: "Keeper" + a._id, |
|
x: a.x, |
|
y: a.y, |
|
body: j, |
|
energy: 0, |
|
energyCapacity: 0, |
|
type: "creep", |
|
room: a.room, |
|
user: "3", |
|
hits: 5e3, |
|
hitsMax: 5e3, |
|
spawning: !1, |
|
fatigue: 0 |
|
}), f.update(a, { |
|
nextSpawnTime: null |
|
}); |
|
} |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
lodash: 53 |
|
} ], |
|
87: [ function(a, b) { |
|
"use strict"; |
|
b.exports = function(b, c, d, e, f, g, h, i) { |
|
c.transferEnergy && a("./transfer-energy")(b, c.transferEnergy, d, e, f, g, h, i); |
|
}; |
|
}, { |
|
"./transfer-energy": 89 |
|
} ], |
|
88: [ function(a, b) { |
|
"use strict"; |
|
a("lodash"), a("../../../utils"), a("../../../game/constants"), a("../movement"); |
|
b.exports = function(a, b, c, d) { |
|
a && "link" == a.type && (a.cooldown > 0 ? (a.cooldown--, a.cooldown < 0 && (a.cooldown = 0), |
|
d.update(a, { |
|
cooldown: a.cooldown, |
|
actionLog: a.actionLog |
|
})) : d.update(a, { |
|
actionLog: a.actionLog |
|
})); |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
"../movement": 90, |
|
lodash: 53 |
|
} ], |
|
89: [ function(a, b) { |
|
"use strict"; |
|
var c = a("lodash"), d = a("../../../utils"), e = a("../../../game/constants"); |
|
b.exports = function(a, b, f, g, h, i, j) { |
|
if ("link" == a.type && !(a.energy < b.amount || b.amount < 0)) { |
|
var k = f[b.id]; |
|
if (k && c.contains([ "link", "creep" ], k.type) && ("creep" != k.type || !(Math.abs(k.x - a.x) > 1 || Math.abs(k.y - a.y) > 1))) { |
|
if ("link" == k.type) { |
|
if (a.cooldown > 0) return; |
|
if (!d.checkStructureAgainstController(a, f, j)) return; |
|
} |
|
if (k.energy != k.energyCapacity) { |
|
var l = b.amount; |
|
k.energy + l > k.energyCapacity && (l = k.energyCapacity - k.energy), k.energy += l, |
|
a.energy -= l, "link" == k.type && (k.energy -= Math.ceil(l * e.LINK_LOSS_RATIO), |
|
a.cooldown += e.LINK_COOLDOWN * Math.max(Math.abs(k.x - a.x), Math.abs(k.y - a.y)), |
|
a.actionLog.transferEnergy = { |
|
x: k.x, |
|
y: k.y |
|
}), h.update(a, { |
|
energy: a.energy, |
|
cooldown: a.cooldown, |
|
actionLog: a.actionLog |
|
}), h.update(k, { |
|
energy: k.energy |
|
}); |
|
} |
|
} |
|
} |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
lodash: 53 |
|
} ], |
|
90: [ function(a, b, c) { |
|
"use strict"; |
|
function d(a, b, c) { |
|
return k.any(h, function(d) { |
|
return d.x == a && d.y == b && (k.contains(m.OBSTACLE_OBJECT_TYPES, d.type) && ("creep" != d.type || !f[d._id]) || "rampart" == d.type && d.user != c.user || "exit" == d.type && "2" != c.user && !/^arena/.test(c.room) || "constructionSite" == d.type && d.user == c.user && k.contains(m.OBSTACLE_OBJECT_TYPES, d.structureType)); |
|
}) || l.checkTerrain(i, a, b, m.TERRAIN_MASK_WALL); |
|
} |
|
var e, f, g, h, i, j = function() { |
|
function a(a, b) { |
|
var c = [], d = !0, e = !1, f = void 0; |
|
try { |
|
for (var g, h = a[Symbol.iterator](); !(d = (g = h.next()).done) && (c.push(g.value), |
|
!b || c.length !== b); d = !0) ; |
|
} catch (i) { |
|
e = !0, f = i; |
|
} finally { |
|
try { |
|
!d && h["return"] && h["return"](); |
|
} finally { |
|
if (e) throw f; |
|
} |
|
} |
|
return c; |
|
} |
|
return function(b, c) { |
|
if (Array.isArray(b)) return b; |
|
if (Symbol.iterator in Object(b)) return a(b, c); |
|
throw new TypeError("Invalid attempt to destructure non-iterable instance"); |
|
}; |
|
}(), k = a("lodash"), l = a("../../utils"), m = a("../../game/constants"); |
|
c.init = function(a, b) { |
|
e = {}, f = {}, g = {}, h = a, i = b; |
|
}, c.add = function(a, b, c) { |
|
var d = a.x + b, f = a.y + c; |
|
d >= 50 && (d = 49), f >= 50 && (f = 49), 0 > d && (d = 0), 0 > f && (f = 0); |
|
var h = d + "," + f; |
|
e[h] = e[h] || [], e[h].push(a), g[h] = g[h] + 1 || 1; |
|
}, c.check = function() { |
|
function a(b) { |
|
var c = e[b]; |
|
if (f[e[b]._id] = null, delete e[b], c) { |
|
var d = c.x + "," + c.y; |
|
e[d] && a(d); |
|
} |
|
} |
|
var b = {}; |
|
for (var c in e) { |
|
var h, i = c.split(/,/), l = j(i, 2), n = l[0], o = l[1]; |
|
if (n = parseInt(n), o = parseInt(o), e[c].length > 1) { |
|
var p = k.map(e[c], function(a) { |
|
var b = k.filter(a.body, function(a) { |
|
return a.hits > 0 && a.type == m.MOVE; |
|
}).length, c = k.filter(a.body, function(a) { |
|
return a.type != m.MOVE && a.type != m.CARRY; |
|
}).length; |
|
c += Math.ceil(a.energy / m.CARRY_CAPACITY), c = c || 1; |
|
var d = a.x + "," + a.y, f = g[d] || 0; |
|
return e[d] && k.any(e[d], { |
|
x: n, |
|
y: o |
|
}) && (f = 100), { |
|
object: a, |
|
rate1: f, |
|
rate2: b / c |
|
}; |
|
}); |
|
p.sort(function(a, b) { |
|
return b.rate1 - a.rate1 != 0 ? b.rate1 - a.rate1 : b.rate2 - a.rate2; |
|
}), h = p[0].object; |
|
} else h = e[c][0]; |
|
f[h._id] = { |
|
x: n, |
|
y: o |
|
}, b[c] = h; |
|
} |
|
e = b; |
|
for (var c in e) { |
|
var q = c.split(/,/), r = j(q, 2), n = r[0], o = r[1]; |
|
n = parseInt(n), o = parseInt(o); |
|
var s = e[c], t = (n - s.x, o - s.y, d(n, o, s)); |
|
t && a(c); |
|
} |
|
}, c.execute = function(b, c) { |
|
var d = f[b._id]; |
|
if (d) { |
|
var e = k.filter(h, function(a) { |
|
return a.x == d.x && a.y == d.y; |
|
}), g = 2; |
|
(k.any(e, { |
|
type: "swamp" |
|
}) || l.checkTerrain(i, d.x, d.y, m.TERRAIN_MASK_SWAMP)) && (g = 10); |
|
var j = k.find(e, { |
|
type: "road" |
|
}); |
|
j && (g = 1, j.nextDecayTime -= m.ROAD_WEAROUT * b.body.length, c.update(j, { |
|
nextDecayTime: j.nextDecayTime |
|
})); |
|
var n = k.find(e, function(a) { |
|
return "constructionSite" == a.type && a.user != b.user; |
|
}); |
|
n && a("./construction-sites/remove")(n, h, c); |
|
var o = k(b.body).filter(function(a) { |
|
return a.type != m.MOVE && a.type != m.CARRY; |
|
}).size(); |
|
o += Math.ceil(b.energy / m.CARRY_CAPACITY), o *= g, c.update(b, { |
|
x: d.x, |
|
y: d.y, |
|
fatigue: o |
|
}); |
|
} |
|
}; |
|
}, { |
|
"../../game/constants": 38, |
|
"../../utils": 108, |
|
"./construction-sites/remove": 56, |
|
lodash: 53 |
|
} ], |
|
91: [ function(a, b) { |
|
"use strict"; |
|
var c = function() { |
|
function a(a, b) { |
|
var c = [], d = !0, e = !1, f = void 0; |
|
try { |
|
for (var g, h = a[Symbol.iterator](); !(d = (g = h.next()).done) && (c.push(g.value), |
|
!b || c.length !== b); d = !0) ; |
|
} catch (i) { |
|
e = !0, f = i; |
|
} finally { |
|
try { |
|
!d && h["return"] && h["return"](); |
|
} finally { |
|
if (e) throw f; |
|
} |
|
} |
|
return c; |
|
} |
|
return function(b, c) { |
|
if (Array.isArray(b)) return b; |
|
if (Symbol.iterator in Object(b)) return a(b, c); |
|
throw new TypeError("Invalid attempt to destructure non-iterable instance"); |
|
}; |
|
}(), d = a("lodash"), e = a("../../../utils"), f = a("../../../game/constants"); |
|
b.exports = function(b, g, h, i) { |
|
if (b && "portal" == b.type) { |
|
b.ticksToSpawn > 0 && b.ticksToSpawn--; |
|
var j = d.filter(g, { |
|
x: b.x, |
|
y: b.y, |
|
type: "creep", |
|
spawning: !0, |
|
ticksToSpawn: 0 |
|
}); |
|
if (j.length > 0 && !b.ticksToSpawn) { |
|
for (var k, l, m, n = j[Math.floor(Math.random() * j.length)], o = function(a) { |
|
return d.contains(f.OBSTACLE_OBJECT_TYPES, a.type) && a.x == k && a.y == l; |
|
}, p = 1; 8 >= p; p++) { |
|
var q = e.getOffsetsByDirection(p), r = c(q, 2), s = r[0], t = r[1]; |
|
if (k = b.x + s, l = b.y + t, m = d.any(g, o) || e.checkTerrain(h, k, l, f.TERRAIN_MASK_WALL), |
|
!m) break; |
|
} |
|
if (m) for (var p = 1; 8 >= p; p++) { |
|
var u = e.getOffsetsByDirection(p), v = c(u, 2), s = v[0], t = v[1]; |
|
if (k = b.x + s, l = b.y + t, m = d.any(g, function(a) { |
|
return "creep" == a.type && a.x == k && a.y == l && a.user == n.user; |
|
}) || e.checkTerrain(h, k, l, f.TERRAIN_MASK_WALL), !m) { |
|
var w = d.find(g, { |
|
x: k, |
|
y: l |
|
}); |
|
w && a("../creeps/_die")(w, g, i); |
|
break; |
|
} |
|
} |
|
m || i.update(n, { |
|
x: k, |
|
y: l, |
|
spawning: !1, |
|
ticksToSpawn: null |
|
}), b.ticksToSpawn = 5; |
|
} |
|
i.update(b, { |
|
ticksToSpawn: b.ticksToSpawn |
|
}); |
|
} |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
"../creeps/_die": 61, |
|
lodash: 53 |
|
} ], |
|
92: [ function(a, b) { |
|
"use strict"; |
|
var c = (a("lodash"), a("../../../utils"), a("../../../game/constants")); |
|
b.exports = function(a, b, d, e, f, g, h) { |
|
if (a && "rampart" == a.type) { |
|
if (g) { |
|
var i = c.RAMPART_HITS_MAX[g.level] || 0; |
|
i != a.hitsMax && e.update(a, { |
|
hitsMax: i |
|
}); |
|
} |
|
(!a.nextDecayTime || h >= a.nextDecayTime - 1) && (a.hits = a.hits || 0, a.hits -= c.RAMPART_DECAY_AMOUNT, |
|
a.hits <= 0 ? (e.remove(a._id), delete b[a._id]) : (a.nextDecayTime = h + c.RAMPART_DECAY_TIME, |
|
e.update(a, { |
|
hits: a.hits, |
|
nextDecayTime: a.nextDecayTime |
|
}))); |
|
} |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
lodash: 53 |
|
} ], |
|
93: [ function(a, b) { |
|
"use strict"; |
|
var c = a("lodash"), d = a("../../../utils"), e = a("../../../game/constants"); |
|
b.exports = function(a, b, f, g, h, i, j) { |
|
if (a && "road" == a.type && (!a.nextDecayTime || j >= a.nextDecayTime - 1)) { |
|
var k = e.ROAD_DECAY_AMOUNT; |
|
(c.any(b, function(b) { |
|
return b.x == a.x && b.y == a.y && "swamp" == b.type; |
|
}) || d.checkTerrain(f, a.x, a.y, e.TERRAIN_MASK_SWAMP)) && (k *= e.CONSTRUCTION_COST_ROAD_SWAMP_RATIO), |
|
a.hits -= k, a.hits <= 0 ? (g.remove(a._id), delete b[a._id]) : (a.nextDecayTime = j + e.ROAD_DECAY_TIME, |
|
g.update(a, { |
|
hits: a.hits, |
|
nextDecayTime: a.nextDecayTime |
|
})); |
|
} |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
lodash: 53 |
|
} ], |
|
94: [ function(a, b) { |
|
"use strict"; |
|
var c = a("lodash"), d = a("../../../utils"), e = a("../../../game/constants"), f = 0; |
|
b.exports = function(a, b, g, h, i, j) { |
|
if (!(a.x < 0 || a.x > 49 || a.y < 0 || a.y > 49) && c.contains([ "spawn", "extension", "road", "rampart", "constructedWall", "link", "storage" ], a.structureType)) { |
|
if (/^(W|E)/.test(a.roomName)) { |
|
if (j && (j.user && j.user != a.user || j.reservation && j.reservation.user != a.user)) return; |
|
if (!d.checkControllerAvailability(a.structureType, b, j)) return; |
|
} |
|
if (d.checkConstructionSite(b, a.structureType, a.x, a.y) && d.checkConstructionSite(g, a.structureType, a.x, a.y)) { |
|
var k = e.CONSTRUCTION_COST[a.structureType]; |
|
"road" == a.structureType && (c.any(b, { |
|
x: a.x, |
|
y: a.y, |
|
type: "swamp" |
|
}) || d.checkTerrain(g, a.x, a.y, e.TERRAIN_MASK_SWAMP)) && (k *= e.CONSTRUCTION_COST_ROAD_SWAMP_RATIO); |
|
var l = { |
|
structureType: a.structureType, |
|
x: a.x, |
|
y: a.y, |
|
type: "constructionSite", |
|
room: a.roomName, |
|
user: a.user, |
|
progress: 0, |
|
progressTotal: k |
|
}; |
|
"spawn" == a.structureType && (l.name = a.name), h.insert(l), b["_createdConstructionSite" + f] = l, |
|
f++; |
|
} |
|
} |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
lodash: 53 |
|
} ], |
|
95: [ function(a, b) { |
|
"use strict"; |
|
{ |
|
var c = a("lodash"); |
|
a("../../../utils"), a("../../../game/constants"); |
|
} |
|
b.exports = function(a, b, d, e) { |
|
c.any(b, { |
|
type: "flag", |
|
user: a.user, |
|
name: a.name |
|
}) || a.color && c.contains([ "white", "grey", "red", "purple", "blue", "cyan", "green", "yellow", "orange", "brown" ], a.color) && (a.x < 0 || a.x > 49 || a.y < 0 || a.y > 49 || e.insert({ |
|
name: a.name, |
|
x: a.x, |
|
y: a.y, |
|
type: "flag", |
|
room: a.roomName, |
|
user: a.user, |
|
color: a.color |
|
})); |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
lodash: 53 |
|
} ], |
|
96: [ function(a, b) { |
|
"use strict"; |
|
var c = a("lodash"), d = (a("../../../utils"), a("../../../game/constants")); |
|
b.exports = function(b, e, f, g, h, i) { |
|
var j = e[b.id]; |
|
if (j && d.CONSTRUCTION_COST[j.type] && i && i.user == b.user) { |
|
if (g.remove(j._id), "spawn" == j.type && j.spawning) { |
|
var k = c.find(e, { |
|
user: j.user, |
|
name: j.spawning.name |
|
}); |
|
k && g.remove(k._id); |
|
} |
|
j.energy > 0 && a("../creeps/_create-energy")(j.x, j.y, j.room, j.energy, e, g), |
|
"constructedWall" == j.type && j.decayTime && j.user && a("../creeps/_clear-newbie-walls")(e, g); |
|
} |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
"../creeps/_clear-newbie-walls": 59, |
|
"../creeps/_create-energy": 60, |
|
lodash: 53 |
|
} ], |
|
97: [ function(a, b) { |
|
"use strict"; |
|
var c = a("lodash"), d = a("../../../utils"), e = a("../../../game/constants"); |
|
b.exports = function(a, b, f, g) { |
|
if ("3" == a.user) { |
|
var h, i; |
|
do h = Math.floor(48 * Math.random()) + 1, i = Math.floor(48 * Math.random()) + 1; while (c.any(b, function(a) { |
|
return c.contains(e.OBSTACLE_OBJECT_TYPES, a.type) && a.x == h && a.y == i; |
|
}) || d.checkTerrain(f, h, i, e.TERRAIN_MASK_WALL)); |
|
g.insert({ |
|
x: h, |
|
y: i, |
|
type: "energy", |
|
energy: 300, |
|
room: a.roomName |
|
}); |
|
} |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
lodash: 53 |
|
} ], |
|
98: [ function(a, b) { |
|
"use strict"; |
|
var c = a("lodash"); |
|
b.exports = function(b, d, e, f, g, h) { |
|
b.createFlag && c.forEach(b.createFlag, function(b) { |
|
a("./create-flag")(b, d, e, f, g, h); |
|
}), b.createConstructionSite && c.forEach(b.createConstructionSite, function(b) { |
|
a("./create-construction-site")(b, d, e, f, g, h); |
|
}), b.destroyStructure && c.forEach(b.destroyStructure, function(b) { |
|
a("./destroy-structure")(b, d, e, f, g, h); |
|
}), b.genEnergy && a("./gen-energy")(b.genEnergy, d, e, f, g, h); |
|
}; |
|
}, { |
|
"./create-construction-site": 94, |
|
"./create-flag": 95, |
|
"./destroy-structure": 96, |
|
"./gen-energy": 97, |
|
lodash: 53 |
|
} ], |
|
99: [ function(a, b) { |
|
"use strict"; |
|
var c = (a("lodash"), a("../../../utils"), a("../../../game/constants")); |
|
b.exports = function(a, b, d, e, f, g, h) { |
|
a && "source" == a.type && a.energy < a.energyCapacity && (a.nextRegenerationTime || (a.nextRegenerationTime = h + c.ENERGY_REGEN_TIME, |
|
e.update(a, { |
|
nextRegenerationTime: a.nextRegenerationTime |
|
})), h >= a.nextRegenerationTime - 1 && (a.energy += Math.min(a.energyCapacity - a.energy, c.ENERGY_REGEN_AMOUNT), |
|
e.update(a, { |
|
nextRegenerationTime: null, |
|
energy: a.energy |
|
}))); |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
lodash: 53 |
|
} ], |
|
100: [ function(a, b) { |
|
"use strict"; |
|
var c = function() { |
|
function a(a, b) { |
|
var c = [], d = !0, e = !1, f = void 0; |
|
try { |
|
for (var g, h = a[Symbol.iterator](); !(d = (g = h.next()).done) && (c.push(g.value), |
|
!b || c.length !== b); d = !0) ; |
|
} catch (i) { |
|
e = !0, f = i; |
|
} finally { |
|
try { |
|
!d && h["return"] && h["return"](); |
|
} finally { |
|
if (e) throw f; |
|
} |
|
} |
|
return c; |
|
} |
|
return function(b, c) { |
|
if (Array.isArray(b)) return b; |
|
if (Symbol.iterator in Object(b)) return a(b, c); |
|
throw new TypeError("Invalid attempt to destructure non-iterable instance"); |
|
}; |
|
}(), d = a("lodash"), e = a("../../../utils"), f = a("../../../game/constants"); |
|
b.exports = function(a, b, g, h, i) { |
|
for (var j, k, l, m = function(a) { |
|
return d.contains(f.OBSTACLE_OBJECT_TYPES, a.type) && a.x == j && a.y == k; |
|
}, n = 1; 8 >= n; n++) { |
|
var o = e.getOffsetsByDirection(n), p = c(o, 2), q = p[0], r = p[1]; |
|
if (j = a.x + q, k = a.y + r, l = d.any(g, m) || e.checkTerrain(h, j, k, f.TERRAIN_MASK_WALL), |
|
!l) break; |
|
} |
|
return l || i.update(b, { |
|
x: j, |
|
y: k, |
|
spawning: !1 |
|
}), !l; |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
lodash: 53 |
|
} ], |
|
101: [ function(a, b) { |
|
"use strict"; |
|
var c = a("lodash"), d = a("../../../utils"), e = a("../../../game/constants"); |
|
b.exports = function(a, b, f, g, h, i, j, k) { |
|
if (!a.spawning && "spawn" == a.type && d.checkStructureAgainstController(a, f, j)) { |
|
var l = c.filter(f, { |
|
type: "spawn" |
|
}); |
|
b.body = b.body.slice(0, e.MAX_CREEP_SIZE); |
|
var m = d.calcCreepCost(b.body), n = c.sum(l, "energy"), o = c.filter(f, function(b) { |
|
return "extension" == b.type && b.energy > 0 && b.user == a.user; |
|
}); |
|
if (/^(W|E)/.test(a.room) && (j.level < 2 && (o = []), o.length > e.CONTROLLER_STRUCTURES.extension[j.level] && (o.sort(d.comparatorDistance(j)), |
|
o = c.take(o, e.CONTROLLER_STRUCTURES.extension[j.level]))), n += c.sum(o, "energy"), |
|
!(m > n)) { |
|
o.sort(d.comparatorDistance(a)), k.inc("energyCreeps", a.user, m), l.forEach(function(a) { |
|
var b = Math.min(m, a.energy); |
|
a.energy -= b, m -= b, h.update(a, { |
|
energy: a.energy |
|
}); |
|
}), o.forEach(function(a) { |
|
if (!(0 >= m)) { |
|
var b = Math.min(m, a.energy); |
|
a.energy -= b, m -= b, h.update(a, { |
|
energy: a.energy |
|
}); |
|
} |
|
}), k.inc("creepsProduced", a.user, b.body.length), h.update(a, { |
|
spawning: { |
|
name: b.name, |
|
needTime: e.CREEP_SPAWN_TIME * b.body.length, |
|
remainingTime: e.CREEP_SPAWN_TIME * b.body.length |
|
} |
|
}); |
|
var p = [], q = 0; |
|
b.body.forEach(function(a) { |
|
c.contains(e.BODYPARTS_ALL, a) && p.push({ |
|
type: a, |
|
hits: 100 |
|
}), a == e.CARRY && (q += e.CARRY_CAPACITY); |
|
}); |
|
var r = { |
|
name: b.name, |
|
x: a.x, |
|
y: a.y, |
|
body: p, |
|
energy: 0, |
|
energyCapacity: q, |
|
type: "creep", |
|
room: a.room, |
|
user: a.user, |
|
hits: 100 * p.length, |
|
hitsMax: 100 * p.length, |
|
spawning: !0, |
|
fatigue: 0, |
|
notifyWhenAttacked: !0 |
|
}; |
|
a.tutorial && (r.tutorial = !0), h.insert(r); |
|
} |
|
} |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
lodash: 53 |
|
} ], |
|
102: [ function(a, b) { |
|
"use strict"; |
|
b.exports = function(b, c, d, e, f, g, h, i) { |
|
c.createCreep && a("./create-creep")(b, c.createCreep, d, e, f, g, h, i), c.transferEnergy && a("./transfer-energy")(b, c.transferEnergy, d, e, f, g, h); |
|
}; |
|
}, { |
|
"./create-creep": 101, |
|
"./transfer-energy": 104 |
|
} ], |
|
103: [ function(a, b) { |
|
"use strict"; |
|
var c = a("lodash"), d = a("../../../utils"), e = a("../../../game/constants"); |
|
b.exports = function(b, f, g, h, i, j, k) { |
|
if (b && "spawn" == b.type) { |
|
if (b.spawning) if (b.spawning.remainingTime--, b.spawning.remainingTime <= 0) { |
|
var l = c.find(f, { |
|
type: "creep", |
|
name: b.spawning.name, |
|
x: b.x, |
|
y: b.y |
|
}), m = a("./_born-creep")(b, l, f, g, h); |
|
m ? h.update(b, { |
|
spawning: null |
|
}) : h.update(b, { |
|
spawning: { |
|
remainingTime: 0 |
|
} |
|
}); |
|
} else h.update(b, { |
|
spawning: { |
|
remainingTime: b.spawning.remainingTime |
|
} |
|
}); |
|
if (j && !(j.level < 1) && j.user == b.user) { |
|
var n = c.filter(f, { |
|
type: "spawn" |
|
}); |
|
n.length > e.CONTROLLER_STRUCTURES.spawn[j.level] && (n.sort(d.comparatorDistance(j)), |
|
n = c.take(n, e.CONTROLLER_STRUCTURES.spawn[j.level]), !c.contains(n, b)) || !b.tutorial && k < e.SPAWN_ENERGY_CAPACITY && b.energy < e.SPAWN_ENERGY_CAPACITY && (b.energy++, |
|
h.update(b, { |
|
energy: b.energy |
|
})); |
|
} |
|
} |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
"./_born-creep": 100, |
|
lodash: 53 |
|
} ], |
|
104: [ function(a, b) { |
|
"use strict"; |
|
a("lodash"), a("../../../utils"), a("../../../game/constants"); |
|
b.exports = function(a, b, c, d, e) { |
|
if ("spawn" == a.type) { |
|
var f = c[b.id]; |
|
if (!(!f || "creep" != f.type || f.energy >= f.energyCapacity || b.amount < 0 || Math.abs(f.x - a.x) > 1 || Math.abs(f.y - a.y) > 1)) { |
|
var g = b.amount; |
|
f.energy + g > f.energyCapacity && (g = f.energyCapacity - f.energy), a.energy < g || (f.energy += g, |
|
a.energy -= g, e.update(a, { |
|
energy: a.energy |
|
}), e.update(f, { |
|
energy: f.energy |
|
})); |
|
} |
|
} |
|
}; |
|
}, { |
|
"../../../game/constants": 38, |
|
"../../../utils": 108, |
|
lodash: 53 |
|
} ], |
|
105: [ function(a, b) { |
|
"use strict"; |
|
function c(a) { |
|
for (var b = [], c = { |
|
M: "move", |
|
A: "attack", |
|
R: "ranged_attack", |
|
T: "tough", |
|
H: "heal" |
|
}, d = 0; d < a.length; d++) b.push(c[a.charAt(d)]); |
|
return b; |
|
} |
|
var d = a("../../core/core.js"), e = (a("q"), a("lodash")), f = (a("../../game/constants"), |
|
{ |
|
1: [ { |
|
name: "Normal", |
|
body: [ "move", "attack" ] |
|
} ], |
|
2: [ { |
|
name: "Normal", |
|
body: [ "move", "ranged_attack", "move", "attack" ] |
|
}, { |
|
name: "Normal", |
|
body: [ "tough", "move", "attack" ] |
|
} ], |
|
3: [ { |
|
name: "Siege", |
|
body: [ "tough", "tough", "tough", "move", "ranged_attack", "move", "attack" ] |
|
}, { |
|
name: "Normal", |
|
body: [ "tough", "move", "attack" ] |
|
}, { |
|
name: "Normal", |
|
body: [ "tough", "move", "heal", "move", "attack" ] |
|
} ], |
|
4: [ { |
|
name: "Siege", |
|
body: [ "tough", "tough", "tough", "move", "ranged_attack", "move", "attack" ] |
|
}, { |
|
name: "Normal", |
|
body: [ "tough", "ranged_attack", "move", "attack" ] |
|
}, { |
|
name: "Normal", |
|
body: [ "tough", "move", "attack" ] |
|
}, { |
|
name: "Normal", |
|
body: [ "move", "heal" ] |
|
} ], |
|
5: [ { |
|
name: "Siege", |
|
body: [ "tough", "tough", "tough", "move", "ranged_attack", "move", "attack", "move", "attack" ] |
|
}, { |
|
name: "Defend", |
|
body: [ "tough", "move", "ranged_attack", "move", "move", "ranged_attack", "move", "attack" ] |
|
}, { |
|
name: "Normal", |
|
body: [ "tough", "ranged_attack", "move", "attack" ] |
|
}, { |
|
name: "Normal", |
|
body: [ "tough", "move", "attack" ] |
|
}, { |
|
name: "Normal", |
|
body: [ "move", "heal" ] |
|
} ], |
|
6: [ { |
|
name: "Siege", |
|
body: [ "tough", "tough", "tough", "move", "ranged_attack", "move", "attack", "move", "attack", "attack" ] |
|
}, { |
|
name: "Defend", |
|
body: [ "tough", "move", "tough", "move", "ranged_attack", "move", "move", "ranged_attack", "move", "attack" ] |
|
}, { |
|
name: "Normal", |
|
body: [ "tough", "ranged_attack", "move", "attack" ] |
|
}, { |
|
name: "Defend", |
|
body: [ "tough", "move", "attack" ] |
|
}, { |
|
name: "Normal", |
|
body: [ "tough", "move", "heal", "move", "heal" ] |
|
} ], |
|
7: [ { |
|
name: "Siege", |
|
body: [ "tough", "tough", "tough", "move", "ranged_attack", "move", "attack", "move", "attack", "attack" ] |
|
}, { |
|
name: "Defend", |
|
body: [ "tough", "move", "tough", "move", "ranged_attack", "move", "move", "ranged_attack", "move", "attack" ] |
|
}, { |
|
name: "Defend", |
|
body: [ "tough", "tough", "ranged_attack", "move", "ranged_attack", "move", "ranged_attack", "move", "attack" ] |
|
}, { |
|
name: "Normal", |
|
body: [ "tough", "tough", "ranged_attack", "move", "ranged_attack", "move", "ranged_attack", "move", "attack" ] |
|
}, { |
|
name: "Normal", |
|
body: [ "tough", "move", "heal", "move", "move", "heal", "move", "attack" ] |
|
} ], |
|
8: [ { |
|
name: "Siege", |
|
body: [ "tough", "tough", "tough", "move", "ranged_attack", "move", "attack", "move", "attack", "attack" ] |
|
}, { |
|
name: "Defend", |
|
body: [ "tough", "move", "tough", "move", "ranged_attack", "move", "move", "ranged_attack", "move", "attack" ] |
|
}, { |
|
name: "Defend", |
|
body: [ "tough", "tough", "ranged_attack", "move", "ranged_attack", "move", "ranged_attack", "move", "attack" ] |
|
}, { |
|
name: "Normal", |
|
body: [ "tough", "tough", "ranged_attack", "move", "ranged_attack", "move", "ranged_attack", "move", "attack" ] |
|
}, { |
|
name: "Normal", |
|
body: [ "tough", "move", "heal", "move", "move", "heal", "move", "attack" ] |
|
}, { |
|
name: "Defend", |
|
body: [ "tough", "move", "tough", "move", "ranged_attack", "move", "move", "ranged_attack", "move", "attack" ] |
|
}, { |
|
name: "Defend", |
|
body: [ "tough", "move", "tough", "move", "ranged_attack", "move", "move", "ranged_attack", "move", "attack" ] |
|
} ], |
|
9: [ { |
|
name: "Siege", |
|
body: [ "tough", "tough", "tough", "move", "ranged_attack", "attack", "attack", "attack", "attack", "move", "attack", "move", "attack", "attack" ] |
|
}, { |
|
name: "Defend", |
|
body: [ "tough", "move", "tough", "move", "ranged_attack", "move", "move", "ranged_attack", "move", "attack" ] |
|
}, { |
|
name: "Defend", |
|
body: [ "tough", "tough", "ranged_attack", "move", "ranged_attack", "move", "ranged_attack", "move", "attack" ] |
|
}, { |
|
name: "Normal", |
|
body: [ "tough", "tough", "ranged_attack", "move", "ranged_attack", "move", "ranged_attack", "move", "attack" ] |
|
}, { |
|
name: "Normal", |
|
body: [ "tough", "move", "heal", "move", "move", "heal", "move", "attack" ] |
|
}, { |
|
name: "Defend", |
|
body: [ "tough", "move", "tough", "move", "ranged_attack", "move", "move", "ranged_attack", "move", "attack" ] |
|
}, { |
|
name: "Defend", |
|
body: [ "tough", "move", "tough", "move", "ranged_attack", "move", "move", "ranged_attack", "move", "attack" ] |
|
}, { |
|
name: "Normal", |
|
body: [ "tough", "move", "heal", "move", "move", "heal", "move", "attack" ] |
|
} ], |
|
10: [ { |
|
name: "Siege", |
|
body: [ "tough", "tough", "tough", "move", "ranged_attack", "attack", "attack", "attack", "attack", "move", "attack", "move", "attack", "attack" ] |
|
}, { |
|
name: "Siege", |
|
body: [ "tough", "tough", "tough", "move", "ranged_attack", "attack", "attack", "attack", "attack", "move", "attack", "move", "attack", "attack" ] |
|
}, { |
|
name: "Defend", |
|
body: [ "tough", "tough", "tough", "move", "ranged_attack", "move", "ranged_attack", "move", "attack", "move", "ranged_attack", "move", "move", "ranged_attack", "move", "attack" ] |
|
}, { |
|
name: "Normal", |
|
body: [ "tough", "tough", "ranged_attack", "move", "ranged_attack", "move", "ranged_attack", "move", "attack" ] |
|
}, { |
|
name: "Normal", |
|
body: [ "tough", "move", "heal", "move", "move", "heal", "move", "attack" ] |
|
}, { |
|
name: "Defend", |
|
body: [ "tough", "move", "tough", "move", "ranged_attack", "move", "move", "ranged_attack", "move", "attack" ] |
|
}, { |
|
name: "Defend", |
|
body: [ "tough", "move", "tough", "move", "ranged_attack", "move", "move", "ranged_attack", "move", "attack" ] |
|
}, { |
|
name: "Normal", |
|
body: [ "tough", "move", "heal", "move", "move", "heal", "move", "attack" ] |
|
} ], |
|
11: [ { |
|
name: "Siege", |
|
body: c("TTTMRAAAAMAMRR") |
|
}, { |
|
name: "Siege", |
|
body: c("TTTMRAAAAMAMRR") |
|
}, { |
|
name: "Defend", |
|
body: c("TTTMRMRMAMRMMRMA") |
|
}, { |
|
name: "Normal", |
|
body: c("TTRMRMRMA") |
|
}, { |
|
name: "Normal", |
|
body: c("TMHHHHMMHMR") |
|
}, { |
|
name: "Defend", |
|
body: c("TTTTMMRRRRMMRMR") |
|
}, { |
|
name: "Defend", |
|
body: c("TTTTMMRRRRMMRMR") |
|
}, { |
|
name: "Normal", |
|
body: c("TMHMMHMR") |
|
} ], |
|
12: [ { |
|
name: "Siege", |
|
body: c("TTTMRAAAAMAMRR") |
|
}, { |
|
name: "Siege", |
|
body: c("TTTMRAAAAMAMRR") |
|
}, { |
|
name: "Defend", |
|
body: c("TTTMRMRMAMRMMRMA") |
|
}, { |
|
name: "Normal", |
|
body: c("TTRMRMRMA") |
|
}, { |
|
name: "Normal", |
|
body: c("TMHHHHMMHMR") |
|
}, { |
|
name: "Defend", |
|
body: c("TTTTMMRRRRMMRMR") |
|
}, { |
|
name: "Defend", |
|
body: c("TTTTMMRRRRMMRMR") |
|
}, { |
|
name: "Normal", |
|
body: c("TMHMMHMR") |
|
} ], |
|
13: [ { |
|
name: "Siege", |
|
body: c("TTTTRAMMRAAAAMAMRR") |
|
}, { |
|
name: "Siege", |
|
body: c("TTTTRAMMRAAAAMAMRR") |
|
}, { |
|
name: "Defend", |
|
body: c("TTTRMRMRMMRMRMAMRMMRMA") |
|
}, { |
|
name: "Normal", |
|
body: c("TTRMRMRMA") |
|
}, { |
|
name: "Normal", |
|
body: c("TTMHMHMHMMHHHHMMHMR") |
|
}, { |
|
name: "Defend", |
|
body: c("TTTTMMRRRRMMRMR") |
|
}, { |
|
name: "Defend", |
|
body: c("TTTTMMRRRRMMRMR") |
|
}, { |
|
name: "Normal", |
|
body: c("TRRHMHMMHMMHMR") |
|
}, { |
|
name: "Normal", |
|
body: c("TRRHMHMMHMMHMR") |
|
} ], |
|
14: [ { |
|
name: "Siege", |
|
body: c("TTTTTRAMRAMMRAAAAMRMRR") |
|
}, { |
|
name: "Siege", |
|
body: c("TTTTTRAMRAMMRAAAAMRMRR") |
|
}, { |
|
name: "Defend", |
|
body: c("TTTTTMMRMRMRMMRMRMAMRMMRMA") |
|
}, { |
|
name: "Normal", |
|
body: c("TTTTRMRMRMRMR") |
|
}, { |
|
name: "Normal", |
|
body: c("TTTMMHMHMHMMHHHHMMHMR") |
|
}, { |
|
name: "Defend", |
|
body: c("TTTTMMRRRRMMRMR") |
|
}, { |
|
name: "Defend", |
|
body: c("TTTTMMRRRRMMRMR") |
|
}, { |
|
name: "Normal", |
|
body: c("TRRHMHMMHMMHMR") |
|
}, { |
|
name: "Normal", |
|
body: c("TRRHMHMMHMMHMR") |
|
}, { |
|
name: "Defend", |
|
body: c("TTTTMMRRRRMMRMA") |
|
} ], |
|
15: [ { |
|
name: "Siege", |
|
body: c("TTTAAAAAAARRRRMRAMMRAAAAMRMRR") |
|
}, { |
|
name: "Siege", |
|
body: c("TTTAAAAAAARRRRMRAMMRAAAAMRMRR") |
|
}, { |
|
name: "Defend", |
|
body: c("TTTRRRMMMRMRMRMMRMRMAMRMMRMA") |
|
}, { |
|
name: "Normal", |
|
body: c("TTTRRMRMRMRMRMRMRMA") |
|
}, { |
|
name: "Normal", |
|
body: c("TTTTMMMHMHMHMHMMHHHHMMHMR") |
|
}, { |
|
name: "Defend", |
|
body: c("TTTRRMRMRMRMMMRRRRMMRMA") |
|
}, { |
|
name: "Defend", |
|
body: c("TTTRRMRMRMMMRRRRMMRMA") |
|
}, { |
|
name: "Normal", |
|
body: c("TTTHMMMHMRRHMHMMHMMHMR") |
|
}, { |
|
name: "Normal", |
|
body: c("TTTHMMMHMRRHMHMMHMMHMR") |
|
}, { |
|
name: "Defend", |
|
body: c("TTTRRRMRMMMRRRRMMRMA") |
|
} ], |
|
16: [ { |
|
name: "Siege", |
|
body: c("TTAAAAAAARRRRRMRAMMRAAAAMRMRR") |
|
}, { |
|
name: "Siege", |
|
body: c("TTAAAAAAARRRRRMRAMMRAAAAMRMRR") |
|
}, { |
|
name: "Defend", |
|
body: c("TTRRRRRMMMRMRMRMMRMRMAMRMMRMA") |
|
}, { |
|
name: "Normal", |
|
body: c("TTRRRRMRMRMRMRMRMRMRMA") |
|
}, { |
|
name: "Defend", |
|
body: c("TTRRRRMRMRMRMMMRRRRMMRMA") |
|
}, { |
|
name: "Normal", |
|
body: c("TTTTRRMMMMHMHMHMHMMHHHHMMHMR") |
|
}, { |
|
name: "Defend", |
|
body: c("TTRRRRMMRMRMRMMMRRRRMMRMA") |
|
}, { |
|
name: "Defend", |
|
body: c("TTRRRRMMRMRMMMRRRRMMRMA") |
|
}, { |
|
name: "Normal", |
|
body: c("TTRHMHMMMHMRRHMHMMHMMHMR") |
|
}, { |
|
name: "Normal", |
|
body: c("TTRHMHMMMHMRRHMHMMHMMHMR") |
|
} ], |
|
17: [ { |
|
name: "Siege", |
|
body: c("RRAAAAAAARRRRRRMRAMMRAAAAMRMRR") |
|
}, { |
|
name: "Siege", |
|
body: c("RRAAAAAAARRRRRRMRAMMRAAAAMRMRR") |
|
}, { |
|
name: "Defend", |
|
body: c("RRRMRMRMRMRMRMRMMRMRMAMRMMRMA") |
|
}, { |
|
name: "Normal", |
|
body: c("TTRRMRMRMRMRMRMRMRMRMRMRMA") |
|
}, { |
|
name: "Defend", |
|
body: c("TTRRRMMRMRMRMRMMMRRRRMMRMA") |
|
}, { |
|
name: "Normal", |
|
body: c("TTRRRHMHMMMMHMHMHMHMMHHHHMMHMR") |
|
}, { |
|
name: "Defend", |
|
body: c("RRRRRRMMMRMMRMRMRMMMRRRRMMRMA") |
|
}, { |
|
name: "Defend", |
|
body: c("TTRRRRMMMRMMRMRMMMRRRRMMRMA") |
|
}, { |
|
name: "Normal", |
|
body: c("TTRHHMMHMHMMMHMRRHMHMMHMMHMR") |
|
}, { |
|
name: "Normal", |
|
body: c("TTRHHMMHMHMMMHMRRHMHMMHMMHMR") |
|
} ], |
|
18: [ { |
|
name: "Siege", |
|
body: c("RRAARRRRRAAAAAAMRAMMRAAAAMRMRR") |
|
}, { |
|
name: "Siege", |
|
body: c("RRAARRRRRAAAAAAMRAMMRAAAAMRMRR") |
|
}, { |
|
name: "Defend", |
|
body: c("RRRRMRMRMRMRMRMRMMRMRMAMRMMRMA") |
|
}, { |
|
name: "Normal", |
|
body: c("RRRRMRMMRRMRMRMRMRMRMRMRMRMRMA") |
|
}, { |
|
name: "Defend", |
|
body: c("RRRRMRMRMRMRMRMRMRMMMRRRRMMRMA") |
|
}, { |
|
name: "Normal", |
|
body: c("RRRHMHMHMMMMHMHMHMHMMHHHHMMHMR") |
|
}, { |
|
name: "Defend", |
|
body: c("RRRRMRMRMMRMMRMRMRMMMRRRRMMRMA") |
|
}, { |
|
name: "Defend", |
|
body: c("RRRRMRMRMRMMRMMRMRMMMRRRRMMRMA") |
|
}, { |
|
name: "Normal", |
|
body: c("RRRHHHMHMHMHMMMHMRRHMHMMHMMHMR") |
|
}, { |
|
name: "Normal", |
|
body: c("RRRHHHMHMHMHMMMHMRRHMHMMHMMHMR") |
|
} ], |
|
19: [ { |
|
name: "Siege", |
|
body: c("RRAARRRRRAAAAAAMRAMMRAAAAMRMRR") |
|
}, { |
|
name: "Siege", |
|
body: c("RRAARRRRRAAAAAAMRAMMRAAAAMRMRR") |
|
}, { |
|
name: "Defend", |
|
body: c("RRRRMRMRMRMRMRMRMMRMRMAMRMMRMA") |
|
}, { |
|
name: "Normal", |
|
body: c("RRRRMRMMRRMRMRMRMRMRMRMRMRMRMA") |
|
}, { |
|
name: "Defend", |
|
body: c("RRRRMRMRMMRMMRMRMRMMMRRRRMMRMA") |
|
}, { |
|
name: "Defend", |
|
body: c("RRRRMRMRMRMMRMMRMRMMMRRRRMMRMA") |
|
}, { |
|
name: "Normal", |
|
body: c("RRRHHHMHMHMHMMMHMRRHMHMMHMMHMR") |
|
}, { |
|
name: "Normal", |
|
body: c("RRRHHHMHMHMHMMMHMRRHMHMMHMMHMR") |
|
}, { |
|
name: "Defend", |
|
body: c("RRRRMRMRMRMRMRMRMRMMMRRRRMMRMA") |
|
}, { |
|
name: "Defend", |
|
body: c("RRRRMRMRMRMRMRMRMRMMMRRRRMMRMA") |
|
}, { |
|
name: "Normal", |
|
body: c("RRRRMRMRMRMRMRMRMRMMMRRRRMMRMA") |
|
}, { |
|
name: "Normal", |
|
body: c("RRRHMHMHMMMMHMHMHMHMMHHHHMMHMR") |
|
} ], |
|
20: [ { |
|
name: "Siege", |
|
body: c("RRAARRRRRAAAAAAMRAMMRAAAAMRMRR") |
|
}, { |
|
name: "Siege", |
|
body: c("RRAARRRRRAAAAAAMRAMMRAAAAMRMRR") |
|
}, { |
|
name: "Defend", |
|
body: c("RRRRMRMRMRMRMRMRMMRMRMAMRMMRMA") |
|
}, { |
|
name: "Normal", |
|
body: c("RRRRMRMMRRMRMRMRMRMRMRMRMRMRMA") |
|
}, { |
|
name: "Normal", |
|
body: c("RRRHMHMHMMMMHMHMHMHMMHHHHMMHMR") |
|
}, { |
|
name: "Defend", |
|
body: c("RRRRMRMRMMRMMRMRMRMMMRRRRMMRMA") |
|
}, { |
|
name: "Defend", |
|
body: c("RRRRMRMRMRMMRMMRMRMMMRRRRMMRMA") |
|
}, { |
|
name: "Defend", |
|
body: c("RRRRMRMRMRMRMRMRMRMMMRRRRMMRMA") |
|
}, { |
|
name: "Defend", |
|
body: c("RRRRMRMRMRMRMRMRMRMMMRRRRMMRMA") |
|
}, { |
|
name: "Defend", |
|
body: c("RRRRMRMRMRMRMRMRMRMMMRRRRMMRMA") |
|
}, { |
|
name: "Normal", |
|
body: c("RRRRMRMRMRMRMRMRMRMMMRRRRMMRMA") |
|
}, { |
|
name: "Normal", |
|
body: c("RRRHHHMHMHMHMMMHMRRHMHMMHMMHMR") |
|
}, { |
|
name: "Normal", |
|
body: c("RRRHHHMHMHMHMMMHMRRHMHMMHMMHMR") |
|
}, { |
|
name: "Normal", |
|
body: c("RRRHHHMHMHMHMMMHMRRHMHMMHMMHMR") |
|
}, { |
|
name: "Normal", |
|
body: c("RRRHHHMHMHMHMMMHMRRHMHMMHMMHMR") |
|
} ] |
|
}); |
|
b.exports = function(a, b, c, g, h) { |
|
if (b.score++, !e.any(c, { |
|
type: "spawn" |
|
}) || b.finishing) b.status = "finished", b.invaders = null; else if (b.survivalEnabled) { |
|
if (b.timeToWave--, b.timeToWave <= 0) { |
|
b.timeToWave = 200, b.wave > 20 && (b.timeToWave -= 10 * (b.wave - 20), b.timeToWave < 20 && (b.timeToWave = 20)), |
|
b.invaders = b.invaders || { |
|
bodies: [] |
|
}; |
|
var i = b.wave; |
|
i > 20 && (i = 20); |
|
for (var j = f[i], k = 0; k < j.length; k++) b.invaders.bodies.push({ |
|
name: j[k].name + new Date().getTime() + Math.floor(1e5 * Math.random()), |
|
body: e.map(j[k].body, function(a) { |
|
return new Object({ |
|
type: a, |
|
hits: 100 |
|
}); |
|
}), |
|
energy: 0, |
|
energyCapacity: 0, |
|
type: "creep", |
|
room: a, |
|
user: "2", |
|
hits: 100 * j[k].body.length, |
|
hitsMax: 100 * j[k].body.length, |
|
spawning: !1, |
|
fatigue: 0, |
|
ticksToLive: 300 |
|
}); |
|
var l = [ 1, 3, 5, 7 ], m = []; |
|
l.sort(function() { |
|
return Math.random() > Math.random(); |
|
}), l.forEach(function(a) { |
|
e.any(c, { |
|
type: "exit", |
|
exit: a |
|
}) && m.push(a); |
|
}), b.invaders.exit = m[0], b.wave++; |
|
} |
|
if (b.invaders.bodies.length) { |
|
var n, o = {}; |
|
do { |
|
if (n = e.filter(c, function(a) { |
|
return "exit" == a.type && a.exit == b.invaders.exit && !o[a.x + "," + a.y] && !e.any(c, { |
|
type: "creep", |
|
x: a.x, |
|
y: a.y |
|
}); |
|
}), !n.length) break; |
|
var p = n[Math.floor(Math.random() * n.length)]; |
|
o[p.x + "," + p.y] = !0, b.invaders.bodies[0].x = p.x, b.invaders.bodies[0].y = p.y, |
|
h.insert(b.invaders.bodies[0]), b.invaders.bodies.splice(0, 1); |
|
} while (n.length && b.invaders.bodies.length); |
|
} |
|
} |
|
return d.saveGameInfo(b, c); |
|
}; |
|
}, { |
|
"../../core/core.js": 27, |
|
"../../game/constants": 38, |
|
lodash: 53, |
|
q: 54 |
|
} ], |
|
106: [ function(a) { |
|
"use strict"; |
|
function b(b, d, j, m, n, o) { |
|
return f.when().then(function() { |
|
var p, q = e.bulkObjectsWrite(), r = e.bulkUsersWrite(), s = !0, t = !1, u = e.getRoomStatsUpdater(b), v = {}, w = m[g.findKey(m)]; |
|
"terrain" == w.type && (m = w.terrain), g.forEach(j, function(a) { |
|
"creep" == a.type && (a._actionLog = a.actionLog, a._ticksToLive = a.ageTime - o, |
|
a.actionLog = { |
|
attacked: null, |
|
healed: null, |
|
attack: null, |
|
rangedAttack: null, |
|
rangedMassAttack: null, |
|
rangedHeal: null, |
|
harvest: null, |
|
heal: null, |
|
repair: null, |
|
build: null, |
|
say: null, |
|
upgradeController: null, |
|
reserveController: null |
|
}), "link" == a.type && (a.actionLog = { |
|
transferEnergy: null |
|
}), "controller" == a.type && (p = a), a.user && "3" != a.user && (s = !1), "constructedWall" == a.type && a.decayTime && a.user && (t = !0); |
|
}), i.init(j, m), d && g.forEach(d.users, function(b) { |
|
b.objectsManual && (b.objects = b.objects || {}, g.extend(b.objects, b.objectsManual)); |
|
for (var c in b.objects) { |
|
var d = b.objects[c], e = j[c]; |
|
"room" != c ? e && ("creep" == e.type && a("./intents/creeps/intents")(e, d, j, m, q, r, p, u, o), |
|
"link" == e.type && a("./intents/links/intents")(e, d, j, m, q, r, p, u), "spawn" == e.type && a("./intents/spawns/intents")(e, d, j, m, q, r, p, u), |
|
"flag" == e.type && a("./intents/flags/intents")(e, d, j, m, q, r, p, u), "constructionSite" == e.type && d.remove && a("./intents/construction-sites/remove")(e, j, q), |
|
("extension" == e.type || "storage" == e.type) && d.transferEnergy && a("./intents/extensions/transfer-energy")(e, d.transferEnergy, j, m, q, r, p), |
|
d.notifyWhenAttacked && (h.CONSTRUCTION_COST[e.type] || "creep" == e.type) && q.update(e, { |
|
notifyWhenAttacked: !!d.notifyWhenAttacked.enabled |
|
})) : a("./intents/room/intents")(d, j, m, q, r, p); |
|
} |
|
}), i.check(); |
|
var x = g(j).filter(function(a) { |
|
return "spawn" == a.type || "extension" == a.type; |
|
}).sum("energy"), y = [ "creep", "spawn", "extension", "controller", "link", "storage", "rampart", "constructedWall", "road" ], z = { |
|
walls: [], |
|
roads: [] |
|
}; |
|
g.forEach(j, function(b) { |
|
if ("energy" == b.type && a("./intents/energy/tick")(b, j, m, q, r, p), "source" == b.type && a("./intents/sources/tick")(b, j, m, q, r, p, o), |
|
"creep" == b.type && a("./intents/creeps/tick")(b, j, m, q, r, p, u, o), "spawn" == b.type && a("./intents/spawns/tick")(b, j, m, q, r, p, x), |
|
"rampart" == b.type && a("./intents/ramparts/tick")(b, j, m, q, r, p, o), "road" == b.type && a("./intents/roads/tick")(b, j, m, q, r, p, o), |
|
"constructionSite" == b.type && a("./intents/construction-sites/tick")(b, j, m, q, r, p), |
|
"keeperLair" == b.type && a("./intents/keeper-lairs/tick")(b, j, m, q, r, p, o), |
|
"portal" == b.type && a("./intents/portals/tick")(b, j, m, q, r, p), "constructedWall" == b.type && a("./intents/constructedWalls/tick")(b, j, m, q, r, p, o), |
|
"link" == b.type && a("./intents/links/tick")(b, j, m, q, r, p), "controller" == b.type && a("./intents/controllers/tick")(b, j, m, q, r, p, o), |
|
"storage" == b.type && p) { |
|
var c = p.level > 0 && p.user == b.user && h.CONTROLLER_STRUCTURES.storage[p.level] > 0 ? h.STORAGE_CAPACITY : 0; |
|
c != b.energyCapacity && q.update(b, { |
|
energyCapacity: c |
|
}); |
|
} |
|
if ("flag" != b.type && (v[b._id] = b, "creep" == b.type && (v[b._id] = g.cloneDeep(b), |
|
v[b._id]._id = "" + b._id, delete v[b._id]._actionLog, delete v[b._id]._ticksToLive, |
|
b.actionLog.say && delete v[b._id].actionLog.say)), g.contains(y, b.type)) if (b.user) { |
|
if (b.newbieWall) return; |
|
z[b.user] = z[b.user] || [], z[b.user].push([ b.x, b.y ]); |
|
} else "constructedWall" == b.type ? z.walls.push([ b.x, b.y ]) : "road" == b.type && z.roads.push([ b.x, b.y ]); |
|
}); |
|
var A = []; |
|
n && "active" == n.status && A.push(a("./intents/survival")(b, n, j, m, q)), k.mark("processRoom:" + b), |
|
A.push(e.mapViewSave(b, z)), A.push(q.execute()), A.push(r.execute()), A.push(c(b, v, o)), |
|
Date.now() > l + 3e4 && (A.push(e.roomsStatsSave()), l = Date.now()); |
|
var B = f.all(A); |
|
if (s && (B = B.then(function() { |
|
return e.deactivateRoom(b); |
|
})), t) { |
|
var C = !0; |
|
g.forEach(j, function(a) { |
|
"constructedWall" == a.type && a.decayTime && a.user && (C = !1); |
|
}), C && (B = B.then(function() { |
|
return e.setRoomStatus(b, "normal"); |
|
})); |
|
} |
|
return n && "finished" == n.status && (B = B.then(function() { |
|
return e.finishGame(n); |
|
})), B; |
|
}); |
|
} |
|
function c(a, b, c) { |
|
var d = f.when(); |
|
if (!(c % 20)) { |
|
var g = 20 * Math.floor((c - 1) / 20); |
|
d = e.history.upload(a, g); |
|
} |
|
var h = JSON.stringify(b); |
|
return d.then(function() { |
|
return e.history.saveTick(a, c, h); |
|
}); |
|
} |
|
var d, e = a("../core/core"), f = a("q"), g = a("lodash"), h = a("../game/constants"), i = a("./intents/movement"), j = a("../utils"), k = j.getTimelineStats("processor"), l = 0; |
|
e.connect().then(function() { |
|
function a() { |
|
"undefined" == typeof self; |
|
var c; |
|
d.fetch().then(function(a) { |
|
return k.setNow(), f.all([ e.getRoomIntents(c = a), e.getRoomObjects(a), e.getRoomTerrain(a), e.getGameInfo(a), e.getGameTime() ]); |
|
}).then(function(a) { |
|
k.mark("getRoomData:" + c), b(c, a[0], a[1], a[2], a[3], parseInt(a[4]))["catch"](function(a) { |
|
return void 0; |
|
}).then(function() { |
|
return k.mark("saveRoom:" + c), e.clearRoomIntents(c); |
|
}).then(function() { |
|
return d.markDone(c); |
|
}); |
|
}).then(function() { |
|
e.flushTimelineStats(k.getStats()), setTimeout(a, 0); |
|
}); |
|
} |
|
d = e.queue.create("rooms", !0), e.setupProcessor(); |
|
a(); |
|
})["catch"](function(a) {}), "undefined " == typeof self && setInterval(function() { |
|
var a = f.getUnhandledReasons(); |
|
a.forEach(function(a) { |
|
return void 0; |
|
}), f.resetUnhandledRejections(); |
|
}, 1e3); |
|
}, { |
|
"../core/core": 27, |
|
"../game/constants": 38, |
|
"../utils": 108, |
|
"./intents/constructedWalls/tick": 55, |
|
"./intents/construction-sites/remove": 56, |
|
"./intents/construction-sites/tick": 57, |
|
"./intents/controllers/tick": 58, |
|
"./intents/creeps/intents": 69, |
|
"./intents/creeps/tick": 79, |
|
"./intents/energy/tick": 83, |
|
"./intents/extensions/transfer-energy": 84, |
|
"./intents/flags/intents": 85, |
|
"./intents/keeper-lairs/tick": 86, |
|
"./intents/links/intents": 87, |
|
"./intents/links/tick": 88, |
|
"./intents/movement": 90, |
|
"./intents/portals/tick": 91, |
|
"./intents/ramparts/tick": 92, |
|
"./intents/roads/tick": 93, |
|
"./intents/room/intents": 98, |
|
"./intents/sources/tick": 99, |
|
"./intents/spawns/intents": 102, |
|
"./intents/spawns/tick": 103, |
|
"./intents/survival": 105, |
|
lodash: 53, |
|
q: 54 |
|
} ], |
|
107: [ function(a) { |
|
"use strict"; |
|
function b(a, b) { |
|
function e(e) { |
|
g.mark("endMakeRuntime:" + e.username), e.console && c.sendConsoleMessages(a, e.console); |
|
var f = []; |
|
return e.memory && f.push(c.saveUserMemory(a, e.memory, b)), e.intents && f.push(c.saveUserIntents(a, e.intents)), |
|
d.all(f).then(function() { |
|
return g.mark("saveUser:" + e.username), e.error ? d.reject(e.error) : void 0; |
|
}); |
|
} |
|
return g.setNow(), c.makeRuntime(a, b, g).then(e, e); |
|
} |
|
var c = a("./core/core"), d = a("q"), e = (a("./game/constants"), a("lodash"), a("util"), |
|
0), f = a("./utils"), g = f.getTimelineStats("runner"); |
|
c.connect("runner").then(function() { |
|
function a() { |
|
var f, h; |
|
e++, "undefined" == typeof self, d.fetch().then(function(a) { |
|
f = h = a; |
|
var c, d = f.match(/^SourceKeeper:(.*)$/); |
|
return d && (f = "3", c = d[1]), b(f, c); |
|
})["catch"](function(a) { |
|
return c.sendConsoleError(f, a); |
|
}).then(function() { |
|
return d.markDone(h); |
|
})["catch"](function(a) { |
|
return void 0; |
|
})["finally"](function() { |
|
c.flushTimelineStats(g.getStats()), setTimeout(a, 0); |
|
}); |
|
} |
|
var d = c.queue.create("users", !0); |
|
a(); |
|
})["catch"](function(a) {}), "undefined " == typeof self && setInterval(function() { |
|
var a = d.getUnhandledReasons(); |
|
a.forEach(function(a) { |
|
return void 0; |
|
}), d.resetUnhandledRejections(); |
|
}, 1e3); |
|
}, { |
|
"./core/core": 27, |
|
"./game/constants": 38, |
|
"./utils": 108, |
|
lodash: 53, |
|
q: 54, |
|
util: 112 |
|
} ], |
|
108: [ function(require, module, exports) { |
|
"use strict"; |
|
function _typeof(a) { |
|
return a && "undefined" != typeof Symbol && a.constructor === Symbol ? "symbol" : typeof a; |
|
} |
|
function _instanceof(a, b) { |
|
return null != b && b[Symbol.hasInstance] ? b[Symbol.hasInstance](a) : a instanceof b; |
|
} |
|
function _defineProperty(a, b, c) { |
|
return b in a ? Object.defineProperty(a, b, { |
|
value: c, |
|
enumerable: !0, |
|
configurable: !0, |
|
writable: !0 |
|
}) : a[b] = c, a; |
|
} |
|
var _slicedToArray = function() { |
|
function a(a, b) { |
|
var c = [], d = !0, e = !1, f = void 0; |
|
try { |
|
for (var g, h = a[Symbol.iterator](); !(d = (g = h.next()).done) && (c.push(g.value), |
|
!b || c.length !== b); d = !0) ; |
|
} catch (i) { |
|
e = !0, f = i; |
|
} finally { |
|
try { |
|
!d && h["return"] && h["return"](); |
|
} finally { |
|
if (e) throw f; |
|
} |
|
} |
|
return c; |
|
} |
|
return function(b, c) { |
|
if (Array.isArray(b)) return b; |
|
if (Symbol.iterator in Object(b)) return a(b, c); |
|
throw new TypeError("Invalid attempt to destructure non-iterable instance"); |
|
}; |
|
}(), _offsetsByDirection, _ = require("lodash"), C = require("./game/constants"), offsetsByDirection = (_offsetsByDirection = {}, |
|
_defineProperty(_offsetsByDirection, C.TOP, [ 0, -1 ]), _defineProperty(_offsetsByDirection, C.TOP_RIGHT, [ 1, -1 ]), |
|
_defineProperty(_offsetsByDirection, C.RIGHT, [ 1, 0 ]), _defineProperty(_offsetsByDirection, C.BOTTOM_RIGHT, [ 1, 1 ]), |
|
_defineProperty(_offsetsByDirection, C.BOTTOM, [ 0, 1 ]), _defineProperty(_offsetsByDirection, C.BOTTOM_LEFT, [ -1, 1 ]), |
|
_defineProperty(_offsetsByDirection, C.LEFT, [ -1, 0 ]), _defineProperty(_offsetsByDirection, C.TOP_LEFT, [ -1, -1 ]), |
|
_offsetsByDirection); |
|
exports.fetchXYArguments = function(a, b, c) { |
|
var d, e, f; |
|
if (_.isUndefined(b) || !_.isNumber(b)) { |
|
if (!_.isObject(a)) return [ void 0, void 0, void 0 ]; |
|
_instanceof(a, c.RoomPosition) && (d = a.x, e = a.y, f = a.roomName), a.pos && _instanceof(a.pos, c.RoomPosition) && (d = a.pos.x, |
|
e = a.pos.y, f = a.pos.roomName); |
|
} else d = a, e = b; |
|
return _.isNaN(d) && (d = void 0), _.isNaN(e) && (e = void 0), [ d, e, f ]; |
|
}, exports.getDirection = function(a, b) { |
|
var c = Math.abs(a), d = Math.abs(b); |
|
return c > 2 * d ? a > 0 ? C.RIGHT : C.LEFT : d > 2 * c ? b > 0 ? C.BOTTOM : C.TOP : a > 0 && b > 0 ? C.BOTTOM_RIGHT : a > 0 && 0 > b ? C.TOP_RIGHT : 0 > a && b > 0 ? C.BOTTOM_LEFT : 0 > a && 0 > b ? C.TOP_LEFT : void 0; |
|
}, exports.getOffsetsByDirection = function(a) { |
|
return !offsetsByDirection[a], offsetsByDirection[a]; |
|
}, exports.calcCreepCost = function(a) { |
|
var b = 0; |
|
return a.forEach(function(a) { |
|
b += _.isObject(a) ? C.BODYPART_COST[a.type] : C.BODYPART_COST[a]; |
|
}), b; |
|
}, exports.checkConstructionSite = function(a, b, c, d) { |
|
if (_.isString(a)) { |
|
if (exports.checkTerrain(a, c, d, C.TERRAIN_MASK_WALL)) return !1; |
|
if ("spawn" == b) for (var e = -1; 1 >= e; e++) for (var f = -1; 1 >= f; f++) if (exports.checkTerrain(a, c + e, d + f, C.TERRAIN_MASK_WALL)) return !1; |
|
return !0; |
|
} |
|
if (a && _.isArray(a[0]) && _.isString(a[0][0])) { |
|
if (a[d][c] & C.TERRAIN_MASK_WALL) return !1; |
|
if ("spawn" == b) for (var e = -1; 1 >= e; e++) for (var f = -1; 1 >= f; f++) if (a[d + f][c + e] & C.TERRAIN_MASK_WALL) return !1; |
|
return !0; |
|
} |
|
return _.any(a, { |
|
x: c, |
|
y: d, |
|
type: b |
|
}) ? !1 : _.any(a, { |
|
x: c, |
|
y: d, |
|
type: "constructionSite" |
|
}) ? !1 : "rampart" != b && _.any(a, function(a) { |
|
return a.x == c && a.y == d && _.contains([ "wall", "constructedWall", "spawn", "extension", "link", "storage" ], a.type); |
|
}) ? !1 : "road" == b && (0 >= c || 0 >= d || c >= 49 || d >= 49) || "road" != b && (1 >= c || 1 >= d || c >= 48 || d >= 48) ? !1 : "spawn" == b && _.any(a, function(a) { |
|
return "source" == a.type ? Math.abs(a.x - c) < 5 && Math.abs(a.y - d) < 5 : Math.abs(a.x - c) < 2 && Math.abs(a.y - d) < 2 && _.contains([ "wall", "constructedWall", "spawn", "extension", "link", "storage" ], a.type); |
|
}) ? !1 : "extension" == b && _.any(a, function(a) { |
|
return "source" == a.type ? Math.abs(a.x - c) < 5 && Math.abs(a.y - d) < 5 : !1; |
|
}) ? !1 : !0; |
|
}, exports.getDiff = function(a, b) { |
|
function c(a) { |
|
var b = {}; |
|
return _.forEach(a, function(a) { |
|
return b[a._id] = a; |
|
}), b; |
|
} |
|
var d = {}, e = c(a), f = c(b); |
|
return _.forEach(a, function(a) { |
|
if (f[a._id]) { |
|
var b = f[a._id], c = d[a._id] = {}; |
|
for (var e in a) if ("_id" != e) if (_.isUndefined(b[e])) c[e] = null; else if (_typeof(a[e]) != _typeof(b[e]) || a[e] && !b[e]) c[e] = b[e]; else if (_.isObject(a[e])) { |
|
c[e] = {}; |
|
for (var g in a[e]) _.isEqual(a[e][g], b[e][g]) || (c[e][g] = b[e][g]); |
|
for (var g in b[e]) _.isUndefined(a[e][g]) && (c[e][g] = b[e][g]); |
|
_.size(c[e]) || delete d[a._id][e]; |
|
} else _.isEqual(a[e], b[e]) || (c[e] = b[e]); |
|
for (var e in b) _.isUndefined(a[e]) && (c[e] = b[e]); |
|
_.size(c) || delete d[a._id]; |
|
} else d[a._id] = null; |
|
}), _.forEach(b, function(a) { |
|
e[a._id] || (d[a._id] = a); |
|
}), d; |
|
}, exports.encodeTerrain = function(a) { |
|
for (var b = "", c = 0; 50 > c; c++) for (var d = 0; 50 > d; d++) { |
|
var e = _.filter(a, { |
|
x: d, |
|
y: c |
|
}), f = 0; |
|
_.any(e, { |
|
type: "wall" |
|
}) && (f |= C.TERRAIN_MASK_WALL), _.any(e, { |
|
type: "swamp" |
|
}) && (f |= C.TERRAIN_MASK_SWAMP), b += f; |
|
} |
|
return b; |
|
}, exports.decodeTerrain = function(a) { |
|
var b = []; |
|
for (var c in a) if ("terrain" == a[c].type) for (var d = 0; 50 > d; d++) for (var e = 0; 50 > e; e++) { |
|
var f = a[c].terrain.charAt(50 * d + e); |
|
f & C.TERRAIN_MASK_WALL && b.push({ |
|
room: a[c].room, |
|
x: e, |
|
y: d, |
|
type: "wall" |
|
}), f & C.TERRAIN_MASK_SWAMP && b.push({ |
|
room: a[c].room, |
|
x: e, |
|
y: d, |
|
type: "swamp" |
|
}); |
|
} |
|
return b; |
|
}, exports.decodeTerrainByRoom = function(a) { |
|
var b = { |
|
spatial: {} |
|
}; |
|
for (var c in a) if ("terrain" == a[c].type) { |
|
b[a[c].room] = b[a[c].room] || [], b.spatial[a[c].room] = new Array(50); |
|
for (var d = 0; 50 > d; d++) { |
|
b.spatial[a[c].room][d] = new Array(50); |
|
for (var e = 0; 50 > e; e++) { |
|
var f = a[c].terrain.charAt(50 * d + e); |
|
b.spatial[a[c].room][d][e] = f; |
|
} |
|
} |
|
} |
|
return b; |
|
}, exports.checkTerrain = function(a, b, c, d) { |
|
return (parseInt(a.charAt(50 * c + b)) & d) > 0; |
|
}, exports.checkControllerAvailability = function(a, b, c, d) { |
|
var e = 0; |
|
_.isObject(c) && c.level && (c.user || c.owner) && (e = c.level), _.isNumber(c) && (e = c), |
|
d = d || 0; |
|
var f = _(b).filter(function(b) { |
|
return b.type == a || "constructionSite" == b.type && b.structureType == a; |
|
}).size(), g = C.CONTROLLER_STRUCTURES[a][e] + d; |
|
return g > f; |
|
}, exports.getRoomNameFromXY = function(a, b) { |
|
return a = 0 > a ? "W" + (-a - 1) : "E" + a, b = 0 > b ? "N" + (-b - 1) : "S" + b, |
|
"" + a + b; |
|
}, exports.roomNameToXY = function(a) { |
|
a = a.toUpperCase(); |
|
var b = a.match(/^(\w)(\d+)(\w)(\d+)$/); |
|
if (!b) return [ void 0, void 0 ]; |
|
var c = _slicedToArray(b, 5), d = c[1], e = c[2], f = c[3], g = c[4]; |
|
return e = "W" == d ? -e - 1 : +e, g = "N" == f ? -g - 1 : +g, [ e, g ]; |
|
}, exports.comparatorDistance = function(a) { |
|
return a.pos && (a = a.pos), function(b, c) { |
|
b.pos && (b = b.pos), c.pos && (c = c.pos); |
|
var d = Math.max(Math.abs(b.x - a.x), Math.abs(b.y - a.y)), e = Math.max(Math.abs(c.x - a.x), Math.abs(c.y - a.y)); |
|
return d - e; |
|
}; |
|
}, exports.getTimelineStats = function(a) { |
|
a += Math.floor(1e5 * Math.random()); |
|
var b = Date.now(), c = []; |
|
return { |
|
mark: function(d) { |
|
c.push({ |
|
type: a, |
|
name: d, |
|
start: b, |
|
end: Date.now() |
|
}), this.setNow(); |
|
}, |
|
setNow: function() { |
|
b = Date.now(); |
|
}, |
|
getStats: function() { |
|
var a = c; |
|
return c = [], a; |
|
} |
|
}; |
|
}, exports.storeIntents = function(a, b, c) { |
|
var d = {}; |
|
for (var e in b) if ("notify" != e) if ("room" != e) { |
|
if (e in c.userObjects) { |
|
var f = c.userObjects[e], g = b[e]; |
|
d[f.room] = d[f.room] || {}; |
|
var h = d[f.room][e] = {}; |
|
g.move && (h.move = { |
|
direction: parseInt(g.move.direction) |
|
}), g.harvest && (h.harvest = { |
|
id: "" + g.harvest.id |
|
}), g.attack && (h.attack = { |
|
id: "" + g.attack.id, |
|
x: parseInt(g.attack.x), |
|
y: parseInt(g.attack.y) |
|
}), g.rangedAttack && (h.rangedAttack = { |
|
id: "" + g.rangedAttack.id |
|
}), g.rangedMassAttack && (h.rangedMassAttack = {}), g.heal && (h.heal = { |
|
id: "" + g.heal.id, |
|
x: parseInt(g.heal.x), |
|
y: parseInt(g.heal.y) |
|
}), g.rangedHeal && (h.rangedHeal = { |
|
id: "" + g.rangedHeal.id |
|
}), g.repair && (h.repair = { |
|
id: "" + g.repair.id, |
|
x: parseInt(g.repair.x), |
|
y: parseInt(g.repair.y) |
|
}), g.build && (h.build = { |
|
id: "" + g.build.id, |
|
x: parseInt(g.build.x), |
|
y: parseInt(g.build.y) |
|
}), g.transferEnergy && (h.transferEnergy = { |
|
id: "" + g.transferEnergy.id, |
|
amount: parseInt(g.transferEnergy.amount) |
|
}), g.dropEnergy && (h.dropEnergy = { |
|
amount: parseInt(g.dropEnergy.amount) |
|
}), g.pickup && (h.pickup = { |
|
id: "" + g.pickup.id |
|
}), g.createCreep && (h.createCreep = { |
|
name: "" + g.createCreep.name, |
|
body: _.filter(g.createCreep.body, function(a) { |
|
return _.contains(C.BODYPARTS_ALL, a); |
|
}) |
|
}), g.suicide && (h.suicide = {}), g.remove && (h.remove = {}), g.say && (h.say = { |
|
message: g.say.message.substring(0, 10) |
|
}), g.claimController && (h.claimController = { |
|
id: "" + g.claimController.id |
|
}), g.unclaimController && (h.unclaimController = { |
|
id: "" + g.unclaimController.id |
|
}), g.upgradeController && (h.upgradeController = { |
|
id: "" + g.upgradeController.id |
|
}), g.reserveController && (h.reserveController = { |
|
id: "" + g.reserveController.id |
|
}), g.notifyWhenAttacked && (h.notifyWhenAttacked = { |
|
enabled: !!g.notifyWhenAttacked.enabled |
|
}), g.setPosition && (h.setPosition = { |
|
x: parseInt(g.setPosition.x), |
|
y: parseInt(g.setPosition.y), |
|
roomName: "" + g.setPosition.roomName |
|
}), g.setColor && (h.setColor = { |
|
color: "" + g.setColor.color |
|
}), g.destroy && (h.destroy = {}); |
|
} |
|
} else { |
|
var i = b.room; |
|
i.createFlag && _.forEach(i.createFlag, function(b) { |
|
d[b.roomName] = d[b.roomName] || {}; |
|
var c = d[b.roomName].room = d[b.roomName].room || {}; |
|
c.createFlag = c.createFlag || [], c.createFlag.push({ |
|
x: parseInt(b.x), |
|
y: parseInt(b.y), |
|
name: "" + b.name, |
|
color: "" + b.color, |
|
roomName: b.roomName, |
|
user: a |
|
}); |
|
}), i.createConstructionSite && _.forEach(i.createConstructionSite, function(b) { |
|
d[b.roomName] = d[b.roomName] || {}; |
|
var c = d[b.roomName].room = d[b.roomName].room || {}; |
|
c.createConstructionSite = c.createConstructionSite || [], c.createConstructionSite.push({ |
|
x: parseInt(b.x), |
|
y: parseInt(b.y), |
|
structureType: "" + b.structureType, |
|
name: "" + b.name, |
|
roomName: "" + b.roomName, |
|
user: a |
|
}); |
|
}), i.destroyStructure && _.forEach(i.destroyStructure, function(b) { |
|
d[b.roomName] = d[b.roomName] || {}; |
|
var c = d[b.roomName].room = d[b.roomName].room || {}; |
|
c.destroyStructure = c.destroyStructure || [], c.destroyStructure.push({ |
|
roomName: "" + b.roomName, |
|
id: "" + b.id, |
|
user: a |
|
}); |
|
}); |
|
} else d.notify = [], _.isArray(b.notify) && b.notify.forEach(function(a) { |
|
d.notify.push({ |
|
message: ("" + a.message).substring(0, 1e3), |
|
groupInterval: +a.groupInterval |
|
}); |
|
}); |
|
return d; |
|
}, exports.sendAttackingNotification = function(a, b) { |
|
var c, d = require("./core/core"); |
|
c = "creep" == a.type ? "creep " + a.name : "spawn" == a.type ? "spawn " + a.name : a.type + " #" + a._id; |
|
var e = a.user ? a.user : b ? b.user : null; |
|
e && d.sendNotification(e, "Your " + c + " in room " + a.room + " is under attack!"); |
|
}, exports.checkStructureAgainstController = function(a, b, c) { |
|
var d = _.filter(b, { |
|
type: a.type, |
|
user: a.user |
|
}); |
|
return !c || c.level < 1 || c.user != a.user ? !1 : d.length > C.CONTROLLER_STRUCTURES[a.type][c.level] && (d.sort(exports.comparatorDistance(c)), |
|
d = _.take(d, C.CONTROLLER_STRUCTURES[a.type][c.level]), !_.contains(d, a)) ? !1 : !0; |
|
}, exports.defineGameObjectProperties = function(obj, dataFn, properties) { |
|
var propertiesInfo = {}; |
|
for (var name in properties) eval("\n propertiesInfo['" + name + "'] = {\n enumerable: true,\n get() {\n if(!this['_" + name + "']) {\n this['_" + name + "'] = properties['" + name + "'](dataFn(this.id));\n }\n return this['_" + name + "'];\n }\n }"); |
|
Object.defineProperties(obj, propertiesInfo), obj.toJSON = function() { |
|
var a = {}; |
|
for (var b in this) "_" == b[0] || _.contains([ "toJSON", "toString" ], b) || (a[b] = this[b]); |
|
return a; |
|
}; |
|
}, exports.serializePath = function(a) { |
|
if (!_.isArray(a)) throw new Error("path is not an array"); |
|
var b = ""; |
|
if (!a.length) return b; |
|
b += a[0].x > 9 ? a[0].x : "0" + a[0].x, b += a[0].y > 9 ? a[0].y : "0" + a[0].y; |
|
for (var c = 0; c < a.length; c++) b += a[c].direction; |
|
return b; |
|
}, exports.deserializePath = function(a) { |
|
if (!_.isString(a)) throw new Error("`path` is not a string"); |
|
var b = []; |
|
if (!a.length) return b; |
|
var c, d, e, f, g; |
|
if (c = parseInt(a.substring(0, 2)), d = parseInt(a.substring(2, 4)), _.isNaN(c) || _.isNaN(d)) throw new Error("`path` is not a valid serialized path string"); |
|
for (var h = 4; h < a.length; h++) { |
|
if (e = parseInt(a.charAt(h)), !offsetsByDirection[e]) throw new Error("`path` is not a valid serialized path string"); |
|
f = offsetsByDirection[e][0], g = offsetsByDirection[e][1], h > 4 && (c += f, d += g), |
|
b.push({ |
|
x: c, |
|
y: d, |
|
dx: f, |
|
dy: g, |
|
direction: e |
|
}); |
|
} |
|
return b; |
|
}; |
|
}, { |
|
"./core/core": 27, |
|
"./game/constants": 38, |
|
lodash: 53 |
|
} ], |
|
109: [ function(a, b) { |
|
b.exports = "function" == typeof Object.create ? function(a, b) { |
|
a.super_ = b, a.prototype = Object.create(b.prototype, { |
|
constructor: { |
|
value: a, |
|
enumerable: !1, |
|
writable: !0, |
|
configurable: !0 |
|
} |
|
}); |
|
} : function(a, b) { |
|
a.super_ = b; |
|
var c = function() {}; |
|
c.prototype = b.prototype, a.prototype = new c(), a.prototype.constructor = a; |
|
}; |
|
}, {} ], |
|
110: [ function(a, b) { |
|
function c() { |
|
if (!g) { |
|
g = !0; |
|
for (var a, b = f.length; b; ) { |
|
a = f, f = []; |
|
for (var c = -1; ++c < b; ) a[c](); |
|
b = f.length; |
|
} |
|
g = !1; |
|
} |
|
} |
|
function d() {} |
|
var e = b.exports = {}, f = [], g = !1; |
|
e.nextTick = function(a) { |
|
f.push(a), g || setTimeout(c, 0); |
|
}, e.title = "browser", e.browser = !0, e.env = {}, e.argv = [], e.version = "", |
|
e.on = d, e.addListener = d, e.once = d, e.off = d, e.removeListener = d, e.removeAllListeners = d, |
|
e.emit = d, e.binding = function() { |
|
throw new Error("process.binding is not supported"); |
|
}, e.cwd = function() { |
|
return "/"; |
|
}, e.chdir = function() { |
|
throw new Error("process.chdir is not supported"); |
|
}, e.umask = function() { |
|
return 0; |
|
}; |
|
}, {} ], |
|
111: [ function(a, b) { |
|
b.exports = function(a) { |
|
return a && "object" == typeof a && "function" == typeof a.copy && "function" == typeof a.fill && "function" == typeof a.readUInt8; |
|
}; |
|
}, {} ], |
|
112: [ function(a, b, c) { |
|
(function(b, d) { |
|
function e(a, b) { |
|
var d = { |
|
seen: [], |
|
stylize: g |
|
}; |
|
return arguments.length >= 3 && (d.depth = arguments[2]), arguments.length >= 4 && (d.colors = arguments[3]), |
|
p(b) ? d.showHidden = b : b && c._extend(d, b), v(d.showHidden) && (d.showHidden = !1), |
|
v(d.depth) && (d.depth = 2), v(d.colors) && (d.colors = !1), v(d.customInspect) && (d.customInspect = !0), |
|
d.colors && (d.stylize = f), i(d, a, d.depth); |
|
} |
|
function f(a, b) { |
|
var c = e.styles[b]; |
|
return c ? "[" + e.colors[c][0] + "m" + a + "[" + e.colors[c][1] + "m" : a; |
|
} |
|
function g(a) { |
|
return a; |
|
} |
|
function h(a) { |
|
var b = {}; |
|
return a.forEach(function(a) { |
|
b[a] = !0; |
|
}), b; |
|
} |
|
function i(a, b, d) { |
|
if (a.customInspect && b && A(b.inspect) && b.inspect !== c.inspect && (!b.constructor || b.constructor.prototype !== b)) { |
|
var e = b.inspect(d, a); |
|
return t(e) || (e = i(a, e, d)), e; |
|
} |
|
var f = j(a, b); |
|
if (f) return f; |
|
var g = Object.keys(b), p = h(g); |
|
if (a.showHidden && (g = Object.getOwnPropertyNames(b)), z(b) && (g.indexOf("message") >= 0 || g.indexOf("description") >= 0)) return k(b); |
|
if (0 === g.length) { |
|
if (A(b)) { |
|
var q = b.name ? ": " + b.name : ""; |
|
return a.stylize("[Function" + q + "]", "special"); |
|
} |
|
if (w(b)) return a.stylize(RegExp.prototype.toString.call(b), "regexp"); |
|
if (y(b)) return a.stylize(Date.prototype.toString.call(b), "date"); |
|
if (z(b)) return k(b); |
|
} |
|
var r = "", s = !1, u = [ "{", "}" ]; |
|
if (o(b) && (s = !0, u = [ "[", "]" ]), A(b)) { |
|
var v = b.name ? ": " + b.name : ""; |
|
r = " [Function" + v + "]"; |
|
} |
|
if (w(b) && (r = " " + RegExp.prototype.toString.call(b)), y(b) && (r = " " + Date.prototype.toUTCString.call(b)), |
|
z(b) && (r = " " + k(b)), 0 === g.length && (!s || 0 == b.length)) return u[0] + r + u[1]; |
|
if (0 > d) return w(b) ? a.stylize(RegExp.prototype.toString.call(b), "regexp") : a.stylize("[Object]", "special"); |
|
a.seen.push(b); |
|
var x; |
|
return x = s ? l(a, b, d, p, g) : g.map(function(c) { |
|
return m(a, b, d, p, c, s); |
|
}), a.seen.pop(), n(x, r, u); |
|
} |
|
function j(a, b) { |
|
if (v(b)) return a.stylize("undefined", "undefined"); |
|
if (t(b)) { |
|
var c = "'" + JSON.stringify(b).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'"; |
|
return a.stylize(c, "string"); |
|
} |
|
return s(b) ? a.stylize("" + b, "number") : p(b) ? a.stylize("" + b, "boolean") : q(b) ? a.stylize("null", "null") : void 0; |
|
} |
|
function k(a) { |
|
return "[" + Error.prototype.toString.call(a) + "]"; |
|
} |
|
function l(a, b, c, d, e) { |
|
for (var f = [], g = 0, h = b.length; h > g; ++g) f.push(D(b, String(g)) ? m(a, b, c, d, String(g), !0) : ""); |
|
return e.forEach(function(e) { |
|
e.match(/^\d+$/) || f.push(m(a, b, c, d, e, !0)); |
|
}), f; |
|
} |
|
function m(a, b, c, d, e, f) { |
|
var g, h, j; |
|
if (j = Object.getOwnPropertyDescriptor(b, e) || { |
|
value: b[e] |
|
}, j.get ? h = j.set ? a.stylize("[Getter/Setter]", "special") : a.stylize("[Getter]", "special") : j.set && (h = a.stylize("[Setter]", "special")), |
|
D(d, e) || (g = "[" + e + "]"), h || (a.seen.indexOf(j.value) < 0 ? (h = q(c) ? i(a, j.value, null) : i(a, j.value, c - 1), |
|
h.indexOf("\n") > -1 && (h = f ? h.split("\n").map(function(a) { |
|
return " " + a; |
|
}).join("\n").substr(2) : "\n" + h.split("\n").map(function(a) { |
|
return " " + a; |
|
}).join("\n"))) : h = a.stylize("[Circular]", "special")), v(g)) { |
|
if (f && e.match(/^\d+$/)) return h; |
|
g = JSON.stringify("" + e), g.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (g = g.substr(1, g.length - 2), |
|
g = a.stylize(g, "name")) : (g = g.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), |
|
g = a.stylize(g, "string")); |
|
} |
|
return g + ": " + h; |
|
} |
|
function n(a, b, c) { |
|
var d = 0, e = a.reduce(function(a, b) { |
|
return d++, b.indexOf("\n") >= 0 && d++, a + b.replace(/\u001b\[\d\d?m/g, "").length + 1; |
|
}, 0); |
|
return e > 60 ? c[0] + ("" === b ? "" : b + "\n ") + " " + a.join(",\n ") + " " + c[1] : c[0] + b + " " + a.join(", ") + " " + c[1]; |
|
} |
|
function o(a) { |
|
return Array.isArray(a); |
|
} |
|
function p(a) { |
|
return "boolean" == typeof a; |
|
} |
|
function q(a) { |
|
return null === a; |
|
} |
|
function r(a) { |
|
return null == a; |
|
} |
|
function s(a) { |
|
return "number" == typeof a; |
|
} |
|
function t(a) { |
|
return "string" == typeof a; |
|
} |
|
function u(a) { |
|
return "symbol" == typeof a; |
|
} |
|
function v(a) { |
|
return void 0 === a; |
|
} |
|
function w(a) { |
|
return x(a) && "[object RegExp]" === C(a); |
|
} |
|
function x(a) { |
|
return "object" == typeof a && null !== a; |
|
} |
|
function y(a) { |
|
return x(a) && "[object Date]" === C(a); |
|
} |
|
function z(a) { |
|
return x(a) && ("[object Error]" === C(a) || a instanceof Error); |
|
} |
|
function A(a) { |
|
return "function" == typeof a; |
|
} |
|
function B(a) { |
|
return null === a || "boolean" == typeof a || "number" == typeof a || "string" == typeof a || "symbol" == typeof a || "undefined" == typeof a; |
|
} |
|
function C(a) { |
|
return Object.prototype.toString.call(a); |
|
} |
|
function D(a, b) { |
|
return Object.prototype.hasOwnProperty.call(a, b); |
|
} |
|
var E = /%[sdj%]/g; |
|
c.format = function(a) { |
|
if (!t(a)) { |
|
for (var b = [], c = 0; c < arguments.length; c++) b.push(e(arguments[c])); |
|
return b.join(" "); |
|
} |
|
for (var c = 1, d = arguments, f = d.length, g = String(a).replace(E, function(a) { |
|
if ("%%" === a) return "%"; |
|
if (c >= f) return a; |
|
switch (a) { |
|
case "%s": |
|
return String(d[c++]); |
|
|
|
case "%d": |
|
return Number(d[c++]); |
|
|
|
case "%j": |
|
try { |
|
return JSON.stringify(d[c++]); |
|
} catch (b) { |
|
return "[Circular]"; |
|
} |
|
|
|
default: |
|
return a; |
|
} |
|
}), h = d[c]; f > c; h = d[++c]) g += q(h) || !x(h) ? " " + h : " " + e(h); |
|
return g; |
|
}, c.deprecate = function(a, e) { |
|
function f() { |
|
if (!g) { |
|
if (b.throwDeprecation) throw new Error(e); |
|
b.traceDeprecation, g = !0; |
|
} |
|
return a.apply(this, arguments); |
|
} |
|
if (v(d.process)) return function() { |
|
return c.deprecate(a, e).apply(this, arguments); |
|
}; |
|
if (b.noDeprecation === !0) return a; |
|
var g = !1; |
|
return f; |
|
}; |
|
var F, G = {}; |
|
c.debuglog = function(a) { |
|
if (v(F) && (F = b.env.NODE_DEBUG || ""), a = a.toUpperCase(), !G[a]) if (new RegExp("\\b" + a + "\\b", "i").test(F)) { |
|
{ |
|
b.pid; |
|
} |
|
G[a] = function() { |
|
c.format.apply(c, arguments); |
|
}; |
|
} else G[a] = function() {}; |
|
return G[a]; |
|
}, c.inspect = e, e.colors = { |
|
bold: [ 1, 22 ], |
|
italic: [ 3, 23 ], |
|
underline: [ 4, 24 ], |
|
inverse: [ 7, 27 ], |
|
white: [ 37, 39 ], |
|
grey: [ 90, 39 ], |
|
black: [ 30, 39 ], |
|
blue: [ 34, 39 ], |
|
cyan: [ 36, 39 ], |
|
green: [ 32, 39 ], |
|
magenta: [ 35, 39 ], |
|
red: [ 31, 39 ], |
|
yellow: [ 33, 39 ] |
|
}, e.styles = { |
|
special: "cyan", |
|
number: "yellow", |
|
"boolean": "yellow", |
|
undefined: "grey", |
|
"null": "bold", |
|
string: "green", |
|
date: "magenta", |
|
regexp: "red" |
|
}, c.isArray = o, c.isBoolean = p, c.isNull = q, c.isNullOrUndefined = r, c.isNumber = s, |
|
c.isString = t, c.isSymbol = u, c.isUndefined = v, c.isRegExp = w, c.isObject = x, |
|
c.isDate = y, c.isError = z, c.isFunction = A, c.isPrimitive = B, c.isBuffer = a("./support/isBuffer"); |
|
c.log = function() {}, c.inherits = a("inherits"), c._extend = function(a, b) { |
|
if (!b || !x(b)) return a; |
|
for (var c = Object.keys(b), d = c.length; d--; ) a[c[d]] = b[c[d]]; |
|
return a; |
|
}; |
|
}).call(this, a("_process"), "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}); |
|
}, { |
|
"./support/isBuffer": 111, |
|
_process: 110, |
|
inherits: 109 |
|
} ], |
|
113: [ function(a) { |
|
var b = []; |
|
self.onmessage = function(c) { |
|
if ("launch" == c.data.type) { |
|
switch (c.data.name) { |
|
case "main": |
|
a("../.engine/main.js"); |
|
break; |
|
|
|
case "runner": |
|
a("../.engine/runner.js"); |
|
break; |
|
|
|
case "processor": |
|
a("../.engine/processor/processor.js"); |
|
break; |
|
|
|
case "runtime": |
|
a("../.engine/core/runtime.js"); |
|
} |
|
b.forEach(function(a) { |
|
self.onmessage(a); |
|
}); |
|
} else b.push(c); |
|
}; |
|
}, { |
|
"../.engine/core/runtime.js": 35, |
|
"../.engine/main.js": 52, |
|
"../.engine/processor/processor.js": 106, |
|
"../.engine/runner.js": 107 |
|
} ] |
|
}, {}, [ 113 ]); |